@cntrl-site/components 1.0.39-alpha.2 → 1.0.40-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/Form/FormComponent.d.ts +28 -3
- package/dist/Components/Grid/Grid.d.ts +1 -1
- package/dist/Components/Hive/HiveLightboxTitles.d.ts +1 -0
- package/dist/Components/LightboxJournal/LightboxJournalComponent.d.ts +3 -2
- package/dist/Components/LightboxStrip/LightboxStripComponent.d.ts +3 -2
- package/dist/Components/Marquee/MarqueeComponent.d.ts +4 -1
- package/dist/Components/OnelinerForm/OnelinerFormComponent.d.ts +24 -3
- package/dist/Components/TestimonialSingle/TestimonialSingleComponent.d.ts +0 -3
- package/dist/index.js +325 -147
- package/dist/index.mjs +6368 -5937
- 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"),it=require("classnames"),F=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Mi=require("react-dom");function Dl(e){return e.type==="object"&&e.version===1}const Vl="ControlSlider-module__wrapper___sHEkd",ql="ControlSlider-module__hoverArrow___A-dOH",Gl="ControlSlider-module__sliderItem___QQSkR",Kl="ControlSlider-module__sliderImage___9hRl-",Ul="ControlSlider-module__arrow___05ghY",Xl="ControlSlider-module__arrowVertical___tBfVN",Yl="ControlSlider-module__nextArrow___-30Yc",Jl="ControlSlider-module__arrowInner___aEra3",Zl="ControlSlider-module__arrowIcon___S4ztF",Ql="ControlSlider-module__arrowImg___2dwJW",ec="ControlSlider-module__mirror___brd6U",tc="ControlSlider-module__pagination___bicLF",nc="ControlSlider-module__paginationInner___bT-P-",ic="ControlSlider-module__paginationVertical___zYqKw",oc="ControlSlider-module__paginationItem___nTRbk",rc="ControlSlider-module__dot___p1Qun",ac="ControlSlider-module__activeDot___LHFaj",sc="ControlSlider-module__paginationInsideBottom___R3FWn",lc="ControlSlider-module__paginationInsideTop___V-qb-",cc="ControlSlider-module__paginationOutsideBottom___14w8D",dc="ControlSlider-module__paginationOutsideTop___SCLqB",uc="ControlSlider-module__paginationInsideLeft___yOBRZ",pc="ControlSlider-module__paginationInsideRight___Rtt3o",mc="ControlSlider-module__paginationOutsideLeft___lahaw",gc="ControlSlider-module__paginationOutsideRight___EtuQa",hc="ControlSlider-module__imgWrapper___UjEgB",fc="ControlSlider-module__captionBlock___dJ6-j",yc="ControlSlider-module__captionTextWrapper___HFlpf",vc="ControlSlider-module__captionText___uGBVc",xc="ControlSlider-module__active___WZK4G",bc="ControlSlider-module__withPointerEvents___t-18M",wc="ControlSlider-module__topLeftAlignment___zjnGM",Sc="ControlSlider-module__topCenterAlignment___gD1xW",$c="ControlSlider-module__topRightAlignment___NMapS",Cc="ControlSlider-module__middleLeftAlignment___OnUrY",Tc="ControlSlider-module__middleCenterAlignment___Tdkl0",Lc="ControlSlider-module__middleRightAlignment___wEbfX",Ic="ControlSlider-module__bottomLeftAlignment___cTP2-",Ec="ControlSlider-module__bottomCenterAlignment___c54fB",Rc="ControlSlider-module__bottomRightAlignment___kEwrz",Mc="ControlSlider-module__clickOverlay___DZA28",Pc="ControlSlider-module__contain___pLyq7",kc="ControlSlider-module__cover___KdDat",Oe={wrapper:Vl,hoverArrow:ql,sliderItem:Gl,sliderImage:Kl,arrow:Ul,arrowVertical:Xl,nextArrow:Yl,arrowInner:Jl,arrowIcon:Zl,arrowImg:Ql,mirror:ec,pagination:tc,paginationInner:nc,paginationVertical:ic,paginationItem:oc,dot:rc,activeDot:ac,paginationInsideBottom:sc,paginationInsideTop:lc,paginationOutsideBottom:cc,paginationOutsideTop:dc,paginationInsideLeft:uc,paginationInsideRight:pc,paginationOutsideLeft:mc,paginationOutsideRight:gc,imgWrapper:hc,captionBlock:fc,captionTextWrapper:yc,captionText:vc,active:xc,withPointerEvents:bc,topLeftAlignment:wc,topCenterAlignment:Sc,topRightAlignment:$c,middleLeftAlignment:Cc,middleCenterAlignment:Tc,middleRightAlignment:Lc,bottomLeftAlignment:Ic,bottomCenterAlignment:Ec,bottomRightAlignment:Rc,clickOverlay:Mc,contain:Pc,cover:kc};function Ac(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 Wc(e,t,n){return t&&Ac(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var $a="(prefers-reduced-motion: reduce)",hi=1,Fc=2,xi=3,Pi=4,io=5,ko=6,jo=7,_c={CREATED:hi,MOUNTED:Fc,IDLE:xi,MOVING:Pi,SCROLLING:io,DRAGGING:ko,DESTROYED:jo};function En(e){e.length=0}function zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function wt(e){return e.bind.apply(e,[null].concat(zn(arguments,1)))}var Ws=setTimeout,Pr=function(){};function Ca(e){return requestAnimationFrame(e)}function Ko(e,t){return typeof t===e}function Vi(e){return!Gr(e)&&Ko("object",e)}var qr=Array.isArray,Fs=wt(Ko,"function"),On=wt(Ko,"string"),oo=wt(Ko,"undefined");function Gr(e){return e===null}function _s(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function ro(e){return qr(e)?e:[e]}function on(e,t){ro(e).forEach(t)}function Kr(e,t){return e.indexOf(t)>-1}function Ao(e,t){return e.push.apply(e,ro(t)),e}function $n(e,t,n){e&&on(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function fn(e,t){$n(e,On(t)?t.split(" "):t,!0)}function ao(e,t){on(t,e.appendChild.bind(e))}function Ur(e,t){on(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function qi(e,t){return _s(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Ns(e,t){var n=e?zn(e.children):[];return t?n.filter(function(i){return qi(i,t)}):n}function so(e,t){return t?Ns(e,t)[0]:e.firstElementChild}var Gi=Object.keys;function ii(e,t,n){return e&&(n?Gi(e).reverse():Gi(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Ki(e){return zn(arguments,1).forEach(function(t){ii(t,function(n,i){e[i]=t[i]})}),e}function Fn(e){return zn(arguments,1).forEach(function(t){ii(t,function(n,i){qr(n)?e[i]=n.slice():Vi(n)?e[i]=Fn({},Vi(e[i])?e[i]:{},n):e[i]=n})}),e}function Ta(e,t){on(t||Gi(e),function(n){delete e[n]})}function yn(e,t){on(e,function(n){on(t,function(i){n&&n.removeAttribute(i)})})}function nt(e,t,n){Vi(t)?ii(t,function(i,o){nt(e,o,i)}):on(e,function(i){Gr(n)||n===""?yn(i,t):i.setAttribute(t,String(n))})}function fi(e,t,n){var i=document.createElement(e);return t&&(On(t)?fn(i,t):nt(i,t)),n&&ao(n,i),i}function un(e,t,n){if(oo(n))return getComputedStyle(e)[t];Gr(n)||(e.style[t]=""+n)}function Ui(e,t){un(e,"display",t)}function Hs(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function pn(e,t){return e.getAttribute(t)}function La(e,t){return e&&e.classList.contains(t)}function Jt(e){return e.getBoundingClientRect()}function oi(e){on(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Os(e){return so(new DOMParser().parseFromString(e,"text/html").body)}function Sn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function js(e,t){return e&&e.querySelector(t)}function Xr(e,t){return t?zn(e.querySelectorAll(t)):[]}function Cn(e,t){$n(e,t,!1)}function kr(e){return e.timeStamp}function Un(e){return On(e)?e:e?e+"px":""}var lo="splide",Yr="data-"+lo;function Oi(e,t){if(!e)throw new Error("["+lo+"] "+(t||""))}var jn=Math.min,Bo=Math.max,zo=Math.floor,Xi=Math.ceil,Gt=Math.abs;function Bs(e,t,n){return Gt(e-t)<n}function Wo(e,t,n,i){var o=jn(t,n),l=Bo(t,n);return i?o<e&&e<l:o<=e&&e<=l}function pi(e,t,n){var i=jn(t,n),o=Bo(t,n);return jn(Bo(i,e),o)}function Ar(e){return+(e>0)-+(e<0)}function Wr(e,t){return on(t,function(n){e=e.replace("%s",""+n)}),e}function Jr(e){return e<10?"0"+e:""+e}var Ia={};function Nc(e){return""+e+Jr(Ia[e]=(Ia[e]||0)+1)}function zs(){var e=[];function t(s,d,c,u){o(s,d,function(m,y,E){var T="addEventListener"in m,h=T?m.removeEventListener.bind(m,y,c,u):m.removeListener.bind(m,c);T?m.addEventListener(y,c,u):m.addListener(c),e.push([m,y,E,c,h])})}function n(s,d,c){o(s,d,function(u,m,y){e=e.filter(function(E){return E[0]===u&&E[1]===m&&E[2]===y&&(!c||E[3]===c)?(E[4](),!1):!0})})}function i(s,d,c){var u,m=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:m,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,m,!1,c)),s.dispatchEvent(u),u}function o(s,d,c){on(s,function(u){u&&on(d,function(m){m.split(" ").forEach(function(y){var E=y.split(".");c(u,E[0],E[1])})})})}function l(){e.forEach(function(s){s[4]()}),En(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Dn="mounted",Fr="ready",Rn="move",ki="moved",Zr="click",Ds="active",Vs="inactive",qs="visible",Gs="hidden",At="refresh",Vt="updated",bi="resize",Uo="resized",Ks="drag",Us="dragging",Xs="dragged",Xo="scroll",si="scrolled",Hc="overflow",Qr="destroy",Ys="arrows:mounted",Js="arrows:updated",Zs="pagination:mounted",Qs="pagination:updated",ea="navigation:mounted",ta="autoplay:play",el="autoplay:playing",na="autoplay:pause",ia="lazyload:loaded",tl="sk",nl="sh",Do="ei";function Lt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=zs();function i(l,s){n.bind(t,ro(l).join(" "),function(d){s.apply(s,qr(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,zn(arguments,1))}return e&&e.event.on(Qr,n.destroy),Ki(n,{bus:t,on:i,off:wt(n.unbind,t),emit:o})}function Yo(e,t,n,i){var o=Date.now,l,s=0,d,c=!0,u=0;function m(){if(!c){if(s=e?jn((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++u>=i))return E();d=Ca(m)}}function y(L){L||h(),l=o()-(L?s*e:0),c=!1,d=Ca(m)}function E(){c=!0}function T(){l=o(),s=0,n&&n(s)}function h(){d&&cancelAnimationFrame(d),s=0,d=0,c=!0}function v(L){e=L}function I(){return c}return{start:y,rewind:T,pause:E,cancel:h,set:v,isPaused:I}}function Oc(e){var t=e;function n(o){t=o}function i(o){return Kr(ro(o),t)}return{set:n,is:i}}function jc(e,t){var n=Yo(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Bc(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=zs(),d=[];function c(){var h=n.mediaQuery==="min";Gi(o).sort(function(v,I){return h?+v-+I:+I-+v}).forEach(function(v){m(o[v],"("+(h?"min":"max")+"-width:"+v+"px)")}),m(l,$a),y()}function u(h){h&&s.destroy()}function m(h,v){var I=matchMedia(v);s.bind(I,"change",y),d.push([h,I])}function y(){var h=i.is(jo),v=n.direction,I=d.reduce(function(L,R){return Fn(L,R[1].matches?R[0]:{})},{});Ta(n),T(I),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):v!==n.direction&&e.refresh()}function E(h){matchMedia($a).matches&&(h?Fn(n,l):Ta(n,Gi(l)))}function T(h,v,I){Fn(n,h),v&&Fn(Object.getPrototypeOf(n),h),(I||!i.is(hi))&&e.emit(Vt,n)}return{setup:c,destroy:u,reduce:E,set:T}}var Jo="Arrow",Zo=Jo+"Left",Qo=Jo+"Right",il=Jo+"Up",ol=Jo+"Down",Ea="rtl",er="ttb",gr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[il,Qo],ArrowRight:[ol,Zo]};function zc(e,t,n){function i(l,s,d){d=d||n.direction;var c=d===Ea&&!s?1:d===er?0:-1;return gr[l]&&gr[l][c]||l.replace(/width|left|right/i,function(u,m){var y=gr[u.toLowerCase()][c]||u;return m>0?y.charAt(0).toUpperCase()+y.slice(1):y})}function o(l){return l*(n.direction===Ea?1:-1)}return{resolve:i,orient:o}}var Tn="role",yi="tabindex",Dc="disabled",mn="aria-",co=mn+"controls",rl=mn+"current",Ra=mn+"selected",Qt=mn+"label",oa=mn+"labelledby",al=mn+"hidden",ra=mn+"orientation",Yi=mn+"roledescription",Ma=mn+"live",Pa=mn+"busy",ka=mn+"atomic",aa=[Tn,yi,Dc,co,rl,Qt,oa,al,ra,Yi],vn=lo+"__",Vn="is-",hr=lo,Aa=vn+"track",Vc=vn+"list",tr=vn+"slide",sl=tr+"--clone",qc=tr+"__container",sa=vn+"arrows",nr=vn+"arrow",ll=nr+"--prev",cl=nr+"--next",ir=vn+"pagination",dl=ir+"__page",Gc=vn+"progress",Kc=Gc+"__bar",Uc=vn+"toggle",Xc=vn+"spinner",Yc=vn+"sr",Jc=Vn+"initialized",ri=Vn+"active",ul=Vn+"prev",pl=Vn+"next",_r=Vn+"visible",Nr=Vn+"loading",ml=Vn+"focus-in",gl=Vn+"overflow",Zc=[ri,_r,ul,pl,Nr,ml,gl],Qc={slide:tr,clone:sl,arrows:sa,arrow:nr,prev:ll,next:cl,pagination:ir,page:dl,spinner:Xc};function ed(e,t){if(Fs(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!qi(n,t);)n=n.parentElement;return n}var td=5,Wa=200,hl="touchstart mousedown",fr="touchmove mousemove",yr="touchend touchcancel mouseup click";function nd(e,t,n){var i=Lt(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,c={},u=[],m=[],y=[],E,T,h;function v(){P(),O(),R()}function I(){o(At,L),o(At,v),o(Vt,R),l(document,hl+" keydown",function(k){h=k.type==="keydown"},{capture:!0}),l(s,"focusin",function(){$n(s,ml,!!h)})}function L(k){var $=aa.concat("style");En(u),Cn(s,m),Cn(E,y),yn([E,T],$),yn(s,k?$:["style",Yi])}function R(){Cn(s,m),Cn(E,y),m=N(hr),y=N(Aa),fn(s,m),fn(E,y),nt(s,Qt,n.label),nt(s,oa,n.labelledby)}function P(){E=x("."+Aa),T=so(E,"."+Vc),Oi(E&&T,"A track/list element is missing."),Ao(u,Ns(T,"."+tr+":not(."+sl+")")),ii({arrows:sa,pagination:ir,prev:ll,next:cl,bar:Kc,toggle:Uc},function(k,$){c[$]=x("."+k)}),Ki(c,{root:s,track:E,list:T,slides:u})}function O(){var k=s.id||Nc(lo),$=n.role;s.id=k,E.id=E.id||k+"-track",T.id=T.id||k+"-list",!pn(s,Tn)&&s.tagName!=="SECTION"&&$&&nt(s,Tn,$),nt(s,Yi,d.carousel),nt(T,Tn,"presentation")}function x(k){var $=js(s,k);return $&&ed($,"."+hr)===s?$:void 0}function N(k){return[k+"--"+n.type,k+"--"+n.direction,n.drag&&k+"--draggable",n.isNavigation&&k+"--nav",k===hr&&ri]}return Ki(c,{setup:v,mount:I,destroy:L})}var wi="slide",Ai="loop",uo="fade";function id(e,t,n,i){var o=Lt(e),l=o.on,s=o.emit,d=o.bind,c=e.Components,u=e.root,m=e.options,y=m.isNavigation,E=m.updateOnMove,T=m.i18n,h=m.pagination,v=m.slideFocus,I=c.Direction.resolve,L=pn(i,"style"),R=pn(i,Qt),P=n>-1,O=so(i,"."+qc),x;function N(){P||(i.id=u.id+"-slide"+Jr(t+1),nt(i,Tn,h?"tabpanel":"group"),nt(i,Yi,T.slide),nt(i,Qt,R||Wr(T.slideLabel,[t+1,e.length]))),k()}function k(){d(i,"click",wt(s,Zr,H)),d(i,"keydown",wt(s,tl,H)),l([ki,nl,si],M),l(ea,q),E&&l(Rn,f)}function $(){x=!0,o.destroy(),Cn(i,Zc),yn(i,aa),nt(i,"style",L),nt(i,Qt,R||"")}function q(){var W=e.splides.map(function(S){var K=S.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");nt(i,Qt,Wr(T.slideX,(P?n:t)+1)),nt(i,co,W),nt(i,Tn,v?"button":""),v&&yn(i,Yi)}function f(){x||M()}function M(){if(!x){var W=e.index;_(),j(),$n(i,ul,t===W-1),$n(i,pl,t===W+1)}}function _(){var W=ie();W!==La(i,ri)&&($n(i,ri,W),nt(i,rl,y&&W||""),s(W?Ds:Vs,H))}function j(){var W=G(),S=!W&&(!ie()||P);if(e.state.is([Pi,io])||nt(i,al,S||""),nt(Xr(i,m.focusableNodes||""),yi,S?-1:""),v&&nt(i,yi,S?-1:0),W!==La(i,_r)&&($n(i,_r,W),s(W?qs:Gs,H)),!W&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&Hs(K.slide)}}function te(W,S,K){un(K&&O||i,W,S)}function ie(){var W=e.index;return W===t||m.cloneStatus&&W===n}function G(){if(e.is(uo))return ie();var W=Jt(c.Elements.track),S=Jt(i),K=I("left",!0),J=I("right",!0);return zo(W[K])<=Xi(S[K])&&zo(S[J])<=Xi(W[J])}function z(W,S){var K=Gt(W-t);return!P&&(m.rewind||e.is(Ai))&&(K=jn(K,e.length-K)),K<=S}var H={index:t,slideIndex:n,slide:i,container:O,isClone:P,mount:N,destroy:$,update:M,style:te,isWithin:z};return H}function od(e,t,n){var i=Lt(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,c=d.slides,u=d.list,m=[];function y(){E(),o(At,T),o(At,E)}function E(){c.forEach(function(M,_){v(M,_,-1)})}function T(){x(function(M){M.destroy()}),En(m)}function h(){x(function(M){M.update()})}function v(M,_,j){var te=id(e,_,j,M);te.mount(),m.push(te),m.sort(function(ie,G){return ie.index-G.index})}function I(M){return M?N(function(_){return!_.isClone}):m}function L(M){var _=t.Controller,j=_.toIndex(M),te=_.hasFocus()?1:n.perPage;return N(function(ie){return Wo(ie.index,j,j+te-1)})}function R(M){return N(M)[0]}function P(M,_){on(M,function(j){if(On(j)&&(j=Os(j)),_s(j)){var te=c[_];te?Ur(j,te):ao(u,j),fn(j,n.classes.slide),$(j,wt(l,bi))}}),l(At)}function O(M){oi(N(M).map(function(_){return _.slide})),l(At)}function x(M,_){I(_).forEach(M)}function N(M){return m.filter(Fs(M)?M:function(_){return On(M)?qi(_.slide,M):Kr(ro(M),_.index)})}function k(M,_,j){x(function(te){te.style(M,_,j)})}function $(M,_){var j=Xr(M,"img"),te=j.length;te?j.forEach(function(ie){s(ie,"load error",function(){--te||_()})}):_()}function q(M){return M?c.length:m.length}function f(){return m.length>n.perPage}return{mount:y,destroy:T,update:h,register:v,get:I,getIn:L,getAt:R,add:P,remove:O,forEach:x,filter:N,style:k,getLength:q,isEnough:f}}function rd(e,t,n){var i=Lt(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,m=u.root,y=u.track,E=u.list,T=d.getAt,h=d.style,v,I,L;function R(){P(),l(window,"resize load",jc(wt(s,bi))),o([Vt,At],P),o(bi,O)}function P(){v=n.direction===er,un(m,"maxWidth",Un(n.width)),un(y,c("paddingLeft"),x(!1)),un(y,c("paddingRight"),x(!0)),O(!0)}function O(H){var W=Jt(m);(H||I.width!==W.width||I.height!==W.height)&&(un(y,"height",N()),h(c("marginRight"),Un(n.gap)),h("width",$()),h("height",q(),!0),I=W,s(Uo),L!==(L=z())&&($n(m,gl,L),s(Hc,L)))}function x(H){var W=n.padding,S=c(H?"right":"left");return W&&Un(W[S]||(Vi(W)?0:W))||"0px"}function N(){var H="";return v&&(H=k(),Oi(H,"height or heightRatio is missing."),H="calc("+H+" - "+x(!1)+" - "+x(!0)+")"),H}function k(){return Un(n.height||Jt(E).width*n.heightRatio)}function $(){return n.autoWidth?null:Un(n.fixedWidth)||(v?"":f())}function q(){return Un(n.fixedHeight)||(v?n.autoHeight?null:f():k())}function f(){var H=Un(n.gap);return"calc((100%"+(H&&" + "+H)+")/"+(n.perPage||1)+(H&&" - "+H)+")"}function M(){return Jt(E)[c("width")]}function _(H,W){var S=T(H||0);return S?Jt(S.slide)[c("width")]+(W?0:ie()):0}function j(H,W){var S=T(H);if(S){var K=Jt(S.slide)[c("right")],J=Jt(E)[c("left")];return Gt(K-J)+(W?0:ie())}return 0}function te(H){return j(e.length-1)-j(0)+_(0,H)}function ie(){var H=T(0);return H&&parseFloat(un(H.slide,c("marginRight")))||0}function G(H){return parseFloat(un(y,c("padding"+(H?"Right":"Left"))))||0}function z(){return e.is(uo)||te(!0)>M()}return{mount:R,resize:O,listSize:M,slideSize:_,sliderSize:te,totalSize:j,getPadding:G,isOverflow:z}}var ad=2;function sd(e,t,n){var i=Lt(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,c=[],u;function m(){o(At,y),o([Vt,bi],T),(u=I())&&(h(u),t.Layout.resize(!0))}function y(){E(),m()}function E(){oi(c),En(c),i.destroy()}function T(){var L=I();u!==L&&(u<L||!L)&&i.emit(At)}function h(L){var R=s.get().slice(),P=R.length;if(P){for(;R.length<L;)Ao(R,R);Ao(R.slice(-L),R.slice(0,L)).forEach(function(O,x){var N=x<L,k=v(O.slide,x);N?Ur(k,R[0].slide):ao(l.list,k),Ao(c,k),s.register(k,x-L+(N?0:P),O.index)})}}function v(L,R){var P=L.cloneNode(!0);return fn(P,n.classes.clone),P.id=e.root.id+"-clone"+Jr(R+1),P}function I(){var L=n.clones;if(!e.is(Ai))L=0;else if(oo(L)){var R=n[d("fixedWidth")]&&t.Layout.slideSize(0),P=R&&Xi(Jt(l.track)[d("width")]/R);L=P||n[d("autoWidth")]&&e.length||n.perPage*ad}return L}return{mount:m,destroy:E}}function ld(e,t,n){var i=Lt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,m=d.totalSize,y=d.listSize,E=d.sliderSize,T=t.Direction,h=T.resolve,v=T.orient,I=t.Elements,L=I.list,R=I.track,P;function O(){P=t.Transition,o([Dn,Uo,Vt,At],x)}function x(){t.Controller.isBusy()||(t.Scroll.cancel(),k(e.index),t.Slides.update())}function N(S,K,J,Q){S!==K&&H(S>J)&&(M(),$(f(te(),S>J),!0)),s(Pi),l(Rn,K,J,S),P.start(K,function(){s(xi),l(ki,K,J,S),Q&&Q()})}function k(S){$(j(S,!0))}function $(S,K){if(!e.is(uo)){var J=K?S:q(S);un(L,"transform","translate"+h("X")+"("+J+"px)"),S!==J&&l(nl)}}function q(S){if(e.is(Ai)){var K=_(S),J=K>t.Controller.getEnd(),Q=K<0;(Q||J)&&(S=f(S,J))}return S}function f(S,K){var J=S-z(K),Q=E();return S-=v(Q*(Xi(Gt(J)/Q)||1))*(K?1:-1),S}function M(){$(te(),!0),P.cancel()}function _(S){for(var K=t.Slides.get(),J=0,Q=1/0,D=0;D<K.length;D++){var ue=K[D].index,g=Gt(j(ue,!0)-S);if(g<=Q)Q=g,J=ue;else break}return J}function j(S,K){var J=v(m(S-1)-G(S));return K?ie(J):J}function te(){var S=h("left");return Jt(L)[S]-Jt(R)[S]+v(u(!1))}function ie(S){return n.trimSpace&&e.is(wi)&&(S=pi(S,0,v(E(!0)-y()))),S}function G(S){var K=n.focus;return K==="center"?(y()-c(S,!0))/2:+K*c(S)||0}function z(S){return j(S?t.Controller.getEnd():0,!!n.trimSpace)}function H(S){var K=v(f(te(),S));return S?K>=0:K<=L[h("scrollWidth")]-Jt(R)[h("width")]}function W(S,K){K=oo(K)?te():K;var J=S!==!0&&v(K)<v(z(!1)),Q=S!==!1&&v(K)>v(z(!0));return J||Q}return{mount:O,move:N,jump:k,translate:$,shift:f,cancel:M,toIndex:_,toPosition:j,getPosition:te,getLimit:z,exceededLimit:W,reposition:x}}function cd(e,t,n){var i=Lt(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,c=s.getLimit,u=s.toPosition,m=t.Slides,y=m.isEnough,E=m.getLength,T=n.omitEnd,h=e.is(Ai),v=e.is(wi),I=wt(te,!1),L=wt(te,!0),R=n.start||0,P,O=R,x,N,k;function $(){q(),o([Vt,At,Do],q),o(Uo,f)}function q(){x=E(!0),N=n.perMove,k=n.perPage,P=H();var g=pi(R,0,T?P:x-1);g!==R&&(R=g,s.reposition())}function f(){P!==H()&&l(Do)}function M(g,pe,fe){if(!ue()){var ve=j(g),Ne=z(ve);Ne>-1&&(pe||Ne!==R)&&(J(Ne),s.move(ve,Ne,O,fe))}}function _(g,pe,fe,ve){t.Scroll.scroll(g,pe,fe,function(){var Ne=z(s.toIndex(d()));J(T?jn(Ne,P):Ne),ve&&ve()})}function j(g){var pe=R;if(On(g)){var fe=g.match(/([+\-<>])(\d+)?/)||[],ve=fe[1],Ne=fe[2];ve==="+"||ve==="-"?pe=ie(R+ +(""+ve+(+Ne||1)),R):ve===">"?pe=Ne?W(+Ne):I(!0):ve==="<"&&(pe=L(!0))}else pe=h?g:pi(g,0,P);return pe}function te(g,pe){var fe=N||(D()?1:k),ve=ie(R+fe*(g?-1:1),R,!(N||D()));return ve===-1&&v&&!Bs(d(),c(!g),1)?g?0:P:pe?ve:z(ve)}function ie(g,pe,fe){if(y()||D()){var ve=G(g);ve!==g&&(pe=g,g=ve,fe=!1),g<0||g>P?!N&&(Wo(0,g,pe,!0)||Wo(P,pe,g,!0))?g=W(S(g)):h?g=fe?g<0?-(x%k||k):x:g:n.rewind?g=g<0?P:0:g=-1:fe&&g!==pe&&(g=W(S(pe)+(g<pe?-1:1)))}else g=-1;return g}function G(g){if(v&&n.trimSpace==="move"&&g!==R)for(var pe=d();pe===u(g,!0)&&Wo(g,0,e.length-1,!n.rewind);)g<R?--g:++g;return g}function z(g){return h?(g+x)%x||0:g}function H(){for(var g=x-(D()||h&&N?1:k);T&&g-- >0;)if(u(x-1,!0)!==u(g,!0)){g++;break}return pi(g,0,x-1)}function W(g){return pi(D()?g:k*g,0,P)}function S(g){return D()?jn(g,P):zo((g>=P?x-1:g)/k)}function K(g){var pe=s.toIndex(g);return v?pi(pe,0,P):pe}function J(g){g!==R&&(O=R,R=g)}function Q(g){return g?O:R}function D(){return!oo(n.focus)||n.isNavigation}function ue(){return e.state.is([Pi,io])&&!!n.waitForTransition}return{mount:$,go:M,scroll:_,getNext:I,getPrev:L,getAdjacent:te,getEnd:H,setIndex:J,getIndex:Q,toIndex:W,toPage:S,toDest:K,hasFocus:D,isBusy:ue}}var dd="http://www.w3.org/2000/svg",ud="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",vo=40;function pd(e,t,n){var i=Lt(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,c=n.i18n,u=t.Elements,m=t.Controller,y=u.arrows,E=u.track,T=y,h=u.prev,v=u.next,I,L,R={};function P(){x(),o(Vt,O)}function O(){N(),P()}function x(){var _=n.arrows;_&&!(h&&v)&&q(),h&&v&&(Ki(R,{prev:h,next:v}),Ui(T,_?"":"none"),fn(T,L=sa+"--"+n.direction),_&&(k(),M(),nt([h,v],co,E.id),s(Ys,h,v)))}function N(){i.destroy(),Cn(T,L),I?(oi(y?[h,v]:T),h=v=null):yn([h,v],aa)}function k(){o([Dn,ki,At,si,Do],M),l(v,"click",wt($,">")),l(h,"click",wt($,"<"))}function $(_){m.go(_,!0)}function q(){T=y||fi("div",d.arrows),h=f(!0),v=f(!1),I=!0,ao(T,[h,v]),!y&&Ur(T,E)}function f(_){var j='<button class="'+d.arrow+" "+(_?d.prev:d.next)+'" type="button"><svg xmlns="'+dd+'" viewBox="0 0 '+vo+" "+vo+'" width="'+vo+'" height="'+vo+'" focusable="false"><path d="'+(n.arrowPath||ud)+'" />';return Os(j)}function M(){if(h&&v){var _=e.index,j=m.getPrev(),te=m.getNext(),ie=j>-1&&_<j?c.last:c.prev,G=te>-1&&_>te?c.first:c.next;h.disabled=j<0,v.disabled=te<0,nt(h,Qt,ie),nt(v,Qt,G),s(Js,h,v,j,te)}}return{arrows:R,mount:P,destroy:N,update:M}}var md=Yr+"-interval";function gd(e,t,n){var i=Lt(e),o=i.on,l=i.bind,s=i.emit,d=Yo(n.interval,e.go.bind(e,">"),k),c=d.isPaused,u=t.Elements,m=t.Elements,y=m.root,E=m.toggle,T=n.autoplay,h,v,I=T==="pause";function L(){T&&(R(),E&&nt(E,co,u.track.id),I||P(),N())}function R(){n.pauseOnHover&&l(y,"mouseenter mouseleave",function(q){h=q.type==="mouseenter",x()}),n.pauseOnFocus&&l(y,"focusin focusout",function(q){v=q.type==="focusin",x()}),E&&l(E,"click",function(){I?P():O(!0)}),o([Rn,Xo,At],d.rewind),o(Rn,$)}function P(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),v=h=I=!1,N(),s(ta))}function O(q){q===void 0&&(q=!0),I=!!q,N(),c()||(d.pause(),s(na))}function x(){I||(h||v?O(!1):P())}function N(){E&&($n(E,ri,!I),nt(E,Qt,n.i18n[I?"play":"pause"]))}function k(q){var f=u.bar;f&&un(f,"width",q*100+"%"),s(el,q)}function $(q){var f=t.Slides.getAt(q);d.set(f&&+pn(f.slide,md)||n.interval)}return{mount:L,destroy:d.cancel,play:P,pause:O,isPaused:c}}function hd(e,t,n){var i=Lt(e),o=i.on;function l(){n.cover&&(o(ia,wt(d,!0)),o([Dn,Vt,At],wt(s,!0)))}function s(c){t.Slides.forEach(function(u){var m=so(u.container||u.slide,"img");m&&m.src&&d(c,m,u)})}function d(c,u,m){m.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),Ui(u,c?"none":"")}return{mount:l,destroy:wt(s,!1)}}var fd=10,yd=600,vd=.6,xd=1.5,bd=800;function wd(e,t,n){var i=Lt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,m=d.exceededLimit,y=d.translate,E=e.is(wi),T,h,v=1;function I(){o(Rn,O),o([Vt,At],x)}function L(k,$,q,f,M){var _=c();if(O(),q&&(!E||!m())){var j=t.Layout.sliderSize(),te=Ar(k)*j*zo(Gt(k)/j)||0;k=d.toPosition(t.Controller.toDest(k%j))+te}var ie=Bs(_,k,1);v=1,$=ie?0:$||Bo(Gt(k-_)/xd,bd),h=f,T=Yo($,R,wt(P,_,k,M),1),s(io),l(Xo),T.start()}function R(){s(xi),h&&h(),l(si)}function P(k,$,q,f){var M=c(),_=k+($-k)*N(f),j=(_-M)*v;y(M+j),E&&!q&&m()&&(v*=vd,Gt(j)<fd&&L(u(m(!0)),yd,!1,h,!0))}function O(){T&&T.cancel()}function x(){T&&!T.isPaused()&&(O(),R())}function N(k){var $=n.easingFunc;return $?$(k):1-Math.pow(1-k,4)}return{mount:I,destroy:O,scroll:L,cancel:x}}var mi={passive:!1,capture:!0};function Sd(e,t,n){var i=Lt(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,c=e.state,u=t.Move,m=t.Scroll,y=t.Controller,E=t.Elements.track,T=t.Media.reduce,h=t.Direction,v=h.resolve,I=h.orient,L=u.getPosition,R=u.exceededLimit,P,O,x,N,k,$=!1,q,f,M;function _(){s(E,fr,Pr,mi),s(E,yr,Pr,mi),s(E,hl,te,mi),s(E,"click",z,{capture:!0}),s(E,"dragstart",Sn),o([Dn,Vt],j)}function j(){var ee=n.drag;ge(!ee),N=ee==="free"}function te(ee){if(q=!1,!f){var be=Ne(ee);ve(ee.target)&&(be||!ee.button)&&(y.isBusy()?Sn(ee,!0):(M=be?E:window,k=c.is([Pi,io]),x=null,s(M,fr,ie,mi),s(M,yr,G,mi),u.cancel(),m.cancel(),H(ee)))}}function ie(ee){if(c.is(ko)||(c.set(ko),l(Ks)),ee.cancelable)if(k){u.translate(P+fe(D(ee)));var be=ue(ee)>Wa,ce=$!==($=R());(be||ce)&&H(ee),q=!0,l(Us),Sn(ee)}else K(ee)&&(k=S(ee),Sn(ee))}function G(ee){c.is(ko)&&(c.set(xi),l(Xs)),k&&(W(ee),Sn(ee)),d(M,fr,ie),d(M,yr,G),k=!1}function z(ee){!f&&q&&Sn(ee,!0)}function H(ee){x=O,O=ee,P=L()}function W(ee){var be=J(ee),ce=Q(be),oe=n.rewind&&n.rewindByDrag;T(!1),N?y.scroll(ce,0,n.snap):e.is(uo)?y.go(I(Ar(be))<0?oe?"<":"-":oe?">":"+"):e.is(wi)&&$&&oe?y.go(R(!0)?">":"<"):y.go(y.toDest(ce),!0),T(!0)}function S(ee){var be=n.dragMinThreshold,ce=Vi(be),oe=ce&&be.mouse||0,Z=(ce?be.touch:+be)||10;return Gt(D(ee))>(Ne(ee)?Z:oe)}function K(ee){return Gt(D(ee))>Gt(D(ee,!0))}function J(ee){if(e.is(Ai)||!$){var be=ue(ee);if(be&&be<Wa)return D(ee)/be}return 0}function Q(ee){return L()+Ar(ee)*jn(Gt(ee)*(n.flickPower||600),N?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function D(ee,be){return pe(ee,be)-pe(g(ee),be)}function ue(ee){return kr(ee)-kr(g(ee))}function g(ee){return O===ee&&x||O}function pe(ee,be){return(Ne(ee)?ee.changedTouches[0]:ee)["page"+v(be?"Y":"X")]}function fe(ee){return ee/($&&e.is(wi)?td:1)}function ve(ee){var be=n.noDrag;return!qi(ee,"."+dl+", ."+nr)&&(!be||!qi(ee,be))}function Ne(ee){return typeof TouchEvent<"u"&&ee instanceof TouchEvent}function ne(){return k}function ge(ee){f=ee}return{mount:_,disable:ge,isDragging:ne}}var $d={Spacebar:" ",Right:Qo,Left:Zo,Up:il,Down:ol};function la(e){return e=On(e)?e:e.key,$d[e]||e}var Fa="keydown";function Cd(e,t,n){var i=Lt(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,c=t.Direction.resolve,u,m;function y(){E(),o(Vt,T),o(Vt,E),o(Rn,v)}function E(){var L=n.keyboard;L&&(u=L==="global"?window:d,l(u,Fa,I))}function T(){s(u,Fa)}function h(L){m=L}function v(){var L=m;m=!0,Ws(function(){m=L})}function I(L){if(!m){var R=la(L);R===c(Zo)?e.go("<"):R===c(Qo)&&e.go(">")}}return{mount:y,destroy:T,disable:h}}var ji=Yr+"-lazy",Fo=ji+"-srcset",Td="["+ji+"], ["+Fo+"]";function Ld(e,t,n){var i=Lt(e),o=i.on,l=i.off,s=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[ki,si],m=[];function y(){n.lazyLoad&&(E(),o(At,E))}function E(){En(m),T(),c?L():(l(u),o(u,h),h())}function T(){t.Slides.forEach(function(R){Xr(R.slide,Td).forEach(function(P){var O=pn(P,ji),x=pn(P,Fo);if(O!==P.src||x!==P.srcset){var N=n.classes.spinner,k=P.parentElement,$=so(k,"."+N)||fi("span",N,k);m.push([P,R,$]),P.src||Ui(P,"none")}})})}function h(){m=m.filter(function(R){var P=n.perPage*((n.preloadPages||1)+1)-1;return R[1].isWithin(e.index,P)?v(R):!0}),m.length||l(u)}function v(R){var P=R[0];fn(R[1].slide,Nr),s(P,"load error",wt(I,R)),nt(P,"src",pn(P,ji)),nt(P,"srcset",pn(P,Fo)),yn(P,ji),yn(P,Fo)}function I(R,P){var O=R[0],x=R[1];Cn(x.slide,Nr),P.type!=="error"&&(oi(R[2]),Ui(O,""),d(ia,O,x),d(bi)),c&&L()}function L(){m.length&&v(m.shift())}return{mount:y,destroy:wt(En,m),check:h}}function Id(e,t,n){var i=Lt(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,m=u.hasFocus,y=u.getIndex,E=u.go,T=t.Direction.resolve,h=c.pagination,v=[],I,L;function R(){P(),o([Vt,At,Do],R);var f=n.pagination;h&&Ui(h,f?"":"none"),f&&(o([Rn,Xo,si],q),O(),q(),l(Zs,{list:I,items:v},$(e.index)))}function P(){I&&(oi(h?zn(I.children):I),Cn(I,L),En(v),I=null),i.destroy()}function O(){var f=e.length,M=n.classes,_=n.i18n,j=n.perPage,te=m()?u.getEnd()+1:Xi(f/j);I=h||fi("ul",M.pagination,c.track.parentElement),fn(I,L=ir+"--"+k()),nt(I,Tn,"tablist"),nt(I,Qt,_.select),nt(I,ra,k()===er?"vertical":"");for(var ie=0;ie<te;ie++){var G=fi("li",null,I),z=fi("button",{class:M.page,type:"button"},G),H=d.getIn(ie).map(function(S){return S.slide.id}),W=!m()&&j>1?_.pageX:_.slideX;s(z,"click",wt(x,ie)),n.paginationKeyboard&&s(z,"keydown",wt(N,ie)),nt(G,Tn,"presentation"),nt(z,Tn,"tab"),nt(z,co,H.join(" ")),nt(z,Qt,Wr(W,ie+1)),nt(z,yi,-1),v.push({li:G,button:z,page:ie})}}function x(f){E(">"+f,!0)}function N(f,M){var _=v.length,j=la(M),te=k(),ie=-1;j===T(Qo,!1,te)?ie=++f%_:j===T(Zo,!1,te)?ie=(--f+_)%_:j==="Home"?ie=0:j==="End"&&(ie=_-1);var G=v[ie];G&&(Hs(G.button),E(">"+ie),Sn(M,!0))}function k(){return n.paginationDirection||n.direction}function $(f){return v[u.toPage(f)]}function q(){var f=$(y(!0)),M=$(y());if(f){var _=f.button;Cn(_,ri),yn(_,Ra),nt(_,yi,-1)}if(M){var j=M.button;fn(j,ri),nt(j,Ra,!0),nt(j,yi,"")}l(Qs,{list:I,items:v},f,M)}return{items:v,mount:R,destroy:P,getAt:$,update:q}}var Ed=[" ","Enter"];function Rd(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&m()}function d(){l.forEach(function(h){h.destroy()}),En(l)}function c(){d(),s()}function u(h,v){var I=Lt(h);I.on(Rn,function(L,R,P){v.go(v.is(Ai)?P:L)}),l.push(I)}function m(){var h=Lt(e),v=h.on;v(Zr,E),v(tl,T),v([Dn,Vt],y),l.push(h),h.emit(ea,e.splides)}function y(){nt(t.Elements.list,ra,n.direction===er?"vertical":"")}function E(h){e.go(h.index)}function T(h,v){Kr(Ed,la(v))&&(E(h),Sn(v))}return{setup:wt(t.Media.set,{slideFocus:oo(o)?i:o},!0),mount:s,destroy:d,remount:c}}function Md(e,t,n){var i=Lt(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,mi)}function d(u){if(u.cancelable){var m=u.deltaY,y=m<0,E=kr(u),T=n.wheelMinThreshold||0,h=n.wheelSleep||0;Gt(m)>T&&E-l>h&&(e.go(y?"<":">"),l=E),c(y)&&Sn(u)}}function c(u){return!n.releaseWheel||e.state.is(Pi)||t.Controller.getAdjacent(u)!==-1}return{mount:s}}var Pd=90;function kd(e,t,n){var i=Lt(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=fi("span",Yc),c=Yo(Pd,wt(m,!1));function u(){s&&(E(!t.Autoplay.isPaused()),nt(l,ka,!0),d.textContent="…",o(ta,wt(E,!0)),o(na,wt(E,!1)),o([ki,si],wt(m,!0)))}function m(T){nt(l,Pa,T),T?(ao(l,d),c.start()):(oi(d),c.cancel())}function y(){yn(l,[Ma,ka,Pa]),oi(d)}function E(T){s&&nt(l,Ma,T?"off":"polite")}return{mount:u,disable:E,destroy:y}}var Ad=Object.freeze({__proto__:null,Media:Bc,Direction:zc,Elements:nd,Slides:od,Layout:rd,Clones:sd,Move:ld,Controller:cd,Arrows:pd,Autoplay:gd,Cover:hd,Scroll:wd,Drag:Sd,Keyboard:Cd,LazyLoad:Ld,Pagination:Id,Sync:Rd,Wheel:Md,Live:kd}),Wd={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"},Fd={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:Qc,i18n:Wd,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function _d(e,t,n){var i=t.Slides;function o(){Lt(e).on([Dn,At],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),Ws(c)}return{mount:o,start:s,cancel:Pr}}function Nd(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=wt(un,s,"transition"),c;function u(){Lt(e).bind(s,"transitionend",function(T){T.target===s&&c&&(y(),c())})}function m(T,h){var v=i.toPosition(T,!0),I=i.getPosition(),L=E(T);Gt(v-I)>=1&&L>=1?n.useScroll?l.scroll(v,L,!1,h):(d("transform "+L+"ms "+n.easing),i.translate(v,!0),c=h):(i.jump(T),h())}function y(){d(""),l.cancel()}function E(T){var h=n.rewindSpeed;if(e.is(wi)&&h){var v=o.getIndex(!0),I=o.getEnd();if(v===0&&T>=I||v>=I&&T===0)return h}return n.speed}return{mount:u,start:m,cancel:y}}var Hd=(function(){function e(n,i){this.event=Lt(),this.Components={},this.state=Oc(hi),this.splides=[],this._o={},this._E={};var o=On(n)?js(document,n):n;Oi(o,o+" is invalid."),this.root=o,i=Fn({label:pn(o,Qt)||"",labelledby:pn(o,oa)||""},Fd,e.defaults,i||{});try{Fn(i,JSON.parse(pn(o,Yr)))}catch{Oi(!1,"Invalid JSON")}this._o=Object.create(Fn({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;Oi(s.is([hi,jo]),"Already mounted!"),s.set(hi),this._C=d,this._T=o||this._T||(this.is(uo)?_d:Nd),this._E=i||this._E;var c=Ki({},Ad,this._E,{Transition:this._T});return ii(c,function(u,m){var y=u(l,d,l._o);d[m]=y,y.setup&&y.setup()}),ii(d,function(u){u.mount&&u.mount()}),this.emit(Dn),fn(this.root,Jc),s.set(xi),this.emit(Fr),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(xi)&&(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(At),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(hi)?Lt(this).on(Fr,this.destroy.bind(this,i)):(ii(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(Qr),o.destroy(),i&&En(this.splides),l.set(jo)),this},Wc(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})(),ca=Hd;ca.defaults={};ca.STATES=_c;var _a=[[Dn,"onMounted"],[Fr,"onReady"],[Rn,"onMove"],[ki,"onMoved"],[Zr,"onClick"],[Ds,"onActive"],[Vs,"onInactive"],[qs,"onVisible"],[Gs,"onHidden"],[At,"onRefresh"],[Vt,"onUpdated"],[bi,"onResize"],[Uo,"onResized"],[Ks,"onDrag"],[Us,"onDragging"],[Xs,"onDragged"],[Xo,"onScroll"],[si,"onScrolled"],[Qr,"onDestroy"],[Ys,"onArrowsMounted"],[Js,"onArrowsUpdated"],[Zs,"onPaginationMounted"],[Qs,"onPaginationUpdated"],[ea,"onNavigationMounted"],[ta,"onAutoplayPlay"],[el,"onAutoplayPlaying"],[na,"onAutoplayPause"],[ia,"onLazyLoadLoaded"]];function da(...e){return e.filter(Boolean).join(" ")}function Vo(e){return e!==null&&typeof e=="object"}function Hr(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Hr(n,t[i]));if(Vo(e)&&Vo(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Hr(e[o],t[o]))}return e===t}function Od(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function jd(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 Or(e,t){const n=e;return jd(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Vo(i)?n[o]=Or(Vo(n[o])?n[o]:{},i):n[o]=i}),n}var Bd=({children:e,className:t,...n})=>a.createElement("div",{className:da("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),ua=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 ca(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Or({},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&&!Hr(this.options,e)&&(this.splide.options=e,this.options=Or({},e));const t=this.getSlides();Od(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){_a.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:da("splide",e),ref:this.splideRef,...this.omit(o,["options",..._a.map(l=>l[1])])},n?a.createElement(Bd,null,i):i)}},pa=({children:e,className:t,...n})=>a.createElement("li",{className:da("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),at=require("classnames"),N=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Pi=require("react-dom");function Gl(e){return e.type==="object"&&e.version===1}const Kl="ControlSlider-module__wrapper___sHEkd",Ul="ControlSlider-module__hoverArrow___A-dOH",Xl="ControlSlider-module__sliderItem___QQSkR",Yl="ControlSlider-module__sliderImage___9hRl-",Jl="ControlSlider-module__arrow___05ghY",Zl="ControlSlider-module__arrowVertical___tBfVN",Ql="ControlSlider-module__nextArrow___-30Yc",ec="ControlSlider-module__arrowInner___aEra3",tc="ControlSlider-module__arrowIcon___S4ztF",nc="ControlSlider-module__arrowImg___2dwJW",ic="ControlSlider-module__mirror___brd6U",oc="ControlSlider-module__pagination___bicLF",rc="ControlSlider-module__paginationInner___bT-P-",ac="ControlSlider-module__paginationVertical___zYqKw",sc="ControlSlider-module__paginationItem___nTRbk",lc="ControlSlider-module__dot___p1Qun",cc="ControlSlider-module__activeDot___LHFaj",dc="ControlSlider-module__paginationInsideBottom___R3FWn",uc="ControlSlider-module__paginationInsideTop___V-qb-",pc="ControlSlider-module__paginationOutsideBottom___14w8D",mc="ControlSlider-module__paginationOutsideTop___SCLqB",gc="ControlSlider-module__paginationInsideLeft___yOBRZ",hc="ControlSlider-module__paginationInsideRight___Rtt3o",fc="ControlSlider-module__paginationOutsideLeft___lahaw",yc="ControlSlider-module__paginationOutsideRight___EtuQa",vc="ControlSlider-module__imgWrapper___UjEgB",xc="ControlSlider-module__captionBlock___dJ6-j",bc="ControlSlider-module__captionTextWrapper___HFlpf",wc="ControlSlider-module__captionText___uGBVc",Sc="ControlSlider-module__active___WZK4G",$c="ControlSlider-module__withPointerEvents___t-18M",Cc="ControlSlider-module__topLeftAlignment___zjnGM",Tc="ControlSlider-module__topCenterAlignment___gD1xW",Lc="ControlSlider-module__topRightAlignment___NMapS",Ic="ControlSlider-module__middleLeftAlignment___OnUrY",Rc="ControlSlider-module__middleCenterAlignment___Tdkl0",Ec="ControlSlider-module__middleRightAlignment___wEbfX",Mc="ControlSlider-module__bottomLeftAlignment___cTP2-",Pc="ControlSlider-module__bottomCenterAlignment___c54fB",kc="ControlSlider-module__bottomRightAlignment___kEwrz",Ac="ControlSlider-module__clickOverlay___DZA28",Fc="ControlSlider-module__contain___pLyq7",Wc="ControlSlider-module__cover___KdDat",je={wrapper:Kl,hoverArrow:Ul,sliderItem:Xl,sliderImage:Yl,arrow:Jl,arrowVertical:Zl,nextArrow:Ql,arrowInner:ec,arrowIcon:tc,arrowImg:nc,mirror:ic,pagination:oc,paginationInner:rc,paginationVertical:ac,paginationItem:sc,dot:lc,activeDot:cc,paginationInsideBottom:dc,paginationInsideTop:uc,paginationOutsideBottom:pc,paginationOutsideTop:mc,paginationInsideLeft:gc,paginationInsideRight:hc,paginationOutsideLeft:fc,paginationOutsideRight:yc,imgWrapper:vc,captionBlock:xc,captionTextWrapper:bc,captionText:wc,active:Sc,withPointerEvents:$c,topLeftAlignment:Cc,topCenterAlignment:Tc,topRightAlignment:Lc,middleLeftAlignment:Ic,middleCenterAlignment:Rc,middleRightAlignment:Ec,bottomLeftAlignment:Mc,bottomCenterAlignment:Pc,bottomRightAlignment:kc,clickOverlay:Ac,contain:Fc,cover:Wc};function _c(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 Nc(e,t,n){return t&&_c(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ra="(prefers-reduced-motion: reduce)",hi=1,Hc=2,xi=3,ki=4,ro=5,Ao=6,Bo=7,Oc={CREATED:hi,MOUNTED:Hc,IDLE:xi,MOVING:ki,SCROLLING:ro,DRAGGING:Ao,DESTROYED:Bo};function Ln(e){e.length=0}function jn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Rt(e){return e.bind.apply(e,[null].concat(jn(arguments,1)))}var _s=setTimeout,_r=function(){};function Ea(e){return requestAnimationFrame(e)}function Xo(e,t){return typeof t===e}function Ki(e){return!Jr(e)&&Xo("object",e)}var Yr=Array.isArray,Ns=Rt(Xo,"function"),Nn=Rt(Xo,"string"),ao=Rt(Xo,"undefined");function Jr(e){return e===null}function Hs(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function so(e){return Yr(e)?e:[e]}function an(e,t){so(e).forEach(t)}function Zr(e,t){return e.indexOf(t)>-1}function Fo(e,t){return e.push.apply(e,so(t)),e}function wn(e,t,n){e&&an(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function hn(e,t){wn(e,Nn(t)?t.split(" "):t,!0)}function lo(e,t){an(t,e.appendChild.bind(e))}function Qr(e,t){an(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Ui(e,t){return Hs(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Os(e,t){var n=e?jn(e.children):[];return t?n.filter(function(i){return Ui(i,t)}):n}function co(e,t){return t?Os(e,t)[0]:e.firstElementChild}var Xi=Object.keys;function ti(e,t,n){return e&&(n?Xi(e).reverse():Xi(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Yi(e){return jn(arguments,1).forEach(function(t){ti(t,function(n,i){e[i]=t[i]})}),e}function An(e){return jn(arguments,1).forEach(function(t){ti(t,function(n,i){Yr(n)?e[i]=n.slice():Ki(n)?e[i]=An({},Ki(e[i])?e[i]:{},n):e[i]=n})}),e}function Ma(e,t){an(t||Xi(e),function(n){delete e[n]})}function fn(e,t){an(e,function(n){an(t,function(i){n&&n.removeAttribute(i)})})}function it(e,t,n){Ki(t)?ti(t,function(i,o){it(e,o,i)}):an(e,function(i){Jr(n)||n===""?fn(i,t):i.setAttribute(t,String(n))})}function fi(e,t,n){var i=document.createElement(e);return t&&(Nn(t)?hn(i,t):it(i,t)),n&&lo(n,i),i}function dn(e,t,n){if(ao(n))return getComputedStyle(e)[t];Jr(n)||(e.style[t]=""+n)}function Ji(e,t){dn(e,"display",t)}function js(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function un(e,t){return e.getAttribute(t)}function Pa(e,t){return e&&e.classList.contains(t)}function Qt(e){return e.getBoundingClientRect()}function ni(e){an(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Bs(e){return co(new DOMParser().parseFromString(e,"text/html").body)}function bn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function zs(e,t){return e&&e.querySelector(t)}function ea(e,t){return t?jn(e.querySelectorAll(t)):[]}function Sn(e,t){wn(e,t,!1)}function Nr(e){return e.timeStamp}function Gn(e){return Nn(e)?e:e?e+"px":""}var uo="splide",ta="data-"+uo;function zi(e,t){if(!e)throw new Error("["+uo+"] "+(t||""))}var Hn=Math.min,zo=Math.max,Do=Math.floor,Zi=Math.ceil,Xt=Math.abs;function Ds(e,t,n){return Xt(e-t)<n}function Wo(e,t,n,i){var o=Hn(t,n),l=zo(t,n);return i?o<e&&e<l:o<=e&&e<=l}function pi(e,t,n){var i=Hn(t,n),o=zo(t,n);return Hn(zo(i,e),o)}function Hr(e){return+(e>0)-+(e<0)}function Or(e,t){return an(t,function(n){e=e.replace("%s",""+n)}),e}function na(e){return e<10?"0"+e:""+e}var ka={};function jc(e){return""+e+na(ka[e]=(ka[e]||0)+1)}function Vs(){var e=[];function t(s,d,c,u){o(s,d,function(m,y,w){var $="addEventListener"in m,h=$?m.removeEventListener.bind(m,y,c,u):m.removeListener.bind(m,c);$?m.addEventListener(y,c,u):m.addListener(c),e.push([m,y,w,c,h])})}function n(s,d,c){o(s,d,function(u,m,y){e=e.filter(function(w){return w[0]===u&&w[1]===m&&w[2]===y&&(!c||w[3]===c)?(w[4](),!1):!0})})}function i(s,d,c){var u,m=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:m,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,m,!1,c)),s.dispatchEvent(u),u}function o(s,d,c){an(s,function(u){u&&an(d,function(m){m.split(" ").forEach(function(y){var w=y.split(".");c(u,w[0],w[1])})})})}function l(){e.forEach(function(s){s[4]()}),Ln(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Bn="mounted",jr="ready",In="move",Ai="moved",ia="click",qs="active",Gs="inactive",Ks="visible",Us="hidden",Ht="refresh",Kt="updated",bi="resize",Yo="resized",Xs="drag",Ys="dragging",Js="dragged",Jo="scroll",ri="scrolled",Bc="overflow",oa="destroy",Zs="arrows:mounted",Qs="arrows:updated",el="pagination:mounted",tl="pagination:updated",ra="navigation:mounted",aa="autoplay:play",nl="autoplay:playing",sa="autoplay:pause",la="lazyload:loaded",il="sk",ol="sh",Vo="ei";function Wt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Vs();function i(l,s){n.bind(t,so(l).join(" "),function(d){s.apply(s,Yr(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,jn(arguments,1))}return e&&e.event.on(oa,n.destroy),Yi(n,{bus:t,on:i,off:Rt(n.unbind,t),emit:o})}function Zo(e,t,n,i){var o=Date.now,l,s=0,d,c=!0,u=0;function m(){if(!c){if(s=e?Hn((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++u>=i))return w();d=Ea(m)}}function y(C){C||h(),l=o()-(C?s*e:0),c=!1,d=Ea(m)}function w(){c=!0}function $(){l=o(),s=0,n&&n(s)}function h(){d&&cancelAnimationFrame(d),s=0,d=0,c=!0}function v(C){e=C}function S(){return c}return{start:y,rewind:$,pause:w,cancel:h,set:v,isPaused:S}}function zc(e){var t=e;function n(o){t=o}function i(o){return Zr(so(o),t)}return{set:n,is:i}}function Dc(e,t){var n=Zo(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Vc(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=Vs(),d=[];function c(){var h=n.mediaQuery==="min";Xi(o).sort(function(v,S){return h?+v-+S:+S-+v}).forEach(function(v){m(o[v],"("+(h?"min":"max")+"-width:"+v+"px)")}),m(l,Ra),y()}function u(h){h&&s.destroy()}function m(h,v){var S=matchMedia(v);s.bind(S,"change",y),d.push([h,S])}function y(){var h=i.is(Bo),v=n.direction,S=d.reduce(function(C,E){return An(C,E[1].matches?E[0]:{})},{});Ma(n),$(S),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):v!==n.direction&&e.refresh()}function w(h){matchMedia(Ra).matches&&(h?An(n,l):Ma(n,Xi(l)))}function $(h,v,S){An(n,h),v&&An(Object.getPrototypeOf(n),h),(S||!i.is(hi))&&e.emit(Kt,n)}return{setup:c,destroy:u,reduce:w,set:$}}var Qo="Arrow",er=Qo+"Left",tr=Qo+"Right",rl=Qo+"Up",al=Qo+"Down",Aa="rtl",nr="ttb",fr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[rl,tr],ArrowRight:[al,er]};function qc(e,t,n){function i(l,s,d){d=d||n.direction;var c=d===Aa&&!s?1:d===nr?0:-1;return fr[l]&&fr[l][c]||l.replace(/width|left|right/i,function(u,m){var y=fr[u.toLowerCase()][c]||u;return m>0?y.charAt(0).toUpperCase()+y.slice(1):y})}function o(l){return l*(n.direction===Aa?1:-1)}return{resolve:i,orient:o}}var $n="role",yi="tabindex",Gc="disabled",pn="aria-",po=pn+"controls",sl=pn+"current",Fa=pn+"selected",tn=pn+"label",ca=pn+"labelledby",ll=pn+"hidden",da=pn+"orientation",Qi=pn+"roledescription",Wa=pn+"live",_a=pn+"busy",Na=pn+"atomic",ua=[$n,yi,Gc,po,sl,tn,ca,ll,da,Qi],yn=uo+"__",zn="is-",yr=uo,Ha=yn+"track",Kc=yn+"list",ir=yn+"slide",cl=ir+"--clone",Uc=ir+"__container",pa=yn+"arrows",or=yn+"arrow",dl=or+"--prev",ul=or+"--next",rr=yn+"pagination",pl=rr+"__page",Xc=yn+"progress",Yc=Xc+"__bar",Jc=yn+"toggle",Zc=yn+"spinner",Qc=yn+"sr",ed=zn+"initialized",ii=zn+"active",ml=zn+"prev",gl=zn+"next",Br=zn+"visible",zr=zn+"loading",hl=zn+"focus-in",fl=zn+"overflow",td=[ii,Br,ml,gl,zr,hl,fl],nd={slide:ir,clone:cl,arrows:pa,arrow:or,prev:dl,next:ul,pagination:rr,page:pl,spinner:Zc};function id(e,t){if(Ns(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Ui(n,t);)n=n.parentElement;return n}var od=5,Oa=200,yl="touchstart mousedown",vr="touchmove mousemove",xr="touchend touchcancel mouseup click";function rd(e,t,n){var i=Wt(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,c={},u=[],m=[],y=[],w,$,h;function v(){M(),H(),E()}function S(){o(Ht,C),o(Ht,v),o(Kt,E),l(document,yl+" keydown",function(P){h=P.type==="keydown"},{capture:!0}),l(s,"focusin",function(){wn(s,hl,!!h)})}function C(P){var T=ua.concat("style");Ln(u),Sn(s,m),Sn(w,y),fn([w,$],T),fn(s,P?T:["style",Qi])}function E(){Sn(s,m),Sn(w,y),m=j(yr),y=j(Ha),hn(s,m),hn(w,y),it(s,tn,n.label),it(s,ca,n.labelledby)}function M(){w=x("."+Ha),$=co(w,"."+Kc),zi(w&&$,"A track/list element is missing."),Fo(u,Os($,"."+ir+":not(."+cl+")")),ti({arrows:pa,pagination:rr,prev:dl,next:ul,bar:Yc,toggle:Jc},function(P,T){c[T]=x("."+P)}),Yi(c,{root:s,track:w,list:$,slides:u})}function H(){var P=s.id||jc(uo),T=n.role;s.id=P,w.id=w.id||P+"-track",$.id=$.id||P+"-list",!un(s,$n)&&s.tagName!=="SECTION"&&T&&it(s,$n,T),it(s,Qi,d.carousel),it($,$n,"presentation")}function x(P){var T=zs(s,P);return T&&id(T,"."+yr)===s?T:void 0}function j(P){return[P+"--"+n.type,P+"--"+n.direction,n.drag&&P+"--draggable",n.isNavigation&&P+"--nav",P===yr&&ii]}return Yi(c,{setup:v,mount:S,destroy:C})}var wi="slide",Fi="loop",mo="fade";function ad(e,t,n,i){var o=Wt(e),l=o.on,s=o.emit,d=o.bind,c=e.Components,u=e.root,m=e.options,y=m.isNavigation,w=m.updateOnMove,$=m.i18n,h=m.pagination,v=m.slideFocus,S=c.Direction.resolve,C=un(i,"style"),E=un(i,tn),M=n>-1,H=co(i,"."+Uc),x;function j(){M||(i.id=u.id+"-slide"+na(t+1),it(i,$n,h?"tabpanel":"group"),it(i,Qi,$.slide),it(i,tn,E||Or($.slideLabel,[t+1,e.length]))),P()}function P(){d(i,"click",Rt(s,ia,F)),d(i,"keydown",Rt(s,il,F)),l([Ai,ol,ri],A),l(ra,G),w&&l(In,f)}function T(){x=!0,o.destroy(),Sn(i,td),fn(i,ua),it(i,"style",C),it(i,tn,E||"")}function G(){var I=e.splides.map(function(R){var U=R.splide.Components.Slides.getAt(t);return U?U.slide.id:""}).join(" ");it(i,tn,Or($.slideX,(M?n:t)+1)),it(i,po,I),it(i,$n,v?"button":""),v&&fn(i,Qi)}function f(){x||A()}function A(){if(!x){var I=e.index;_(),V(),wn(i,ml,t===I-1),wn(i,gl,t===I+1)}}function _(){var I=ne();I!==Pa(i,ii)&&(wn(i,ii,I),it(i,sl,y&&I||""),s(I?qs:Gs,F))}function V(){var I=K(),R=!I&&(!ne()||M);if(e.state.is([ki,ro])||it(i,ll,R||""),it(ea(i,m.focusableNodes||""),yi,R?-1:""),v&&it(i,yi,R?-1:0),I!==Pa(i,Br)&&(wn(i,Br,I),s(I?Ks:Us,F)),!I&&document.activeElement===i){var U=c.Slides.getAt(e.index);U&&js(U.slide)}}function te(I,R,U){dn(U&&H||i,I,R)}function ne(){var I=e.index;return I===t||m.cloneStatus&&I===n}function K(){if(e.is(mo))return ne();var I=Qt(c.Elements.track),R=Qt(i),U=S("left",!0),D=S("right",!0);return Do(I[U])<=Zi(R[U])&&Do(R[D])<=Zi(I[D])}function B(I,R){var U=Xt(I-t);return!M&&(m.rewind||e.is(Fi))&&(U=Hn(U,e.length-U)),U<=R}var F={index:t,slideIndex:n,slide:i,container:H,isClone:M,mount:j,destroy:T,update:A,style:te,isWithin:B};return F}function sd(e,t,n){var i=Wt(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,c=d.slides,u=d.list,m=[];function y(){w(),o(Ht,$),o(Ht,w)}function w(){c.forEach(function(A,_){v(A,_,-1)})}function $(){x(function(A){A.destroy()}),Ln(m)}function h(){x(function(A){A.update()})}function v(A,_,V){var te=ad(e,_,V,A);te.mount(),m.push(te),m.sort(function(ne,K){return ne.index-K.index})}function S(A){return A?j(function(_){return!_.isClone}):m}function C(A){var _=t.Controller,V=_.toIndex(A),te=_.hasFocus()?1:n.perPage;return j(function(ne){return Wo(ne.index,V,V+te-1)})}function E(A){return j(A)[0]}function M(A,_){an(A,function(V){if(Nn(V)&&(V=Bs(V)),Hs(V)){var te=c[_];te?Qr(V,te):lo(u,V),hn(V,n.classes.slide),T(V,Rt(l,bi))}}),l(Ht)}function H(A){ni(j(A).map(function(_){return _.slide})),l(Ht)}function x(A,_){S(_).forEach(A)}function j(A){return m.filter(Ns(A)?A:function(_){return Nn(A)?Ui(_.slide,A):Zr(so(A),_.index)})}function P(A,_,V){x(function(te){te.style(A,_,V)})}function T(A,_){var V=ea(A,"img"),te=V.length;te?V.forEach(function(ne){s(ne,"load error",function(){--te||_()})}):_()}function G(A){return A?c.length:m.length}function f(){return m.length>n.perPage}return{mount:y,destroy:$,update:h,register:v,get:S,getIn:C,getAt:E,add:M,remove:H,forEach:x,filter:j,style:P,getLength:G,isEnough:f}}function ld(e,t,n){var i=Wt(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,m=u.root,y=u.track,w=u.list,$=d.getAt,h=d.style,v,S,C;function E(){M(),l(window,"resize load",Dc(Rt(s,bi))),o([Kt,Ht],M),o(bi,H)}function M(){v=n.direction===nr,dn(m,"maxWidth",Gn(n.width)),dn(y,c("paddingLeft"),x(!1)),dn(y,c("paddingRight"),x(!0)),H(!0)}function H(F){var I=Qt(m);(F||S.width!==I.width||S.height!==I.height)&&(dn(y,"height",j()),h(c("marginRight"),Gn(n.gap)),h("width",T()),h("height",G(),!0),S=I,s(Yo),C!==(C=B())&&(wn(m,fl,C),s(Bc,C)))}function x(F){var I=n.padding,R=c(F?"right":"left");return I&&Gn(I[R]||(Ki(I)?0:I))||"0px"}function j(){var F="";return v&&(F=P(),zi(F,"height or heightRatio is missing."),F="calc("+F+" - "+x(!1)+" - "+x(!0)+")"),F}function P(){return Gn(n.height||Qt(w).width*n.heightRatio)}function T(){return n.autoWidth?null:Gn(n.fixedWidth)||(v?"":f())}function G(){return Gn(n.fixedHeight)||(v?n.autoHeight?null:f():P())}function f(){var F=Gn(n.gap);return"calc((100%"+(F&&" + "+F)+")/"+(n.perPage||1)+(F&&" - "+F)+")"}function A(){return Qt(w)[c("width")]}function _(F,I){var R=$(F||0);return R?Qt(R.slide)[c("width")]+(I?0:ne()):0}function V(F,I){var R=$(F);if(R){var U=Qt(R.slide)[c("right")],D=Qt(w)[c("left")];return Xt(U-D)+(I?0:ne())}return 0}function te(F){return V(e.length-1)-V(0)+_(0,F)}function ne(){var F=$(0);return F&&parseFloat(dn(F.slide,c("marginRight")))||0}function K(F){return parseFloat(dn(y,c("padding"+(F?"Right":"Left"))))||0}function B(){return e.is(mo)||te(!0)>A()}return{mount:E,resize:H,listSize:A,slideSize:_,sliderSize:te,totalSize:V,getPadding:K,isOverflow:B}}var cd=2;function dd(e,t,n){var i=Wt(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,c=[],u;function m(){o(Ht,y),o([Kt,bi],$),(u=S())&&(h(u),t.Layout.resize(!0))}function y(){w(),m()}function w(){ni(c),Ln(c),i.destroy()}function $(){var C=S();u!==C&&(u<C||!C)&&i.emit(Ht)}function h(C){var E=s.get().slice(),M=E.length;if(M){for(;E.length<C;)Fo(E,E);Fo(E.slice(-C),E.slice(0,C)).forEach(function(H,x){var j=x<C,P=v(H.slide,x);j?Qr(P,E[0].slide):lo(l.list,P),Fo(c,P),s.register(P,x-C+(j?0:M),H.index)})}}function v(C,E){var M=C.cloneNode(!0);return hn(M,n.classes.clone),M.id=e.root.id+"-clone"+na(E+1),M}function S(){var C=n.clones;if(!e.is(Fi))C=0;else if(ao(C)){var E=n[d("fixedWidth")]&&t.Layout.slideSize(0),M=E&&Zi(Qt(l.track)[d("width")]/E);C=M||n[d("autoWidth")]&&e.length||n.perPage*cd}return C}return{mount:m,destroy:w}}function ud(e,t,n){var i=Wt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,m=d.totalSize,y=d.listSize,w=d.sliderSize,$=t.Direction,h=$.resolve,v=$.orient,S=t.Elements,C=S.list,E=S.track,M;function H(){M=t.Transition,o([Bn,Yo,Kt,Ht],x)}function x(){t.Controller.isBusy()||(t.Scroll.cancel(),P(e.index),t.Slides.update())}function j(R,U,D,ee){R!==U&&F(R>D)&&(A(),T(f(te(),R>D),!0)),s(ki),l(In,U,D,R),M.start(U,function(){s(xi),l(Ai,U,D,R),ee&&ee()})}function P(R){T(V(R,!0))}function T(R,U){if(!e.is(mo)){var D=U?R:G(R);dn(C,"transform","translate"+h("X")+"("+D+"px)"),R!==D&&l(ol)}}function G(R){if(e.is(Fi)){var U=_(R),D=U>t.Controller.getEnd(),ee=U<0;(ee||D)&&(R=f(R,D))}return R}function f(R,U){var D=R-B(U),ee=w();return R-=v(ee*(Zi(Xt(D)/ee)||1))*(U?1:-1),R}function A(){T(te(),!0),M.cancel()}function _(R){for(var U=t.Slides.get(),D=0,ee=1/0,O=0;O<U.length;O++){var pe=U[O].index,g=Xt(V(pe,!0)-R);if(g<=ee)ee=g,D=pe;else break}return D}function V(R,U){var D=v(m(R-1)-K(R));return U?ne(D):D}function te(){var R=h("left");return Qt(C)[R]-Qt(E)[R]+v(u(!1))}function ne(R){return n.trimSpace&&e.is(wi)&&(R=pi(R,0,v(w(!0)-y()))),R}function K(R){var U=n.focus;return U==="center"?(y()-c(R,!0))/2:+U*c(R)||0}function B(R){return V(R?t.Controller.getEnd():0,!!n.trimSpace)}function F(R){var U=v(f(te(),R));return R?U>=0:U<=C[h("scrollWidth")]-Qt(E)[h("width")]}function I(R,U){U=ao(U)?te():U;var D=R!==!0&&v(U)<v(B(!1)),ee=R!==!1&&v(U)>v(B(!0));return D||ee}return{mount:H,move:j,jump:P,translate:T,shift:f,cancel:A,toIndex:_,toPosition:V,getPosition:te,getLimit:B,exceededLimit:I,reposition:x}}function pd(e,t,n){var i=Wt(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,c=s.getLimit,u=s.toPosition,m=t.Slides,y=m.isEnough,w=m.getLength,$=n.omitEnd,h=e.is(Fi),v=e.is(wi),S=Rt(te,!1),C=Rt(te,!0),E=n.start||0,M,H=E,x,j,P;function T(){G(),o([Kt,Ht,Vo],G),o(Yo,f)}function G(){x=w(!0),j=n.perMove,P=n.perPage,M=F();var g=pi(E,0,$?M:x-1);g!==E&&(E=g,s.reposition())}function f(){M!==F()&&l(Vo)}function A(g,ue,me){if(!pe()){var we=V(g),_e=B(we);_e>-1&&(ue||_e!==E)&&(D(_e),s.move(we,_e,H,me))}}function _(g,ue,me,we){t.Scroll.scroll(g,ue,me,function(){var _e=B(s.toIndex(d()));D($?Hn(_e,M):_e),we&&we()})}function V(g){var ue=E;if(Nn(g)){var me=g.match(/([+\-<>])(\d+)?/)||[],we=me[1],_e=me[2];we==="+"||we==="-"?ue=ne(E+ +(""+we+(+_e||1)),E):we===">"?ue=_e?I(+_e):S(!0):we==="<"&&(ue=C(!0))}else ue=h?g:pi(g,0,M);return ue}function te(g,ue){var me=j||(O()?1:P),we=ne(E+me*(g?-1:1),E,!(j||O()));return we===-1&&v&&!Ds(d(),c(!g),1)?g?0:M:ue?we:B(we)}function ne(g,ue,me){if(y()||O()){var we=K(g);we!==g&&(ue=g,g=we,me=!1),g<0||g>M?!j&&(Wo(0,g,ue,!0)||Wo(M,ue,g,!0))?g=I(R(g)):h?g=me?g<0?-(x%P||P):x:g:n.rewind?g=g<0?M:0:g=-1:me&&g!==ue&&(g=I(R(ue)+(g<ue?-1:1)))}else g=-1;return g}function K(g){if(v&&n.trimSpace==="move"&&g!==E)for(var ue=d();ue===u(g,!0)&&Wo(g,0,e.length-1,!n.rewind);)g<E?--g:++g;return g}function B(g){return h?(g+x)%x||0:g}function F(){for(var g=x-(O()||h&&j?1:P);$&&g-- >0;)if(u(x-1,!0)!==u(g,!0)){g++;break}return pi(g,0,x-1)}function I(g){return pi(O()?g:P*g,0,M)}function R(g){return O()?Hn(g,M):Do((g>=M?x-1:g)/P)}function U(g){var ue=s.toIndex(g);return v?pi(ue,0,M):ue}function D(g){g!==E&&(H=E,E=g)}function ee(g){return g?H:E}function O(){return!ao(n.focus)||n.isNavigation}function pe(){return e.state.is([ki,ro])&&!!n.waitForTransition}return{mount:T,go:A,scroll:_,getNext:S,getPrev:C,getAdjacent:te,getEnd:F,setIndex:D,getIndex:ee,toIndex:I,toPage:R,toDest:U,hasFocus:O,isBusy:pe}}var md="http://www.w3.org/2000/svg",gd="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",bo=40;function hd(e,t,n){var i=Wt(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,c=n.i18n,u=t.Elements,m=t.Controller,y=u.arrows,w=u.track,$=y,h=u.prev,v=u.next,S,C,E={};function M(){x(),o(Kt,H)}function H(){j(),M()}function x(){var _=n.arrows;_&&!(h&&v)&&G(),h&&v&&(Yi(E,{prev:h,next:v}),Ji($,_?"":"none"),hn($,C=pa+"--"+n.direction),_&&(P(),A(),it([h,v],po,w.id),s(Zs,h,v)))}function j(){i.destroy(),Sn($,C),S?(ni(y?[h,v]:$),h=v=null):fn([h,v],ua)}function P(){o([Bn,Ai,Ht,ri,Vo],A),l(v,"click",Rt(T,">")),l(h,"click",Rt(T,"<"))}function T(_){m.go(_,!0)}function G(){$=y||fi("div",d.arrows),h=f(!0),v=f(!1),S=!0,lo($,[h,v]),!y&&Qr($,w)}function f(_){var V='<button class="'+d.arrow+" "+(_?d.prev:d.next)+'" type="button"><svg xmlns="'+md+'" viewBox="0 0 '+bo+" "+bo+'" width="'+bo+'" height="'+bo+'" focusable="false"><path d="'+(n.arrowPath||gd)+'" />';return Bs(V)}function A(){if(h&&v){var _=e.index,V=m.getPrev(),te=m.getNext(),ne=V>-1&&_<V?c.last:c.prev,K=te>-1&&_>te?c.first:c.next;h.disabled=V<0,v.disabled=te<0,it(h,tn,ne),it(v,tn,K),s(Qs,h,v,V,te)}}return{arrows:E,mount:M,destroy:j,update:A}}var fd=ta+"-interval";function yd(e,t,n){var i=Wt(e),o=i.on,l=i.bind,s=i.emit,d=Zo(n.interval,e.go.bind(e,">"),P),c=d.isPaused,u=t.Elements,m=t.Elements,y=m.root,w=m.toggle,$=n.autoplay,h,v,S=$==="pause";function C(){$&&(E(),w&&it(w,po,u.track.id),S||M(),j())}function E(){n.pauseOnHover&&l(y,"mouseenter mouseleave",function(G){h=G.type==="mouseenter",x()}),n.pauseOnFocus&&l(y,"focusin focusout",function(G){v=G.type==="focusin",x()}),w&&l(w,"click",function(){S?M():H(!0)}),o([In,Jo,Ht],d.rewind),o(In,T)}function M(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),v=h=S=!1,j(),s(aa))}function H(G){G===void 0&&(G=!0),S=!!G,j(),c()||(d.pause(),s(sa))}function x(){S||(h||v?H(!1):M())}function j(){w&&(wn(w,ii,!S),it(w,tn,n.i18n[S?"play":"pause"]))}function P(G){var f=u.bar;f&&dn(f,"width",G*100+"%"),s(nl,G)}function T(G){var f=t.Slides.getAt(G);d.set(f&&+un(f.slide,fd)||n.interval)}return{mount:C,destroy:d.cancel,play:M,pause:H,isPaused:c}}function vd(e,t,n){var i=Wt(e),o=i.on;function l(){n.cover&&(o(la,Rt(d,!0)),o([Bn,Kt,Ht],Rt(s,!0)))}function s(c){t.Slides.forEach(function(u){var m=co(u.container||u.slide,"img");m&&m.src&&d(c,m,u)})}function d(c,u,m){m.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),Ji(u,c?"none":"")}return{mount:l,destroy:Rt(s,!1)}}var xd=10,bd=600,wd=.6,Sd=1.5,$d=800;function Cd(e,t,n){var i=Wt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,m=d.exceededLimit,y=d.translate,w=e.is(wi),$,h,v=1;function S(){o(In,H),o([Kt,Ht],x)}function C(P,T,G,f,A){var _=c();if(H(),G&&(!w||!m())){var V=t.Layout.sliderSize(),te=Hr(P)*V*Do(Xt(P)/V)||0;P=d.toPosition(t.Controller.toDest(P%V))+te}var ne=Ds(_,P,1);v=1,T=ne?0:T||zo(Xt(P-_)/Sd,$d),h=f,$=Zo(T,E,Rt(M,_,P,A),1),s(ro),l(Jo),$.start()}function E(){s(xi),h&&h(),l(ri)}function M(P,T,G,f){var A=c(),_=P+(T-P)*j(f),V=(_-A)*v;y(A+V),w&&!G&&m()&&(v*=wd,Xt(V)<xd&&C(u(m(!0)),bd,!1,h,!0))}function H(){$&&$.cancel()}function x(){$&&!$.isPaused()&&(H(),E())}function j(P){var T=n.easingFunc;return T?T(P):1-Math.pow(1-P,4)}return{mount:S,destroy:H,scroll:C,cancel:x}}var mi={passive:!1,capture:!0};function Td(e,t,n){var i=Wt(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,c=e.state,u=t.Move,m=t.Scroll,y=t.Controller,w=t.Elements.track,$=t.Media.reduce,h=t.Direction,v=h.resolve,S=h.orient,C=u.getPosition,E=u.exceededLimit,M,H,x,j,P,T=!1,G,f,A;function _(){s(w,vr,_r,mi),s(w,xr,_r,mi),s(w,yl,te,mi),s(w,"click",B,{capture:!0}),s(w,"dragstart",bn),o([Bn,Kt],V)}function V(){var X=n.drag;ye(!X),j=X==="free"}function te(X){if(G=!1,!f){var be=_e(X);we(X.target)&&(be||!X.button)&&(y.isBusy()?bn(X,!0):(A=be?w:window,P=c.is([ki,ro]),x=null,s(A,vr,ne,mi),s(A,xr,K,mi),u.cancel(),m.cancel(),F(X)))}}function ne(X){if(c.is(Ao)||(c.set(Ao),l(Xs)),X.cancelable)if(P){u.translate(M+me(O(X)));var be=pe(X)>Oa,ce=T!==(T=E());(be||ce)&&F(X),G=!0,l(Ys),bn(X)}else U(X)&&(P=R(X),bn(X))}function K(X){c.is(Ao)&&(c.set(xi),l(Js)),P&&(I(X),bn(X)),d(A,vr,ne),d(A,xr,K),P=!1}function B(X){!f&&G&&bn(X,!0)}function F(X){x=H,H=X,M=C()}function I(X){var be=D(X),ce=ee(be),ge=n.rewind&&n.rewindByDrag;$(!1),j?y.scroll(ce,0,n.snap):e.is(mo)?y.go(S(Hr(be))<0?ge?"<":"-":ge?">":"+"):e.is(wi)&&T&&ge?y.go(E(!0)?">":"<"):y.go(y.toDest(ce),!0),$(!0)}function R(X){var be=n.dragMinThreshold,ce=Ki(be),ge=ce&&be.mouse||0,se=(ce?be.touch:+be)||10;return Xt(O(X))>(_e(X)?se:ge)}function U(X){return Xt(O(X))>Xt(O(X,!0))}function D(X){if(e.is(Fi)||!T){var be=pe(X);if(be&&be<Oa)return O(X)/be}return 0}function ee(X){return C()+Hr(X)*Hn(Xt(X)*(n.flickPower||600),j?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function O(X,be){return ue(X,be)-ue(g(X),be)}function pe(X){return Nr(X)-Nr(g(X))}function g(X){return H===X&&x||H}function ue(X,be){return(_e(X)?X.changedTouches[0]:X)["page"+v(be?"Y":"X")]}function me(X){return X/(T&&e.is(wi)?od:1)}function we(X){var be=n.noDrag;return!Ui(X,"."+pl+", ."+or)&&(!be||!Ui(X,be))}function _e(X){return typeof TouchEvent<"u"&&X instanceof TouchEvent}function oe(){return P}function ye(X){f=X}return{mount:_,disable:ye,isDragging:oe}}var Ld={Spacebar:" ",Right:tr,Left:er,Up:rl,Down:al};function ma(e){return e=Nn(e)?e:e.key,Ld[e]||e}var ja="keydown";function Id(e,t,n){var i=Wt(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,c=t.Direction.resolve,u,m;function y(){w(),o(Kt,$),o(Kt,w),o(In,v)}function w(){var C=n.keyboard;C&&(u=C==="global"?window:d,l(u,ja,S))}function $(){s(u,ja)}function h(C){m=C}function v(){var C=m;m=!0,_s(function(){m=C})}function S(C){if(!m){var E=ma(C);E===c(er)?e.go("<"):E===c(tr)&&e.go(">")}}return{mount:y,destroy:$,disable:h}}var Di=ta+"-lazy",_o=Di+"-srcset",Rd="["+Di+"], ["+_o+"]";function Ed(e,t,n){var i=Wt(e),o=i.on,l=i.off,s=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Ai,ri],m=[];function y(){n.lazyLoad&&(w(),o(Ht,w))}function w(){Ln(m),$(),c?C():(l(u),o(u,h),h())}function $(){t.Slides.forEach(function(E){ea(E.slide,Rd).forEach(function(M){var H=un(M,Di),x=un(M,_o);if(H!==M.src||x!==M.srcset){var j=n.classes.spinner,P=M.parentElement,T=co(P,"."+j)||fi("span",j,P);m.push([M,E,T]),M.src||Ji(M,"none")}})})}function h(){m=m.filter(function(E){var M=n.perPage*((n.preloadPages||1)+1)-1;return E[1].isWithin(e.index,M)?v(E):!0}),m.length||l(u)}function v(E){var M=E[0];hn(E[1].slide,zr),s(M,"load error",Rt(S,E)),it(M,"src",un(M,Di)),it(M,"srcset",un(M,_o)),fn(M,Di),fn(M,_o)}function S(E,M){var H=E[0],x=E[1];Sn(x.slide,zr),M.type!=="error"&&(ni(E[2]),Ji(H,""),d(la,H,x),d(bi)),c&&C()}function C(){m.length&&v(m.shift())}return{mount:y,destroy:Rt(Ln,m),check:h}}function Md(e,t,n){var i=Wt(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,m=u.hasFocus,y=u.getIndex,w=u.go,$=t.Direction.resolve,h=c.pagination,v=[],S,C;function E(){M(),o([Kt,Ht,Vo],E);var f=n.pagination;h&&Ji(h,f?"":"none"),f&&(o([In,Jo,ri],G),H(),G(),l(el,{list:S,items:v},T(e.index)))}function M(){S&&(ni(h?jn(S.children):S),Sn(S,C),Ln(v),S=null),i.destroy()}function H(){var f=e.length,A=n.classes,_=n.i18n,V=n.perPage,te=m()?u.getEnd()+1:Zi(f/V);S=h||fi("ul",A.pagination,c.track.parentElement),hn(S,C=rr+"--"+P()),it(S,$n,"tablist"),it(S,tn,_.select),it(S,da,P()===nr?"vertical":"");for(var ne=0;ne<te;ne++){var K=fi("li",null,S),B=fi("button",{class:A.page,type:"button"},K),F=d.getIn(ne).map(function(R){return R.slide.id}),I=!m()&&V>1?_.pageX:_.slideX;s(B,"click",Rt(x,ne)),n.paginationKeyboard&&s(B,"keydown",Rt(j,ne)),it(K,$n,"presentation"),it(B,$n,"tab"),it(B,po,F.join(" ")),it(B,tn,Or(I,ne+1)),it(B,yi,-1),v.push({li:K,button:B,page:ne})}}function x(f){w(">"+f,!0)}function j(f,A){var _=v.length,V=ma(A),te=P(),ne=-1;V===$(tr,!1,te)?ne=++f%_:V===$(er,!1,te)?ne=(--f+_)%_:V==="Home"?ne=0:V==="End"&&(ne=_-1);var K=v[ne];K&&(js(K.button),w(">"+ne),bn(A,!0))}function P(){return n.paginationDirection||n.direction}function T(f){return v[u.toPage(f)]}function G(){var f=T(y(!0)),A=T(y());if(f){var _=f.button;Sn(_,ii),fn(_,Fa),it(_,yi,-1)}if(A){var V=A.button;hn(V,ii),it(V,Fa,!0),it(V,yi,"")}l(tl,{list:S,items:v},f,A)}return{items:v,mount:E,destroy:M,getAt:T,update:G}}var Pd=[" ","Enter"];function kd(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&m()}function d(){l.forEach(function(h){h.destroy()}),Ln(l)}function c(){d(),s()}function u(h,v){var S=Wt(h);S.on(In,function(C,E,M){v.go(v.is(Fi)?M:C)}),l.push(S)}function m(){var h=Wt(e),v=h.on;v(ia,w),v(il,$),v([Bn,Kt],y),l.push(h),h.emit(ra,e.splides)}function y(){it(t.Elements.list,da,n.direction===nr?"vertical":"")}function w(h){e.go(h.index)}function $(h,v){Zr(Pd,ma(v))&&(w(h),bn(v))}return{setup:Rt(t.Media.set,{slideFocus:ao(o)?i:o},!0),mount:s,destroy:d,remount:c}}function Ad(e,t,n){var i=Wt(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,mi)}function d(u){if(u.cancelable){var m=u.deltaY,y=m<0,w=Nr(u),$=n.wheelMinThreshold||0,h=n.wheelSleep||0;Xt(m)>$&&w-l>h&&(e.go(y?"<":">"),l=w),c(y)&&bn(u)}}function c(u){return!n.releaseWheel||e.state.is(ki)||t.Controller.getAdjacent(u)!==-1}return{mount:s}}var Fd=90;function Wd(e,t,n){var i=Wt(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=fi("span",Qc),c=Zo(Fd,Rt(m,!1));function u(){s&&(w(!t.Autoplay.isPaused()),it(l,Na,!0),d.textContent="…",o(aa,Rt(w,!0)),o(sa,Rt(w,!1)),o([Ai,ri],Rt(m,!0)))}function m($){it(l,_a,$),$?(lo(l,d),c.start()):(ni(d),c.cancel())}function y(){fn(l,[Wa,Na,_a]),ni(d)}function w($){s&&it(l,Wa,$?"off":"polite")}return{mount:u,disable:w,destroy:y}}var _d=Object.freeze({__proto__:null,Media:Vc,Direction:qc,Elements:rd,Slides:sd,Layout:ld,Clones:dd,Move:ud,Controller:pd,Arrows:hd,Autoplay:yd,Cover:vd,Scroll:Cd,Drag:Td,Keyboard:Id,LazyLoad:Ed,Pagination:Md,Sync:kd,Wheel:Ad,Live:Wd}),Nd={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"},Hd={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:nd,i18n:Nd,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Od(e,t,n){var i=t.Slides;function o(){Wt(e).on([Bn,Ht],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),_s(c)}return{mount:o,start:s,cancel:_r}}function jd(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=Rt(dn,s,"transition"),c;function u(){Wt(e).bind(s,"transitionend",function($){$.target===s&&c&&(y(),c())})}function m($,h){var v=i.toPosition($,!0),S=i.getPosition(),C=w($);Xt(v-S)>=1&&C>=1?n.useScroll?l.scroll(v,C,!1,h):(d("transform "+C+"ms "+n.easing),i.translate(v,!0),c=h):(i.jump($),h())}function y(){d(""),l.cancel()}function w($){var h=n.rewindSpeed;if(e.is(wi)&&h){var v=o.getIndex(!0),S=o.getEnd();if(v===0&&$>=S||v>=S&&$===0)return h}return n.speed}return{mount:u,start:m,cancel:y}}var Bd=(function(){function e(n,i){this.event=Wt(),this.Components={},this.state=zc(hi),this.splides=[],this._o={},this._E={};var o=Nn(n)?zs(document,n):n;zi(o,o+" is invalid."),this.root=o,i=An({label:un(o,tn)||"",labelledby:un(o,ca)||""},Hd,e.defaults,i||{});try{An(i,JSON.parse(un(o,ta)))}catch{zi(!1,"Invalid JSON")}this._o=Object.create(An({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;zi(s.is([hi,Bo]),"Already mounted!"),s.set(hi),this._C=d,this._T=o||this._T||(this.is(mo)?Od:jd),this._E=i||this._E;var c=Yi({},_d,this._E,{Transition:this._T});return ti(c,function(u,m){var y=u(l,d,l._o);d[m]=y,y.setup&&y.setup()}),ti(d,function(u){u.mount&&u.mount()}),this.emit(Bn),hn(this.root,ed),s.set(xi),this.emit(jr),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(xi)&&(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(jn(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(Ht),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(hi)?Wt(this).on(jr,this.destroy.bind(this,i)):(ti(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(oa),o.destroy(),i&&Ln(this.splides),l.set(Bo)),this},Nc(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})(),ga=Bd;ga.defaults={};ga.STATES=Oc;var Ba=[[Bn,"onMounted"],[jr,"onReady"],[In,"onMove"],[Ai,"onMoved"],[ia,"onClick"],[qs,"onActive"],[Gs,"onInactive"],[Ks,"onVisible"],[Us,"onHidden"],[Ht,"onRefresh"],[Kt,"onUpdated"],[bi,"onResize"],[Yo,"onResized"],[Xs,"onDrag"],[Ys,"onDragging"],[Js,"onDragged"],[Jo,"onScroll"],[ri,"onScrolled"],[oa,"onDestroy"],[Zs,"onArrowsMounted"],[Qs,"onArrowsUpdated"],[el,"onPaginationMounted"],[tl,"onPaginationUpdated"],[ra,"onNavigationMounted"],[aa,"onAutoplayPlay"],[nl,"onAutoplayPlaying"],[sa,"onAutoplayPause"],[la,"onLazyLoadLoaded"]];function ha(...e){return e.filter(Boolean).join(" ")}function qo(e){return e!==null&&typeof e=="object"}function Dr(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Dr(n,t[i]));if(qo(e)&&qo(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Dr(e[o],t[o]))}return e===t}function zd(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Dd(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 Vr(e,t){const n=e;return Dd(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():qo(i)?n[o]=Vr(qo(n[o])?n[o]:{},i):n[o]=i}),n}var Vd=({children:e,className:t,...n})=>a.createElement("div",{className:ha("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),fa=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 ga(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Vr({},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&&!Dr(this.options,e)&&(this.splide.options=e,this.options=Vr({},e));const t=this.getSlides();zd(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){Ba.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:ha("splide",e),ref:this.splideRef,...this.omit(o,["options",...Ba.map(l=>l[1])])},n?a.createElement(Vd,null,i):i)}},ya=({children:e,className:t,...n})=>a.createElement("li",{className:ha("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 zd="RichTextRenderer-module__link___BWeZ2",Dd={link:zd},Vd=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))},or=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Vd(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function en(e){const{color:t,...n}=e;return n}function Ot(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:or(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:F.scalingValue(e.letterSpacing,t),wordSpacing:F.scalingValue(e.wordSpacing,t),fontSize:F.scalingValue(n,t),lineHeight:i!==void 0?F.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 Si=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Dd.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:qd(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 qd(e){return{...e.fontFamily&&{fontFamily:or(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 Gd="SvgImage-module__svg___q3xE-",Kd="SvgImage-module__img___VsTm-",Na={svg:Gd,img:Kd},Ud=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Xd=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,tn=({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)}},[]),!Ud(e)||!l?r.jsx("img",{src:e,alt:"",className:it(Na.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:it(Na.svg,i),style:{"--svg":Xd(e),"--fill":t,"--hover-fill":n,...o??{}}})},Yd={"top-left":Oe.topLeftAlignment,"top-center":Oe.topCenterAlignment,"top-right":Oe.topRightAlignment,"middle-left":Oe.middleLeftAlignment,"middle-center":Oe.middleCenterAlignment,"middle-right":Oe.middleRightAlignment,"bottom-left":Oe.bottomLeftAlignment,"bottom-center":Oe.bottomCenterAlignment,"bottom-right":Oe.bottomRightAlignment};function Jd({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=a.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:m,fontSizeLineHeight:y,textAppearance:E,color:T}=n.imageCaption??{},[h,v]=a.useState(void 0),[I,L]=a.useState(null),[R,P]=a.useState(0),[O,x]=a.useState(0),{direction:N,transition:k,controls:$,pagination:q,imageCaption:f,triggers:M}=e,_=a.useRef(k.type),{x:j,y:te}=e.controls.offset,ie=G=>{o&&o.go(G)};return a.useEffect(()=>{if(!I)return;const G=new ResizeObserver(z=>{if(!o)return;const[H]=z;v({width:Math.round(H.contentRect.width),height:Math.round(H.contentRect.height)})});return G.observe(I),()=>G.unobserve(I)},[I]),a.useEffect(()=>{!o||_.current===k.type||(x(G=>G+1),_.current=k.type)},[k.type]),r.jsx("div",{className:it(Oe.wrapper,{[Oe.editor]:i}),ref:L,children:r.jsxs("div",{className:Oe.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:k.backgroundColor&&k.type==="fade in"?k.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:it(Oe.captionBlock),children:r.jsx("div",{className:Oe.captionTextWrapper,children:t.map((G,z)=>r.jsx("div",{className:it(Oe.captionText,Yd[f.alignment],{[Oe.withPointerEvents]:z===R&&i,[Oe.active]:z===R}),style:{fontFamily:or(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":F.scalingValue(s.width,i),letterSpacing:F.scalingValue(c,i),wordSpacing:F.scalingValue(m,i),textAlign:u,fontSize:F.scalingValue(y.fontSize,i),lineHeight:F.scalingValue(y.lineHeight,i),textTransform:E.textTransform??"none",textDecoration:E.textDecoration??"none",fontVariant:E.fontVariant??"normal",color:T,transitionDuration:k.duration?`${Math.round(parseInt(k.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Oe.captionTextInner,style:{"--link-hover-color":f.linkHoverColor,"--link-color":f.linkColor,position:"relative",top:F.scalingValue(f.offset.y,i),left:F.scalingValue(f.offset.x,i)},children:r.jsx(Si,{content:G.imageCaption})})},z))})}),r.jsx(ua,{onMove:G=>{P(G.index)},ref:l,options:{arrows:!1,speed:k.duration?parseInt(k.duration):500,autoplay:M.autoPlay!==null,...M.autoPlay!==null&&{interval:parseInt(M.autoPlay)*1e3},direction:N==="horiz"||k.type==="fade in"?"ltr":"ttb",pagination:!1,drag:M.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:k.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((G,z)=>r.jsx(pa,{children:r.jsx("div",{className:Oe.sliderItem,children:r.jsx("div",{className:Oe.imgWrapper,children:r.jsx("img",{className:it(Oe.sliderImage,{[Oe.contain]:G.image.objectFit==="contain",[Oe.cover]:G.image.objectFit==="cover"}),src:G.image.url,alt:G.image.name??""})})})},z))},O),$.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:it(Oe.arrow,{[Oe.arrowVertical]:N==="vert",[Oe.hoverArrow]:$.show==="on hover"}),style:{color:$.color,"--arrow-hover-color":$.hover},children:r.jsxs("button",{onClick:()=>{ie("-1")},className:Oe.arrowInner,style:{transform:`translate(${F.scalingValue(j,i)}, ${F.scalingValue(te*(N==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${N==="horiz"?"0deg":"90deg"})`},children:[$.arrowsImgUrl&&r.jsx(tn,{url:$.arrowsImgUrl,fill:$.color,hoverFill:$.hover,className:it(Oe.arrowImg,Oe.mirror)}),!$.arrowsImgUrl&&r.jsx(Ha,{color:$.color,className:it(Oe.arrowIcon,Oe.arrowImg,Oe.mirror)})]})}),r.jsx("div",{className:it(Oe.arrow,Oe.nextArrow,{[Oe.arrowVertical]:N==="vert",[Oe.hoverArrow]:$.show==="on hover"}),style:{color:$.color,"--arrow-hover-color":$.hover},children:r.jsxs("button",{className:Oe.arrowInner,onClick:()=>ie("+1"),style:{transform:`translate(${F.scalingValue(j*(N==="horiz"?-1:1),i)}, ${F.scalingValue(te,i)}) scale(${e.controls.scale/100}) rotate(${N==="horiz"?"0deg":"90deg"})`},children:[$.arrowsImgUrl&&r.jsx(tn,{url:$.arrowsImgUrl,fill:$.color,hoverFill:$.hover,className:Oe.arrowImg}),!$.arrowsImgUrl&&r.jsx(Ha,{color:$.color,className:it(Oe.arrowIcon,Oe.arrowImg)})]})})]}),M.triggersList.click&&r.jsx("div",{className:Oe.clickOverlay,onClick:()=>{o&&o.go("+1")}}),q.isActive&&r.jsx("div",{className:it(Oe.pagination,{[Oe.paginationInsideBottom]:q.position==="inside-1"&&N==="horiz",[Oe.paginationInsideTop]:q.position==="inside-2"&&N==="horiz",[Oe.paginationOutsideBottom]:q.position==="outside-1"&&N==="horiz",[Oe.paginationOutsideTop]:q.position==="outside-2"&&N==="horiz",[Oe.paginationInsideLeft]:q.position==="inside-1"&&N==="vert",[Oe.paginationInsideRight]:q.position==="inside-2"&&N==="vert",[Oe.paginationOutsideLeft]:q.position==="outside-1"&&N==="vert",[Oe.paginationOutsideRight]:q.position==="outside-2"&&N==="vert",[Oe.paginationVertical]:N==="vert"}),children:r.jsx("div",{className:Oe.paginationInner,style:{backgroundColor:q.colors[2],transform:`scale(${q.scale/100}) translate(${F.scalingValue(q.offset.x,i)}, ${F.scalingValue(q.offset.y,i)}) rotate(${N==="horiz"?"0deg":"90deg"})`},children:t.map((G,z)=>r.jsx("button",{onClick:()=>{o&&o.go(z)},className:it(Oe.paginationItem),children:r.jsx("div",{className:it(Oe.dot,{[Oe.activeDot]:z===R}),style:{backgroundColor:z===R?q.colors[0]:q.colors[1],"--pagination-hover-color":q.hover}})},z))})})]})})}function Ha({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 Zd={element:Jd,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"]}},Qd="ImageRevealSlider-module__imageRevealSlider___UE5Ob",eu="ImageRevealSlider-module__image___Qjt-e",tu="ImageRevealSlider-module__link___N-iLG",nu="ImageRevealSlider-module__cursor___2U03d",di={imageRevealSlider:Qd,image:eu,link:tu,cursor:nu};function Oa(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 vr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function iu(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await vr(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await vr(e);l=s.height/s.width*o}else{const s=await vr(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function ou({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),[m,y]=a.useState({x:0,y:0}),[E,T]=a.useState(1),[h,v]=a.useState("none"),I=a.useRef({x:0,y:0}),[L,R]=a.useState(!1),{sizeType:P,imageWidth:O,randomRangeImageWidth:x}=e.imageSize,{revealPosition:N,visible:k}=e.position,{cursorType:$,target:q,defaultCursorScale:f,defaultCursor:M,hoverCursorScale:_,hoverCursor:j}=e.cursor;a.useEffect(()=>{if(!i)return;const G=(W,S)=>{const K=i.getBoundingClientRect(),J=W-K.left,Q=S-K.top;if(y({x:J,y:Q}),$==="system"){v("none"),T(1);return}const D=J,ue=Q,g=document.elementFromPoint(K.left+D,K.top+ue);if(g&&g.closest("a")){v("none"),T(1);return}const pe=Oa(D,ue,l)||q==="area"?{img:j??"none",scale:_}:{img:M??"none",scale:f};v(pe.img),T(pe.scale)},z=W=>{W.stopPropagation(),I.current={x:W.clientX,y:W.clientY},G(W.clientX,W.clientY)},H=()=>{L&&G(I.current.x,I.current.y)};return i.addEventListener("mousemove",z),window.addEventListener("scroll",H,!0),()=>{i.removeEventListener("mousemove",z),window.removeEventListener("scroll",H,!0)}},[i,L,m,$,q,j,M,_,f,l]),a.useEffect(()=>{L||(v("none"),T(0))},[L]);const te=async(G,z,H,W={})=>{const{width:S,height:K,finalWidth:J}=await iu(G.image.url,P,O,x);let Q=0,D=0;N==="same"?(Q=z/2,D=H/2):(Q=W.x??Math.random()*z,D=W.y??Math.random()*H);const ue=Math.min(Math.max(Q,S/2),z-S/2),g=Math.min(Math.max(D,K/2),H-K/2);return{id:u.current++,url:G.image.url,link:G.link,name:G.image.name,x:ue,y:g,width:J}};a.useEffect(()=>{if(!i||t.length===0)return;const G=i.getBoundingClientRect(),z=G.width,H=G.height,W=[];(async()=>{const K=t[0],J=await te(K,z,H);W.push(J),s(W),c(1)})()},[P,O,x,N,i]),a.useEffect(()=>{k==="last One"&&s(G=>G.length>0?[G[G.length-1]]:[])},[k]);const ie=async G=>{if(!i)return;const z=i.getBoundingClientRect(),H=G.clientX-z.left,W=G.clientY-z.top;if(q==="image"&&!Oa(H,W,l))return;let S=0,K=0;N==="on Click"?(S=H,K=W):N==="same"?(S=z.width/2,K=z.height/2):(S=Math.random()*z.width,K=Math.random()*z.height);const J=t[d],Q=await te(J,z.width,z.height,{x:S,y:K});s(D=>k==="all"?[...D,Q]:[Q]),c(D=>D>=t.length-1?0:D+1)};return r.jsxs("div",{ref:o,onClick:ie,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:di.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[l.map(G=>r.jsx("div",{className:di.wrapper,style:{top:`${G.y}px`,left:`${G.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:G.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:q==="area"&&G.link?r.jsx("a",{href:G.link,target:"_blank",className:di.link,children:r.jsx("img",{src:G.url,alt:G.name,className:di.image},G.id)}):r.jsx("img",{src:G.url,alt:G.name,className:di.image},G.id)},G.id)),L&&r.jsx("div",{className:di.cursor,style:{left:`${m.x}px`,top:`${m.y}px`,transform:`translate(-50%, -50%) scale(${E})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ru={element:ou,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:""}]}}}},au="LightBox-module__hidden___9s-9x",su="LightBox-module__heroImage___sTxNF",lu="LightBox-module__background___rm9ml",cu="LightBox-module__editor___4ACaY",du="LightBox-module__contentStyle___Bgnsq",uu="LightBox-module__imageStyle___tLIlB",pu="LightBox-module__imgWrapper___LuFUp",mu="LightBox-module__contain___8-yaS",gu="LightBox-module__cover___hNvOG",hu="LightBox-module__caption___b6L2I",fu="LightBox-module__captionTextInner___rCGNH",yu="LightBox-module__lightboxSplide___XFuWC",vu="LightBox-module__arrow___iz38X",xu="LightBox-module__arrowVertical___Zfz81",bu="LightBox-module__nextArrow___zkAQN",wu="LightBox-module__arrowInner___p48sW",Su="LightBox-module__arrowIcon___3VaFf",$u="LightBox-module__arrowImg___pNV88",Cu="LightBox-module__mirror___pjeXc",Tu="LightBox-module__thumbsWrapper___GB-nU",Lu="LightBox-module__thumbsContainerVertical___wttk5",Iu="LightBox-module__thumbsContainer___osSma",Eu="LightBox-module__thumbsAlignStart___MO6tY",Ru="LightBox-module__thumbsAlignCenter___Q4sUx",Mu="LightBox-module__thumbsAlignEnd___p4y9R",Pu="LightBox-module__thumbItem___HvnF3",ku="LightBox-module__closeButton___g2khP",Au="LightBox-module__fadeIn___0m5GW",Wu="LightBox-module__slideInLeft___gPYwC",Fu="LightBox-module__slideInRight___S-pPp",_u="LightBox-module__slideInTop___DFdAj",Nu="LightBox-module__slideInBottom___m27kZ",Hu="LightBox-module__fadeOut___55qBR",Ou="LightBox-module__slideOutLeft___NvU7P",ju="LightBox-module__slideOutRight___SK7eC",Bu="LightBox-module__slideOutTop___Vgg0z",zu="LightBox-module__slideOutBottom___nJ0Ef",Du="LightBox-module__scaleSlide___vZriG",Ee={hidden:au,heroImage:su,background:lu,editor:cu,contentStyle:du,imageStyle:uu,imgWrapper:pu,contain:mu,cover:gu,caption:hu,captionTextInner:fu,lightboxSplide:yu,arrow:vu,arrowVertical:xu,nextArrow:bu,arrowInner:wu,arrowIcon:Su,arrowImg:$u,mirror:Cu,thumbsWrapper:Tu,thumbsContainerVertical:Lu,thumbsContainer:Iu,thumbsAlignStart:Eu,thumbsAlignCenter:Ru,thumbsAlignEnd:Mu,thumbItem:Pu,closeButton:ku,fadeIn:Au,slideInLeft:Wu,slideInRight:Fu,slideInTop:_u,slideInBottom:Nu,fadeOut:Hu,slideOutLeft:Ou,slideOutRight:ju,slideOutTop:Bu,slideOutBottom:zu,scaleSlide:Du},xo=(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% + ${F.scalingValue(t.x,n)}), calc(-50% + ${F.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${F.scalingValue(t.x,n)}, calc(-50% + ${F.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${F.scalingValue(t.x,n)}), ${F.scalingValue(t.y,n)})`:i.transform=`translate(${F.scalingValue(t.x,n)}, ${F.scalingValue(t.y,n)})`,i};function fl(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 ja(e){const t=e.getBoundingClientRect(),n=fl(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,d=i/o,c=l/s;let u,m;c>d?(u=i,m=i/c):(m=o,u=o*c);const y=t.left+n.left,E=t.top+n.top,T=(i-u)/2+y,h=(o-m)/2+E;return{x:T,y:h,width:u,height:m}}function Ba(e){const t=e.getBoundingClientRect(),n=fl(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function za(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 Vu(e,t){const n=(()=>{if(e==="fade in")return Ee.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ee.slideInLeft;case"right":return Ee.slideInRight;case"top":return Ee.slideInTop;case"bottom":return Ee.slideInBottom;default:return Ee.slideInRight}return Ee.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ee.fadeIn;if(e==="slide in")switch(t){case"left":return Ee.slideInLeft;case"right":return Ee.slideInRight;case"top":return Ee.slideInTop;case"bottom":return Ee.slideInBottom;default:return Ee.slideInRight}return Ee.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ee.fadeOut;if(e==="slide in")switch(t){case"left":return Ee.slideOutLeft;case"right":return Ee.slideOutRight;case"top":return Ee.slideOutTop;case"bottom":return Ee.slideOutBottom;default:return Ee.slideOutRight}return Ee.fadeOut})(),l=(()=>{if(e==="fade in")return Ee.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ee.slideOutLeft;case"right":return Ee.slideOutRight;case"top":return Ee.slideOutTop;case"bottom":return Ee.slideOutBottom;default:return Ee.slideOutRight}return Ee.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const qu=({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:Ee.heroImage,onClick:()=>c(!0)}),r.jsx(Gu,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},Gu=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var ke;const{widthSettings:c,fontSettings:u,letterSpacing:m,textAlign:y,wordSpacing:E,fontSizeLineHeight:T,textAppearance:h,color:v}=i.imageCaption??{},[I,L]=a.useState(0),[R,P]=a.useState(0),[O,x]=a.useState(!1),[N,k]=a.useState(!1),[$,q]=a.useState({}),f=a.useRef(null),M=a.useRef(null),_=a.useRef(null),j=a.useRef(!1),te=a.useRef(null),ie=a.useRef(null),G=a.useRef(null),z=a.useRef(null),H=a.useRef(!1),W=a.useRef(null),[S,K]=a.useState(!1),{appear:J,triggers:Q,slider:D,thumbnail:ue,controls:g,area:pe,caption:fe,layout:ve}=o.lightboxBlock,{appearClass:Ne,backdropAppearClass:ne,backdropDisappearClass:ge,disappearClass:ee}=Vu(J.type,J.direction),be=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const b=()=>{setTimeout(()=>{var C,U;(U=(C=f.current)==null?void 0:C.splide)==null||U.refresh()},16)},re=()=>{P(C=>C+1)};return window.addEventListener("ArticleEditor.Layout:change",b),window.addEventListener("ArticleEditor.ComponentContent:change",re),()=>{window.removeEventListener("ArticleEditor.Layout:change",b),window.removeEventListener("ArticleEditor.ComponentContent:change",re)}},[]),a.useEffect(()=>{if(!e||!ue.isActive){K(!1);return}const b=W.current;if(!b)return;const re=()=>{D.direction==="horiz"?K(b.scrollWidth>b.clientWidth):K(b.scrollHeight>b.clientHeight)};re();const C=new ResizeObserver(re);return C.observe(b),()=>C.disconnect()},[e,ue.isActive,n.length,$,D.direction]);const ce=a.useCallback(()=>{const b=window.matchMedia("(max-width: 768px)").matches,re=za(pe.color);b&&!s&&re>.9&&(document.body.style.backgroundColor=""),x(!0),j.current=!0;const C=U=>{U.target===te.current&&U.animationName&&(te.current&&ie.current&&te.current.removeEventListener("animationend",ie.current),ie.current=null,j.current&&(j.current=!1,t()),x(!1))};te.current&&(ie.current=C,te.current.addEventListener("animationend",C))},[t,pe.color,s]),oe=(b,re,C)=>{var U,X;if(b){if(Q.type==="click"&&Q.switch==="image")Q.repeat==="close"&&I===n.length-1?ce():(U=f.current)==null||U.go("+1");else if(Q.type==="click"&&Q.switch==="50/50"){const se=b.getBoundingClientRect(),le=re-se.left,ye=C-se.top,We=se.width,Me=se.height;let B;D.direction==="horiz"?B=le<We/2?"-1":"+1":B=ye<Me/2?"-1":"+1",(X=f.current)==null||X.go(B)}}},Z=b=>{if(H.current){H.current=!1;return}const re=n[I],C=(re==null?void 0:re.image.objectFit)==="cover";let U,X;if("changedTouches"in b&&b.changedTouches.length>0)U=b.changedTouches[0].clientX,X=b.changedTouches[0].clientY;else if("clientX"in b)U=b.clientX,X=b.clientY;else return;let se;if(C&&_.current){const le=Ba(_.current);se=U>=le.left&&U<=le.right&&X>=le.top&&X<=le.bottom}else{const le=_.current?ja(_.current):null;if(!le){b.target===b.currentTarget&&ce();return}se=U>=le.x&&U<=le.x+le.width&&X>=le.y&&X<=le.y+le.height}se?oe(_.current,U,X):ce()},Ce=b=>{const re=b.target;(re.classList.contains(Ee.thumbsWrapper)||re.classList.contains(Ee.thumbsContainer))&&Z(b)};a.useEffect(()=>{if(!e)return;const b=re=>{var C,U;if(re.key==="Escape"){ce();return}if(re.key==="ArrowRight"){L(X=>(X+1)%Math.max(n.length,1)),(C=f.current)==null||C.go("+1");return}re.key==="ArrowLeft"&&(L(X=>(X-1+Math.max(n.length,1))%Math.max(n.length,1)),(U=f.current)==null||U.go("-1"))};return window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}},[e,ce,n.length]),a.useEffect(()=>{if(e){if(L(0),P(re=>re+1),j.current=!1,x(!1),k(!1),q({}),!be)return;const b=new CustomEvent("page-overlay",{detail:{itemId:be}});window.dispatchEvent(b)}return()=>{te.current&&ie.current&&(te.current.removeEventListener("animationend",ie.current),ie.current=null),k(!1)}},[e,be]),a.useEffect(()=>{M.current!==null&&M.current!==D.type&&P(b=>b+1),M.current=D.type},[D.type]),a.useEffect(()=>{if(!e)return;const b=document.body.style.overflow,re=window.matchMedia("(max-width: 768px)").matches,C=za(pe.color);document.body.style.overflow="hidden",k(!1);const U=se=>{se.target===te.current&&!j.current&&se.animationName&&(re&&!s&&C>.9&&(document.body.style.backgroundColor=pe.color),k(!0),te.current&&G.current&&te.current.removeEventListener("animationend",G.current),G.current=null)};te.current&&(G.current=U,te.current.addEventListener("animationend",U));const X=se=>{const le=se.target;le&&(le.closest(`.${Ee.thumbsWrapper}`)||le.closest(`.${Ee.thumbsContainer}`))||D.type!=="slide"&&se.preventDefault()};return document.addEventListener("touchmove",X,{passive:!1}),()=>{document.body.style.overflow=b,document.removeEventListener("touchmove",X),te.current&&G.current&&(te.current.removeEventListener("animationend",G.current),G.current=null),k(!1)}},[e,s,pe.color,D.type]),a.useEffect(()=>{if(!e)return;const b=re=>{var U,X;if(j.current){re.stopPropagation();return}if(H.current){H.current=!1;return}const C=re.target;if(!(C&&(C.closest(`.${Ee.thumbsContainer}`)||C.closest(`.${Ee.thumbItem}`)||C.closest(`.${Ee.arrow}`)||C.closest(`.${Ee.closeButton}`)||C.closest(`.${Ee.caption}`)))){if(D.type==="slide"&&Q.type==="drag"&&((X=(U=f.current)==null?void 0:U.splide)!=null&&X.root)){const se=f.current.splide.root;if(C&&(se.contains(C)||se===C))return}if(re.touches.length===0&&re.changedTouches.length>0){const se=n[I],le=(se==null?void 0:se.image.objectFit)==="cover",ye=re.changedTouches[0];let We;if(le&&_.current){const Me=Ba(_.current);We=ye.clientX>=Me.left&&ye.clientX<=Me.right&&ye.clientY>=Me.top&&ye.clientY<=Me.bottom}else{const Me=_.current?ja(_.current):null;if(!Me)return;We=ye.clientX>=Me.x&&ye.clientX<=Me.x+Me.width&&ye.clientY>=Me.y&&ye.clientY<=Me.y+Me.height}if(!We){re.stopPropagation(),j.current=!0;const Me=B=>{B.stopPropagation(),B.preventDefault(),document.removeEventListener("click",Me,!0)};document.addEventListener("click",Me,!0),ce()}}}};return document.addEventListener("touchend",b,{passive:!0}),()=>{document.removeEventListener("touchend",b)}},[e,ce,I,n]);const Le=(D.type==="scale"||D.type==="fade")&&D.direction==="vert"&&Q.type==="drag";a.useEffect(()=>{var B,we;if(!e||!Le||!((we=(B=f.current)==null?void 0:B.splide)!=null&&we.root))return;const b=f.current.splide.root,re=30,C=(Y,me)=>{if(z.current){const Te=Math.abs(Y-z.current.x),He=Math.abs(me-z.current.y);(Te>0||He>0)&&(H.current=!0)}},U=Y=>{z.current&&(Y.preventDefault(),C(Y.clientX,Y.clientY))},X=Y=>{z.current&&Y.touches.length>0&&(Y.preventDefault(),C(Y.touches[0].clientX,Y.touches[0].clientY))},se=(Y,me)=>{if(!z.current||!f.current){z.current=null;return}const Te=Math.abs(Y-z.current.x),He=Math.abs(me-z.current.y);He>re&&He>Te&&f.current.go(me<z.current.y?"+1":"-1"),z.current=null},le=Y=>{z.current&&se(Y.clientX,Y.clientY),document.removeEventListener("pointerup",le),document.removeEventListener("pointercancel",le),document.removeEventListener("pointermove",U)},ye=Y=>{if(z.current){if(Y.changedTouches.length>0){const me=Y.changedTouches[0];se(me.clientX,me.clientY)}document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),document.removeEventListener("touchmove",X)}},We=Y=>{z.current={x:Y.clientX,y:Y.clientY},H.current=!1,document.addEventListener("pointermove",U,{passive:!1}),document.addEventListener("pointerup",le),document.addEventListener("pointercancel",le)},Me=Y=>{Y.touches.length>0&&(z.current={x:Y.touches[0].clientX,y:Y.touches[0].clientY},H.current=!1,document.addEventListener("touchmove",X,{passive:!1}),document.addEventListener("touchend",ye),document.addEventListener("touchcancel",ye))};return b.addEventListener("pointerdown",We),b.addEventListener("touchstart",Me),()=>{b.removeEventListener("pointerdown",We),b.removeEventListener("touchstart",Me),document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",le),document.removeEventListener("pointercancel",le),document.removeEventListener("touchmove",X),document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),z.current=null,H.current=!1}},[e,Le,R]);const $e={backgroundColor:pe.color,backdropFilter:`blur(${pe.blur}px)`,animationDuration:`${parseInt(J.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Mi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:te,className:it(Ee.background,O?ge:ne,{[Ee.editor]:s},{[Ee.hidden]:!e}),style:{...$e,...N&&!s&&!O?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?te:null,className:it(Ee.contentStyle,O?ee:Ne,{[Ee.editor]:s},{[Ee.hidden]:!e}),style:{animationDuration:`${parseInt(J.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(ua,{onMove:b=>L(b.index),ref:f,className:Ee.lightboxSplide,options:{arrows:!1,speed:D.duration?parseInt(D.duration):500,direction:D.direction==="horiz"||D.type==="fade"||D.type==="scale"?"ltr":"ttb",pagination:!1,drag:Q.type==="drag"&&!Le,perPage:1,width:"100%",height:"100%",type:D.type==="fade"||D.type==="scale"?"fade":"loop",padding:0,rewind:Q.repeat!=="close",start:0},style:{"--splide-speed":D.duration},children:n.map((b,re)=>{const C=xo(ve.position,ve.offset,s),U=`${F.scalingValue(ve.padding.top,s)} ${F.scalingValue(ve.padding.right,s)} ${F.scalingValue(ve.padding.bottom,s)} ${F.scalingValue(ve.padding.left,s)}`,X=D.type==="scale"?(()=>{const{transform:se,...le}=C;return{...le,position:"absolute",padding:U,boxSizing:"border-box","--position-transform":se||"none"}})():{...C,position:"absolute",padding:U,boxSizing:"border-box"};return r.jsx(pa,{children:r.jsx("div",{className:Ee.imgWrapper,onClick:Z,children:r.jsx("img",{ref:re===I?_:null,className:it(Ee.imageStyle,{[Ee.contain]:b.image.objectFit==="contain",[Ee.cover]:b.image.objectFit==="cover",[Ee.scaleSlide]:D.type==="scale"}),src:b.image.url,alt:b.image.name??"",style:{...X,pointerEvents:b.image.objectFit==="contain"?"none":"auto"}})})},re)})},R),g.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:it(Ee.arrow,{[Ee.arrowVertical]:D.direction==="vert"}),style:{color:g.color,"--arrow-hover-color":g.hover},children:r.jsxs("button",{className:Ee.arrowInner,style:{transform:`translate(${F.scalingValue(g.offset.x,s)}, ${F.scalingValue(g.offset.y*(D.direction==="horiz"?1:-1),s)}) scale(${g.scale}) rotate(${D.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var b;return(b=f.current)==null?void 0:b.go("-1")},"aria-label":"Previous",children:[g.arrowsImgUrl&&r.jsx(tn,{url:g.arrowsImgUrl,fill:g.color,hoverFill:g.hover,className:it(Ee.arrowImg,Ee.mirror)}),!g.arrowsImgUrl&&r.jsx(Da,{color:g.color,className:it(Ee.arrowIcon,Ee.arrowImg,Ee.mirror)})]})}),r.jsx("div",{className:it(Ee.arrow,Ee.nextArrow,{[Ee.arrowVertical]:D.direction==="vert"}),style:{color:g.color,"--arrow-hover-color":g.hover},children:r.jsxs("button",{className:Ee.arrowInner,style:{transform:`translate(${F.scalingValue(g.offset.x*(D.direction==="horiz"?-1:1),s)}, ${F.scalingValue(g.offset.y,s)}) scale(${g.scale}) rotate(${D.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var b;return(b=f.current)==null?void 0:b.go("+1")},"aria-label":"Next",children:[g.arrowsImgUrl&&r.jsx(tn,{url:g.arrowsImgUrl,fill:g.color,hoverFill:g.hover,className:Ee.arrowImg}),!g.arrowsImgUrl&&r.jsx(Da,{color:g.color,className:it(Ee.arrowIcon,Ee.arrowImg)})]})})]}),pe.closeIconUrl&&(()=>{const b=xo(pe.closeIconAlign,pe.closeIconOffset,s),re=`scale(${pe.closeIconScale})`,C=b.transform?`${b.transform} ${re}`:re;return r.jsx("button",{className:Ee.closeButton,style:{...b,transform:C},onClick:ce,"aria-label":"Close lightbox",children:r.jsx(tn,{url:pe.closeIconUrl,fill:pe.closeIconColor??"#000000",hoverFill:pe.closeIconHover??"#cccccc"})})})(),fe&&fe.isActive&&i.imageCaption&&((ke=n[I])==null?void 0:ke.imageCaption)&&r.jsx("div",{className:Ee.caption,style:{...xo(fe.alignment,fe.offset,s),fontFamily:or(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":F.scalingValue(c.width,s),letterSpacing:F.scalingValue(m,s),wordSpacing:F.scalingValue(E,s),textAlign:y,fontSize:F.scalingValue(T.fontSize,s),lineHeight:F.scalingValue(T.lineHeight,s),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:v},onClick:b=>b.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Ee.captionTextInner,style:{"--link-color":fe.linkColor,"--link-hover-color":fe.linkHoverColor},children:r.jsx(Si,{content:n[I].imageCaption})})}),ue.isActive&&(()=>{const[b,re]=ue.position.split("-"),C=D.direction==="horiz"?`${b}-left`:ue.position,U=xo(C,ue.offset,s),X=()=>{if(D.direction==="horiz"){if(re==="left")return"flex-start";if(re==="center")return"center";if(re==="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:W,className:Ee.thumbsWrapper,onClick:se=>Ce(se),style:{position:s?"absolute":"fixed",...U,...D.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:it(Ee.thumbsContainer,{[Ee.thumbsContainerVertical]:D.direction==="vert",[Ee.thumbsAlignStart]:ue.align==="start",[Ee.thumbsAlignCenter]:ue.align==="center",[Ee.thumbsAlignEnd]:ue.align==="end"}),style:{gap:F.scalingValue(ue.grid.gap,s),justifyContent:S?"flex-start":X()},children:n.map((se,le)=>{const ye=le===I,We=$[le],B=ue.grid.size*(ye?ue.activeState.scale:1),we=()=>{if(ue.fit!=="fit")return{};if(!We)return D.direction==="horiz"?{height:F.scalingValue(B,s)}:{width:F.scalingValue(B,s)};const Y=We.width/We.height;if(D.direction==="horiz"){const me=B,Te=me*Y;return{width:F.scalingValue(Te,s),height:F.scalingValue(me,s)}}else{const me=B,Te=me/Y;return{width:F.scalingValue(me,s),height:F.scalingValue(Te,s)}}};return r.jsx("button",{className:Ee.thumbItem,style:{...D.direction==="horiz"&&ue.fit!=="fit"?{height:F.scalingValue(B,s)}:{},...D.direction==="vert"&&ue.fit!=="fit"?{width:F.scalingValue(B,s)}:{},...ue.fit==="cover"?{width:F.scalingValue(B,s),height:F.scalingValue(B,s)}:{},...we(),transition:ye?"all 0.25s ease-out":"none",opacity:ye?ue.activeState.opacity/100:ue.opacity/100,"--thumb-hover":ue.activeState.opacity/100},onClick:Y=>{var me;Y.stopPropagation(),L(le),(me=f.current)==null||me.go(le)},onMouseEnter:()=>{var Y;ue.triggers==="hov"&&((Y=f.current)==null||Y.go(le))},children:r.jsx("img",{src:se.image.url,alt:se.image.name??"",onLoad:Y=>{const me=Y.currentTarget;me.naturalWidth&&me.naturalHeight&&q(Te=>({...Te,[le]:{width:me.naturalWidth,height:me.naturalHeight}}))},style:{objectFit:ue.fit==="cover"?"cover":"contain",...ue.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ue.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${se.image.name}-${le}`)})})})})()]})]}),document.getElementById(l))};function Da({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 Ku={element:qu,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 bo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Uu(e){return`
|
|
6
|
+
*/const qd="RichTextRenderer-module__link___BWeZ2",Gd={link:qd},Kd=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))},ar=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Kd(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function nn(e){const{color:t,...n}=e;return n}function Bt(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:ar(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:N.scalingValue(e.letterSpacing,t),wordSpacing:N.scalingValue(e.wordSpacing,t),fontSize:N.scalingValue(n,t),lineHeight:i!==void 0?N.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 Si=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Gd.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Ud(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 Ud(e){return{...e.fontFamily&&{fontFamily:ar(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}const Xd="SvgImage-module__svg___q3xE-",Yd="SvgImage-module__img___VsTm-",za={svg:Xd,img:Yd},Jd=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Zd=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,on=({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)}},[]),!Jd(e)||!l?r.jsx("img",{src:e,alt:"",className:at(za.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:at(za.svg,i),style:{"--svg":Zd(e),"--fill":t,"--hover-fill":n,...o??{}}})},Qd={"top-left":je.topLeftAlignment,"top-center":je.topCenterAlignment,"top-right":je.topRightAlignment,"middle-left":je.middleLeftAlignment,"middle-center":je.middleCenterAlignment,"middle-right":je.middleRightAlignment,"bottom-left":je.bottomLeftAlignment,"bottom-center":je.bottomCenterAlignment,"bottom-right":je.bottomRightAlignment};function eu({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=a.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:m,fontSizeLineHeight:y,textAppearance:w,color:$}=n.imageCaption??{},[h,v]=a.useState(void 0),[S,C]=a.useState(null),[E,M]=a.useState(0),[H,x]=a.useState(0),{direction:j,transition:P,controls:T,pagination:G,imageCaption:f,triggers:A}=e,_=a.useRef(P.type),{x:V,y:te}=e.controls.offset,ne=K=>{o&&o.go(K)};return a.useEffect(()=>{if(!S)return;const K=new ResizeObserver(B=>{if(!o)return;const[F]=B;v({width:Math.round(F.contentRect.width),height:Math.round(F.contentRect.height)})});return K.observe(S),()=>K.unobserve(S)},[S]),a.useEffect(()=>{!o||_.current===P.type||(x(K=>K+1),_.current=P.type)},[P.type]),r.jsx("div",{className:at(je.wrapper,{[je.editor]:i}),ref:C,children:r.jsxs("div",{className:je.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:P.backgroundColor&&P.type==="fade in"?P.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:at(je.captionBlock),children:r.jsx("div",{className:je.captionTextWrapper,children:t.map((K,B)=>r.jsx("div",{className:at(je.captionText,Qd[f.alignment],{[je.withPointerEvents]:B===E&&i,[je.active]:B===E}),style:{fontFamily:ar(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":N.scalingValue(s.width,i),letterSpacing:N.scalingValue(c,i),wordSpacing:N.scalingValue(m,i),textAlign:u,fontSize:N.scalingValue(y.fontSize,i),lineHeight:N.scalingValue(y.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:$,transitionDuration:P.duration?`${Math.round(parseInt(P.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:je.captionTextInner,style:{"--link-hover-color":f.linkHoverColor,"--link-color":f.linkColor,position:"relative",top:N.scalingValue(f.offset.y,i),left:N.scalingValue(f.offset.x,i)},children:r.jsx(Si,{content:K.imageCaption})})},B))})}),r.jsx(fa,{onMove:K=>{M(K.index)},ref:l,options:{arrows:!1,speed:P.duration?parseInt(P.duration):500,autoplay:A.autoPlay!==null,...A.autoPlay!==null&&{interval:parseInt(A.autoPlay)*1e3},direction:j==="horiz"||P.type==="fade in"?"ltr":"ttb",pagination:!1,drag:A.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:P.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((K,B)=>r.jsx(ya,{children:r.jsx("div",{className:je.sliderItem,children:r.jsx("div",{className:je.imgWrapper,children:r.jsx("img",{className:at(je.sliderImage,{[je.contain]:K.image.objectFit==="contain",[je.cover]:K.image.objectFit==="cover"}),src:K.image.url,alt:K.image.name??""})})})},B))},H),T.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:at(je.arrow,{[je.arrowVertical]:j==="vert",[je.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:r.jsxs("button",{onClick:()=>{ne("-1")},className:je.arrowInner,style:{transform:`translate(${N.scalingValue(V,i)}, ${N.scalingValue(te*(j==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&r.jsx(on,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:at(je.arrowImg,je.mirror)}),!T.arrowsImgUrl&&r.jsx(Da,{color:T.color,className:at(je.arrowIcon,je.arrowImg,je.mirror)})]})}),r.jsx("div",{className:at(je.arrow,je.nextArrow,{[je.arrowVertical]:j==="vert",[je.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:r.jsxs("button",{className:je.arrowInner,onClick:()=>ne("+1"),style:{transform:`translate(${N.scalingValue(V*(j==="horiz"?-1:1),i)}, ${N.scalingValue(te,i)}) scale(${e.controls.scale/100}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&r.jsx(on,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:je.arrowImg}),!T.arrowsImgUrl&&r.jsx(Da,{color:T.color,className:at(je.arrowIcon,je.arrowImg)})]})})]}),A.triggersList.click&&r.jsx("div",{className:je.clickOverlay,onClick:()=>{o&&o.go("+1")}}),G.isActive&&r.jsx("div",{className:at(je.pagination,{[je.paginationInsideBottom]:G.position==="inside-1"&&j==="horiz",[je.paginationInsideTop]:G.position==="inside-2"&&j==="horiz",[je.paginationOutsideBottom]:G.position==="outside-1"&&j==="horiz",[je.paginationOutsideTop]:G.position==="outside-2"&&j==="horiz",[je.paginationInsideLeft]:G.position==="inside-1"&&j==="vert",[je.paginationInsideRight]:G.position==="inside-2"&&j==="vert",[je.paginationOutsideLeft]:G.position==="outside-1"&&j==="vert",[je.paginationOutsideRight]:G.position==="outside-2"&&j==="vert",[je.paginationVertical]:j==="vert"}),children:r.jsx("div",{className:je.paginationInner,style:{backgroundColor:G.colors[2],transform:`scale(${G.scale/100}) translate(${N.scalingValue(G.offset.x,i)}, ${N.scalingValue(G.offset.y,i)}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:t.map((K,B)=>r.jsx("button",{onClick:()=>{o&&o.go(B)},className:at(je.paginationItem),children:r.jsx("div",{className:at(je.dot,{[je.activeDot]:B===E}),style:{backgroundColor:B===E?G.colors[0]:G.colors[1],"--pagination-hover-color":G.hover}})},B))})})]})})}function Da({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 tu={element:eu,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"]}},nu="ImageRevealSlider-module__imageRevealSlider___UE5Ob",iu="ImageRevealSlider-module__image___Qjt-e",ou="ImageRevealSlider-module__link___N-iLG",ru="ImageRevealSlider-module__cursor___2U03d",di={imageRevealSlider:nu,image:iu,link:ou,cursor:ru};function Va(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 br(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function au(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await br(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await br(e);l=s.height/s.width*o}else{const s=await br(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function su({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),[m,y]=a.useState({x:0,y:0}),[w,$]=a.useState(1),[h,v]=a.useState("none"),S=a.useRef({x:0,y:0}),[C,E]=a.useState(!1),{sizeType:M,imageWidth:H,randomRangeImageWidth:x}=e.imageSize,{revealPosition:j,visible:P}=e.position,{cursorType:T,target:G,defaultCursorScale:f,defaultCursor:A,hoverCursorScale:_,hoverCursor:V}=e.cursor;a.useEffect(()=>{if(!i)return;const K=(I,R)=>{const U=i.getBoundingClientRect(),D=I-U.left,ee=R-U.top;if(y({x:D,y:ee}),T==="system"){v("none"),$(1);return}const O=D,pe=ee,g=document.elementFromPoint(U.left+O,U.top+pe);if(g&&g.closest("a")){v("none"),$(1);return}const ue=Va(O,pe,l)||G==="area"?{img:V??"none",scale:_}:{img:A??"none",scale:f};v(ue.img),$(ue.scale)},B=I=>{I.stopPropagation(),S.current={x:I.clientX,y:I.clientY},K(I.clientX,I.clientY)},F=()=>{C&&K(S.current.x,S.current.y)};return i.addEventListener("mousemove",B),window.addEventListener("scroll",F,!0),()=>{i.removeEventListener("mousemove",B),window.removeEventListener("scroll",F,!0)}},[i,C,m,T,G,V,A,_,f,l]),a.useEffect(()=>{C||(v("none"),$(0))},[C]);const te=async(K,B,F,I={})=>{const{width:R,height:U,finalWidth:D}=await au(K.image.url,M,H,x);let ee=0,O=0;j==="same"?(ee=B/2,O=F/2):(ee=I.x??Math.random()*B,O=I.y??Math.random()*F);const pe=Math.min(Math.max(ee,R/2),B-R/2),g=Math.min(Math.max(O,U/2),F-U/2);return{id:u.current++,url:K.image.url,link:K.link,name:K.image.name,x:pe,y:g,width:D}};a.useEffect(()=>{if(!i||t.length===0)return;const K=i.getBoundingClientRect(),B=K.width,F=K.height,I=[];(async()=>{const U=t[0],D=await te(U,B,F);I.push(D),s(I),c(1)})()},[M,H,x,j,i]),a.useEffect(()=>{P==="last One"&&s(K=>K.length>0?[K[K.length-1]]:[])},[P]);const ne=async K=>{if(!i)return;const B=i.getBoundingClientRect(),F=K.clientX-B.left,I=K.clientY-B.top;if(G==="image"&&!Va(F,I,l))return;let R=0,U=0;j==="on Click"?(R=F,U=I):j==="same"?(R=B.width/2,U=B.height/2):(R=Math.random()*B.width,U=Math.random()*B.height);const D=t[d],ee=await te(D,B.width,B.height,{x:R,y:U});s(O=>P==="all"?[...O,ee]:[ee]),c(O=>O>=t.length-1?0:O+1)};return r.jsxs("div",{ref:o,onClick:ne,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),className:di.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[l.map(K=>r.jsx("div",{className:di.wrapper,style:{top:`${K.y}px`,left:`${K.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:K.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:G==="area"&&K.link?r.jsx("a",{href:K.link,target:"_blank",className:di.link,children:r.jsx("img",{src:K.url,alt:K.name,className:di.image},K.id)}):r.jsx("img",{src:K.url,alt:K.name,className:di.image},K.id)},K.id)),C&&r.jsx("div",{className:di.cursor,style:{left:`${m.x}px`,top:`${m.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const lu={element:su,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:""}]}}}},cu="LightBox-module__hidden___9s-9x",du="LightBox-module__heroImage___sTxNF",uu="LightBox-module__background___rm9ml",pu="LightBox-module__editor___4ACaY",mu="LightBox-module__contentStyle___Bgnsq",gu="LightBox-module__imageStyle___tLIlB",hu="LightBox-module__imgWrapper___LuFUp",fu="LightBox-module__contain___8-yaS",yu="LightBox-module__cover___hNvOG",vu="LightBox-module__caption___b6L2I",xu="LightBox-module__captionTextInner___rCGNH",bu="LightBox-module__lightboxSplide___XFuWC",wu="LightBox-module__arrow___iz38X",Su="LightBox-module__arrowVertical___Zfz81",$u="LightBox-module__nextArrow___zkAQN",Cu="LightBox-module__arrowInner___p48sW",Tu="LightBox-module__arrowIcon___3VaFf",Lu="LightBox-module__arrowImg___pNV88",Iu="LightBox-module__mirror___pjeXc",Ru="LightBox-module__thumbsWrapper___GB-nU",Eu="LightBox-module__thumbsContainerVertical___wttk5",Mu="LightBox-module__thumbsContainer___osSma",Pu="LightBox-module__thumbsAlignStart___MO6tY",ku="LightBox-module__thumbsAlignCenter___Q4sUx",Au="LightBox-module__thumbsAlignEnd___p4y9R",Fu="LightBox-module__thumbItem___HvnF3",Wu="LightBox-module__closeButton___g2khP",_u="LightBox-module__fadeIn___0m5GW",Nu="LightBox-module__slideInLeft___gPYwC",Hu="LightBox-module__slideInRight___S-pPp",Ou="LightBox-module__slideInTop___DFdAj",ju="LightBox-module__slideInBottom___m27kZ",Bu="LightBox-module__fadeOut___55qBR",zu="LightBox-module__slideOutLeft___NvU7P",Du="LightBox-module__slideOutRight___SK7eC",Vu="LightBox-module__slideOutTop___Vgg0z",qu="LightBox-module__slideOutBottom___nJ0Ef",Gu="LightBox-module__scaleSlide___vZriG",Ee={hidden:cu,heroImage:du,background:uu,editor:pu,contentStyle:mu,imageStyle:gu,imgWrapper:hu,contain:fu,cover:yu,caption:vu,captionTextInner:xu,lightboxSplide:bu,arrow:wu,arrowVertical:Su,nextArrow:$u,arrowInner:Cu,arrowIcon:Tu,arrowImg:Lu,mirror:Iu,thumbsWrapper:Ru,thumbsContainerVertical:Eu,thumbsContainer:Mu,thumbsAlignStart:Pu,thumbsAlignCenter:ku,thumbsAlignEnd:Au,thumbItem:Fu,closeButton:Wu,fadeIn:_u,slideInLeft:Nu,slideInRight:Hu,slideInTop:Ou,slideInBottom:ju,fadeOut:Bu,slideOutLeft:zu,slideOutRight:Du,slideOutTop:Vu,slideOutBottom:qu,scaleSlide:Gu},wo=(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% + ${N.scalingValue(t.x,n)}), calc(-50% + ${N.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${N.scalingValue(t.x,n)}, calc(-50% + ${N.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${N.scalingValue(t.x,n)}), ${N.scalingValue(t.y,n)})`:i.transform=`translate(${N.scalingValue(t.x,n)}, ${N.scalingValue(t.y,n)})`,i};function vl(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 qr(e){const t=e.getBoundingClientRect(),n=vl(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,d=i/o,c=l/s;let u,m;c>d?(u=i,m=i/c):(m=o,u=o*c);const y=t.left+n.left,w=t.top+n.top,$=(i-u)/2+y,h=(o-m)/2+w;return{x:$,y:h,width:u,height:m}}function qa(e){const t=e.getBoundingClientRect(),n=vl(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ga(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 Ku(e,t){const n=(()=>{if(e==="fade in")return Ee.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ee.slideInLeft;case"right":return Ee.slideInRight;case"top":return Ee.slideInTop;case"bottom":return Ee.slideInBottom;default:return Ee.slideInRight}return Ee.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ee.fadeIn;if(e==="slide in")switch(t){case"left":return Ee.slideInLeft;case"right":return Ee.slideInRight;case"top":return Ee.slideInTop;case"bottom":return Ee.slideInBottom;default:return Ee.slideInRight}return Ee.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ee.fadeOut;if(e==="slide in")switch(t){case"left":return Ee.slideOutLeft;case"right":return Ee.slideOutRight;case"top":return Ee.slideOutTop;case"bottom":return Ee.slideOutBottom;default:return Ee.slideOutRight}return Ee.fadeOut})(),l=(()=>{if(e==="fade in")return Ee.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ee.slideOutLeft;case"right":return Ee.slideOutRight;case"top":return Ee.slideOutTop;case"bottom":return Ee.slideOutBottom;default:return Ee.slideOutRight}return Ee.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const Uu=({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:Ee.heroImage,onClick:()=>c(!0)}),r.jsx(Xu,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},Xu=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var Ce;const{widthSettings:c,fontSettings:u,letterSpacing:m,textAlign:y,wordSpacing:w,fontSizeLineHeight:$,textAppearance:h,color:v}=i.imageCaption??{},[S,C]=a.useState(0),[E,M]=a.useState(0),[H,x]=a.useState(!1),[j,P]=a.useState(!1),[T,G]=a.useState({}),f=a.useRef(null),A=a.useRef(null),_=a.useRef(null),V=a.useRef(!1),te=a.useRef(null),ne=a.useRef(null),K=a.useRef(null),B=a.useRef(null),F=a.useRef(!1),I=a.useRef(null),[R,U]=a.useState(!1),{appear:D,triggers:ee,slider:O,thumbnail:pe,controls:g,area:ue,caption:me,layout:we}=o.lightboxBlock,{appearClass:_e,backdropAppearClass:oe,backdropDisappearClass:ye,disappearClass:X}=Ku(D.type,D.direction),be=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const W=()=>{setTimeout(()=>{var L,Y;(Y=(L=f.current)==null?void 0:L.splide)==null||Y.refresh()},16)},Q=()=>{M(L=>L+1)};return window.addEventListener("ArticleEditor.Layout:change",W),window.addEventListener("ArticleEditor.ComponentContent:change",Q),()=>{window.removeEventListener("ArticleEditor.Layout:change",W),window.removeEventListener("ArticleEditor.ComponentContent:change",Q)}},[]),a.useEffect(()=>{if(!e||!pe.isActive){U(!1);return}const W=I.current;if(!W)return;const Q=()=>{O.direction==="horiz"?U(W.scrollWidth>W.clientWidth):U(W.scrollHeight>W.clientHeight)};Q();const L=new ResizeObserver(Q);return L.observe(W),()=>L.disconnect()},[e,pe.isActive,n.length,T,O.direction]);const ce=a.useCallback(()=>{const W=window.matchMedia("(max-width: 768px)").matches,Q=Ga(ue.color);W&&!s&&Q>.9&&(document.body.style.backgroundColor=""),x(!0),V.current=!0;const L=Y=>{Y.target===te.current&&Y.animationName&&(te.current&&ne.current&&te.current.removeEventListener("animationend",ne.current),ne.current=null,V.current&&(V.current=!1,t()),x(!1))};te.current&&(ne.current=L,te.current.addEventListener("animationend",L))},[t,ue.color,s]),ge=(W,Q,L)=>{var Y,J;if(W){if(ee.type==="click"&&ee.switch==="image")ee.repeat==="close"&&S===n.length-1?ce():(Y=f.current)==null||Y.go("+1");else if(ee.type==="click"&&ee.switch==="50/50"){const de=W.getBoundingClientRect(),le=Q-de.left,ie=L-de.top,Re=de.width,Se=de.height;let z;O.direction==="horiz"?z=le<Re/2?"-1":"+1":z=ie<Se/2?"-1":"+1",(J=f.current)==null||J.go(z)}}},se=W=>{if(F.current){F.current=!1;return}const Q=n[S],L=(Q==null?void 0:Q.image.objectFit)==="cover";let Y,J;if("changedTouches"in W&&W.changedTouches.length>0)Y=W.changedTouches[0].clientX,J=W.changedTouches[0].clientY;else if("clientX"in W)Y=W.clientX,J=W.clientY;else return;let de;if(L&&_.current){const le=qa(_.current);de=Y>=le.left&&Y<=le.right&&J>=le.top&&J<=le.bottom}else{const le=_.current?qr(_.current):null;if(!le){W.target===W.currentTarget&&ce();return}de=Y>=le.x&&Y<=le.x+le.width&&J>=le.y&&J<=le.y+le.height}de?ge(_.current,Y,J):ce()},Ie=W=>{const Q=W.target;(Q.classList.contains(Ee.thumbsWrapper)||Q.classList.contains(Ee.thumbsContainer))&&se(W)};a.useEffect(()=>{if(!e)return;const W=Q=>{var L,Y;if(Q.key==="Escape"){ce();return}if(Q.key==="ArrowRight"){C(J=>(J+1)%Math.max(n.length,1)),(L=f.current)==null||L.go("+1");return}Q.key==="ArrowLeft"&&(C(J=>(J-1+Math.max(n.length,1))%Math.max(n.length,1)),(Y=f.current)==null||Y.go("-1"))};return window.addEventListener("keydown",W),()=>{window.removeEventListener("keydown",W)}},[e,ce,n.length]),a.useEffect(()=>{if(e){if(C(0),M(Q=>Q+1),V.current=!1,x(!1),P(!1),G({}),!be)return;const W=new CustomEvent("page-overlay",{detail:{itemId:be}});window.dispatchEvent(W)}return()=>{te.current&&ne.current&&(te.current.removeEventListener("animationend",ne.current),ne.current=null),P(!1)}},[e,be]),a.useEffect(()=>{A.current!==null&&A.current!==O.type&&M(W=>W+1),A.current=O.type},[O.type]),a.useEffect(()=>{if(!e)return;const W=document.body.style.overflow,Q=window.matchMedia("(max-width: 768px)").matches,L=Ga(ue.color);document.body.style.overflow="hidden",P(!1);const Y=de=>{de.target===te.current&&!V.current&&de.animationName&&(Q&&!s&&L>.9&&(document.body.style.backgroundColor=ue.color),P(!0),te.current&&K.current&&te.current.removeEventListener("animationend",K.current),K.current=null)};te.current&&(K.current=Y,te.current.addEventListener("animationend",Y));const J=de=>{const le=de.target;le&&(le.closest(`.${Ee.thumbsWrapper}`)||le.closest(`.${Ee.thumbsContainer}`))||O.type!=="slide"&&de.preventDefault()};return document.addEventListener("touchmove",J,{passive:!1}),()=>{document.body.style.overflow=W,document.removeEventListener("touchmove",J),te.current&&K.current&&(te.current.removeEventListener("animationend",K.current),K.current=null),P(!1)}},[e,s,ue.color,O.type]),a.useEffect(()=>{if(!e)return;const W=Q=>{var Y,J;if(V.current){Q.stopPropagation();return}if(F.current){F.current=!1;return}const L=Q.target;if(!(L&&(L.closest(`.${Ee.thumbsContainer}`)||L.closest(`.${Ee.thumbItem}`)||L.closest(`.${Ee.arrow}`)||L.closest(`.${Ee.closeButton}`)||L.closest(`.${Ee.caption}`)))){if(O.type==="slide"&&ee.type==="drag"&&((J=(Y=f.current)==null?void 0:Y.splide)!=null&&J.root)){const de=f.current.splide.root;if(L&&(de.contains(L)||de===L))return}if(Q.touches.length===0&&Q.changedTouches.length>0){const de=n[S],le=(de==null?void 0:de.image.objectFit)==="cover",ie=Q.changedTouches[0];let Re;if(le&&_.current){const Se=qa(_.current);Re=ie.clientX>=Se.left&&ie.clientX<=Se.right&&ie.clientY>=Se.top&&ie.clientY<=Se.bottom}else{const Se=_.current?qr(_.current):null;if(!Se)return;Re=ie.clientX>=Se.x&&ie.clientX<=Se.x+Se.width&&ie.clientY>=Se.y&&ie.clientY<=Se.y+Se.height}if(!Re){Q.stopPropagation(),V.current=!0;const Se=z=>{z.stopPropagation(),z.preventDefault(),document.removeEventListener("click",Se,!0)};document.addEventListener("click",Se,!0),ce()}}}};return document.addEventListener("touchend",W,{passive:!0}),()=>{document.removeEventListener("touchend",W)}},[e,ce,S,n]);const Fe=(O.type==="scale"||O.type==="fade")&&O.direction==="vert"&&ee.type==="drag";a.useEffect(()=>{var z,Te;if(!e||!Fe||!((Te=(z=f.current)==null?void 0:z.splide)!=null&&Te.root))return;const W=f.current.splide.root,Q=30,L=(Z,fe)=>{if(B.current){const ve=Math.abs(Z-B.current.x),ke=Math.abs(fe-B.current.y);(ve>0||ke>0)&&(F.current=!0)}},Y=Z=>{B.current&&(Z.preventDefault(),L(Z.clientX,Z.clientY))},J=Z=>{B.current&&Z.touches.length>0&&(Z.preventDefault(),L(Z.touches[0].clientX,Z.touches[0].clientY))},de=(Z,fe)=>{if(!B.current||!f.current){B.current=null;return}const ve=Math.abs(Z-B.current.x),ke=Math.abs(fe-B.current.y);ke>Q&&ke>ve&&f.current.go(fe<B.current.y?"+1":"-1"),B.current=null},le=Z=>{B.current&&de(Z.clientX,Z.clientY),document.removeEventListener("pointerup",le),document.removeEventListener("pointercancel",le),document.removeEventListener("pointermove",Y)},ie=Z=>{if(B.current){if(Z.changedTouches.length>0){const fe=Z.changedTouches[0];de(fe.clientX,fe.clientY)}document.removeEventListener("touchend",ie),document.removeEventListener("touchcancel",ie),document.removeEventListener("touchmove",J)}},Re=Z=>{B.current={x:Z.clientX,y:Z.clientY},F.current=!1,document.addEventListener("pointermove",Y,{passive:!1}),document.addEventListener("pointerup",le),document.addEventListener("pointercancel",le)},Se=Z=>{Z.touches.length>0&&(B.current={x:Z.touches[0].clientX,y:Z.touches[0].clientY},F.current=!1,document.addEventListener("touchmove",J,{passive:!1}),document.addEventListener("touchend",ie),document.addEventListener("touchcancel",ie))};return W.addEventListener("pointerdown",Re),W.addEventListener("touchstart",Se),()=>{W.removeEventListener("pointerdown",Re),W.removeEventListener("touchstart",Se),document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",le),document.removeEventListener("pointercancel",le),document.removeEventListener("touchmove",J),document.removeEventListener("touchend",ie),document.removeEventListener("touchcancel",ie),B.current=null,F.current=!1}},[e,Fe,E]);const he={backgroundColor:ue.color,backdropFilter:`blur(${ue.blur}px)`,animationDuration:`${parseInt(D.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Pi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:te,className:at(Ee.background,H?ye:oe,{[Ee.editor]:s},{[Ee.hidden]:!e}),style:{...he,...j&&!s&&!H?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?te:null,className:at(Ee.contentStyle,H?X:_e,{[Ee.editor]:s},{[Ee.hidden]:!e}),style:{animationDuration:`${parseInt(D.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(fa,{onMove:W=>C(W.index),ref:f,className:Ee.lightboxSplide,options:{arrows:!1,speed:O.duration?parseInt(O.duration):500,direction:O.direction==="horiz"||O.type==="fade"||O.type==="scale"?"ltr":"ttb",pagination:!1,drag:ee.type==="drag"&&!Fe,perPage:1,width:"100%",height:"100%",type:O.type==="fade"||O.type==="scale"?"fade":"loop",padding:0,rewind:ee.repeat!=="close",start:0},style:{"--splide-speed":O.duration},children:n.map((W,Q)=>{const L=wo(we.position,we.offset,s),Y=`${N.scalingValue(we.padding.top,s)} ${N.scalingValue(we.padding.right,s)} ${N.scalingValue(we.padding.bottom,s)} ${N.scalingValue(we.padding.left,s)}`,J=O.type==="scale"?(()=>{const{transform:de,...le}=L;return{...le,position:"absolute",padding:Y,boxSizing:"border-box","--position-transform":de||"none"}})():{...L,position:"absolute",padding:Y,boxSizing:"border-box"};return r.jsx(ya,{children:r.jsx("div",{className:Ee.imgWrapper,onClick:se,children:r.jsx("img",{ref:Q===S?_:null,className:at(Ee.imageStyle,{[Ee.contain]:W.image.objectFit==="contain",[Ee.cover]:W.image.objectFit==="cover",[Ee.scaleSlide]:O.type==="scale"}),src:W.image.url,alt:W.image.name??"",style:{...J,pointerEvents:W.image.objectFit==="contain"?"none":"auto"}})})},Q)})},E),g.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:at(Ee.arrow,{[Ee.arrowVertical]:O.direction==="vert"}),style:{color:g.color,"--arrow-hover-color":g.hover},children:r.jsxs("button",{className:Ee.arrowInner,style:{transform:`translate(${N.scalingValue(g.offset.x,s)}, ${N.scalingValue(g.offset.y*(O.direction==="horiz"?1:-1),s)}) scale(${g.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var W;return(W=f.current)==null?void 0:W.go("-1")},"aria-label":"Previous",children:[g.arrowsImgUrl&&r.jsx(on,{url:g.arrowsImgUrl,fill:g.color,hoverFill:g.hover,className:at(Ee.arrowImg,Ee.mirror)}),!g.arrowsImgUrl&&r.jsx(Ka,{color:g.color,className:at(Ee.arrowIcon,Ee.arrowImg,Ee.mirror)})]})}),r.jsx("div",{className:at(Ee.arrow,Ee.nextArrow,{[Ee.arrowVertical]:O.direction==="vert"}),style:{color:g.color,"--arrow-hover-color":g.hover},children:r.jsxs("button",{className:Ee.arrowInner,style:{transform:`translate(${N.scalingValue(g.offset.x*(O.direction==="horiz"?-1:1),s)}, ${N.scalingValue(g.offset.y,s)}) scale(${g.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var W;return(W=f.current)==null?void 0:W.go("+1")},"aria-label":"Next",children:[g.arrowsImgUrl&&r.jsx(on,{url:g.arrowsImgUrl,fill:g.color,hoverFill:g.hover,className:Ee.arrowImg}),!g.arrowsImgUrl&&r.jsx(Ka,{color:g.color,className:at(Ee.arrowIcon,Ee.arrowImg)})]})})]}),ue.closeIconUrl&&(()=>{const W=wo(ue.closeIconAlign,ue.closeIconOffset,s),Q=`scale(${ue.closeIconScale})`,L=W.transform?`${W.transform} ${Q}`:Q;return r.jsx("button",{className:Ee.closeButton,style:{...W,transform:L},onClick:ce,"aria-label":"Close lightbox",children:r.jsx(on,{url:ue.closeIconUrl,fill:ue.closeIconColor??"#000000",hoverFill:ue.closeIconHover??"#cccccc"})})})(),me&&me.isActive&&i.imageCaption&&((Ce=n[S])==null?void 0:Ce.imageCaption)&&r.jsx("div",{className:Ee.caption,style:{...wo(me.alignment,me.offset,s),fontFamily:ar(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":N.scalingValue(c.width,s),letterSpacing:N.scalingValue(m,s),wordSpacing:N.scalingValue(w,s),textAlign:y,fontSize:N.scalingValue($.fontSize,s),lineHeight:N.scalingValue($.lineHeight,s),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:v},onClick:W=>W.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Ee.captionTextInner,style:{"--link-color":me.linkColor,"--link-hover-color":me.linkHoverColor},children:r.jsx(Si,{content:n[S].imageCaption})})}),pe.isActive&&(()=>{const[W,Q]=pe.position.split("-"),L=O.direction==="horiz"?`${W}-left`:pe.position,Y=wo(L,pe.offset,s),J=()=>{if(O.direction==="horiz"){if(Q==="left")return"flex-start";if(Q==="center")return"center";if(Q==="right")return"flex-end"}else{if(W==="top")return"flex-start";if(W==="middle")return"center";if(W==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:I,className:Ee.thumbsWrapper,onClick:de=>Ie(de),style:{position:s?"absolute":"fixed",...Y,...O.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:at(Ee.thumbsContainer,{[Ee.thumbsContainerVertical]:O.direction==="vert",[Ee.thumbsAlignStart]:pe.align==="start",[Ee.thumbsAlignCenter]:pe.align==="center",[Ee.thumbsAlignEnd]:pe.align==="end"}),style:{gap:N.scalingValue(pe.grid.gap,s),justifyContent:R?"flex-start":J()},children:n.map((de,le)=>{const ie=le===S,Re=T[le],z=pe.grid.size*(ie?pe.activeState.scale:1),Te=()=>{if(pe.fit!=="fit")return{};if(!Re)return O.direction==="horiz"?{height:N.scalingValue(z,s)}:{width:N.scalingValue(z,s)};const Z=Re.width/Re.height;if(O.direction==="horiz"){const fe=z,ve=fe*Z;return{width:N.scalingValue(ve,s),height:N.scalingValue(fe,s)}}else{const fe=z,ve=fe/Z;return{width:N.scalingValue(fe,s),height:N.scalingValue(ve,s)}}};return r.jsx("button",{className:Ee.thumbItem,style:{...O.direction==="horiz"&&pe.fit!=="fit"?{height:N.scalingValue(z,s)}:{},...O.direction==="vert"&&pe.fit!=="fit"?{width:N.scalingValue(z,s)}:{},...pe.fit==="cover"?{width:N.scalingValue(z,s),height:N.scalingValue(z,s)}:{},...Te(),transition:ie?"all 0.25s ease-out":"none",opacity:ie?pe.activeState.opacity/100:pe.opacity/100,"--thumb-hover":pe.activeState.opacity/100},onClick:Z=>{var fe;Z.stopPropagation(),C(le),(fe=f.current)==null||fe.go(le)},onMouseEnter:()=>{var Z;pe.triggers==="hov"&&((Z=f.current)==null||Z.go(le))},children:r.jsx("img",{src:de.image.url,alt:de.image.name??"",onLoad:Z=>{const fe=Z.currentTarget;fe.naturalWidth&&fe.naturalHeight&&G(ve=>({...ve,[le]:{width:fe.naturalWidth,height:fe.naturalHeight}}))},style:{objectFit:pe.fit==="cover"?"cover":"contain",...pe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...pe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${de.image.name}-${le}`)})})})})()]})]}),document.getElementById(l))};function Ka({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 Yu={element:Uu,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 So(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ju(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: ${So(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: ${So(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: ${So(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: ${So(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 Zu({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,d=i&&t||!t,{prefix:c}=N.useScopedStyles(),{type:u="A",fieldsToShow:m=2,fields:y=[],buttonLabel:w,gap:$,fieldsGap:h,buttonCorners:v,buttonStroke:S,buttonPadding:C,isButtonFullWidth:E,inputCorners:M,inputStroke:H,inputPadding:x,inputColor:j,inputTextColor:P,inputBorderColor:T,placeholderColor:G,buttonColor:f,buttonTextColor:A,buttonBorderColor:_,labelTextColor:V,successColor:te,errorColor:ne,fontFamily:K,inputFontSettings:B,inputFontSize:F,inputLineHeight:I,inputLetterSpacing:R,inputWordSpacing:U,inputTextAppearance:D,buttonFontSettings:ee,buttonFontSize:O,buttonLineHeight:pe,buttonLetterSpacing:g,buttonWordSpacing:ue,buttonTextAppearance:me,labelFontSettings:we,labelFontSize:_e,labelLineHeight:oe,labelLetterSpacing:ye,labelWordSpacing:X,labelTextAppearance:be,statusFontSettings:ce,statusFontSize:ge,statusLineHeight:se,statusLetterSpacing:Ie,statusWordSpacing:Fe,statusTextAppearance:he,successMessage:Ce,errorMessage:W,stateOverrides:Q}=e,L=u==="B",Y=y.slice(0,Math.min(m,y.length)),J={fontSettings:{fontFamily:K,fontWeight:(B==null?void 0:B.fontWeight)??400,fontStyle:(B==null?void 0:B.fontStyle)??"normal"},fontSize:F??.01,lineHeight:I,letterSpacing:R??0,wordSpacing:U??0,textAppearance:D,color:P},de=nn(Bt(J,t)),le=N.scalingValue(H??0,t),ie=N.scalingValue((I??F??.01)+((x==null?void 0:x.top)??0)+((x==null?void 0:x.bottom)??0)+(u==="C"?H??0:(H??0)*2),t),Re={...de,borderStyle:"solid",borderRadius:u==="C"?0:N.scalingValue(M??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:le,borderLeftWidth:0}:{borderWidth:le},paddingTop:N.scalingValue((x==null?void 0:x.top)??0,t),paddingRight:N.scalingValue((x==null?void 0:x.right)??0,t),paddingBottom:N.scalingValue((x==null?void 0:x.bottom)??0,t),paddingLeft:N.scalingValue((x==null?void 0:x.left)??0,t),height:ie,minHeight:ie},Se={fontSettings:{fontFamily:K,fontWeight:(ee==null?void 0:ee.fontWeight)??400,fontStyle:(ee==null?void 0:ee.fontStyle)??"normal"},fontSize:O??.01,lineHeight:pe,letterSpacing:g??0,wordSpacing:ue??0,textAppearance:me,color:A},z=nn(Bt(Se,t)),Te=N.scalingValue(S??0,t),Z={fontSettings:{fontFamily:K,fontWeight:(we==null?void 0:we.fontWeight)??400,fontStyle:(we==null?void 0:we.fontStyle)??"normal"},fontSize:_e??.01,lineHeight:oe,letterSpacing:ye??0,wordSpacing:X??0,textAppearance:be,color:V},fe=Bt(Z,t),ve={fontSettings:{fontFamily:K,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:ge??.01,lineHeight:se,letterSpacing:Ie??0,wordSpacing:Fe??0,textAppearance:he,color:te},ke=nn(Bt(ve,t)),Qe=N.buildColorVars(c,{inputColor:j,inputTextColor:P,inputBorderColor:T,placeholderColor:G!=null&&G.trim()?G:"#cccccc",buttonColor:f,buttonTextColor:A,buttonBorderColor:_,labelTextColor:V,successColor:te,errorColor:ne},Qu,ep,Q),[Xe,ht]=a.useState(()=>Object.fromEntries(Y.map(Be=>[Be.name,""]))),[xt,It]=a.useState("idle"),[Et,wt]=a.useState(null),Ze=l==="success"?"success":l==="error"?"error":xt,Ne=l==="error"?W:Et,ot=l==="filled",dt=a.useMemo(()=>{if(!ot)return Xe;let Be=null;for(const ft of Y)(Xe[ft.name]??"").trim().length>0||(Be=Be??{...Xe},Be[ft.name]="Filled");return Be??Xe},[Xe,ot,Y]),et=Ze==="error"?N.getFormFieldValidationError(Y,dt):null,ut=`${l&&l!=="default"?`${c}-state-${l}`:""}`.trim(),lt=o==null?void 0:o.submitUrl,_t=(Be,ft)=>{ht(rt=>({...rt,[Be]:ft}))},Mt=async Be=>{if(Be.preventDefault(),!d)return;const ft=Object.fromEntries(Y.map(Ye=>{var St;return[Ye.name,((St=Xe[Ye.name])==null?void 0:St.trim())??""]}).filter(([,Ye])=>Ye));if(!lt){It("error"),wt("No integrations were found for this form.");return}if(Object.keys(ft).length===0)return;const rt=N.getFormFieldValidationError(Y,Xe);if(rt){It("error"),wt(rt);return}It("submitting"),wt(null);try{const Ye=await fetch(lt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ft)});if(!Ye.ok){const St=await Ye.text();throw new Error(St||`Request failed: ${Ye.status}`)}It("success"),ht(Object.fromEntries(Y.map(St=>[St.name,""])))}catch(Ye){It("error"),wt(Ye instanceof Error?Ye.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${ut}`.trim(),style:Qe,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ju(c)}}),r.jsxs("form",{onSubmit:Mt,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:Y.map((Be,ft)=>r.jsxs(a.Fragment,{children:[ft>0&&r.jsx("div",{"data-controls":s?"fieldsGap":void 0,className:s?`${c}-control`:void 0,style:{height:N.scalingValue(h??0,t)}}),r.jsxs("div",{className:`${c}-field-group${L?` ${c}-labeled`:""}`,children:[L&&r.jsx("span",{className:`${c}-field-label`,style:fe?{...fe,lineHeight:fe.fontSize}:void 0,children:Be.label||Be.name}),Be.type==="textarea"?r.jsx("textarea",{name:Be.name,autoComplete:"off",value:dt[Be.name]??"",onChange:rt=>_t(Be.name,rt.target.value),placeholder:Be.placeholder,className:`${c}-input`,style:Re,rows:1,"data-filled":ot||(dt[Be.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:Be.type==="phone"?"tel":Be.type==="email"?"email":"text",name:Be.name,autoComplete:"off",value:dt[Be.name]??"",onChange:rt=>_t(Be.name,rt.target.value),placeholder:Be.placeholder,required:Be.isRequired??Be.type==="email",className:`${c}-input`,style:Re,"data-filled":ot||(dt[Be.name]??"").trim().length>0})]})]},ft))}),r.jsx("div",{"data-controls":s?"gap":void 0,className:s?`${c}-control`:void 0,style:{height:N.scalingValue($??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:N.scalingValue(v??0,t),borderWidth:Te,paddingTop:N.scalingValue((C==null?void 0:C.top)??0,t),paddingRight:N.scalingValue((C==null?void 0:C.right)??0,t),paddingBottom:N.scalingValue((C==null?void 0:C.bottom)??0,t),paddingLeft:N.scalingValue((C==null?void 0:C.left)??0,t),pointerEvents:d?"auto":void 0,...z,...E?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:E?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:xt==="submitting"?"...":w})})})]}),Ze==="success"&&r.jsx("p",{className:`${c}-success`,style:{...ke},children:Ce}),Ze==="error"&&r.jsx("p",{className:`${c}-error`,style:{...ke},role:"alert",children:et??Ne??W})]})}const Qu={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"},ep=["hover","focus","filled","success","error"],tp=`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
|
-
`,Qu=[{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"}],wo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ep=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],tp={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:{...wo.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:{...wo.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:{...wo.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:{...wo.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:Qu,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...ep],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"]},np={element:Xu,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:tp,sourceCode:Zu,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function So(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ip(e){return`
|
|
792
|
+
`,np=[{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"}],$o={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ip=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],op={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:{...$o.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:{...$o.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:{...$o.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:{...$o.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:np,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:[...ip],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"]},rp={element:Zu,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:op,sourceCode:tp,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Co(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ap(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: ${Co(8)};
|
|
975
|
+
font-size: ${Co(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: ${Co(8)};
|
|
980
|
+
font-size: ${Co(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const
|
|
983
|
+
`}const sp=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=N.useScopedStyles(),s=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:m=1,fontFamily:y,inputFontSettings:w,inputFontSize:$,inputLineHeight:h,inputLetterSpacing:v,inputWordSpacing:S,inputTextAppearance:C,buttonFontSettings:E,buttonFontSize:M,buttonLineHeight:H,buttonLetterSpacing:x,buttonWordSpacing:j,buttonTextAppearance:P,statusFontSettings:T,statusFontSize:G,statusLineHeight:f,statusLetterSpacing:A,statusWordSpacing:_,statusTextAppearance:V,iconMaxWidth:te,minHeight:ne,corners:K,stroke:B,stateOverrides:F,inputPadding:I,buttonPadding:R,successMessage:U="Thanks for subscribing!",errorMessage:D="Please, fill all required fields."}=e,ee=d.slice(0,Math.min(m,d.length)),[O,pe]=a.useState(()=>Object.fromEntries(ee.map(Z=>[Z.name,""]))),[g,ue]=a.useState("idle"),[me,we]=a.useState(null),_e=o==="success"?"success":o==="error"?"error":g,oe=o==="error"?D:me,ye=o==="filled",X=a.useMemo(()=>{if(!ye)return O;let Z=null;for(const fe of ee)(O[fe.name]??"").trim().length>0||(Z=Z??{...O},Z[fe.name]="Filled");return Z??O},[ye,O,ee]),be=_e==="error"?N.getFormFieldValidationError(ee,X):null,ce=o&&o!=="default"?`${l}-state-${o}`:"",ge=ee.some(Z=>(X[Z.name]??"").trim().length>0),se=ce!==`${l}-state-filled`&&ge?`${l}-state-filled`:"",Ie=`${ce} ${se}`.trim(),Fe=i==null?void 0:i.submitUrl,he=u??"",Ce=(c==null?void 0:c.icon)??"",W=(c==null?void 0:c.mode)==="On",Q=he||"Submit",L={fontSettings:{fontFamily:y,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:$??.01,lineHeight:h,letterSpacing:v??0,wordSpacing:S??0,textAppearance:C,color:e.inputTextColor??"#111111"},Y={fontSettings:{fontFamily:y,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:M??.01,lineHeight:H,letterSpacing:x??0,wordSpacing:j??0,textAppearance:P,color:e.buttonTextColor??"#ffffff"},J={fontSettings:{fontFamily:y,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:G??.01,lineHeight:f,letterSpacing:A??0,wordSpacing:_??0,textAppearance:V,color:e.successColor??"#22c55e"},de=nn(Bt(L,t)),le=nn(Bt(Y,t)),ie=nn(Bt(J,t)),Re=N.buildColorVars(l,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(L==null?void 0:L.color)??"#111111",buttonTextColor:e.buttonTextColor??(Y==null?void 0:Y.color)??"#ffffff"},lp,cp,F),Se={borderRadius:N.scalingValue(K,t),borderWidth:N.scalingValue(B,t),borderStyle:"solid"},z={borderLeftWidth:N.scalingValue(B,t)},Te=async Z=>{if(Z.preventDefault(),!s)return;const fe=Object.fromEntries(ee.map(ke=>{var Qe;return[ke.name,((Qe=O[ke.name])==null?void 0:Qe.trim())??""]}).filter(([,ke])=>ke));if(!Fe){ue("error"),we("No integrations were found for this form.");return}if(Object.keys(fe).length===0)return;const ve=N.getFormFieldValidationError(ee,O);if(ve){ue("error"),we(ve);return}ue("submitting"),we(null);try{const ke=await fetch(Fe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(fe)});if(!ke.ok){const Qe=await ke.text();throw new Error(Qe||`Request failed: ${ke.status}`)}ue("success"),pe(Object.fromEntries(ee.map(Qe=>[Qe.name,""])))}catch(ke){ue("error"),we(ke instanceof Error?ke.message:"Something went wrong")}};return r.jsxs("div",{className:`${l}-wrapper ${Ie}`.trim(),style:Re,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ap(l)}}),r.jsxs("form",{onSubmit:Te,className:`${l}-form`,style:{...Se,height:N.scalingValue(ne,t),minHeight:N.scalingValue(ne,t)},children:[r.jsx("div",{className:`${l}-inputWrap ${l}-overlayAnchor`,style:{flex:1,minWidth:0},children:ee.map(Z=>r.jsx("input",{type:Z.type==="email"?"email":Z.type==="phone"?"tel":"text",name:Z.name,autoComplete:"off",value:X[Z.name]??"",onChange:fe=>pe(ve=>({...ve,[Z.name]:fe.target.value})),placeholder:Z.placeholder,required:Z.isRequired??Z.type==="email",className:`${l}-input`,style:{...de,paddingRight:N.scalingValue(I.right,t),paddingLeft:N.scalingValue(I.left,t),paddingTop:N.scalingValue(I.top,t),paddingBottom:N.scalingValue(I.bottom,t)}},Z.name))}),r.jsx("div",{className:`${l}-overlayAnchor`,children:r.jsx("button",{type:s?"submit":"button",className:`${l}-submitBtn`,"aria-label":Q,style:{...le,...z,paddingRight:N.scalingValue(R.right,t),paddingLeft:N.scalingValue(R.left,t),paddingTop:N.scalingValue(R.top,t),paddingBottom:N.scalingValue(R.bottom,t),pointerEvents:s?"auto":void 0},children:g==="submitting"?"...":W?Ce&&r.jsx(on,{url:Ce,className:`${l}-submitBtnIcon`,style:{maxWidth:N.scalingValue(te??0,t)},fill:`var(--${l}-button-text-color)`,hoverFill:`var(--${l}-button-text-color)`}):he})})]}),_e==="success"&&r.jsx("p",{className:`${l}-success`,style:{...ie},children:U}),_e==="error"&&r.jsx("p",{className:`${l}-error`,style:{...ie},role:"alert",children:be??oe??D})]})},lp={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"},cp=["hover","focus","filled","success","error"],dp=`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
|
-
`,lp="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>'),cp=[{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."}],xr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},dp=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],up={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:{...xr.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:{...xr.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:{...xr.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:cp,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:lp},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...dp],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"]},pp={element:op,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:up,sourceCode:sp};function mp(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1560
|
+
`,up="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>'),pp=[{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."}],wr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},mp=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],gp={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:{...wr.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:{...wr.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:{...wr.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:pp,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:up},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:[...mp],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"]},hp={element:sp,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:gp,sourceCode:dp};function fp(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1561
1561
|
.${e}-marquee-wrapper {
|
|
1562
1562
|
overflow: hidden;
|
|
1563
1563
|
width: 100%;
|
|
@@ -1685,7 +1685,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1685
1685
|
.${e}-image-hover-grayscale:hover img {
|
|
1686
1686
|
filter: grayscale(100%);
|
|
1687
1687
|
}
|
|
1688
|
-
`}const
|
|
1688
|
+
`}const yp=30,vp=20,Sr=3,xp=12,bp=32,wp=3,Sp=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")},$p=(e,t)=>Array.from({length:t},()=>e).flat(),Cp=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},xl=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Ua=(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,m)=>e.children[m]),c=xl(d);return c<=0?0:c+l*Math.max(0,t-1)},Tp=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=xl(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},Lp=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Ip=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Lp(i,e))},Rp=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:l,isFirstSet:s,scaled:d,onFirstSetImageDone:c})=>{var T,G,f;const u=a.useRef(null);a.useLayoutEffect(()=>{if(!s)return;const A=u.current;A!=null&&A.complete&&(c==null||c())},[s,(T=e.image)==null?void 0:T.url,c]);const m=n.display==="cover",y=n.ratioValue??"1:1",w=n.reversed??!1,[$,h]=y.split(":").map(Number),C=(w?h:$)/(w?$:h),E=i/C,M=E>o?o:E,H=E>o?o*C:i,x=d(H),j=d(M),P=((G=e.image)==null?void 0:G.url)&&r.jsx("img",{ref:u,src:e.image.url,alt:((f=e.image)==null?void 0:f.name)??"",style:m?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:d(i),objectFit:"contain"},onLoad:s?c:void 0,onError:s?c:void 0});return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...m?{width:x}:{width:"max-content",maxWidth:d(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...m?{width:x,height:j,overflow:"hidden"}:{width:"max-content",maxWidth:d(i),height:d(o)}},children:P&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:at(`${t}-marquee-link`,!m&&`${t}-marquee-link-contain`),children:P}):P})})},Ep=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=N.useScopedStyles(),[s,d]=a.useState(0),c=s>0?Math.round(s):0,u=a.useMemo(()=>fp(l,c),[l,c]),{speed:m,direction:y,pauseOnHover:w,gap:$,imageMaxWidth:h,imageMaxHeight:v,hoverEffect:S}=e,C=a.useMemo(()=>Cp(e.imageFit),[e.imageFit]),E=(t==null?void 0:t.length)??0,M=!!o,H=!n||!!i,x=H&&S!=="off"&&S!=="randomize"?`${l}-image-hover-${S}`:void 0,j=n?!!i:!0,T=((t==null?void 0:t.length)??0)>0&&(j||!!n),G=Math.max(0,m)*yp,f=ge=>N.scalingValue(ge,n??!1),A=a.useRef(null),_=a.useRef(null),V=a.useRef(null),[te,ne]=a.useState(0),K=j&&w==="on",[B,F]=a.useState(!1),[I,R]=a.useState({}),U=a.useRef(I);U.current=I;const D=a.useRef(null),ee=a.useRef(0),O=a.useRef(null),pe=a.useMemo(()=>(t??[]).map(ge=>{var se;return((se=ge.image)==null?void 0:se.url)??""}).join("\0"),[t]),[g,ue]=a.useState(Sr),me=a.useMemo(()=>{const ge=t??[];return ge.length===0||!(j||!!n)?ge:$p(ge,g)},[t,j,g,n]),we=a.useMemo(()=>(t??[]).filter(ge=>{var se;return!!((se=ge.image)!=null&&se.url)}).length,[t]),_e=T?wp:1;a.useLayoutEffect(()=>{ee.current=0,R({}),D.current=null,ue(Sr),d(0)},[pe]),a.useEffect(()=>{if(!H||S!=="randomize")return;const ge=A.current;if(!ge)return;const se=Ce=>{R(W=>{const Q=Array.from(Ce).filter(Y=>Y in W&&!Ip(ge,Y));if(Q.length===0)return W;const L={...W};return Q.forEach(Y=>{delete L[Y]}),L})},Ie=new IntersectionObserver(Ce=>{const W=new Set;for(const Q of Ce){const L=Q.target.dataset.marqueeItemIndex,Y=L!==void 0?Number(L):NaN;Number.isNaN(Y)||W.add(Y)}W.size>0&&se(W)},{root:ge,threshold:0});Object.keys(I).forEach(Ce=>{const W=Number(Ce);ge.querySelectorAll(`[data-marquee-item-index="${W}"]`).forEach(Q=>Ie.observe(Q))});const Fe={current:0},he=()=>{const Ce=Object.keys(U.current);Ce.length!==0&&(se(Ce.map(Number)),Fe.current=requestAnimationFrame(he))};return Object.keys(U.current).length>0&&(Fe.current=requestAnimationFrame(he)),()=>{cancelAnimationFrame(Fe.current),Ie.disconnect()}},[S,I,H]),a.useLayoutEffect(()=>{if(!T)return;const ge=A.current,se=V.current;if(!ge||!se)return;const Ie={current:0},Fe=()=>{const W=ge.getBoundingClientRect().width||ge.offsetWidth,Q=Tp(se),L=D.current,Y=typeof L=="number"&&Math.abs(L-Q)<=.25;D.current=Q;let J=g,de=0;if((j||n)&&E>0&&W>0){const Re=Ua(se,E);if(Re>=bp){de=Re;const Se=Math.min(xp,Math.max(Sr,Math.ceil(W/Re)+1));J=Se,Se!==g&&ue(Se)}}const ie=J!==g&&de>0?de*J:Q>0?Q:de>0?de*J:(()=>{const Re=Ua(se,E);return Re>0?Re*J:0})();ie>0?d(Re=>Re<=0?ie:!Y||Math.round(Re)===Math.round(ie)?Re:ie):!Y&&s<=0&&(cancelAnimationFrame(Ie.current),Ie.current=requestAnimationFrame(Fe))},he=()=>{cancelAnimationFrame(Ie.current),Ie.current=requestAnimationFrame(Fe)};O.current=he,he();const Ce=new ResizeObserver(he);return Ce.observe(ge),Ce.observe(se),()=>{O.current=null,cancelAnimationFrame(Ie.current),Ce.disconnect()}},[j,T,s,pe,g,E,n]),a.useLayoutEffect(()=>{if(!T||c<=0)return;const ge=_.current;ge&&Sp(ge)},[T,c,y,G]),a.useLayoutEffect(()=>{if(!T||s<=0){ne(0);return}const ge=_.current,se=V.current;if(!ge||!se)return;const Ie=()=>{const he=ge.offsetHeight||ge.getBoundingClientRect().height,Ce=Array.from(se.children).reduce((Q,L)=>Math.max(Q,L.offsetHeight||L.getBoundingClientRect().height),0),W=he>0?he:Ce;ne(W>0?W:0)};Ie();const Fe=new ResizeObserver(Ie);return Fe.observe(ge),Fe.observe(se),()=>Fe.disconnect()},[T,_e,me,n,$,h,v,s,C,I]),a.useLayoutEffect(()=>{if(!n||!M||!T||typeof window>"u")return;const ge=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(ge)},[n,M,T,y,s,te,$,me]);const oe=()=>{K&&F(!0)},ye=()=>{K&&F(!1)},X=a.useCallback(()=>{var ge;ee.current=Math.min(we,ee.current+1),(ge=O.current)==null||ge.call(O)},[we]),be=a.useCallback((ge,se)=>{R(Ie=>{const Fe=Ie[ge]??se,he=(t??[]).filter(W=>W!==Fe);if(he.length===0)return Ie;const Ce=he[Math.floor(Math.random()*he.length)];return{...Ie,[ge]:Ce}})},[t]),ce=(ge,se,Ie,Fe)=>{const he=H&&S==="randomize"&&C.display==="cover"?I[Ie]??ge:ge,Ce=`max(${f($)}, ${vp}px)`,W=`calc(-0.5 * (${Ce} + ${f($)}))`;return r.jsxs("div",{className:`${l}-marquee-card`,"data-marquee-item-index":Ie,onMouseEnter:H&&S==="randomize"&&C.display==="cover"?()=>be(Ie,ge):void 0,children:[r.jsx(Rp,{item:he,prefix:l,imageFit:C,imageMaxWidth:h,imageMaxHeight:v,imageHoverClass:x,isEditor:n,isFirstSet:Fe,scaled:f,onFirstSetImageDone:X}),M&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${l}-gap-control`,style:{position:"absolute",top:0,right:W,width:Ce,height:"100%"}})]},`${se}-${Ie}`)};if(T){const ge=j?K&&B?"paused":"running":"paused",se=c>0&&G>0?c/G*1e3:0,Ie=`${Math.max(0,se)/1e3}s`;return r.jsxs("div",{ref:A,className:at(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Marquee",style:te>0?{height:te}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:_,className:`${l}-marquee-track`,"data-direction":y,onMouseEnter:oe,onMouseLeave:ye,style:{WebkitAnimationDuration:Ie,animationDuration:Ie,WebkitAnimationPlayState:ge,animationPlayState:ge},children:Array.from({length:_e},(Fe,he)=>r.jsx("div",{ref:he===0?V:void 0,className:at(`${l}-marquee-row`,`${l}-marquee-set`),style:{gap:f($),paddingRight:f($)},"aria-hidden":he>0,children:me.map((Ce,W)=>ce(Ce,he,W,he===0&&W<E))},`set-${he}`))})]})}return r.jsxs("div",{ref:A,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:at(`${l}-marquee-row`,`${l}-marquee-static`),style:{gap:f($),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((ge,se)=>ce(ge,0,se))},"marquee-static")]})},Mp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1689
1689
|
import cn from 'classnames';
|
|
1690
1690
|
import { CommonComponentProps } from '../props';
|
|
1691
1691
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2013,12 +2013,7 @@ const MarqueeItemCard = ({
|
|
|
2013
2013
|
>
|
|
2014
2014
|
{imageNode && item.link
|
|
2015
2015
|
? (
|
|
2016
|
-
<a
|
|
2017
|
-
href={item.link}
|
|
2018
|
-
target='_blank'
|
|
2019
|
-
rel='noopener noreferrer'
|
|
2020
|
-
className={cn(\`\${P}-marquee-link\`, !isCover && \`\${P}-marquee-link-contain\`)}
|
|
2021
|
-
>
|
|
2016
|
+
<a href={item.link} target='_self' rel='noopener noreferrer' className={cn(\`\${P}-marquee-link\`, !isCover && \`\${P}-marquee-link-contain\`)}>
|
|
2022
2017
|
{imageNode}
|
|
2023
2018
|
</a>
|
|
2024
2019
|
)
|
|
@@ -2147,9 +2142,12 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
2147
2142
|
typeof prevCandidate === 'number' &&
|
|
2148
2143
|
Math.abs(prevCandidate - nextRawSetWidth) <= 0.25;
|
|
2149
2144
|
stableCandidateRef.current = nextRawSetWidth;
|
|
2145
|
+
let effectiveRepeat = contentSequenceRepeat;
|
|
2146
|
+
let trustworthySingleCycleWidth = 0;
|
|
2150
2147
|
if ((autoplayEnabled || isEditor) && originalItemCount > 0 && nextContainerWidth > 0) {
|
|
2151
2148
|
const singleCycleWidth = measureSingleCycleWidth(set, originalItemCount);
|
|
2152
2149
|
if (singleCycleWidth >= MIN_TRUSTWORTHY_CYCLE_WIDTH_PX) {
|
|
2150
|
+
trustworthySingleCycleWidth = singleCycleWidth;
|
|
2153
2151
|
const targetRepeat = Math.min(
|
|
2154
2152
|
MAX_CONTENT_SEQUENCE_REPEAT,
|
|
2155
2153
|
Math.max(
|
|
@@ -2157,17 +2155,23 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
2157
2155
|
Math.ceil(nextContainerWidth / singleCycleWidth) + 1,
|
|
2158
2156
|
),
|
|
2159
2157
|
);
|
|
2158
|
+
effectiveRepeat = targetRepeat;
|
|
2160
2159
|
if (targetRepeat !== contentSequenceRepeat) {
|
|
2161
2160
|
setContentSequenceRepeat(targetRepeat);
|
|
2162
2161
|
}
|
|
2163
2162
|
}
|
|
2164
2163
|
}
|
|
2165
|
-
const
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2164
|
+
const repeatIsChanging = effectiveRepeat !== contentSequenceRepeat;
|
|
2165
|
+
const resolvedSetWidth = repeatIsChanging && trustworthySingleCycleWidth > 0
|
|
2166
|
+
? trustworthySingleCycleWidth * effectiveRepeat
|
|
2167
|
+
: nextRawSetWidth > 0
|
|
2168
|
+
? nextRawSetWidth
|
|
2169
|
+
: trustworthySingleCycleWidth > 0
|
|
2170
|
+
? trustworthySingleCycleWidth * effectiveRepeat
|
|
2171
|
+
: (() => {
|
|
2172
|
+
const singleCycleWidth = measureSingleCycleWidth(set, originalItemCount);
|
|
2173
|
+
return singleCycleWidth > 0 ? singleCycleWidth * effectiveRepeat : 0;
|
|
2174
|
+
})();
|
|
2171
2175
|
if (resolvedSetWidth > 0) {
|
|
2172
2176
|
setSetWidth((prev) => {
|
|
2173
2177
|
if (prev <= 0) return resolvedSetWidth;
|
|
@@ -2407,7 +2411,7 @@ type MarqueeProps = {
|
|
|
2407
2411
|
isPreviewMode?: boolean;
|
|
2408
2412
|
isEditMode?: boolean;
|
|
2409
2413
|
} & CommonComponentProps;
|
|
2410
|
-
`,
|
|
2414
|
+
`,Pp={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.8},t:{speed:1.64,gap:.02,imageMaxWidth:.5208,imageMaxHeight:.5208},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278}},displayRules:[{if:{name:"imageFit.display",value:"cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:""},link:""}]}},kp={element:Ep,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:Pp,sourceCode:Mp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function Xa(e){return`
|
|
2411
2415
|
.${e}-marquee-wrapper {
|
|
2412
2416
|
overflow: hidden;
|
|
2413
2417
|
width: 100%;
|
|
@@ -2494,7 +2498,7 @@ type MarqueeProps = {
|
|
|
2494
2498
|
pointer-events: auto;
|
|
2495
2499
|
z-index: 10;
|
|
2496
2500
|
}
|
|
2497
|
-
`}const
|
|
2501
|
+
`}const Ap=30,Ya=2,Fp=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=N.useScopedStyles(),{align:s,speed:d,direction:c,pauseOnHover:u,gap:m,cardWidth:y,corners:w,stroke:$,strokeColor:h,bgColor:v,padding:S,logoMarginTop:C,logoWidth:E,logoHeight:M,captionMarginTop:H}=e,x=!!o,j=((t==null?void 0:t.length)??0)>0,P=d>0&&(!n||i),T=j&&(P||n),G=Math.max(0,d)*Ap,f=L=>N.scalingValue(L,n??!1),A=a.useRef(null),_=a.useRef(null),V=a.useRef(null),[te,ne]=a.useState(0),[K,B]=a.useState(0),[F,I]=a.useState(0),R=P&&u==="on",[U,D]=a.useState(!1),ee=a.useRef(null),[O,pe]=a.useState(0),[g,ue]=a.useState(0),me=a.useRef(null),we=L=>{var J,de,le,ie,Re;return{fontSettings:{fontFamily:(e==null?void 0:e[`${L}FontFamily`])??"Arial",fontWeight:((J=e==null?void 0:e[`${L}FontSettings`])==null?void 0:J.fontWeight)??400,fontStyle:((de=e==null?void 0:e[`${L}FontSettings`])==null?void 0:de.fontStyle)??"normal"},textAppearance:{textTransform:((le=e==null?void 0:e[`${L}TextAppearance`])==null?void 0:le.textTransform)??"none",textDecoration:((ie=e==null?void 0:e[`${L}TextAppearance`])==null?void 0:ie.textDecoration)??"none",fontVariant:((Re=e==null?void 0:e[`${L}TextAppearance`])==null?void 0:Re.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${L}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${L}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${L}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${L}LineHeight`])??.01,color:(e==null?void 0:e[`${L}Color`])??"#000000"}},_e=we("text"),oe=we("caption"),ye=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(L=>{var Y,J;return(((Y=L.text)==null?void 0:Y.length)??0)>0||(((J=L.caption)==null?void 0:J.length)??0)>0}),[t]),X=a.useMemo(()=>!T||(t==null?void 0:t.length)===0?1:K<=0||te<=0?Ya:Math.max(Ya,Math.ceil(te/K)+1),[T,t==null?void 0:t.length,K,te]);a.useLayoutEffect(()=>{if(!T)return;const L=A.current,Y=V.current;if(!L||!Y)return;let J=0;const de=()=>{const Re=L.getBoundingClientRect().width,Se=Y.getBoundingClientRect().width,z=me.current,Te=typeof z=="number"&&Math.abs(z-Se)<=.25;if(me.current=Se,ne(Re),typeof Se=="number"&&Se>0&&K<=0){B(Se);return}Te&&Se!==K?B(Se):!Te&&K<=0&&(cancelAnimationFrame(J),J=requestAnimationFrame(de))},le=()=>{cancelAnimationFrame(J),J=requestAnimationFrame(de)};le();const ie=new ResizeObserver(le);return ie.observe(L),ie.observe(Y),()=>{cancelAnimationFrame(J),ie.disconnect()}},[P,T,K]),a.useLayoutEffect(()=>{const L=_.current;if(!T||!L)return;const Y=K>0?K:0,J=Y>0&&G>0?Y/G*1e3:0,de=`${Math.max(0,J)/1e3}s`;L.style.setProperty("--marquee-distance",`${Y}px`),L.style.setProperty("--marquee-duration",de)},[P,T,G,K]),a.useLayoutEffect(()=>{if(!T){I(0);return}const L=V.current,Y=_.current;if(!L||!Y)return;const J=()=>{let le=0;for(let ie=0;ie<L.children.length;ie++){const Se=L.children[ie].firstElementChild;Se&&(le=Math.max(le,Se.offsetHeight))}le<=0&&(le=Y.offsetHeight),I(le>0?le:0)};J();const de=new ResizeObserver(J);return de.observe(L),de.observe(Y),()=>{de.disconnect()}},[T,X,t,n,m,y,S,$,w,E,M,O,g]);const be=()=>{R&&D(!0)},ce=()=>{R&&D(!1)},ge=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]),Ie=a.useCallback((L,Y,J,de)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[r.jsx("div",{"data-controls":x?de==null?void 0:de.controlsName:void 0,"data-controls-axis":x?"y":void 0,className:x?`${l}-control`:void 0,style:{height:f((de==null?void 0:de.marginTop)??0)}}),r.jsx("div",{...de!=null&&de.dataMeasureKind?{"data-testimonial-measure":de.dataMeasureKind}:{},style:{...Bt(L,n),textAlign:se,pointerEvents:"auto",...typeof(de==null?void 0:de.minHeightPx)=="number"&&de.minHeightPx>0?{minHeight:de.minHeightPx}:{}},children:r.jsx(Si,{content:Y})})]},J),[ge,se,n,x,l,f]),Fe=a.useCallback((L,Y,J)=>{var de,le,ie;return r.jsxs("div",{style:{padding:`${f(S.top)} ${f(S.right)} ${f(S.bottom)} ${f(S.left)}`,width:f(y+$*2),height:"100%",borderRadius:f(w),border:`${f($)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${l}-cover`,style:{background:v}}),r.jsxs("div",{className:`${l}-elements-overlay`,style:{alignItems:ge,textAlign:se},children:[L.text&&Ie(_e,L.text,"text",J!=null&&J.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(J==null?void 0:J.textMinHeightPx)=="number"&&J.textMinHeightPx>0?{minHeightPx:J.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[r.jsx("div",{"data-controls":x&&!(J!=null&&J.dataMeasureAttrs)?"logoMarginTop":void 0,className:x&&!(J!=null&&J.dataMeasureAttrs)?`${l}-control`:void 0,style:{height:f(C)}}),r.jsx("div",{style:{width:f(E),height:f(M)},children:((de=L.logo)==null?void 0:de.url)&&r.jsx("img",{src:L.logo.url,alt:((le=L.logo)==null?void 0:le.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ie=L.logo)==null?void 0:ie.objectFit)||"contain"}})})]}),L.caption&&Ie(oe,L.caption,"caption",{...J!=null&&J.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...J!=null&&J.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(J==null?void 0:J.captionMinHeightPx)=="number"&&J.captionMinHeightPx>0?{minHeightPx:J.captionMinHeightPx}:{}})]})]},Y)},[v,H,oe,y,w,M,C,E,ge,se,S.bottom,S.left,S.right,S.top,Ie,$,h,_e,n,x,l]),he=a.useCallback(L=>{pe(L.maxTextPx),ue(L.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!ye){he({maxTextPx:0,maxCaptionPx:0});return}const L=ee.current;if(!L)return;const Y=()=>{N.readTestimonialTextMeasure(L,he)};Y();const J=new ResizeObserver(Y);return J.observe(L),()=>{J.disconnect()}},[ye,he,t,Fe]);const Ce=ye?{textMinHeightPx:O,captionMinHeightPx:g}:void 0,W=ye?r.jsx("div",{ref:ee,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((L,Y)=>Fe(L,`measure-${Y}`,{dataMeasureAttrs:!0}))}):null,Q=(L,Y)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Fe(L,`card-${Y}`,Ce),x&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${f(m)})`,width:f(m),height:"100%",pointerEvents:"auto",zIndex:2}})]},Y);if(T){const L=P?R&&U?"paused":"running":"paused";return r.jsxs("div",{ref:A,className:at(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...F>0?{height:F}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Xa(l)}}),W,r.jsx("div",{ref:_,className:`${l}-marquee-track`,"data-direction":c,onMouseEnter:be,onMouseLeave:ce,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px","--marquee-play-state":L},children:Array.from({length:X},(Y,J)=>r.jsx("div",{ref:J===0?V:void 0,className:`${l}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:f(m),paddingRight:f(m)},"aria-hidden":J>0,children:t==null?void 0:t.map((de,le)=>Q(de,`${J}-${le}`))},`set-${J}`))})]})}return r.jsxs("div",{className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Xa(l)}}),W,r.jsx("div",{style:{gap:f(m),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((L,Y)=>Q(L,Y))})]})},Wp=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2498
2502
|
import cn from 'classnames';
|
|
2499
2503
|
import { CommonComponentProps } from '../props';
|
|
2500
2504
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3109,7 +3113,7 @@ type TestimonialsSettings = {
|
|
|
3109
3113
|
logoHeight: number;
|
|
3110
3114
|
captionMarginTop: number;
|
|
3111
3115
|
};
|
|
3112
|
-
`,
|
|
3116
|
+
`,Ja={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},_p={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Ja.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:{...Ja.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"}]}]}]}},Np={element:Fp,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:_p,sourceCode:Wp,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Hp(e){return`
|
|
3113
3117
|
.${e}-container {
|
|
3114
3118
|
position: relative;
|
|
3115
3119
|
overflow-x: clip;
|
|
@@ -3233,7 +3237,7 @@ type TestimonialsSettings = {
|
|
|
3233
3237
|
width: 100%;
|
|
3234
3238
|
height: 100%;
|
|
3235
3239
|
}
|
|
3236
|
-
`}const
|
|
3240
|
+
`}const Op=3e3,jp=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=N.useScopedStyles(),s=t||[],{speed:d,align:c,width:u,imageMarginTop:m,textMarginTop:y,captionMarginTop:w,imageWidth:$,imageHeight:h,controlsWidth:v,controlsColor:S,controlsHoverColor:C}=e,E=d>0&&(!n||!!i),[M,H]=a.useState(0),[x,j]=a.useState(null),[P,T]=a.useState(!1),G=a.useRef(null),f=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),A=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);a.useEffect(()=>{H(0),j(null),T(!1)},[s.length]);const _=s[M],V=x===null?null:s[x],te=oe=>{var X,be,ce,ge,se;return{fontSettings:{fontFamily:(e==null?void 0:e[`${oe}FontFamily`])??"Arial",fontWeight:((X=e==null?void 0:e[`${oe}FontSettings`])==null?void 0:X.fontWeight)??400,fontStyle:((be=e==null?void 0:e[`${oe}FontSettings`])==null?void 0:be.fontStyle)??"normal"},textAppearance:{textTransform:((ce=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:ce.textTransform)??"none",textDecoration:((ge=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:ge.textDecoration)??"none",fontVariant:((se=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:se.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${oe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${oe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${oe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${oe}WordSpacing`])??0,color:(e==null?void 0:e[`${oe}Color`])??"#000000"}},ne=te("text"),K=te("caption"),B=s.length>1&&s.some(oe=>{var ye,X;return(((ye=oe.text)==null?void 0:ye.length)??0)>0||(((X=oe.caption)==null?void 0:X.length)??0)>0}),F=a.useRef(null),[I,R]=a.useState(0),[U,D]=a.useState(0),ee=e.controls??{mode:"Off",icon:null},O=s.length>1,pe=a.useCallback((oe,ye)=>!O||ye===oe?oe:(G.current&&window.clearTimeout(G.current),j(oe),T(!0),G.current=window.setTimeout(()=>{j(null),T(!1),G.current=null},300),ye),[O]),g=a.useCallback(()=>{O&&H(oe=>pe(oe,(oe-1+s.length)%s.length))},[O,pe,s.length]),ue=a.useCallback(()=>{O&&H(oe=>pe(oe,(oe+1)%s.length))},[O,pe,s.length]);a.useEffect(()=>{if(!E||!O)return;const oe=Math.max(300,Op/d),ye=window.setInterval(()=>{H(X=>pe(X,(X+1)%s.length))},oe);return()=>{window.clearInterval(ye)}},[E,O,pe,s.length,d]),a.useEffect(()=>()=>{G.current&&window.clearTimeout(G.current)},[]);const me=(oe,ye)=>{var se,Ie,Fe,he;const X=ye==null?void 0:ye.textMinHeightPx,be=ye==null?void 0:ye.captionMinHeightPx,ce=ye==null?void 0:ye.dataMeasureAttrs,ge=o&&!(ye!=null&&ye.dataMeasureAttrs)&&!(ye!=null&&ye.hideControls);return r.jsxs(r.Fragment,{children:[oe.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:f,width:"100%"},children:[r.jsx("div",{"data-controls":ge?"textMarginTop":void 0,className:ge?`${l}-control`:void 0,style:{height:N.scalingValue(y??0,n??!1)}}),r.jsx("div",{...ce&&{"data-testimonial-measure":"text"},style:{...Bt(ne,n),...X&&X>0?{minHeight:X}:{},textAlign:A,pointerEvents:"auto"},children:r.jsx(Si,{content:oe.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:f,width:"100%"},children:[r.jsx("div",{"data-controls":ge?"imageMarginTop":void 0,className:ge?`${l}-control`:void 0,style:{height:N.scalingValue(m??0,n??!1)}}),r.jsx("div",{style:{width:N.scalingValue($??0,n??!1),height:N.scalingValue(h??0,n??!1)},children:((se=oe.image)==null?void 0:se.url)&&r.jsx("img",{src:(Ie=oe.image)==null?void 0:Ie.url,alt:((Fe=oe.image)==null?void 0:Fe.name)??"",className:`${l}-icon`,style:{objectFit:((he=oe.image)==null?void 0:he.objectFit)||"contain"}})})]}),oe.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:f,width:"100%"},children:[r.jsx("div",{"data-controls":ge?"captionMarginTop":void 0,className:ge?`${l}-control`:void 0,style:{height:N.scalingValue(w??0,n??!1)}}),r.jsx("div",{...ce?{"data-testimonial-measure":"caption"}:{},style:{...Bt(K,n),...be&&be>0?{minHeight:be}:{},textAlign:A,pointerEvents:"auto"},children:r.jsx(Si,{content:oe.caption})})]})]})},we=a.useCallback(oe=>{R(oe.maxTextPx),D(oe.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!B){we({maxTextPx:0,maxCaptionPx:0});return}const oe=F.current;if(!oe)return;const ye=()=>{N.readTestimonialTextMeasure(oe,we)};ye();const X=new ResizeObserver(ye);return X.observe(oe),()=>{X.disconnect()}},[B,we,t]),!_)return r.jsx(r.Fragment,{});const _e=B?{textMinHeightPx:I,captionMinHeightPx:U}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${l}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Hp(l)}}),r.jsxs("div",{className:`${l}-wrapper`,style:{width:N.scalingValue(u??0,n??!1),alignItems:f},children:[B&&r.jsx("div",{ref:F,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((oe,ye)=>r.jsx("div",{style:{width:"100%"},children:me(oe,{dataMeasureAttrs:!0})},ye))}),r.jsxs("div",{className:`${l}-fade-stack`,children:[V&&P&&r.jsx("div",{className:at(`${l}-fade-item-prev`,`${l}-fade-out`),children:me(V,{..._e,hideControls:!0})}),r.jsx("div",{className:at(`${l}-fade-item-current`,P?`${l}-fade-in`:void 0),children:me(_,_e)})]})]}),ee.mode==="On"&&r.jsxs("div",{className:`${l}-controls`,children:[r.jsx("div",{className:`${l}-arrow`,style:{width:N.scalingValue(v??.02,n??!1),height:N.scalingValue(v??.02,n??!1),"--arrow-hover-color":C},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:g,disabled:!O,"aria-label":"Previous testimonial",children:ee.icon&&r.jsx(on,{url:ee.icon,fill:S,hoverFill:C,className:at(`${l}-arrow-img`,`${l}-mirror`)})})}),r.jsx("div",{className:at(`${l}-arrow`,`${l}-next-arrow`),style:{width:N.scalingValue(v??.02,n??!1),height:N.scalingValue(v??.02,n??!1),"--arrow-hover-color":C},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:ue,disabled:!O,"aria-label":"Next testimonial",children:ee.icon&&r.jsx(on,{url:ee.icon,fill:S,hoverFill:C,className:`${l}-arrow-img`})})})]})]})})},Bp=`import cn from 'classnames';
|
|
3237
3241
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3238
3242
|
import { CommonComponentProps } from '../props';
|
|
3239
3243
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3729,12 +3733,12 @@ type TestimonialsSettings = {
|
|
|
3729
3733
|
icon?: string | null;
|
|
3730
3734
|
};
|
|
3731
3735
|
};
|
|
3732
|
-
`,
|
|
3736
|
+
`,zp="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>'),Za={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Dp={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Fill Controls",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Hover Controls",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Za.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Fill Caption"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Za.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Fill Text"}},defaults:{controls:{mode:"On",icon:zp},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"}]}]}]}},Vp={element:jp,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:Dp,sourceCode:Bp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function qp(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qa(e){return((e==null?void 0:e.trim().length)??0)>0}function $r(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Cr(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:N.scalingValue((o-t)/2,i)}}function Gp(e){return`
|
|
3733
3737
|
.${e}-wrapper {
|
|
3734
3738
|
display: grid;
|
|
3735
3739
|
align-items: start;
|
|
3736
3740
|
justify-content: center;
|
|
3737
|
-
min-height: ${
|
|
3741
|
+
min-height: ${qp(48)};
|
|
3738
3742
|
}
|
|
3739
3743
|
.${e}-item {
|
|
3740
3744
|
display: flex;
|
|
@@ -4071,7 +4075,7 @@ type TestimonialsSettings = {
|
|
|
4071
4075
|
pointer-events: auto;
|
|
4072
4076
|
z-index: 10;
|
|
4073
4077
|
}
|
|
4074
|
-
`}const bn=500,qp=750,Xn="cubic-bezier(0.22, 1, 0.36, 1)",Gp=72,Kp=50;function Up(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 Xp(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Yp(e){const[t]=e.media;return t!=null&&t.url?t:null}function Jp(e){return!Array.isArray(e)||e.length===0?[]:Up(e)?e.flatMap(t=>{const n=Xp(t);if(!n)return[];const i=Yp(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 Bi(e){return e.type==="video"}function Zp(e){e.pause(),e.removeAttribute("src"),e.load()}function Ya({media:e,className:t,style:n,onMediaClick:i}){return Bi(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 $o(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Qp(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function em({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()=>{Zp(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 tm({items:e,index:t,imageDisplay:n,onClose:i,onPrev:o,onNext:l,counterClassName:s,counterStyle:d}){const c=n==="cover",u=a.useRef(null),m=a.useRef(null),y=a.useRef(null),E=a.useRef(null),T=a.useRef(0),h=a.useRef(0),v=a.useRef("none"),I=a.useRef(!1),L=a.useRef(!1),R=a.useRef(!1),P=a.useRef(null),[O,x]=a.useState(null),[N,k]=a.useState("opening"),[$,q]=a.useState(0),[f,M]=a.useState(0),[_,j]=a.useState(!1),[te,ie]=a.useState(!1),[G,z]=a.useState(!1),H=a.useRef(t),W=e[t],S=W?Bi(W):!1,K=f!==0||_,J=a.useCallback(Z=>{R.current=Z,j(Z)},[]),Q=a.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),D=a.useCallback(()=>{Q(),P.current=window.setTimeout(()=>{Q(),J(!1)},bn+32)},[Q,J]),ue=a.useCallback(()=>{const Z=m.current,Ce=y.current;if(!Z)return;const Le=Z.getBoundingClientRect(),$e=Le.width,ke=Le.height;if(!$e||!ke)return;if(n==="cover"){x({width:$e,height:ke,left:Le.left,top:Le.top});return}if(!Ce){x($o(Z));return}const{width:b,height:re}=Qp(Ce);if(!b||!re){x($o(Z));return}const C=b/re,U=$e/ke;if(C>U){const X=$e/C;x({width:$e,height:X,left:Le.left,top:Le.top+(ke-X)/2})}else{const X=ke*C;x({width:X,height:ke,left:Le.left+($e-X)/2,top:Le.top})}},[n]);a.useEffect(()=>{ue();const Z=m.current;if(!Z)return;const Ce=new ResizeObserver(()=>ue());return Ce.observe(Z),()=>Ce.disconnect()},[ue,t]),a.useEffect(()=>{N==="opening"&&O&&k("open")},[N,O]),a.useEffect(()=>{if(N!=="closing")return;const Z=setTimeout(()=>i(),bn);return()=>clearTimeout(Z)},[N,i]),a.useEffect(()=>()=>{Q()},[Q]),a.useLayoutEffect(()=>{if(H.current===t)return;Q(),q(0),M(0),J(!1),z(!1),ie(!1),T.current=0,h.current=0,v.current="none",I.current=!1,E.current=null,L.current=!1;const Z=m.current;Z&&x($o(Z)),H.current=t},[t,J,Q]),a.useEffect(()=>{if(N!=="open")return;const Z=()=>{const re=C=>{C.stopPropagation(),C.preventDefault(),document.removeEventListener("click",re,!0)};document.addEventListener("click",re,!0)},Ce=re=>{Q(),R.current=!1,j(!1),M(0),ie(!1),I.current=!1,h.current=0,v.current="none";const C=m.current;C&&x($o(C)),re<0?l():o()},Le=re=>{if(Math.abs(re)>Kp&&e.length>1){Ce(re);return}J(!0),M(0),D()},$e=re=>{if(re.touches.length!==1||R.current)return;const C=re.touches[0];L.current=!0,E.current={x:C.clientX,y:C.clientY},v.current="none",h.current=0,I.current=!1},ke=re=>{if(!E.current||re.touches.length!==1||R.current)return;const C=re.touches[0],U=C.clientX-E.current.x,X=C.clientY-E.current.y;if(v.current==="none"){if(Math.abs(U)<10&&Math.abs(X)<10)return;if(Math.abs(U)>Math.abs(X)){if(e.length<=1)return;v.current="horizontal"}else if(X>0)v.current="vertical";else return}if(v.current==="horizontal"){I.current=!0,ie(!0),h.current=U,M(U),re.preventDefault();return}v.current==="vertical"&&(I.current=!0,ie(!0),T.current=X,q(X),re.preventDefault())},b=()=>{if(!E.current)return;const re=v.current,C=I.current;if(C&&re==="horizontal")Le(h.current),Z();else if(C&&re==="vertical"){if(T.current>Gp){const X=window.innerHeight;T.current=X,z(!0),q(X),k("closing")}else T.current=0,q(0);Z()}else re==="horizontal"&&Math.abs(h.current)>0&&(Le(h.current),Z());E.current=null,v.current="none",h.current=0,I.current=!1,ie(!1)};return document.addEventListener("touchstart",$e,{passive:!0}),document.addEventListener("touchmove",ke,{passive:!1}),document.addEventListener("touchend",b),document.addEventListener("touchcancel",b),()=>{document.removeEventListener("touchstart",$e),document.removeEventListener("touchmove",ke),document.removeEventListener("touchend",b),document.removeEventListener("touchcancel",b)}},[N,e.length,l,o,J,D]),a.useEffect(()=>{const Z=Ce=>{Ce.key==="Escape"&&(Ce.preventDefault(),Ce.stopPropagation(),N!=="closing"&&k("closing"))};return window.addEventListener("keydown",Z,!0),()=>window.removeEventListener("keydown",Z,!0)},[N]);const g=()=>{N!=="closing"&&k("closing")},pe=N==="open",fe=N==="closing",ve=$>0?Math.max(0,1-$/500):1,Ne=$>0?Math.max(.35,1-$/500):1,ne=Z=>{if(Z.stopPropagation(),L.current){L.current=!1;return}if(e.length<=1)return;const Ce=Z.currentTarget.getBoundingClientRect(),Le=Z.clientY-Ce.top,$e=Math.min(52,Ce.height*.2);if(!(Le>Ce.height-$e)){if(Z.clientX-Ce.left<Ce.width/2){o();return}l()}},ge=Z=>{if(e.length<=1)return;const Ce=Z.currentTarget.getBoundingClientRect(),Le=Z.clientX-Ce.left,$e=Z.clientY-Ce.top,ke=Math.min(52,Ce.height*.2);if($e>Ce.height-ke){Z.currentTarget.style.cursor="default";return}Z.currentTarget.style.cursor=Le<Ce.width/2?"w-resize":"e-resize"},ee=a.useCallback(Z=>{Z.propertyName!=="transform"||!R.current||(Q(),J(!1))},[Q,J]),be=K?`translateX(${f}px)`:$>0?`translateY(${$}px)`:void 0,ce={position:"fixed",top:O==null?void 0:O.top,left:O==null?void 0:O.left,width:O==null?void 0:O.width,height:O==null?void 0:O.height,objectFit:n==="cover"?"cover":"contain",transform:be,opacity:$>0?Ne:N==="opening"||fe?0:1,transition:te&&!_?"none":_?`transform ${bn}ms ${Xn}`:G?`transform ${bn}ms ${Xn}, opacity ${bn}ms ${Xn}`:N==="opening"||fe?`opacity ${bn}ms ${Xn}`:"none",pointerEvents:S&&pe&&!K?"auto":"none",touchAction:S&&pe?"none":void 0,zIndex:9998},oe=O?{position:"fixed",top:O.top,height:O.height,width:O.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:u,style:{position:"fixed",top:"var(--cntrl-article-top, 0)",left:"var(--cntrl-article-left, 0)",width:"var(--cntrl-article-width, 100vw) !important",height:"var(--cntrl-viewport-height, 100vh) !important",zIndex:9997,touchAction:N==="open"?"none":void 0},onClick:g,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:pe?ve:0,transition:te?"none":`opacity ${bn}ms ${Xn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:c?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:m,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:pe?1:0,transition:`opacity ${bn}ms ${Xn}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:s,style:d,children:[t+1," / ",e.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:m,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:pe?1:0,transition:`opacity ${bn}ms ${Xn}`},children:e.length>1&&r.jsxs("p",{className:s,style:d,children:[t+1," / ",e.length]})})]})}),O&&W&&(S?r.jsx(em,{src:W.url,phase:N,mediaRef:y,mediaStyle:ce,onLoadedMetadata:ue,onClick:ne,onMouseMove:ge,onTransitionEnd:ee},`${t}-${W.url}`):r.jsx("img",{ref:y,src:W.url,alt:W.name,onLoad:ue,onTransitionEnd:ee,style:ce},`${t}-${W.url}`)),pe&&oe&&e.length>1&&!S&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...oe,left:O.left,cursor:"w-resize",pointerEvents:K?"none":"auto"},onClick:Z=>{if(L.current){L.current=!1;return}Z.stopPropagation(),o()}}),r.jsx("div",{style:{...oe,left:O.left+O.width/2,cursor:"e-resize",pointerEvents:K?"none":"auto"},onClick:Z=>{if(L.current){L.current=!1;return}Z.stopPropagation(),l()}})]})]})}function nm(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function im({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d,portalId:c}){const{prefix:u}=F.useScopedStyles(),{type:m="a",gridLayout:y,verticalGap:E,entriesCount:T,lightbox:h,imageDisplay:v,lightboxImageDisplay:I,slider:L,sliderTiming:R,direction:P,transition:O,titleMarginTop:x,subtitleMarginTop:N,titleColor:k,subtitleColor:$,lightboxCounterColor:q,titleFontFamily:f,titleFontSettings:M,titleFontSize:_,titleLineHeight:j,titleLetterSpacing:te,titleWordSpacing:ie,titleTextAppearance:G,subtitleFontFamily:z,subtitleFontSettings:H,subtitleFontSize:W,subtitleLineHeight:S,subtitleLetterSpacing:K,subtitleWordSpacing:J,subtitleTextAppearance:Q,lightboxCounterFontFamily:D,lightboxCounterFontSettings:ue,lightboxCounterFontSize:g,lightboxCounterLineHeight:pe,lightboxCounterLetterSpacing:fe,lightboxCounterWordSpacing:ve,lightboxCounterTextAppearance:Ne,showText:ne="always",alignEntries:ge="off",align:ee="top"}=e,be={fontSettings:{fontFamily:f,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:_??.01,lineHeight:j,letterSpacing:te??0,wordSpacing:ie??0,textAppearance:G,color:k},oe={...en(Ot(be,n))},Z={fontSettings:{fontFamily:z,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:W??.01,lineHeight:S,letterSpacing:K??0,wordSpacing:J??0,textAppearance:Q,color:$},Le={...en(Ot(Z,n))},$e={fontSettings:{fontFamily:D,fontWeight:(ue==null?void 0:ue.fontWeight)??400,fontStyle:(ue==null?void 0:ue.fontStyle)??"normal"},fontSize:g??.01,lineHeight:pe,letterSpacing:fe??0,wordSpacing:ve??0,textAppearance:Ne,color:q},b={...en(Ot($e,n)),...Sr(g,pe,u,n)},re=wr(_,j,`${u}-item-title`,`${u}-text-tight-leading`),C=wr(W,S,`${u}-item-subtitle`,`${u}-text-tight-leading`),U=Sr(_,j,u,n),X=Sr(W,S,u,n),se=wr(g,pe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),le=F.buildColorVars(u,{titleColor:k,subtitleColor:$,lightboxCounterColor:q},om,rm),Me=`${s&&s!=="default"?`${u}-state-${s}`:""}${ne==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),B=T===0?1/0:T,we=(t??[]).slice(0,B),Y=y.entryWidth??.2,me=y.columnsCount,Te=y.textWidthPercent,He=Y*(Te??100)/100,Ze=Dp(Y,Te),je=F.scalingValue(Ze,n),Ke=F.scalingValue(y.horizontalGap??0,n),ct=we.length%me||me,ft=ct<me&&we.length>0,bt=we.length-ct,Ct=ft?Math.floor((me-ct)/2)+1:1,Qe=(v==null?void 0:v.display)==="cover",Be=(v==null?void 0:v.ratioValue)??"1:1",Je=(v==null?void 0:v.reversed)??!1,[ut,et]=Be.split(":").map(Number),ot=`${Je?et:ut} / ${Je?ut:et}`,Wt=F.scalingValue(Y,n),jt=!Qe&&L!=="off",Ue={width:Wt,...Qe?{aspectRatio:ot,height:"auto",overflow:"hidden"}:{height:"auto"}},$t=`${u}-item-image-wrapper${jt?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Ge=m==="d"||m==="e"||m==="f",tt=ge==="on",pt=F.scalingValue(He,n),rt=F.scalingValue(He,n),Kt=Qe?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[rn,gn]=a.useState("ltr"),[mt,Dt]=a.useState(0),Rt=a.useRef(null);a.useEffect(()=>{const De=Rt.current;if(!De)return;const Ve=new ResizeObserver(st=>{Dt(Math.round(st[0].contentRect.width))});return Ve.observe(De),()=>Ve.disconnect()},[]);const he=(()=>{const De={...le},Ve=Rt.current?getComputedStyle(Rt.current).getPropertyValue("--cntrl-article-width").trim():"";return Ve&&(De["--cntrl-article-width"]=Ve),De})(),[Ae,ze]=a.useState(!1),[de,Ie]=a.useState([]),[_e,Re]=a.useState(0),qe=h==="on"&&(!n||i),gt=(De,Ve)=>{n&&!i||h!=="off"&&(Ie(De),Re(Ve),ze(!0))};a.useEffect(()=>{if(!Ae||h!=="on"||typeof document>"u")return;const De=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=De}},[Ae,h]),a.useEffect(()=>{!n||i||ze(!1)},[n,i]);const Fe=a.useMemo(()=>Vp(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Fe}}),r.jsx("div",{style:le,children:r.jsx("div",{ref:Rt,className:`${u}-wrapper ${u}-type-${m}${tt?` ${u}-align-entries`:""} ${u}-image-align-${ee} ${Me}`.trim(),style:{gridTemplateColumns:`repeat(${me}, ${je})`,rowGap:tt?0:F.scalingValue(E??0,n),columnGap:Ke,width:F.scalingValue(y.wrapperWidth??0,n),...tt?{[`--${u}-align-entries-row-gap`]:F.scalingValue(E??0,n)}:{}},children:we.map((De,Ve)=>{var sn;const st=Xa(De.title),dt=Xa(De.subtitle),Tt=(((sn=De.link)==null?void 0:sn.length)??0)>0&&h==="off"?De.link:void 0,Mt=Math.floor(Ve/me)===Math.ceil(we.length/me)-1,St=ft&&Ve>=bt?`${Ct+(Ve-bt)}`:void 0,Bt=Ge?r.jsxs("div",{className:`${u}-item-text-block`,children:[st&&r.jsx("p",{className:re,style:{width:pt,...oe,...U},children:De.title}),st&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(x??0,n),width:rt}}),dt&&r.jsx("p",{className:C,style:{width:pt,...Le,...X},children:De.subtitle}),dt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(N??0,n),width:rt}})]}):null,_t=tt?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Ge&&r.jsx("div",{"data-controls":o&&st?"titleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?F.scalingValue(x??0,n):0,width:rt}}),st&&r.jsx("p",{className:re,style:{width:pt,...oe,...U},children:De.title}),Ge&&st&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(x??0,n),width:rt}})]}):null,Nt=tt?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Ge&&r.jsx("div",{"data-controls":o&&dt?"subtitleMarginTop":void 0,className:o&&dt?`${u}-control`:void 0,style:{height:dt?F.scalingValue(N??0,n):0,width:rt}}),dt&&r.jsx("p",{className:C,style:{width:pt,...Le,...X},children:De.subtitle}),Ge&&dt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(N??0,n),width:rt}})]}):null,an=Tt?r.jsxs("a",{href:Tt,target:"_blank",className:`${u}-item-text-link`,children:[_t,Nt]}):r.jsxs(r.Fragment,{children:[_t,Nt]}),ht=Jp(De.gallery),Ft=ht.filter(vt=>vt.lightboxMedia).map(vt=>vt.lightboxMedia),Et=r.jsx("div",{className:$t,style:Ue,children:ht.length===0?null:L==="off"?(()=>{const{displayMedia:vt,lightboxMedia:Pt}=ht[0],Ut=Pt?Ft.findIndex(ln=>ln.url===Pt.url):-1;return r.jsx(Ya,{media:vt,className:`${u}-item-${Bi(vt)?"video":"image"}`.trim(),style:Kt,onMediaClick:qe&&Ut>=0?()=>gt(Ft,Ut):void 0})})():r.jsxs(r.Fragment,{children:[jt&&tt&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:ht.map(({displayMedia:vt})=>Bi(vt)?r.jsx("video",{src:vt.url,muted:!0,playsInline:!0},`sizer-${vt.url}`):r.jsx("img",{src:vt.url,alt:""},`sizer-${vt.url}`))}),r.jsx(ua,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:R*1e3,width:"100%",height:"100%",speed:qp,type:O==="fade"?"fade":"loop",rewind:O==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:O==="fade"?"ltr":P!=="random"?P==="horizontal"?"ltr":"ttb":rn},onMoved:vt=>{if(P!=="random"||O==="fade")return;const Pt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";gn(Pt),setTimeout(()=>{vt.refresh()},0)},children:ht.map(({displayMedia:vt,lightboxMedia:Pt},Ut)=>{const ln=Pt?Ft.findIndex(Mn=>Mn.url===Pt.url):-1;return r.jsx(pa,{children:r.jsx(Ya,{media:vt,className:`${u}-item-${Bi(vt)?"video":"image"}`.trim(),style:Kt,onMediaClick:qe&&ln>=0?()=>gt(Ft,ln):void 0})},Ut)})},`${O}-${Y}-${P}-${R}-${mt}-${d}`)]})}),Xt=Ge?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&st?"titleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?F.scalingValue(x??0,n):0,width:rt}}),r.jsx("p",{className:re,style:{width:pt,...oe,...U},children:De.title}),r.jsx("div",{"data-controls":o&&dt?"subtitleMarginTop":void 0,className:o&&dt?`${u}-control`:void 0,style:{height:dt?F.scalingValue(N??0,n):0,width:rt}}),r.jsx("p",{className:C,style:{width:pt,...Le,...X},children:De.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${tt&&Mt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:je,...St?{gridColumn:St}:{}},children:tt?r.jsx(r.Fragment,{children:Ge?r.jsxs(r.Fragment,{children:[an,r.jsx("a",{href:Tt,target:"_blank",className:`${u}-item-image-link`,children:Et})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:Tt,target:"_blank",className:`${u}-item-image-link`,children:Et}),an]})}):Tt?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:Tt,target:"_blank",className:`${u}-item-image-link`,children:[Bt,Et]}),!Ge&&r.jsx("a",{href:Tt,target:"_blank",className:`${u}-item-text-link`,children:Xt})]}):r.jsxs(r.Fragment,{children:[Bt,Et,Xt]})})},Ve)})})}),(!n||i)&&Ae&&typeof document<"u"&&h==="on"&&(()=>{const De=(c?document.getElementById(c):null)??document.body;return Mi.createPortal(r.jsx("div",{style:he,"data-selection":"none",children:r.jsx(tm,{items:de,index:_e,imageDisplay:nm(I),onClose:()=>ze(!1),onPrev:()=>Re(Ve=>(Ve-1+de.length)%de.length),onNext:()=>Re(Ve=>(Ve+1)%de.length),counterClassName:se,counterStyle:b})}),De)})()]})}const om={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},rm=["hover","focus","filled","success","error"],am=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4078
|
+
`}const xn=500,Kp=750,Kn="cubic-bezier(0.22, 1, 0.36, 1)",Up=72,Xp=50;function Yp(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 Jp(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Zp(e){const[t]=e.media;return t!=null&&t.url?t:null}function Qp(e){return!Array.isArray(e)||e.length===0?[]:Yp(e)?e.flatMap(t=>{const n=Jp(t);if(!n)return[];const i=Zp(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 Vi(e){return e.type==="video"}function em(e){e.pause(),e.removeAttribute("src"),e.load()}function es({media:e,className:t,style:n,onMediaClick:i}){return Vi(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 To(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function tm(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function nm({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()=>{em(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 im({items:e,index:t,imageDisplay:n,onClose:i,onPrev:o,onNext:l,counterClassName:s,counterStyle:d}){const c=n==="cover",u=a.useRef(null),m=a.useRef(null),y=a.useRef(null),w=a.useRef(null),$=a.useRef(0),h=a.useRef(0),v=a.useRef("none"),S=a.useRef(!1),C=a.useRef(!1),E=a.useRef(!1),M=a.useRef(null),[H,x]=a.useState(null),[j,P]=a.useState("opening"),[T,G]=a.useState(0),[f,A]=a.useState(0),[_,V]=a.useState(!1),[te,ne]=a.useState(!1),[K,B]=a.useState(!1),F=a.useRef(t),I=e[t],R=I?Vi(I):!1,U=f!==0||_,D=a.useCallback(se=>{E.current=se,V(se)},[]),ee=a.useCallback(()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),O=a.useCallback(()=>{ee(),M.current=window.setTimeout(()=>{ee(),D(!1)},xn+32)},[ee,D]),pe=a.useCallback(()=>{const se=m.current,Ie=y.current;if(!se)return;const Fe=se.getBoundingClientRect(),he=Fe.width,Ce=Fe.height;if(!he||!Ce)return;if(n==="cover"){x({width:he,height:Ce,left:Fe.left,top:Fe.top});return}if(!Ie){x(To(se));return}const{width:W,height:Q}=tm(Ie);if(!W||!Q){x(To(se));return}const L=W/Q,Y=he/Ce;if(L>Y){const J=he/L;x({width:he,height:J,left:Fe.left,top:Fe.top+(Ce-J)/2})}else{const J=Ce*L;x({width:J,height:Ce,left:Fe.left+(he-J)/2,top:Fe.top})}},[n]);a.useEffect(()=>{pe();const se=m.current;if(!se)return;const Ie=new ResizeObserver(()=>pe());return Ie.observe(se),()=>Ie.disconnect()},[pe,t]),a.useEffect(()=>{j==="opening"&&H&&P("open")},[j,H]),a.useEffect(()=>{if(j!=="closing")return;const se=setTimeout(()=>i(),xn);return()=>clearTimeout(se)},[j,i]),a.useEffect(()=>()=>{ee()},[ee]),a.useLayoutEffect(()=>{if(F.current===t)return;ee(),G(0),A(0),D(!1),B(!1),ne(!1),$.current=0,h.current=0,v.current="none",S.current=!1,w.current=null,C.current=!1;const se=m.current;se&&x(To(se)),F.current=t},[t,D,ee]),a.useEffect(()=>{if(j!=="open")return;const se=()=>{const Q=L=>{L.stopPropagation(),L.preventDefault(),document.removeEventListener("click",Q,!0)};document.addEventListener("click",Q,!0)},Ie=Q=>{ee(),E.current=!1,V(!1),A(0),ne(!1),S.current=!1,h.current=0,v.current="none";const L=m.current;L&&x(To(L)),Q<0?l():o()},Fe=Q=>{if(Math.abs(Q)>Xp&&e.length>1){Ie(Q);return}D(!0),A(0),O()},he=Q=>{if(Q.touches.length!==1||E.current)return;const L=Q.touches[0];C.current=!0,w.current={x:L.clientX,y:L.clientY},v.current="none",h.current=0,S.current=!1},Ce=Q=>{if(!w.current||Q.touches.length!==1||E.current)return;const L=Q.touches[0],Y=L.clientX-w.current.x,J=L.clientY-w.current.y;if(v.current==="none"){if(Math.abs(Y)<10&&Math.abs(J)<10)return;if(Math.abs(Y)>Math.abs(J)){if(e.length<=1)return;v.current="horizontal"}else if(J>0)v.current="vertical";else return}if(v.current==="horizontal"){S.current=!0,ne(!0),h.current=Y,A(Y),Q.preventDefault();return}v.current==="vertical"&&(S.current=!0,ne(!0),$.current=J,G(J),Q.preventDefault())},W=()=>{if(!w.current)return;const Q=v.current,L=S.current;if(L&&Q==="horizontal")Fe(h.current),se();else if(L&&Q==="vertical"){if($.current>Up){const J=window.innerHeight;$.current=J,B(!0),G(J),P("closing")}else $.current=0,G(0);se()}else Q==="horizontal"&&Math.abs(h.current)>0&&(Fe(h.current),se());w.current=null,v.current="none",h.current=0,S.current=!1,ne(!1)};return document.addEventListener("touchstart",he,{passive:!0}),document.addEventListener("touchmove",Ce,{passive:!1}),document.addEventListener("touchend",W),document.addEventListener("touchcancel",W),()=>{document.removeEventListener("touchstart",he),document.removeEventListener("touchmove",Ce),document.removeEventListener("touchend",W),document.removeEventListener("touchcancel",W)}},[j,e.length,l,o,D,O]),a.useEffect(()=>{const se=Ie=>{Ie.key==="Escape"&&(Ie.preventDefault(),Ie.stopPropagation(),j!=="closing"&&P("closing"))};return window.addEventListener("keydown",se,!0),()=>window.removeEventListener("keydown",se,!0)},[j]);const g=()=>{j!=="closing"&&P("closing")},ue=j==="open",me=j==="closing",we=T>0?Math.max(0,1-T/500):1,_e=T>0?Math.max(.35,1-T/500):1,oe=se=>{if(se.stopPropagation(),C.current){C.current=!1;return}if(e.length<=1)return;const Ie=se.currentTarget.getBoundingClientRect(),Fe=se.clientY-Ie.top,he=Math.min(52,Ie.height*.2);if(!(Fe>Ie.height-he)){if(se.clientX-Ie.left<Ie.width/2){o();return}l()}},ye=se=>{if(e.length<=1)return;const Ie=se.currentTarget.getBoundingClientRect(),Fe=se.clientX-Ie.left,he=se.clientY-Ie.top,Ce=Math.min(52,Ie.height*.2);if(he>Ie.height-Ce){se.currentTarget.style.cursor="default";return}se.currentTarget.style.cursor=Fe<Ie.width/2?"w-resize":"e-resize"},X=a.useCallback(se=>{se.propertyName!=="transform"||!E.current||(ee(),D(!1))},[ee,D]),be=U?`translateX(${f}px)`:T>0?`translateY(${T}px)`:void 0,ce={position:"fixed",top:H==null?void 0:H.top,left:H==null?void 0:H.left,width:H==null?void 0:H.width,height:H==null?void 0:H.height,objectFit:n==="cover"?"cover":"contain",transform:be,opacity:T>0?_e:j==="opening"||me?0:1,transition:te&&!_?"none":_?`transform ${xn}ms ${Kn}`:K?`transform ${xn}ms ${Kn}, opacity ${xn}ms ${Kn}`:j==="opening"||me?`opacity ${xn}ms ${Kn}`:"none",pointerEvents:R&&ue&&!U?"auto":"none",touchAction:R&&ue?"none":void 0,zIndex:9998},ge=H?{position:"fixed",top:H.top,height:H.height,width:H.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:u,style:{position:"fixed",top:"var(--cntrl-article-top, 0)",left:"var(--cntrl-article-left, 0)",width:"var(--cntrl-article-width, 100vw) !important",height:"var(--cntrl-viewport-height, 100vh) !important",zIndex:9997,touchAction:j==="open"?"none":void 0},onClick:g,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ue?we:0,transition:te?"none":`opacity ${xn}ms ${Kn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:c?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:m,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:ue?1:0,transition:`opacity ${xn}ms ${Kn}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:s,style:d,children:[t+1," / ",e.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:m,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ue?1:0,transition:`opacity ${xn}ms ${Kn}`},children:e.length>1&&r.jsxs("p",{className:s,style:d,children:[t+1," / ",e.length]})})]})}),H&&I&&(R?r.jsx(nm,{src:I.url,phase:j,mediaRef:y,mediaStyle:ce,onLoadedMetadata:pe,onClick:oe,onMouseMove:ye,onTransitionEnd:X},`${t}-${I.url}`):r.jsx("img",{ref:y,src:I.url,alt:I.name,onLoad:pe,onTransitionEnd:X,style:ce},`${t}-${I.url}`)),ue&&ge&&e.length>1&&!R&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...ge,left:H.left,cursor:"w-resize",pointerEvents:U?"none":"auto"},onClick:se=>{if(C.current){C.current=!1;return}se.stopPropagation(),o()}}),r.jsx("div",{style:{...ge,left:H.left+H.width/2,cursor:"e-resize",pointerEvents:U?"none":"auto"},onClick:se=>{if(C.current){C.current=!1;return}se.stopPropagation(),l()}})]})]})}function om(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function rm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d,portalId:c}){const{prefix:u}=N.useScopedStyles(),{type:m="a",gridLayout:y,textBoxWidth:w=100,verticalGap:$,entriesCount:h,lightbox:v,imageDisplay:S,lightboxImageDisplay:C,slider:E,sliderTiming:M,direction:H,transition:x,titleMarginTop:j,subtitleMarginTop:P,titleColor:T,subtitleColor:G,lightboxCounterColor:f,titleFontFamily:A,titleFontSettings:_,titleFontSize:V,titleLineHeight:te,titleLetterSpacing:ne,titleWordSpacing:K,titleTextAppearance:B,subtitleFontFamily:F,subtitleFontSettings:I,subtitleFontSize:R,subtitleLineHeight:U,subtitleLetterSpacing:D,subtitleWordSpacing:ee,subtitleTextAppearance:O,lightboxCounterFontFamily:pe,lightboxCounterFontSettings:g,lightboxCounterFontSize:ue,lightboxCounterLineHeight:me,lightboxCounterLetterSpacing:we,lightboxCounterWordSpacing:_e,lightboxCounterTextAppearance:oe,showText:ye="always",alignEntries:X="off",align:be="top"}=e,ce={fontSettings:{fontFamily:A,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:V??.01,lineHeight:te,letterSpacing:ne??0,wordSpacing:K??0,textAppearance:B,color:T},se={...nn(Bt(ce,n))},Ie={fontSettings:{fontFamily:F,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:R??.01,lineHeight:U,letterSpacing:D??0,wordSpacing:ee??0,textAppearance:O,color:G},he={...nn(Bt(Ie,n))},Ce={fontSettings:{fontFamily:pe,fontWeight:(g==null?void 0:g.fontWeight)??400,fontStyle:(g==null?void 0:g.fontStyle)??"normal"},fontSize:ue??.01,lineHeight:me,letterSpacing:we??0,wordSpacing:_e??0,textAppearance:oe,color:f},Q={...nn(Bt(Ce,n)),...Cr(ue,me,u,n)},L=$r(V,te,`${u}-item-title`,`${u}-text-tight-leading`),Y=$r(R,U,`${u}-item-subtitle`,`${u}-text-tight-leading`),J=Cr(V,te,u,n),de=Cr(R,U,u,n),le=$r(ue,me,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ie=N.buildColorVars(u,{titleColor:T,subtitleColor:G,lightboxCounterColor:f},am,sm),z=`${s&&s!=="default"?`${u}-state-${s}`:""}${ye==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Te=h===0?1/0:h,Z=(t??[]).slice(0,Te),fe=y.entryWidth??.2,ve=(S==null?void 0:S.display)==="cover",ke=(S==null?void 0:S.ratioValue)??"1:1",Qe=(S==null?void 0:S.reversed)??!1,[Xe,ht]=ke.split(":").map(Number),Et=`${Qe?ht:Xe} / ${Qe?Xe:ht}`,wt=y.columnsCount,Ze=N.scalingValue(fe??0,n),Ne=Ze,ot=!ve&&E!=="off",dt=Z.length%wt||wt,et=dt<wt&&Z.length>0,mt=Z.length-dt,ut=et?Math.floor((wt-dt)/2)+1:1,lt={width:Ne,...ve?{aspectRatio:Et,height:"auto",overflow:"hidden"}:{height:"auto"}},_t=`${u}-item-image-wrapper${ot?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Mt=m==="d"||m==="e"||m==="f",Be=X==="on",ft=`calc(${N.scalingValue(fe??0,n)} * (${w} / 100))`,rt=N.scalingValue(fe*w/100,n),Ye=ve?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[St,bt]=a.useState("ltr"),[Yt,sn]=a.useState(0),Pt=a.useRef(null);a.useEffect(()=>{const Oe=Pt.current;if(!Oe)return;const st=new ResizeObserver(Me=>{sn(Math.round(Me[0].contentRect.width))});return st.observe(Oe),()=>st.disconnect()},[]);const gt=(()=>{const Oe={...ie},st=Pt.current?getComputedStyle(Pt.current).getPropertyValue("--cntrl-article-width").trim():"";return st&&(Oe["--cntrl-article-width"]=st),Oe})(),[Jt,qt]=a.useState(!1),[Ft,Ot]=a.useState([]),[Gt,Le]=a.useState(0),Ae=v==="on"&&(!n||i),ze=(Oe,st)=>{n&&!i||v!=="off"&&(Ot(Oe),Le(st),qt(!0))};a.useEffect(()=>{if(!Jt||v!=="on"||typeof document>"u")return;const Oe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Oe}},[Jt,v]),a.useEffect(()=>{!n||i||qt(!1)},[n,i]);const Je=a.useMemo(()=>Gp(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Je}}),r.jsx("div",{style:ie,children:r.jsx("div",{ref:Pt,className:`${u}-wrapper ${u}-type-${m}${Be?` ${u}-align-entries`:""} ${u}-image-align-${be} ${z}`.trim(),style:{gridTemplateColumns:`repeat(${wt}, ${Ze})`,rowGap:Be?0:N.scalingValue($??0,n),columnGap:N.scalingValue(y.horizontalGap??0,n),width:N.scalingValue(y.wrapperWidth??0,n),...Be?{[`--${u}-align-entries-row-gap`]:N.scalingValue($??0,n)}:{}},children:Z.map((Oe,st)=>{var qe;const Me=Qa(Oe.title),tt=Qa(Oe.subtitle),Ke=(((qe=Oe.link)==null?void 0:qe.length)??0)>0&&v==="off"?Oe.link:void 0,Ct=Math.floor(st/wt)===Math.ceil(Z.length/wt)-1,vt=et&&st>=mt?`${ut+(st-mt)}`:void 0,kt=Mt?r.jsxs("div",{className:`${u}-item-text-block`,children:[Me&&r.jsx("p",{className:L,style:{width:ft,...se,...J},children:Oe.title}),Me&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:N.scalingValue(j??0,n),width:rt}}),tt&&r.jsx("p",{className:Y,style:{width:ft,...he,...de},children:Oe.subtitle}),tt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:N.scalingValue(P??0,n),width:rt}})]}):null,Tt=Be?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Mt&&r.jsx("div",{"data-controls":o&&Me?"titleMarginTop":void 0,className:o&&Me?`${u}-control`:void 0,style:{height:Me?N.scalingValue(j??0,n):0,width:rt}}),Me&&r.jsx("p",{className:L,style:{width:ft,...se,...J},children:Oe.title}),Mt&&Me&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:N.scalingValue(j??0,n),width:rt}})]}):null,ae=Be?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Mt&&r.jsx("div",{"data-controls":o&&tt?"subtitleMarginTop":void 0,className:o&&tt?`${u}-control`:void 0,style:{height:tt?N.scalingValue(P??0,n):0,width:rt}}),tt&&r.jsx("p",{className:Y,style:{width:ft,...he,...de},children:Oe.subtitle}),Mt&&tt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:N.scalingValue(P??0,n),width:rt}})]}):null,Pe=Ke?r.jsxs("a",{href:Ke,target:"_blank",className:`${u}-item-text-link`,children:[Tt,ae]}):r.jsxs(r.Fragment,{children:[Tt,ae]}),He=Qp(Oe.gallery),Ve=He.filter(De=>De.lightboxMedia).map(De=>De.lightboxMedia),yt=r.jsx("div",{className:_t,style:lt,children:He.length===0?null:E==="off"?(()=>{const{displayMedia:De,lightboxMedia:$t}=He[0],At=$t?Ve.findIndex(Dt=>Dt.url===$t.url):-1;return r.jsx(es,{media:De,className:`${u}-item-${Vi(De)?"video":"image"}`.trim(),style:Ye,onMediaClick:Ae&&At>=0?()=>ze(Ve,At):void 0})})():r.jsxs(r.Fragment,{children:[ot&&Be&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:He.map(({displayMedia:De})=>Vi(De)?r.jsx("video",{src:De.url,muted:!0,playsInline:!0},`sizer-${De.url}`):r.jsx("img",{src:De.url,alt:""},`sizer-${De.url}`))}),r.jsx(fa,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:M*1e3,width:"100%",height:"100%",speed:Kp,type:x==="fade"?"fade":"loop",rewind:x==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:x==="fade"?"ltr":H!=="random"?H==="horizontal"?"ltr":"ttb":St},onMoved:De=>{if(H!=="random"||x==="fade")return;const $t=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";bt($t),setTimeout(()=>{De.refresh()},0)},children:He.map(({displayMedia:De,lightboxMedia:$t},At)=>{const Dt=$t?Ve.findIndex(Vt=>Vt.url===$t.url):-1;return r.jsx(ya,{children:r.jsx(es,{media:De,className:`${u}-item-${Vi(De)?"video":"image"}`.trim(),style:Ye,onMediaClick:Ae&&Dt>=0?()=>ze(Ve,Dt):void 0})},At)})},`${x}-${fe}-${H}-${M}-${Yt}-${d}`)]})}),nt=Mt?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&Me?"titleMarginTop":void 0,className:o&&Me?`${u}-control`:void 0,style:{height:Me?N.scalingValue(j??0,n):0,width:rt}}),r.jsx("p",{className:L,style:{width:ft,...se,...J},children:Oe.title}),r.jsx("div",{"data-controls":o&&tt?"subtitleMarginTop":void 0,className:o&&tt?`${u}-control`:void 0,style:{height:tt?N.scalingValue(P??0,n):0,width:rt}}),r.jsx("p",{className:Y,style:{width:ft,...he,...de},children:Oe.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:vt&&!Be?{gridColumn:vt}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Be&&Ct?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${Ze} * (${w} / 100))`:Ze,...vt&&Be?{gridColumn:vt}:{}},children:Be?r.jsx(r.Fragment,{children:Mt?r.jsxs(r.Fragment,{children:[Pe,r.jsx("a",{href:Ke,target:"_blank",className:`${u}-item-image-link`,children:yt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:Ke,target:"_blank",className:`${u}-item-image-link`,children:yt}),Pe]})}):Ke?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:Ke,target:"_blank",className:`${u}-item-image-link`,children:[kt,yt]}),!Mt&&r.jsx("a",{href:Ke,target:"_blank",className:`${u}-item-text-link`,children:nt})]}):r.jsxs(r.Fragment,{children:[kt,yt,nt]})})},st)})})}),(!n||i)&&Jt&&typeof document<"u"&&v==="on"&&(()=>{const Oe=(c?document.getElementById(c):null)??document.body;return Pi.createPortal(r.jsx("div",{style:gt,"data-selection":"none",children:r.jsx(im,{items:Ft,index:Gt,imageDisplay:om(C),onClose:()=>qt(!1),onPrev:()=>Le(st=>(st-1+Ft.length)%Ft.length),onNext:()=>Le(st=>(st+1)%Ft.length),counterClassName:le,counterStyle:Q})}),Oe)})()]})}const am={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},sm=["hover","focus","filled","success","error"],lm=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4075
4079
|
import '@splidejs/react-splide/css/core';
|
|
4076
4080
|
import { CommonComponentProps } from '../props';
|
|
4077
4081
|
import {
|
|
@@ -4123,11 +4127,6 @@ function getGridTextLeadingVars(
|
|
|
4123
4127
|
} as React.CSSProperties;
|
|
4124
4128
|
}
|
|
4125
4129
|
|
|
4126
|
-
function getEffectiveGridEntryWidth(entryWidth: number, textWidthPercent?: number): number {
|
|
4127
|
-
const factor = textWidthPercent == null ? 1 : Math.max(1, textWidthPercent / 100);
|
|
4128
|
-
return entryWidth * factor;
|
|
4129
|
-
}
|
|
4130
|
-
|
|
4131
4130
|
function getCSS(P: string): string {
|
|
4132
4131
|
return \`
|
|
4133
4132
|
.\${P}-wrapper {
|
|
@@ -5229,6 +5228,7 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
5229
5228
|
const {
|
|
5230
5229
|
type = 'a',
|
|
5231
5230
|
gridLayout,
|
|
5231
|
+
textBoxWidth = 100,
|
|
5232
5232
|
verticalGap,
|
|
5233
5233
|
entriesCount,
|
|
5234
5234
|
lightbox,
|
|
@@ -5360,18 +5360,6 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
5360
5360
|
const cropContent = (content ?? []).slice(0, resEntriesCount);
|
|
5361
5361
|
|
|
5362
5362
|
const size = gridLayout.entryWidth ?? 0.2;
|
|
5363
|
-
const columnsCount = gridLayout.columnsCount;
|
|
5364
|
-
const textWidthPercent = gridLayout.textWidthPercent;
|
|
5365
|
-
const textWidthValue = size * (textWidthPercent ?? 100) / 100;
|
|
5366
|
-
const entryColumnWidthValue = getEffectiveGridEntryWidth(size, textWidthPercent);
|
|
5367
|
-
const entryWidthScaled = scalingValue(entryColumnWidthValue, isEditor);
|
|
5368
|
-
const horizontalGapScaled = scalingValue(gridLayout.horizontalGap ?? 0, isEditor);
|
|
5369
|
-
const itemsInLastRow = cropContent.length % columnsCount || columnsCount;
|
|
5370
|
-
const isPartialLastRow = itemsInLastRow < columnsCount && cropContent.length > 0;
|
|
5371
|
-
const lastRowStartIndex = cropContent.length - itemsInLastRow;
|
|
5372
|
-
const lastRowStartColumn = isPartialLastRow
|
|
5373
|
-
? Math.floor((columnsCount - itemsInLastRow) / 2) + 1
|
|
5374
|
-
: 1;
|
|
5375
5363
|
|
|
5376
5364
|
const isCover = imageDisplay?.display === 'cover';
|
|
5377
5365
|
const ratioValue = imageDisplay?.ratioValue ?? '1:1';
|
|
@@ -5381,9 +5369,18 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
5381
5369
|
const effH = ratioReversed ? rW : rH;
|
|
5382
5370
|
const aspectRatio = \`\${effW} / \${effH}\`;
|
|
5383
5371
|
|
|
5384
|
-
const
|
|
5372
|
+
const columnsCount = gridLayout.columnsCount;
|
|
5373
|
+
const entryWidthScaled = scalingValue(size ?? 0, isEditor);
|
|
5374
|
+
const imageWrapperWidth = entryWidthScaled;
|
|
5385
5375
|
const isFitSlider = !isCover && slider !== 'off';
|
|
5386
5376
|
|
|
5377
|
+
const itemsInLastRow = cropContent.length % columnsCount || columnsCount;
|
|
5378
|
+
const isPartialLastRow = itemsInLastRow < columnsCount && cropContent.length > 0;
|
|
5379
|
+
const lastRowStartIndex = cropContent.length - itemsInLastRow;
|
|
5380
|
+
const lastRowStartColumn = isPartialLastRow
|
|
5381
|
+
? Math.floor((columnsCount - itemsInLastRow) / 2) + 1
|
|
5382
|
+
: 1;
|
|
5383
|
+
|
|
5387
5384
|
const imageWrapperStyle: React.CSSProperties = {
|
|
5388
5385
|
width: imageWrapperWidth,
|
|
5389
5386
|
...(isCover
|
|
@@ -5394,8 +5391,8 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
5394
5391
|
const imageWrapperClassName = \`\${P}-item-image-wrapper\${isFitSlider ? \` \${P}-item-image-wrapper-fit-slider\` : ''}\`.trim();
|
|
5395
5392
|
const isTextBeforeImage = type === 'd' || type === 'e' || type === 'f';
|
|
5396
5393
|
const shouldAlignEntries = alignEntries === 'on';
|
|
5397
|
-
const textBoxWidthStyle = scalingValue(
|
|
5398
|
-
const controlWidthStyle = scalingValue(
|
|
5394
|
+
const textBoxWidthStyle = \`calc(\${scalingValue(size ?? 0, isEditor)} * (\${textBoxWidth} / 100))\`;
|
|
5395
|
+
const controlWidthStyle = scalingValue(size * textBoxWidth / 100, isEditor);
|
|
5399
5396
|
|
|
5400
5397
|
const imageStyle: React.CSSProperties = isCover
|
|
5401
5398
|
? {
|
|
@@ -5478,7 +5475,7 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
5478
5475
|
style={{
|
|
5479
5476
|
gridTemplateColumns: \`repeat(\${columnsCount}, \${entryWidthScaled})\`,
|
|
5480
5477
|
rowGap: shouldAlignEntries ? 0 : scalingValue(verticalGap ?? 0, isEditor),
|
|
5481
|
-
columnGap:
|
|
5478
|
+
columnGap: scalingValue(gridLayout.horizontalGap ?? 0, isEditor),
|
|
5482
5479
|
width: scalingValue(gridLayout.wrapperWidth ?? 0, isEditor),
|
|
5483
5480
|
...(shouldAlignEntries
|
|
5484
5481
|
? { [\`--\${P}-align-entries-row-gap\`]: scalingValue(verticalGap ?? 0, isEditor) }
|
|
@@ -5734,14 +5731,17 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
5734
5731
|
<div
|
|
5735
5732
|
key={index}
|
|
5736
5733
|
className={\`\${P}-item\`.trim()}
|
|
5734
|
+
style={gridColumn && !shouldAlignEntries ? { gridColumn } : undefined}
|
|
5737
5735
|
>
|
|
5738
5736
|
<div
|
|
5739
5737
|
className={\`\${isEditMode
|
|
5740
5738
|
? \`\${P}-item-inner\`
|
|
5741
5739
|
: \`\${P}-item-inner-hidden\`}\${shouldAlignEntries && isLastRow ? \` \${P}-item-inner-last-row\` : ''}\`.trim()}
|
|
5742
5740
|
style={{
|
|
5743
|
-
width:
|
|
5744
|
-
|
|
5741
|
+
width: (textBoxWidth ?? 0) > 100
|
|
5742
|
+
? \`calc(\${entryWidthScaled} * (\${textBoxWidth} / 100))\`
|
|
5743
|
+
: entryWidthScaled,
|
|
5744
|
+
...(gridColumn && shouldAlignEntries ? { gridColumn } : {}),
|
|
5745
5745
|
}}
|
|
5746
5746
|
>
|
|
5747
5747
|
{shouldAlignEntries ? (
|
|
@@ -5814,13 +5814,13 @@ type GridLayoutConfig = {
|
|
|
5814
5814
|
horizontalGap: number;
|
|
5815
5815
|
wrapperWidth: number;
|
|
5816
5816
|
columnsCount: number;
|
|
5817
|
-
textWidthPercent?: number;
|
|
5818
5817
|
lockedParam?: 'wrapperWidth' | 'entryWidth' | 'horizontalGap' | null;
|
|
5819
5818
|
};
|
|
5820
5819
|
|
|
5821
5820
|
type GridSettings = {
|
|
5822
5821
|
type: 'a' | 'b' | 'c' | 'd' | 'e' | 'f';
|
|
5823
5822
|
gridLayout: GridLayoutConfig;
|
|
5823
|
+
textBoxWidth: number;
|
|
5824
5824
|
verticalGap: number;
|
|
5825
5825
|
entriesCount: number;
|
|
5826
5826
|
lightbox: 'on' | 'off';
|
|
@@ -5877,12 +5877,12 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
5877
5877
|
};
|
|
5878
5878
|
|
|
5879
5879
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
5880
|
-
`,$r={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},sm=["titleColor","subtitleColor","lightboxCounterColor"],lm={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},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:"Flying Over the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Doors of Matera",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Cattedrale di Santa Maria",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"City Through the Cracks",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Private Stone Gardens",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/grid(7).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Leaving the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(8).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Under the Sun",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(9).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Citygates View",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(10).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Around the City",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(11).webp",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},textWidthPercent:{type:"number",title:"Text Width (%)",min:0,display:{type:"percentage-input"}}}}},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"}}},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:{...$r.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:{...$r.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:{...$r.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"on",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:"a",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,textWidthPercent:100,lockedParam:null},verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.0506,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},d:{type:"a",gridLayout:{entryWidth:.0833,horizontalGap:0,wrapperWidth:1,columnsCount:3,textWidthPercent:200,lockedParam:null},verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["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"]},{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:[...sm],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},cm={element:im,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:lm,sourceCode:am},dm=50,Ja=10,ma="cntrl-lightbox-journal",rr=ma,jr=`${ma}-`,ar=e=>`${ma}-${e}`,ga=e=>e===rr||e.startsWith(jr),Za=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Qa=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Za(t.get(ar(e)));if(i)return i}const n=Za(t.get(rr));if(n)return n;for(const[i]of t){if(!i.startsWith(jr))continue;const o=i.slice(jr.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},es=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},vl=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(s=>{ga(s)&&i.searchParams.delete(s)}),t?i.searchParams.set(ar(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)},um=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===ar(e)||i===rr:ga(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)}},xl=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(ar(e)):[...t.keys()].some(n=>ga(n))},pm=(e,t)=>{if(xl(t)){if(e){window.history.back();return}um(t)}},mm=20,gm=2,Cr=e=>`max(${e}, ${mm}px)`,$i=e=>((e==null?void 0:e.image)??[]).slice(0,gm),bl=e=>e.reduce((t,n)=>t+$i(n).length,0),hm=(e,t)=>{const n=e.slice(0,t).reduce((o,l)=>o+$i(l).length,1),i=$i(e[t]).length;return{start:n,end:n+i-1}},fm=(e,t)=>{const n=bl(e),{start:i,end:o}=hm(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},_o=(e,t)=>t==="B"?e.flatMap((n,i)=>$i(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:$i(n)})),ym=(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 fm(i,o)},ts=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",vm=(e,t,n)=>e==="B"?t.length>1:bl(n)>1,Zt=.004,_n=.004,vi={title1Width:.13,title2Width:.13,title3Width:.14},Nn=(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},Ci=(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},Ji=(e,t)=>Ci(e,t),qt=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Hn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ci(e.length,n),effective:Ji(e.length,n)}},wl=(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),Sl=(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),ai=["title1","title2","title3","count"],Ye=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,$l={title1:"1",title2:"2",title3:"3",count:"Count"},Cl=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")],xm=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ai.map(e=>[$l[e],Cl(e)]))}),bm={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},wm={title1:.02,title2:.02,title3:.02,count:.017},ti=(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[bm[t]]}},ni=(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??wm[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ot(i,n)};function Sm({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:m=0,title2MarginLeft:y=0,title3MarginLeft:E=0,titleRowMarginBottom:T=0,titleHeaderLayout:h="desktop",contentMarginTop:v=0,iconMarginRight:I=0,closeIcon:L=null,closeIconMaxWidth:R=0,closeIconColor:P="#000000",closeIconHoverColor:O="#cccccc"}=n,x=a.useCallback(B=>F.scalingValue(B,i??!1),[i]),N=x(v),k=x(I),$=x(T),q=h==="mobile",f=ni("title1",ti(n,"title1"),i),M=ni("title2",ti(n,"title2"),i),_=ni("title3",ti(n,"title3"),i),j=a.useMemo(()=>({title1Width:d??vi.title1Width,title2Width:c??vi.title2Width,title3Width:u??vi.title3Width}),[d,c,u]),te=a.useMemo(()=>({title2MarginLeft:y,title3MarginLeft:E}),[y,E]),ie=a.useMemo(()=>Nn(e,t,f,M,_),[e,t,f,M,_]),G=a.useMemo(()=>ie.map(B=>j[B.widthKey]),[ie,j]),z=a.useMemo(()=>Ci(ie.length,G),[ie.length,G]),H=a.useMemo(()=>Ji(ie.length,G),[ie.length,G]),W=a.useMemo(()=>ie.filter(B=>B.prefix==="title1"),[ie]),S=a.useMemo(()=>ie.filter(B=>B.prefix==="title2"||B.prefix==="title3"),[ie]),K=a.useMemo(()=>Hn(W,j),[W,j]),J=a.useMemo(()=>Hn(S,j),[S,j]),Q=!!(t.title1||t.title2||t.title3),D=L!==null;if(!(Q||D))return null;const g=(m??0)>0||o,pe=(B,we)=>{const Y=ie.findIndex(Te=>Te.prefix===B.prefix);if(!q||we==="single-row")return{effectiveWidth:H[Y]??0,resolvedWidth:z[Y]??0,maxWidth:qt(Y,z)};if(we==="two-row-top"){const Te=W.findIndex(He=>He.prefix===B.prefix);return{effectiveWidth:K.effective[Te]??0,resolvedWidth:K.resolved[Te]??0,maxWidth:qt(Te,K.resolved)}}const me=S.findIndex(Te=>Te.prefix===B.prefix);return{effectiveWidth:J.effective[me]??0,resolvedWidth:J.resolved[me]??0,maxWidth:qt(me,J.resolved)}},fe=(B,we,Y)=>{if(!q||Y==="single-row"){const je=B.findIndex(bt=>bt.prefix===we.prefix),Ke=B.map(bt=>j[bt.widthKey]),ct=Ci(B.length,Ke);return{effectiveWidth:Ji(B.length,Ke)[je]??0,resolvedWidth:ct[je]??0,maxWidth:qt(je,ct)}}if(Y==="two-row-top"){const je=B.filter(bt=>bt.prefix==="title1"),Ke=je.findIndex(bt=>bt.prefix===we.prefix),{resolved:ct,effective:ft}=Hn(je,j);return{effectiveWidth:ft[Ke]??0,resolvedWidth:ct[Ke]??0,maxWidth:qt(Ke,ct)}}const me=B.filter(je=>je.prefix==="title2"||je.prefix==="title3"),Te=me.findIndex(je=>je.prefix===we.prefix),{resolved:He,effective:Ze}=Hn(me,j);return{effectiveWidth:Ze[Te]??0,resolvedWidth:He[Te]??0,maxWidth:qt(Te,He)}},ve=B=>Sl(ie,z,te,B)+(q?0:m??0),Ne=()=>q?0:m??0,ne=B=>S.slice(0,B).reduce((we,Y,me)=>we+(Y.marginLeftKey?te[Y.marginLeftKey]??0:0)+(J.resolved[me]??0),0),ge=B=>{const we=S[B];return ne(B)+(we.marginLeftKey?te[we.marginLeftKey]??0:0)+(J.resolved[B]??0)},ee=(B,we,Y)=>{const me=B.marginLeftKey?te[B.marginLeftKey]??0:0,{effectiveWidth:Te,resolvedWidth:He,maxWidth:Ze}=Y??pe(B,we),je=Math.max(me,_n),Ke=o&&we==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":B.prefix,style:{width:x(Te),...me>0?{marginLeft:x(me)}:{}},children:[r.jsx("p",{className:B.className,style:B.style,children:B.text}),Ke&&B.marginLeftKey?r.jsx("div",{"data-controls":B.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:x(-me),width:x(je),height:"100%",pointerEvents:"auto"}}):null,Ke?r.jsx("div",{"data-controls":B.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ze),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:x(-Zt/2),width:x(Zt),height:"100%",pointerEvents:"auto"}}):null]},B.className)},be=(B="two-row")=>{const we=ie.findIndex(Te=>Te.prefix==="title1"),Y=we>=0?z[we]:j.title1Width,me=B==="two-row"&&o;return r.jsx("div",{...me?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Y)}:{},style:{width:x(m??0),flexShrink:0,alignSelf:"stretch",...me?{pointerEvents:"auto"}:{}}})},ce=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:f,"aria-hidden":"true",children:" "}),oe=B=>{const we=Nn(e,B,f,M,_);return r.jsx(r.Fragment,{children:we.map(Y=>ee(Y,"single-row",fe(we,Y,"single-row")))})},Z=B=>{const we=Nn(e,B,f,M,_),Y=we.find(me=>me.prefix==="title1");return Y?ee(Y,"two-row-top",fe(we,Y,"two-row-top")):null},Ce=(B,we=!1)=>{const Y=Nn(e,B,f,M,_),me=Y.filter(Ze=>Ze.prefix==="title2"||Ze.prefix==="title3"),Te=o&&we;return me.length>0||Te||(T??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[me.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:me.map(Ze=>ee(Ze,"two-row-bottom",fe(Y,Ze,"two-row-bottom")))}),we&&o?r.jsxs(r.Fragment,{children:[X(),se()]}):null]}):null,(T??0)>0||Te?r.jsx("div",{"data-controls":Te?"titleRowMarginBottom":void 0,"data-controls-axis":Te?"y":void 0,"data-controls-reverse":Te?"":void 0,className:Te?`${e}-control`:void 0,style:{height:$,width:"100%",flexShrink:0,pointerEvents:Te?"auto":"none"}}):null]}):null},Le=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(R??0,i),height:F.scalingValue(R??0,i),marginRight:k,"--close-icon-hover-color":O},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:B=>{B.stopPropagation(),s==null||s()},"aria-label":"Close",children:r.jsx(tn,{url:L??"",fill:P,hoverFill:i&&!l?P:O,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:k,height:"100%",pointerEvents:"auto"}})]}),$e=()=>D?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Le()}):null,ke=B=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:B})}),b=B=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[D||Q?ce():null,g?be("two-row"):null,ke(B),$e()]}),re=(B,we=!1)=>r.jsxs(r.Fragment,{children:[b(Z(B)),Ce(B,we)]}),C=()=>{const B=q?-1:ie.findIndex(me=>me.prefix==="title1"),we=!q&&(o||(m??0)>0)?(()=>{const me=m??0,Te=B>=0?z[B]:j.title1Width,He=Math.max(me,_n);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:0,width:x(He),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Y=ie.flatMap((me,Te)=>{if(!me.marginLeftKey)return[];const He=te[me.marginLeftKey]??0,Ze=wl(ie,z,te,Te)+Ne(),je=Math.max(He,_n);return r.jsx("div",{"data-controls":me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(z[Te]),style:{position:"absolute",top:0,left:x(Ze),width:x(je),height:"100%",pointerEvents:"auto"}},me.marginLeftKey)});return we?[we,...Y]:Y},U=()=>ie.map((B,we)=>{const Y=qt(we,z),Te=ve(we)-Zt/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":B.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Y),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:x(Te),width:x(Zt),height:"100%",pointerEvents:"auto"}})},`${B.widthKey}-junction`)}),X=()=>S.flatMap((B,we)=>{if(!B.marginLeftKey)return[];const Y=te[B.marginLeftKey]??0,me=ne(we),Te=Math.max(Y,_n),{resolvedWidth:He}=pe(B,"two-row-bottom");return r.jsx("div",{"data-controls":B.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:x(me),width:x(Te),height:"100%",pointerEvents:"auto"}},B.marginLeftKey)}),se=()=>S.map((B,we)=>{const{maxWidth:Y}=pe(B,"two-row-bottom"),Te=ge(we)-Zt/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":B.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Y),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:x(Te),width:x(Zt),height:"100%",pointerEvents:"auto"}})},`${B.widthKey}-junction`)}),le=()=>!o||q?null:r.jsxs(r.Fragment,{children:[C(),U()]}),ye=!!(t.title2||t.title3||(T??0)>0||o),We=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[D||Q?ce():null,g?be("single-row"):null,Q?ke(oe(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),$e(),le()]}),Me=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ye?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:ye?void 0:{flex:"0 0 auto",height:"auto"},children:re(t,!0)}),le()]});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:N,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: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?Me():We()})})})]})}function $m(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Cm(e){return`
|
|
5880
|
+
`,Tr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},cm=["titleColor","subtitleColor","lightboxCounterColor"],dm={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},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:"Flying Over the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Doors of Matera",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Cattedrale di Santa Maria",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"City Through the Cracks",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Private Stone Gardens",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/grid(7).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Leaving the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(8).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Under the Sun",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(9).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Citygates View",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(10).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Around the City",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(11).webp",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"}}},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:{...Tr.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:{...Tr.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:{...Tr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"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,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.0506,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.015625,subtitleLineHeight:.018229166666666668,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,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","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"]},{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:[...cm],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},um={element:rm,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:dm,sourceCode:lm},pm=50,ts=10,va="cntrl-lightbox-journal",sr=va,Gr=`${va}-`,lr=e=>`${va}-${e}`,xa=e=>e===sr||e.startsWith(Gr),ns=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},is=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=ns(t.get(lr(e)));if(i)return i}const n=ns(t.get(sr));if(n)return n;for(const[i]of t){if(!i.startsWith(Gr))continue;const o=i.slice(Gr.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},os=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},bl=(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(lr(t),String(e)):i.searchParams.set(sr,String(e));const o=n?"replaceState":"pushState",l=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",l)},mm=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===lr(e)||i===sr: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)}},wl=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(lr(e)):[...t.keys()].some(n=>xa(n))},gm=(e,t)=>{if(wl(t)){if(e){window.history.back();return}mm(t)}},hm=20,fm=2,Lr=e=>`max(${e}, ${hm}px)`,$i=e=>((e==null?void 0:e.image)??[]).slice(0,fm),Sl=e=>e.reduce((t,n)=>t+$i(n).length,0),ym=(e,t)=>{const n=e.slice(0,t).reduce((o,l)=>o+$i(l).length,1),i=$i(e[t]).length;return{start:n,end:n+i-1}},vm=(e,t)=>{const n=Sl(e),{start:i,end:o}=ym(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},No=(e,t)=>t==="B"?e.flatMap((n,i)=>$i(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:$i(n)})),xm=(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 vm(i,o)},rs=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",bm=(e,t,n)=>e==="B"?t.length>1:Sl(n)>1,en=.004,Fn=.004,vi={title1Width:.13,title2Width:.13,title3Width:.14},Wn=(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},Ci=(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},eo=(e,t)=>Ci(e,t),Ut=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},_n=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ci(e.length,n),effective:eo(e.length,n)}},$l=(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),Cl=(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),oi=["title1","title2","title3","count"],Ue=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Tl={title1:"1",title2:"2",title3:"3",count:"Count"},Ll=e=>[Ue(e,"fontFamily"),Ue(e,"fontSettings"),{type:"row",items:[Ue(e,"fontSize"),Ue(e,"lineHeight"),Ue(e,"letterSpacing"),Ue(e,"wordSpacing")]},Ue(e,"textAlign"),Ue(e,"textAppearance")],wm=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oi.map(e=>[Tl[e],Ll(e)]))}),Sm={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},$m={title1:.02,title2:.02,title3:.02,count:.017},Qn=(e,t)=>{const n=i=>{const o=Ue(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Sm[t]]}},ei=(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??$m[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Bt(i,n)};function Cm({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:m=0,title2MarginLeft:y=0,title3MarginLeft:w=0,titleRowMarginBottom:$=0,titleHeaderLayout:h="desktop",contentMarginTop:v=0,iconMarginRight:S=0,closeIcon:C=null,closeIconMaxWidth:E=0,closeIconColor:M="#000000",closeIconHoverColor:H="#cccccc"}=n,x=a.useCallback(z=>N.scalingValue(z,i??!1),[i]),j=x(v),P=x(S),T=x($),G=h==="mobile",f=ei("title1",Qn(n,"title1"),i),A=ei("title2",Qn(n,"title2"),i),_=ei("title3",Qn(n,"title3"),i),V=a.useMemo(()=>({title1Width:d??vi.title1Width,title2Width:c??vi.title2Width,title3Width:u??vi.title3Width}),[d,c,u]),te=a.useMemo(()=>({title2MarginLeft:y,title3MarginLeft:w}),[y,w]),ne=a.useMemo(()=>Wn(e,t,f,A,_),[e,t,f,A,_]),K=a.useMemo(()=>ne.map(z=>V[z.widthKey]),[ne,V]),B=a.useMemo(()=>Ci(ne.length,K),[ne.length,K]),F=a.useMemo(()=>eo(ne.length,K),[ne.length,K]),I=a.useMemo(()=>ne.filter(z=>z.prefix==="title1"),[ne]),R=a.useMemo(()=>ne.filter(z=>z.prefix==="title2"||z.prefix==="title3"),[ne]),U=a.useMemo(()=>_n(I,V),[I,V]),D=a.useMemo(()=>_n(R,V),[R,V]),ee=!!(t.title1||t.title2||t.title3),O=C!==null;if(!(ee||O))return null;const g=(m??0)>0||o,ue=(z,Te)=>{const Z=ne.findIndex(ve=>ve.prefix===z.prefix);if(!G||Te==="single-row")return{effectiveWidth:F[Z]??0,resolvedWidth:B[Z]??0,maxWidth:Ut(Z,B)};if(Te==="two-row-top"){const ve=I.findIndex(ke=>ke.prefix===z.prefix);return{effectiveWidth:U.effective[ve]??0,resolvedWidth:U.resolved[ve]??0,maxWidth:Ut(ve,U.resolved)}}const fe=R.findIndex(ve=>ve.prefix===z.prefix);return{effectiveWidth:D.effective[fe]??0,resolvedWidth:D.resolved[fe]??0,maxWidth:Ut(fe,D.resolved)}},me=(z,Te,Z)=>{if(!G||Z==="single-row"){const Xe=z.findIndex(Et=>Et.prefix===Te.prefix),ht=z.map(Et=>V[Et.widthKey]),xt=Ci(z.length,ht);return{effectiveWidth:eo(z.length,ht)[Xe]??0,resolvedWidth:xt[Xe]??0,maxWidth:Ut(Xe,xt)}}if(Z==="two-row-top"){const Xe=z.filter(Et=>Et.prefix==="title1"),ht=Xe.findIndex(Et=>Et.prefix===Te.prefix),{resolved:xt,effective:It}=_n(Xe,V);return{effectiveWidth:It[ht]??0,resolvedWidth:xt[ht]??0,maxWidth:Ut(ht,xt)}}const fe=z.filter(Xe=>Xe.prefix==="title2"||Xe.prefix==="title3"),ve=fe.findIndex(Xe=>Xe.prefix===Te.prefix),{resolved:ke,effective:Qe}=_n(fe,V);return{effectiveWidth:Qe[ve]??0,resolvedWidth:ke[ve]??0,maxWidth:Ut(ve,ke)}},we=z=>Cl(ne,B,te,z)+(G?0:m??0),_e=()=>G?0:m??0,oe=z=>R.slice(0,z).reduce((Te,Z,fe)=>Te+(Z.marginLeftKey?te[Z.marginLeftKey]??0:0)+(D.resolved[fe]??0),0),ye=z=>{const Te=R[z];return oe(z)+(Te.marginLeftKey?te[Te.marginLeftKey]??0:0)+(D.resolved[z]??0)},X=(z,Te,Z)=>{const fe=z.marginLeftKey?te[z.marginLeftKey]??0:0,{effectiveWidth:ve,resolvedWidth:ke,maxWidth:Qe}=Z??ue(z,Te),Xe=Math.max(fe,Fn),ht=o&&Te==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":z.prefix,style:{width:x(ve),...fe>0?{marginLeft:x(fe)}:{}},children:[r.jsx("p",{className:z.className,style:z.style,children:z.text}),ht&&z.marginLeftKey?r.jsx("div",{"data-controls":z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:x(-fe),width:x(Xe),height:"100%",pointerEvents:"auto"}}):null,ht?r.jsx("div",{"data-controls":z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Qe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:x(-en/2),width:x(en),height:"100%",pointerEvents:"auto"}}):null]},z.className)},be=(z="two-row")=>{const Te=ne.findIndex(ve=>ve.prefix==="title1"),Z=Te>=0?B[Te]:V.title1Width,fe=z==="two-row"&&o;return r.jsx("div",{...fe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Z)}:{},style:{width:x(m??0),flexShrink:0,alignSelf:"stretch",...fe?{pointerEvents:"auto"}:{}}})},ce=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:f,"aria-hidden":"true",children:" "}),ge=z=>{const Te=Wn(e,z,f,A,_);return r.jsx(r.Fragment,{children:Te.map(Z=>X(Z,"single-row",me(Te,Z,"single-row")))})},se=z=>{const Te=Wn(e,z,f,A,_),Z=Te.find(fe=>fe.prefix==="title1");return Z?X(Z,"two-row-top",me(Te,Z,"two-row-top")):null},Ie=(z,Te=!1)=>{const Z=Wn(e,z,f,A,_),fe=Z.filter(Qe=>Qe.prefix==="title2"||Qe.prefix==="title3"),ve=o&&Te;return fe.length>0||ve||($??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[fe.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:fe.map(Qe=>X(Qe,"two-row-bottom",me(Z,Qe,"two-row-bottom")))}),Te&&o?r.jsxs(r.Fragment,{children:[J(),de()]}):null]}):null,($??0)>0||ve?r.jsx("div",{"data-controls":ve?"titleRowMarginBottom":void 0,"data-controls-axis":ve?"y":void 0,"data-controls-reverse":ve?"":void 0,className:ve?`${e}-control`:void 0,style:{height:T,width:"100%",flexShrink:0,pointerEvents:ve?"auto":"none"}}):null]}):null},Fe=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:N.scalingValue(E??0,i),height:N.scalingValue(E??0,i),marginRight:P,"--close-icon-hover-color":H},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:z=>{z.stopPropagation(),s==null||s()},"aria-label":"Close",children:r.jsx(on,{url:C??"",fill:M,hoverFill:i&&!l?M:H,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:P,height:"100%",pointerEvents:"auto"}})]}),he=()=>O?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Fe()}):null,Ce=z=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:z})}),W=z=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[O||ee?ce():null,g?be("two-row"):null,Ce(z),he()]}),Q=(z,Te=!1)=>r.jsxs(r.Fragment,{children:[W(se(z)),Ie(z,Te)]}),L=()=>{const z=G?-1:ne.findIndex(fe=>fe.prefix==="title1"),Te=!G&&(o||(m??0)>0)?(()=>{const fe=m??0,ve=z>=0?B[z]:V.title1Width,ke=Math.max(fe,Fn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ve),style:{position:"absolute",top:0,left:0,width:x(ke),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Z=ne.flatMap((fe,ve)=>{if(!fe.marginLeftKey)return[];const ke=te[fe.marginLeftKey]??0,Qe=$l(ne,B,te,ve)+_e(),Xe=Math.max(ke,Fn);return r.jsx("div",{"data-controls":fe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(B[ve]),style:{position:"absolute",top:0,left:x(Qe),width:x(Xe),height:"100%",pointerEvents:"auto"}},fe.marginLeftKey)});return Te?[Te,...Z]:Z},Y=()=>ne.map((z,Te)=>{const Z=Ut(Te,B),ve=we(Te)-en/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(Z),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:x(ve),width:x(en),height:"100%",pointerEvents:"auto"}})},`${z.widthKey}-junction`)}),J=()=>R.flatMap((z,Te)=>{if(!z.marginLeftKey)return[];const Z=te[z.marginLeftKey]??0,fe=oe(Te),ve=Math.max(Z,Fn),{resolvedWidth:ke}=ue(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(ke),style:{position:"absolute",top:0,left:x(fe),width:x(ve),height:"100%",pointerEvents:"auto"}},z.marginLeftKey)}),de=()=>R.map((z,Te)=>{const{maxWidth:Z}=ue(z,"two-row-bottom"),ve=ye(Te)-en/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(Z),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:x(ve),width:x(en),height:"100%",pointerEvents:"auto"}})},`${z.widthKey}-junction`)}),le=()=>!o||G?null:r.jsxs(r.Fragment,{children:[L(),Y()]}),ie=!!(t.title2||t.title3||($??0)>0||o),Re=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[O||ee?ce():null,g?be("single-row"):null,ee?Ce(ge(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),he(),le()]}),Se=()=>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:Q(t,!0)}),le()]});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:j,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...G?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${G?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${G?` ${e}-text-bar-cell-stacked`:""}`,style:G?void 0:{flex:1,minWidth:0,width:"100%"},children:G?Se():Re()})})})]})}function Tm(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Lm(e){return`
|
|
5881
5881
|
.${e}-wrapper {
|
|
5882
5882
|
display: grid;
|
|
5883
5883
|
align-items: start;
|
|
5884
5884
|
justify-content: center;
|
|
5885
|
-
min-height: ${
|
|
5885
|
+
min-height: ${Tm(48)};
|
|
5886
5886
|
}
|
|
5887
5887
|
.${e}-item {
|
|
5888
5888
|
display: flex;
|
|
@@ -6208,7 +6208,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
6208
6208
|
pointer-events: auto;
|
|
6209
6209
|
flex-shrink: 0;
|
|
6210
6210
|
}
|
|
6211
|
-
`}const ns={url:"",name:"",objectFit:"cover"},Yt=500,wn="cubic-bezier(0.22, 1, 0.36, 1)",Tm=72,Lm=50;function Im(e){return e.reduce((t,n,i)=>{const o=ha(n.gallery),s=fa(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 Co(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}const Em=.05;function Tl(e){return e.width*Em}const Tr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function To(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function is(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Rm(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Br(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 Mm(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Br(e,t.width,t.height)}function Pm(e,t){if(Wi(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 km(e){const t=new Set,n=[];for(const i of e){const o=ha(i.gallery),l=fa(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 Am({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=>Wi(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 Zi(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=Tl(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 zr(e,t,n){const i=Zi(e,t,n);return{...i,left:2*i.left-e.left}}function Wm(e,t,n){const{left:i,width:o}=n,l=Tl(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 Ll(e,t,n,i){const o=Zi(e,"left",i),l=Zi(e,"right",i),s=zr(e,"left",i),d=zr(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 Fm(e,t,n,i){const{start:o,end:l}=Ll(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function Il(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 ha(e){if(!e)return;if(Il(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??ns,i??o??ns]}]}function _m(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Nm(e){const[t]=e.media;return t!=null&&t.url?t:null}function fa(e){if(!Array.isArray(e)||e.length===0)return[];if(Il(e)){const t=[];for(const n of e){const i=_m(n);if(!i)continue;const o=Nm(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 Wi(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Hm(e){e.pause()}function Om({media:e,className:t,style:n,onMediaClick:i}){return Wi(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function jm({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&&Hm(c),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 Lo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Wi(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 Bm({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:y,onClose:E,onPrev:T,onNext:h}){const v=a.useRef(null),I=a.useRef(null),L=a.useRef(null),R=a.useRef(new Map),[P,O]=a.useState(0),x=a.useRef(null),N=a.useRef(0),k=a.useRef(0),$=a.useRef("none"),q=a.useRef(!1),f=a.useRef(!1),M=a.useRef(!1),_=a.useRef(null),j=a.useRef(null),[te,ie]=a.useState(null),[G,z]=a.useState(Tr),[H,W]=a.useState(0),[S,K]=a.useState("opening"),[J,Q]=a.useState(0),[D,ue]=a.useState(0),[g,pe]=a.useState(!1),[fe,ve]=a.useState(null),[Ne,ne]=a.useState(null),[ge,ee]=a.useState(null),[be,ce]=a.useState(!1),[oe,Z]=a.useState(!1),[Ce,Le]=a.useState(!1),$e=a.useRef(n),ke=a.useRef(void 0),b=t[n],re=b?Wi(b):!1,C=D!==0||g,U=!s&&(!l||!!d),X=c&&!s,se=u.length>1,le=a.useCallback((he,Ae)=>t.length<=1?null:t[(he+Ae+t.length)%t.length]??null,[t]),ye=se?Co(u,m,-1):le(n,-1),We=se?Co(u,m,1):le(n,1),Me=fe===-1&&C?se&&Ne!==null?Co(u,Ne,-1):ge!==null?le(ge,-1):null:null,B=fe===1&&C?se&&Ne!==null?Co(u,Ne,1):ge!==null?le(ge,1):null:null,we=Me&&Me.url!==(ye==null?void 0:ye.url)?Me:null,Y=B&&B.url!==(We==null?void 0:We.url)?B:null,me=a.useCallback((he,Ae,ze)=>{if(!he||!Ae||!ze)return;const de=R.current,Ie=de.get(he);(Ie==null?void 0:Ie.width)===Ae&&(Ie==null?void 0:Ie.height)===ze||(de.set(he,{width:Ae,height:ze}),O(_e=>_e+1))},[]),Te=a.useCallback(he=>{if(!(he!=null&&he.url))return null;const Ae=R.current.get(he.url);return Mm(I.current,Ae)},[P,H]),He=a.useCallback(()=>{if(!b)return;const he=Te(b);if(he){ie(he);return}const Ae=I.current;Ae&&ie(is(Ae))},[b,Te]),Ze=a.useCallback(he=>{if(se){const Ae=u.length;ne((m+he+Ae)%Ae),ee(null);return}t.length>1&&(ee((n+he+t.length)%t.length),ne(null))},[se,u.length,m,t.length,n]),je=a.useCallback(he=>{M.current=he,pe(he)},[]),Ke=a.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),ct=a.useCallback(()=>{Ke(),_.current=window.setTimeout(()=>{Ke(),je(!1)},Yt+32)},[Ke,je]),ft=a.useCallback(()=>{const he=v.current;if(!he){z({left:0,top:0,width:typeof window<"u"?window.innerWidth:Tr.width,height:typeof window<"u"?window.innerHeight:Tr.height});return}const Ae=he.getBoundingClientRect();z({left:Ae.left,top:Ae.top,width:Ae.width,height:Ae.height})},[]),bt=a.useCallback((he,Ae,ze)=>{if(C){if(oe&&!g)return`translate(${D}px, 0px)`;if(g&&fe!==null){if((Ae==="far-left"||Ae==="far-right")&&!(ze!=null&&ze.farMediaReady))return"translate(0px, 0px)";const de=Te(he);if(!de)return;const{x:Ie,y:_e}=Fm(de,Ae,fe,G);return`translate(${Ie}px, ${_e}px)`}if(g)return"translate(0px, 0px)"}},[C,oe,g,D,fe,G,Te]),Ct=a.useCallback(()=>{const he=j.current;j.current=null,Ke(),je(!1),ve(null),ne(null),ee(null),ce(!1),ue(0),Z(!1),q.current=!1,k.current=0,$.current="none",he===-1?T():he===1&&h()},[Ke,je,T,h]),Qe=a.useCallback(()=>{Ke(),_.current=window.setTimeout(()=>{j.current!==null&&Ct()},Yt+32)},[Ke,Ct]),Be=a.useCallback(he=>{!X||!te||M.current||(Ke(),Ze(he),j.current=he,ve(he),je(!0),Qe())},[X,te,Ke,Ze,je,Qe]),Je=a.useCallback(()=>{const he=I.current;if(!he)return;const Ae=b==null?void 0:b.url,ze=Ae?R.current.get(Ae):void 0;if(ze!=null&&ze.width&&(ze!=null&&ze.height)){ie(Br(he,ze.width,ze.height));return}const de=L.current;if(de&&Ae&&(de.src===Ae||de.currentSrc===Ae)){const{width:_e,height:Re}=Rm(de);if(_e&&Re){me(Ae,_e,Re),ie(Br(he,_e,Re));return}}const Ie=is(he);!Ie.width||!Ie.height||ie(Ie)},[b==null?void 0:b.url,me]),ut=a.useCallback(he=>{if(L.current=he,!!he){if(he instanceof HTMLVideoElement){he.readyState>=1&&he.videoWidth>0&&Je();return}he.complete&&he.naturalWidth>0&&Je()}},[Je]),et=a.useCallback(()=>{ft(),Je(),W(he=>he+1)},[ft,Je]);a.useEffect(()=>{et();const he=I.current,Ae=v.current,ze=new ResizeObserver(()=>et());return he&&ze.observe(he),Ae&&ze.observe(Ae),window.addEventListener("resize",et),()=>{ze.disconnect(),window.removeEventListener("resize",et)}},[et,n,y]),a.useLayoutEffect(()=>{if(!b)return;const he=L.current;if(he){if(he instanceof HTMLImageElement&&he.complete&&he.naturalWidth>0){Je();return}he instanceof HTMLVideoElement&&he.readyState>=1&&he.videoWidth>0&&Je()}},[b==null?void 0:b.url,n,Je]),a.useEffect(()=>{He()},[He,P]),a.useEffect(()=>{const he=new Set,Ae=[],ze=de=>{!(de!=null&&de.url)||he.has(de.url)||(he.add(de.url),Ae.push(de))};t.forEach(ze),u.forEach(de=>de.items.forEach(ze)),Ae.forEach(de=>{R.current.has(de.url)||Pm(de,me)})},[t,u,me]),a.useEffect(()=>{S==="opening"&&te&&K("open")},[S,te]),a.useEffect(()=>{if(S!=="closing")return;const he=setTimeout(()=>E(),Yt);return()=>clearTimeout(he)},[S,E]),a.useEffect(()=>()=>{Ke()},[Ke]),a.useLayoutEffect(()=>{$e.current===n&&ke.current===(b==null?void 0:b.url)||(Ke(),j.current=null,ve(null),ne(null),ee(null),ce(!1),Q(0),ue(0),je(!1),Le(!1),Z(!1),N.current=0,k.current=0,$.current="none",q.current=!1,x.current=null,f.current=!1,L.current=null,He(),$e.current=n,ke.current=b==null?void 0:b.url)},[n,b==null?void 0:b.url,je,Ke,He]),a.useLayoutEffect(()=>{if(!(we||Y)||!C){ce(!1);return}ce(!1);const he=requestAnimationFrame(()=>{requestAnimationFrame(()=>ce(!0))});return()=>cancelAnimationFrame(he)},[we==null?void 0:we.url,Y==null?void 0:Y.url,C]),a.useEffect(()=>{if(S!=="open")return;const he=()=>{const Re=qe=>{qe.stopPropagation(),qe.preventDefault(),document.removeEventListener("click",Re,!0)};document.addEventListener("click",Re,!0)},Ae=Re=>{const qe=Re<0?1:-1;Ke(),Ze(qe),j.current=qe,ve(qe),je(!0),Qe()},ze=Re=>{if(Math.abs(Re)>Lm&&X){Ae(Re);return}j.current=null,ve(null),ne(null),ee(null),ce(!1),je(!0),ue(0),ct()},de=Re=>{if(Re.touches.length!==1||M.current)return;const qe=Re.touches[0];f.current=!0,x.current={x:qe.clientX,y:qe.clientY},$.current="none",k.current=0,q.current=!1},Ie=Re=>{if(!x.current||Re.touches.length!==1||M.current)return;const qe=Re.touches[0],gt=qe.clientX-x.current.x,Fe=qe.clientY-x.current.y;if($.current==="none"){if(Math.abs(gt)<10&&Math.abs(Fe)<10)return;if(Math.abs(gt)>Math.abs(Fe)){if(!X)return;$.current="horizontal"}else if(Fe>0){if(!U)return;$.current="vertical"}else return}if($.current==="horizontal"){q.current=!0,Z(!0),k.current=gt,ue(gt),Re.preventDefault();return}$.current==="vertical"&&(q.current=!0,Z(!0),N.current=Fe,Q(Fe),Re.preventDefault())},_e=()=>{if(!x.current)return;const Re=$.current,qe=q.current;if(qe&&Re==="horizontal")ze(k.current),he();else if(qe&&Re==="vertical"){const gt=N.current;if(U&>>Tm){const Fe=window.innerHeight;N.current=Fe,Le(!0),Q(Fe),K("closing")}else N.current=0,Q(0);he()}else Re==="horizontal"&&Math.abs(k.current)>0&&(ze(k.current),he());x.current=null,$.current="none",k.current=0,q.current=!1,Z(!1)};return document.addEventListener("touchstart",de,{passive:!0}),document.addEventListener("touchmove",Ie,{passive:!1}),document.addEventListener("touchend",_e),document.addEventListener("touchcancel",_e),()=>{document.removeEventListener("touchstart",de),document.removeEventListener("touchmove",Ie),document.removeEventListener("touchend",_e),document.removeEventListener("touchcancel",_e)}},[S,X,je,ct,Ke,U,Qe,Ze]),a.useEffect(()=>{const he=Ae=>{Ae.key==="Escape"&&(l&&d||S!=="closing"&&K("closing"))};return window.addEventListener("keydown",he),()=>window.removeEventListener("keydown",he)},[S,l,d]);const It=()=>{S==="closing"||s||K("closing")},yt=S==="open",ot=S==="closing",Wt=J>0?Math.max(0,1-J/500):1,jt=J>0?Math.max(.35,1-J/500):1,Ue=a.useCallback(he=>{if(!(he.propertyName!=="transform"||!M.current)){if(j.current!==null){Ct();return}Ke(),je(!1)}},[Ke,je,Ct]),$t=C&&b?bt(b,"center"):J>0?`translateY(${J}px)`:void 0,Ge=te?To(te,G):null,tt={position:"absolute",top:Ge==null?void 0:Ge.top,left:Ge==null?void 0:Ge.left,width:Ge==null?void 0:Ge.width,height:Ge==null?void 0:Ge.height,objectFit:"contain",transform:$t,opacity:J>0?jt:S==="opening"||ot?0:1,transition:oe&&!g?"none":g?`transform ${Yt}ms ${wn}`:Ce?`transform ${Yt}ms ${wn}, opacity ${Yt}ms ${wn}`:S==="opening"||ot?`opacity ${Yt}ms ${wn}`:"none",pointerEvents:re&&yt&&!C?"auto":"none",touchAction:re&&yt?"none":void 0,zIndex:1,overflow:re?"hidden":void 0},pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:yt&&!C?"auto":"none"},rt=(he,Ae,ze="adjacent")=>{const de=Te(he);if(!de)return{display:"none"};const Ie=ze==="far"?Ae==="left"?"far-left":"far-right":Ae==="left"?"left-adjacent":"right-adjacent",{start:_e}=fe!==null?Ll(de,Ie,fe,G):{start:ze==="far"?zr(de,Ae,G):Zi(de,Ae,G)},Re=To(_e,G),qe=bt(he,Ie,{farMediaReady:ze!=="far"||be}),gt=oe&&!g?!1:g||ze==="far"&&be;return{position:"absolute",top:Re.top,left:Re.left,width:Re.width,height:Re.height,objectFit:"contain",transform:qe,opacity:ze==="far"?be&&yt?1:0:yt?1:0,transition:gt?`transform ${Yt}ms ${wn}, opacity ${Yt}ms ${wn}`:S==="opening"||ot?`opacity ${Yt}ms ${wn}`:"none",pointerEvents:"none",zIndex:1}},Kt=(he,Ae)=>{const ze=Te(he);return ze?Wm(Zi(ze,Ae,G),Ae,G):null},rn=he=>Ae=>{if(!s){if(f.current){f.current=!1;return}Ae.stopPropagation(),Be(he)}},gn=ye?Kt(ye,"left"):null,mt=We?Kt(We,"right"):null,Dt=gn?To(gn,G):null,Rt=mt?To(mt,G):null;return r.jsxs("div",{ref:v,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:S==="open"?"none":void 0},onClick:It,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"#ffffff",opacity:yt?Wt:0,transition:oe?"none":`opacity ${Yt}ms ${wn}`,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:yt?1:0,transition:oe?"none":`opacity ${Yt}ms ${wn}`,pointerEvents:"none"},children:r.jsx(Sm,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:It})})]}),yt&&we&&r.jsx(Lo,{media:we,style:rt(we,"left","far"),onMeasure:me,onTransitionEnd:Ue},`far-prev-${we.url}`),yt&&ye&&r.jsxs(r.Fragment,{children:[r.jsx(Lo,{media:ye,style:rt(ye,"left"),onMeasure:me,onTransitionEnd:Ue},`prev-${ye.url}`),Dt&&r.jsx("div",{style:{position:"absolute",top:Dt.top,left:Dt.left,width:Dt.width,height:Dt.height,cursor:C||s?"default":"pointer",pointerEvents:C||s?"none":"auto",zIndex:3},onClick:rn(-1)})]}),yt&&We&&r.jsxs(r.Fragment,{children:[r.jsx(Lo,{media:We,style:rt(We,"right"),onMeasure:me,onTransitionEnd:Ue},`next-${We.url}`),Rt&&r.jsx("div",{style:{position:"absolute",top:Rt.top,left:Rt.left,width:Rt.width,height:Rt.height,cursor:C||s?"default":"pointer",pointerEvents:C||s?"none":"auto",zIndex:3},onClick:rn(1)})]}),yt&&Y&&r.jsx(Lo,{media:Y,style:rt(Y,"right","far"),onMeasure:me,onTransitionEnd:Ue},`far-next-${Y.url}`),te&&b&&(re?r.jsx(jm,{src:b.url,phase:S,onMediaElement:ut,wrapperStyle:tt,videoStyle:pt,onLoadedMetadata:Je,onTransitionEnd:Ue},`${n}-${b.url}`):r.jsx("img",{ref:ut,src:b.url,alt:b.name,onLoad:Je,onTransitionEnd:Ue,style:tt},`${n}-${b.url}`))]})}function zm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=F.useScopedStyles(),{gridLayout:c,verticalGap:u,align:m="top",imageDisplay:y}=e,E=(y==null?void 0:y.display)==="cover",T=(y==null?void 0:y.ratioValue)??"1:1",h=(y==null?void 0:y.reversed)??!1,[v,I]=T.split(":").map(Number),P=`${h?I:v} / ${h?v:I}`,O=c.entryWidth??.2,x=c.columnsCount,N=F.scalingValue(O,n),k=F.scalingValue(c.horizontalGap??0,n),$=N,q=N,f={width:$,...E?{aspectRatio:P,height:"auto",overflow:"hidden"}:{height:"auto"}},M=E?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},_=a.useRef(null),[j,te]=a.useState(!1),[ie,G]=a.useState([]),[z,H]=a.useState(0),[W,S]=a.useState(0),[K,J]=a.useState({title1:"",title2:"",title3:""}),Q=(()=>{const oe={},Z=_.current?getComputedStyle(_.current).getPropertyValue("--cntrl-article-width").trim():"";return Z&&(oe["--cntrl-article-width"]=Z),oe})(),D=!n||i||o,ue=a.useMemo(()=>Cm(d),[d]),g=t??[],pe=g.length%x||x,fe=pe<x&&g.length>0,ve=g.length-pe,Ne=fe?Math.floor((x-pe)/2)+1:1,ne=a.useMemo(()=>Im(g),[g]),ge=a.useMemo(()=>km(g),[g]),ee=(oe,Z)=>{if(n&&!o&&!i)return;const Ce=ne.findIndex($e=>$e.gridIndex===oe);if(Ce<0)return;const Le=ne[Ce];S(Ce),G(Le.items),H(Z),J(Le.entry),te(!0)},be=a.useCallback(oe=>{if(ne.length>1){const Z=ne.length,Ce=(W+oe+Z)%Z,Le=ne[Ce],$e=Math.min(z,Le.items.length-1);S(Ce),G(Le.items),H($e),J(Le.entry);return}H(Z=>(Z+oe+ie.length)%ie.length)},[ne,W,z,ie.length]),ce=ne.length>1||ie.length>1;return a.useEffect(()=>{if(!j||typeof document>"u")return;const oe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=oe}},[j]),a.useEffect(()=>{!n||o||i||te(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ue}}),r.jsx(Am,{mediaList:ge}),r.jsx("div",{ref:_,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${m}`.trim(),style:{gridTemplateColumns:`repeat(${x}, ${N})`,rowGap:0,columnGap:k,width:F.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:F.scalingValue(u??0,n)},children:g.map((oe,Z)=>{const Ce=ha(oe.gallery),Le=fa(Ce),$e=Le.filter(C=>C.lightboxMedia).map(C=>C.lightboxMedia),ke=Math.floor(Z/x)===Math.ceil(g.length/x)-1,b=fe&&Z>=ve?`${Ne+(Z-ve)}`:void 0,re=r.jsx("div",{className:`${d}-item-image-wrapper`,style:f,children:Le.length===0?null:(()=>{const{displayMedia:C,lightboxMedia:U}=Le[0],X=U?$e.findIndex(se=>se.url===U.url):-1;return r.jsx(Om,{media:C,className:`${d}-item-${Wi(C)?"video":"image"}`.trim(),style:M,onMediaClick:D&&X>=0?()=>ee(Z,X):void 0})})()});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,ke?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:N,...b?{gridColumn:b}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:q}})}),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:q}})})]})},Z)})}),j&&typeof document<"u"&&(()=>{const oe=(s?document.getElementById(s):null)??document.body;return Mi.createPortal(r.jsx("div",{style:Q,"data-selection":"none",children:r.jsx(Bm,{prefix:d,items:ie,index:z,entry:K,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ce,lightboxEntries:ne,entryIdx:W,layoutId:l,onClose:()=>te(!1),onPrev:()=>be(-1),onNext:()=>be(1)})}),oe)})()]})}const Dm=`import { CommonComponentProps } from '../props';
|
|
6211
|
+
`}const as={url:"",name:"",objectFit:"cover"},gn=500,Oi=650,Zt="cubic-bezier(0.22, 1, 0.36, 1)",Im=72,Rm=50;function Em(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 Il(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=qr(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 Mm(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Il(i,n):null}function Pm(e){return e.reduce((t,n,i)=>{const o=ba(n.gallery),s=wa(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 Bi(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 ss(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Bi(e,i,n)}const km=.03;function Rl(e){return e.width*km}const Ir={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Lo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function ls(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Am(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Kr(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 Fm(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Kr(e,t.width,t.height)}function Wm(e,t){if(Wi(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 _m(e){const t=new Set,n=[];for(const i of e){const o=ba(i.gallery),l=wa(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 Nm({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=>Wi(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 Ti(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=Rl(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 Go(e,t,n){const i=Ti(e,t,n);return{...i,left:2*i.left-e.left}}function Hm(e,t,n){const{left:i,width:o}=n,l=Rl(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 El(e,t,n,i){const o=Ti(e,"left",i),l=Ti(e,"right",i),s=Go(e,"left",i),d=Go(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 Om(e,t,n,i){const{start:o,end:l}=El(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function jm(e,t,n){const i=Ti(e,t,n),o=Go(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ml(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 ba(e){if(!e)return;if(Ml(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??as,i??o??as]}]}function Bm(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function zm(e){const[t]=e.media;return t!=null&&t.url?t:null}function wa(e){if(!Array.isArray(e)||e.length===0)return[];if(Ml(e)){const t=[];for(const n of e){const i=Bm(n);if(!i)continue;const o=zm(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 Wi(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Dm(e){e.pause()}function Vm({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Wi(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 qm({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&&Dm(c),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 Io({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Wi(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 Gm({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:y,sourceRect:w,resolveCloseSourceRect:$,onClose:h,onPrev:v,onNext:S}){const C=a.useRef(null),E=a.useRef(null),M=a.useRef(null),H=a.useRef(new Map),[x,j]=a.useState(0),P=a.useRef(null),T=a.useRef(0),G=a.useRef(0),f=a.useRef("none"),A=a.useRef(!1),_=a.useRef(!1),V=a.useRef(!1),te=a.useRef(null),ne=a.useRef(null),[K,B]=a.useState(null),[F,I]=a.useState(Ir),[R,U]=a.useState(0),[D,ee]=a.useState("opening"),[O,pe]=a.useState(0),[g,ue]=a.useState(0),[me,we]=a.useState(!1),[_e,oe]=a.useState(null),[ye,X]=a.useState(null),[be,ce]=a.useState(null),[ge,se]=a.useState(!1),[Ie,Fe]=a.useState(null),[he,Ce]=a.useState(!1),W=a.useRef(!1),[Q,L]=a.useState(!1),[Y,J]=a.useState(!1),de=a.useRef(n),le=a.useRef(void 0),ie=t[n],Re=ie?Wi(ie):!1,Se=g!==0||me,z=!s&&(!l||!!d),Te=c&&!s,Z=u.length>1,fe=a.useCallback((ae,Pe)=>t.length<=1?null:t[(ae+Pe+t.length)%t.length]??null,[t]),ve=Z?Bi(u,m,-1):fe(n,-1),ke=Z?Bi(u,m,1):fe(n,1),Qe=_e===-1&&Se?Z&&ye!==null?Bi(u,ye,-1):be!==null?fe(be,-1):null:null,Xe=_e===1&&Se?Z&&ye!==null?Bi(u,ye,1):be!==null?fe(be,1):null:null,ht=Qe&&Qe.url!==(ve==null?void 0:ve.url)?Qe:null,xt=Xe&&Xe.url!==(ke==null?void 0:ke.url)?Xe:null,It=ve&&Te?(()=>{const ae=Z?ss(u,m,-1):t.length>2?fe((n-1+t.length)%t.length,-1):null;return ae&&ae.url!==ve.url?ae:null})():null,Et=ke&&Te?(()=>{const ae=Z?ss(u,m,1):t.length>2?fe((n+1)%t.length,1):null;return ae&&ae.url!==ke.url?ae:null})():null,wt=ht??It,Ze=xt??Et,Ne=a.useCallback((ae,Pe,He)=>{if(!ae||!Pe||!He)return;const Ve=H.current,yt=Ve.get(ae);(yt==null?void 0:yt.width)===Pe&&(yt==null?void 0:yt.height)===He||(Ve.set(ae,{width:Pe,height:He}),j(nt=>nt+1))},[]),ot=a.useCallback(ae=>{if(!(ae!=null&&ae.url))return null;const Pe=H.current.get(ae.url);return Fm(E.current,Pe)},[x,R]),dt=a.useCallback(()=>{if(!ie)return;const ae=ot(ie);if(ae){B(ae);return}const Pe=E.current;Pe&&B(ls(Pe))},[ie,ot]),et=a.useCallback(ae=>{if(Z){const Pe=u.length;X((m+ae+Pe)%Pe),ce(null);return}t.length>1&&(ce((n+ae+t.length)%t.length),X(null))},[Z,u.length,m,t.length,n]),mt=a.useCallback(ae=>{V.current=ae,we(ae)},[]),ut=a.useCallback(()=>{te.current!==null&&(window.clearTimeout(te.current),te.current=null)},[]),lt=a.useCallback(()=>{ut(),te.current=window.setTimeout(()=>{ut(),mt(!1)},Oi+32)},[ut,mt]),_t=a.useCallback(()=>{const ae=C.current;if(!ae){I({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ir.width,height:typeof window<"u"?window.innerHeight:Ir.height});return}const Pe=ae.getBoundingClientRect();I({left:Pe.left,top:Pe.top,width:Pe.width,height:Pe.height})},[]),Mt=a.useCallback((ae,Pe)=>{if(Se){if(Q&&!me)return`translate(${g}px, 0px)`;if(me&&_e!==null){const He=ot(ae);if(!He)return;const{x:Ve,y:yt}=Om(He,Pe,_e,F);return`translate(${Ve}px, ${yt}px)`}if(me)return"translate(0px, 0px)"}},[Se,Q,me,g,_e,F,ot]),Be=a.useCallback(()=>{const ae=ne.current;ne.current=null,ut(),mt(!1),oe(null),X(null),ce(null),ue(0),L(!1),A.current=!1,G.current=0,f.current="none",ae===-1?v():ae===1&&S()},[ut,mt,v,S]),ft=a.useCallback(()=>{ut(),te.current=window.setTimeout(()=>{ne.current!==null&&Be()},Oi+32)},[ut,Be]),rt=a.useCallback(ae=>{!Te||!K||V.current||(ut(),et(ae),ne.current=ae,oe(ae),mt(!0),ft())},[Te,K,ut,et,mt,ft]),Ye=a.useCallback(()=>{const ae=E.current;if(!ae)return;const Pe=ie==null?void 0:ie.url,He=Pe?H.current.get(Pe):void 0;if(He!=null&&He.width&&(He!=null&&He.height)){B(Kr(ae,He.width,He.height));return}const Ve=M.current;if(Ve&&Pe&&(Ve.src===Pe||Ve.currentSrc===Pe)){const{width:nt,height:qe}=Am(Ve);if(nt&&qe){Ne(Pe,nt,qe),B(Kr(ae,nt,qe));return}}const yt=ls(ae);!yt.width||!yt.height||B(yt)},[ie==null?void 0:ie.url,Ne]),St=a.useCallback(ae=>{if(M.current=ae,!!ae){if(ae instanceof HTMLVideoElement){ae.readyState>=1&&ae.videoWidth>0&&Ye();return}ae.complete&&ae.naturalWidth>0&&Ye()}},[Ye]),bt=a.useCallback(()=>{_t(),Ye(),U(ae=>ae+1)},[_t,Ye]);a.useEffect(()=>{bt();const ae=E.current,Pe=C.current,He=new ResizeObserver(()=>bt());return ae&&He.observe(ae),Pe&&He.observe(Pe),window.addEventListener("resize",bt),()=>{He.disconnect(),window.removeEventListener("resize",bt)}},[bt,n,y]),a.useLayoutEffect(()=>{if(!ie)return;const ae=M.current;if(ae){if(ae instanceof HTMLImageElement&&ae.complete&&ae.naturalWidth>0){Ye();return}ae instanceof HTMLVideoElement&&ae.readyState>=1&&ae.videoWidth>0&&Ye()}},[ie==null?void 0:ie.url,n,Ye]),a.useEffect(()=>{dt()},[dt,x]),a.useEffect(()=>{const ae=new Set,Pe=[],He=Ve=>{!(Ve!=null&&Ve.url)||ae.has(Ve.url)||(ae.add(Ve.url),Pe.push(Ve))};t.forEach(He),u.forEach(Ve=>Ve.items.forEach(He)),Pe.forEach(Ve=>{H.current.has(Ve.url)||Wm(Ve,Ne)})},[t,u,Ne]),a.useEffect(()=>{if(D!=="opening"||!K)return;if(!w){ee("open");return}se(!1);const ae=requestAnimationFrame(()=>{requestAnimationFrame(()=>{se(!0),ee("open")})});return()=>cancelAnimationFrame(ae)},[D,K,w]),a.useEffect(()=>{if(D!=="closing")return;const ae=setTimeout(()=>h(),gn);return()=>clearTimeout(ae)},[D,h]),a.useEffect(()=>()=>{ut()},[ut]),a.useLayoutEffect(()=>{de.current===n&&le.current===(ie==null?void 0:ie.url)||(ut(),ne.current=null,oe(null),X(null),ce(null),pe(0),ue(0),mt(!1),J(!1),L(!1),T.current=0,G.current=0,f.current="none",A.current=!1,P.current=null,_.current=!1,M.current=null,dt(),de.current=n,le.current=ie==null?void 0:ie.url)},[n,ie==null?void 0:ie.url,mt,ut,dt]),a.useLayoutEffect(()=>{if(D==="opening"){W.current=!1,Ce(!1);return}if(D!=="open"||W.current)return;if(!ve&&!ke){W.current=!0;return}Ce(!1);const ae=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),W.current=!0})});return()=>cancelAnimationFrame(ae)},[D,ve==null?void 0:ve.url,ke==null?void 0:ke.url]),a.useEffect(()=>{if(D!=="open")return;const ae=()=>{const qe=De=>{De.stopPropagation(),De.preventDefault(),document.removeEventListener("click",qe,!0)};document.addEventListener("click",qe,!0)},Pe=qe=>{const De=qe<0?1:-1;ut(),et(De),ne.current=De,oe(De),mt(!0),ft()},He=qe=>{if(Math.abs(qe)>Rm&&Te){Pe(qe);return}ne.current=null,oe(null),X(null),ce(null),mt(!0),ue(0),lt()},Ve=qe=>{if(qe.touches.length!==1||V.current)return;const De=qe.touches[0];_.current=!0,P.current={x:De.clientX,y:De.clientY},f.current="none",G.current=0,A.current=!1},yt=qe=>{if(!P.current||qe.touches.length!==1||V.current)return;const De=qe.touches[0],$t=De.clientX-P.current.x,At=De.clientY-P.current.y;if(f.current==="none"){if(Math.abs($t)<10&&Math.abs(At)<10)return;if(Math.abs($t)>Math.abs(At)){if(!Te)return;f.current="horizontal"}else if(At>0){if(!z)return;f.current="vertical"}else return}if(f.current==="horizontal"){A.current=!0,L(!0),G.current=$t,ue($t),qe.preventDefault();return}f.current==="vertical"&&(A.current=!0,L(!0),T.current=At,pe(At),qe.preventDefault())},nt=()=>{if(!P.current)return;const qe=f.current,De=A.current;if(De&&qe==="horizontal")He(G.current),ae();else if(De&&qe==="vertical"){const $t=T.current;if(z&&$t>Im){const At=window.innerHeight;T.current=At,J(!0),pe(At),ee("closing")}else T.current=0,pe(0);ae()}else qe==="horizontal"&&Math.abs(G.current)>0&&(He(G.current),ae());P.current=null,f.current="none",G.current=0,A.current=!1,L(!1)};return document.addEventListener("touchstart",Ve,{passive:!0}),document.addEventListener("touchmove",yt,{passive:!1}),document.addEventListener("touchend",nt),document.addEventListener("touchcancel",nt),()=>{document.removeEventListener("touchstart",Ve),document.removeEventListener("touchmove",yt),document.removeEventListener("touchend",nt),document.removeEventListener("touchcancel",nt)}},[D,Te,mt,lt,ut,z,ft,et]);const Yt=a.useCallback(()=>{const ae=($==null?void 0:$())??w??null;ae&&K&&(Fe(ae),se(!0)),ee("closing")},[$,w,K]);a.useEffect(()=>{const ae=Pe=>{if(Pe.key==="Escape"){if(l&&d||D==="closing")return;Yt();return}Pe.key!=="ArrowLeft"&&Pe.key!=="ArrowRight"||D==="open"&&Te&&(Pe.preventDefault(),rt(Pe.key==="ArrowLeft"?-1:1))};return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[D,l,d,Yt,Te,rt]);const sn=()=>{D==="closing"||s||Yt()},Pt=D==="open",gt=D==="closing",Jt=O>0?Math.max(0,1-O/500):1,qt=O>0?Math.max(.35,1-O/500):1,Ft=a.useCallback(ae=>{if(!(ae.propertyName!=="transform"||!V.current)){if(ne.current!==null){Be();return}ut(),mt(!1)}},[ut,mt,Be]),Ot=D==="closing"?Ie??w:w,Gt=Ot&&K&&(D==="opening"||gt)?Em(Ot,K):void 0,Le=Se&&ie?Mt(ie,"center"):O>0?`translateY(${O}px)`:Gt,Ae=K?Lo(K,F):null,ze=!!(Ot&&K),Je=ze&&(D==="closing"||D==="open"&&ge),Oe={position:"absolute",top:Ae==null?void 0:Ae.top,left:Ae==null?void 0:Ae.left,width:Ae==null?void 0:Ae.width,height:Ae==null?void 0:Ae.height,objectFit:"contain",transformOrigin:"top left",transform:Le,opacity:O>0?qt:ze?1:D==="opening"||gt?0:1,transition:Q&&!me?"none":me?`transform ${Oi}ms ${Zt}`:Y?`transform ${gn}ms ${Zt}, opacity ${gn}ms ${Zt}`:Je?`transform ${gn}ms ${Zt}`:D==="opening"||gt?`opacity ${gn}ms ${Zt}`:"none",pointerEvents:Re&&Pt&&!Se?"auto":"none",touchAction:Re&&Pt?"none":void 0,zIndex:1,overflow:Re?"hidden":void 0},st={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Pt&&!Se?"auto":"none"},Me=(ae,Pe,He="adjacent")=>{const Ve=ot(ae);if(!Ve)return{display:"none"};const yt=He==="far"?Pe==="left"?"far-left":"far-right":Pe==="left"?"left-adjacent":"right-adjacent",{start:nt}=_e!==null?El(Ve,yt,_e,F):{start:He==="far"?Go(Ve,Pe,F):Ti(Ve,Pe,F)},qe=Lo(nt,F),De=Mt(ae,yt),$t=!Se&&He==="adjacent"&&Pt&&!he?jm(Ve,Pe,F):null,At=He==="far"&&Se&&_e===(Pe==="left"?-1:1),Dt=Q&&!me?!1:me,Vt=He==="adjacent"&&Pt&&he&&!Se;return{position:"absolute",top:qe.top,left:qe.left,width:qe.width,height:qe.height,objectFit:"contain",transform:De??($t?`translate(${$t.x}px, ${$t.y}px)`:void 0),opacity:He==="far"?Pt&&At?1:0:Pt?1:0,transition:Dt?He==="far"?`transform ${Oi}ms ${Zt}`:`transform ${Oi}ms ${Zt}, opacity ${gn}ms ${Zt}`:Vt?`transform ${gn}ms ${Zt}`:D==="opening"||gt?`opacity ${gn}ms ${Zt}`:"none",pointerEvents:"none",zIndex:1}},tt=(ae,Pe)=>{const He=ot(ae);return He?Hm(Ti(He,Pe,F),Pe,F):null},Ke=ae=>Pe=>{if(!s){if(_.current){_.current=!1;return}Pe.stopPropagation(),rt(ae)}},Ct=ve?tt(ve,"left"):null,vt=ke?tt(ke,"right"):null,kt=Ct?Lo(Ct,F):null,Tt=vt?Lo(vt,F):null;return r.jsxs("div",{ref:C,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:D==="open"?"none":void 0},onClick:sn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Pt?Jt:0,transition:Q?"none":`opacity ${gn}ms ${Zt}`,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:E,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Pt?1:0,transition:Q?"none":`opacity ${gn}ms ${Zt}`,pointerEvents:"none"},children:r.jsx(Cm,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:sn})})]}),Pt&&wt&&r.jsx(Io,{media:wt,style:Me(wt,"left","far"),onMeasure:Ne,onTransitionEnd:Ft},`far-prev-${wt.url}`),Pt&&ve&&r.jsxs(r.Fragment,{children:[r.jsx(Io,{media:ve,style:Me(ve,"left"),onMeasure:Ne,onTransitionEnd:Ft},`prev-${ve.url}`),kt&&r.jsx("div",{style:{position:"absolute",top:kt.top,left:kt.left,width:kt.width,height:kt.height,cursor:Se||s?"default":"pointer",pointerEvents:Se||s?"none":"auto",zIndex:3},onClick:Ke(-1)})]}),Pt&&ke&&r.jsxs(r.Fragment,{children:[r.jsx(Io,{media:ke,style:Me(ke,"right"),onMeasure:Ne,onTransitionEnd:Ft},`next-${ke.url}`),Tt&&r.jsx("div",{style:{position:"absolute",top:Tt.top,left:Tt.left,width:Tt.width,height:Tt.height,cursor:Se||s?"default":"pointer",pointerEvents:Se||s?"none":"auto",zIndex:3},onClick:Ke(1)})]}),Pt&&Ze&&r.jsx(Io,{media:Ze,style:Me(Ze,"right","far"),onMeasure:Ne,onTransitionEnd:Ft},`far-next-${Ze.url}`),K&&ie&&(Re?r.jsx(qm,{src:ie.url,phase:D,onMediaElement:St,wrapperStyle:Oe,videoStyle:st,onLoadedMetadata:Ye,onTransitionEnd:Ft},`${n}-${ie.url}`):r.jsx("img",{ref:St,src:ie.url,alt:ie.name,onLoad:Ye,onTransitionEnd:Ft,style:Oe},`${n}-${ie.url}`))]})}function Km({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=N.useScopedStyles(),{gridLayout:c,verticalGap:u,align:m="top",imageDisplay:y}=e,w=(y==null?void 0:y.display)==="cover",$=(y==null?void 0:y.ratioValue)??"1:1",h=(y==null?void 0:y.reversed)??!1,[v,S]=$.split(":").map(Number),M=`${h?S:v} / ${h?v:S}`,H=c.entryWidth??.2,x=c.columnsCount,j=N.scalingValue(H,n),P=N.scalingValue(c.horizontalGap??0,n),T=j,G=j,f={width:T,...w?{aspectRatio:M,height:"auto",overflow:"hidden"}:{height:"auto"}},A=w?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},_=a.useRef(null),[V,te]=a.useState(!1),[ne,K]=a.useState([]),[B,F]=a.useState(0),[I,R]=a.useState(0),[U,D]=a.useState(null),[ee,O]=a.useState({title1:"",title2:"",title3:""}),pe=(()=>{const he={},Ce=_.current?getComputedStyle(_.current).getPropertyValue("--cntrl-article-width").trim():"";return Ce&&(he["--cntrl-article-width"]=Ce),he})(),g=!n||i||o,ue=a.useMemo(()=>Lm(d),[d]),me=t??[],we=me.length%x||x,_e=we<x&&me.length>0,oe=me.length-we,ye=_e?Math.floor((x-we)/2)+1:1,X=a.useMemo(()=>Pm(me),[me]),be=a.useMemo(()=>_m(me),[me]),ce=(he,Ce,W)=>{if(n&&!o&&!i)return;const Q=X.findIndex(Y=>Y.gridIndex===he);if(Q<0)return;const L=X[Q];R(Q),K(L.items),F(Ce),O(L.entry),D(W??null),te(!0)},ge=a.useCallback(()=>{te(!1),D(null)},[]),se=a.useCallback(()=>{const he=X[I];return!he||!_.current?U:Mm(_.current,he.gridIndex,w?"cover":"contain")??U},[X,I,U,w]),Ie=a.useCallback(he=>{if(X.length>1){const Ce=X.length,W=(I+he+Ce)%Ce,Q=X[W],L=Math.min(B,Q.items.length-1);R(W),K(Q.items),F(L),O(Q.entry);return}F(Ce=>(Ce+he+ne.length)%ne.length)},[X,I,B,ne.length]),Fe=X.length>1||ne.length>1;return a.useEffect(()=>{if(!V||typeof document>"u")return;const he=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=he}},[V]),a.useEffect(()=>{!n||o||i||te(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ue}}),r.jsx(Nm,{mediaList:be}),r.jsx("div",{ref:_,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${m}`.trim(),style:{gridTemplateColumns:`repeat(${x}, ${j})`,rowGap:0,columnGap:P,width:N.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:N.scalingValue(u??0,n)},children:me.map((he,Ce)=>{const W=ba(he.gallery),Q=wa(W),L=Q.filter(le=>le.lightboxMedia).map(le=>le.lightboxMedia),Y=Math.floor(Ce/x)===Math.ceil(me.length/x)-1,J=_e&&Ce>=oe?`${ye+(Ce-oe)}`:void 0,de=r.jsx("div",{className:`${d}-item-image-wrapper`,style:f,children:Q.length===0?null:(()=>{const{displayMedia:le,lightboxMedia:ie}=Q[0],Re=ie?L.findIndex(Se=>Se.url===ie.url):-1;return r.jsx(Vm,{media:le,gridIndex:Ce,className:`${d}-item-${Wi(le)?"video":"image"}`.trim(),style:A,onMediaClick:g&&Re>=0?Se=>ce(Ce,Re,Il(Se.currentTarget,w?"cover":"contain")):void 0})})()});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,Y?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:j,...J?{gridColumn:J}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:G}})}),r.jsx("a",{className:`${d}-item-image-link`,children:de}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:G}})})]})},Ce)})}),V&&typeof document<"u"&&(()=>{const he=(s?document.getElementById(s):null)??document.body;return Pi.createPortal(r.jsx("div",{style:pe,"data-selection":"none",children:r.jsx(Gm,{prefix:d,items:ne,index:B,entry:ee,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:Fe,lightboxEntries:X,entryIdx:I,layoutId:l,sourceRect:U,resolveCloseSourceRect:se,onClose:ge,onPrev:()=>Ie(-1),onNext:()=>Ie(1)})}),he)})()]})}const Um=`import { CommonComponentProps } from '../props';
|
|
6212
6212
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
6213
6213
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6214
6214
|
import { createPortal } from 'react-dom';
|
|
@@ -6217,6 +6217,7 @@ import {
|
|
|
6217
6217
|
type HiveLightboxTextEntry,
|
|
6218
6218
|
type HiveLightboxTitleSettings,
|
|
6219
6219
|
} from './HiveLightboxTitles';
|
|
6220
|
+
import { getDisplayedImageRect } from '../utils/getImageRect';
|
|
6220
6221
|
|
|
6221
6222
|
function sv(px: number): string {
|
|
6222
6223
|
return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;
|
|
@@ -6608,6 +6609,7 @@ type HiveProps = {
|
|
|
6608
6609
|
const EMPTY_MEDIA: HiveMedia = { url: '', name: '', objectFit: 'cover' };
|
|
6609
6610
|
|
|
6610
6611
|
const LIGHTBOX_ANIM_MS = 500;
|
|
6612
|
+
const SLIDE_ANIM_MS = 650;
|
|
6611
6613
|
const LIGHTBOX_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';
|
|
6612
6614
|
const SWIPE_CLOSE_THRESHOLD = 72;
|
|
6613
6615
|
const SWIPE_NAV_THRESHOLD = 50;
|
|
@@ -6615,6 +6617,37 @@ const SWIPE_NAV_THRESHOLD = 50;
|
|
|
6615
6617
|
type AnimRect = { top: number; left: number; width: number; height: number };
|
|
6616
6618
|
type SwipeAxis = 'none' | 'horizontal' | 'vertical';
|
|
6617
6619
|
|
|
6620
|
+
function getZoomTransform(from: AnimRect, to: AnimRect): string {
|
|
6621
|
+
const scaleX = from.width / to.width;
|
|
6622
|
+
const scaleY = from.height / to.height;
|
|
6623
|
+
const translateX = from.left - to.left;
|
|
6624
|
+
const translateY = from.top - to.top;
|
|
6625
|
+
return \`translate(\${translateX}px, \${translateY}px) scale(\${scaleX}, \${scaleY})\`;
|
|
6626
|
+
}
|
|
6627
|
+
|
|
6628
|
+
function getMediaClickSourceRect(
|
|
6629
|
+
target: HTMLElement,
|
|
6630
|
+
objectFit: 'cover' | 'contain',
|
|
6631
|
+
): AnimRect {
|
|
6632
|
+
if (objectFit === 'contain' && target instanceof HTMLImageElement) {
|
|
6633
|
+
const rect = getDisplayedImageRect(target);
|
|
6634
|
+
return { left: rect.x, top: rect.y, width: rect.width, height: rect.height };
|
|
6635
|
+
}
|
|
6636
|
+
|
|
6637
|
+
const cb = target.getBoundingClientRect();
|
|
6638
|
+
return { left: cb.left, top: cb.top, width: cb.width, height: cb.height };
|
|
6639
|
+
}
|
|
6640
|
+
|
|
6641
|
+
function getGridItemSourceRect(
|
|
6642
|
+
container: HTMLElement,
|
|
6643
|
+
gridIndex: number,
|
|
6644
|
+
objectFit: 'cover' | 'contain',
|
|
6645
|
+
): AnimRect | null {
|
|
6646
|
+
const mediaEl = container.querySelector(\`[data-hive-grid-index="\${gridIndex}"]\`);
|
|
6647
|
+
if (!(mediaEl instanceof HTMLElement)) return null;
|
|
6648
|
+
return getMediaClickSourceRect(mediaEl, objectFit);
|
|
6649
|
+
}
|
|
6650
|
+
|
|
6618
6651
|
type DisplayItem = {
|
|
6619
6652
|
displayMedia: HiveMedia;
|
|
6620
6653
|
lightboxMedia: HiveMedia | null;
|
|
@@ -6658,7 +6691,17 @@ function getAdjacentEntryMedia(
|
|
|
6658
6691
|
return entries[adjacentIdx]?.items[0] ?? null;
|
|
6659
6692
|
}
|
|
6660
6693
|
|
|
6661
|
-
|
|
6694
|
+
function getFarAdjacentEntryMedia(
|
|
6695
|
+
entries: LightboxEntryData[],
|
|
6696
|
+
entryIdx: number,
|
|
6697
|
+
direction: -1 | 1,
|
|
6698
|
+
): HiveMedia | null {
|
|
6699
|
+
if (entries.length <= 2) return null;
|
|
6700
|
+
const adjacentIdx = (entryIdx + direction + entries.length) % entries.length;
|
|
6701
|
+
return getAdjacentEntryMedia(entries, adjacentIdx, direction);
|
|
6702
|
+
}
|
|
6703
|
+
|
|
6704
|
+
const SIDE_PEEK_WIDTH_RATIO = 0.03;
|
|
6662
6705
|
|
|
6663
6706
|
function getSidePeekWidth(bounds: LightboxBounds): number {
|
|
6664
6707
|
return bounds.width * SIDE_PEEK_WIDTH_RATIO;
|
|
@@ -6919,6 +6962,19 @@ function getSlideTransform(
|
|
|
6919
6962
|
};
|
|
6920
6963
|
}
|
|
6921
6964
|
|
|
6965
|
+
function getSideOpenTransform(
|
|
6966
|
+
fittedRect: AnimRect,
|
|
6967
|
+
side: 'left' | 'right',
|
|
6968
|
+
bounds: LightboxBounds,
|
|
6969
|
+
): { x: number; y: number } {
|
|
6970
|
+
const peekRect = positionPeekRect(fittedRect, side, bounds);
|
|
6971
|
+
const farRect = getFarPeekRect(fittedRect, side, bounds);
|
|
6972
|
+
return {
|
|
6973
|
+
x: farRect.left - peekRect.left,
|
|
6974
|
+
y: farRect.top - peekRect.top,
|
|
6975
|
+
};
|
|
6976
|
+
}
|
|
6977
|
+
|
|
6922
6978
|
function isMediaPairGallery(gallery: unknown): gallery is HiveMediaPair[] {
|
|
6923
6979
|
if (!Array.isArray(gallery) || gallery.length === 0) return false;
|
|
6924
6980
|
const first = gallery[0];
|
|
@@ -6996,11 +7052,13 @@ function MediaItem({
|
|
|
6996
7052
|
media,
|
|
6997
7053
|
className,
|
|
6998
7054
|
style,
|
|
7055
|
+
gridIndex,
|
|
6999
7056
|
onMediaClick,
|
|
7000
7057
|
}: {
|
|
7001
7058
|
media: HiveMedia;
|
|
7002
7059
|
className: string;
|
|
7003
7060
|
style: React.CSSProperties;
|
|
7061
|
+
gridIndex?: number;
|
|
7004
7062
|
onMediaClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
7005
7063
|
}) {
|
|
7006
7064
|
if (isVideoMedia(media)) {
|
|
@@ -7008,6 +7066,7 @@ function MediaItem({
|
|
|
7008
7066
|
<video
|
|
7009
7067
|
src={media.url}
|
|
7010
7068
|
className={className}
|
|
7069
|
+
data-hive-grid-index={gridIndex}
|
|
7011
7070
|
style={{
|
|
7012
7071
|
...style,
|
|
7013
7072
|
cursor: onMediaClick ? 'pointer' : 'default',
|
|
@@ -7027,6 +7086,7 @@ function MediaItem({
|
|
|
7027
7086
|
src={media.url}
|
|
7028
7087
|
alt={media.name}
|
|
7029
7088
|
className={className}
|
|
7089
|
+
data-hive-grid-index={gridIndex}
|
|
7030
7090
|
style={{
|
|
7031
7091
|
...style,
|
|
7032
7092
|
cursor: onMediaClick ? 'pointer' : 'default',
|
|
@@ -7141,6 +7201,8 @@ function Lightbox({
|
|
|
7141
7201
|
lightboxEntries,
|
|
7142
7202
|
entryIdx,
|
|
7143
7203
|
layoutId,
|
|
7204
|
+
sourceRect,
|
|
7205
|
+
resolveCloseSourceRect,
|
|
7144
7206
|
onClose,
|
|
7145
7207
|
onPrev,
|
|
7146
7208
|
onNext,
|
|
@@ -7157,6 +7219,8 @@ function Lightbox({
|
|
|
7157
7219
|
lightboxEntries: LightboxEntryData[];
|
|
7158
7220
|
entryIdx: number;
|
|
7159
7221
|
layoutId?: string;
|
|
7222
|
+
sourceRect?: AnimRect | null;
|
|
7223
|
+
resolveCloseSourceRect?: () => AnimRect | null;
|
|
7160
7224
|
onClose: () => void;
|
|
7161
7225
|
onPrev: () => void;
|
|
7162
7226
|
onNext: () => void;
|
|
@@ -7185,7 +7249,10 @@ function Lightbox({
|
|
|
7185
7249
|
const [slideDirection, setSlideDirection] = useState<-1 | 1 | null>(null);
|
|
7186
7250
|
const [pendingEntryIdx, setPendingEntryIdx] = useState<number | null>(null);
|
|
7187
7251
|
const [pendingImageIdx, setPendingImageIdx] = useState<number | null>(null);
|
|
7188
|
-
const [
|
|
7252
|
+
const [zoomTransitionActive, setZoomTransitionActive] = useState(false);
|
|
7253
|
+
const [closeSourceRect, setCloseSourceRect] = useState<AnimRect | null>(null);
|
|
7254
|
+
const [sidePeekAnimating, setSidePeekAnimating] = useState(false);
|
|
7255
|
+
const sidePeekOpenDoneRef = useRef(false);
|
|
7189
7256
|
const [isSwiping, setIsSwiping] = useState(false);
|
|
7190
7257
|
const [swipeDismiss, setSwipeDismiss] = useState(false);
|
|
7191
7258
|
const prevIndexRef = useRef(index);
|
|
@@ -7230,6 +7297,29 @@ function Lightbox({
|
|
|
7230
7297
|
? farNextCandidate
|
|
7231
7298
|
: null;
|
|
7232
7299
|
|
|
7300
|
+
const idleFarPrevMedia = prevMedia && allowNavigation
|
|
7301
|
+
? (() => {
|
|
7302
|
+
const candidate = isEntryNavigation
|
|
7303
|
+
? getFarAdjacentEntryMedia(lightboxEntries, entryIdx, -1)
|
|
7304
|
+
: items.length > 2
|
|
7305
|
+
? getAdjacentImage((index - 1 + items.length) % items.length, -1)
|
|
7306
|
+
: null;
|
|
7307
|
+
return candidate && candidate.url !== prevMedia.url ? candidate : null;
|
|
7308
|
+
})()
|
|
7309
|
+
: null;
|
|
7310
|
+
const idleFarNextMedia = nextMedia && allowNavigation
|
|
7311
|
+
? (() => {
|
|
7312
|
+
const candidate = isEntryNavigation
|
|
7313
|
+
? getFarAdjacentEntryMedia(lightboxEntries, entryIdx, 1)
|
|
7314
|
+
: items.length > 2
|
|
7315
|
+
? getAdjacentImage((index + 1) % items.length, 1)
|
|
7316
|
+
: null;
|
|
7317
|
+
return candidate && candidate.url !== nextMedia.url ? candidate : null;
|
|
7318
|
+
})()
|
|
7319
|
+
: null;
|
|
7320
|
+
const renderFarPrevMedia = farPrevMedia ?? idleFarPrevMedia;
|
|
7321
|
+
const renderFarNextMedia = farNextMedia ?? idleFarNextMedia;
|
|
7322
|
+
|
|
7233
7323
|
const rememberMediaDimensions = useCallback((url: string, width: number, height: number) => {
|
|
7234
7324
|
if (!url || !width || !height) return;
|
|
7235
7325
|
|
|
@@ -7292,7 +7382,7 @@ function Lightbox({
|
|
|
7292
7382
|
navSwipeCommitTimerRef.current = window.setTimeout(() => {
|
|
7293
7383
|
clearNavSwipeCommitTimer();
|
|
7294
7384
|
setNavSwipeAnimatingState(false);
|
|
7295
|
-
},
|
|
7385
|
+
}, SLIDE_ANIM_MS + 32);
|
|
7296
7386
|
}, [clearNavSwipeCommitTimer, setNavSwipeAnimatingState]);
|
|
7297
7387
|
|
|
7298
7388
|
const updateContainerBounds = useCallback(() => {
|
|
@@ -7319,7 +7409,6 @@ function Lightbox({
|
|
|
7319
7409
|
const getHorizontalNavTransform = useCallback((
|
|
7320
7410
|
media: HiveMedia,
|
|
7321
7411
|
placement: SlidePlacement,
|
|
7322
|
-
options?: { farMediaReady?: boolean },
|
|
7323
7412
|
): string | undefined => {
|
|
7324
7413
|
if (!isHorizontalNavActive) return undefined;
|
|
7325
7414
|
|
|
@@ -7328,12 +7417,6 @@ function Lightbox({
|
|
|
7328
7417
|
}
|
|
7329
7418
|
|
|
7330
7419
|
if (navSwipeAnimating && slideDirection !== null) {
|
|
7331
|
-
if (placement === 'far-left' || placement === 'far-right') {
|
|
7332
|
-
if (!options?.farMediaReady) {
|
|
7333
|
-
return 'translate(0px, 0px)';
|
|
7334
|
-
}
|
|
7335
|
-
}
|
|
7336
|
-
|
|
7337
7420
|
const fittedRect = getFittedRectForMedia(media);
|
|
7338
7421
|
if (!fittedRect) return undefined;
|
|
7339
7422
|
|
|
@@ -7364,7 +7447,6 @@ function Lightbox({
|
|
|
7364
7447
|
setSlideDirection(null);
|
|
7365
7448
|
setPendingEntryIdx(null);
|
|
7366
7449
|
setPendingImageIdx(null);
|
|
7367
|
-
setFarMediaAnimating(false);
|
|
7368
7450
|
setNavSwipeOffset(0);
|
|
7369
7451
|
setIsSwiping(false);
|
|
7370
7452
|
isSwipingRef.current = false;
|
|
@@ -7380,7 +7462,7 @@ function Lightbox({
|
|
|
7380
7462
|
navSwipeCommitTimerRef.current = window.setTimeout(() => {
|
|
7381
7463
|
if (slideCommitDirectionRef.current === null) return;
|
|
7382
7464
|
commitSlideNavigation();
|
|
7383
|
-
},
|
|
7465
|
+
}, SLIDE_ANIM_MS + 32);
|
|
7384
7466
|
}, [clearNavSwipeCommitTimer, commitSlideNavigation]);
|
|
7385
7467
|
|
|
7386
7468
|
const startSlideNavigation = useCallback((direction: -1 | 1) => {
|
|
@@ -7502,8 +7584,23 @@ function Lightbox({
|
|
|
7502
7584
|
}, [items, lightboxEntries, rememberMediaDimensions]);
|
|
7503
7585
|
|
|
7504
7586
|
useEffect(() => {
|
|
7505
|
-
if (phase
|
|
7506
|
-
|
|
7587
|
+
if (phase !== 'opening' || !finalRect) return;
|
|
7588
|
+
|
|
7589
|
+
if (!sourceRect) {
|
|
7590
|
+
setPhase('open');
|
|
7591
|
+
return;
|
|
7592
|
+
}
|
|
7593
|
+
|
|
7594
|
+
setZoomTransitionActive(false);
|
|
7595
|
+
const frame = requestAnimationFrame(() => {
|
|
7596
|
+
requestAnimationFrame(() => {
|
|
7597
|
+
setZoomTransitionActive(true);
|
|
7598
|
+
setPhase('open');
|
|
7599
|
+
});
|
|
7600
|
+
});
|
|
7601
|
+
|
|
7602
|
+
return () => cancelAnimationFrame(frame);
|
|
7603
|
+
}, [phase, finalRect, sourceRect]);
|
|
7507
7604
|
|
|
7508
7605
|
useEffect(() => {
|
|
7509
7606
|
if (phase !== 'closing') return;
|
|
@@ -7525,7 +7622,6 @@ function Lightbox({
|
|
|
7525
7622
|
setSlideDirection(null);
|
|
7526
7623
|
setPendingEntryIdx(null);
|
|
7527
7624
|
setPendingImageIdx(null);
|
|
7528
|
-
setFarMediaAnimating(false);
|
|
7529
7625
|
setSwipeOffset(0);
|
|
7530
7626
|
setNavSwipeOffset(0);
|
|
7531
7627
|
setNavSwipeAnimatingState(false);
|
|
@@ -7546,18 +7642,28 @@ function Lightbox({
|
|
|
7546
7642
|
}, [index, currentItem?.url, setNavSwipeAnimatingState, clearNavSwipeCommitTimer, syncFinalRectForCurrentItem]);
|
|
7547
7643
|
|
|
7548
7644
|
useLayoutEffect(() => {
|
|
7549
|
-
if (
|
|
7550
|
-
|
|
7645
|
+
if (phase === 'opening') {
|
|
7646
|
+
sidePeekOpenDoneRef.current = false;
|
|
7647
|
+
setSidePeekAnimating(false);
|
|
7551
7648
|
return;
|
|
7552
7649
|
}
|
|
7553
7650
|
|
|
7554
|
-
|
|
7651
|
+
if (phase !== 'open' || sidePeekOpenDoneRef.current) return;
|
|
7652
|
+
if (!prevMedia && !nextMedia) {
|
|
7653
|
+
sidePeekOpenDoneRef.current = true;
|
|
7654
|
+
return;
|
|
7655
|
+
}
|
|
7656
|
+
|
|
7657
|
+
setSidePeekAnimating(false);
|
|
7555
7658
|
const frame = requestAnimationFrame(() => {
|
|
7556
|
-
requestAnimationFrame(() =>
|
|
7659
|
+
requestAnimationFrame(() => {
|
|
7660
|
+
setSidePeekAnimating(true);
|
|
7661
|
+
sidePeekOpenDoneRef.current = true;
|
|
7662
|
+
});
|
|
7557
7663
|
});
|
|
7558
7664
|
|
|
7559
7665
|
return () => cancelAnimationFrame(frame);
|
|
7560
|
-
}, [
|
|
7666
|
+
}, [phase, prevMedia?.url, nextMedia?.url]);
|
|
7561
7667
|
|
|
7562
7668
|
useEffect(() => {
|
|
7563
7669
|
if (phase !== 'open') return;
|
|
@@ -7591,7 +7697,6 @@ function Lightbox({
|
|
|
7591
7697
|
setSlideDirection(null);
|
|
7592
7698
|
setPendingEntryIdx(null);
|
|
7593
7699
|
setPendingImageIdx(null);
|
|
7594
|
-
setFarMediaAnimating(false);
|
|
7595
7700
|
setNavSwipeAnimatingState(true);
|
|
7596
7701
|
setNavSwipeOffset(0);
|
|
7597
7702
|
scheduleNavSwipeSnapBackEnd();
|
|
@@ -7694,20 +7799,38 @@ function Lightbox({
|
|
|
7694
7799
|
};
|
|
7695
7800
|
}, [phase, allowNavigation, setNavSwipeAnimatingState, scheduleNavSwipeSnapBackEnd, clearNavSwipeCommitTimer, allowSwipeDismiss, scheduleSlideCommit, beginSlideTo]);
|
|
7696
7801
|
|
|
7802
|
+
const startClosing = useCallback(() => {
|
|
7803
|
+
const rect = resolveCloseSourceRect?.() ?? sourceRect ?? null;
|
|
7804
|
+
if (rect && finalRect) {
|
|
7805
|
+
setCloseSourceRect(rect);
|
|
7806
|
+
setZoomTransitionActive(true);
|
|
7807
|
+
}
|
|
7808
|
+
setPhase('closing');
|
|
7809
|
+
}, [resolveCloseSourceRect, sourceRect, finalRect]);
|
|
7810
|
+
|
|
7697
7811
|
useEffect(() => {
|
|
7698
7812
|
const onKeyDown = (e: KeyboardEvent) => {
|
|
7699
|
-
if (e.key
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7813
|
+
if (e.key === 'Escape') {
|
|
7814
|
+
if (isEditor && isPreviewMode) return;
|
|
7815
|
+
if (phase === 'closing') return;
|
|
7816
|
+
startClosing();
|
|
7817
|
+
return;
|
|
7818
|
+
}
|
|
7819
|
+
|
|
7820
|
+
if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') return;
|
|
7821
|
+
if (phase !== 'open') return;
|
|
7822
|
+
if (!allowNavigation) return;
|
|
7823
|
+
|
|
7824
|
+
e.preventDefault();
|
|
7825
|
+
startSlideNavigation(e.key === 'ArrowLeft' ? -1 : 1);
|
|
7703
7826
|
};
|
|
7704
7827
|
window.addEventListener('keydown', onKeyDown);
|
|
7705
7828
|
return () => window.removeEventListener('keydown', onKeyDown);
|
|
7706
|
-
}, [phase, isEditor, isPreviewMode]);
|
|
7829
|
+
}, [phase, isEditor, isPreviewMode, startClosing, allowNavigation, startSlideNavigation]);
|
|
7707
7830
|
|
|
7708
7831
|
const handleClose = () => {
|
|
7709
7832
|
if (phase === 'closing' || isEditMode) return;
|
|
7710
|
-
|
|
7833
|
+
startClosing();
|
|
7711
7834
|
};
|
|
7712
7835
|
|
|
7713
7836
|
const isOpen = phase === 'open';
|
|
@@ -7727,13 +7850,25 @@ function Lightbox({
|
|
|
7727
7850
|
setNavSwipeAnimatingState(false);
|
|
7728
7851
|
}, [clearNavSwipeCommitTimer, setNavSwipeAnimatingState, commitSlideNavigation]);
|
|
7729
7852
|
|
|
7853
|
+
const zoomSourceRect = phase === 'closing'
|
|
7854
|
+
? (closeSourceRect ?? sourceRect)
|
|
7855
|
+
: sourceRect;
|
|
7856
|
+
|
|
7857
|
+
const zoomTransform = zoomSourceRect && finalRect && (phase === 'opening' || isClosing)
|
|
7858
|
+
? getZoomTransform(zoomSourceRect, finalRect)
|
|
7859
|
+
: undefined;
|
|
7860
|
+
|
|
7730
7861
|
const mediaTransform = isHorizontalNavActive && currentItem
|
|
7731
7862
|
? getHorizontalNavTransform(currentItem, 'center')
|
|
7732
7863
|
: swipeOffset > 0
|
|
7733
7864
|
? \`translateY(\${swipeOffset}px)\`
|
|
7734
|
-
:
|
|
7865
|
+
: zoomTransform;
|
|
7735
7866
|
|
|
7736
7867
|
const containerMediaRect = finalRect ? toContainerRect(finalRect, containerBounds) : null;
|
|
7868
|
+
const useZoomAnimation = Boolean(zoomSourceRect && finalRect);
|
|
7869
|
+
const shouldAnimateZoom = useZoomAnimation && (
|
|
7870
|
+
phase === 'closing' || (phase === 'open' && zoomTransitionActive)
|
|
7871
|
+
);
|
|
7737
7872
|
|
|
7738
7873
|
const mediaStyle: React.CSSProperties = {
|
|
7739
7874
|
position: 'absolute',
|
|
@@ -7742,21 +7877,26 @@ function Lightbox({
|
|
|
7742
7877
|
width: containerMediaRect?.width,
|
|
7743
7878
|
height: containerMediaRect?.height,
|
|
7744
7879
|
objectFit: 'contain',
|
|
7880
|
+
transformOrigin: 'top left',
|
|
7745
7881
|
transform: mediaTransform,
|
|
7746
7882
|
opacity: swipeOffset > 0
|
|
7747
7883
|
? swipeMediaOpacity
|
|
7748
|
-
:
|
|
7749
|
-
?
|
|
7750
|
-
:
|
|
7884
|
+
: useZoomAnimation
|
|
7885
|
+
? 1
|
|
7886
|
+
: phase === 'opening' || isClosing
|
|
7887
|
+
? 0
|
|
7888
|
+
: 1,
|
|
7751
7889
|
transition: (isSwiping && !navSwipeAnimating)
|
|
7752
7890
|
? 'none'
|
|
7753
7891
|
: navSwipeAnimating
|
|
7754
|
-
? \`transform \${
|
|
7892
|
+
? \`transform \${SLIDE_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
7755
7893
|
: swipeDismiss
|
|
7756
7894
|
? \`transform \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}, opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
7757
|
-
:
|
|
7758
|
-
? \`
|
|
7759
|
-
: '
|
|
7895
|
+
: shouldAnimateZoom
|
|
7896
|
+
? \`transform \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
7897
|
+
: phase === 'opening' || isClosing
|
|
7898
|
+
? \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
7899
|
+
: 'none',
|
|
7760
7900
|
pointerEvents: isCurrentVideo && isOpen && !isHorizontalNavActive ? 'auto' : 'none',
|
|
7761
7901
|
touchAction: isCurrentVideo && isOpen ? 'none' : undefined,
|
|
7762
7902
|
zIndex: 1,
|
|
@@ -7790,12 +7930,17 @@ function Lightbox({
|
|
|
7790
7930
|
: positionPeekRect(fittedRect, side, containerBounds),
|
|
7791
7931
|
};
|
|
7792
7932
|
const containerSideRect = toContainerRect(sideRect, containerBounds);
|
|
7793
|
-
const swipeTransform = getHorizontalNavTransform(media, slidePlacement
|
|
7794
|
-
|
|
7795
|
-
|
|
7933
|
+
const swipeTransform = getHorizontalNavTransform(media, slidePlacement);
|
|
7934
|
+
const openSlideOffset = !isHorizontalNavActive && placement === 'adjacent' && isOpen && !sidePeekAnimating
|
|
7935
|
+
? getSideOpenTransform(fittedRect, side, containerBounds)
|
|
7936
|
+
: null;
|
|
7937
|
+
const isFarSlideActive = placement === 'far'
|
|
7938
|
+
&& isHorizontalNavActive
|
|
7939
|
+
&& slideDirection === (side === 'left' ? -1 : 1);
|
|
7796
7940
|
const useSlideTransition = (isSwiping && !navSwipeAnimating)
|
|
7797
7941
|
? false
|
|
7798
|
-
: navSwipeAnimating
|
|
7942
|
+
: navSwipeAnimating;
|
|
7943
|
+
const useSideOpenTransition = placement === 'adjacent' && isOpen && sidePeekAnimating && !isHorizontalNavActive;
|
|
7799
7944
|
|
|
7800
7945
|
return {
|
|
7801
7946
|
position: 'absolute',
|
|
@@ -7804,15 +7949,23 @@ function Lightbox({
|
|
|
7804
7949
|
width: containerSideRect.width,
|
|
7805
7950
|
height: containerSideRect.height,
|
|
7806
7951
|
objectFit: 'contain',
|
|
7807
|
-
transform: swipeTransform
|
|
7952
|
+
transform: swipeTransform ?? (
|
|
7953
|
+
openSlideOffset
|
|
7954
|
+
? \`translate(\${openSlideOffset.x}px, \${openSlideOffset.y}px)\`
|
|
7955
|
+
: undefined
|
|
7956
|
+
),
|
|
7808
7957
|
opacity: placement === 'far'
|
|
7809
|
-
? (
|
|
7958
|
+
? (isOpen && isFarSlideActive ? 1 : 0)
|
|
7810
7959
|
: (isOpen ? 1 : 0),
|
|
7811
7960
|
transition: useSlideTransition
|
|
7812
|
-
?
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7961
|
+
? placement === 'far'
|
|
7962
|
+
? \`transform \${SLIDE_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
7963
|
+
: \`transform \${SLIDE_ANIM_MS}ms \${LIGHTBOX_EASING}, opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
7964
|
+
: useSideOpenTransition
|
|
7965
|
+
? \`transform \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
7966
|
+
: phase === 'opening' || isClosing
|
|
7967
|
+
? \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
7968
|
+
: 'none',
|
|
7816
7969
|
pointerEvents: 'none',
|
|
7817
7970
|
zIndex: 1,
|
|
7818
7971
|
};
|
|
@@ -7864,7 +8017,7 @@ function Lightbox({
|
|
|
7864
8017
|
style={{
|
|
7865
8018
|
position: 'absolute',
|
|
7866
8019
|
inset: 0,
|
|
7867
|
-
background: '#
|
|
8020
|
+
background: settings.backgroundColor ?? '#FFFFFF',
|
|
7868
8021
|
opacity: isOpen ? swipeBackdropOpacity : 0,
|
|
7869
8022
|
transition: isSwiping ? 'none' : \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`,
|
|
7870
8023
|
pointerEvents: 'none',
|
|
@@ -7918,11 +8071,11 @@ function Lightbox({
|
|
|
7918
8071
|
</div>
|
|
7919
8072
|
</div>
|
|
7920
8073
|
|
|
7921
|
-
{isOpen &&
|
|
8074
|
+
{isOpen && renderFarPrevMedia && (
|
|
7922
8075
|
<LightboxSideMedia
|
|
7923
|
-
key={\`far-prev-\${
|
|
7924
|
-
media={
|
|
7925
|
-
style={getSideMediaStyle(
|
|
8076
|
+
key={\`far-prev-\${renderFarPrevMedia.url}\`}
|
|
8077
|
+
media={renderFarPrevMedia}
|
|
8078
|
+
style={getSideMediaStyle(renderFarPrevMedia, 'left', 'far')}
|
|
7926
8079
|
onMeasure={rememberMediaDimensions}
|
|
7927
8080
|
onTransitionEnd={handleNavSwipeTransitionEnd}
|
|
7928
8081
|
/>
|
|
@@ -7982,11 +8135,11 @@ function Lightbox({
|
|
|
7982
8135
|
</>
|
|
7983
8136
|
)}
|
|
7984
8137
|
|
|
7985
|
-
{isOpen &&
|
|
8138
|
+
{isOpen && renderFarNextMedia && (
|
|
7986
8139
|
<LightboxSideMedia
|
|
7987
|
-
key={\`far-next-\${
|
|
7988
|
-
media={
|
|
7989
|
-
style={getSideMediaStyle(
|
|
8140
|
+
key={\`far-next-\${renderFarNextMedia.url}\`}
|
|
8141
|
+
media={renderFarNextMedia}
|
|
8142
|
+
style={getSideMediaStyle(renderFarNextMedia, 'right', 'far')}
|
|
7990
8143
|
onMeasure={rememberMediaDimensions}
|
|
7991
8144
|
onTransitionEnd={handleNavSwipeTransitionEnd}
|
|
7992
8145
|
/>
|
|
@@ -8076,6 +8229,7 @@ export function Hive({
|
|
|
8076
8229
|
const [lightboxItems, setLightboxItems] = useState<HiveMedia[]>([]);
|
|
8077
8230
|
const [lightboxIndex, setLightboxIndex] = useState(0);
|
|
8078
8231
|
const [lightboxEntryIdx, setLightboxEntryIdx] = useState(0);
|
|
8232
|
+
const [lightboxSourceRect, setLightboxSourceRect] = useState<AnimRect | null>(null);
|
|
8079
8233
|
const [lightboxEntry, setLightboxEntry] = useState<HiveLightboxTextEntry>({
|
|
8080
8234
|
title1: '',
|
|
8081
8235
|
title2: '',
|
|
@@ -8105,7 +8259,7 @@ export function Hive({
|
|
|
8105
8259
|
const allLightboxEntries = useMemo(() => buildLightboxEntries(items), [items]);
|
|
8106
8260
|
const allMedia = useMemo(() => collectAllHiveMedia(items), [items]);
|
|
8107
8261
|
|
|
8108
|
-
const openLightbox = (gridIndex: number, imageIdx: number) => {
|
|
8262
|
+
const openLightbox = (gridIndex: number, imageIdx: number, sourceRect?: AnimRect) => {
|
|
8109
8263
|
if (isEditor && !isEditMode && !isPreviewMode) return;
|
|
8110
8264
|
const entryIdx = allLightboxEntries.findIndex(entry => entry.gridIndex === gridIndex);
|
|
8111
8265
|
if (entryIdx < 0) return;
|
|
@@ -8115,9 +8269,26 @@ export function Hive({
|
|
|
8115
8269
|
setLightboxItems(data.items);
|
|
8116
8270
|
setLightboxIndex(imageIdx);
|
|
8117
8271
|
setLightboxEntry(data.entry);
|
|
8272
|
+
setLightboxSourceRect(sourceRect ?? null);
|
|
8118
8273
|
setLightboxOpen(true);
|
|
8119
8274
|
};
|
|
8120
8275
|
|
|
8276
|
+
const closeLightbox = useCallback(() => {
|
|
8277
|
+
setLightboxOpen(false);
|
|
8278
|
+
setLightboxSourceRect(null);
|
|
8279
|
+
}, []);
|
|
8280
|
+
|
|
8281
|
+
const resolveCloseSourceRect = useCallback((): AnimRect | null => {
|
|
8282
|
+
const entry = allLightboxEntries[lightboxEntryIdx];
|
|
8283
|
+
if (!entry || !containerRef.current) return lightboxSourceRect;
|
|
8284
|
+
|
|
8285
|
+
return getGridItemSourceRect(
|
|
8286
|
+
containerRef.current,
|
|
8287
|
+
entry.gridIndex,
|
|
8288
|
+
isCover ? 'cover' : 'contain',
|
|
8289
|
+
) ?? lightboxSourceRect;
|
|
8290
|
+
}, [allLightboxEntries, lightboxEntryIdx, lightboxSourceRect, isCover]);
|
|
8291
|
+
|
|
8121
8292
|
const navigateLightbox = useCallback((direction: -1 | 1) => {
|
|
8122
8293
|
if (allLightboxEntries.length > 1) {
|
|
8123
8294
|
const len = allLightboxEntries.length;
|
|
@@ -8191,10 +8362,15 @@ export function Hive({
|
|
|
8191
8362
|
return (
|
|
8192
8363
|
<MediaItem
|
|
8193
8364
|
media={displayMedia}
|
|
8365
|
+
gridIndex={index}
|
|
8194
8366
|
className={\`\${P}-item-\${isVideoMedia(displayMedia) ? 'video' : 'image'}\`.trim()}
|
|
8195
8367
|
style={imageStyle}
|
|
8196
8368
|
onMediaClick={canOpenLightbox && entryLightboxIndex >= 0
|
|
8197
|
-
? () => openLightbox(
|
|
8369
|
+
? (e) => openLightbox(
|
|
8370
|
+
index,
|
|
8371
|
+
entryLightboxIndex,
|
|
8372
|
+
getMediaClickSourceRect(e.currentTarget, isCover ? 'cover' : 'contain'),
|
|
8373
|
+
)
|
|
8198
8374
|
: undefined}
|
|
8199
8375
|
/>
|
|
8200
8376
|
);
|
|
@@ -8245,7 +8421,9 @@ export function Hive({
|
|
|
8245
8421
|
lightboxEntries={allLightboxEntries}
|
|
8246
8422
|
entryIdx={lightboxEntryIdx}
|
|
8247
8423
|
layoutId={layoutId}
|
|
8248
|
-
|
|
8424
|
+
sourceRect={lightboxSourceRect}
|
|
8425
|
+
resolveCloseSourceRect={resolveCloseSourceRect}
|
|
8426
|
+
onClose={closeLightbox}
|
|
8249
8427
|
onPrev={() => navigateLightbox(-1)}
|
|
8250
8428
|
onNext={() => navigateLightbox(1)}
|
|
8251
8429
|
/>
|
|
@@ -8256,11 +8434,11 @@ export function Hive({
|
|
|
8256
8434
|
</>
|
|
8257
8435
|
);
|
|
8258
8436
|
}
|
|
8259
|
-
`,Vm="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>'),Yn={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 qm(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")]={...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...Yn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...Yn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...Yn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...Yn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...Yn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...Yn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ti=ai.filter(e=>e!=="count"),Gm=Ti.reduce((e,t)=>({...e,...qm(t)}),{}),Km=Ti.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 os(e){return Ti.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 Um={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ti.map(e=>[$l[e],Cl(e)]))},Xm={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!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:[{title1:"Dorothy Manners & Julanne Johnston",title2:"by Evans Studio",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"Inez Nadeau",title2:"Melbourne Spurr",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"Colleen Moore",title2:"Clarence S. Bull",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"Gloria Swanson",title2:"Donald Biddle Keyes",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"",title2:"",title3:"",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"",title2:"",title3:"",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},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"}},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"}},...Gm},defaults:{imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",closeIcon:Vm,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Km},layoutDefaults:{m:{gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},verticalGap:.266,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.04,closeIconMaxWidth:.05,iconMarginRight:.01,...os({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{gridLayout:{entryWidth:.0833,horizontalGap:0,wrapperWidth:1,columnsCount:3,lockedParam:null},verticalGap:.09722,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...os({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:[Um]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Ym={element:zm,id:"hive",name:"Hive",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:[...Ti.map(e=>({path:`${Ye(e,"fontFamily")}`}))]},fontRelations:{...Ti.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ye(t,"fontFamily")}`}),{})},schema:Xm,sourceCode:Dm},rs=12;function Jm(e,t="50%"){const n={position:"absolute",width:rs,height:rs,pointerEvents:"none"};return e==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:e==="center-x"?{...n,left:"50%",top:t,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function zt({className:e,areaStyle:t,hitPlacement:n,centerXHitTop:i,...o}){return r.jsx("div",{className:e,style:{...t,pointerEvents:"none"},"data-controls-center-only-drag":"",...o,children:r.jsx("div",{style:Jm(n,i)})})}function Zm(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 Qm({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 No(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function eg(e){return String(e??"").trim().length>0}function as(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 ss(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 ls(e,t,n,i,o,l,s){const d=F.scalingValue(l,s),c=F.scalingValue(0,s),u=e===0,m=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!m||i?d:c}}function tg(e,t,n){const i=F.scalingValue(t,n),o=F.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const cs=10;function ng(e){return`
|
|
8437
|
+
`,Xm="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>'),Un={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 Ym(e){const t={};return t[Ue(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ue(e,"fontSettings")]={...Un.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ue(e,"fontSize")]={...Un.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ue(e,"lineHeight")]={...Un.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ue(e,"letterSpacing")]={...Un.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ue(e,"wordSpacing")]={...Un.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ue(e,"textAlign")]={...Un.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ue(e,"textAppearance")]={...Un.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Li=oi.filter(e=>e!=="count"),Jm=Li.reduce((e,t)=>({...e,...Ym(t)}),{}),Zm=Li.reduce((e,t)=>({...e,[Ue(t,"fontFamily")]:"Goudy Bookletter 1911",[Ue(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ue(t,"letterSpacing")]:0,[Ue(t,"wordSpacing")]:0,[Ue(t,"textAlign")]:"left",[Ue(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Rr(e){return Li.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ue(n,"fontSize")]=i),o!==void 0&&(t[Ue(n,"lineHeight")]=o),t},{})}const Qm={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Li.map(e=>[Tl[e],Ll(e)]))},eg={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!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:[{title1:"Dorothy Manners & Julanne Johnston",title2:"by Evans Studio",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"Inez Nadeau",title2:"Melbourne Spurr",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"Colleen Moore",title2:"Clarence S. Bull",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"Gloria Swanson",title2:"Donald Biddle Keyes",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"",title2:"",title3:"",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"",title2:"",title3:"",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},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"}},...Jm},defaults:{imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Xm,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Zm},layoutDefaults:{m:{gridLayout:{entryWidth:.2666,horizontalGap:.02666,wrapperWidth:1,columnsCount:3,lockedParam:null},verticalGap:.02666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.04,closeIconMaxWidth:.05,iconMarginRight:.01,...Rr({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},t:{gridLayout:{entryWidth:.0833,horizontalGap:.0125,wrapperWidth:1,columnsCount:3,lockedParam:null},verticalGap:.0125,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...Rr({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},d:{gridLayout:{entryWidth:.0833,horizontalGap:.00694,wrapperWidth:1,columnsCount:3,lockedParam:null},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...Rr({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:[Qm]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},tg={element:Km,id:"hive",name:"Hive",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:[...Li.map(e=>({path:`${Ue(e,"fontFamily")}`}))]},fontRelations:{...Li.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ue(t,"fontFamily")}`}),{})},schema:eg,sourceCode:Um},cs=12;function ng(e,t="50%"){const n={position:"absolute",width:cs,height:cs,pointerEvents:"none"};return e==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:e==="center-x"?{...n,left:"50%",top:t,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function zt({className:e,areaStyle:t,hitPlacement:n,centerXHitTop:i,...o}){return r.jsx("div",{className:e,style:{...t,pointerEvents:"none"},"data-controls-center-only-drag":"",...o,children:r.jsx("div",{style:ng(n,i)})})}function ig(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 og({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 Ho(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function rg(e){return String(e??"").trim().length>0}function ds(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 us(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 ps(e,t,n,i,o,l,s){const d=N.scalingValue(l,s),c=N.scalingValue(0,s),u=e===0,m=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!m||i?d:c}}function ag(e,t,n){const i=N.scalingValue(t,n),o=N.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const ms=10;function sg(e){return`
|
|
8260
8438
|
.${e}-wrapper {
|
|
8261
8439
|
display: grid;
|
|
8262
8440
|
align-items: start;
|
|
8263
|
-
min-height: ${
|
|
8441
|
+
min-height: ${Ho(48)};
|
|
8264
8442
|
position: relative;
|
|
8265
8443
|
overflow: visible;
|
|
8266
8444
|
box-sizing: border-box;
|
|
@@ -8382,7 +8560,7 @@ a.${e}-list-item {
|
|
|
8382
8560
|
flex-shrink: 0;
|
|
8383
8561
|
overflow: visible;
|
|
8384
8562
|
box-sizing: border-box;
|
|
8385
|
-
min-width: ${
|
|
8563
|
+
min-width: ${Ho(50)};
|
|
8386
8564
|
position: relative;
|
|
8387
8565
|
display: flex;
|
|
8388
8566
|
align-items: flex-start;
|
|
@@ -8390,7 +8568,7 @@ a.${e}-list-item {
|
|
|
8390
8568
|
|
|
8391
8569
|
.${e}-list-col-last {
|
|
8392
8570
|
flex: 1 1 auto;
|
|
8393
|
-
min-width: ${
|
|
8571
|
+
min-width: ${Ho(50)};
|
|
8394
8572
|
}
|
|
8395
8573
|
|
|
8396
8574
|
.${e}-list-col-title {
|
|
@@ -8687,7 +8865,7 @@ a.${e}-list-item {
|
|
|
8687
8865
|
overflow-wrap: anywhere;
|
|
8688
8866
|
word-break: break-word;
|
|
8689
8867
|
}
|
|
8690
|
-
`}const Bn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ya=["AColumn","BColumn","CColumn","DColumn","EColumn"],Ln="cutLabel",Qi=[...ya,Ln],sr=["A","B","C","D","E"];function El(e){return`${e}ColumnVerticalAlign`}const Dr=["Top","Center","Bottom"];function va(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return sr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function ig(e){const t=va(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function og(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return sr.includes(n)?n:null}function Rl(e,t,n){const i=og(e);return i?i===t?!1:ig(n[El(i)]):!0}function eo(e){const t=va(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return sr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function rg(e,t,n){if(Ml(e,t,n))return eo(e);const i=eo(e);return i.kind==="baseline"?{kind:"top"}:i}function ag(e){const t=eo(e);return t.kind==="baseline"?{kind:"top"}:t}function Ml(e,t,n){return Rl(e,n,t)?eo(e).kind==="baseline":!1}function sg(e){const t={};let n=!1;for(const i of sr){const o=El(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}Rl(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function lg(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function cg(e){const t=eo(e).kind;return t==="baseline"?"center":t}function dg(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function ds(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function ug(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 Lr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=ug(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 pg(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 mg(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const gg={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function lt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const hg={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function fg(e){return[lt(e,"textFontFamily"),lt(e,"textFontSettings"),{type:"row",items:[lt(e,"textFontSize"),lt(e,"textLineHeight"),lt(e,"textLetterSpacing"),lt(e,"textWordSpacing")]},lt(e,"textTextAlign"),lt(e,"textTextAppearance"),`${e}VerticalAlign`]}function yg(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Qi.map(e=>[hg[e],fg(e)]))}}function qo(e,t){const n=i=>{const o=lt(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===Ln?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function us(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 en(Ot(n,t))}function ps(e,t,n,i){const o=qo(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function ms(e,t,n,i){const o=qo(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:F.scalingValue((l-s)/2,i)}}const nn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Li=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ii=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ei=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],vg={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},xg=["hover","focus","filled","success","error"],gs=.004,gi=.004,Ir=gi,xa=50,to=1440,no=xa/to;function Pl(e){const t=typeof e=="number"&&e>0?e:to;return xa/t}function bg(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 to}const kl={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function zi(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function wg(e,t=1){const n=t/e;return Object.fromEntries(nn.map(i=>[i,n]))}function Sg(){return Object.fromEntries([...Li.map(e=>[e,0]),...Ii.map(e=>[e,0])])}function $g(){return Object.fromEntries(Ei.map(e=>[e,0]))}function Io(e){return Object.fromEntries(nn.map(t=>[t,typeof e[t]=="number"?e[t]:kl[t]]))}function Al(e,t,n){const i=e-no,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 Ho(e,t,n){const i=ba(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 Cg(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=Li[o],s=Ii[o],d=typeof n[l]=="number"?n[l]:0,c=typeof n[s]=="number"?n[s]:0,u=Al(t[o]??0,d,c);u.paddingLeft!==d&&(i[l]=u.paddingLeft),u.paddingRight!==c&&(i[s]=u.paddingRight)}return i}function ba(e,t,n){if(e<=0)return[];const i=nn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((u,m)=>u+m,0)+no;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 m=d[u]-no;if(m<=0)continue;const y=Math.min(c,m);d[u]-=y,c-=y}return[...d,i[e-1]]}function Tg(e,t,n){if(e<=1)return{};const i=ba(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=nn[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function hs(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Bn]}function Lg(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Ig(e,t,n,i){const o=Math.min(i,e.length,nn.length),l={};for(let s=0;s<o;s+=1){const d=e[s],c=t.indexOf(d);if(c===-1)continue;const u=nn[c],m=Li[c],y=Ii[c],E=Ei[c],T=nn[s],h=Li[s],v=Ii[s],I=Ei[s],L=n[u],R=n[m],P=n[y],O=n[E];typeof L=="number"&&(l[T]=L),typeof R=="number"&&(l[h]=R),typeof P=="number"&&(l[v]=P),typeof O=="number"&&(l[I]=O)}return l}function Wl(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 Eg(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=zi(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...wg(n,o),...Sg()};if(l)for(const d of Ei)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,$g());return Wl(e,s)?s:e}function Rg(e,t,n){const i=sg(e);i&&(e={...e,...i});const o=Pl(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=zi(e),c=zi(t),u=e.type==="b"||e.type===void 0&&t.type==="b",m=typeof l=="number"?l:typeof s=="number"?s:Bn.length,y=P=>{if(u)return P;const O=Io({...t,...P}),x=zi(P),N=Ho(m,x,O),k=Cg(m,N,{...t,...P});return Object.keys(k).length===0?P:{...P,...k}};if(typeof l=="number"&&l!==s)return e;const E=hs(e),T=hs(t);if(!Lg(E,T))return y({...e,...Ig(E,T,t,m)});if(d<c&&typeof m=="number"&&!u){const P=Io({...t,...e});return y({...e,...Tg(m,d,P)})}if(u){const P=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,O=Math.max(0,(d-o)/2);return P>O?{...e,textPaddingLR:O}:e}const h=Io({...t,...e}),v=Ho(m,c,Io(t)),L=Ho(m,d,h).some((P,O)=>P<(v[O]??P)),R=nn.some(P=>{const O=e[P],x=t[P];return typeof O=="number"&&typeof x=="number"&&O!==x});return L||R?y(e):e}function Mg(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(no,i-o-l-no)}function Pg(e,t){return Math.random()*(t-e)+e}function kg(e){return Object.fromEntries(nn.map(t=>[t,typeof e[t]=="number"?e[t]:kl[t]]))}function Er(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Ag(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const c=Li[d],u=Ii[d],m=Ei[d];return{key:s,textPrefix:gg[s],widthKey:nn[d],width:n[nn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:m,paddingLeft:i[c],paddingRight:o[u],paddingBottom:l[m]}})}function Wg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:c}=F.useScopedStyles(),u=!!o,{columns:m,type:y,wrapperWidth:E,entriesCount:T,cellMinHeight:h,dividerWidth:v,showVisibility:I,cut:L,showCut:R,cutCellMinHeight:P,cutLabel:O,imageSize:x,imageOnHover:N,entryHoverEffect:k,entryHoverShowOption:$,rowPaddingTop:q,rowPaddingBottom:f,rowPaddingTopB:M,columnsOrder:_,textPaddingLR:j,textColor:te,backgroundColor:ie,dividerColor:G,textHoverColor:z,backgroundHoverColor:H,dividerHoverColor:W}=e,[S,K]=a.useState(void 0),[J,Q]=a.useState(null),D=N==="on"&&(!n||i),ue=(L??0)>0,g=y==="b",pe=a.useRef(null),fe=a.useRef(null),[ve,Ne]=a.useState(null),[ne,ge]=a.useState(to),ee=Pl(ne),be=Math.max(0,((E??0)-ee)/2),ce=Math.min(j??0,be),oe=Math.max(ce,gi),Z=((E??0)+ee)/2;a.useLayoutEffect(()=>{if(!n){ge(to);return}const de=()=>{ge(bg(pe.current))};de();const Ie=pe.current;if(!Ie)return;const _e=new ResizeObserver(de);_e.observe(Ie);let Re=Ie;for(;Re&&!Re.style.getPropertyValue("--cntrl-article-width");)Re=Re.parentElement;return Re&&_e.observe(Re),()=>_e.disconnect()},[n,s]),a.useEffect(()=>{K(void 0)},[L,R,t,T]),a.useEffect(()=>{n&&!i&&K(void 0)},[n,i]);const Ce=F.buildColorVars(c,{textColor:te,backgroundColor:ie,dividerColor:G,textHoverColor:z,backgroundHoverColor:H,dividerHoverColor:W},vg,xg),Le=l&&l!=="default"?`${c}-state-${l}`:"",ke=`${!n||i?k==="default"?`${c}-entry-hover-default`:k==="blinds"?`${c}-entry-hover-blinds`:k==="reveal"?`${c}-entry-hover-reveal`:"":""} ${Le}`.trim(),b=k==="reveal"&&(!n||i),re=(I==null?void 0:I[0])??!1,C=(I==null?void 0:I[1])??!1,U=a.useRef(e),X=a.useRef(s);a.useEffect(()=>{if(!d||!n){U.current=e,X.current=s;return}if(X.current!==s){U.current=e,X.current=s;return}const de=U.current;if(!(de!==e))return;if(typeof de.columns=="number"&&typeof e.columns=="number"&&de.columns!==e.columns){U.current=e;return}const _e=Rg(e,de,{designWidth:ne});U.current=e,Wl(e,_e)&&d(_e)},[e,d,n,s,ne]);const se=a.useMemo(()=>kg(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),le=a.useMemo(()=>Er(e,Li),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),ye=a.useMemo(()=>Er(e,Ii),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),We=a.useMemo(()=>Er(e,Ei),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Me=a.useMemo(()=>Array.isArray(_)&&_.length>0?_:[...Bn],[_]),B=a.useMemo(()=>Ag(Me,m,se,le,ye,We),[Me,m,se,le,ye,We]),we=zi(e),Y=a.useMemo(()=>nn.slice(0,m).map(de=>se[de]),[m,se]),me=a.useMemo(()=>ba(m,we,se),[m,we,se]),Te=a.useMemo(()=>Ho(m,we,se),[m,we,se]),He=a.useMemo(()=>B.map((de,Ie)=>Al(Te[Ie]??0,de.paddingLeft,de.paddingRight)),[B,Te]),Ze=a.useMemo(()=>{const de=T===0?1/0:T;return(t??[]).slice(0,de).map((_e,Re)=>({id:Re,cells:Object.fromEntries(Bn.map(qe=>[qe,_e[qe]??""])),image:_e.image,link:_e.link}))},[t,T]),je=ue?S??L:Ze.length,Ke=a.useMemo(()=>ue?Ze.slice(0,je):Ze,[Ze,ue,je]),ct=ue&&je<Ze.length,ft=Ke.length>1||ct,bt=[re?`${c}-divider-top`:"",C||ft?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Ct=!n||i,Qe=()=>{if(!Ct)return;const de=S??L;if(!R){K(Ze.length);return}K(Math.min(de+R,Ze.length))},Be=de=>F.scalingValue(de,n??!1),Je=g?M??0:q??0,ut=f??0,et=h??0,It=Je+et/2,yt=Math.max(ut,Ir),ot=ls(0,Ke.length,re,C,ct,v??0,n??!1).borderTopWidth,Wt=ve!=null?`${ve}px`:`calc(${ot} + ${Be(It)})`,jt=g?"rowPaddingTopB":"rowPaddingTop",Ue=B[0],$t=B[B.length-1],Ge=He[0],tt=He[He.length-1],pt=Ue&&Ge?Math.max(Ge.paddingLeft,gi):0,rt=$t&&tt?Math.max(tt.paddingRight,gi):0,Kt=we,rn=de=>{const Ie=pe.current;if(!Ie)return{x:0,y:0};const _e=Ie.getBoundingClientRect();return{x:de.clientX-_e.left+cs,y:de.clientY-_e.top+cs}},gn=(de,Ie)=>{if(!D)return;const _e=de.image;if(!(_e!=null&&_e.url)){Q(null);return}const{x:Re,y:qe}=rn(Ie),gt=(x==null?void 0:x.min)??80,Fe=(x==null?void 0:x.max)??320,De=(J==null?void 0:J.rowId)===de.id?J.widthPx:Pg(gt,Fe);Q({rowId:de.id,url:_e.url,objectFit:"contain",isVideo:Zm(_e),widthPx:De,x:Re,y:qe})},mt=de=>{if(!D||!J)return;const{x:Ie,y:_e}=rn(de);Q(Re=>!Re||Re.x===Ie&&Re.y===_e?Re:{...Re,x:Ie,y:_e})},Dt=()=>{Q(null)},Rt=de=>{b&&as(de,c),D&&Q(null)},he=de=>{b&&ss(de,c)};a.useLayoutEffect(()=>{if(!u||g){Ne(null);return}const de=fe.current,Ie=de==null?void 0:de.parentElement;if(!de||!Ie){Ne(null);return}const _e=()=>{const qe=de.querySelector("[data-list-row]");if(!qe){Ne(null);return}const gt=Ie.getBoundingClientRect(),Fe=qe.getBoundingClientRect();Ne(Fe.top-gt.top+Fe.height/2)};_e();const Re=new ResizeObserver(_e);return Re.observe(de),Re.observe(Ie),()=>Re.disconnect()},[u,g,Ke,Je,ut,et,t,e,B,Te,ne,v,re,C,ct]);const Ae=a.useMemo(()=>!g&&ya.some(de=>{const Ie=de.charAt(0),_e=e[`${de}VerticalAlign`];return Ml(_e,e,Ie)}),[g,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var De;const de=pe.current;if(!de)return;const Ie=()=>{de.querySelectorAll("[data-list-col]").forEach(Ve=>{Ve.style.transform="";const st=Ve.querySelector(`.${c}-list-col`);st&&(st.style.minHeight="",st.style.height="");const dt=Ve.querySelector(`.${c}-list-col-title`);dt&&(dt.style.transform="")})};if(g||!Ae){Ie();return}const _e=()=>{const Ve=Array.from(de.querySelectorAll("[data-list-row]")),st=`${c}-list-col`,dt=`${c}-baseline-probe`;Ve.forEach(Tt=>{Tt.querySelectorAll("[data-list-col]").forEach(Mt=>{Mt.style.transform="";const St=Mt.querySelector(`.${st}`);St&&(St.style.minHeight="",St.style.height="");const Bt=Mt.querySelector(`.${c}-list-col-title`);Bt&&(Bt.style.transform="")})}),Ve.forEach(Tt=>{const Mt=Array.from(Tt.querySelectorAll("[data-list-col]"));pg(Tt,Mt,st)}),de.offsetHeight,Ve.forEach(Tt=>{const Mt=Array.from(Tt.querySelectorAll("[data-list-col]")),St=Tt.getBoundingClientRect().top,Bt=new Map,_t=Mt.map(ht=>{const Ft=ht.querySelector(`.${c}-list-col-title`),Et={el:ht,titleEl:Ft,letter:ht.getAttribute("data-col-letter")??"",kind:ht.getAttribute("data-valign")??"top",anchor:ht.getAttribute("data-valign-anchor")};return Bt.set(Et.letter,Et),Et}),Nt=new Map,an=(ht,Ft)=>{const Et=Nt.get(ht.letter);if(Et!==void 0)return Et;const Xt=ht.anchor?Bt.get(ht.anchor):void 0;if(ht.kind!=="baseline"||!Xt||Ft.has(ht.letter)){const ln=Lr(ht,St,st,dt);return Nt.set(ht.letter,ln),ln}Ft.add(ht.letter);const sn=an(Xt,Ft);Ft.delete(ht.letter);const vt=Lr(ht,St,st,dt),Pt=sn-vt;mg(ht.titleEl,Pt);const Ut=Lr(ht,St,st,dt);return Nt.set(ht.letter,Ut),Ut};_t.forEach(ht=>an(ht,new Set))})};let Re=null;const qe=()=>{Re===null&&(Re=requestAnimationFrame(()=>{Re=null,_e()}))};_e();const gt=new ResizeObserver(()=>qe());gt.observe(de);let Fe=!1;return typeof document<"u"&&((De=document.fonts)!=null&&De.ready)&&document.fonts.ready.then(()=>{Fe||qe()}),()=>{Fe=!0,Re!==null&&(cancelAnimationFrame(Re),Re=null),gt.disconnect(),Ie()}},[Ae,g,e,t,ne,Ke,Te]);const ze=a.useMemo(()=>ng(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ze}}),r.jsx("div",{style:Ce,children:r.jsxs("div",{ref:pe,className:`${c}-wrapper ${ke}${bt?` ${bt}`:""}${g?` ${c}-type-b`:""}`.trim(),style:{width:F.scalingValue(E??0,n),...!g&&u?{[`--${c}-first-entry-handle-top`]:Wt}:{}},onMouseMove:D?mt:void 0,onMouseLeave:D?Dt:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ke.map((de,Ie)=>{var gt;const _e=(((gt=de.link)==null?void 0:gt.length)??0)>0,Re=_e&&(!n||i)?"a":"div",qe=ls(Ie,Ke.length,re,C,ct,v??0,n??!1);return r.jsxs(Re,{ref:Ie===0?Fe=>{fe.current=Fe}:void 0,className:`${c}-list-item${_e||$==="always"?` ${c}-list-item-has-link`:""}`,..._e?{href:de.link,target:"_blank"}:{},style:qe,onMouseEnter:Fe=>{b&&(_e||$==="always")&&as(Fe,c),D&&gn(de,Fe)},onMouseLeave:Fe=>{b&&(_e||$==="always")&&ss(Fe,c)},children:[Je>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Be(Je)}}),r.jsxs("div",{className:`${c}-list-cols-row${g?"":` ${c}-list-cols-row-h`}${u&&Ie===0&&g?` ${c}-list-cols-row-controls`:""}`,...g?{}:{"data-list-row":""},style:g?void 0:{minHeight:Be(et)},children:[B.map((Fe,De)=>{const Ve=De===B.length-1,st=He[De],dt=Fe.paddingBottom,Tt=eg(de.cells[Fe.key]),Mt=g&&Tt&&dt>0,St=g?{minHeight:Be(et)}:{width:Be(Te[De])},Bt=g?{paddingLeft:Be(ce),paddingRight:Be(ce)}:{paddingLeft:Be(st.paddingLeft),paddingRight:Be(st.paddingRight)},_t=Fe.textPrefix.charAt(0),Nt=g?ag(e[`${Fe.textPrefix}VerticalAlign`]):rg(e[`${Fe.textPrefix}VerticalAlign`],e,_t),an=g&&Tt&&u&&Ie===0;return r.jsxs("div",{className:g?`${c}-list-col-wrap`:void 0,...g?{}:{"data-list-col":"","data-col-letter":_t,"data-valign":Nt.kind,...Nt.kind==="baseline"?{"data-valign-anchor":Nt.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${Ve?` ${c}-list-col-last`:""}`,style:{...Bt,...St,...g?{justifyContent:ds(Nt.kind)}:{}},"data-test":Fe.width,children:r.jsx("span",{className:ps(e,Fe.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...us(qo(e,Fe.textPrefix),n),...ms(e,Fe.textPrefix,c,n),...g?{}:lg(Nt.kind)},children:de.cells[Fe.key]??null})}),Mt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Be(dt)}}),an&&r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Fe.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Be(Math.max(dt,Ir))}})]},Fe.key)}),u&&Ie===0&&g&&r.jsxs(r.Fragment,{children:[r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Z),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Be(oe),height:"100%"}}),r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Z),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Be(Math.max(oe,we-oe)),width:Be(oe),height:"100%"}})]})]}),!g&&ut>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Be(ut)}}),u&&Ie===0&&!g&&r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Be(yt)}})]},de.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":jt,"data-controls-static-handle":"",...g?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:g?"center":"left-y",areaStyle:{position:"absolute",top:ot,left:0,width:"100%",height:Be(Math.max(Je,Ir))}})},"row-padding-handles"),u&&!g&&Ue&&$t&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ue.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Te[0]-((Ge==null?void 0:Ge.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Be(pt),height:"100%"}}),r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":$t.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Te[B.length-1]-((tt==null?void 0:tt.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Be(Kt-rt),width:Be(rt),height:"100%"}})]},"column-edge-padding-handles"),u&&!g&&B.slice(0,-1).map((de,Ie)=>{const _e=B[Ie+1],Re=me.slice(0,Ie+1).reduce((Ve,st)=>Ve+st,0),qe=He[Ie],gt=He[Ie+1],Fe=Math.max(qe.paddingRight,gi),De=Math.max(gt.paddingLeft,gi);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":de.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Te[Ie]-qe.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Be(Re-Fe),width:Be(Fe),height:"100%"}}),r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":_e.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Te[Ie+1]-gt.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Be(Re),width:Be(De),height:"100%"}})]},`${de.paddingRightKey}-padding`)}),u&&!g&&B.slice(0,-1).map((de,Ie)=>{const _e=Mg(Ie,me,Y,we),qe=me.slice(0,Ie+1).reduce((gt,Fe)=>gt+Fe,0)-gs/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":de.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(xa),"data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Be(qe),width:Be(gs),height:"calc(100%)",pointerEvents:"auto"}})},`${de.widthKey}-junction`)})]}),ct&&(()=>{const de=qo(e,Ln),Ie=cg(e.cutLabelVerticalAlign),_e=de.textTextAlign==="justify"||g;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Be(P??0),cursor:Ct?"pointer":"default",...tg(C,v??0,n??!1)},onClick:Ct?Qe:void 0,onMouseEnter:b||D?Rt:void 0,onMouseLeave:b?he:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...g?{paddingLeft:Be(ce),paddingRight:Be(ce)}:{},justifyContent:dg(de.textTextAlign),alignItems:ds(Ie)},children:r.jsx("span",{className:ps(e,Ln,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...us(de,n),...ms(e,Ln,c,n),..._e?{width:"100%"}:{}},children:O})})})})(),D&&J&&(()=>{const de=No(J.widthPx),Ie={width:de,height:"auto",maxHeight:de,objectFit:"contain",left:J.x,top:J.y,position:"absolute"};return r.jsx(Qm,{media:J,className:J.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Ie},`${J.rowId}-${J.url}`)})()]})})]})}const Fg=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
8868
|
+
`}const On=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Sa=["AColumn","BColumn","CColumn","DColumn","EColumn"],Cn="cutLabel",to=[...Sa,Cn],cr=["A","B","C","D","E"];function Pl(e){return`${e}ColumnVerticalAlign`}const Ur=["Top","Center","Bottom"];function $a(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return cr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function lg(e){const t=$a(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function cg(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return cr.includes(n)?n:null}function kl(e,t,n){const i=cg(e);return i?i===t?!1:lg(n[Pl(i)]):!0}function no(e){const t=$a(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return cr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function dg(e,t,n){if(Al(e,t,n))return no(e);const i=no(e);return i.kind==="baseline"?{kind:"top"}:i}function ug(e){const t=no(e);return t.kind==="baseline"?{kind:"top"}:t}function Al(e,t,n){return kl(e,n,t)?no(e).kind==="baseline":!1}function pg(e){const t={};let n=!1;for(const i of cr){const o=Pl(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}kl(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function mg(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function gg(e){const t=no(e).kind;return t==="baseline"?"center":t}function hg(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 fg(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 Er(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=fg(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 yg(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 vg(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const xg={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const bg={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function wg(e){return[pt(e,"textFontFamily"),pt(e,"textFontSettings"),{type:"row",items:[pt(e,"textFontSize"),pt(e,"textLineHeight"),pt(e,"textLetterSpacing"),pt(e,"textWordSpacing")]},pt(e,"textTextAlign"),pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Sg(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(to.map(e=>[bg[e],wg(e)]))}}function Ko(e,t){const n=i=>{const o=pt(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===Cn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function hs(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(Bt(n,t))}function fs(e,t,n,i){const o=Ko(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function ys(e,t,n,i){const o=Ko(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:N.scalingValue((l-s)/2,i)}}const rn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ii=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ri=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ei=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],$g={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Cg=["hover","focus","filled","success","error"],vs=.004,gi=.004,Mr=gi,Ca=50,io=1440,oo=Ca/io;function Fl(e){const t=typeof e=="number"&&e>0?e:io;return Ca/t}function Tg(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 io}const Wl={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function qi(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Lg(e,t=1){const n=t/e;return Object.fromEntries(rn.map(i=>[i,n]))}function Ig(){return Object.fromEntries([...Ii.map(e=>[e,0]),...Ri.map(e=>[e,0])])}function Rg(){return Object.fromEntries(Ei.map(e=>[e,0]))}function Ro(e){return Object.fromEntries(rn.map(t=>[t,typeof e[t]=="number"?e[t]:Wl[t]]))}function _l(e,t,n){const i=e-oo,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const l=i/o;return{paddingLeft:t*l,paddingRight:n*l}}function Oo(e,t,n){const i=Ta(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 Eg(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=Ii[o],s=Ri[o],d=typeof n[l]=="number"?n[l]:0,c=typeof n[s]=="number"?n[s]:0,u=_l(t[o]??0,d,c);u.paddingLeft!==d&&(i[l]=u.paddingLeft),u.paddingRight!==c&&(i[s]=u.paddingRight)}return i}function Ta(e,t,n){if(e<=0)return[];const i=rn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((u,m)=>u+m,0)+oo;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 m=d[u]-oo;if(m<=0)continue;const y=Math.min(c,m);d[u]-=y,c-=y}return[...d,i[e-1]]}function Mg(e,t,n){if(e<=1)return{};const i=Ta(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=rn[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function xs(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...On]}function Pg(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function kg(e,t,n,i){const o=Math.min(i,e.length,rn.length),l={};for(let s=0;s<o;s+=1){const d=e[s],c=t.indexOf(d);if(c===-1)continue;const u=rn[c],m=Ii[c],y=Ri[c],w=Ei[c],$=rn[s],h=Ii[s],v=Ri[s],S=Ei[s],C=n[u],E=n[m],M=n[y],H=n[w];typeof C=="number"&&(l[$]=C),typeof E=="number"&&(l[h]=E),typeof M=="number"&&(l[v]=M),typeof H=="number"&&(l[S]=H)}return l}function Nl(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 Ag(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=qi(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...Lg(n,o),...Ig()};if(l)for(const d of Ei)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,Rg());return Nl(e,s)?s:e}function Fg(e,t,n){const i=pg(e);i&&(e={...e,...i});const o=Fl(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=qi(e),c=qi(t),u=e.type==="b"||e.type===void 0&&t.type==="b",m=typeof l=="number"?l:typeof s=="number"?s:On.length,y=M=>{if(u)return M;const H=Ro({...t,...M}),x=qi(M),j=Oo(m,x,H),P=Eg(m,j,{...t,...M});return Object.keys(P).length===0?M:{...M,...P}};if(typeof l=="number"&&l!==s)return e;const w=xs(e),$=xs(t);if(!Pg(w,$))return y({...e,...kg(w,$,t,m)});if(d<c&&typeof m=="number"&&!u){const M=Ro({...t,...e});return y({...e,...Mg(m,d,M)})}if(u){const M=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return M>H?{...e,textPaddingLR:H}:e}const h=Ro({...t,...e}),v=Oo(m,c,Ro(t)),C=Oo(m,d,h).some((M,H)=>M<(v[H]??M)),E=rn.some(M=>{const H=e[M],x=t[M];return typeof H=="number"&&typeof x=="number"&&H!==x});return C||E?y(e):e}function Wg(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(oo,i-o-l-oo)}function _g(e,t){return Math.random()*(t-e)+e}function Ng(e){return Object.fromEntries(rn.map(t=>[t,typeof e[t]=="number"?e[t]:Wl[t]]))}function Pr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Hg(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const c=Ii[d],u=Ri[d],m=Ei[d];return{key:s,textPrefix:xg[s],widthKey:rn[d],width:n[rn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:m,paddingLeft:i[c],paddingRight:o[u],paddingBottom:l[m]}})}function Og({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:c}=N.useScopedStyles(),u=!!o,{columns:m,type:y,wrapperWidth:w,entriesCount:$,cellMinHeight:h,dividerWidth:v,showVisibility:S,cut:C,showCut:E,cutCellMinHeight:M,cutLabel:H,imageSize:x,imageOnHover:j,entryHoverEffect:P,entryHoverShowOption:T,rowPaddingTop:G,rowPaddingBottom:f,rowPaddingTopB:A,columnsOrder:_,textPaddingLR:V,textColor:te,backgroundColor:ne,dividerColor:K,textHoverColor:B,backgroundHoverColor:F,dividerHoverColor:I}=e,[R,U]=a.useState(void 0),[D,ee]=a.useState(null),O=j==="on"&&(!n||i),pe=(C??0)>0,g=y==="b",ue=a.useRef(null),me=a.useRef(null),[we,_e]=a.useState(null),[oe,ye]=a.useState(io),X=Fl(oe),be=Math.max(0,((w??0)-X)/2),ce=Math.min(V??0,be),ge=Math.max(ce,gi),se=((w??0)+X)/2;a.useLayoutEffect(()=>{if(!n){ye(io);return}const Le=()=>{ye(Tg(ue.current))};Le();const Ae=ue.current;if(!Ae)return;const ze=new ResizeObserver(Le);ze.observe(Ae);let Je=Ae;for(;Je&&!Je.style.getPropertyValue("--cntrl-article-width");)Je=Je.parentElement;return Je&&ze.observe(Je),()=>ze.disconnect()},[n,s]),a.useEffect(()=>{U(void 0)},[C,E,t,$]),a.useEffect(()=>{n&&!i&&U(void 0)},[n,i]);const Ie=N.buildColorVars(c,{textColor:te,backgroundColor:ne,dividerColor:K,textHoverColor:B,backgroundHoverColor:F,dividerHoverColor:I},$g,Cg),Fe=l&&l!=="default"?`${c}-state-${l}`:"",Ce=`${!n||i?P==="default"?`${c}-entry-hover-default`:P==="blinds"?`${c}-entry-hover-blinds`:P==="reveal"?`${c}-entry-hover-reveal`:"":""} ${Fe}`.trim(),W=P==="reveal"&&(!n||i),Q=(S==null?void 0:S[0])??!1,L=(S==null?void 0:S[1])??!1,Y=a.useRef(e),J=a.useRef(s);a.useEffect(()=>{if(!d||!n){Y.current=e,J.current=s;return}if(J.current!==s){Y.current=e,J.current=s;return}const Le=Y.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){Y.current=e;return}const ze=Fg(e,Le,{designWidth:oe});Y.current=e,Nl(e,ze)&&d(ze)},[e,d,n,s,oe]);const de=a.useMemo(()=>Ng(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),le=a.useMemo(()=>Pr(e,Ii),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),ie=a.useMemo(()=>Pr(e,Ri),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Re=a.useMemo(()=>Pr(e,Ei),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Se=a.useMemo(()=>Array.isArray(_)&&_.length>0?_:[...On],[_]),z=a.useMemo(()=>Hg(Se,m,de,le,ie,Re),[Se,m,de,le,ie,Re]),Te=qi(e),Z=a.useMemo(()=>rn.slice(0,m).map(Le=>de[Le]),[m,de]),fe=a.useMemo(()=>Ta(m,Te,de),[m,Te,de]),ve=a.useMemo(()=>Oo(m,Te,de),[m,Te,de]),ke=a.useMemo(()=>z.map((Le,Ae)=>_l(ve[Ae]??0,Le.paddingLeft,Le.paddingRight)),[z,ve]),Qe=a.useMemo(()=>{const Le=$===0?1/0:$;return(t??[]).slice(0,Le).map((ze,Je)=>({id:Je,cells:Object.fromEntries(On.map(Oe=>[Oe,ze[Oe]??""])),image:ze.image,link:ze.link}))},[t,$]),Xe=pe?R??C:Qe.length,ht=a.useMemo(()=>pe?Qe.slice(0,Xe):Qe,[Qe,pe,Xe]),xt=pe&&Xe<Qe.length,It=ht.length>1||xt,Et=[Q?`${c}-divider-top`:"",L||It?`${c}-divider-bottom`:""].filter(Boolean).join(" "),wt=!n||i,Ze=()=>{if(!wt)return;const Le=R??C;if(!E){U(Qe.length);return}U(Math.min(Le+E,Qe.length))},Ne=Le=>N.scalingValue(Le,n??!1),ot=g?A??0:G??0,dt=f??0,et=h??0,mt=ot+et/2,ut=Math.max(dt,Mr),lt=ps(0,ht.length,Q,L,xt,v??0,n??!1).borderTopWidth,_t=we!=null?`${we}px`:`calc(${lt} + ${Ne(mt)})`,Mt=g?"rowPaddingTopB":"rowPaddingTop",Be=z[0],ft=z[z.length-1],rt=ke[0],Ye=ke[ke.length-1],St=Be&&rt?Math.max(rt.paddingLeft,gi):0,bt=ft&&Ye?Math.max(Ye.paddingRight,gi):0,Yt=Te,sn=Le=>{const Ae=ue.current;if(!Ae)return{x:0,y:0};const ze=Ae.getBoundingClientRect();return{x:Le.clientX-ze.left+ms,y:Le.clientY-ze.top+ms}},Pt=(Le,Ae)=>{if(!O)return;const ze=Le.image;if(!(ze!=null&&ze.url)){ee(null);return}const{x:Je,y:Oe}=sn(Ae),st=(x==null?void 0:x.min)??80,Me=(x==null?void 0:x.max)??320,tt=(D==null?void 0:D.rowId)===Le.id?D.widthPx:_g(st,Me);ee({rowId:Le.id,url:ze.url,objectFit:"contain",isVideo:ig(ze),widthPx:tt,x:Je,y:Oe})},gt=Le=>{if(!O||!D)return;const{x:Ae,y:ze}=sn(Le);ee(Je=>!Je||Je.x===Ae&&Je.y===ze?Je:{...Je,x:Ae,y:ze})},Jt=()=>{ee(null)},qt=Le=>{W&&ds(Le,c),O&&ee(null)},Ft=Le=>{W&&us(Le,c)};a.useLayoutEffect(()=>{if(!u||g){_e(null);return}const Le=me.current,Ae=Le==null?void 0:Le.parentElement;if(!Le||!Ae){_e(null);return}const ze=()=>{const Oe=Le.querySelector("[data-list-row]");if(!Oe){_e(null);return}const st=Ae.getBoundingClientRect(),Me=Oe.getBoundingClientRect();_e(Me.top-st.top+Me.height/2)};ze();const Je=new ResizeObserver(ze);return Je.observe(Le),Je.observe(Ae),()=>Je.disconnect()},[u,g,ht,ot,dt,et,t,e,z,ve,oe,v,Q,L,xt]);const Ot=a.useMemo(()=>!g&&Sa.some(Le=>{const Ae=Le.charAt(0),ze=e[`${Le}VerticalAlign`];return Al(ze,e,Ae)}),[g,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var tt;const Le=ue.current;if(!Le)return;const Ae=()=>{Le.querySelectorAll("[data-list-col]").forEach(Ke=>{Ke.style.transform="";const Ct=Ke.querySelector(`.${c}-list-col`);Ct&&(Ct.style.minHeight="",Ct.style.height="");const vt=Ke.querySelector(`.${c}-list-col-title`);vt&&(vt.style.transform="")})};if(g||!Ot){Ae();return}const ze=()=>{const Ke=Array.from(Le.querySelectorAll("[data-list-row]")),Ct=`${c}-list-col`,vt=`${c}-baseline-probe`;Ke.forEach(kt=>{kt.querySelectorAll("[data-list-col]").forEach(Tt=>{Tt.style.transform="";const ae=Tt.querySelector(`.${Ct}`);ae&&(ae.style.minHeight="",ae.style.height="");const Pe=Tt.querySelector(`.${c}-list-col-title`);Pe&&(Pe.style.transform="")})}),Ke.forEach(kt=>{const Tt=Array.from(kt.querySelectorAll("[data-list-col]"));yg(kt,Tt,Ct)}),Le.offsetHeight,Ke.forEach(kt=>{const Tt=Array.from(kt.querySelectorAll("[data-list-col]")),ae=kt.getBoundingClientRect().top,Pe=new Map,He=Tt.map(nt=>{const qe=nt.querySelector(`.${c}-list-col-title`),De={el:nt,titleEl:qe,letter:nt.getAttribute("data-col-letter")??"",kind:nt.getAttribute("data-valign")??"top",anchor:nt.getAttribute("data-valign-anchor")};return Pe.set(De.letter,De),De}),Ve=new Map,yt=(nt,qe)=>{const De=Ve.get(nt.letter);if(De!==void 0)return De;const $t=nt.anchor?Pe.get(nt.anchor):void 0;if(nt.kind!=="baseline"||!$t||qe.has(nt.letter)){const ai=Er(nt,ae,Ct,vt);return Ve.set(nt.letter,ai),ai}qe.add(nt.letter);const At=yt($t,qe);qe.delete(nt.letter);const Dt=Er(nt,ae,Ct,vt),Vt=At-Dt;vg(nt.titleEl,Vt);const Rn=Er(nt,ae,Ct,vt);return Ve.set(nt.letter,Rn),Rn};He.forEach(nt=>yt(nt,new Set))})};let Je=null;const Oe=()=>{Je===null&&(Je=requestAnimationFrame(()=>{Je=null,ze()}))};ze();const st=new ResizeObserver(()=>Oe());st.observe(Le);let Me=!1;return typeof document<"u"&&((tt=document.fonts)!=null&&tt.ready)&&document.fonts.ready.then(()=>{Me||Oe()}),()=>{Me=!0,Je!==null&&(cancelAnimationFrame(Je),Je=null),st.disconnect(),Ae()}},[Ot,g,e,t,oe,ht,ve]);const Gt=a.useMemo(()=>sg(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Gt}}),r.jsx("div",{style:Ie,children:r.jsxs("div",{ref:ue,className:`${c}-wrapper ${Ce}${Et?` ${Et}`:""}${g?` ${c}-type-b`:""}`.trim(),style:{width:N.scalingValue(w??0,n),...!g&&u?{[`--${c}-first-entry-handle-top`]:_t}:{}},onMouseMove:O?gt:void 0,onMouseLeave:O?Jt:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[ht.map((Le,Ae)=>{var st;const ze=(((st=Le.link)==null?void 0:st.length)??0)>0,Je=ze&&(!n||i)?"a":"div",Oe=ps(Ae,ht.length,Q,L,xt,v??0,n??!1);return r.jsxs(Je,{ref:Ae===0?Me=>{me.current=Me}:void 0,className:`${c}-list-item${ze||T==="always"?` ${c}-list-item-has-link`:""}`,...ze?{href:Le.link,target:"_blank"}:{},style:Oe,onMouseEnter:Me=>{W&&(ze||T==="always")&&ds(Me,c),O&&Pt(Le,Me)},onMouseLeave:Me=>{W&&(ze||T==="always")&&us(Me,c)},children:[ot>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ne(ot)}}),r.jsxs("div",{className:`${c}-list-cols-row${g?"":` ${c}-list-cols-row-h`}${u&&Ae===0&&g?` ${c}-list-cols-row-controls`:""}`,...g?{}:{"data-list-row":""},style:g?void 0:{minHeight:Ne(et)},children:[z.map((Me,tt)=>{const Ke=tt===z.length-1,Ct=ke[tt],vt=Me.paddingBottom,kt=rg(Le.cells[Me.key]),Tt=g&&kt&&vt>0,ae=g?{minHeight:Ne(et)}:{width:Ne(ve[tt])},Pe=g?{paddingLeft:Ne(ce),paddingRight:Ne(ce)}:{paddingLeft:Ne(Ct.paddingLeft),paddingRight:Ne(Ct.paddingRight)},He=Me.textPrefix.charAt(0),Ve=g?ug(e[`${Me.textPrefix}VerticalAlign`]):dg(e[`${Me.textPrefix}VerticalAlign`],e,He),yt=g&&kt&&u&&Ae===0;return r.jsxs("div",{className:g?`${c}-list-col-wrap`:void 0,...g?{}:{"data-list-col":"","data-col-letter":He,"data-valign":Ve.kind,...Ve.kind==="baseline"?{"data-valign-anchor":Ve.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${Ke?` ${c}-list-col-last`:""}`,style:{...Pe,...ae,...g?{justifyContent:gs(Ve.kind)}:{}},"data-test":Me.width,children:r.jsx("span",{className:fs(e,Me.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...hs(Ko(e,Me.textPrefix),n),...ys(e,Me.textPrefix,c,n),...g?{}:mg(Ve.kind)},children:Le.cells[Me.key]??null})}),Tt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ne(vt)}}),yt&&r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Me.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ne(Math.max(vt,Mr))}})]},Me.key)}),u&&Ae===0&&g&&r.jsxs(r.Fragment,{children:[r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(se),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Ne(ge),height:"100%"}}),r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(se),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Ne(Math.max(ge,Te-ge)),width:Ne(ge),height:"100%"}})]})]}),!g&&dt>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ne(dt)}}),u&&Ae===0&&!g&&r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ne(ut)}})]},Le.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Mt,"data-controls-static-handle":"",...g?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:g?"center":"left-y",areaStyle:{position:"absolute",top:lt,left:0,width:"100%",height:Ne(Math.max(ot,Mr))}})},"row-padding-handles"),u&&!g&&Be&&ft&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Be.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ve[0]-((rt==null?void 0:rt.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Ne(St),height:"100%"}}),r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":ft.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ve[z.length-1]-((Ye==null?void 0:Ye.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ne(Yt-bt),width:Ne(bt),height:"100%"}})]},"column-edge-padding-handles"),u&&!g&&z.slice(0,-1).map((Le,Ae)=>{const ze=z[Ae+1],Je=fe.slice(0,Ae+1).reduce((Ke,Ct)=>Ke+Ct,0),Oe=ke[Ae],st=ke[Ae+1],Me=Math.max(Oe.paddingRight,gi),tt=Math.max(st.paddingLeft,gi);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Le.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ve[Ae]-Oe.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ne(Je-Me),width:Ne(Me),height:"100%"}}),r.jsx(zt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":ze.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ve[Ae+1]-st.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ne(Je),width:Ne(tt),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!g&&z.slice(0,-1).map((Le,Ae)=>{const ze=Wg(Ae,fe,Z,Te),Oe=fe.slice(0,Ae+1).reduce((st,Me)=>st+Me,0)-vs/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Le.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(Ca),"data-controls-max-fraction":String(ze),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ne(Oe),width:Ne(vs),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),xt&&(()=>{const Le=Ko(e,Cn),Ae=gg(e.cutLabelVerticalAlign),ze=Le.textTextAlign==="justify"||g;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ne(M??0),cursor:wt?"pointer":"default",...ag(L,v??0,n??!1)},onClick:wt?Ze:void 0,onMouseEnter:W||O?qt:void 0,onMouseLeave:W?Ft:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...g?{paddingLeft:Ne(ce),paddingRight:Ne(ce)}:{},justifyContent:hg(Le.textTextAlign),alignItems:gs(Ae)},children:r.jsx("span",{className:fs(e,Cn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...hs(Le,n),...ys(e,Cn,c,n),...ze?{width:"100%"}:{}},children:H})})})})(),O&&D&&(()=>{const Le=Ho(D.widthPx),Ae={width:Le,height:"auto",maxHeight:Le,objectFit:"contain",left:D.x,top:D.y,position:"absolute"};return r.jsx(og,{media:D,className:D.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Ae},`${D.rowId}-${D.url}`)})()]})})]})}const jg=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
8691
8869
|
import { CommonComponentProps } from '../props';
|
|
8692
8870
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
8693
8871
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -11644,7 +11822,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11644
11822
|
</>
|
|
11645
11823
|
);
|
|
11646
11824
|
}
|
|
11647
|
-
`,Fi=["A","B","C","D","E"],fs=[...Dr,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function _g(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Eo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Ng(){return Object.fromEntries(Fi.map((e,t)=>{const n=Bn[t],i=`${e} column`;return[n,_g(i)]}))}function Hg(){const e={};for(const t of Fi)e[`${t}ColumnWidth`]=Eo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Eo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Eo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Eo(`${t} column padding bottom`);return e}function ys(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Bn]};for(const l of Fi)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 Og(e){const t={};if(e===Ln)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Dr]},enum:[...Dr]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...fs],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...fs]}}return t[lt(e,"textFontFamily")]={type:"string",scope:"layout",title:"",display:{type:"font-family-select",hideLabel:!0}},t[lt(e,"textFontSettings")]={...Jn.fontSettings,scope:"layout",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[lt(e,"textFontSize")]={...Jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[lt(e,"textLineHeight")]={...Jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[lt(e,"textLetterSpacing")]={...Jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[lt(e,"textWordSpacing")]={...Jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[lt(e,"textTextAlign")]={...Jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[lt(e,"textTextAppearance")]={...Jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const jg=Qi.reduce((e,t)=>({...e,...Og(t)}),{});function Bg(e){return{verticalAlign:e===Ln?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Ln?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function zg(e,t={}){var n;return{...Bg(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const vs=new Set(["textFontFamily","textFontSettings"]);function Dg(e,t,n){const i=l=>n===void 0?!0:n==="common"?vs.has(l):!vs.has(l),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=va(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[lt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[lt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[lt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[lt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[lt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[lt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[lt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[lt(e,"textTextAppearance")]=t.textTextAppearance),o}function Oo(e={},t){return Qi.reduce((n,i)=>({...n,...Dg(i,zg(i,e),t)}),{})}const Vg=Oo(),qg=yg();function Fl(e){return[lt(e,"textFontFamily"),lt(e,"textFontSettings"),lt(e,"textFontSize"),lt(e,"textLineHeight"),lt(e,"textLetterSpacing"),lt(e,"textWordSpacing"),lt(e,"textTextAlign"),lt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Gg(){const e=[];return ya.forEach((t,n)=>{const i=Bn[n],o=Fl(t);for(let l=1;l<Bn.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 Kg=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Fl(Ln);const Ug=[...Fi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],Zn=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(1).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(2).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(3).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(4).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(5).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(8).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(9).webp"}],Xg=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:Zn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:Zn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:Zn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:Zn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:Zn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:Zn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:Zn[6],link:""}],Yg=[...Fi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Jg={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Ng(),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:Xg},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"}},...Hg(),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"}},...jg,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",...Vg,...Oo({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:ys({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},...Oo({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:ys({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},...Oo({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Gg(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Ug.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}},...Fi.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",...Yg]},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__",qg]}],paletteBookmark:{items:[...Kg],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Zg={element:Wg,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Eg(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Qi.map(e=>({path:`${lt(e,"textFontFamily")}`}))]},fontRelations:{...Qi.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${lt(t,"textFontFamily")}`}),{})},schema:Jg,sourceCode:Fg},xs=300,kn=.004,Qg={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"},eh=["hover","focus","filled","success","error"];function th(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function bs(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ws(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:F.scalingValue((o-t)/2,i)}}function nh(e){return`
|
|
11825
|
+
`,_i=["A","B","C","D","E"],bs=[...Ur,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Xn={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 Bg(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Eo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function zg(){return Object.fromEntries(_i.map((e,t)=>{const n=On[t],i=`${e} column`;return[n,Bg(i)]}))}function Dg(){const e={};for(const t of _i)e[`${t}ColumnWidth`]=Eo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Eo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Eo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Eo(`${t} column padding bottom`);return e}function ws(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...On]};for(const l of _i)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 Vg(e){const t={};if(e===Cn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Ur]},enum:[...Ur]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...bs],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...bs]}}return t[pt(e,"textFontFamily")]={type:"string",scope:"layout",title:"",display:{type:"font-family-select",hideLabel:!0}},t[pt(e,"textFontSettings")]={...Xn.fontSettings,scope:"layout",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[pt(e,"textFontSize")]={...Xn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[pt(e,"textLineHeight")]={...Xn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[pt(e,"textLetterSpacing")]={...Xn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[pt(e,"textWordSpacing")]={...Xn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[pt(e,"textTextAlign")]={...Xn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[pt(e,"textTextAppearance")]={...Xn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const qg=to.reduce((e,t)=>({...e,...Vg(t)}),{});function Gg(e){return{verticalAlign:e===Cn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Cn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Kg(e,t={}){var n;return{...Gg(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ss=new Set(["textFontFamily","textFontSettings"]);function Ug(e,t,n){const i=l=>n===void 0?!0:n==="common"?Ss.has(l):!Ss.has(l),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=$a(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[pt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[pt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[pt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[pt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[pt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[pt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[pt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[pt(e,"textTextAppearance")]=t.textTextAppearance),o}function jo(e={},t){return to.reduce((n,i)=>({...n,...Ug(i,Kg(i,e),t)}),{})}const Xg=jo(),Yg=Sg();function Hl(e){return[pt(e,"textFontFamily"),pt(e,"textFontSettings"),pt(e,"textFontSize"),pt(e,"textLineHeight"),pt(e,"textLetterSpacing"),pt(e,"textWordSpacing"),pt(e,"textTextAlign"),pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Jg(){const e=[];return Sa.forEach((t,n)=>{const i=On[n],o=Hl(t);for(let l=1;l<On.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 Zg=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Hl(Cn);const Qg=[..._i.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],Yn=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(1).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(2).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(3).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(4).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(5).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(8).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(9).webp"}],eh=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:Yn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:Yn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:Yn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:Yn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:Yn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:Yn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:Yn[6],link:""}],th=[..._i.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],nh={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...zg(),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:eh},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"}},...Dg(),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"}},...qg,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",...Xg,...jo({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:ws({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},...jo({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:ws({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},...jo({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Jg(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Qg.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}},..._i.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",...th]},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__",Yg]}],paletteBookmark:{items:[...Zg],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},ih={element:Og,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Ag(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...to.map(e=>({path:`${pt(e,"textFontFamily")}`}))]},fontRelations:{...to.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${pt(t,"textFontFamily")}`}),{})},schema:nh,sourceCode:jg},$s=300,Mn=.004,oh={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"},rh=["hover","focus","filled","success","error"];function ah(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Cs(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ts(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:N.scalingValue((o-t)/2,i)}}function sh(e){return`
|
|
11648
11826
|
.${e}-wrapper {
|
|
11649
11827
|
box-sizing: border-box;
|
|
11650
11828
|
display: flex;
|
|
@@ -11706,7 +11884,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11706
11884
|
display: flex;
|
|
11707
11885
|
align-items: center;
|
|
11708
11886
|
justify-content: space-between;
|
|
11709
|
-
gap: ${
|
|
11887
|
+
gap: ${ah(20)};
|
|
11710
11888
|
width: 100%;
|
|
11711
11889
|
min-width: 0;
|
|
11712
11890
|
min-height: var(--${e}-question-min-height, unset);
|
|
@@ -11734,7 +11912,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11734
11912
|
width: var(--${e}-icon-max-width);
|
|
11735
11913
|
height: var(--${e}-icon-max-width);
|
|
11736
11914
|
position: relative;
|
|
11737
|
-
transition: transform ${
|
|
11915
|
+
transition: transform ${$s}ms ease;
|
|
11738
11916
|
}
|
|
11739
11917
|
.${e}-icon-custom {
|
|
11740
11918
|
display: flex;
|
|
@@ -11769,7 +11947,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11769
11947
|
.${e}-panel {
|
|
11770
11948
|
display: grid;
|
|
11771
11949
|
grid-template-rows: 0fr;
|
|
11772
|
-
transition: grid-template-rows ${
|
|
11950
|
+
transition: grid-template-rows ${$s}ms ease;
|
|
11773
11951
|
}
|
|
11774
11952
|
.${e}-item-open .${e}-panel {
|
|
11775
11953
|
grid-template-rows: 1fr;
|
|
@@ -11837,7 +12015,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11837
12015
|
left: 20px;
|
|
11838
12016
|
transform: translateY(-50%);
|
|
11839
12017
|
}
|
|
11840
|
-
`}function
|
|
12018
|
+
`}function Ls(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 lh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l}){const{prefix:s}=N.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:m=694e-6,dividerStyle:y="solid",entryHoverEffect:w="default",autoclose:$="off",icon:h,iconMaxWidth:v=.00833,iconPaddingRight:S=0,iconAnimation:C="rotate 45",questionColor:E="#000000",answerColor:M="#000000",dividerColor:H="#0000001F",iconColor:x="#000000",questionHoverColor:j="#666666",iconHoverColor:P="#666666",iconActiveColor:T="#000000",dividerHoverColor:G="#000000",questionFontFamily:f,questionFontSettings:A,questionFontSize:_,questionLineHeight:V,questionLetterSpacing:te,questionWordSpacing:ne,questionTextAppearance:K,answerFontFamily:B,answerFontSettings:F,answerFontSize:I,answerLineHeight:R,answerLetterSpacing:U,answerWordSpacing:D,answerTextAppearance:ee,questionPaddingLeft:O=0,questionPaddingTop:pe=0,questionPaddingBottom:g=0,answerPaddingLeft:ue=0,answerPaddingRight:me=0,answerPaddingTop:we=0,answerPaddingBottom:_e=0}=e,oe=t??[],[ye,X]=a.useState(()=>new Set),be=!n||i;a.useEffect(()=>{X(new Set)},[$]),a.useEffect(()=>{n&&!o&&!i&&X(new Set)},[n,o,i]);const ce=Ne=>N.scalingValue(Ne,n??!1),ge=Math.max(O,Mn),se=Math.max(pe,Mn),Ie=Math.max(g,Mn),Fe=Math.max(ue,Mn),he=Math.max(me,Mn),Ce=Math.max(we,Mn),W=Math.max(_e,Mn),Q=Math.max(0,(c??1)-S-v),L=Math.max(0,(c??1)-me),Y=Math.max(0,(c??1)-ue),J=Math.max(S,Mn),de=Math.max(0,(c??1)-O-v),le=a.useMemo(()=>ye.size===0?0:Math.min(...ye),[ye]),ie=a.useCallback(Ne=>ye.has(Ne),[ye]),Re=be&&w==="default"?`${s}-entry-hover-default`:"",Se=h??"",z=Se!=="",Te=C.replace(/^rotate /,""),Z=`${s}-icon-anim-${Te}`,fe=nn(Bt(Ls(f,A,_,V,te,ne,K,E),n)),ve=nn(Bt(Ls(B,F,I,R,U,D,ee,M),n)),ke=Cs(_,V,`${s}-question`,`${s}-text-tight-leading`),Qe=Cs(I,R,`${s}-answer-text`,`${s}-text-tight-leading`),Xe=Ts(_,V,s,n),ht=Ts(I,R,s,n),xt=N.buildColorVars(s,{questionColor:E,answerColor:M,dividerColor:H,iconColor:x,questionHoverColor:j,iconHoverColor:P,iconActiveColor:T,dividerHoverColor:G},oh,rh),It=l&&l!=="default"?`${s}-state-${l}`:"",Et=a.useCallback(Ne=>{be&&X(ot=>{if(ot.has(Ne)){const et=new Set(ot);return et.delete(Ne),et}if($==="on")return new Set([Ne]);const dt=new Set(ot);return dt.add(Ne),dt})},[be,$]),wt=a.useMemo(()=>sh(s),[s]),Ze={[`--${s}-divider-width`]:N.scalingValue(m,n??!1),[`--${s}-divider-style`]:y,[`--${s}-icon-max-width`]:N.scalingValue(v,n??!1),...u>0?{[`--${s}-question-min-height`]:N.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:wt}}),r.jsx("div",{style:xt,children:r.jsx("div",{className:at(`${s}-wrapper`,n&&!i&&`${s}-editor`,Re,It),style:{width:N.scalingValue(c,n??!1),maxWidth:"100%",...Ze},children:oe.map((Ne,ot)=>{var _t;const dt=ie(ot),et=((_t=Ne.question)==null?void 0:_t.trim())??"",mt=Ne.answer,ut=((mt==null?void 0:mt.length)??0)>0,lt=d&&ot===le;return r.jsxs("div",{className:at(`${s}-item`,dt&&`${s}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${s}-question-controls`,children:[lt&&r.jsxs(r.Fragment,{children:[r.jsx(zt,{"data-controls":"questionPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:ce(se),zIndex:2}}),r.jsx(zt,{"data-controls":"questionPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Q),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:ce(ge),height:"100%",zIndex:2}}),r.jsx(zt,{"data-controls":"iconPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(de),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:ce(J),height:"100%",zIndex:2}})]}),r.jsxs("button",{type:"button",className:`${s}-question-button`,"aria-expanded":dt,style:{...fe,...Xe,paddingLeft:ce(O),paddingRight:ce(S)},onClick:()=>Et(ot),children:[pe>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:ce(pe)},"aria-hidden":"true"}),r.jsxs("span",{className:`${s}-question-row`,children:[r.jsx("span",{className:ke,children:et}),ut&&(z?r.jsx("span",{className:`${s}-icon ${s}-icon-custom ${Z}`,"aria-hidden":"true",children:r.jsx(on,{url:Se,fill:x,hoverFill:P,className:`${s}-icon-image`})}):r.jsx("span",{className:`${s}-icon ${s}-icon-default ${Z}`,"aria-hidden":"true"}))]}),g>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:ce(g)},"aria-hidden":"true"})]}),lt&&r.jsx(zt,{"data-controls":"questionPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ce(Ie),zIndex:2}})]}),ut&&mt&&r.jsx("div",{className:`${s}-panel`,"aria-hidden":!dt,children:r.jsx("div",{className:`${s}-panel-inner`,children:r.jsxs("div",{className:`${s}-answer-controls`,children:[lt&&dt&&r.jsxs(r.Fragment,{children:[r.jsx(zt,{"data-controls":"answerPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:ce(Ce),zIndex:2}}),r.jsx(zt,{"data-controls":"answerPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(L),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:ce(Fe),height:"100%",zIndex:2}}),r.jsx(zt,{"data-controls":"answerPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Y),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:ce(he),height:"100%",zIndex:2}})]}),we>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:ce(we)}}),r.jsx("div",{className:`${s}-answer`,style:{...ve,...ht,paddingLeft:ce(ue),paddingRight:ce(me)},children:r.jsx("div",{className:Qe,children:r.jsx(Si,{content:mt})})}),_e>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:ce(_e)}}),lt&&dt&&r.jsx(zt,{"data-controls":"answerPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ce(W),zIndex:2}})]})})})]},ot)})})})]})}const ch=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
11841
12019
|
import cn from 'classnames';
|
|
11842
12020
|
import { CommonComponentProps } from '../props';
|
|
11843
12021
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -12634,7 +12812,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
12634
12812
|
</>
|
|
12635
12813
|
);
|
|
12636
12814
|
}
|
|
12637
|
-
`;function An(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const $s={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},rh=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],ah={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:An("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:{...$s.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:{...$s.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:An("Question Padding Left"),questionPaddingTop:An("Question Padding Top"),questionPaddingBottom:An("Question Padding Bottom"),answerPaddingLeft:An("Answer Padding Left"),answerPaddingRight:An("Answer Padding Right"),answerPaddingTop:An("Answer Padding Top"),answerPaddingBottom:An("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:[...rh],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},sh={element:ih,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:ah,sourceCode:oh},In=e=>e.display==="cover",lr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Cs=100,lh=.2,Ts=8,_l=({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 m=a.useMemo(()=>typeof window>"u"?Cs:Math.max(Cs,window.innerHeight*lh),[]),y=a.useCallback(f=>Math.max(0,1-f/(m*1.5)),[m]),E=a.useCallback(f=>Math.max(0,1-f/(m*.45)),[m]),T=a.useCallback(f=>{const M=typeof window<"u"?window.innerHeight:800,_=Math.max(.88,1-f/M*.12);return`translateY(${f}px) scale(${_})`},[]),h=a.useCallback(()=>{c.current=null},[]),v=a.useCallback(()=>{d(!0),l(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),I=a.useCallback(()=>{const f=typeof window<"u"?window.innerHeight:800;d(!0),l(f),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),L=a.useCallback(f=>{!e||s||f.pointerType==="touch"&&(i!=null&&i(f.target)||(c.current={startX:f.clientX,startY:f.clientY,isLocked:null,pointerId:f.pointerId}))},[e,s,i]),R=a.useCallback(f=>{const M=c.current;if(!e||!M||f.pointerType!=="touch"||M.pointerId!==f.pointerId)return;const _=f.clientX-M.startX,j=f.clientY-M.startY;if(M.isLocked===null){if(Math.abs(_)<Ts&&Math.abs(j)<Ts)return;if(j>0&&j>Math.abs(_))M.isLocked=!0,f.currentTarget.setPointerCapture(f.pointerId);else{M.isLocked=!1,h();return}}if(!M.isLocked)return;f.preventDefault();const te=Math.max(0,j);u.current=te,l(te)},[e,h]),P=a.useCallback(f=>{const M=c.current;if(!e||!M||f.pointerType!=="touch"||M.pointerId!==f.pointerId)return;const _=M.isLocked===!0;if(f.currentTarget.hasPointerCapture(f.pointerId)&&f.currentTarget.releasePointerCapture(f.pointerId),!_){h();return}f.clientY-M.startY>=m?I():v()},[m,I,e,h,v]),O=a.useCallback(f=>{P(f)},[P]),x=a.useCallback(f=>{P(f)},[P]),N=o>0,k=s?`transform ${n}ms ease`:"none",$=s?`opacity ${n}ms ease`:"none",q=o>0||s;return{isSwipeDragging:N,backdropStyle:{opacity:y(o),transition:$},mediaAreaStyle:{transform:T(o),transition:k,touchAction:N?"none":void 0,willChange:N?"transform":void 0},overlayContentStyle:q?{opacity:E(o),transition:$}:void 0,swipeHandlers:e?{onPointerDown:L,onPointerMove:R,onPointerUp:O,onPointerCancel:x}:{},dismissAreaStyle:e?{touchAction:N?"none":"pan-x"}:void 0}},ch="[data-lightbox-scrollable]",Nl=()=>{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(ch)||d.preventDefault()};return document.addEventListener("touchmove",s,{passive:!1}),()=>{document.removeEventListener("touchmove",s),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=l,window.scrollTo(0,e)}},[])},dh=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},uh=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},ph=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},mh=(e,t,n,{duration:i,easing:o,onComplete:l})=>{const s=e.scrollLeft,d=n-s,c=s-n,u=(h,v)=>{uh(t),e.scrollLeft=h,v&&(l==null||l())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let m=!1,y=0;const E=()=>{t.removeEventListener("transitionend",T),clearTimeout(y)},T=h=>{h.target!==t||h.propertyName!=="transform"||m||(m=!0,E(),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)`,y=window.setTimeout(()=>{m||(m=!0,E(),u(n,!0))},i+64),()=>{m||(m=!0,E(),u(s-ph(t),!1))}},Di=300,gh=900,hh=1500,fh="cubic-bezier(0.16, 1, 0.3, 1)",yh=3e3,vh=2,xh=16,bh=.05,wh=1,Ro=.3,Sh=50,$h=20,ui=.004,Ri=["title1","title2","title3"],Ch={title1:"1",title2:"2",title3:"3"},Th={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Lh={title1:.02,title2:.02,title3:.02},Mo=e=>`max(${e}, ${$h}px)`,Ih=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]}},Eh=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=Ih(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},xt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Rh=e=>[xt(e,"fontFamily"),xt(e,"fontSettings"),{type:"row",items:[xt(e,"fontSize"),xt(e,"lineHeight"),xt(e,"letterSpacing"),xt(e,"wordSpacing")]},xt(e,"textAlign"),xt(e,"textAppearance")],Mh=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Ri.map(e=>[Ch[e],Rh(e)]))}),wa=(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},Hl=(e,t)=>wa(e,t),Po=(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:wa(e.length,n),effective:Hl(e.length,n)}},Ph=(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},Rr=(e,t)=>{const n=i=>{const o=xt(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[Th[t]]}},kh=(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),Mr=(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??Lh[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ot(i,n)},Ah=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:m,imageGap:y,closeIcon:E,closeIconMaxWidth:T,closeIconColor:h,closeIconHoverColor:v,thumbnailTrigger:I,thumbnailVisibility:L,thumbnailObjectFit:R,thumbnailActive:P,thumbnailActiveColor:O,title1Width:x,title2Width:N,title3Width:k,title1MarginLeft:$=0,title2MarginLeft:q=0,title3MarginLeft:f=0,titleRowMarginBottom:M=0,titleHeaderLayout:_="desktop",contentMarginTop:j,iconMarginLeft:te}=n,ie=p=>F.scalingValue(p,i??!1),G=c??n.thumnailSize??.03,z=ie(G),H=ie(u),W=ie(m??.02),S=ie(y??0),K=ie(j??0),J=Mo(K),Q=ie(te??0),[D,ue]=a.useState(0),g=a.useRef(D);g.current=D;const pe=t[D],{title1:fe,title2:ve,title3:Ne}=Eh(pe),ne=Mr("title1",Rr(n,"title1"),i),ge=Mr("title2",Rr(n,"title2"),i),ee=Mr("title3",Rr(n,"title3"),i),be=_==="mobile",ce=!o&&(!i||l),oe=ce,Z=ce,Ce=ce,Le=In(R),$e=Le?{"--image-aspect-ratio":lr(R)}:void 0,ke=!!(fe||ve||Ne),b=a.useMemo(()=>Ph(e,fe,ve,Ne,ne,ge,ee),[e,D,fe,ve,Ne,ne,ge,ee]),re=a.useMemo(()=>({title1Width:x,title2Width:N,title3Width:k}),[x,N,k]),C=a.useMemo(()=>b.map(p=>re[p.widthKey]),[b,re]),U=a.useMemo(()=>wa(b.length,C),[b.length,C]),X=a.useMemo(()=>Hl(b.length,C),[b.length,C]),se=a.useMemo(()=>b.filter(p=>p.prefix==="title1"),[b]),le=a.useMemo(()=>b.filter(p=>p.prefix==="title2"||p.prefix==="title3"),[b]),ye=a.useMemo(()=>Ls(se,re),[se,re]),We=a.useMemo(()=>Ls(le,re),[le,re]),Me=a.useCallback((p,w)=>{const A=b.indexOf(p);if(!be||w==="single-row")return{effectiveWidth:X[A]??0,resolvedWidth:U[A]??0,maxWidth:Po(A,U)};if(w==="two-row-top"){const xe=se.indexOf(p);return{effectiveWidth:ye.effective[xe]??0,resolvedWidth:ye.resolved[xe]??0,maxWidth:Po(xe,ye.resolved)}}const ae=le.indexOf(p);return{effectiveWidth:We.effective[ae]??0,resolvedWidth:We.resolved[ae]??0,maxWidth:Po(ae,We.resolved)}},[le,We,X,U,b,se,ye,be]),B=a.useCallback(p=>F.scalingValue(p,i??!1),[i]),we=B(M??0),Y=a.useMemo(()=>({title1MarginLeft:$,title2MarginLeft:q,title3MarginLeft:f}),[$,q,f]),me=a.useCallback(p=>b.slice(0,p+1).reduce((w,A,ae)=>w+(A!=null&&A.marginLeftKey?Y[A.marginLeftKey]??0:0)+(U[ae]??0),0)+(be?0:$??0),[b,Y,U,be,$]),Te=a.useCallback(()=>be?0:$??0,[be,$]),He=a.useCallback(p=>le.slice(0,p).reduce((w,A,ae)=>w+(A.marginLeftKey?Y[A.marginLeftKey]??0:0)+(We.resolved[ae]??0),0),[le,We.resolved,Y]),Ze=a.useCallback(p=>{const w=le[p];return He(p)+(w.marginLeftKey?Y[w.marginLeftKey]??0:0)+(We.resolved[p]??0)},[le,We.resolved,He,Y]),je=(p,w)=>{const A=p.marginLeftKey?Y[p.marginLeftKey]??0:0,{effectiveWidth:ae,resolvedWidth:xe,maxWidth:Pe}=Me(p,w),Xe=o&&w==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":p.prefix,style:{...w==="single-row"?{gridArea:p.prefix}:{},width:B(ae),...A>0?{marginLeft:B(A)}:{}},children:[r.jsx("p",{className:p.className,style:p.style,children:p.text}),Xe&&p.marginLeftKey&&r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe),style:{position:"absolute",top:0,left:B(-A),width:`max(${B(A)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Xe&&r.jsx("div",{"data-controls":p.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:B(-ui/2),width:B(ui),height:"100%",pointerEvents:"auto"}})]},p.className)},Ke=()=>{const p=be?-1:b.findIndex(ae=>ae.prefix==="title1"),w=!be&&(o||($??0)>0)?(()=>{const ae=$??0,xe=p>=0?U[p]:x??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe),style:{position:"absolute",top:0,left:0,width:`max(${B(ae)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,A=b.flatMap((ae,xe)=>{if(!ae.marginLeftKey)return[];const Pe=Y[ae.marginLeftKey]??0,Xe=kh(b,U,Y,xe)+Te();return r.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(U[xe]),style:{position:"absolute",top:0,left:B(Xe),width:`max(${B(Pe)}, 10px)`,height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)});return w?[w,...A]:A},ct=()=>b.map((p,w)=>{const A=Po(w,U),xe=me(w)-ui/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(A),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:B(xe),width:B(ui),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),ft=()=>le.flatMap((p,w)=>{if(!p.marginLeftKey)return[];const A=Y[p.marginLeftKey]??0,ae=He(w),{resolvedWidth:xe}=Me(p,"two-row-bottom");return r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe),style:{position:"absolute",top:0,left:B(ae),width:`max(${B(A)}, 10px)`,height:"100%",pointerEvents:"auto"}},p.marginLeftKey)}),bt=()=>le.map((p,w)=>{const{maxWidth:A}=Me(p,"two-row-bottom"),xe=Ze(w)-ui/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(A),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:B(xe),width:B(ui),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),Ct=a.useRef(null),Qe=a.useRef(null),Be=a.useRef(null),Je=a.useRef(null),ut=a.useRef([]),et=a.useRef([]),It=a.useRef(0),yt=a.useRef(null),ot=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Wt=a.useRef(null),jt=a.useRef(null),Ue=a.useRef(0),$t=a.useRef("forward"),Ge=a.useRef(0),tt=a.useRef(null),pt=a.useRef(!1),rt=t.length>1&&(!o||!!l),Kt=rt?3:1,rn=a.useMemo(()=>Array.from({length:Kt},()=>t).flat(),[t,Kt]),[gn,mt]=a.useState(!1),[Dt,Rt]=a.useState(!1),[he,Ae]=a.useState(!0),ze=a.useRef(null),de=a.useRef(null),Ie=a.useRef(!1),_e=a.useRef(!1),Re=a.useRef(null),qe=a.useRef(null),gt=oe&&!he,Fe=a.useCallback(()=>{oe&&(Ae(!0),qe.current&&clearTimeout(qe.current),qe.current=setTimeout(()=>{ot.current.isActive||Ae(!1)},yh))},[oe]),De=a.useCallback(()=>{o||_e.current||(_e.current=!0,Rt(!1),Re.current=setTimeout(()=>{s()},Di))},[o,s]),Ve=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":gt?"true":"false",style:{width:F.scalingValue(T??0,i),height:F.scalingValue(T??0,i),marginRight:Q,"--close-icon-hover-color":v},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:De,"aria-label":"Close",children:r.jsx(tn,{url:E,fill:h,hoverFill:i&&!l?h:v,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:Q,height:"100%",pointerEvents:"auto"}})]}),st=(p="two-row")=>r.jsx("div",{...p==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:B($??0),flexShrink:0,...p==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...p==="two-row"&&o?{pointerEvents:"auto"}:{}}}),dt=()=>{const p=b.find(ae=>ae.prefix==="title1"),w=b.filter(ae=>ae.prefix==="title2"||ae.prefix==="title3"),A=w.length>0||o||(M??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[($??0)>0||o?st():null,p&&je(p,"two-row-top"),E&&Ve()]}),A?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[w.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[w.map(ae=>je(ae,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[ft(),bt()]})]}):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:we,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},Tt=()=>r.jsxs(r.Fragment,{children:[($??0)>0||o?st("single-row"):null,b.map(p=>je(p,"single-row")),o?r.jsxs(r.Fragment,{children:[Ke(),ct()]}):null,E?Ve():null]}),Mt=a.useCallback(p=>!!(p.closest("[data-controls]")||p.closest(`.${e}-thumbnails`)||p.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:St,backdropStyle:Bt,mediaAreaStyle:_t,overlayContentStyle:Nt,swipeHandlers:an,dismissAreaStyle:ht}=_l({enabled:ce??!1,onClose:De,animMs:Di,isBlockedTarget:Mt}),Ft=()=>{if(!rt||t.length===0)return It.current=0,0;const p=et.current[0],w=et.current[t.length];if(!p||!w)return It.current;const A=w.offsetLeft-p.offsetLeft;return A>0&&(It.current=A),It.current},Et=(p=!1)=>{if(!rt)return;const w=Qe.current,A=Ft();!w||A<=0||A<w.clientWidth*.25||(w.scrollLeft<=0?(w.scrollLeft+=A,p&&(ot.current.scrollLeft+=A),pt.current&&(Ge.current+=A)):w.scrollLeft>=A*2&&(w.scrollLeft-=A,p&&(ot.current.scrollLeft-=A),pt.current&&(Ge.current-=A)))},Xt=(p,w=(A=>(A=Qe.current)==null?void 0:A.scrollLeft)()??0)=>{if(!rt)return p;let ae=t.length+p,xe=1/0;for(let Pe=0;Pe<Kt;Pe++){const Xe=Pe*t.length+p,at=et.current[Xe];if(!at)continue;const Ht=Math.abs(at.offsetLeft-w);Ht<xe&&(xe=Ht,ae=Xe)}return ae},sn=p=>{const w=Qe.current;return!p||!w?!1:p.offsetWidth>w.clientWidth+1},vt=p=>{const w=Qe.current;if(!p||!w||!sn(p))return!1;const A=p.offsetLeft,ae=A+p.offsetWidth;return w.scrollLeft>=A-1&&w.scrollLeft+w.clientWidth<=ae+1},Pt=(p=(w=>(w=Qe.current)==null?void 0:w.scrollLeft)()??0)=>{for(let ae=0;ae<et.current.length;ae+=1){const xe=et.current[ae];if(xe&&vt(xe))return ae}let A={flatIndex:0,distance:1/0};return et.current.forEach((ae,xe)=>{if(!ae)return;const Pe=Math.abs(ae.offsetLeft-p);Pe<A.distance&&(A={flatIndex:xe,distance:Pe})}),A.flatIndex},Ut=p=>{Qe.current&&et.current.forEach(w=>{w&&(w.style.scrollSnapAlign=sn(w)&&p==="backward"?"end":"start")})},ln=(p,w,A)=>{const ae=p-w,xe=Pt(w),Pe=et.current[xe];if(vt(Pe))return Pt(p)%t.length;const Xe=et.current[xe+1],at=Pe?Xe?Xe.offsetLeft-Pe.offsetLeft:Pe.offsetWidth:0,Ht=at>0?ae>at*Ro?1:ae<-at*Ro?-1:0:0;return Ht===0?A:rt?(A+Ht+t.length)%t.length:Math.max(0,Math.min(t.length-1,A+Ht))},Mn=a.useCallback((p=!1)=>{if(L!=="on"||o)return;const w=Je.current,A=g.current,ae=ut.current[A];if(!w||!ae||w.scrollWidth<=w.clientWidth)return;const xe=w.scrollLeft,Pe=xe+w.clientWidth,Xe=ae.offsetLeft,at=Xe+ae.offsetWidth;if(Xe>=xe&&at<=Pe)return;const Ht=w.scrollWidth-w.clientWidth;let kt=xe;if(!p&&ze.current===null){const ci=ut.current[A-1],Ni=ut.current[A+1],yo=ci?ae.offsetLeft-ci.offsetLeft:Ni?Ni.offsetLeft-ae.offsetLeft:ae.offsetWidth;at>Pe?kt+=yo:Xe<xe&&(kt-=yo)}else at>Pe?kt=at-w.clientWidth:kt=Xe;w.scrollLeft=Math.max(0,Math.min(Ht,kt))},[o,L]),_i=a.useCallback((p=!1)=>{p&&(Ie.current=!0),de.current===null&&(de.current=requestAnimationFrame(()=>{de.current=null;const w=Ie.current;Ie.current=!1,Mn(w)}))},[Mn]),cr=a.useCallback(p=>{if(p===g.current)return;const w=g.current;g.current=p;const A=Math.abs(p-w)>1,ae=rt&&t.length>1&&(w===t.length-1&&p===0||w===0&&p===t.length-1);ue(p),_i(A||ae)},[t.length,rt,_i]),cn=()=>{if(!Qe.current||t.length===0||ze.current!==null||ot.current.isActive&&ot.current.hasMoved)return;const p=Qe.current.scrollLeft,w=Pt(p)%t.length;w!==g.current&&cr(w)},po=()=>{ze.current=null},dn=p=>{const w=Qe.current;w&&(w.style.scrollSnapType=p?"":"none")},xn=()=>{var p;(p=jt.current)==null||p.call(jt),jt.current=null},Pn=()=>{tt.current!==null&&(cancelAnimationFrame(tt.current),tt.current=null),pt.current=!1},qn=()=>{const p=Qe.current;if(!p){tt.current=null,pt.current=!1;return}const w=Ge.current-p.scrollLeft;if(Math.abs(w)<.5){p.scrollLeft=Ge.current,Et(),cn(),tt.current=null,pt.current=!1;return}p.scrollLeft+=w*bh,Et(),cn(),Fe(),tt.current=requestAnimationFrame(qn)},Gn=()=>{const p=Be.current;p&&(p.style.transition="",p.style.transform="",p.style.willChange="")},mo=(p,w,A,ae)=>{Gn(),p.scrollLeft=w,Ue.current=p.scrollLeft,Et(),A!==void 0?(g.current=A,ue(A)):cn(),dn(!0),ae==null||ae()},go=(p,{behavior:w="smooth",activeIndex:A,onComplete:ae}={})=>{const xe=Qe.current,Pe=Be.current;if(!xe||!Pe)return;if(Pn(),xn(),dn(!1),w==="auto"){mo(xe,p,A,ae);return}const Xe=Math.abs(p-xe.scrollLeft),at=dh(Xe,gh,hh,xe.clientWidth*.55);jt.current=mh(xe,Pe,p,{duration:at,easing:fh,onComplete:()=>{jt.current=null,mo(xe,p,A,ae)}})},dr=(p="smooth")=>{const w=Qe.current;if(!w||t.length===0)return;const A=Pt()%t.length,ae=Xt(A,w.scrollLeft),xe=et.current[ae];xe&&go(xe.offsetLeft,{behavior:p,activeIndex:A})},ur=(p,w="smooth",A,ae)=>{const xe=Qe.current;if(!xe||t.length===0)return;const Pe=(ae??xe.scrollLeft)-p,Xe=Pt(p),at=et.current[Xe];if(vt(at)){dn(!0),cn();return}const Ht=et.current[Xe+1],kt=at?Ht?Ht.offsetLeft-at.offsetLeft:at.offsetWidth:0;if((kt>0?Pe>kt*Ro?1:Pe<-kt*Ro?-1:0:0)!==0){const Bl=A??Xe%t.length,zl=ln(ae??xe.scrollLeft,p,Bl);hn(zl,w);return}const Ni=ae??xe.scrollLeft,yo=Pt(Ni),Sa=et.current[yo];if(Sa&&Math.abs(Sa.offsetLeft-Ni)<1){dn(!0),cn();return}dr("auto")},hn=(p,w="smooth")=>{const A=Qe.current;if(!A||t.length===0)return;const ae=Xt(p,A.scrollLeft),xe=et.current[ae];xe&&(w==="smooth"?ze.current=p:ze.current=null,g.current=p,ue(p),_i(!0),go(xe.offsetLeft,{behavior:w,activeIndex:p,onComplete:w==="smooth"?po:void 0}))},li=()=>{Wt.current&&(window.removeEventListener("pointerup",Wt.current),window.removeEventListener("pointercancel",Wt.current),Wt.current=null)},ho=(p,w,A,ae,xe)=>{const Pe=A-p,Xe=ae-w,at=Math.abs(Pe),Ht=Math.abs(Xe);if(at<Sh||at<=Ht)return!1;const kt=Pe<0?1:-1,ci=rt?(xe+kt+t.length)%t.length:Math.max(0,Math.min(t.length-1,xe+kt));return ci===xe?!1:(hn(ci),!0)},Kn=p=>{if(!ot.current.isActive)return;li();const w=Qe.current;if(!w)return;const{scrollLeft:A,startActiveIndex:ae,hasMoved:xe}=ot.current,Pe=w.scrollLeft;Et(!0),ot.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},mt(!1),p!==void 0&&w.hasPointerCapture(p)&&w.releasePointerCapture(p),xe?ur(A,"smooth",ae,Pe):(dn(!0),cn()),Fe()},fo=(p,w)=>{const A=yt.current;yt.current=null,A&&(ho(A.startX,A.startY,p,w,A.startActiveIndex),Fe())},pr=p=>{if(!Z)return;if(p.pointerType==="touch"){if(Pn(),dn(!0),Mt(p.target))return;yt.current={startX:p.clientX,startY:p.clientY,startActiveIndex:g.current};return}if(p.pointerType!=="mouse"||p.button!==0||Mt(p.target))return;const w=Qe.current;if(!w)return;Pn(),xn(),Gn(),ze.current=null,ot.current={isActive:!0,startX:p.clientX,scrollLeft:w.scrollLeft,startActiveIndex:g.current,hasMoved:!1},dn(!1),Fe(),w.setPointerCapture(p.pointerId),li();const A=ae=>{ae.pointerType==="mouse"&&Kn(ae.pointerId)};Wt.current=A,window.addEventListener("pointerup",A),window.addEventListener("pointercancel",A)},mr=p=>{if(!Z||p.pointerType!=="mouse")return;const w=Qe.current;if(!w||!ot.current.isActive)return;if(p.buttons===0){Kn(p.pointerId);return}const A=p.clientX-ot.current.startX;Math.abs(A)>wh&&(ot.current.hasMoved=!0,mt(!0)),ot.current.hasMoved&&(p.preventDefault(),w.scrollLeft=ot.current.scrollLeft-A,Et(!0),cn(),Fe())},V=p=>{if(Z){if(p.pointerType==="touch"){p.type==="pointerup"?fo(p.clientX,p.clientY):yt.current=null;return}p.pointerType==="mouse"&&Kn(p.pointerId)}},Se=p=>{!Z||p.pointerType!=="mouse"||Kn(p.pointerId)};return Nl(),a.useEffect(()=>{const p=requestAnimationFrame(()=>Rt(!0));return()=>{cancelAnimationFrame(p),xn(),li(),de.current!==null&&(cancelAnimationFrame(de.current),de.current=null),Re.current&&clearTimeout(Re.current),qe.current&&clearTimeout(qe.current)}},[]),a.useEffect(()=>{if(!oe){Ae(!0);return}Fe();const p=Ct.current;if(!p)return;const w=()=>Fe();return p.addEventListener("pointermove",w),p.addEventListener("pointerdown",w),()=>{p.removeEventListener("pointermove",w),p.removeEventListener("pointerdown",w),qe.current&&clearTimeout(qe.current)}},[oe,Fe]),a.useEffect(()=>{const p=w=>{w.key==="Escape"&&De()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[De]),a.useLayoutEffect(()=>{Ft()},[S,t.length,rt]),a.useLayoutEffect(()=>{o||hn(g.current,"auto")},[S,o]),a.useLayoutEffect(()=>{hn(0,"auto")},[t.length,rt]),a.useEffect(()=>{const p=Qe.current;if(!p||o||!ce)return;const w=A=>{if(A.preventDefault(),Math.abs(A.deltaY)<=Math.abs(A.deltaX))return;const ae=A.deltaMode===1?xh:A.deltaMode===2?p.clientHeight:1,xe=A.deltaY*ae*vh;if(xe!==0){if(xn(),pt.current||(pt.current=!0,Ge.current=p.scrollLeft,ze.current=null,dn(!1)),Ge.current+=xe,!rt){const Pe=p.scrollWidth-p.clientWidth;Ge.current=Math.max(0,Math.min(Pe,Ge.current))}Fe(),tt.current===null&&(tt.current=requestAnimationFrame(qn))}};return p.addEventListener("wheel",w,{passive:!1}),()=>{p.removeEventListener("wheel",w),Pn()}},[o,ce,rt]),a.useEffect(()=>{const p=Qe.current;if(!p)return;const w=()=>{Et(ot.current.isActive);const ae=p.scrollLeft,xe=ae-Ue.current;Ue.current=ae;const Pe=It.current>0?It.current*.5:1/0;if(xe!==0&&Math.abs(xe)<Pe){const Xe=xe>0?"forward":"backward";Xe!==$t.current&&($t.current=Xe,Ut(Xe))}ot.current.isActive&&ot.current.hasMoved||cn()};p.addEventListener("scroll",w,{passive:!0});const A=new ResizeObserver(()=>{Ft(),Et(ot.current.isActive),Ut($t.current),cn()});return A.observe(p),()=>{xn(),p.removeEventListener("scroll",w),A.disconnect()}},[t.length,rt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{St||De()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Dt?1:0,transition:`opacity ${Di}ms ease`,pointerEvents:Dt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Bt}}),r.jsxs("div",{ref:Ct,className:`${e}-lightbox-dismiss-area`,style:ht,...an,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:_t,onClick:p=>p.stopPropagation(),children:r.jsx("div",{ref:Qe,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Z&&t.length>0?"true":"false","data-mouse-dragging":gn?"true":"false",onPointerDown:pr,onPointerMove:mr,onPointerUp:V,onPointerCancel:V,onLostPointerCapture:Se,children:r.jsx("div",{ref:Be,className:`${e}-lightbox-strip-track`,style:{gap:S},children:rn.map((p,w)=>{const A=p.image.objectFit??"contain",ae=w%t.length,xe=Math.floor(w/t.length),Pe=Mo(S),Xe=`calc(-0.5 * (${Pe} + ${S}))`;return r.jsxs("div",{ref:at=>et.current[w]=at,className:`${e}-strip-item`,style:{height:_==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"75%"},children:[r.jsx("img",{src:p.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:A}}),o&&ae<t.length-1&&xe===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Xe,width:Pe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${xe}-${p.image.url}-${ae}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":gt?"true":"false",style:Nt,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:J,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${be?` ${e}-lightbox-content-area-stacked`:""}`,children:(ke||E)&&r.jsx("div",{className:`${e}-header ${be?`${e}-header-two-row`:`${e}-header-single-row`}`,children:be?dt():ke||E?Tt():null})})})]}),t.length>1&&L==="on"&&(()=>{const p=Mo(W),w=`calc(-0.5 * (${W} + ${p}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:W},children:r.jsx("div",{ref:Je,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:A=>A.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":P,style:{gap:H,"--thumbnail-active-color":O},children:[t.map((A,ae)=>{const xe=Mo(H),Pe=`calc(-0.5 * (${xe} + ${H}))`;return r.jsxs("div",{ref:Xe=>{ut.current[ae]=Xe},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":D===ae?"true":"false",onClick:()=>ce&&I==="click"&&hn(ae),onMouseEnter:()=>Ce&&I==="hover"&&hn(ae),"aria-label":A.image.name?`View ${A.image.name}`:`View image ${ae+1}`,"aria-current":D===ae?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${Le?` ${e}-thumb-image-cover`:""}`,src:A.image.url,alt:"",draggable:!1,style:{...$e,maxWidth:z,maxHeight:z,width:R.display==="cover"?"auto":"100%",height:"auto",objectFit:R.display==="cover"?"cover":"contain"}})}),o&&ae<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Pe,width:xe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${A.image.url}-${ae}`)}),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:w,height:p,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Wh(e){return`
|
|
12815
|
+
`;function Pn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Is={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},dh=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],uh={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:Pn("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:{...Is.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:{...Is.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:Pn("Question Padding Left"),questionPaddingTop:Pn("Question Padding Top"),questionPaddingBottom:Pn("Question Padding Bottom"),answerPaddingLeft:Pn("Answer Padding Left"),answerPaddingRight:Pn("Answer Padding Right"),answerPaddingTop:Pn("Answer Padding Top"),answerPaddingBottom:Pn("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:[...dh],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},ph={element:lh,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:uh,sourceCode:ch},Tn=e=>e.display==="cover",dr=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,mh=.2,Es=8,Ol=({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 m=a.useMemo(()=>typeof window>"u"?Rs:Math.max(Rs,window.innerHeight*mh),[]),y=a.useCallback(f=>Math.max(0,1-f/(m*1.5)),[m]),w=a.useCallback(f=>Math.max(0,1-f/(m*.45)),[m]),$=a.useCallback(f=>{const A=typeof window<"u"?window.innerHeight:800,_=Math.max(.88,1-f/A*.12);return`translateY(${f}px) scale(${_})`},[]),h=a.useCallback(()=>{c.current=null},[]),v=a.useCallback(()=>{d(!0),l(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),S=a.useCallback(()=>{const f=typeof window<"u"?window.innerHeight:800;d(!0),l(f),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),C=a.useCallback(f=>{!e||s||f.pointerType==="touch"&&(i!=null&&i(f.target)||(c.current={startX:f.clientX,startY:f.clientY,isLocked:null,pointerId:f.pointerId}))},[e,s,i]),E=a.useCallback(f=>{const A=c.current;if(!e||!A||f.pointerType!=="touch"||A.pointerId!==f.pointerId)return;const _=f.clientX-A.startX,V=f.clientY-A.startY;if(A.isLocked===null){if(Math.abs(_)<Es&&Math.abs(V)<Es)return;if(V>0&&V>Math.abs(_))A.isLocked=!0,f.currentTarget.setPointerCapture(f.pointerId);else{A.isLocked=!1,h();return}}if(!A.isLocked)return;f.preventDefault();const te=Math.max(0,V);u.current=te,l(te)},[e,h]),M=a.useCallback(f=>{const A=c.current;if(!e||!A||f.pointerType!=="touch"||A.pointerId!==f.pointerId)return;const _=A.isLocked===!0;if(f.currentTarget.hasPointerCapture(f.pointerId)&&f.currentTarget.releasePointerCapture(f.pointerId),!_){h();return}f.clientY-A.startY>=m?S():v()},[m,S,e,h,v]),H=a.useCallback(f=>{M(f)},[M]),x=a.useCallback(f=>{M(f)},[M]),j=o>0,P=s?`transform ${n}ms ease`:"none",T=s?`opacity ${n}ms ease`:"none",G=o>0||s;return{isSwipeDragging:j,backdropStyle:{opacity:y(o),transition:T},mediaAreaStyle:{transform:$(o),transition:P,touchAction:j?"none":void 0,willChange:j?"transform":void 0},overlayContentStyle:G?{opacity:w(o),transition:T}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:E,onPointerUp:H,onPointerCancel:x}:{},dismissAreaStyle:e?{touchAction:j?"none":"pan-x"}:void 0}},gh="[data-lightbox-scrollable]",jl=()=>{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(gh)||d.preventDefault()};return document.addEventListener("touchmove",s,{passive:!1}),()=>{document.removeEventListener("touchmove",s),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=l,window.scrollTo(0,e)}},[])},hh=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},fh=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},yh=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},vh=(e,t,n,{duration:i,easing:o,onComplete:l})=>{const s=e.scrollLeft,d=n-s,c=s-n,u=(h,v)=>{fh(t),e.scrollLeft=h,v&&(l==null||l())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let m=!1,y=0;const w=()=>{t.removeEventListener("transitionend",$),clearTimeout(y)},$=h=>{h.target!==t||h.propertyName!=="transform"||m||(m=!0,w(),u(n,!0))};return t.addEventListener("transitionend",$),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)`,y=window.setTimeout(()=>{m||(m=!0,w(),u(n,!0))},i+64),()=>{m||(m=!0,w(),u(s-yh(t),!1))}},Gi=300,xh=900,bh=1500,wh="cubic-bezier(0.16, 1, 0.3, 1)",Sh=3e3,$h=2,Ch=16,Th=.05,Lh=1,Mo=.3,Ih=50,Rh=20,ui=.004,Mi=["title1","title2","title3"],Eh={title1:"1",title2:"2",title3:"3"},Mh={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Ph={title1:.02,title2:.02,title3:.02},Po=e=>`max(${e}, ${Rh}px)`,kh=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]}},Ah=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=kh(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Lt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Fh=e=>[Lt(e,"fontFamily"),Lt(e,"fontSettings"),{type:"row",items:[Lt(e,"fontSize"),Lt(e,"lineHeight"),Lt(e,"letterSpacing"),Lt(e,"wordSpacing")]},Lt(e,"textAlign"),Lt(e,"textAppearance")],Wh=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Mi.map(e=>[Eh[e],Fh(e)]))}),La=(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},Bl=(e,t)=>La(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)},Ms=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:La(e.length,n),effective:Bl(e.length,n)}},_h=(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},kr=(e,t)=>{const n=i=>{const o=Lt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Mh[t]]}},Nh=(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),Ar=(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??Ph[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Bt(i,n)},Hh=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:m,imageGap:y,closeIcon:w,closeIconMaxWidth:$,closeIconColor:h,closeIconHoverColor:v,thumbnailTrigger:S,thumbnailVisibility:C,thumbnailObjectFit:E,thumbnailActive:M,thumbnailActiveColor:H,title1Width:x,title2Width:j,title3Width:P,title1MarginLeft:T=0,title2MarginLeft:G=0,title3MarginLeft:f=0,titleRowMarginBottom:A=0,titleHeaderLayout:_="desktop",contentMarginTop:V,iconMarginLeft:te}=n,ne=p=>N.scalingValue(p,i??!1),K=c??n.thumnailSize??.03,B=ne(K),F=ne(u),I=ne(m??.02),R=ne(y??0),U=ne(V??0),D=Po(U),ee=ne(te??0),[O,pe]=a.useState(0),g=a.useRef(O);g.current=O;const ue=t[O],{title1:me,title2:we,title3:_e}=Ah(ue),oe=Ar("title1",kr(n,"title1"),i),ye=Ar("title2",kr(n,"title2"),i),X=Ar("title3",kr(n,"title3"),i),be=_==="mobile",ce=!o&&(!i||l),ge=ce,se=ce,Ie=ce,Fe=Tn(E),he=Fe?{"--image-aspect-ratio":dr(E)}:void 0,Ce=!!(me||we||_e),W=a.useMemo(()=>_h(e,me,we,_e,oe,ye,X),[e,O,me,we,_e,oe,ye,X]),Q=a.useMemo(()=>({title1Width:x,title2Width:j,title3Width:P}),[x,j,P]),L=a.useMemo(()=>W.map(p=>Q[p.widthKey]),[W,Q]),Y=a.useMemo(()=>La(W.length,L),[W.length,L]),J=a.useMemo(()=>Bl(W.length,L),[W.length,L]),de=a.useMemo(()=>W.filter(p=>p.prefix==="title1"),[W]),le=a.useMemo(()=>W.filter(p=>p.prefix==="title2"||p.prefix==="title3"),[W]),ie=a.useMemo(()=>Ms(de,Q),[de,Q]),Re=a.useMemo(()=>Ms(le,Q),[le,Q]),Se=a.useCallback((p,b)=>{const k=W.indexOf(p);if(!be||b==="single-row")return{effectiveWidth:J[k]??0,resolvedWidth:Y[k]??0,maxWidth:ko(k,Y)};if(b==="two-row-top"){const xe=de.indexOf(p);return{effectiveWidth:ie.effective[xe]??0,resolvedWidth:ie.resolved[xe]??0,maxWidth:ko(xe,ie.resolved)}}const re=le.indexOf(p);return{effectiveWidth:Re.effective[re]??0,resolvedWidth:Re.resolved[re]??0,maxWidth:ko(re,Re.resolved)}},[le,Re,J,Y,W,de,ie,be]),z=a.useCallback(p=>N.scalingValue(p,i??!1),[i]),Te=z(A??0),Z=a.useMemo(()=>({title1MarginLeft:T,title2MarginLeft:G,title3MarginLeft:f}),[T,G,f]),fe=a.useCallback(p=>W.slice(0,p+1).reduce((b,k,re)=>b+(k!=null&&k.marginLeftKey?Z[k.marginLeftKey]??0:0)+(Y[re]??0),0)+(be?0:T??0),[W,Z,Y,be,T]),ve=a.useCallback(()=>be?0:T??0,[be,T]),ke=a.useCallback(p=>le.slice(0,p).reduce((b,k,re)=>b+(k.marginLeftKey?Z[k.marginLeftKey]??0:0)+(Re.resolved[re]??0),0),[le,Re.resolved,Z]),Qe=a.useCallback(p=>{const b=le[p];return ke(p)+(b.marginLeftKey?Z[b.marginLeftKey]??0:0)+(Re.resolved[p]??0)},[le,Re.resolved,ke,Z]),Xe=(p,b)=>{const k=p.marginLeftKey?Z[p.marginLeftKey]??0:0,{effectiveWidth:re,resolvedWidth:xe,maxWidth:We}=Se(p,b),Ge=o&&b==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":p.prefix,style:{...b==="single-row"?{gridArea:p.prefix}:{},width:z(re),...k>0?{marginLeft:z(k)}:{}},children:[r.jsx("p",{className:p.className,style:p.style,children:p.text}),Ge&&p.marginLeftKey&&r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe),style:{position:"absolute",top:0,left:z(-k),width:`max(${z(k)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Ge&&r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(We),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:z(-ui/2),width:z(ui),height:"100%",pointerEvents:"auto"}})]},p.className)},ht=()=>{const p=be?-1:W.findIndex(re=>re.prefix==="title1"),b=!be&&(o||(T??0)>0)?(()=>{const re=T??0,xe=p>=0?Y[p]:x??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe),style:{position:"absolute",top:0,left:0,width:`max(${z(re)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,k=W.flatMap((re,xe)=>{if(!re.marginLeftKey)return[];const We=Z[re.marginLeftKey]??0,Ge=Nh(W,Y,Z,xe)+ve();return r.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Y[xe]),style:{position:"absolute",top:0,left:z(Ge),width:`max(${z(We)}, 10px)`,height:"100%",pointerEvents:"auto"}},re.marginLeftKey)});return b?[b,...k]:k},xt=()=>W.map((p,b)=>{const k=ko(b,Y),xe=fe(b)-ui/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.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:z(xe),width:z(ui),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),It=()=>le.flatMap((p,b)=>{if(!p.marginLeftKey)return[];const k=Z[p.marginLeftKey]??0,re=ke(b),{resolvedWidth:xe}=Se(p,"two-row-bottom");return r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe),style:{position:"absolute",top:0,left:z(re),width:`max(${z(k)}, 10px)`,height:"100%",pointerEvents:"auto"}},p.marginLeftKey)}),Et=()=>le.map((p,b)=>{const{maxWidth:k}=Se(p,"two-row-bottom"),xe=Qe(b)-ui/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.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:z(xe),width:z(ui),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),wt=a.useRef(null),Ze=a.useRef(null),Ne=a.useRef(null),ot=a.useRef(null),dt=a.useRef([]),et=a.useRef([]),mt=a.useRef(0),ut=a.useRef(null),lt=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),_t=a.useRef(null),Mt=a.useRef(null),Be=a.useRef(0),ft=a.useRef("forward"),rt=a.useRef(0),Ye=a.useRef(null),St=a.useRef(!1),bt=t.length>1&&(!o||!!l),Yt=bt?3:1,sn=a.useMemo(()=>Array.from({length:Yt},()=>t).flat(),[t,Yt]),[Pt,gt]=a.useState(!1),[Jt,qt]=a.useState(!1),[Ft,Ot]=a.useState(!0),Gt=a.useRef(null),Le=a.useRef(null),Ae=a.useRef(!1),ze=a.useRef(!1),Je=a.useRef(null),Oe=a.useRef(null),st=ge&&!Ft,Me=a.useCallback(()=>{ge&&(Ot(!0),Oe.current&&clearTimeout(Oe.current),Oe.current=setTimeout(()=>{lt.current.isActive||Ot(!1)},Sh))},[ge]),tt=a.useCallback(()=>{o||ze.current||(ze.current=!0,qt(!1),Je.current=setTimeout(()=>{s()},Gi))},[o,s]),Ke=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":st?"true":"false",style:{width:N.scalingValue($??0,i),height:N.scalingValue($??0,i),marginRight:ee,"--close-icon-hover-color":v},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:tt,"aria-label":"Close",children:r.jsx(on,{url:w,fill:h,hoverFill:i&&!l?h:v,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:ee,height:"100%",pointerEvents:"auto"}})]}),Ct=(p="two-row")=>r.jsx("div",{...p==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:z(T??0),flexShrink:0,...p==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...p==="two-row"&&o?{pointerEvents:"auto"}:{}}}),vt=()=>{const p=W.find(re=>re.prefix==="title1"),b=W.filter(re=>re.prefix==="title2"||re.prefix==="title3"),k=b.length>0||o||(A??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(T??0)>0||o?Ct():null,p&&Xe(p,"two-row-top"),w&&Ke()]}),k?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[b.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[b.map(re=>Xe(re,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[It(),Et()]})]}):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:Te,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},kt=()=>r.jsxs(r.Fragment,{children:[(T??0)>0||o?Ct("single-row"):null,W.map(p=>Xe(p,"single-row")),o?r.jsxs(r.Fragment,{children:[ht(),xt()]}):null,w?Ke():null]}),Tt=a.useCallback(p=>!!(p.closest("[data-controls]")||p.closest(`.${e}-thumbnails`)||p.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ae,backdropStyle:Pe,mediaAreaStyle:He,overlayContentStyle:Ve,swipeHandlers:yt,dismissAreaStyle:nt}=Ol({enabled:ce??!1,onClose:tt,animMs:Gi,isBlockedTarget:Tt}),qe=()=>{if(!bt||t.length===0)return mt.current=0,0;const p=et.current[0],b=et.current[t.length];if(!p||!b)return mt.current;const k=b.offsetLeft-p.offsetLeft;return k>0&&(mt.current=k),mt.current},De=(p=!1)=>{if(!bt)return;const b=Ze.current,k=qe();!b||k<=0||k<b.clientWidth*.25||(b.scrollLeft<=0?(b.scrollLeft+=k,p&&(lt.current.scrollLeft+=k),St.current&&(rt.current+=k)):b.scrollLeft>=k*2&&(b.scrollLeft-=k,p&&(lt.current.scrollLeft-=k),St.current&&(rt.current-=k)))},$t=(p,b=(k=>(k=Ze.current)==null?void 0:k.scrollLeft)()??0)=>{if(!bt)return p;let re=t.length+p,xe=1/0;for(let We=0;We<Yt;We++){const Ge=We*t.length+p,ct=et.current[Ge];if(!ct)continue;const jt=Math.abs(ct.offsetLeft-b);jt<xe&&(xe=jt,re=Ge)}return re},At=p=>{const b=Ze.current;return!p||!b?!1:p.offsetWidth>b.clientWidth+1},Dt=p=>{const b=Ze.current;if(!p||!b||!At(p))return!1;const k=p.offsetLeft,re=k+p.offsetWidth;return b.scrollLeft>=k-1&&b.scrollLeft+b.clientWidth<=re+1},Vt=(p=(b=>(b=Ze.current)==null?void 0:b.scrollLeft)()??0)=>{for(let re=0;re<et.current.length;re+=1){const xe=et.current[re];if(xe&&Dt(xe))return re}let k={flatIndex:0,distance:1/0};return et.current.forEach((re,xe)=>{if(!re)return;const We=Math.abs(re.offsetLeft-p);We<k.distance&&(k={flatIndex:xe,distance:We})}),k.flatIndex},Rn=p=>{Ze.current&&et.current.forEach(b=>{b&&(b.style.scrollSnapAlign=At(b)&&p==="backward"?"end":"start")})},ai=(p,b,k)=>{const re=p-b,xe=Vt(b),We=et.current[xe];if(Dt(We))return Vt(p)%t.length;const Ge=et.current[xe+1],ct=We?Ge?Ge.offsetLeft-We.offsetLeft:We.offsetWidth:0,jt=ct>0?re>ct*Mo?1:re<-ct*Mo?-1:0:0;return jt===0?k:bt?(k+jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,k+jt))},si=a.useCallback((p=!1)=>{if(C!=="on"||o)return;const b=ot.current,k=g.current,re=dt.current[k];if(!b||!re||b.scrollWidth<=b.clientWidth)return;const xe=b.scrollLeft,We=xe+b.clientWidth,Ge=re.offsetLeft,ct=Ge+re.offsetWidth;if(Ge>=xe&&ct<=We)return;const jt=b.scrollWidth-b.clientWidth;let Nt=xe;if(!p&&Gt.current===null){const ci=dt.current[k-1],Hi=dt.current[k+1],xo=ci?re.offsetLeft-ci.offsetLeft:Hi?Hi.offsetLeft-re.offsetLeft:re.offsetWidth;ct>We?Nt+=xo:Ge<xe&&(Nt-=xo)}else ct>We?Nt=ct-b.clientWidth:Nt=Ge;b.scrollLeft=Math.max(0,Math.min(jt,Nt))},[o,C]),Ni=a.useCallback((p=!1)=>{p&&(Ae.current=!0),Le.current===null&&(Le.current=requestAnimationFrame(()=>{Le.current=null;const b=Ae.current;Ae.current=!1,si(b)}))},[si]),ur=a.useCallback(p=>{if(p===g.current)return;const b=g.current;g.current=p;const k=Math.abs(p-b)>1,re=bt&&t.length>1&&(b===t.length-1&&p===0||b===0&&p===t.length-1);pe(p),Ni(k||re)},[t.length,bt,Ni]),ln=()=>{if(!Ze.current||t.length===0||Gt.current!==null||lt.current.isActive&<.current.hasMoved)return;const p=Ze.current.scrollLeft,b=Vt(p)%t.length;b!==g.current&&ur(b)},go=()=>{Gt.current=null},cn=p=>{const b=Ze.current;b&&(b.style.scrollSnapType=p?"":"none")},vn=()=>{var p;(p=Mt.current)==null||p.call(Mt),Mt.current=null},En=()=>{Ye.current!==null&&(cancelAnimationFrame(Ye.current),Ye.current=null),St.current=!1},Dn=()=>{const p=Ze.current;if(!p){Ye.current=null,St.current=!1;return}const b=rt.current-p.scrollLeft;if(Math.abs(b)<.5){p.scrollLeft=rt.current,De(),ln(),Ye.current=null,St.current=!1;return}p.scrollLeft+=b*Th,De(),ln(),Me(),Ye.current=requestAnimationFrame(Dn)},Vn=()=>{const p=Ne.current;p&&(p.style.transition="",p.style.transform="",p.style.willChange="")},ho=(p,b,k,re)=>{Vn(),p.scrollLeft=b,Be.current=p.scrollLeft,De(),k!==void 0?(g.current=k,pe(k)):ln(),cn(!0),re==null||re()},fo=(p,{behavior:b="smooth",activeIndex:k,onComplete:re}={})=>{const xe=Ze.current,We=Ne.current;if(!xe||!We)return;if(En(),vn(),cn(!1),b==="auto"){ho(xe,p,k,re);return}const Ge=Math.abs(p-xe.scrollLeft),ct=hh(Ge,xh,bh,xe.clientWidth*.55);Mt.current=vh(xe,We,p,{duration:ct,easing:wh,onComplete:()=>{Mt.current=null,ho(xe,p,k,re)}})},pr=(p="smooth")=>{const b=Ze.current;if(!b||t.length===0)return;const k=Vt()%t.length,re=$t(k,b.scrollLeft),xe=et.current[re];xe&&fo(xe.offsetLeft,{behavior:p,activeIndex:k})},mr=(p,b="smooth",k,re)=>{const xe=Ze.current;if(!xe||t.length===0)return;const We=(re??xe.scrollLeft)-p,Ge=Vt(p),ct=et.current[Ge];if(Dt(ct)){cn(!0),ln();return}const jt=et.current[Ge+1],Nt=ct?jt?jt.offsetLeft-ct.offsetLeft:ct.offsetWidth:0;if((Nt>0?We>Nt*Mo?1:We<-Nt*Mo?-1:0:0)!==0){const Vl=k??Ge%t.length,ql=ai(re??xe.scrollLeft,p,Vl);mn(ql,b);return}const Hi=re??xe.scrollLeft,xo=Vt(Hi),Ia=et.current[xo];if(Ia&&Math.abs(Ia.offsetLeft-Hi)<1){cn(!0),ln();return}pr("auto")},mn=(p,b="smooth")=>{const k=Ze.current;if(!k||t.length===0)return;const re=$t(p,k.scrollLeft),xe=et.current[re];xe&&(b==="smooth"?Gt.current=p:Gt.current=null,g.current=p,pe(p),Ni(!0),fo(xe.offsetLeft,{behavior:b,activeIndex:p,onComplete:b==="smooth"?go:void 0}))},li=()=>{_t.current&&(window.removeEventListener("pointerup",_t.current),window.removeEventListener("pointercancel",_t.current),_t.current=null)},yo=(p,b,k,re,xe)=>{const We=k-p,Ge=re-b,ct=Math.abs(We),jt=Math.abs(Ge);if(ct<Ih||ct<=jt)return!1;const Nt=We<0?1:-1,ci=bt?(xe+Nt+t.length)%t.length:Math.max(0,Math.min(t.length-1,xe+Nt));return ci===xe?!1:(mn(ci),!0)},qn=p=>{if(!lt.current.isActive)return;li();const b=Ze.current;if(!b)return;const{scrollLeft:k,startActiveIndex:re,hasMoved:xe}=lt.current,We=b.scrollLeft;De(!0),lt.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},gt(!1),p!==void 0&&b.hasPointerCapture(p)&&b.releasePointerCapture(p),xe?mr(k,"smooth",re,We):(cn(!0),ln()),Me()},vo=(p,b)=>{const k=ut.current;ut.current=null,k&&(yo(k.startX,k.startY,p,b,k.startActiveIndex),Me())},gr=p=>{if(!se)return;if(p.pointerType==="touch"){if(En(),cn(!0),Tt(p.target))return;ut.current={startX:p.clientX,startY:p.clientY,startActiveIndex:g.current};return}if(p.pointerType!=="mouse"||p.button!==0||Tt(p.target))return;const b=Ze.current;if(!b)return;En(),vn(),Vn(),Gt.current=null,lt.current={isActive:!0,startX:p.clientX,scrollLeft:b.scrollLeft,startActiveIndex:g.current,hasMoved:!1},cn(!1),Me(),b.setPointerCapture(p.pointerId),li();const k=re=>{re.pointerType==="mouse"&&qn(re.pointerId)};_t.current=k,window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k)},hr=p=>{if(!se||p.pointerType!=="mouse")return;const b=Ze.current;if(!b||!lt.current.isActive)return;if(p.buttons===0){qn(p.pointerId);return}const k=p.clientX-lt.current.startX;Math.abs(k)>Lh&&(lt.current.hasMoved=!0,gt(!0)),lt.current.hasMoved&&(p.preventDefault(),b.scrollLeft=lt.current.scrollLeft-k,De(!0),ln(),Me())},q=p=>{if(se){if(p.pointerType==="touch"){p.type==="pointerup"?vo(p.clientX,p.clientY):ut.current=null;return}p.pointerType==="mouse"&&qn(p.pointerId)}},$e=p=>{!se||p.pointerType!=="mouse"||qn(p.pointerId)};return jl(),a.useEffect(()=>{const p=requestAnimationFrame(()=>qt(!0));return()=>{cancelAnimationFrame(p),vn(),li(),Le.current!==null&&(cancelAnimationFrame(Le.current),Le.current=null),Je.current&&clearTimeout(Je.current),Oe.current&&clearTimeout(Oe.current)}},[]),a.useEffect(()=>{if(!ge){Ot(!0);return}Me();const p=wt.current;if(!p)return;const b=()=>Me();return p.addEventListener("pointermove",b),p.addEventListener("pointerdown",b),()=>{p.removeEventListener("pointermove",b),p.removeEventListener("pointerdown",b),Oe.current&&clearTimeout(Oe.current)}},[ge,Me]),a.useEffect(()=>{const p=b=>{b.key==="Escape"&&tt()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[tt]),a.useLayoutEffect(()=>{qe()},[R,t.length,bt]),a.useLayoutEffect(()=>{o||mn(g.current,"auto")},[R,o]),a.useLayoutEffect(()=>{mn(0,"auto")},[t.length,bt]),a.useEffect(()=>{const p=Ze.current;if(!p||o||!ce)return;const b=k=>{if(k.preventDefault(),Math.abs(k.deltaY)<=Math.abs(k.deltaX))return;const re=k.deltaMode===1?Ch:k.deltaMode===2?p.clientHeight:1,xe=k.deltaY*re*$h;if(xe!==0){if(vn(),St.current||(St.current=!0,rt.current=p.scrollLeft,Gt.current=null,cn(!1)),rt.current+=xe,!bt){const We=p.scrollWidth-p.clientWidth;rt.current=Math.max(0,Math.min(We,rt.current))}Me(),Ye.current===null&&(Ye.current=requestAnimationFrame(Dn))}};return p.addEventListener("wheel",b,{passive:!1}),()=>{p.removeEventListener("wheel",b),En()}},[o,ce,bt]),a.useEffect(()=>{const p=Ze.current;if(!p)return;const b=()=>{De(lt.current.isActive);const re=p.scrollLeft,xe=re-Be.current;Be.current=re;const We=mt.current>0?mt.current*.5:1/0;if(xe!==0&&Math.abs(xe)<We){const Ge=xe>0?"forward":"backward";Ge!==ft.current&&(ft.current=Ge,Rn(Ge))}lt.current.isActive&<.current.hasMoved||ln()};p.addEventListener("scroll",b,{passive:!0});const k=new ResizeObserver(()=>{qe(),De(lt.current.isActive),Rn(ft.current),ln()});return k.observe(p),()=>{vn(),p.removeEventListener("scroll",b),k.disconnect()}},[t.length,bt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ae||tt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Jt?1:0,transition:`opacity ${Gi}ms ease`,pointerEvents:Jt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Pe}}),r.jsxs("div",{ref:wt,className:`${e}-lightbox-dismiss-area`,style:nt,...yt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:He,onClick:p=>p.stopPropagation(),children:r.jsx("div",{ref:Ze,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":se&&t.length>0?"true":"false","data-mouse-dragging":Pt?"true":"false",onPointerDown:gr,onPointerMove:hr,onPointerUp:q,onPointerCancel:q,onLostPointerCapture:$e,children:r.jsx("div",{ref:Ne,className:`${e}-lightbox-strip-track`,style:{gap:R},children:sn.map((p,b)=>{const k=p.image.objectFit??"contain",re=b%t.length,xe=Math.floor(b/t.length),We=Po(R),Ge=`calc(-0.5 * (${We} + ${R}))`;return r.jsxs("div",{ref:ct=>et.current[b]=ct,className:`${e}-strip-item`,style:{height:_==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:p.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:k}}),o&&re<t.length-1&&xe===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ge,width:We,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${xe}-${p.image.url}-${re}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":st?"true":"false",style:Ve,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:U,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:D,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${be?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ce||w)&&r.jsx("div",{className:`${e}-header ${be?`${e}-header-two-row`:`${e}-header-single-row`}`,children:be?vt():Ce||w?kt():null})})})]}),t.length>1&&C==="on"&&(()=>{const p=Po(I),b=`calc(-0.5 * (${I} + ${p}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:I},children:r.jsx("div",{ref:ot,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:k=>k.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":M,style:{gap:F,"--thumbnail-active-color":H},children:[t.map((k,re)=>{const xe=Po(F),We=`calc(-0.5 * (${xe} + ${F}))`;return r.jsxs("div",{ref:Ge=>{dt.current[re]=Ge},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":O===re?"true":"false",onClick:()=>ce&&S==="click"&&mn(re),onMouseEnter:()=>Ie&&S==="hover"&&mn(re),"aria-label":k.image.name?`View ${k.image.name}`:`View image ${re+1}`,"aria-current":O===re?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${Fe?` ${e}-thumb-image-cover`:""}`,src:k.image.url,alt:"",draggable:!1,style:{...he,maxWidth:B,maxHeight:B,width:E.display==="cover"?"auto":"100%",height:"auto",objectFit:E.display==="cover"?"cover":"contain"}})}),o&&re<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:We,width:xe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${k.image.url}-${re}`)}),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:b,height:p,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Oh(e){return`
|
|
12638
12816
|
.${e}-wrapper {
|
|
12639
12817
|
position: relative;
|
|
12640
12818
|
width: 100%;
|
|
@@ -12860,7 +13038,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
12860
13038
|
background-color: transparent;
|
|
12861
13039
|
padding: 0;
|
|
12862
13040
|
opacity: 1;
|
|
12863
|
-
transition: opacity ${
|
|
13041
|
+
transition: opacity ${Gi}ms ease;
|
|
12864
13042
|
}
|
|
12865
13043
|
|
|
12866
13044
|
.${e}-close-icon[data-overlay-content-hidden="true"] {
|
|
@@ -12985,7 +13163,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
12985
13163
|
display: flex;
|
|
12986
13164
|
flex-direction: column;
|
|
12987
13165
|
opacity: 1;
|
|
12988
|
-
transition: opacity ${
|
|
13166
|
+
transition: opacity ${Gi}ms ease;
|
|
12989
13167
|
}
|
|
12990
13168
|
|
|
12991
13169
|
.${e}-lightbox-content-inner[data-overlay-content-hidden="true"] {
|
|
@@ -13026,7 +13204,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
13026
13204
|
pointer-events: auto;
|
|
13027
13205
|
z-index: 10;
|
|
13028
13206
|
}
|
|
13029
|
-
`}const
|
|
13207
|
+
`}const jh=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=N.useScopedStyles(),{cover:d,coverFit:c}=e,u=a.useRef(null),[m,y]=a.useState(!1),w=t??[],$=m&&w.length>0,h=()=>{w.length!==0&&y(!0)};return a.useEffect(()=>{!n||i||o||y(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:u,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Oh(s)}}),d&&r.jsx("div",{className:`${s}-cover ${Tn(c)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...Tn(c)?{"--image-aspect-ratio":dr(c)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${s}-cover-image ${Tn(c)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:d,alt:"cover"})})]}),$&&typeof document<"u"&&(()=>{const v=(l?document.getElementById(l):null)??document.body;return Pi.createPortal(r.jsx(Hh,{prefix:s,images:w,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>y(!1)}),v)})()]})},Bh=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
13030
13208
|
import { createPortal } from 'react-dom';
|
|
13031
13209
|
import { CommonComponentProps } from '../props';
|
|
13032
13210
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -13580,7 +13758,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
13580
13758
|
</>
|
|
13581
13759
|
);
|
|
13582
13760
|
};
|
|
13583
|
-
`,Nh="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>'),Qn={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 Hh(e){const t={};return t[xt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSettings")]={...Qn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSize")]={...Qn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[xt(e,"lineHeight")]={...Qn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[xt(e,"letterSpacing")]={...Qn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[xt(e,"wordSpacing")]={...Qn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[xt(e,"textAlign")]={...Qn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[xt(e,"textAppearance")]={...Qn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Oh=Ri.reduce((e,t)=>({...e,...Hh(t)}),{}),jh=Ri.reduce((e,t)=>({...e,[xt(t,"fontFamily")]:"Goudy Bookletter 1911",[xt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[xt(t,"letterSpacing")]:0,[xt(t,"wordSpacing")]:0,[xt(t,"textAlign")]:"left",[xt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Is(e){return Ri.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[xt(n,"fontSize")]=i),o!==void 0&&(t[xt(n,"lineHeight")]=o),t},{})}const Bh=Mh(),zh={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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up"]}},thumbnailActiveColor:{type:"string",scope:"common",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},...Oh,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/lightbox_strip_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Nh,closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",...jh},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,backgroundColor:"#FFFFFF",contentMarginTop:.08,iconMarginLeft:.02,...Is({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,backgroundColor:"#FFFFFF",contentMarginTop:.015,iconMarginLeft:.02,...Is({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:[Bh]}],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/lightbox_strip_2.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_3.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_4.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_5.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_6.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_7.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"}]}},Dh={element:Fh,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:zh,sourceCode:_h,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Ri.map(e=>({path:`${xt(e,"fontFamily")}`}))]},fontRelations:{...Ri.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${xt(t,"fontFamily")}`}),{})}},Vh=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,initialSlideIndex:s=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:m})=>{const{type:y,coverFit:E,backgroundColor:T,imageGap:h,maxWidth:v,maxHeight:I,textTransition:L,title1Width:R,title2Width:P,title3Width:O,title1MarginLeft:x=0,title2MarginLeft:N=0,title3MarginLeft:k=0,titleRowMarginBottom:$=0,titleHeaderLayout:q="single-row",countCloseGap:f=0,closeIcon:M,closeIconMaxWidth:_,closeIconColor:j,closeIconHoverColor:te,contentMarginTop:ie=0,iconMarginRight:G=0}=n,z=a.useCallback(V=>F.scalingValue(V,i??!1),[i]),H=z(h??0),W=`${v}%`,S=`${I}%`,K=z(f),J=z(ie),Q=z(G),D=ni("title1",ti(n,"title1"),i),ue=ni("title2",ti(n,"title2"),i),g=ni("title3",ti(n,"title3"),i),pe=ni("count",ti(n,"count"),i),fe=q==="mobile",ve=!i||!!l,Ne=!o&&(!i||!!l),ne=a.useMemo(()=>_o(t,y),[t,y]),[ge,ee]=a.useState(s),be=ne[ge],ce=be==null?void 0:be.entry,[oe,Z]=a.useState(!1),[Ce,Le]=a.useState(null),[$e,ke]=a.useState(!1),[b,re]=a.useState(null),[C,U]=a.useState(!1),[X,se]=a.useState(0),[le,ye]=a.useState(),[We,Me]=a.useState(),[B,we]=a.useState(null),Y=a.useRef(null),me=a.useRef(0),Te=a.useRef(0),He=a.useRef(0),Ze=a.useRef(!1),je=a.useRef(null),Ke=a.useRef(null),ct=a.useRef(null),ft=a.useRef(null),bt=a.useRef(null),Ct=a.useRef(null),Qe=a.useRef(null),Be=a.useCallback(()=>{const V=Ke.current;if(!V)return;const Se=V.closest(`.${e}-lightbox-content-area`);if(!Se)return V.getBoundingClientRect().width;const p=Array.from(Se.children).reduce((w,A)=>!(A instanceof HTMLElement)||A.contains(V)?w:w+A.getBoundingClientRect().width,0);return Se.getBoundingClientRect().width-p},[e]),Je=a.useCallback(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null)},[]),ut=a.useCallback(V=>{V===me.current&&(re(null),U(!1))},[]),et=a.useCallback(()=>{o||Ze.current||(Ze.current=!0,u==null||u(),Z(!1),je.current=setTimeout(()=>{m()},300))},[o,u,m]),It=a.useCallback(V=>!!(V.closest("[data-controls]")||V.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:yt,backdropStyle:ot,mediaAreaStyle:Wt,overlayContentStyle:jt,swipeHandlers:Ue,dismissAreaStyle:$t}=_l({enabled:Ne,onClose:et,animMs:300,isBlockedTarget:It}),Ge=a.useCallback(V=>{d&&vl(V+1,c,!0)},[d,c]),tt=a.useCallback(V=>{if(V)return V.getBoundingClientRect().height},[]),pt=a.useCallback(V=>{if(ne.length===0)return;const Se=(V%ne.length+ne.length)%ne.length;if(Se===ge)return;const p=ne[ge],w=ne[Se];me.current+=1;const A=me.current,ae=L==="fade"&&ts(p==null?void 0:p.entry)!==ts(w==null?void 0:w.entry),xe=tt(ct.current),Pe=ae?(()=>{const at=Be();Mi.flushSync(()=>{we(w.entry)}),ct.current&&at&&(ct.current.style.width=`${at}px`);const Ht=tt(ct.current);return ct.current&&(ct.current.style.width=""),{measuredIncomingTitlesHeight:Ht,incomingTitlesMeasureWidth:at}})():void 0,Xe=Math.max(xe??0,(Pe==null?void 0:Pe.measuredIncomingTitlesHeight)??0)||void 0;se(A),re(ge),U(!0),ee(Se),Ge(Se),He.current=Se,ae?(Je(),Xe&&ye(Xe),Pe!=null&&Pe.incomingTitlesMeasureWidth&&Me(Pe.incomingTitlesMeasureWidth),Le((p==null?void 0:p.entryIndex)??null),ke(!0),Te.current=w.entryIndex,Y.current=setTimeout(()=>{Le(null),ke(!1),ye(void 0),Me(void 0),we(null),Y.current=null},400)):(Je(),Le(null),ke(!1),ye(void 0),Me(void 0),we(null),Te.current=w.entryIndex)},[ge,Je,Be,tt,ne,Ge,L]),rt=a.useCallback(()=>{Qe.current=null},[]),Kt=a.useCallback(V=>{!ve||ne.length<=1||V.pointerType==="mouse"&&V.button!==0||V.target.closest("[data-controls]")||(Qe.current={startX:V.clientX,startY:V.clientY,pointerId:V.pointerId})},[ve,ne.length]),rn=a.useCallback(V=>{var at;if(!ve||ne.length<=1||V.pointerType==="mouse"&&V.button!==0)return;if(yt){rt();return}const Se=Qe.current;if(!Se||Se.pointerId!==V.pointerId||(rt(),V.target.closest("[data-controls]")))return;const w=V.clientX-Se.startX,A=V.clientY-Se.startY,ae=Math.abs(w),xe=Math.abs(A);if(ae>=dm&&ae>xe){pt(w>0?ge-1:ge+1);return}if(ae>Ja||xe>Ja)return;const Pe=(at=ft.current)==null?void 0:at.getBoundingClientRect(),Xe=Pe?Pe.left+Pe.width/2:window.innerWidth/2;pt(V.clientX<Xe?ge-1:ge+1)},[ge,ve,pt,yt,rt,ne.length]),gn=a.useCallback(V=>{const Se=Qe.current;(Se==null?void 0:Se.pointerId)===V.pointerId&&rt()},[rt]);Nl(),a.useEffect(()=>{Ct.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const V=requestAnimationFrame(()=>{Z(!0),requestAnimationFrame(()=>{bt.current?bt.current.focus():ft.current&&ft.current.focus()})});return()=>{cancelAnimationFrame(V),je.current&&clearTimeout(je.current),Y.current&&clearTimeout(Y.current);const Se=Ct.current;Se&&document.contains(Se)&&Se.focus()}},[]),a.useEffect(()=>{var V;L!=="fade"&&(Te.current=((V=ne[ge])==null?void 0:V.entryIndex)??0,Je(),Le(null),ke(!1),ye(void 0),Me(void 0))},[ge,Je,ne,L]),a.useEffect(()=>{const V=Se=>{if(Se.key==="Escape"){et();return}if(Se.key==="ArrowLeft"&&ne.length>1){pt(ge-1);return}if(Se.key==="ArrowRight"&&ne.length>1){pt(ge+1);return}if(Se.key==="Tab"&&ft.current){const p=ft.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),w=Array.from(p).filter(Pe=>!Pe.closest('[aria-hidden="true"]'));if(w.length===0)return;const A=w[0],ae=w[w.length-1],xe=document.activeElement;Se.shiftKey?(xe===A||!ft.current.contains(xe))&&(Se.preventDefault(),ae.focus()):(xe===ae||!ft.current.contains(xe))&&(Se.preventDefault(),A.focus())}};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[pt,et,ge,ne.length]),a.useLayoutEffect(()=>{Je(),me.current=0,se(0),re(null),U(!1),Le(null),ke(!1),ye(void 0),Me(void 0),we(null),ee(V=>{const Se=Math.max(0,ne.length-1);return Math.min(V,Se)})},[Je,t.length,y,ne.length]),a.useLayoutEffect(()=>{var p;const V=Math.max(0,ne.length-1),Se=Math.min(Math.max(0,s),V);He.current=Se,Te.current=((p=ne[Se])==null?void 0:p.entryIndex)??0,ee(Se)},[s]);const mt=Ce!==null?t[Ce]:null,Dt=b!==null?ne[b]:null,Rt=(ce==null?void 0:ce.title1)||(ce==null?void 0:ce.title2)||(ce==null?void 0:ce.title3)||(mt==null?void 0:mt.title1)||(mt==null?void 0:mt.title2)||(mt==null?void 0:mt.title3),he=vm(y,ne,t),Ae=M!==null,ze=Rt||he||Ae,de=he&&Ae?{gap:K}:void 0,Ie=`${e}-titles-stack${fe?` ${e}-titles-stack-stacked`:""}`,_e=`${e}-titles-layer-out${fe?` ${e}-titles-layer-out-stacked`:""}`,Re=`${e}-titles-layer-out`,qe=(x??0)>0||o,gt=z($),Fe=a.useMemo(()=>({title1Width:R??vi.title1Width,title2Width:P??vi.title2Width,title3Width:O??vi.title3Width}),[R,P,O]),De=a.useMemo(()=>({title2MarginLeft:N,title3MarginLeft:k}),[N,k]),Ve=a.useMemo(()=>ce?Nn(e,ce,D,ue,g):[],[e,ce,D,ue,g]),st=a.useMemo(()=>Ve.map(V=>Fe[V.widthKey]),[Ve,Fe]),dt=a.useMemo(()=>Ci(Ve.length,st),[Ve.length,st]),Tt=a.useMemo(()=>Ji(Ve.length,st),[Ve.length,st]),Mt=a.useMemo(()=>Ve.filter(V=>V.prefix==="title1"),[Ve]),St=a.useMemo(()=>Ve.filter(V=>V.prefix==="title2"||V.prefix==="title3"),[Ve]),Bt=a.useMemo(()=>Hn(Mt,Fe),[Mt,Fe]),_t=a.useMemo(()=>Hn(St,Fe),[St,Fe]),Nt=a.useCallback((V,Se)=>{const p=Ve.findIndex(A=>A.prefix===V.prefix);if(!fe||Se==="single-row")return{effectiveWidth:Tt[p]??0,resolvedWidth:dt[p]??0,maxWidth:qt(p,dt)};if(Se==="two-row-top"){const A=Mt.findIndex(ae=>ae.prefix===V.prefix);return{effectiveWidth:Bt.effective[A]??0,resolvedWidth:Bt.resolved[A]??0,maxWidth:qt(A,Bt.resolved)}}const w=St.findIndex(A=>A.prefix===V.prefix);return{effectiveWidth:_t.effective[w]??0,resolvedWidth:_t.resolved[w]??0,maxWidth:qt(w,_t.resolved)}},[Ve,St,_t,Tt,dt,Mt,Bt,fe]),an=a.useCallback(V=>Sl(Ve,dt,De,V)+(fe?0:x??0),[Ve,dt,De,fe,x]),ht=a.useCallback(()=>fe?0:x??0,[fe,x]),Ft=a.useCallback(V=>St.slice(0,V).reduce((Se,p,w)=>Se+(p.marginLeftKey?De[p.marginLeftKey]??0:0)+(_t.resolved[w]??0),0),[St,_t.resolved,De]),Et=a.useCallback(V=>{const Se=St[V];return Ft(V)+(Se.marginLeftKey?De[Se.marginLeftKey]??0:0)+(_t.resolved[V]??0)},[St,_t.resolved,Ft,De]),Xt=a.useCallback((V,Se,p)=>{if(!fe||p==="single-row"){const Pe=V.findIndex(kt=>kt.prefix===Se.prefix),Xe=V.map(kt=>Fe[kt.widthKey]),at=Ci(V.length,Xe);return{effectiveWidth:Ji(V.length,Xe)[Pe]??0,resolvedWidth:at[Pe]??0,maxWidth:qt(Pe,at)}}if(p==="two-row-top"){const Pe=V.filter(kt=>kt.prefix==="title1"),Xe=Pe.findIndex(kt=>kt.prefix===Se.prefix),{resolved:at,effective:Ht}=Hn(Pe,Fe);return{effectiveWidth:Ht[Xe]??0,resolvedWidth:at[Xe]??0,maxWidth:qt(Xe,at)}}const w=V.filter(Pe=>Pe.prefix==="title2"||Pe.prefix==="title3"),A=w.findIndex(Pe=>Pe.prefix===Se.prefix),{resolved:ae,effective:xe}=Hn(w,Fe);return{effectiveWidth:xe[A]??0,resolvedWidth:ae[A]??0,maxWidth:qt(A,ae)}},[Fe,fe]),sn=(V,Se,p)=>{const w=V.marginLeftKey?De[V.marginLeftKey]??0:0,{effectiveWidth:A,resolvedWidth:ae,maxWidth:xe}=p??Nt(V,Se),Pe=Math.max(w,_n),Xe=o&&Se==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":V.prefix,style:{width:z(A),...w>0?{marginLeft:z(w)}:{}},children:[r.jsx("p",{className:V.className,style:V.style,children:V.text}),Xe&&V.marginLeftKey?r.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ae),style:{position:"absolute",top:0,left:z(-w),width:z(Pe),height:"100%",pointerEvents:"auto"}}):null,Xe?r.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(xe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:z(-Zt/2),width:z(Zt),height:"100%",pointerEvents:"auto"}}):null]},V.className)},vt=(V="two-row")=>{const Se=Ve.findIndex(A=>A.prefix==="title1"),p=Se>=0?dt[Se]:Fe.title1Width,w=V==="two-row"&&o;return r.jsx("div",{...w?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p)}:{},style:{width:z(x??0),flexShrink:0,alignSelf:"stretch",...w?{pointerEvents:"auto"}:{}}})},Pt=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:D,"aria-hidden":"true",children:" "}),Ut=()=>r.jsx("span",{className:`${e}-entry-counter`,style:pe,"aria-live":"polite","aria-atomic":"true",children:ym(ne,ge,y,t)}),ln=()=>he?o&&Ae?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ut(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Cr(K)} + ${K}))`,width:Cr(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ut():null,Mn=()=>!he&&!Ae?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:de,children:[ln(),Ae?cn():null]}),_i=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[he||Rt?Pt():null,qe?vt("single-row"):null,dn(ce),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Mn(),hn()]}),cr=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[he||Rt?Pt():null,qe?vt("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:$e&&le?{minHeight:le}:void 0,children:[r.jsx("div",{ref:ct,className:Ie,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Gn(B||ce)}),r.jsxs("div",{ref:Ke,className:Ie,style:{position:$e?"absolute":"relative",inset:$e?0:void 0,width:"100%",...$e&&We?{width:We,maxWidth:"100%"}:void 0},children:[mt&&$e?r.jsx("div",{className:`${_e} ${e}-titles-fade-out`,children:Gn(mt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${$e?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Gn(ce)})]})]}),Mn(),hn()]}),cn=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(_??0,i),height:F.scalingValue(_??0,i),marginRight:Q,"--close-icon-hover-color":te},children:[r.jsx("button",{ref:bt,type:"button",className:`${e}-close-icon-inner`,onClick:et,"aria-label":"Close",children:r.jsx(tn,{url:M??"",fill:j,hoverFill:i&&!l?j:te,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:Q,height:"100%",pointerEvents:"auto"}})]}),po=(V,Se)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[he||Rt?Pt():null,qe?vt("two-row"):null,Se!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Se},children:V}):r.jsxs(r.Fragment,{children:[V,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Mn()]}),dn=V=>{if(!V)return null;const Se=Nn(e,V,D,ue,g);return r.jsx(r.Fragment,{children:Se.map(p=>sn(p,"single-row",Xt(Se,p,"single-row")))})},xn=V=>{if(!V)return null;const Se=Nn(e,V,D,ue,g),p=Se.find(w=>w.prefix==="title1");return p?sn(p,"two-row-top",Xt(Se,p,"two-row-top")):null},Pn=(V,Se=!1)=>{const p=V?Nn(e,V,D,ue,g):[],w=p.filter(xe=>xe.prefix==="title2"||xe.prefix==="title3"),A=o&&Se;return w.length>0||A||($??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[w.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[w.map(xe=>sn(xe,"two-row-bottom",Xt(p,xe,"two-row-bottom"))),Se&&o?r.jsxs(r.Fragment,{children:[dr(),ur()]}):null]}):null,($??0)>0||A?r.jsx("div",{"data-controls":A?"titleRowMarginBottom":void 0,"data-controls-axis":A?"y":void 0,"data-controls-reverse":A?"":void 0,className:A?`${e}-control`:void 0,style:{height:gt,width:"100%",flexShrink:0,pointerEvents:A?"auto":"none"}}):null]}):null},qn=(V,Se=!1)=>r.jsxs(r.Fragment,{children:[po(xn(V)),Pn(V,Se)]}),Gn=V=>fe?r.jsx("div",{className:`${e}-titles-row-two-row`,children:qn(V)}):V?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:dn(V)}):null,mo=()=>{const V=fe?-1:Ve.findIndex(w=>w.prefix==="title1"),Se=!fe&&(o||(x??0)>0)?(()=>{const w=x??0,A=V>=0?dt[V]:Fe.title1Width,ae=Math.max(w,_n);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(A),style:{position:"absolute",top:0,left:0,width:z(ae),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,p=Ve.flatMap((w,A)=>{if(!w.marginLeftKey)return[];const ae=De[w.marginLeftKey]??0,xe=wl(Ve,dt,De,A)+ht(),Pe=Math.max(ae,_n);return r.jsx("div",{"data-controls":w.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(dt[A]),style:{position:"absolute",top:0,left:z(xe),width:z(Pe),height:"100%",pointerEvents:"auto"}},w.marginLeftKey)});return Se?[Se,...p]:p},go=()=>Ve.map((V,Se)=>{const p=qt(Se,dt),A=an(Se)-Zt/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(A),width:z(Zt),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),dr=()=>St.flatMap((V,Se)=>{if(!V.marginLeftKey)return[];const p=De[V.marginLeftKey]??0,w=Ft(Se),A=Math.max(p,_n),{resolvedWidth:ae}=Nt(V,"two-row-bottom");return r.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ae),style:{position:"absolute",top:0,left:z(w),width:z(A),height:"100%",pointerEvents:"auto"}},V.marginLeftKey)}),ur=()=>St.map((V,Se)=>{const{maxWidth:p}=Nt(V,"two-row-bottom"),A=Et(Se)-Zt/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(A),width:z(Zt),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),hn=()=>!o||fe?null:r.jsxs(r.Fragment,{children:[mo(),go()]}),li=V=>{const Se=!V.objectFit&&In(E);return{className:`${e}-slide-image-cell${Se?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:W,maxHeight:S,...Se?{"--image-aspect-ratio":lr(E)}:{}}}},ho=V=>V.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":V.objectFit}}:In(E)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Kn=V=>{if(V.length===0)return null;const Se=V.length>1,p=Cr(H),w=`calc(-0.5 * (${p} + ${H}))`;if(V.length===1){const A=V[0];return r.jsx("div",{...li(A),children:r.jsx("img",{...ho(A),src:A.url,alt:A.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:Se?{gap:H}:void 0,children:V.map((A,ae)=>r.jsxs("div",{...li(A),children:[r.jsx("img",{...ho(A),src:A.url,alt:A.name??"",draggable:!1}),o&&Se&&ae<V.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:w,width:p,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${A.url}-${ae}`))})},fo=!!(ce!=null&&ce.title2||ce!=null&&ce.title3||mt!=null&&mt.title2||mt!=null&&mt.title3||($??0)>0||o),pr=()=>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:ct,className:Ie,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:qn(B||ce)}),r.jsxs("div",{ref:Ke,className:`${e}-titles-row-two-row`,style:{...$e&&le?{minHeight:le}:void 0,...$e&&We?{width:We,maxWidth:"100%"}:void 0},children:[po(r.jsxs("div",{className:Ie,style:{position:$e?"absolute":"relative",inset:$e?0:void 0,width:"100%"},children:[mt&&$e?r.jsx("div",{className:`${Re} ${e}-titles-fade-out`,children:xn(mt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${$e?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:xn(ce)})]}),$e&&le?le:void 0),fo?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[mt&&$e?r.jsx("div",{className:`${_e} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:Pn(mt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${$e?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${fe?` ${e}-titles-layer-in-stacked`:""}`,children:Pn(ce,!0)})]}):null]})]}),mr=()=>{const V=fo;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...V?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:V?void 0:{flex:"0 0 auto",height:"auto"},children:qn(ce,!0)}),hn()]})};return r.jsxs("div",{ref:ft,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{yt||et()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Ae?void 0:-1,style:{opacity:oe?1:0,transition:"opacity 300ms ease",pointerEvents:oe?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:T,...ot}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:$t,...Ue,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Wt,onClick:V=>V.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ve&&ne.length>1?"true":"false",onPointerDown:ve?Kt:void 0,onPointerUp:ve?rn:void 0,onPointerCancel:ve?gn:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Dt&&C?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:V=>{V.target===V.currentTarget&&ut(X)},children:r.jsx("div",{className:`${e}-slide-area`,children:Kn(Dt.images)})},`slide-out-${X}`):null,r.jsx("div",{className:`${e}-slide-layer-in${C?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:be?Kn(be.images):null})},`slide-in-${X}-${ge}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:jt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:J,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...fe?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${fe?` ${e}-lightbox-content-area-stacked`:""}`,children:ze&&r.jsx("div",{className:`${e}-text-bar-cell${fe?` ${e}-text-bar-cell-stacked`:""}`,style:fe?void 0:{flex:1,minWidth:0,width:"100%"},children:fe?L==="fade"?pr():mr():L==="fade"?cr():_i()})})})]})]})]})};function qh(e){return`
|
|
13761
|
+
`,zh="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 Dh(e){const t={};return t[Lt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Lt(e,"fontSettings")]={...Jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Lt(e,"fontSize")]={...Jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Lt(e,"lineHeight")]={...Jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Lt(e,"letterSpacing")]={...Jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Lt(e,"wordSpacing")]={...Jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Lt(e,"textAlign")]={...Jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Lt(e,"textAppearance")]={...Jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Vh=Mi.reduce((e,t)=>({...e,...Dh(t)}),{}),qh=Mi.reduce((e,t)=>({...e,[Lt(t,"fontFamily")]:"Goudy Bookletter 1911",[Lt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Lt(t,"letterSpacing")]:0,[Lt(t,"wordSpacing")]:0,[Lt(t,"textAlign")]:"left",[Lt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Fr(e){return Mi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Lt(n,"fontSize")]=i),o!==void 0&&(t[Lt(n,"lineHeight")]=o),t},{})}const Gh=Wh(),Kh={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:"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"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up"]}},thumbnailActiveColor:{type:"string",scope:"common",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},...Vh,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/lightbox_strip_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:zh,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",...qh},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...Fr({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,title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...Fr({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,title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...Fr({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:[Gh]}],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/lightbox_strip_2.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_3.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_4.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_5.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_6.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_7.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"}]}},Uh={element:jh,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:Kh,sourceCode:Bh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Mi.map(e=>({path:`${Lt(e,"fontFamily")}`}))]},fontRelations:{...Mi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Lt(t,"fontFamily")}`}),{})}},Xh=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,initialSlideIndex:s=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:m})=>{const{type:y,coverFit:w,backgroundColor:$,imageGap:h,maxWidth:v,maxHeight:S,textTransition:C,title1Width:E,title2Width:M,title3Width:H,title1MarginLeft:x=0,title2MarginLeft:j=0,title3MarginLeft:P=0,titleRowMarginBottom:T=0,titleHeaderLayout:G="single-row",countCloseGap:f=0,closeIcon:A,closeIconMaxWidth:_,closeIconColor:V,closeIconHoverColor:te,contentMarginTop:ne=0,iconMarginRight:K=0}=n,B=a.useCallback(q=>N.scalingValue(q,i??!1),[i]),F=B(h??0),I=`${v}%`,R=`${S}%`,U=B(f),D=B(ne),ee=B(K),O=ei("title1",Qn(n,"title1"),i),pe=ei("title2",Qn(n,"title2"),i),g=ei("title3",Qn(n,"title3"),i),ue=ei("count",Qn(n,"count"),i),me=G==="mobile",we=!i||!!l,_e=!o&&(!i||!!l),oe=a.useMemo(()=>No(t,y),[t,y]),[ye,X]=a.useState(s),be=oe[ye],ce=be==null?void 0:be.entry,[ge,se]=a.useState(!1),[Ie,Fe]=a.useState(null),[he,Ce]=a.useState(!1),[W,Q]=a.useState(null),[L,Y]=a.useState(!1),[J,de]=a.useState(0),[le,ie]=a.useState(),[Re,Se]=a.useState(),[z,Te]=a.useState(null),Z=a.useRef(null),fe=a.useRef(0),ve=a.useRef(0),ke=a.useRef(0),Qe=a.useRef(!1),Xe=a.useRef(null),ht=a.useRef(null),xt=a.useRef(null),It=a.useRef(null),Et=a.useRef(null),wt=a.useRef(null),Ze=a.useRef(null),Ne=a.useCallback(()=>{const q=ht.current;if(!q)return;const $e=q.closest(`.${e}-lightbox-content-area`);if(!$e)return q.getBoundingClientRect().width;const p=Array.from($e.children).reduce((b,k)=>!(k instanceof HTMLElement)||k.contains(q)?b:b+k.getBoundingClientRect().width,0);return $e.getBoundingClientRect().width-p},[e]),ot=a.useCallback(()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)},[]),dt=a.useCallback(q=>{q===fe.current&&(Q(null),Y(!1))},[]),et=a.useCallback(()=>{o||Qe.current||(Qe.current=!0,u==null||u(),se(!1),Xe.current=setTimeout(()=>{m()},300))},[o,u,m]),mt=a.useCallback(q=>!!(q.closest("[data-controls]")||q.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ut,backdropStyle:lt,mediaAreaStyle:_t,overlayContentStyle:Mt,swipeHandlers:Be,dismissAreaStyle:ft}=Ol({enabled:_e,onClose:et,animMs:300,isBlockedTarget:mt}),rt=a.useCallback(q=>{d&&bl(q+1,c,!0)},[d,c]),Ye=a.useCallback(q=>{if(q)return q.getBoundingClientRect().height},[]),St=a.useCallback(q=>{if(oe.length===0)return;const $e=(q%oe.length+oe.length)%oe.length;if($e===ye)return;const p=oe[ye],b=oe[$e];fe.current+=1;const k=fe.current,re=C==="fade"&&rs(p==null?void 0:p.entry)!==rs(b==null?void 0:b.entry),xe=Ye(xt.current),We=re?(()=>{const ct=Ne();Pi.flushSync(()=>{Te(b.entry)}),xt.current&&ct&&(xt.current.style.width=`${ct}px`);const jt=Ye(xt.current);return xt.current&&(xt.current.style.width=""),{measuredIncomingTitlesHeight:jt,incomingTitlesMeasureWidth:ct}})():void 0,Ge=Math.max(xe??0,(We==null?void 0:We.measuredIncomingTitlesHeight)??0)||void 0;de(k),Q(ye),Y(!0),X($e),rt($e),ke.current=$e,re?(ot(),Ge&&ie(Ge),We!=null&&We.incomingTitlesMeasureWidth&&Se(We.incomingTitlesMeasureWidth),Fe((p==null?void 0:p.entryIndex)??null),Ce(!0),ve.current=b.entryIndex,Z.current=setTimeout(()=>{Fe(null),Ce(!1),ie(void 0),Se(void 0),Te(null),Z.current=null},400)):(ot(),Fe(null),Ce(!1),ie(void 0),Se(void 0),Te(null),ve.current=b.entryIndex)},[ye,ot,Ne,Ye,oe,rt,C]),bt=a.useCallback(()=>{Ze.current=null},[]),Yt=a.useCallback(q=>{!we||oe.length<=1||q.pointerType==="mouse"&&q.button!==0||q.target.closest("[data-controls]")||(Ze.current={startX:q.clientX,startY:q.clientY,pointerId:q.pointerId})},[we,oe.length]),sn=a.useCallback(q=>{var ct;if(!we||oe.length<=1||q.pointerType==="mouse"&&q.button!==0)return;if(ut){bt();return}const $e=Ze.current;if(!$e||$e.pointerId!==q.pointerId||(bt(),q.target.closest("[data-controls]")))return;const b=q.clientX-$e.startX,k=q.clientY-$e.startY,re=Math.abs(b),xe=Math.abs(k);if(re>=pm&&re>xe){St(b>0?ye-1:ye+1);return}if(re>ts||xe>ts)return;const We=(ct=It.current)==null?void 0:ct.getBoundingClientRect(),Ge=We?We.left+We.width/2:window.innerWidth/2;St(q.clientX<Ge?ye-1:ye+1)},[ye,we,St,ut,bt,oe.length]),Pt=a.useCallback(q=>{const $e=Ze.current;($e==null?void 0:$e.pointerId)===q.pointerId&&bt()},[bt]);jl(),a.useEffect(()=>{wt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const q=requestAnimationFrame(()=>{se(!0),requestAnimationFrame(()=>{Et.current?Et.current.focus():It.current&&It.current.focus()})});return()=>{cancelAnimationFrame(q),Xe.current&&clearTimeout(Xe.current),Z.current&&clearTimeout(Z.current);const $e=wt.current;$e&&document.contains($e)&&$e.focus()}},[]),a.useEffect(()=>{var q;C!=="fade"&&(ve.current=((q=oe[ye])==null?void 0:q.entryIndex)??0,ot(),Fe(null),Ce(!1),ie(void 0),Se(void 0))},[ye,ot,oe,C]),a.useEffect(()=>{const q=$e=>{if($e.key==="Escape"){et();return}if($e.key==="ArrowLeft"&&oe.length>1){St(ye-1);return}if($e.key==="ArrowRight"&&oe.length>1){St(ye+1);return}if($e.key==="Tab"&&It.current){const p=It.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),b=Array.from(p).filter(We=>!We.closest('[aria-hidden="true"]'));if(b.length===0)return;const k=b[0],re=b[b.length-1],xe=document.activeElement;$e.shiftKey?(xe===k||!It.current.contains(xe))&&($e.preventDefault(),re.focus()):(xe===re||!It.current.contains(xe))&&($e.preventDefault(),k.focus())}};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[St,et,ye,oe.length]),a.useLayoutEffect(()=>{ot(),fe.current=0,de(0),Q(null),Y(!1),Fe(null),Ce(!1),ie(void 0),Se(void 0),Te(null),X(q=>{const $e=Math.max(0,oe.length-1);return Math.min(q,$e)})},[ot,t.length,y,oe.length]),a.useLayoutEffect(()=>{var p;const q=Math.max(0,oe.length-1),$e=Math.min(Math.max(0,s),q);ke.current=$e,ve.current=((p=oe[$e])==null?void 0:p.entryIndex)??0,X($e)},[s]);const gt=Ie!==null?t[Ie]:null,Jt=W!==null?oe[W]:null,qt=(ce==null?void 0:ce.title1)||(ce==null?void 0:ce.title2)||(ce==null?void 0:ce.title3)||(gt==null?void 0:gt.title1)||(gt==null?void 0:gt.title2)||(gt==null?void 0:gt.title3),Ft=bm(y,oe,t),Ot=A!==null,Gt=qt||Ft||Ot,Le=Ft&&Ot?{gap:U}:void 0,Ae=`${e}-titles-stack${me?` ${e}-titles-stack-stacked`:""}`,ze=`${e}-titles-layer-out${me?` ${e}-titles-layer-out-stacked`:""}`,Je=`${e}-titles-layer-out`,Oe=(x??0)>0||o,st=B(T),Me=a.useMemo(()=>({title1Width:E??vi.title1Width,title2Width:M??vi.title2Width,title3Width:H??vi.title3Width}),[E,M,H]),tt=a.useMemo(()=>({title2MarginLeft:j,title3MarginLeft:P}),[j,P]),Ke=a.useMemo(()=>ce?Wn(e,ce,O,pe,g):[],[e,ce,O,pe,g]),Ct=a.useMemo(()=>Ke.map(q=>Me[q.widthKey]),[Ke,Me]),vt=a.useMemo(()=>Ci(Ke.length,Ct),[Ke.length,Ct]),kt=a.useMemo(()=>eo(Ke.length,Ct),[Ke.length,Ct]),Tt=a.useMemo(()=>Ke.filter(q=>q.prefix==="title1"),[Ke]),ae=a.useMemo(()=>Ke.filter(q=>q.prefix==="title2"||q.prefix==="title3"),[Ke]),Pe=a.useMemo(()=>_n(Tt,Me),[Tt,Me]),He=a.useMemo(()=>_n(ae,Me),[ae,Me]),Ve=a.useCallback((q,$e)=>{const p=Ke.findIndex(k=>k.prefix===q.prefix);if(!me||$e==="single-row")return{effectiveWidth:kt[p]??0,resolvedWidth:vt[p]??0,maxWidth:Ut(p,vt)};if($e==="two-row-top"){const k=Tt.findIndex(re=>re.prefix===q.prefix);return{effectiveWidth:Pe.effective[k]??0,resolvedWidth:Pe.resolved[k]??0,maxWidth:Ut(k,Pe.resolved)}}const b=ae.findIndex(k=>k.prefix===q.prefix);return{effectiveWidth:He.effective[b]??0,resolvedWidth:He.resolved[b]??0,maxWidth:Ut(b,He.resolved)}},[Ke,ae,He,kt,vt,Tt,Pe,me]),yt=a.useCallback(q=>Cl(Ke,vt,tt,q)+(me?0:x??0),[Ke,vt,tt,me,x]),nt=a.useCallback(()=>me?0:x??0,[me,x]),qe=a.useCallback(q=>ae.slice(0,q).reduce(($e,p,b)=>$e+(p.marginLeftKey?tt[p.marginLeftKey]??0:0)+(He.resolved[b]??0),0),[ae,He.resolved,tt]),De=a.useCallback(q=>{const $e=ae[q];return qe(q)+($e.marginLeftKey?tt[$e.marginLeftKey]??0:0)+(He.resolved[q]??0)},[ae,He.resolved,qe,tt]),$t=a.useCallback((q,$e,p)=>{if(!me||p==="single-row"){const We=q.findIndex(Nt=>Nt.prefix===$e.prefix),Ge=q.map(Nt=>Me[Nt.widthKey]),ct=Ci(q.length,Ge);return{effectiveWidth:eo(q.length,Ge)[We]??0,resolvedWidth:ct[We]??0,maxWidth:Ut(We,ct)}}if(p==="two-row-top"){const We=q.filter(Nt=>Nt.prefix==="title1"),Ge=We.findIndex(Nt=>Nt.prefix===$e.prefix),{resolved:ct,effective:jt}=_n(We,Me);return{effectiveWidth:jt[Ge]??0,resolvedWidth:ct[Ge]??0,maxWidth:Ut(Ge,ct)}}const b=q.filter(We=>We.prefix==="title2"||We.prefix==="title3"),k=b.findIndex(We=>We.prefix===$e.prefix),{resolved:re,effective:xe}=_n(b,Me);return{effectiveWidth:xe[k]??0,resolvedWidth:re[k]??0,maxWidth:Ut(k,re)}},[Me,me]),At=(q,$e,p)=>{const b=q.marginLeftKey?tt[q.marginLeftKey]??0:0,{effectiveWidth:k,resolvedWidth:re,maxWidth:xe}=p??Ve(q,$e),We=Math.max(b,Fn),Ge=o&&$e==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":q.prefix,style:{width:B(k),...b>0?{marginLeft:B(b)}:{}},children:[r.jsx("p",{className:q.className,style:q.style,children:q.text}),Ge&&q.marginLeftKey?r.jsx("div",{"data-controls":q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re),style:{position:"absolute",top:0,left:B(-b),width:B(We),height:"100%",pointerEvents:"auto"}}):null,Ge?r.jsx("div",{"data-controls":q.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(xe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:B(-en/2),width:B(en),height:"100%",pointerEvents:"auto"}}):null]},q.className)},Dt=(q="two-row")=>{const $e=Ke.findIndex(k=>k.prefix==="title1"),p=$e>=0?vt[$e]:Me.title1Width,b=q==="two-row"&&o;return r.jsx("div",{...b?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p)}:{},style:{width:B(x??0),flexShrink:0,alignSelf:"stretch",...b?{pointerEvents:"auto"}:{}}})},Vt=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:O,"aria-hidden":"true",children:" "}),Rn=()=>r.jsx("span",{className:`${e}-entry-counter`,style:ue,"aria-live":"polite","aria-atomic":"true",children:xm(oe,ye,y,t)}),ai=()=>Ft?o&&Ot?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Rn(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Lr(U)} + ${U}))`,width:Lr(U),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Rn():null,si=()=>!Ft&&!Ot?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Le,children:[ai(),Ot?ln():null]}),Ni=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||qt?Vt():null,Oe?Dt("single-row"):null,cn(ce),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),si(),mn()]}),ur=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||qt?Vt():null,Oe?Dt("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:he&&le?{minHeight:le}:void 0,children:[r.jsx("div",{ref:xt,className:Ae,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Vn(z||ce)}),r.jsxs("div",{ref:ht,className:Ae,style:{position:he?"absolute":"relative",inset:he?0:void 0,width:"100%",...he&&Re?{width:Re,maxWidth:"100%"}:void 0},children:[gt&&he?r.jsx("div",{className:`${ze} ${e}-titles-fade-out`,children:Vn(gt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${he?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Vn(ce)})]})]}),si(),mn()]}),ln=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:N.scalingValue(_??0,i),height:N.scalingValue(_??0,i),marginRight:ee,"--close-icon-hover-color":te},children:[r.jsx("button",{ref:Et,type:"button",className:`${e}-close-icon-inner`,onClick:et,"aria-label":"Close",children:r.jsx(on,{url:A??"",fill:V,hoverFill:i&&!l?V:te,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:ee,height:"100%",pointerEvents:"auto"}})]}),go=(q,$e)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Ft||qt?Vt():null,Oe?Dt("two-row"):null,$e!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:$e},children:q}):r.jsxs(r.Fragment,{children:[q,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),si()]}),cn=q=>{if(!q)return null;const $e=Wn(e,q,O,pe,g);return r.jsx(r.Fragment,{children:$e.map(p=>At(p,"single-row",$t($e,p,"single-row")))})},vn=q=>{if(!q)return null;const $e=Wn(e,q,O,pe,g),p=$e.find(b=>b.prefix==="title1");return p?At(p,"two-row-top",$t($e,p,"two-row-top")):null},En=(q,$e=!1)=>{const p=q?Wn(e,q,O,pe,g):[],b=p.filter(xe=>xe.prefix==="title2"||xe.prefix==="title3"),k=o&&$e;return b.length>0||k||(T??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[b.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[b.map(xe=>At(xe,"two-row-bottom",$t(p,xe,"two-row-bottom"))),$e&&o?r.jsxs(r.Fragment,{children:[pr(),mr()]}):null]}):null,(T??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:st,width:"100%",flexShrink:0,pointerEvents:k?"auto":"none"}}):null]}):null},Dn=(q,$e=!1)=>r.jsxs(r.Fragment,{children:[go(vn(q)),En(q,$e)]}),Vn=q=>me?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Dn(q)}):q?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:cn(q)}):null,ho=()=>{const q=me?-1:Ke.findIndex(b=>b.prefix==="title1"),$e=!me&&(o||(x??0)>0)?(()=>{const b=x??0,k=q>=0?vt[q]:Me.title1Width,re=Math.max(b,Fn);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:B(re),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,p=Ke.flatMap((b,k)=>{if(!b.marginLeftKey)return[];const re=tt[b.marginLeftKey]??0,xe=$l(Ke,vt,tt,k)+nt(),We=Math.max(re,Fn);return r.jsx("div",{"data-controls":b.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(vt[k]),style:{position:"absolute",top:0,left:B(xe),width:B(We),height:"100%",pointerEvents:"auto"}},b.marginLeftKey)});return $e?[$e,...p]:p},fo=()=>Ke.map((q,$e)=>{const p=Ut($e,vt),k=yt($e)-en/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":q.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:B(k),width:B(en),height:"100%",pointerEvents:"auto"}})},`${q.widthKey}-junction`)}),pr=()=>ae.flatMap((q,$e)=>{if(!q.marginLeftKey)return[];const p=tt[q.marginLeftKey]??0,b=qe($e),k=Math.max(p,Fn),{resolvedWidth:re}=Ve(q,"two-row-bottom");return r.jsx("div",{"data-controls":q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re),style:{position:"absolute",top:0,left:B(b),width:B(k),height:"100%",pointerEvents:"auto"}},q.marginLeftKey)}),mr=()=>ae.map((q,$e)=>{const{maxWidth:p}=Ve(q,"two-row-bottom"),k=De($e)-en/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":q.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:B(k),width:B(en),height:"100%",pointerEvents:"auto"}})},`${q.widthKey}-junction`)}),mn=()=>!o||me?null:r.jsxs(r.Fragment,{children:[ho(),fo()]}),li=q=>{const $e=!q.objectFit&&Tn(w);return{className:`${e}-slide-image-cell${$e?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:I,maxHeight:R,...$e?{"--image-aspect-ratio":dr(w)}:{}}}},yo=q=>q.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":q.objectFit}}:Tn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},qn=q=>{if(q.length===0)return null;const $e=q.length>1,p=Lr(F),b=`calc(-0.5 * (${p} + ${F}))`;if(q.length===1){const k=q[0];return r.jsx("div",{...li(k),children:r.jsx("img",{...yo(k),src:k.url,alt:k.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:$e?{gap:F}:void 0,children:q.map((k,re)=>r.jsxs("div",{...li(k),children:[r.jsx("img",{...yo(k),src:k.url,alt:k.name??"",draggable:!1}),o&&$e&&re<q.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:b,width:p,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${k.url}-${re}`))})},vo=!!(ce!=null&&ce.title2||ce!=null&&ce.title3||gt!=null&>.title2||gt!=null&>.title3||(T??0)>0||o),gr=()=>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:xt,className:Ae,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Dn(z||ce)}),r.jsxs("div",{ref:ht,className:`${e}-titles-row-two-row`,style:{...he&&le?{minHeight:le}:void 0,...he&&Re?{width:Re,maxWidth:"100%"}:void 0},children:[go(r.jsxs("div",{className:Ae,style:{position:he?"absolute":"relative",inset:he?0:void 0,width:"100%"},children:[gt&&he?r.jsx("div",{className:`${Je} ${e}-titles-fade-out`,children:vn(gt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${he?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:vn(ce)})]}),he&&le?le:void 0),vo?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[gt&&he?r.jsx("div",{className:`${ze} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:En(gt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${he?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${me?` ${e}-titles-layer-in-stacked`:""}`,children:En(ce,!0)})]}):null]})]}),hr=()=>{const q=vo;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...q?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:q?void 0:{flex:"0 0 auto",height:"auto"},children:Dn(ce,!0)}),mn()]})};return r.jsxs("div",{ref:It,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ut||et()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Ot?void 0:-1,style:{opacity:ge?1:0,transition:"opacity 300ms ease",pointerEvents:ge?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:$,...lt}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:ft,...Be,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:_t,onClick:q=>q.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":we&&oe.length>1?"true":"false",onPointerDown:we?Yt:void 0,onPointerUp:we?sn:void 0,onPointerCancel:we?Pt:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Jt&&L?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:q=>{q.target===q.currentTarget&&dt(J)},children:r.jsx("div",{className:`${e}-slide-area`,children:qn(Jt.images)})},`slide-out-${J}`):null,r.jsx("div",{className:`${e}-slide-layer-in${L?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:be?qn(be.images):null})},`slide-in-${J}-${ye}`)]})})}),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:D,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...me?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${me?` ${e}-lightbox-content-area-stacked`:""}`,children:Gt&&r.jsx("div",{className:`${e}-text-bar-cell${me?` ${e}-text-bar-cell-stacked`:""}`,style:me?void 0:{flex:1,minWidth:0,width:"100%"},children:me?C==="fade"?gr():hr():C==="fade"?ur():Ni()})})})]})]})]})};function Yh(e){return`
|
|
13584
13762
|
.${e}-wrapper {
|
|
13585
13763
|
position: relative;
|
|
13586
13764
|
width: 100%;
|
|
@@ -14114,7 +14292,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
14114
14292
|
pointer-events: auto;
|
|
14115
14293
|
z-index: 10;
|
|
14116
14294
|
}
|
|
14117
|
-
`}const
|
|
14295
|
+
`}const Jh=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l,metadata:s})=>{const{prefix:d}=N.useScopedStyles(),c=(s==null?void 0:s.itemId)??null,{cover:u,coverFit:m,type:y}=e,w=a.useRef(null),[$,h]=a.useState(!1),[v,S]=a.useState(0),C=a.useRef(!1),E=a.useRef(!1),M=a.useRef(!1),H=a.useMemo(()=>(t??[]).filter(f=>$i(f).length>0),[t]),x=$&&H.length>0,j=!n,P=a.useCallback(()=>{j&&(M.current=!0,gm(E.current,c),E.current=!1)},[j,c]),T=(f=0)=>{if(H.length===0||n&&!i&&!o)return;const A=No(H,y),_=Math.max(0,Math.min(f,A.length-1));if(S(_),j){const V=wl();bl(_+1,c,V),E.current=!V}h(!0)},G=a.useCallback(()=>{h(!1),M.current=!1},[]);return a.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),a.useEffect(()=>{if(!j||C.current)return;C.current=!0;const f=is(c);if(!f)return;const A=os(f,No(H,y).length);A<0||(S(A),h(!0))},[H,c,j,y]),a.useEffect(()=>{if(!j)return;const f=()=>{if(M.current){M.current=!1,h(!1);return}const A=is(c);if(!A){h(!1);return}const _=os(A,No(H,y).length);if(_<0){h(!1);return}E.current=!1,S(_),h(!0)};return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[H,c,j,y]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:w,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Yh(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Tn(m)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>T(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Tn(m)?{"--image-aspect-ratio":dr(m)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Tn(m)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),x&&typeof document<"u"&&(()=>{const f=(l?document.getElementById(l):null)??document.body;return Pi.createPortal(r.jsx(Xh,{prefix:d,entries:H,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:v,enableUrlSync:j,journalItemId:c,onBeforeClose:P,onClose:G}),f)})()]})},Zh=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
14118
14296
|
import { createPortal } from 'react-dom';
|
|
14119
14297
|
import { CommonComponentProps } from '../props';
|
|
14120
14298
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -14882,7 +15060,7 @@ export type LightboxJournalSettings = {
|
|
|
14882
15060
|
closeIconColor: string;
|
|
14883
15061
|
closeIconHoverColor: string;
|
|
14884
15062
|
};
|
|
14885
|
-
`,Uh="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>'),ei={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 Xh(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")]={...ei.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...ei.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...ei.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...ei.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...ei.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...ei.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...ei.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Yh=ai.reduce((e,t)=>({...e,...Xh(t)}),{}),Jh=ai.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 Es(e){return ai.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 Zh=xm(),Qh={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"}},...Yh,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/journal_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Uh,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...Jh,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.05,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.005,...Es({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...Es({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:[Zh]}],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:"Dorothy Manners & Julanne Johnston",title2:"by Evans Studio",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_2.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/journal_3.jpg",name:"",objectFit:"contain"}]},{title1:"Inez Nadeau",title2:"Melbourne Spurr",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_4.jpg",name:"",objectFit:"contain"}]},{title1:"Colleen Moore",title2:"Clarence S. Bull",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_5.jpg",name:"",objectFit:"contain"}]},{title1:"Gloria Swanson",title2:"Donald Biddle Keyes",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_6.jpg",name:"",objectFit:"contain"}]}]}},ef={element:Gh,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:Qh,sourceCode:Kh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ai.map(e=>({path:`${Ye(e,"fontFamily")}`}))]},fontRelations:{...ai.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ye(t,"fontFamily")}`}),{})}},tf={sizeType:"custom",value:700,min:400,max:700};function Go(e,t){return{widthPx:e,heightPx:e*t}}function Vr(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 Rs(e,t,n,i){const{heightPx:o}=Go(n,i);return Vr(e/2,t/2,e,t,n,o)}function Ol(e,t,n){for(const i of n){const{heightPx:o}=Go(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 nf(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":Ol(e,t,n)||l==="area"?s??"none":d??"none"}function Ms(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 of(e){return`
|
|
15063
|
+
`,Qh="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>'),Zn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function ef(e){const t={};return t[Ue(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ue(e,"fontSettings")]={...Zn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ue(e,"fontSize")]={...Zn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ue(e,"lineHeight")]={...Zn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ue(e,"letterSpacing")]={...Zn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ue(e,"wordSpacing")]={...Zn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ue(e,"textAlign")]={...Zn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ue(e,"textAppearance")]={...Zn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const tf=oi.reduce((e,t)=>({...e,...ef(t)}),{}),nf=oi.reduce((e,t)=>({...e,[Ue(t,"fontFamily")]:"Goudy Bookletter 1911",[Ue(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ue(t,"letterSpacing")]:0,[Ue(t,"wordSpacing")]:0,[Ue(t,"textAlign")]:"left",[Ue(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Wr(e){return oi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ue(n,"fontSize")]=i),o!==void 0&&(t[Ue(n,"lineHeight")]=o),t},{})}const of=wm(),rf={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"}},...tf,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/journal_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Qh,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...nf,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:.005,...Wr({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,...Wr({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,...Wr({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:[of]}],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:"Dorothy Manners & Julanne Johnston",title2:"by Evans Studio",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_2.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/journal_3.jpg",name:"",objectFit:"contain"}]},{title1:"Inez Nadeau",title2:"Melbourne Spurr",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_4.jpg",name:"",objectFit:"contain"}]},{title1:"Colleen Moore",title2:"Clarence S. Bull",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_5.jpg",name:"",objectFit:"contain"}]},{title1:"Gloria Swanson",title2:"Donald Biddle Keyes",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_6.jpg",name:"",objectFit:"contain"}]}]}},af={element:Jh,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:rf,sourceCode:Zh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...oi.map(e=>({path:`${Ue(e,"fontFamily")}`}))]},fontRelations:{...oi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ue(t,"fontFamily")}`}),{})}},sf={sizeType:"custom",value:700,min:400,max:700};function Uo(e,t){return{widthPx:e,heightPx:e*t}}function Xr(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 Ps(e,t,n,i){const{heightPx:o}=Uo(n,i);return Xr(e/2,t/2,e,t,n,o)}function zl(e,t,n){for(const i of n){const{heightPx:o}=Uo(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 lf(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":zl(e,t,n)||l==="area"?s??"none":d??"none"}function ks(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 cf(e){return`
|
|
14886
15064
|
.${e}-root {
|
|
14887
15065
|
position: absolute;
|
|
14888
15066
|
top: 0;
|
|
@@ -14917,7 +15095,7 @@ export type LightboxJournalSettings = {
|
|
|
14917
15095
|
width: 32px;
|
|
14918
15096
|
height: 32px;
|
|
14919
15097
|
}
|
|
14920
|
-
`}function
|
|
15098
|
+
`}function df(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 uf(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await df(i)]));return new Map(n)}function pf({settings:e,content:t=[],isEditor:n}){const{prefix:i}=N.useScopedStyles(),[o,l]=a.useState(null),[s,d]=a.useState([]),[c,u]=a.useState(0),m=a.useRef(0),[y,w]=a.useState({x:0,y:0}),[$,h]=a.useState("none"),v=a.useRef({x:0,y:0}),[S,C]=a.useState(!1),[E,M]=a.useState(!1),H=a.useRef(new Map),{imageSize:x=sf,cursor:j="system",target:P="area",position:T="random",visible:G="all",defaultCursor:f=null,hoverCursor:A=null}=e,_=a.useMemo(()=>cf(i),[i]),V=a.useCallback((F,I,R=s)=>{if(!o)return;const U=o.getBoundingClientRect(),D=F-U.left,ee=I-U.top;w({x:D,y:ee}),h(lf(D,ee,R,o,j,P,A,f))},[o,s,j,P,A,f]);a.useEffect(()=>{const F=[...t.map(R=>R.image.url),f,A].filter(R=>!!R);if(F.length===0){H.current=new Map,M(!0);return}let I=!1;return M(!1),uf(F).then(R=>{I||(H.current=R,M(!0))}),()=>{I=!0}},[t,f,A]),a.useEffect(()=>{if(!o)return;const F=R=>{R.stopPropagation(),v.current={x:R.clientX,y:R.clientY},V(R.clientX,R.clientY)},I=()=>{S&&V(v.current.x,v.current.y)};return o.addEventListener("mousemove",F),window.addEventListener("scroll",I,!0),()=>{o.removeEventListener("mousemove",F),window.removeEventListener("scroll",I,!0)}},[o,S,V]),a.useEffect(()=>{!o||!S||V(v.current.x,v.current.y)},[s,o,S,V]),a.useEffect(()=>{S||h("none")},[S]);const te=(F,I,R,U={})=>{var ue;const D=((ue=H.current.get(F.image.url))==null?void 0:ue.aspectRatio)??1,ee=ks(F.image.url,x,H.current),{heightPx:O}=Uo(ee,D);let pe=0,g=0;return T==="same"?{x:pe,y:g}=Ps(I,R,ee,D):(pe=U.x??Math.random()*I,g=U.y??Math.random()*R,{x:pe,y:g}=Xr(pe,g,I,R,ee,O)),{id:m.current++,url:F.image.url,link:F.link,name:F.image.name,x:pe,y:g,xRatio:pe/I,yRatio:g/R,aspectRatio:D,widthPx:ee}},ne=()=>{if(!o)return;const F=o.getBoundingClientRect(),I=F.width,R=F.height;I===0||R===0||d(U=>U.length===0?U:U.map(D=>{const ee=x.sizeType==="random"?D.widthPx:ks(D.url,x,H.current),{heightPx:O}=Uo(ee,D.aspectRatio);if(T==="same"){const{x:ue,y:me}=Ps(I,R,ee,D.aspectRatio);return{...D,x:ue,y:me,widthPx:ee}}const{x:pe,y:g}=Xr(D.xRatio*I,D.yRatio*R,I,R,ee,O);return{...D,x:pe,y:g,widthPx:ee}}))};a.useEffect(()=>{if(!o||t.length===0||!E)return;const F=o.getBoundingClientRect(),I=F.width,R=F.height,U=te(t[0],I,R);d([U]),u(1)},[x,T,o,t,E]),a.useEffect(()=>{if(!o)return;ne();const F=new ResizeObserver(ne);return F.observe(o),window.addEventListener("resize",ne),()=>{F.disconnect(),window.removeEventListener("resize",ne)}},[o,T,x,s.length]),a.useEffect(()=>{G==="last One"&&d(F=>F.length>0?[F[F.length-1]]:[])},[G]);const K=F=>{if(!o||t.length===0||!E)return;const I=o.getBoundingClientRect(),R=F.clientX-I.left,U=F.clientY-I.top;if(P==="image"&&!zl(R,U,s))return;let D=0,ee=0;T==="on Click"?(D=R,ee=U):T==="same"?(D=I.width/2,ee=I.height/2):(D=Math.random()*I.width,ee=Math.random()*I.height);const O=t[c],pe=te(O,I.width,I.height,{x:D,y:ee}),g=G==="all"?[...s,pe]:[pe];d(g),u(ue=>ue>=t.length-1?0:ue+1),V(F.clientX,F.clientY,g)},B=j==="custom"&&$!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:_}}),r.jsxs("div",{ref:l,onClick:K,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:`${i}-root`,style:{cursor:B?"none":"default"},children:[s.map(F=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${F.y}px`,left:`${F.x}px`,width:`${F.widthPx}px`,cursor:B?"none":"default"},children:P==="area"&&F.link?r.jsx("a",{href:F.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:F.url,alt:F.name,className:`${i}-image`})}):r.jsx("img",{src:F.url,alt:F.name,className:`${i}-image`})},F.id)),S&&B&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${y.x}px`,top:`${y.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${$}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const mf=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
14921
15099
|
import { CommonComponentProps } from '../props';
|
|
14922
15100
|
import { useScopedStyles } from '../utils/index';
|
|
14923
15101
|
|
|
@@ -15438,7 +15616,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15438
15616
|
</>
|
|
15439
15617
|
);
|
|
15440
15618
|
}
|
|
15441
|
-
`,
|
|
15619
|
+
`,gf={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/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.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"]}]}]},hf={element:pf,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:gf,sourceCode:mf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.defaultCursor"},{path:"settings.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},ff=100,yf=70,kn="cubic-bezier(0.86, 0, 0.07, 1)";function vf(e){return`
|
|
15442
15620
|
.${e}-wrapper {
|
|
15443
15621
|
position: relative;
|
|
15444
15622
|
width: 100%;
|
|
@@ -15473,34 +15651,34 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15473
15651
|
}
|
|
15474
15652
|
.${e}-incoming-next {
|
|
15475
15653
|
z-index: 4;
|
|
15476
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
15654
|
+
transition: transform var(--${e}-transition-ms) ${kn};
|
|
15477
15655
|
}
|
|
15478
15656
|
.${e}-incoming-prev {
|
|
15479
15657
|
z-index: 4;
|
|
15480
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
15658
|
+
transition: transform var(--${e}-transition-ms) ${kn};
|
|
15481
15659
|
}
|
|
15482
15660
|
.${e}-outgoing {
|
|
15483
15661
|
will-change: transform;
|
|
15484
15662
|
}
|
|
15485
15663
|
.${e}-outgoing-next {
|
|
15486
15664
|
z-index: 3;
|
|
15487
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
15665
|
+
transition: transform var(--${e}-transition-ms) ${kn};
|
|
15488
15666
|
}
|
|
15489
15667
|
.${e}-outgoing-prev {
|
|
15490
15668
|
z-index: 3;
|
|
15491
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
15669
|
+
transition: transform var(--${e}-transition-ms) ${kn};
|
|
15492
15670
|
}
|
|
15493
15671
|
.${e}-outgoing-next .${e}-effect-image {
|
|
15494
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
15672
|
+
transition: filter var(--${e}-transition-ms) ${kn};
|
|
15495
15673
|
}
|
|
15496
15674
|
.${e}-outgoing-prev .${e}-effect-image {
|
|
15497
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
15675
|
+
transition: filter var(--${e}-transition-ms) ${kn};
|
|
15498
15676
|
}
|
|
15499
15677
|
.${e}-incoming .${e}-effect-image {
|
|
15500
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
15678
|
+
transition: filter var(--${e}-transition-ms) ${kn};
|
|
15501
15679
|
}
|
|
15502
15680
|
.${e}-background .${e}-effect-image {
|
|
15503
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
15681
|
+
transition: filter var(--${e}-transition-ms) ${kn};
|
|
15504
15682
|
}
|
|
15505
15683
|
.${e}-snap .${e}-incoming,
|
|
15506
15684
|
.${e}-snap .${e}-outgoing,
|
|
@@ -15548,7 +15726,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15548
15726
|
display: block;
|
|
15549
15727
|
pointer-events: none;
|
|
15550
15728
|
}
|
|
15551
|
-
`}function
|
|
15729
|
+
`}function xf(e){return e==="blur"?yf:e==="greyscale"?ff:0}function ji(e,t=1,n=1){const i=xf(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 As(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function bf(e,t){return t<=1?0:(e-1+t)%t}function wf(e,t=1){return!e||e.height===0?t:e.width/e.height}function Sf(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 Fs(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 Dl(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function Ws(e,t,n){return{...Dl(e),[`--${n}-stage-scale`]:t}}function $f(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 Cf({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ce,W,Q,L,Y,J,de;const{prefix:o}=N.useScopedStyles(),l=a.useMemo(()=>vf(o),[o]),{imageSize:s,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:m="greyscale"}=e,y=t??[],w=As(y.length),[$,h]=a.useState(w.activeIndex),[v,S]=a.useState(w.backgroundIndex),[C,E]=a.useState(!1),[M,H]=a.useState(!1),[x,j]=a.useState(null),[P,T]=a.useState(null),[G,f]=a.useState(0),[A,_]=a.useState(1),[V,te]=a.useState("none"),[ne,K]=a.useState("next"),[B,F]=a.useState({}),[I,R]=a.useState({width:0,height:0}),U=a.useRef(null),D=a.useRef(null),ee=!n||!!i,O=s??60,pe=Math.max(10,Math.min(100,d??O)),g=Math.max(10,Math.min(100,c??O)),ue=Math.max(100,u),me=ji(m),we=a.useCallback(le=>{const ie=wf(le?B[le]:void 0);return Sf(I.width,I.height,ie,pe,g)},[I.height,I.width,B,g,pe]);a.useEffect(()=>{const le=D.current;if(!le)return;const ie=new ResizeObserver(([Re])=>{const{width:Se,height:z}=Re.contentRect;R({width:Se,height:z})});return ie.observe(le),()=>ie.disconnect()},[]),a.useEffect(()=>{const le=(t??[]).map(ie=>{var Re;return(Re=ie.image)==null?void 0:Re.url}).filter(ie=>!!ie);$f(le,(ie,Re)=>{F(Se=>{var z,Te;return((z=Se[ie])==null?void 0:z.width)===Re.width&&((Te=Se[ie])==null?void 0:Te.height)===Re.height?Se:{...Se,[ie]:Re}})})},[t]),a.useEffect(()=>{const{backgroundIndex:le,activeIndex:ie}=As(y.length);h(ie),S(le),E(!1),H(!1),j(null),T(null),f(0),_(1),te("none"),K("next")},[y.length,t]),a.useEffect(()=>()=>{U.current&&clearTimeout(U.current)},[]);const _e=a.useCallback(le=>{var Z,fe,ve,ke;if(!ee||C||y.length<=1)return;const ie=le==="next"?($+1)%y.length:($-1+y.length)%y.length,Re=we((fe=(Z=y[$])==null?void 0:Z.image)==null?void 0:fe.url),Se=we((ke=(ve=y[ie])==null?void 0:ve.image)==null?void 0:ke.url),z=Fs(I.width,I.height,Re),Te=Fs(I.width,I.height,Se);U.current&&clearTimeout(U.current),K(le),H(!0),E(!0),le==="next"?(j($),T(ie),f(0),_(1),te(ji(m,0,1))):(S(bf(ie,y.length)),j(ie),T($),f(1),_(Te),te(ji(m,1,Te))),requestAnimationFrame(()=>{H(!1),requestAnimationFrame(()=>{le==="next"?(f(1),_(z),te(ji(m,1,z))):(f(0),_(1),te(ji(m,0,1)))})}),U.current=setTimeout(()=>{le==="next"&&S($),h(ie),j(null),T(null),E(!1)},ue)},[$,m,I.height,I.width,we,C,ee,y,ue]),oe=y[$],ye=v!==null?y[v]:null,X=x!==null?y[x]:null,be=P!==null?y[P]:null,ce=y.length<=1?0:($-1+y.length)%y.length,ge=y.length<=1?0:($+1)%y.length,se=we((Ce=oe==null?void 0:oe.image)==null?void 0:Ce.url),Ie=we((W=X==null?void 0:X.image)==null?void 0:W.url),Fe=we((Q=be==null?void 0:be.image)==null?void 0:Q.url),he={[`--${o}-transition-ms`]:`${ue}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsxs("div",{ref:D,className:at(`${o}-wrapper`,M&&`${o}-snap`,n&&!i&&`${o}-editor`),style:he,"aria-label":"Zoom gallery",children:[((L=ye==null?void 0:ye.image)==null?void 0:L.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:ye.image.url,alt:"",style:{filter:me}})}),C&&((Y=X==null?void 0:X.image)==null?void 0:Y.url)&&r.jsx("div",{className:at(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${ne}`),style:Ws(Ie,A,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:X.image.url,alt:"",style:{filter:V}})}),C&&((J=be==null?void 0:be.image)==null?void 0:J.url)&&r.jsx("div",{className:at(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${ne}`),style:Ws(Fe,G,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:be.image.url,alt:""})}),!C&&((de=oe==null?void 0:oe.image)==null?void 0:de.url)&&r.jsx("div",{className:at(`${o}-stage`,`${o}-foreground`),style:Dl(se),children:r.jsx("img",{className:`${o}-image`,src:oe.image.url,alt:oe.image.name??""})}),ee&&y.length>1&&!C&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:at(`${o}-nav`,`${o}-nav-prev`),onClick:()=>_e("prev"),"aria-label":`Show previous image (${ce+1} of ${y.length})`}),r.jsx("button",{type:"button",className:at(`${o}-nav`,`${o}-nav-next`),onClick:()=>_e("next"),"aria-label":`Show next image (${ge+1} of ${y.length})`})]})]})]})}const Tf=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15552
15730
|
import cn from 'classnames';
|
|
15553
15731
|
import { CommonComponentProps } from '../props';
|
|
15554
15732
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16067,4 +16245,4 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
16067
16245
|
</>
|
|
16068
16246
|
);
|
|
16069
16247
|
}
|
|
16070
|
-
`,
|
|
16248
|
+
`,Lf={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/scale_component_1.jpg ",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/scale_component_2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/scale_component_3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/scale_component_4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/scale_component_5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/scale_component_6.jpg",name:""}}]}},If={element:Cf,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:Lf,sourceCode:Tf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Rf=[tu,lu,hf,Yu,rp,hp,kp,Np,Vp,um,tg,ih,ph,Uh,af,If];exports.components=Rf;exports.isSchemaV1=Gl;
|