@cntrl-site/components 1.0.97 → 1.0.98-alpha.2
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/Pretext/Pretext.d.ts +5 -0
- package/dist/Components/Pretext/PretextColumn.d.ts +1 -1
- package/dist/Components/Pretext/hyphenation.d.ts +21 -0
- package/dist/Components/Pretext/textLayout.d.ts +3 -0
- package/dist/export-contract-Ca9b5SgN.js +1 -0
- package/dist/export-contract-DQ4zqboX.mjs +282 -0
- package/dist/index-1HMblVmZ.js +1 -0
- package/dist/index-2JTNRDR1.js +1 -0
- package/dist/index-6Pkh3skU.mjs +45858 -0
- package/dist/index-7g44aFH6.mjs +2406 -0
- package/dist/index-B-0_dAcP.mjs +3966 -0
- package/dist/index-B0n2O6vm.mjs +2740 -0
- package/dist/index-B1vNL0m-.js +1 -0
- package/dist/index-B6E31HBG.js +1 -0
- package/dist/index-BA25un1c.mjs +457 -0
- package/dist/index-BK-G0i5L.js +1 -0
- package/dist/index-B_Fyqx22.mjs +28247 -0
- package/dist/index-BkmSPu6z.js +1 -0
- package/dist/index-BlAuAthm.js +1 -0
- package/dist/index-Bq8huKYW.mjs +2685 -0
- package/dist/index-BrL2zv3x.js +1 -0
- package/dist/index-By2pnaap.mjs +4107 -0
- package/dist/index-C-Y61Lcr.mjs +7087 -0
- package/dist/index-C0IKjloI.mjs +114 -0
- package/dist/index-C0cxTf5o.js +1 -0
- package/dist/index-C2kp589t.mjs +483 -0
- package/dist/index-C7aqOvnk.mjs +6479 -0
- package/dist/index-CADju5Cy.js +1 -0
- package/dist/index-CBQfJnR5.mjs +1469 -0
- package/dist/index-CDO1-R3j.js +1 -0
- package/dist/index-CG_43X7q.js +1 -0
- package/dist/index-CIgabTwE.js +1 -0
- package/dist/index-CJ0NMfJ3.js +1 -0
- package/dist/index-CNFsG2yO.js +1 -0
- package/dist/index-CNGjgoL-.mjs +648 -0
- package/dist/index-CbVelYDh.mjs +212 -0
- package/dist/index-CcAPGjN3.mjs +6188 -0
- package/dist/index-D5u4q2ir.mjs +5660 -0
- package/dist/index-D6ylLL_6.mjs +604 -0
- package/dist/index-DA8t6EZ4.mjs +255 -0
- package/dist/index-DEtZMhOE.mjs +3691 -0
- package/dist/index-DGU-dfFs.mjs +3786 -0
- package/dist/index-DVS4MiPy.mjs +114 -0
- package/dist/index-DapMA5nM.js +1 -0
- package/dist/index-DehKWXGA.js +1 -0
- package/dist/index-DmSeFq2X.mjs +811 -0
- package/dist/index-DtWVe73G.mjs +9278 -0
- package/dist/index-HhE2sJlU.js +1 -0
- package/dist/index-Rwqfce2n.js +1 -0
- package/dist/index-Ypt3vHbi.js +1 -0
- package/dist/index-gBhj9Tcu.js +1 -0
- package/dist/index-kFrlcZxC.js +1 -0
- package/dist/index-kjKI70JX.js +1 -0
- package/dist/index-x_p4zv7D.js +1 -0
- package/dist/index.js +117 -105
- package/dist/index.mjs +9439 -9241
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),Ct=require("classnames"),F=require("./panelAvailability-D8c7cdbu.js"),Xn=require("react-dom");function rg(e){return e.type==="object"&&e.version===1}const ag="ControlSlider-module__wrapper___sHEkd",sg="ControlSlider-module__hoverArrow___A-dOH",lg="ControlSlider-module__sliderItem___QQSkR",cg="ControlSlider-module__sliderImage___9hRl-",dg="ControlSlider-module__arrow___05ghY",ug="ControlSlider-module__arrowVertical___tBfVN",pg="ControlSlider-module__nextArrow___-30Yc",gg="ControlSlider-module__arrowInner___aEra3",mg="ControlSlider-module__arrowIcon___S4ztF",hg="ControlSlider-module__arrowImg___2dwJW",fg="ControlSlider-module__mirror___brd6U",yg="ControlSlider-module__pagination___bicLF",vg="ControlSlider-module__paginationInner___bT-P-",xg="ControlSlider-module__paginationVertical___zYqKw",bg="ControlSlider-module__paginationItem___nTRbk",Sg="ControlSlider-module__dot___p1Qun",wg="ControlSlider-module__activeDot___LHFaj",$g="ControlSlider-module__paginationInsideBottom___R3FWn",Cg="ControlSlider-module__paginationInsideTop___V-qb-",Tg="ControlSlider-module__paginationOutsideBottom___14w8D",Ig="ControlSlider-module__paginationOutsideTop___SCLqB",Lg="ControlSlider-module__paginationInsideLeft___yOBRZ",Pg="ControlSlider-module__paginationInsideRight___Rtt3o",Rg="ControlSlider-module__paginationOutsideLeft___lahaw",Mg="ControlSlider-module__paginationOutsideRight___EtuQa",Eg="ControlSlider-module__imgWrapper___UjEgB",kg="ControlSlider-module__captionBlock___dJ6-j",Ag="ControlSlider-module__captionTextWrapper___HFlpf",Fg="ControlSlider-module__captionText___uGBVc",Ng="ControlSlider-module__active___WZK4G",_g="ControlSlider-module__withPointerEvents___t-18M",Hg="ControlSlider-module__topLeftAlignment___zjnGM",Wg="ControlSlider-module__topCenterAlignment___gD1xW",Og="ControlSlider-module__topRightAlignment___NMapS",Dg="ControlSlider-module__middleLeftAlignment___OnUrY",Bg="ControlSlider-module__middleCenterAlignment___Tdkl0",zg="ControlSlider-module__middleRightAlignment___wEbfX",jg="ControlSlider-module__bottomLeftAlignment___cTP2-",Vg="ControlSlider-module__bottomCenterAlignment___c54fB",Gg="ControlSlider-module__bottomRightAlignment___kEwrz",Xg="ControlSlider-module__clickOverlay___DZA28",Ug="ControlSlider-module__contain___pLyq7",qg="ControlSlider-module__cover___KdDat",$t={wrapper:ag,hoverArrow:sg,sliderItem:lg,sliderImage:cg,arrow:dg,arrowVertical:ug,nextArrow:pg,arrowInner:gg,arrowIcon:mg,arrowImg:hg,mirror:fg,pagination:yg,paginationInner:vg,paginationVertical:xg,paginationItem:bg,dot:Sg,activeDot:wg,paginationInsideBottom:$g,paginationInsideTop:Cg,paginationOutsideBottom:Tg,paginationOutsideTop:Ig,paginationInsideLeft:Lg,paginationInsideRight:Pg,paginationOutsideLeft:Rg,paginationOutsideRight:Mg,imgWrapper:Eg,captionBlock:kg,captionTextWrapper:Ag,captionText:Fg,active:Ng,withPointerEvents:_g,topLeftAlignment:Hg,topCenterAlignment:Wg,topRightAlignment:Og,middleLeftAlignment:Dg,middleCenterAlignment:Bg,middleRightAlignment:zg,bottomLeftAlignment:jg,bottomCenterAlignment:Vg,bottomRightAlignment:Gg,clickOverlay:Xg,contain:Ug,cover:qg};function Yg(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 Kg(e,t,n){return t&&Yg(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var nc="(prefers-reduced-motion: reduce)",go=1,Qg=2,$o=3,Ho=4,Cr=5,sa=6,fa=7,Zg={CREATED:go,MOUNTED:Qg,IDLE:$o,MOVING:Ho,SCROLLING:Cr,DRAGGING:sa,DESTROYED:fa};function li(e){e.length=0}function Mi(e,t,n){return Array.prototype.slice.call(e,t,n)}function Jt(e){return e.bind.apply(e,[null].concat(Mi(arguments,1)))}var ru=setTimeout,_s=function(){};function ic(e){return requestAnimationFrame(e)}function Ra(e,t){return typeof t===e}function dr(e){return!pl(e)&&Ra("object",e)}var ul=Array.isArray,au=Jt(Ra,"function"),Ti=Jt(Ra,"string"),Tr=Jt(Ra,"undefined");function pl(e){return e===null}function su(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Ir(e){return ul(e)?e:[e]}function Mn(e,t){Ir(e).forEach(t)}function gl(e,t){return e.indexOf(t)>-1}function la(e,t){return e.push.apply(e,Ir(t)),e}function ii(e,t,n){e&&Mn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function jn(e,t){ii(e,Ti(t)?t.split(" "):t,!0)}function Lr(e,t){Mn(t,e.appendChild.bind(e))}function ml(e,t){Mn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ur(e,t){return su(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function lu(e,t){var n=e?Mi(e.children):[];return t?n.filter(function(i){return ur(i,t)}):n}function Pr(e,t){return t?lu(e,t)[0]:e.firstElementChild}var pr=Object.keys;function Gi(e,t,n){return e&&(n?pr(e).reverse():pr(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function gr(e){return Mi(arguments,1).forEach(function(t){Gi(t,function(n,i){e[i]=t[i]})}),e}function Si(e){return Mi(arguments,1).forEach(function(t){Gi(t,function(n,i){ul(n)?e[i]=n.slice():dr(n)?e[i]=Si({},dr(e[i])?e[i]:{},n):e[i]=n})}),e}function oc(e,t){Mn(t||pr(e),function(n){delete e[n]})}function Vn(e,t){Mn(e,function(n){Mn(t,function(i){n&&n.removeAttribute(i)})})}function Nt(e,t,n){dr(t)?Gi(t,function(i,o){Nt(e,o,i)}):Mn(e,function(i){pl(n)||n===""?Vn(i,t):i.setAttribute(t,String(n))})}function vo(e,t,n){var i=document.createElement(e);return t&&(Ti(t)?jn(i,t):Nt(i,t)),n&&Lr(n,i),i}function Fn(e,t,n){if(Tr(n))return getComputedStyle(e)[t];pl(n)||(e.style[t]=""+n)}function mr(e,t){Fn(e,"display",t)}function cu(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Nn(e,t){return e.getAttribute(t)}function rc(e,t){return e&&e.classList.contains(t)}function In(e){return e.getBoundingClientRect()}function Ui(e){Mn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function du(e){return Pr(new DOMParser().parseFromString(e,"text/html").body)}function ti(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function uu(e,t){return e&&e.querySelector(t)}function hl(e,t){return t?Mi(e.querySelectorAll(t)):[]}function oi(e,t){ii(e,t,!1)}function Hs(e){return e.timeStamp}function Ai(e){return Ti(e)?e:e?e+"px":""}var Rr="splide",fl="data-"+Rr;function ar(e,t){if(!e)throw new Error("["+Rr+"] "+(t||""))}var Ii=Math.min,ya=Math.max,va=Math.floor,hr=Math.ceil,vn=Math.abs;function pu(e,t,n){return vn(e-t)<n}function ca(e,t,n,i){var o=Ii(t,n),r=ya(t,n);return i?o<e&&e<r:o<=e&&e<=r}function lo(e,t,n){var i=Ii(t,n),o=ya(t,n);return Ii(ya(i,e),o)}function Ws(e){return+(e>0)-+(e<0)}function Os(e,t){return Mn(t,function(n){e=e.replace("%s",""+n)}),e}function yl(e){return e<10?"0"+e:""+e}var ac={};function Jg(e){return""+e+yl(ac[e]=(ac[e]||0)+1)}function gu(){var e=[];function t(l,c,d,u){o(l,c,function(p,y,v){var g="addEventListener"in p,m=g?p.removeEventListener.bind(p,y,d,u):p.removeListener.bind(p,d);g?p.addEventListener(y,d,u):p.addListener(d),e.push([p,y,v,d,m])})}function n(l,c,d){o(l,c,function(u,p,y){e=e.filter(function(v){return v[0]===u&&v[1]===p&&v[2]===y&&(!d||v[3]===d)?(v[4](),!1):!0})})}function i(l,c,d){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(c,{bubbles:p,detail:d}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(c,p,!1,d)),l.dispatchEvent(u),u}function o(l,c,d){Mn(l,function(u){u&&Mn(c,function(p){p.split(" ").forEach(function(y){var v=y.split(".");d(u,v[0],v[1])})})})}function r(){e.forEach(function(l){l[4]()}),li(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var Ei="mounted",Ds="ready",ci="move",Wo="moved",vl="click",mu="active",hu="inactive",fu="visible",yu="hidden",sn="refresh",mn="updated",Co="resize",Ma="resized",vu="drag",xu="dragging",bu="dragged",Ea="scroll",Ki="scrolled",em="overflow",xl="destroy",Su="arrows:mounted",wu="arrows:updated",$u="pagination:mounted",Cu="pagination:updated",bl="navigation:mounted",Sl="autoplay:play",Tu="autoplay:playing",wl="autoplay:pause",$l="lazyload:loaded",Iu="sk",Lu="sh",xa="ei";function nn(e){var t=e?e.event.bus:document.createDocumentFragment(),n=gu();function i(r,l){n.bind(t,Ir(r).join(" "),function(c){l.apply(l,ul(c.detail)?c.detail:[])})}function o(r){n.dispatch(t,r,Mi(arguments,1))}return e&&e.event.on(xl,n.destroy),gr(n,{bus:t,on:i,off:Jt(n.unbind,t),emit:o})}function ka(e,t,n,i){var o=Date.now,r,l=0,c,d=!0,u=0;function p(){if(!d){if(l=e?Ii((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return v();c=ic(p)}}function y(M){M||m(),r=o()-(M?l*e:0),d=!1,c=ic(p)}function v(){d=!0}function g(){r=o(),l=0,n&&n(l)}function m(){c&&cancelAnimationFrame(c),l=0,c=0,d=!0}function x(M){e=M}function b(){return d}return{start:y,rewind:g,pause:v,cancel:m,set:x,isPaused:b}}function tm(e){var t=e;function n(o){t=o}function i(o){return gl(Ir(o),t)}return{set:n,is:i}}function nm(e,t){var n=ka(0,e,null,1);return function(){n.isPaused()&&n.start()}}function im(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=gu(),c=[];function d(){var m=n.mediaQuery==="min";pr(o).sort(function(x,b){return m?+x-+b:+b-+x}).forEach(function(x){p(o[x],"("+(m?"min":"max")+"-width:"+x+"px)")}),p(r,nc),y()}function u(m){m&&l.destroy()}function p(m,x){var b=matchMedia(x);l.bind(b,"change",y),c.push([m,b])}function y(){var m=i.is(fa),x=n.direction,b=c.reduce(function(M,f){return Si(M,f[1].matches?f[0]:{})},{});oc(n),g(b),n.destroy?e.destroy(n.destroy==="completely"):m?(u(!0),e.mount()):x!==n.direction&&e.refresh()}function v(m){matchMedia(nc).matches&&(m?Si(n,r):oc(n,pr(r)))}function g(m,x,b){Si(n,m),x&&Si(Object.getPrototypeOf(n),m),(b||!i.is(go))&&e.emit(mn,n)}return{setup:d,destroy:u,reduce:v,set:g}}var Aa="Arrow",Fa=Aa+"Left",Na=Aa+"Right",Pu=Aa+"Up",Ru=Aa+"Down",sc="rtl",_a="ttb",qa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Pu,Na],ArrowRight:[Ru,Fa]};function om(e,t,n){function i(r,l,c){c=c||n.direction;var d=c===sc&&!l?1:c===_a?0:-1;return qa[r]&&qa[r][d]||r.replace(/width|left|right/i,function(u,p){var y=qa[u.toLowerCase()][d]||u;return p>0?y.charAt(0).toUpperCase()+y.slice(1):y})}function o(r){return r*(n.direction===sc?1:-1)}return{resolve:i,orient:o}}var ri="role",xo="tabindex",rm="disabled",_n="aria-",Mr=_n+"controls",Mu=_n+"current",lc=_n+"selected",Pn=_n+"label",Cl=_n+"labelledby",Eu=_n+"hidden",Tl=_n+"orientation",fr=_n+"roledescription",cc=_n+"live",dc=_n+"busy",uc=_n+"atomic",Il=[ri,xo,rm,Mr,Mu,Pn,Cl,Eu,Tl,fr],Un=Rr+"__",ki="is-",Ya=Rr,pc=Un+"track",am=Un+"list",Ha=Un+"slide",ku=Ha+"--clone",sm=Ha+"__container",Ll=Un+"arrows",Wa=Un+"arrow",Au=Wa+"--prev",Fu=Wa+"--next",Oa=Un+"pagination",Nu=Oa+"__page",lm=Un+"progress",cm=lm+"__bar",dm=Un+"toggle",um=Un+"spinner",pm=Un+"sr",gm=ki+"initialized",qi=ki+"active",_u=ki+"prev",Hu=ki+"next",Bs=ki+"visible",zs=ki+"loading",Wu=ki+"focus-in",Ou=ki+"overflow",mm=[qi,Bs,_u,Hu,zs,Wu,Ou],hm={slide:Ha,clone:ku,arrows:Ll,arrow:Wa,prev:Au,next:Fu,pagination:Oa,page:Nu,spinner:um};function fm(e,t){if(au(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ur(n,t);)n=n.parentElement;return n}var ym=5,gc=200,Du="touchstart mousedown",Ka="touchmove mousemove",Qa="touchend touchcancel mouseup click";function vm(e,t,n){var i=nn(e),o=i.on,r=i.bind,l=e.root,c=n.i18n,d={},u=[],p=[],y=[],v,g,m;function x(){S(),W(),f()}function b(){o(sn,M),o(sn,x),o(mn,f),r(document,Du+" keydown",function(L){m=L.type==="keydown"},{capture:!0}),r(l,"focusin",function(){ii(l,Wu,!!m)})}function M(L){var _=Il.concat("style");li(u),oi(l,p),oi(v,y),Vn([v,g],_),Vn(l,L?_:["style",fr])}function f(){oi(l,p),oi(v,y),p=z(Ya),y=z(pc),jn(l,p),jn(v,y),Nt(l,Pn,n.label),Nt(l,Cl,n.labelledby)}function S(){v=q("."+pc),g=Pr(v,"."+am),ar(v&&g,"A track/list element is missing."),la(u,lu(g,"."+Ha+":not(."+ku+")")),Gi({arrows:Ll,pagination:Oa,prev:Au,next:Fu,bar:cm,toggle:dm},function(L,_){d[_]=q("."+L)}),gr(d,{root:l,track:v,list:g,slides:u})}function W(){var L=l.id||Jg(Rr),_=n.role;l.id=L,v.id=v.id||L+"-track",g.id=g.id||L+"-list",!Nn(l,ri)&&l.tagName!=="SECTION"&&_&&Nt(l,ri,_),Nt(l,fr,c.carousel),Nt(g,ri,"presentation")}function q(L){var _=uu(l,L);return _&&fm(_,"."+Ya)===l?_:void 0}function z(L){return[L+"--"+n.type,L+"--"+n.direction,n.drag&&L+"--draggable",n.isNavigation&&L+"--nav",L===Ya&&qi]}return gr(d,{setup:x,mount:b,destroy:M})}var To="slide",Oo="loop",Er="fade";function xm(e,t,n,i){var o=nn(e),r=o.on,l=o.emit,c=o.bind,d=e.Components,u=e.root,p=e.options,y=p.isNavigation,v=p.updateOnMove,g=p.i18n,m=p.pagination,x=p.slideFocus,b=d.Direction.resolve,M=Nn(i,"style"),f=Nn(i,Pn),S=n>-1,W=Pr(i,"."+sm),q;function z(){S||(i.id=u.id+"-slide"+yl(t+1),Nt(i,ri,m?"tabpanel":"group"),Nt(i,fr,g.slide),Nt(i,Pn,f||Os(g.slideLabel,[t+1,e.length]))),L()}function L(){c(i,"click",Jt(l,vl,U)),c(i,"keydown",Jt(l,Iu,U)),r([Wo,Lu,Ki],I),r(bl,G),v&&r(ci,$)}function _(){q=!0,o.destroy(),oi(i,mm),Vn(i,Il),Nt(i,"style",M),Nt(i,Pn,f||"")}function G(){var P=e.splides.map(function(A){var j=A.splide.Components.Slides.getAt(t);return j?j.slide.id:""}).join(" ");Nt(i,Pn,Os(g.slideX,(S?n:t)+1)),Nt(i,Mr,P),Nt(i,ri,x?"button":""),x&&Vn(i,fr)}function $(){q||I()}function I(){if(!q){var P=e.index;D(),E(),ii(i,_u,t===P-1),ii(i,Hu,t===P+1)}}function D(){var P=C();P!==rc(i,qi)&&(ii(i,qi,P),Nt(i,Mu,y&&P||""),l(P?mu:hu,U))}function E(){var P=V(),A=!P&&(!C()||S);if(e.state.is([Ho,Cr])||Nt(i,Eu,A||""),Nt(hl(i,p.focusableNodes||""),xo,A?-1:""),x&&Nt(i,xo,A?-1:0),P!==rc(i,Bs)&&(ii(i,Bs,P),l(P?fu:yu,U)),!P&&document.activeElement===i){var j=d.Slides.getAt(e.index);j&&cu(j.slide)}}function T(P,A,j){Fn(j&&W||i,P,A)}function C(){var P=e.index;return P===t||p.cloneStatus&&P===n}function V(){if(e.is(Er))return C();var P=In(d.Elements.track),A=In(i),j=b("left",!0),ie=b("right",!0);return va(P[j])<=hr(A[j])&&va(A[ie])<=hr(P[ie])}function w(P,A){var j=vn(P-t);return!S&&(p.rewind||e.is(Oo))&&(j=Ii(j,e.length-j)),j<=A}var U={index:t,slideIndex:n,slide:i,container:W,isClone:S,mount:z,destroy:_,update:I,style:T,isWithin:w};return U}function bm(e,t,n){var i=nn(e),o=i.on,r=i.emit,l=i.bind,c=t.Elements,d=c.slides,u=c.list,p=[];function y(){v(),o(sn,g),o(sn,v)}function v(){d.forEach(function(I,D){x(I,D,-1)})}function g(){q(function(I){I.destroy()}),li(p)}function m(){q(function(I){I.update()})}function x(I,D,E){var T=xm(e,D,E,I);T.mount(),p.push(T),p.sort(function(C,V){return C.index-V.index})}function b(I){return I?z(function(D){return!D.isClone}):p}function M(I){var D=t.Controller,E=D.toIndex(I),T=D.hasFocus()?1:n.perPage;return z(function(C){return ca(C.index,E,E+T-1)})}function f(I){return z(I)[0]}function S(I,D){Mn(I,function(E){if(Ti(E)&&(E=du(E)),su(E)){var T=d[D];T?ml(E,T):Lr(u,E),jn(E,n.classes.slide),_(E,Jt(r,Co))}}),r(sn)}function W(I){Ui(z(I).map(function(D){return D.slide})),r(sn)}function q(I,D){b(D).forEach(I)}function z(I){return p.filter(au(I)?I:function(D){return Ti(I)?ur(D.slide,I):gl(Ir(I),D.index)})}function L(I,D,E){q(function(T){T.style(I,D,E)})}function _(I,D){var E=hl(I,"img"),T=E.length;T?E.forEach(function(C){l(C,"load error",function(){--T||D()})}):D()}function G(I){return I?d.length:p.length}function $(){return p.length>n.perPage}return{mount:y,destroy:g,update:m,register:x,get:b,getIn:M,getAt:f,add:S,remove:W,forEach:q,filter:z,style:L,getLength:G,isEnough:$}}function Sm(e,t,n){var i=nn(e),o=i.on,r=i.bind,l=i.emit,c=t.Slides,d=t.Direction.resolve,u=t.Elements,p=u.root,y=u.track,v=u.list,g=c.getAt,m=c.style,x,b,M;function f(){S(),r(window,"resize load",nm(Jt(l,Co))),o([mn,sn],S),o(Co,W)}function S(){x=n.direction===_a,Fn(p,"maxWidth",Ai(n.width)),Fn(y,d("paddingLeft"),q(!1)),Fn(y,d("paddingRight"),q(!0)),W(!0)}function W(U){var P=In(p);(U||b.width!==P.width||b.height!==P.height)&&(Fn(y,"height",z()),m(d("marginRight"),Ai(n.gap)),m("width",_()),m("height",G(),!0),b=P,l(Ma),M!==(M=w())&&(ii(p,Ou,M),l(em,M)))}function q(U){var P=n.padding,A=d(U?"right":"left");return P&&Ai(P[A]||(dr(P)?0:P))||"0px"}function z(){var U="";return x&&(U=L(),ar(U,"height or heightRatio is missing."),U="calc("+U+" - "+q(!1)+" - "+q(!0)+")"),U}function L(){return Ai(n.height||In(v).width*n.heightRatio)}function _(){return n.autoWidth?null:Ai(n.fixedWidth)||(x?"":$())}function G(){return Ai(n.fixedHeight)||(x?n.autoHeight?null:$():L())}function $(){var U=Ai(n.gap);return"calc((100%"+(U&&" + "+U)+")/"+(n.perPage||1)+(U&&" - "+U)+")"}function I(){return In(v)[d("width")]}function D(U,P){var A=g(U||0);return A?In(A.slide)[d("width")]+(P?0:C()):0}function E(U,P){var A=g(U);if(A){var j=In(A.slide)[d("right")],ie=In(v)[d("left")];return vn(j-ie)+(P?0:C())}return 0}function T(U){return E(e.length-1)-E(0)+D(0,U)}function C(){var U=g(0);return U&&parseFloat(Fn(U.slide,d("marginRight")))||0}function V(U){return parseFloat(Fn(y,d("padding"+(U?"Right":"Left"))))||0}function w(){return e.is(Er)||T(!0)>I()}return{mount:f,resize:W,listSize:I,slideSize:D,sliderSize:T,totalSize:E,getPadding:V,isOverflow:w}}var wm=2;function $m(e,t,n){var i=nn(e),o=i.on,r=t.Elements,l=t.Slides,c=t.Direction.resolve,d=[],u;function p(){o(sn,y),o([mn,Co],g),(u=b())&&(m(u),t.Layout.resize(!0))}function y(){v(),p()}function v(){Ui(d),li(d),i.destroy()}function g(){var M=b();u!==M&&(u<M||!M)&&i.emit(sn)}function m(M){var f=l.get().slice(),S=f.length;if(S){for(;f.length<M;)la(f,f);la(f.slice(-M),f.slice(0,M)).forEach(function(W,q){var z=q<M,L=x(W.slide,q);z?ml(L,f[0].slide):Lr(r.list,L),la(d,L),l.register(L,q-M+(z?0:S),W.index)})}}function x(M,f){var S=M.cloneNode(!0);return jn(S,n.classes.clone),S.id=e.root.id+"-clone"+yl(f+1),S}function b(){var M=n.clones;if(!e.is(Oo))M=0;else if(Tr(M)){var f=n[c("fixedWidth")]&&t.Layout.slideSize(0),S=f&&hr(In(r.track)[c("width")]/f);M=S||n[c("autoWidth")]&&e.length||n.perPage*wm}return M}return{mount:p,destroy:v}}function Cm(e,t,n){var i=nn(e),o=i.on,r=i.emit,l=e.state.set,c=t.Layout,d=c.slideSize,u=c.getPadding,p=c.totalSize,y=c.listSize,v=c.sliderSize,g=t.Direction,m=g.resolve,x=g.orient,b=t.Elements,M=b.list,f=b.track,S;function W(){S=t.Transition,o([Ei,Ma,mn,sn],q)}function q(){t.Controller.isBusy()||(t.Scroll.cancel(),L(e.index),t.Slides.update())}function z(A,j,ie,ae){A!==j&&U(A>ie)&&(I(),_($(T(),A>ie),!0)),l(Ho),r(ci,j,ie,A),S.start(j,function(){l($o),r(Wo,j,ie,A),ae&&ae()})}function L(A){_(E(A,!0))}function _(A,j){if(!e.is(Er)){var ie=j?A:G(A);Fn(M,"transform","translate"+m("X")+"("+ie+"px)"),A!==ie&&r(Lu)}}function G(A){if(e.is(Oo)){var j=D(A),ie=j>t.Controller.getEnd(),ae=j<0;(ae||ie)&&(A=$(A,ie))}return A}function $(A,j){var ie=A-w(j),ae=v();return A-=x(ae*(hr(vn(ie)/ae)||1))*(j?1:-1),A}function I(){_(T(),!0),S.cancel()}function D(A){for(var j=t.Slides.get(),ie=0,ae=1/0,O=0;O<j.length;O++){var re=j[O].index,N=vn(E(re,!0)-A);if(N<=ae)ae=N,ie=re;else break}return ie}function E(A,j){var ie=x(p(A-1)-V(A));return j?C(ie):ie}function T(){var A=m("left");return In(M)[A]-In(f)[A]+x(u(!1))}function C(A){return n.trimSpace&&e.is(To)&&(A=lo(A,0,x(v(!0)-y()))),A}function V(A){var j=n.focus;return j==="center"?(y()-d(A,!0))/2:+j*d(A)||0}function w(A){return E(A?t.Controller.getEnd():0,!!n.trimSpace)}function U(A){var j=x($(T(),A));return A?j>=0:j<=M[m("scrollWidth")]-In(f)[m("width")]}function P(A,j){j=Tr(j)?T():j;var ie=A!==!0&&x(j)<x(w(!1)),ae=A!==!1&&x(j)>x(w(!0));return ie||ae}return{mount:W,move:z,jump:L,translate:_,shift:$,cancel:I,toIndex:D,toPosition:E,getPosition:T,getLimit:w,exceededLimit:P,reposition:q}}function Tm(e,t,n){var i=nn(e),o=i.on,r=i.emit,l=t.Move,c=l.getPosition,d=l.getLimit,u=l.toPosition,p=t.Slides,y=p.isEnough,v=p.getLength,g=n.omitEnd,m=e.is(Oo),x=e.is(To),b=Jt(T,!1),M=Jt(T,!0),f=n.start||0,S,W=f,q,z,L;function _(){G(),o([mn,sn,xa],G),o(Ma,$)}function G(){q=v(!0),z=n.perMove,L=n.perPage,S=U();var N=lo(f,0,g?S:q-1);N!==f&&(f=N,l.reposition())}function $(){S!==U()&&r(xa)}function I(N,le,J){if(!re()){var be=E(N),Le=w(be);Le>-1&&(le||Le!==f)&&(ie(Le),l.move(be,Le,W,J))}}function D(N,le,J,be){t.Scroll.scroll(N,le,J,function(){var Le=w(l.toIndex(c()));ie(g?Ii(Le,S):Le),be&&be()})}function E(N){var le=f;if(Ti(N)){var J=N.match(/([+\-<>])(\d+)?/)||[],be=J[1],Le=J[2];be==="+"||be==="-"?le=C(f+ +(""+be+(+Le||1)),f):be===">"?le=Le?P(+Le):b(!0):be==="<"&&(le=M(!0))}else le=m?N:lo(N,0,S);return le}function T(N,le){var J=z||(O()?1:L),be=C(f+J*(N?-1:1),f,!(z||O()));return be===-1&&x&&!pu(c(),d(!N),1)?N?0:S:le?be:w(be)}function C(N,le,J){if(y()||O()){var be=V(N);be!==N&&(le=N,N=be,J=!1),N<0||N>S?!z&&(ca(0,N,le,!0)||ca(S,le,N,!0))?N=P(A(N)):m?N=J?N<0?-(q%L||L):q:N:n.rewind?N=N<0?S:0:N=-1:J&&N!==le&&(N=P(A(le)+(N<le?-1:1)))}else N=-1;return N}function V(N){if(x&&n.trimSpace==="move"&&N!==f)for(var le=c();le===u(N,!0)&&ca(N,0,e.length-1,!n.rewind);)N<f?--N:++N;return N}function w(N){return m?(N+q)%q||0:N}function U(){for(var N=q-(O()||m&&z?1:L);g&&N-- >0;)if(u(q-1,!0)!==u(N,!0)){N++;break}return lo(N,0,q-1)}function P(N){return lo(O()?N:L*N,0,S)}function A(N){return O()?Ii(N,S):va((N>=S?q-1:N)/L)}function j(N){var le=l.toIndex(N);return x?lo(le,0,S):le}function ie(N){N!==f&&(W=f,f=N)}function ae(N){return N?W:f}function O(){return!Tr(n.focus)||n.isNavigation}function re(){return e.state.is([Ho,Cr])&&!!n.waitForTransition}return{mount:_,go:I,scroll:D,getNext:b,getPrev:M,getAdjacent:T,getEnd:U,setIndex:ie,getIndex:ae,toIndex:P,toPage:A,toDest:j,hasFocus:O,isBusy:re}}var Im="http://www.w3.org/2000/svg",Lm="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",Hr=40;function Pm(e,t,n){var i=nn(e),o=i.on,r=i.bind,l=i.emit,c=n.classes,d=n.i18n,u=t.Elements,p=t.Controller,y=u.arrows,v=u.track,g=y,m=u.prev,x=u.next,b,M,f={};function S(){q(),o(mn,W)}function W(){z(),S()}function q(){var D=n.arrows;D&&!(m&&x)&&G(),m&&x&&(gr(f,{prev:m,next:x}),mr(g,D?"":"none"),jn(g,M=Ll+"--"+n.direction),D&&(L(),I(),Nt([m,x],Mr,v.id),l(Su,m,x)))}function z(){i.destroy(),oi(g,M),b?(Ui(y?[m,x]:g),m=x=null):Vn([m,x],Il)}function L(){o([Ei,Wo,sn,Ki,xa],I),r(x,"click",Jt(_,">")),r(m,"click",Jt(_,"<"))}function _(D){p.go(D,!0)}function G(){g=y||vo("div",c.arrows),m=$(!0),x=$(!1),b=!0,Lr(g,[m,x]),!y&&ml(g,v)}function $(D){var E='<button class="'+c.arrow+" "+(D?c.prev:c.next)+'" type="button"><svg xmlns="'+Im+'" viewBox="0 0 '+Hr+" "+Hr+'" width="'+Hr+'" height="'+Hr+'" focusable="false"><path d="'+(n.arrowPath||Lm)+'" />';return du(E)}function I(){if(m&&x){var D=e.index,E=p.getPrev(),T=p.getNext(),C=E>-1&&D<E?d.last:d.prev,V=T>-1&&D>T?d.first:d.next;m.disabled=E<0,x.disabled=T<0,Nt(m,Pn,C),Nt(x,Pn,V),l(wu,m,x,E,T)}}return{arrows:f,mount:S,destroy:z,update:I}}var Rm=fl+"-interval";function Mm(e,t,n){var i=nn(e),o=i.on,r=i.bind,l=i.emit,c=ka(n.interval,e.go.bind(e,">"),L),d=c.isPaused,u=t.Elements,p=t.Elements,y=p.root,v=p.toggle,g=n.autoplay,m,x,b=g==="pause";function M(){g&&(f(),v&&Nt(v,Mr,u.track.id),b||S(),z())}function f(){n.pauseOnHover&&r(y,"mouseenter mouseleave",function(G){m=G.type==="mouseenter",q()}),n.pauseOnFocus&&r(y,"focusin focusout",function(G){x=G.type==="focusin",q()}),v&&r(v,"click",function(){b?S():W(!0)}),o([ci,Ea,sn],c.rewind),o(ci,_)}function S(){d()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),x=m=b=!1,z(),l(Sl))}function W(G){G===void 0&&(G=!0),b=!!G,z(),d()||(c.pause(),l(wl))}function q(){b||(m||x?W(!1):S())}function z(){v&&(ii(v,qi,!b),Nt(v,Pn,n.i18n[b?"play":"pause"]))}function L(G){var $=u.bar;$&&Fn($,"width",G*100+"%"),l(Tu,G)}function _(G){var $=t.Slides.getAt(G);c.set($&&+Nn($.slide,Rm)||n.interval)}return{mount:M,destroy:c.cancel,play:S,pause:W,isPaused:d}}function Em(e,t,n){var i=nn(e),o=i.on;function r(){n.cover&&(o($l,Jt(c,!0)),o([Ei,mn,sn],Jt(l,!0)))}function l(d){t.Slides.forEach(function(u){var p=Pr(u.container||u.slide,"img");p&&p.src&&c(d,p,u)})}function c(d,u,p){p.style("background",d?'center/cover no-repeat url("'+u.src+'")':"",!0),mr(u,d?"none":"")}return{mount:r,destroy:Jt(l,!1)}}var km=10,Am=600,Fm=.6,Nm=1.5,_m=800;function Hm(e,t,n){var i=nn(e),o=i.on,r=i.emit,l=e.state.set,c=t.Move,d=c.getPosition,u=c.getLimit,p=c.exceededLimit,y=c.translate,v=e.is(To),g,m,x=1;function b(){o(ci,W),o([mn,sn],q)}function M(L,_,G,$,I){var D=d();if(W(),G&&(!v||!p())){var E=t.Layout.sliderSize(),T=Ws(L)*E*va(vn(L)/E)||0;L=c.toPosition(t.Controller.toDest(L%E))+T}var C=pu(D,L,1);x=1,_=C?0:_||ya(vn(L-D)/Nm,_m),m=$,g=ka(_,f,Jt(S,D,L,I),1),l(Cr),r(Ea),g.start()}function f(){l($o),m&&m(),r(Ki)}function S(L,_,G,$){var I=d(),D=L+(_-L)*z($),E=(D-I)*x;y(I+E),v&&!G&&p()&&(x*=Fm,vn(E)<km&&M(u(p(!0)),Am,!1,m,!0))}function W(){g&&g.cancel()}function q(){g&&!g.isPaused()&&(W(),f())}function z(L){var _=n.easingFunc;return _?_(L):1-Math.pow(1-L,4)}return{mount:b,destroy:W,scroll:M,cancel:q}}var co={passive:!1,capture:!0};function Wm(e,t,n){var i=nn(e),o=i.on,r=i.emit,l=i.bind,c=i.unbind,d=e.state,u=t.Move,p=t.Scroll,y=t.Controller,v=t.Elements.track,g=t.Media.reduce,m=t.Direction,x=m.resolve,b=m.orient,M=u.getPosition,f=u.exceededLimit,S,W,q,z,L,_=!1,G,$,I;function D(){l(v,Ka,_s,co),l(v,Qa,_s,co),l(v,Du,T,co),l(v,"click",w,{capture:!0}),l(v,"dragstart",ti),o([Ei,mn],E)}function E(){var K=n.drag;ce(!K),z=K==="free"}function T(K){if(G=!1,!$){var se=Le(K);be(K.target)&&(se||!K.button)&&(y.isBusy()?ti(K,!0):(I=se?v:window,L=d.is([Ho,Cr]),q=null,l(I,Ka,C,co),l(I,Qa,V,co),u.cancel(),p.cancel(),U(K)))}}function C(K){if(d.is(sa)||(d.set(sa),r(vu)),K.cancelable)if(L){u.translate(S+J(O(K)));var se=re(K)>gc,pe=_!==(_=f());(se||pe)&&U(K),G=!0,r(xu),ti(K)}else j(K)&&(L=A(K),ti(K))}function V(K){d.is(sa)&&(d.set($o),r(bu)),L&&(P(K),ti(K)),c(I,Ka,C),c(I,Qa,V),L=!1}function w(K){!$&&G&&ti(K,!0)}function U(K){q=W,W=K,S=M()}function P(K){var se=ie(K),pe=ae(se),fe=n.rewind&&n.rewindByDrag;g(!1),z?y.scroll(pe,0,n.snap):e.is(Er)?y.go(b(Ws(se))<0?fe?"<":"-":fe?">":"+"):e.is(To)&&_&&fe?y.go(f(!0)?">":"<"):y.go(y.toDest(pe),!0),g(!0)}function A(K){var se=n.dragMinThreshold,pe=dr(se),fe=pe&&se.mouse||0,we=(pe?se.touch:+se)||10;return vn(O(K))>(Le(K)?we:fe)}function j(K){return vn(O(K))>vn(O(K,!0))}function ie(K){if(e.is(Oo)||!_){var se=re(K);if(se&&se<gc)return O(K)/se}return 0}function ae(K){return M()+Ws(K)*Ii(vn(K)*(n.flickPower||600),z?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function O(K,se){return le(K,se)-le(N(K),se)}function re(K){return Hs(K)-Hs(N(K))}function N(K){return W===K&&q||W}function le(K,se){return(Le(K)?K.changedTouches[0]:K)["page"+x(se?"Y":"X")]}function J(K){return K/(_&&e.is(To)?ym:1)}function be(K){var se=n.noDrag;return!ur(K,"."+Nu+", ."+Wa)&&(!se||!ur(K,se))}function Le(K){return typeof TouchEvent<"u"&&K instanceof TouchEvent}function ye(){return L}function ce(K){$=K}return{mount:D,disable:ce,isDragging:ye}}var Om={Spacebar:" ",Right:Na,Left:Fa,Up:Pu,Down:Ru};function Pl(e){return e=Ti(e)?e:e.key,Om[e]||e}var mc="keydown";function Dm(e,t,n){var i=nn(e),o=i.on,r=i.bind,l=i.unbind,c=e.root,d=t.Direction.resolve,u,p;function y(){v(),o(mn,g),o(mn,v),o(ci,x)}function v(){var M=n.keyboard;M&&(u=M==="global"?window:c,r(u,mc,b))}function g(){l(u,mc)}function m(M){p=M}function x(){var M=p;p=!0,ru(function(){p=M})}function b(M){if(!p){var f=Pl(M);f===d(Fa)?e.go("<"):f===d(Na)&&e.go(">")}}return{mount:y,destroy:g,disable:m}}var sr=fl+"-lazy",da=sr+"-srcset",Bm="["+sr+"], ["+da+"]";function zm(e,t,n){var i=nn(e),o=i.on,r=i.off,l=i.bind,c=i.emit,d=n.lazyLoad==="sequential",u=[Wo,Ki],p=[];function y(){n.lazyLoad&&(v(),o(sn,v))}function v(){li(p),g(),d?M():(r(u),o(u,m),m())}function g(){t.Slides.forEach(function(f){hl(f.slide,Bm).forEach(function(S){var W=Nn(S,sr),q=Nn(S,da);if(W!==S.src||q!==S.srcset){var z=n.classes.spinner,L=S.parentElement,_=Pr(L,"."+z)||vo("span",z,L);p.push([S,f,_]),S.src||mr(S,"none")}})})}function m(){p=p.filter(function(f){var S=n.perPage*((n.preloadPages||1)+1)-1;return f[1].isWithin(e.index,S)?x(f):!0}),p.length||r(u)}function x(f){var S=f[0];jn(f[1].slide,zs),l(S,"load error",Jt(b,f)),Nt(S,"src",Nn(S,sr)),Nt(S,"srcset",Nn(S,da)),Vn(S,sr),Vn(S,da)}function b(f,S){var W=f[0],q=f[1];oi(q.slide,zs),S.type!=="error"&&(Ui(f[2]),mr(W,""),c($l,W,q),c(Co)),d&&M()}function M(){p.length&&x(p.shift())}return{mount:y,destroy:Jt(li,p),check:m}}function jm(e,t,n){var i=nn(e),o=i.on,r=i.emit,l=i.bind,c=t.Slides,d=t.Elements,u=t.Controller,p=u.hasFocus,y=u.getIndex,v=u.go,g=t.Direction.resolve,m=d.pagination,x=[],b,M;function f(){S(),o([mn,sn,xa],f);var $=n.pagination;m&&mr(m,$?"":"none"),$&&(o([ci,Ea,Ki],G),W(),G(),r($u,{list:b,items:x},_(e.index)))}function S(){b&&(Ui(m?Mi(b.children):b),oi(b,M),li(x),b=null),i.destroy()}function W(){var $=e.length,I=n.classes,D=n.i18n,E=n.perPage,T=p()?u.getEnd()+1:hr($/E);b=m||vo("ul",I.pagination,d.track.parentElement),jn(b,M=Oa+"--"+L()),Nt(b,ri,"tablist"),Nt(b,Pn,D.select),Nt(b,Tl,L()===_a?"vertical":"");for(var C=0;C<T;C++){var V=vo("li",null,b),w=vo("button",{class:I.page,type:"button"},V),U=c.getIn(C).map(function(A){return A.slide.id}),P=!p()&&E>1?D.pageX:D.slideX;l(w,"click",Jt(q,C)),n.paginationKeyboard&&l(w,"keydown",Jt(z,C)),Nt(V,ri,"presentation"),Nt(w,ri,"tab"),Nt(w,Mr,U.join(" ")),Nt(w,Pn,Os(P,C+1)),Nt(w,xo,-1),x.push({li:V,button:w,page:C})}}function q($){v(">"+$,!0)}function z($,I){var D=x.length,E=Pl(I),T=L(),C=-1;E===g(Na,!1,T)?C=++$%D:E===g(Fa,!1,T)?C=(--$+D)%D:E==="Home"?C=0:E==="End"&&(C=D-1);var V=x[C];V&&(cu(V.button),v(">"+C),ti(I,!0))}function L(){return n.paginationDirection||n.direction}function _($){return x[u.toPage($)]}function G(){var $=_(y(!0)),I=_(y());if($){var D=$.button;oi(D,qi),Vn(D,lc),Nt(D,xo,-1)}if(I){var E=I.button;jn(E,qi),Nt(E,lc,!0),Nt(E,xo,"")}r(Cu,{list:b,items:x},$,I)}return{items:x,mount:f,destroy:S,getAt:_,update:G}}var Vm=[" ","Enter"];function Gm(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(m){m.isParent||(u(e,m.splide),u(m.splide,e))}),i&&p()}function c(){r.forEach(function(m){m.destroy()}),li(r)}function d(){c(),l()}function u(m,x){var b=nn(m);b.on(ci,function(M,f,S){x.go(x.is(Oo)?S:M)}),r.push(b)}function p(){var m=nn(e),x=m.on;x(vl,v),x(Iu,g),x([Ei,mn],y),r.push(m),m.emit(bl,e.splides)}function y(){Nt(t.Elements.list,Tl,n.direction===_a?"vertical":"")}function v(m){e.go(m.index)}function g(m,x){gl(Vm,Pl(x))&&(v(m),ti(x))}return{setup:Jt(t.Media.set,{slideFocus:Tr(o)?i:o},!0),mount:l,destroy:c,remount:d}}function Xm(e,t,n){var i=nn(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",c,co)}function c(u){if(u.cancelable){var p=u.deltaY,y=p<0,v=Hs(u),g=n.wheelMinThreshold||0,m=n.wheelSleep||0;vn(p)>g&&v-r>m&&(e.go(y?"<":">"),r=v),d(y)&&ti(u)}}function d(u){return!n.releaseWheel||e.state.is(Ho)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Um=90;function qm(e,t,n){var i=nn(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,c=vo("span",pm),d=ka(Um,Jt(p,!1));function u(){l&&(v(!t.Autoplay.isPaused()),Nt(r,uc,!0),c.textContent="…",o(Sl,Jt(v,!0)),o(wl,Jt(v,!1)),o([Wo,Ki],Jt(p,!0)))}function p(g){Nt(r,dc,g),g?(Lr(r,c),d.start()):(Ui(c),d.cancel())}function y(){Vn(r,[cc,uc,dc]),Ui(c)}function v(g){l&&Nt(r,cc,g?"off":"polite")}return{mount:u,disable:v,destroy:y}}var Ym=Object.freeze({__proto__:null,Media:im,Direction:om,Elements:vm,Slides:bm,Layout:Sm,Clones:$m,Move:Cm,Controller:Tm,Arrows:Pm,Autoplay:Mm,Cover:Em,Scroll:Hm,Drag:Wm,Keyboard:Dm,LazyLoad:zm,Pagination:jm,Sync:Gm,Wheel:Xm,Live:qm}),Km={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"},Qm={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:hm,i18n:Km,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Zm(e,t,n){var i=t.Slides;function o(){nn(e).on([Ei,sn],r)}function r(){i.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function l(c,d){i.style("transition","opacity "+n.speed+"ms "+n.easing),ru(d)}return{mount:o,start:l,cancel:_s}}function Jm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,c=Jt(Fn,l,"transition"),d;function u(){nn(e).bind(l,"transitionend",function(g){g.target===l&&d&&(y(),d())})}function p(g,m){var x=i.toPosition(g,!0),b=i.getPosition(),M=v(g);vn(x-b)>=1&&M>=1?n.useScroll?r.scroll(x,M,!1,m):(c("transform "+M+"ms "+n.easing),i.translate(x,!0),d=m):(i.jump(g),m())}function y(){c(""),r.cancel()}function v(g){var m=n.rewindSpeed;if(e.is(To)&&m){var x=o.getIndex(!0),b=o.getEnd();if(x===0&&g>=b||x>=b&&g===0)return m}return n.speed}return{mount:u,start:p,cancel:y}}var eh=(function(){function e(n,i){this.event=nn(),this.Components={},this.state=tm(go),this.splides=[],this._o={},this._E={};var o=Ti(n)?uu(document,n):n;ar(o,o+" is invalid."),this.root=o,i=Si({label:Nn(o,Pn)||"",labelledby:Nn(o,Cl)||""},Qm,e.defaults,i||{});try{Si(i,JSON.parse(Nn(o,fl)))}catch{ar(!1,"Invalid JSON")}this._o=Object.create(Si({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,c=this.Components;ar(l.is([go,fa]),"Already mounted!"),l.set(go),this._C=c,this._T=o||this._T||(this.is(Er)?Zm:Jm),this._E=i||this._E;var d=gr({},Ym,this._E,{Transition:this._T});return Gi(d,function(u,p){var y=u(r,c,r._o);c[p]=y,y.setup&&y.setup()}),Gi(c,function(u){u.mount&&u.mount()}),this.emit(Ei),jn(this.root,gm),l.set($o),this.emit(Ds),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is($o)&&(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(Mi(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(sn),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(go)?nn(this).on(Ds,this.destroy.bind(this,i)):(Gi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(xl),o.destroy(),i&&li(this.splides),r.set(fa)),this},Kg(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})(),Rl=eh;Rl.defaults={};Rl.STATES=Zg;var hc=[[Ei,"onMounted"],[Ds,"onReady"],[ci,"onMove"],[Wo,"onMoved"],[vl,"onClick"],[mu,"onActive"],[hu,"onInactive"],[fu,"onVisible"],[yu,"onHidden"],[sn,"onRefresh"],[mn,"onUpdated"],[Co,"onResize"],[Ma,"onResized"],[vu,"onDrag"],[xu,"onDragging"],[bu,"onDragged"],[Ea,"onScroll"],[Ki,"onScrolled"],[xl,"onDestroy"],[Su,"onArrowsMounted"],[wu,"onArrowsUpdated"],[$u,"onPaginationMounted"],[Cu,"onPaginationUpdated"],[bl,"onNavigationMounted"],[Sl,"onAutoplayPlay"],[Tu,"onAutoplayPlaying"],[wl,"onAutoplayPause"],[$l,"onLazyLoadLoaded"]];function Ml(...e){return e.filter(Boolean).join(" ")}function ba(e){return e!==null&&typeof e=="object"}function js(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!js(n,t[i]));if(ba(e)&&ba(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!js(e[o],t[o]))}return e===t}function th(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function nh(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 Vs(e,t){const n=e;return nh(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ba(i)?n[o]=Vs(ba(n[o])?n[o]:{},i):n[o]=i}),n}var ih=({children:e,className:t,...n})=>s.createElement("div",{className:Ml("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),El=class extends s.Component{constructor(){super(...arguments),this.splideRef=s.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Rl(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Vs({},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&&!js(this.options,e)&&(this.splide.options=e,this.options=Vs({},e));const t=this.getSlides();th(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){hc.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 s.createElement(t,{className:Ml("splide",e),ref:this.splideRef,...this.omit(o,["options",...hc.map(r=>r[1])])},n?s.createElement(ih,null,i):i)}},kl=({children:e,className:t,...n})=>s.createElement("li",{className:Ml("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),Rt=require("classnames"),A=require("./panelAvailability-D8c7cdbu.js"),Un=require("react-dom");function um(e){return e.type==="object"&&e.version===1}const pm="ControlSlider-module__wrapper___sHEkd",mm="ControlSlider-module__hoverArrow___A-dOH",gm="ControlSlider-module__sliderItem___QQSkR",hm="ControlSlider-module__sliderImage___9hRl-",fm="ControlSlider-module__arrow___05ghY",ym="ControlSlider-module__arrowVertical___tBfVN",vm="ControlSlider-module__nextArrow___-30Yc",xm="ControlSlider-module__arrowInner___aEra3",bm="ControlSlider-module__arrowIcon___S4ztF",Sm="ControlSlider-module__arrowImg___2dwJW",wm="ControlSlider-module__mirror___brd6U",$m="ControlSlider-module__pagination___bicLF",Cm="ControlSlider-module__paginationInner___bT-P-",Tm="ControlSlider-module__paginationVertical___zYqKw",Im="ControlSlider-module__paginationItem___nTRbk",Lm="ControlSlider-module__dot___p1Qun",Pm="ControlSlider-module__activeDot___LHFaj",Rm="ControlSlider-module__paginationInsideBottom___R3FWn",Mm="ControlSlider-module__paginationInsideTop___V-qb-",Em="ControlSlider-module__paginationOutsideBottom___14w8D",km="ControlSlider-module__paginationOutsideTop___SCLqB",Am="ControlSlider-module__paginationInsideLeft___yOBRZ",Fm="ControlSlider-module__paginationInsideRight___Rtt3o",Nm="ControlSlider-module__paginationOutsideLeft___lahaw",_m="ControlSlider-module__paginationOutsideRight___EtuQa",Hm="ControlSlider-module__imgWrapper___UjEgB",Wm="ControlSlider-module__captionBlock___dJ6-j",Om="ControlSlider-module__captionTextWrapper___HFlpf",Dm="ControlSlider-module__captionText___uGBVc",Bm="ControlSlider-module__active___WZK4G",zm="ControlSlider-module__withPointerEvents___t-18M",jm="ControlSlider-module__topLeftAlignment___zjnGM",Vm="ControlSlider-module__topCenterAlignment___gD1xW",Gm="ControlSlider-module__topRightAlignment___NMapS",Xm="ControlSlider-module__middleLeftAlignment___OnUrY",qm="ControlSlider-module__middleCenterAlignment___Tdkl0",Um="ControlSlider-module__middleRightAlignment___wEbfX",Ym="ControlSlider-module__bottomLeftAlignment___cTP2-",Km="ControlSlider-module__bottomCenterAlignment___c54fB",Qm="ControlSlider-module__bottomRightAlignment___kEwrz",Zm="ControlSlider-module__clickOverlay___DZA28",Jm="ControlSlider-module__contain___pLyq7",eg="ControlSlider-module__cover___KdDat",Lt={wrapper:pm,hoverArrow:mm,sliderItem:gm,sliderImage:hm,arrow:fm,arrowVertical:ym,nextArrow:vm,arrowInner:xm,arrowIcon:bm,arrowImg:Sm,mirror:wm,pagination:$m,paginationInner:Cm,paginationVertical:Tm,paginationItem:Im,dot:Lm,activeDot:Pm,paginationInsideBottom:Rm,paginationInsideTop:Mm,paginationOutsideBottom:Em,paginationOutsideTop:km,paginationInsideLeft:Am,paginationInsideRight:Fm,paginationOutsideLeft:Nm,paginationOutsideRight:_m,imgWrapper:Hm,captionBlock:Wm,captionTextWrapper:Om,captionText:Dm,active:Bm,withPointerEvents:zm,topLeftAlignment:jm,topCenterAlignment:Vm,topRightAlignment:Gm,middleLeftAlignment:Xm,middleCenterAlignment:qm,middleRightAlignment:Um,bottomLeftAlignment:Ym,bottomCenterAlignment:Km,bottomRightAlignment:Qm,clickOverlay:Zm,contain:Jm,cover:eg};function tg(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 ng(e,t,n){return t&&tg(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var nc="(prefers-reduced-motion: reduce)",ho=1,ig=2,To=3,Oo=4,Cr=5,sa=6,fa=7,og={CREATED:ho,MOUNTED:ig,IDLE:To,MOVING:Oo,SCROLLING:Cr,DRAGGING:sa,DESTROYED:fa};function ci(e){e.length=0}function Ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function tn(e){return e.bind.apply(e,[null].concat(Ai(arguments,1)))}var uu=setTimeout,Ns=function(){};function ic(e){return requestAnimationFrame(e)}function Ra(e,t){return typeof t===e}function dr(e){return!pl(e)&&Ra("object",e)}var ul=Array.isArray,pu=tn(Ra,"function"),Pi=tn(Ra,"string"),Tr=tn(Ra,"undefined");function pl(e){return e===null}function mu(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Ir(e){return ul(e)?e:[e]}function En(e,t){Ir(e).forEach(t)}function ml(e,t){return e.indexOf(t)>-1}function la(e,t){return e.push.apply(e,Ir(t)),e}function oi(e,t,n){e&&En(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Gn(e,t){oi(e,Pi(t)?t.split(" "):t,!0)}function Lr(e,t){En(t,e.appendChild.bind(e))}function gl(e,t){En(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ur(e,t){return mu(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function gu(e,t){var n=e?Ai(e.children):[];return t?n.filter(function(i){return ur(i,t)}):n}function Pr(e,t){return t?gu(e,t)[0]:e.firstElementChild}var pr=Object.keys;function Ui(e,t,n){return e&&(n?pr(e).reverse():pr(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function mr(e){return Ai(arguments,1).forEach(function(t){Ui(t,function(n,i){e[i]=t[i]})}),e}function Ci(e){return Ai(arguments,1).forEach(function(t){Ui(t,function(n,i){ul(n)?e[i]=n.slice():dr(n)?e[i]=Ci({},dr(e[i])?e[i]:{},n):e[i]=n})}),e}function oc(e,t){En(t||pr(e),function(n){delete e[n]})}function Xn(e,t){En(e,function(n){En(t,function(i){n&&n.removeAttribute(i)})})}function zt(e,t,n){dr(t)?Ui(t,function(i,o){zt(e,o,i)}):En(e,function(i){pl(n)||n===""?Xn(i,t):i.setAttribute(t,String(n))})}function bo(e,t,n){var i=document.createElement(e);return t&&(Pi(t)?Gn(i,t):zt(i,t)),n&&Lr(n,i),i}function Nn(e,t,n){if(Tr(n))return getComputedStyle(e)[t];pl(n)||(e.style[t]=""+n)}function gr(e,t){Nn(e,"display",t)}function hu(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function _n(e,t){return e.getAttribute(t)}function rc(e,t){return e&&e.classList.contains(t)}function Ln(e){return e.getBoundingClientRect()}function Ki(e){En(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function fu(e){return Pr(new DOMParser().parseFromString(e,"text/html").body)}function ni(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function yu(e,t){return e&&e.querySelector(t)}function hl(e,t){return t?Ai(e.querySelectorAll(t)):[]}function ri(e,t){oi(e,t,!1)}function _s(e){return e.timeStamp}function _i(e){return Pi(e)?e:e?e+"px":""}var Rr="splide",fl="data-"+Rr;function ar(e,t){if(!e)throw new Error("["+Rr+"] "+(t||""))}var Ri=Math.min,ya=Math.max,va=Math.floor,hr=Math.ceil,vn=Math.abs;function vu(e,t,n){return vn(e-t)<n}function ca(e,t,n,i){var o=Ri(t,n),r=ya(t,n);return i?o<e&&e<r:o<=e&&e<=r}function uo(e,t,n){var i=Ri(t,n),o=ya(t,n);return Ri(ya(i,e),o)}function Hs(e){return+(e>0)-+(e<0)}function Ws(e,t){return En(t,function(n){e=e.replace("%s",""+n)}),e}function yl(e){return e<10?"0"+e:""+e}var ac={};function rg(e){return""+e+yl(ac[e]=(ac[e]||0)+1)}function xu(){var e=[];function t(l,c,d,u){o(l,c,function(p,v,x){var m="addEventListener"in p,h=m?p.removeEventListener.bind(p,v,d,u):p.removeListener.bind(p,d);m?p.addEventListener(v,d,u):p.addListener(d),e.push([p,v,x,d,h])})}function n(l,c,d){o(l,c,function(u,p,v){e=e.filter(function(x){return x[0]===u&&x[1]===p&&x[2]===v&&(!d||x[3]===d)?(x[4](),!1):!0})})}function i(l,c,d){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(c,{bubbles:p,detail:d}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(c,p,!1,d)),l.dispatchEvent(u),u}function o(l,c,d){En(l,function(u){u&&En(c,function(p){p.split(" ").forEach(function(v){var x=v.split(".");d(u,x[0],x[1])})})})}function r(){e.forEach(function(l){l[4]()}),ci(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var Fi="mounted",Os="ready",di="move",Do="moved",vl="click",bu="active",Su="inactive",wu="visible",$u="hidden",ln="refresh",hn="updated",Io="resize",Ma="resized",Cu="drag",Tu="dragging",Iu="dragged",Ea="scroll",Ji="scrolled",ag="overflow",xl="destroy",Lu="arrows:mounted",Pu="arrows:updated",Ru="pagination:mounted",Mu="pagination:updated",bl="navigation:mounted",Sl="autoplay:play",Eu="autoplay:playing",wl="autoplay:pause",$l="lazyload:loaded",ku="sk",Au="sh",xa="ei";function an(e){var t=e?e.event.bus:document.createDocumentFragment(),n=xu();function i(r,l){n.bind(t,Ir(r).join(" "),function(c){l.apply(l,ul(c.detail)?c.detail:[])})}function o(r){n.dispatch(t,r,Ai(arguments,1))}return e&&e.event.on(xl,n.destroy),mr(n,{bus:t,on:i,off:tn(n.unbind,t),emit:o})}function ka(e,t,n,i){var o=Date.now,r,l=0,c,d=!0,u=0;function p(){if(!d){if(l=e?Ri((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return x();c=ic(p)}}function v(M){M||h(),r=o()-(M?l*e:0),d=!1,c=ic(p)}function x(){d=!0}function m(){r=o(),l=0,n&&n(l)}function h(){c&&cancelAnimationFrame(c),l=0,c=0,d=!0}function b(M){e=M}function S(){return d}return{start:v,rewind:m,pause:x,cancel:h,set:b,isPaused:S}}function sg(e){var t=e;function n(o){t=o}function i(o){return ml(Ir(o),t)}return{set:n,is:i}}function lg(e,t){var n=ka(0,e,null,1);return function(){n.isPaused()&&n.start()}}function cg(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=xu(),c=[];function d(){var h=n.mediaQuery==="min";pr(o).sort(function(b,S){return h?+b-+S:+S-+b}).forEach(function(b){p(o[b],"("+(h?"min":"max")+"-width:"+b+"px)")}),p(r,nc),v()}function u(h){h&&l.destroy()}function p(h,b){var S=matchMedia(b);l.bind(S,"change",v),c.push([h,S])}function v(){var h=i.is(fa),b=n.direction,S=c.reduce(function(M,y){return Ci(M,y[1].matches?y[0]:{})},{});oc(n),m(S),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):b!==n.direction&&e.refresh()}function x(h){matchMedia(nc).matches&&(h?Ci(n,r):oc(n,pr(r)))}function m(h,b,S){Ci(n,h),b&&Ci(Object.getPrototypeOf(n),h),(S||!i.is(ho))&&e.emit(hn,n)}return{setup:d,destroy:u,reduce:x,set:m}}var Aa="Arrow",Fa=Aa+"Left",Na=Aa+"Right",Fu=Aa+"Up",Nu=Aa+"Down",sc="rtl",_a="ttb",Ua={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Fu,Na],ArrowRight:[Nu,Fa]};function dg(e,t,n){function i(r,l,c){c=c||n.direction;var d=c===sc&&!l?1:c===_a?0:-1;return Ua[r]&&Ua[r][d]||r.replace(/width|left|right/i,function(u,p){var v=Ua[u.toLowerCase()][d]||u;return p>0?v.charAt(0).toUpperCase()+v.slice(1):v})}function o(r){return r*(n.direction===sc?1:-1)}return{resolve:i,orient:o}}var ai="role",So="tabindex",ug="disabled",Hn="aria-",Mr=Hn+"controls",_u=Hn+"current",lc=Hn+"selected",Rn=Hn+"label",Cl=Hn+"labelledby",Hu=Hn+"hidden",Tl=Hn+"orientation",fr=Hn+"roledescription",cc=Hn+"live",dc=Hn+"busy",uc=Hn+"atomic",Il=[ai,So,ug,Mr,_u,Rn,Cl,Hu,Tl,fr],Yn=Rr+"__",Ni="is-",Ya=Rr,pc=Yn+"track",pg=Yn+"list",Ha=Yn+"slide",Wu=Ha+"--clone",mg=Ha+"__container",Ll=Yn+"arrows",Wa=Yn+"arrow",Ou=Wa+"--prev",Du=Wa+"--next",Oa=Yn+"pagination",Bu=Oa+"__page",gg=Yn+"progress",hg=gg+"__bar",fg=Yn+"toggle",yg=Yn+"spinner",vg=Yn+"sr",xg=Ni+"initialized",Qi=Ni+"active",zu=Ni+"prev",ju=Ni+"next",Ds=Ni+"visible",Bs=Ni+"loading",Vu=Ni+"focus-in",Gu=Ni+"overflow",bg=[Qi,Ds,zu,ju,Bs,Vu,Gu],Sg={slide:Ha,clone:Wu,arrows:Ll,arrow:Wa,prev:Ou,next:Du,pagination:Oa,page:Bu,spinner:yg};function wg(e,t){if(pu(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ur(n,t);)n=n.parentElement;return n}var $g=5,mc=200,Xu="touchstart mousedown",Ka="touchmove mousemove",Qa="touchend touchcancel mouseup click";function Cg(e,t,n){var i=an(e),o=i.on,r=i.bind,l=e.root,c=n.i18n,d={},u=[],p=[],v=[],x,m,h;function b(){$(),R(),y()}function S(){o(ln,M),o(ln,b),o(hn,y),r(document,Xu+" keydown",function(O){h=O.type==="keydown"},{capture:!0}),r(l,"focusin",function(){oi(l,Vu,!!h)})}function M(O){var N=Il.concat("style");ci(u),ri(l,p),ri(x,v),Xn([x,m],N),Xn(l,O?N:["style",fr])}function y(){ri(l,p),ri(x,v),p=B(Ya),v=B(pc),Gn(l,p),Gn(x,v),zt(l,Rn,n.label),zt(l,Cl,n.labelledby)}function $(){x=X("."+pc),m=Pr(x,"."+pg),ar(x&&m,"A track/list element is missing."),la(u,gu(m,"."+Ha+":not(."+Wu+")")),Ui({arrows:Ll,pagination:Oa,prev:Ou,next:Du,bar:hg,toggle:fg},function(O,N){d[N]=X("."+O)}),mr(d,{root:l,track:x,list:m,slides:u})}function R(){var O=l.id||rg(Rr),N=n.role;l.id=O,x.id=x.id||O+"-track",m.id=m.id||O+"-list",!_n(l,ai)&&l.tagName!=="SECTION"&&N&&zt(l,ai,N),zt(l,fr,c.carousel),zt(m,ai,"presentation")}function X(O){var N=yu(l,O);return N&&wg(N,"."+Ya)===l?N:void 0}function B(O){return[O+"--"+n.type,O+"--"+n.direction,n.drag&&O+"--draggable",n.isNavigation&&O+"--nav",O===Ya&&Qi]}return mr(d,{setup:b,mount:S,destroy:M})}var Lo="slide",Bo="loop",Er="fade";function Tg(e,t,n,i){var o=an(e),r=o.on,l=o.emit,c=o.bind,d=e.Components,u=e.root,p=e.options,v=p.isNavigation,x=p.updateOnMove,m=p.i18n,h=p.pagination,b=p.slideFocus,S=d.Direction.resolve,M=_n(i,"style"),y=_n(i,Rn),$=n>-1,R=Pr(i,"."+mg),X;function B(){$||(i.id=u.id+"-slide"+yl(t+1),zt(i,ai,h?"tabpanel":"group"),zt(i,fr,m.slide),zt(i,Rn,y||Ws(m.slideLabel,[t+1,e.length]))),O()}function O(){c(i,"click",tn(l,vl,K)),c(i,"keydown",tn(l,ku,K)),r([Do,Au,Ji],I),r(bl,z),x&&r(di,C)}function N(){X=!0,o.destroy(),ri(i,bg),Xn(i,Il),zt(i,"style",M),zt(i,Rn,y||"")}function z(){var P=e.splides.map(function(f){var U=f.splide.Components.Slides.getAt(t);return U?U.slide.id:""}).join(" ");zt(i,Rn,Ws(m.slideX,($?n:t)+1)),zt(i,Mr,P),zt(i,ai,b?"button":""),b&&Xn(i,fr)}function C(){X||I()}function I(){if(!X){var P=e.index;j(),E(),oi(i,zu,t===P-1),oi(i,ju,t===P+1)}}function j(){var P=L();P!==rc(i,Qi)&&(oi(i,Qi,P),zt(i,_u,v&&P||""),l(P?bu:Su,K))}function E(){var P=V(),f=!P&&(!L()||$);if(e.state.is([Oo,Cr])||zt(i,Hu,f||""),zt(hl(i,p.focusableNodes||""),So,f?-1:""),b&&zt(i,So,f?-1:0),P!==rc(i,Ds)&&(oi(i,Ds,P),l(P?wu:$u,K)),!P&&document.activeElement===i){var U=d.Slides.getAt(e.index);U&&hu(U.slide)}}function w(P,f,U){Nn(U&&R||i,P,f)}function L(){var P=e.index;return P===t||p.cloneStatus&&P===n}function V(){if(e.is(Er))return L();var P=Ln(d.Elements.track),f=Ln(i),U=S("left",!0),te=S("right",!0);return va(P[U])<=hr(f[U])&&va(f[te])<=hr(P[te])}function _(P,f){var U=vn(P-t);return!$&&(p.rewind||e.is(Bo))&&(U=Ri(U,e.length-U)),U<=f}var K={index:t,slideIndex:n,slide:i,container:R,isClone:$,mount:B,destroy:N,update:I,style:w,isWithin:_};return K}function Ig(e,t,n){var i=an(e),o=i.on,r=i.emit,l=i.bind,c=t.Elements,d=c.slides,u=c.list,p=[];function v(){x(),o(ln,m),o(ln,x)}function x(){d.forEach(function(I,j){b(I,j,-1)})}function m(){X(function(I){I.destroy()}),ci(p)}function h(){X(function(I){I.update()})}function b(I,j,E){var w=Tg(e,j,E,I);w.mount(),p.push(w),p.sort(function(L,V){return L.index-V.index})}function S(I){return I?B(function(j){return!j.isClone}):p}function M(I){var j=t.Controller,E=j.toIndex(I),w=j.hasFocus()?1:n.perPage;return B(function(L){return ca(L.index,E,E+w-1)})}function y(I){return B(I)[0]}function $(I,j){En(I,function(E){if(Pi(E)&&(E=fu(E)),mu(E)){var w=d[j];w?gl(E,w):Lr(u,E),Gn(E,n.classes.slide),N(E,tn(r,Io))}}),r(ln)}function R(I){Ki(B(I).map(function(j){return j.slide})),r(ln)}function X(I,j){S(j).forEach(I)}function B(I){return p.filter(pu(I)?I:function(j){return Pi(I)?ur(j.slide,I):ml(Ir(I),j.index)})}function O(I,j,E){X(function(w){w.style(I,j,E)})}function N(I,j){var E=hl(I,"img"),w=E.length;w?E.forEach(function(L){l(L,"load error",function(){--w||j()})}):j()}function z(I){return I?d.length:p.length}function C(){return p.length>n.perPage}return{mount:v,destroy:m,update:h,register:b,get:S,getIn:M,getAt:y,add:$,remove:R,forEach:X,filter:B,style:O,getLength:z,isEnough:C}}function Lg(e,t,n){var i=an(e),o=i.on,r=i.bind,l=i.emit,c=t.Slides,d=t.Direction.resolve,u=t.Elements,p=u.root,v=u.track,x=u.list,m=c.getAt,h=c.style,b,S,M;function y(){$(),r(window,"resize load",lg(tn(l,Io))),o([hn,ln],$),o(Io,R)}function $(){b=n.direction===_a,Nn(p,"maxWidth",_i(n.width)),Nn(v,d("paddingLeft"),X(!1)),Nn(v,d("paddingRight"),X(!0)),R(!0)}function R(K){var P=Ln(p);(K||S.width!==P.width||S.height!==P.height)&&(Nn(v,"height",B()),h(d("marginRight"),_i(n.gap)),h("width",N()),h("height",z(),!0),S=P,l(Ma),M!==(M=_())&&(oi(p,Gu,M),l(ag,M)))}function X(K){var P=n.padding,f=d(K?"right":"left");return P&&_i(P[f]||(dr(P)?0:P))||"0px"}function B(){var K="";return b&&(K=O(),ar(K,"height or heightRatio is missing."),K="calc("+K+" - "+X(!1)+" - "+X(!0)+")"),K}function O(){return _i(n.height||Ln(x).width*n.heightRatio)}function N(){return n.autoWidth?null:_i(n.fixedWidth)||(b?"":C())}function z(){return _i(n.fixedHeight)||(b?n.autoHeight?null:C():O())}function C(){var K=_i(n.gap);return"calc((100%"+(K&&" + "+K)+")/"+(n.perPage||1)+(K&&" - "+K)+")"}function I(){return Ln(x)[d("width")]}function j(K,P){var f=m(K||0);return f?Ln(f.slide)[d("width")]+(P?0:L()):0}function E(K,P){var f=m(K);if(f){var U=Ln(f.slide)[d("right")],te=Ln(x)[d("left")];return vn(U-te)+(P?0:L())}return 0}function w(K){return E(e.length-1)-E(0)+j(0,K)}function L(){var K=m(0);return K&&parseFloat(Nn(K.slide,d("marginRight")))||0}function V(K){return parseFloat(Nn(v,d("padding"+(K?"Right":"Left"))))||0}function _(){return e.is(Er)||w(!0)>I()}return{mount:y,resize:R,listSize:I,slideSize:j,sliderSize:w,totalSize:E,getPadding:V,isOverflow:_}}var Pg=2;function Rg(e,t,n){var i=an(e),o=i.on,r=t.Elements,l=t.Slides,c=t.Direction.resolve,d=[],u;function p(){o(ln,v),o([hn,Io],m),(u=S())&&(h(u),t.Layout.resize(!0))}function v(){x(),p()}function x(){Ki(d),ci(d),i.destroy()}function m(){var M=S();u!==M&&(u<M||!M)&&i.emit(ln)}function h(M){var y=l.get().slice(),$=y.length;if($){for(;y.length<M;)la(y,y);la(y.slice(-M),y.slice(0,M)).forEach(function(R,X){var B=X<M,O=b(R.slide,X);B?gl(O,y[0].slide):Lr(r.list,O),la(d,O),l.register(O,X-M+(B?0:$),R.index)})}}function b(M,y){var $=M.cloneNode(!0);return Gn($,n.classes.clone),$.id=e.root.id+"-clone"+yl(y+1),$}function S(){var M=n.clones;if(!e.is(Bo))M=0;else if(Tr(M)){var y=n[c("fixedWidth")]&&t.Layout.slideSize(0),$=y&&hr(Ln(r.track)[c("width")]/y);M=$||n[c("autoWidth")]&&e.length||n.perPage*Pg}return M}return{mount:p,destroy:x}}function Mg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=e.state.set,c=t.Layout,d=c.slideSize,u=c.getPadding,p=c.totalSize,v=c.listSize,x=c.sliderSize,m=t.Direction,h=m.resolve,b=m.orient,S=t.Elements,M=S.list,y=S.track,$;function R(){$=t.Transition,o([Fi,Ma,hn,ln],X)}function X(){t.Controller.isBusy()||(t.Scroll.cancel(),O(e.index),t.Slides.update())}function B(f,U,te,ce){f!==U&&K(f>te)&&(I(),N(C(w(),f>te),!0)),l(Oo),r(di,U,te,f),$.start(U,function(){l(To),r(Do,U,te,f),ce&&ce()})}function O(f){N(E(f,!0))}function N(f,U){if(!e.is(Er)){var te=U?f:z(f);Nn(M,"transform","translate"+h("X")+"("+te+"px)"),f!==te&&r(Au)}}function z(f){if(e.is(Bo)){var U=j(f),te=U>t.Controller.getEnd(),ce=U<0;(ce||te)&&(f=C(f,te))}return f}function C(f,U){var te=f-_(U),ce=x();return f-=b(ce*(hr(vn(te)/ce)||1))*(U?1:-1),f}function I(){N(w(),!0),$.cancel()}function j(f){for(var U=t.Slides.get(),te=0,ce=1/0,F=0;F<U.length;F++){var ie=U[F].index,T=vn(E(ie,!0)-f);if(T<=ce)ce=T,te=ie;else break}return te}function E(f,U){var te=b(p(f-1)-V(f));return U?L(te):te}function w(){var f=h("left");return Ln(M)[f]-Ln(y)[f]+b(u(!1))}function L(f){return n.trimSpace&&e.is(Lo)&&(f=uo(f,0,b(x(!0)-v()))),f}function V(f){var U=n.focus;return U==="center"?(v()-d(f,!0))/2:+U*d(f)||0}function _(f){return E(f?t.Controller.getEnd():0,!!n.trimSpace)}function K(f){var U=b(C(w(),f));return f?U>=0:U<=M[h("scrollWidth")]-Ln(y)[h("width")]}function P(f,U){U=Tr(U)?w():U;var te=f!==!0&&b(U)<b(_(!1)),ce=f!==!1&&b(U)>b(_(!0));return te||ce}return{mount:R,move:B,jump:O,translate:N,shift:C,cancel:I,toIndex:j,toPosition:E,getPosition:w,getLimit:_,exceededLimit:P,reposition:X}}function Eg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=t.Move,c=l.getPosition,d=l.getLimit,u=l.toPosition,p=t.Slides,v=p.isEnough,x=p.getLength,m=n.omitEnd,h=e.is(Bo),b=e.is(Lo),S=tn(w,!1),M=tn(w,!0),y=n.start||0,$,R=y,X,B,O;function N(){z(),o([hn,ln,xa],z),o(Ma,C)}function z(){X=x(!0),B=n.perMove,O=n.perPage,$=K();var T=uo(y,0,m?$:X-1);T!==y&&(y=T,l.reposition())}function C(){$!==K()&&r(xa)}function I(T,le,J){if(!ie()){var Se=E(T),Le=_(Se);Le>-1&&(le||Le!==y)&&(te(Le),l.move(Se,Le,R,J))}}function j(T,le,J,Se){t.Scroll.scroll(T,le,J,function(){var Le=_(l.toIndex(c()));te(m?Ri(Le,$):Le),Se&&Se()})}function E(T){var le=y;if(Pi(T)){var J=T.match(/([+\-<>])(\d+)?/)||[],Se=J[1],Le=J[2];Se==="+"||Se==="-"?le=L(y+ +(""+Se+(+Le||1)),y):Se===">"?le=Le?P(+Le):S(!0):Se==="<"&&(le=M(!0))}else le=h?T:uo(T,0,$);return le}function w(T,le){var J=B||(F()?1:O),Se=L(y+J*(T?-1:1),y,!(B||F()));return Se===-1&&b&&!vu(c(),d(!T),1)?T?0:$:le?Se:_(Se)}function L(T,le,J){if(v()||F()){var Se=V(T);Se!==T&&(le=T,T=Se,J=!1),T<0||T>$?!B&&(ca(0,T,le,!0)||ca($,le,T,!0))?T=P(f(T)):h?T=J?T<0?-(X%O||O):X:T:n.rewind?T=T<0?$:0:T=-1:J&&T!==le&&(T=P(f(le)+(T<le?-1:1)))}else T=-1;return T}function V(T){if(b&&n.trimSpace==="move"&&T!==y)for(var le=c();le===u(T,!0)&&ca(T,0,e.length-1,!n.rewind);)T<y?--T:++T;return T}function _(T){return h?(T+X)%X||0:T}function K(){for(var T=X-(F()||h&&B?1:O);m&&T-- >0;)if(u(X-1,!0)!==u(T,!0)){T++;break}return uo(T,0,X-1)}function P(T){return uo(F()?T:O*T,0,$)}function f(T){return F()?Ri(T,$):va((T>=$?X-1:T)/O)}function U(T){var le=l.toIndex(T);return b?uo(le,0,$):le}function te(T){T!==y&&(R=y,y=T)}function ce(T){return T?R:y}function F(){return!Tr(n.focus)||n.isNavigation}function ie(){return e.state.is([Oo,Cr])&&!!n.waitForTransition}return{mount:N,go:I,scroll:j,getNext:S,getPrev:M,getAdjacent:w,getEnd:K,setIndex:te,getIndex:ce,toIndex:P,toPage:f,toDest:U,hasFocus:F,isBusy:ie}}var kg="http://www.w3.org/2000/svg",Ag="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",Hr=40;function Fg(e,t,n){var i=an(e),o=i.on,r=i.bind,l=i.emit,c=n.classes,d=n.i18n,u=t.Elements,p=t.Controller,v=u.arrows,x=u.track,m=v,h=u.prev,b=u.next,S,M,y={};function $(){X(),o(hn,R)}function R(){B(),$()}function X(){var j=n.arrows;j&&!(h&&b)&&z(),h&&b&&(mr(y,{prev:h,next:b}),gr(m,j?"":"none"),Gn(m,M=Ll+"--"+n.direction),j&&(O(),I(),zt([h,b],Mr,x.id),l(Lu,h,b)))}function B(){i.destroy(),ri(m,M),S?(Ki(v?[h,b]:m),h=b=null):Xn([h,b],Il)}function O(){o([Fi,Do,ln,Ji,xa],I),r(b,"click",tn(N,">")),r(h,"click",tn(N,"<"))}function N(j){p.go(j,!0)}function z(){m=v||bo("div",c.arrows),h=C(!0),b=C(!1),S=!0,Lr(m,[h,b]),!v&&gl(m,x)}function C(j){var E='<button class="'+c.arrow+" "+(j?c.prev:c.next)+'" type="button"><svg xmlns="'+kg+'" viewBox="0 0 '+Hr+" "+Hr+'" width="'+Hr+'" height="'+Hr+'" focusable="false"><path d="'+(n.arrowPath||Ag)+'" />';return fu(E)}function I(){if(h&&b){var j=e.index,E=p.getPrev(),w=p.getNext(),L=E>-1&&j<E?d.last:d.prev,V=w>-1&&j>w?d.first:d.next;h.disabled=E<0,b.disabled=w<0,zt(h,Rn,L),zt(b,Rn,V),l(Pu,h,b,E,w)}}return{arrows:y,mount:$,destroy:B,update:I}}var Ng=fl+"-interval";function _g(e,t,n){var i=an(e),o=i.on,r=i.bind,l=i.emit,c=ka(n.interval,e.go.bind(e,">"),O),d=c.isPaused,u=t.Elements,p=t.Elements,v=p.root,x=p.toggle,m=n.autoplay,h,b,S=m==="pause";function M(){m&&(y(),x&&zt(x,Mr,u.track.id),S||$(),B())}function y(){n.pauseOnHover&&r(v,"mouseenter mouseleave",function(z){h=z.type==="mouseenter",X()}),n.pauseOnFocus&&r(v,"focusin focusout",function(z){b=z.type==="focusin",X()}),x&&r(x,"click",function(){S?$():R(!0)}),o([di,Ea,ln],c.rewind),o(di,N)}function $(){d()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),b=h=S=!1,B(),l(Sl))}function R(z){z===void 0&&(z=!0),S=!!z,B(),d()||(c.pause(),l(wl))}function X(){S||(h||b?R(!1):$())}function B(){x&&(oi(x,Qi,!S),zt(x,Rn,n.i18n[S?"play":"pause"]))}function O(z){var C=u.bar;C&&Nn(C,"width",z*100+"%"),l(Eu,z)}function N(z){var C=t.Slides.getAt(z);c.set(C&&+_n(C.slide,Ng)||n.interval)}return{mount:M,destroy:c.cancel,play:$,pause:R,isPaused:d}}function Hg(e,t,n){var i=an(e),o=i.on;function r(){n.cover&&(o($l,tn(c,!0)),o([Fi,hn,ln],tn(l,!0)))}function l(d){t.Slides.forEach(function(u){var p=Pr(u.container||u.slide,"img");p&&p.src&&c(d,p,u)})}function c(d,u,p){p.style("background",d?'center/cover no-repeat url("'+u.src+'")':"",!0),gr(u,d?"none":"")}return{mount:r,destroy:tn(l,!1)}}var Wg=10,Og=600,Dg=.6,Bg=1.5,zg=800;function jg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=e.state.set,c=t.Move,d=c.getPosition,u=c.getLimit,p=c.exceededLimit,v=c.translate,x=e.is(Lo),m,h,b=1;function S(){o(di,R),o([hn,ln],X)}function M(O,N,z,C,I){var j=d();if(R(),z&&(!x||!p())){var E=t.Layout.sliderSize(),w=Hs(O)*E*va(vn(O)/E)||0;O=c.toPosition(t.Controller.toDest(O%E))+w}var L=vu(j,O,1);b=1,N=L?0:N||ya(vn(O-j)/Bg,zg),h=C,m=ka(N,y,tn($,j,O,I),1),l(Cr),r(Ea),m.start()}function y(){l(To),h&&h(),r(Ji)}function $(O,N,z,C){var I=d(),j=O+(N-O)*B(C),E=(j-I)*b;v(I+E),x&&!z&&p()&&(b*=Dg,vn(E)<Wg&&M(u(p(!0)),Og,!1,h,!0))}function R(){m&&m.cancel()}function X(){m&&!m.isPaused()&&(R(),y())}function B(O){var N=n.easingFunc;return N?N(O):1-Math.pow(1-O,4)}return{mount:S,destroy:R,scroll:M,cancel:X}}var po={passive:!1,capture:!0};function Vg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=i.bind,c=i.unbind,d=e.state,u=t.Move,p=t.Scroll,v=t.Controller,x=t.Elements.track,m=t.Media.reduce,h=t.Direction,b=h.resolve,S=h.orient,M=u.getPosition,y=u.exceededLimit,$,R,X,B,O,N=!1,z,C,I;function j(){l(x,Ka,Ns,po),l(x,Qa,Ns,po),l(x,Xu,w,po),l(x,"click",_,{capture:!0}),l(x,"dragstart",ni),o([Fi,hn],E)}function E(){var ee=n.drag;ye(!ee),B=ee==="free"}function w(ee){if(z=!1,!C){var oe=Le(ee);Se(ee.target)&&(oe||!ee.button)&&(v.isBusy()?ni(ee,!0):(I=oe?x:window,O=d.is([Oo,Cr]),X=null,l(I,Ka,L,po),l(I,Qa,V,po),u.cancel(),p.cancel(),K(ee)))}}function L(ee){if(d.is(sa)||(d.set(sa),r(Cu)),ee.cancelable)if(O){u.translate($+J(F(ee)));var oe=ie(ee)>mc,re=N!==(N=y());(oe||re)&&K(ee),z=!0,r(Tu),ni(ee)}else U(ee)&&(O=f(ee),ni(ee))}function V(ee){d.is(sa)&&(d.set(To),r(Iu)),O&&(P(ee),ni(ee)),c(I,Ka,L),c(I,Qa,V),O=!1}function _(ee){!C&&z&&ni(ee,!0)}function K(ee){X=R,R=ee,$=M()}function P(ee){var oe=te(ee),re=ce(oe),ge=n.rewind&&n.rewindByDrag;m(!1),B?v.scroll(re,0,n.snap):e.is(Er)?v.go(S(Hs(oe))<0?ge?"<":"-":ge?">":"+"):e.is(Lo)&&N&&ge?v.go(y(!0)?">":"<"):v.go(v.toDest(re),!0),m(!0)}function f(ee){var oe=n.dragMinThreshold,re=dr(oe),ge=re&&oe.mouse||0,we=(re?oe.touch:+oe)||10;return vn(F(ee))>(Le(ee)?we:ge)}function U(ee){return vn(F(ee))>vn(F(ee,!0))}function te(ee){if(e.is(Bo)||!N){var oe=ie(ee);if(oe&&oe<mc)return F(ee)/oe}return 0}function ce(ee){return M()+Hs(ee)*Ri(vn(ee)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function F(ee,oe){return le(ee,oe)-le(T(ee),oe)}function ie(ee){return _s(ee)-_s(T(ee))}function T(ee){return R===ee&&X||R}function le(ee,oe){return(Le(ee)?ee.changedTouches[0]:ee)["page"+b(oe?"Y":"X")]}function J(ee){return ee/(N&&e.is(Lo)?$g:1)}function Se(ee){var oe=n.noDrag;return!ur(ee,"."+Bu+", ."+Wa)&&(!oe||!ur(ee,oe))}function Le(ee){return typeof TouchEvent<"u"&&ee instanceof TouchEvent}function me(){return O}function ye(ee){C=ee}return{mount:j,disable:ye,isDragging:me}}var Gg={Spacebar:" ",Right:Na,Left:Fa,Up:Fu,Down:Nu};function Pl(e){return e=Pi(e)?e:e.key,Gg[e]||e}var gc="keydown";function Xg(e,t,n){var i=an(e),o=i.on,r=i.bind,l=i.unbind,c=e.root,d=t.Direction.resolve,u,p;function v(){x(),o(hn,m),o(hn,x),o(di,b)}function x(){var M=n.keyboard;M&&(u=M==="global"?window:c,r(u,gc,S))}function m(){l(u,gc)}function h(M){p=M}function b(){var M=p;p=!0,uu(function(){p=M})}function S(M){if(!p){var y=Pl(M);y===d(Fa)?e.go("<"):y===d(Na)&&e.go(">")}}return{mount:v,destroy:m,disable:h}}var sr=fl+"-lazy",da=sr+"-srcset",qg="["+sr+"], ["+da+"]";function Ug(e,t,n){var i=an(e),o=i.on,r=i.off,l=i.bind,c=i.emit,d=n.lazyLoad==="sequential",u=[Do,Ji],p=[];function v(){n.lazyLoad&&(x(),o(ln,x))}function x(){ci(p),m(),d?M():(r(u),o(u,h),h())}function m(){t.Slides.forEach(function(y){hl(y.slide,qg).forEach(function($){var R=_n($,sr),X=_n($,da);if(R!==$.src||X!==$.srcset){var B=n.classes.spinner,O=$.parentElement,N=Pr(O,"."+B)||bo("span",B,O);p.push([$,y,N]),$.src||gr($,"none")}})})}function h(){p=p.filter(function(y){var $=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,$)?b(y):!0}),p.length||r(u)}function b(y){var $=y[0];Gn(y[1].slide,Bs),l($,"load error",tn(S,y)),zt($,"src",_n($,sr)),zt($,"srcset",_n($,da)),Xn($,sr),Xn($,da)}function S(y,$){var R=y[0],X=y[1];ri(X.slide,Bs),$.type!=="error"&&(Ki(y[2]),gr(R,""),c($l,R,X),c(Io)),d&&M()}function M(){p.length&&b(p.shift())}return{mount:v,destroy:tn(ci,p),check:h}}function Yg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=i.bind,c=t.Slides,d=t.Elements,u=t.Controller,p=u.hasFocus,v=u.getIndex,x=u.go,m=t.Direction.resolve,h=d.pagination,b=[],S,M;function y(){$(),o([hn,ln,xa],y);var C=n.pagination;h&&gr(h,C?"":"none"),C&&(o([di,Ea,Ji],z),R(),z(),r(Ru,{list:S,items:b},N(e.index)))}function $(){S&&(Ki(h?Ai(S.children):S),ri(S,M),ci(b),S=null),i.destroy()}function R(){var C=e.length,I=n.classes,j=n.i18n,E=n.perPage,w=p()?u.getEnd()+1:hr(C/E);S=h||bo("ul",I.pagination,d.track.parentElement),Gn(S,M=Oa+"--"+O()),zt(S,ai,"tablist"),zt(S,Rn,j.select),zt(S,Tl,O()===_a?"vertical":"");for(var L=0;L<w;L++){var V=bo("li",null,S),_=bo("button",{class:I.page,type:"button"},V),K=c.getIn(L).map(function(f){return f.slide.id}),P=!p()&&E>1?j.pageX:j.slideX;l(_,"click",tn(X,L)),n.paginationKeyboard&&l(_,"keydown",tn(B,L)),zt(V,ai,"presentation"),zt(_,ai,"tab"),zt(_,Mr,K.join(" ")),zt(_,Rn,Ws(P,L+1)),zt(_,So,-1),b.push({li:V,button:_,page:L})}}function X(C){x(">"+C,!0)}function B(C,I){var j=b.length,E=Pl(I),w=O(),L=-1;E===m(Na,!1,w)?L=++C%j:E===m(Fa,!1,w)?L=(--C+j)%j:E==="Home"?L=0:E==="End"&&(L=j-1);var V=b[L];V&&(hu(V.button),x(">"+L),ni(I,!0))}function O(){return n.paginationDirection||n.direction}function N(C){return b[u.toPage(C)]}function z(){var C=N(v(!0)),I=N(v());if(C){var j=C.button;ri(j,Qi),Xn(j,lc),zt(j,So,-1)}if(I){var E=I.button;Gn(E,Qi),zt(E,lc,!0),zt(E,So,"")}r(Mu,{list:S,items:b},C,I)}return{items:b,mount:y,destroy:$,getAt:N,update:z}}var Kg=[" ","Enter"];function Qg(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function c(){r.forEach(function(h){h.destroy()}),ci(r)}function d(){c(),l()}function u(h,b){var S=an(h);S.on(di,function(M,y,$){b.go(b.is(Bo)?$:M)}),r.push(S)}function p(){var h=an(e),b=h.on;b(vl,x),b(ku,m),b([Fi,hn],v),r.push(h),h.emit(bl,e.splides)}function v(){zt(t.Elements.list,Tl,n.direction===_a?"vertical":"")}function x(h){e.go(h.index)}function m(h,b){ml(Kg,Pl(b))&&(x(h),ni(b))}return{setup:tn(t.Media.set,{slideFocus:Tr(o)?i:o},!0),mount:l,destroy:c,remount:d}}function Zg(e,t,n){var i=an(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",c,po)}function c(u){if(u.cancelable){var p=u.deltaY,v=p<0,x=_s(u),m=n.wheelMinThreshold||0,h=n.wheelSleep||0;vn(p)>m&&x-r>h&&(e.go(v?"<":">"),r=x),d(v)&&ni(u)}}function d(u){return!n.releaseWheel||e.state.is(Oo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Jg=90;function eh(e,t,n){var i=an(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,c=bo("span",vg),d=ka(Jg,tn(p,!1));function u(){l&&(x(!t.Autoplay.isPaused()),zt(r,uc,!0),c.textContent="…",o(Sl,tn(x,!0)),o(wl,tn(x,!1)),o([Do,Ji],tn(p,!0)))}function p(m){zt(r,dc,m),m?(Lr(r,c),d.start()):(Ki(c),d.cancel())}function v(){Xn(r,[cc,uc,dc]),Ki(c)}function x(m){l&&zt(r,cc,m?"off":"polite")}return{mount:u,disable:x,destroy:v}}var th=Object.freeze({__proto__:null,Media:cg,Direction:dg,Elements:Cg,Slides:Ig,Layout:Lg,Clones:Rg,Move:Mg,Controller:Eg,Arrows:Fg,Autoplay:_g,Cover:Hg,Scroll:jg,Drag:Vg,Keyboard:Xg,LazyLoad:Ug,Pagination:Yg,Sync:Qg,Wheel:Zg,Live:eh}),nh={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"},ih={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:Sg,i18n:nh,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function oh(e,t,n){var i=t.Slides;function o(){an(e).on([Fi,ln],r)}function r(){i.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function l(c,d){i.style("transition","opacity "+n.speed+"ms "+n.easing),uu(d)}return{mount:o,start:l,cancel:Ns}}function rh(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,c=tn(Nn,l,"transition"),d;function u(){an(e).bind(l,"transitionend",function(m){m.target===l&&d&&(v(),d())})}function p(m,h){var b=i.toPosition(m,!0),S=i.getPosition(),M=x(m);vn(b-S)>=1&&M>=1?n.useScroll?r.scroll(b,M,!1,h):(c("transform "+M+"ms "+n.easing),i.translate(b,!0),d=h):(i.jump(m),h())}function v(){c(""),r.cancel()}function x(m){var h=n.rewindSpeed;if(e.is(Lo)&&h){var b=o.getIndex(!0),S=o.getEnd();if(b===0&&m>=S||b>=S&&m===0)return h}return n.speed}return{mount:u,start:p,cancel:v}}var ah=(function(){function e(n,i){this.event=an(),this.Components={},this.state=sg(ho),this.splides=[],this._o={},this._E={};var o=Pi(n)?yu(document,n):n;ar(o,o+" is invalid."),this.root=o,i=Ci({label:_n(o,Rn)||"",labelledby:_n(o,Cl)||""},ih,e.defaults,i||{});try{Ci(i,JSON.parse(_n(o,fl)))}catch{ar(!1,"Invalid JSON")}this._o=Object.create(Ci({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,c=this.Components;ar(l.is([ho,fa]),"Already mounted!"),l.set(ho),this._C=c,this._T=o||this._T||(this.is(Er)?oh:rh),this._E=i||this._E;var d=mr({},th,this._E,{Transition:this._T});return Ui(d,function(u,p){var v=u(r,c,r._o);c[p]=v,v.setup&&v.setup()}),Ui(c,function(u){u.mount&&u.mount()}),this.emit(Fi),Gn(this.root,xg),l.set(To),this.emit(Os),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(To)&&(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(Ai(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(ln),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(ho)?an(this).on(Os,this.destroy.bind(this,i)):(Ui(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(xl),o.destroy(),i&&ci(this.splides),r.set(fa)),this},ng(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})(),Rl=ah;Rl.defaults={};Rl.STATES=og;var hc=[[Fi,"onMounted"],[Os,"onReady"],[di,"onMove"],[Do,"onMoved"],[vl,"onClick"],[bu,"onActive"],[Su,"onInactive"],[wu,"onVisible"],[$u,"onHidden"],[ln,"onRefresh"],[hn,"onUpdated"],[Io,"onResize"],[Ma,"onResized"],[Cu,"onDrag"],[Tu,"onDragging"],[Iu,"onDragged"],[Ea,"onScroll"],[Ji,"onScrolled"],[xl,"onDestroy"],[Lu,"onArrowsMounted"],[Pu,"onArrowsUpdated"],[Ru,"onPaginationMounted"],[Mu,"onPaginationUpdated"],[bl,"onNavigationMounted"],[Sl,"onAutoplayPlay"],[Eu,"onAutoplayPlaying"],[wl,"onAutoplayPause"],[$l,"onLazyLoadLoaded"]];function Ml(...e){return e.filter(Boolean).join(" ")}function ba(e){return e!==null&&typeof e=="object"}function zs(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!zs(n,t[i]));if(ba(e)&&ba(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!zs(e[o],t[o]))}return e===t}function sh(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function lh(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 js(e,t){const n=e;return lh(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ba(i)?n[o]=js(ba(n[o])?n[o]:{},i):n[o]=i}),n}var ch=({children:e,className:t,...n})=>s.createElement("div",{className:Ml("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),El=class extends s.Component{constructor(){super(...arguments),this.splideRef=s.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Rl(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=js({},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&&!zs(this.options,e)&&(this.splide.options=e,this.options=js({},e));const t=this.getSlides();sh(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){hc.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 s.createElement(t,{className:Ml("splide",e),ref:this.splideRef,...this.omit(o,["options",...hc.map(r=>r[1])])},n?s.createElement(ch,null,i):i)}},kl=({children:e,className:t,...n})=>s.createElement("li",{className:Ml("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 oh="RichTextRenderer-module__link___BWeZ2",rh={link:oh},ah=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))},Do=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>ah(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function un(e){const{color:t,...n}=e;return n}function en(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Do(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:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}function Bu(e){return e!=null&&e.length?e.some(t=>t.type==="link"?Bu(t.children):!!t.text):!1}const Yi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:rh.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:sh(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:Bu(o)?t(o):" "},i)})})};function sh(e){return{...e.fontFamily&&{fontFamily:Do(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 lh="SvgImage-module__svg___q3xE-",ch="SvgImage-module__img___VsTm-",fc={svg:lh,img:ch},Za=new Map;function yr(e){return e.startsWith("data:")||e.startsWith("blob:")}function zu(e){if(yr(e))return Promise.resolve(e);const t=Za.get(e);if(t)return t;const n=fetch(e,{mode:"cors",cache:"reload"}).then(i=>{if(!i.ok)throw new Error(String(i.status));return i.blob()}).then(i=>URL.createObjectURL(i)).catch(i=>{throw Za.delete(e),i});return Za.set(e,n),n}const dh=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},uh=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,gn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[r,l]=s.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")')),[c,d]=s.useState(()=>yr(e)?e:null);return s.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(u)}},[]),s.useEffect(()=>{if(!dh(e)){d(null);return}if(yr(e)){d(e);return}let u=!1;return zu(e).then(p=>{u||d(p)}).catch(()=>{u||d(null)}),()=>{u=!0}},[e]),!c||!r?a.jsx("img",{src:e,alt:"",className:Ct(fc.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:Ct(fc.svg,i),style:{"--svg":uh(c),"--fill":t,"--hover-fill":n,...o??{}}})},ph={"top-left":$t.topLeftAlignment,"top-center":$t.topCenterAlignment,"top-right":$t.topRightAlignment,"middle-left":$t.middleLeftAlignment,"middle-center":$t.middleCenterAlignment,"middle-right":$t.middleRightAlignment,"bottom-left":$t.bottomLeftAlignment,"bottom-center":$t.bottomCenterAlignment,"bottom-right":$t.bottomRightAlignment};function gh({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:c,letterSpacing:d,textAlign:u,wordSpacing:p,fontSizeLineHeight:y,textAppearance:v,color:g}=n.imageCaption??{},[m,x]=s.useState(void 0),[b,M]=s.useState(null),[f,S]=s.useState(0),[W,q]=s.useState(0),{direction:z,transition:L,controls:_,pagination:G,imageCaption:$,triggers:I}=e,D=s.useRef(L.type),{x:E,y:T}=e.controls.offset,C=V=>{o&&o.go(V)};return s.useEffect(()=>{if(!b)return;const V=new ResizeObserver(w=>{if(!o)return;const[U]=w;x({width:Math.round(U.contentRect.width),height:Math.round(U.contentRect.height)})});return V.observe(b),()=>V.unobserve(b)},[b]),s.useEffect(()=>{!o||D.current===L.type||(q(V=>V+1),D.current=L.type)},[L.type]),a.jsx("div",{className:Ct($t.wrapper,{[$t.editor]:i}),ref:M,children:a.jsxs("div",{className:$t.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:L.backgroundColor&&L.type==="fade in"?L.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:Ct($t.captionBlock),children:a.jsx("div",{className:$t.captionTextWrapper,children:t.map((V,w)=>a.jsx("div",{className:Ct($t.captionText,ph[$.alignment],{[$t.withPointerEvents]:w===f&&i,[$t.active]:w===f}),style:{fontFamily:Do(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:l.sizing==="auto"?"max-content":F.scalingValue(l.width,i),letterSpacing:F.scalingValue(d,i),wordSpacing:F.scalingValue(p,i),textAlign:u,fontSize:F.scalingValue(y.fontSize,i),lineHeight:F.scalingValue(y.lineHeight,i),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:g,transitionDuration:L.duration?`${Math.round(parseInt(L.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:$t.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:F.scalingValue($.offset.y,i),left:F.scalingValue($.offset.x,i)},children:a.jsx(Yi,{content:V.imageCaption})})},w))})}),a.jsx(El,{onMove:V=>{S(V.index)},ref:r,options:{arrows:!1,speed:L.duration?parseInt(L.duration):500,autoplay:I.autoPlay!==null,...I.autoPlay!==null&&{interval:parseInt(I.autoPlay)*1e3},direction:z==="horiz"||L.type==="fade in"?"ltr":"ttb",pagination:!1,drag:I.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:L.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((V,w)=>a.jsx(kl,{children:a.jsx("div",{className:$t.sliderItem,children:a.jsx("div",{className:$t.imgWrapper,children:a.jsx("img",{className:Ct($t.sliderImage,{[$t.contain]:V.image.objectFit==="contain",[$t.cover]:V.image.objectFit==="cover"}),src:V.image.assetId,alt:V.image.name??""})})})},w))},W),_.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct($t.arrow,{[$t.arrowVertical]:z==="vert",[$t.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{onClick:()=>{C("-1")},className:$t.arrowInner,style:{transform:`translate(${F.scalingValue(E,i)}, ${F.scalingValue(T*(z==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${z==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&a.jsx(gn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:Ct($t.arrowImg,$t.mirror)}),!_.arrowsImgUrl&&a.jsx(yc,{color:_.color,className:Ct($t.arrowIcon,$t.arrowImg,$t.mirror)})]})}),a.jsx("div",{className:Ct($t.arrow,$t.nextArrow,{[$t.arrowVertical]:z==="vert",[$t.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{className:$t.arrowInner,onClick:()=>C("+1"),style:{transform:`translate(${F.scalingValue(E*(z==="horiz"?-1:1),i)}, ${F.scalingValue(T,i)}) scale(${e.controls.scale/100}) rotate(${z==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&a.jsx(gn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:$t.arrowImg}),!_.arrowsImgUrl&&a.jsx(yc,{color:_.color,className:Ct($t.arrowIcon,$t.arrowImg)})]})})]}),I.triggersList.click&&a.jsx("div",{className:$t.clickOverlay,onClick:()=>{o&&o.go("+1")}}),G.isActive&&a.jsx("div",{className:Ct($t.pagination,{[$t.paginationInsideBottom]:G.position==="inside-1"&&z==="horiz",[$t.paginationInsideTop]:G.position==="inside-2"&&z==="horiz",[$t.paginationOutsideBottom]:G.position==="outside-1"&&z==="horiz",[$t.paginationOutsideTop]:G.position==="outside-2"&&z==="horiz",[$t.paginationInsideLeft]:G.position==="inside-1"&&z==="vert",[$t.paginationInsideRight]:G.position==="inside-2"&&z==="vert",[$t.paginationOutsideLeft]:G.position==="outside-1"&&z==="vert",[$t.paginationOutsideRight]:G.position==="outside-2"&&z==="vert",[$t.paginationVertical]:z==="vert"}),children:a.jsx("div",{className:$t.paginationInner,style:{backgroundColor:G.colors[2],transform:`scale(${G.scale/100}) translate(${F.scalingValue(G.offset.x,i)}, ${F.scalingValue(G.offset.y,i)}) rotate(${z==="horiz"?"0deg":"90deg"})`},children:t.map((V,w)=>a.jsx("button",{onClick:()=>{o&&o.go(w)},className:Ct($t.paginationItem),children:a.jsx("div",{className:Ct($t.dot,{[$t.activeDot]:w===f}),style:{backgroundColor:w===f?G.colors[0]:G.colors[1],"--pagination-hover-color":G.hover}})},w))})})]})})}function yc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const mh={element:gh,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.assetId",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:{assetId:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",assetId:"01M3QM74XES6E7GVC0H3KJ2RH6",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",assetId:"01M3QM74XEAZ8H1DTC5V1S554K",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",assetId:"01M3QM74XEDRP49HNTEPNZYQTP",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"]}},hh="ImageRevealSlider-module__imageRevealSlider___UE5Ob",fh="ImageRevealSlider-module__image___Qjt-e",yh="ImageRevealSlider-module__link___N-iLG",vh="ImageRevealSlider-module__cursor___2U03d",no={imageRevealSlider:hh,image:fh,link:yh,cursor:vh};function vc(e,t,n){for(const i of n){const o=new Image;o.src=i.assetId;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,c=r/2,d=l/2;if(e>=i.x-c&&e<=i.x+c&&t>=i.y-d&&t<=i.y+d)return!0}return!1}function Ja(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function xh(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await Ja(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Ja(e);r=l.height/l.width*o}else{const l=await Ja(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function bh({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[c,d]=s.useState(0),u=s.useRef(0),[p,y]=s.useState({x:0,y:0}),[v,g]=s.useState(1),[m,x]=s.useState("none"),b=s.useRef({x:0,y:0}),[M,f]=s.useState(!1),{sizeType:S,imageWidth:W,randomRangeImageWidth:q}=e.imageSize,{revealPosition:z,visible:L}=e.position,{cursorType:_,target:G,defaultCursorScale:$,defaultCursor:I,hoverCursorScale:D,hoverCursor:E}=e.cursor;s.useEffect(()=>{if(!i)return;const V=(P,A)=>{const j=i.getBoundingClientRect(),ie=P-j.left,ae=A-j.top;if(y({x:ie,y:ae}),_==="system"){x("none"),g(1);return}const O=ie,re=ae,N=document.elementFromPoint(j.left+O,j.top+re);if(N&&N.closest("a")){x("none"),g(1);return}const le=vc(O,re,r)||G==="area"?{img:E??"none",scale:D}:{img:I??"none",scale:$};x(le.img),g(le.scale)},w=P=>{P.stopPropagation(),b.current={x:P.clientX,y:P.clientY},V(P.clientX,P.clientY)},U=()=>{M&&V(b.current.x,b.current.y)};return i.addEventListener("mousemove",w),window.addEventListener("scroll",U,!0),()=>{i.removeEventListener("mousemove",w),window.removeEventListener("scroll",U,!0)}},[i,M,p,_,G,E,I,D,$,r]),s.useEffect(()=>{M||(x("none"),g(0))},[M]);const T=async(V,w,U,P={})=>{const{width:A,height:j,finalWidth:ie}=await xh(V.image.assetId,S,W,q);let ae=0,O=0;z==="same"?(ae=w/2,O=U/2):(ae=P.x??Math.random()*w,O=P.y??Math.random()*U);const re=Math.min(Math.max(ae,A/2),w-A/2),N=Math.min(Math.max(O,j/2),U-j/2);return{id:u.current++,assetId:V.image.assetId,link:V.link,name:V.image.name,x:re,y:N,width:ie}};s.useEffect(()=>{if(!i||t.length===0)return;const V=i.getBoundingClientRect(),w=V.width,U=V.height,P=[];(async()=>{const j=t[0],ie=await T(j,w,U);P.push(ie),l(P),d(1)})()},[S,W,q,z,i]),s.useEffect(()=>{L==="last One"&&l(V=>V.length>0?[V[V.length-1]]:[])},[L]);const C=async V=>{if(!i)return;const w=i.getBoundingClientRect(),U=V.clientX-w.left,P=V.clientY-w.top;if(G==="image"&&!vc(U,P,r))return;let A=0,j=0;z==="on Click"?(A=U,j=P):z==="same"?(A=w.width/2,j=w.height/2):(A=Math.random()*w.width,j=Math.random()*w.height);const ie=t[c],ae=await T(ie,w.width,w.height,{x:A,y:j});l(O=>L==="all"?[...O,ae]:[ae]),d(O=>O>=t.length-1?0:O+1)};return a.jsxs("div",{ref:o,onClick:C,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:no.imageRevealSlider,style:{cursor:m==="none"?"default":"none"},children:[r.map(V=>a.jsx("div",{className:no.wrapper,style:{top:`${V.y}px`,left:`${V.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:V.width??"auto",height:"auto",cursor:m==="none"?"default":"none"},children:G==="area"&&V.link?a.jsx("a",{href:V.link,target:"_blank",className:no.link,children:a.jsx("img",{src:V.assetId,alt:V.name,className:no.image},V.id)}):a.jsx("img",{src:V.assetId,alt:V.name,className:no.image},V.id)},V.id)),M&&a.jsx("div",{className:no.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Sh={element:bh,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.assetId",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:{assetId:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",assetId:"01M3QM74XGWBJY3AQQ71GC2Z6Q",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",assetId:"01M3QM74XGMXS1Z5ZY2RFGS3T4",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",assetId:"01M3QM74XGWG6VCHNEXKVKAJGT",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",assetId:"01M3QM74XGCVMTPNHFHMR98RPZ",name:"Slider-4.png"},link:""}]}}}},wh="LightBox-module__hidden___9s-9x",$h="LightBox-module__heroImage___sTxNF",Ch="LightBox-module__background___rm9ml",Th="LightBox-module__editor___4ACaY",Ih="LightBox-module__contentStyle___Bgnsq",Lh="LightBox-module__imageStyle___tLIlB",Ph="LightBox-module__imgWrapper___LuFUp",Rh="LightBox-module__contain___8-yaS",Mh="LightBox-module__cover___hNvOG",Eh="LightBox-module__caption___b6L2I",kh="LightBox-module__captionTextInner___rCGNH",Ah="LightBox-module__lightboxSplide___XFuWC",Fh="LightBox-module__arrow___iz38X",Nh="LightBox-module__arrowVertical___Zfz81",_h="LightBox-module__nextArrow___zkAQN",Hh="LightBox-module__arrowInner___p48sW",Wh="LightBox-module__arrowIcon___3VaFf",Oh="LightBox-module__arrowImg___pNV88",Dh="LightBox-module__mirror___pjeXc",Bh="LightBox-module__thumbsWrapper___GB-nU",zh="LightBox-module__thumbsContainerVertical___wttk5",jh="LightBox-module__thumbsContainer___osSma",Vh="LightBox-module__thumbsAlignStart___MO6tY",Gh="LightBox-module__thumbsAlignCenter___Q4sUx",Xh="LightBox-module__thumbsAlignEnd___p4y9R",Uh="LightBox-module__thumbItem___HvnF3",qh="LightBox-module__closeButton___g2khP",Yh="LightBox-module__fadeIn___0m5GW",Kh="LightBox-module__slideInLeft___gPYwC",Qh="LightBox-module__slideInRight___S-pPp",Zh="LightBox-module__slideInTop___DFdAj",Jh="LightBox-module__slideInBottom___m27kZ",ef="LightBox-module__fadeOut___55qBR",tf="LightBox-module__slideOutLeft___NvU7P",nf="LightBox-module__slideOutRight___SK7eC",of="LightBox-module__slideOutTop___Vgg0z",rf="LightBox-module__slideOutBottom___nJ0Ef",af="LightBox-module__scaleSlide___vZriG",at={hidden:wh,heroImage:$h,background:Ch,editor:Th,contentStyle:Ih,imageStyle:Lh,imgWrapper:Ph,contain:Rh,cover:Mh,caption:Eh,captionTextInner:kh,lightboxSplide:Ah,arrow:Fh,arrowVertical:Nh,nextArrow:_h,arrowInner:Hh,arrowIcon:Wh,arrowImg:Oh,mirror:Dh,thumbsWrapper:Bh,thumbsContainerVertical:zh,thumbsContainer:jh,thumbsAlignStart:Vh,thumbsAlignCenter:Gh,thumbsAlignEnd:Xh,thumbItem:Uh,closeButton:qh,fadeIn:Yh,slideInLeft:Kh,slideInRight:Qh,slideInTop:Zh,slideInBottom:Jh,fadeOut:ef,slideOutLeft:tf,slideOutRight:nf,slideOutTop:of,slideOutBottom:rf,scaleSlide:af},Wr=(e,t,n)=>{const i={},[o,r]=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"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="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)}))`:r==="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 ju(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 sf(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function Vu(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const c=e;return{renderedW:c,renderedH:c/r}}const l=t;return{renderedW:l*r,renderedH:l}}function lf(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const c=t;return{renderedW:c*r,renderedH:c}}const l=e;return{renderedW:l,renderedH:l/r}}function Gu(e,t,n,i,o){const{x:r,y:l}=sf(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function cf(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,r=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:c}=window.getComputedStyle(e),d=l==="cover"?lf:Vu,{renderedW:u,renderedH:p}=d(n,i,o,r),{offsetX:y,offsetY:v}=Gu(n,i,u,p,c),g=(y+u/2)/n*100,m=(v+p/2)/i*100;return`${g}% ${m}%`}function df(e){return cf(e)}function Sa(e){const t=e.getBoundingClientRect(),n=ju(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),r=e.naturalWidth,l=e.naturalHeight,{renderedW:c,renderedH:d}=Vu(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:y}=Gu(i,o,c,d,u),v=t.left+n.left,g=t.top+n.top;return{x:p+v,y:y+g,width:c,height:d}}function xc(e){const t=e.getBoundingClientRect(),n=ju(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function uf(e,t){const n=(()=>{if(e==="fade in")return at.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return at.slideInLeft;case"right":return at.slideInRight;case"top":return at.slideInTop;case"bottom":return at.slideInBottom;default:return at.slideInRight}return at.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return at.fadeIn;if(e==="slide in")switch(t){case"left":return at.slideInLeft;case"right":return at.slideInRight;case"top":return at.slideInTop;case"bottom":return at.slideInBottom;default:return at.slideInRight}return at.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return at.fadeOut;if(e==="slide in")switch(t){case"left":return at.slideOutLeft;case"right":return at.slideOutRight;case"top":return at.slideOutTop;case"bottom":return at.slideOutBottom;default:return at.slideOutRight}return at.fadeOut})(),r=(()=>{if(e==="fade in")return at.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return at.slideOutLeft;case"right":return at.slideOutRight;case"top":return at.slideOutTop;case"bottom":return at.slideOutBottom;default:return at.slideOutRight}return at.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const pf=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[c,d]=s.useState(!1),{assetId:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&d(!1),o==="open"&&d(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:at.heroImage,onClick:()=>d(!0)}),a.jsx(gf,{isOpen:c,onClose:()=>d(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},gf=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:c})=>{var Ce;const{widthSettings:d,fontSettings:u,letterSpacing:p,textAlign:y,wordSpacing:v,fontSizeLineHeight:g,textAppearance:m,color:x}=i.imageCaption??{},[b,M]=s.useState(0),[f,S]=s.useState(0),[W,q]=s.useState(!1),[z,L]=s.useState(!1),[_,G]=s.useState({}),$=s.useRef(null),I=s.useRef(null),D=s.useRef(null),E=s.useRef(!1),T=s.useRef(null),C=s.useRef(null),V=s.useRef(null),w=s.useRef(null),U=s.useRef(!1),P=s.useRef(null),[A,j]=s.useState(!1),{appear:ie,triggers:ae,slider:O,thumbnail:re,controls:N,area:le,caption:J,layout:be}=o.lightboxBlock,{appearClass:Le,backdropAppearClass:ye,backdropDisappearClass:ce,disappearClass:K}=uf(ie.type,ie.direction),se=(c==null?void 0:c.itemId)??null;s.useEffect(()=>{const h=()=>{setTimeout(()=>{var Q,ne;(ne=(Q=$.current)==null?void 0:Q.splide)==null||ne.refresh()},16)},Y=()=>{S(Q=>Q+1)};return window.addEventListener("ArticleEditor.Layout:change",h),window.addEventListener("ArticleEditor.ComponentContent:change",Y),()=>{window.removeEventListener("ArticleEditor.Layout:change",h),window.removeEventListener("ArticleEditor.ComponentContent:change",Y)}},[]),s.useEffect(()=>{if(!e||!re.isActive){j(!1);return}const h=P.current;if(!h)return;const Y=()=>{O.direction==="horiz"?j(h.scrollWidth>h.clientWidth):j(h.scrollHeight>h.clientHeight)};Y();const Q=new ResizeObserver(Y);return Q.observe(h),()=>Q.disconnect()},[e,re.isActive,n.length,_,O.direction]);const pe=s.useCallback(()=>{const h=window.matchMedia("(max-width: 768px)").matches,Y=F.getColorAlpha(le.color);h&&!l&&Y>.9&&(document.body.style.backgroundColor=""),q(!0),E.current=!0;const Q=ne=>{ne.target===T.current&&ne.animationName&&(T.current&&C.current&&T.current.removeEventListener("animationend",C.current),C.current=null,E.current&&(E.current=!1,t()),q(!1))};T.current&&(C.current=Q,T.current.addEventListener("animationend",Q))},[t,le.color,l]),fe=(h,Y,Q)=>{var ne,ue;if(h){if(ae.type==="click"&&ae.switch==="image")ae.repeat==="close"&&b===n.length-1?pe():(ne=$.current)==null||ne.go("+1");else if(ae.type==="click"&&ae.switch==="50/50"){const B=h.getBoundingClientRect(),R=Y-B.left,ee=Q-B.top,te=B.width,ge=B.height;let X;O.direction==="horiz"?X=R<te/2?"-1":"+1":X=ee<ge/2?"-1":"+1",(ue=$.current)==null||ue.go(X)}}},we=h=>{if(U.current){U.current=!1;return}const Y=n[b],Q=(Y==null?void 0:Y.image.objectFit)==="cover";let ne,ue;if("changedTouches"in h&&h.changedTouches.length>0)ne=h.changedTouches[0].clientX,ue=h.changedTouches[0].clientY;else if("clientX"in h)ne=h.clientX,ue=h.clientY;else return;let B;if(Q&&D.current){const R=xc(D.current);B=ne>=R.left&&ne<=R.right&&ue>=R.top&&ue<=R.bottom}else{const R=D.current?Sa(D.current):null;if(!R){h.target===h.currentTarget&&pe();return}B=ne>=R.x&&ne<=R.x+R.width&&ue>=R.y&&ue<=R.y+R.height}B?fe(D.current,ne,ue):pe()},Re=h=>{const Y=h.target;(Y.classList.contains(at.thumbsWrapper)||Y.classList.contains(at.thumbsContainer))&&we(h)};s.useEffect(()=>{if(!e)return;const h=Y=>{var Q,ne;if(Y.key==="Escape"){pe();return}if(Y.key==="ArrowRight"){M(ue=>(ue+1)%Math.max(n.length,1)),(Q=$.current)==null||Q.go("+1");return}Y.key==="ArrowLeft"&&(M(ue=>(ue-1+Math.max(n.length,1))%Math.max(n.length,1)),(ne=$.current)==null||ne.go("-1"))};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[e,pe,n.length]),s.useEffect(()=>{if(e){if(M(0),S(Y=>Y+1),E.current=!1,q(!1),L(!1),G({}),!se)return;const h=new CustomEvent("page-overlay",{detail:{itemId:se}});window.dispatchEvent(h)}return()=>{T.current&&C.current&&(T.current.removeEventListener("animationend",C.current),C.current=null),L(!1)}},[e,se]),s.useEffect(()=>{I.current!==null&&I.current!==O.type&&S(h=>h+1),I.current=O.type},[O.type]),s.useEffect(()=>{if(!e)return;const h=document.body.style.overflow,Y=window.matchMedia("(max-width: 768px)").matches,Q=F.getColorAlpha(le.color);document.body.style.overflow="hidden",L(!1);const ne=B=>{B.target===T.current&&!E.current&&B.animationName&&(Y&&!l&&Q>.9&&(document.body.style.backgroundColor=le.color),L(!0),T.current&&V.current&&T.current.removeEventListener("animationend",V.current),V.current=null)};T.current&&(V.current=ne,T.current.addEventListener("animationend",ne));const ue=B=>{const R=B.target;R&&(R.closest(`.${at.thumbsWrapper}`)||R.closest(`.${at.thumbsContainer}`))||O.type!=="slide"&&B.preventDefault()};return document.addEventListener("touchmove",ue,{passive:!1}),()=>{document.body.style.overflow=h,document.removeEventListener("touchmove",ue),T.current&&V.current&&(T.current.removeEventListener("animationend",V.current),V.current=null),L(!1)}},[e,l,le.color,O.type]),s.useEffect(()=>{if(!e)return;const h=Y=>{var ne,ue;if(E.current){Y.stopPropagation();return}if(U.current){U.current=!1;return}const Q=Y.target;if(!(Q&&(Q.closest(`.${at.thumbsContainer}`)||Q.closest(`.${at.thumbItem}`)||Q.closest(`.${at.arrow}`)||Q.closest(`.${at.closeButton}`)||Q.closest(`.${at.caption}`)))){if(O.type==="slide"&&ae.type==="drag"&&((ue=(ne=$.current)==null?void 0:ne.splide)!=null&&ue.root)){const B=$.current.splide.root;if(Q&&(B.contains(Q)||B===Q))return}if(Y.touches.length===0&&Y.changedTouches.length>0){const B=n[b],R=(B==null?void 0:B.image.objectFit)==="cover",ee=Y.changedTouches[0];let te;if(R&&D.current){const ge=xc(D.current);te=ee.clientX>=ge.left&&ee.clientX<=ge.right&&ee.clientY>=ge.top&&ee.clientY<=ge.bottom}else{const ge=D.current?Sa(D.current):null;if(!ge)return;te=ee.clientX>=ge.x&&ee.clientX<=ge.x+ge.width&&ee.clientY>=ge.y&&ee.clientY<=ge.y+ge.height}if(!te){Y.stopPropagation(),E.current=!0;const ge=X=>{X.stopPropagation(),X.preventDefault(),document.removeEventListener("click",ge,!0)};document.addEventListener("click",ge,!0),pe()}}}};return document.addEventListener("touchend",h,{passive:!0}),()=>{document.removeEventListener("touchend",h)}},[e,pe,b,n]);const me=(O.type==="scale"||O.type==="fade")&&O.direction==="vert"&&ae.type==="drag";s.useEffect(()=>{var X,Pe;if(!e||!me||!((Pe=(X=$.current)==null?void 0:X.splide)!=null&&Pe.root))return;const h=$.current.splide.root,Y=30,Q=(Se,Z)=>{if(w.current){const He=Math.abs(Se-w.current.x),We=Math.abs(Z-w.current.y);(He>0||We>0)&&(U.current=!0)}},ne=Se=>{w.current&&(Se.preventDefault(),Q(Se.clientX,Se.clientY))},ue=Se=>{w.current&&Se.touches.length>0&&(Se.preventDefault(),Q(Se.touches[0].clientX,Se.touches[0].clientY))},B=(Se,Z)=>{if(!w.current||!$.current){w.current=null;return}const He=Math.abs(Se-w.current.x),We=Math.abs(Z-w.current.y);We>Y&&We>He&&$.current.go(Z<w.current.y?"+1":"-1"),w.current=null},R=Se=>{w.current&&B(Se.clientX,Se.clientY),document.removeEventListener("pointerup",R),document.removeEventListener("pointercancel",R),document.removeEventListener("pointermove",ne)},ee=Se=>{if(w.current){if(Se.changedTouches.length>0){const Z=Se.changedTouches[0];B(Z.clientX,Z.clientY)}document.removeEventListener("touchend",ee),document.removeEventListener("touchcancel",ee),document.removeEventListener("touchmove",ue)}},te=Se=>{w.current={x:Se.clientX,y:Se.clientY},U.current=!1,document.addEventListener("pointermove",ne,{passive:!1}),document.addEventListener("pointerup",R),document.addEventListener("pointercancel",R)},ge=Se=>{Se.touches.length>0&&(w.current={x:Se.touches[0].clientX,y:Se.touches[0].clientY},U.current=!1,document.addEventListener("touchmove",ue,{passive:!1}),document.addEventListener("touchend",ee),document.addEventListener("touchcancel",ee))};return h.addEventListener("pointerdown",te),h.addEventListener("touchstart",ge),()=>{h.removeEventListener("pointerdown",te),h.removeEventListener("touchstart",ge),document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",R),document.removeEventListener("pointercancel",R),document.removeEventListener("touchmove",ue),document.removeEventListener("touchend",ee),document.removeEventListener("touchcancel",ee),w.current=null,U.current=!1}},[e,me,f]);const xe={backgroundColor:le.color,backdropFilter:`blur(${le.blur}px)`,animationDuration:`${parseInt(ie.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Xn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:T,className:Ct(at.background,W?ce:ye,{[at.editor]:l},{[at.hidden]:!e}),style:{...xe,...z&&!l&&!W?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?T:null,className:Ct(at.contentStyle,W?K:Le,{[at.editor]:l},{[at.hidden]:!e}),style:{animationDuration:`${parseInt(ie.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(El,{onMove:h=>M(h.index),ref:$,className:at.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:ae.type==="drag"&&!me,perPage:1,width:"100%",height:"100%",type:O.type==="fade"||O.type==="scale"?"fade":"loop",padding:0,rewind:ae.repeat!=="close",start:0},style:{"--splide-speed":O.duration},children:n.map((h,Y)=>{const Q=Wr(be.position,be.offset,l),ne=`${F.scalingValue(be.padding.top,l)} ${F.scalingValue(be.padding.right,l)} ${F.scalingValue(be.padding.bottom,l)} ${F.scalingValue(be.padding.left,l)}`,ue=O.type==="scale"?(()=>{const{transform:B,...R}=Q;return{...R,position:"absolute",padding:ne,boxSizing:"border-box","--position-transform":B||"none"}})():{...Q,position:"absolute",padding:ne,boxSizing:"border-box"};return a.jsx(kl,{children:a.jsx("div",{className:at.imgWrapper,onClick:we,children:a.jsx("img",{ref:Y===b?D:null,className:Ct(at.imageStyle,{[at.contain]:h.image.objectFit==="contain",[at.cover]:h.image.objectFit==="cover",[at.scaleSlide]:O.type==="scale"}),src:h.image.assetId,alt:h.image.name??"",style:{...ue,pointerEvents:h.image.objectFit==="contain"?"none":"auto"}})})},Y)})},f),N.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(at.arrow,{[at.arrowVertical]:O.direction==="vert"}),style:{color:N.color,"--arrow-hover-color":N.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${F.scalingValue(N.offset.x,l)}, ${F.scalingValue(N.offset.y*(O.direction==="horiz"?1:-1),l)}) scale(${N.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=$.current)==null?void 0:h.go("-1")},"aria-label":"Previous",children:[N.arrowsImgUrl&&a.jsx(gn,{url:N.arrowsImgUrl,fill:N.color,hoverFill:N.hover,className:Ct(at.arrowImg,at.mirror)}),!N.arrowsImgUrl&&a.jsx(bc,{color:N.color,className:Ct(at.arrowIcon,at.arrowImg,at.mirror)})]})}),a.jsx("div",{className:Ct(at.arrow,at.nextArrow,{[at.arrowVertical]:O.direction==="vert"}),style:{color:N.color,"--arrow-hover-color":N.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${F.scalingValue(N.offset.x*(O.direction==="horiz"?-1:1),l)}, ${F.scalingValue(N.offset.y,l)}) scale(${N.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=$.current)==null?void 0:h.go("+1")},"aria-label":"Next",children:[N.arrowsImgUrl&&a.jsx(gn,{url:N.arrowsImgUrl,fill:N.color,hoverFill:N.hover,className:at.arrowImg}),!N.arrowsImgUrl&&a.jsx(bc,{color:N.color,className:Ct(at.arrowIcon,at.arrowImg)})]})})]}),le.closeIconUrl&&(()=>{const h=Wr(le.closeIconAlign,le.closeIconOffset,l),Y=`scale(${le.closeIconScale})`,Q=h.transform?`${h.transform} ${Y}`:Y;return a.jsx("button",{className:at.closeButton,style:{...h,transform:Q},onClick:pe,"aria-label":"Close lightbox",children:a.jsx(gn,{url:le.closeIconUrl,fill:le.closeIconColor??"#000000",hoverFill:le.closeIconHover??"#cccccc"})})})(),J&&J.isActive&&i.imageCaption&&((Ce=n[b])==null?void 0:Ce.imageCaption)&&a.jsx("div",{className:at.caption,style:{...Wr(J.alignment,J.offset,l),fontFamily:Do(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:d.sizing==="auto"?"max-content":F.scalingValue(d.width,l),letterSpacing:F.scalingValue(p,l),wordSpacing:F.scalingValue(v,l),textAlign:y,fontSize:F.scalingValue(g.fontSize,l),lineHeight:F.scalingValue(g.lineHeight,l),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:x},onClick:h=>h.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:at.captionTextInner,style:{"--link-color":J.linkColor,"--link-hover-color":J.linkHoverColor},children:a.jsx(Yi,{content:n[b].imageCaption})})}),re.isActive&&(()=>{const[h,Y]=re.position.split("-"),Q=O.direction==="horiz"?`${h}-left`:re.position,ne=Wr(Q,re.offset,l),ue=()=>{if(O.direction==="horiz"){if(Y==="left")return"flex-start";if(Y==="center")return"center";if(Y==="right")return"flex-end"}else{if(h==="top")return"flex-start";if(h==="middle")return"center";if(h==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:P,className:at.thumbsWrapper,onClick:B=>Re(B),style:{position:l?"absolute":"fixed",...ne,...O.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:Ct(at.thumbsContainer,{[at.thumbsContainerVertical]:O.direction==="vert",[at.thumbsAlignStart]:re.align==="start",[at.thumbsAlignCenter]:re.align==="center",[at.thumbsAlignEnd]:re.align==="end"}),style:{gap:F.scalingValue(re.grid.gap,l),justifyContent:A?"flex-start":ue()},children:n.map((B,R)=>{const ee=R===b,te=_[R],X=re.grid.size*(ee?re.activeState.scale:1),Pe=()=>{if(re.fit!=="fit")return{};if(!te)return O.direction==="horiz"?{height:F.scalingValue(X,l)}:{width:F.scalingValue(X,l)};const Se=te.width/te.height;if(O.direction==="horiz"){const Z=X,He=Z*Se;return{width:F.scalingValue(He,l),height:F.scalingValue(Z,l)}}else{const Z=X,He=Z/Se;return{width:F.scalingValue(Z,l),height:F.scalingValue(He,l)}}};return a.jsx("button",{className:at.thumbItem,style:{...O.direction==="horiz"&&re.fit!=="fit"?{height:F.scalingValue(X,l)}:{},...O.direction==="vert"&&re.fit!=="fit"?{width:F.scalingValue(X,l)}:{},...re.fit==="cover"?{width:F.scalingValue(X,l),height:F.scalingValue(X,l)}:{},...Pe(),transition:ee?"all 0.25s ease-out":"none",opacity:ee?re.activeState.opacity/100:re.opacity/100,"--thumb-hover":re.activeState.opacity/100},onClick:Se=>{var Z;Se.stopPropagation(),M(R),(Z=$.current)==null||Z.go(R)},onMouseEnter:()=>{var Se;re.triggers==="hov"&&((Se=$.current)==null||Se.go(R))},children:a.jsx("img",{src:B.image.assetId,alt:B.image.name??"",onLoad:Se=>{const Z=Se.currentTarget;Z.naturalWidth&&Z.naturalHeight&&G(He=>({...He,[R]:{width:Z.naturalWidth,height:Z.naturalHeight}}))},style:{objectFit:re.fit==="cover"?"cover":"contain",...re.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...re.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${B.image.name}-${R}`)})})})})()]})]}),document.getElementById(r))};function bc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const mf={element:pf,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.assetId",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.assetId",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:{assetId:{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:{assetId:"01M3QM74XEQ5ZGJ9WAMKV0EY1V"}},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:{assetId:"01M3QM74XEQ5ZGJ9WAMKV0EY1V"}},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:{assetId:"01M3QM74XEQ5ZGJ9WAMKV0EY1V"}},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:{assetId:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",assetId:"01M3QM74XD4J8X0B8TTSQ8CV3P",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",assetId:"01M3QM74XD0N6VQJ5J8J9YB32N",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",assetId:"01M3QM74XE4WSEPVF1QQSKMD76",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 Or(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function hf(e){return`
|
|
6
|
+
*/const dh="RichTextRenderer-module__link___BWeZ2",uh={link:dh},ph=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))},zo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>ph(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function pn(e){const{color:t,...n}=e;return n}function nn(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:zo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:A.scalingValue(e.letterSpacing,t),wordSpacing:A.scalingValue(e.wordSpacing,t),fontSize:A.scalingValue(n,t),lineHeight:i!==void 0?A.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}function qu(e){return e!=null&&e.length?e.some(t=>t.type==="link"?qu(t.children):!!t.text):!1}const Zi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:uh.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:mh(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:qu(o)?t(o):" "},i)})})};function mh(e){return{...e.fontFamily&&{fontFamily:zo(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 gh="SvgImage-module__svg___q3xE-",hh="SvgImage-module__img___VsTm-",fc={svg:gh,img:hh},Za=new Map;function yr(e){return e.startsWith("data:")||e.startsWith("blob:")}function Uu(e){if(yr(e))return Promise.resolve(e);const t=Za.get(e);if(t)return t;const n=fetch(e,{mode:"cors",cache:"reload"}).then(i=>{if(!i.ok)throw new Error(String(i.status));return i.blob()}).then(i=>URL.createObjectURL(i)).catch(i=>{throw Za.delete(e),i});return Za.set(e,n),n}const fh=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},yh=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,gn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[r,l]=s.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")')),[c,d]=s.useState(()=>yr(e)?e:null);return s.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(u)}},[]),s.useEffect(()=>{if(!fh(e)){d(null);return}if(yr(e)){d(e);return}let u=!1;return Uu(e).then(p=>{u||d(p)}).catch(()=>{u||d(null)}),()=>{u=!0}},[e]),!c||!r?a.jsx("img",{src:e,alt:"",className:Rt(fc.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:Rt(fc.svg,i),style:{"--svg":yh(c),"--fill":t,"--hover-fill":n,...o??{}}})},vh={"top-left":Lt.topLeftAlignment,"top-center":Lt.topCenterAlignment,"top-right":Lt.topRightAlignment,"middle-left":Lt.middleLeftAlignment,"middle-center":Lt.middleCenterAlignment,"middle-right":Lt.middleRightAlignment,"bottom-left":Lt.bottomLeftAlignment,"bottom-center":Lt.bottomCenterAlignment,"bottom-right":Lt.bottomRightAlignment};function xh({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:c,letterSpacing:d,textAlign:u,wordSpacing:p,fontSizeLineHeight:v,textAppearance:x,color:m}=n.imageCaption??{},[h,b]=s.useState(void 0),[S,M]=s.useState(null),[y,$]=s.useState(0),[R,X]=s.useState(0),{direction:B,transition:O,controls:N,pagination:z,imageCaption:C,triggers:I}=e,j=s.useRef(O.type),{x:E,y:w}=e.controls.offset,L=V=>{o&&o.go(V)};return s.useEffect(()=>{if(!S)return;const V=new ResizeObserver(_=>{if(!o)return;const[K]=_;b({width:Math.round(K.contentRect.width),height:Math.round(K.contentRect.height)})});return V.observe(S),()=>V.unobserve(S)},[S]),s.useEffect(()=>{!o||j.current===O.type||(X(V=>V+1),j.current=O.type)},[O.type]),a.jsx("div",{className:Rt(Lt.wrapper,{[Lt.editor]:i}),ref:M,children:a.jsxs("div",{className:Lt.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:O.backgroundColor&&O.type==="fade in"?O.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:Rt(Lt.captionBlock),children:a.jsx("div",{className:Lt.captionTextWrapper,children:t.map((V,_)=>a.jsx("div",{className:Rt(Lt.captionText,vh[C.alignment],{[Lt.withPointerEvents]:_===y&&i,[Lt.active]:_===y}),style:{fontFamily:zo(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:l.sizing==="auto"?"max-content":A.scalingValue(l.width,i),letterSpacing:A.scalingValue(d,i),wordSpacing:A.scalingValue(p,i),textAlign:u,fontSize:A.scalingValue(v.fontSize,i),lineHeight:A.scalingValue(v.lineHeight,i),textTransform:x.textTransform??"none",textDecoration:x.textDecoration??"none",fontVariant:x.fontVariant??"normal",color:m,transitionDuration:O.duration?`${Math.round(parseInt(O.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:Lt.captionTextInner,style:{"--link-hover-color":C.linkHoverColor,"--link-color":C.linkColor,position:"relative",top:A.scalingValue(C.offset.y,i),left:A.scalingValue(C.offset.x,i)},children:a.jsx(Zi,{content:V.imageCaption})})},_))})}),a.jsx(El,{onMove:V=>{$(V.index)},ref:r,options:{arrows:!1,speed:O.duration?parseInt(O.duration):500,autoplay:I.autoPlay!==null,...I.autoPlay!==null&&{interval:parseInt(I.autoPlay)*1e3},direction:B==="horiz"||O.type==="fade in"?"ltr":"ttb",pagination:!1,drag:I.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:O.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((V,_)=>a.jsx(kl,{children:a.jsx("div",{className:Lt.sliderItem,children:a.jsx("div",{className:Lt.imgWrapper,children:a.jsx("img",{className:Rt(Lt.sliderImage,{[Lt.contain]:V.image.objectFit==="contain",[Lt.cover]:V.image.objectFit==="cover"}),src:V.image.assetId,alt:V.image.name??""})})})},_))},R),N.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Rt(Lt.arrow,{[Lt.arrowVertical]:B==="vert",[Lt.hoverArrow]:N.show==="on hover"}),style:{color:N.color,"--arrow-hover-color":N.hover},children:a.jsxs("button",{onClick:()=>{L("-1")},className:Lt.arrowInner,style:{transform:`translate(${A.scalingValue(E,i)}, ${A.scalingValue(w*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[N.arrowsImgUrl&&a.jsx(gn,{url:N.arrowsImgUrl,fill:N.color,hoverFill:N.hover,className:Rt(Lt.arrowImg,Lt.mirror)}),!N.arrowsImgUrl&&a.jsx(yc,{color:N.color,className:Rt(Lt.arrowIcon,Lt.arrowImg,Lt.mirror)})]})}),a.jsx("div",{className:Rt(Lt.arrow,Lt.nextArrow,{[Lt.arrowVertical]:B==="vert",[Lt.hoverArrow]:N.show==="on hover"}),style:{color:N.color,"--arrow-hover-color":N.hover},children:a.jsxs("button",{className:Lt.arrowInner,onClick:()=>L("+1"),style:{transform:`translate(${A.scalingValue(E*(B==="horiz"?-1:1),i)}, ${A.scalingValue(w,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[N.arrowsImgUrl&&a.jsx(gn,{url:N.arrowsImgUrl,fill:N.color,hoverFill:N.hover,className:Lt.arrowImg}),!N.arrowsImgUrl&&a.jsx(yc,{color:N.color,className:Rt(Lt.arrowIcon,Lt.arrowImg)})]})})]}),I.triggersList.click&&a.jsx("div",{className:Lt.clickOverlay,onClick:()=>{o&&o.go("+1")}}),z.isActive&&a.jsx("div",{className:Rt(Lt.pagination,{[Lt.paginationInsideBottom]:z.position==="inside-1"&&B==="horiz",[Lt.paginationInsideTop]:z.position==="inside-2"&&B==="horiz",[Lt.paginationOutsideBottom]:z.position==="outside-1"&&B==="horiz",[Lt.paginationOutsideTop]:z.position==="outside-2"&&B==="horiz",[Lt.paginationInsideLeft]:z.position==="inside-1"&&B==="vert",[Lt.paginationInsideRight]:z.position==="inside-2"&&B==="vert",[Lt.paginationOutsideLeft]:z.position==="outside-1"&&B==="vert",[Lt.paginationOutsideRight]:z.position==="outside-2"&&B==="vert",[Lt.paginationVertical]:B==="vert"}),children:a.jsx("div",{className:Lt.paginationInner,style:{backgroundColor:z.colors[2],transform:`scale(${z.scale/100}) translate(${A.scalingValue(z.offset.x,i)}, ${A.scalingValue(z.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((V,_)=>a.jsx("button",{onClick:()=>{o&&o.go(_)},className:Rt(Lt.paginationItem),children:a.jsx("div",{className:Rt(Lt.dot,{[Lt.activeDot]:_===y}),style:{backgroundColor:_===y?z.colors[0]:z.colors[1],"--pagination-hover-color":z.hover}})},_))})})]})})}function yc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const bh={element:xh,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.assetId",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:{assetId:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",assetId:"01M3QM74XES6E7GVC0H3KJ2RH6",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",assetId:"01M3QM74XEAZ8H1DTC5V1S554K",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",assetId:"01M3QM74XEDRP49HNTEPNZYQTP",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"]}},Sh="ImageRevealSlider-module__imageRevealSlider___UE5Ob",wh="ImageRevealSlider-module__image___Qjt-e",$h="ImageRevealSlider-module__link___N-iLG",Ch="ImageRevealSlider-module__cursor___2U03d",oo={imageRevealSlider:Sh,image:wh,link:$h,cursor:Ch};function vc(e,t,n){for(const i of n){const o=new Image;o.src=i.assetId;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,c=r/2,d=l/2;if(e>=i.x-c&&e<=i.x+c&&t>=i.y-d&&t<=i.y+d)return!0}return!1}function Ja(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Th(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await Ja(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Ja(e);r=l.height/l.width*o}else{const l=await Ja(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Ih({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[c,d]=s.useState(0),u=s.useRef(0),[p,v]=s.useState({x:0,y:0}),[x,m]=s.useState(1),[h,b]=s.useState("none"),S=s.useRef({x:0,y:0}),[M,y]=s.useState(!1),{sizeType:$,imageWidth:R,randomRangeImageWidth:X}=e.imageSize,{revealPosition:B,visible:O}=e.position,{cursorType:N,target:z,defaultCursorScale:C,defaultCursor:I,hoverCursorScale:j,hoverCursor:E}=e.cursor;s.useEffect(()=>{if(!i)return;const V=(P,f)=>{const U=i.getBoundingClientRect(),te=P-U.left,ce=f-U.top;if(v({x:te,y:ce}),N==="system"){b("none"),m(1);return}const F=te,ie=ce,T=document.elementFromPoint(U.left+F,U.top+ie);if(T&&T.closest("a")){b("none"),m(1);return}const le=vc(F,ie,r)||z==="area"?{img:E??"none",scale:j}:{img:I??"none",scale:C};b(le.img),m(le.scale)},_=P=>{P.stopPropagation(),S.current={x:P.clientX,y:P.clientY},V(P.clientX,P.clientY)},K=()=>{M&&V(S.current.x,S.current.y)};return i.addEventListener("mousemove",_),window.addEventListener("scroll",K,!0),()=>{i.removeEventListener("mousemove",_),window.removeEventListener("scroll",K,!0)}},[i,M,p,N,z,E,I,j,C,r]),s.useEffect(()=>{M||(b("none"),m(0))},[M]);const w=async(V,_,K,P={})=>{const{width:f,height:U,finalWidth:te}=await Th(V.image.assetId,$,R,X);let ce=0,F=0;B==="same"?(ce=_/2,F=K/2):(ce=P.x??Math.random()*_,F=P.y??Math.random()*K);const ie=Math.min(Math.max(ce,f/2),_-f/2),T=Math.min(Math.max(F,U/2),K-U/2);return{id:u.current++,assetId:V.image.assetId,link:V.link,name:V.image.name,x:ie,y:T,width:te}};s.useEffect(()=>{if(!i||t.length===0)return;const V=i.getBoundingClientRect(),_=V.width,K=V.height,P=[];(async()=>{const U=t[0],te=await w(U,_,K);P.push(te),l(P),d(1)})()},[$,R,X,B,i]),s.useEffect(()=>{O==="last One"&&l(V=>V.length>0?[V[V.length-1]]:[])},[O]);const L=async V=>{if(!i)return;const _=i.getBoundingClientRect(),K=V.clientX-_.left,P=V.clientY-_.top;if(z==="image"&&!vc(K,P,r))return;let f=0,U=0;B==="on Click"?(f=K,U=P):B==="same"?(f=_.width/2,U=_.height/2):(f=Math.random()*_.width,U=Math.random()*_.height);const te=t[c],ce=await w(te,_.width,_.height,{x:f,y:U});l(F=>O==="all"?[...F,ce]:[ce]),d(F=>F>=t.length-1?0:F+1)};return a.jsxs("div",{ref:o,onClick:L,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:oo.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[r.map(V=>a.jsx("div",{className:oo.wrapper,style:{top:`${V.y}px`,left:`${V.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:V.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:z==="area"&&V.link?a.jsx("a",{href:V.link,target:"_blank",className:oo.link,children:a.jsx("img",{src:V.assetId,alt:V.name,className:oo.image},V.id)}):a.jsx("img",{src:V.assetId,alt:V.name,className:oo.image},V.id)},V.id)),M&&a.jsx("div",{className:oo.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${x})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Lh={element:Ih,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.assetId",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:{assetId:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",assetId:"01M3QM74XGWBJY3AQQ71GC2Z6Q",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",assetId:"01M3QM74XGMXS1Z5ZY2RFGS3T4",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",assetId:"01M3QM74XGWG6VCHNEXKVKAJGT",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",assetId:"01M3QM74XGCVMTPNHFHMR98RPZ",name:"Slider-4.png"},link:""}]}}}},Ph="LightBox-module__hidden___9s-9x",Rh="LightBox-module__heroImage___sTxNF",Mh="LightBox-module__background___rm9ml",Eh="LightBox-module__editor___4ACaY",kh="LightBox-module__contentStyle___Bgnsq",Ah="LightBox-module__imageStyle___tLIlB",Fh="LightBox-module__imgWrapper___LuFUp",Nh="LightBox-module__contain___8-yaS",_h="LightBox-module__cover___hNvOG",Hh="LightBox-module__caption___b6L2I",Wh="LightBox-module__captionTextInner___rCGNH",Oh="LightBox-module__lightboxSplide___XFuWC",Dh="LightBox-module__arrow___iz38X",Bh="LightBox-module__arrowVertical___Zfz81",zh="LightBox-module__nextArrow___zkAQN",jh="LightBox-module__arrowInner___p48sW",Vh="LightBox-module__arrowIcon___3VaFf",Gh="LightBox-module__arrowImg___pNV88",Xh="LightBox-module__mirror___pjeXc",qh="LightBox-module__thumbsWrapper___GB-nU",Uh="LightBox-module__thumbsContainerVertical___wttk5",Yh="LightBox-module__thumbsContainer___osSma",Kh="LightBox-module__thumbsAlignStart___MO6tY",Qh="LightBox-module__thumbsAlignCenter___Q4sUx",Zh="LightBox-module__thumbsAlignEnd___p4y9R",Jh="LightBox-module__thumbItem___HvnF3",ef="LightBox-module__closeButton___g2khP",tf="LightBox-module__fadeIn___0m5GW",nf="LightBox-module__slideInLeft___gPYwC",of="LightBox-module__slideInRight___S-pPp",rf="LightBox-module__slideInTop___DFdAj",af="LightBox-module__slideInBottom___m27kZ",sf="LightBox-module__fadeOut___55qBR",lf="LightBox-module__slideOutLeft___NvU7P",cf="LightBox-module__slideOutRight___SK7eC",df="LightBox-module__slideOutTop___Vgg0z",uf="LightBox-module__slideOutBottom___nJ0Ef",pf="LightBox-module__scaleSlide___vZriG",rt={hidden:Ph,heroImage:Rh,background:Mh,editor:Eh,contentStyle:kh,imageStyle:Ah,imgWrapper:Fh,contain:Nh,cover:_h,caption:Hh,captionTextInner:Wh,lightboxSplide:Oh,arrow:Dh,arrowVertical:Bh,nextArrow:zh,arrowInner:jh,arrowIcon:Vh,arrowImg:Gh,mirror:Xh,thumbsWrapper:qh,thumbsContainerVertical:Uh,thumbsContainer:Yh,thumbsAlignStart:Kh,thumbsAlignCenter:Qh,thumbsAlignEnd:Zh,thumbItem:Jh,closeButton:ef,fadeIn:tf,slideInLeft:nf,slideInRight:of,slideInTop:rf,slideInBottom:af,fadeOut:sf,slideOutLeft:lf,slideOutRight:cf,slideOutTop:df,slideOutBottom:uf,scaleSlide:pf},Wr=(e,t,n)=>{const i={},[o,r]=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"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${A.scalingValue(t.x,n)}), calc(-50% + ${A.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${A.scalingValue(t.x,n)}, calc(-50% + ${A.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${A.scalingValue(t.x,n)}), ${A.scalingValue(t.y,n)})`:i.transform=`translate(${A.scalingValue(t.x,n)}, ${A.scalingValue(t.y,n)})`,i};function Yu(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 mf(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function Ku(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const c=e;return{renderedW:c,renderedH:c/r}}const l=t;return{renderedW:l*r,renderedH:l}}function gf(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const c=t;return{renderedW:c*r,renderedH:c}}const l=e;return{renderedW:l,renderedH:l/r}}function Qu(e,t,n,i,o){const{x:r,y:l}=mf(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function hf(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,r=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:c}=window.getComputedStyle(e),d=l==="cover"?gf:Ku,{renderedW:u,renderedH:p}=d(n,i,o,r),{offsetX:v,offsetY:x}=Qu(n,i,u,p,c),m=(v+u/2)/n*100,h=(x+p/2)/i*100;return`${m}% ${h}%`}function ff(e){return hf(e)}function Sa(e){const t=e.getBoundingClientRect(),n=Yu(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),r=e.naturalWidth,l=e.naturalHeight,{renderedW:c,renderedH:d}=Ku(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:v}=Qu(i,o,c,d,u),x=t.left+n.left,m=t.top+n.top;return{x:p+x,y:v+m,width:c,height:d}}function xc(e){const t=e.getBoundingClientRect(),n=Yu(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function yf(e,t){const n=(()=>{if(e==="fade in")return rt.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return rt.slideInLeft;case"right":return rt.slideInRight;case"top":return rt.slideInTop;case"bottom":return rt.slideInBottom;default:return rt.slideInRight}return rt.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return rt.fadeIn;if(e==="slide in")switch(t){case"left":return rt.slideInLeft;case"right":return rt.slideInRight;case"top":return rt.slideInTop;case"bottom":return rt.slideInBottom;default:return rt.slideInRight}return rt.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return rt.fadeOut;if(e==="slide in")switch(t){case"left":return rt.slideOutLeft;case"right":return rt.slideOutRight;case"top":return rt.slideOutTop;case"bottom":return rt.slideOutBottom;default:return rt.slideOutRight}return rt.fadeOut})(),r=(()=>{if(e==="fade in")return rt.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return rt.slideOutLeft;case"right":return rt.slideOutRight;case"top":return rt.slideOutTop;case"bottom":return rt.slideOutBottom;default:return rt.slideOutRight}return rt.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const vf=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[c,d]=s.useState(!1),{assetId:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&d(!1),o==="open"&&d(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:rt.heroImage,onClick:()=>d(!0)}),a.jsx(xf,{isOpen:c,onClose:()=>d(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},xf=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:c})=>{var xe;const{widthSettings:d,fontSettings:u,letterSpacing:p,textAlign:v,wordSpacing:x,fontSizeLineHeight:m,textAppearance:h,color:b}=i.imageCaption??{},[S,M]=s.useState(0),[y,$]=s.useState(0),[R,X]=s.useState(!1),[B,O]=s.useState(!1),[N,z]=s.useState({}),C=s.useRef(null),I=s.useRef(null),j=s.useRef(null),E=s.useRef(!1),w=s.useRef(null),L=s.useRef(null),V=s.useRef(null),_=s.useRef(null),K=s.useRef(!1),P=s.useRef(null),[f,U]=s.useState(!1),{appear:te,triggers:ce,slider:F,thumbnail:ie,controls:T,area:le,caption:J,layout:Se}=o.lightboxBlock,{appearClass:Le,backdropAppearClass:me,backdropDisappearClass:ye,disappearClass:ee}=yf(te.type,te.direction),oe=(c==null?void 0:c.itemId)??null;s.useEffect(()=>{const g=()=>{setTimeout(()=>{var Q,ne;(ne=(Q=C.current)==null?void 0:Q.splide)==null||ne.refresh()},16)},G=()=>{$(Q=>Q+1)};return window.addEventListener("ArticleEditor.Layout:change",g),window.addEventListener("ArticleEditor.ComponentContent:change",G),()=>{window.removeEventListener("ArticleEditor.Layout:change",g),window.removeEventListener("ArticleEditor.ComponentContent:change",G)}},[]),s.useEffect(()=>{if(!e||!ie.isActive){U(!1);return}const g=P.current;if(!g)return;const G=()=>{F.direction==="horiz"?U(g.scrollWidth>g.clientWidth):U(g.scrollHeight>g.clientHeight)};G();const Q=new ResizeObserver(G);return Q.observe(g),()=>Q.disconnect()},[e,ie.isActive,n.length,N,F.direction]);const re=s.useCallback(()=>{const g=window.matchMedia("(max-width: 768px)").matches,G=A.getColorAlpha(le.color);g&&!l&&G>.9&&(document.body.style.backgroundColor=""),X(!0),E.current=!0;const Q=ne=>{ne.target===w.current&&ne.animationName&&(w.current&&L.current&&w.current.removeEventListener("animationend",L.current),L.current=null,E.current&&(E.current=!1,t()),X(!1))};w.current&&(L.current=Q,w.current.addEventListener("animationend",Q))},[t,le.color,l]),ge=(g,G,Q)=>{var ne,ue;if(g){if(ce.type==="click"&&ce.switch==="image")ce.repeat==="close"&&S===n.length-1?re():(ne=C.current)==null||ne.go("+1");else if(ce.type==="click"&&ce.switch==="50/50"){const q=g.getBoundingClientRect(),D=G-q.left,se=Q-q.top,Y=q.width,pe=q.height;let H;F.direction==="horiz"?H=D<Y/2?"-1":"+1":H=se<pe/2?"-1":"+1",(ue=C.current)==null||ue.go(H)}}},we=g=>{if(K.current){K.current=!1;return}const G=n[S],Q=(G==null?void 0:G.image.objectFit)==="cover";let ne,ue;if("changedTouches"in g&&g.changedTouches.length>0)ne=g.changedTouches[0].clientX,ue=g.changedTouches[0].clientY;else if("clientX"in g)ne=g.clientX,ue=g.clientY;else return;let q;if(Q&&j.current){const D=xc(j.current);q=ne>=D.left&&ne<=D.right&&ue>=D.top&&ue<=D.bottom}else{const D=j.current?Sa(j.current):null;if(!D){g.target===g.currentTarget&&re();return}q=ne>=D.x&&ne<=D.x+D.width&&ue>=D.y&&ue<=D.y+D.height}q?ge(j.current,ne,ue):re()},Ae=g=>{const G=g.target;(G.classList.contains(rt.thumbsWrapper)||G.classList.contains(rt.thumbsContainer))&&we(g)};s.useEffect(()=>{if(!e)return;const g=G=>{var Q,ne;if(G.key==="Escape"){re();return}if(G.key==="ArrowRight"){M(ue=>(ue+1)%Math.max(n.length,1)),(Q=C.current)==null||Q.go("+1");return}G.key==="ArrowLeft"&&(M(ue=>(ue-1+Math.max(n.length,1))%Math.max(n.length,1)),(ne=C.current)==null||ne.go("-1"))};return window.addEventListener("keydown",g),()=>{window.removeEventListener("keydown",g)}},[e,re,n.length]),s.useEffect(()=>{if(e){if(M(0),$(G=>G+1),E.current=!1,X(!1),O(!1),z({}),!oe)return;const g=new CustomEvent("page-overlay",{detail:{itemId:oe}});window.dispatchEvent(g)}return()=>{w.current&&L.current&&(w.current.removeEventListener("animationend",L.current),L.current=null),O(!1)}},[e,oe]),s.useEffect(()=>{I.current!==null&&I.current!==F.type&&$(g=>g+1),I.current=F.type},[F.type]),s.useEffect(()=>{if(!e)return;const g=document.body.style.overflow,G=window.matchMedia("(max-width: 768px)").matches,Q=A.getColorAlpha(le.color);document.body.style.overflow="hidden",O(!1);const ne=q=>{q.target===w.current&&!E.current&&q.animationName&&(G&&!l&&Q>.9&&(document.body.style.backgroundColor=le.color),O(!0),w.current&&V.current&&w.current.removeEventListener("animationend",V.current),V.current=null)};w.current&&(V.current=ne,w.current.addEventListener("animationend",ne));const ue=q=>{const D=q.target;D&&(D.closest(`.${rt.thumbsWrapper}`)||D.closest(`.${rt.thumbsContainer}`))||F.type!=="slide"&&q.preventDefault()};return document.addEventListener("touchmove",ue,{passive:!1}),()=>{document.body.style.overflow=g,document.removeEventListener("touchmove",ue),w.current&&V.current&&(w.current.removeEventListener("animationend",V.current),V.current=null),O(!1)}},[e,l,le.color,F.type]),s.useEffect(()=>{if(!e)return;const g=G=>{var ne,ue;if(E.current){G.stopPropagation();return}if(K.current){K.current=!1;return}const Q=G.target;if(!(Q&&(Q.closest(`.${rt.thumbsContainer}`)||Q.closest(`.${rt.thumbItem}`)||Q.closest(`.${rt.arrow}`)||Q.closest(`.${rt.closeButton}`)||Q.closest(`.${rt.caption}`)))){if(F.type==="slide"&&ce.type==="drag"&&((ue=(ne=C.current)==null?void 0:ne.splide)!=null&&ue.root)){const q=C.current.splide.root;if(Q&&(q.contains(Q)||q===Q))return}if(G.touches.length===0&&G.changedTouches.length>0){const q=n[S],D=(q==null?void 0:q.image.objectFit)==="cover",se=G.changedTouches[0];let Y;if(D&&j.current){const pe=xc(j.current);Y=se.clientX>=pe.left&&se.clientX<=pe.right&&se.clientY>=pe.top&&se.clientY<=pe.bottom}else{const pe=j.current?Sa(j.current):null;if(!pe)return;Y=se.clientX>=pe.x&&se.clientX<=pe.x+pe.width&&se.clientY>=pe.y&&se.clientY<=pe.y+pe.height}if(!Y){G.stopPropagation(),E.current=!0;const pe=H=>{H.stopPropagation(),H.preventDefault(),document.removeEventListener("click",pe,!0)};document.addEventListener("click",pe,!0),re()}}}};return document.addEventListener("touchend",g,{passive:!0}),()=>{document.removeEventListener("touchend",g)}},[e,re,S,n]);const fe=(F.type==="scale"||F.type==="fade")&&F.direction==="vert"&&ce.type==="drag";s.useEffect(()=>{var H,Ie;if(!e||!fe||!((Ie=(H=C.current)==null?void 0:H.splide)!=null&&Ie.root))return;const g=C.current.splide.root,G=30,Q=(de,Z)=>{if(_.current){const Ne=Math.abs(de-_.current.x),Oe=Math.abs(Z-_.current.y);(Ne>0||Oe>0)&&(K.current=!0)}},ne=de=>{_.current&&(de.preventDefault(),Q(de.clientX,de.clientY))},ue=de=>{_.current&&de.touches.length>0&&(de.preventDefault(),Q(de.touches[0].clientX,de.touches[0].clientY))},q=(de,Z)=>{if(!_.current||!C.current){_.current=null;return}const Ne=Math.abs(de-_.current.x),Oe=Math.abs(Z-_.current.y);Oe>G&&Oe>Ne&&C.current.go(Z<_.current.y?"+1":"-1"),_.current=null},D=de=>{_.current&&q(de.clientX,de.clientY),document.removeEventListener("pointerup",D),document.removeEventListener("pointercancel",D),document.removeEventListener("pointermove",ne)},se=de=>{if(_.current){if(de.changedTouches.length>0){const Z=de.changedTouches[0];q(Z.clientX,Z.clientY)}document.removeEventListener("touchend",se),document.removeEventListener("touchcancel",se),document.removeEventListener("touchmove",ue)}},Y=de=>{_.current={x:de.clientX,y:de.clientY},K.current=!1,document.addEventListener("pointermove",ne,{passive:!1}),document.addEventListener("pointerup",D),document.addEventListener("pointercancel",D)},pe=de=>{de.touches.length>0&&(_.current={x:de.touches[0].clientX,y:de.touches[0].clientY},K.current=!1,document.addEventListener("touchmove",ue,{passive:!1}),document.addEventListener("touchend",se),document.addEventListener("touchcancel",se))};return g.addEventListener("pointerdown",Y),g.addEventListener("touchstart",pe),()=>{g.removeEventListener("pointerdown",Y),g.removeEventListener("touchstart",pe),document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",D),document.removeEventListener("pointercancel",D),document.removeEventListener("touchmove",ue),document.removeEventListener("touchend",se),document.removeEventListener("touchcancel",se),_.current=null,K.current=!1}},[e,fe,y]);const ve={backgroundColor:le.color,backdropFilter:`blur(${le.blur}px)`,animationDuration:`${parseInt(te.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Un.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:w,className:Rt(rt.background,R?ye:me,{[rt.editor]:l},{[rt.hidden]:!e}),style:{...ve,...B&&!l&&!R?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?w:null,className:Rt(rt.contentStyle,R?ee:Le,{[rt.editor]:l},{[rt.hidden]:!e}),style:{animationDuration:`${parseInt(te.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(El,{onMove:g=>M(g.index),ref:C,className:rt.lightboxSplide,options:{arrows:!1,speed:F.duration?parseInt(F.duration):500,direction:F.direction==="horiz"||F.type==="fade"||F.type==="scale"?"ltr":"ttb",pagination:!1,drag:ce.type==="drag"&&!fe,perPage:1,width:"100%",height:"100%",type:F.type==="fade"||F.type==="scale"?"fade":"loop",padding:0,rewind:ce.repeat!=="close",start:0},style:{"--splide-speed":F.duration},children:n.map((g,G)=>{const Q=Wr(Se.position,Se.offset,l),ne=`${A.scalingValue(Se.padding.top,l)} ${A.scalingValue(Se.padding.right,l)} ${A.scalingValue(Se.padding.bottom,l)} ${A.scalingValue(Se.padding.left,l)}`,ue=F.type==="scale"?(()=>{const{transform:q,...D}=Q;return{...D,position:"absolute",padding:ne,boxSizing:"border-box","--position-transform":q||"none"}})():{...Q,position:"absolute",padding:ne,boxSizing:"border-box"};return a.jsx(kl,{children:a.jsx("div",{className:rt.imgWrapper,onClick:we,children:a.jsx("img",{ref:G===S?j:null,className:Rt(rt.imageStyle,{[rt.contain]:g.image.objectFit==="contain",[rt.cover]:g.image.objectFit==="cover",[rt.scaleSlide]:F.type==="scale"}),src:g.image.assetId,alt:g.image.name??"",style:{...ue,pointerEvents:g.image.objectFit==="contain"?"none":"auto"}})})},G)})},y),T.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Rt(rt.arrow,{[rt.arrowVertical]:F.direction==="vert"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:a.jsxs("button",{className:rt.arrowInner,style:{transform:`translate(${A.scalingValue(T.offset.x,l)}, ${A.scalingValue(T.offset.y*(F.direction==="horiz"?1:-1),l)}) scale(${T.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var g;return(g=C.current)==null?void 0:g.go("-1")},"aria-label":"Previous",children:[T.arrowsImgUrl&&a.jsx(gn,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:Rt(rt.arrowImg,rt.mirror)}),!T.arrowsImgUrl&&a.jsx(bc,{color:T.color,className:Rt(rt.arrowIcon,rt.arrowImg,rt.mirror)})]})}),a.jsx("div",{className:Rt(rt.arrow,rt.nextArrow,{[rt.arrowVertical]:F.direction==="vert"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:a.jsxs("button",{className:rt.arrowInner,style:{transform:`translate(${A.scalingValue(T.offset.x*(F.direction==="horiz"?-1:1),l)}, ${A.scalingValue(T.offset.y,l)}) scale(${T.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var g;return(g=C.current)==null?void 0:g.go("+1")},"aria-label":"Next",children:[T.arrowsImgUrl&&a.jsx(gn,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:rt.arrowImg}),!T.arrowsImgUrl&&a.jsx(bc,{color:T.color,className:Rt(rt.arrowIcon,rt.arrowImg)})]})})]}),le.closeIconUrl&&(()=>{const g=Wr(le.closeIconAlign,le.closeIconOffset,l),G=`scale(${le.closeIconScale})`,Q=g.transform?`${g.transform} ${G}`:G;return a.jsx("button",{className:rt.closeButton,style:{...g,transform:Q},onClick:re,"aria-label":"Close lightbox",children:a.jsx(gn,{url:le.closeIconUrl,fill:le.closeIconColor??"#000000",hoverFill:le.closeIconHover??"#cccccc"})})})(),J&&J.isActive&&i.imageCaption&&((xe=n[S])==null?void 0:xe.imageCaption)&&a.jsx("div",{className:rt.caption,style:{...Wr(J.alignment,J.offset,l),fontFamily:zo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:d.sizing==="auto"?"max-content":A.scalingValue(d.width,l),letterSpacing:A.scalingValue(p,l),wordSpacing:A.scalingValue(x,l),textAlign:v,fontSize:A.scalingValue(m.fontSize,l),lineHeight:A.scalingValue(m.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:b},onClick:g=>g.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:rt.captionTextInner,style:{"--link-color":J.linkColor,"--link-hover-color":J.linkHoverColor},children:a.jsx(Zi,{content:n[S].imageCaption})})}),ie.isActive&&(()=>{const[g,G]=ie.position.split("-"),Q=F.direction==="horiz"?`${g}-left`:ie.position,ne=Wr(Q,ie.offset,l),ue=()=>{if(F.direction==="horiz"){if(G==="left")return"flex-start";if(G==="center")return"center";if(G==="right")return"flex-end"}else{if(g==="top")return"flex-start";if(g==="middle")return"center";if(g==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:P,className:rt.thumbsWrapper,onClick:q=>Ae(q),style:{position:l?"absolute":"fixed",...ne,...F.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:Rt(rt.thumbsContainer,{[rt.thumbsContainerVertical]:F.direction==="vert",[rt.thumbsAlignStart]:ie.align==="start",[rt.thumbsAlignCenter]:ie.align==="center",[rt.thumbsAlignEnd]:ie.align==="end"}),style:{gap:A.scalingValue(ie.grid.gap,l),justifyContent:f?"flex-start":ue()},children:n.map((q,D)=>{const se=D===S,Y=N[D],H=ie.grid.size*(se?ie.activeState.scale:1),Ie=()=>{if(ie.fit!=="fit")return{};if(!Y)return F.direction==="horiz"?{height:A.scalingValue(H,l)}:{width:A.scalingValue(H,l)};const de=Y.width/Y.height;if(F.direction==="horiz"){const Z=H,Ne=Z*de;return{width:A.scalingValue(Ne,l),height:A.scalingValue(Z,l)}}else{const Z=H,Ne=Z/de;return{width:A.scalingValue(Z,l),height:A.scalingValue(Ne,l)}}};return a.jsx("button",{className:rt.thumbItem,style:{...F.direction==="horiz"&&ie.fit!=="fit"?{height:A.scalingValue(H,l)}:{},...F.direction==="vert"&&ie.fit!=="fit"?{width:A.scalingValue(H,l)}:{},...ie.fit==="cover"?{width:A.scalingValue(H,l),height:A.scalingValue(H,l)}:{},...Ie(),transition:se?"all 0.25s ease-out":"none",opacity:se?ie.activeState.opacity/100:ie.opacity/100,"--thumb-hover":ie.activeState.opacity/100},onClick:de=>{var Z;de.stopPropagation(),M(D),(Z=C.current)==null||Z.go(D)},onMouseEnter:()=>{var de;ie.triggers==="hov"&&((de=C.current)==null||de.go(D))},children:a.jsx("img",{src:q.image.assetId,alt:q.image.name??"",onLoad:de=>{const Z=de.currentTarget;Z.naturalWidth&&Z.naturalHeight&&z(Ne=>({...Ne,[D]:{width:Z.naturalWidth,height:Z.naturalHeight}}))},style:{objectFit:ie.fit==="cover"?"cover":"contain",...ie.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ie.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${q.image.name}-${D}`)})})})})()]})]}),document.getElementById(r))};function bc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const bf={element:vf,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.assetId",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.assetId",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:{assetId:{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:{assetId:"01M3QM74XEQ5ZGJ9WAMKV0EY1V"}},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:{assetId:"01M3QM74XEQ5ZGJ9WAMKV0EY1V"}},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:{assetId:"01M3QM74XEQ5ZGJ9WAMKV0EY1V"}},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:{assetId:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",assetId:"01M3QM74XD4J8X0B8TTSQ8CV3P",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",assetId:"01M3QM74XD0N6VQJ5J8J9YB32N",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",assetId:"01M3QM74XE4WSEPVF1QQSKMD76",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 Or(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Sf(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
pointer-events: auto;
|
|
156
156
|
z-index: 10;
|
|
157
157
|
}
|
|
158
|
-
`}function
|
|
158
|
+
`}function wf({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,c=i&&t||!t,{prefix:d}=A.useScopedStyles(),{type:u="A",fieldsToShow:p=2,textareaRows:v=1,fields:x=[],buttonLabel:m,gap:h,fieldsGap:b,buttonCorners:S,buttonStroke:M,buttonPadding:y,isButtonFullWidth:$,inputCorners:R,inputStroke:X,inputPadding:B,inputColor:O,inputTextColor:N,inputBorderColor:z,placeholderColor:C,buttonColor:I,buttonTextColor:j,buttonBorderColor:E,labelTextColor:w,successColor:L,errorColor:V,fontFamily:_,inputFontSettings:K,inputFontSize:P,inputLineHeight:f,inputLetterSpacing:U,inputWordSpacing:te,inputTextAppearance:ce,buttonFontSettings:F,buttonFontSize:ie,buttonLineHeight:T,buttonLetterSpacing:le,buttonWordSpacing:J,buttonTextAppearance:Se,labelFontSettings:Le,labelFontSize:me,labelLineHeight:ye,labelLetterSpacing:ee,labelWordSpacing:oe,labelTextAppearance:re,statusFontSettings:ge,statusFontSize:we,statusLineHeight:Ae,statusLetterSpacing:fe,statusWordSpacing:ve,statusTextAppearance:xe,successMessage:g,errorMessage:G,stateOverrides:Q}=e,ne=u==="B",ue=x.slice(0,Math.min(p,x.length)),q={fontSettings:{fontFamily:_,fontWeight:(K==null?void 0:K.fontWeight)??400,fontStyle:(K==null?void 0:K.fontStyle)??"normal"},fontSize:P??.01,lineHeight:f,letterSpacing:U??0,wordSpacing:te??0,textAppearance:ce,color:N},D=pn(nn(q,t)),se=A.scalingValue(X??0,t),Y=Ve=>A.scalingValue((f??P??.01)*Ve+((B==null?void 0:B.top)??0)+((B==null?void 0:B.bottom)??0)+(u==="C"?X??0:(X??0)*2),t),pe=Y(1),H=Y(Math.max(1,v)),Ie={...D,borderStyle:"solid",borderRadius:u==="C"?0:A.scalingValue(R??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:se,borderLeftWidth:0}:{borderWidth:se},paddingTop:A.scalingValue((B==null?void 0:B.top)??0,t),paddingRight:A.scalingValue((B==null?void 0:B.right)??0,t),paddingBottom:A.scalingValue((B==null?void 0:B.bottom)??0,t),paddingLeft:A.scalingValue((B==null?void 0:B.left)??0,t),height:pe,minHeight:pe},de={fontSettings:{fontFamily:_,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:T,letterSpacing:le??0,wordSpacing:J??0,textAppearance:Se,color:j},Z=pn(nn(de,t)),Ne=A.scalingValue(M??0,t),Oe={fontSettings:{fontFamily:_,fontWeight:(Le==null?void 0:Le.fontWeight)??400,fontStyle:(Le==null?void 0:Le.fontStyle)??"normal"},fontSize:me??.01,lineHeight:ye,letterSpacing:ee??0,wordSpacing:oe??0,textAppearance:re,color:w},Je=nn(Oe,t),De={fontSettings:{fontFamily:_,fontWeight:(ge==null?void 0:ge.fontWeight)??400,fontStyle:(ge==null?void 0:ge.fontStyle)??"normal"},fontSize:we??.01,lineHeight:Ae,letterSpacing:fe??0,wordSpacing:ve??0,textAppearance:xe,color:L},Ze=pn(nn(De,t)),at=A.buildColorVars(d,{inputColor:O,inputTextColor:N,inputBorderColor:z,placeholderColor:C!=null&&C.trim()?C:"#cccccc",buttonColor:I,buttonTextColor:j,buttonBorderColor:E,labelTextColor:w,successColor:L,errorColor:V},$f,Cf,Q),[Xe,be]=s.useState(()=>Object.fromEntries(ue.map(Ve=>[Ve.name,""]))),[He,je]=s.useState("idle"),[Qe,Ce]=s.useState(null),_e=r==="success"?"success":r==="error"?"error":He,Ue=r==="error"?G:Qe,Ye=r==="filled",lt=s.useMemo(()=>{if(!Ye)return Xe;let Ve=null;for(const ct of ue)(Xe[ct.name]??"").trim().length>0||(Ve=Ve??{...Xe},Ve[ct.name]="Filled");return Ve??Xe},[Xe,Ye,ue]),it=_e==="error"?A.getFormFieldValidationError(ue,lt):null,Ee=`${r&&r!=="default"?`${d}-state-${r}`:""}`.trim(),pt=o==null?void 0:o.submitUrl,ke=(Ve,ct)=>{be(ot=>({...ot,[Ve]:ct}))},We=async Ve=>{if(Ve.preventDefault(),!c)return;const ct=Object.fromEntries(ue.map(xt=>{var Pt;return[xt.name,((Pt=Xe[xt.name])==null?void 0:Pt.trim())??""]}).filter(([,xt])=>xt));if(!pt){je("error"),Ce("No integrations were found for this form.");return}if(Object.keys(ct).length===0)return;const ot=A.getFormFieldValidationError(ue,Xe);if(ot){je("error"),Ce(ot);return}je("submitting"),Ce(null);try{const xt=await fetch(pt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ct)});if(!xt.ok){const Pt=await xt.text();throw new Error(Pt||`Request failed: ${xt.status}`)}je("success"),be(Object.fromEntries(ue.map(Pt=>[Pt.name,""])))}catch(xt){je("error"),Ce(xt instanceof Error?xt.message:"Something went wrong")}};return a.jsxs("div",{className:`${d}-wrapper ${d}-type-${u} ${Ee}`.trim(),style:at,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Sf(d)}}),a.jsxs("form",{onSubmit:We,className:`${d}-form`,children:[a.jsx("div",{className:`${d}-fields`,children:ue.map((Ve,ct)=>a.jsxs(s.Fragment,{children:[ct>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${d}-control`:void 0,style:{height:A.scalingValue(b??0,t)}}),a.jsxs("div",{className:`${d}-field-group${ne?` ${d}-labeled`:""}`,children:[ne&&a.jsx("span",{className:`${d}-field-label`,style:Je?{...Je,lineHeight:Je.fontSize}:void 0,children:Ve.label||Ve.name}),Ve.type==="textarea"?a.jsx("textarea",{name:Ve.name,autoComplete:"off",value:lt[Ve.name]??"",onChange:ot=>ke(Ve.name,ot.target.value),placeholder:Ve.placeholder,className:`${d}-input`,style:{...Ie,height:H,minHeight:H},rows:v,"data-filled":Ye||(lt[Ve.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:Ve.type==="phone"?"tel":Ve.type==="email"?"email":"text",name:Ve.name,autoComplete:"off",value:lt[Ve.name]??"",onChange:ot=>ke(Ve.name,ot.target.value),placeholder:Ve.placeholder,required:Ve.isRequired??Ve.type==="email",className:`${d}-input`,style:Ie,"data-filled":Ye||(lt[Ve.name]??"").trim().length>0})]})]},ct))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${d}-control`:void 0,style:{height:A.scalingValue(h??0,t)}}),a.jsx("div",{className:`${d}-overlay-anchor`,children:a.jsx("button",{type:c?"submit":"button",className:`${d}-button`,style:{borderStyle:"solid",borderRadius:A.scalingValue(S??0,t),borderWidth:Ne,paddingTop:A.scalingValue((y==null?void 0:y.top)??0,t),paddingRight:A.scalingValue((y==null?void 0:y.right)??0,t),paddingBottom:A.scalingValue((y==null?void 0:y.bottom)??0,t),paddingLeft:A.scalingValue((y==null?void 0:y.left)??0,t),pointerEvents:c?"auto":void 0,...Z,...$?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${d}-overlay-anchor`,style:$?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:He==="submitting"?"...":m})})})]}),_e==="success"&&a.jsx("p",{className:`${d}-success`,style:{...Ze},children:g}),_e==="error"&&a.jsx("p",{className:`${d}-error`,style:{...Ze},role:"alert",children:it??Ue??G})]})}const $f={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"},Cf=["hover","focus","filled","success","error"],Tf=`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';
|
|
@@ -793,7 +793,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
793
793
|
};
|
|
794
794
|
|
|
795
795
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
796
|
-
`,bf=[{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"}],Dr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Sf=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],wf={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},textareaRows:{type:"number",scope:"common",title:"Rows",display:{type:"common-numeric-input"},min:1,max:20},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:{...Dr.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:{...Dr.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:{...Dr.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:{...Dr.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,textareaRows:1,fields:bf,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"]}]},{type:"group",title:"",items:[{type:"row",title:"Textarea",items:["textareaRows"]}]}]},{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:[...Sf],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"]},$f={element:ff,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:wf,sourceCode:xf,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Br(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Cf(e){return`
|
|
796
|
+
`,If=[{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"}],Dr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Lf=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Pf={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},textareaRows:{type:"number",scope:"common",title:"Rows",display:{type:"common-numeric-input"},min:1,max:20},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:{...Dr.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:{...Dr.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:{...Dr.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:{...Dr.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,textareaRows:1,fields:If,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"]}]},{type:"group",title:"",items:[{type:"row",title:"Textarea",items:["textareaRows"]}]}]},{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:[...Lf],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"]},Rf={element:wf,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:Pf,sourceCode:Tf,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Br(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Mf(e){return`
|
|
797
797
|
.${e}-wrapper {
|
|
798
798
|
display: flex;
|
|
799
799
|
flex-direction: column;
|
|
@@ -986,7 +986,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
986
986
|
font-size: ${Br(14)};
|
|
987
987
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
988
988
|
}
|
|
989
|
-
`}const
|
|
989
|
+
`}const Ef=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=A.useScopedStyles(),l=n&&t||!t,{fields:c=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:d,buttonLabel:u,fieldsToShow:p=1,fontFamily:v,inputFontSettings:x,inputFontSize:m,inputLineHeight:h,inputLetterSpacing:b,inputWordSpacing:S,inputTextAppearance:M,buttonFontSettings:y,buttonFontSize:$,buttonLineHeight:R,buttonLetterSpacing:X,buttonWordSpacing:B,buttonTextAppearance:O,statusFontSettings:N,statusFontSize:z,statusLineHeight:C,statusLetterSpacing:I,statusWordSpacing:j,statusTextAppearance:E,iconMaxWidth:w,minHeight:L,corners:V,stroke:_,stateOverrides:K,inputPadding:P,buttonPadding:f,successMessage:U="Thanks for subscribing!",errorMessage:te="Please, fill all required fields."}=e,ce=c.slice(0,Math.min(p,c.length)),[F,ie]=s.useState(()=>Object.fromEntries(ce.map(de=>[de.name,""]))),[T,le]=s.useState("idle"),[J,Se]=s.useState(null),Le=o==="success"?"success":o==="error"?"error":T,me=o==="error"?te:J,ye=o==="filled",ee=s.useMemo(()=>{if(!ye)return F;let de=null;for(const Z of ce)(F[Z.name]??"").trim().length>0||(de=de??{...F},de[Z.name]="Filled");return de??F},[ye,F,ce]),oe=Le==="error"?A.getFormFieldValidationError(ce,ee):null,re=o&&o!=="default"?`${r}-state-${o}`:"",ge=ce.some(de=>(ee[de.name]??"").trim().length>0),we=re!==`${r}-state-filled`&&ge?`${r}-state-filled`:"",Ae=`${re} ${we}`.trim(),fe=i==null?void 0:i.submitUrl,ve=u??"",xe=(d==null?void 0:d.icon)??"",g=(d==null?void 0:d.mode)==="On",G=ve||"Submit",Q={fontSettings:{fontFamily:v,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:m??.01,lineHeight:h,letterSpacing:b??0,wordSpacing:S??0,textAppearance:M,color:e.inputTextColor??"#111111"},ne={fontSettings:{fontFamily:v,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:$??.01,lineHeight:R,letterSpacing:X??0,wordSpacing:B??0,textAppearance:O,color:e.buttonTextColor??"#ffffff"},ue={fontSettings:{fontFamily:v,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:z??.01,lineHeight:C,letterSpacing:I??0,wordSpacing:j??0,textAppearance:E,color:e.successColor??"#22c55e"},q=pn(nn(Q,t)),D=pn(nn(ne,t)),se=pn(nn(ue,t)),Y=A.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(Q==null?void 0:Q.color)??"#111111",buttonTextColor:e.buttonTextColor??(ne==null?void 0:ne.color)??"#ffffff"},kf,Af,K),pe={borderRadius:A.scalingValue(V,t),borderWidth:A.scalingValue(_,t),borderStyle:"solid"},H={borderLeftWidth:A.scalingValue(_,t)},Ie=async de=>{if(de.preventDefault(),!l)return;const Z=Object.fromEntries(ce.map(Oe=>{var Je;return[Oe.name,((Je=F[Oe.name])==null?void 0:Je.trim())??""]}).filter(([,Oe])=>Oe));if(!fe){le("error"),Se("No integrations were found for this form.");return}if(Object.keys(Z).length===0)return;const Ne=A.getFormFieldValidationError(ce,F);if(Ne){le("error"),Se(Ne);return}le("submitting"),Se(null);try{const Oe=await fetch(fe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Z)});if(!Oe.ok){const Je=await Oe.text();throw new Error(Je||`Request failed: ${Oe.status}`)}le("success"),ie(Object.fromEntries(ce.map(Je=>[Je.name,""])))}catch(Oe){le("error"),Se(Oe instanceof Error?Oe.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Ae}`.trim(),style:Y,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Mf(r)}}),a.jsxs("form",{onSubmit:Ie,className:`${r}-form`,style:{...pe,height:A.scalingValue(L,t),minHeight:A.scalingValue(L,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ce.map(de=>a.jsx("input",{type:de.type==="email"?"email":de.type==="phone"?"tel":"text",name:de.name,autoComplete:"off",value:ee[de.name]??"",onChange:Z=>ie(Ne=>({...Ne,[de.name]:Z.target.value})),placeholder:de.placeholder,required:de.isRequired??de.type==="email",className:`${r}-input`,style:{...q,paddingRight:A.scalingValue(P.right,t),paddingLeft:A.scalingValue(P.left,t),paddingTop:A.scalingValue(P.top,t),paddingBottom:A.scalingValue(P.bottom,t)}},de.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":G,style:{...D,...H,paddingRight:A.scalingValue(f.right,t),paddingLeft:A.scalingValue(f.left,t),paddingTop:A.scalingValue(f.top,t),paddingBottom:A.scalingValue(f.bottom,t),pointerEvents:l?"auto":void 0},children:T==="submitting"?"...":g?xe&&a.jsx(gn,{url:xe,className:`${r}-submitBtnIcon`,style:{maxWidth:A.scalingValue(w??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):ve})})]}),Le==="success"&&a.jsx("p",{className:`${r}-success`,style:{...se},children:U}),Le==="error"&&a.jsx("p",{className:`${r}-error`,style:{...se},role:"alert",children:oe??me??te})]})},kf={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"},Af=["hover","focus","filled","success","error"],Ff=`import React, { useMemo, useState } from 'react';
|
|
990
990
|
import { CommonComponentProps } from '../props';
|
|
991
991
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
992
992
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1565,7 +1565,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1565
1565
|
};
|
|
1566
1566
|
|
|
1567
1567
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1568
|
-
`,Rf="01M46GNEM2XB41HP5K8WY5BHD2",Mf=[{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."}],es={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Ef=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],kf={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:{...es.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:{...es.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:{...es.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:Mf,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Rf},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:[...Ef],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"]},Af={element:Tf,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:kf,sourceCode:Pf};function Ff(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1568
|
+
`,Nf="01M46GNEM2XB41HP5K8WY5BHD2",_f=[{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."}],es={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Hf=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Wf={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:{...es.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:{...es.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:{...es.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:_f,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Nf},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:[...Hf],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"]},Of={element:Ef,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:Wf,sourceCode:Ff};function Df(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1569
1569
|
.${e}-marquee-wrapper {
|
|
1570
1570
|
overflow: hidden;
|
|
1571
1571
|
width: 100%;
|
|
@@ -1697,7 +1697,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1697
1697
|
.${e}-image-hover-grayscale:hover video {
|
|
1698
1698
|
filter: grayscale(100%);
|
|
1699
1699
|
}
|
|
1700
|
-
`}const
|
|
1700
|
+
`}const Bf=30,zf=20,ts=3,jf=12,Vf=32,Gf=3,Xf=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")},qf=(e,t)=>Array.from({length:t},()=>e).flat(),Uf=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},Zu=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Sc=(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),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(l>0)return l;const c=Array.from({length:t},(u,p)=>e.children[p]),d=Zu(c);return d<=0?0:d+r*Math.max(0,t-1)},Yf=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Zu(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+r*Math.max(0,e.children.length-1)+l},Kf=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Qf=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Kf(i,e))},Zf=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.assetId??"")},Jf=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,ey=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:c,scaled:d,onFirstSetImageDone:u})=>{var j,E,w,L;const p=s.useRef(null),v=!!((j=e.image)!=null&&j.assetId&&Zf(e.image));s.useLayoutEffect(()=>{c&&Jf(p.current)&&(u==null||u())},[c,(E=e.image)==null?void 0:E.assetId,u]);const x=n.display==="cover",m=n.ratioValue??"1:1",h=n.reversed??!1,[b,S]=m.split(":").map(Number),$=(h?S:b)/(h?b:S),R=i/$,X=R>o?o:R,B=R>o?o*$:i,O=d(B),N=d(X),z={borderRadius:d(r)},C=x?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...z}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:d(i),maxHeight:d(o),objectFit:"contain",...z},I=((w=e.image)==null?void 0:w.assetId)&&(v?a.jsx("video",{ref:V=>{p.current=V},src:e.image.assetId,style:C,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:c?u:void 0,onError:c?u:void 0}):a.jsx("img",{ref:V=>{p.current=V},src:e.image.assetId,alt:((L=e.image)==null?void 0:L.name)??"",style:C,onLoad:c?u:void 0,onError:c?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...x?{width:O}:{width:"max-content",maxWidth:d(i),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...x?{width:O,height:N,overflow:"hidden",...z}:{width:"max-content",maxWidth:d(i),height:d(o)}},children:I&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:Rt(`${t}-marquee-link`,!x&&`${t}-marquee-link-contain`),children:I}):I})})},ty=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=A.useScopedStyles(),[l,c]=s.useState(0),d=l>0?Math.round(l):0,u=s.useMemo(()=>Df(r,d),[r,d]),{speed:p,direction:v,pauseOnHover:x,gap:m,imageMaxWidth:h,imageMaxHeight:b,hoverEffect:S,cornerRadius:M=0}=e,y=s.useMemo(()=>Uf(e.imageFit),[e.imageFit]),$=(t==null?void 0:t.length)??0,R=!!o,X=!n||!!i,B=X&&S!=="off"&&S!=="randomize"?`${r}-image-hover-${S}`:void 0,O=n?!!i:!0,z=((t==null?void 0:t.length)??0)>0&&(O||!!n),C=Math.max(0,p)*Bf,I=we=>A.scalingValue(we,n??!1),j=s.useRef(null),E=s.useRef(null),w=s.useRef(null),[L,V]=s.useState(0),_=O&&x==="on",[K,P]=s.useState(!1),[f,U]=s.useState({}),te=s.useRef(f);te.current=f;const ce=s.useRef(null),F=s.useRef(0),ie=s.useRef(null),T=s.useMemo(()=>(t??[]).map(we=>{var Ae;return((Ae=we.image)==null?void 0:Ae.assetId)??""}).join("\0"),[t]),[le,J]=s.useState(ts),Se=s.useMemo(()=>{const we=t??[];return we.length===0||!(O||!!n)?we:qf(we,le)},[t,O,le,n]),Le=s.useMemo(()=>(t??[]).filter(we=>{var Ae;return!!((Ae=we.image)!=null&&Ae.assetId)}).length,[t]),me=z?Gf:1;s.useLayoutEffect(()=>{F.current=0,U({}),ce.current=null,J(ts),c(0)},[T]),s.useEffect(()=>{if(!X||S!=="randomize")return;const we=j.current;if(!we)return;const Ae=g=>{U(G=>{const Q=Array.from(g).filter(ue=>ue in G&&!Qf(we,ue));if(Q.length===0)return G;const ne={...G};return Q.forEach(ue=>{delete ne[ue]}),ne})},fe=new IntersectionObserver(g=>{const G=new Set;for(const Q of g){const ne=Q.target.dataset.marqueeItemIndex,ue=ne!==void 0?Number(ne):NaN;Number.isNaN(ue)||G.add(ue)}G.size>0&&Ae(G)},{root:we,threshold:0});Object.keys(f).forEach(g=>{const G=Number(g);we.querySelectorAll(`[data-marquee-item-index="${G}"]`).forEach(Q=>fe.observe(Q))});const ve={current:0},xe=()=>{const g=Object.keys(te.current);g.length!==0&&(Ae(g.map(Number)),ve.current=requestAnimationFrame(xe))};return Object.keys(te.current).length>0&&(ve.current=requestAnimationFrame(xe)),()=>{cancelAnimationFrame(ve.current),fe.disconnect()}},[S,f,X]),s.useEffect(()=>{const we=j.current;if(!we||typeof IntersectionObserver>"u")return;const Ae=we.querySelectorAll("video");if(Ae.length===0)return;const fe=new IntersectionObserver(ve=>{for(const xe of ve){const g=xe.target;xe.isIntersecting?g.paused&&g.play().catch(()=>{}):g.paused||g.pause()}},{threshold:0});return Ae.forEach(ve=>fe.observe(ve)),()=>fe.disconnect()},[z,Se,me,f]),s.useLayoutEffect(()=>{if(!z)return;const we=j.current,Ae=w.current;if(!we||!Ae)return;const fe={current:0},ve=()=>{const G=we.getBoundingClientRect().width||we.offsetWidth,Q=Yf(Ae),ne=ce.current,ue=typeof ne=="number"&&Math.abs(ne-Q)<=.25;ce.current=Q;let q=le,D=0;if((O||n)&&$>0&&G>0){const pe=Sc(Ae,$);if(pe>=Vf){D=pe;const H=Math.min(jf,Math.max(ts,Math.ceil(G/pe)+1));q=H,H!==le&&J(H)}}const Y=q!==le&&D>0?D*q:Q>0?Q:D>0?D*q:(()=>{const pe=Sc(Ae,$);return pe>0?pe*q:0})();Y>0?c(pe=>pe<=0?Y:!ue||Math.round(pe)===Math.round(Y)?pe:Y):!ue&&l<=0&&(cancelAnimationFrame(fe.current),fe.current=requestAnimationFrame(ve))},xe=()=>{cancelAnimationFrame(fe.current),fe.current=requestAnimationFrame(ve)};ie.current=xe,xe();const g=new ResizeObserver(xe);return g.observe(we),g.observe(Ae),()=>{ie.current=null,cancelAnimationFrame(fe.current),g.disconnect()}},[O,z,l,T,le,$,n]),s.useLayoutEffect(()=>{if(!z||d<=0)return;const we=E.current;we&&Xf(we)},[z,d,v,C]),s.useLayoutEffect(()=>{if(!z||l<=0){V(0);return}const we=E.current,Ae=w.current;if(!we||!Ae)return;const fe=()=>{const xe=we.offsetHeight||we.getBoundingClientRect().height,g=Array.from(Ae.children).reduce((Q,ne)=>Math.max(Q,ne.offsetHeight||ne.getBoundingClientRect().height),0),G=xe>0?xe:g;V(G>0?G:0)};fe();const ve=new ResizeObserver(fe);return ve.observe(we),ve.observe(Ae),()=>ve.disconnect()},[z,me,Se,n,m,h,b,l,y,f]),s.useLayoutEffect(()=>{if(!n||!R||!z||typeof window>"u")return;const we=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(we)},[n,R,z,v,l,L,m,Se]);const ye=()=>{_&&P(!0)},ee=()=>{_&&P(!1)},oe=s.useCallback(()=>{var we;F.current=Math.min(Le,F.current+1),(we=ie.current)==null||we.call(ie)},[Le]),re=s.useCallback((we,Ae)=>{U(fe=>{const ve=fe[we]??Ae,xe=(t??[]).filter(G=>G!==ve);if(xe.length===0)return fe;const g=xe[Math.floor(Math.random()*xe.length)];return{...fe,[we]:g}})},[t]),ge=(we,Ae,fe,ve)=>{const xe=X&&S==="randomize"&&y.display==="cover"?f[fe]??we:we,g=`max(${I(m)}, ${zf}px)`,G=`calc(-0.5 * (${g} + ${I(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":fe,onMouseEnter:X&&S==="randomize"&&y.display==="cover"?()=>re(fe,we):void 0,children:[a.jsx(ey,{item:xe,prefix:r,imageFit:y,imageMaxWidth:h,imageMaxHeight:b,cornerRadius:M,imageHoverClass:B,isEditor:n,isFirstSet:ve,scaled:I,onFirstSetImageDone:oe}),R&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:G,width:g,height:"100%"}})]},`${Ae}-${fe}`)};if(z){const we=O?_&&K?"paused":"running":"paused",Ae=d>0&&C>0?d/C*1e3:0,fe=`${Math.max(0,Ae)/1e3}s`;return a.jsxs("div",{ref:j,className:Rt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:L>0?{height:L}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:E,className:`${r}-marquee-track`,"data-direction":v,onMouseEnter:ye,onMouseLeave:ee,style:{WebkitAnimationDuration:fe,animationDuration:fe,WebkitAnimationPlayState:we,animationPlayState:we},children:Array.from({length:me},(ve,xe)=>a.jsx("div",{ref:xe===0?w:void 0,className:Rt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:I(m),paddingRight:I(m)},"aria-hidden":xe>0,children:Se.map((g,G)=>ge(g,xe,G,xe===0&&G<$))},`set-${xe}`))})]})}return a.jsxs("div",{ref:j,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:Rt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:I(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((we,Ae)=>ge(we,0,Ae))},"marquee-static")]})},ny=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1701
1701
|
import cn from 'classnames';
|
|
1702
1702
|
import { CommonComponentProps } from '../props';
|
|
1703
1703
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2501,7 +2501,7 @@ type MarqueeProps = {
|
|
|
2501
2501
|
isPreviewMode?: boolean;
|
|
2502
2502
|
isEditMode?: boolean;
|
|
2503
2503
|
} & CommonComponentProps;
|
|
2504
|
-
`,
|
|
2504
|
+
`,iy={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.8,cornerRadius:0},t:{speed:1.64,gap:.02,imageMaxWidth:.5208,imageMaxHeight:.5208,cornerRadius:0},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278,cornerRadius:0}},displayRules:[{if:{name:"imageFit.display",value:"cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit","cornerRadius"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["cornerRadius"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{assetId:"01M3QM74XESYN1HRYH9VRTZ5CK",name:""},link:""},{image:{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:""},link:""},{image:{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:""},link:""},{image:{assetId:"01M3QM74XE20C38X4NND20C5R4",name:""},link:""},{image:{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:""},link:""},{image:{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:""},link:""},{image:{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:""},link:""}]}},oy={element:ty,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:iy,sourceCode:ny,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function ry(e,t,n){const i=t>0?`${t}px`:"0px",o=n?`
|
|
2505
2505
|
.${e}-item-image-wrap {
|
|
2506
2506
|
display: flex;
|
|
2507
2507
|
flex: 0 0 auto;
|
|
@@ -2632,7 +2632,7 @@ ${o}
|
|
|
2632
2632
|
left: -9999px;
|
|
2633
2633
|
top: 0;
|
|
2634
2634
|
}
|
|
2635
|
-
`}const ey=30,ns=3,ty=12,ny=96,wc=3,ua=.72,iy=100,oy=10,ry=e=>e/iy,ay=e=>Math.max(0,e)/oy,sy=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")},ly=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),io={ctx:void 0},cy=()=>io.ctx!==void 0?io.ctx:typeof document>"u"?(io.ctx=null,io.ctx):(io.ctx=document.createElement("canvas").getContext("2d"),io.ctx),dy=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},$c=e=>{e.style.transform=""},uy=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},py=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const r=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?r:n(l,r)};return n(e,e.offsetWidth/2)},Uu=96,qu=(e,t,n)=>{if(t<=0||Math.abs(e)<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,c=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),d=i/n;return Array.from({length:n},(u,p)=>{const y=p*d,v=y+d;o[p+1]=v,r[p+1]=r[p]+(c(y)+c(v))*.5*d}),{wavelength:i,periodArc:r[n],x:o,s:r}},gy=(e,t)=>{const n=qu(e,t,Uu);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},my=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:c}=e,d=(g,m)=>{if(m-g<=1)return[g,m];const x=g+m>>1;return l[x]<=r?d(x,m):d(g,x)},[u,p]=d(0,l.length-1),y=l[p]-l[u],v=y>0?(r-l[u])/y:0;return n*(o*e.wavelength+c[u]+(c[p]-c[u])*v)},hy=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,c=m=>i+t*Math.sin(l*m),d=m=>t*l*Math.cos(l*m),u=-o,y=e+o-u,v=Math.max(4,Math.ceil(r*4*(y/Math.max(e,1)))),g=Array.from({length:v},(m,x)=>{const b=u+x/v*y,M=u+(x+1)/v*y,f=M-b,S=c(b),W=c(M),q=b+f/3,z=S+d(b)*f/3,L=M-f/3,_=W-d(M)*f/3;return`C${q.toFixed(2)} ${z.toFixed(2)} ${L.toFixed(2)} ${_.toFixed(2)} ${M.toFixed(2)} ${W.toFixed(2)}`});return[`M${u.toFixed(2)} ${c(u).toFixed(2)}`,...g].join(" ")},fy=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var g;const c=o!==0?{...n,transform:`translateY(${o}px)`}:n,d=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${ua}em`},u=((g=e.image)==null?void 0:g.assetId)&&a.jsx("img",{src:e.image.assetId,alt:e.image.name??"",className:`${t}-item-image`,style:d}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),y=l?a.jsx("span",{className:`${t}-text`,style:c,children:Array.from(e.text).map((m,x)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:m===" "?" ":m})},x))}):a.jsx("span",{className:`${t}-text`,style:c,children:e.text}),v=a.jsxs(a.Fragment,{children:[p,y]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:v}):v})},yy=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=F.useScopedStyles(),[r,l]=s.useState(0),c=r>0?Math.round(r):0,{speed:d,direction:u,pauseOnHover:p,gap:y,layoutType:v,curveAmplitude:g,curveFrequency:m,textFontFamily:x,textFontSettings:b,textFontSize:M,textLetterSpacing:f,textWordSpacing:S,textTextAppearance:W,textColor:q,backgroundColor:z,ribbonWidth:L}=e,_=L??M,G=v==="curve",$=ry(g),I=ay(m),D=s.useMemo(()=>Jf(o,c,G),[o,c,G]),E=s.useMemo(()=>en({fontSettings:{fontFamily:x,fontWeight:b.fontWeight,fontStyle:b.fontStyle},letterSpacing:f,wordSpacing:S,fontSize:M,lineHeight:M,textAppearance:W,color:q},n),[x,b,f,S,M,W,q,n]),T=Oe=>F.scalingValue(Oe,n??!1),C=((t==null?void 0:t.length)??0)>0,V=n?!!i:!0,w=C&&(V||!!n),U=Math.max(0,d)*ey,P=V&&p==="on",[A,j]=s.useState(!1),ie=V?P&&A?"paused":"running":"paused",ae=ie==="running"&&U>0&&c>0,O=c>0&&U>0?c/U*1e3:0,re=s.useRef(null),N=s.useRef(null),le=s.useRef(null),J=s.useRef(null),be=s.useRef(null),Le=s.useRef(null),ye=s.useRef(ae),ce=s.useRef(null),K=s.useRef(null),se=s.useRef($),pe=s.useRef(I);ye.current=ae,se.current=$,pe.current=I;const[fe,we]=s.useState(0),[Re,me]=s.useState(0),[xe,Ce]=s.useState(0),[h,Y]=s.useState(0),[Q,ne]=s.useState(0),ue=s.useMemo(()=>(t??[]).map(Oe=>{var Ae;return`${Oe.text}\0${((Ae=Oe.image)==null?void 0:Ae.assetId)??""}\0${Oe.link??""}`}).join("\0"),[t]),[B,R]=s.useState(ns),ee=s.useMemo(()=>{const Oe=t??[];return Oe.length===0||!(V||n)?Oe:ly(Oe,B)},[t,V,B,n]),te=w?wc:1;s.useLayoutEffect(()=>{R(ns),l(0)},[ue]),s.useLayoutEffect(()=>{var De;const Oe=Le.current;if(!Oe)return;const Ae=()=>{const Ue=getComputedStyle(Oe),ct=parseFloat(Ue.fontSize)||0;if(ct<=0)return;const he=cy();if(!he){we(ct*ua),me(0);return}he.font=`${Ue.fontStyle} ${Ue.fontWeight} ${ct}px ${Ue.fontFamily}`;const Me=he.measureText("H"),nt=Me.actualBoundingBoxAscent>0?Me.actualBoundingBoxAscent:ct*ua,pt=Math.max(0,Me.actualBoundingBoxDescent||0),Ve=Me.fontBoundingBoxAscent||0,vt=Me.fontBoundingBoxDescent||0;we(At=>Math.abs(At-nt)>.5?nt:At);const Pt=Ve>0||vt>0?(vt-pt-(Ve-nt))/2:0;me(At=>Math.abs(At-Pt)>.25?Pt:At)};Ae();const mt=typeof document<"u"?document.fonts:void 0;(De=mt==null?void 0:mt.ready)==null||De.then(Ae).catch(()=>{});const Be=new ResizeObserver(Ae);return Be.observe(Oe),()=>Be.disconnect()},[E.fontFamily,E.fontWeight,E.fontStyle,E.fontSize,E.lineHeight]),s.useLayoutEffect(()=>{if(!w)return;const Oe=re.current,Ae=J.current;if(!Oe||!Ae)return;const mt={id:0},Be=()=>{const he=Oe.offsetWidth||Oe.getBoundingClientRect().width,Me=Ae.offsetWidth||Ae.getBoundingClientRect().width;if(C&&he>0&&Me>0){const nt=Me/B;if(nt>0){let pt=he,Ve=ty;if(G){const Pt=he*se.current,At=pe.current,wt=At>0?2*Math.PI*At/he:0,Vt=gy(Pt,wt);pt=Math.max(he,Vt*he/(wc-1)),Ve=ny}const vt=Math.min(Ve,Math.max(ns,Math.ceil(pt/nt)+1));if(vt!==B){R(vt);return}}}Me>0&&l(Me)},De=()=>{cancelAnimationFrame(mt.id),mt.id=requestAnimationFrame(Be)};De();const Ue=new ResizeObserver(De);Ue.observe(Oe),Ue.observe(Ae);const ct=()=>{document.hidden||De()};return document.addEventListener("visibilitychange",ct),window.addEventListener("pageshow",ct),window.addEventListener("focus",ct),()=>{cancelAnimationFrame(mt.id),Ue.disconnect(),document.removeEventListener("visibilitychange",ct),window.removeEventListener("pageshow",ct),window.removeEventListener("focus",ct)}},[w,ue,B,C,fe,G,$,I]),s.useLayoutEffect(()=>{const Oe=be.current;if(!Oe)return;const Ae={id:0},mt=()=>{const De=Oe.offsetHeight;De>0&&ne(Ue=>Math.abs(Ue-De)>.5?De:Ue)};Ae.id=requestAnimationFrame(mt);const Be=new ResizeObserver(()=>{cancelAnimationFrame(Ae.id),Ae.id=requestAnimationFrame(mt)});return Be.observe(Oe),()=>{cancelAnimationFrame(Ae.id),Be.disconnect()}},[_,n]),s.useLayoutEffect(()=>{if(!G){Ce(0),Y(0);return}const Oe=re.current,Ae=J.current;if(!Oe||!Ae)return;const mt={id:0},Be=()=>{const Ue=Oe.offsetWidth,ct=Ae.offsetHeight;Ue>0&&Y(he=>Math.abs(he-Ue)>.5?Ue:he),ct>0&&Ce(he=>Math.abs(he-ct)>.5?ct:he)};mt.id=requestAnimationFrame(Be);const De=new ResizeObserver(()=>{cancelAnimationFrame(mt.id),mt.id=requestAnimationFrame(Be)});return De.observe(Oe),De.observe(Ae),()=>{cancelAnimationFrame(mt.id),De.disconnect()}},[G,ue,fe,M,w]),s.useLayoutEffect(()=>{if(!w||c<=0)return;const Oe=le.current;Oe&&sy(Oe)},[w,c,u,U]),s.useLayoutEffect(()=>{if(!G||!C)return;const Oe=re.current;if(!Oe)return;const Ae={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},mt=()=>{for(const nt of Ae.itemsCache)for(const pt of nt.glyphs)$c(pt.inner)},Be=()=>{const nt=N.current??Oe;Ae.itemsCache=Array.from(Oe.querySelectorAll("[data-marquee-text-item]"),pt=>{const Ve=[];return pt.querySelectorAll("[data-marquee-wave-node]").forEach(vt=>{const Pt=vt.firstElementChild;Pt&&Ve.push({inner:Pt,layoutLocalX:py(vt,nt)})}),{item:pt,glyphs:Ve}}),Ae.cacheDirty=!1},De=()=>{Ae.cacheDirty&&Be();const pt=(N.current??Oe).offsetWidth||1,Ve=pt*se.current,vt=pe.current,Pt=2*Math.PI*vt/pt,At=`${pt}|${Ve}|${Pt}`;if(At!==Ae.lutKey&&(Ae.lutKey=At,Ae.lut=qu(Ve,Pt,Uu)),Math.abs(Ve)<=0||Pt<=0){mt();return}const wt=le.current,Vt=wt?uy(getComputedStyle(wt).transform):0,jt=Oe.getBoundingClientRect(),Yt=jt.left,Kt=jt.right,Rt=Ae.lut&&Ae.lut.wavelength>0?Math.max(0,(Ae.lut.periodArc/Ae.lut.wavelength-1)*pt):0;for(const{item:zt,glyphs:on}of Ae.itemsCache){const xt=zt.getBoundingClientRect();if(xt.right<Yt||xt.left>Kt+Rt){for(const yt of on)$c(yt.inner);continue}for(const yt of on){const ke=yt.layoutLocalX+Vt,Je=Ae.lut?my(Ae.lut,ke):ke,rt=Pt*Je,dt=Ve*Math.sin(rt),Lt=Ve*Pt*Math.cos(rt),St=Math.atan(Lt)*(180/Math.PI);dy(yt.inner,Je-ke,dt,St)}}},Ue=()=>{Ae.cancelled||(Ae.raf=0,De(),ye.current&&!document.hidden&&(Ae.raf=requestAnimationFrame(Ue)))},ct=()=>{Ae.cancelled||Ae.raf||(Ae.raf=requestAnimationFrame(Ue))},he=()=>{Ae.cacheDirty=!0,De(),ct()};ce.current=ct,K.current=he,De(),ct();const Me=()=>{if(document.hidden){cancelAnimationFrame(Ae.raf),Ae.raf=0;return}cancelAnimationFrame(Ae.raf),Ae.raf=0,he()};return document.addEventListener("visibilitychange",Me),window.addEventListener("pageshow",Me),window.addEventListener("focus",Me),()=>{Ae.cancelled=!0,ce.current=null,K.current=null,cancelAnimationFrame(Ae.raf),document.removeEventListener("visibilitychange",Me),window.removeEventListener("pageshow",Me),window.removeEventListener("focus",Me),mt()}},[G,C]),s.useLayoutEffect(()=>{var Oe;!G||!C||(Oe=K.current)==null||Oe.call(K)},[G,C,r,ue,B,fe,$,I,h]),s.useLayoutEffect(()=>{var Oe;(Oe=ce.current)==null||Oe.call(ce)},[ae,u]);const ge=Oe=>{P&&Oe.pointerType==="mouse"&&j(!0)},X=()=>{P&&j(!1)},Pe=G?Math.abs($)*100:0,Se=T(_),Z={minHeight:Se,...G?{paddingTop:`${Pe}%`,paddingBottom:`${Pe}%`}:{}},He={height:Se,...G?{visibility:"hidden"}:{backgroundColor:z}},We={gap:T(y),minHeight:Se},ot=h*$,qe=Math.abs(ot),tt=Q>0?Q:xe,et=Math.max(xe,tt),Ge=qe+et/2,ve=Math.max(tt,1),_e=G&&h>0&&et>0?hy(h,ot,I,Ge,ve):"",ze=qe*2+et,Qe=_e?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${h} ${ze}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:_e,fill:"none",stroke:z,strokeWidth:tt,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,$e=a.jsx("div",{ref:be,className:`${o}-ribbon`,style:He,"aria-hidden":!0}),Ne={...E,lineHeight:fe>0?`${fe}px`:`${ua}em`},Ye=(Oe,Ae,mt)=>a.jsx(fy,{item:Oe,prefix:o,textCss:Ne,capHeightPx:fe,opticalOffsetY:Re,imageGapPx:T(y),isCurve:G},`${Ae}-${mt}`),Ze=a.jsx("span",{ref:Le,"aria-hidden":!0,className:`${o}-cap-ref`,style:E,children:"H"}),st=`${Math.max(0,O)/1e3}s`,it=w?a.jsx("div",{ref:le,className:`${o}-marquee-track`,"data-direction":u,onPointerEnter:ge,onPointerLeave:X,style:{WebkitAnimationDuration:st,animationDuration:st,WebkitAnimationPlayState:ie,animationPlayState:ie},children:Array.from({length:te},(Oe,Ae)=>a.jsx("div",{ref:Ae===0?J:void 0,className:`${o}-marquee-set`,style:{...We,paddingRight:T(y)},"aria-hidden":Ae>0,children:ee.map((mt,Be)=>Ye(mt,Ae,Be))},`set-${Ae}`))}):a.jsx("div",{ref:J,className:Ct(`${o}-marquee-set`,`${o}-marquee-static`),style:We,children:t==null?void 0:t.map((Oe,Ae)=>Ye(Oe,0,Ae))});return a.jsxs("div",{ref:re,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:D}}),Ze,a.jsxs("div",{ref:N,className:`${o}-marquee-wrapper`,style:Z,children:[$e,Qe,it]})]})},vy=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type PointerEvent as ReactPointerEvent } from 'react';
|
|
2635
|
+
`}const ay=30,ns=3,sy=12,ly=96,wc=3,ua=.72,cy=100,dy=10,uy=e=>e/cy,py=e=>Math.max(0,e)/dy,my=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")},gy=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ro={ctx:void 0},hy=()=>ro.ctx!==void 0?ro.ctx:typeof document>"u"?(ro.ctx=null,ro.ctx):(ro.ctx=document.createElement("canvas").getContext("2d"),ro.ctx),fy=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},$c=e=>{e.style.transform=""},yy=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},vy=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const r=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?r:n(l,r)};return n(e,e.offsetWidth/2)},Ju=96,ep=(e,t,n)=>{if(t<=0||Math.abs(e)<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,c=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),d=i/n;return Array.from({length:n},(u,p)=>{const v=p*d,x=v+d;o[p+1]=x,r[p+1]=r[p]+(c(v)+c(x))*.5*d}),{wavelength:i,periodArc:r[n],x:o,s:r}},xy=(e,t)=>{const n=ep(e,t,Ju);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},by=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:c}=e,d=(m,h)=>{if(h-m<=1)return[m,h];const b=m+h>>1;return l[b]<=r?d(b,h):d(m,b)},[u,p]=d(0,l.length-1),v=l[p]-l[u],x=v>0?(r-l[u])/v:0;return n*(o*e.wavelength+c[u]+(c[p]-c[u])*x)},Sy=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,c=h=>i+t*Math.sin(l*h),d=h=>t*l*Math.cos(l*h),u=-o,v=e+o-u,x=Math.max(4,Math.ceil(r*4*(v/Math.max(e,1)))),m=Array.from({length:x},(h,b)=>{const S=u+b/x*v,M=u+(b+1)/x*v,y=M-S,$=c(S),R=c(M),X=S+y/3,B=$+d(S)*y/3,O=M-y/3,N=R-d(M)*y/3;return`C${X.toFixed(2)} ${B.toFixed(2)} ${O.toFixed(2)} ${N.toFixed(2)} ${M.toFixed(2)} ${R.toFixed(2)}`});return[`M${u.toFixed(2)} ${c(u).toFixed(2)}`,...m].join(" ")},wy=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const c=o!==0?{...n,transform:`translateY(${o}px)`}:n,d=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${ua}em`},u=((m=e.image)==null?void 0:m.assetId)&&a.jsx("img",{src:e.image.assetId,alt:e.image.name??"",className:`${t}-item-image`,style:d}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),v=l?a.jsx("span",{className:`${t}-text`,style:c,children:Array.from(e.text).map((h,b)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},b))}):a.jsx("span",{className:`${t}-text`,style:c,children:e.text}),x=a.jsxs(a.Fragment,{children:[p,v]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:x}):x})},$y=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=A.useScopedStyles(),[r,l]=s.useState(0),c=r>0?Math.round(r):0,{speed:d,direction:u,pauseOnHover:p,gap:v,layoutType:x,curveAmplitude:m,curveFrequency:h,textFontFamily:b,textFontSettings:S,textFontSize:M,textLetterSpacing:y,textWordSpacing:$,textTextAppearance:R,textColor:X,backgroundColor:B,ribbonWidth:O}=e,N=O??M,z=x==="curve",C=uy(m),I=py(h),j=s.useMemo(()=>ry(o,c,z),[o,c,z]),E=s.useMemo(()=>nn({fontSettings:{fontFamily:b,fontWeight:S.fontWeight,fontStyle:S.fontStyle},letterSpacing:y,wordSpacing:$,fontSize:M,lineHeight:M,textAppearance:R,color:X},n),[b,S,y,$,M,R,X,n]),w=qe=>A.scalingValue(qe,n??!1),L=((t==null?void 0:t.length)??0)>0,V=n?!!i:!0,_=L&&(V||!!n),K=Math.max(0,d)*ay,P=V&&p==="on",[f,U]=s.useState(!1),te=V?P&&f?"paused":"running":"paused",ce=te==="running"&&K>0&&c>0,F=c>0&&K>0?c/K*1e3:0,ie=s.useRef(null),T=s.useRef(null),le=s.useRef(null),J=s.useRef(null),Se=s.useRef(null),Le=s.useRef(null),me=s.useRef(ce),ye=s.useRef(null),ee=s.useRef(null),oe=s.useRef(C),re=s.useRef(I);me.current=ce,oe.current=C,re.current=I;const[ge,we]=s.useState(0),[Ae,fe]=s.useState(0),[ve,xe]=s.useState(0),[g,G]=s.useState(0),[Q,ne]=s.useState(0),ue=s.useMemo(()=>(t??[]).map(qe=>{var Ee;return`${qe.text}\0${((Ee=qe.image)==null?void 0:Ee.assetId)??""}\0${qe.link??""}`}).join("\0"),[t]),[q,D]=s.useState(ns),se=s.useMemo(()=>{const qe=t??[];return qe.length===0||!(V||n)?qe:gy(qe,q)},[t,V,q,n]),Y=_?wc:1;s.useLayoutEffect(()=>{D(ns),l(0)},[ue]),s.useLayoutEffect(()=>{var We;const qe=Le.current;if(!qe)return;const Ee=()=>{const Ve=getComputedStyle(qe),ct=parseFloat(Ve.fontSize)||0;if(ct<=0)return;const ot=hy();if(!ot){we(ct*ua),fe(0);return}ot.font=`${Ve.fontStyle} ${Ve.fontWeight} ${ct}px ${Ve.fontFamily}`;const xt=ot.measureText("H"),Pt=xt.actualBoundingBoxAscent>0?xt.actualBoundingBoxAscent:ct*ua,Vt=Math.max(0,xt.actualBoundingBoxDescent||0),vt=xt.fontBoundingBoxAscent||0,Mt=xt.fontBoundingBoxDescent||0;we(Gt=>Math.abs(Gt-Pt)>.5?Pt:Gt);const Ht=vt>0||Mt>0?(Mt-Vt-(vt-Pt))/2:0;fe(Gt=>Math.abs(Gt-Ht)>.25?Ht:Gt)};Ee();const pt=typeof document<"u"?document.fonts:void 0;(We=pt==null?void 0:pt.ready)==null||We.then(Ee).catch(()=>{});const ke=new ResizeObserver(Ee);return ke.observe(qe),()=>ke.disconnect()},[E.fontFamily,E.fontWeight,E.fontStyle,E.fontSize,E.lineHeight]),s.useLayoutEffect(()=>{if(!_)return;const qe=ie.current,Ee=J.current;if(!qe||!Ee)return;const pt={id:0},ke=()=>{const ot=qe.offsetWidth||qe.getBoundingClientRect().width,xt=Ee.offsetWidth||Ee.getBoundingClientRect().width;if(L&&ot>0&&xt>0){const Pt=xt/q;if(Pt>0){let Vt=ot,vt=sy;if(z){const Ht=ot*oe.current,Gt=re.current,kt=Gt>0?2*Math.PI*Gt/ot:0,Pe=xy(Ht,kt);Vt=Math.max(ot,Pe*ot/(wc-1)),vt=ly}const Mt=Math.min(vt,Math.max(ns,Math.ceil(Vt/Pt)+1));if(Mt!==q){D(Mt);return}}}xt>0&&l(xt)},We=()=>{cancelAnimationFrame(pt.id),pt.id=requestAnimationFrame(ke)};We();const Ve=new ResizeObserver(We);Ve.observe(qe),Ve.observe(Ee);const ct=()=>{document.hidden||We()};return document.addEventListener("visibilitychange",ct),window.addEventListener("pageshow",ct),window.addEventListener("focus",ct),()=>{cancelAnimationFrame(pt.id),Ve.disconnect(),document.removeEventListener("visibilitychange",ct),window.removeEventListener("pageshow",ct),window.removeEventListener("focus",ct)}},[_,ue,q,L,ge,z,C,I]),s.useLayoutEffect(()=>{const qe=Se.current;if(!qe)return;const Ee={id:0},pt=()=>{const We=qe.offsetHeight;We>0&&ne(Ve=>Math.abs(Ve-We)>.5?We:Ve)};Ee.id=requestAnimationFrame(pt);const ke=new ResizeObserver(()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(pt)});return ke.observe(qe),()=>{cancelAnimationFrame(Ee.id),ke.disconnect()}},[N,n]),s.useLayoutEffect(()=>{if(!z){xe(0),G(0);return}const qe=ie.current,Ee=J.current;if(!qe||!Ee)return;const pt={id:0},ke=()=>{const Ve=qe.offsetWidth,ct=Ee.offsetHeight;Ve>0&&G(ot=>Math.abs(ot-Ve)>.5?Ve:ot),ct>0&&xe(ot=>Math.abs(ot-ct)>.5?ct:ot)};pt.id=requestAnimationFrame(ke);const We=new ResizeObserver(()=>{cancelAnimationFrame(pt.id),pt.id=requestAnimationFrame(ke)});return We.observe(qe),We.observe(Ee),()=>{cancelAnimationFrame(pt.id),We.disconnect()}},[z,ue,ge,M,_]),s.useLayoutEffect(()=>{if(!_||c<=0)return;const qe=le.current;qe&&my(qe)},[_,c,u,K]),s.useLayoutEffect(()=>{if(!z||!L)return;const qe=ie.current;if(!qe)return;const Ee={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},pt=()=>{for(const Pt of Ee.itemsCache)for(const Vt of Pt.glyphs)$c(Vt.inner)},ke=()=>{const Pt=T.current??qe;Ee.itemsCache=Array.from(qe.querySelectorAll("[data-marquee-text-item]"),Vt=>{const vt=[];return Vt.querySelectorAll("[data-marquee-wave-node]").forEach(Mt=>{const Ht=Mt.firstElementChild;Ht&&vt.push({inner:Ht,layoutLocalX:vy(Mt,Pt)})}),{item:Vt,glyphs:vt}}),Ee.cacheDirty=!1},We=()=>{Ee.cacheDirty&&ke();const Vt=(T.current??qe).offsetWidth||1,vt=Vt*oe.current,Mt=re.current,Ht=2*Math.PI*Mt/Vt,Gt=`${Vt}|${vt}|${Ht}`;if(Gt!==Ee.lutKey&&(Ee.lutKey=Gt,Ee.lut=ep(vt,Ht,Ju)),Math.abs(vt)<=0||Ht<=0){pt();return}const kt=le.current,Pe=kt?yy(getComputedStyle(kt).transform):0,Be=qe.getBoundingClientRect(),ft=Be.left,$t=Be.right,et=Ee.lut&&Ee.lut.wavelength>0?Math.max(0,(Ee.lut.periodArc/Ee.lut.wavelength-1)*Vt):0;for(const{item:Et,glyphs:Xt}of Ee.itemsCache){const mt=Et.getBoundingClientRect();if(mt.right<ft||mt.left>$t+et){for(const gt of Xt)$c(gt.inner);continue}for(const gt of Xt){const Re=gt.layoutLocalX+Pe,tt=Ee.lut?by(Ee.lut,Re):Re,nt=Ht*tt,st=vt*Math.sin(nt),At=vt*Ht*Math.cos(nt),St=Math.atan(At)*(180/Math.PI);fy(gt.inner,tt-Re,st,St)}}},Ve=()=>{Ee.cancelled||(Ee.raf=0,We(),me.current&&!document.hidden&&(Ee.raf=requestAnimationFrame(Ve)))},ct=()=>{Ee.cancelled||Ee.raf||(Ee.raf=requestAnimationFrame(Ve))},ot=()=>{Ee.cacheDirty=!0,We(),ct()};ye.current=ct,ee.current=ot,We(),ct();const xt=()=>{if(document.hidden){cancelAnimationFrame(Ee.raf),Ee.raf=0;return}cancelAnimationFrame(Ee.raf),Ee.raf=0,ot()};return document.addEventListener("visibilitychange",xt),window.addEventListener("pageshow",xt),window.addEventListener("focus",xt),()=>{Ee.cancelled=!0,ye.current=null,ee.current=null,cancelAnimationFrame(Ee.raf),document.removeEventListener("visibilitychange",xt),window.removeEventListener("pageshow",xt),window.removeEventListener("focus",xt),pt()}},[z,L]),s.useLayoutEffect(()=>{var qe;!z||!L||(qe=ee.current)==null||qe.call(ee)},[z,L,r,ue,q,ge,C,I,g]),s.useLayoutEffect(()=>{var qe;(qe=ye.current)==null||qe.call(ye)},[ce,u]);const pe=qe=>{P&&qe.pointerType==="mouse"&&U(!0)},H=()=>{P&&U(!1)},Ie=z?Math.abs(C)*100:0,de=w(N),Z={minHeight:de,...z?{paddingTop:`${Ie}%`,paddingBottom:`${Ie}%`}:{}},Ne={height:de,...z?{visibility:"hidden"}:{backgroundColor:B}},Oe={gap:w(v),minHeight:de},Je=g*C,De=Math.abs(Je),Ze=Q>0?Q:ve,at=Math.max(ve,Ze),Xe=De+at/2,be=Math.max(Ze,1),He=z&&g>0&&at>0?Sy(g,Je,I,Xe,be):"",je=De*2+at,Qe=He?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${g} ${je}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:He,fill:"none",stroke:B,strokeWidth:Ze,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,Ce=a.jsx("div",{ref:Se,className:`${o}-ribbon`,style:Ne,"aria-hidden":!0}),_e={...E,lineHeight:ge>0?`${ge}px`:`${ua}em`},Ue=(qe,Ee,pt)=>a.jsx(wy,{item:qe,prefix:o,textCss:_e,capHeightPx:ge,opticalOffsetY:Ae,imageGapPx:w(v),isCurve:z},`${Ee}-${pt}`),Ye=a.jsx("span",{ref:Le,"aria-hidden":!0,className:`${o}-cap-ref`,style:E,children:"H"}),lt=`${Math.max(0,F)/1e3}s`,it=_?a.jsx("div",{ref:le,className:`${o}-marquee-track`,"data-direction":u,onPointerEnter:pe,onPointerLeave:H,style:{WebkitAnimationDuration:lt,animationDuration:lt,WebkitAnimationPlayState:te,animationPlayState:te},children:Array.from({length:Y},(qe,Ee)=>a.jsx("div",{ref:Ee===0?J:void 0,className:`${o}-marquee-set`,style:{...Oe,paddingRight:w(v)},"aria-hidden":Ee>0,children:se.map((pt,ke)=>Ue(pt,Ee,ke))},`set-${Ee}`))}):a.jsx("div",{ref:J,className:Rt(`${o}-marquee-set`,`${o}-marquee-static`),style:Oe,children:t==null?void 0:t.map((qe,Ee)=>Ue(qe,0,Ee))});return a.jsxs("div",{ref:ie,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:j}}),Ye,a.jsxs("div",{ref:T,className:`${o}-marquee-wrapper`,style:Z,children:[Ce,Qe,it]})]})},Cy=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type PointerEvent as ReactPointerEvent } from 'react';
|
|
2636
2636
|
import cn from 'classnames';
|
|
2637
2637
|
import { CommonComponentProps } from '../props';
|
|
2638
2638
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -3567,7 +3567,7 @@ type MarqueeTextProps = {
|
|
|
3567
3567
|
isPreviewMode?: boolean;
|
|
3568
3568
|
isEditMode?: boolean;
|
|
3569
3569
|
} & CommonComponentProps;
|
|
3570
|
-
`,
|
|
3570
|
+
`,Ty={fontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Iy={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"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},ribbonWidth:{type:"number",scope:"layout",title:"Ribbon Width",min:0,display:{type:"numeric-input"}},layoutType:{type:"string",scope:"common",title:"Path Type",display:{type:"toggle-cycle",enum:["straight","curve"]}},curveAmplitude:{type:"number",scope:"layout",title:"Amplitude",min:-30,max:30,step:1,display:{type:"common-numeric-input",visible:!1}},curveFrequency:{type:"number",scope:"layout",title:"Frequency",min:0,max:100,step:1,display:{type:"common-numeric-input",visible:!1}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Ty.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Color"},backgroundColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Ribbon Color"}},defaults:{direction:"left",pauseOnHover:"off",layoutType:"curve",textFontFamily:"Antique Série",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#FFFFFF",backgroundColor:"#2E12F0"},layoutDefaults:{m:{speed:.55,gap:.04,ribbonWidth:.08,curveAmplitude:6,curveFrequency:15,textFontSize:.08},t:{speed:1.3,gap:.02,ribbonWidth:.11,curveAmplitude:5,curveFrequency:15,textFontSize:.07},d:{speed:2.5,gap:.02,ribbonWidth:.11,curveAmplitude:5,curveFrequency:18,textFontSize:.071}},displayRules:[{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveAmplitude.display.visible",value:!0}},{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveFrequency.display.visible",value:!0}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","ribbonWidth","layoutType","curveAmplitude","curveFrequency"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction","speed"]},{type:"row",items:["ribbonWidth","gap"]},{type:"row",items:["pauseOnHover","layoutType"]},{type:"row",items:["curveAmplitude","curveFrequency"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}],paletteBookmark:{items:["textColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{text:{placeholder:"Add text...",label:"Text",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-input"}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}}},default:[{text:"NEW WORK",image:{assetId:"01M3QM74XF10Z2N5P1Y0J0XDQQ",name:""},link:""}]}},Ly={element:$y,id:"marquee-text",name:"Marquee Text",category:"typography",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Text_Marquee.mp4"},schema:Iy,sourceCode:Cy,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}};function Py(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
3571
3571
|
.${e}-marquee-wrapper {
|
|
3572
3572
|
overflow: hidden;
|
|
3573
3573
|
width: 100%;
|
|
@@ -3656,7 +3656,7 @@ type MarqueeTextProps = {
|
|
|
3656
3656
|
pointer-events: auto;
|
|
3657
3657
|
z-index: 10;
|
|
3658
3658
|
}
|
|
3659
|
-
`}const
|
|
3659
|
+
`}const Ry=30,Cc=2,My=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")},Ey=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=A.useScopedStyles(),{align:l,speed:c,direction:d,pauseOnHover:u,gap:p,cardWidth:v,corners:x,stroke:m,strokeColor:h,bgColor:b,padding:S,logoMarginTop:M,logoWidth:y,logoHeight:$,captionMarginTop:R}=e,X=!!o,B=((t==null?void 0:t.length)??0)>0,O=c>0&&(!n||i),N=B&&(O||n),z=Math.max(0,c)*Ry,C=D=>A.scalingValue(D,n??!1),I=s.useRef(null),j=s.useRef(null),E=s.useRef(null),[w,L]=s.useState(0),[V,_]=s.useState(0),K=V>0?V:0,P=s.useMemo(()=>Py(r,K),[r,K]),[f,U]=s.useState(0),te=O&&u==="on",[ce,F]=s.useState(!1),ie=s.useRef(null),[T,le]=s.useState(0),[J,Se]=s.useState(0),Le=s.useRef(null),me=D=>{var Y,pe,H,Ie,de;return{fontSettings:{fontFamily:(e==null?void 0:e[`${D}FontFamily`])??"Arial",fontWeight:((Y=e==null?void 0:e[`${D}FontSettings`])==null?void 0:Y.fontWeight)??400,fontStyle:((pe=e==null?void 0:e[`${D}FontSettings`])==null?void 0:pe.fontStyle)??"normal"},textAppearance:{textTransform:((H=e==null?void 0:e[`${D}TextAppearance`])==null?void 0:H.textTransform)??"none",textDecoration:((Ie=e==null?void 0:e[`${D}TextAppearance`])==null?void 0:Ie.textDecoration)??"none",fontVariant:((de=e==null?void 0:e[`${D}TextAppearance`])==null?void 0:de.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${D}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${D}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${D}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${D}LineHeight`])??.01,color:(e==null?void 0:e[`${D}Color`])??"#000000"}},ye=me("text"),ee=me("caption"),oe=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(D=>{var se,Y;return(((se=D.text)==null?void 0:se.length)??0)>0||(((Y=D.caption)==null?void 0:Y.length)??0)>0}),[t]),re=s.useMemo(()=>!N||(t==null?void 0:t.length)===0?1:V<=0||w<=0?Cc:Math.max(Cc,Math.ceil(w/V)+1),[N,t==null?void 0:t.length,V,w]);s.useLayoutEffect(()=>{if(!N)return;const D=I.current,se=E.current;if(!D||!se)return;let Y=0;const pe=()=>{const de=D.getBoundingClientRect().width,Z=se.getBoundingClientRect().width,Ne=Le.current,Oe=typeof Ne=="number"&&Math.abs(Ne-Z)<=.25;if(Le.current=Z,L(de),typeof Z=="number"&&Z>0&&V<=0){_(Z);return}Oe&&Z!==V?_(Z):!Oe&&V<=0&&(cancelAnimationFrame(Y),Y=requestAnimationFrame(pe))},H=()=>{cancelAnimationFrame(Y),Y=requestAnimationFrame(pe)};H();const Ie=new ResizeObserver(H);return Ie.observe(D),Ie.observe(se),()=>{cancelAnimationFrame(Y),Ie.disconnect()}},[O,N,V]);const ge=K>0&&z>0?K/z*1e3:0,we=`${Math.max(0,ge)/1e3}s`;s.useLayoutEffect(()=>{if(!N||K<=0)return;const D=j.current;D&&My(D)},[N,K,d]),s.useLayoutEffect(()=>{if(!N){U(0);return}const D=E.current,se=j.current;if(!D||!se)return;const Y=()=>{let H=0;for(let Ie=0;Ie<D.children.length;Ie++){const Z=D.children[Ie].firstElementChild;Z&&(H=Math.max(H,Z.offsetHeight))}H<=0&&(H=se.offsetHeight),U(H>0?H:0)};Y();const pe=new ResizeObserver(Y);return pe.observe(D),pe.observe(se),()=>{pe.disconnect()}},[N,re,t,n,p,v,S,m,x,y,$,T,J]);const Ae=()=>{te&&F(!0)},fe=()=>{te&&F(!1)},ve=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),xe=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),g=s.useCallback((D,se,Y,pe)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ve,width:"100%"},children:[a.jsx("div",{"data-controls":X?pe==null?void 0:pe.controlsName:void 0,"data-controls-axis":X?"y":void 0,className:X?`${r}-control`:void 0,style:{height:C((pe==null?void 0:pe.marginTop)??0)}}),a.jsx("div",{...pe!=null&&pe.dataMeasureKind?{"data-testimonial-measure":pe.dataMeasureKind}:{},style:{...nn(D,n),textAlign:xe,pointerEvents:"auto",...typeof(pe==null?void 0:pe.minHeightPx)=="number"&&pe.minHeightPx>0?{minHeight:pe.minHeightPx}:{}},children:a.jsx(Zi,{content:se})})]},Y),[ve,xe,n,X,r,C]),G=s.useCallback((D,se,Y)=>{var pe,H,Ie;return a.jsxs("div",{style:{padding:`${C(S.top)} ${C(S.right)} ${C(S.bottom)} ${C(S.left)}`,width:C(v+m*2),height:"100%",borderRadius:C(x),border:`${C(m)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:b}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:ve,textAlign:xe},children:[D.text&&g(ye,D.text,"text",Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(Y==null?void 0:Y.textMinHeightPx)=="number"&&Y.textMinHeightPx>0?{minHeightPx:Y.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ve,width:"100%"},children:[a.jsx("div",{"data-controls":X&&!(Y!=null&&Y.dataMeasureAttrs)?"logoMarginTop":void 0,className:X&&!(Y!=null&&Y.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:C(M)}}),a.jsx("div",{style:{width:C(y),height:C($)},children:((pe=D.logo)==null?void 0:pe.assetId)&&a.jsx("img",{src:D.logo.assetId,alt:((H=D.logo)==null?void 0:H.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Ie=D.logo)==null?void 0:Ie.objectFit)||"contain"}})})]}),D.caption&&g(ee,D.caption,"caption",{...Y!=null&&Y.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:R,...Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(Y==null?void 0:Y.captionMinHeightPx)=="number"&&Y.captionMinHeightPx>0?{minHeightPx:Y.captionMinHeightPx}:{}})]})]},se)},[b,R,ee,v,x,$,M,y,ve,xe,S.bottom,S.left,S.right,S.top,g,m,h,ye,n,X,r]),Q=s.useCallback(D=>{le(D.maxTextPx),Se(D.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!oe){Q({maxTextPx:0,maxCaptionPx:0});return}const D=ie.current;if(!D)return;const se=()=>{A.readTestimonialTextMeasure(D,Q)};se();const Y=new ResizeObserver(se);return Y.observe(D),()=>{Y.disconnect()}},[oe,Q,t,G]);const ne=oe?{textMinHeightPx:T,captionMinHeightPx:J}:void 0,ue=oe?a.jsx("div",{ref:ie,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((D,se)=>G(D,`measure-${se}`,{dataMeasureAttrs:!0}))}):null,q=(D,se)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[G(D,`card-${se}`,ne),X&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${C(p)})`,width:C(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},se);if(N){const D=O?te&&ce?"paused":"running":"paused";return a.jsxs("div",{ref:I,className:Rt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...f>0?{height:f}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),ue,a.jsx("div",{ref:j,className:`${r}-marquee-track`,"data-direction":d,onMouseEnter:Ae,onMouseLeave:fe,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:we,WebkitAnimationDuration:we,animationPlayState:D,WebkitAnimationPlayState:D},children:Array.from({length:re},(se,Y)=>a.jsx("div",{ref:Y===0?E:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:C(p),paddingRight:C(p)},"aria-hidden":Y>0,children:t==null?void 0:t.map((pe,H)=>q(pe,`${Y}-${H}`))},`set-${Y}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),ue,a.jsx("div",{style:{gap:C(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((D,se)=>q(D,se))})]})},ky=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3660
3660
|
import cn from 'classnames';
|
|
3661
3661
|
import { CommonComponentProps } from '../props';
|
|
3662
3662
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4287,7 +4287,7 @@ type TestimonialsSettings = {
|
|
|
4287
4287
|
logoHeight: number;
|
|
4288
4288
|
captionMarginTop: number;
|
|
4289
4289
|
};
|
|
4290
|
-
`,Tc={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},
|
|
4290
|
+
`,Tc={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Ay={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Tc.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:{...Tc.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",assetId:"01M3QM74XFE5YFEHBH605E8FXT",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",assetId:"01M3QM74XFZD1R3FV8BKW3NT24",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",assetId:"01M3QM74XGNPA7232QGZAYFNSS",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"}]}]}]}},Fy={element:Ey,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:Ay,sourceCode:ky,assetsPaths:{content:[{path:"logo.assetId",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Ny(e){return`
|
|
4291
4291
|
.${e}-container {
|
|
4292
4292
|
position: relative;
|
|
4293
4293
|
overflow-x: clip;
|
|
@@ -4411,7 +4411,7 @@ type TestimonialsSettings = {
|
|
|
4411
4411
|
width: 100%;
|
|
4412
4412
|
height: 100%;
|
|
4413
4413
|
}
|
|
4414
|
-
`}const
|
|
4414
|
+
`}const _y=3e3,Hy=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=A.useScopedStyles(),l=t||[],{speed:c,align:d,width:u,imageMarginTop:p,textMarginTop:v,captionMarginTop:x,imageWidth:m,imageHeight:h,controlsWidth:b,controlsColor:S,controlsHoverColor:M}=e,y=c>0&&(!n||!!i),[$,R]=s.useState(0),[X,B]=s.useState(null),[O,N]=s.useState(!1),z=s.useRef(null),C=s.useMemo(()=>{switch(d){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[d]),I=s.useMemo(()=>{switch(d){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[d]);s.useEffect(()=>{R(0),B(null),N(!1)},[l.length]);const j=l[$],E=X===null?null:l[X],w=me=>{var ee,oe,re,ge,we;return{fontSettings:{fontFamily:(e==null?void 0:e[`${me}FontFamily`])??"Arial",fontWeight:((ee=e==null?void 0:e[`${me}FontSettings`])==null?void 0:ee.fontWeight)??400,fontStyle:((oe=e==null?void 0:e[`${me}FontSettings`])==null?void 0:oe.fontStyle)??"normal"},textAppearance:{textTransform:((re=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:re.textTransform)??"none",textDecoration:((ge=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:ge.textDecoration)??"none",fontVariant:((we=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:we.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${me}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${me}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${me}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${me}WordSpacing`])??0,color:(e==null?void 0:e[`${me}Color`])??"#000000"}},L=w("text"),V=w("caption"),_=l.length>1&&l.some(me=>{var ye,ee;return(((ye=me.text)==null?void 0:ye.length)??0)>0||(((ee=me.caption)==null?void 0:ee.length)??0)>0}),K=s.useRef(null),[P,f]=s.useState(0),[U,te]=s.useState(0),ce=e.controls??{mode:"Off",icon:null},F=l.length>1,ie=s.useCallback((me,ye)=>!F||ye===me?me:(z.current&&window.clearTimeout(z.current),B(me),N(!0),z.current=window.setTimeout(()=>{B(null),N(!1),z.current=null},300),ye),[F]),T=s.useCallback(()=>{F&&R(me=>ie(me,(me-1+l.length)%l.length))},[F,ie,l.length]),le=s.useCallback(()=>{F&&R(me=>ie(me,(me+1)%l.length))},[F,ie,l.length]);s.useEffect(()=>{if(!y||!F)return;const me=Math.max(300,_y/c),ye=window.setInterval(()=>{R(ee=>ie(ee,(ee+1)%l.length))},me);return()=>{window.clearInterval(ye)}},[y,F,ie,l.length,c]),s.useEffect(()=>()=>{z.current&&window.clearTimeout(z.current)},[]);const J=(me,ye)=>{var we,Ae,fe,ve;const ee=ye==null?void 0:ye.textMinHeightPx,oe=ye==null?void 0:ye.captionMinHeightPx,re=ye==null?void 0:ye.dataMeasureAttrs,ge=o&&!(ye!=null&&ye.dataMeasureAttrs)&&!(ye!=null&&ye.hideControls);return a.jsxs(a.Fragment,{children:[me.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:C,width:"100%"},children:[a.jsx("div",{"data-controls":ge?"textMarginTop":void 0,className:ge?`${r}-control`:void 0,style:{height:A.scalingValue(v??0,n??!1)}}),a.jsx("div",{...re&&{"data-testimonial-measure":"text"},style:{...nn(L,n),...ee&&ee>0?{minHeight:ee}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Zi,{content:me.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:C,width:"100%"},children:[a.jsx("div",{"data-controls":ge?"imageMarginTop":void 0,className:ge?`${r}-control`:void 0,style:{height:A.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:A.scalingValue(m??0,n??!1),height:A.scalingValue(h??0,n??!1)},children:((we=me.image)==null?void 0:we.assetId)&&a.jsx("img",{src:(Ae=me.image)==null?void 0:Ae.assetId,alt:((fe=me.image)==null?void 0:fe.name)??"",className:`${r}-icon`,style:{objectFit:((ve=me.image)==null?void 0:ve.objectFit)||"contain"}})})]}),me.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:C,width:"100%"},children:[a.jsx("div",{"data-controls":ge?"captionMarginTop":void 0,className:ge?`${r}-control`:void 0,style:{height:A.scalingValue(x??0,n??!1)}}),a.jsx("div",{...re?{"data-testimonial-measure":"caption"}:{},style:{...nn(V,n),...oe&&oe>0?{minHeight:oe}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Zi,{content:me.caption})})]})]})},Se=s.useCallback(me=>{f(me.maxTextPx),te(me.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!_){Se({maxTextPx:0,maxCaptionPx:0});return}const me=K.current;if(!me)return;const ye=()=>{A.readTestimonialTextMeasure(me,Se)};ye();const ee=new ResizeObserver(ye);return ee.observe(me),()=>{ee.disconnect()}},[_,Se,t]),!j)return a.jsx(a.Fragment,{});const Le=_?{textMinHeightPx:P,captionMinHeightPx:U}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ny(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:A.scalingValue(u??0,n??!1),alignItems:C},children:[_&&a.jsx("div",{ref:K,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((me,ye)=>a.jsx("div",{style:{width:"100%"},children:J(me,{dataMeasureAttrs:!0})},ye))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[E&&O&&a.jsx("div",{className:Rt(`${r}-fade-item-prev`,`${r}-fade-out`),children:J(E,{...Le,hideControls:!0})}),a.jsx("div",{className:Rt(`${r}-fade-item-current`,O?`${r}-fade-in`:void 0),children:J(j,Le)})]})]}),ce.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:A.scalingValue(b??.02,n??!1),height:A.scalingValue(b??.02,n??!1),"--arrow-hover-color":M},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:T,disabled:!F,"aria-label":"Previous testimonial",children:ce.icon&&a.jsx(gn,{url:ce.icon,fill:S,hoverFill:M,className:Rt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:Rt(`${r}-arrow`,`${r}-next-arrow`),style:{width:A.scalingValue(b??.02,n??!1),height:A.scalingValue(b??.02,n??!1),"--arrow-hover-color":M},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:le,disabled:!F,"aria-label":"Next testimonial",children:ce.icon&&a.jsx(gn,{url:ce.icon,fill:S,hoverFill:M,className:`${r}-arrow-img`})})})]})]})})},Wy=`import cn from 'classnames';
|
|
4415
4415
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4416
4416
|
import { CommonComponentProps } from '../props';
|
|
4417
4417
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4907,12 +4907,12 @@ type TestimonialsSettings = {
|
|
|
4907
4907
|
icon?: string | null;
|
|
4908
4908
|
};
|
|
4909
4909
|
};
|
|
4910
|
-
`,
|
|
4910
|
+
`,Oy="01M46GNEM3GEJ4HQSNJYYTA45T",Ic={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Dy={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Ic.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Default"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Ic.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Default"}},defaults:{controls:{mode:"On",icon:Oy},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",assetId:"01M3QM74XFE5YFEHBH605E8FXT",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",assetId:"01M3QM74XFZD1R3FV8BKW3NT24",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",assetId:"01M3QM74XGNPA7232QGZAYFNSS",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"}]}]}]}},By={element:Hy,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:Dy,sourceCode:Wy,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function zy(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Lc(e){return((e==null?void 0:e.trim().length)??0)>0}function is(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function os(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:A.scalingValue((o-t)/2,i)}}function jy(e){return`
|
|
4911
4911
|
.${e}-wrapper {
|
|
4912
4912
|
display: grid;
|
|
4913
4913
|
align-items: start;
|
|
4914
4914
|
justify-content: center;
|
|
4915
|
-
min-height: ${
|
|
4915
|
+
min-height: ${zy(48)};
|
|
4916
4916
|
}
|
|
4917
4917
|
.${e}-item {
|
|
4918
4918
|
display: flex;
|
|
@@ -5254,7 +5254,7 @@ type TestimonialsSettings = {
|
|
|
5254
5254
|
z-index: 2;
|
|
5255
5255
|
width: 100%;
|
|
5256
5256
|
}
|
|
5257
|
-
`}function Wy(){return Math.random()<.5?"ltr":"ttb"}function Oy(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Dy(e){const t=Wy();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Oy(e)})})}const An=500,By=750,pi="cubic-bezier(0.22, 1, 0.36, 1)",zy=72,jy=50;function Vy(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 Gy(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function Xy(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function Yu(e){return!Array.isArray(e)||e.length===0?[]:Vy(e)?e.flatMap(t=>{const n=Gy(t);if(!n)return[];const i=Xy(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.assetId?i:null}]}):e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Xi(e){return e.type==="video"}function Uy(e){const t=new Set,n=[];for(const i of e){const o=Yu(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.assetId&&!t.has(l.assetId)&&(t.add(l.assetId),n.push(l))}}return n}function qy({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Xi(t)?a.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):a.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function Yy(e){e.pause(),e.removeAttribute("src"),e.load()}function Pc({media:e,className:t,style:n,onMediaClick:i}){return Xi(e)?a.jsx("video",{src:e.assetId,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.assetId,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Rc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Ky(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const r=e.width/n;return{width:e.width,height:r,left:e.left,top:e.top+(e.height-r)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function Qy({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{Yy(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,style:i})}function Zy({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:c,counterClassName:d,counterStyle:u}){const p=i==="cover",y=s.useRef(null),v=s.useRef(null),g=s.useRef(null),m=s.useRef(null),x=s.useRef(0),b=s.useRef(0),M=s.useRef("none"),f=s.useRef(!1),S=s.useRef(!1),W=s.useRef(null),q=s.useRef(0),z=s.useRef(null),L=s.useRef(!1),_=s.useRef(null),G=s.useRef(null),$=s.useRef(null),I=s.useRef(()=>{}),[D,E]=s.useState(null),[T,C]=s.useState(null),[V,w]=s.useState("opening"),[U,P]=s.useState(0),[A,j]=s.useState(0),[ie,ae]=s.useState(null),[O,re]=s.useState(!1),[N,le]=s.useState(!1),[J,be]=s.useState(!1),[Le,ye]=s.useState(null),ce=s.useRef(n),K=s.useRef(void 0),se=t[n],pe=se?Xi(se):!1,fe=A!==0||O,we=ie!==null,Re=s.useCallback($e=>{const Ne=$e.currentTarget,Ye=Ne instanceof HTMLVideoElement?{width:Ne.videoWidth,height:Ne.videoHeight}:{width:Ne.naturalWidth,height:Ne.naturalHeight};!Ye.width||!Ye.height||ye(Ye)},[]);s.useEffect(()=>{W.current=T},[T]),s.useEffect(()=>{const $e=y.current;if(!$e)return;const Ne=()=>C(Rc($e));Ne();const Ye=new ResizeObserver(Ne);return Ye.observe($e),()=>Ye.disconnect()},[]);const me=s.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),xe=s.useCallback(()=>{const $e=G.current;G.current=null,me(),z.current=null,L.current=!1,ae(null),re(!1),j(0),q.current=0,le(!1),f.current=!1,b.current=0,M.current="none",$e===1?c():$e===-1&&l()},[me,c,l]),Ce=s.useCallback(()=>{me(),G.current=null,z.current=null,L.current=!1,ae(null),re(!1),j(0),q.current=0},[me]),h=s.useCallback(()=>{me(),_.current=window.setTimeout(()=>{G.current!==null&&xe()},An+32)},[me,xe]),Y=s.useCallback(($e,Ne)=>{var Ze;const Ye=((Ze=W.current)==null?void 0:Ze.width)??0;if(me(),z.current=$e,ae($e),L.current=!0,re(!0),Ne){G.current=$e;const st=-$e*Ye;q.current=st,j(st),h();return}q.current=0,j(0),_.current=window.setTimeout(()=>{_.current=null,Ce()},An+32)},[me,Ce,h]),Q=s.useCallback($e=>{if(!(t.length<=1)){if(L.current){if(G.current===$e){$.current=$e,xe();return}Ce()}me(),z.current=$e,ae($e),L.current=!1,re(!1),q.current=0,j(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Y($e,!0)})})}},[t.length,Y,xe,Ce,me]);I.current=Q;const ne=s.useCallback($e=>{$e.propertyName!=="transform"||!L.current||G.current!==null&&xe()},[xe]),ue=s.useCallback(()=>{const $e=v.current;if(!$e)return;const Ne=Rc($e);!Ne.width||!Ne.height||E(Ne)},[]);s.useEffect(()=>{ue();const $e=v.current;if(!$e)return;const Ne=new ResizeObserver(()=>ue());return Ne.observe($e),()=>Ne.disconnect()},[ue]),s.useEffect(()=>{V==="opening"&&D&&w("open")},[V,D]),s.useEffect(()=>{if(V!=="closing")return;const $e=setTimeout(()=>r(),An);return()=>clearTimeout($e)},[V,r]),s.useEffect(()=>()=>{me()},[me]),s.useLayoutEffect(()=>{ce.current===n&&K.current===(se==null?void 0:se.assetId)||(me(),G.current=null,ae(null),P(0),j(0),re(!1),be(!1),le(!1),ye(null),x.current=0,b.current=0,M.current="none",f.current=!1,L.current=!1,q.current=0,z.current=null,m.current=null,S.current=!1,ce.current=n,K.current=se==null?void 0:se.assetId)},[n,se==null?void 0:se.assetId,me]),s.useLayoutEffect(()=>{const $e=$.current;$e!==null&&($.current=null,requestAnimationFrame(()=>{I.current($e)}))},[n,se==null?void 0:se.assetId]),s.useEffect(()=>{if(V!=="open")return;let $e=null;const Ne=()=>{$e&&(document.removeEventListener("click",$e,!0),$e=null)},Ye=()=>{Ne(),$e=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),Ne()},document.addEventListener("click",$e,!0)},Ze=Ae=>{const mt=Ae<0?1:-1;if(Math.abs(Ae)>jy&&t.length>1){Y(mt,!0);return}Y(mt,!1)},st=Ae=>{if(Ae.touches.length!==1||L.current)return;const mt=Ae.touches[0];S.current=!0,m.current={x:mt.clientX,y:mt.clientY},M.current="none",b.current=0,f.current=!1},it=Ae=>{if(!m.current||Ae.touches.length!==1||L.current)return;const mt=Ae.touches[0],Be=mt.clientX-m.current.x,De=mt.clientY-m.current.y;if(M.current==="none"){if(Math.abs(Be)<10&&Math.abs(De)<10)return;if(Math.abs(Be)>Math.abs(De)){if(t.length<=1)return;M.current="horizontal"}else if(De>0)M.current="vertical";else return}if(M.current==="horizontal"){f.current=!0,le(!0),b.current=Be;const Ue=Be<0?1:-1;z.current!==Ue&&(z.current=Ue,ae(Ue)),q.current=Be,j(Be),Ae.preventDefault();return}M.current==="vertical"&&(f.current=!0,le(!0),x.current=De,P(De),Ae.preventDefault())},Oe=()=>{if(!m.current)return;const Ae=M.current,mt=f.current;if(mt&&Ae==="horizontal")Ze(b.current),Ye();else if(mt&&Ae==="vertical")if(x.current>zy){const De=window.innerHeight;x.current=De,be(!0),P(De),w("closing")}else x.current=0,P(0),Ye();else Ae==="horizontal"&&Math.abs(b.current)>0&&(Ze(b.current),Ye());m.current=null,M.current="none",b.current=0,f.current=!1,le(!1)};return document.addEventListener("touchstart",st,{passive:!0}),document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",Oe),document.addEventListener("touchcancel",Oe),()=>{document.removeEventListener("touchstart",st),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",Oe),document.removeEventListener("touchcancel",Oe),Ne()}},[V,t.length,Y]),s.useEffect(()=>{const $e=Ne=>{Ne.key==="Escape"&&(Ne.preventDefault(),Ne.stopPropagation(),V!=="closing"&&w("closing"))};return window.addEventListener("keydown",$e,!0),()=>window.removeEventListener("keydown",$e,!0)},[V]);const B=()=>{V!=="closing"&&w("closing")},R=V==="open",ee=V==="closing",te=U>0?Math.max(0,1-U/500):1,ge=U>0?Math.max(.35,1-U/500):1,X=D?p?D:Ky(D,Le):null,Pe=$e=>{if($e.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const Ne=X??$e.currentTarget.getBoundingClientRect(),Ye=$e.clientY-Ne.top,Ze=Math.min(52,Ne.height*.2);if(!(Ye>Ne.height-Ze)){if($e.clientX-Ne.left<Ne.width/2){Q(-1);return}Q(1)}},Se=$e=>{if(t.length<=1)return;const Ne=X??$e.currentTarget.getBoundingClientRect(),Ye=$e.clientX-Ne.left,Ze=$e.clientY-Ne.top,st=Math.min(52,Ne.height*.2);if(Ze>Ne.height-st){$e.currentTarget.style.cursor="default";return}$e.currentTarget.style.cursor=Ye<Ne.width/2?"w-resize":"e-resize"},Z={position:"fixed",top:T==null?void 0:T.top,left:T==null?void 0:T.left,width:T==null?void 0:T.width,height:T==null?void 0:T.height,zIndex:9998},He=p?"cover":"contain",We=A!==0||U>0?`translate(${A}px, ${U}px)`:void 0,ot=N&&!O?"none":O?`transform ${An}ms ${pi}`:J?`transform ${An}ms ${pi}, opacity ${An}ms ${pi}`:V==="opening"||ee?`opacity ${An}ms ${pi}`:"none",qe={...Z,transform:We,opacity:U>0?ge:V==="opening"||ee?0:1,transition:ot,pointerEvents:"none"},tt={position:"absolute",top:((X==null?void 0:X.top)??0)-((T==null?void 0:T.top)??0),left:((X==null?void 0:X.left)??0)-((T==null?void 0:T.left)??0),width:X==null?void 0:X.width,height:X==null?void 0:X.height,objectFit:He,pointerEvents:pe&&R&&!fe?"auto":"none",touchAction:pe&&R?"none":void 0},et=(T==null?void 0:T.width)??0,Ge=we?(n+ie+t.length)%t.length:null,ve=Ge!==null?t[Ge]:null,_e={...Z,transform:we?`translateX(${ie*et+A}px)`:void 0,opacity:1,transition:O?`transform ${An}ms ${pi}`:"none",pointerEvents:"none"},ze={position:"absolute",top:((D==null?void 0:D.top)??0)-((T==null?void 0:T.top)??0),left:((D==null?void 0:D.left)??0)-((T==null?void 0:T.left)??0),width:D==null?void 0:D.width,height:D==null?void 0:D.height,objectFit:He,pointerEvents:"none"},Qe=X?{position:"fixed",top:X.top,height:X.height,width:X.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:y,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:B,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:R?te:0,transition:N?"none":`opacity ${An}ms ${pi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:R?1:0,transition:`opacity ${An}ms ${pi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:R?1:0,transition:`opacity ${An}ms ${pi}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),D&&T&&ve&&a.jsx("div",{style:_e,onTransitionEnd:ne,children:Xi(ve)?a.jsx("video",{src:ve.assetId,muted:!0,playsInline:!0,preload:"auto",style:ze},`neighbor-${Ge}-${ve.assetId}`):a.jsx("img",{src:ve.assetId,alt:ve.name,style:ze},`neighbor-${Ge}-${ve.assetId}`)}),D&&T&&se&&a.jsx("div",{style:qe,onTransitionEnd:ne,children:pe?a.jsx(Qy,{src:se.assetId,phase:V,mediaRef:g,mediaStyle:tt,onLoadedMetadata:Re,onClick:Pe,onMouseMove:Se},`${n}-${se.assetId}`):a.jsx("img",{ref:g,src:se.assetId,alt:se.name,onLoad:Re,style:tt},`${n}-${se.assetId}`)}),R&&Qe&&t.length>1&&!pe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Qe,left:X.left,cursor:"w-resize",pointerEvents:N?"none":"auto"},onClick:$e=>{if(S.current){S.current=!1;return}$e.stopPropagation(),Q(-1)}}),a.jsx("div",{style:{...Qe,left:X.left+X.width/2,cursor:"e-resize",pointerEvents:N?"none":"auto"},onClick:$e=>{if(S.current){S.current=!1;return}$e.stopPropagation(),Q(1)}})]})]})}function Jy(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function ev({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:c,portalId:d}){const{prefix:u}=F.useScopedStyles(),{type:p="a",gridLayout:y,textBoxWidth:v=100,verticalGap:g,entriesCount:m,lightbox:x,imageDisplay:b,imageCorners:M,lightboxImageDisplay:f,slider:S,sliderTiming:W,direction:q,transition:z,titleMarginTop:L,subtitleMarginTop:_,titleColor:G,subtitleColor:$,lightboxCounterColor:I,titleFontFamily:D,titleFontSettings:E,titleFontSize:T,titleLineHeight:C,titleLetterSpacing:V,titleWordSpacing:w,titleTextAppearance:U,subtitleFontFamily:P,subtitleFontSettings:A,subtitleFontSize:j,subtitleLineHeight:ie,subtitleLetterSpacing:ae,subtitleWordSpacing:O,subtitleTextAppearance:re,lightboxCounterFontFamily:N,lightboxCounterFontSettings:le,lightboxCounterFontSize:J,lightboxCounterLineHeight:be,lightboxCounterLetterSpacing:Le,lightboxCounterWordSpacing:ye,lightboxCounterTextAppearance:ce,showText:K="always",alignEntries:se="off",align:pe="top"}=e,fe={fontSettings:{fontFamily:D,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:T??.01,lineHeight:C,letterSpacing:V??0,wordSpacing:w??0,textAppearance:U,color:G},Re={...un(en(fe,n))},me={fontSettings:{fontFamily:P,fontWeight:(A==null?void 0:A.fontWeight)??400,fontStyle:(A==null?void 0:A.fontStyle)??"normal"},fontSize:j??.01,lineHeight:ie,letterSpacing:ae??0,wordSpacing:O??0,textAppearance:re,color:$},Ce={...un(en(me,n))},h={fontSettings:{fontFamily:N,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:J??.01,lineHeight:be,letterSpacing:Le??0,wordSpacing:ye??0,textAppearance:ce,color:I},Q={...un(en(h,n)),...os(J,be,u,n)},ne=is(T,C,`${u}-item-title`,`${u}-text-tight-leading`),ue=is(j,ie,`${u}-item-subtitle`,`${u}-text-tight-leading`),B=os(T,C,u,n),R=os(j,ie,u,n),ee=is(J,be,`${u}-lightbox-counter`,`${u}-text-tight-leading`),te=F.buildColorVars(u,{titleColor:G,subtitleColor:$,lightboxCounterColor:I},tv,nv),Pe=`${l&&l!=="default"?`${u}-state-${l}`:""}${K==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Se=m===0?1/0:m,Z=(t??[]).slice(0,Se),He=s.useMemo(()=>x==="on"?Uy(Z):[],[Z,x]),We=y.entryWidth??.2,ot=(b==null?void 0:b.display)==="cover",qe=(b==null?void 0:b.ratioValue)??"1:1",tt=(b==null?void 0:b.reversed)??!1,[et,Ge]=qe.split(":").map(Number),ze=`${tt?Ge:et} / ${tt?et:Ge}`,Qe=y.columnsCount,$e=F.scalingValue(We??0,n),Ne=$e,Ye=!ot&&S!=="off",Ze=Z.length%Qe||Qe,st=Ze<Qe&&Z.length>0,it=Z.length-Ze,Oe=st?Math.floor((Qe-Ze)/2)+1:1,Ae=M?F.scalingValue(M,n):void 0,mt={width:Ne,...ot?{aspectRatio:ze,height:"auto",overflow:"hidden"}:{height:"auto"},...Ae?{borderRadius:Ae,overflow:"hidden"}:{}},Be=`${u}-item-image-wrapper${Ye?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),De=p==="d"||p==="e"||p==="f",Ue=se==="on",ct=`calc(${F.scalingValue(We??0,n)} * (${v} / 100))`,he=F.scalingValue(We*v/100,n),Me=ot?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Ae?{borderRadius:Ae}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Ae?{borderRadius:Ae}:{}},[nt,pt]=s.useState(0),Ve=s.useRef(null),vt=z==="fade"||q==="horizontal"?"ltr":q==="vertical"?"ttb":"ltr";s.useEffect(()=>{const xt=Ve.current;if(!xt)return;const yt=new ResizeObserver(ke=>{pt(Math.round(ke[0].contentRect.width))});return yt.observe(xt),()=>yt.disconnect()},[]);const Pt=(()=>{const xt={...te},yt=Ve.current?getComputedStyle(Ve.current).getPropertyValue("--cntrl-article-width").trim():"";return yt&&(xt["--cntrl-article-width"]=yt),xt})(),[At,wt]=s.useState(!1),[Vt,jt]=s.useState([]),[Yt,Kt]=s.useState(0),Rt=x==="on"&&(!n||i),zt=(xt,yt)=>{n&&!i||x!=="off"&&(jt(xt),Kt(yt),wt(!0))};s.useEffect(()=>{if(!At||x!=="on"||typeof document>"u")return;const xt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=xt}},[At,x]),s.useEffect(()=>{!n||i||wt(!1)},[n,i]);const on=s.useMemo(()=>Hy(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:on}}),x==="on"&&a.jsx(qy,{mediaList:He}),a.jsx("div",{style:te,children:a.jsx("div",{ref:Ve,className:`${u}-wrapper ${u}-type-${p}${Ue?` ${u}-align-entries`:""} ${u}-image-align-${pe} ${Pe}`.trim(),style:{gridTemplateColumns:`repeat(${Qe}, ${$e})`,rowGap:Ue?0:F.scalingValue(g??0,n),columnGap:F.scalingValue(y.horizontalGap??0,n),width:F.scalingValue(y.wrapperWidth??0,n),...Ue?{[`--${u}-align-entries-row-gap`]:F.scalingValue(g??0,n)}:{}},children:Z.map((xt,yt)=>{var Ft;const ke=Lc(xt.title),Je=Lc(xt.subtitle),rt=(((Ft=xt.link)==null?void 0:Ft.length)??0)>0&&x==="off"?xt.link:void 0,dt=Math.floor(yt/Qe)===Math.ceil(Z.length/Qe)-1,Lt=st&&yt>=it?`${Oe+(yt-it)}`:void 0,St=De?a.jsxs("div",{className:`${u}-item-text-block`,children:[ke&&a.jsx("p",{className:ne,style:{width:ct,...Re,...B},children:xt.title}),ke&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(L??0,n),width:he}}),Je&&a.jsx("p",{className:ue,style:{width:ct,...Ce,...R},children:xt.subtitle}),Je&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(_??0,n),width:he}})]}):null,ht=Ue?a.jsxs("div",{className:`${u}-item-title-row`,children:[!De&&a.jsx("div",{"data-controls":o&&ke?"titleMarginTop":void 0,className:o&&ke?`${u}-control`:void 0,style:{height:ke?F.scalingValue(L??0,n):0,width:he}}),ke&&a.jsx("p",{className:ne,style:{width:ct,...Re,...B},children:xt.title}),De&&ke&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(L??0,n),width:he}})]}):null,Wt=Ue?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!De&&a.jsx("div",{"data-controls":o&&Je?"subtitleMarginTop":void 0,className:o&&Je?`${u}-control`:void 0,style:{height:Je?F.scalingValue(_??0,n):0,width:he}}),Je&&a.jsx("p",{className:ue,style:{width:ct,...Ce,...R},children:xt.subtitle}),De&&Je&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(_??0,n),width:he}})]}):null,Tt=rt?a.jsxs("a",{href:rt,target:"_blank",className:`${u}-item-text-link`,children:[ht,Wt]}):a.jsxs(a.Fragment,{children:[ht,Wt]}),Ot=Yu(xt.gallery),Gt=Ot.filter(ut=>ut.lightboxMedia).map(ut=>ut.lightboxMedia),kt=a.jsx("div",{className:Be,style:mt,children:Ot.length===0?null:S==="off"?(()=>{const{displayMedia:ut,lightboxMedia:H}=Ot[0],Ie=H?Gt.findIndex(je=>je.assetId===H.assetId):-1;return a.jsx(Pc,{media:ut,className:`${u}-item-${Xi(ut)?"video":"image"}`.trim(),style:Me,onMediaClick:Rt&&Ie>=0?()=>zt(Gt,Ie):void 0})})():a.jsxs(a.Fragment,{children:[Ye&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Ot.map(({displayMedia:ut})=>Xi(ut)?a.jsx("video",{src:ut.assetId,muted:!0,playsInline:!0},`sizer-${ut.assetId}`):a.jsx("img",{src:ut.assetId,alt:""},`sizer-${ut.assetId}`))}),a.jsx(El,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:W*1e3,width:"100%",height:"100%",speed:By,type:z==="fade"?"fade":"loop",rewind:z==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:vt},onMoved:ut=>{q!=="random"||z==="fade"||Dy(ut)},children:Ot.map(({displayMedia:ut,lightboxMedia:H},Ie)=>{const je=H?Gt.findIndex(Fe=>Fe.assetId===H.assetId):-1;return a.jsx(kl,{children:a.jsx(Pc,{media:ut,className:`${u}-item-${Xi(ut)?"video":"image"}`.trim(),style:Me,onMediaClick:Rt&&je>=0?()=>zt(Gt,je):void 0})},Ie)})},`${z}-${We}-${q}-${W}-${nt}-${c}`)]})}),_t=De?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&ke?"titleMarginTop":void 0,className:o&&ke?`${u}-control`:void 0,style:{height:ke?F.scalingValue(L??0,n):0,width:he}}),a.jsx("p",{className:ne,style:{width:ct,...Re,...B},children:xt.title}),a.jsx("div",{"data-controls":o&&Je?"subtitleMarginTop":void 0,className:o&&Je?`${u}-control`:void 0,style:{height:Je?F.scalingValue(_??0,n):0,width:he}}),a.jsx("p",{className:ue,style:{width:ct,...Ce,...R},children:xt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Lt&&!Ue?{gridColumn:Lt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Ue&&dt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(v??0)>100?`calc(${$e} * (${v} / 100))`:$e,...Lt&&Ue?{gridColumn:Lt}:{}},children:Ue?a.jsx(a.Fragment,{children:De?a.jsxs(a.Fragment,{children:[Tt,a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:kt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:kt}),Tt]})}):rt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:[St,kt]}),!De&&a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-text-link`,children:_t})]}):a.jsxs(a.Fragment,{children:[St,kt,_t]})})},yt)})})}),(!n||i)&&At&&typeof document<"u"&&x==="on"&&(()=>{const xt=(d?document.getElementById(d):null)??document.body;return Xn.createPortal(a.jsx("div",{style:Pt,"data-selection":"none",children:a.jsx(Zy,{prefix:u,items:Vt,index:Yt,imageDisplay:Jy(f),isEditor:n,onClose:()=>wt(!1),onPrev:()=>Kt(yt=>(yt-1+Vt.length)%Vt.length),onNext:()=>Kt(yt=>(yt+1)%Vt.length),counterClassName:ee,counterStyle:Q})}),xt)})()]})}const tv={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},nv=["hover","focus","filled","success","error"],iv=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5257
|
+
`}function Vy(){return Math.random()<.5?"ltr":"ttb"}function Gy(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Xy(e){const t=Vy();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Gy(e)})})}const Fn=500,qy=750,hi="cubic-bezier(0.22, 1, 0.36, 1)",Uy=72,Yy=50;function Ky(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 Qy(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function Zy(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function tp(e){return!Array.isArray(e)||e.length===0?[]:Ky(e)?e.flatMap(t=>{const n=Qy(t);if(!n)return[];const i=Zy(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.assetId?i:null}]}):e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Yi(e){return e.type==="video"}function Jy(e){const t=new Set,n=[];for(const i of e){const o=tp(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.assetId&&!t.has(l.assetId)&&(t.add(l.assetId),n.push(l))}}return n}function ev({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Yi(t)?a.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):a.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function tv(e){e.pause(),e.removeAttribute("src"),e.load()}function Pc({media:e,className:t,style:n,onMediaClick:i}){return Yi(e)?a.jsx("video",{src:e.assetId,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.assetId,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Rc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function nv(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const r=e.width/n;return{width:e.width,height:r,left:e.left,top:e.top+(e.height-r)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function iv({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{tv(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,style:i})}function ov({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:c,counterClassName:d,counterStyle:u}){const p=i==="cover",v=s.useRef(null),x=s.useRef(null),m=s.useRef(null),h=s.useRef(null),b=s.useRef(0),S=s.useRef(0),M=s.useRef("none"),y=s.useRef(!1),$=s.useRef(!1),R=s.useRef(null),X=s.useRef(0),B=s.useRef(null),O=s.useRef(!1),N=s.useRef(null),z=s.useRef(null),C=s.useRef(null),I=s.useRef(()=>{}),[j,E]=s.useState(null),[w,L]=s.useState(null),[V,_]=s.useState("opening"),[K,P]=s.useState(0),[f,U]=s.useState(0),[te,ce]=s.useState(null),[F,ie]=s.useState(!1),[T,le]=s.useState(!1),[J,Se]=s.useState(!1),[Le,me]=s.useState(null),ye=s.useRef(n),ee=s.useRef(void 0),oe=t[n],re=oe?Yi(oe):!1,ge=f!==0||F,we=te!==null,Ae=s.useCallback(Ce=>{const _e=Ce.currentTarget,Ue=_e instanceof HTMLVideoElement?{width:_e.videoWidth,height:_e.videoHeight}:{width:_e.naturalWidth,height:_e.naturalHeight};!Ue.width||!Ue.height||me(Ue)},[]);s.useEffect(()=>{R.current=w},[w]),s.useEffect(()=>{const Ce=v.current;if(!Ce)return;const _e=()=>L(Rc(Ce));_e();const Ue=new ResizeObserver(_e);return Ue.observe(Ce),()=>Ue.disconnect()},[]);const fe=s.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),ve=s.useCallback(()=>{const Ce=z.current;z.current=null,fe(),B.current=null,O.current=!1,ce(null),ie(!1),U(0),X.current=0,le(!1),y.current=!1,S.current=0,M.current="none",Ce===1?c():Ce===-1&&l()},[fe,c,l]),xe=s.useCallback(()=>{fe(),z.current=null,B.current=null,O.current=!1,ce(null),ie(!1),U(0),X.current=0},[fe]),g=s.useCallback(()=>{fe(),N.current=window.setTimeout(()=>{z.current!==null&&ve()},Fn+32)},[fe,ve]),G=s.useCallback((Ce,_e)=>{var Ye;const Ue=((Ye=R.current)==null?void 0:Ye.width)??0;if(fe(),B.current=Ce,ce(Ce),O.current=!0,ie(!0),_e){z.current=Ce;const lt=-Ce*Ue;X.current=lt,U(lt),g();return}X.current=0,U(0),N.current=window.setTimeout(()=>{N.current=null,xe()},Fn+32)},[fe,xe,g]),Q=s.useCallback(Ce=>{if(!(t.length<=1)){if(O.current){if(z.current===Ce){C.current=Ce,ve();return}xe()}fe(),B.current=Ce,ce(Ce),O.current=!1,ie(!1),X.current=0,U(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{G(Ce,!0)})})}},[t.length,G,ve,xe,fe]);I.current=Q;const ne=s.useCallback(Ce=>{Ce.propertyName!=="transform"||!O.current||z.current!==null&&ve()},[ve]),ue=s.useCallback(()=>{const Ce=x.current;if(!Ce)return;const _e=Rc(Ce);!_e.width||!_e.height||E(_e)},[]);s.useEffect(()=>{ue();const Ce=x.current;if(!Ce)return;const _e=new ResizeObserver(()=>ue());return _e.observe(Ce),()=>_e.disconnect()},[ue]),s.useEffect(()=>{V==="opening"&&j&&_("open")},[V,j]),s.useEffect(()=>{if(V!=="closing")return;const Ce=setTimeout(()=>r(),Fn);return()=>clearTimeout(Ce)},[V,r]),s.useEffect(()=>()=>{fe()},[fe]),s.useLayoutEffect(()=>{ye.current===n&&ee.current===(oe==null?void 0:oe.assetId)||(fe(),z.current=null,ce(null),P(0),U(0),ie(!1),Se(!1),le(!1),me(null),b.current=0,S.current=0,M.current="none",y.current=!1,O.current=!1,X.current=0,B.current=null,h.current=null,$.current=!1,ye.current=n,ee.current=oe==null?void 0:oe.assetId)},[n,oe==null?void 0:oe.assetId,fe]),s.useLayoutEffect(()=>{const Ce=C.current;Ce!==null&&(C.current=null,requestAnimationFrame(()=>{I.current(Ce)}))},[n,oe==null?void 0:oe.assetId]),s.useEffect(()=>{if(V!=="open")return;let Ce=null;const _e=()=>{Ce&&(document.removeEventListener("click",Ce,!0),Ce=null)},Ue=()=>{_e(),Ce=Ee=>{Ee.stopPropagation(),Ee.preventDefault(),_e()},document.addEventListener("click",Ce,!0)},Ye=Ee=>{const pt=Ee<0?1:-1;if(Math.abs(Ee)>Yy&&t.length>1){G(pt,!0);return}G(pt,!1)},lt=Ee=>{if(Ee.touches.length!==1||O.current)return;const pt=Ee.touches[0];$.current=!0,h.current={x:pt.clientX,y:pt.clientY},M.current="none",S.current=0,y.current=!1},it=Ee=>{if(!h.current||Ee.touches.length!==1||O.current)return;const pt=Ee.touches[0],ke=pt.clientX-h.current.x,We=pt.clientY-h.current.y;if(M.current==="none"){if(Math.abs(ke)<10&&Math.abs(We)<10)return;if(Math.abs(ke)>Math.abs(We)){if(t.length<=1)return;M.current="horizontal"}else if(We>0)M.current="vertical";else return}if(M.current==="horizontal"){y.current=!0,le(!0),S.current=ke;const Ve=ke<0?1:-1;B.current!==Ve&&(B.current=Ve,ce(Ve)),X.current=ke,U(ke),Ee.preventDefault();return}M.current==="vertical"&&(y.current=!0,le(!0),b.current=We,P(We),Ee.preventDefault())},qe=()=>{if(!h.current)return;const Ee=M.current,pt=y.current;if(pt&&Ee==="horizontal")Ye(S.current),Ue();else if(pt&&Ee==="vertical")if(b.current>Uy){const We=window.innerHeight;b.current=We,Se(!0),P(We),_("closing")}else b.current=0,P(0),Ue();else Ee==="horizontal"&&Math.abs(S.current)>0&&(Ye(S.current),Ue());h.current=null,M.current="none",S.current=0,y.current=!1,le(!1)};return document.addEventListener("touchstart",lt,{passive:!0}),document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",qe),document.addEventListener("touchcancel",qe),()=>{document.removeEventListener("touchstart",lt),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",qe),document.removeEventListener("touchcancel",qe),_e()}},[V,t.length,G]),s.useEffect(()=>{const Ce=_e=>{_e.key==="Escape"&&(_e.preventDefault(),_e.stopPropagation(),V!=="closing"&&_("closing"))};return window.addEventListener("keydown",Ce,!0),()=>window.removeEventListener("keydown",Ce,!0)},[V]);const q=()=>{V!=="closing"&&_("closing")},D=V==="open",se=V==="closing",Y=K>0?Math.max(0,1-K/500):1,pe=K>0?Math.max(.35,1-K/500):1,H=j?p?j:nv(j,Le):null,Ie=Ce=>{if(Ce.stopPropagation(),$.current){$.current=!1;return}if(t.length<=1)return;const _e=H??Ce.currentTarget.getBoundingClientRect(),Ue=Ce.clientY-_e.top,Ye=Math.min(52,_e.height*.2);if(!(Ue>_e.height-Ye)){if(Ce.clientX-_e.left<_e.width/2){Q(-1);return}Q(1)}},de=Ce=>{if(t.length<=1)return;const _e=H??Ce.currentTarget.getBoundingClientRect(),Ue=Ce.clientX-_e.left,Ye=Ce.clientY-_e.top,lt=Math.min(52,_e.height*.2);if(Ye>_e.height-lt){Ce.currentTarget.style.cursor="default";return}Ce.currentTarget.style.cursor=Ue<_e.width/2?"w-resize":"e-resize"},Z={position:"fixed",top:w==null?void 0:w.top,left:w==null?void 0:w.left,width:w==null?void 0:w.width,height:w==null?void 0:w.height,zIndex:9998},Ne=p?"cover":"contain",Oe=f!==0||K>0?`translate(${f}px, ${K}px)`:void 0,Je=T&&!F?"none":F?`transform ${Fn}ms ${hi}`:J?`transform ${Fn}ms ${hi}, opacity ${Fn}ms ${hi}`:V==="opening"||se?`opacity ${Fn}ms ${hi}`:"none",De={...Z,transform:Oe,opacity:K>0?pe:V==="opening"||se?0:1,transition:Je,pointerEvents:"none"},Ze={position:"absolute",top:((H==null?void 0:H.top)??0)-((w==null?void 0:w.top)??0),left:((H==null?void 0:H.left)??0)-((w==null?void 0:w.left)??0),width:H==null?void 0:H.width,height:H==null?void 0:H.height,objectFit:Ne,pointerEvents:re&&D&&!ge?"auto":"none",touchAction:re&&D?"none":void 0},at=(w==null?void 0:w.width)??0,Xe=we?(n+te+t.length)%t.length:null,be=Xe!==null?t[Xe]:null,He={...Z,transform:we?`translateX(${te*at+f}px)`:void 0,opacity:1,transition:F?`transform ${Fn}ms ${hi}`:"none",pointerEvents:"none"},je={position:"absolute",top:((j==null?void 0:j.top)??0)-((w==null?void 0:w.top)??0),left:((j==null?void 0:j.left)??0)-((w==null?void 0:w.left)??0),width:j==null?void 0:j.width,height:j==null?void 0:j.height,objectFit:Ne,pointerEvents:"none"},Qe=H?{position:"fixed",top:H.top,height:H.height,width:H.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:v,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:q,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:D?Y:0,transition:T?"none":`opacity ${Fn}ms ${hi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:x,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:D?1:0,transition:`opacity ${Fn}ms ${hi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:x,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:D?1:0,transition:`opacity ${Fn}ms ${hi}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),j&&w&&be&&a.jsx("div",{style:He,onTransitionEnd:ne,children:Yi(be)?a.jsx("video",{src:be.assetId,muted:!0,playsInline:!0,preload:"auto",style:je},`neighbor-${Xe}-${be.assetId}`):a.jsx("img",{src:be.assetId,alt:be.name,style:je},`neighbor-${Xe}-${be.assetId}`)}),j&&w&&oe&&a.jsx("div",{style:De,onTransitionEnd:ne,children:re?a.jsx(iv,{src:oe.assetId,phase:V,mediaRef:m,mediaStyle:Ze,onLoadedMetadata:Ae,onClick:Ie,onMouseMove:de},`${n}-${oe.assetId}`):a.jsx("img",{ref:m,src:oe.assetId,alt:oe.name,onLoad:Ae,style:Ze},`${n}-${oe.assetId}`)}),D&&Qe&&t.length>1&&!re&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Qe,left:H.left,cursor:"w-resize",pointerEvents:T?"none":"auto"},onClick:Ce=>{if($.current){$.current=!1;return}Ce.stopPropagation(),Q(-1)}}),a.jsx("div",{style:{...Qe,left:H.left+H.width/2,cursor:"e-resize",pointerEvents:T?"none":"auto"},onClick:Ce=>{if($.current){$.current=!1;return}Ce.stopPropagation(),Q(1)}})]})]})}function rv(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function av({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:c,portalId:d}){const{prefix:u}=A.useScopedStyles(),{type:p="a",gridLayout:v,textBoxWidth:x=100,verticalGap:m,entriesCount:h,lightbox:b,imageDisplay:S,imageCorners:M,lightboxImageDisplay:y,slider:$,sliderTiming:R,direction:X,transition:B,titleMarginTop:O,subtitleMarginTop:N,titleColor:z,subtitleColor:C,lightboxCounterColor:I,titleFontFamily:j,titleFontSettings:E,titleFontSize:w,titleLineHeight:L,titleLetterSpacing:V,titleWordSpacing:_,titleTextAppearance:K,subtitleFontFamily:P,subtitleFontSettings:f,subtitleFontSize:U,subtitleLineHeight:te,subtitleLetterSpacing:ce,subtitleWordSpacing:F,subtitleTextAppearance:ie,lightboxCounterFontFamily:T,lightboxCounterFontSettings:le,lightboxCounterFontSize:J,lightboxCounterLineHeight:Se,lightboxCounterLetterSpacing:Le,lightboxCounterWordSpacing:me,lightboxCounterTextAppearance:ye,showText:ee="always",alignEntries:oe="off",align:re="top"}=e,ge={fontSettings:{fontFamily:j,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:w??.01,lineHeight:L,letterSpacing:V??0,wordSpacing:_??0,textAppearance:K,color:z},Ae={...pn(nn(ge,n))},fe={fontSettings:{fontFamily:P,fontWeight:(f==null?void 0:f.fontWeight)??400,fontStyle:(f==null?void 0:f.fontStyle)??"normal"},fontSize:U??.01,lineHeight:te,letterSpacing:ce??0,wordSpacing:F??0,textAppearance:ie,color:C},xe={...pn(nn(fe,n))},g={fontSettings:{fontFamily:T,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:J??.01,lineHeight:Se,letterSpacing:Le??0,wordSpacing:me??0,textAppearance:ye,color:I},Q={...pn(nn(g,n)),...os(J,Se,u,n)},ne=is(w,L,`${u}-item-title`,`${u}-text-tight-leading`),ue=is(U,te,`${u}-item-subtitle`,`${u}-text-tight-leading`),q=os(w,L,u,n),D=os(U,te,u,n),se=is(J,Se,`${u}-lightbox-counter`,`${u}-text-tight-leading`),Y=A.buildColorVars(u,{titleColor:z,subtitleColor:C,lightboxCounterColor:I},sv,lv),Ie=`${l&&l!=="default"?`${u}-state-${l}`:""}${ee==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),de=h===0?1/0:h,Z=(t??[]).slice(0,de),Ne=s.useMemo(()=>b==="on"?Jy(Z):[],[Z,b]),Oe=v.entryWidth??.2,Je=(S==null?void 0:S.display)==="cover",De=(S==null?void 0:S.ratioValue)??"1:1",Ze=(S==null?void 0:S.reversed)??!1,[at,Xe]=De.split(":").map(Number),je=`${Ze?Xe:at} / ${Ze?at:Xe}`,Qe=v.columnsCount,Ce=A.scalingValue(Oe??0,n),_e=Ce,Ue=!Je&&$!=="off",Ye=Z.length%Qe||Qe,lt=Ye<Qe&&Z.length>0,it=Z.length-Ye,qe=lt?Math.floor((Qe-Ye)/2)+1:1,Ee=M?A.scalingValue(M,n):void 0,pt={width:_e,...Je?{aspectRatio:je,height:"auto",overflow:"hidden"}:{height:"auto"},...Ee?{borderRadius:Ee,overflow:"hidden"}:{}},ke=`${u}-item-image-wrapper${Ue?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),We=p==="d"||p==="e"||p==="f",Ve=oe==="on",ct=`calc(${A.scalingValue(Oe??0,n)} * (${x} / 100))`,ot=A.scalingValue(Oe*x/100,n),xt=Je?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Ee?{borderRadius:Ee}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Ee?{borderRadius:Ee}:{}},[Pt,Vt]=s.useState(0),vt=s.useRef(null),Mt=B==="fade"||X==="horizontal"?"ltr":X==="vertical"?"ttb":"ltr";s.useEffect(()=>{const mt=vt.current;if(!mt)return;const gt=new ResizeObserver(Re=>{Vt(Math.round(Re[0].contentRect.width))});return gt.observe(mt),()=>gt.disconnect()},[]);const Ht=(()=>{const mt={...Y},gt=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return gt&&(mt["--cntrl-article-width"]=gt),mt})(),[Gt,kt]=s.useState(!1),[Pe,Be]=s.useState([]),[ft,$t]=s.useState(0),et=b==="on"&&(!n||i),Et=(mt,gt)=>{n&&!i||b!=="off"&&(Be(mt),$t(gt),kt(!0))};s.useEffect(()=>{if(!Gt||b!=="on"||typeof document>"u")return;const mt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=mt}},[Gt,b]),s.useEffect(()=>{!n||i||kt(!1)},[n,i]);const Xt=s.useMemo(()=>jy(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Xt}}),b==="on"&&a.jsx(ev,{mediaList:Ne}),a.jsx("div",{style:Y,children:a.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${Ve?` ${u}-align-entries`:""} ${u}-image-align-${re} ${Ie}`.trim(),style:{gridTemplateColumns:`repeat(${Qe}, ${Ce})`,rowGap:Ve?0:A.scalingValue(m??0,n),columnGap:A.scalingValue(v.horizontalGap??0,n),width:A.scalingValue(v.wrapperWidth??0,n),...Ve?{[`--${u}-align-entries-row-gap`]:A.scalingValue(m??0,n)}:{}},children:Z.map((mt,gt)=>{var Wt;const Re=Lc(mt.title),tt=Lc(mt.subtitle),nt=(((Wt=mt.link)==null?void 0:Wt.length)??0)>0&&b==="off"?mt.link:void 0,st=Math.floor(gt/Qe)===Math.ceil(Z.length/Qe)-1,At=lt&>>=it?`${qe+(gt-it)}`:void 0,St=We?a.jsxs("div",{className:`${u}-item-text-block`,children:[Re&&a.jsx("p",{className:ne,style:{width:ct,...Ae,...q},children:mt.title}),Re&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:A.scalingValue(O??0,n),width:ot}}),tt&&a.jsx("p",{className:ue,style:{width:ct,...xe,...D},children:mt.subtitle}),tt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:A.scalingValue(N??0,n),width:ot}})]}):null,ht=Ve?a.jsxs("div",{className:`${u}-item-title-row`,children:[!We&&a.jsx("div",{"data-controls":o&&Re?"titleMarginTop":void 0,className:o&&Re?`${u}-control`:void 0,style:{height:Re?A.scalingValue(O??0,n):0,width:ot}}),Re&&a.jsx("p",{className:ne,style:{width:ct,...Ae,...q},children:mt.title}),We&&Re&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:A.scalingValue(O??0,n),width:ot}})]}):null,Dt=Ve?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!We&&a.jsx("div",{"data-controls":o&&tt?"subtitleMarginTop":void 0,className:o&&tt?`${u}-control`:void 0,style:{height:tt?A.scalingValue(N??0,n):0,width:ot}}),tt&&a.jsx("p",{className:ue,style:{width:ct,...xe,...D},children:mt.subtitle}),We&&tt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:A.scalingValue(N??0,n),width:ot}})]}):null,Ct=nt?a.jsxs("a",{href:nt,target:"_blank",className:`${u}-item-text-link`,children:[ht,Dt]}):a.jsxs(a.Fragment,{children:[ht,Dt]}),qt=tp(mt.gallery),jt=qt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),Nt=a.jsx("div",{className:ke,style:pt,children:qt.length===0?null:$==="off"?(()=>{const{displayMedia:wt,lightboxMedia:W}=qt[0],Te=W?jt.findIndex(ze=>ze.assetId===W.assetId):-1;return a.jsx(Pc,{media:wt,className:`${u}-item-${Yi(wt)?"video":"image"}`.trim(),style:xt,onMediaClick:et&&Te>=0?()=>Et(jt,Te):void 0})})():a.jsxs(a.Fragment,{children:[Ue&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:qt.map(({displayMedia:wt})=>Yi(wt)?a.jsx("video",{src:wt.assetId,muted:!0,playsInline:!0},`sizer-${wt.assetId}`):a.jsx("img",{src:wt.assetId,alt:""},`sizer-${wt.assetId}`))}),a.jsx(El,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:R*1e3,width:"100%",height:"100%",speed:qy,type:B==="fade"?"fade":"loop",rewind:B==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:Mt},onMoved:wt=>{X!=="random"||B==="fade"||Xy(wt)},children:qt.map(({displayMedia:wt,lightboxMedia:W},Te)=>{const ze=W?jt.findIndex(Fe=>Fe.assetId===W.assetId):-1;return a.jsx(kl,{children:a.jsx(Pc,{media:wt,className:`${u}-item-${Yi(wt)?"video":"image"}`.trim(),style:xt,onMediaClick:et&&ze>=0?()=>Et(jt,ze):void 0})},Te)})},`${B}-${Oe}-${X}-${R}-${Pt}-${c}`)]})}),Bt=We?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Re?"titleMarginTop":void 0,className:o&&Re?`${u}-control`:void 0,style:{height:Re?A.scalingValue(O??0,n):0,width:ot}}),a.jsx("p",{className:ne,style:{width:ct,...Ae,...q},children:mt.title}),a.jsx("div",{"data-controls":o&&tt?"subtitleMarginTop":void 0,className:o&&tt?`${u}-control`:void 0,style:{height:tt?A.scalingValue(N??0,n):0,width:ot}}),a.jsx("p",{className:ue,style:{width:ct,...xe,...D},children:mt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:At&&!Ve?{gridColumn:At}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Ve&&st?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(x??0)>100?`calc(${Ce} * (${x} / 100))`:Ce,...At&&Ve?{gridColumn:At}:{}},children:Ve?a.jsx(a.Fragment,{children:We?a.jsxs(a.Fragment,{children:[Ct,a.jsx("a",{href:nt,target:"_blank",className:`${u}-item-image-link`,children:Nt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:nt,target:"_blank",className:`${u}-item-image-link`,children:Nt}),Ct]})}):nt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:nt,target:"_blank",className:`${u}-item-image-link`,children:[St,Nt]}),!We&&a.jsx("a",{href:nt,target:"_blank",className:`${u}-item-text-link`,children:Bt})]}):a.jsxs(a.Fragment,{children:[St,Nt,Bt]})})},gt)})})}),(!n||i)&&Gt&&typeof document<"u"&&b==="on"&&(()=>{const mt=(d?document.getElementById(d):null)??document.body;return Un.createPortal(a.jsx("div",{style:Ht,"data-selection":"none",children:a.jsx(ov,{prefix:u,items:Pe,index:ft,imageDisplay:rv(y),isEditor:n,onClose:()=>kt(!1),onPrev:()=>$t(gt=>(gt-1+Pe.length)%Pe.length),onNext:()=>$t(gt=>(gt+1)%Pe.length),counterClassName:se,counterStyle:Q})}),mt)})()]})}const sv={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},lv=["hover","focus","filled","success","error"],cv=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5258
5258
|
import '@splidejs/react-splide/css/core';
|
|
5259
5259
|
import { CommonComponentProps } from '../props';
|
|
5260
5260
|
import {
|
|
@@ -7307,12 +7307,12 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
7307
7307
|
};
|
|
7308
7308
|
|
|
7309
7309
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
7310
|
-
`,rs={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ov=["titleColor","subtitleColor","lightboxCounterColor"],rv={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XESYN1HRYH9VRTZ5CK",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XERA3G7J0J00XVKEXX",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XEZCK8SJPAFXCKG8QN",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XES6MX14JTT1CF24BB",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XEMGJWCYNPZ3ETQTKM",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...rs.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:{...rs.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:{...rs.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,imageCorners:0,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...ov],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},av={element:ev,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.assetId",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:rv,sourceCode:iv},sv=50,Mc=10,Al="cntrl-lightbox-journal",Da=Al,Gs=`${Al}-`,Ba=e=>`${Al}-${e}`,Fl=e=>e===Da||e.startsWith(Gs),Ec=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},kc=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Ec(t.get(Ba(e)));if(i)return i}const n=Ec(t.get(Da));if(n)return n;for(const[i]of t){if(!i.startsWith(Gs))continue;const o=i.slice(Gs.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Ac=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Ku=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Fl(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Ba(t),String(e)):i.searchParams.set(Da,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},lv=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Ba(e)||i===Da:Fl(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)}},Qu=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Ba(e)):[...t.keys()].some(n=>Fl(n))},cv=(e,t)=>{if(Qu(t)){if(e){window.history.back();return}lv(t)}},dv=20,uv=2,as=e=>`max(${e}, ${dv}px)`,Io=e=>((e==null?void 0:e.image)??[]).slice(0,uv),Zu=e=>e.reduce((t,n)=>t+Io(n).length,0),pv=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Io(r).length,1),i=Io(e[t]).length;return{start:n,end:n+i-1}},gv=(e,t)=>{const n=Zu(e),{start:i,end:o}=pv(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},pa=(e,t)=>t==="B"?e.flatMap((n,i)=>Io(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Io(n)})),mv=(e,t,n,i)=>{var r;if(n==="B")return`${t+1} / ${e.length}`;const o=((r=e[t])==null?void 0:r.entryIndex)??0;return gv(i,o)},Fc=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",hv=(e,t,n)=>e==="B"?t.length>1:Zu(n)>1,Ln=.004,ni=.004,bo={title1Width:.13,title2Width:.13,title3Width:.14},wi=(e,t,n,i,o)=>{const r=[];return t.title1&&r.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&r.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&r.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),r},Lo=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},c)=>{if(r<=0||c<=0)return{overflow:r,widths:[c,...l]};const d=Math.min(r,c);return{overflow:r-d,widths:[c-d,...l]}},{overflow:i-1,widths:[]});return o},vr=(e,t)=>Lo(e,t),yn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},$i=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Lo(e.length,n),effective:vr(e.length,n)}},Ju=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),ep=(e,t,n,i)=>e.slice(0,i+1).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),Li=["title1","title2","title3","count"],bt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Nl={title1:"1",title2:"2",title3:"3",count:"Count"},_l=e=>[bt(e,"fontFamily"),bt(e,"fontSettings"),{type:"row",items:[bt(e,"fontSize"),bt(e,"lineHeight"),bt(e,"letterSpacing"),bt(e,"wordSpacing")]},bt(e,"textAlign"),bt(e,"textAppearance")],fv=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Li.map(e=>[Nl[e],_l(e)]))}),yv={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},vv={title1:.02,title2:.02,title3:.02,count:.017},Bi=(e,t)=>{const n=i=>{const o=bt(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[yv[t]]}},zi=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??vv[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return en(i,n)};function tp({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:c,title2Width:d,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:y=0,title3MarginLeft:v=0,titleRowMarginBottom:g=0,titleHeaderLayout:m="desktop",contentMarginTop:x=0,iconMarginRight:b=0,closeIcon:M=null,closeIconMaxWidth:f=0,closeIconColor:S="#000000",closeIconHoverColor:W="#cccccc"}=n,q=F.scalingValue(x,i),z=F.scalingValue(Math.max(x,ni),i),L=F.scalingValue(b,i),_=F.scalingValue(g,i),G=m==="mobile",$=zi("title1",Bi(n,"title1"),i),I=zi("title2",Bi(n,"title2"),i),D=zi("title3",Bi(n,"title3"),i),E=s.useMemo(()=>({title1Width:c??bo.title1Width,title2Width:d??bo.title2Width,title3Width:u??bo.title3Width}),[c,d,u]),T=s.useMemo(()=>({title2MarginLeft:y,title3MarginLeft:v}),[y,v]),C=s.useMemo(()=>wi(e,t,$,I,D),[e,t,$,I,D]),V=s.useMemo(()=>C.map(X=>E[X.widthKey]),[C,E]),w=s.useMemo(()=>Lo(C.length,V),[C.length,V]),U=s.useMemo(()=>vr(C.length,V),[C.length,V]),P=s.useMemo(()=>C.filter(X=>X.prefix==="title1"),[C]),A=s.useMemo(()=>C.filter(X=>X.prefix==="title2"||X.prefix==="title3"),[C]),j=s.useMemo(()=>$i(P,E),[P,E]),ie=s.useMemo(()=>$i(A,E),[A,E]),ae=!!(t.title1||t.title2||t.title3),O=M!==null;if(!(ae||O))return null;const N=(p??0)>0||o,le=(X,Pe)=>{const Se=C.findIndex(He=>He.prefix===X.prefix);if(!G||Pe==="single-row")return{effectiveWidth:U[Se]??0,resolvedWidth:w[Se]??0,maxWidth:yn(Se,w)};if(Pe==="two-row-top"){const He=P.findIndex(We=>We.prefix===X.prefix);return{effectiveWidth:j.effective[He]??0,resolvedWidth:j.resolved[He]??0,maxWidth:yn(He,j.resolved)}}const Z=A.findIndex(He=>He.prefix===X.prefix);return{effectiveWidth:ie.effective[Z]??0,resolvedWidth:ie.resolved[Z]??0,maxWidth:yn(Z,ie.resolved)}},J=(X,Pe,Se)=>{if(!G||Se==="single-row"){const qe=X.findIndex(ve=>ve.prefix===Pe.prefix),tt=X.map(ve=>E[ve.widthKey]),et=Lo(X.length,tt);return{effectiveWidth:vr(X.length,tt)[qe]??0,resolvedWidth:et[qe]??0,maxWidth:yn(qe,et)}}if(Se==="two-row-top"){const qe=X.filter(ve=>ve.prefix==="title1"),tt=qe.findIndex(ve=>ve.prefix===Pe.prefix),{resolved:et,effective:Ge}=$i(qe,E);return{effectiveWidth:Ge[tt]??0,resolvedWidth:et[tt]??0,maxWidth:yn(tt,et)}}const Z=X.filter(qe=>qe.prefix==="title2"||qe.prefix==="title3"),He=Z.findIndex(qe=>qe.prefix===Pe.prefix),{resolved:We,effective:ot}=$i(Z,E);return{effectiveWidth:ot[He]??0,resolvedWidth:We[He]??0,maxWidth:yn(He,We)}},be=X=>ep(C,w,T,X)+(G?0:p??0),Le=()=>G?0:p??0,ye=X=>A.slice(0,X).reduce((Pe,Se,Z)=>Pe+(Se.marginLeftKey?T[Se.marginLeftKey]??0:0)+(ie.resolved[Z]??0),0),ce=X=>{const Pe=A[X];return ye(X)+(Pe.marginLeftKey?T[Pe.marginLeftKey]??0:0)+(ie.resolved[X]??0)},K=(X,Pe,Se)=>{const Z=X.marginLeftKey?T[X.marginLeftKey]??0:0,{effectiveWidth:He,resolvedWidth:We,maxWidth:ot}=Se??le(X,Pe),qe=Math.max(Z,ni),tt=o&&Pe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":X.prefix,style:{width:F.scalingValue(He,i),...Z>0?{marginLeft:F.scalingValue(Z,i)}:{}},children:[a.jsx("p",{className:X.className,style:X.style,children:X.text}),tt&&X.marginLeftKey?a.jsx("div",{"data-controls":X.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(We),style:{position:"absolute",top:0,left:F.scalingValue(-Z,i),width:F.scalingValue(qe,i),height:"100%",pointerEvents:"auto"}}):null,tt?a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ot),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:F.scalingValue(-Ln/2,i),width:F.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}}):null]},X.className)},se=(X="two-row")=>{const Pe=C.findIndex(He=>He.prefix==="title1"),Se=Pe>=0?w[Pe]:E.title1Width,Z=X==="two-row"&&o;return a.jsx("div",{...Z?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Se)}:{},style:{width:F.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...Z?{pointerEvents:"auto"}:{}}})},pe=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:$,"aria-hidden":"true",children:" "}),fe=X=>{const Pe=wi(e,X,$,I,D);return a.jsx(a.Fragment,{children:Pe.map(Se=>K(Se,"single-row",J(Pe,Se,"single-row")))})},we=X=>{const Pe=wi(e,X,$,I,D),Se=Pe.find(Z=>Z.prefix==="title1");return Se?K(Se,"two-row-top",J(Pe,Se,"two-row-top")):null},Re=(X,Pe=!1)=>{const Se=wi(e,X,$,I,D),Z=Se.filter(ot=>ot.prefix==="title2"||ot.prefix==="title3"),He=o&&Pe;return Z.length>0||He||(g??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[Z.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:Z.map(ot=>K(ot,"two-row-bottom",J(Se,ot,"two-row-bottom")))}),Pe&&o?a.jsxs(a.Fragment,{children:[ue(),B()]}):null]}):null,(g??0)>0||He?a.jsx("div",{"data-controls":He?"titleRowMarginBottom":void 0,"data-controls-axis":He?"y":void 0,"data-controls-reverse":He?"":void 0,className:He?`${e}-control`:void 0,style:{height:_,width:"100%",flexShrink:0,pointerEvents:He?"auto":"none"}}):null]}):null},me=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(f??0,i),height:F.scalingValue(f??0,i),marginRight:L,"--close-icon-hover-color":W},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:X=>{X.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(gn,{url:M??"",fill:S,hoverFill:i&&!r?S:W,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:L,height:"100%",pointerEvents:"auto"}})]}),xe=()=>O?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:me()}):null,Ce=X=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:X})}),h=X=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[O||ae?pe():null,N?se("two-row"):null,Ce(X),xe()]}),Y=(X,Pe=!1)=>a.jsxs(a.Fragment,{children:[h(we(X)),Re(X,Pe)]}),Q=()=>{const X=G?-1:C.findIndex(Z=>Z.prefix==="title1"),Pe=!G&&(o||(p??0)>0)?(()=>{const Z=p??0,He=X>=0?w[X]:E.title1Width,We=Math.max(Z,ni);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:0,width:F.scalingValue(We,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Se=C.flatMap((Z,He)=>{if(!Z.marginLeftKey)return[];const We=T[Z.marginLeftKey]??0,ot=Ju(C,w,T,He)+Le(),qe=Math.max(We,ni);return a.jsx("div",{"data-controls":Z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(w[He]),style:{position:"absolute",top:0,left:F.scalingValue(ot,i),width:F.scalingValue(qe,i),height:"100%",pointerEvents:"auto"}},Z.marginLeftKey)});return Pe?[Pe,...Se]:Se},ne=()=>C.map((X,Pe)=>{const Se=yn(Pe,w),He=be(Pe)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Se),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:F.scalingValue(He,i),width:F.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}})},`${X.widthKey}-junction`)}),ue=()=>A.flatMap((X,Pe)=>{if(!X.marginLeftKey)return[];const Se=T[X.marginLeftKey]??0,Z=ye(Pe),He=Math.max(Se,ni),{resolvedWidth:We}=le(X,"two-row-bottom");return a.jsx("div",{"data-controls":X.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(We),style:{position:"absolute",top:0,left:F.scalingValue(Z,i),width:F.scalingValue(He,i),height:"100%",pointerEvents:"auto"}},X.marginLeftKey)}),B=()=>A.map((X,Pe)=>{const{maxWidth:Se}=le(X,"two-row-bottom"),He=ce(Pe)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Se),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:F.scalingValue(He,i),width:F.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}})},`${X.widthKey}-junction`)}),R=()=>!o||G?null:a.jsxs(a.Fragment,{children:[Q(),ne()]}),ee=!!(t.title2||t.title3||(g??0)>0||o),te=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[O||ae?pe():null,N?se("single-row"):null,ae?Ce(fe(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),xe(),R()]}),ge=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ee?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:ee?void 0:{flex:"0 0 auto",height:"auto"},children:Y(t,!0)}),R()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:q,flexShrink:0},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:z,pointerEvents:"auto"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...G?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${G?` ${e}-lightbox-content-area-stacked`:""}`,children:a.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?ge():te()})})})]})}function xv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function bv(e){return`
|
|
7310
|
+
`,rs={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},dv=["titleColor","subtitleColor","lightboxCounterColor"],uv={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XESYN1HRYH9VRTZ5CK",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XERA3G7J0J00XVKEXX",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XEZCK8SJPAFXCKG8QN",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XES6MX14JTT1CF24BB",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{assetId:"01M3QM74XEMGJWCYNPZ3ETQTKM",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...rs.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:{...rs.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:{...rs.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,imageCorners:0,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...dv],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},pv={element:av,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.assetId",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:uv,sourceCode:cv},mv=50,Mc=10,Al="cntrl-lightbox-journal",Da=Al,Vs=`${Al}-`,Ba=e=>`${Al}-${e}`,Fl=e=>e===Da||e.startsWith(Vs),Ec=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},kc=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Ec(t.get(Ba(e)));if(i)return i}const n=Ec(t.get(Da));if(n)return n;for(const[i]of t){if(!i.startsWith(Vs))continue;const o=i.slice(Vs.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Ac=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},np=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Fl(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Ba(t),String(e)):i.searchParams.set(Da,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},gv=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Ba(e)||i===Da:Fl(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)}},ip=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Ba(e)):[...t.keys()].some(n=>Fl(n))},hv=(e,t)=>{if(ip(t)){if(e){window.history.back();return}gv(t)}},fv=20,yv=2,as=e=>`max(${e}, ${fv}px)`,Po=e=>((e==null?void 0:e.image)??[]).slice(0,yv),op=e=>e.reduce((t,n)=>t+Po(n).length,0),vv=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Po(r).length,1),i=Po(e[t]).length;return{start:n,end:n+i-1}},xv=(e,t)=>{const n=op(e),{start:i,end:o}=vv(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},pa=(e,t)=>t==="B"?e.flatMap((n,i)=>Po(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Po(n)})),bv=(e,t,n,i)=>{var r;if(n==="B")return`${t+1} / ${e.length}`;const o=((r=e[t])==null?void 0:r.entryIndex)??0;return xv(i,o)},Fc=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Sv=(e,t,n)=>e==="B"?t.length>1:op(n)>1,Pn=.004,ii=.004,wo={title1Width:.13,title2Width:.13,title3Width:.14},Ti=(e,t,n,i,o)=>{const r=[];return t.title1&&r.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&r.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&r.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),r},Ro=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},c)=>{if(r<=0||c<=0)return{overflow:r,widths:[c,...l]};const d=Math.min(r,c);return{overflow:r-d,widths:[c-d,...l]}},{overflow:i-1,widths:[]});return o},vr=(e,t)=>Ro(e,t),yn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Ii=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ro(e.length,n),effective:vr(e.length,n)}},rp=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),ap=(e,t,n,i)=>e.slice(0,i+1).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),Mi=["title1","title2","title3","count"],bt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Nl={title1:"1",title2:"2",title3:"3",count:"Count"},_l=e=>[bt(e,"fontFamily"),bt(e,"fontSettings"),{type:"row",items:[bt(e,"fontSize"),bt(e,"lineHeight"),bt(e,"letterSpacing"),bt(e,"wordSpacing")]},bt(e,"textAlign"),bt(e,"textAppearance")],wv=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Mi.map(e=>[Nl[e],_l(e)]))}),$v={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Cv={title1:.02,title2:.02,title3:.02,count:.017},Vi=(e,t)=>{const n=i=>{const o=bt(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[$v[t]]}},Gi=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Cv[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return nn(i,n)};function sp({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:c,title2Width:d,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:v=0,title3MarginLeft:x=0,titleRowMarginBottom:m=0,titleHeaderLayout:h="desktop",contentMarginTop:b=0,iconMarginRight:S=0,closeIcon:M=null,closeIconMaxWidth:y=0,closeIconColor:$="#000000",closeIconHoverColor:R="#cccccc"}=n,X=A.scalingValue(b,i),B=A.scalingValue(Math.max(b,ii),i),O=A.scalingValue(S,i),N=A.scalingValue(m,i),z=h==="mobile",C=Gi("title1",Vi(n,"title1"),i),I=Gi("title2",Vi(n,"title2"),i),j=Gi("title3",Vi(n,"title3"),i),E=s.useMemo(()=>({title1Width:c??wo.title1Width,title2Width:d??wo.title2Width,title3Width:u??wo.title3Width}),[c,d,u]),w=s.useMemo(()=>({title2MarginLeft:v,title3MarginLeft:x}),[v,x]),L=s.useMemo(()=>Ti(e,t,C,I,j),[e,t,C,I,j]),V=s.useMemo(()=>L.map(H=>E[H.widthKey]),[L,E]),_=s.useMemo(()=>Ro(L.length,V),[L.length,V]),K=s.useMemo(()=>vr(L.length,V),[L.length,V]),P=s.useMemo(()=>L.filter(H=>H.prefix==="title1"),[L]),f=s.useMemo(()=>L.filter(H=>H.prefix==="title2"||H.prefix==="title3"),[L]),U=s.useMemo(()=>Ii(P,E),[P,E]),te=s.useMemo(()=>Ii(f,E),[f,E]),ce=!!(t.title1||t.title2||t.title3),F=M!==null;if(!(ce||F))return null;const T=(p??0)>0||o,le=(H,Ie)=>{const de=L.findIndex(Ne=>Ne.prefix===H.prefix);if(!z||Ie==="single-row")return{effectiveWidth:K[de]??0,resolvedWidth:_[de]??0,maxWidth:yn(de,_)};if(Ie==="two-row-top"){const Ne=P.findIndex(Oe=>Oe.prefix===H.prefix);return{effectiveWidth:U.effective[Ne]??0,resolvedWidth:U.resolved[Ne]??0,maxWidth:yn(Ne,U.resolved)}}const Z=f.findIndex(Ne=>Ne.prefix===H.prefix);return{effectiveWidth:te.effective[Z]??0,resolvedWidth:te.resolved[Z]??0,maxWidth:yn(Z,te.resolved)}},J=(H,Ie,de)=>{if(!z||de==="single-row"){const De=H.findIndex(be=>be.prefix===Ie.prefix),Ze=H.map(be=>E[be.widthKey]),at=Ro(H.length,Ze);return{effectiveWidth:vr(H.length,Ze)[De]??0,resolvedWidth:at[De]??0,maxWidth:yn(De,at)}}if(de==="two-row-top"){const De=H.filter(be=>be.prefix==="title1"),Ze=De.findIndex(be=>be.prefix===Ie.prefix),{resolved:at,effective:Xe}=Ii(De,E);return{effectiveWidth:Xe[Ze]??0,resolvedWidth:at[Ze]??0,maxWidth:yn(Ze,at)}}const Z=H.filter(De=>De.prefix==="title2"||De.prefix==="title3"),Ne=Z.findIndex(De=>De.prefix===Ie.prefix),{resolved:Oe,effective:Je}=Ii(Z,E);return{effectiveWidth:Je[Ne]??0,resolvedWidth:Oe[Ne]??0,maxWidth:yn(Ne,Oe)}},Se=H=>ap(L,_,w,H)+(z?0:p??0),Le=()=>z?0:p??0,me=H=>f.slice(0,H).reduce((Ie,de,Z)=>Ie+(de.marginLeftKey?w[de.marginLeftKey]??0:0)+(te.resolved[Z]??0),0),ye=H=>{const Ie=f[H];return me(H)+(Ie.marginLeftKey?w[Ie.marginLeftKey]??0:0)+(te.resolved[H]??0)},ee=(H,Ie,de)=>{const Z=H.marginLeftKey?w[H.marginLeftKey]??0:0,{effectiveWidth:Ne,resolvedWidth:Oe,maxWidth:Je}=de??le(H,Ie),De=Math.max(Z,ii),Ze=o&&Ie==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":H.prefix,style:{width:A.scalingValue(Ne,i),...Z>0?{marginLeft:A.scalingValue(Z,i)}:{}},children:[a.jsx("p",{className:H.className,style:H.style,children:H.text}),Ze&&H.marginLeftKey?a.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Oe),style:{position:"absolute",top:0,left:A.scalingValue(-Z,i),width:A.scalingValue(De,i),height:"100%",pointerEvents:"auto"}}):null,Ze?a.jsx("div",{"data-controls":H.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:A.scalingValue(-Pn/2,i),width:A.scalingValue(Pn,i),height:"100%",pointerEvents:"auto"}}):null]},H.className)},oe=(H="two-row")=>{const Ie=L.findIndex(Ne=>Ne.prefix==="title1"),de=Ie>=0?_[Ie]:E.title1Width,Z=H==="two-row"&&o;return a.jsx("div",{...Z?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(de)}:{},style:{width:A.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...Z?{pointerEvents:"auto"}:{}}})},re=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:C,"aria-hidden":"true",children:" "}),ge=H=>{const Ie=Ti(e,H,C,I,j);return a.jsx(a.Fragment,{children:Ie.map(de=>ee(de,"single-row",J(Ie,de,"single-row")))})},we=H=>{const Ie=Ti(e,H,C,I,j),de=Ie.find(Z=>Z.prefix==="title1");return de?ee(de,"two-row-top",J(Ie,de,"two-row-top")):null},Ae=(H,Ie=!1)=>{const de=Ti(e,H,C,I,j),Z=de.filter(Je=>Je.prefix==="title2"||Je.prefix==="title3"),Ne=o&&Ie;return Z.length>0||Ne||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[Z.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:Z.map(Je=>ee(Je,"two-row-bottom",J(de,Je,"two-row-bottom")))}),Ie&&o?a.jsxs(a.Fragment,{children:[ue(),q()]}):null]}):null,(m??0)>0||Ne?a.jsx("div",{"data-controls":Ne?"titleRowMarginBottom":void 0,"data-controls-axis":Ne?"y":void 0,"data-controls-reverse":Ne?"":void 0,className:Ne?`${e}-control`:void 0,style:{height:N,width:"100%",flexShrink:0,pointerEvents:Ne?"auto":"none"}}):null]}):null},fe=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:A.scalingValue(y??0,i),height:A.scalingValue(y??0,i),marginRight:O,"--close-icon-hover-color":R},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:H=>{H.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(gn,{url:M??"",fill:$,hoverFill:i&&!r?$:R,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:O,height:"100%",pointerEvents:"auto"}})]}),ve=()=>F?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:fe()}):null,xe=H=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:H})}),g=H=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[F||ce?re():null,T?oe("two-row"):null,xe(H),ve()]}),G=(H,Ie=!1)=>a.jsxs(a.Fragment,{children:[g(we(H)),Ae(H,Ie)]}),Q=()=>{const H=z?-1:L.findIndex(Z=>Z.prefix==="title1"),Ie=!z&&(o||(p??0)>0)?(()=>{const Z=p??0,Ne=H>=0?_[H]:E.title1Width,Oe=Math.max(Z,ii);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:0,width:A.scalingValue(Oe,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,de=L.flatMap((Z,Ne)=>{if(!Z.marginLeftKey)return[];const Oe=w[Z.marginLeftKey]??0,Je=rp(L,_,w,Ne)+Le(),De=Math.max(Oe,ii);return a.jsx("div",{"data-controls":Z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(_[Ne]),style:{position:"absolute",top:0,left:A.scalingValue(Je,i),width:A.scalingValue(De,i),height:"100%",pointerEvents:"auto"}},Z.marginLeftKey)});return Ie?[Ie,...de]:de},ne=()=>L.map((H,Ie)=>{const de=yn(Ie,_),Ne=Se(Ie)-Pn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":H.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(de),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:A.scalingValue(Ne,i),width:A.scalingValue(Pn,i),height:"100%",pointerEvents:"auto"}})},`${H.widthKey}-junction`)}),ue=()=>f.flatMap((H,Ie)=>{if(!H.marginLeftKey)return[];const de=w[H.marginLeftKey]??0,Z=me(Ie),Ne=Math.max(de,ii),{resolvedWidth:Oe}=le(H,"two-row-bottom");return a.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Oe),style:{position:"absolute",top:0,left:A.scalingValue(Z,i),width:A.scalingValue(Ne,i),height:"100%",pointerEvents:"auto"}},H.marginLeftKey)}),q=()=>f.map((H,Ie)=>{const{maxWidth:de}=le(H,"two-row-bottom"),Ne=ye(Ie)-Pn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":H.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(de),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:A.scalingValue(Ne,i),width:A.scalingValue(Pn,i),height:"100%",pointerEvents:"auto"}})},`${H.widthKey}-junction`)}),D=()=>!o||z?null:a.jsxs(a.Fragment,{children:[Q(),ne()]}),se=!!(t.title2||t.title3||(m??0)>0||o),Y=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[F||ce?re():null,T?oe("single-row"):null,ce?xe(ge(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ve(),D()]}),pe=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...se?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:se?void 0:{flex:"0 0 auto",height:"auto"},children:G(t,!0)}),D()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:X,flexShrink:0},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:B,pointerEvents:"auto"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...z?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${z?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${z?` ${e}-text-bar-cell-stacked`:""}`,style:z?void 0:{flex:1,minWidth:0,width:"100%"},children:z?pe():Y()})})})]})}function Tv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Iv(e){return`
|
|
7311
7311
|
.${e}-wrapper {
|
|
7312
7312
|
display: grid;
|
|
7313
7313
|
align-items: start;
|
|
7314
7314
|
justify-content: center;
|
|
7315
|
-
min-height: ${
|
|
7315
|
+
min-height: ${Tv(48)};
|
|
7316
7316
|
}
|
|
7317
7317
|
.${e}-item {
|
|
7318
7318
|
display: flex;
|
|
@@ -7627,7 +7627,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7627
7627
|
pointer-events: auto;
|
|
7628
7628
|
flex-shrink: 0;
|
|
7629
7629
|
}
|
|
7630
|
-
`}const Nc={assetId:"",name:"",objectFit:"cover"},Hn=500,qo=650,wn="cubic-bezier(0.22, 1, 0.36, 1)",Sv=72,wv=50,$v=1e4,Cv=650,Tv=500;function Iv(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function np(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Sa(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 Lv(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?np(i,n):null}function Pv(e){return e.reduce((t,n,i)=>{const o=Hl(n.gallery),l=Wl(o).filter(c=>c.lightboxMedia).map(c=>c.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function ir(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 _c(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ir(e,i,n)}const Rv=.03;function ip(e){return e.width*Rv}const ss={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function zr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Hc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Mv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Xs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function Ev(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Xs(e,t.width,t.height)}function kv(e,t){if(Bo(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.assetId,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.assetId,n.naturalWidth,n.naturalHeight)},n.src=e.assetId}function Av(e){const t=new Set,n=[];for(const i of e){const o=Hl(i.gallery),r=Wl(o);for(const l of r)for(const c of[l.displayMedia,l.lightboxMedia])c!=null&&c.assetId&&!t.has(c.assetId)&&(t.add(c.assetId),n.push(c))}return n}function Fv({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Bo(t)?a.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):a.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function Po(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=ip(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function wa(e,t,n){const i=Po(e,t,n);return{...i,left:2*i.left-e.left}}function Nv(e,t,n){const{left:i,width:o}=n,r=ip(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function op(e,t,n,i){const o=Po(e,"left",i),r=Po(e,"right",i),l=wa(e,"left",i),c=wa(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:c,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function _v(e,t,n,i){const{start:o,end:r}=op(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Hv(e,t,n){const i=Po(e,t,n),o=wa(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function rp(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 Hl(e){if(!e)return;if(rp(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.assetId?t:void 0,o=n!=null&&n.assetId?n:void 0;if(!(!i&&!o))return[{media:[o??i??Nc,i??o??Nc]}]}function Wv(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function Ov(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function Wl(e){if(!Array.isArray(e)||e.length===0)return[];if(rp(e)){const t=[];for(const n of e){const i=Wv(n);if(!i)continue;const o=Ov(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.assetId?o:null})}return t}return e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Bo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function Dv({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Bo(e)?a.jsx("video",{src:e.assetId,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}):a.jsx("img",{src:e.assetId,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Bv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function jr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Bo(e)?a.jsx("video",{src:e.assetId,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.assetId,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.assetId,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function zv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:v,resolveCloseSourceRect:g,onClose:m,onPrev:x,onNext:b}){const M=s.useRef(null),f=s.useRef(null),S=s.useRef(null),W=s.useRef(new Map),[q,z]=s.useState(0),L=s.useRef(null),_=s.useRef(0),G=s.useRef(0),$=s.useRef("none"),I=s.useRef(!1),D=s.useRef(!1),E=s.useRef(!1),T=s.useRef(null),C=s.useRef(null),V=s.useRef(null),w=s.useRef(()=>{}),U=s.useRef(null),P=s.useRef(null),A=s.useRef(null),j=s.useRef(!1),[ie,ae]=s.useState(null),[O,re]=s.useState(ss),[N,le]=s.useState(0),[J,be]=s.useState("opening"),[Le,ye]=s.useState(0),[ce,K]=s.useState(0),[se,pe]=s.useState(!1),[fe,we]=s.useState(null),[Re,me]=s.useState(null),[xe,Ce]=s.useState(null),[h,Y]=s.useState(!1),[Q,ne]=s.useState(null),[ue,B]=s.useState(!1),R=s.useRef(!1),[ee,te]=s.useState(!1),[ge,X]=s.useState(!1),Pe=s.useRef(n),Se=s.useRef(void 0),Z=t[n],He=Z?Bo(Z):!1,We=ce!==0||se,ot=!l&&(!r||!!c),qe=d&&!l,tt=u.length>1,et=s.useCallback((H,Ie)=>t.length<=1?null:t[(H+Ie+t.length)%t.length]??null,[t]),Ge=tt?ir(u,p,-1):et(n,-1),ve=tt?ir(u,p,1):et(n,1),_e=fe===-1&&We?tt&&Re!==null?ir(u,Re,-1):xe!==null?et(xe,-1):null:null,ze=fe===1&&We?tt&&Re!==null?ir(u,Re,1):xe!==null?et(xe,1):null:null,Qe=_e&&_e.assetId!==(Ge==null?void 0:Ge.assetId)?_e:null,$e=ze&&ze.assetId!==(ve==null?void 0:ve.assetId)?ze:null,Ne=Ge&&qe?(()=>{const H=tt?_c(u,p,-1):t.length>2?et((n-1+t.length)%t.length,-1):null;return H&&H.assetId!==Ge.assetId?H:null})():null,Ye=ve&&qe?(()=>{const H=tt?_c(u,p,1):t.length>2?et((n+1)%t.length,1):null;return H&&H.assetId!==ve.assetId?H:null})():null,Ze=Qe??Ne,st=$e??Ye,it=s.useCallback((H,Ie,je)=>{if(!H||!Ie||!je)return;const Fe=W.current,ft=Fe.get(H);(ft==null?void 0:ft.width)===Ie&&(ft==null?void 0:ft.height)===je||(Fe.set(H,{width:Ie,height:je}),z(Ht=>Ht+1))},[]),Oe=s.useCallback(H=>{if(!(H!=null&&H.assetId))return null;const Ie=W.current.get(H.assetId);return Ev(f.current,Ie)},[q,N]),Ae=s.useCallback(()=>{if(!Z)return;const H=Oe(Z);if(H){ae(H);return}const Ie=f.current;Ie&&ae(Hc(Ie))},[Z,Oe]),mt=s.useCallback(H=>{if(tt){const Ie=u.length;me((p+H+Ie)%Ie),Ce(null);return}t.length>1&&(Ce((n+H+t.length)%t.length),me(null))},[tt,u.length,p,t.length,n]),Be=s.useCallback(H=>{E.current=H,pe(H)},[]),De=s.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),Ue=s.useCallback(()=>{De(),T.current=window.setTimeout(()=>{De(),Be(!1)},qo+32)},[De,Be]),ct=s.useCallback(()=>{const H=M.current;if(!H){re({left:0,top:0,width:typeof window<"u"?window.innerWidth:ss.width,height:typeof window<"u"?window.innerHeight:ss.height});return}const Ie=H.getBoundingClientRect();re({left:Ie.left,top:Ie.top,width:Ie.width,height:Ie.height})},[]),he=s.useCallback((H,Ie)=>{if(We){if(ee&&!se)return`translate(${ce}px, 0px)`;if(se&&fe!==null){const je=Oe(H);if(!je)return;const{x:Fe,y:ft}=_v(je,Ie,fe,O);return`translate(${Fe}px, ${ft}px)`}if(se)return"translate(0px, 0px)"}},[We,ee,se,ce,fe,O,Oe]),Me=s.useCallback(()=>{const H=C.current;C.current=null,De(),Be(!1),we(null),me(null),Ce(null),K(0),te(!1),I.current=!1,G.current=0,$.current="none",H===-1?x():H===1&&b()},[De,Be,x,b]),nt=s.useCallback(()=>{De(),T.current=window.setTimeout(()=>{C.current!==null&&Me()},qo+32)},[De,Me]),pt=s.useCallback(()=>{De(),C.current=null,Be(!1),we(null),me(null),Ce(null),K(0),te(!1),I.current=!1,G.current=0,$.current="none"},[De,Be]),Ve=s.useCallback(H=>{if(!(!qe||!ie)){if(E.current){if(C.current===H){V.current=H,Me();return}pt()}De(),mt(H),C.current=H,we(H),Be(!0),nt()}},[qe,ie,Me,pt,De,mt,Be,nt]);w.current=Ve;const vt=s.useCallback(()=>{U.current=null,j.current=!1,P.current!==null&&(window.clearInterval(P.current),P.current=null),A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),Pt=s.useCallback(H=>{P.current!==null&&window.clearInterval(P.current);const Ie=j.current?Tv:Cv;P.current=window.setInterval(()=>{w.current(H)},Ie)},[]),At=s.useCallback(H=>{U.current!==H&&(vt(),U.current=H,j.current=!1,w.current(H),Pt(H),A.current=window.setTimeout(()=>{A.current=null,U.current===H&&(j.current=!0,Pt(H))},$v))},[vt,Pt]),wt=s.useCallback(()=>{const H=f.current;if(!H)return;const Ie=Z==null?void 0:Z.assetId,je=Ie?W.current.get(Ie):void 0;if(je!=null&&je.width&&(je!=null&&je.height)){ae(Xs(H,je.width,je.height));return}const Fe=S.current;if(Fe&&Ie&&(Fe.src===Ie||Fe.currentSrc===Ie)){const{width:Ht,height:gt}=Mv(Fe);if(Ht&>){it(Ie,Ht,gt),ae(Xs(H,Ht,gt));return}}const ft=Hc(H);!ft.width||!ft.height||ae(ft)},[Z==null?void 0:Z.assetId,it]),Vt=s.useCallback(H=>{if(S.current=H,!!H){if(H instanceof HTMLVideoElement){H.readyState>=1&&H.videoWidth>0&&wt();return}H.complete&&H.naturalWidth>0&&wt()}},[wt]),jt=s.useCallback(()=>{ct(),wt(),le(H=>H+1)},[ct,wt]);s.useEffect(()=>{jt();const H=f.current,Ie=M.current,je=new ResizeObserver(()=>jt());return H&&je.observe(H),Ie&&je.observe(Ie),window.addEventListener("resize",jt),()=>{je.disconnect(),window.removeEventListener("resize",jt)}},[jt,n,y]),s.useLayoutEffect(()=>{if(!Z)return;const H=S.current;if(H){if(H instanceof HTMLImageElement&&H.complete&&H.naturalWidth>0){wt();return}H instanceof HTMLVideoElement&&H.readyState>=1&&H.videoWidth>0&&wt()}},[Z==null?void 0:Z.assetId,n,wt]),s.useEffect(()=>{Ae()},[Ae,q]),s.useEffect(()=>{const H=new Set,Ie=[],je=Fe=>{!(Fe!=null&&Fe.assetId)||H.has(Fe.assetId)||(H.add(Fe.assetId),Ie.push(Fe))};t.forEach(je),u.forEach(Fe=>Fe.items.forEach(je)),Ie.forEach(Fe=>{W.current.has(Fe.assetId)||kv(Fe,it)})},[t,u,it]),s.useEffect(()=>{if(J!=="opening"||!ie)return;if(!v){be("open");return}Y(!1);const H=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Y(!0),be("open")})});return()=>cancelAnimationFrame(H)},[J,ie,v]),s.useEffect(()=>{if(J!=="closing")return;const H=setTimeout(()=>m(),Hn);return()=>clearTimeout(H)},[J,m]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{Pe.current===n&&Se.current===(Z==null?void 0:Z.assetId)||(De(),C.current=null,we(null),me(null),Ce(null),ye(0),K(0),Be(!1),X(!1),te(!1),_.current=0,G.current=0,$.current="none",I.current=!1,L.current=null,D.current=!1,S.current=null,Ae(),Pe.current=n,Se.current=Z==null?void 0:Z.assetId)},[n,Z==null?void 0:Z.assetId,Be,De,Ae]),s.useLayoutEffect(()=>{const H=V.current;H!==null&&(V.current=null,requestAnimationFrame(()=>{w.current(H)}))},[n,p,Z==null?void 0:Z.assetId]),s.useLayoutEffect(()=>{if(J==="opening"){R.current=!1,B(!1);return}if(J!=="open"||R.current)return;if(!Ge&&!ve){R.current=!0;return}B(!1);const H=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),R.current=!0})});return()=>cancelAnimationFrame(H)},[J,Ge==null?void 0:Ge.assetId,ve==null?void 0:ve.assetId]),s.useEffect(()=>{if(J!=="open")return;const H=()=>{const gt=It=>{It.stopPropagation(),It.preventDefault(),document.removeEventListener("click",gt,!0)};document.addEventListener("click",gt,!0)},Ie=gt=>{const It=gt<0?1:-1;De(),mt(It),C.current=It,we(It),Be(!0),nt()},je=gt=>{if(Math.abs(gt)>wv&&qe){Ie(gt);return}C.current=null,we(null),me(null),Ce(null),Be(!0),K(0),Ue()},Fe=gt=>{if(gt.touches.length!==1||E.current)return;const It=gt.touches[0];D.current=!0,L.current={x:It.clientX,y:It.clientY},$.current="none",G.current=0,I.current=!1},ft=gt=>{if(!L.current||gt.touches.length!==1||E.current)return;const It=gt.touches[0],qt=It.clientX-L.current.x,Dt=It.clientY-L.current.y;if($.current==="none"){if(Math.abs(qt)<10&&Math.abs(Dt)<10)return;if(Math.abs(qt)>Math.abs(Dt)){if(!qe)return;$.current="horizontal"}else if(Dt>0){if(!ot)return;$.current="vertical"}else return}if($.current==="horizontal"){I.current=!0,te(!0),G.current=qt,K(qt),gt.preventDefault();return}$.current==="vertical"&&(I.current=!0,te(!0),_.current=Dt,ye(Dt),gt.preventDefault())},Ht=()=>{if(!L.current)return;const gt=$.current,It=I.current;if(It&>==="horizontal")je(G.current),H();else if(It&>==="vertical"){const qt=_.current;if(ot&&qt>Sv){const Dt=window.innerHeight;_.current=Dt,X(!0),ye(Dt),be("closing")}else _.current=0,ye(0);H()}else gt==="horizontal"&&Math.abs(G.current)>0&&(je(G.current),H());L.current=null,$.current="none",G.current=0,I.current=!1,te(!1)};return document.addEventListener("touchstart",Fe,{passive:!0}),document.addEventListener("touchmove",ft,{passive:!1}),document.addEventListener("touchend",Ht),document.addEventListener("touchcancel",Ht),()=>{document.removeEventListener("touchstart",Fe),document.removeEventListener("touchmove",ft),document.removeEventListener("touchend",Ht),document.removeEventListener("touchcancel",Ht)}},[J,qe,Be,Ue,De,ot,nt,mt]);const Yt=s.useCallback(()=>{const H=(g==null?void 0:g())??v??null;H&&ie&&(ne(H),Y(!0)),be("closing")},[g,v,ie]);s.useEffect(()=>{const H=Fe=>{if(Fe.key==="Escape"){if(r&&c||J==="closing")return;vt(),Yt();return}if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight"||J!=="open"||!qe)return;Fe.preventDefault();const ft=Fe.key==="ArrowLeft"?-1:1;Fe.repeat&&U.current===ft||At(ft)},Ie=Fe=>{if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight")return;const ft=Fe.key==="ArrowLeft"?-1:1;U.current===ft&&vt()},je=()=>{vt()};return window.addEventListener("keydown",H),window.addEventListener("keyup",Ie),window.addEventListener("blur",je),()=>{window.removeEventListener("keydown",H),window.removeEventListener("keyup",Ie),window.removeEventListener("blur",je),vt()}},[J,r,c,Yt,qe,At,vt]),s.useEffect(()=>{J!=="open"&&vt()},[J,vt]);const Kt=()=>{J==="closing"||l||Yt()},Rt=J==="open",zt=J==="closing",on=Le>0?Math.max(0,1-Le/500):1,xt=Le>0?Math.max(.35,1-Le/500):1,yt=s.useCallback(H=>{if(!(H.propertyName!=="transform"||!E.current)){if(C.current!==null){Me();return}De(),Be(!1)}},[De,Be,Me]),ke=J==="closing"?Q??v:v,Je=ke&&ie&&(J==="opening"||zt)?Iv(ke,ie):void 0,rt=We&&Z?he(Z,"center"):Le>0?`translateY(${Le}px)`:Je,dt=ie?zr(ie,O):null,Lt=!!(ke&&ie),St=Lt&&(J==="closing"||J==="open"&&h),ht={position:"absolute",top:dt==null?void 0:dt.top,left:dt==null?void 0:dt.left,width:dt==null?void 0:dt.width,height:dt==null?void 0:dt.height,objectFit:"contain",transformOrigin:"top left",transform:rt,opacity:Le>0?xt:Lt?1:J==="opening"||zt?0:1,transition:ee&&!se?"none":se?`transform ${qo}ms ${wn}`:ge?`transform ${Hn}ms ${wn}, opacity ${Hn}ms ${wn}`:St?`transform ${Hn}ms ${wn}`:J==="opening"||zt?`opacity ${Hn}ms ${wn}`:"none",pointerEvents:He&&Rt&&!We?"auto":"none",touchAction:He&&Rt?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},Wt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Rt&&!We?"auto":"none"},Tt=(H,Ie,je="adjacent")=>{const Fe=Oe(H);if(!Fe)return{display:"none"};const ft=je==="far"?Ie==="left"?"far-left":"far-right":Ie==="left"?"left-adjacent":"right-adjacent",{start:Ht}=fe!==null?op(Fe,ft,fe,O):{start:je==="far"?wa(Fe,Ie,O):Po(Fe,Ie,O)},gt=zr(Ht,O),It=he(H,ft),qt=!We&&je==="adjacent"&&Rt&&!ue?Hv(Fe,Ie,O):null,Dt=je==="far"&&We&&fe===(Ie==="left"?-1:1),an=ee&&!se?!1:se,cn=je==="adjacent"&&Rt&&ue&&!We;return{position:"absolute",top:gt.top,left:gt.left,width:gt.width,height:gt.height,objectFit:"contain",transform:It??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:je==="far"?Rt&&Dt?1:0:Rt?1:0,transition:an?je==="far"?`transform ${qo}ms ${wn}`:`transform ${qo}ms ${wn}, opacity ${Hn}ms ${wn}`:cn?`transform ${Hn}ms ${wn}`:J==="opening"||zt?`opacity ${Hn}ms ${wn}`:"none",pointerEvents:"none",zIndex:1}},Ot=(H,Ie)=>{const je=Oe(H);return je?Nv(Po(je,Ie,O),Ie,O):null},Gt=H=>Ie=>{if(!l){if(D.current){D.current=!1;return}Ie.stopPropagation(),Ve(H)}},kt=Ge?Ot(Ge,"left"):null,_t=ve?Ot(ve,"right"):null,Ft=kt?zr(kt,O):null,ut=_t?zr(_t,O):null;return a.jsxs("div",{ref:M,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:Kt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Rt?on:0,transition:ee?"none":`opacity ${Hn}ms ${wn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:f,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Rt?1:0,transition:ee?"none":`opacity ${Hn}ms ${wn}`,pointerEvents:"none"},children:a.jsx(tp,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Kt})})]}),Rt&&Ze&&a.jsx(jr,{media:Ze,style:Tt(Ze,"left","far"),onMeasure:it,onTransitionEnd:yt},`far-prev-${Ze.assetId}`),Rt&&Ge&&a.jsxs(a.Fragment,{children:[a.jsx(jr,{media:Ge,style:Tt(Ge,"left"),onMeasure:it,onTransitionEnd:yt},`prev-${Ge.assetId}`),Ft&&a.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:l||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Rt&&ve&&a.jsxs(a.Fragment,{children:[a.jsx(jr,{media:ve,style:Tt(ve,"right"),onMeasure:it,onTransitionEnd:yt},`next-${ve.assetId}`),ut&&a.jsx("div",{style:{position:"absolute",top:ut.top,left:ut.left,width:ut.width,height:ut.height,cursor:l||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Rt&&st&&a.jsx(jr,{media:st,style:Tt(st,"right","far"),onMeasure:it,onTransitionEnd:yt},`far-next-${st.assetId}`),ie&&Z&&(He?a.jsx(Bv,{src:Z.assetId,phase:J,onMediaElement:Vt,wrapperStyle:ht,videoStyle:Wt,onLoadedMetadata:wt,onTransitionEnd:yt},`${n}-${Z.assetId}`):a.jsx("img",{ref:Vt,src:Z.assetId,alt:Z.name,onLoad:wt,onTransitionEnd:yt,style:ht},`${n}-${Z.assetId}`))]})}function jv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=F.useScopedStyles(),{gridLayout:d,verticalGap:u,align:p="top",imageDisplay:y}=e,v=(y==null?void 0:y.display)==="cover",g=(y==null?void 0:y.ratioValue)??"1:1",m=(y==null?void 0:y.reversed)??!1,[x,b]=g.split(":").map(Number),S=`${m?b:x} / ${m?x:b}`,W=d.entryWidth??.2,q=d.columnsCount,z=F.scalingValue(W,n),L=F.scalingValue(d.horizontalGap??0,n),_=z,G=z,$={width:_,...v?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},I=v?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},D=s.useRef(null),[E,T]=s.useState(!1),[C,V]=s.useState([]),[w,U]=s.useState(0),[P,A]=s.useState(0),[j,ie]=s.useState(null),[ae,O]=s.useState({title1:"",title2:"",title3:""}),re=(()=>{const xe={},Ce=D.current?getComputedStyle(D.current).getPropertyValue("--cntrl-article-width").trim():"";return Ce&&(xe["--cntrl-article-width"]=Ce),xe})(),N=!n||i||o,le=s.useMemo(()=>bv(c),[c]),J=t??[],be=J.length%q||q,Le=be<q&&J.length>0,ye=J.length-be,ce=Le?Math.floor((q-be)/2)+1:1,K=s.useMemo(()=>Pv(J),[J]),se=s.useMemo(()=>Av(J),[J]),pe=(xe,Ce,h)=>{if(n&&!o&&!i)return;const Y=K.findIndex(ne=>ne.gridIndex===xe);if(Y<0)return;const Q=K[Y];A(Y),V(Q.items),U(Ce),O(Q.entry),ie(h??null),T(!0)},fe=s.useCallback(()=>{T(!1),ie(null)},[]),we=s.useCallback(()=>{const xe=K[P];return!xe||!D.current?j:Lv(D.current,xe.gridIndex,v?"cover":"contain")??j},[K,P,j,v]),Re=s.useCallback(xe=>{if(K.length>1){const Ce=K.length,h=(P+xe+Ce)%Ce,Y=K[h],Q=Math.min(w,Y.items.length-1);A(h),V(Y.items),U(Q),O(Y.entry);return}U(Ce=>(Ce+xe+C.length)%C.length)},[K,P,w,C.length]),me=K.length>1||C.length>1;return s.useEffect(()=>{if(!E||typeof document>"u")return;const xe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=xe}},[E]),s.useEffect(()=>{!n||o||i||T(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:le}}),a.jsx(Fv,{mediaList:se}),a.jsx("div",{ref:D,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${q}, ${z})`,rowGap:0,columnGap:L,width:F.scalingValue(d.wrapperWidth??0,n),[`--${c}-align-entries-row-gap`]:F.scalingValue(u??0,n)},children:J.map((xe,Ce)=>{const h=Hl(xe.gallery),Y=Wl(h),Q=Y.filter(te=>te.lightboxMedia).map(te=>te.lightboxMedia),ne=Math.floor(Ce/q)===Math.ceil(J.length/q)-1,ue=Le&&Ce>=ye?`${ce+(Ce-ye)}`:void 0,B=Y[0],R=B!=null&&B.lightboxMedia?Q.findIndex(te=>te.assetId===B.lightboxMedia.assetId):-1,ee=a.jsx("div",{className:`${c}-item-image-wrapper`,style:$,children:Y.length>0&&a.jsx(Dv,{media:B.displayMedia,gridIndex:Ce,className:`${c}-item-${Bo(B.displayMedia)?"video":"image"}`.trim(),style:I,onMediaClick:N&&R>=0?te=>pe(Ce,R,np(te.currentTarget,v?"cover":"contain")):void 0})});return a.jsx("div",{className:`${c}-item`,children:a.jsxs("div",{className:[o?`${c}-item-inner`:`${c}-item-inner-hidden`,ne?`${c}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:z,...ue?{gridColumn:ue}:{}},children:[a.jsx("div",{className:`${c}-item-title-row`,children:a.jsx("div",{style:{height:0,width:G}})}),a.jsx("a",{className:`${c}-item-image-link`,children:ee}),a.jsx("div",{className:`${c}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:G}})})]})},Ce)})}),E&&typeof document<"u"&&(()=>{const xe=(l?document.getElementById(l):null)??document.body;return Xn.createPortal(a.jsx("div",{style:re,"data-selection":"none",children:a.jsx(zv,{prefix:c,items:C,index:w,entry:ae,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:me,lightboxEntries:K,entryIdx:P,layoutId:r,sourceRect:j,resolveCloseSourceRect:we,onClose:fe,onPrev:()=>Re(-1),onNext:()=>Re(1)})}),xe)})()]})}const Vv=`import { CommonComponentProps } from '../props';
|
|
7630
|
+
`}const Nc={assetId:"",name:"",objectFit:"cover"},On=500,Uo=650,$n="cubic-bezier(0.22, 1, 0.36, 1)",Lv=72,Pv=50,Rv=1e4,Mv=650,Ev=500;function kv(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function lp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Sa(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 Av(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?lp(i,n):null}function Fv(e){return e.reduce((t,n,i)=>{const o=Hl(n.gallery),l=Wl(o).filter(c=>c.lightboxMedia).map(c=>c.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function ir(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 _c(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ir(e,i,n)}const Nv=.03;function cp(e){return e.width*Nv}const ss={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function zr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Hc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function _v(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Gs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function Hv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Gs(e,t.width,t.height)}function Wv(e,t){if(jo(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.assetId,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.assetId,n.naturalWidth,n.naturalHeight)},n.src=e.assetId}function Ov(e){const t=new Set,n=[];for(const i of e){const o=Hl(i.gallery),r=Wl(o);for(const l of r)for(const c of[l.displayMedia,l.lightboxMedia])c!=null&&c.assetId&&!t.has(c.assetId)&&(t.add(c.assetId),n.push(c))}return n}function Dv({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>jo(t)?a.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):a.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function Mo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=cp(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function wa(e,t,n){const i=Mo(e,t,n);return{...i,left:2*i.left-e.left}}function Bv(e,t,n){const{left:i,width:o}=n,r=cp(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function dp(e,t,n,i){const o=Mo(e,"left",i),r=Mo(e,"right",i),l=wa(e,"left",i),c=wa(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:c,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function zv(e,t,n,i){const{start:o,end:r}=dp(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function jv(e,t,n){const i=Mo(e,t,n),o=wa(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}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 Hl(e){if(!e)return;if(up(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.assetId?t:void 0,o=n!=null&&n.assetId?n:void 0;if(!(!i&&!o))return[{media:[o??i??Nc,i??o??Nc]}]}function Vv(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function Gv(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function Wl(e){if(!Array.isArray(e)||e.length===0)return[];if(up(e)){const t=[];for(const n of e){const i=Vv(n);if(!i)continue;const o=Gv(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.assetId?o:null})}return t}return e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function jo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function Xv({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return jo(e)?a.jsx("video",{src:e.assetId,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}):a.jsx("img",{src:e.assetId,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function qv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function jr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return jo(e)?a.jsx("video",{src:e.assetId,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.assetId,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.assetId,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Uv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:x,resolveCloseSourceRect:m,onClose:h,onPrev:b,onNext:S}){const M=s.useRef(null),y=s.useRef(null),$=s.useRef(null),R=s.useRef(new Map),[X,B]=s.useState(0),O=s.useRef(null),N=s.useRef(0),z=s.useRef(0),C=s.useRef("none"),I=s.useRef(!1),j=s.useRef(!1),E=s.useRef(!1),w=s.useRef(null),L=s.useRef(null),V=s.useRef(null),_=s.useRef(()=>{}),K=s.useRef(null),P=s.useRef(null),f=s.useRef(null),U=s.useRef(!1),[te,ce]=s.useState(null),[F,ie]=s.useState(ss),[T,le]=s.useState(0),[J,Se]=s.useState("opening"),[Le,me]=s.useState(0),[ye,ee]=s.useState(0),[oe,re]=s.useState(!1),[ge,we]=s.useState(null),[Ae,fe]=s.useState(null),[ve,xe]=s.useState(null),[g,G]=s.useState(!1),[Q,ne]=s.useState(null),[ue,q]=s.useState(!1),D=s.useRef(!1),[se,Y]=s.useState(!1),[pe,H]=s.useState(!1),Ie=s.useRef(n),de=s.useRef(void 0),Z=t[n],Ne=Z?jo(Z):!1,Oe=ye!==0||oe,Je=!l&&(!r||!!c),De=d&&!l,Ze=u.length>1,at=s.useCallback((W,Te)=>t.length<=1?null:t[(W+Te+t.length)%t.length]??null,[t]),Xe=Ze?ir(u,p,-1):at(n,-1),be=Ze?ir(u,p,1):at(n,1),He=ge===-1&&Oe?Ze&&Ae!==null?ir(u,Ae,-1):ve!==null?at(ve,-1):null:null,je=ge===1&&Oe?Ze&&Ae!==null?ir(u,Ae,1):ve!==null?at(ve,1):null:null,Qe=He&&He.assetId!==(Xe==null?void 0:Xe.assetId)?He:null,Ce=je&&je.assetId!==(be==null?void 0:be.assetId)?je:null,_e=Xe&&De?(()=>{const W=Ze?_c(u,p,-1):t.length>2?at((n-1+t.length)%t.length,-1):null;return W&&W.assetId!==Xe.assetId?W:null})():null,Ue=be&&De?(()=>{const W=Ze?_c(u,p,1):t.length>2?at((n+1)%t.length,1):null;return W&&W.assetId!==be.assetId?W:null})():null,Ye=Qe??_e,lt=Ce??Ue,it=s.useCallback((W,Te,ze)=>{if(!W||!Te||!ze)return;const Fe=R.current,yt=Fe.get(W);(yt==null?void 0:yt.width)===Te&&(yt==null?void 0:yt.height)===ze||(Fe.set(W,{width:Te,height:ze}),B(Ot=>Ot+1))},[]),qe=s.useCallback(W=>{if(!(W!=null&&W.assetId))return null;const Te=R.current.get(W.assetId);return Hv(y.current,Te)},[X,T]),Ee=s.useCallback(()=>{if(!Z)return;const W=qe(Z);if(W){ce(W);return}const Te=y.current;Te&&ce(Hc(Te))},[Z,qe]),pt=s.useCallback(W=>{if(Ze){const Te=u.length;fe((p+W+Te)%Te),xe(null);return}t.length>1&&(xe((n+W+t.length)%t.length),fe(null))},[Ze,u.length,p,t.length,n]),ke=s.useCallback(W=>{E.current=W,re(W)},[]),We=s.useCallback(()=>{w.current!==null&&(window.clearTimeout(w.current),w.current=null)},[]),Ve=s.useCallback(()=>{We(),w.current=window.setTimeout(()=>{We(),ke(!1)},Uo+32)},[We,ke]),ct=s.useCallback(()=>{const W=M.current;if(!W){ie({left:0,top:0,width:typeof window<"u"?window.innerWidth:ss.width,height:typeof window<"u"?window.innerHeight:ss.height});return}const Te=W.getBoundingClientRect();ie({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),ot=s.useCallback((W,Te)=>{if(Oe){if(se&&!oe)return`translate(${ye}px, 0px)`;if(oe&&ge!==null){const ze=qe(W);if(!ze)return;const{x:Fe,y:yt}=zv(ze,Te,ge,F);return`translate(${Fe}px, ${yt}px)`}if(oe)return"translate(0px, 0px)"}},[Oe,se,oe,ye,ge,F,qe]),xt=s.useCallback(()=>{const W=L.current;L.current=null,We(),ke(!1),we(null),fe(null),xe(null),ee(0),Y(!1),I.current=!1,z.current=0,C.current="none",W===-1?b():W===1&&S()},[We,ke,b,S]),Pt=s.useCallback(()=>{We(),w.current=window.setTimeout(()=>{L.current!==null&&xt()},Uo+32)},[We,xt]),Vt=s.useCallback(()=>{We(),L.current=null,ke(!1),we(null),fe(null),xe(null),ee(0),Y(!1),I.current=!1,z.current=0,C.current="none"},[We,ke]),vt=s.useCallback(W=>{if(!(!De||!te)){if(E.current){if(L.current===W){V.current=W,xt();return}Vt()}We(),pt(W),L.current=W,we(W),ke(!0),Pt()}},[De,te,xt,Vt,We,pt,ke,Pt]);_.current=vt;const Mt=s.useCallback(()=>{K.current=null,U.current=!1,P.current!==null&&(window.clearInterval(P.current),P.current=null),f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]),Ht=s.useCallback(W=>{P.current!==null&&window.clearInterval(P.current);const Te=U.current?Ev:Mv;P.current=window.setInterval(()=>{_.current(W)},Te)},[]),Gt=s.useCallback(W=>{K.current!==W&&(Mt(),K.current=W,U.current=!1,_.current(W),Ht(W),f.current=window.setTimeout(()=>{f.current=null,K.current===W&&(U.current=!0,Ht(W))},Rv))},[Mt,Ht]),kt=s.useCallback(()=>{const W=y.current;if(!W)return;const Te=Z==null?void 0:Z.assetId,ze=Te?R.current.get(Te):void 0;if(ze!=null&&ze.width&&(ze!=null&&ze.height)){ce(Gs(W,ze.width,ze.height));return}const Fe=$.current;if(Fe&&Te&&(Fe.src===Te||Fe.currentSrc===Te)){const{width:Ot,height:ut}=_v(Fe);if(Ot&&ut){it(Te,Ot,ut),ce(Gs(W,Ot,ut));return}}const yt=Hc(W);!yt.width||!yt.height||ce(yt)},[Z==null?void 0:Z.assetId,it]),Pe=s.useCallback(W=>{if($.current=W,!!W){if(W instanceof HTMLVideoElement){W.readyState>=1&&W.videoWidth>0&&kt();return}W.complete&&W.naturalWidth>0&&kt()}},[kt]),Be=s.useCallback(()=>{ct(),kt(),le(W=>W+1)},[ct,kt]);s.useEffect(()=>{Be();const W=y.current,Te=M.current,ze=new ResizeObserver(()=>Be());return W&&ze.observe(W),Te&&ze.observe(Te),window.addEventListener("resize",Be),()=>{ze.disconnect(),window.removeEventListener("resize",Be)}},[Be,n,v]),s.useLayoutEffect(()=>{if(!Z)return;const W=$.current;if(W){if(W instanceof HTMLImageElement&&W.complete&&W.naturalWidth>0){kt();return}W instanceof HTMLVideoElement&&W.readyState>=1&&W.videoWidth>0&&kt()}},[Z==null?void 0:Z.assetId,n,kt]),s.useEffect(()=>{Ee()},[Ee,X]),s.useEffect(()=>{const W=new Set,Te=[],ze=Fe=>{!(Fe!=null&&Fe.assetId)||W.has(Fe.assetId)||(W.add(Fe.assetId),Te.push(Fe))};t.forEach(ze),u.forEach(Fe=>Fe.items.forEach(ze)),Te.forEach(Fe=>{R.current.has(Fe.assetId)||Wv(Fe,it)})},[t,u,it]),s.useEffect(()=>{if(J!=="opening"||!te)return;if(!x){Se("open");return}G(!1);const W=requestAnimationFrame(()=>{requestAnimationFrame(()=>{G(!0),Se("open")})});return()=>cancelAnimationFrame(W)},[J,te,x]),s.useEffect(()=>{if(J!=="closing")return;const W=setTimeout(()=>h(),On);return()=>clearTimeout(W)},[J,h]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{Ie.current===n&&de.current===(Z==null?void 0:Z.assetId)||(We(),L.current=null,we(null),fe(null),xe(null),me(0),ee(0),ke(!1),H(!1),Y(!1),N.current=0,z.current=0,C.current="none",I.current=!1,O.current=null,j.current=!1,$.current=null,Ee(),Ie.current=n,de.current=Z==null?void 0:Z.assetId)},[n,Z==null?void 0:Z.assetId,ke,We,Ee]),s.useLayoutEffect(()=>{const W=V.current;W!==null&&(V.current=null,requestAnimationFrame(()=>{_.current(W)}))},[n,p,Z==null?void 0:Z.assetId]),s.useLayoutEffect(()=>{if(J==="opening"){D.current=!1,q(!1);return}if(J!=="open"||D.current)return;if(!Xe&&!be){D.current=!0;return}q(!1);const W=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),D.current=!0})});return()=>cancelAnimationFrame(W)},[J,Xe==null?void 0:Xe.assetId,be==null?void 0:be.assetId]),s.useEffect(()=>{if(J!=="open")return;const W=()=>{const ut=Tt=>{Tt.stopPropagation(),Tt.preventDefault(),document.removeEventListener("click",ut,!0)};document.addEventListener("click",ut,!0)},Te=ut=>{const Tt=ut<0?1:-1;We(),pt(Tt),L.current=Tt,we(Tt),ke(!0),Pt()},ze=ut=>{if(Math.abs(ut)>Pv&&De){Te(ut);return}L.current=null,we(null),fe(null),xe(null),ke(!0),ee(0),Ve()},Fe=ut=>{if(ut.touches.length!==1||E.current)return;const Tt=ut.touches[0];j.current=!0,O.current={x:Tt.clientX,y:Tt.clientY},C.current="none",z.current=0,I.current=!1},yt=ut=>{if(!O.current||ut.touches.length!==1||E.current)return;const Tt=ut.touches[0],Yt=Tt.clientX-O.current.x,It=Tt.clientY-O.current.y;if(C.current==="none"){if(Math.abs(Yt)<10&&Math.abs(It)<10)return;if(Math.abs(Yt)>Math.abs(It)){if(!De)return;C.current="horizontal"}else if(It>0){if(!Je)return;C.current="vertical"}else return}if(C.current==="horizontal"){I.current=!0,Y(!0),z.current=Yt,ee(Yt),ut.preventDefault();return}C.current==="vertical"&&(I.current=!0,Y(!0),N.current=It,me(It),ut.preventDefault())},Ot=()=>{if(!O.current)return;const ut=C.current,Tt=I.current;if(Tt&&ut==="horizontal")ze(z.current),W();else if(Tt&&ut==="vertical"){const Yt=N.current;if(Je&&Yt>Lv){const It=window.innerHeight;N.current=It,H(!0),me(It),Se("closing")}else N.current=0,me(0);W()}else ut==="horizontal"&&Math.abs(z.current)>0&&(ze(z.current),W());O.current=null,C.current="none",z.current=0,I.current=!1,Y(!1)};return document.addEventListener("touchstart",Fe,{passive:!0}),document.addEventListener("touchmove",yt,{passive:!1}),document.addEventListener("touchend",Ot),document.addEventListener("touchcancel",Ot),()=>{document.removeEventListener("touchstart",Fe),document.removeEventListener("touchmove",yt),document.removeEventListener("touchend",Ot),document.removeEventListener("touchcancel",Ot)}},[J,De,ke,Ve,We,Je,Pt,pt]);const ft=s.useCallback(()=>{const W=(m==null?void 0:m())??x??null;W&&te&&(ne(W),G(!0)),Se("closing")},[m,x,te]);s.useEffect(()=>{const W=Fe=>{if(Fe.key==="Escape"){if(r&&c||J==="closing")return;Mt(),ft();return}if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight"||J!=="open"||!De)return;Fe.preventDefault();const yt=Fe.key==="ArrowLeft"?-1:1;Fe.repeat&&K.current===yt||Gt(yt)},Te=Fe=>{if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight")return;const yt=Fe.key==="ArrowLeft"?-1:1;K.current===yt&&Mt()},ze=()=>{Mt()};return window.addEventListener("keydown",W),window.addEventListener("keyup",Te),window.addEventListener("blur",ze),()=>{window.removeEventListener("keydown",W),window.removeEventListener("keyup",Te),window.removeEventListener("blur",ze),Mt()}},[J,r,c,ft,De,Gt,Mt]),s.useEffect(()=>{J!=="open"&&Mt()},[J,Mt]);const $t=()=>{J==="closing"||l||ft()},et=J==="open",Et=J==="closing",Xt=Le>0?Math.max(0,1-Le/500):1,mt=Le>0?Math.max(.35,1-Le/500):1,gt=s.useCallback(W=>{if(!(W.propertyName!=="transform"||!E.current)){if(L.current!==null){xt();return}We(),ke(!1)}},[We,ke,xt]),Re=J==="closing"?Q??x:x,tt=Re&&te&&(J==="opening"||Et)?kv(Re,te):void 0,nt=Oe&&Z?ot(Z,"center"):Le>0?`translateY(${Le}px)`:tt,st=te?zr(te,F):null,At=!!(Re&&te),St=At&&(J==="closing"||J==="open"&&g),ht={position:"absolute",top:st==null?void 0:st.top,left:st==null?void 0:st.left,width:st==null?void 0:st.width,height:st==null?void 0:st.height,objectFit:"contain",transformOrigin:"top left",transform:nt,opacity:Le>0?mt:At?1:J==="opening"||Et?0:1,transition:se&&!oe?"none":oe?`transform ${Uo}ms ${$n}`:pe?`transform ${On}ms ${$n}, opacity ${On}ms ${$n}`:St?`transform ${On}ms ${$n}`:J==="opening"||Et?`opacity ${On}ms ${$n}`:"none",pointerEvents:Ne&&et&&!Oe?"auto":"none",touchAction:Ne&&et?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},Dt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:et&&!Oe?"auto":"none"},Ct=(W,Te,ze="adjacent")=>{const Fe=qe(W);if(!Fe)return{display:"none"};const yt=ze==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:Ot}=ge!==null?dp(Fe,yt,ge,F):{start:ze==="far"?wa(Fe,Te,F):Mo(Fe,Te,F)},ut=zr(Ot,F),Tt=ot(W,yt),Yt=!Oe&&ze==="adjacent"&&et&&!ue?jv(Fe,Te,F):null,It=ze==="far"&&Oe&&ge===(Te==="left"?-1:1),Zt=se&&!oe?!1:oe,on=ze==="adjacent"&&et&&ue&&!Oe;return{position:"absolute",top:ut.top,left:ut.left,width:ut.width,height:ut.height,objectFit:"contain",transform:Tt??(Yt?`translate(${Yt.x}px, ${Yt.y}px)`:void 0),opacity:ze==="far"?et&&It?1:0:et?1:0,transition:Zt?ze==="far"?`transform ${Uo}ms ${$n}`:`transform ${Uo}ms ${$n}, opacity ${On}ms ${$n}`:on?`transform ${On}ms ${$n}`:J==="opening"||Et?`opacity ${On}ms ${$n}`:"none",pointerEvents:"none",zIndex:1}},qt=(W,Te)=>{const ze=qe(W);return ze?Bv(Mo(ze,Te,F),Te,F):null},jt=W=>Te=>{if(!l){if(j.current){j.current=!1;return}Te.stopPropagation(),vt(W)}},Nt=Xe?qt(Xe,"left"):null,Bt=be?qt(be,"right"):null,Wt=Nt?zr(Nt,F):null,wt=Bt?zr(Bt,F):null;return a.jsxs("div",{ref:M,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:$t,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:et?Xt:0,transition:se?"none":`opacity ${On}ms ${$n}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:et?1:0,transition:se?"none":`opacity ${On}ms ${$n}`,pointerEvents:"none"},children:a.jsx(sp,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:$t})})]}),et&&Ye&&a.jsx(jr,{media:Ye,style:Ct(Ye,"left","far"),onMeasure:it,onTransitionEnd:gt},`far-prev-${Ye.assetId}`),et&&Xe&&a.jsxs(a.Fragment,{children:[a.jsx(jr,{media:Xe,style:Ct(Xe,"left"),onMeasure:it,onTransitionEnd:gt},`prev-${Xe.assetId}`),Wt&&a.jsx("div",{style:{position:"absolute",top:Wt.top,left:Wt.left,width:Wt.width,height:Wt.height,cursor:l||se?"default":"pointer",pointerEvents:l||se?"none":"auto",zIndex:3},onClick:jt(-1)})]}),et&&be&&a.jsxs(a.Fragment,{children:[a.jsx(jr,{media:be,style:Ct(be,"right"),onMeasure:it,onTransitionEnd:gt},`next-${be.assetId}`),wt&&a.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||se?"default":"pointer",pointerEvents:l||se?"none":"auto",zIndex:3},onClick:jt(1)})]}),et&<&&a.jsx(jr,{media:lt,style:Ct(lt,"right","far"),onMeasure:it,onTransitionEnd:gt},`far-next-${lt.assetId}`),te&&Z&&(Ne?a.jsx(qv,{src:Z.assetId,phase:J,onMediaElement:Pe,wrapperStyle:ht,videoStyle:Dt,onLoadedMetadata:kt,onTransitionEnd:gt},`${n}-${Z.assetId}`):a.jsx("img",{ref:Pe,src:Z.assetId,alt:Z.name,onLoad:kt,onTransitionEnd:gt,style:ht},`${n}-${Z.assetId}`))]})}function Yv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=A.useScopedStyles(),{gridLayout:d,verticalGap:u,align:p="top",imageDisplay:v}=e,x=(v==null?void 0:v.display)==="cover",m=(v==null?void 0:v.ratioValue)??"1:1",h=(v==null?void 0:v.reversed)??!1,[b,S]=m.split(":").map(Number),$=`${h?S:b} / ${h?b:S}`,R=d.entryWidth??.2,X=d.columnsCount,B=A.scalingValue(R,n),O=A.scalingValue(d.horizontalGap??0,n),N=B,z=B,C={width:N,...x?{aspectRatio:$,height:"auto",overflow:"hidden"}:{height:"auto"}},I=x?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},j=s.useRef(null),[E,w]=s.useState(!1),[L,V]=s.useState([]),[_,K]=s.useState(0),[P,f]=s.useState(0),[U,te]=s.useState(null),[ce,F]=s.useState({title1:"",title2:"",title3:""}),ie=(()=>{const ve={},xe=j.current?getComputedStyle(j.current).getPropertyValue("--cntrl-article-width").trim():"";return xe&&(ve["--cntrl-article-width"]=xe),ve})(),T=!n||i||o,le=s.useMemo(()=>Iv(c),[c]),J=t??[],Se=J.length%X||X,Le=Se<X&&J.length>0,me=J.length-Se,ye=Le?Math.floor((X-Se)/2)+1:1,ee=s.useMemo(()=>Fv(J),[J]),oe=s.useMemo(()=>Ov(J),[J]),re=(ve,xe,g)=>{if(n&&!o&&!i)return;const G=ee.findIndex(ne=>ne.gridIndex===ve);if(G<0)return;const Q=ee[G];f(G),V(Q.items),K(xe),F(Q.entry),te(g??null),w(!0)},ge=s.useCallback(()=>{w(!1),te(null)},[]),we=s.useCallback(()=>{const ve=ee[P];return!ve||!j.current?U:Av(j.current,ve.gridIndex,x?"cover":"contain")??U},[ee,P,U,x]),Ae=s.useCallback(ve=>{if(ee.length>1){const xe=ee.length,g=(P+ve+xe)%xe,G=ee[g],Q=Math.min(_,G.items.length-1);f(g),V(G.items),K(Q),F(G.entry);return}K(xe=>(xe+ve+L.length)%L.length)},[ee,P,_,L.length]),fe=ee.length>1||L.length>1;return s.useEffect(()=>{if(!E||typeof document>"u")return;const ve=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ve}},[E]),s.useEffect(()=>{!n||o||i||w(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:le}}),a.jsx(Dv,{mediaList:oe}),a.jsx("div",{ref:j,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${X}, ${B})`,rowGap:0,columnGap:O,width:A.scalingValue(d.wrapperWidth??0,n),[`--${c}-align-entries-row-gap`]:A.scalingValue(u??0,n)},children:J.map((ve,xe)=>{const g=Hl(ve.gallery),G=Wl(g),Q=G.filter(Y=>Y.lightboxMedia).map(Y=>Y.lightboxMedia),ne=Math.floor(xe/X)===Math.ceil(J.length/X)-1,ue=Le&&xe>=me?`${ye+(xe-me)}`:void 0,q=G[0],D=q!=null&&q.lightboxMedia?Q.findIndex(Y=>Y.assetId===q.lightboxMedia.assetId):-1,se=a.jsx("div",{className:`${c}-item-image-wrapper`,style:C,children:G.length>0&&a.jsx(Xv,{media:q.displayMedia,gridIndex:xe,className:`${c}-item-${jo(q.displayMedia)?"video":"image"}`.trim(),style:I,onMediaClick:T&&D>=0?Y=>re(xe,D,lp(Y.currentTarget,x?"cover":"contain")):void 0})});return a.jsx("div",{className:`${c}-item`,children:a.jsxs("div",{className:[o?`${c}-item-inner`:`${c}-item-inner-hidden`,ne?`${c}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:B,...ue?{gridColumn:ue}:{}},children:[a.jsx("div",{className:`${c}-item-title-row`,children:a.jsx("div",{style:{height:0,width:z}})}),a.jsx("a",{className:`${c}-item-image-link`,children:se}),a.jsx("div",{className:`${c}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:z}})})]})},xe)})}),E&&typeof document<"u"&&(()=>{const ve=(l?document.getElementById(l):null)??document.body;return Un.createPortal(a.jsx("div",{style:ie,"data-selection":"none",children:a.jsx(Uv,{prefix:c,items:L,index:_,entry:ce,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:fe,lightboxEntries:ee,entryIdx:P,layoutId:r,sourceRect:U,resolveCloseSourceRect:we,onClose:ge,onPrev:()=>Ae(-1),onNext:()=>Ae(1)})}),ve)})()]})}const Kv=`import { CommonComponentProps } from '../props';
|
|
7631
7631
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7632
7632
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7633
7633
|
import { createPortal } from 'react-dom';
|
|
@@ -9970,7 +9970,7 @@ export function Hive({
|
|
|
9970
9970
|
</>
|
|
9971
9971
|
);
|
|
9972
9972
|
}
|
|
9973
|
-
`,Gv="01M3SBP3P8CMVMM1ZZ0QVD2PPF",Fi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Xv(e){const t={};return t[bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSettings")]={...Fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSize")]={...Fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[bt(e,"lineHeight")]={...Fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[bt(e,"letterSpacing")]={...Fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[bt(e,"wordSpacing")]={...Fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[bt(e,"textAlign")]={...Fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[bt(e,"textAppearance")]={...Fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ro=Li.filter(e=>e!=="count"),Uv=Ro.reduce((e,t)=>({...e,...Xv(t)}),{}),qv=Ro.reduce((e,t)=>({...e,[bt(t,"fontFamily")]:"Arial",[bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[bt(t,"letterSpacing")]:0,[bt(t,"wordSpacing")]:0,[bt(t,"textAlign")]:"left",[bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ls(e){return Ro.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[bt(n,"fontSize")]=i),o!==void 0&&(t[bt(n,"lineHeight")]=o),t},{})}const Yv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ro.map(e=>[Nl[e],_l(e)]))},Kv={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},Qv=["01M3QM74XEQE7FN1WYJN6H984H","01M3QM74XFXCSMJJ8TNR0RXSWV","01M3QM74XFQ6K4CJ0QYC7BT7VP","01M3QM74XFK2K9T3SPCZD8M7RT","01M3QM74XFV4J15XRFB85877RE","01M3QM74XFB8Q39K12G4G6CZDM","01M3QM74XFWVH9HND47HYNCBZB","01M3QM74XF3MFEKEA4E0W9F9ZQ","01M3QM74XFEQY4XMN22Q9ERGKX","01M3QM74XFWP1RY8ND8QX88J2V","01M3QM74XFD41TXQ5BQ2KFJBGQ","01M3QM74XFV8973P7WXXWJP3QK","01M3QM74XF67PD2N10JYF9409X","01M3QM74XFA5B75WMTTKRN9TM7","01M3QM74XFFQRBHCQGKWPGSAGE","01M3QM74XF1HQBTRANGVX0QVGK","01M3QM74XF8ZWGSVCX3KS5YXSC","01M3QM74XFPHGV2XFZ23ADCVFC","01M3QM74XFECQG799S95G63BDJ","01M3QM74XFW1XS568WAHG3BGN1","01M3QM74XFT1RRJ3N1JJKPK5EA","01M3QM74XFB2JQ62RPFSM145GN","01M3QM74XFH61QR5PACJS04Z5K","01M3QM74XFKD44BXHRA7SSMD7N"],Zv=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Kv,gallery:[{media:[{assetId:Qv[t-1],name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}]});return e})(),Jv={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",max:1,display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:Zv},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"}},...Uv},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Gv,closeIconColor:"#000000",closeIconHoverColor:"#999999",...qv},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...ls({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...ls({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...ls({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:[Yv]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},e0={element:jv,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.assetId",placeholderEnabled:!0}],parameters:[{path:"closeIcon"}]},fontSettingsPaths:{content:[],parameters:[...Ro.map(e=>({path:`${bt(e,"fontFamily")}`}))]},fontRelations:{...Ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${bt(t,"fontFamily")}`}),{})},schema:Jv,sourceCode:Vv};function t0(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.assetId)}function n0({media:e,className:t,style:n}){const i=s.useRef(null);return s.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.assetId]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.assetId,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.assetId,alt:"",style:n})}function cs(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function i0(e){return String(e??"").trim().length>0}function Wc(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 Oc(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 Dc(e,t,n,i,o,r,l){const c=F.scalingValue(r,l),d=F.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?c:d,borderBottomWidth:!p||i?c:d}}function o0(e,t,n){const i=F.scalingValue(t,n),o=F.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Bc=10,zc=10,Yo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function r0(e,t,n){return Math.max(t,Math.min(n,e))}function ds(e,t,n){return e+(t-e)*n}function a0(e,t,n,i){if(!t)return{x:0,y:0};const o=t.getBoundingClientRect(),r=o.top+o.height/2;if(e==="cursor"&&n)return{x:n.clientX+Bc,y:n.clientY+Bc};switch(e){case"left":return{x:o.left+zc+i/2,y:r};case"center":return{x:o.left+o.width/2,y:r};case"right":return{x:o.right-zc-i/2,y:r};default:return{x:o.left+o.width/2,y:r}}}function s0(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const g=n.current,m=i.current;g&&(g.style.transform=`translate3d(${m.x}px, ${m.y}px, 0) translate(-50%, -50%) rotate(${m.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),c=s.useCallback(()=>{const g=i.current;t?(g.x=ds(g.x,g.targetX,Yo.positionEase),g.y=ds(g.y,g.targetY,Yo.positionEase),g.rotation=ds(g.rotation,g.targetRotation,Yo.rotationEase)):(g.x=g.targetX,g.y=g.targetY,g.rotation=g.targetRotation),r();const m=Math.abs(g.x-g.targetX)<.4&&Math.abs(g.y-g.targetY)<.4,x=Math.abs(g.rotation-g.targetRotation)<.08;!m||!x?o.current=requestAnimationFrame(c):o.current=null},[r,t]),d=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(c))},[c]),u=s.useCallback((g,m)=>{const x=i.current;x.targetX=g,x.targetY=m,x.targetRotation=0,x.x=g,x.y=m,x.rotation=0,x.lastX=g,x.hasLastX=!0,r(),t&&d()},[r,t,d]),p=s.useCallback((g,m)=>{if(!e)return;const x=i.current;if(t&&x.hasLastX){const b=g-x.lastX;x.targetRotation=r0(b*Yo.rotationFactor,-20,Yo.maxRotation)}else x.targetRotation=0;if(x.lastX=g,x.hasLastX=!0,x.targetX=g,x.targetY=m,t){d();return}x.x=g,x.y=m,x.rotation=x.targetRotation,r()},[e,r,t,d]),y=s.useCallback(g=>{l(),i.current.hasLastX=!1,g==null||g()},[l]),v=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||v(),l),[e,v,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:y,reset:v}}function l0(e){return`
|
|
9973
|
+
`,Qv="01M3SBP3P8CMVMM1ZZ0QVD2PPF",Hi={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 Zv(e){const t={};return t[bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSettings")]={...Hi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSize")]={...Hi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[bt(e,"lineHeight")]={...Hi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[bt(e,"letterSpacing")]={...Hi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[bt(e,"wordSpacing")]={...Hi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[bt(e,"textAlign")]={...Hi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[bt(e,"textAppearance")]={...Hi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Eo=Mi.filter(e=>e!=="count"),Jv=Eo.reduce((e,t)=>({...e,...Zv(t)}),{}),e0=Eo.reduce((e,t)=>({...e,[bt(t,"fontFamily")]:"Arial",[bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[bt(t,"letterSpacing")]:0,[bt(t,"wordSpacing")]:0,[bt(t,"textAlign")]:"left",[bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ls(e){return Eo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[bt(n,"fontSize")]=i),o!==void 0&&(t[bt(n,"lineHeight")]=o),t},{})}const t0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Eo.map(e=>[Nl[e],_l(e)]))},n0={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},i0=["01M3QM74XEQE7FN1WYJN6H984H","01M3QM74XFXCSMJJ8TNR0RXSWV","01M3QM74XFQ6K4CJ0QYC7BT7VP","01M3QM74XFK2K9T3SPCZD8M7RT","01M3QM74XFV4J15XRFB85877RE","01M3QM74XFB8Q39K12G4G6CZDM","01M3QM74XFWVH9HND47HYNCBZB","01M3QM74XF3MFEKEA4E0W9F9ZQ","01M3QM74XFEQY4XMN22Q9ERGKX","01M3QM74XFWP1RY8ND8QX88J2V","01M3QM74XFD41TXQ5BQ2KFJBGQ","01M3QM74XFV8973P7WXXWJP3QK","01M3QM74XF67PD2N10JYF9409X","01M3QM74XFA5B75WMTTKRN9TM7","01M3QM74XFFQRBHCQGKWPGSAGE","01M3QM74XF1HQBTRANGVX0QVGK","01M3QM74XF8ZWGSVCX3KS5YXSC","01M3QM74XFPHGV2XFZ23ADCVFC","01M3QM74XFECQG799S95G63BDJ","01M3QM74XFW1XS568WAHG3BGN1","01M3QM74XFT1RRJ3N1JJKPK5EA","01M3QM74XFB2JQ62RPFSM145GN","01M3QM74XFH61QR5PACJS04Z5K","01M3QM74XFKD44BXHRA7SSMD7N"],o0=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...n0,gallery:[{media:[{assetId:i0[t-1],name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}]});return e})(),r0={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",max:1,display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:o0},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"}},...Jv},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Qv,closeIconColor:"#000000",closeIconHoverColor:"#999999",...e0},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...ls({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...ls({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...ls({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:[t0]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},a0={element:Yv,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.assetId",placeholderEnabled:!0}],parameters:[{path:"closeIcon"}]},fontSettingsPaths:{content:[],parameters:[...Eo.map(e=>({path:`${bt(e,"fontFamily")}`}))]},fontRelations:{...Eo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${bt(t,"fontFamily")}`}),{})},schema:r0,sourceCode:Kv};function s0(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.assetId)}function l0({media:e,className:t,style:n}){const i=s.useRef(null);return s.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.assetId]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.assetId,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.assetId,alt:"",style:n})}function cs(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function c0(e){return String(e??"").trim().length>0}function Wc(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 Oc(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 Dc(e,t,n,i,o,r,l){const c=A.scalingValue(r,l),d=A.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?c:d,borderBottomWidth:!p||i?c:d}}function d0(e,t,n){const i=A.scalingValue(t,n),o=A.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Bc=10,zc=10,Yo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function u0(e,t,n){return Math.max(t,Math.min(n,e))}function ds(e,t,n){return e+(t-e)*n}function p0(e,t,n,i){if(!t)return{x:0,y:0};const o=t.getBoundingClientRect(),r=o.top+o.height/2;if(e==="cursor"&&n)return{x:n.clientX+Bc,y:n.clientY+Bc};switch(e){case"left":return{x:o.left+zc+i/2,y:r};case"center":return{x:o.left+o.width/2,y:r};case"right":return{x:o.right-zc-i/2,y:r};default:return{x:o.left+o.width/2,y:r}}}function m0(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const m=n.current,h=i.current;m&&(m.style.transform=`translate3d(${h.x}px, ${h.y}px, 0) translate(-50%, -50%) rotate(${h.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),c=s.useCallback(()=>{const m=i.current;t?(m.x=ds(m.x,m.targetX,Yo.positionEase),m.y=ds(m.y,m.targetY,Yo.positionEase),m.rotation=ds(m.rotation,m.targetRotation,Yo.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const h=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,b=Math.abs(m.rotation-m.targetRotation)<.08;!h||!b?o.current=requestAnimationFrame(c):o.current=null},[r,t]),d=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(c))},[c]),u=s.useCallback((m,h)=>{const b=i.current;b.targetX=m,b.targetY=h,b.targetRotation=0,b.x=m,b.y=h,b.rotation=0,b.lastX=m,b.hasLastX=!0,r(),t&&d()},[r,t,d]),p=s.useCallback((m,h)=>{if(!e)return;const b=i.current;if(t&&b.hasLastX){const S=m-b.lastX;b.targetRotation=u0(S*Yo.rotationFactor,-20,Yo.maxRotation)}else b.targetRotation=0;if(b.lastX=m,b.hasLastX=!0,b.targetX=m,b.targetY=h,t){d();return}b.x=m,b.y=h,b.rotation=b.targetRotation,r()},[e,r,t,d]),v=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[l]),x=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||x(),l),[e,x,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:v,reset:x}}function g0(e){return`
|
|
9974
9974
|
.${e}-wrapper {
|
|
9975
9975
|
display: grid;
|
|
9976
9976
|
align-items: start;
|
|
@@ -10346,7 +10346,7 @@ a.${e}-list-item {
|
|
|
10346
10346
|
overflow-wrap: anywhere;
|
|
10347
10347
|
word-break: break-word;
|
|
10348
10348
|
}
|
|
10349
|
-
`}const Pi=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ol=["AColumn","BColumn","CColumn","DColumn","EColumn"],ai="cutLabel",xr=[...Ol,ai],za=["A","B","C","D","E"];function ap(e){return`${e}ColumnVerticalAlign`}const Us=["Top","Center","Bottom"];function Dl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return za.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function c0(e){const t=Dl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function d0(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return za.includes(n)?n:null}function sp(e,t,n){const i=d0(e);return i?i===t?!1:c0(n[ap(i)]):!0}function br(e){const t=Dl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return za.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function u0(e,t,n){if(lp(e,t,n))return br(e);const i=br(e);return i.kind==="baseline"?{kind:"top"}:i}function p0(e){const t=br(e);return t.kind==="baseline"?{kind:"top"}:t}function lp(e,t,n){return sp(e,n,t)?br(e).kind==="baseline":!1}function g0(e){const t={};let n=!1;for(const i of za){const o=ap(i),r=e[o];if(e.type==="b"){const l=String(r??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}sp(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function m0(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function h0(e){const t=br(e).kind;return t==="baseline"?"center":t}function f0(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function jc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function y0(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(),r=o-i;return n.remove(),r}function us(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=y0(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const c=r.getBoundingClientRect(),d=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(c.height-d)/2:e.kind==="bottom"&&(u=c.height-d),c.top-t+u+l}function v0(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const r=o.querySelector(`.${n}`);r&&(r.style.minHeight=`${i}px`,r.style.height=`${i}px`)}),i)}function x0(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const b0={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Ut(e,t){return`${e}${t.replace(/^text/,"Text")}`}const S0={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function w0(e){return[Ut(e,"textFontFamily"),Ut(e,"textFontSettings"),{type:"row",items:[Ut(e,"textFontSize"),Ut(e,"textLineHeight"),Ut(e,"textLetterSpacing"),Ut(e,"textWordSpacing")]},Ut(e,"textTextAlign"),Ut(e,"textTextAppearance"),`${e}VerticalAlign`]}function $0(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(xr.map(e=>[S0[e],w0(e)]))}}function $a(e,t){const n=i=>{const o=Ut(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===ai?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Vc(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 un(en(n,t))}function Gc(e,t,n,i){const o=$a(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Xc(e,t,n,i){const o=$a(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:F.scalingValue((r-l)/2,i)}}const Rn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Mo=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Eo=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],ko=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],C0={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},T0=["hover","focus","filled","success","error"],Uc=.004,uo=.004,ps=uo,Bl=50,Sr=1440,wr=Bl/Sr;function cp(e){const t=typeof e=="number"&&e>0?e:Sr;return Bl/t}function I0(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 Sr}const dp={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function lr(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function L0(e,t=1){const n=t/e;return Object.fromEntries(Rn.map(i=>[i,n]))}function P0(){return Object.fromEntries([...Mo.map(e=>[e,0]),...Eo.map(e=>[e,0])])}function R0(){return Object.fromEntries(ko.map(e=>[e,0]))}function Vr(e){return Object.fromEntries(Rn.map(t=>[t,typeof e[t]=="number"?e[t]:dp[t]]))}function up(e,t,n){const i=e-wr,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const r=i/o;return{paddingLeft:t*r,paddingRight:n*r}}function ga(e,t,n){const i=zl(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((r,l)=>r+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function M0(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Mo[o],l=Eo[o],c=typeof n[r]=="number"?n[r]:0,d=typeof n[l]=="number"?n[l]:0,u=up(t[o]??0,c,d);u.paddingLeft!==c&&(i[r]=u.paddingLeft),u.paddingRight!==d&&(i[l]=u.paddingRight)}return i}function zl(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),l=o.reduce((u,p)=>u+p,0)+wr;if(t>=l)return i;const c=[...o];let d=l-t;for(let u=c.length-1;u>=0&&d>0;u-=1){const p=c[u]-wr;if(p<=0)continue;const y=Math.min(d,p);c[u]-=y,d-=y}return[...c,i[e-1]]}function E0(e,t,n){if(e<=1)return{};const i=zl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=Rn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function qc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Pi]}function k0(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function A0(e,t,n,i){const o=Math.min(i,e.length,Rn.length),r={};for(let l=0;l<o;l+=1){const c=e[l],d=t.indexOf(c);if(d===-1)continue;const u=Rn[d],p=Mo[d],y=Eo[d],v=ko[d],g=Rn[l],m=Mo[l],x=Eo[l],b=ko[l],M=n[u],f=n[p],S=n[y],W=n[v];typeof M=="number"&&(r[g]=M),typeof f=="number"&&(r[m]=f),typeof S=="number"&&(r[x]=S),typeof W=="number"&&(r[b]=W)}return r}function pp(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 F0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=lr(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...L0(n,o),...P0()};if(r)for(const c of ko)typeof t[c]=="number"&&(l[c]=t[c]);else Object.assign(l,R0());return pp(e,l)?l:e}function N0(e,t,n){const i=g0(e);i&&(e={...e,...i});const o=cp(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,c=lr(e),d=lr(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Pi.length,y=S=>{if(u)return S;const W=Vr({...t,...S}),q=lr(S),z=ga(p,q,W),L=M0(p,z,{...t,...S});return Object.keys(L).length===0?S:{...S,...L}};if(typeof r=="number"&&r!==l)return e;const v=qc(e),g=qc(t);if(!k0(v,g))return y({...e,...A0(v,g,t,p)});if(c<d&&typeof p=="number"&&!u){const S=Vr({...t,...e});return y({...e,...E0(p,c,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,W=Math.max(0,(c-o)/2);return S>W?{...e,textPaddingLR:W}:e}const m=Vr({...t,...e}),x=ga(p,d,Vr(t)),M=ga(p,c,m).some((S,W)=>S<(x[W]??S)),f=Rn.some(S=>{const W=e[S],q=t[S];return typeof W=="number"&&typeof q=="number"&&W!==q});return M||f?y(e):e}function _0(e,t,n,i){const o=t.slice(0,e).reduce((l,c)=>l+c,0),r=n.slice(e+1,t.length-1).reduce((l,c)=>l+c,0);return Math.max(wr,i-o-r-wr)}function H0(e,t){return Math.random()*(t-e)+e}function W0(e){return Object.fromEntries(Rn.map(t=>[t,typeof e[t]=="number"?e[t]:dp[t]]))}function gs(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function O0(e,t,n,i,o,r){return e.slice(0,t).map((l,c)=>{const d=Mo[c],u=Eo[c],p=ko[c];return{key:l,textPrefix:b0[l],widthKey:Rn[c],width:n[Rn[c]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[d],paddingRight:o[u],paddingBottom:r[p]}})}function D0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,portalId:c,onUpdateSettings:d}){const{prefix:u}=F.useScopedStyles(),p=!!o,{columns:y,type:v,wrapperWidth:g,entriesCount:m,cellMinHeight:x,dividerWidth:b,showVisibility:M,cut:f,showCut:S,cutCellMinHeight:W,cutLabel:q,imageSize:z,imageOnHover:L,imagePosition:_="cursor",imageInterpolation:G="on",entryHoverEffect:$,entryHoverShowOption:I,rowPaddingTop:D,rowPaddingBottom:E,rowPaddingTopB:T,columnsOrder:C,textPaddingLR:V,textColor:w,backgroundColor:U,dividerColor:P,textHoverColor:A,backgroundHoverColor:j,dividerHoverColor:ie}=e,[ae,O]=s.useState(void 0),[re,N]=s.useState(null),le=s.useRef(null),J=L==="on"&&(!n||i),be=_==="cursor",Le=be&&G==="on",{anchorRef:ye,onShow:ce,onCursorMove:K,exit:se}=s0(!!(J&&re!==null),Le),pe=(f??0)>0,fe=v==="b",we=s.useRef(null),Re=s.useRef(null),[me,xe]=s.useState(null),[Ce,h]=s.useState(Sr),Y=cp(Ce),Q=Math.max(0,((g??0)-Y)/2),ne=Math.min(V??0,Q),ue=Math.max(ne,uo),B=((g??0)+Y)/2;s.useLayoutEffect(()=>{if(!n){h(Sr);return}const ke=()=>{h(I0(we.current))};ke();const Je=we.current;if(!Je)return;const rt=new ResizeObserver(ke);rt.observe(Je);let dt=Je;for(;dt&&!dt.style.getPropertyValue("--cntrl-article-width");)dt=dt.parentElement;return dt&&rt.observe(dt),()=>rt.disconnect()},[n,l]),s.useEffect(()=>{O(void 0)},[f,S,t,m]),s.useEffect(()=>{n&&!i&&O(void 0)},[n,i]);const R=F.buildColorVars(u,{textColor:w,backgroundColor:U,dividerColor:P,textHoverColor:A,backgroundHoverColor:j,dividerHoverColor:ie},C0,T0),ee=r&&r!=="default"?`${u}-state-${r}`:"",ge=`${!n||i?$==="default"?`${u}-entry-hover-default`:$==="blinds"?`${u}-entry-hover-blinds`:$==="reveal"?`${u}-entry-hover-reveal`:"":""} ${ee}`.trim(),X=$==="reveal"&&(!n||i),Pe=(M==null?void 0:M[0])??!1,Se=(M==null?void 0:M[1])??!1,Z=s.useRef(e),He=s.useRef(l);s.useEffect(()=>{if(!d||!n){Z.current=e,He.current=l;return}if(He.current!==l){Z.current=e,He.current=l;return}const ke=Z.current;if(!(ke!==e))return;if(typeof ke.columns=="number"&&typeof e.columns=="number"&&ke.columns!==e.columns){Z.current=e;return}const rt=N0(e,ke,{designWidth:Ce});Z.current=e,pp(e,rt)&&d(rt)},[e,d,n,l,Ce]);const We=s.useMemo(()=>W0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ot=s.useMemo(()=>gs(e,Mo),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),qe=s.useMemo(()=>gs(e,Eo),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),tt=s.useMemo(()=>gs(e,ko),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),et=s.useMemo(()=>Array.isArray(C)&&C.length>0?C:[...Pi],[C]),Ge=s.useMemo(()=>O0(et,y,We,ot,qe,tt),[et,y,We,ot,qe,tt]),ve=lr(e),_e=s.useMemo(()=>Rn.slice(0,y).map(ke=>We[ke]),[y,We]),ze=s.useMemo(()=>zl(y,ve,We),[y,ve,We]),Qe=s.useMemo(()=>ga(y,ve,We),[y,ve,We]),$e=s.useMemo(()=>Ge.map((ke,Je)=>up(Qe[Je]??0,ke.paddingLeft,ke.paddingRight)),[Ge,Qe]),Ne=s.useMemo(()=>{const ke=m===0?1/0:m;return(t??[]).slice(0,ke).map((rt,dt)=>({id:dt,cells:Object.fromEntries(Pi.map(Lt=>[Lt,rt[Lt]??""])),image:rt.image,link:rt.link}))},[t,m]),Ye=pe?ae??f:Ne.length,Ze=s.useMemo(()=>pe?Ne.slice(0,Ye):Ne,[Ne,pe,Ye]),st=pe&&Ye<Ne.length,it=Ze.length>1||st,Oe=[Pe?`${u}-divider-top`:"",Se||it?`${u}-divider-bottom`:""].filter(Boolean).join(" "),Ae=!n||i,mt=()=>{if(!Ae)return;const ke=ae??f;if(!S){O(Ne.length);return}O(Math.min(ke+S,Ne.length))},Be=ke=>F.scalingValue(ke,n??!1),De=fe?T??0:D??0,Ue=E??0,ct=x??0,he=Math.max(Ue,ps),Me=Dc(0,Ze.length,Pe,Se,st,b??0,n??!1).borderTopWidth,nt=fe?"rowPaddingTopB":"rowPaddingTop",pt=Ge[0],Ve=Ge[Ge.length-1],vt=$e[0],Pt=$e[$e.length-1],At=pt&&vt?Math.max(vt.paddingLeft,uo):0,wt=Ve&&Pt?Math.max(Pt.paddingRight,uo):0,Vt=ve,jt=(ke,Je)=>a0(_,we.current,be?ke:null,Je),Yt=(ke,Je)=>{if(!J)return;const rt=ke.image;if(!(rt!=null&&rt.assetId)){se(()=>N(null));return}const dt=(z==null?void 0:z.min)??80,Lt=(z==null?void 0:z.max)??320,St=(re==null?void 0:re.rowId)===ke.id,ht=St?re.widthPx:H0(dt,Lt),{x:Wt,y:Tt}=jt(Je,ht);if(St&&be){K(Wt,Tt);return}N({rowId:ke.id,assetId:rt.assetId,objectFit:"contain",isVideo:t0(rt),widthPx:ht}),le.current={x:Wt,y:Tt}},Kt=ke=>{if(!J||!re||!be)return;const{x:Je,y:rt}=jt(ke,re.widthPx);K(Je,rt)},Rt=()=>{re&&se(()=>N(null))},zt=ke=>{X&&Wc(ke,u),!(!J||!re)&&se(()=>N(null))},on=ke=>{X&&Oc(ke,u)};s.useLayoutEffect(()=>{if(!re||!le.current)return;const{x:ke,y:Je}=le.current;le.current=null,ce(ke,Je)},[re==null?void 0:re.rowId,re==null?void 0:re.assetId,ce]),s.useLayoutEffect(()=>{if(!p||fe){xe(null);return}const ke=Re.current,Je=ke==null?void 0:ke.parentElement;if(!ke||!Je){xe(null);return}const rt=()=>{const Lt=ke.querySelector("[data-list-row]");if(!Lt){xe(null);return}const St=Je.getBoundingClientRect(),ht=Lt.getBoundingClientRect();xe(ht.top-St.top+ht.height/2)};rt();const dt=new ResizeObserver(rt);return dt.observe(ke),dt.observe(Je),()=>dt.disconnect()},[p,fe,Ze,De,Ue,ct,t,e,Ge,Qe,Ce,b,Pe,Se,st]);const xt=s.useMemo(()=>!fe&&Ol.some(ke=>{const Je=ke.charAt(0),rt=e[`${ke}VerticalAlign`];return lp(rt,e,Je)}),[fe,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Wt;const ke=we.current;if(!ke)return;const Je=()=>{ke.querySelectorAll("[data-list-col]").forEach(Tt=>{Tt.style.transform="";const Ot=Tt.querySelector(`.${u}-list-col`);Ot&&(Ot.style.minHeight="",Ot.style.height="");const Gt=Tt.querySelector(`.${u}-list-col-title`);Gt&&(Gt.style.transform="")})};if(fe||!xt){Je();return}const rt=()=>{const Tt=Array.from(ke.querySelectorAll("[data-list-row]")),Ot=`${u}-list-col`,Gt=`${u}-baseline-probe`;Tt.forEach(kt=>{kt.querySelectorAll("[data-list-col]").forEach(_t=>{_t.style.transform="";const Ft=_t.querySelector(`.${Ot}`);Ft&&(Ft.style.minHeight="",Ft.style.height="");const ut=_t.querySelector(`.${u}-list-col-title`);ut&&(ut.style.transform="")})}),Tt.forEach(kt=>{const _t=Array.from(kt.querySelectorAll("[data-list-col]"));v0(kt,_t,Ot)}),ke.offsetHeight,Tt.forEach(kt=>{const _t=Array.from(kt.querySelectorAll("[data-list-col]")),Ft=kt.getBoundingClientRect().top,ut=new Map,H=_t.map(Fe=>{const ft=Fe.querySelector(`.${u}-list-col-title`),Ht={el:Fe,titleEl:ft,letter:Fe.getAttribute("data-col-letter")??"",kind:Fe.getAttribute("data-valign")??"top",anchor:Fe.getAttribute("data-valign-anchor")};return ut.set(Ht.letter,Ht),Ht}),Ie=new Map,je=(Fe,ft)=>{const Ht=Ie.get(Fe.letter);if(Ht!==void 0)return Ht;const gt=Fe.anchor?ut.get(Fe.anchor):void 0;if(Fe.kind!=="baseline"||!gt||ft.has(Fe.letter)){const cn=us(Fe,Ft,Ot,Gt);return Ie.set(Fe.letter,cn),cn}ft.add(Fe.letter);const It=je(gt,ft);ft.delete(Fe.letter);const qt=us(Fe,Ft,Ot,Gt),Dt=It-qt;x0(Fe.titleEl,Dt);const an=us(Fe,Ft,Ot,Gt);return Ie.set(Fe.letter,an),an};H.forEach(Fe=>je(Fe,new Set))})};let dt=null;const Lt=()=>{dt===null&&(dt=requestAnimationFrame(()=>{dt=null,rt()}))};rt();const St=new ResizeObserver(()=>Lt());St.observe(ke);let ht=!1;return typeof document<"u"&&((Wt=document.fonts)!=null&&Wt.ready)&&document.fonts.ready.then(()=>{ht||Lt()}),()=>{ht=!0,dt!==null&&(cancelAnimationFrame(dt),dt=null),St.disconnect(),Je()}},[xt,fe,e,t,Ce,Ze,Qe]);const yt=s.useMemo(()=>l0(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:yt}}),a.jsx("div",{style:R,children:a.jsxs("div",{ref:we,className:`${u}-wrapper ${ge}${Oe?` ${Oe}`:""}${fe?` ${u}-type-b`:""}`.trim(),style:{width:F.scalingValue(g??0,n)},onMouseMove:J?Kt:void 0,onMouseLeave:J?Rt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ze.map((ke,Je)=>{var St;const rt=(((St=ke.link)==null?void 0:St.length)??0)>0,dt=rt&&(!n||i)?"a":"div",Lt=Dc(Je,Ze.length,Pe,Se,st,b??0,n??!1);return a.jsxs(dt,{ref:Je===0?ht=>{Re.current=ht}:void 0,className:`${u}-list-item${rt||I==="always"?` ${u}-list-item-has-link`:""}${st&&Je===Ze.length-1?` ${u}-list-item-before-cut`:""}`,...rt?{href:ke.link,target:"_blank"}:{},style:Lt,onMouseEnter:ht=>{X&&(rt||I==="always")&&Wc(ht,u),J&&Yt(ke,ht)},onMouseLeave:ht=>{X&&(rt||I==="always")&&Oc(ht,u)},children:[De>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:Be(De)}}),a.jsxs("div",{className:`${u}-list-cols-row${fe?"":` ${u}-list-cols-row-h`}${p&&Je===0&&fe?` ${u}-list-cols-row-controls`:""}`,...fe?{}:{"data-list-row":""},style:fe?void 0:{minHeight:Be(ct)},children:[Ge.map((ht,Wt)=>{const Tt=Wt===Ge.length-1,Ot=$e[Wt],Gt=ht.paddingBottom,kt=i0(ke.cells[ht.key]),_t=fe&&kt&&Gt>0,Ft=fe?{minHeight:Be(ct)}:{width:Be(Qe[Wt])},ut=fe?{paddingLeft:Be(ne),paddingRight:Be(ne)}:{paddingLeft:Be(Ot.paddingLeft),paddingRight:Be(Ot.paddingRight)},H=ht.textPrefix.charAt(0),Ie=fe?p0(e[`${ht.textPrefix}VerticalAlign`]):u0(e[`${ht.textPrefix}VerticalAlign`],e,H),je=fe&&kt&&p&&Je===0;return fe&&!kt?null:a.jsxs("div",{className:fe?`${u}-list-col-wrap`:void 0,...fe?{}:{"data-list-col":"","data-col-letter":H,"data-valign":Ie.kind,...Ie.kind==="baseline"?{"data-valign-anchor":Ie.anchorLetter}:{}},children:[a.jsx("div",{className:`${u}-list-col${Tt?` ${u}-list-col-last`:""}`,style:{...ut,...Ft,...fe?{justifyContent:jc(Ie.kind)}:{}},"data-test":ht.width,children:a.jsx("span",{className:Gc(e,ht.textPrefix,`${u}-list-col-title`,`${u}-text-tight-leading`),style:{...Vc($a(e,ht.textPrefix),n),...Xc(e,ht.textPrefix,u,n),...fe?{}:m0(Ie.kind)},children:ke.cells[ht.key]??null})}),_t&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:Be(Gt)}}),je&&a.jsx("div",{"data-controls":ht.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Be(Math.max(Gt,ps))}})]},ht.key)}),p&&Je===0&&fe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(B),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:0,width:Be(ue),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(B),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:Be(Math.max(ue,ve-ue)),width:Be(ue),height:"100%"}})]})]}),!fe&&Ue>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:Be(Ue)}}),p&&Je===0&&!fe&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Be(he)}})]},ke.id)}),p&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":nt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":fe?"center":"left-y",className:`${u}-control-anchor`,style:{top:Me,left:0,width:"100%",height:Be(Math.max(De,ps))}})},"row-padding-handles"),p&&!fe&&pt&&Ve&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":pt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Qe[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":me??void 0,className:`${u}-control-anchor`,style:{top:0,left:0,width:Be(At),height:"100%"}}),a.jsx("div",{"data-controls":Ve.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Qe[Ge.length-1]-((Pt==null?void 0:Pt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":me??void 0,className:`${u}-control-anchor`,style:{top:0,left:Be(Vt-wt),width:Be(wt),height:"100%"}})]},"column-edge-padding-handles"),p&&!fe&&Ge.slice(0,-1).map((ke,Je)=>{const rt=Ge[Je+1],dt=ze.slice(0,Je+1).reduce((Tt,Ot)=>Tt+Ot,0),Lt=$e[Je],St=$e[Je+1],ht=Math.max(Lt.paddingRight,uo),Wt=Math.max(St.paddingLeft,uo);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":ke.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Qe[Je]-Lt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":me??void 0,className:`${u}-control-anchor`,style:{top:0,left:Be(dt-ht),width:Be(ht),height:"100%"}}),a.jsx("div",{"data-controls":rt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Qe[Je+1]-St.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":me??void 0,className:`${u}-control-anchor`,style:{top:0,left:Be(dt),width:Be(Wt),height:"100%"}})]},`${ke.paddingRightKey}-padding`)}),p&&!fe&&Ge.slice(0,-1).map((ke,Je)=>{const rt=_0(Je,ze,_e,ve),Lt=ze.slice(0,Je+1).reduce((St,ht)=>St+ht,0)-Uc/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":ke.widthKey,"data-controls-axis":"x","data-controls-min":String(Bl),"data-controls-max-fraction":String(rt),"data-controls-variant":"column-width",className:`${u}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Be(Lt),width:Be(Uc),height:"calc(100%)",pointerEvents:"auto"}})},`${ke.widthKey}-junction`)})]}),st&&(()=>{const ke=$a(e,ai),Je=h0(e.cutLabelVerticalAlign),rt=ke.textTextAlign==="justify"||fe;return a.jsx("button",{type:"button",className:`${u}-cut-item`,style:{minHeight:Be(W??0),cursor:Ae?"pointer":"default",...o0(Se,b??0,n??!1)},onClick:Ae?mt:void 0,onMouseEnter:X||J?zt:void 0,onMouseLeave:X?on:void 0,children:a.jsx("div",{className:`${u}-list-cols-row`,style:{...fe?{paddingLeft:Be(ne),paddingRight:Be(ne)}:{},justifyContent:f0(ke.textTextAlign),alignItems:jc(Je)},children:a.jsx("span",{className:Gc(e,ai,`${u}-cut-label`,`${u}-text-tight-leading`),style:{...Vc(ke,n),...Xc(e,ai,u,n),...rt?{width:"100%"}:{}},children:q})})})})(),J&&re&&typeof document<"u"&&(()=>{const ke=`${re.widthPx}px`,Je={width:ke,height:"auto",maxHeight:ke,objectFit:"contain"},rt=(c?document.getElementById(c):null)??document.body;return Xn.createPortal(a.jsx("div",{ref:ye,className:`${u}-hover-media-anchor`,"data-selection":"none",children:a.jsx(n0,{media:re,className:re.isVideo?`${u}-hover-video`:`${u}-hover-image`,style:Je},`${re.rowId}-${re.assetId}`)}),rt)})()]})})]})}const B0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10349
|
+
`}const Ei=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ol=["AColumn","BColumn","CColumn","DColumn","EColumn"],si="cutLabel",xr=[...Ol,si],za=["A","B","C","D","E"];function pp(e){return`${e}ColumnVerticalAlign`}const Xs=["Top","Center","Bottom"];function Dl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return za.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function h0(e){const t=Dl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function f0(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return za.includes(n)?n:null}function mp(e,t,n){const i=f0(e);return i?i===t?!1:h0(n[pp(i)]):!0}function br(e){const t=Dl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return za.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function y0(e,t,n){if(gp(e,t,n))return br(e);const i=br(e);return i.kind==="baseline"?{kind:"top"}:i}function v0(e){const t=br(e);return t.kind==="baseline"?{kind:"top"}:t}function gp(e,t,n){return mp(e,n,t)?br(e).kind==="baseline":!1}function x0(e){const t={};let n=!1;for(const i of za){const o=pp(i),r=e[o];if(e.type==="b"){const l=String(r??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}mp(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function b0(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function S0(e){const t=br(e).kind;return t==="baseline"?"center":t}function w0(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function jc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function $0(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(),r=o-i;return n.remove(),r}function us(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=$0(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const c=r.getBoundingClientRect(),d=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(c.height-d)/2:e.kind==="bottom"&&(u=c.height-d),c.top-t+u+l}function C0(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const r=o.querySelector(`.${n}`);r&&(r.style.minHeight=`${i}px`,r.style.height=`${i}px`)}),i)}function T0(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const I0={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Qt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const L0={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function P0(e){return[Qt(e,"textFontFamily"),Qt(e,"textFontSettings"),{type:"row",items:[Qt(e,"textFontSize"),Qt(e,"textLineHeight"),Qt(e,"textLetterSpacing"),Qt(e,"textWordSpacing")]},Qt(e,"textTextAlign"),Qt(e,"textTextAppearance"),`${e}VerticalAlign`]}function R0(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(xr.map(e=>[L0[e],P0(e)]))}}function $a(e,t){const n=i=>{const o=Qt(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===si?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Vc(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 pn(nn(n,t))}function Gc(e,t,n,i){const o=$a(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Xc(e,t,n,i){const o=$a(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:A.scalingValue((r-l)/2,i)}}const Mn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ko=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ao=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Fo=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],M0={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},E0=["hover","focus","filled","success","error"],qc=.004,mo=.004,ps=mo,Bl=50,Sr=1440,wr=Bl/Sr;function hp(e){const t=typeof e=="number"&&e>0?e:Sr;return Bl/t}function k0(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 Sr}const fp={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function lr(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function A0(e,t=1){const n=t/e;return Object.fromEntries(Mn.map(i=>[i,n]))}function F0(){return Object.fromEntries([...ko.map(e=>[e,0]),...Ao.map(e=>[e,0])])}function N0(){return Object.fromEntries(Fo.map(e=>[e,0]))}function Vr(e){return Object.fromEntries(Mn.map(t=>[t,typeof e[t]=="number"?e[t]:fp[t]]))}function yp(e,t,n){const i=e-wr,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const r=i/o;return{paddingLeft:t*r,paddingRight:n*r}}function ma(e,t,n){const i=zl(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((r,l)=>r+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function _0(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=ko[o],l=Ao[o],c=typeof n[r]=="number"?n[r]:0,d=typeof n[l]=="number"?n[l]:0,u=yp(t[o]??0,c,d);u.paddingLeft!==c&&(i[r]=u.paddingLeft),u.paddingRight!==d&&(i[l]=u.paddingRight)}return i}function zl(e,t,n){if(e<=0)return[];const i=Mn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+wr;if(t>=l)return i;const c=[...o];let d=l-t;for(let u=c.length-1;u>=0&&d>0;u-=1){const p=c[u]-wr;if(p<=0)continue;const v=Math.min(d,p);c[u]-=v,d-=v}return[...c,i[e-1]]}function H0(e,t,n){if(e<=1)return{};const i=zl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=Mn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Uc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Ei]}function W0(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function O0(e,t,n,i){const o=Math.min(i,e.length,Mn.length),r={};for(let l=0;l<o;l+=1){const c=e[l],d=t.indexOf(c);if(d===-1)continue;const u=Mn[d],p=ko[d],v=Ao[d],x=Fo[d],m=Mn[l],h=ko[l],b=Ao[l],S=Fo[l],M=n[u],y=n[p],$=n[v],R=n[x];typeof M=="number"&&(r[m]=M),typeof y=="number"&&(r[h]=y),typeof $=="number"&&(r[b]=$),typeof R=="number"&&(r[S]=R)}return r}function vp(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 D0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=lr(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...A0(n,o),...F0()};if(r)for(const c of Fo)typeof t[c]=="number"&&(l[c]=t[c]);else Object.assign(l,N0());return vp(e,l)?l:e}function B0(e,t,n){const i=x0(e);i&&(e={...e,...i});const o=hp(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,c=lr(e),d=lr(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Ei.length,v=$=>{if(u)return $;const R=Vr({...t,...$}),X=lr($),B=ma(p,X,R),O=_0(p,B,{...t,...$});return Object.keys(O).length===0?$:{...$,...O}};if(typeof r=="number"&&r!==l)return e;const x=Uc(e),m=Uc(t);if(!W0(x,m))return v({...e,...O0(x,m,t,p)});if(c<d&&typeof p=="number"&&!u){const $=Vr({...t,...e});return v({...e,...H0(p,c,$)})}if(u){const $=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,R=Math.max(0,(c-o)/2);return $>R?{...e,textPaddingLR:R}:e}const h=Vr({...t,...e}),b=ma(p,d,Vr(t)),M=ma(p,c,h).some(($,R)=>$<(b[R]??$)),y=Mn.some($=>{const R=e[$],X=t[$];return typeof R=="number"&&typeof X=="number"&&R!==X});return M||y?v(e):e}function z0(e,t,n,i){const o=t.slice(0,e).reduce((l,c)=>l+c,0),r=n.slice(e+1,t.length-1).reduce((l,c)=>l+c,0);return Math.max(wr,i-o-r-wr)}function j0(e,t){return Math.random()*(t-e)+e}function V0(e){return Object.fromEntries(Mn.map(t=>[t,typeof e[t]=="number"?e[t]:fp[t]]))}function ms(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function G0(e,t,n,i,o,r){return e.slice(0,t).map((l,c)=>{const d=ko[c],u=Ao[c],p=Fo[c];return{key:l,textPrefix:I0[l],widthKey:Mn[c],width:n[Mn[c]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[d],paddingRight:o[u],paddingBottom:r[p]}})}function X0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,portalId:c,onUpdateSettings:d}){const{prefix:u}=A.useScopedStyles(),p=!!o,{columns:v,type:x,wrapperWidth:m,entriesCount:h,cellMinHeight:b,dividerWidth:S,showVisibility:M,cut:y,showCut:$,cutCellMinHeight:R,cutLabel:X,imageSize:B,imageOnHover:O,imagePosition:N="cursor",imageInterpolation:z="on",entryHoverEffect:C,entryHoverShowOption:I,rowPaddingTop:j,rowPaddingBottom:E,rowPaddingTopB:w,columnsOrder:L,textPaddingLR:V,textColor:_,backgroundColor:K,dividerColor:P,textHoverColor:f,backgroundHoverColor:U,dividerHoverColor:te}=e,[ce,F]=s.useState(void 0),[ie,T]=s.useState(null),le=s.useRef(null),J=O==="on"&&(!n||i),Se=N==="cursor",Le=Se&&z==="on",{anchorRef:me,onShow:ye,onCursorMove:ee,exit:oe}=m0(!!(J&&ie!==null),Le),re=(y??0)>0,ge=x==="b",we=s.useRef(null),Ae=s.useRef(null),[fe,ve]=s.useState(null),[xe,g]=s.useState(Sr),G=hp(xe),Q=Math.max(0,((m??0)-G)/2),ne=Math.min(V??0,Q),ue=Math.max(ne,mo),q=((m??0)+G)/2;s.useLayoutEffect(()=>{if(!n){g(Sr);return}const Re=()=>{g(k0(we.current))};Re();const tt=we.current;if(!tt)return;const nt=new ResizeObserver(Re);nt.observe(tt);let st=tt;for(;st&&!st.style.getPropertyValue("--cntrl-article-width");)st=st.parentElement;return st&&nt.observe(st),()=>nt.disconnect()},[n,l]),s.useEffect(()=>{F(void 0)},[y,$,t,h]),s.useEffect(()=>{n&&!i&&F(void 0)},[n,i]);const D=A.buildColorVars(u,{textColor:_,backgroundColor:K,dividerColor:P,textHoverColor:f,backgroundHoverColor:U,dividerHoverColor:te},M0,E0),se=r&&r!=="default"?`${u}-state-${r}`:"",pe=`${!n||i?C==="default"?`${u}-entry-hover-default`:C==="blinds"?`${u}-entry-hover-blinds`:C==="reveal"?`${u}-entry-hover-reveal`:"":""} ${se}`.trim(),H=C==="reveal"&&(!n||i),Ie=(M==null?void 0:M[0])??!1,de=(M==null?void 0:M[1])??!1,Z=s.useRef(e),Ne=s.useRef(l);s.useEffect(()=>{if(!d||!n){Z.current=e,Ne.current=l;return}if(Ne.current!==l){Z.current=e,Ne.current=l;return}const Re=Z.current;if(!(Re!==e))return;if(typeof Re.columns=="number"&&typeof e.columns=="number"&&Re.columns!==e.columns){Z.current=e;return}const nt=B0(e,Re,{designWidth:xe});Z.current=e,vp(e,nt)&&d(nt)},[e,d,n,l,xe]);const Oe=s.useMemo(()=>V0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Je=s.useMemo(()=>ms(e,ko),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),De=s.useMemo(()=>ms(e,Ao),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ze=s.useMemo(()=>ms(e,Fo),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),at=s.useMemo(()=>Array.isArray(L)&&L.length>0?L:[...Ei],[L]),Xe=s.useMemo(()=>G0(at,v,Oe,Je,De,Ze),[at,v,Oe,Je,De,Ze]),be=lr(e),He=s.useMemo(()=>Mn.slice(0,v).map(Re=>Oe[Re]),[v,Oe]),je=s.useMemo(()=>zl(v,be,Oe),[v,be,Oe]),Qe=s.useMemo(()=>ma(v,be,Oe),[v,be,Oe]),Ce=s.useMemo(()=>Xe.map((Re,tt)=>yp(Qe[tt]??0,Re.paddingLeft,Re.paddingRight)),[Xe,Qe]),_e=s.useMemo(()=>{const Re=h===0?1/0:h;return(t??[]).slice(0,Re).map((nt,st)=>({id:st,cells:Object.fromEntries(Ei.map(At=>[At,nt[At]??""])),image:nt.image,link:nt.link}))},[t,h]),Ue=re?ce??y:_e.length,Ye=s.useMemo(()=>re?_e.slice(0,Ue):_e,[_e,re,Ue]),lt=re&&Ue<_e.length,it=Ye.length>1||lt,qe=[Ie?`${u}-divider-top`:"",de||it?`${u}-divider-bottom`:""].filter(Boolean).join(" "),Ee=!n||i,pt=()=>{if(!Ee)return;const Re=ce??y;if(!$){F(_e.length);return}F(Math.min(Re+$,_e.length))},ke=Re=>A.scalingValue(Re,n??!1),We=ge?w??0:j??0,Ve=E??0,ct=b??0,ot=Math.max(Ve,ps),xt=Dc(0,Ye.length,Ie,de,lt,S??0,n??!1).borderTopWidth,Pt=ge?"rowPaddingTopB":"rowPaddingTop",Vt=Xe[0],vt=Xe[Xe.length-1],Mt=Ce[0],Ht=Ce[Ce.length-1],Gt=Vt&&Mt?Math.max(Mt.paddingLeft,mo):0,kt=vt&&Ht?Math.max(Ht.paddingRight,mo):0,Pe=be,Be=(Re,tt)=>p0(N,we.current,Se?Re:null,tt),ft=(Re,tt)=>{if(!J)return;const nt=Re.image;if(!(nt!=null&&nt.assetId)){oe(()=>T(null));return}const st=(B==null?void 0:B.min)??80,At=(B==null?void 0:B.max)??320,St=(ie==null?void 0:ie.rowId)===Re.id,ht=St?ie.widthPx:j0(st,At),{x:Dt,y:Ct}=Be(tt,ht);if(St&&Se){ee(Dt,Ct);return}T({rowId:Re.id,assetId:nt.assetId,objectFit:"contain",isVideo:s0(nt),widthPx:ht}),le.current={x:Dt,y:Ct}},$t=Re=>{if(!J||!ie||!Se)return;const{x:tt,y:nt}=Be(Re,ie.widthPx);ee(tt,nt)},et=()=>{ie&&oe(()=>T(null))},Et=Re=>{H&&Wc(Re,u),!(!J||!ie)&&oe(()=>T(null))},Xt=Re=>{H&&Oc(Re,u)};s.useLayoutEffect(()=>{if(!ie||!le.current)return;const{x:Re,y:tt}=le.current;le.current=null,ye(Re,tt)},[ie==null?void 0:ie.rowId,ie==null?void 0:ie.assetId,ye]),s.useLayoutEffect(()=>{if(!p||ge){ve(null);return}const Re=Ae.current,tt=Re==null?void 0:Re.parentElement;if(!Re||!tt){ve(null);return}const nt=()=>{const At=Re.querySelector("[data-list-row]");if(!At){ve(null);return}const St=tt.getBoundingClientRect(),ht=At.getBoundingClientRect();ve(ht.top-St.top+ht.height/2)};nt();const st=new ResizeObserver(nt);return st.observe(Re),st.observe(tt),()=>st.disconnect()},[p,ge,Ye,We,Ve,ct,t,e,Xe,Qe,xe,S,Ie,de,lt]);const mt=s.useMemo(()=>!ge&&Ol.some(Re=>{const tt=Re.charAt(0),nt=e[`${Re}VerticalAlign`];return gp(nt,e,tt)}),[ge,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Dt;const Re=we.current;if(!Re)return;const tt=()=>{Re.querySelectorAll("[data-list-col]").forEach(Ct=>{Ct.style.transform="";const qt=Ct.querySelector(`.${u}-list-col`);qt&&(qt.style.minHeight="",qt.style.height="");const jt=Ct.querySelector(`.${u}-list-col-title`);jt&&(jt.style.transform="")})};if(ge||!mt){tt();return}const nt=()=>{const Ct=Array.from(Re.querySelectorAll("[data-list-row]")),qt=`${u}-list-col`,jt=`${u}-baseline-probe`;Ct.forEach(Nt=>{Nt.querySelectorAll("[data-list-col]").forEach(Bt=>{Bt.style.transform="";const Wt=Bt.querySelector(`.${qt}`);Wt&&(Wt.style.minHeight="",Wt.style.height="");const wt=Bt.querySelector(`.${u}-list-col-title`);wt&&(wt.style.transform="")})}),Ct.forEach(Nt=>{const Bt=Array.from(Nt.querySelectorAll("[data-list-col]"));C0(Nt,Bt,qt)}),Re.offsetHeight,Ct.forEach(Nt=>{const Bt=Array.from(Nt.querySelectorAll("[data-list-col]")),Wt=Nt.getBoundingClientRect().top,wt=new Map,W=Bt.map(Fe=>{const yt=Fe.querySelector(`.${u}-list-col-title`),Ot={el:Fe,titleEl:yt,letter:Fe.getAttribute("data-col-letter")??"",kind:Fe.getAttribute("data-valign")??"top",anchor:Fe.getAttribute("data-valign-anchor")};return wt.set(Ot.letter,Ot),Ot}),Te=new Map,ze=(Fe,yt)=>{const Ot=Te.get(Fe.letter);if(Ot!==void 0)return Ot;const ut=Fe.anchor?wt.get(Fe.anchor):void 0;if(Fe.kind!=="baseline"||!ut||yt.has(Fe.letter)){const on=us(Fe,Wt,qt,jt);return Te.set(Fe.letter,on),on}yt.add(Fe.letter);const Tt=ze(ut,yt);yt.delete(Fe.letter);const Yt=us(Fe,Wt,qt,jt),It=Tt-Yt;T0(Fe.titleEl,It);const Zt=us(Fe,Wt,qt,jt);return Te.set(Fe.letter,Zt),Zt};W.forEach(Fe=>ze(Fe,new Set))})};let st=null;const At=()=>{st===null&&(st=requestAnimationFrame(()=>{st=null,nt()}))};nt();const St=new ResizeObserver(()=>At());St.observe(Re);let ht=!1;return typeof document<"u"&&((Dt=document.fonts)!=null&&Dt.ready)&&document.fonts.ready.then(()=>{ht||At()}),()=>{ht=!0,st!==null&&(cancelAnimationFrame(st),st=null),St.disconnect(),tt()}},[mt,ge,e,t,xe,Ye,Qe]);const gt=s.useMemo(()=>g0(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gt}}),a.jsx("div",{style:D,children:a.jsxs("div",{ref:we,className:`${u}-wrapper ${pe}${qe?` ${qe}`:""}${ge?` ${u}-type-b`:""}`.trim(),style:{width:A.scalingValue(m??0,n)},onMouseMove:J?$t:void 0,onMouseLeave:J?et:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ye.map((Re,tt)=>{var St;const nt=(((St=Re.link)==null?void 0:St.length)??0)>0,st=nt&&(!n||i)?"a":"div",At=Dc(tt,Ye.length,Ie,de,lt,S??0,n??!1);return a.jsxs(st,{ref:tt===0?ht=>{Ae.current=ht}:void 0,className:`${u}-list-item${nt||I==="always"?` ${u}-list-item-has-link`:""}${lt&&tt===Ye.length-1?` ${u}-list-item-before-cut`:""}`,...nt?{href:Re.link,target:"_blank"}:{},style:At,onMouseEnter:ht=>{H&&(nt||I==="always")&&Wc(ht,u),J&&ft(Re,ht)},onMouseLeave:ht=>{H&&(nt||I==="always")&&Oc(ht,u)},children:[We>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:ke(We)}}),a.jsxs("div",{className:`${u}-list-cols-row${ge?"":` ${u}-list-cols-row-h`}${p&&tt===0&&ge?` ${u}-list-cols-row-controls`:""}`,...ge?{}:{"data-list-row":""},style:ge?void 0:{minHeight:ke(ct)},children:[Xe.map((ht,Dt)=>{const Ct=Dt===Xe.length-1,qt=Ce[Dt],jt=ht.paddingBottom,Nt=c0(Re.cells[ht.key]),Bt=ge&&Nt&&jt>0,Wt=ge?{minHeight:ke(ct)}:{width:ke(Qe[Dt])},wt=ge?{paddingLeft:ke(ne),paddingRight:ke(ne)}:{paddingLeft:ke(qt.paddingLeft),paddingRight:ke(qt.paddingRight)},W=ht.textPrefix.charAt(0),Te=ge?v0(e[`${ht.textPrefix}VerticalAlign`]):y0(e[`${ht.textPrefix}VerticalAlign`],e,W),ze=ge&&Nt&&p&&tt===0;return ge&&!Nt?null:a.jsxs("div",{className:ge?`${u}-list-col-wrap`:void 0,...ge?{}:{"data-list-col":"","data-col-letter":W,"data-valign":Te.kind,...Te.kind==="baseline"?{"data-valign-anchor":Te.anchorLetter}:{}},children:[a.jsx("div",{className:`${u}-list-col${Ct?` ${u}-list-col-last`:""}`,style:{...wt,...Wt,...ge?{justifyContent:jc(Te.kind)}:{}},"data-test":ht.width,children:a.jsx("span",{className:Gc(e,ht.textPrefix,`${u}-list-col-title`,`${u}-text-tight-leading`),style:{...Vc($a(e,ht.textPrefix),n),...Xc(e,ht.textPrefix,u,n),...ge?{}:b0(Te.kind)},children:Re.cells[ht.key]??null})}),Bt&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:ke(jt)}}),ze&&a.jsx("div",{"data-controls":ht.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:ke(Math.max(jt,ps))}})]},ht.key)}),p&&tt===0&&ge&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(q),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:0,width:ke(ue),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(q),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:ke(Math.max(ue,be-ue)),width:ke(ue),height:"100%"}})]})]}),!ge&&Ve>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:ke(Ve)}}),p&&tt===0&&!ge&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:ke(ot)}})]},Re.id)}),p&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Pt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":ge?"center":"left-y",className:`${u}-control-anchor`,style:{top:xt,left:0,width:"100%",height:ke(Math.max(We,ps))}})},"row-padding-handles"),p&&!ge&&Vt&&vt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Vt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Qe[0]-((Mt==null?void 0:Mt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":fe??void 0,className:`${u}-control-anchor`,style:{top:0,left:0,width:ke(Gt),height:"100%"}}),a.jsx("div",{"data-controls":vt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Qe[Xe.length-1]-((Ht==null?void 0:Ht.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":fe??void 0,className:`${u}-control-anchor`,style:{top:0,left:ke(Pe-kt),width:ke(kt),height:"100%"}})]},"column-edge-padding-handles"),p&&!ge&&Xe.slice(0,-1).map((Re,tt)=>{const nt=Xe[tt+1],st=je.slice(0,tt+1).reduce((Ct,qt)=>Ct+qt,0),At=Ce[tt],St=Ce[tt+1],ht=Math.max(At.paddingRight,mo),Dt=Math.max(St.paddingLeft,mo);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Re.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Qe[tt]-At.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":fe??void 0,className:`${u}-control-anchor`,style:{top:0,left:ke(st-ht),width:ke(ht),height:"100%"}}),a.jsx("div",{"data-controls":nt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Qe[tt+1]-St.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":fe??void 0,className:`${u}-control-anchor`,style:{top:0,left:ke(st),width:ke(Dt),height:"100%"}})]},`${Re.paddingRightKey}-padding`)}),p&&!ge&&Xe.slice(0,-1).map((Re,tt)=>{const nt=z0(tt,je,He,be),At=je.slice(0,tt+1).reduce((St,ht)=>St+ht,0)-qc/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Re.widthKey,"data-controls-axis":"x","data-controls-min":String(Bl),"data-controls-max-fraction":String(nt),"data-controls-variant":"column-width",className:`${u}-col-resize-handle`,style:{position:"absolute",top:"0px",left:ke(At),width:ke(qc),height:"calc(100%)",pointerEvents:"auto"}})},`${Re.widthKey}-junction`)})]}),lt&&(()=>{const Re=$a(e,si),tt=S0(e.cutLabelVerticalAlign),nt=Re.textTextAlign==="justify"||ge;return a.jsx("button",{type:"button",className:`${u}-cut-item`,style:{minHeight:ke(R??0),cursor:Ee?"pointer":"default",...d0(de,S??0,n??!1)},onClick:Ee?pt:void 0,onMouseEnter:H||J?Et:void 0,onMouseLeave:H?Xt:void 0,children:a.jsx("div",{className:`${u}-list-cols-row`,style:{...ge?{paddingLeft:ke(ne),paddingRight:ke(ne)}:{},justifyContent:w0(Re.textTextAlign),alignItems:jc(tt)},children:a.jsx("span",{className:Gc(e,si,`${u}-cut-label`,`${u}-text-tight-leading`),style:{...Vc(Re,n),...Xc(e,si,u,n),...nt?{width:"100%"}:{}},children:X})})})})(),J&&ie&&typeof document<"u"&&(()=>{const Re=`${ie.widthPx}px`,tt={width:Re,height:"auto",maxHeight:Re,objectFit:"contain"},nt=(c?document.getElementById(c):null)??document.body;return Un.createPortal(a.jsx("div",{ref:me,className:`${u}-hover-media-anchor`,"data-selection":"none",children:a.jsx(l0,{media:ie,className:ie.isVideo?`${u}-hover-video`:`${u}-hover-image`,style:tt},`${ie.rowId}-${ie.assetId}`)}),nt)})()]})})]})}const q0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10350
10350
|
import { createPortal } from 'react-dom';
|
|
10351
10351
|
import { CommonComponentProps } from '../props';
|
|
10352
10352
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -13436,7 +13436,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13436
13436
|
</>
|
|
13437
13437
|
);
|
|
13438
13438
|
}
|
|
13439
|
-
`,zo=["A","B","C","D","E"],Yc=[...Us,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Ni={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 z0(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Gr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function j0(){return Object.fromEntries(zo.map((e,t)=>{const n=Pi[t],i=`${e} column`;return[n,z0(i)]}))}function V0(){const e={};for(const t of zo)e[`${t}ColumnWidth`]=Gr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Gr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Gr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Gr(`${t} column padding bottom`);return e}function Kc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Pi]};for(const r of zo)i[`${r}ColumnWidth`]=r==="A"?.0798:.32,i[`${r}ColumnPaddingLeft`]=0,i[`${r}ColumnPaddingRight`]=0,i[`${r}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function G0(e){const t={};if(e===ai)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Us]},enum:[...Us]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Yc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Yc]}}return t[Ut(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Ut(e,"textFontSettings")]={...Ni.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Ut(e,"textFontSize")]={...Ni.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ut(e,"textLineHeight")]={...Ni.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ut(e,"textLetterSpacing")]={...Ni.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ut(e,"textWordSpacing")]={...Ni.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ut(e,"textTextAlign")]={...Ni.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ut(e,"textTextAppearance")]={...Ni.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const X0=xr.reduce((e,t)=>({...e,...G0(t)}),{});function U0(e){return{verticalAlign:e===ai?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===ai?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function q0(e,t={}){var n;return{...U0(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Qc=new Set(["textFontFamily","textFontSettings"]);function Y0(e,t,n){const i=r=>n===void 0?!0:n==="common"?Qc.has(r):!Qc.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Dl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Ut(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Ut(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Ut(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Ut(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Ut(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Ut(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Ut(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Ut(e,"textTextAppearance")]=t.textTextAppearance),o}function ma(e={},t){return xr.reduce((n,i)=>({...n,...Y0(i,q0(i,e),t)}),{})}const K0=ma(),Q0=$0();function gp(e){return[Ut(e,"textFontFamily"),Ut(e,"textFontSettings"),Ut(e,"textFontSize"),Ut(e,"textLineHeight"),Ut(e,"textLetterSpacing"),Ut(e,"textWordSpacing"),Ut(e,"textTextAlign"),Ut(e,"textTextAppearance"),`${e}VerticalAlign`]}function Z0(){const e=[];return Ol.forEach((t,n)=>{const i=Pi[n],o=gp(t);for(let r=1;r<Pi.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(c,d)=>({name:`columnsOrder.${d}`,value:i,isNotEqual:!0}))];o.forEach(c=>{e.push({if:l,then:{name:`properties.${c}.display.visible`,value:!1}})})}}),e}const J0=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];gp(ai);const ex=[...zo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],_i=[{objectFit:"contain",assetId:"01M3QM74XESYN1HRYH9VRTZ5CK"},{objectFit:"contain",assetId:"01M3QM74XEVZ9F59FC7M9BA63Q"},{objectFit:"contain",assetId:"01M3QM74XEE2101QD8PM6E4JSA"},{objectFit:"contain",assetId:"01M3QM74XE20C38X4NND20C5R4"},{objectFit:"contain",assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA"},{objectFit:"contain",assetId:"01M3QM74XEBS5231QA4355P4VQ"},{objectFit:"contain",assetId:"01M3QM74XEWT5YM43KF6PEYRCV"}],tx=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:_i[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:_i[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:_i[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:_i[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:_i[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:_i[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:_i[6],link:""}],nx=[...zo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],ix={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...j0(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:tx},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"]}},imagePosition:{type:"string",scope:"layout",title:"Image Position",display:{type:"toggle-cycle",enum:["left","center","right","cursor"]}},imageInterpolation:{type:"boolean",scope:"common",title:"Interpolation",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"}},...V0(),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"}},...X0,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",imagePosition:"cursor",imageInterpolation:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...K0,...ma({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Kc({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},...ma({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Kc({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},...ma({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Z0(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...ex.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}},...zo.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),{if:{name:"imagePosition",value:"cursor",isNotEqual:!0},then:{name:"properties.imageInterpolation.display.enabled",value:!1}}],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imagePosition","imageInterpolation","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...nx]},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:"",items:["imagePosition","imageInterpolation"]},{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__",Q0]}],paletteBookmark:{items:[...J0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},ox={element:D0,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>F0(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...xr.map(e=>({path:`${Ut(e,"textFontFamily")}`}))]},fontRelations:{...xr.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Ut(t,"textFontFamily")}`}),{})},schema:ix,sourceCode:B0},Zc=300,gi=.004,rx={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"},ax=["hover","focus","filled","success","error"];function sx(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Jc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ed(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 lx(e){return`
|
|
13439
|
+
`,Vo=["A","B","C","D","E"],Yc=[...Xs,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Wi={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 U0(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Gr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Y0(){return Object.fromEntries(Vo.map((e,t)=>{const n=Ei[t],i=`${e} column`;return[n,U0(i)]}))}function K0(){const e={};for(const t of Vo)e[`${t}ColumnWidth`]=Gr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Gr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Gr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Gr(`${t} column padding bottom`);return e}function Kc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Ei]};for(const r of Vo)i[`${r}ColumnWidth`]=r==="A"?.0798:.32,i[`${r}ColumnPaddingLeft`]=0,i[`${r}ColumnPaddingRight`]=0,i[`${r}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Q0(e){const t={};if(e===si)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Xs]},enum:[...Xs]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Yc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Yc]}}return t[Qt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Qt(e,"textFontSettings")]={...Wi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Qt(e,"textFontSize")]={...Wi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Qt(e,"textLineHeight")]={...Wi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Qt(e,"textLetterSpacing")]={...Wi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Qt(e,"textWordSpacing")]={...Wi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Qt(e,"textTextAlign")]={...Wi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Qt(e,"textTextAppearance")]={...Wi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Z0=xr.reduce((e,t)=>({...e,...Q0(t)}),{});function J0(e){return{verticalAlign:e===si?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===si?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function ex(e,t={}){var n;return{...J0(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Qc=new Set(["textFontFamily","textFontSettings"]);function tx(e,t,n){const i=r=>n===void 0?!0:n==="common"?Qc.has(r):!Qc.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Dl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Qt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Qt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Qt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Qt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Qt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Qt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Qt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Qt(e,"textTextAppearance")]=t.textTextAppearance),o}function ga(e={},t){return xr.reduce((n,i)=>({...n,...tx(i,ex(i,e),t)}),{})}const nx=ga(),ix=R0();function xp(e){return[Qt(e,"textFontFamily"),Qt(e,"textFontSettings"),Qt(e,"textFontSize"),Qt(e,"textLineHeight"),Qt(e,"textLetterSpacing"),Qt(e,"textWordSpacing"),Qt(e,"textTextAlign"),Qt(e,"textTextAppearance"),`${e}VerticalAlign`]}function ox(){const e=[];return Ol.forEach((t,n)=>{const i=Ei[n],o=xp(t);for(let r=1;r<Ei.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(c,d)=>({name:`columnsOrder.${d}`,value:i,isNotEqual:!0}))];o.forEach(c=>{e.push({if:l,then:{name:`properties.${c}.display.visible`,value:!1}})})}}),e}const rx=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];xp(si);const ax=[...Vo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],Oi=[{objectFit:"contain",assetId:"01M3QM74XESYN1HRYH9VRTZ5CK"},{objectFit:"contain",assetId:"01M3QM74XEVZ9F59FC7M9BA63Q"},{objectFit:"contain",assetId:"01M3QM74XEE2101QD8PM6E4JSA"},{objectFit:"contain",assetId:"01M3QM74XE20C38X4NND20C5R4"},{objectFit:"contain",assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA"},{objectFit:"contain",assetId:"01M3QM74XEBS5231QA4355P4VQ"},{objectFit:"contain",assetId:"01M3QM74XEWT5YM43KF6PEYRCV"}],sx=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:Oi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:Oi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:Oi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:Oi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:Oi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:Oi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:Oi[6],link:""}],lx=[...Vo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],cx={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Y0(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:sx},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"]}},imagePosition:{type:"string",scope:"layout",title:"Image Position",display:{type:"toggle-cycle",enum:["left","center","right","cursor"]}},imageInterpolation:{type:"boolean",scope:"common",title:"Interpolation",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"}},...K0(),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"}},...Z0,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",imagePosition:"cursor",imageInterpolation:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...nx,...ga({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Kc({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},...ga({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Kc({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},...ga({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...ox(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...ax.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}},...Vo.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),{if:{name:"imagePosition",value:"cursor",isNotEqual:!0},then:{name:"properties.imageInterpolation.display.enabled",value:!1}}],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imagePosition","imageInterpolation","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...lx]},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:"",items:["imagePosition","imageInterpolation"]},{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__",ix]}],paletteBookmark:{items:[...rx],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},dx={element:X0,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>D0(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...xr.map(e=>({path:`${Qt(e,"textFontFamily")}`}))]},fontRelations:{...xr.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Qt(t,"textFontFamily")}`}),{})},schema:cx,sourceCode:q0},Zc=300,fi=.004,ux={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"},px=["hover","focus","filled","success","error"];function mx(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Jc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ed(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:A.scalingValue((o-t)/2,i)}}function gx(e){return`
|
|
13440
13440
|
.${e}-wrapper {
|
|
13441
13441
|
box-sizing: border-box;
|
|
13442
13442
|
display: flex;
|
|
@@ -13498,7 +13498,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13498
13498
|
display: flex;
|
|
13499
13499
|
align-items: center;
|
|
13500
13500
|
justify-content: space-between;
|
|
13501
|
-
gap: ${
|
|
13501
|
+
gap: ${mx(20)};
|
|
13502
13502
|
width: 100%;
|
|
13503
13503
|
min-width: 0;
|
|
13504
13504
|
min-height: var(--${e}-question-min-height, unset);
|
|
@@ -13601,7 +13601,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13601
13601
|
pointer-events: none;
|
|
13602
13602
|
z-index: 2;
|
|
13603
13603
|
}
|
|
13604
|
-
`}function td(e,t,n,i,o,r,l,c){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:r??0,textAppearance:l,color:c??"#000000"}}function
|
|
13604
|
+
`}function td(e,t,n,i,o,r,l,c){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:r??0,textAppearance:l,color:c??"#000000"}}function hx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=A.useScopedStyles(),c=o??!1,{wrapperWidth:d=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:v="solid",entryHoverEffect:x="default",autoclose:m="off",icon:h,iconMaxWidth:b=.00833,iconPaddingRight:S=0,iconAnimation:M="rotate 45",questionColor:y="#000000",answerColor:$="#000000",dividerColor:R="#0000001F",iconColor:X="#000000",questionHoverColor:B="#666666",iconHoverColor:O="#666666",iconActiveColor:N="#000000",dividerHoverColor:z="#000000",questionFontFamily:C,questionFontSettings:I,questionFontSize:j,questionLineHeight:E,questionLetterSpacing:w,questionWordSpacing:L,questionTextAppearance:V,answerFontFamily:_,answerFontSettings:K,answerFontSize:P,answerLineHeight:f,answerLetterSpacing:U,answerWordSpacing:te,answerTextAppearance:ce,questionPaddingLeft:F=0,questionPaddingTop:ie=0,questionPaddingBottom:T=0,answerPaddingLeft:le=0,answerPaddingRight:J=0,answerPaddingTop:Se=0,answerPaddingBottom:Le=0}=e,me=t??[],[ye,ee]=s.useState(()=>new Set),oe=!n||i;s.useEffect(()=>{ee(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&ee(new Set)},[n,o,i]);const re=Qe=>A.scalingValue(Qe,n??!1),ge=Math.max(F,fi),we=Math.max(ie,fi),Ae=Math.max(T,fi),fe=Math.max(le,fi),ve=Math.max(J,fi),xe=Math.max(Se,fi),g=Math.max(Le,fi),G=Math.max(0,(d??1)-S-b),Q=Math.max(0,(d??1)-J),ne=Math.max(0,(d??1)-le),ue=Math.max(S,fi),q=Math.max(0,(d??1)-F-b),D=s.useMemo(()=>ye.size===0?0:Math.min(...ye),[ye]),se=s.useCallback(Qe=>ye.has(Qe),[ye]),Y=oe&&x==="default"?`${l}-entry-hover-default`:"",pe=h??"",H=pe!=="",Ie=M.replace(/^rotate /,""),de=`${l}-icon-anim-${Ie}`,Z=pn(nn(td(C,I,j,E,w,L,V,y),n)),Ne=pn(nn(td(_,K,P,f,U,te,ce,$),n)),Oe=Jc(j,E,`${l}-question`,`${l}-text-tight-leading`),Je=Jc(P,f,`${l}-answer-text`,`${l}-text-tight-leading`),De=ed(j,E,l,n),Ze=ed(P,f,l,n),at=A.buildColorVars(l,{questionColor:y,answerColor:$,dividerColor:R,iconColor:X,questionHoverColor:B,iconHoverColor:O,iconActiveColor:N,dividerHoverColor:z},ux,px),Xe=r&&r!=="default"?`${l}-state-${r}`:"",be=s.useCallback(Qe=>{oe&&ee(Ce=>{if(Ce.has(Qe)){const Ue=new Set(Ce);return Ue.delete(Qe),Ue}if(m==="on")return new Set([Qe]);const _e=new Set(Ce);return _e.add(Qe),_e})},[oe,m]),He=s.useMemo(()=>gx(l),[l]),je={[`--${l}-divider-width`]:A.scalingValue(p,n??!1),[`--${l}-divider-style`]:v,[`--${l}-icon-max-width`]:A.scalingValue(b,n??!1),...u>0?{[`--${l}-question-min-height`]:A.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:He}}),a.jsx("div",{style:at,children:a.jsx("div",{className:Rt(`${l}-wrapper`,n&&!i&&`${l}-editor`,Y,Xe),style:{width:A.scalingValue(d,n??!1),maxWidth:"100%",...je},children:me.map((Qe,Ce)=>{var qe;const _e=se(Ce),Ue=((qe=Qe.question)==null?void 0:qe.trim())??"",Ye=Qe.answer,lt=((Ye==null?void 0:Ye.length)??0)>0,it=c&&Ce===D;return a.jsxs("div",{className:Rt(`${l}-item`,_e&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[it&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"questionPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:re(we)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(G),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:re(ge),height:"100%"}}),a.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(q),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:re(ue),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":_e,style:{...Z,...De,paddingLeft:re(F),paddingRight:re(S)},onClick:()=>be(Ce),children:[ie>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:re(ie)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:Oe,children:Ue}),lt&&(H?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${de}`,"aria-hidden":"true",children:a.jsx(gn,{url:pe,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):a.jsx("span",{className:`${l}-icon ${l}-icon-default ${de}`,"aria-hidden":"true"}))]}),T>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:re(T)},"aria-hidden":"true"})]}),it&&a.jsx("div",{"data-controls":"questionPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:re(Ae)}})]}),lt&&Ye&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!_e,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[it&&_e&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"answerPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:re(xe)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Q),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:re(fe),height:"100%"}}),a.jsx("div",{"data-controls":"answerPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ne),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:re(ve),height:"100%"}})]}),Se>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:re(Se)}}),a.jsx("div",{className:`${l}-answer`,style:{...Ne,...Ze,paddingLeft:re(le),paddingRight:re(J)},children:a.jsx("div",{className:Je,children:a.jsx(Zi,{content:Ye})})}),Le>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:re(Le)}}),it&&_e&&a.jsx("div",{"data-controls":"answerPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:re(g)}})]})})})]},Ce)})})})]})}const fx=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13605
13605
|
import cn from 'classnames';
|
|
13606
13606
|
import { CommonComponentProps } from '../props';
|
|
13607
13607
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -14349,7 +14349,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14349
14349
|
</>
|
|
14350
14350
|
);
|
|
14351
14351
|
}
|
|
14352
|
-
`;function mi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const nd={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ux=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],px={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:mi("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:{...nd.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:{...nd.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:mi("Question Padding Left"),questionPaddingTop:mi("Question Padding Top"),questionPaddingBottom:mi("Question Padding Bottom"),answerPaddingLeft:mi("Answer Padding Left"),answerPaddingRight:mi("Answer Padding Right"),answerPaddingTop:mi("Answer Padding Top"),answerPaddingBottom:mi("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"01M3QM74XGFBPMXNEQB1BXSD9E",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:[...ux],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},gx={element:cx,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:px,sourceCode:dx},si=e=>e.display==="cover",ja=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},id=100,mx=.2,od=8,mp=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,c]=s.useState(!1),d=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?id:Math.max(id,window.innerHeight*mx),[]),y=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),v=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),g=s.useCallback($=>{const I=typeof window<"u"?window.innerHeight:800,D=Math.max(.88,1-$/I*.12);return`translateY(${$}px) scale(${D})`},[]),m=s.useCallback(()=>{d.current=null},[]),x=s.useCallback(()=>{c(!0),r(0),window.setTimeout(()=>c(!1),n),m()},[n,m]),b=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;c(!0),r($),window.setTimeout(()=>{t(),m(),c(!1)},Math.min(n,200))},[n,t,m]),M=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(d.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),f=s.useCallback($=>{const I=d.current;if(!e||!I||$.pointerType!=="touch"||I.pointerId!==$.pointerId)return;const D=$.clientX-I.startX,E=$.clientY-I.startY;if(I.isLocked===null){if(Math.abs(D)<od&&Math.abs(E)<od)return;if(E>0&&E>Math.abs(D))I.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{I.isLocked=!1,m();return}}if(!I.isLocked)return;$.preventDefault();const T=Math.max(0,E);u.current=T,r(T)},[e,m]),S=s.useCallback($=>{const I=d.current;if(!e||!I||$.pointerType!=="touch"||I.pointerId!==$.pointerId)return;const D=I.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!D){m();return}$.clientY-I.startY>=p?b():x()},[p,b,e,m,x]),W=s.useCallback($=>{S($)},[S]),q=s.useCallback($=>{S($)},[S]),z=o>0,L=l?`transform ${n}ms ease`:"none",_=l?`opacity ${n}ms ease`:"none",G=o>0||l;return{isSwipeDragging:z,backdropStyle:{opacity:y(o),transition:_},mediaAreaStyle:{transform:g(o),transition:L,touchAction:z?"none":void 0,willChange:z?"transform":void 0},overlayContentStyle:G?{opacity:v(o),transition:_}:void 0,swipeHandlers:e?{onPointerDown:M,onPointerMove:f,onPointerUp:W,onPointerCancel:q}:{},dismissAreaStyle:e?{touchAction:z?"none":"pan-x"}:void 0}},hx="[data-lightbox-scrollable]",jl=(e=!0)=>{s.useEffect(()=>{if(!e)return;const t=window.scrollY,n=document.body.style.overflow,i=document.body.style.position,o=document.body.style.top,r=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${t}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const c=d=>{const u=d.target;u instanceof Element&&u.closest(hx)||d.preventDefault()};return document.addEventListener("touchmove",c,{passive:!1}),()=>{document.removeEventListener("touchmove",c),document.body.style.overflow=n,document.body.style.position=i,document.body.style.top=o,document.body.style.width=r,document.documentElement.style.overflow=l,window.scrollTo({top:t,left:0,behavior:"instant"})}},[e])},fx=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},yx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},vx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},xx=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,c=n-l,d=l-n,u=(m,x)=>{yx(t),e.scrollLeft=m,x&&(r==null||r())};if(Math.abs(c)<.5)return u(n,!0),()=>{};let p=!1,y=0;const v=()=>{t.removeEventListener("transitionend",g),clearTimeout(y)},g=m=>{m.target!==t||m.propertyName!=="transform"||p||(p=!0,v(),u(n,!0))};return t.addEventListener("transitionend",g),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(${d}px, 0, 0)`,y=window.setTimeout(()=>{p||(p=!0,v(),u(n,!0))},i+64),()=>{p||(p=!0,v(),u(l-vx(t),!1))}},cr=300,bx=900,Sx=1500,wx="cubic-bezier(0.16, 1, 0.3, 1)",$x=3e3,Cx=2,Tx=16,Ix=.05,Lx=1,Xr=.3,Px=50,Rx=20,oo=.004,Ao=["title1","title2","title3"],Mx={title1:"1",title2:"2",title3:"3"},Ex={title1:"title1Color",title2:"title2Color",title3:"title3Color"},kx={title1:.02,title2:.02,title3:.02},Ur=e=>`max(${e}, ${Rx}px)`,Ax=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]}},Fx=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=Ax(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Qt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Nx=e=>[Qt(e,"fontFamily"),Qt(e,"fontSettings"),{type:"row",items:[Qt(e,"fontSize"),Qt(e,"lineHeight"),Qt(e,"letterSpacing"),Qt(e,"wordSpacing")]},Qt(e,"textAlign"),Qt(e,"textAppearance")],_x=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Ao.map(e=>[Mx[e],Nx(e)]))}),Vl=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},c)=>{if(r<=0||c<=0)return{overflow:r,widths:[c,...l]};const d=Math.min(r,c);return{overflow:r-d,widths:[c-d,...l]}},{overflow:i-1,widths:[]});return o},hp=(e,t)=>Vl(e,t),qr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},rd=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Vl(e.length,n),effective:hp(e.length,n)}},Hx=(e,t,n,i,o,r,l)=>{const c=[];return t&&c.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&c.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&c.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),c},ms=(e,t)=>{const n=i=>{const o=Qt(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[Ex[t]]}},Wx=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),hs=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??kx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return en(i,n)},Ox=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:c,thumbnailSize:d,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:y,closeIcon:v,closeIconMaxWidth:g,closeIconColor:m,closeIconHoverColor:x,thumbnailTrigger:b,thumbnailVisibility:M,thumbnailObjectFit:f,thumbnailActive:S,thumbnailActiveColor:W,title1Width:q,title2Width:z,title3Width:L,title1MarginLeft:_=0,title2MarginLeft:G=0,title3MarginLeft:$=0,titleRowMarginBottom:I=0,titleHeaderLayout:D="desktop",contentMarginTop:E,iconMarginLeft:T}=n,C=k=>F.scalingValue(k,i??!1),V=d??n.thumnailSize??.03,w=C(V),U=C(u),P=C(p??.02),A=C(y??0),j=C(E??0),ie=Ur(j),ae=C(T??0),[O,re]=s.useState(0),N=s.useRef(O);N.current=O;const le=t[O],{title1:J,title2:be,title3:Le}=Fx(le),ye=hs("title1",ms(n,"title1"),i),ce=hs("title2",ms(n,"title2"),i),K=hs("title3",ms(n,"title3"),i),se=D==="mobile",pe=!o&&(!i||r),fe=pe,we=pe,Re=pe,me=si(f),xe=me?{"--image-aspect-ratio":ja(f)}:void 0,Ce=!!(J||be||Le),h=s.useMemo(()=>Hx(e,J,be,Le,ye,ce,K),[e,O,J,be,Le,ye,ce,K]),Y=s.useMemo(()=>({title1Width:q,title2Width:z,title3Width:L}),[q,z,L]),Q=s.useMemo(()=>h.map(k=>Y[k.widthKey]),[h,Y]),ne=s.useMemo(()=>Vl(h.length,Q),[h.length,Q]),ue=s.useMemo(()=>hp(h.length,Q),[h.length,Q]),B=s.useMemo(()=>h.filter(k=>k.prefix==="title1"),[h]),R=s.useMemo(()=>h.filter(k=>k.prefix==="title2"||k.prefix==="title3"),[h]),ee=s.useMemo(()=>rd(B,Y),[B,Y]),te=s.useMemo(()=>rd(R,Y),[R,Y]),ge=s.useCallback((k,oe)=>{const de=h.indexOf(k);if(!se||oe==="single-row")return{effectiveWidth:ue[de]??0,resolvedWidth:ne[de]??0,maxWidth:qr(de,ne)};if(oe==="two-row-top"){const Xe=B.indexOf(k);return{effectiveWidth:ee.effective[Xe]??0,resolvedWidth:ee.resolved[Xe]??0,maxWidth:qr(Xe,ee.resolved)}}const Ee=R.indexOf(k);return{effectiveWidth:te.effective[Ee]??0,resolvedWidth:te.resolved[Ee]??0,maxWidth:qr(Ee,te.resolved)}},[R,te,ue,ne,h,B,ee,se]),X=s.useCallback(k=>F.scalingValue(k,i??!1),[i]),Pe=X(I??0),Se=s.useMemo(()=>({title1MarginLeft:_,title2MarginLeft:G,title3MarginLeft:$}),[_,G,$]),Z=s.useCallback(k=>h.slice(0,k+1).reduce((oe,de,Ee)=>oe+(de!=null&&de.marginLeftKey?Se[de.marginLeftKey]??0:0)+(ne[Ee]??0),0)+(se?0:_??0),[h,Se,ne,se,_]),He=s.useCallback(()=>se?0:_??0,[se,_]),We=s.useCallback(k=>R.slice(0,k).reduce((oe,de,Ee)=>oe+(de.marginLeftKey?Se[de.marginLeftKey]??0:0)+(te.resolved[Ee]??0),0),[R,te.resolved,Se]),ot=s.useCallback(k=>{const oe=R[k];return We(k)+(oe.marginLeftKey?Se[oe.marginLeftKey]??0:0)+(te.resolved[k]??0)},[R,te.resolved,We,Se]),qe=(k,oe)=>{const de=k.marginLeftKey?Se[k.marginLeftKey]??0:0,{effectiveWidth:Ee,resolvedWidth:Xe,maxWidth:lt}=ge(k,oe),Et=o&&oe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":k.prefix,style:{...oe==="single-row"?{gridArea:k.prefix}:{},width:X(Ee),...de>0?{marginLeft:X(de)}:{}},children:[a.jsx("p",{className:k.className,style:k.style,children:k.text}),Et&&k.marginLeftKey&&a.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:X(-de),width:`max(${X(de)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Et&&a.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(lt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:X(-oo/2),width:X(oo),height:"100%",pointerEvents:"auto"}})]},k.className)},tt=()=>{const k=se?-1:h.findIndex(Ee=>Ee.prefix==="title1"),oe=!se&&(o||(_??0)>0)?(()=>{const Ee=_??0,Xe=k>=0?ne[k]:q??0;return a.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(${X(Ee)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,de=h.flatMap((Ee,Xe)=>{if(!Ee.marginLeftKey)return[];const lt=Se[Ee.marginLeftKey]??0,Et=Wx(h,ne,Se,Xe)+He();return a.jsx("div",{"data-controls":Ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ne[Xe]),style:{position:"absolute",top:0,left:X(Et),width:`max(${X(lt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Ee.marginLeftKey)});return oe?[oe,...de]:de},et=()=>h.map((k,oe)=>{const de=qr(oe,ne),Xe=Z(oe)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(de),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:X(Xe),width:X(oo),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),Ge=()=>R.flatMap((k,oe)=>{if(!k.marginLeftKey)return[];const de=Se[k.marginLeftKey]??0,Ee=We(oe),{resolvedWidth:Xe}=ge(k,"two-row-bottom");return a.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:X(Ee),width:`max(${X(de)}, 10px)`,height:"100%",pointerEvents:"auto"}},k.marginLeftKey)}),ve=()=>R.map((k,oe)=>{const{maxWidth:de}=ge(k,"two-row-bottom"),Xe=ot(oe)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(de),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:X(Xe),width:X(oo),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),_e=s.useRef(null),ze=s.useRef(null),Qe=s.useRef(null),$e=s.useRef(null),Ne=s.useRef([]),Ye=s.useRef([]),Ze=s.useRef(0),st=s.useRef(null),it=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Oe=s.useRef(null),Ae=s.useRef(null),mt=s.useRef(0),Be=s.useRef("forward"),De=s.useRef(0),Ue=s.useRef(null),ct=s.useRef(!1),he=t.length>1&&(!o||!!r),Me=he?3:1,nt=s.useMemo(()=>Array.from({length:Me},()=>t).flat(),[t,Me]),[pt,Ve]=s.useState(!1),[vt,Pt]=s.useState(!1),[At,wt]=s.useState(!0),Vt=s.useRef(null),jt=s.useRef(null),Yt=s.useRef(!1),Kt=s.useRef(!1),Rt=s.useRef(null),zt=s.useRef(null),on=fe&&!At,xt=s.useCallback(()=>{fe&&(wt(!0),zt.current&&clearTimeout(zt.current),zt.current=setTimeout(()=>{it.current.isActive||wt(!1)},$x))},[fe]),yt=s.useCallback(()=>{o||Kt.current||(Kt.current=!0,Pt(!1),Rt.current=setTimeout(()=>{l()},cr))},[o,l]),ke=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":on?"true":"false",style:{width:F.scalingValue(g??0,i),height:F.scalingValue(g??0,i),marginRight:ae,"--close-icon-hover-color":x},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:yt,"aria-label":"Close",children:a.jsx(gn,{url:v,fill:m,hoverFill:i&&!r?m:x,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ae,height:"100%",pointerEvents:"auto"}})]}),Je=(k="two-row")=>a.jsx("div",{...k==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:X(_??0),flexShrink:0,...k==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...k==="two-row"&&o?{pointerEvents:"auto"}:{}}}),rt=()=>{const k=h.find(Ee=>Ee.prefix==="title1"),oe=h.filter(Ee=>Ee.prefix==="title2"||Ee.prefix==="title3"),de=oe.length>0||o||(I??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(_??0)>0||o?Je():null,k&&qe(k,"two-row-top"),v&&ke()]}),de?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[oe.map(Ee=>qe(Ee,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ge(),ve()]})]}):null,a.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:Pe,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},dt=()=>a.jsxs(a.Fragment,{children:[(_??0)>0||o?Je("single-row"):null,h.map(k=>qe(k,"single-row")),o?a.jsxs(a.Fragment,{children:[tt(),et()]}):null,v?ke():null]}),Lt=s.useCallback(k=>!!(k.closest("[data-controls]")||k.closest(`.${e}-thumbnails`)||k.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:St,backdropStyle:ht,mediaAreaStyle:Wt,overlayContentStyle:Tt,swipeHandlers:Ot,dismissAreaStyle:Gt}=mp({enabled:pe??!1,onClose:yt,animMs:cr,isBlockedTarget:Lt}),kt=()=>{if(!he||t.length===0)return Ze.current=0,0;const k=Ye.current[0],oe=Ye.current[t.length];if(!k||!oe)return Ze.current;const de=oe.offsetLeft-k.offsetLeft;return de>0&&(Ze.current=de),Ze.current},_t=(k=!1)=>{if(!he)return;const oe=ze.current,de=kt();!oe||de<=0||de<oe.clientWidth*.25||(oe.scrollLeft<=0?(oe.scrollLeft+=de,k&&(it.current.scrollLeft+=de),ct.current&&(De.current+=de)):oe.scrollLeft>=de*2&&(oe.scrollLeft-=de,k&&(it.current.scrollLeft-=de),ct.current&&(De.current-=de)))},Ft=(k,oe=(de=>(de=ze.current)==null?void 0:de.scrollLeft)()??0)=>{if(!he)return k;let Ee=t.length+k,Xe=1/0;for(let lt=0;lt<Me;lt++){const Et=lt*t.length+k,Bt=Ye.current[Et];if(!Bt)continue;const rn=Math.abs(Bt.offsetLeft-oe);rn<Xe&&(Xe=rn,Ee=Et)}return Ee},ut=k=>{const oe=ze.current;return!k||!oe?!1:k.offsetWidth>oe.clientWidth+1},H=k=>{const oe=ze.current;if(!k||!oe||!ut(k))return!1;const de=k.offsetLeft,Ee=de+k.offsetWidth;return oe.scrollLeft>=de-1&&oe.scrollLeft+oe.clientWidth<=Ee+1},Ie=(k=(oe=>(oe=ze.current)==null?void 0:oe.scrollLeft)()??0)=>{for(let Ee=0;Ee<Ye.current.length;Ee+=1){const Xe=Ye.current[Ee];if(Xe&&H(Xe))return Ee}let de={flatIndex:0,distance:1/0};return Ye.current.forEach((Ee,Xe)=>{if(!Ee)return;const lt=Math.abs(Ee.offsetLeft-k);lt<de.distance&&(de={flatIndex:Xe,distance:lt})}),de.flatIndex},je=k=>{ze.current&&Ye.current.forEach(oe=>{oe&&(oe.style.scrollSnapAlign=ut(oe)&&k==="backward"?"end":"start")})},Fe=(k,oe,de)=>{const Ee=k-oe,Xe=Ie(oe),lt=Ye.current[Xe];if(H(lt))return Ie(k)%t.length;const Et=Ye.current[Xe+1],Bt=lt?Et?Et.offsetLeft-lt.offsetLeft:lt.offsetWidth:0,rn=Bt>0?Ee>Bt*Xr?1:Ee<-Bt*Xr?-1:0:0;return rn===0?de:he?(de+rn+t.length)%t.length:Math.max(0,Math.min(t.length-1,de+rn))},ft=s.useCallback((k=!1)=>{if(M!=="on"||o)return;const oe=$e.current,de=N.current,Ee=Ne.current[de];if(!oe||!Ee||oe.scrollWidth<=oe.clientWidth)return;const Xe=oe.scrollLeft,lt=Xe+oe.clientWidth,Et=Ee.offsetLeft,Bt=Et+Ee.offsetWidth;if(Et>=Xe&&Bt<=lt)return;const rn=oe.scrollWidth-oe.clientWidth;let Zt=Xe;if(!k&&Vt.current===null){const ui=Ne.current[de-1],En=Ne.current[de+1],Qn=ui?Ee.offsetLeft-ui.offsetLeft:En?En.offsetLeft-Ee.offsetLeft:Ee.offsetWidth;Bt>lt?Zt+=Qn:Et<Xe&&(Zt-=Qn)}else Bt>lt?Zt=Bt-oe.clientWidth:Zt=Et;oe.scrollLeft=Math.max(0,Math.min(rn,Zt))},[o,M]),Ht=s.useCallback((k=!1)=>{k&&(Yt.current=!0),jt.current===null&&(jt.current=requestAnimationFrame(()=>{jt.current=null;const oe=Yt.current;Yt.current=!1,ft(oe)}))},[ft]),gt=s.useCallback(k=>{if(k===N.current)return;const oe=N.current;N.current=k;const de=Math.abs(k-oe)>1,Ee=he&&t.length>1&&(oe===t.length-1&&k===0||oe===0&&k===t.length-1);re(k),Ht(de||Ee)},[t.length,he,Ht]),It=()=>{if(!ze.current||t.length===0||Vt.current!==null||it.current.isActive&&it.current.hasMoved)return;const k=ze.current.scrollLeft,oe=Ie(k)%t.length;oe!==N.current&>(oe)},qt=()=>{Vt.current=null},Dt=k=>{const oe=ze.current;oe&&(oe.style.scrollSnapType=k?"":"none")},an=()=>{var k;(k=Ae.current)==null||k.call(Ae),Ae.current=null},cn=()=>{Ue.current!==null&&(cancelAnimationFrame(Ue.current),Ue.current=null),ct.current=!1},qn=()=>{const k=ze.current;if(!k){Ue.current=null,ct.current=!1;return}const oe=De.current-k.scrollLeft;if(Math.abs(oe)<.5){k.scrollLeft=De.current,_t(),It(),Ue.current=null,ct.current=!1;return}k.scrollLeft+=oe*Ix,_t(),It(),xt(),Ue.current=requestAnimationFrame(qn)},Yn=()=>{const k=Qe.current;k&&(k.style.transition="",k.style.transform="",k.style.willChange="")},Qi=(k,oe,de,Ee)=>{Yn(),k.scrollLeft=oe,mt.current=k.scrollLeft,_t(),de!==void 0?(N.current=de,re(de)):It(),Dt(!0),Ee==null||Ee()},hn=(k,{behavior:oe="smooth",activeIndex:de,onComplete:Ee}={})=>{const Xe=ze.current,lt=Qe.current;if(!Xe||!lt)return;if(cn(),an(),Dt(!1),oe==="auto"){Qi(Xe,k,de,Ee);return}const Et=Math.abs(k-Xe.scrollLeft),Bt=fx(Et,bx,Sx,Xe.clientWidth*.55);Ae.current=xx(Xe,lt,k,{duration:Bt,easing:wx,onComplete:()=>{Ae.current=null,Qi(Xe,k,de,Ee)}})},Vo=(k="smooth")=>{const oe=ze.current;if(!oe||t.length===0)return;const de=Ie()%t.length,Ee=Ft(de,oe.scrollLeft),Xe=Ye.current[Ee];Xe&&hn(Xe.offsetLeft,{behavior:k,activeIndex:de})},Go=(k,oe="smooth",de,Ee)=>{const Xe=ze.current;if(!Xe||t.length===0)return;const lt=(Ee??Xe.scrollLeft)-k,Et=Ie(k),Bt=Ye.current[Et];if(H(Bt)){Dt(!0),It();return}const rn=Ye.current[Et+1],Zt=Bt?rn?rn.offsetLeft-Bt.offsetLeft:Bt.offsetWidth:0;if((Zt>0?lt>Zt*Xr?1:lt<-Zt*Xr?-1:0:0)!==0){const Kl=de??Et%t.length,Xo=Fe(Ee??Xe.scrollLeft,k,Kl);xn(Xo,oe);return}const En=Ee??Xe.scrollLeft,Qn=Ie(En),kr=Ye.current[Qn];if(kr&&Math.abs(kr.offsetLeft-En)<1){Dt(!0),It();return}Vo("auto")},xn=(k,oe="smooth")=>{const de=ze.current;if(!de||t.length===0)return;const Ee=Ft(k,de.scrollLeft),Xe=Ye.current[Ee];Xe&&(oe==="smooth"?Vt.current=k:Vt.current=null,N.current=k,re(k),Ht(!0),hn(Xe.offsetLeft,{behavior:oe,activeIndex:k,onComplete:oe==="smooth"?qt:void 0}))},di=()=>{Oe.current&&(window.removeEventListener("pointerup",Oe.current),window.removeEventListener("pointercancel",Oe.current),Oe.current=null)},Zi=(k,oe,de,Ee,Xe)=>{const lt=de-k,Et=Ee-oe,Bt=Math.abs(lt),rn=Math.abs(Et);if(Bt<Px||Bt<=rn)return!1;const Zt=lt<0?1:-1,ui=he?(Xe+Zt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Xe+Zt));return ui===Xe?!1:(xn(ui),!0)},bn=k=>{if(!it.current.isActive)return;di();const oe=ze.current;if(!oe)return;const{scrollLeft:de,startActiveIndex:Ee,hasMoved:Xe}=it.current,lt=oe.scrollLeft;_t(!0),it.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Ve(!1),k!==void 0&&oe.hasPointerCapture(k)&&oe.releasePointerCapture(k),Xe?Go(de,"smooth",Ee,lt):(Dt(!0),It()),xt()},Kn=(k,oe)=>{const de=st.current;st.current=null,de&&(Zi(de.startX,de.startY,k,oe,de.startActiveIndex),xt())},Ji=k=>{if(!we)return;if(k.pointerType==="touch"){if(cn(),Dt(!0),Lt(k.target))return;st.current={startX:k.clientX,startY:k.clientY,startActiveIndex:N.current};return}if(k.pointerType!=="mouse"||k.button!==0||Lt(k.target))return;const oe=ze.current;if(!oe)return;cn(),an(),Yn(),Vt.current=null,it.current={isActive:!0,startX:k.clientX,scrollLeft:oe.scrollLeft,startActiveIndex:N.current,hasMoved:!1},Dt(!1),xt(),oe.setPointerCapture(k.pointerId),di();const de=Ee=>{Ee.pointerType==="mouse"&&bn(Ee.pointerId)};Oe.current=de,window.addEventListener("pointerup",de),window.addEventListener("pointercancel",de)},eo=k=>{if(!we||k.pointerType!=="mouse")return;const oe=ze.current;if(!oe||!it.current.isActive)return;if(k.buttons===0){bn(k.pointerId);return}const de=k.clientX-it.current.startX;Math.abs(de)>Lx&&(it.current.hasMoved=!0,Ve(!0)),it.current.hasMoved&&(k.preventDefault(),oe.scrollLeft=it.current.scrollLeft-de,_t(!0),It(),xt())},Te=k=>{if(we){if(k.pointerType==="touch"){k.type==="pointerup"?Kn(k.clientX,k.clientY):st.current=null;return}k.pointerType==="mouse"&&bn(k.pointerId)}},Ke=k=>{!we||k.pointerType!=="mouse"||bn(k.pointerId)};return jl(),s.useEffect(()=>{const k=requestAnimationFrame(()=>Pt(!0));return()=>{cancelAnimationFrame(k),an(),di(),jt.current!==null&&(cancelAnimationFrame(jt.current),jt.current=null),Rt.current&&clearTimeout(Rt.current),zt.current&&clearTimeout(zt.current)}},[]),s.useEffect(()=>{if(!fe){wt(!0);return}xt();const k=()=>xt();return document.addEventListener("pointermove",k,{passive:!0}),document.addEventListener("pointerdown",k,{passive:!0}),()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerdown",k),zt.current&&clearTimeout(zt.current)}},[fe,xt]),s.useEffect(()=>{const k=oe=>{oe.key==="Escape"&&yt()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[yt]),s.useLayoutEffect(()=>{kt()},[A,t.length,he]),s.useLayoutEffect(()=>{o||xn(N.current,"auto")},[A,o]),s.useLayoutEffect(()=>{xn(0,"auto")},[t.length,he]),s.useEffect(()=>{const k=ze.current;if(!k||o||!pe)return;const oe=de=>{if(de.preventDefault(),Math.abs(de.deltaY)<=Math.abs(de.deltaX))return;const Ee=de.deltaMode===1?Tx:de.deltaMode===2?k.clientHeight:1,Xe=de.deltaY*Ee*Cx;if(Xe!==0){if(an(),ct.current||(ct.current=!0,De.current=k.scrollLeft,Vt.current=null,Dt(!1)),De.current+=Xe,!he){const lt=k.scrollWidth-k.clientWidth;De.current=Math.max(0,Math.min(lt,De.current))}xt(),Ue.current===null&&(Ue.current=requestAnimationFrame(qn))}};return k.addEventListener("wheel",oe,{passive:!1}),()=>{k.removeEventListener("wheel",oe),cn()}},[o,pe,he]),s.useEffect(()=>{const k=ze.current;if(!k)return;const oe=()=>{_t(it.current.isActive);const Ee=k.scrollLeft,Xe=Ee-mt.current;mt.current=Ee;const lt=Ze.current>0?Ze.current*.5:1/0;if(Xe!==0&&Math.abs(Xe)<lt){const Et=Xe>0?"forward":"backward";Et!==Be.current&&(Be.current=Et,je(Et))}it.current.isActive&&it.current.hasMoved||It()};k.addEventListener("scroll",oe,{passive:!0});const de=new ResizeObserver(()=>{kt(),_t(it.current.isActive),je(Be.current),It()});return de.observe(k),()=>{an(),k.removeEventListener("scroll",oe),de.disconnect()}},[t.length,he]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{St||yt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:vt?1:0,transition:`opacity ${cr}ms ease`,pointerEvents:vt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:c,...ht}}),a.jsxs("div",{ref:_e,className:`${e}-lightbox-dismiss-area`,style:Gt,...Ot,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Wt,onClick:k=>k.stopPropagation(),children:a.jsx("div",{ref:ze,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":we&&t.length>0?"true":"false","data-mouse-dragging":pt?"true":"false",onPointerDown:Ji,onPointerMove:eo,onPointerUp:Te,onPointerCancel:Te,onLostPointerCapture:Ke,children:a.jsx("div",{ref:Qe,className:`${e}-lightbox-strip-track`,style:{gap:A},children:nt.map((k,oe)=>{const de=k.image.objectFit??"contain",Ee=oe%t.length,Xe=Math.floor(oe/t.length),lt=Ur(A),Et=`calc(-0.5 * (${lt} + ${A}))`;return a.jsxs("div",{ref:Bt=>Ye.current[oe]=Bt,className:`${e}-strip-item`,style:{height:D==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:k.image.assetId,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:de}}),o&&Ee<t.length-1&&Xe===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Et,width:lt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Xe}-${k.image.assetId}-${Ee}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":on?"true":"false",style:Tt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:j,flexShrink:0,pointerEvents:"none"},children:o&&a.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:ie,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${se?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ce||v)&&a.jsx("div",{className:`${e}-header ${se?`${e}-header-two-row`:`${e}-header-single-row`}`,children:se?rt():Ce||v?dt():null})})})]}),t.length>1&&M==="on"&&(()=>{const k=Ur(P),oe=`calc(-0.5 * (${P} + ${k}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:P},children:a.jsx("div",{ref:$e,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:de=>de.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:U,"--thumbnail-active-color":W},children:[t.map((de,Ee)=>{const Xe=Ur(U),lt=`calc(-0.5 * (${Xe} + ${U}))`;return a.jsxs("div",{ref:Et=>{Ne.current[Ee]=Et},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":O===Ee?"true":"false",onClick:()=>pe&&b==="click"&&xn(Ee),onMouseEnter:()=>Re&&b==="hover"&&xn(Ee),"aria-label":de.image.name?`View ${de.image.name}`:`View image ${Ee+1}`,"aria-current":O===Ee?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${me?` ${e}-thumb-image-cover`:""}`,src:de.image.assetId,alt:"",draggable:!1,style:{...xe,maxWidth:w,maxHeight:w,width:f.display==="cover"?"auto":"100%",height:"auto",objectFit:f.display==="cover"?"cover":"contain"}})}),o&&Ee<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:lt,width:Xe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${de.image.assetId}-${Ee}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:oe,height:k,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Dx(e){return`
|
|
14352
|
+
`;function yi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const nd={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},yx=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],vx={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:yi("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:{...nd.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:{...nd.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:yi("Question Padding Left"),questionPaddingTop:yi("Question Padding Top"),questionPaddingBottom:yi("Question Padding Bottom"),answerPaddingLeft:yi("Answer Padding Left"),answerPaddingRight:yi("Answer Padding Right"),answerPaddingTop:yi("Answer Padding Top"),answerPaddingBottom:yi("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"01M3QM74XGFBPMXNEQB1BXSD9E",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:[...yx],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},xx={element:hx,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:vx,sourceCode:fx},li=e=>e.display==="cover",ja=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},id=100,bx=.2,od=8,bp=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,c]=s.useState(!1),d=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?id:Math.max(id,window.innerHeight*bx),[]),v=s.useCallback(C=>Math.max(0,1-C/(p*1.5)),[p]),x=s.useCallback(C=>Math.max(0,1-C/(p*.45)),[p]),m=s.useCallback(C=>{const I=typeof window<"u"?window.innerHeight:800,j=Math.max(.88,1-C/I*.12);return`translateY(${C}px) scale(${j})`},[]),h=s.useCallback(()=>{d.current=null},[]),b=s.useCallback(()=>{c(!0),r(0),window.setTimeout(()=>c(!1),n),h()},[n,h]),S=s.useCallback(()=>{const C=typeof window<"u"?window.innerHeight:800;c(!0),r(C),window.setTimeout(()=>{t(),h(),c(!1)},Math.min(n,200))},[n,t,h]),M=s.useCallback(C=>{!e||l||C.pointerType==="touch"&&(i!=null&&i(C.target)||(d.current={startX:C.clientX,startY:C.clientY,isLocked:null,pointerId:C.pointerId}))},[e,l,i]),y=s.useCallback(C=>{const I=d.current;if(!e||!I||C.pointerType!=="touch"||I.pointerId!==C.pointerId)return;const j=C.clientX-I.startX,E=C.clientY-I.startY;if(I.isLocked===null){if(Math.abs(j)<od&&Math.abs(E)<od)return;if(E>0&&E>Math.abs(j))I.isLocked=!0,C.currentTarget.setPointerCapture(C.pointerId);else{I.isLocked=!1,h();return}}if(!I.isLocked)return;C.preventDefault();const w=Math.max(0,E);u.current=w,r(w)},[e,h]),$=s.useCallback(C=>{const I=d.current;if(!e||!I||C.pointerType!=="touch"||I.pointerId!==C.pointerId)return;const j=I.isLocked===!0;if(C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId),!j){h();return}C.clientY-I.startY>=p?S():b()},[p,S,e,h,b]),R=s.useCallback(C=>{$(C)},[$]),X=s.useCallback(C=>{$(C)},[$]),B=o>0,O=l?`transform ${n}ms ease`:"none",N=l?`opacity ${n}ms ease`:"none",z=o>0||l;return{isSwipeDragging:B,backdropStyle:{opacity:v(o),transition:N},mediaAreaStyle:{transform:m(o),transition:O,touchAction:B?"none":void 0,willChange:B?"transform":void 0},overlayContentStyle:z?{opacity:x(o),transition:N}:void 0,swipeHandlers:e?{onPointerDown:M,onPointerMove:y,onPointerUp:R,onPointerCancel:X}:{},dismissAreaStyle:e?{touchAction:B?"none":"pan-x"}:void 0}},Sx="[data-lightbox-scrollable]",jl=(e=!0)=>{s.useEffect(()=>{if(!e)return;const t=window.scrollY,n=document.body.style.overflow,i=document.body.style.position,o=document.body.style.top,r=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${t}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const c=d=>{const u=d.target;u instanceof Element&&u.closest(Sx)||d.preventDefault()};return document.addEventListener("touchmove",c,{passive:!1}),()=>{document.removeEventListener("touchmove",c),document.body.style.overflow=n,document.body.style.position=i,document.body.style.top=o,document.body.style.width=r,document.documentElement.style.overflow=l,window.scrollTo({top:t,left:0,behavior:"instant"})}},[e])},wx=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},$x=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Cx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Tx=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,c=n-l,d=l-n,u=(h,b)=>{$x(t),e.scrollLeft=h,b&&(r==null||r())};if(Math.abs(c)<.5)return u(n,!0),()=>{};let p=!1,v=0;const x=()=>{t.removeEventListener("transitionend",m),clearTimeout(v)},m=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,x(),u(n,!0))};return t.addEventListener("transitionend",m),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(${d}px, 0, 0)`,v=window.setTimeout(()=>{p||(p=!0,x(),u(n,!0))},i+64),()=>{p||(p=!0,x(),u(l-Cx(t),!1))}},cr=300,Ix=900,Lx=1500,Px="cubic-bezier(0.16, 1, 0.3, 1)",Rx=3e3,Mx=2,Ex=16,kx=.05,Ax=1,Xr=.3,Fx=50,Nx=20,ao=.004,No=["title1","title2","title3"],_x={title1:"1",title2:"2",title3:"3"},Hx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Wx={title1:.02,title2:.02,title3:.02},qr=e=>`max(${e}, ${Nx}px)`,Ox=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]}},Dx=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=Ox(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Jt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Bx=e=>[Jt(e,"fontFamily"),Jt(e,"fontSettings"),{type:"row",items:[Jt(e,"fontSize"),Jt(e,"lineHeight"),Jt(e,"letterSpacing"),Jt(e,"wordSpacing")]},Jt(e,"textAlign"),Jt(e,"textAppearance")],zx=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(No.map(e=>[_x[e],Bx(e)]))}),Vl=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},c)=>{if(r<=0||c<=0)return{overflow:r,widths:[c,...l]};const d=Math.min(r,c);return{overflow:r-d,widths:[c-d,...l]}},{overflow:i-1,widths:[]});return o},Sp=(e,t)=>Vl(e,t),Ur=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},rd=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Vl(e.length,n),effective:Sp(e.length,n)}},jx=(e,t,n,i,o,r,l)=>{const c=[];return t&&c.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&c.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&c.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),c},gs=(e,t)=>{const n=i=>{const o=Jt(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[Hx[t]]}},Vx=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),hs=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Wx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return nn(i,n)},Gx=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:c,thumbnailSize:d,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:v,closeIcon:x,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:b,thumbnailTrigger:S,thumbnailVisibility:M,thumbnailObjectFit:y,thumbnailActive:$,thumbnailActiveColor:R,title1Width:X,title2Width:B,title3Width:O,title1MarginLeft:N=0,title2MarginLeft:z=0,title3MarginLeft:C=0,titleRowMarginBottom:I=0,titleHeaderLayout:j="desktop",contentMarginTop:E,iconMarginLeft:w}=n,L=k=>A.scalingValue(k,i??!1),V=d??n.thumnailSize??.03,_=L(V),K=L(u),P=L(p??.02),f=L(v??0),U=L(E??0),te=qr(U),ce=L(w??0),[F,ie]=s.useState(0),T=s.useRef(F);T.current=F;const le=t[F],{title1:J,title2:Se,title3:Le}=Dx(le),me=hs("title1",gs(n,"title1"),i),ye=hs("title2",gs(n,"title2"),i),ee=hs("title3",gs(n,"title3"),i),oe=j==="mobile",re=!o&&(!i||r),ge=re,we=re,Ae=re,fe=li(y),ve=fe?{"--image-aspect-ratio":ja(y)}:void 0,xe=!!(J||Se||Le),g=s.useMemo(()=>jx(e,J,Se,Le,me,ye,ee),[e,F,J,Se,Le,me,ye,ee]),G=s.useMemo(()=>({title1Width:X,title2Width:B,title3Width:O}),[X,B,O]),Q=s.useMemo(()=>g.map(k=>G[k.widthKey]),[g,G]),ne=s.useMemo(()=>Vl(g.length,Q),[g.length,Q]),ue=s.useMemo(()=>Sp(g.length,Q),[g.length,Q]),q=s.useMemo(()=>g.filter(k=>k.prefix==="title1"),[g]),D=s.useMemo(()=>g.filter(k=>k.prefix==="title2"||k.prefix==="title3"),[g]),se=s.useMemo(()=>rd(q,G),[q,G]),Y=s.useMemo(()=>rd(D,G),[D,G]),pe=s.useCallback((k,ae)=>{const he=g.indexOf(k);if(!oe||ae==="single-row")return{effectiveWidth:ue[he]??0,resolvedWidth:ne[he]??0,maxWidth:Ur(he,ne)};if(ae==="two-row-top"){const Ge=q.indexOf(k);return{effectiveWidth:se.effective[Ge]??0,resolvedWidth:se.resolved[Ge]??0,maxWidth:Ur(Ge,se.resolved)}}const Me=D.indexOf(k);return{effectiveWidth:Y.effective[Me]??0,resolvedWidth:Y.resolved[Me]??0,maxWidth:Ur(Me,Y.resolved)}},[D,Y,ue,ne,g,q,se,oe]),H=s.useCallback(k=>A.scalingValue(k,i??!1),[i]),Ie=H(I??0),de=s.useMemo(()=>({title1MarginLeft:N,title2MarginLeft:z,title3MarginLeft:C}),[N,z,C]),Z=s.useCallback(k=>g.slice(0,k+1).reduce((ae,he,Me)=>ae+(he!=null&&he.marginLeftKey?de[he.marginLeftKey]??0:0)+(ne[Me]??0),0)+(oe?0:N??0),[g,de,ne,oe,N]),Ne=s.useCallback(()=>oe?0:N??0,[oe,N]),Oe=s.useCallback(k=>D.slice(0,k).reduce((ae,he,Me)=>ae+(he.marginLeftKey?de[he.marginLeftKey]??0:0)+(Y.resolved[Me]??0),0),[D,Y.resolved,de]),Je=s.useCallback(k=>{const ae=D[k];return Oe(k)+(ae.marginLeftKey?de[ae.marginLeftKey]??0:0)+(Y.resolved[k]??0)},[D,Y.resolved,Oe,de]),De=(k,ae)=>{const he=k.marginLeftKey?de[k.marginLeftKey]??0:0,{effectiveWidth:Me,resolvedWidth:Ge,maxWidth:dt}=pe(k,ae),_t=o&&ae==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":k.prefix,style:{...ae==="single-row"?{gridArea:k.prefix}:{},width:H(Me),...he>0?{marginLeft:H(he)}:{}},children:[a.jsx("p",{className:k.className,style:k.style,children:k.text}),_t&&k.marginLeftKey&&a.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:H(-he),width:`max(${H(he)}, 10px)`,height:"100%",pointerEvents:"auto"}}),_t&&a.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(dt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:H(-ao/2),width:H(ao),height:"100%",pointerEvents:"auto"}})]},k.className)},Ze=()=>{const k=oe?-1:g.findIndex(Me=>Me.prefix==="title1"),ae=!oe&&(o||(N??0)>0)?(()=>{const Me=N??0,Ge=k>=0?ne[k]:X??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:0,width:`max(${H(Me)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,he=g.flatMap((Me,Ge)=>{if(!Me.marginLeftKey)return[];const dt=de[Me.marginLeftKey]??0,_t=Vx(g,ne,de,Ge)+Ne();return a.jsx("div",{"data-controls":Me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ne[Ge]),style:{position:"absolute",top:0,left:H(_t),width:`max(${H(dt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Me.marginLeftKey)});return ae?[ae,...he]:he},at=()=>g.map((k,ae)=>{const he=Ur(ae,ne),Ge=Z(ae)-ao/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(he),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(Ge),width:H(ao),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),Xe=()=>D.flatMap((k,ae)=>{if(!k.marginLeftKey)return[];const he=de[k.marginLeftKey]??0,Me=Oe(ae),{resolvedWidth:Ge}=pe(k,"two-row-bottom");return a.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:H(Me),width:`max(${H(he)}, 10px)`,height:"100%",pointerEvents:"auto"}},k.marginLeftKey)}),be=()=>D.map((k,ae)=>{const{maxWidth:he}=pe(k,"two-row-bottom"),Ge=Je(ae)-ao/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(he),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(Ge),width:H(ao),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),He=s.useRef(null),je=s.useRef(null),Qe=s.useRef(null),Ce=s.useRef(null),_e=s.useRef([]),Ue=s.useRef([]),Ye=s.useRef(0),lt=s.useRef(null),it=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),qe=s.useRef(null),Ee=s.useRef(null),pt=s.useRef(0),ke=s.useRef("forward"),We=s.useRef(0),Ve=s.useRef(null),ct=s.useRef(!1),ot=t.length>1&&(!o||!!r),xt=ot?3:1,Pt=s.useMemo(()=>Array.from({length:xt},()=>t).flat(),[t,xt]),[Vt,vt]=s.useState(!1),[Mt,Ht]=s.useState(!1),[Gt,kt]=s.useState(!0),Pe=s.useRef(null),Be=s.useRef(null),ft=s.useRef(!1),$t=s.useRef(!1),et=s.useRef(null),Et=s.useRef(null),Xt=ge&&!Gt,mt=s.useCallback(()=>{ge&&(kt(!0),Et.current&&clearTimeout(Et.current),Et.current=setTimeout(()=>{it.current.isActive||kt(!1)},Rx))},[ge]),gt=s.useCallback(()=>{o||$t.current||($t.current=!0,Ht(!1),et.current=setTimeout(()=>{l()},cr))},[o,l]),Re=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Xt?"true":"false",style:{width:A.scalingValue(m??0,i),height:A.scalingValue(m??0,i),marginRight:ce,"--close-icon-hover-color":b},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:gt,"aria-label":"Close",children:a.jsx(gn,{url:x,fill:h,hoverFill:i&&!r?h:b,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ce,height:"100%",pointerEvents:"auto"}})]}),tt=(k="two-row")=>a.jsx("div",{...k==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:H(N??0),flexShrink:0,...k==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...k==="two-row"&&o?{pointerEvents:"auto"}:{}}}),nt=()=>{const k=g.find(Me=>Me.prefix==="title1"),ae=g.filter(Me=>Me.prefix==="title2"||Me.prefix==="title3"),he=ae.length>0||o||(I??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(N??0)>0||o?tt():null,k&&De(k,"two-row-top"),x&&Re()]}),he?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[ae.map(Me=>De(Me,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Xe(),be()]})]}):null,a.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:Ie,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},st=()=>a.jsxs(a.Fragment,{children:[(N??0)>0||o?tt("single-row"):null,g.map(k=>De(k,"single-row")),o?a.jsxs(a.Fragment,{children:[Ze(),at()]}):null,x?Re():null]}),At=s.useCallback(k=>!!(k.closest("[data-controls]")||k.closest(`.${e}-thumbnails`)||k.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:St,backdropStyle:ht,mediaAreaStyle:Dt,overlayContentStyle:Ct,swipeHandlers:qt,dismissAreaStyle:jt}=bp({enabled:re??!1,onClose:gt,animMs:cr,isBlockedTarget:At}),Nt=()=>{if(!ot||t.length===0)return Ye.current=0,0;const k=Ue.current[0],ae=Ue.current[t.length];if(!k||!ae)return Ye.current;const he=ae.offsetLeft-k.offsetLeft;return he>0&&(Ye.current=he),Ye.current},Bt=(k=!1)=>{if(!ot)return;const ae=je.current,he=Nt();!ae||he<=0||he<ae.clientWidth*.25||(ae.scrollLeft<=0?(ae.scrollLeft+=he,k&&(it.current.scrollLeft+=he),ct.current&&(We.current+=he)):ae.scrollLeft>=he*2&&(ae.scrollLeft-=he,k&&(it.current.scrollLeft-=he),ct.current&&(We.current-=he)))},Wt=(k,ae=(he=>(he=je.current)==null?void 0:he.scrollLeft)()??0)=>{if(!ot)return k;let Me=t.length+k,Ge=1/0;for(let dt=0;dt<xt;dt++){const _t=dt*t.length+k,Ut=Ue.current[_t];if(!Ut)continue;const sn=Math.abs(Ut.offsetLeft-ae);sn<Ge&&(Ge=sn,Me=_t)}return Me},wt=k=>{const ae=je.current;return!k||!ae?!1:k.offsetWidth>ae.clientWidth+1},W=k=>{const ae=je.current;if(!k||!ae||!wt(k))return!1;const he=k.offsetLeft,Me=he+k.offsetWidth;return ae.scrollLeft>=he-1&&ae.scrollLeft+ae.clientWidth<=Me+1},Te=(k=(ae=>(ae=je.current)==null?void 0:ae.scrollLeft)()??0)=>{for(let Me=0;Me<Ue.current.length;Me+=1){const Ge=Ue.current[Me];if(Ge&&W(Ge))return Me}let he={flatIndex:0,distance:1/0};return Ue.current.forEach((Me,Ge)=>{if(!Me)return;const dt=Math.abs(Me.offsetLeft-k);dt<he.distance&&(he={flatIndex:Ge,distance:dt})}),he.flatIndex},ze=k=>{je.current&&Ue.current.forEach(ae=>{ae&&(ae.style.scrollSnapAlign=wt(ae)&&k==="backward"?"end":"start")})},Fe=(k,ae,he)=>{const Me=k-ae,Ge=Te(ae),dt=Ue.current[Ge];if(W(dt))return Te(k)%t.length;const _t=Ue.current[Ge+1],Ut=dt?_t?_t.offsetLeft-dt.offsetLeft:dt.offsetWidth:0,sn=Ut>0?Me>Ut*Xr?1:Me<-Ut*Xr?-1:0:0;return sn===0?he:ot?(he+sn+t.length)%t.length:Math.max(0,Math.min(t.length-1,he+sn))},yt=s.useCallback((k=!1)=>{if(M!=="on"||o)return;const ae=Ce.current,he=T.current,Me=_e.current[he];if(!ae||!Me||ae.scrollWidth<=ae.clientWidth)return;const Ge=ae.scrollLeft,dt=Ge+ae.clientWidth,_t=Me.offsetLeft,Ut=_t+Me.offsetWidth;if(_t>=Ge&&Ut<=dt)return;const sn=ae.scrollWidth-ae.clientWidth;let en=Ge;if(!k&&Pe.current===null){const gi=_e.current[he-1],kn=_e.current[he+1],Zn=gi?Me.offsetLeft-gi.offsetLeft:kn?kn.offsetLeft-Me.offsetLeft:Me.offsetWidth;Ut>dt?en+=Zn:_t<Ge&&(en-=Zn)}else Ut>dt?en=Ut-ae.clientWidth:en=_t;ae.scrollLeft=Math.max(0,Math.min(sn,en))},[o,M]),Ot=s.useCallback((k=!1)=>{k&&(ft.current=!0),Be.current===null&&(Be.current=requestAnimationFrame(()=>{Be.current=null;const ae=ft.current;ft.current=!1,yt(ae)}))},[yt]),ut=s.useCallback(k=>{if(k===T.current)return;const ae=T.current;T.current=k;const he=Math.abs(k-ae)>1,Me=ot&&t.length>1&&(ae===t.length-1&&k===0||ae===0&&k===t.length-1);ie(k),Ot(he||Me)},[t.length,ot,Ot]),Tt=()=>{if(!je.current||t.length===0||Pe.current!==null||it.current.isActive&&it.current.hasMoved)return;const k=je.current.scrollLeft,ae=Te(k)%t.length;ae!==T.current&&ut(ae)},Yt=()=>{Pe.current=null},It=k=>{const ae=je.current;ae&&(ae.style.scrollSnapType=k?"":"none")},Zt=()=>{var k;(k=Ee.current)==null||k.call(Ee),Ee.current=null},on=()=>{Ve.current!==null&&(cancelAnimationFrame(Ve.current),Ve.current=null),ct.current=!1},Wn=()=>{const k=je.current;if(!k){Ve.current=null,ct.current=!1;return}const ae=We.current-k.scrollLeft;if(Math.abs(ae)<.5){k.scrollLeft=We.current,Bt(),Tt(),Ve.current=null,ct.current=!1;return}k.scrollLeft+=ae*kx,Bt(),Tt(),mt(),Ve.current=requestAnimationFrame(Wn)},xn=()=>{const k=Qe.current;k&&(k.style.transition="",k.style.transform="",k.style.willChange="")},ui=(k,ae,he,Me)=>{xn(),k.scrollLeft=ae,pt.current=k.scrollLeft,Bt(),he!==void 0?(T.current=he,ie(he)):Tt(),It(!0),Me==null||Me()},dn=(k,{behavior:ae="smooth",activeIndex:he,onComplete:Me}={})=>{const Ge=je.current,dt=Qe.current;if(!Ge||!dt)return;if(on(),Zt(),It(!1),ae==="auto"){ui(Ge,k,he,Me);return}const _t=Math.abs(k-Ge.scrollLeft),Ut=wx(_t,Ix,Lx,Ge.clientWidth*.55);Ee.current=Tx(Ge,dt,k,{duration:Ut,easing:Px,onComplete:()=>{Ee.current=null,ui(Ge,k,he,Me)}})},pi=(k="smooth")=>{const ae=je.current;if(!ae||t.length===0)return;const he=Te()%t.length,Me=Wt(he,ae.scrollLeft),Ge=Ue.current[Me];Ge&&dn(Ge.offsetLeft,{behavior:k,activeIndex:he})},Kn=(k,ae="smooth",he,Me)=>{const Ge=je.current;if(!Ge||t.length===0)return;const dt=(Me??Ge.scrollLeft)-k,_t=Te(k),Ut=Ue.current[_t];if(W(Ut)){It(!0),Tt();return}const sn=Ue.current[_t+1],en=Ut?sn?sn.offsetLeft-Ut.offsetLeft:Ut.offsetWidth:0;if((en>0?dt>en*Xr?1:dt<-en*Xr?-1:0:0)!==0){const Kl=he??_t%t.length,Xo=Fe(Me??Ge.scrollLeft,k,Kl);bn(Xo,ae);return}const kn=Me??Ge.scrollLeft,Zn=Te(kn),kr=Ue.current[Zn];if(kr&&Math.abs(kr.offsetLeft-kn)<1){It(!0),Tt();return}pi("auto")},bn=(k,ae="smooth")=>{const he=je.current;if(!he||t.length===0)return;const Me=Wt(k,he.scrollLeft),Ge=Ue.current[Me];Ge&&(ae==="smooth"?Pe.current=k:Pe.current=null,T.current=k,ie(k),Ot(!0),dn(Ge.offsetLeft,{behavior:ae,activeIndex:k,onComplete:ae==="smooth"?Yt:void 0}))},mi=()=>{qe.current&&(window.removeEventListener("pointerup",qe.current),window.removeEventListener("pointercancel",qe.current),qe.current=null)},eo=(k,ae,he,Me,Ge)=>{const dt=he-k,_t=Me-ae,Ut=Math.abs(dt),sn=Math.abs(_t);if(Ut<Fx||Ut<=sn)return!1;const en=dt<0?1:-1,gi=ot?(Ge+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ge+en));return gi===Ge?!1:(bn(gi),!0)},Sn=k=>{if(!it.current.isActive)return;mi();const ae=je.current;if(!ae)return;const{scrollLeft:he,startActiveIndex:Me,hasMoved:Ge}=it.current,dt=ae.scrollLeft;Bt(!0),it.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),k!==void 0&&ae.hasPointerCapture(k)&&ae.releasePointerCapture(k),Ge?Kn(he,"smooth",Me,dt):(It(!0),Tt()),mt()},Qn=(k,ae)=>{const he=lt.current;lt.current=null,he&&(eo(he.startX,he.startY,k,ae,he.startActiveIndex),mt())},to=k=>{if(!we)return;if(k.pointerType==="touch"){if(on(),It(!0),At(k.target))return;lt.current={startX:k.clientX,startY:k.clientY,startActiveIndex:T.current};return}if(k.pointerType!=="mouse"||k.button!==0||At(k.target))return;const ae=je.current;if(!ae)return;on(),Zt(),xn(),Pe.current=null,it.current={isActive:!0,startX:k.clientX,scrollLeft:ae.scrollLeft,startActiveIndex:T.current,hasMoved:!1},It(!1),mt(),ae.setPointerCapture(k.pointerId),mi();const he=Me=>{Me.pointerType==="mouse"&&Sn(Me.pointerId)};qe.current=he,window.addEventListener("pointerup",he),window.addEventListener("pointercancel",he)},no=k=>{if(!we||k.pointerType!=="mouse")return;const ae=je.current;if(!ae||!it.current.isActive)return;if(k.buttons===0){Sn(k.pointerId);return}const he=k.clientX-it.current.startX;Math.abs(he)>Ax&&(it.current.hasMoved=!0,vt(!0)),it.current.hasMoved&&(k.preventDefault(),ae.scrollLeft=it.current.scrollLeft-he,Bt(!0),Tt(),mt())},$e=k=>{if(we){if(k.pointerType==="touch"){k.type==="pointerup"?Qn(k.clientX,k.clientY):lt.current=null;return}k.pointerType==="mouse"&&Sn(k.pointerId)}},Ke=k=>{!we||k.pointerType!=="mouse"||Sn(k.pointerId)};return jl(),s.useEffect(()=>{const k=requestAnimationFrame(()=>Ht(!0));return()=>{cancelAnimationFrame(k),Zt(),mi(),Be.current!==null&&(cancelAnimationFrame(Be.current),Be.current=null),et.current&&clearTimeout(et.current),Et.current&&clearTimeout(Et.current)}},[]),s.useEffect(()=>{if(!ge){kt(!0);return}mt();const k=()=>mt();return document.addEventListener("pointermove",k,{passive:!0}),document.addEventListener("pointerdown",k,{passive:!0}),()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerdown",k),Et.current&&clearTimeout(Et.current)}},[ge,mt]),s.useEffect(()=>{const k=ae=>{ae.key==="Escape"&>()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[gt]),s.useLayoutEffect(()=>{Nt()},[f,t.length,ot]),s.useLayoutEffect(()=>{o||bn(T.current,"auto")},[f,o]),s.useLayoutEffect(()=>{bn(0,"auto")},[t.length,ot]),s.useEffect(()=>{const k=je.current;if(!k||o||!re)return;const ae=he=>{if(he.preventDefault(),Math.abs(he.deltaY)<=Math.abs(he.deltaX))return;const Me=he.deltaMode===1?Ex:he.deltaMode===2?k.clientHeight:1,Ge=he.deltaY*Me*Mx;if(Ge!==0){if(Zt(),ct.current||(ct.current=!0,We.current=k.scrollLeft,Pe.current=null,It(!1)),We.current+=Ge,!ot){const dt=k.scrollWidth-k.clientWidth;We.current=Math.max(0,Math.min(dt,We.current))}mt(),Ve.current===null&&(Ve.current=requestAnimationFrame(Wn))}};return k.addEventListener("wheel",ae,{passive:!1}),()=>{k.removeEventListener("wheel",ae),on()}},[o,re,ot]),s.useEffect(()=>{const k=je.current;if(!k)return;const ae=()=>{Bt(it.current.isActive);const Me=k.scrollLeft,Ge=Me-pt.current;pt.current=Me;const dt=Ye.current>0?Ye.current*.5:1/0;if(Ge!==0&&Math.abs(Ge)<dt){const _t=Ge>0?"forward":"backward";_t!==ke.current&&(ke.current=_t,ze(_t))}it.current.isActive&&it.current.hasMoved||Tt()};k.addEventListener("scroll",ae,{passive:!0});const he=new ResizeObserver(()=>{Nt(),Bt(it.current.isActive),ze(ke.current),Tt()});return he.observe(k),()=>{Zt(),k.removeEventListener("scroll",ae),he.disconnect()}},[t.length,ot]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{St||gt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Mt?1:0,transition:`opacity ${cr}ms ease`,pointerEvents:Mt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:c,...ht}}),a.jsxs("div",{ref:He,className:`${e}-lightbox-dismiss-area`,style:jt,...qt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Dt,onClick:k=>k.stopPropagation(),children:a.jsx("div",{ref:je,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":we&&t.length>0?"true":"false","data-mouse-dragging":Vt?"true":"false",onPointerDown:to,onPointerMove:no,onPointerUp:$e,onPointerCancel:$e,onLostPointerCapture:Ke,children:a.jsx("div",{ref:Qe,className:`${e}-lightbox-strip-track`,style:{gap:f},children:Pt.map((k,ae)=>{const he=k.image.objectFit??"contain",Me=ae%t.length,Ge=Math.floor(ae/t.length),dt=qr(f),_t=`calc(-0.5 * (${dt} + ${f}))`;return a.jsxs("div",{ref:Ut=>Ue.current[ae]=Ut,className:`${e}-strip-item`,style:{height:j==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:k.image.assetId,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:he}}),o&&Me<t.length-1&&Ge===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:_t,width:dt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ge}-${k.image.assetId}-${Me}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Xt?"true":"false",style:Ct,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:U,flexShrink:0,pointerEvents:"none"},children:o&&a.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:te,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${oe?` ${e}-lightbox-content-area-stacked`:""}`,children:(xe||x)&&a.jsx("div",{className:`${e}-header ${oe?`${e}-header-two-row`:`${e}-header-single-row`}`,children:oe?nt():xe||x?st():null})})})]}),t.length>1&&M==="on"&&(()=>{const k=qr(P),ae=`calc(-0.5 * (${P} + ${k}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:P},children:a.jsx("div",{ref:Ce,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:he=>he.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":$,style:{gap:K,"--thumbnail-active-color":R},children:[t.map((he,Me)=>{const Ge=qr(K),dt=`calc(-0.5 * (${Ge} + ${K}))`;return a.jsxs("div",{ref:_t=>{_e.current[Me]=_t},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":F===Me?"true":"false",onClick:()=>re&&S==="click"&&bn(Me),onMouseEnter:()=>Ae&&S==="hover"&&bn(Me),"aria-label":he.image.name?`View ${he.image.name}`:`View image ${Me+1}`,"aria-current":F===Me?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${fe?` ${e}-thumb-image-cover`:""}`,src:he.image.assetId,alt:"",draggable:!1,style:{...ve,maxWidth:_,maxHeight:_,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Me<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:dt,width:Ge,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${he.image.assetId}-${Me}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:ae,height:k,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Xx(e){return`
|
|
14353
14353
|
.${e}-wrapper {
|
|
14354
14354
|
position: relative;
|
|
14355
14355
|
width: 100%;
|
|
@@ -14734,7 +14734,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14734
14734
|
pointer-events: auto;
|
|
14735
14735
|
z-index: 10;
|
|
14736
14736
|
}
|
|
14737
|
-
`}const
|
|
14737
|
+
`}const qx=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=A.useScopedStyles(),{cover:c,coverFit:d}=e,u=s.useRef(null),[p,v]=s.useState(!1),x=t??[],m=p&&x.length>0,h=()=>{x.length!==0&&v(!0)};return s.useEffect(()=>{!n||i||o||v(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Xx(l)}}),c&&a.jsx("div",{className:`${l}-cover ${li(d)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...li(d)?{"--image-aspect-ratio":ja(d)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${li(d)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:c,alt:"cover"})})]}),m&&typeof document<"u"&&(()=>{const b=(r?document.getElementById(r):null)??document.body;return Un.createPortal(a.jsx(Gx,{prefix:l,images:x,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>v(!1)}),b)})()]})},Ux=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
14738
14738
|
import { createPortal } from 'react-dom';
|
|
14739
14739
|
import { CommonComponentProps } from '../props';
|
|
14740
14740
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15280,7 +15280,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15280
15280
|
</>
|
|
15281
15281
|
);
|
|
15282
15282
|
};
|
|
15283
|
-
`,jx="01M3SBP3P8CMVMM1ZZ0QVD2PPF",Hi={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 Vx(e){const t={};return t[Qt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Qt(e,"fontSettings")]={...Hi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Qt(e,"fontSize")]={...Hi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Qt(e,"lineHeight")]={...Hi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Qt(e,"letterSpacing")]={...Hi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Qt(e,"wordSpacing")]={...Hi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Qt(e,"textAlign")]={...Hi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Qt(e,"textAppearance")]={...Hi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Gx=Ao.reduce((e,t)=>({...e,...Vx(t)}),{}),Xx=Ao.reduce((e,t)=>({...e,[Qt(t,"fontFamily")]:"Goudy Bookletter 1911",[Qt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Qt(t,"letterSpacing")]:0,[Qt(t,"wordSpacing")]:0,[Qt(t,"textAlign")]:"left",[Qt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function fs(e){return Ao.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Qt(n,"fontSize")]=i),o!==void 0&&(t[Qt(n,"lineHeight")]=o),t},{})}const Ux=_x(),qx={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...Gx,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:"01M3QM74XESYN1HRYH9VRTZ5CK",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:jx,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Xx},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...fs({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...fs({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...fs({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:[Ux]}],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:{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},Yx={element:Bx,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:qx,sourceCode:zx,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0},{path:"closeIcon"}]},fontSettingsPaths:{content:[],parameters:[...Ao.map(e=>({path:`${Qt(e,"fontFamily")}`}))]},fontRelations:{...Ao.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Qt(t,"fontFamily")}`}),{})}},Kx=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:c=!1,journalItemId:d=null,onBeforeClose:u,onClose:p})=>{const{type:y,coverFit:v,backgroundColor:g,imageGap:m,maxWidth:x,maxHeight:b,textTransition:M,title1Width:f,title2Width:S,title3Width:W,title1MarginLeft:q=0,title2MarginLeft:z=0,title3MarginLeft:L=0,titleRowMarginBottom:_=0,titleHeaderLayout:G="single-row",countCloseGap:$=0,closeIcon:I,closeIconMaxWidth:D,closeIconColor:E,closeIconHoverColor:T,contentMarginTop:C=0,iconMarginRight:V=0}=n,w=s.useCallback(Te=>F.scalingValue(Te,i??!1),[i]),U=w(m??0),P=`${x}%`,A=`${b}%`,j=w($),ie=w(C),ae=w(V),O=zi("title1",Bi(n,"title1"),i),re=zi("title2",Bi(n,"title2"),i),N=zi("title3",Bi(n,"title3"),i),le=zi("count",Bi(n,"count"),i),J=G==="mobile",be=!i||!!r,Le=!o&&(!i||!!r),ye=s.useMemo(()=>pa(t,y),[t,y]),[ce,K]=s.useState(l),se=ye[ce],pe=se==null?void 0:se.entry,[fe,we]=s.useState(!1),[Re,me]=s.useState(null),[xe,Ce]=s.useState(!1),[h,Y]=s.useState(null),[Q,ne]=s.useState(!1),[ue,B]=s.useState(0),[R,ee]=s.useState(),[te,ge]=s.useState(),[X,Pe]=s.useState(null),Se=s.useRef(null),Z=s.useRef(0),He=s.useRef(0),We=s.useRef(0),ot=s.useRef(!1),qe=s.useRef(null),tt=s.useRef(null),et=s.useRef(null),Ge=s.useRef(null),ve=s.useRef(null),_e=s.useRef(null),ze=s.useRef(null),Qe=s.useCallback(()=>{const Te=tt.current;if(!Te)return;const Ke=Te.closest(`.${e}-lightbox-content-area`);if(!Ke)return Te.getBoundingClientRect().width;const k=Array.from(Ke.children).reduce((oe,de)=>!(de instanceof HTMLElement)||de.contains(Te)?oe:oe+de.getBoundingClientRect().width,0);return Ke.getBoundingClientRect().width-k},[e]),$e=s.useCallback(()=>{Se.current&&(clearTimeout(Se.current),Se.current=null)},[]),Ne=s.useCallback(Te=>{Te===Z.current&&(Y(null),ne(!1))},[]),Ye=s.useCallback(()=>{o||ot.current||(ot.current=!0,u==null||u(),we(!1),qe.current=setTimeout(()=>{p()},300))},[o,u,p]),Ze=s.useCallback(Te=>!!(Te.closest("[data-controls]")||Te.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:st,backdropStyle:it,mediaAreaStyle:Oe,overlayContentStyle:Ae,swipeHandlers:mt,dismissAreaStyle:Be}=mp({enabled:Le,onClose:Ye,animMs:300,isBlockedTarget:Ze}),De=s.useCallback(Te=>{c&&Ku(Te+1,d,!0)},[c,d]),Ue=s.useCallback(Te=>{if(Te)return Te.getBoundingClientRect().height},[]),ct=s.useCallback(Te=>{if(ye.length===0)return;const Ke=(Te%ye.length+ye.length)%ye.length;if(Ke===ce)return;const k=ye[ce],oe=ye[Ke];Z.current+=1;const de=Z.current,Ee=M==="fade"&&Fc(k==null?void 0:k.entry)!==Fc(oe==null?void 0:oe.entry),Xe=Ue(et.current),lt=Ee?(()=>{const Bt=Qe();Xn.flushSync(()=>{Pe(oe.entry)}),et.current&&Bt&&(et.current.style.width=`${Bt}px`);const rn=Ue(et.current);return et.current&&(et.current.style.width=""),{measuredIncomingTitlesHeight:rn,incomingTitlesMeasureWidth:Bt}})():void 0,Et=Math.max(Xe??0,(lt==null?void 0:lt.measuredIncomingTitlesHeight)??0)||void 0;B(de),Y(ce),ne(!0),K(Ke),De(Ke),We.current=Ke,Ee?($e(),Et&&ee(Et),lt!=null&<.incomingTitlesMeasureWidth&&ge(lt.incomingTitlesMeasureWidth),me((k==null?void 0:k.entryIndex)??null),Ce(!0),He.current=oe.entryIndex,Se.current=setTimeout(()=>{me(null),Ce(!1),ee(void 0),ge(void 0),Pe(null),Se.current=null},400)):($e(),me(null),Ce(!1),ee(void 0),ge(void 0),Pe(null),He.current=oe.entryIndex)},[ce,$e,Qe,Ue,ye,De,M]),he=s.useCallback(()=>{ze.current=null},[]),Me=s.useCallback(Te=>{!be||ye.length<=1||Te.pointerType==="mouse"&&Te.button!==0||Te.target.closest("[data-controls]")||(ze.current={startX:Te.clientX,startY:Te.clientY,pointerId:Te.pointerId})},[be,ye.length]),nt=s.useCallback(Te=>{var Bt;if(!be||ye.length<=1||Te.pointerType==="mouse"&&Te.button!==0)return;if(st){he();return}const Ke=ze.current;if(!Ke||Ke.pointerId!==Te.pointerId||(he(),Te.target.closest("[data-controls]")))return;const oe=Te.clientX-Ke.startX,de=Te.clientY-Ke.startY,Ee=Math.abs(oe),Xe=Math.abs(de);if(Ee>=sv&&Ee>Xe){ct(oe>0?ce-1:ce+1);return}if(Ee>Mc||Xe>Mc)return;const lt=(Bt=Ge.current)==null?void 0:Bt.getBoundingClientRect(),Et=lt?lt.left+lt.width/2:window.innerWidth/2;ct(Te.clientX<Et?ce-1:ce+1)},[ce,be,ct,st,he,ye.length]),pt=s.useCallback(Te=>{const Ke=ze.current;(Ke==null?void 0:Ke.pointerId)===Te.pointerId&&he()},[he]);jl(),s.useEffect(()=>{_e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const Te=requestAnimationFrame(()=>{we(!0),requestAnimationFrame(()=>{ve.current?ve.current.focus():Ge.current&&Ge.current.focus()})});return()=>{cancelAnimationFrame(Te),qe.current&&clearTimeout(qe.current),Se.current&&clearTimeout(Se.current);const Ke=_e.current;Ke&&document.contains(Ke)&&Ke.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var Te;M!=="fade"&&(He.current=((Te=ye[ce])==null?void 0:Te.entryIndex)??0,$e(),me(null),Ce(!1),ee(void 0),ge(void 0))},[ce,$e,ye,M]),s.useEffect(()=>{const Te=Ke=>{if(Ke.key==="Escape"){Ye();return}if(Ke.key==="ArrowLeft"&&ye.length>1){ct(ce-1);return}if(Ke.key==="ArrowRight"&&ye.length>1){ct(ce+1);return}if(Ke.key==="Tab"&&Ge.current){const k=Ge.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),oe=Array.from(k).filter(lt=>!lt.closest('[aria-hidden="true"]'));if(oe.length===0)return;const de=oe[0],Ee=oe[oe.length-1],Xe=document.activeElement;Ke.shiftKey?(Xe===de||!Ge.current.contains(Xe))&&(Ke.preventDefault(),Ee.focus()):(Xe===Ee||!Ge.current.contains(Xe))&&(Ke.preventDefault(),de.focus())}};return window.addEventListener("keydown",Te),()=>window.removeEventListener("keydown",Te)},[ct,Ye,ce,ye.length]),s.useLayoutEffect(()=>{$e(),Z.current=0,B(0),Y(null),ne(!1),me(null),Ce(!1),ee(void 0),ge(void 0),Pe(null),K(Te=>{const Ke=Math.max(0,ye.length-1);return Math.min(Te,Ke)})},[$e,t.length,y,ye.length]),s.useLayoutEffect(()=>{var k;const Te=Math.max(0,ye.length-1),Ke=Math.min(Math.max(0,l),Te);We.current=Ke,He.current=((k=ye[Ke])==null?void 0:k.entryIndex)??0,K(Ke)},[l]);const Ve=Re!==null?t[Re]:null,vt=h!==null?ye[h]:null,Pt=(pe==null?void 0:pe.title1)||(pe==null?void 0:pe.title2)||(pe==null?void 0:pe.title3)||(Ve==null?void 0:Ve.title1)||(Ve==null?void 0:Ve.title2)||(Ve==null?void 0:Ve.title3),At=hv(y,ye,t),wt=I!==null,Vt=Pt||At||wt,jt=At&&wt?{gap:j}:void 0,Yt=`${e}-titles-stack${J?` ${e}-titles-stack-stacked`:""}`,Kt=`${e}-titles-layer-out${J?` ${e}-titles-layer-out-stacked`:""}`,Rt=`${e}-titles-layer-out`,zt=(q??0)>0||o,on=w(_),xt=s.useMemo(()=>({title1Width:f??bo.title1Width,title2Width:S??bo.title2Width,title3Width:W??bo.title3Width}),[f,S,W]),yt=s.useMemo(()=>({title2MarginLeft:z,title3MarginLeft:L}),[z,L]),ke=s.useMemo(()=>pe?wi(e,pe,O,re,N):[],[e,pe,O,re,N]),Je=s.useMemo(()=>ke.map(Te=>xt[Te.widthKey]),[ke,xt]),rt=s.useMemo(()=>Lo(ke.length,Je),[ke.length,Je]),dt=s.useMemo(()=>vr(ke.length,Je),[ke.length,Je]),Lt=s.useMemo(()=>ke.filter(Te=>Te.prefix==="title1"),[ke]),St=s.useMemo(()=>ke.filter(Te=>Te.prefix==="title2"||Te.prefix==="title3"),[ke]),ht=s.useMemo(()=>$i(Lt,xt),[Lt,xt]),Wt=s.useMemo(()=>$i(St,xt),[St,xt]),Tt=s.useCallback((Te,Ke)=>{const k=ke.findIndex(de=>de.prefix===Te.prefix);if(!J||Ke==="single-row")return{effectiveWidth:dt[k]??0,resolvedWidth:rt[k]??0,maxWidth:yn(k,rt)};if(Ke==="two-row-top"){const de=Lt.findIndex(Ee=>Ee.prefix===Te.prefix);return{effectiveWidth:ht.effective[de]??0,resolvedWidth:ht.resolved[de]??0,maxWidth:yn(de,ht.resolved)}}const oe=St.findIndex(de=>de.prefix===Te.prefix);return{effectiveWidth:Wt.effective[oe]??0,resolvedWidth:Wt.resolved[oe]??0,maxWidth:yn(oe,Wt.resolved)}},[ke,St,Wt,dt,rt,Lt,ht,J]),Ot=s.useCallback(Te=>ep(ke,rt,yt,Te)+(J?0:q??0),[ke,rt,yt,J,q]),Gt=s.useCallback(()=>J?0:q??0,[J,q]),kt=s.useCallback(Te=>St.slice(0,Te).reduce((Ke,k,oe)=>Ke+(k.marginLeftKey?yt[k.marginLeftKey]??0:0)+(Wt.resolved[oe]??0),0),[St,Wt.resolved,yt]),_t=s.useCallback(Te=>{const Ke=St[Te];return kt(Te)+(Ke.marginLeftKey?yt[Ke.marginLeftKey]??0:0)+(Wt.resolved[Te]??0)},[St,Wt.resolved,kt,yt]),Ft=s.useCallback((Te,Ke,k)=>{if(!J||k==="single-row"){const lt=Te.findIndex(Zt=>Zt.prefix===Ke.prefix),Et=Te.map(Zt=>xt[Zt.widthKey]),Bt=Lo(Te.length,Et);return{effectiveWidth:vr(Te.length,Et)[lt]??0,resolvedWidth:Bt[lt]??0,maxWidth:yn(lt,Bt)}}if(k==="two-row-top"){const lt=Te.filter(Zt=>Zt.prefix==="title1"),Et=lt.findIndex(Zt=>Zt.prefix===Ke.prefix),{resolved:Bt,effective:rn}=$i(lt,xt);return{effectiveWidth:rn[Et]??0,resolvedWidth:Bt[Et]??0,maxWidth:yn(Et,Bt)}}const oe=Te.filter(lt=>lt.prefix==="title2"||lt.prefix==="title3"),de=oe.findIndex(lt=>lt.prefix===Ke.prefix),{resolved:Ee,effective:Xe}=$i(oe,xt);return{effectiveWidth:Xe[de]??0,resolvedWidth:Ee[de]??0,maxWidth:yn(de,Ee)}},[xt,J]),ut=(Te,Ke,k)=>{const oe=Te.marginLeftKey?yt[Te.marginLeftKey]??0:0,{effectiveWidth:de,resolvedWidth:Ee,maxWidth:Xe}=k??Tt(Te,Ke),lt=Math.max(oe,ni),Et=o&&Ke==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Te.prefix,style:{width:w(de),...oe>0?{marginLeft:w(oe)}:{}},children:[a.jsx("p",{className:Te.className,style:Te.style,children:Te.text}),Et&&Te.marginLeftKey?a.jsx("div",{"data-controls":Te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ee),style:{position:"absolute",top:0,left:w(-oe),width:w(lt),height:"100%",pointerEvents:"auto"}}):null,Et?a.jsx("div",{"data-controls":Te.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:w(-Ln/2),width:w(Ln),height:"100%",pointerEvents:"auto"}}):null]},Te.className)},H=(Te="two-row")=>{const Ke=ke.findIndex(de=>de.prefix==="title1"),k=Ke>=0?rt[Ke]:xt.title1Width,oe=Te==="two-row"&&o;return a.jsx("div",{...oe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(k)}:{},style:{width:w(q??0),flexShrink:0,alignSelf:"stretch",...oe?{pointerEvents:"auto"}:{}}})},Ie=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:O,"aria-hidden":"true",children:" "}),je=()=>a.jsx("span",{className:`${e}-entry-counter`,style:le,"aria-live":"polite","aria-atomic":"true",children:mv(ye,ce,y,t)}),Fe=()=>At?o&&wt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[je(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${as(j)} + ${j}))`,width:as(j),height:"100%",pointerEvents:"auto",zIndex:3}})]}):je():null,ft=()=>!At&&!wt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:jt,children:[Fe(),wt?It():null]}),Ht=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Pt?Ie():null,zt?H("single-row"):null,Dt(pe),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ft(),xn()]}),gt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Pt?Ie():null,zt?H("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:xe&&R?{minHeight:R}:void 0,children:[a.jsx("div",{ref:et,className:Yt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Yn(X||pe)}),a.jsxs("div",{ref:tt,className:Yt,style:{position:xe?"absolute":"relative",inset:xe?0:void 0,width:"100%",...xe&&te?{width:te,maxWidth:"100%"}:void 0},children:[Ve&&xe?a.jsx("div",{className:`${Kt} ${e}-titles-fade-out`,children:Yn(Ve)}):null,a.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Yn(pe)})]})]}),ft(),xn()]}),It=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(D??0,i),height:F.scalingValue(D??0,i),marginRight:ae,"--close-icon-hover-color":T},children:[a.jsx("button",{ref:ve,type:"button",className:`${e}-close-icon-inner`,onClick:Ye,"aria-label":"Close",children:a.jsx(gn,{url:I??"",fill:E,hoverFill:i&&!r?E:T,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ae,height:"100%",pointerEvents:"auto"}})]}),qt=(Te,Ke)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||Pt?Ie():null,zt?H("two-row"):null,Ke!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ke},children:Te}):a.jsxs(a.Fragment,{children:[Te,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ft()]}),Dt=Te=>{if(!Te)return null;const Ke=wi(e,Te,O,re,N);return a.jsx(a.Fragment,{children:Ke.map(k=>ut(k,"single-row",Ft(Ke,k,"single-row")))})},an=Te=>{if(!Te)return null;const Ke=wi(e,Te,O,re,N),k=Ke.find(oe=>oe.prefix==="title1");return k?ut(k,"two-row-top",Ft(Ke,k,"two-row-top")):null},cn=(Te,Ke=!1)=>{const k=Te?wi(e,Te,O,re,N):[],oe=k.filter(Xe=>Xe.prefix==="title2"||Xe.prefix==="title3"),de=o&&Ke;return oe.length>0||de||(_??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[oe.map(Xe=>ut(Xe,"two-row-bottom",Ft(k,Xe,"two-row-bottom"))),Ke&&o?a.jsxs(a.Fragment,{children:[Vo(),Go()]}):null]}):null,(_??0)>0||de?a.jsx("div",{"data-controls":de?"titleRowMarginBottom":void 0,"data-controls-axis":de?"y":void 0,"data-controls-reverse":de?"":void 0,className:de?`${e}-control`:void 0,style:{height:on,width:"100%",flexShrink:0,pointerEvents:de?"auto":"none"}}):null]}):null},qn=(Te,Ke=!1)=>a.jsxs(a.Fragment,{children:[qt(an(Te)),cn(Te,Ke)]}),Yn=Te=>J?a.jsx("div",{className:`${e}-titles-row-two-row`,children:qn(Te)}):Te?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Dt(Te)}):null,Qi=()=>{const Te=J?-1:ke.findIndex(oe=>oe.prefix==="title1"),Ke=!J&&(o||(q??0)>0)?(()=>{const oe=q??0,de=Te>=0?rt[Te]:xt.title1Width,Ee=Math.max(oe,ni);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(de),style:{position:"absolute",top:0,left:0,width:w(Ee),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,k=ke.flatMap((oe,de)=>{if(!oe.marginLeftKey)return[];const Ee=yt[oe.marginLeftKey]??0,Xe=Ju(ke,rt,yt,de)+Gt(),lt=Math.max(Ee,ni);return a.jsx("div",{"data-controls":oe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(rt[de]),style:{position:"absolute",top:0,left:w(Xe),width:w(lt),height:"100%",pointerEvents:"auto"}},oe.marginLeftKey)});return Ke?[Ke,...k]:k},hn=()=>ke.map((Te,Ke)=>{const k=yn(Ke,rt),de=Ot(Ke)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Te.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:w(de),width:w(Ln),height:"100%",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)}),Vo=()=>St.flatMap((Te,Ke)=>{if(!Te.marginLeftKey)return[];const k=yt[Te.marginLeftKey]??0,oe=kt(Ke),de=Math.max(k,ni),{resolvedWidth:Ee}=Tt(Te,"two-row-bottom");return a.jsx("div",{"data-controls":Te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ee),style:{position:"absolute",top:0,left:w(oe),width:w(de),height:"100%",pointerEvents:"auto"}},Te.marginLeftKey)}),Go=()=>St.map((Te,Ke)=>{const{maxWidth:k}=Tt(Te,"two-row-bottom"),de=_t(Ke)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Te.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:w(de),width:w(Ln),height:"100%",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)}),xn=()=>!o||J?null:a.jsxs(a.Fragment,{children:[Qi(),hn()]}),di=Te=>{const Ke=!Te.objectFit&&si(v);return{className:`${e}-slide-image-cell${Ke?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:P,maxHeight:A,...Ke?{"--image-aspect-ratio":ja(v)}:{}}}},Zi=Te=>Te.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":Te.objectFit}}:si(v)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},bn=Te=>{if(Te.length===0)return null;const Ke=Te.length>1,k=as(U),oe=`calc(-0.5 * (${k} + ${U}))`;if(Te.length===1){const de=Te[0];return a.jsx("div",{...di(de),children:a.jsx("img",{...Zi(de),src:de.assetId,alt:de.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ke?{gap:U}:void 0,children:Te.map((de,Ee)=>a.jsxs("div",{...di(de),children:[a.jsx("img",{...Zi(de),src:de.assetId,alt:de.name??"",draggable:!1}),o&&Ke&&Ee<Te.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:oe,width:k,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${de.assetId}-${Ee}`))})},Kn=!!(pe!=null&&pe.title2||pe!=null&&pe.title3||Ve!=null&&Ve.title2||Ve!=null&&Ve.title3||(_??0)>0||o),Ji=()=>a.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[a.jsx("div",{ref:et,className:Yt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:qn(X||pe)}),a.jsxs("div",{ref:tt,className:`${e}-titles-row-two-row`,style:{...xe&&R?{minHeight:R}:void 0,...xe&&te?{width:te,maxWidth:"100%"}:void 0},children:[qt(a.jsxs("div",{className:Yt,style:{position:xe?"absolute":"relative",inset:xe?0:void 0,width:"100%"},children:[Ve&&xe?a.jsx("div",{className:`${Rt} ${e}-titles-fade-out`,children:an(Ve)}):null,a.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:an(pe)})]}),xe&&R?R:void 0),Kn?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Ve&&xe?a.jsx("div",{className:`${Kt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:cn(Ve)}):null,a.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${J?` ${e}-titles-layer-in-stacked`:""}`,children:cn(pe,!0)})]}):null]})]}),eo=()=>{const Te=Kn;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Te?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Te?void 0:{flex:"0 0 auto",height:"auto"},children:qn(pe,!0)}),xn()]})};return a.jsxs("div",{ref:Ge,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{st||Ye()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:wt?void 0:-1,style:{opacity:fe?1:0,transition:"opacity 300ms ease",pointerEvents:fe?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...it}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Be,...mt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Oe,onClick:Te=>Te.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":be&&ye.length>1?"true":"false",onPointerDown:be?Me:void 0,onPointerUp:be?nt:void 0,onPointerCancel:be?pt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[vt&&Q?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:Te=>{Te.target===Te.currentTarget&&Ne(ue)},children:a.jsx("div",{className:`${e}-slide-area`,children:bn(vt.images)})},`slide-out-${ue}`):null,a.jsx("div",{className:`${e}-slide-layer-in${Q?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:se?bn(se.images):null})},`slide-in-${ue}-${ce}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ae,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ie,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...J?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${J?` ${e}-lightbox-content-area-stacked`:""}`,children:Vt&&a.jsx("div",{className:`${e}-text-bar-cell${J?` ${e}-text-bar-cell-stacked`:""}`,style:J?void 0:{flex:1,minWidth:0,width:"100%"},children:J?M==="fade"?Ji():eo():M==="fade"?gt():Ht()})})})]})]})]})};function Qx(e){return`
|
|
15283
|
+
`,Yx="01M3SBP3P8CMVMM1ZZ0QVD2PPF",Di={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 Kx(e){const t={};return t[Jt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Jt(e,"fontSettings")]={...Di.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Jt(e,"fontSize")]={...Di.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Jt(e,"lineHeight")]={...Di.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Jt(e,"letterSpacing")]={...Di.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Jt(e,"wordSpacing")]={...Di.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Jt(e,"textAlign")]={...Di.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Jt(e,"textAppearance")]={...Di.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Qx=No.reduce((e,t)=>({...e,...Kx(t)}),{}),Zx=No.reduce((e,t)=>({...e,[Jt(t,"fontFamily")]:"Goudy Bookletter 1911",[Jt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Jt(t,"letterSpacing")]:0,[Jt(t,"wordSpacing")]:0,[Jt(t,"textAlign")]:"left",[Jt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function fs(e){return No.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Jt(n,"fontSize")]=i),o!==void 0&&(t[Jt(n,"lineHeight")]=o),t},{})}const Jx=zx(),eb={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...Qx,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:"01M3QM74XESYN1HRYH9VRTZ5CK",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Yx,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Zx},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...fs({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...fs({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...fs({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:[Jx]}],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:{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},tb={element:qx,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:eb,sourceCode:Ux,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0},{path:"closeIcon"}]},fontSettingsPaths:{content:[],parameters:[...No.map(e=>({path:`${Jt(e,"fontFamily")}`}))]},fontRelations:{...No.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Jt(t,"fontFamily")}`}),{})}},nb=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:c=!1,journalItemId:d=null,onBeforeClose:u,onClose:p})=>{const{type:v,coverFit:x,backgroundColor:m,imageGap:h,maxWidth:b,maxHeight:S,textTransition:M,title1Width:y,title2Width:$,title3Width:R,title1MarginLeft:X=0,title2MarginLeft:B=0,title3MarginLeft:O=0,titleRowMarginBottom:N=0,titleHeaderLayout:z="single-row",countCloseGap:C=0,closeIcon:I,closeIconMaxWidth:j,closeIconColor:E,closeIconHoverColor:w,contentMarginTop:L=0,iconMarginRight:V=0}=n,_=s.useCallback($e=>A.scalingValue($e,i??!1),[i]),K=_(h??0),P=`${b}%`,f=`${S}%`,U=_(C),te=_(L),ce=_(V),F=Gi("title1",Vi(n,"title1"),i),ie=Gi("title2",Vi(n,"title2"),i),T=Gi("title3",Vi(n,"title3"),i),le=Gi("count",Vi(n,"count"),i),J=z==="mobile",Se=!i||!!r,Le=!o&&(!i||!!r),me=s.useMemo(()=>pa(t,v),[t,v]),[ye,ee]=s.useState(l),oe=me[ye],re=oe==null?void 0:oe.entry,[ge,we]=s.useState(!1),[Ae,fe]=s.useState(null),[ve,xe]=s.useState(!1),[g,G]=s.useState(null),[Q,ne]=s.useState(!1),[ue,q]=s.useState(0),[D,se]=s.useState(),[Y,pe]=s.useState(),[H,Ie]=s.useState(null),de=s.useRef(null),Z=s.useRef(0),Ne=s.useRef(0),Oe=s.useRef(0),Je=s.useRef(!1),De=s.useRef(null),Ze=s.useRef(null),at=s.useRef(null),Xe=s.useRef(null),be=s.useRef(null),He=s.useRef(null),je=s.useRef(null),Qe=s.useCallback(()=>{const $e=Ze.current;if(!$e)return;const Ke=$e.closest(`.${e}-lightbox-content-area`);if(!Ke)return $e.getBoundingClientRect().width;const k=Array.from(Ke.children).reduce((ae,he)=>!(he instanceof HTMLElement)||he.contains($e)?ae:ae+he.getBoundingClientRect().width,0);return Ke.getBoundingClientRect().width-k},[e]),Ce=s.useCallback(()=>{de.current&&(clearTimeout(de.current),de.current=null)},[]),_e=s.useCallback($e=>{$e===Z.current&&(G(null),ne(!1))},[]),Ue=s.useCallback(()=>{o||Je.current||(Je.current=!0,u==null||u(),we(!1),De.current=setTimeout(()=>{p()},300))},[o,u,p]),Ye=s.useCallback($e=>!!($e.closest("[data-controls]")||$e.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:lt,backdropStyle:it,mediaAreaStyle:qe,overlayContentStyle:Ee,swipeHandlers:pt,dismissAreaStyle:ke}=bp({enabled:Le,onClose:Ue,animMs:300,isBlockedTarget:Ye}),We=s.useCallback($e=>{c&&np($e+1,d,!0)},[c,d]),Ve=s.useCallback($e=>{if($e)return $e.getBoundingClientRect().height},[]),ct=s.useCallback($e=>{if(me.length===0)return;const Ke=($e%me.length+me.length)%me.length;if(Ke===ye)return;const k=me[ye],ae=me[Ke];Z.current+=1;const he=Z.current,Me=M==="fade"&&Fc(k==null?void 0:k.entry)!==Fc(ae==null?void 0:ae.entry),Ge=Ve(at.current),dt=Me?(()=>{const Ut=Qe();Un.flushSync(()=>{Ie(ae.entry)}),at.current&&Ut&&(at.current.style.width=`${Ut}px`);const sn=Ve(at.current);return at.current&&(at.current.style.width=""),{measuredIncomingTitlesHeight:sn,incomingTitlesMeasureWidth:Ut}})():void 0,_t=Math.max(Ge??0,(dt==null?void 0:dt.measuredIncomingTitlesHeight)??0)||void 0;q(he),G(ye),ne(!0),ee(Ke),We(Ke),Oe.current=Ke,Me?(Ce(),_t&&se(_t),dt!=null&&dt.incomingTitlesMeasureWidth&&pe(dt.incomingTitlesMeasureWidth),fe((k==null?void 0:k.entryIndex)??null),xe(!0),Ne.current=ae.entryIndex,de.current=setTimeout(()=>{fe(null),xe(!1),se(void 0),pe(void 0),Ie(null),de.current=null},400)):(Ce(),fe(null),xe(!1),se(void 0),pe(void 0),Ie(null),Ne.current=ae.entryIndex)},[ye,Ce,Qe,Ve,me,We,M]),ot=s.useCallback(()=>{je.current=null},[]),xt=s.useCallback($e=>{!Se||me.length<=1||$e.pointerType==="mouse"&&$e.button!==0||$e.target.closest("[data-controls]")||(je.current={startX:$e.clientX,startY:$e.clientY,pointerId:$e.pointerId})},[Se,me.length]),Pt=s.useCallback($e=>{var Ut;if(!Se||me.length<=1||$e.pointerType==="mouse"&&$e.button!==0)return;if(lt){ot();return}const Ke=je.current;if(!Ke||Ke.pointerId!==$e.pointerId||(ot(),$e.target.closest("[data-controls]")))return;const ae=$e.clientX-Ke.startX,he=$e.clientY-Ke.startY,Me=Math.abs(ae),Ge=Math.abs(he);if(Me>=mv&&Me>Ge){ct(ae>0?ye-1:ye+1);return}if(Me>Mc||Ge>Mc)return;const dt=(Ut=Xe.current)==null?void 0:Ut.getBoundingClientRect(),_t=dt?dt.left+dt.width/2:window.innerWidth/2;ct($e.clientX<_t?ye-1:ye+1)},[ye,Se,ct,lt,ot,me.length]),Vt=s.useCallback($e=>{const Ke=je.current;(Ke==null?void 0:Ke.pointerId)===$e.pointerId&&ot()},[ot]);jl(),s.useEffect(()=>{He.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const $e=requestAnimationFrame(()=>{we(!0),requestAnimationFrame(()=>{be.current?be.current.focus():Xe.current&&Xe.current.focus()})});return()=>{cancelAnimationFrame($e),De.current&&clearTimeout(De.current),de.current&&clearTimeout(de.current);const Ke=He.current;Ke&&document.contains(Ke)&&Ke.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var $e;M!=="fade"&&(Ne.current=(($e=me[ye])==null?void 0:$e.entryIndex)??0,Ce(),fe(null),xe(!1),se(void 0),pe(void 0))},[ye,Ce,me,M]),s.useEffect(()=>{const $e=Ke=>{if(Ke.key==="Escape"){Ue();return}if(Ke.key==="ArrowLeft"&&me.length>1){ct(ye-1);return}if(Ke.key==="ArrowRight"&&me.length>1){ct(ye+1);return}if(Ke.key==="Tab"&&Xe.current){const k=Xe.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ae=Array.from(k).filter(dt=>!dt.closest('[aria-hidden="true"]'));if(ae.length===0)return;const he=ae[0],Me=ae[ae.length-1],Ge=document.activeElement;Ke.shiftKey?(Ge===he||!Xe.current.contains(Ge))&&(Ke.preventDefault(),Me.focus()):(Ge===Me||!Xe.current.contains(Ge))&&(Ke.preventDefault(),he.focus())}};return window.addEventListener("keydown",$e),()=>window.removeEventListener("keydown",$e)},[ct,Ue,ye,me.length]),s.useLayoutEffect(()=>{Ce(),Z.current=0,q(0),G(null),ne(!1),fe(null),xe(!1),se(void 0),pe(void 0),Ie(null),ee($e=>{const Ke=Math.max(0,me.length-1);return Math.min($e,Ke)})},[Ce,t.length,v,me.length]),s.useLayoutEffect(()=>{var k;const $e=Math.max(0,me.length-1),Ke=Math.min(Math.max(0,l),$e);Oe.current=Ke,Ne.current=((k=me[Ke])==null?void 0:k.entryIndex)??0,ee(Ke)},[l]);const vt=Ae!==null?t[Ae]:null,Mt=g!==null?me[g]:null,Ht=(re==null?void 0:re.title1)||(re==null?void 0:re.title2)||(re==null?void 0:re.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),Gt=Sv(v,me,t),kt=I!==null,Pe=Ht||Gt||kt,Be=Gt&&kt?{gap:U}:void 0,ft=`${e}-titles-stack${J?` ${e}-titles-stack-stacked`:""}`,$t=`${e}-titles-layer-out${J?` ${e}-titles-layer-out-stacked`:""}`,et=`${e}-titles-layer-out`,Et=(X??0)>0||o,Xt=_(N),mt=s.useMemo(()=>({title1Width:y??wo.title1Width,title2Width:$??wo.title2Width,title3Width:R??wo.title3Width}),[y,$,R]),gt=s.useMemo(()=>({title2MarginLeft:B,title3MarginLeft:O}),[B,O]),Re=s.useMemo(()=>re?Ti(e,re,F,ie,T):[],[e,re,F,ie,T]),tt=s.useMemo(()=>Re.map($e=>mt[$e.widthKey]),[Re,mt]),nt=s.useMemo(()=>Ro(Re.length,tt),[Re.length,tt]),st=s.useMemo(()=>vr(Re.length,tt),[Re.length,tt]),At=s.useMemo(()=>Re.filter($e=>$e.prefix==="title1"),[Re]),St=s.useMemo(()=>Re.filter($e=>$e.prefix==="title2"||$e.prefix==="title3"),[Re]),ht=s.useMemo(()=>Ii(At,mt),[At,mt]),Dt=s.useMemo(()=>Ii(St,mt),[St,mt]),Ct=s.useCallback(($e,Ke)=>{const k=Re.findIndex(he=>he.prefix===$e.prefix);if(!J||Ke==="single-row")return{effectiveWidth:st[k]??0,resolvedWidth:nt[k]??0,maxWidth:yn(k,nt)};if(Ke==="two-row-top"){const he=At.findIndex(Me=>Me.prefix===$e.prefix);return{effectiveWidth:ht.effective[he]??0,resolvedWidth:ht.resolved[he]??0,maxWidth:yn(he,ht.resolved)}}const ae=St.findIndex(he=>he.prefix===$e.prefix);return{effectiveWidth:Dt.effective[ae]??0,resolvedWidth:Dt.resolved[ae]??0,maxWidth:yn(ae,Dt.resolved)}},[Re,St,Dt,st,nt,At,ht,J]),qt=s.useCallback($e=>ap(Re,nt,gt,$e)+(J?0:X??0),[Re,nt,gt,J,X]),jt=s.useCallback(()=>J?0:X??0,[J,X]),Nt=s.useCallback($e=>St.slice(0,$e).reduce((Ke,k,ae)=>Ke+(k.marginLeftKey?gt[k.marginLeftKey]??0:0)+(Dt.resolved[ae]??0),0),[St,Dt.resolved,gt]),Bt=s.useCallback($e=>{const Ke=St[$e];return Nt($e)+(Ke.marginLeftKey?gt[Ke.marginLeftKey]??0:0)+(Dt.resolved[$e]??0)},[St,Dt.resolved,Nt,gt]),Wt=s.useCallback(($e,Ke,k)=>{if(!J||k==="single-row"){const dt=$e.findIndex(en=>en.prefix===Ke.prefix),_t=$e.map(en=>mt[en.widthKey]),Ut=Ro($e.length,_t);return{effectiveWidth:vr($e.length,_t)[dt]??0,resolvedWidth:Ut[dt]??0,maxWidth:yn(dt,Ut)}}if(k==="two-row-top"){const dt=$e.filter(en=>en.prefix==="title1"),_t=dt.findIndex(en=>en.prefix===Ke.prefix),{resolved:Ut,effective:sn}=Ii(dt,mt);return{effectiveWidth:sn[_t]??0,resolvedWidth:Ut[_t]??0,maxWidth:yn(_t,Ut)}}const ae=$e.filter(dt=>dt.prefix==="title2"||dt.prefix==="title3"),he=ae.findIndex(dt=>dt.prefix===Ke.prefix),{resolved:Me,effective:Ge}=Ii(ae,mt);return{effectiveWidth:Ge[he]??0,resolvedWidth:Me[he]??0,maxWidth:yn(he,Me)}},[mt,J]),wt=($e,Ke,k)=>{const ae=$e.marginLeftKey?gt[$e.marginLeftKey]??0:0,{effectiveWidth:he,resolvedWidth:Me,maxWidth:Ge}=k??Ct($e,Ke),dt=Math.max(ae,ii),_t=o&&Ke==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":$e.prefix,style:{width:_(he),...ae>0?{marginLeft:_(ae)}:{}},children:[a.jsx("p",{className:$e.className,style:$e.style,children:$e.text}),_t&&$e.marginLeftKey?a.jsx("div",{"data-controls":$e.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:_(-ae),width:_(dt),height:"100%",pointerEvents:"auto"}}):null,_t?a.jsx("div",{"data-controls":$e.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:_(-Pn/2),width:_(Pn),height:"100%",pointerEvents:"auto"}}):null]},$e.className)},W=($e="two-row")=>{const Ke=Re.findIndex(he=>he.prefix==="title1"),k=Ke>=0?nt[Ke]:mt.title1Width,ae=$e==="two-row"&&o;return a.jsx("div",{...ae?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(k)}:{},style:{width:_(X??0),flexShrink:0,alignSelf:"stretch",...ae?{pointerEvents:"auto"}:{}}})},Te=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:F,"aria-hidden":"true",children:" "}),ze=()=>a.jsx("span",{className:`${e}-entry-counter`,style:le,"aria-live":"polite","aria-atomic":"true",children:bv(me,ye,v,t)}),Fe=()=>Gt?o&&kt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[ze(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${as(U)} + ${U}))`,width:as(U),height:"100%",pointerEvents:"auto",zIndex:3}})]}):ze():null,yt=()=>!Gt&&!kt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Be,children:[Fe(),kt?Tt():null]}),Ot=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Gt||Ht?Te():null,Et?W("single-row"):null,It(re),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),yt(),bn()]}),ut=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Gt||Ht?Te():null,Et?W("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:ve&&D?{minHeight:D}:void 0,children:[a.jsx("div",{ref:at,className:ft,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:xn(H||re)}),a.jsxs("div",{ref:Ze,className:ft,style:{position:ve?"absolute":"relative",inset:ve?0:void 0,width:"100%",...ve&&Y?{width:Y,maxWidth:"100%"}:void 0},children:[vt&&ve?a.jsx("div",{className:`${$t} ${e}-titles-fade-out`,children:xn(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ve?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:xn(re)})]})]}),yt(),bn()]}),Tt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:A.scalingValue(j??0,i),height:A.scalingValue(j??0,i),marginRight:ce,"--close-icon-hover-color":w},children:[a.jsx("button",{ref:be,type:"button",className:`${e}-close-icon-inner`,onClick:Ue,"aria-label":"Close",children:a.jsx(gn,{url:I??"",fill:E,hoverFill:i&&!r?E:w,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ce,height:"100%",pointerEvents:"auto"}})]}),Yt=($e,Ke)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Gt||Ht?Te():null,Et?W("two-row"):null,Ke!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ke},children:$e}):a.jsxs(a.Fragment,{children:[$e,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),yt()]}),It=$e=>{if(!$e)return null;const Ke=Ti(e,$e,F,ie,T);return a.jsx(a.Fragment,{children:Ke.map(k=>wt(k,"single-row",Wt(Ke,k,"single-row")))})},Zt=$e=>{if(!$e)return null;const Ke=Ti(e,$e,F,ie,T),k=Ke.find(ae=>ae.prefix==="title1");return k?wt(k,"two-row-top",Wt(Ke,k,"two-row-top")):null},on=($e,Ke=!1)=>{const k=$e?Ti(e,$e,F,ie,T):[],ae=k.filter(Ge=>Ge.prefix==="title2"||Ge.prefix==="title3"),he=o&&Ke;return ae.length>0||he||(N??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[ae.map(Ge=>wt(Ge,"two-row-bottom",Wt(k,Ge,"two-row-bottom"))),Ke&&o?a.jsxs(a.Fragment,{children:[pi(),Kn()]}):null]}):null,(N??0)>0||he?a.jsx("div",{"data-controls":he?"titleRowMarginBottom":void 0,"data-controls-axis":he?"y":void 0,"data-controls-reverse":he?"":void 0,className:he?`${e}-control`:void 0,style:{height:Xt,width:"100%",flexShrink:0,pointerEvents:he?"auto":"none"}}):null]}):null},Wn=($e,Ke=!1)=>a.jsxs(a.Fragment,{children:[Yt(Zt($e)),on($e,Ke)]}),xn=$e=>J?a.jsx("div",{className:`${e}-titles-row-two-row`,children:Wn($e)}):$e?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:It($e)}):null,ui=()=>{const $e=J?-1:Re.findIndex(ae=>ae.prefix==="title1"),Ke=!J&&(o||(X??0)>0)?(()=>{const ae=X??0,he=$e>=0?nt[$e]:mt.title1Width,Me=Math.max(ae,ii);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(he),style:{position:"absolute",top:0,left:0,width:_(Me),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,k=Re.flatMap((ae,he)=>{if(!ae.marginLeftKey)return[];const Me=gt[ae.marginLeftKey]??0,Ge=rp(Re,nt,gt,he)+jt(),dt=Math.max(Me,ii);return a.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(nt[he]),style:{position:"absolute",top:0,left:_(Ge),width:_(dt),height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)});return Ke?[Ke,...k]:k},dn=()=>Re.map(($e,Ke)=>{const k=yn(Ke,nt),he=qt(Ke)-Pn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":$e.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:_(he),width:_(Pn),height:"100%",pointerEvents:"auto"}})},`${$e.widthKey}-junction`)}),pi=()=>St.flatMap(($e,Ke)=>{if(!$e.marginLeftKey)return[];const k=gt[$e.marginLeftKey]??0,ae=Nt(Ke),he=Math.max(k,ii),{resolvedWidth:Me}=Ct($e,"two-row-bottom");return a.jsx("div",{"data-controls":$e.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:_(ae),width:_(he),height:"100%",pointerEvents:"auto"}},$e.marginLeftKey)}),Kn=()=>St.map(($e,Ke)=>{const{maxWidth:k}=Ct($e,"two-row-bottom"),he=Bt(Ke)-Pn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":$e.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:_(he),width:_(Pn),height:"100%",pointerEvents:"auto"}})},`${$e.widthKey}-junction`)}),bn=()=>!o||J?null:a.jsxs(a.Fragment,{children:[ui(),dn()]}),mi=$e=>{const Ke=!$e.objectFit&&li(x);return{className:`${e}-slide-image-cell${Ke?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:P,maxHeight:f,...Ke?{"--image-aspect-ratio":ja(x)}:{}}}},eo=$e=>$e.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":$e.objectFit}}:li(x)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Sn=$e=>{if($e.length===0)return null;const Ke=$e.length>1,k=as(K),ae=`calc(-0.5 * (${k} + ${K}))`;if($e.length===1){const he=$e[0];return a.jsx("div",{...mi(he),children:a.jsx("img",{...eo(he),src:he.assetId,alt:he.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ke?{gap:K}:void 0,children:$e.map((he,Me)=>a.jsxs("div",{...mi(he),children:[a.jsx("img",{...eo(he),src:he.assetId,alt:he.name??"",draggable:!1}),o&&Ke&&Me<$e.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ae,width:k,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${he.assetId}-${Me}`))})},Qn=!!(re!=null&&re.title2||re!=null&&re.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(N??0)>0||o),to=()=>a.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[a.jsx("div",{ref:at,className:ft,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Wn(H||re)}),a.jsxs("div",{ref:Ze,className:`${e}-titles-row-two-row`,style:{...ve&&D?{minHeight:D}:void 0,...ve&&Y?{width:Y,maxWidth:"100%"}:void 0},children:[Yt(a.jsxs("div",{className:ft,style:{position:ve?"absolute":"relative",inset:ve?0:void 0,width:"100%"},children:[vt&&ve?a.jsx("div",{className:`${et} ${e}-titles-fade-out`,children:Zt(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ve?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Zt(re)})]}),ve&&D?D:void 0),Qn?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&ve?a.jsx("div",{className:`${$t} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:on(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ve?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${J?` ${e}-titles-layer-in-stacked`:""}`,children:on(re,!0)})]}):null]})]}),no=()=>{const $e=Qn;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...$e?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:$e?void 0:{flex:"0 0 auto",height:"auto"},children:Wn(re,!0)}),bn()]})};return a.jsxs("div",{ref:Xe,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{lt||Ue()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:kt?void 0:-1,style:{opacity:ge?1:0,transition:"opacity 300ms ease",pointerEvents:ge?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...it}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:ke,...pt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:qe,onClick:$e=>$e.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":Se&&me.length>1?"true":"false",onPointerDown:Se?xt:void 0,onPointerUp:Se?Pt:void 0,onPointerCancel:Se?Vt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[Mt&&Q?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:$e=>{$e.target===$e.currentTarget&&_e(ue)},children:a.jsx("div",{className:`${e}-slide-area`,children:Sn(Mt.images)})},`slide-out-${ue}`):null,a.jsx("div",{className:`${e}-slide-layer-in${Q?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:oe?Sn(oe.images):null})},`slide-in-${ue}-${ye}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ee,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:te,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...J?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${J?` ${e}-lightbox-content-area-stacked`:""}`,children:Pe&&a.jsx("div",{className:`${e}-text-bar-cell${J?` ${e}-text-bar-cell-stacked`:""}`,style:J?void 0:{flex:1,minWidth:0,width:"100%"},children:J?M==="fade"?to():no():M==="fade"?ut():Ot()})})})]})]})]})};function ib(e){return`
|
|
15284
15284
|
.${e}-wrapper {
|
|
15285
15285
|
position: relative;
|
|
15286
15286
|
width: 100%;
|
|
@@ -15802,7 +15802,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15802
15802
|
pointer-events: auto;
|
|
15803
15803
|
z-index: 10;
|
|
15804
15804
|
}
|
|
15805
|
-
`}const
|
|
15805
|
+
`}const ob=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:c}=A.useScopedStyles(),d=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:v}=e,x=s.useRef(null),[m,h]=s.useState(!1),[b,S]=s.useState(0),M=s.useRef(!1),y=s.useRef(!1),$=s.useRef(!1),R=s.useMemo(()=>(t??[]).filter(C=>Po(C).length>0),[t]),X=m&&R.length>0,B=!n,O=s.useCallback(()=>{B&&($.current=!0,hv(y.current,d),y.current=!1)},[B,d]),N=(C=0)=>{if(R.length===0||n&&!i&&!o)return;const I=pa(R,v),j=Math.max(0,Math.min(C,I.length-1));if(S(j),B){const E=ip();np(j+1,d,E),y.current=!E}h(!0)},z=s.useCallback(()=>{h(!1),$.current=!1},[]);return s.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),s.useEffect(()=>{if(!B||typeof window>"u")return;const C=window.history.scrollRestoration;return window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration=C}},[B]),s.useEffect(()=>{if(!B||M.current)return;M.current=!0;const C=kc(d);if(!C)return;const I=Ac(C,pa(R,v).length);I<0||(S(I),h(!0))},[R,d,B,v]),s.useEffect(()=>{if(!B)return;const C=()=>{if($.current){$.current=!1,h(!1);return}const I=kc(d);if(!I){h(!1);return}const j=Ac(I,pa(R,v).length);if(j<0){h(!1);return}y.current=!1,S(j),h(!0)};return window.addEventListener("popstate",C),()=>window.removeEventListener("popstate",C)},[R,d,B,v]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:x,className:`${c}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ib(c)}}),u?a.jsx("button",{type:"button",className:`${c}-cover ${li(p)?`${c}-ratio-wrapper-cover`:`${c}-ratio-wrapper-fit`}`,onClick:()=>N(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...li(p)?{"--image-aspect-ratio":ja(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${c}-cover-image ${li(p)?`${c}-cover-image-cover`:`${c}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),X&&typeof document<"u"&&(()=>{const C=(r?document.getElementById(r):null)??document.body;return Un.createPortal(a.jsx(nb,{prefix:c,entries:R,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:b,enableUrlSync:B,journalItemId:d,onBeforeClose:O,onClose:z}),C)})()]})},rb=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
15806
15806
|
import { createPortal } from 'react-dom';
|
|
15807
15807
|
import { CommonComponentProps } from '../props';
|
|
15808
15808
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16567,7 +16567,7 @@ export type LightboxJournalSettings = {
|
|
|
16567
16567
|
closeIconColor: string;
|
|
16568
16568
|
closeIconHoverColor: string;
|
|
16569
16569
|
};
|
|
16570
|
-
`,eb="01M3SBP3P8CMVMM1ZZ0QVD2PPF",Wi={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 tb(e){const t={};return t[bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSettings")]={...Wi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSize")]={...Wi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[bt(e,"lineHeight")]={...Wi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[bt(e,"letterSpacing")]={...Wi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[bt(e,"wordSpacing")]={...Wi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[bt(e,"textAlign")]={...Wi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[bt(e,"textAppearance")]={...Wi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const nb=Li.reduce((e,t)=>({...e,...tb(t)}),{}),ib=Li.reduce((e,t)=>({...e,[bt(t,"fontFamily")]:"Goudy Bookletter 1911",[bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[bt(t,"letterSpacing")]:0,[bt(t,"wordSpacing")]:0,[bt(t,"textAlign")]:"left",[bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ys(e){return Li.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[bt(n,"fontSize")]=i),o!==void 0&&(t[bt(n,"lineHeight")]=o),t},{})}const ob=fv(),rb={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"}},...nb,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:"01M3QM74XESYN1HRYH9VRTZ5CK",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:eb,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...ib,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...ys({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,...ys({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,...ys({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:[ob]}],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:{assetId:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"",objectFit:"contain"},{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"",objectFit:"contain"},{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"",objectFit:"contain"}]}]}},ab={element:Zx,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:rb,sourceCode:Jx,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0},{path:"closeIcon"}]},fontSettingsPaths:{content:[],parameters:[...Li.map(e=>({path:`${bt(e,"fontFamily")}`}))]},fontRelations:{...Li.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${bt(t,"fontFamily")}`}),{})}},sb={sizeType:"custom",value:700,min:400,max:700};function Ca(e,t){return{widthPx:e,heightPx:e*t}}function qs(e,t,n,i,o,r){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,r/2),i-r/2)}}function ad(e,t,n,i){const{heightPx:o}=Ca(n,i);return qs(e/2,t/2,e,t,n,o)}function fp(e,t,n){for(const i of n){const{heightPx:o}=Ca(i.widthPx,i.aspectRatio),r=i.widthPx/2,l=o/2;if(e>=i.x-r&&e<=i.x+r&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function lb(e,t,n,i,o,r,l,c){if(o==="system")return"none";const d=i.getBoundingClientRect(),u=document.elementFromPoint(d.left+e,d.top+t);return u&&u.closest("a")?"none":fp(e,t,n)||r==="area"?l??"none":c??"none"}function sd(e,t,n){var c;const{sizeType:i,value:o,min:r,max:l}=t;return i==="custom"?o:i==="as is"?((c=n.get(e))==null?void 0:c.naturalWidth)??o:Math.round(Math.random()*(l-r)+r)}function cb(e){return`
|
|
16570
|
+
`,ab="01M3SBP3P8CMVMM1ZZ0QVD2PPF",Bi={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 sb(e){const t={};return t[bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSettings")]={...Bi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSize")]={...Bi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[bt(e,"lineHeight")]={...Bi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[bt(e,"letterSpacing")]={...Bi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[bt(e,"wordSpacing")]={...Bi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[bt(e,"textAlign")]={...Bi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[bt(e,"textAppearance")]={...Bi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const lb=Mi.reduce((e,t)=>({...e,...sb(t)}),{}),cb=Mi.reduce((e,t)=>({...e,[bt(t,"fontFamily")]:"Goudy Bookletter 1911",[bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[bt(t,"letterSpacing")]:0,[bt(t,"wordSpacing")]:0,[bt(t,"textAlign")]:"left",[bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ys(e){return Mi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[bt(n,"fontSize")]=i),o!==void 0&&(t[bt(n,"lineHeight")]=o),t},{})}const db=wv(),ub={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"}},...lb,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:"01M3QM74XESYN1HRYH9VRTZ5CK",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:ab,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...cb,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...ys({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,...ys({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,...ys({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:[db]}],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:{assetId:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"",objectFit:"contain"},{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"",objectFit:"contain"},{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"",objectFit:"contain"}]}]}},pb={element:ob,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:ub,sourceCode:rb,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0},{path:"closeIcon"}]},fontSettingsPaths:{content:[],parameters:[...Mi.map(e=>({path:`${bt(e,"fontFamily")}`}))]},fontRelations:{...Mi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${bt(t,"fontFamily")}`}),{})}},mb={sizeType:"custom",value:700,min:400,max:700};function Ca(e,t){return{widthPx:e,heightPx:e*t}}function qs(e,t,n,i,o,r){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,r/2),i-r/2)}}function ad(e,t,n,i){const{heightPx:o}=Ca(n,i);return qs(e/2,t/2,e,t,n,o)}function wp(e,t,n){for(const i of n){const{heightPx:o}=Ca(i.widthPx,i.aspectRatio),r=i.widthPx/2,l=o/2;if(e>=i.x-r&&e<=i.x+r&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function gb(e,t,n,i,o,r,l,c){if(o==="system")return"none";const d=i.getBoundingClientRect(),u=document.elementFromPoint(d.left+e,d.top+t);return u&&u.closest("a")?"none":wp(e,t,n)||r==="area"?l??"none":c??"none"}function sd(e,t,n){var c;const{sizeType:i,value:o,min:r,max:l}=t;return i==="custom"?o:i==="as is"?((c=n.get(e))==null?void 0:c.naturalWidth)??o:Math.round(Math.random()*(l-r)+r)}function hb(e){return`
|
|
16571
16571
|
.${e}-root {
|
|
16572
16572
|
position: absolute;
|
|
16573
16573
|
top: 0;
|
|
@@ -16602,7 +16602,7 @@ export type LightboxJournalSettings = {
|
|
|
16602
16602
|
width: 32px;
|
|
16603
16603
|
height: 32px;
|
|
16604
16604
|
}
|
|
16605
|
-
`}function
|
|
16605
|
+
`}function fb(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 yb(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await fb(i)]));return new Map(n)}function vb({settings:e,content:t=[],isEditor:n}){const{prefix:i}=A.useScopedStyles(),[o,r]=s.useState(null),[l,c]=s.useState([]),[d,u]=s.useState(0),p=s.useRef(0),[v,x]=s.useState({x:0,y:0}),[m,h]=s.useState("none"),b=s.useRef({x:0,y:0}),[S,M]=s.useState(!1),[y,$]=s.useState(!1),R=s.useRef(new Map),{imageSize:X=mb,cursor:B="system",target:O="area",position:N="random",visible:z="all",defaultCursor:C=null,hoverCursor:I=null}=e,j=t.filter(P=>{var f;return!!((f=P==null?void 0:P.image)!=null&&f.assetId)}),E=s.useMemo(()=>hb(i),[i]),w=s.useCallback((P,f,U=l)=>{if(!o)return;const te=o.getBoundingClientRect(),ce=P-te.left,F=f-te.top;x({x:ce,y:F}),h(gb(ce,F,U,o,B,O,I,C))},[o,l,B,O,I,C]);s.useEffect(()=>{const P=[...j.map(U=>U.image.assetId),C,I].filter(U=>!!U);if(P.length===0){R.current=new Map,$(!0);return}let f=!1;return $(!1),yb(P).then(U=>{f||(R.current=U,$(!0))}),()=>{f=!0}},[t,C,I]),s.useEffect(()=>{if(!o)return;const P=U=>{U.stopPropagation(),b.current={x:U.clientX,y:U.clientY},w(U.clientX,U.clientY)},f=()=>{S&&w(b.current.x,b.current.y)};return o.addEventListener("mousemove",P),window.addEventListener("scroll",f,!0),()=>{o.removeEventListener("mousemove",P),window.removeEventListener("scroll",f,!0)}},[o,S,w]),s.useEffect(()=>{!o||!S||w(b.current.x,b.current.y)},[l,o,S,w]),s.useEffect(()=>{S||h("none")},[S]);const L=(P,f,U,te={})=>{var J,Se;if(!((J=P==null?void 0:P.image)!=null&&J.assetId))return null;const ce=((Se=R.current.get(P.image.assetId))==null?void 0:Se.aspectRatio)??1,F=sd(P.image.assetId,X,R.current),{heightPx:ie}=Ca(F,ce);let T=0,le=0;return N==="same"?{x:T,y:le}=ad(f,U,F,ce):(T=te.x??Math.random()*f,le=te.y??Math.random()*U,{x:T,y:le}=qs(T,le,f,U,F,ie)),{id:p.current++,assetId:P.image.assetId,link:P.link,name:P.image.name,x:T,y:le,xRatio:T/f,yRatio:le/U,aspectRatio:ce,widthPx:F}},V=()=>{if(!o)return;const P=o.getBoundingClientRect(),f=P.width,U=P.height;f===0||U===0||c(te=>te.length===0?te:te.map(ce=>{const F=X.sizeType==="random"?ce.widthPx:sd(ce.assetId,X,R.current),{heightPx:ie}=Ca(F,ce.aspectRatio);if(N==="same"){const{x:J,y:Se}=ad(f,U,F,ce.aspectRatio);return{...ce,x:J,y:Se,widthPx:F}}const{x:T,y:le}=qs(ce.xRatio*f,ce.yRatio*U,f,U,F,ie);return{...ce,x:T,y:le,widthPx:F}}))};s.useEffect(()=>{if(!o||j.length===0||!y)return;const P=o.getBoundingClientRect(),f=P.width,U=P.height,te=L(j[0],f,U);te&&(c([te]),u(j.length>1?1:0))},[X,N,o,t,y]),s.useEffect(()=>{if(!o)return;V();const P=new ResizeObserver(V);return P.observe(o),window.addEventListener("resize",V),()=>{P.disconnect(),window.removeEventListener("resize",V)}},[o,N,X,l.length]),s.useEffect(()=>{z==="last One"&&c(P=>P.length>0?[P[P.length-1]]:[])},[z]);const _=P=>{if(!o||j.length===0||!y)return;const f=o.getBoundingClientRect(),U=P.clientX-f.left,te=P.clientY-f.top;if(O==="image"&&!wp(U,te,l))return;let ce=0,F=0;N==="on Click"?(ce=U,F=te):N==="same"?(ce=f.width/2,F=f.height/2):(ce=Math.random()*f.width,F=Math.random()*f.height);const ie=j[d%j.length],T=L(ie,f.width,f.height,{x:ce,y:F});if(!T)return;const le=z==="all"?[...l,T]:[T];c(le),u(J=>(J+1)%j.length),w(P.clientX,P.clientY,le)},K=B==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:E}}),a.jsxs("div",{ref:r,onClick:_,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),className:`${i}-root`,style:{cursor:K?"none":"default"},children:[l.map(P=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${P.y}px`,left:`${P.x}px`,width:`${P.widthPx}px`,cursor:K?"none":"default"},children:O==="area"&&P.link?a.jsx("a",{href:P.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:P.assetId,alt:P.name,className:`${i}-image`})}):a.jsx("img",{src:P.assetId,alt:P.name,className:`${i}-image`})},P.id)),S&&K&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${v.x}px`,top:`${v.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const xb=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16606
16606
|
import { CommonComponentProps } from '../props';
|
|
16607
16607
|
import { useScopedStyles } from '../utils/index';
|
|
16608
16608
|
|
|
@@ -17132,7 +17132,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17132
17132
|
</>
|
|
17133
17133
|
);
|
|
17134
17134
|
}
|
|
17135
|
-
`,
|
|
17135
|
+
`,bb={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:{assetId:{type:"string"},name:{type:"string"}},required:["assetId","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{assetId:"01M3QM74XESYN1HRYH9VRTZ5CK",name:"Slider-1.png"},link:""},{image:{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"Slider-2.png"},link:""},{image:{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"Slider-3.png"},link:""},{image:{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"Slider-4.png"},link:""},{image:{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"Slider-5.png"},link:""},{image:{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"Slider-6.png"},link:""},{image:{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},Sb={element:vb,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:bb,sourceCode:xb,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},wb=100,$b=70,vi="cubic-bezier(0.86, 0, 0.07, 1)";function Cb(e){return`
|
|
17136
17136
|
.${e}-wrapper {
|
|
17137
17137
|
position: relative;
|
|
17138
17138
|
width: 100%;
|
|
@@ -17167,34 +17167,34 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17167
17167
|
}
|
|
17168
17168
|
.${e}-incoming-next {
|
|
17169
17169
|
z-index: 4;
|
|
17170
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
17170
|
+
transition: transform var(--${e}-transition-ms) ${vi};
|
|
17171
17171
|
}
|
|
17172
17172
|
.${e}-incoming-prev {
|
|
17173
17173
|
z-index: 4;
|
|
17174
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
17174
|
+
transition: transform var(--${e}-transition-ms) ${vi};
|
|
17175
17175
|
}
|
|
17176
17176
|
.${e}-outgoing {
|
|
17177
17177
|
will-change: transform;
|
|
17178
17178
|
}
|
|
17179
17179
|
.${e}-outgoing-next {
|
|
17180
17180
|
z-index: 3;
|
|
17181
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
17181
|
+
transition: transform var(--${e}-transition-ms) ${vi};
|
|
17182
17182
|
}
|
|
17183
17183
|
.${e}-outgoing-prev {
|
|
17184
17184
|
z-index: 3;
|
|
17185
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
17185
|
+
transition: transform var(--${e}-transition-ms) ${vi};
|
|
17186
17186
|
}
|
|
17187
17187
|
.${e}-outgoing-next .${e}-effect-image {
|
|
17188
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
17188
|
+
transition: filter var(--${e}-transition-ms) ${vi};
|
|
17189
17189
|
}
|
|
17190
17190
|
.${e}-outgoing-prev .${e}-effect-image {
|
|
17191
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
17191
|
+
transition: filter var(--${e}-transition-ms) ${vi};
|
|
17192
17192
|
}
|
|
17193
17193
|
.${e}-incoming .${e}-effect-image {
|
|
17194
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
17194
|
+
transition: filter var(--${e}-transition-ms) ${vi};
|
|
17195
17195
|
}
|
|
17196
17196
|
.${e}-background .${e}-effect-image {
|
|
17197
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
17197
|
+
transition: filter var(--${e}-transition-ms) ${vi};
|
|
17198
17198
|
}
|
|
17199
17199
|
.${e}-snap .${e}-incoming,
|
|
17200
17200
|
.${e}-snap .${e}-outgoing,
|
|
@@ -17242,7 +17242,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17242
17242
|
display: block;
|
|
17243
17243
|
pointer-events: none;
|
|
17244
17244
|
}
|
|
17245
|
-
`}function
|
|
17245
|
+
`}function Tb(e){return e==="blur"?$b:e==="greyscale"?wb:0}function Ko(e,t=1,n=1){const i=Tb(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 ld(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Ib(e,t){return t<=1?0:(e-1+t)%t}function Lb(e,t=1){return!e||e.height===0?t:e.width/e.height}function Pb(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const r=e*i/100,l=t*o/100;let c=r,d=c/n;return d>l&&(d=l,c=d*n),{widthPercent:c/e*100,heightPercent:d/t*100}}function cd(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 $p(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function dd(e,t,n){return{...$p(e),[`--${n}-stage-scale`]:t}}function Rb(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 Mb({settings:e,content:t,isEditor:n,isPreviewMode:i}){var xe,g,G,Q,ne,ue,q;const{prefix:o}=A.useScopedStyles(),r=s.useMemo(()=>Cb(o),[o]),{imageSize:l,maxWidth:c,maxHeight:d,transition:u=1e3,bgImage:p="greyscale"}=e,v=t??[],x=ld(v.length),[m,h]=s.useState(x.activeIndex),[b,S]=s.useState(x.backgroundIndex),[M,y]=s.useState(!1),[$,R]=s.useState(!1),[X,B]=s.useState(null),[O,N]=s.useState(null),[z,C]=s.useState(0),[I,j]=s.useState(1),[E,w]=s.useState("none"),[L,V]=s.useState("next"),[_,K]=s.useState({}),[P,f]=s.useState({width:0,height:0}),U=s.useRef(null),te=s.useRef(null),ce=!n||!!i,F=l??60,ie=Math.max(10,Math.min(100,c??F)),T=Math.max(10,Math.min(100,d??F)),le=Math.max(100,u),J=Ko(p),Se=s.useCallback(D=>{const se=Lb(D?_[D]:void 0);return Pb(P.width,P.height,se,ie,T)},[P.height,P.width,_,T,ie]);s.useEffect(()=>{const D=te.current;if(!D)return;const se=new ResizeObserver(([Y])=>{const{width:pe,height:H}=Y.contentRect;f({width:pe,height:H})});return se.observe(D),()=>se.disconnect()},[]),s.useEffect(()=>{const D=(t??[]).map(se=>{var Y;return(Y=se.image)==null?void 0:Y.assetId}).filter(se=>!!se);Rb(D,(se,Y)=>{K(pe=>{var H,Ie;return((H=pe[se])==null?void 0:H.width)===Y.width&&((Ie=pe[se])==null?void 0:Ie.height)===Y.height?pe:{...pe,[se]:Y}})})},[t]),s.useEffect(()=>{const{backgroundIndex:D,activeIndex:se}=ld(v.length);h(se),S(D),y(!1),R(!1),B(null),N(null),C(0),j(1),w("none"),V("next")},[v.length,t]),s.useEffect(()=>()=>{U.current&&clearTimeout(U.current)},[]);const Le=s.useCallback(D=>{var de,Z,Ne,Oe;if(!ce||M||v.length<=1)return;const se=D==="next"?(m+1)%v.length:(m-1+v.length)%v.length,Y=Se((Z=(de=v[m])==null?void 0:de.image)==null?void 0:Z.assetId),pe=Se((Oe=(Ne=v[se])==null?void 0:Ne.image)==null?void 0:Oe.assetId),H=cd(P.width,P.height,Y),Ie=cd(P.width,P.height,pe);U.current&&clearTimeout(U.current),V(D),R(!0),y(!0),D==="next"?(B(m),N(se),C(0),j(1),w(Ko(p,0,1))):(S(Ib(se,v.length)),B(se),N(m),C(1),j(Ie),w(Ko(p,1,Ie))),requestAnimationFrame(()=>{R(!1),requestAnimationFrame(()=>{D==="next"?(C(1),j(H),w(Ko(p,1,H))):(C(0),j(1),w(Ko(p,0,1)))})}),U.current=setTimeout(()=>{D==="next"&&S(m),h(se),B(null),N(null),y(!1)},le)},[m,p,P.height,P.width,Se,M,ce,v,le]),me=v[m],ye=b!==null?v[b]:null,ee=X!==null?v[X]:null,oe=O!==null?v[O]:null,re=v.length<=1?0:(m-1+v.length)%v.length,ge=v.length<=1?0:(m+1)%v.length,we=Se((xe=me==null?void 0:me.image)==null?void 0:xe.assetId),Ae=Se((g=ee==null?void 0:ee.image)==null?void 0:g.assetId),fe=Se((G=oe==null?void 0:oe.image)==null?void 0:G.assetId),ve={[`--${o}-transition-ms`]:`${le}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:te,className:Rt(`${o}-wrapper`,$&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ve,"aria-label":"Zoom gallery",children:[((Q=ye==null?void 0:ye.image)==null?void 0:Q.assetId)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:ye.image.assetId,alt:"",style:{filter:J}})}),M&&((ne=ee==null?void 0:ee.image)==null?void 0:ne.assetId)&&a.jsx("div",{className:Rt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${L}`),style:dd(Ae,I,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:ee.image.assetId,alt:"",style:{filter:E}})}),M&&((ue=oe==null?void 0:oe.image)==null?void 0:ue.assetId)&&a.jsx("div",{className:Rt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${L}`),style:dd(fe,z,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:oe.image.assetId,alt:""})}),!M&&((q=me==null?void 0:me.image)==null?void 0:q.assetId)&&a.jsx("div",{className:Rt(`${o}-stage`,`${o}-foreground`),style:$p(we),children:a.jsx("img",{className:`${o}-image`,src:me.image.assetId,alt:me.image.name??""})}),ce&&v.length>1&&!M&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:Rt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Le("prev"),"aria-label":`Show previous image (${re+1} of ${v.length})`}),a.jsx("button",{type:"button",className:Rt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Le("next"),"aria-label":`Show next image (${ge+1} of ${v.length})`})]})]})]})}const Eb=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17246
17246
|
import cn from 'classnames';
|
|
17247
17247
|
import { CommonComponentProps } from '../props';
|
|
17248
17248
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -17761,7 +17761,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
17761
17761
|
</>
|
|
17762
17762
|
);
|
|
17763
17763
|
}
|
|
17764
|
-
`,
|
|
17764
|
+
`,kb={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:{assetId:"01M3QM74XESYN1HRYH9VRTZ5CK",name:""}},{image:{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:""}},{image:{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:""}},{image:{assetId:"01M3QM74XE20C38X4NND20C5R4",name:""}},{image:{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:""}},{image:{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:""}},{image:{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:""}}]}},Ab={element:Mb,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:kb,sourceCode:Eb,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Fb={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},Nb=["hover","active"],vs={left:"flex-start",center:"center",right:"flex-end"};function _b(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 Hb(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 Wb(e){const t=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-box-shadow-color, transparent)`,n=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-inner-box-shadow-color, transparent)`,i=`${t}, ${n}`,o=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-hover-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,r=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-hover-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,l=`${o}, ${r}`,c=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,d=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${c}, ${d}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,v=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,x=`.${e}-button:hover, ${v}`,m=h=>`.${e}-hover-effect-${h}:hover, .${e}-hover-effect-${h}:focus-visible, a:focus-visible .${e}-hover-effect-${h}`;return`
|
|
17765
17765
|
.${e}-root {
|
|
17766
17766
|
line-height: 0;
|
|
17767
17767
|
}
|
|
@@ -17793,11 +17793,11 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
17793
17793
|
.${e}-wrapper.${e}-editing .${e}-button {
|
|
17794
17794
|
transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms;
|
|
17795
17795
|
}
|
|
17796
|
-
${
|
|
17796
|
+
${m("scale-up")},
|
|
17797
17797
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-scale-up {
|
|
17798
17798
|
transform: scale(1.05);
|
|
17799
17799
|
}
|
|
17800
|
-
${
|
|
17800
|
+
${m("lift")},
|
|
17801
17801
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-lift {
|
|
17802
17802
|
transform: translateY(-2px);
|
|
17803
17803
|
box-shadow: ${p};
|
|
@@ -17859,9 +17859,9 @@ a:focus-visible .${e}-hover-effect-swipe::before,
|
|
|
17859
17859
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe::before {
|
|
17860
17860
|
transform: translateX(0);
|
|
17861
17861
|
}
|
|
17862
|
-
${
|
|
17862
|
+
${m("reveal")},
|
|
17863
17863
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-reveal,
|
|
17864
|
-
${
|
|
17864
|
+
${m("swipe")},
|
|
17865
17865
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe {
|
|
17866
17866
|
background-color: var(--${e}-background-color);
|
|
17867
17867
|
}
|
|
@@ -17924,7 +17924,7 @@ a:focus-visible .${e}-hover-effect-content-roll .${e}-content-roll-layer-hover,
|
|
|
17924
17924
|
transform: translateY(-50%);
|
|
17925
17925
|
opacity: 1;
|
|
17926
17926
|
}
|
|
17927
|
-
${
|
|
17927
|
+
${x} {
|
|
17928
17928
|
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
17929
17929
|
color: var(--${e}-hover-text-color, var(--${e}-text-color));
|
|
17930
17930
|
border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
|
|
@@ -18003,7 +18003,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
18003
18003
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
18004
18004
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
18005
18005
|
}
|
|
18006
|
-
`}function xs(e,t,n="",i,o){const r=t();return a.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[a.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:r}),a.jsxs("span",{className:`${e}-content-roll-viewport`,children:[a.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),a.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function ud(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(gn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return a.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const c=
|
|
18006
|
+
`}function xs(e,t,n="",i,o){const r=t();return a.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[a.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:r}),a.jsxs("span",{className:`${e}-content-roll-viewport`,children:[a.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),a.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function ud(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(gn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return a.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const c=A.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:c,height:c},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function Ob({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=A.useScopedStyles(),l=s.useMemo(()=>Wb(r),[r]),{type:c="a",label:d="Button",icon:u,alignment:p="center",alignA:v,order:x="text-icon",gap:m=0,iconSize:h=0,iconWidthC:b=0,dimensions:S=!1,padding:M={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:$={top:0,left:0,right:0,bottom:0},boxShadowColor:R="rgba(0, 0, 0, 0)",innerBoxShadow:X={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:B="rgba(0, 0, 0, 0)",stroke:O=0,blur:N=0,backgroundColor:z="#000000",textColor:C="#ffffff",borderColor:I="#ffffff",iconColor:j="#ffffff",hoverEffect:E="none",fontFamily:w,fontSettings:L,fontSize:V,lineHeight:_,letterSpacing:K=0,wordSpacing:P=0,textAppearance:f,stateOverrides:U,minWidth:te=0,minHeight:ce=0,width:F=0,height:ie=0}=e,T=A.buildColorVars(r,{backgroundColor:z,textColor:C,borderColor:I,iconColor:j,boxShadowColor:R,innerBoxShadowColor:B},Fb,Nb,U),le=i&&i!=="default"?`${r}-state-${i}`:"",J=t&&!n?`${r}-editing`:"",Se=E!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${E}`:"",Le=E==="reveal"||E==="swipe",me=E==="content-roll",ye=E==="reveal"&&(!t||n),ee=S===!0,re=c==="a"?v??p:p,ge=c==="c",we=c!=="b",Ae={fontSettings:{fontFamily:w,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:V??.01,lineHeight:_,letterSpacing:K,wordSpacing:P,textAppearance:f,color:C},ve={...we?pn(nn(Ae,t)):{},[`--${r}-box-shadow-x`]:A.scalingValue($.left,t),[`--${r}-box-shadow-y`]:A.scalingValue($.top,t),[`--${r}-box-shadow-blur`]:A.scalingValue($.right,t),[`--${r}-box-shadow-spread`]:A.scalingValue($.bottom,t),[`--${r}-inner-box-shadow-x`]:A.scalingValue(X.left,t),[`--${r}-inner-box-shadow-y`]:A.scalingValue(X.top,t),[`--${r}-inner-box-shadow-blur`]:A.scalingValue(X.right,t),[`--${r}-inner-box-shadow-spread`]:A.scalingValue(X.bottom,t),[`--${r}-backdrop-blur`]:N>0?`blur(${A.scalingValue(N,t)})`:void 0,paddingTop:A.scalingValue(M.top,t),paddingRight:A.scalingValue(M.right,t),paddingBottom:A.scalingValue(M.bottom,t),paddingLeft:A.scalingValue(M.left,t),borderRadius:A.scalingValue(y,t),borderWidth:A.scalingValue(O,t),...ge?{}:{justifyContent:vs[re],textAlign:re},...ge&&!me?{gap:A.scalingValue(m,t)}:{},...ee?{width:A.scalingValue(F,t),height:A.scalingValue(ie,t)}:{minWidth:A.scalingValue(te,t),minHeight:A.scalingValue(ce,t),...ge?{width:"100%"}:{}}};let xe;const g={display:"inline-flex",alignItems:"center",justifyContent:ge?vs[re]:vs[c==="a"?re:"center"],gap:ge?A.scalingValue(m,t):void 0,width:"100%",height:"100%",...c==="a"?{textAlign:re}:{}};if(c==="b"){const ne=()=>ud(r,u,h>0?"fixed":"fill",100,h,t);xe=me?xs(r,ne,`${r}-icon-roll`,void 0,g):ne()}else if(c==="c"){const ne=()=>{const ue=a.jsx("span",{className:`${r}-text`,style:{textAlign:re},children:d}),q=ud(r,u,b>0?"fixed":"fill",100,b,t);return x==="icon-text"?a.jsxs(a.Fragment,{children:[q,ue]}):a.jsxs(a.Fragment,{children:[ue,q]})};xe=me?xs(r,ne,`${r}-icon-text-roll`,void 0,g):ne()}else xe=me?xs(r,()=>d,`${r}-label-roll`,void 0,g):Le?a.jsx("span",{className:`${r}-button-inner`,children:d}):d;const G=ye?ne=>_b(ne,r):void 0,Q=ye?ne=>Hb(ne,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:T,children:a.jsx("div",{className:`${r}-wrapper ${le} ${J}`.trim(),children:a.jsx("div",{className:`${r}-button ${Se}`.trim(),style:ve,onMouseEnter:G,onMouseLeave:Q,role:"button",tabIndex:o||t&&!n?void 0:0,children:xe})})})]})}const Db=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
18007
18007
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
18008
18008
|
import { CommonComponentProps } from '../props';
|
|
18009
18009
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -18635,7 +18635,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18635
18635
|
</>
|
|
18636
18636
|
);
|
|
18637
18637
|
}
|
|
18638
|
-
`,Nb={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},_b=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Hb={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"number",scope:"layout",title:"Blur",display:{type:"numeric-input"},min:0,max:100},backgroundColor:{type:"string",scope:"common",title:"BG Default",titleByState:{default:"BG Default",hover:"BG Hover",active:"BG Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...Nb.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"01M3QM74XG7DQZZXTPG1E8EBBC",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},blur:0,stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,blur:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,blur:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,blur:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","blur","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["blur"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[..._b],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},Wb={element:Ab,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:Hb,sourceCode:Fb,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function Ob(e){return`
|
|
18638
|
+
`,Bb={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},zb=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],jb={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"number",scope:"layout",title:"Blur",display:{type:"numeric-input"},min:0,max:100},backgroundColor:{type:"string",scope:"common",title:"BG Default",titleByState:{default:"BG Default",hover:"BG Hover",active:"BG Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...Bb.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"01M3QM74XG7DQZZXTPG1E8EBBC",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},blur:0,stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,blur:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,blur:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,blur:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","blur","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["blur"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...zb],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},Vb={element:Ob,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:jb,sourceCode:Db,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function Gb(e){return`
|
|
18639
18639
|
.${e}-titles-row {
|
|
18640
18640
|
position: relative;
|
|
18641
18641
|
flex: 0 1 auto;
|
|
@@ -18833,7 +18833,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18833
18833
|
pointer-events: auto;
|
|
18834
18834
|
flex-shrink: 0;
|
|
18835
18835
|
}
|
|
18836
|
-
`}const Wn=500,Qo=650,$n="cubic-bezier(0.22, 1, 0.36, 1)",Db=72,Bb=50,zb=1e4,jb=650,Vb=500;function Gb(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function vp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Sa(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 Xb(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?vp(i,n):null}function Ub(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.assetId&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function or(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 pd(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return or(e,i,n)}const qb=.03;function xp(e){return e.width*qb}const bs={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Yr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function gd(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Yb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ys(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function Kb(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ys(e,t.width,t.height)}function Qb(e,t){if(Va(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.assetId,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.assetId,n.naturalWidth,n.naturalHeight)},n.src=e.assetId}function Zb(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.assetId)||t.has(o.assetId)||(t.add(o.assetId),n.push(o))}return n}function Jb({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Va(t)?a.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):a.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function Fo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=xp(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function Ta(e,t,n){const i=Fo(e,t,n);return{...i,left:2*i.left-e.left}}function eS(e,t,n){const{left:i,width:o}=n,r=xp(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function bp(e,t,n,i){const o=Fo(e,"left",i),r=Fo(e,"right",i),l=Ta(e,"left",i),c=Ta(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:c,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function tS(e,t,n,i){const{start:o,end:r}=bp(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function nS(e,t,n){const i=Fo(e,t,n),o=Ta(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Va(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function iS({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function Kr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Va(e)?a.jsx("video",{src:e.assetId,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.assetId,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.assetId,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function oS({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:v,resolveCloseSourceRect:g,onClose:m,onPrev:x,onNext:b}){const M=s.useRef(null),f=s.useRef(null),S=s.useRef(null),W=s.useRef(new Map),[q,z]=s.useState(0),L=s.useRef(null),_=s.useRef(0),G=s.useRef(0),$=s.useRef("none"),I=s.useRef(!1),D=s.useRef(!1),E=s.useRef(!1),T=s.useRef(null),C=s.useRef(null),V=s.useRef(null),w=s.useRef(()=>{}),U=s.useRef(null),P=s.useRef(null),A=s.useRef(null),j=s.useRef(!1),[ie,ae]=s.useState(null),[O,re]=s.useState(bs),[N,le]=s.useState(0),[J,be]=s.useState("opening"),[Le,ye]=s.useState(0),[ce,K]=s.useState(0),[se,pe]=s.useState(!1),[fe,we]=s.useState(null),[Re,me]=s.useState(null),[xe,Ce]=s.useState(null),[h,Y]=s.useState(!1),[Q,ne]=s.useState(null),[ue,B]=s.useState(!1),R=s.useRef(!1),[ee,te]=s.useState(!1),[ge,X]=s.useState(!1),Pe=s.useRef(n),Se=s.useRef(void 0),Z=t[n],He=Z?Va(Z):!1,We=ce!==0||se,ot=!l&&(!r||!!c),qe=d&&!l,tt=u.length>1,et=s.useCallback((H,Ie)=>t.length<=1?null:t[(H+Ie+t.length)%t.length]??null,[t]),Ge=tt?or(u,p,-1):et(n,-1),ve=tt?or(u,p,1):et(n,1),_e=fe===-1&&We?tt&&Re!==null?or(u,Re,-1):xe!==null?et(xe,-1):null:null,ze=fe===1&&We?tt&&Re!==null?or(u,Re,1):xe!==null?et(xe,1):null:null,Qe=_e&&_e.assetId!==(Ge==null?void 0:Ge.assetId)?_e:null,$e=ze&&ze.assetId!==(ve==null?void 0:ve.assetId)?ze:null,Ne=Ge&&qe?(()=>{const H=tt?pd(u,p,-1):t.length>2?et((n-1+t.length)%t.length,-1):null;return H&&H.assetId!==Ge.assetId?H:null})():null,Ye=ve&&qe?(()=>{const H=tt?pd(u,p,1):t.length>2?et((n+1)%t.length,1):null;return H&&H.assetId!==ve.assetId?H:null})():null,Ze=Qe??Ne,st=$e??Ye,it=s.useCallback((H,Ie,je)=>{if(!H||!Ie||!je)return;const Fe=W.current,ft=Fe.get(H);(ft==null?void 0:ft.width)===Ie&&(ft==null?void 0:ft.height)===je||(Fe.set(H,{width:Ie,height:je}),z(Ht=>Ht+1))},[]),Oe=s.useCallback(H=>{if(!(H!=null&&H.assetId))return null;const Ie=W.current.get(H.assetId);return Kb(f.current,Ie)},[q,N]),Ae=s.useCallback(()=>{if(!Z)return;const H=Oe(Z);if(H){ae(H);return}const Ie=f.current;Ie&&ae(gd(Ie))},[Z,Oe]),mt=s.useCallback(H=>{if(tt){const Ie=u.length;me((p+H+Ie)%Ie),Ce(null);return}t.length>1&&(Ce((n+H+t.length)%t.length),me(null))},[tt,u.length,p,t.length,n]),Be=s.useCallback(H=>{E.current=H,pe(H)},[]),De=s.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),Ue=s.useCallback(()=>{De(),T.current=window.setTimeout(()=>{De(),Be(!1)},Qo+32)},[De,Be]),ct=s.useCallback(()=>{const H=M.current;if(!H){re({left:0,top:0,width:typeof window<"u"?window.innerWidth:bs.width,height:typeof window<"u"?window.innerHeight:bs.height});return}const Ie=H.getBoundingClientRect();re({left:Ie.left,top:Ie.top,width:Ie.width,height:Ie.height})},[]),he=s.useCallback((H,Ie)=>{if(We){if(ee&&!se)return`translate(${ce}px, 0px)`;if(se&&fe!==null){const je=Oe(H);if(!je)return;const{x:Fe,y:ft}=tS(je,Ie,fe,O);return`translate(${Fe}px, ${ft}px)`}if(se)return"translate(0px, 0px)"}},[We,ee,se,ce,fe,O,Oe]),Me=s.useCallback(()=>{const H=C.current;C.current=null,De(),Be(!1),we(null),me(null),Ce(null),K(0),te(!1),I.current=!1,G.current=0,$.current="none",H===-1?x():H===1&&b()},[De,Be,x,b]),nt=s.useCallback(()=>{De(),T.current=window.setTimeout(()=>{C.current!==null&&Me()},Qo+32)},[De,Me]),pt=s.useCallback(()=>{De(),C.current=null,Be(!1),we(null),me(null),Ce(null),K(0),te(!1),I.current=!1,G.current=0,$.current="none"},[De,Be]),Ve=s.useCallback(H=>{if(!(!qe||!ie)){if(E.current){if(C.current===H){V.current=H,Me();return}pt()}De(),mt(H),C.current=H,we(H),Be(!0),nt()}},[qe,ie,Me,pt,De,mt,Be,nt]);w.current=Ve;const vt=s.useCallback(()=>{U.current=null,j.current=!1,P.current!==null&&(window.clearInterval(P.current),P.current=null),A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),Pt=s.useCallback(H=>{P.current!==null&&window.clearInterval(P.current);const Ie=j.current?Vb:jb;P.current=window.setInterval(()=>{w.current(H)},Ie)},[]),At=s.useCallback(H=>{U.current!==H&&(vt(),U.current=H,j.current=!1,w.current(H),Pt(H),A.current=window.setTimeout(()=>{A.current=null,U.current===H&&(j.current=!0,Pt(H))},zb))},[vt,Pt]),wt=s.useCallback(()=>{const H=f.current;if(!H)return;const Ie=Z==null?void 0:Z.assetId,je=Ie?W.current.get(Ie):void 0;if(je!=null&&je.width&&(je!=null&&je.height)){ae(Ys(H,je.width,je.height));return}const Fe=S.current;if(Fe&&Ie&&(Fe.src===Ie||Fe.currentSrc===Ie)){const{width:Ht,height:gt}=Yb(Fe);if(Ht&>){it(Ie,Ht,gt),ae(Ys(H,Ht,gt));return}}const ft=gd(H);!ft.width||!ft.height||ae(ft)},[Z==null?void 0:Z.assetId,it]),Vt=s.useCallback(H=>{if(S.current=H,!!H){if(H instanceof HTMLVideoElement){H.readyState>=1&&H.videoWidth>0&&wt();return}H.complete&&H.naturalWidth>0&&wt()}},[wt]),jt=s.useCallback(()=>{ct(),wt(),le(H=>H+1)},[ct,wt]);s.useEffect(()=>{jt();const H=f.current,Ie=M.current,je=new ResizeObserver(()=>jt());return H&&je.observe(H),Ie&&je.observe(Ie),window.addEventListener("resize",jt),()=>{je.disconnect(),window.removeEventListener("resize",jt)}},[jt,n,y]),s.useLayoutEffect(()=>{if(!Z)return;const H=S.current;if(H){if(H instanceof HTMLImageElement&&H.complete&&H.naturalWidth>0){wt();return}H instanceof HTMLVideoElement&&H.readyState>=1&&H.videoWidth>0&&wt()}},[Z==null?void 0:Z.assetId,n,wt]),s.useEffect(()=>{Ae()},[Ae,q]),s.useEffect(()=>{const H=new Set,Ie=[],je=Fe=>{!(Fe!=null&&Fe.assetId)||H.has(Fe.assetId)||(H.add(Fe.assetId),Ie.push(Fe))};t.forEach(je),u.forEach(Fe=>Fe.items.forEach(je)),Ie.forEach(Fe=>{W.current.has(Fe.assetId)||Qb(Fe,it)})},[t,u,it]),s.useEffect(()=>{if(J!=="opening"||!ie)return;if(!v){be("open");return}Y(!1);const H=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Y(!0),be("open")})});return()=>cancelAnimationFrame(H)},[J,ie,v]),s.useEffect(()=>{if(J!=="closing")return;const H=setTimeout(()=>m(),Wn);return()=>clearTimeout(H)},[J,m]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{Pe.current===n&&Se.current===(Z==null?void 0:Z.assetId)||(De(),C.current=null,we(null),me(null),Ce(null),ye(0),K(0),Be(!1),X(!1),te(!1),_.current=0,G.current=0,$.current="none",I.current=!1,L.current=null,D.current=!1,S.current=null,Ae(),Pe.current=n,Se.current=Z==null?void 0:Z.assetId)},[n,Z==null?void 0:Z.assetId,Be,De,Ae]),s.useLayoutEffect(()=>{const H=V.current;H!==null&&(V.current=null,requestAnimationFrame(()=>{w.current(H)}))},[n,p,Z==null?void 0:Z.assetId]),s.useLayoutEffect(()=>{if(J==="opening"){R.current=!1,B(!1);return}if(J!=="open"||R.current)return;if(!Ge&&!ve){R.current=!0;return}B(!1);const H=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),R.current=!0})});return()=>cancelAnimationFrame(H)},[J,Ge==null?void 0:Ge.assetId,ve==null?void 0:ve.assetId]),s.useEffect(()=>{if(J!=="open")return;const H=()=>{const gt=It=>{It.stopPropagation(),It.preventDefault(),document.removeEventListener("click",gt,!0)};document.addEventListener("click",gt,!0)},Ie=gt=>{const It=gt<0?1:-1;De(),mt(It),C.current=It,we(It),Be(!0),nt()},je=gt=>{if(Math.abs(gt)>Bb&&qe){Ie(gt);return}C.current=null,we(null),me(null),Ce(null),Be(!0),K(0),Ue()},Fe=gt=>{if(gt.touches.length!==1||E.current)return;const It=gt.touches[0];D.current=!0,L.current={x:It.clientX,y:It.clientY},$.current="none",G.current=0,I.current=!1},ft=gt=>{if(!L.current||gt.touches.length!==1||E.current)return;const It=gt.touches[0],qt=It.clientX-L.current.x,Dt=It.clientY-L.current.y;if($.current==="none"){if(Math.abs(qt)<10&&Math.abs(Dt)<10)return;if(Math.abs(qt)>Math.abs(Dt)){if(!qe)return;$.current="horizontal"}else if(Dt>0){if(!ot)return;$.current="vertical"}else return}if($.current==="horizontal"){I.current=!0,te(!0),G.current=qt,K(qt),gt.preventDefault();return}$.current==="vertical"&&(I.current=!0,te(!0),_.current=Dt,ye(Dt),gt.preventDefault())},Ht=()=>{if(!L.current)return;const gt=$.current,It=I.current;if(It&>==="horizontal")je(G.current),H();else if(It&>==="vertical"){const qt=_.current;if(ot&&qt>Db){const Dt=window.innerHeight;_.current=Dt,X(!0),ye(Dt),be("closing")}else _.current=0,ye(0);H()}else gt==="horizontal"&&Math.abs(G.current)>0&&(je(G.current),H());L.current=null,$.current="none",G.current=0,I.current=!1,te(!1)};return document.addEventListener("touchstart",Fe,{passive:!0}),document.addEventListener("touchmove",ft,{passive:!1}),document.addEventListener("touchend",Ht),document.addEventListener("touchcancel",Ht),()=>{document.removeEventListener("touchstart",Fe),document.removeEventListener("touchmove",ft),document.removeEventListener("touchend",Ht),document.removeEventListener("touchcancel",Ht)}},[J,qe,Be,Ue,De,ot,nt,mt]);const Yt=s.useCallback(()=>{const H=(g==null?void 0:g())??v??null;H&&ie&&(ne(H),Y(!0)),be("closing")},[g,v,ie]);s.useEffect(()=>{const H=Fe=>{if(Fe.key==="Escape"){if(r&&c||J==="closing")return;vt(),Yt();return}if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight"||J!=="open"||!qe)return;Fe.preventDefault();const ft=Fe.key==="ArrowLeft"?-1:1;Fe.repeat&&U.current===ft||At(ft)},Ie=Fe=>{if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight")return;const ft=Fe.key==="ArrowLeft"?-1:1;U.current===ft&&vt()},je=()=>{vt()};return window.addEventListener("keydown",H),window.addEventListener("keyup",Ie),window.addEventListener("blur",je),()=>{window.removeEventListener("keydown",H),window.removeEventListener("keyup",Ie),window.removeEventListener("blur",je),vt()}},[J,r,c,Yt,qe,At,vt]),s.useEffect(()=>{J!=="open"&&vt()},[J,vt]);const Kt=()=>{J==="closing"||l||Yt()},Rt=J==="open",zt=J==="closing",on=Le>0?Math.max(0,1-Le/500):1,xt=Le>0?Math.max(.35,1-Le/500):1,yt=s.useCallback(H=>{if(!(H.propertyName!=="transform"||!E.current)){if(C.current!==null){Me();return}De(),Be(!1)}},[De,Be,Me]),ke=J==="closing"?Q??v:v,Je=ke&&ie&&(J==="opening"||zt)?Gb(ke,ie):void 0,rt=We&&Z?he(Z,"center"):Le>0?`translateY(${Le}px)`:Je,dt=ie?Yr(ie,O):null,Lt=!!(ke&&ie),St=Lt&&(J==="closing"||J==="open"&&h),ht={position:"absolute",top:dt==null?void 0:dt.top,left:dt==null?void 0:dt.left,width:dt==null?void 0:dt.width,height:dt==null?void 0:dt.height,objectFit:"contain",transformOrigin:"top left",transform:rt,opacity:Le>0?xt:Lt?1:J==="opening"||zt?0:1,transition:ee&&!se?"none":se?`transform ${Qo}ms ${$n}`:ge?`transform ${Wn}ms ${$n}, opacity ${Wn}ms ${$n}`:St?`transform ${Wn}ms ${$n}`:J==="opening"||zt?`opacity ${Wn}ms ${$n}`:"none",pointerEvents:He&&Rt&&!We?"auto":"none",touchAction:He&&Rt?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},Wt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Rt&&!We?"auto":"none"},Tt=(H,Ie,je="adjacent")=>{const Fe=Oe(H);if(!Fe)return{display:"none"};const ft=je==="far"?Ie==="left"?"far-left":"far-right":Ie==="left"?"left-adjacent":"right-adjacent",{start:Ht}=fe!==null?bp(Fe,ft,fe,O):{start:je==="far"?Ta(Fe,Ie,O):Fo(Fe,Ie,O)},gt=Yr(Ht,O),It=he(H,ft),qt=!We&&je==="adjacent"&&Rt&&!ue?nS(Fe,Ie,O):null,Dt=je==="far"&&We&&fe===(Ie==="left"?-1:1),an=ee&&!se?!1:se,cn=je==="adjacent"&&Rt&&ue&&!We;return{position:"absolute",top:gt.top,left:gt.left,width:gt.width,height:gt.height,objectFit:"contain",transform:It??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:je==="far"?Rt&&Dt?1:0:Rt?1:0,transition:an?je==="far"?`transform ${Qo}ms ${$n}`:`transform ${Qo}ms ${$n}, opacity ${Wn}ms ${$n}`:cn?`transform ${Wn}ms ${$n}`:J==="opening"||zt?`opacity ${Wn}ms ${$n}`:"none",pointerEvents:"none",zIndex:1}},Ot=(H,Ie)=>{const je=Oe(H);return je?eS(Fo(je,Ie,O),Ie,O):null},Gt=H=>Ie=>{if(!l){if(D.current){D.current=!1;return}Ie.stopPropagation(),Ve(H)}},kt=Ge?Ot(Ge,"left"):null,_t=ve?Ot(ve,"right"):null,Ft=kt?Yr(kt,O):null,ut=_t?Yr(_t,O):null;return a.jsxs("div",{ref:M,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:Kt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Rt?on:0,transition:ee?"none":`opacity ${Wn}ms ${$n}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:f,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Rt?1:0,transition:ee?"none":`opacity ${Wn}ms ${$n}`,pointerEvents:"none"},children:a.jsx(tp,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Kt})})]}),Rt&&Ze&&a.jsx(Kr,{media:Ze,style:Tt(Ze,"left","far"),onMeasure:it,onTransitionEnd:yt},`far-prev-${Ze.assetId}`),Rt&&Ge&&a.jsxs(a.Fragment,{children:[a.jsx(Kr,{media:Ge,style:Tt(Ge,"left"),onMeasure:it,onTransitionEnd:yt},`prev-${Ge.assetId}`),Ft&&a.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:l||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Rt&&ve&&a.jsxs(a.Fragment,{children:[a.jsx(Kr,{media:ve,style:Tt(ve,"right"),onMeasure:it,onTransitionEnd:yt},`next-${ve.assetId}`),ut&&a.jsx("div",{style:{position:"absolute",top:ut.top,left:ut.left,width:ut.width,height:ut.height,cursor:l||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Rt&&st&&a.jsx(Kr,{media:st,style:Tt(st,"right","far"),onMeasure:it,onTransitionEnd:yt},`far-next-${st.assetId}`),ie&&Z&&(He?a.jsx(iS,{src:Z.assetId,phase:J,onMediaElement:Vt,wrapperStyle:ht,videoStyle:Wt,onLoadedMetadata:wt,onTransitionEnd:yt},`${n}-${Z.assetId}`):a.jsx("img",{ref:Vt,src:Z.assetId,alt:Z.name,onLoad:wt,onTransitionEnd:yt,style:ht},`${n}-${Z.assetId}`))]})}const rS=20,aS=.18;function sS(e){return`
|
|
18836
|
+
`}const Dn=500,Qo=650,Cn="cubic-bezier(0.22, 1, 0.36, 1)",Xb=72,qb=50,Ub=1e4,Yb=650,Kb=500;function Qb(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function Cp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Sa(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 Zb(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Cp(i,n):null}function Jb(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.assetId&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function or(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 pd(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return or(e,i,n)}const eS=.03;function Tp(e){return e.width*eS}const bs={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Yr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function md(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function tS(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Us(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function nS(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Us(e,t.width,t.height)}function iS(e,t){if(Va(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.assetId,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.assetId,n.naturalWidth,n.naturalHeight)},n.src=e.assetId}function oS(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.assetId)||t.has(o.assetId)||(t.add(o.assetId),n.push(o))}return n}function rS({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Va(t)?a.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):a.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function _o(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=Tp(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function Ta(e,t,n){const i=_o(e,t,n);return{...i,left:2*i.left-e.left}}function aS(e,t,n){const{left:i,width:o}=n,r=Tp(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function Ip(e,t,n,i){const o=_o(e,"left",i),r=_o(e,"right",i),l=Ta(e,"left",i),c=Ta(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:c,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function sS(e,t,n,i){const{start:o,end:r}=Ip(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function lS(e,t,n){const i=_o(e,t,n),o=Ta(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Va(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function cS({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function Kr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Va(e)?a.jsx("video",{src:e.assetId,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.assetId,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.assetId,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function dS({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:x,resolveCloseSourceRect:m,onClose:h,onPrev:b,onNext:S}){const M=s.useRef(null),y=s.useRef(null),$=s.useRef(null),R=s.useRef(new Map),[X,B]=s.useState(0),O=s.useRef(null),N=s.useRef(0),z=s.useRef(0),C=s.useRef("none"),I=s.useRef(!1),j=s.useRef(!1),E=s.useRef(!1),w=s.useRef(null),L=s.useRef(null),V=s.useRef(null),_=s.useRef(()=>{}),K=s.useRef(null),P=s.useRef(null),f=s.useRef(null),U=s.useRef(!1),[te,ce]=s.useState(null),[F,ie]=s.useState(bs),[T,le]=s.useState(0),[J,Se]=s.useState("opening"),[Le,me]=s.useState(0),[ye,ee]=s.useState(0),[oe,re]=s.useState(!1),[ge,we]=s.useState(null),[Ae,fe]=s.useState(null),[ve,xe]=s.useState(null),[g,G]=s.useState(!1),[Q,ne]=s.useState(null),[ue,q]=s.useState(!1),D=s.useRef(!1),[se,Y]=s.useState(!1),[pe,H]=s.useState(!1),Ie=s.useRef(n),de=s.useRef(void 0),Z=t[n],Ne=Z?Va(Z):!1,Oe=ye!==0||oe,Je=!l&&(!r||!!c),De=d&&!l,Ze=u.length>1,at=s.useCallback((W,Te)=>t.length<=1?null:t[(W+Te+t.length)%t.length]??null,[t]),Xe=Ze?or(u,p,-1):at(n,-1),be=Ze?or(u,p,1):at(n,1),He=ge===-1&&Oe?Ze&&Ae!==null?or(u,Ae,-1):ve!==null?at(ve,-1):null:null,je=ge===1&&Oe?Ze&&Ae!==null?or(u,Ae,1):ve!==null?at(ve,1):null:null,Qe=He&&He.assetId!==(Xe==null?void 0:Xe.assetId)?He:null,Ce=je&&je.assetId!==(be==null?void 0:be.assetId)?je:null,_e=Xe&&De?(()=>{const W=Ze?pd(u,p,-1):t.length>2?at((n-1+t.length)%t.length,-1):null;return W&&W.assetId!==Xe.assetId?W:null})():null,Ue=be&&De?(()=>{const W=Ze?pd(u,p,1):t.length>2?at((n+1)%t.length,1):null;return W&&W.assetId!==be.assetId?W:null})():null,Ye=Qe??_e,lt=Ce??Ue,it=s.useCallback((W,Te,ze)=>{if(!W||!Te||!ze)return;const Fe=R.current,yt=Fe.get(W);(yt==null?void 0:yt.width)===Te&&(yt==null?void 0:yt.height)===ze||(Fe.set(W,{width:Te,height:ze}),B(Ot=>Ot+1))},[]),qe=s.useCallback(W=>{if(!(W!=null&&W.assetId))return null;const Te=R.current.get(W.assetId);return nS(y.current,Te)},[X,T]),Ee=s.useCallback(()=>{if(!Z)return;const W=qe(Z);if(W){ce(W);return}const Te=y.current;Te&&ce(md(Te))},[Z,qe]),pt=s.useCallback(W=>{if(Ze){const Te=u.length;fe((p+W+Te)%Te),xe(null);return}t.length>1&&(xe((n+W+t.length)%t.length),fe(null))},[Ze,u.length,p,t.length,n]),ke=s.useCallback(W=>{E.current=W,re(W)},[]),We=s.useCallback(()=>{w.current!==null&&(window.clearTimeout(w.current),w.current=null)},[]),Ve=s.useCallback(()=>{We(),w.current=window.setTimeout(()=>{We(),ke(!1)},Qo+32)},[We,ke]),ct=s.useCallback(()=>{const W=M.current;if(!W){ie({left:0,top:0,width:typeof window<"u"?window.innerWidth:bs.width,height:typeof window<"u"?window.innerHeight:bs.height});return}const Te=W.getBoundingClientRect();ie({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),ot=s.useCallback((W,Te)=>{if(Oe){if(se&&!oe)return`translate(${ye}px, 0px)`;if(oe&&ge!==null){const ze=qe(W);if(!ze)return;const{x:Fe,y:yt}=sS(ze,Te,ge,F);return`translate(${Fe}px, ${yt}px)`}if(oe)return"translate(0px, 0px)"}},[Oe,se,oe,ye,ge,F,qe]),xt=s.useCallback(()=>{const W=L.current;L.current=null,We(),ke(!1),we(null),fe(null),xe(null),ee(0),Y(!1),I.current=!1,z.current=0,C.current="none",W===-1?b():W===1&&S()},[We,ke,b,S]),Pt=s.useCallback(()=>{We(),w.current=window.setTimeout(()=>{L.current!==null&&xt()},Qo+32)},[We,xt]),Vt=s.useCallback(()=>{We(),L.current=null,ke(!1),we(null),fe(null),xe(null),ee(0),Y(!1),I.current=!1,z.current=0,C.current="none"},[We,ke]),vt=s.useCallback(W=>{if(!(!De||!te)){if(E.current){if(L.current===W){V.current=W,xt();return}Vt()}We(),pt(W),L.current=W,we(W),ke(!0),Pt()}},[De,te,xt,Vt,We,pt,ke,Pt]);_.current=vt;const Mt=s.useCallback(()=>{K.current=null,U.current=!1,P.current!==null&&(window.clearInterval(P.current),P.current=null),f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]),Ht=s.useCallback(W=>{P.current!==null&&window.clearInterval(P.current);const Te=U.current?Kb:Yb;P.current=window.setInterval(()=>{_.current(W)},Te)},[]),Gt=s.useCallback(W=>{K.current!==W&&(Mt(),K.current=W,U.current=!1,_.current(W),Ht(W),f.current=window.setTimeout(()=>{f.current=null,K.current===W&&(U.current=!0,Ht(W))},Ub))},[Mt,Ht]),kt=s.useCallback(()=>{const W=y.current;if(!W)return;const Te=Z==null?void 0:Z.assetId,ze=Te?R.current.get(Te):void 0;if(ze!=null&&ze.width&&(ze!=null&&ze.height)){ce(Us(W,ze.width,ze.height));return}const Fe=$.current;if(Fe&&Te&&(Fe.src===Te||Fe.currentSrc===Te)){const{width:Ot,height:ut}=tS(Fe);if(Ot&&ut){it(Te,Ot,ut),ce(Us(W,Ot,ut));return}}const yt=md(W);!yt.width||!yt.height||ce(yt)},[Z==null?void 0:Z.assetId,it]),Pe=s.useCallback(W=>{if($.current=W,!!W){if(W instanceof HTMLVideoElement){W.readyState>=1&&W.videoWidth>0&&kt();return}W.complete&&W.naturalWidth>0&&kt()}},[kt]),Be=s.useCallback(()=>{ct(),kt(),le(W=>W+1)},[ct,kt]);s.useEffect(()=>{Be();const W=y.current,Te=M.current,ze=new ResizeObserver(()=>Be());return W&&ze.observe(W),Te&&ze.observe(Te),window.addEventListener("resize",Be),()=>{ze.disconnect(),window.removeEventListener("resize",Be)}},[Be,n,v]),s.useLayoutEffect(()=>{if(!Z)return;const W=$.current;if(W){if(W instanceof HTMLImageElement&&W.complete&&W.naturalWidth>0){kt();return}W instanceof HTMLVideoElement&&W.readyState>=1&&W.videoWidth>0&&kt()}},[Z==null?void 0:Z.assetId,n,kt]),s.useEffect(()=>{Ee()},[Ee,X]),s.useEffect(()=>{const W=new Set,Te=[],ze=Fe=>{!(Fe!=null&&Fe.assetId)||W.has(Fe.assetId)||(W.add(Fe.assetId),Te.push(Fe))};t.forEach(ze),u.forEach(Fe=>Fe.items.forEach(ze)),Te.forEach(Fe=>{R.current.has(Fe.assetId)||iS(Fe,it)})},[t,u,it]),s.useEffect(()=>{if(J!=="opening"||!te)return;if(!x){Se("open");return}G(!1);const W=requestAnimationFrame(()=>{requestAnimationFrame(()=>{G(!0),Se("open")})});return()=>cancelAnimationFrame(W)},[J,te,x]),s.useEffect(()=>{if(J!=="closing")return;const W=setTimeout(()=>h(),Dn);return()=>clearTimeout(W)},[J,h]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{Ie.current===n&&de.current===(Z==null?void 0:Z.assetId)||(We(),L.current=null,we(null),fe(null),xe(null),me(0),ee(0),ke(!1),H(!1),Y(!1),N.current=0,z.current=0,C.current="none",I.current=!1,O.current=null,j.current=!1,$.current=null,Ee(),Ie.current=n,de.current=Z==null?void 0:Z.assetId)},[n,Z==null?void 0:Z.assetId,ke,We,Ee]),s.useLayoutEffect(()=>{const W=V.current;W!==null&&(V.current=null,requestAnimationFrame(()=>{_.current(W)}))},[n,p,Z==null?void 0:Z.assetId]),s.useLayoutEffect(()=>{if(J==="opening"){D.current=!1,q(!1);return}if(J!=="open"||D.current)return;if(!Xe&&!be){D.current=!0;return}q(!1);const W=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),D.current=!0})});return()=>cancelAnimationFrame(W)},[J,Xe==null?void 0:Xe.assetId,be==null?void 0:be.assetId]),s.useEffect(()=>{if(J!=="open")return;const W=()=>{const ut=Tt=>{Tt.stopPropagation(),Tt.preventDefault(),document.removeEventListener("click",ut,!0)};document.addEventListener("click",ut,!0)},Te=ut=>{const Tt=ut<0?1:-1;We(),pt(Tt),L.current=Tt,we(Tt),ke(!0),Pt()},ze=ut=>{if(Math.abs(ut)>qb&&De){Te(ut);return}L.current=null,we(null),fe(null),xe(null),ke(!0),ee(0),Ve()},Fe=ut=>{if(ut.touches.length!==1||E.current)return;const Tt=ut.touches[0];j.current=!0,O.current={x:Tt.clientX,y:Tt.clientY},C.current="none",z.current=0,I.current=!1},yt=ut=>{if(!O.current||ut.touches.length!==1||E.current)return;const Tt=ut.touches[0],Yt=Tt.clientX-O.current.x,It=Tt.clientY-O.current.y;if(C.current==="none"){if(Math.abs(Yt)<10&&Math.abs(It)<10)return;if(Math.abs(Yt)>Math.abs(It)){if(!De)return;C.current="horizontal"}else if(It>0){if(!Je)return;C.current="vertical"}else return}if(C.current==="horizontal"){I.current=!0,Y(!0),z.current=Yt,ee(Yt),ut.preventDefault();return}C.current==="vertical"&&(I.current=!0,Y(!0),N.current=It,me(It),ut.preventDefault())},Ot=()=>{if(!O.current)return;const ut=C.current,Tt=I.current;if(Tt&&ut==="horizontal")ze(z.current),W();else if(Tt&&ut==="vertical"){const Yt=N.current;if(Je&&Yt>Xb){const It=window.innerHeight;N.current=It,H(!0),me(It),Se("closing")}else N.current=0,me(0);W()}else ut==="horizontal"&&Math.abs(z.current)>0&&(ze(z.current),W());O.current=null,C.current="none",z.current=0,I.current=!1,Y(!1)};return document.addEventListener("touchstart",Fe,{passive:!0}),document.addEventListener("touchmove",yt,{passive:!1}),document.addEventListener("touchend",Ot),document.addEventListener("touchcancel",Ot),()=>{document.removeEventListener("touchstart",Fe),document.removeEventListener("touchmove",yt),document.removeEventListener("touchend",Ot),document.removeEventListener("touchcancel",Ot)}},[J,De,ke,Ve,We,Je,Pt,pt]);const ft=s.useCallback(()=>{const W=(m==null?void 0:m())??x??null;W&&te&&(ne(W),G(!0)),Se("closing")},[m,x,te]);s.useEffect(()=>{const W=Fe=>{if(Fe.key==="Escape"){if(r&&c||J==="closing")return;Mt(),ft();return}if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight"||J!=="open"||!De)return;Fe.preventDefault();const yt=Fe.key==="ArrowLeft"?-1:1;Fe.repeat&&K.current===yt||Gt(yt)},Te=Fe=>{if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight")return;const yt=Fe.key==="ArrowLeft"?-1:1;K.current===yt&&Mt()},ze=()=>{Mt()};return window.addEventListener("keydown",W),window.addEventListener("keyup",Te),window.addEventListener("blur",ze),()=>{window.removeEventListener("keydown",W),window.removeEventListener("keyup",Te),window.removeEventListener("blur",ze),Mt()}},[J,r,c,ft,De,Gt,Mt]),s.useEffect(()=>{J!=="open"&&Mt()},[J,Mt]);const $t=()=>{J==="closing"||l||ft()},et=J==="open",Et=J==="closing",Xt=Le>0?Math.max(0,1-Le/500):1,mt=Le>0?Math.max(.35,1-Le/500):1,gt=s.useCallback(W=>{if(!(W.propertyName!=="transform"||!E.current)){if(L.current!==null){xt();return}We(),ke(!1)}},[We,ke,xt]),Re=J==="closing"?Q??x:x,tt=Re&&te&&(J==="opening"||Et)?Qb(Re,te):void 0,nt=Oe&&Z?ot(Z,"center"):Le>0?`translateY(${Le}px)`:tt,st=te?Yr(te,F):null,At=!!(Re&&te),St=At&&(J==="closing"||J==="open"&&g),ht={position:"absolute",top:st==null?void 0:st.top,left:st==null?void 0:st.left,width:st==null?void 0:st.width,height:st==null?void 0:st.height,objectFit:"contain",transformOrigin:"top left",transform:nt,opacity:Le>0?mt:At?1:J==="opening"||Et?0:1,transition:se&&!oe?"none":oe?`transform ${Qo}ms ${Cn}`:pe?`transform ${Dn}ms ${Cn}, opacity ${Dn}ms ${Cn}`:St?`transform ${Dn}ms ${Cn}`:J==="opening"||Et?`opacity ${Dn}ms ${Cn}`:"none",pointerEvents:Ne&&et&&!Oe?"auto":"none",touchAction:Ne&&et?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},Dt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:et&&!Oe?"auto":"none"},Ct=(W,Te,ze="adjacent")=>{const Fe=qe(W);if(!Fe)return{display:"none"};const yt=ze==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:Ot}=ge!==null?Ip(Fe,yt,ge,F):{start:ze==="far"?Ta(Fe,Te,F):_o(Fe,Te,F)},ut=Yr(Ot,F),Tt=ot(W,yt),Yt=!Oe&&ze==="adjacent"&&et&&!ue?lS(Fe,Te,F):null,It=ze==="far"&&Oe&&ge===(Te==="left"?-1:1),Zt=se&&!oe?!1:oe,on=ze==="adjacent"&&et&&ue&&!Oe;return{position:"absolute",top:ut.top,left:ut.left,width:ut.width,height:ut.height,objectFit:"contain",transform:Tt??(Yt?`translate(${Yt.x}px, ${Yt.y}px)`:void 0),opacity:ze==="far"?et&&It?1:0:et?1:0,transition:Zt?ze==="far"?`transform ${Qo}ms ${Cn}`:`transform ${Qo}ms ${Cn}, opacity ${Dn}ms ${Cn}`:on?`transform ${Dn}ms ${Cn}`:J==="opening"||Et?`opacity ${Dn}ms ${Cn}`:"none",pointerEvents:"none",zIndex:1}},qt=(W,Te)=>{const ze=qe(W);return ze?aS(_o(ze,Te,F),Te,F):null},jt=W=>Te=>{if(!l){if(j.current){j.current=!1;return}Te.stopPropagation(),vt(W)}},Nt=Xe?qt(Xe,"left"):null,Bt=be?qt(be,"right"):null,Wt=Nt?Yr(Nt,F):null,wt=Bt?Yr(Bt,F):null;return a.jsxs("div",{ref:M,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:$t,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:et?Xt:0,transition:se?"none":`opacity ${Dn}ms ${Cn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:et?1:0,transition:se?"none":`opacity ${Dn}ms ${Cn}`,pointerEvents:"none"},children:a.jsx(sp,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:$t})})]}),et&&Ye&&a.jsx(Kr,{media:Ye,style:Ct(Ye,"left","far"),onMeasure:it,onTransitionEnd:gt},`far-prev-${Ye.assetId}`),et&&Xe&&a.jsxs(a.Fragment,{children:[a.jsx(Kr,{media:Xe,style:Ct(Xe,"left"),onMeasure:it,onTransitionEnd:gt},`prev-${Xe.assetId}`),Wt&&a.jsx("div",{style:{position:"absolute",top:Wt.top,left:Wt.left,width:Wt.width,height:Wt.height,cursor:l||se?"default":"pointer",pointerEvents:l||se?"none":"auto",zIndex:3},onClick:jt(-1)})]}),et&&be&&a.jsxs(a.Fragment,{children:[a.jsx(Kr,{media:be,style:Ct(be,"right"),onMeasure:it,onTransitionEnd:gt},`next-${be.assetId}`),wt&&a.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||se?"default":"pointer",pointerEvents:l||se?"none":"auto",zIndex:3},onClick:jt(1)})]}),et&<&&a.jsx(Kr,{media:lt,style:Ct(lt,"right","far"),onMeasure:it,onTransitionEnd:gt},`far-next-${lt.assetId}`),te&&Z&&(Ne?a.jsx(cS,{src:Z.assetId,phase:J,onMediaElement:Pe,wrapperStyle:ht,videoStyle:Dt,onLoadedMetadata:kt,onTransitionEnd:gt},`${n}-${Z.assetId}`):a.jsx("img",{ref:Pe,src:Z.assetId,alt:Z.name,onLoad:kt,onTransitionEnd:gt,style:ht},`${n}-${Z.assetId}`))]})}const uS=20,pS=.18;function mS(e){return`
|
|
18837
18837
|
.${e}-wrapper {
|
|
18838
18838
|
box-sizing: border-box;
|
|
18839
18839
|
max-width: 100%;
|
|
@@ -18920,8 +18920,8 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18920
18920
|
z-index: 2;
|
|
18921
18921
|
pointer-events: auto;
|
|
18922
18922
|
}
|
|
18923
|
-
${
|
|
18924
|
-
`}function
|
|
18923
|
+
${Gb(e)}
|
|
18924
|
+
`}function gS(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,r]=n.split(":").map(Number),l=i?r:o,c=i?o:r;return c>0?l/c:1}function hS(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,n=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!n?null:t/n}function fS(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:A.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:A.scalingValue(i*pS,n??!1),[`--${t}-image-aspect`]:gS(e)}}function yS(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return nn(n,t)}function vS(e){var o;const t=((o=e==null?void 0:e.imageDisplay)==null?void 0:o.display)==="cover",n=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...n?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function xS(e,t,n,i,o,r){if(!(!e||!t))return l=>{var d;const c=((d=l.currentTarget.closest(`.${i}-item`))==null?void 0:d.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);r(n,c?Cp(c,o):void 0)}}function bS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=A.useScopedStyles(),d=s.useMemo(()=>mS(c),[c]),u=t??[],p=(e==null?void 0:e.type)??"a",v=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,x=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=A.scalingValue(x,n??!1),h=`max(${m}, ${uS}px)`,{objectFitMode:b,imageStyle:S}=vS(e),M=yS(e,n),y=s.useRef(null),[$,R]=s.useState(!1),[X,B]=s.useState([]),[O,N]=s.useState(0),[z,C]=s.useState(0),[I,j]=s.useState(null),[E,w]=s.useState({title1:"",title2:"",title3:""}),L=(!n||i)&&!$,V=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},_=V.sizeType??"none",K=L&&_!=="none"?`${c}-item-image-hover-${_}`:void 0,P=(V.value??120)/100,f=s.useCallback(ye=>{!ye||_!=="scale"||(ye.style.transformOrigin=ff(ye))},[_]),U=s.useCallback(ye=>{if(ye){if(b==="contain"){const ee=hS(ye);if(ee){const oe=ye.closest(`.${c}-item-image`);oe instanceof HTMLElement&&oe.style.setProperty(`--${c}-item-media-aspect`,String(ee))}}f(ye)}},[c,f,b]),te={width:A.scalingValue(v,n??!1),...M,...fS(e,c,n),[`--${c}-image-hover-scale`]:String(P)},ce=(()=>{const ye={},ee=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return ee&&(ye["--cntrl-article-width"]=ee),ye})(),F=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),ie=s.useMemo(()=>Jb(u),[u]),T=s.useMemo(()=>oS(u),[u]),le=(ye,ee)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const oe=ie.findIndex(ge=>ge.gridIndex===ye);if(oe<0)return;const re=ie[oe];C(oe),B(re.items),N(0),w(re.entry),j(ee??null),R(!0)},J=s.useCallback(()=>{R(!1),j(null)},[]),Se=s.useCallback(()=>{const ye=ie[z];return!ye||!y.current?I:Zb(y.current,ye.gridIndex,b)??I},[ie,z,I,b]),Le=s.useCallback(ye=>{if(ie.length>1){const ee=ie.length,oe=(z+ye+ee)%ee,re=ie[oe];C(oe),B(re.items),N(0),w(re.entry);return}N(ee=>(ee+ye+X.length)%X.length)},[ie,z,X.length]),me=ie.length>1||X.length>1;return s.useEffect(()=>{if(!$||typeof document>"u")return;const ye=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ye}},[$]),s.useEffect(()=>{!n||o||i||R(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&R(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx(rS,{mediaList:T}),a.jsx("div",{ref:y,className:`${c}-wrapper ${c}-type-${p}`,style:te,children:u.map((ye,ee)=>{var ge,we;const oe=!!((ge=ye.image)!=null&&ge.assetId),re=xS(!!F,oe,ee,c,b,le);return a.jsxs("div",{className:`${c}-item`,children:[ye.title?a.jsx("span",{className:`${c}-item-title`,onClick:re,style:re?{cursor:"pointer"}:void 0,children:ye.title}):null,(we=ye.image)!=null&&we.assetId?a.jsx("span",{className:[`${c}-item-image`,b==="contain"?`${c}-item-image-fit`:void 0,K].filter(Boolean).join(" "),children:ye.image.type==="video"?a.jsx("video",{ref:U,src:ye.image.assetId,"data-waterfall-index":ee,style:S,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:re,onLoadedData:Ae=>U(Ae.currentTarget)}):a.jsx("img",{ref:U,src:ye.image.assetId,alt:ye.image.name??"","data-waterfall-index":ee,style:S,onClick:re,onLoad:Ae=>U(Ae.currentTarget)})}):null,ee<u.length-1&&a.jsx("div",{className:`${c}-item-gap-host`,style:{width:m},children:o&&!$&&a.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${c}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:h,height:"100%"}})})]},ee)})}),$&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const ye=(l?document.getElementById(l):null)??document.body;return Un.createPortal(a.jsx("div",{style:ce,"data-selection":"none",children:a.jsx(dS,{prefix:c,items:X,index:O,entry:E,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:me,lightboxEntries:ie,entryIdx:z,layoutId:r,sourceRect:I,resolveCloseSourceRect:Se,onClose:J,onPrev:()=>Le(-1),onNext:()=>Le(1)})}),ye)})()]})}const SS=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18925
18925
|
import type React from 'react';
|
|
18926
18926
|
import { createPortal } from 'react-dom';
|
|
18927
18927
|
import { CommonComponentProps } from '../props';
|
|
@@ -19435,7 +19435,7 @@ export function Waterfall({
|
|
|
19435
19435
|
</>
|
|
19436
19436
|
);
|
|
19437
19437
|
}
|
|
19438
|
-
`,fS="01M3SBP3P8CMVMM1ZZ0QVD2PPF",vi={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 yS(e){const t={};return t[bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSettings")]={...vi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSize")]={...vi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[bt(e,"lineHeight")]={...vi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[bt(e,"letterSpacing")]={...vi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[bt(e,"wordSpacing")]={...vi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[bt(e,"textAlign")]={...vi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[bt(e,"textAppearance")]={...vi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const No=Li.filter(e=>e!=="count"),vS=No.reduce((e,t)=>({...e,...yS(t)}),{}),xS=No.reduce((e,t)=>({...e,[bt(t,"fontFamily")]:"Arial",[bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[bt(t,"letterSpacing")]:0,[bt(t,"wordSpacing")]:0,[bt(t,"textAlign")]:"left",[bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ss(e){return No.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[bt(n,"fontSize")]=i),o!==void 0&&(t[bt(n,"lineHeight")]=o),t},{})}const bS={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(No.map(e=>[Nl[e],_l(e)]))},Qr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},SS=[{title:"Salton Sea from Above",...Qr,image:{assetId:"01M3QM74XERA3G7J0J00XVKEXX",objectFit:"cover"}},{title:"Lunar Module Pilot",...Qr,image:{assetId:"01M3QM74XEE2101QD8PM6E4JSA",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Qr,image:{assetId:"01M3QM74XEBS5231QA4355P4VQ",objectFit:"cover"}},{title:"David R. Scott During EVA",...Qr,image:{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",objectFit:"cover"}}],wS={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]}},required:["image"]},default:SS},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...vi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},...vS},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:fS,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...xS},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...Ss({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...Ss({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...Ss({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Lightbox",items:[bS]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},$S={element:mS,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"closeIcon"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...No.map(e=>({path:`${bt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...No.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${bt(t,"fontFamily")}`}),{})},schema:wS,sourceCode:hS},So=500,Sp="cubic-bezier(0.25, 1, 0.5, 1)",CS=300,TS=5,IS=.15,LS=.4,PS=100,ro=100,md={color:"#000000",hover:"#cccccc"},Zo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},RS={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},ws={offset:{x:0,y:0},linkColor:"#cccccc"},hd={sizeType:"drag",value:3},MS="left";function ES(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:MS,color:(e==null?void 0:e.titleColor)??"#000000"};return en(n,t)}function ao(e,t,n){return`${e}: ${F.scalingValue(t/1440,n)};`}function rr(e,t){return t<=0?0:(e%t+t)%t}function kS(e,t,n,i){if(!i)return{position:rr(e+t,n),hitBoundary:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,hitBoundary:!1}:{position:t>0?n+1:0,hitBoundary:!0}}function AS(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function FS(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,y)=>{n.style.transform=`translate(${p}px, ${y}px)`;const v=n.getBoundingClientRect();return{x:v.left,y:v.top}},o=i(0,0),r=i(ro,0),l=i(0,ro);e.removeChild(n);const c={x:(r.x-o.x)/ro,y:(r.y-o.y)/ro},d={x:(l.x-o.x)/ro,y:(l.y-o.y)/ro},u=c.x*d.y-d.x*c.y;return{ex:c,ey:d,det:u}}function NS(e,t,n){const{ex:i,ey:o,det:r}=e;return{x:(t*o.y-n*o.x)/r,y:(i.x*n-i.y*t)/r}}function _S(e,t){return`
|
|
19438
|
+
`,wS="01M3SBP3P8CMVMM1ZZ0QVD2PPF",Si={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function $S(e){const t={};return t[bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSettings")]={...Si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSize")]={...Si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[bt(e,"lineHeight")]={...Si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[bt(e,"letterSpacing")]={...Si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[bt(e,"wordSpacing")]={...Si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[bt(e,"textAlign")]={...Si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[bt(e,"textAppearance")]={...Si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ho=Mi.filter(e=>e!=="count"),CS=Ho.reduce((e,t)=>({...e,...$S(t)}),{}),TS=Ho.reduce((e,t)=>({...e,[bt(t,"fontFamily")]:"Arial",[bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[bt(t,"letterSpacing")]:0,[bt(t,"wordSpacing")]:0,[bt(t,"textAlign")]:"left",[bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ss(e){return Ho.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[bt(n,"fontSize")]=i),o!==void 0&&(t[bt(n,"lineHeight")]=o),t},{})}const IS={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ho.map(e=>[Nl[e],_l(e)]))},Qr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},LS=[{title:"Salton Sea from Above",...Qr,image:{assetId:"01M3QM74XERA3G7J0J00XVKEXX",objectFit:"cover"}},{title:"Lunar Module Pilot",...Qr,image:{assetId:"01M3QM74XEE2101QD8PM6E4JSA",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Qr,image:{assetId:"01M3QM74XEBS5231QA4355P4VQ",objectFit:"cover"}},{title:"David R. Scott During EVA",...Qr,image:{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",objectFit:"cover"}}],PS={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]}},required:["image"]},default:LS},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},...CS},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:wS,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...TS},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...Ss({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...Ss({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...Ss({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Lightbox",items:[IS]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},RS={element:bS,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"closeIcon"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...Ho.map(e=>({path:`${bt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Ho.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${bt(t,"fontFamily")}`}),{})},schema:PS,sourceCode:SS},$o=500,Lp="cubic-bezier(0.25, 1, 0.5, 1)",MS=300,ES=5,kS=.15,AS=.4,FS=100,so=100,gd={color:"#000000",hover:"#cccccc"},Zo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},NS={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},ws={offset:{x:0,y:0},linkColor:"#cccccc"},hd={sizeType:"drag",value:3},_S="left";function HS(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:_S,color:(e==null?void 0:e.titleColor)??"#000000"};return nn(n,t)}function lo(e,t,n){return`${e}: ${A.scalingValue(t/1440,n)};`}function rr(e,t){return t<=0?0:(e%t+t)%t}function WS(e,t,n,i){if(!i)return{position:rr(e+t,n),hitBoundary:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,hitBoundary:!1}:{position:t>0?n+1:0,hitBoundary:!0}}function OS(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function DS(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,v)=>{n.style.transform=`translate(${p}px, ${v}px)`;const x=n.getBoundingClientRect();return{x:x.left,y:x.top}},o=i(0,0),r=i(so,0),l=i(0,so);e.removeChild(n);const c={x:(r.x-o.x)/so,y:(r.y-o.y)/so},d={x:(l.x-o.x)/so,y:(l.y-o.y)/so},u=c.x*d.y-d.x*c.y;return{ex:c,ey:d,det:u}}function BS(e,t,n){const{ex:i,ey:o,det:r}=e;return{x:(t*o.y-n*o.x)/r,y:(i.x*n-i.y*t)/r}}function zS(e,t){return`
|
|
19439
19439
|
.${e}-wrapper {
|
|
19440
19440
|
position: relative;
|
|
19441
19441
|
width: 100%;
|
|
@@ -19507,7 +19507,7 @@ export function Waterfall({
|
|
|
19507
19507
|
top: 0;
|
|
19508
19508
|
left: 0;
|
|
19509
19509
|
opacity: 0;
|
|
19510
|
-
transition: opacity ${
|
|
19510
|
+
transition: opacity ${$o}ms ${Lp};
|
|
19511
19511
|
}
|
|
19512
19512
|
.${e}-list-fade .${e}-slide.${e}-is-active {
|
|
19513
19513
|
opacity: 1;
|
|
@@ -19534,29 +19534,29 @@ export function Waterfall({
|
|
|
19534
19534
|
top: 50%;
|
|
19535
19535
|
z-index: 1;
|
|
19536
19536
|
padding: 0;
|
|
19537
|
-
${
|
|
19538
|
-
${
|
|
19537
|
+
${lo("width",30,t)}
|
|
19538
|
+
${lo("height",30,t)}
|
|
19539
19539
|
transition: opacity 0.15s ease-in-out;
|
|
19540
19540
|
}
|
|
19541
19541
|
.${e}-arrow-prev {
|
|
19542
|
-
${
|
|
19542
|
+
${lo("left",-20,t)}
|
|
19543
19543
|
transform: translate3d(-50%, -50%, 0);
|
|
19544
19544
|
}
|
|
19545
19545
|
.${e}-arrow-next {
|
|
19546
19546
|
left: unset;
|
|
19547
|
-
${
|
|
19547
|
+
${lo("right",-20,t)}
|
|
19548
19548
|
transform: translate3d(50%, -50%, 0);
|
|
19549
19549
|
}
|
|
19550
19550
|
.${e}-arrow-prev-vertical {
|
|
19551
19551
|
left: 50%;
|
|
19552
|
-
${
|
|
19552
|
+
${lo("top",-20,t)}
|
|
19553
19553
|
transform: translate3d(-50%, -50%, 0);
|
|
19554
19554
|
}
|
|
19555
19555
|
.${e}-arrow-next-vertical {
|
|
19556
19556
|
left: 50%;
|
|
19557
19557
|
right: unset;
|
|
19558
19558
|
top: unset;
|
|
19559
|
-
${
|
|
19559
|
+
${lo("bottom",-20,t)}
|
|
19560
19560
|
transform: translate3d(-50%, 50%, 0);
|
|
19561
19561
|
}
|
|
19562
19562
|
.${e}-arrow-hidden {
|
|
@@ -19692,10 +19692,10 @@ export function Waterfall({
|
|
|
19692
19692
|
object-fit: cover;
|
|
19693
19693
|
}
|
|
19694
19694
|
.${e}-transition-reveal .${e}-slide.${e}-is-active .${e}-slider-image {
|
|
19695
|
-
animation: ${e}-reveal-horizontal ${
|
|
19695
|
+
animation: ${e}-reveal-horizontal ${$o}ms ease;
|
|
19696
19696
|
}
|
|
19697
19697
|
.${e}-transition-reveal-vertical .${e}-slide.${e}-is-active .${e}-slider-image {
|
|
19698
|
-
animation: ${e}-reveal-vertical ${
|
|
19698
|
+
animation: ${e}-reveal-vertical ${$o}ms ease;
|
|
19699
19699
|
}
|
|
19700
19700
|
@keyframes ${e}-reveal-horizontal {
|
|
19701
19701
|
from { clip-path: inset(0 100% 0 0); }
|
|
@@ -19705,7 +19705,7 @@ export function Waterfall({
|
|
|
19705
19705
|
from { clip-path: inset(100% 0 0 0); }
|
|
19706
19706
|
to { clip-path: inset(0 0 0 0); }
|
|
19707
19707
|
}
|
|
19708
|
-
`}function HS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=F.useScopedStyles(),l=ES(e,n),c=t??[],d=c.length,u=(e==null?void 0:e.trigger)??hd,p=u.sizeType??"drag",y=u.value??hd.value,v=(e==null?void 0:e.direction)??"horizontal",g=(e==null?void 0:e.transition)??"slide",m=(e==null?void 0:e.nav)??"classic",x=(e==null?void 0:e.navSize)??"m",b=RS[x],M=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,f=ve=>F.scalingValue(ve*M,n),S=(e==null?void 0:e.show)??"always",W=(e==null?void 0:e.controls)??null,q=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,z=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,L=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,_=(e==null?void 0:e.controlsColor)??md.color,G=(e==null?void 0:e.controlsHoverColor)??md.hover,$=(e==null?void 0:e.navColor)??Zo.colors.inactive,I=(e==null?void 0:e.navPaginationColor)??Zo.colors.pagination,D=(e==null?void 0:e.navBackgroundColor)??Zo.colors.background,E=(e==null?void 0:e.linkColor)??ws.linkColor,T=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,C=v==="horizontal",V=p==="click",w=p==="drag",U=p==="auto"&&(!n||!!i),P=!n,A=g==="slide",j=m==="classic",ie=S!=="never"&&q>0,ae=S==="on hover",O=F.scalingValue(q,n),re={width:O,height:O,maxWidth:O},N=A&&d>1,[le,J]=s.useState(0),[be,Le]=s.useState(N?1:0),[ye,ce]=s.useState(!1),[K,se]=s.useState(!1),[pe,fe]=s.useState(!1),[we,Re]=s.useState(0),[me,xe]=s.useState(!1),[Ce,h]=s.useState(!1),Y=s.useRef(!1),Q=s.useRef(be);Q.current=be;const ne=s.useRef(null),ue=s.useRef(0),B=s.useRef(null),R=s.useRef(null),ee=s.useRef(null),te=s.useRef(null),ge=s.useCallback(ve=>{Y.current=ve,ce(ve)},[]),X=s.useCallback(ve=>{if(d<2||ve===0)return;const _e=ve>0?1:-1,ze=Math.abs(ve);if(xe(!0),ge(!0),!A){J(st=>rr(st+ve,d));return}let Qe=Q.current;const $e=N&&(Qe===0||Qe===d+1),Ne=$e?le+1:null;$e&&(Qe=le+1);let Ye=ze;for(;Ye>0;){const st=kS(Qe,_e,d,N);if(Qe=st.position,Ye-=1,st.hitBoundary){ue.current=Ye*_e;break}}const Ze=ze-Ye;if(Ze>0&&J(st=>rr(st+Ze*_e,d)),Q.current=Qe,Ne!==null){if(Q.current=Ne,Qe===Ne){se(!0),Le(Qe);return}ne.current=Qe,se(!0),Le(Ne);return}se(!1),Le(Qe)},[le,d,N,A,ge]),Pe=s.useCallback(ve=>{X(ve)},[X]),Se=s.useCallback(ve=>{if(d<2)return;const _e=rr(ve,d);if(!(_e===le&&!Y.current)&&(xe(!0),ge(!0),J(_e),A)){const ze=_e+(N?1:0);ne.current=null,ue.current=0,Q.current=ze,se(!1),Le(ze)}},[le,d,N,A,ge]);s.useEffect(()=>{if(!ye)return;const ve=window.setTimeout(()=>{if(N&&(be===0||be===d+1)){ne.current=null,se(!0),Le(le+1);return}ge(!1)},So);return()=>window.clearTimeout(ve)},[le,d,N,ye,ge,be]),s.useEffect(()=>{if(!K)return;let ve=0;const _e=requestAnimationFrame(()=>{ve=requestAnimationFrame(()=>{const ze=ne.current;ne.current=null;const Qe=ue.current;if(ue.current=0,se(!1),ze!==null){Q.current=ze,Le(ze);return}if(Qe!==0){X(Qe);return}ge(!1)})});return()=>{cancelAnimationFrame(_e),cancelAnimationFrame(ve)}},[X,ge,K]);const Z=`${N}:${d}`,He=s.useRef(Z);s.useEffect(()=>{if(He.current===Z)return;He.current=Z;const ve=d>0?Math.min(le,d-1):0;ee.current=null,te.current=null,fe(!1),Re(0),J(ve),se(!0),Le(ve+(N?1:0))},[le,d,N,Z]),s.useEffect(()=>{if(!me)return;const ve=window.setTimeout(()=>xe(!1),CS);return()=>window.clearTimeout(ve)},[me,le]),s.useEffect(()=>{if(!U||d<2)return;const ve=Math.max(y,.1)*1e3,_e=window.setInterval(()=>{P&&Ce||Pe(1)},ve);return()=>window.clearInterval(_e)},[y,d,Pe,U,Ce,P]);const We=s.useCallback(ve=>{const _e=ee.current;if(!_e||_e.pointerId!==ve.pointerId)return;ee.current=null,te.current=null;const ze=B.current;if(ze!=null&&ze.hasPointerCapture(ve.pointerId)&&ze.releasePointerCapture(ve.pointerId),!_e.isActive){A&&Re(0);return}const $e=!(ve.timeStamp-_e.lastTime>PS)&&Math.abs(_e.velocity)>LS,Ne=_e.size>0&&Math.abs(_e.offset-_e.baseOffset)>_e.size*IS;if(fe(!1),!$e&&!Ne){Re(0);return}const Ye=Ne?_e.offset-_e.baseOffset:_e.velocity;let Ze=1;Ne&&_e.size>0&&(Ze=Math.max(1,Math.round(Math.abs(Ye)/_e.size))),Re(0),X(Ye<0?Ze:-Ze)},[X,A]);s.useEffect(()=>{const ve=_e=>{te.current===null||_e.pointerId!==te.current||We(_e)};return window.addEventListener("pointerup",ve),window.addEventListener("pointercancel",ve),()=>{window.removeEventListener("pointerup",ve),window.removeEventListener("pointercancel",ve)}},[We]);const ot=ve=>{const _e=B.current;if(!w||d<2||!_e||ve.pointerType==="mouse"&&ve.button!==0)return;ne.current=null,ue.current=0,Y.current&&ge(!1);let ze=0;const Qe=R.current;if(A&&Qe){const $e=C?Qe.offsetWidth:Qe.offsetHeight;if($e>0){const Ne=AS(Qe,C);let Ye=Q.current;N&&(Ye===0||Ye===d+1)?(Ye=le+1,Q.current=Ye,se(!0),Le(Ye),ze=0):ze=Ne+Ye*$e,Re(ze)}}_e.setPointerCapture(ve.pointerId),te.current=ve.pointerId,ee.current={pointerId:ve.pointerId,startClientX:ve.clientX,startClientY:ve.clientY,axes:FS(_e,`${r}-axis-probe`),size:C?_e.offsetWidth:_e.offsetHeight,isActive:!1,baseOffset:ze,offset:ze,lastTime:ve.timeStamp,velocity:0}},qe=ve=>{const _e=ee.current;if(!_e||_e.pointerId!==ve.pointerId)return;if(ve.pointerType==="mouse"&&ve.buttons===0){We(ve);return}const ze=ve.clientX-_e.startClientX,Qe=ve.clientY-_e.startClientY,$e=_e.axes?NS(_e.axes,ze,Qe):{x:ze,y:Qe},Ne=C?$e.x:$e.y,Ye=C?$e.y:$e.x,Ze=_e.baseOffset+Ne;if(!_e.isActive){if(Math.max(Math.abs(Ne),Math.abs(Ye))<TS)return;if(Math.abs(Ye)>Math.abs(Ne)){const it=B.current;it!=null&&it.hasPointerCapture(_e.pointerId)&&it.releasePointerCapture(_e.pointerId),ee.current=null,te.current=null,A&&Re(0);return}_e.isActive=!0,fe(!0)}const st=ve.timeStamp-_e.lastTime;st>0&&(_e.velocity=(Ze-_e.offset)/st,_e.lastTime=ve.timeStamp),_e.offset=Ze,A&&Re(Ze)},tt=ve=>{We(ve)},et=C?`translate3d(calc(${-be*100}% + ${we}px), 0, 0)`:`translate3d(0, calc(${-be*100}% + ${we}px), 0)`,Ge=N?[c[d-1],...c,c[0]]:c;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_S(r,n)}}),a.jsxs("div",{className:Ct(`${r}-wrapper`,{[`${r}-transition-reveal`]:g==="reveal",[`${r}-transition-reveal-vertical`]:g==="reveal"&&!C}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:B,className:Ct(`${r}-track`,{[`${r}-track-draggable`]:w,[`${r}-track-draggable-vertical`]:w&&!C}),onPointerDown:ot,onPointerMove:qe,onPointerUp:tt,onPointerCancel:tt,onLostPointerCapture:ve=>{te.current===ve.pointerId&&We(ve)},children:a.jsx("div",{ref:R,className:Ct(`${r}-list`,{[`${r}-list-slide`]:A,[`${r}-list-slide-vertical`]:A&&!C,[`${r}-list-fade`]:!A}),style:A?{transform:et,transition:pe||K?"none":`transform ${So}ms ${Sp}`}:void 0,children:Ge.map((ve,_e)=>{const ze=N?rr(_e-1,d):_e,$e=N&&(_e===0||_e===d+1)?`clone-${_e===0?"start":"end"}`:`slide-${ze}`;return a.jsx("div",{className:Ct(`${r}-slide`,{[`${r}-is-active`]:!A&&ze===le}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:Ct(`${r}-slider-image`,{[`${r}-contain`]:ve.image.objectFit==="contain",[`${r}-cover`]:ve.image.objectFit==="cover"}),src:ve.image.assetId,alt:ve.image.name??"",draggable:!1})})})},$e)})})}),ie&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-prev`]:C,[`${r}-arrow-prev-vertical`]:!C,[`${r}-hover-arrow`]:ae}),style:{color:_,"--arrow-hover-color":G,...re},children:a.jsxs("button",{onClick:ve=>{ve.stopPropagation(),Pe(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${F.scalingValue(z,n)}, ${F.scalingValue(L*(C?1:-1),n)}) rotate(${C?"0deg":"90deg"})`},children:[W&&a.jsx(gn,{url:W,fill:_,hoverFill:G,className:Ct(`${r}-arrow-img`,`${r}-mirror`),style:re}),!W&&a.jsx(fd,{color:_,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-next`]:C,[`${r}-arrow-next-vertical`]:!C,[`${r}-hover-arrow`]:ae}),style:{color:_,"--arrow-hover-color":G,...re},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:ve=>{ve.stopPropagation(),Pe(1)},style:{transform:`translate(${F.scalingValue(z*(C?-1:1),n)}, ${F.scalingValue(L,n)}) rotate(${C?"0deg":"90deg"})`},children:[W&&a.jsx(gn,{url:W,fill:_,hoverFill:G,className:`${r}-arrow-img`,style:re}),!W&&a.jsx(fd,{color:_,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),V&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Pe(1)}),j&&a.jsx("div",{className:Ct(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:C,[`${r}-pagination-inside-left`]:!C}),style:C?{bottom:f(b.inset)}:{left:f(b.inset)},children:a.jsx("div",{className:Ct(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!C,[`${r}-animate-dots`]:me}),style:{backgroundColor:D,gap:f(b.gapInactive-b.activeDot+b.dot),...C?{height:f(b.activeDot+b.paddingY*2),paddingTop:f(b.paddingY),paddingBottom:f(b.paddingY),paddingLeft:f(b.paddingActive),paddingRight:f(b.paddingActive)}:{width:f(b.activeDot+b.paddingY*2),paddingLeft:f(b.paddingY),paddingRight:f(b.paddingY),paddingTop:f(b.paddingActive),paddingBottom:f(b.paddingActive)},borderRadius:f(b.borderRadius),transform:`translate(${F.scalingValue(Zo.offset.x,n)}, ${F.scalingValue(Zo.offset.y,n)})`},children:c.map((ve,_e)=>{const ze=_e===le,Qe=ze?b.activeDot:b.dot;return a.jsx("button",{onClick:()=>Se(_e),className:`${r}-pagination-item`,style:{width:f(b.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:ze?I:$,width:f(Qe)}})},_e)})},`${x}-${v}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:F.scalingValue(T,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:c.map((ve,_e)=>a.jsx("div",{className:Ct(`${r}-caption-text`,{[`${r}-with-pointer-events`]:_e===le&&n,[`${r}-active`]:_e===le}),style:{...l,width:"max-content",transitionDuration:`${Math.round(So/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":E,"--link-hover-color":E,position:"relative",top:F.scalingValue(ws.offset.y,n),left:F.scalingValue(ws.offset.x,n)},children:a.jsx(Yi,{content:ve.imageCaption})})},_e))})]})]})]})}function fd({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const WS=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19708
|
+
`}function jS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=A.useScopedStyles(),l=HS(e,n),c=t??[],d=c.length,u=(e==null?void 0:e.trigger)??hd,p=u.sizeType??"drag",v=u.value??hd.value,x=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",b=(e==null?void 0:e.navSize)??"m",S=NS[b],M=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=be=>A.scalingValue(be*M,n),$=(e==null?void 0:e.show)??"always",R=(e==null?void 0:e.controls)??null,X=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,B=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,O=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,N=(e==null?void 0:e.controlsColor)??gd.color,z=(e==null?void 0:e.controlsHoverColor)??gd.hover,C=(e==null?void 0:e.navColor)??Zo.colors.inactive,I=(e==null?void 0:e.navPaginationColor)??Zo.colors.pagination,j=(e==null?void 0:e.navBackgroundColor)??Zo.colors.background,E=(e==null?void 0:e.linkColor)??ws.linkColor,w=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,L=x==="horizontal",V=p==="click",_=p==="drag",K=p==="auto"&&(!n||!!i),P=!n,f=m==="slide",U=h==="classic",te=$!=="never"&&X>0,ce=$==="on hover",F=A.scalingValue(X,n),ie={width:F,height:F,maxWidth:F},T=f&&d>1,[le,J]=s.useState(0),[Se,Le]=s.useState(T?1:0),[me,ye]=s.useState(!1),[ee,oe]=s.useState(!1),[re,ge]=s.useState(!1),[we,Ae]=s.useState(0),[fe,ve]=s.useState(!1),[xe,g]=s.useState(!1),G=s.useRef(!1),Q=s.useRef(Se);Q.current=Se;const ne=s.useRef(null),ue=s.useRef(0),q=s.useRef(null),D=s.useRef(null),se=s.useRef(null),Y=s.useRef(null),pe=s.useCallback(be=>{G.current=be,ye(be)},[]),H=s.useCallback(be=>{if(d<2||be===0)return;const He=be>0?1:-1,je=Math.abs(be);if(ve(!0),pe(!0),!f){J(lt=>rr(lt+be,d));return}let Qe=Q.current;const Ce=T&&(Qe===0||Qe===d+1),_e=Ce?le+1:null;Ce&&(Qe=le+1);let Ue=je;for(;Ue>0;){const lt=WS(Qe,He,d,T);if(Qe=lt.position,Ue-=1,lt.hitBoundary){ue.current=Ue*He;break}}const Ye=je-Ue;if(Ye>0&&J(lt=>rr(lt+Ye*He,d)),Q.current=Qe,_e!==null){if(Q.current=_e,Qe===_e){oe(!0),Le(Qe);return}ne.current=Qe,oe(!0),Le(_e);return}oe(!1),Le(Qe)},[le,d,T,f,pe]),Ie=s.useCallback(be=>{H(be)},[H]),de=s.useCallback(be=>{if(d<2)return;const He=rr(be,d);if(!(He===le&&!G.current)&&(ve(!0),pe(!0),J(He),f)){const je=He+(T?1:0);ne.current=null,ue.current=0,Q.current=je,oe(!1),Le(je)}},[le,d,T,f,pe]);s.useEffect(()=>{if(!me)return;const be=window.setTimeout(()=>{if(T&&(Se===0||Se===d+1)){ne.current=null,oe(!0),Le(le+1);return}pe(!1)},$o);return()=>window.clearTimeout(be)},[le,d,T,me,pe,Se]),s.useEffect(()=>{if(!ee)return;let be=0;const He=requestAnimationFrame(()=>{be=requestAnimationFrame(()=>{const je=ne.current;ne.current=null;const Qe=ue.current;if(ue.current=0,oe(!1),je!==null){Q.current=je,Le(je);return}if(Qe!==0){H(Qe);return}pe(!1)})});return()=>{cancelAnimationFrame(He),cancelAnimationFrame(be)}},[H,pe,ee]);const Z=`${T}:${d}`,Ne=s.useRef(Z);s.useEffect(()=>{if(Ne.current===Z)return;Ne.current=Z;const be=d>0?Math.min(le,d-1):0;se.current=null,Y.current=null,ge(!1),Ae(0),J(be),oe(!0),Le(be+(T?1:0))},[le,d,T,Z]),s.useEffect(()=>{if(!fe)return;const be=window.setTimeout(()=>ve(!1),MS);return()=>window.clearTimeout(be)},[fe,le]),s.useEffect(()=>{if(!K||d<2)return;const be=Math.max(v,.1)*1e3,He=window.setInterval(()=>{P&&xe||Ie(1)},be);return()=>window.clearInterval(He)},[v,d,Ie,K,xe,P]);const Oe=s.useCallback(be=>{const He=se.current;if(!He||He.pointerId!==be.pointerId)return;se.current=null,Y.current=null;const je=q.current;if(je!=null&&je.hasPointerCapture(be.pointerId)&&je.releasePointerCapture(be.pointerId),!He.isActive){f&&Ae(0);return}const Ce=!(be.timeStamp-He.lastTime>FS)&&Math.abs(He.velocity)>AS,_e=He.size>0&&Math.abs(He.offset-He.baseOffset)>He.size*kS;if(ge(!1),!Ce&&!_e){Ae(0);return}const Ue=_e?He.offset-He.baseOffset:He.velocity;let Ye=1;_e&&He.size>0&&(Ye=Math.max(1,Math.round(Math.abs(Ue)/He.size))),Ae(0),H(Ue<0?Ye:-Ye)},[H,f]);s.useEffect(()=>{const be=He=>{Y.current===null||He.pointerId!==Y.current||Oe(He)};return window.addEventListener("pointerup",be),window.addEventListener("pointercancel",be),()=>{window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",be)}},[Oe]);const Je=be=>{const He=q.current;if(!_||d<2||!He||be.pointerType==="mouse"&&be.button!==0)return;ne.current=null,ue.current=0,G.current&&pe(!1);let je=0;const Qe=D.current;if(f&&Qe){const Ce=L?Qe.offsetWidth:Qe.offsetHeight;if(Ce>0){const _e=OS(Qe,L);let Ue=Q.current;T&&(Ue===0||Ue===d+1)?(Ue=le+1,Q.current=Ue,oe(!0),Le(Ue),je=0):je=_e+Ue*Ce,Ae(je)}}He.setPointerCapture(be.pointerId),Y.current=be.pointerId,se.current={pointerId:be.pointerId,startClientX:be.clientX,startClientY:be.clientY,axes:DS(He,`${r}-axis-probe`),size:L?He.offsetWidth:He.offsetHeight,isActive:!1,baseOffset:je,offset:je,lastTime:be.timeStamp,velocity:0}},De=be=>{const He=se.current;if(!He||He.pointerId!==be.pointerId)return;if(be.pointerType==="mouse"&&be.buttons===0){Oe(be);return}const je=be.clientX-He.startClientX,Qe=be.clientY-He.startClientY,Ce=He.axes?BS(He.axes,je,Qe):{x:je,y:Qe},_e=L?Ce.x:Ce.y,Ue=L?Ce.y:Ce.x,Ye=He.baseOffset+_e;if(!He.isActive){if(Math.max(Math.abs(_e),Math.abs(Ue))<ES)return;if(Math.abs(Ue)>Math.abs(_e)){const it=q.current;it!=null&&it.hasPointerCapture(He.pointerId)&&it.releasePointerCapture(He.pointerId),se.current=null,Y.current=null,f&&Ae(0);return}He.isActive=!0,ge(!0)}const lt=be.timeStamp-He.lastTime;lt>0&&(He.velocity=(Ye-He.offset)/lt,He.lastTime=be.timeStamp),He.offset=Ye,f&&Ae(Ye)},Ze=be=>{Oe(be)},at=L?`translate3d(calc(${-Se*100}% + ${we}px), 0, 0)`:`translate3d(0, calc(${-Se*100}% + ${we}px), 0)`,Xe=T?[c[d-1],...c,c[0]]:c;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:zS(r,n)}}),a.jsxs("div",{className:Rt(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!L}),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:q,className:Rt(`${r}-track`,{[`${r}-track-draggable`]:_,[`${r}-track-draggable-vertical`]:_&&!L}),onPointerDown:Je,onPointerMove:De,onPointerUp:Ze,onPointerCancel:Ze,onLostPointerCapture:be=>{Y.current===be.pointerId&&Oe(be)},children:a.jsx("div",{ref:D,className:Rt(`${r}-list`,{[`${r}-list-slide`]:f,[`${r}-list-slide-vertical`]:f&&!L,[`${r}-list-fade`]:!f}),style:f?{transform:at,transition:re||ee?"none":`transform ${$o}ms ${Lp}`}:void 0,children:Xe.map((be,He)=>{const je=T?rr(He-1,d):He,Ce=T&&(He===0||He===d+1)?`clone-${He===0?"start":"end"}`:`slide-${je}`;return a.jsx("div",{className:Rt(`${r}-slide`,{[`${r}-is-active`]:!f&&je===le}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:Rt(`${r}-slider-image`,{[`${r}-contain`]:be.image.objectFit==="contain",[`${r}-cover`]:be.image.objectFit==="cover"}),src:be.image.assetId,alt:be.image.name??"",draggable:!1})})})},Ce)})})}),te&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Rt(`${r}-arrow`,{[`${r}-arrow-prev`]:L,[`${r}-arrow-prev-vertical`]:!L,[`${r}-hover-arrow`]:ce}),style:{color:N,"--arrow-hover-color":z,...ie},children:a.jsxs("button",{onClick:be=>{be.stopPropagation(),Ie(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${A.scalingValue(B,n)}, ${A.scalingValue(O*(L?1:-1),n)}) rotate(${L?"0deg":"90deg"})`},children:[R&&a.jsx(gn,{url:R,fill:N,hoverFill:z,className:Rt(`${r}-arrow-img`,`${r}-mirror`),style:ie}),!R&&a.jsx(fd,{color:N,className:Rt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:Rt(`${r}-arrow`,{[`${r}-arrow-next`]:L,[`${r}-arrow-next-vertical`]:!L,[`${r}-hover-arrow`]:ce}),style:{color:N,"--arrow-hover-color":z,...ie},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:be=>{be.stopPropagation(),Ie(1)},style:{transform:`translate(${A.scalingValue(B*(L?-1:1),n)}, ${A.scalingValue(O,n)}) rotate(${L?"0deg":"90deg"})`},children:[R&&a.jsx(gn,{url:R,fill:N,hoverFill:z,className:`${r}-arrow-img`,style:ie}),!R&&a.jsx(fd,{color:N,className:Rt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),V&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Ie(1)}),U&&a.jsx("div",{className:Rt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:L,[`${r}-pagination-inside-left`]:!L}),style:L?{bottom:y(S.inset)}:{left:y(S.inset)},children:a.jsx("div",{className:Rt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!L,[`${r}-animate-dots`]:fe}),style:{backgroundColor:j,gap:y(S.gapInactive-S.activeDot+S.dot),...L?{height:y(S.activeDot+S.paddingY*2),paddingTop:y(S.paddingY),paddingBottom:y(S.paddingY),paddingLeft:y(S.paddingActive),paddingRight:y(S.paddingActive)}:{width:y(S.activeDot+S.paddingY*2),paddingLeft:y(S.paddingY),paddingRight:y(S.paddingY),paddingTop:y(S.paddingActive),paddingBottom:y(S.paddingActive)},borderRadius:y(S.borderRadius),transform:`translate(${A.scalingValue(Zo.offset.x,n)}, ${A.scalingValue(Zo.offset.y,n)})`},children:c.map((be,He)=>{const je=He===le,Qe=je?S.activeDot:S.dot;return a.jsx("button",{onClick:()=>de(He),className:`${r}-pagination-item`,style:{width:y(S.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:je?I:C,width:y(Qe)}})},He)})},`${b}-${x}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:A.scalingValue(w,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:c.map((be,He)=>a.jsx("div",{className:Rt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:He===le&&n,[`${r}-active`]:He===le}),style:{...l,width:"max-content",transitionDuration:`${Math.round($o/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":E,"--link-hover-color":E,position:"relative",top:A.scalingValue(ws.offset.y,n),left:A.scalingValue(ws.offset.x,n)},children:a.jsx(Zi,{content:be.imageCaption})})},He))})]})]})]})}function fd({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const VS=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19709
19709
|
import cn from 'classnames';
|
|
19710
19710
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
19711
19711
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -20886,14 +20886,14 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20886
20886
|
</svg>
|
|
20887
20887
|
);
|
|
20888
20888
|
}
|
|
20889
|
-
`,
|
|
20889
|
+
`,GS={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{assetId:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["assetId","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",assetId:"01M3QM74XESYN1HRYH9VRTZ5CK"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",assetId:"01M3QM74XERA3G7J0J00XVKEXX"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",assetId:"01M3QM74XEE2101QD8PM6E4JSA"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",assetId:"01M3QM74XEVZ9F59FC7M9BA63Q"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},XS={element:jS,id:"slider-2-0",name:"Slider 2.0",category:"galleries",version:1,defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},schema:GS,sourceCode:VS,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},go=300/1440,qS=8/1440,ti=.004;function US(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $s(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Cs(e,t,n,i,o="title-leading-gap"){const r=e??.01;return t===void 0||t>=r?{}:{[`--${n}-${o}`]:A.scalingValue((r-t)/2,i)}}function YS(e){return`
|
|
20890
20890
|
.${e}-wrapper {
|
|
20891
20891
|
box-sizing: border-box;
|
|
20892
20892
|
display: flex;
|
|
20893
20893
|
flex-direction: column;
|
|
20894
20894
|
position: relative;
|
|
20895
20895
|
width: 100%;
|
|
20896
|
-
min-height: ${
|
|
20896
|
+
min-height: ${US(48)};
|
|
20897
20897
|
}
|
|
20898
20898
|
.${e}-single-title-layer {
|
|
20899
20899
|
position: absolute;
|
|
@@ -21126,7 +21126,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
21126
21126
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
21127
21127
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
21128
21128
|
}
|
|
21129
|
-
`}const wp={"left-top":{horizontal:"left",vertical:"top"},"top-center":{horizontal:"center",vertical:"top"},"top-right":{horizontal:"right",vertical:"top"},"left-center":{horizontal:"left",vertical:"center"},center:{horizontal:"center",vertical:"center"},"right-center":{horizontal:"right",vertical:"center"},"left-bottom":{horizontal:"left",vertical:"bottom"},"bottom-center":{horizontal:"center",vertical:"bottom"},"right-bottom":{horizontal:"right",vertical:"bottom"}};function VS(e){return e in wp}function GS(e){if(e&&VS(e))return e;switch(e){case"center-top":return"top-center";case"right-top":return"top-right";case"top-left":return"left-top";case"center-bottom":return"bottom-center";case"bottom-left":return"left-bottom";case"bottom-right":return"right-bottom";case"center-center":return"center";case"left":return"left-center";case"right":return"right-center";case"top":return"left-top";default:return"center"}}function Gl(e){return wp[e]}const XS="rgba(28,31,34,0.9)",Zn=500,Oi="cubic-bezier(0.22, 1, 0.36, 1)",US=72,qS=50,YS={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},KS=[];function QS(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 ZS(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function JS(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function ew(e){if(!Array.isArray(e)||e.length===0)return[];if(QS(e)){const t=[];for(const n of e){const i=ZS(n);if(!i)continue;const o=JS(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.assetId?o:null})}return t}return e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ks(e){return e.type==="video"}function tw(e){e.pause(),e.removeAttribute("src"),e.load()}function Zr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function nw(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const iw=1140/1440;function ow(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function rw(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function aw(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function sw({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{tw(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c,style:i})}function lw({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:c,counterClassName:d,counterStyle:u,backgroundColor:p}){const y=i==="cover",v=s.useRef(null),g=s.useRef(null),m=s.useRef(null),x=s.useRef(0),b=s.useRef(0),M=s.useRef("none"),f=s.useRef(!1),S=s.useRef(!1),W=s.useRef(!1),q=s.useRef(null),[z,L]=s.useState(null),[_,G]=s.useState("opening"),[$,I]=s.useState(0),[D,E]=s.useState(0),[T,C]=s.useState(!1),[V,w]=s.useState(!1),[U,P]=s.useState(!1),A=s.useRef(n),j=t[n],ie=j?Ks(j):!1,ae=D!==0||T,O=s.useCallback(me=>{W.current=me,C(me)},[]),re=s.useCallback(()=>{q.current!==null&&(window.clearTimeout(q.current),q.current=null)},[]),N=s.useCallback(()=>{re(),q.current=window.setTimeout(()=>{re(),O(!1)},Zn+32)},[re,O]),le=s.useCallback(()=>{const me=v.current,xe=g.current;if(!me)return;const Ce=me.getBoundingClientRect(),h=Ce.width,Y=Ce.height;if(!h||!Y)return;if(i==="cover"){L({width:h,height:Y,left:Ce.left,top:Ce.top});return}if(!xe){L(Zr(me));return}const{width:Q,height:ne}=nw(xe);if(!Q||!ne){L(Zr(me));return}const ue=Q/ne,B=h/Y;if(ue>B){const R=h/ue;L({width:h,height:R,left:Ce.left,top:Ce.top+(Y-R)/2})}else{const R=Y*ue;L({width:R,height:Y,left:Ce.left+(h-R)/2,top:Ce.top})}},[i]);s.useEffect(()=>{le();const me=v.current;if(!me)return;const xe=new ResizeObserver(()=>le());return xe.observe(me),()=>xe.disconnect()},[le,n]),s.useEffect(()=>{_==="opening"&&z&&G("open")},[_,z]),s.useEffect(()=>{if(_!=="closing")return;const me=setTimeout(()=>r(),Zn);return()=>clearTimeout(me)},[_,r]),s.useEffect(()=>()=>{re()},[re]),s.useLayoutEffect(()=>{if(A.current===n)return;re(),I(0),E(0),O(!1),P(!1),w(!1),x.current=0,b.current=0,M.current="none",f.current=!1,m.current=null,S.current=!1;const me=v.current;me&&L(Zr(me)),A.current=n},[n,O,re]),s.useEffect(()=>{if(_!=="open")return;let me=null;const xe=()=>{me&&(document.removeEventListener("click",me,!0),me=null)},Ce=()=>{xe(),me=B=>{B.stopPropagation(),B.preventDefault(),xe()},document.addEventListener("click",me,!0)},h=B=>{re(),W.current=!1,C(!1),E(0),w(!1),f.current=!1,b.current=0,M.current="none";const R=v.current;R&&L(Zr(R)),B<0?c():l()},Y=B=>{if(Math.abs(B)>qS&&t.length>1){h(B);return}O(!0),E(0),N()},Q=B=>{if(B.touches.length!==1||W.current)return;const R=B.touches[0];S.current=!0,m.current={x:R.clientX,y:R.clientY},M.current="none",b.current=0,f.current=!1},ne=B=>{if(!m.current||B.touches.length!==1||W.current)return;const R=B.touches[0],ee=R.clientX-m.current.x,te=R.clientY-m.current.y;if(M.current==="none"){if(Math.abs(ee)<10&&Math.abs(te)<10)return;if(Math.abs(ee)>Math.abs(te)){if(t.length<=1)return;M.current="horizontal"}else if(te>0)M.current="vertical";else return}if(M.current==="horizontal"){f.current=!0,w(!0),b.current=ee,E(ee),B.preventDefault();return}M.current==="vertical"&&(f.current=!0,w(!0),x.current=te,I(te),B.preventDefault())},ue=()=>{if(!m.current)return;const B=M.current,R=f.current;if(R&&B==="horizontal")Y(b.current),Ce();else if(R&&B==="vertical")if(x.current>US){const te=window.innerHeight;x.current=te,P(!0),I(te),G("closing")}else x.current=0,I(0),Ce();else B==="horizontal"&&Math.abs(b.current)>0&&(Y(b.current),Ce());m.current=null,M.current="none",b.current=0,f.current=!1,w(!1)};return document.addEventListener("touchstart",Q,{passive:!0}),document.addEventListener("touchmove",ne,{passive:!1}),document.addEventListener("touchend",ue),document.addEventListener("touchcancel",ue),()=>{document.removeEventListener("touchstart",Q),document.removeEventListener("touchmove",ne),document.removeEventListener("touchend",ue),document.removeEventListener("touchcancel",ue),xe()}},[_,t.length,c,l,O,N,re]),s.useEffect(()=>{const me=xe=>{xe.key==="Escape"&&(xe.preventDefault(),xe.stopPropagation(),_!=="closing"&&G("closing"))};return window.addEventListener("keydown",me,!0),()=>window.removeEventListener("keydown",me,!0)},[_]);const J=()=>{_!=="closing"&&G("closing")},be=_==="open",Le=_==="closing",ye=$>0?Math.max(0,1-$/500):1,ce=$>0?Math.max(.35,1-$/500):1,K=me=>{if(me.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const xe=me.currentTarget.getBoundingClientRect(),Ce=me.clientY-xe.top,h=Math.min(52,xe.height*.2);if(!(Ce>xe.height-h)){if(me.clientX-xe.left<xe.width/2){l();return}c()}},se=me=>{if(t.length<=1)return;const xe=me.currentTarget.getBoundingClientRect(),Ce=me.clientX-xe.left,h=me.clientY-xe.top,Y=Math.min(52,xe.height*.2);if(h>xe.height-Y){me.currentTarget.style.cursor="default";return}me.currentTarget.style.cursor=Ce<xe.width/2?"w-resize":"e-resize"},pe=s.useCallback(me=>{me.propertyName!=="transform"||!W.current||(re(),O(!1))},[re,O]),fe=ae?`translateX(${D}px)`:$>0?`translateY(${$}px)`:void 0,we={position:"fixed",top:z==null?void 0:z.top,left:z==null?void 0:z.left,width:z==null?void 0:z.width,height:z==null?void 0:z.height,objectFit:i==="cover"?"cover":"contain",transform:fe,opacity:$>0?ce:_==="opening"||Le?0:1,transition:V&&!T?"none":T?`transform ${Zn}ms ${Oi}`:U?`transform ${Zn}ms ${Oi}, opacity ${Zn}ms ${Oi}`:_==="opening"||Le?`opacity ${Zn}ms ${Oi}`:"none",pointerEvents:ie&&be&&!ae?"auto":"none",touchAction:ie&&be?"none":void 0,zIndex:9998},Re=z?{position:"fixed",top:z.top,height:z.height,width:z.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:_==="open"?"none":void 0},onClick:J,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:be?ye:0,transition:V?"none":`opacity ${Zn}ms ${Oi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:y?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:be?1:0,transition:`opacity ${Zn}ms ${Oi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:be?1:0,transition:`opacity ${Zn}ms ${Oi}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),z&&j&&(ie?a.jsx(sw,{src:j.assetId,phase:_,mediaRef:g,mediaStyle:we,onLoadedMetadata:le,onClick:K,onMouseMove:se,onTransitionEnd:pe},`${n}-${j.assetId}`):a.jsx("img",{ref:g,src:j.assetId,alt:j.name,onLoad:le,onTransitionEnd:pe,style:we},`${n}-${j.assetId}`)),be&&Re&&t.length>1&&!ie&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Re,left:z.left,cursor:"w-resize",pointerEvents:ae?"none":"auto"},onClick:me=>{if(S.current){S.current=!1;return}me.stopPropagation(),l()}}),a.jsx("div",{style:{...Re,left:z.left+z.width/2,cursor:"e-resize",pointerEvents:ae?"none":"auto"},onClick:me=>{if(S.current){S.current=!1;return}me.stopPropagation(),c()}})]})]})}function yd({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:c=0,showPaddingAfter:d=!1,showControls:u=!1,onMediaClick:p}){const y=`${e}-gallery-${Ks(t)?"video":"image"}`,v=r.display==="cover",g=rw(r),m=_=>F.scalingValue(_,l??!1),x=n??po,b=o?{width:"100%",maxWidth:"100%"}:{width:m(x),maxWidth:"100%"},M=i?{borderRadius:m(i)}:{},f={...b,...v?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},...M},S={...v?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":m(x)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...v?{}:M},q={className:y,style:S,onClick:p?_=>{_.stopPropagation(),p()}:void 0},z=Math.max(c,ei),L=Ks(t)?a.jsx("video",{...q,src:t.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...q,src:t.assetId,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[v?a.jsx("div",{style:f,children:L}):L,d&&c>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:m(c)},"aria-hidden":"true"}),u&&d&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:m(z)}})]})}function cw({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:c,showControls:d,scaled:u,children:p}){const y=t==="a"?i:t==="c"?o:0,v=y>0||d;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"aria-hidden":"true"}),d&&t==="c"&&a.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),a.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"aria-hidden":"true"}),d&&t==="a"&&a.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function dw(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Jr({P:e,controlKey:t,scaled:n,height:i,paired:o,side:r}){return a.jsx("div",{"data-controls":t,...o?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{...r==="top"?{top:0}:{bottom:0},left:0,width:"100%",height:n(i)}})}function vd({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:c}){return a.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...r==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...r==="left"?{left:0}:{right:0},width:n(i),height:"100%",...c}})}function Ts({P:e,title:t,description:n,position:i,titleRef:o,titleClassName:r,titleContainerStyle:l,titleTextBoxStyle:c,titleStyle:d,descriptionClassName:u,descriptionStyle:p,descriptionPadding:y,showTextBoxOutline:v=!1,showDescriptionPaddingControl:g=!1,descriptionPaddingPaired:m=!1,topPaddingControl:x,bottomPaddingControl:b}){const M=s.useRef(null),[f,S]=s.useState(0),W=t??"",q=n??"",z=q.length>0,{horizontal:L,vertical:_}=Gl(i),G=_==="center"||_==="bottom",$=_==="bottom";s.useLayoutEffect(()=>{if(!G)return;const T=M.current;if(!T||typeof ResizeObserver>"u")return;const C=()=>S(T.offsetHeight);C();const V=new ResizeObserver(C);return V.observe(T),()=>V.disconnect()},[W,q,G]);const I=a.jsx("span",{className:`${e}-title-text`,style:d,children:W}),D=z?a.jsx("span",{className:u,style:p,children:q}):null,E=z?a.jsx("div",{className:`${e}-title-texts-gap`,style:{height:y},children:g&&a.jsx("div",{"data-controls":"titleDescriptionPadding",...m?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:"100%"}})}):null;return a.jsx("div",{ref:T=>{M.current=T,o(T)},className:[r,`${e}-title-h-${L}`,`${e}-title-v-${_}`].join(" "),style:{...G?{[`--${e}-title-height`]:`${f}px`}:{},...l},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:c,children:[x,a.jsx("div",{className:v?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("div",{className:`${e}-title-texts`,children:$?a.jsxs(a.Fragment,{children:[D,E,I]}):a.jsxs(a.Fragment,{children:[I,E,D]})})}),b]})})}const xd=45;function bd(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const r=parseFloat(o);if(!Number.isNaN(r))return r}i=i.parentElement}return n}function uw(e){const t=bd(e,"--cntrl-viewport-height",window.innerHeight),n=bd(e,"--cntrl-article-top",0);return{top:n,height:t,centerY:n+t/2}}function pw(e,t,n){const{vertical:i}=Gl(t),{top:o,height:r,centerY:l}=uw(n);if(i==="top"){const d=n&&parseFloat(getComputedStyle(n).top)||o;return Math.abs(e.top-d)}if(i==="bottom")return Math.abs(e.bottom-(o+r));const c=e.top+e.height/2;return Math.abs(c-l)}function gw(e,t,n){const i=Array.from({length:t},(l,c)=>{const d=e.current[c];if(!d)return 0;const u=d.getBoundingClientRect(),p=pw(u,n,d);return Math.exp(-(p*p)/(2*xd*xd))});let o=0,r=-1;return i.forEach((l,c)=>{l>r&&(r=l,o=c)}),{opacities:i,dominantIndex:o}}function mw(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(d,u)=>u===0?1:0),dominantIndex:0}));return s.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let d=0;const u=()=>{l(gw(i,e,n))},p=()=>{d||(d=window.requestAnimationFrame(()=>{d=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{d&&window.cancelAnimationFrame(d),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:d=>u=>{i.current[d]=u},opacities:o,dominantIndex:r}}function Sd(e,t){const[n,i]=s.useState(e),o=s.useRef(e);return s.useEffect(()=>{if(!t){o.current=e,i(e);return}const r=Array.from(o.current),l=Array.from(e),c=Math.max(r.length,l.length);if(c===0||o.current===e)return;let d=0;const u=window.setInterval(()=>{d+=1;const p=[...l.slice(0,d),...r.slice(d)].join("");o.current=p,i(p),d>=c&&window.clearInterval(u)},70);return()=>window.clearInterval(u)},[t,e]),n}function hw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var dt,Lt;const{prefix:l}=F.useScopedStyles(),c=s.useMemo(()=>jS(l),[l]),d=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",y=(e==null?void 0:e.imgWidth)??po,v=(e==null?void 0:e.titleWidth)??iw,g=ow(e==null?void 0:e.imageDisplay),m=(e==null?void 0:e.cornerRadius)??BS,x=GS(e==null?void 0:e.position),{horizontal:b,vertical:M}=Gl(x),f=(e==null?void 0:e.titleTopPadding)??0,S=(e==null?void 0:e.titleBottomPadding)??0,W=(e==null?void 0:e.titleLeftPadding)??0,q=(e==null?void 0:e.titleRightPadding)??0,z=(e==null?void 0:e.titleDescriptionPadding)??0,L=dw(e==null?void 0:e.transition),_=(e==null?void 0:e.lightbox)??"on",G=p==="b",$=L==="fade"||L==="retype",{setTitleRef:I,dominantIndex:D}=mw(d.length,$,x),E=((dt=d[D])==null?void 0:dt.title)??"",T=((Lt=d[D])==null?void 0:Lt.description)??"",C=Sd(E,L==="retype"),V=Sd(T,L==="retype"),w=L==="fade"||L==="retype",U=L==="retype"?C:E,P=L==="retype"?V:T,A=G?void 0:{width:F.scalingValue(y,n??!1)},j=_==="on"&&(!n||i||o),ie=o??!1,ae=(e==null?void 0:e.galleryPaddingRight)??0,O=(e==null?void 0:e.galleryPaddingLeft)??0,re=(e==null?void 0:e.galleryPaddingBetween)??0,N=St=>F.scalingValue(St,n??!1),J={width:N(v)},be=p==="a"?ae:O,Le=G?{width:"100%"}:{width:`calc(100% - ${N(y)} - ${N(be)})`,...p==="c"?{marginLeft:"auto"}:{}},ye=Math.max(ae,ei),ce=Math.max(O,ei),K=Math.max(re,ei),se=Math.max(f,ei),pe=Math.max(S,ei),fe=Math.max(W,ei),we=Math.max(q,ei),Re=Math.max(z,ei),me=Math.max(0,(u??1)-(y??po)),xe=p==="a"?Math.max(0,(u??1)-(y??po)-ae):p==="c"?Math.max(0,(u??1)-(y??po)-O):p==="b"?u??1:1,Ce=ie&&M==="top",h=ie&&M==="bottom",Y=ie&&b==="left",Q=ie&&b==="right",ne=d.length>1,ue=G?void 0:N((p==="c"?O:ae)+(y??po)),B=p==="c"&&ue?{left:ue}:void 0,R=p==="a"&&ue?{right:ue}:void 0,ee=G?{left:0,width:"100%"}:p==="a"?{right:N(ae),width:N(y)}:{left:N(O),width:N(y)},{titleColor:te,titleFontFamily:ge,titleFontSettings:X,titleFontSize:Pe,titleLineHeight:Se,titleLetterSpacing:Z,titleWordSpacing:He,titleAlign:We,titleTextAppearance:ot,descriptionColor:qe,descriptionFontFamily:tt,descriptionFontSettings:et,descriptionFontSize:Ge,descriptionLineHeight:ve,descriptionLetterSpacing:_e,descriptionWordSpacing:ze,descriptionAlign:Qe,descriptionTextAppearance:$e,lightboxCounterColor:Ne,lightboxCounterFontFamily:Ye,lightboxCounterFontSettings:Ze,lightboxCounterFontSize:st,lightboxCounterLineHeight:it,lightboxCounterLetterSpacing:Oe,lightboxCounterWordSpacing:Ae,lightboxCounterTextAppearance:mt}=e??{},Be={fontSettings:{fontFamily:ge,fontWeight:(X==null?void 0:X.fontWeight)??400,fontStyle:(X==null?void 0:X.fontStyle)??"normal"},fontSize:Pe??.01,lineHeight:Se,letterSpacing:Z??0,wordSpacing:He??0,textAlign:We??"left",textAppearance:ot,color:te??"#000000"},Ue=un(en(Be,n)),ct=J,he={...Cs(Pe,Se,l,n),...Cs(Ge,ve,l,n,"description-leading-gap")},Me=$s(Pe,Se,`${l}-title`,`${l}-text-tight-leading`),nt={fontSettings:{fontFamily:tt,fontWeight:(et==null?void 0:et.fontWeight)??400,fontStyle:(et==null?void 0:et.fontStyle)??"normal"},fontSize:Ge??.01,lineHeight:ve,letterSpacing:_e??0,wordSpacing:ze??0,textAlign:Qe??"left",textAppearance:$e,color:qe??"#000000"},pt=un(en(nt,n)),Ve=$s(Ge,ve,`${l}-description-text`,`${l}-description-tight-leading`),vt=N(ie?Re:z),Pt={fontSettings:{fontFamily:Ye,fontWeight:(Ze==null?void 0:Ze.fontWeight)??400,fontStyle:(Ze==null?void 0:Ze.fontStyle)??"normal"},fontSize:st??.01,lineHeight:it,letterSpacing:Oe??0,wordSpacing:Ae??0,textAppearance:mt,color:Ne??"#DEDDDD"},wt={...un(en(Pt,n)),...Cs(st,it,l,n)},Vt=$s(st,it,`${l}-lightbox-counter`,`${l}-text-tight-leading`),jt=F.buildColorVars(l,{titleColor:te??"#000000",descriptionColor:qe??"#000000",lightboxCounterColor:Ne??"#DEDDDD"},YS,KS),Yt=s.useRef(null),[Kt,Rt]=s.useState(!1),[zt,on]=s.useState([]),[xt,yt]=s.useState(0),ke=s.useCallback((St,ht)=>{j&&(on(St),yt(ht),Rt(!0))},[j]),Je=s.useCallback(()=>{Rt(!1)},[]),rt=s.useMemo(()=>{const St={...jt},ht=Yt.current?getComputedStyle(Yt.current).getPropertyValue("--cntrl-article-width").trim():"";return ht&&(St["--cntrl-article-width"]=ht),St},[jt,Kt]);return s.useEffect(()=>{if(!Kt||_!=="on"||typeof document>"u")return;const St=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=St}},[Kt,_]),s.useEffect(()=>{!n||o||i||Rt(!1)},[n,o,i]),s.useEffect(()=>{_==="off"&&Rt(!1)},[_]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{style:jt,children:a.jsxs("div",{ref:Yt,className:`${l}-wrapper`,style:{width:F.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:M==="top"?N(f):void 0,[`--${l}-title-bottom-padding`]:M==="bottom"?N(S):void 0,[`--${l}-title-left-padding`]:b==="left"?N(W):void 0,[`--${l}-title-right-padding`]:b==="right"?N(q):void 0},children:[w&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Ts,{P:l,title:U,description:P,position:x,titleRef:()=>{},titleClassName:`${Me} ${l}-single-title`,titleContainerStyle:{...he,...Le},titleTextBoxStyle:ct,titleStyle:Ue,descriptionClassName:Ve,descriptionStyle:pt,descriptionPadding:vt,showTextBoxOutline:ie,showDescriptionPaddingControl:ie,topPaddingControl:Ce?Jr({P:l,controlKey:"titleTopPadding",scaled:N,height:se,paired:!1,side:"top"}):void 0,bottomPaddingControl:h?Jr({P:l,controlKey:"titleBottomPadding",scaled:N,height:pe,paired:!1,side:"bottom"}):void 0})}),d.map((St,ht)=>{const Wt=ew(St.gallery),Tt=ht<d.length-1,Ot=Wt.filter(kt=>kt.lightboxMedia).map(kt=>kt.lightboxMedia),Gt={P:l,position:x,titleRef:I(ht),titleClassName:Me,titleContainerStyle:he,titleTextBoxStyle:w?{maxWidth:"100%"}:ct,titleStyle:Ue,descriptionClassName:Ve,descriptionStyle:pt,descriptionPadding:vt,showTextBoxOutline:ie&&!w,showDescriptionPaddingControl:ie&&!w,descriptionPaddingPaired:ne,topPaddingControl:Ce&&!w?Jr({P:l,controlKey:"titleTopPadding",scaled:N,height:se,paired:ne,side:"top"}):void 0,bottomPaddingControl:h&&!w?Jr({P:l,controlKey:"titleBottomPadding",scaled:N,height:pe,paired:ne,side:"bottom"}):void 0};return a.jsxs("div",{"data-item-index":ht,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Tt?N(re):void 0},children:[Y&&vd({P:l,controlKey:"titleLeftPadding",scaled:N,width:fe,maxFraction:xe,side:"left",paired:ne,anchorStyle:B}),Q&&vd({P:l,controlKey:"titleRightPadding",scaled:N,width:we,maxFraction:xe,side:"right",paired:ne,anchorStyle:R}),ie&&Tt&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:N(K),...ee}}),G?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Wt.map(({displayMedia:kt,lightboxMedia:_t},Ft)=>{const ut=_t?Ot.findIndex(H=>H.assetId===_t.assetId):-1;return a.jsx(yd,{P:l,media:kt,imgWidth:y||void 0,cornerRadius:m||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:re,showPaddingAfter:Ft<Wt.length-1,showControls:ie,onMediaClick:j&&ut>=0?()=>ke(Ot,ut):void 0},`${kt.assetId}-${Ft}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Ts,{...Gt,title:w?"":St.title,description:w?"":St.description})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Ts,{...Gt,title:w?"":St.title,description:w?"":St.description}),Wt.length>0&&a.jsx(cw,{P:l,layoutType:p,galleryWidthStyle:A,galleryPaddingRight:ae,galleryPaddingLeft:O,galleryPaddingRightWidth:ye,galleryPaddingLeftWidth:ce,galleryPaddingMaxFraction:me,showControls:ie,scaled:N,children:Wt.map(({displayMedia:kt,lightboxMedia:_t},Ft)=>{const ut=_t?Ot.findIndex(H=>H.assetId===_t.assetId):-1;return a.jsx(yd,{P:l,media:kt,cornerRadius:m||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:re,showPaddingAfter:Ft<Wt.length-1,showControls:ie,onMediaClick:j&&ut>=0?()=>ke(Ot,ut):void 0},`${kt.assetId}-${Ft}`)})})]})]},ht)})]})}),Kt&&_==="on"&&typeof document<"u"&&e&&(()=>{const St=(r?document.getElementById(r):null)??document.body;return Xn.createPortal(a.jsx("div",{style:rt,"data-selection":"none",children:a.jsx(lw,{prefix:l,items:zt,index:xt,imageDisplay:aw(e.lightboxImageDisplay),isEditor:n,onClose:Je,onPrev:()=>yt(ht=>(ht-1+zt.length)%zt.length),onNext:()=>yt(ht=>(ht+1)%zt.length),counterClassName:Vt,counterStyle:wt,backgroundColor:e.backgroundColor??XS})}),St)})()]})}const fw=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21129
|
+
`}const Pp={"left-top":{horizontal:"left",vertical:"top"},"top-center":{horizontal:"center",vertical:"top"},"top-right":{horizontal:"right",vertical:"top"},"left-center":{horizontal:"left",vertical:"center"},center:{horizontal:"center",vertical:"center"},"right-center":{horizontal:"right",vertical:"center"},"left-bottom":{horizontal:"left",vertical:"bottom"},"bottom-center":{horizontal:"center",vertical:"bottom"},"right-bottom":{horizontal:"right",vertical:"bottom"}};function KS(e){return e in Pp}function QS(e){if(e&&KS(e))return e;switch(e){case"center-top":return"top-center";case"right-top":return"top-right";case"top-left":return"left-top";case"center-bottom":return"bottom-center";case"bottom-left":return"left-bottom";case"bottom-right":return"right-bottom";case"center-center":return"center";case"left":return"left-center";case"right":return"right-center";case"top":return"left-top";default:return"center"}}function Gl(e){return Pp[e]}const ZS="rgba(28,31,34,0.9)",Jn=500,zi="cubic-bezier(0.22, 1, 0.36, 1)",JS=72,ew=50,tw={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},nw=[];function iw(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 ow(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function rw(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function aw(e){if(!Array.isArray(e)||e.length===0)return[];if(iw(e)){const t=[];for(const n of e){const i=ow(n);if(!i)continue;const o=rw(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.assetId?o:null})}return t}return e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ys(e){return e.type==="video"}function sw(e){e.pause(),e.removeAttribute("src"),e.load()}function Zr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function lw(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const cw=1140/1440;function dw(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function uw(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function pw(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function mw({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{sw(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c,style:i})}function gw({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:c,counterClassName:d,counterStyle:u,backgroundColor:p}){const v=i==="cover",x=s.useRef(null),m=s.useRef(null),h=s.useRef(null),b=s.useRef(0),S=s.useRef(0),M=s.useRef("none"),y=s.useRef(!1),$=s.useRef(!1),R=s.useRef(!1),X=s.useRef(null),[B,O]=s.useState(null),[N,z]=s.useState("opening"),[C,I]=s.useState(0),[j,E]=s.useState(0),[w,L]=s.useState(!1),[V,_]=s.useState(!1),[K,P]=s.useState(!1),f=s.useRef(n),U=t[n],te=U?Ys(U):!1,ce=j!==0||w,F=s.useCallback(fe=>{R.current=fe,L(fe)},[]),ie=s.useCallback(()=>{X.current!==null&&(window.clearTimeout(X.current),X.current=null)},[]),T=s.useCallback(()=>{ie(),X.current=window.setTimeout(()=>{ie(),F(!1)},Jn+32)},[ie,F]),le=s.useCallback(()=>{const fe=x.current,ve=m.current;if(!fe)return;const xe=fe.getBoundingClientRect(),g=xe.width,G=xe.height;if(!g||!G)return;if(i==="cover"){O({width:g,height:G,left:xe.left,top:xe.top});return}if(!ve){O(Zr(fe));return}const{width:Q,height:ne}=lw(ve);if(!Q||!ne){O(Zr(fe));return}const ue=Q/ne,q=g/G;if(ue>q){const D=g/ue;O({width:g,height:D,left:xe.left,top:xe.top+(G-D)/2})}else{const D=G*ue;O({width:D,height:G,left:xe.left+(g-D)/2,top:xe.top})}},[i]);s.useEffect(()=>{le();const fe=x.current;if(!fe)return;const ve=new ResizeObserver(()=>le());return ve.observe(fe),()=>ve.disconnect()},[le,n]),s.useEffect(()=>{N==="opening"&&B&&z("open")},[N,B]),s.useEffect(()=>{if(N!=="closing")return;const fe=setTimeout(()=>r(),Jn);return()=>clearTimeout(fe)},[N,r]),s.useEffect(()=>()=>{ie()},[ie]),s.useLayoutEffect(()=>{if(f.current===n)return;ie(),I(0),E(0),F(!1),P(!1),_(!1),b.current=0,S.current=0,M.current="none",y.current=!1,h.current=null,$.current=!1;const fe=x.current;fe&&O(Zr(fe)),f.current=n},[n,F,ie]),s.useEffect(()=>{if(N!=="open")return;let fe=null;const ve=()=>{fe&&(document.removeEventListener("click",fe,!0),fe=null)},xe=()=>{ve(),fe=q=>{q.stopPropagation(),q.preventDefault(),ve()},document.addEventListener("click",fe,!0)},g=q=>{ie(),R.current=!1,L(!1),E(0),_(!1),y.current=!1,S.current=0,M.current="none";const D=x.current;D&&O(Zr(D)),q<0?c():l()},G=q=>{if(Math.abs(q)>ew&&t.length>1){g(q);return}F(!0),E(0),T()},Q=q=>{if(q.touches.length!==1||R.current)return;const D=q.touches[0];$.current=!0,h.current={x:D.clientX,y:D.clientY},M.current="none",S.current=0,y.current=!1},ne=q=>{if(!h.current||q.touches.length!==1||R.current)return;const D=q.touches[0],se=D.clientX-h.current.x,Y=D.clientY-h.current.y;if(M.current==="none"){if(Math.abs(se)<10&&Math.abs(Y)<10)return;if(Math.abs(se)>Math.abs(Y)){if(t.length<=1)return;M.current="horizontal"}else if(Y>0)M.current="vertical";else return}if(M.current==="horizontal"){y.current=!0,_(!0),S.current=se,E(se),q.preventDefault();return}M.current==="vertical"&&(y.current=!0,_(!0),b.current=Y,I(Y),q.preventDefault())},ue=()=>{if(!h.current)return;const q=M.current,D=y.current;if(D&&q==="horizontal")G(S.current),xe();else if(D&&q==="vertical")if(b.current>JS){const Y=window.innerHeight;b.current=Y,P(!0),I(Y),z("closing")}else b.current=0,I(0),xe();else q==="horizontal"&&Math.abs(S.current)>0&&(G(S.current),xe());h.current=null,M.current="none",S.current=0,y.current=!1,_(!1)};return document.addEventListener("touchstart",Q,{passive:!0}),document.addEventListener("touchmove",ne,{passive:!1}),document.addEventListener("touchend",ue),document.addEventListener("touchcancel",ue),()=>{document.removeEventListener("touchstart",Q),document.removeEventListener("touchmove",ne),document.removeEventListener("touchend",ue),document.removeEventListener("touchcancel",ue),ve()}},[N,t.length,c,l,F,T,ie]),s.useEffect(()=>{const fe=ve=>{ve.key==="Escape"&&(ve.preventDefault(),ve.stopPropagation(),N!=="closing"&&z("closing"))};return window.addEventListener("keydown",fe,!0),()=>window.removeEventListener("keydown",fe,!0)},[N]);const J=()=>{N!=="closing"&&z("closing")},Se=N==="open",Le=N==="closing",me=C>0?Math.max(0,1-C/500):1,ye=C>0?Math.max(.35,1-C/500):1,ee=fe=>{if(fe.stopPropagation(),$.current){$.current=!1;return}if(t.length<=1)return;const ve=fe.currentTarget.getBoundingClientRect(),xe=fe.clientY-ve.top,g=Math.min(52,ve.height*.2);if(!(xe>ve.height-g)){if(fe.clientX-ve.left<ve.width/2){l();return}c()}},oe=fe=>{if(t.length<=1)return;const ve=fe.currentTarget.getBoundingClientRect(),xe=fe.clientX-ve.left,g=fe.clientY-ve.top,G=Math.min(52,ve.height*.2);if(g>ve.height-G){fe.currentTarget.style.cursor="default";return}fe.currentTarget.style.cursor=xe<ve.width/2?"w-resize":"e-resize"},re=s.useCallback(fe=>{fe.propertyName!=="transform"||!R.current||(ie(),F(!1))},[ie,F]),ge=ce?`translateX(${j}px)`:C>0?`translateY(${C}px)`:void 0,we={position:"fixed",top:B==null?void 0:B.top,left:B==null?void 0:B.left,width:B==null?void 0:B.width,height:B==null?void 0:B.height,objectFit:i==="cover"?"cover":"contain",transform:ge,opacity:C>0?ye:N==="opening"||Le?0:1,transition:V&&!w?"none":w?`transform ${Jn}ms ${zi}`:K?`transform ${Jn}ms ${zi}, opacity ${Jn}ms ${zi}`:N==="opening"||Le?`opacity ${Jn}ms ${zi}`:"none",pointerEvents:te&&Se&&!ce?"auto":"none",touchAction:te&&Se?"none":void 0,zIndex:9998},Ae=B?{position:"fixed",top:B.top,height:B.height,width:B.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:N==="open"?"none":void 0},onClick:J,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:Se?me:0,transition:V?"none":`opacity ${Jn}ms ${zi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:v?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:x,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Se?1:0,transition:`opacity ${Jn}ms ${zi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:x,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Se?1:0,transition:`opacity ${Jn}ms ${zi}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),B&&U&&(te?a.jsx(mw,{src:U.assetId,phase:N,mediaRef:m,mediaStyle:we,onLoadedMetadata:le,onClick:ee,onMouseMove:oe,onTransitionEnd:re},`${n}-${U.assetId}`):a.jsx("img",{ref:m,src:U.assetId,alt:U.name,onLoad:le,onTransitionEnd:re,style:we},`${n}-${U.assetId}`)),Se&&Ae&&t.length>1&&!te&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ae,left:B.left,cursor:"w-resize",pointerEvents:ce?"none":"auto"},onClick:fe=>{if($.current){$.current=!1;return}fe.stopPropagation(),l()}}),a.jsx("div",{style:{...Ae,left:B.left+B.width/2,cursor:"e-resize",pointerEvents:ce?"none":"auto"},onClick:fe=>{if($.current){$.current=!1;return}fe.stopPropagation(),c()}})]})]})}function yd({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:c=0,showPaddingAfter:d=!1,showControls:u=!1,onMediaClick:p}){const v=`${e}-gallery-${Ys(t)?"video":"image"}`,x=r.display==="cover",m=uw(r),h=N=>A.scalingValue(N,l??!1),b=n??go,S=o?{width:"100%",maxWidth:"100%"}:{width:h(b),maxWidth:"100%"},M=i?{borderRadius:h(i)}:{},y={...S,...x?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...M},$={...x?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(b)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...x?{}:M},X={className:v,style:$,onClick:p?N=>{N.stopPropagation(),p()}:void 0},B=Math.max(c,ti),O=Ys(t)?a.jsx("video",{...X,src:t.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...X,src:t.assetId,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[x?a.jsx("div",{style:y,children:O}):O,d&&c>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(c)},"aria-hidden":"true"}),u&&d&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:h(B)}})]})}function hw({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:c,showControls:d,scaled:u,children:p}){const v=t==="a"?i:t==="c"?o:0,x=v>0||d;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&x&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),d&&t==="c"&&a.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),a.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&x&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),d&&t==="a"&&a.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function fw(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Jr({P:e,controlKey:t,scaled:n,height:i,paired:o,side:r}){return a.jsx("div",{"data-controls":t,...o?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{...r==="top"?{top:0}:{bottom:0},left:0,width:"100%",height:n(i)}})}function vd({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:c}){return a.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...r==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...r==="left"?{left:0}:{right:0},width:n(i),height:"100%",...c}})}function Ts({P:e,title:t,description:n,position:i,titleRef:o,titleClassName:r,titleContainerStyle:l,titleTextBoxStyle:c,titleStyle:d,descriptionClassName:u,descriptionStyle:p,descriptionPadding:v,showTextBoxOutline:x=!1,showDescriptionPaddingControl:m=!1,descriptionPaddingPaired:h=!1,topPaddingControl:b,bottomPaddingControl:S}){const M=s.useRef(null),[y,$]=s.useState(0),R=t??"",X=n??"",B=X.length>0,{horizontal:O,vertical:N}=Gl(i),z=N==="center"||N==="bottom",C=N==="bottom";s.useLayoutEffect(()=>{if(!z)return;const w=M.current;if(!w||typeof ResizeObserver>"u")return;const L=()=>$(w.offsetHeight);L();const V=new ResizeObserver(L);return V.observe(w),()=>V.disconnect()},[R,X,z]);const I=a.jsx("span",{className:`${e}-title-text`,style:d,children:R}),j=B?a.jsx("span",{className:u,style:p,children:X}):null,E=B?a.jsx("div",{className:`${e}-title-texts-gap`,style:{height:v},children:m&&a.jsx("div",{"data-controls":"titleDescriptionPadding",...h?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:"100%"}})}):null;return a.jsx("div",{ref:w=>{M.current=w,o(w)},className:[r,`${e}-title-h-${O}`,`${e}-title-v-${N}`].join(" "),style:{...z?{[`--${e}-title-height`]:`${y}px`}:{},...l},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:c,children:[b,a.jsx("div",{className:x?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("div",{className:`${e}-title-texts`,children:C?a.jsxs(a.Fragment,{children:[j,E,I]}):a.jsxs(a.Fragment,{children:[I,E,j]})})}),S]})})}const xd=45;function bd(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const r=parseFloat(o);if(!Number.isNaN(r))return r}i=i.parentElement}return n}function yw(e){const t=bd(e,"--cntrl-viewport-height",window.innerHeight),n=bd(e,"--cntrl-article-top",0);return{top:n,height:t,centerY:n+t/2}}function vw(e,t,n){const{vertical:i}=Gl(t),{top:o,height:r,centerY:l}=yw(n);if(i==="top"){const d=n&&parseFloat(getComputedStyle(n).top)||o;return Math.abs(e.top-d)}if(i==="bottom")return Math.abs(e.bottom-(o+r));const c=e.top+e.height/2;return Math.abs(c-l)}function xw(e,t,n){const i=Array.from({length:t},(l,c)=>{const d=e.current[c];if(!d)return 0;const u=d.getBoundingClientRect(),p=vw(u,n,d);return Math.exp(-(p*p)/(2*xd*xd))});let o=0,r=-1;return i.forEach((l,c)=>{l>r&&(r=l,o=c)}),{opacities:i,dominantIndex:o}}function bw(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(d,u)=>u===0?1:0),dominantIndex:0}));return s.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let d=0;const u=()=>{l(xw(i,e,n))},p=()=>{d||(d=window.requestAnimationFrame(()=>{d=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{d&&window.cancelAnimationFrame(d),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:d=>u=>{i.current[d]=u},opacities:o,dominantIndex:r}}function Sd(e,t){const[n,i]=s.useState(e),o=s.useRef(e);return s.useEffect(()=>{if(!t){o.current=e,i(e);return}const r=Array.from(o.current),l=Array.from(e),c=Math.max(r.length,l.length);if(c===0||o.current===e)return;let d=0;const u=window.setInterval(()=>{d+=1;const p=[...l.slice(0,d),...r.slice(d)].join("");o.current=p,i(p),d>=c&&window.clearInterval(u)},70);return()=>window.clearInterval(u)},[t,e]),n}function Sw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var st,At;const{prefix:l}=A.useScopedStyles(),c=s.useMemo(()=>YS(l),[l]),d=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",v=(e==null?void 0:e.imgWidth)??go,x=(e==null?void 0:e.titleWidth)??cw,m=dw(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??qS,b=QS(e==null?void 0:e.position),{horizontal:S,vertical:M}=Gl(b),y=(e==null?void 0:e.titleTopPadding)??0,$=(e==null?void 0:e.titleBottomPadding)??0,R=(e==null?void 0:e.titleLeftPadding)??0,X=(e==null?void 0:e.titleRightPadding)??0,B=(e==null?void 0:e.titleDescriptionPadding)??0,O=fw(e==null?void 0:e.transition),N=(e==null?void 0:e.lightbox)??"on",z=p==="b",C=O==="fade"||O==="retype",{setTitleRef:I,dominantIndex:j}=bw(d.length,C,b),E=((st=d[j])==null?void 0:st.title)??"",w=((At=d[j])==null?void 0:At.description)??"",L=Sd(E,O==="retype"),V=Sd(w,O==="retype"),_=O==="fade"||O==="retype",K=O==="retype"?L:E,P=O==="retype"?V:w,f=z?void 0:{width:A.scalingValue(v,n??!1)},U=N==="on"&&(!n||i||o),te=o??!1,ce=(e==null?void 0:e.galleryPaddingRight)??0,F=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,T=St=>A.scalingValue(St,n??!1),J={width:T(x)},Se=p==="a"?ce:F,Le=z?{width:"100%"}:{width:`calc(100% - ${T(v)} - ${T(Se)})`,...p==="c"?{marginLeft:"auto"}:{}},me=Math.max(ce,ti),ye=Math.max(F,ti),ee=Math.max(ie,ti),oe=Math.max(y,ti),re=Math.max($,ti),ge=Math.max(R,ti),we=Math.max(X,ti),Ae=Math.max(B,ti),fe=Math.max(0,(u??1)-(v??go)),ve=p==="a"?Math.max(0,(u??1)-(v??go)-ce):p==="c"?Math.max(0,(u??1)-(v??go)-F):p==="b"?u??1:1,xe=te&&M==="top",g=te&&M==="bottom",G=te&&S==="left",Q=te&&S==="right",ne=d.length>1,ue=z?void 0:T((p==="c"?F:ce)+(v??go)),q=p==="c"&&ue?{left:ue}:void 0,D=p==="a"&&ue?{right:ue}:void 0,se=z?{left:0,width:"100%"}:p==="a"?{right:T(ce),width:T(v)}:{left:T(F),width:T(v)},{titleColor:Y,titleFontFamily:pe,titleFontSettings:H,titleFontSize:Ie,titleLineHeight:de,titleLetterSpacing:Z,titleWordSpacing:Ne,titleAlign:Oe,titleTextAppearance:Je,descriptionColor:De,descriptionFontFamily:Ze,descriptionFontSettings:at,descriptionFontSize:Xe,descriptionLineHeight:be,descriptionLetterSpacing:He,descriptionWordSpacing:je,descriptionAlign:Qe,descriptionTextAppearance:Ce,lightboxCounterColor:_e,lightboxCounterFontFamily:Ue,lightboxCounterFontSettings:Ye,lightboxCounterFontSize:lt,lightboxCounterLineHeight:it,lightboxCounterLetterSpacing:qe,lightboxCounterWordSpacing:Ee,lightboxCounterTextAppearance:pt}=e??{},ke={fontSettings:{fontFamily:pe,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:Ie??.01,lineHeight:de,letterSpacing:Z??0,wordSpacing:Ne??0,textAlign:Oe??"left",textAppearance:Je,color:Y??"#000000"},Ve=pn(nn(ke,n)),ct=J,ot={...Cs(Ie,de,l,n),...Cs(Xe,be,l,n,"description-leading-gap")},xt=$s(Ie,de,`${l}-title`,`${l}-text-tight-leading`),Pt={fontSettings:{fontFamily:Ze,fontWeight:(at==null?void 0:at.fontWeight)??400,fontStyle:(at==null?void 0:at.fontStyle)??"normal"},fontSize:Xe??.01,lineHeight:be,letterSpacing:He??0,wordSpacing:je??0,textAlign:Qe??"left",textAppearance:Ce,color:De??"#000000"},Vt=pn(nn(Pt,n)),vt=$s(Xe,be,`${l}-description-text`,`${l}-description-tight-leading`),Mt=T(te?Ae:B),Ht={fontSettings:{fontFamily:Ue,fontWeight:(Ye==null?void 0:Ye.fontWeight)??400,fontStyle:(Ye==null?void 0:Ye.fontStyle)??"normal"},fontSize:lt??.01,lineHeight:it,letterSpacing:qe??0,wordSpacing:Ee??0,textAppearance:pt,color:_e??"#DEDDDD"},kt={...pn(nn(Ht,n)),...Cs(lt,it,l,n)},Pe=$s(lt,it,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Be=A.buildColorVars(l,{titleColor:Y??"#000000",descriptionColor:De??"#000000",lightboxCounterColor:_e??"#DEDDDD"},tw,nw),ft=s.useRef(null),[$t,et]=s.useState(!1),[Et,Xt]=s.useState([]),[mt,gt]=s.useState(0),Re=s.useCallback((St,ht)=>{U&&(Xt(St),gt(ht),et(!0))},[U]),tt=s.useCallback(()=>{et(!1)},[]),nt=s.useMemo(()=>{const St={...Be},ht=ft.current?getComputedStyle(ft.current).getPropertyValue("--cntrl-article-width").trim():"";return ht&&(St["--cntrl-article-width"]=ht),St},[Be,$t]);return s.useEffect(()=>{if(!$t||N!=="on"||typeof document>"u")return;const St=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=St}},[$t,N]),s.useEffect(()=>{!n||o||i||et(!1)},[n,o,i]),s.useEffect(()=>{N==="off"&&et(!1)},[N]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{style:Be,children:a.jsxs("div",{ref:ft,className:`${l}-wrapper`,style:{width:A.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:M==="top"?T(y):void 0,[`--${l}-title-bottom-padding`]:M==="bottom"?T($):void 0,[`--${l}-title-left-padding`]:S==="left"?T(R):void 0,[`--${l}-title-right-padding`]:S==="right"?T(X):void 0},children:[_&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Ts,{P:l,title:K,description:P,position:b,titleRef:()=>{},titleClassName:`${xt} ${l}-single-title`,titleContainerStyle:{...ot,...Le},titleTextBoxStyle:ct,titleStyle:Ve,descriptionClassName:vt,descriptionStyle:Vt,descriptionPadding:Mt,showTextBoxOutline:te,showDescriptionPaddingControl:te,topPaddingControl:xe?Jr({P:l,controlKey:"titleTopPadding",scaled:T,height:oe,paired:!1,side:"top"}):void 0,bottomPaddingControl:g?Jr({P:l,controlKey:"titleBottomPadding",scaled:T,height:re,paired:!1,side:"bottom"}):void 0})}),d.map((St,ht)=>{const Dt=aw(St.gallery),Ct=ht<d.length-1,qt=Dt.filter(Nt=>Nt.lightboxMedia).map(Nt=>Nt.lightboxMedia),jt={P:l,position:b,titleRef:I(ht),titleClassName:xt,titleContainerStyle:ot,titleTextBoxStyle:_?{maxWidth:"100%"}:ct,titleStyle:Ve,descriptionClassName:vt,descriptionStyle:Vt,descriptionPadding:Mt,showTextBoxOutline:te&&!_,showDescriptionPaddingControl:te&&!_,descriptionPaddingPaired:ne,topPaddingControl:xe&&!_?Jr({P:l,controlKey:"titleTopPadding",scaled:T,height:oe,paired:ne,side:"top"}):void 0,bottomPaddingControl:g&&!_?Jr({P:l,controlKey:"titleBottomPadding",scaled:T,height:re,paired:ne,side:"bottom"}):void 0};return a.jsxs("div",{"data-item-index":ht,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Ct?T(ie):void 0},children:[G&&vd({P:l,controlKey:"titleLeftPadding",scaled:T,width:ge,maxFraction:ve,side:"left",paired:ne,anchorStyle:q}),Q&&vd({P:l,controlKey:"titleRightPadding",scaled:T,width:we,maxFraction:ve,side:"right",paired:ne,anchorStyle:D}),te&&Ct&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:T(ee),...se}}),z?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Dt.map(({displayMedia:Nt,lightboxMedia:Bt},Wt)=>{const wt=Bt?qt.findIndex(W=>W.assetId===Bt.assetId):-1;return a.jsx(yd,{P:l,media:Nt,imgWidth:v||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:Wt<Dt.length-1,showControls:te,onMediaClick:U&&wt>=0?()=>Re(qt,wt):void 0},`${Nt.assetId}-${Wt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Ts,{...jt,title:_?"":St.title,description:_?"":St.description})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Ts,{...jt,title:_?"":St.title,description:_?"":St.description}),Dt.length>0&&a.jsx(hw,{P:l,layoutType:p,galleryWidthStyle:f,galleryPaddingRight:ce,galleryPaddingLeft:F,galleryPaddingRightWidth:me,galleryPaddingLeftWidth:ye,galleryPaddingMaxFraction:fe,showControls:te,scaled:T,children:Dt.map(({displayMedia:Nt,lightboxMedia:Bt},Wt)=>{const wt=Bt?qt.findIndex(W=>W.assetId===Bt.assetId):-1;return a.jsx(yd,{P:l,media:Nt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:Wt<Dt.length-1,showControls:te,onMediaClick:U&&wt>=0?()=>Re(qt,wt):void 0},`${Nt.assetId}-${Wt}`)})})]})]},ht)})]})}),$t&&N==="on"&&typeof document<"u"&&e&&(()=>{const St=(r?document.getElementById(r):null)??document.body;return Un.createPortal(a.jsx("div",{style:nt,"data-selection":"none",children:a.jsx(gw,{prefix:l,items:Et,index:mt,imageDisplay:pw(e.lightboxImageDisplay),isEditor:n,onClose:tt,onPrev:()=>gt(ht=>(ht-1+Et.length)%Et.length),onNext:()=>gt(ht=>(ht+1)%Et.length),counterClassName:Pe,counterStyle:kt,backgroundColor:e.backgroundColor??ZS})}),St)})()]})}const ww=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21130
21130
|
import { createPortal } from 'react-dom';
|
|
21131
21131
|
import type React from 'react';
|
|
21132
21132
|
import { CommonComponentProps } from '../props';
|
|
@@ -23424,7 +23424,7 @@ export function Mercury({
|
|
|
23424
23424
|
</>
|
|
23425
23425
|
);
|
|
23426
23426
|
}
|
|
23427
|
-
`;function fi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Jo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},yw={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},description:{type:"string",label:"Description",placeholder:"Add Description...",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:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:[{title:"AX-2 Space Suit",description:"Pressure garment and life support",gallery:[{media:[{assetId:"01M3QM74XFEM0SKERMGHMJ3Q2W",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XG5SKREDC1KS41Y9E7",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGZAMX3BJWP2GWPG2V",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGWVQPRZ334BZBJ0MN",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XG89JTWMZ3JE9DMV05",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGTT2Q8FRDTYX62W0H",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}]},{title:"Earth-orbital mission",description:"Hasselblad documentation series",gallery:[{media:[{assetId:"01M3QM74XESYN1HRYH9VRTZ5CK",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",description:"Aerial survey, California",gallery:[{media:[{assetId:"01M3QM74XERA3G7J0J00XVKEXX",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGK74ANMH9PH0YAYCY",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGSP2F13EM5TFRQZGJ",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGJPAGBPVYJSM3TV07",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XF9TBBQMH8393VK14S",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XG5BANHQ2F7FV8KXSG",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGTS00H47RCAKVNGE3",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},galleryPaddingRight:fi("Gallery Padding Right"),galleryPaddingLeft:fi("Gallery Padding Left"),galleryPaddingBetween:fi("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left-top","top-center","top-right","left-center","center","right-center","left-bottom","bottom-center","right-bottom"]}},titleTopPadding:fi("Title Top Padding"),titleBottomPadding:fi("Title Bottom Padding"),titleLeftPadding:fi("Title Left Padding"),titleRightPadding:fi("Title Right Padding"),titleDescriptionPadding:fi("Title Description Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Jo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleAlign:{...Jo.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},descriptionColor:{type:"string",scope:"common",title:"Description",display:{type:"palette-color-picker"}},descriptionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},descriptionFontSettings:{...Jo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},descriptionFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},descriptionLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},descriptionLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},descriptionWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},descriptionAlign:{...Jo.textAlign,scope:"layout",title:"Align"},descriptionTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Jo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{type:"a",position:"left-center",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},descriptionColor:"#000000",descriptionFontFamily:"Goudy Bookletter 1911",descriptionFontSettings:{fontWeight:400,fontStyle:"normal"},descriptionLetterSpacing:0,descriptionWordSpacing:0,descriptionAlign:"center",descriptionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{defaultPaddingTop:30/1440,wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleBottomPadding:0,titleLeftPadding:0,titleRightPadding:0,titleDescriptionPadding:10/1440,cornerRadius:4/1440,position:"center",titleFontSize:73/1440,titleLineHeight:66/1440,descriptionFontSize:20/1440,descriptionLineHeight:24/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{defaultPaddingTop:10/375,wrapperWidth:1,imgWidth:170/375,titleWidth:150/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleBottomPadding:0,titleLeftPadding:10/375,titleRightPadding:10/375,titleDescriptionPadding:8/375,cornerRadius:8/375,position:"left-center",titleFontSize:30/375,titleLineHeight:25/375,descriptionFontSize:14/375,descriptionLineHeight:18/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{defaultPaddingTop:20/768,wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleBottomPadding:0,titleLeftPadding:0,titleRightPadding:0,titleDescriptionPadding:8/768,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,descriptionFontSize:16/768,descriptionLineHeight:20/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Description",items:["descriptionFontFamily","descriptionFontSettings",{type:"row",items:["descriptionFontSize","descriptionLineHeight","descriptionLetterSpacing","descriptionWordSpacing"]},"descriptionAlign","descriptionTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","descriptionColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},vw={element:hw,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:yw,sourceCode:fw,assetsPaths:{content:[{path:"gallery.media.assetId",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"descriptionFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",descriptionFontSettings:"descriptionFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},xw=10,bw=400,Sw=1,ww=1120/1440,$w=140/1440,Cw=550/1440,Tw=13,Iw=4,Lw=38/100,Pw=28/100,$p=2.8,Rw=.9,Cp=.22,Mw=.5,Ew=1,kw=1.5,Aw=0,Fw=.85;function Nw(e){return`
|
|
23427
|
+
`;function xi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Jo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},$w={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},description:{type:"string",label:"Description",placeholder:"Add Description...",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:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:[{title:"AX-2 Space Suit",description:"Pressure garment and life support",gallery:[{media:[{assetId:"01M3QM74XFEM0SKERMGHMJ3Q2W",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XG5SKREDC1KS41Y9E7",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGZAMX3BJWP2GWPG2V",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGWVQPRZ334BZBJ0MN",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XG89JTWMZ3JE9DMV05",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGTT2Q8FRDTYX62W0H",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}]},{title:"Earth-orbital mission",description:"Hasselblad documentation series",gallery:[{media:[{assetId:"01M3QM74XESYN1HRYH9VRTZ5CK",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",description:"Aerial survey, California",gallery:[{media:[{assetId:"01M3QM74XERA3G7J0J00XVKEXX",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGK74ANMH9PH0YAYCY",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGSP2F13EM5TFRQZGJ",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGJPAGBPVYJSM3TV07",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XF9TBBQMH8393VK14S",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XG5BANHQ2F7FV8KXSG",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]},{media:[{assetId:"01M3QM74XGTS00H47RCAKVNGE3",name:"",objectFit:"cover"},{assetId:"",name:"",objectFit:"cover"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},galleryPaddingRight:xi("Gallery Padding Right"),galleryPaddingLeft:xi("Gallery Padding Left"),galleryPaddingBetween:xi("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left-top","top-center","top-right","left-center","center","right-center","left-bottom","bottom-center","right-bottom"]}},titleTopPadding:xi("Title Top Padding"),titleBottomPadding:xi("Title Bottom Padding"),titleLeftPadding:xi("Title Left Padding"),titleRightPadding:xi("Title Right Padding"),titleDescriptionPadding:xi("Title Description Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Jo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleAlign:{...Jo.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},descriptionColor:{type:"string",scope:"common",title:"Description",display:{type:"palette-color-picker"}},descriptionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},descriptionFontSettings:{...Jo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},descriptionFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},descriptionLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},descriptionLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},descriptionWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},descriptionAlign:{...Jo.textAlign,scope:"layout",title:"Align"},descriptionTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Jo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{type:"a",position:"left-center",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},descriptionColor:"#000000",descriptionFontFamily:"Goudy Bookletter 1911",descriptionFontSettings:{fontWeight:400,fontStyle:"normal"},descriptionLetterSpacing:0,descriptionWordSpacing:0,descriptionAlign:"center",descriptionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{defaultPaddingTop:30/1440,wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleBottomPadding:0,titleLeftPadding:0,titleRightPadding:0,titleDescriptionPadding:10/1440,cornerRadius:4/1440,position:"center",titleFontSize:73/1440,titleLineHeight:66/1440,descriptionFontSize:20/1440,descriptionLineHeight:24/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{defaultPaddingTop:10/375,wrapperWidth:1,imgWidth:170/375,titleWidth:150/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleBottomPadding:0,titleLeftPadding:10/375,titleRightPadding:10/375,titleDescriptionPadding:8/375,cornerRadius:8/375,position:"left-center",titleFontSize:30/375,titleLineHeight:25/375,descriptionFontSize:14/375,descriptionLineHeight:18/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{defaultPaddingTop:20/768,wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleBottomPadding:0,titleLeftPadding:0,titleRightPadding:0,titleDescriptionPadding:8/768,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,descriptionFontSize:16/768,descriptionLineHeight:20/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Description",items:["descriptionFontFamily","descriptionFontSettings",{type:"row",items:["descriptionFontSize","descriptionLineHeight","descriptionLetterSpacing","descriptionWordSpacing"]},"descriptionAlign","descriptionTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","descriptionColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},Cw={element:Sw,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:$w,sourceCode:ww,assetsPaths:{content:[{path:"gallery.media.assetId",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"descriptionFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",descriptionFontSettings:"descriptionFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},Tw=10,Iw=400,Lw=1,Pw=1120/1440,Rw=140/1440,Mw=550/1440,Ew=13,kw=4,Aw=38/100,Fw=28/100,Rp=2.8,Nw=.9,Mp=.22,_w=.5,Hw=1,Ww=1.5,Ow=0,Dw=.85;function Bw(e){return`
|
|
23428
23428
|
.${e}-wrapper {
|
|
23429
23429
|
position: relative;
|
|
23430
23430
|
box-sizing: border-box;
|
|
@@ -23466,7 +23466,7 @@ export function Mercury({
|
|
|
23466
23466
|
object-fit: cover;
|
|
23467
23467
|
object-position: center;
|
|
23468
23468
|
}
|
|
23469
|
-
`}function
|
|
23469
|
+
`}function Ep(e){return Number(e.toFixed(4))}function wd(e,t,n,i){const r=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(r)?Math.min(i,Math.max(n,Math.round(r))):t}function Is(e,t,n=0,i=9999){const r=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(r)?Math.min(i,Math.max(n,r)):t}function zw(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function jw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function Vw(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name??"")||/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.assetId??"")}function kp(e,t){return(1-e)/(1-e*Math.cos(t))}function Gw(e){let t=0;for(let n=0;n<360;n+=1){const i=n*Math.PI/180;t=Math.max(t,Math.abs(Math.sin(i)*kp(e,i)))}return t||1}function Xw(e,t){return e?1:1+Mp*(.35+t)}function qw(e,t,n,i){const o=t*Xw(n,i);return Math.max(0,(e-o)/2)}function Uw(e,t,n){const i=kp(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function Yw(e,t,n){return e/2+t*n}function Kw(e,t,n){return`translate(calc(${e(t)} - var(--helix-base-w) / 2), -50%) scale(${Ep(n)})`}function Qw(e){return Math.round(e*1e3)}function Ap(e,t,n){const i=Math.cos(e),o=Math.cos(Dw*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return Ep(t+(n-t)*r)}function Zw(e){return Ap(e,_w,Hw)}function Jw(e){return Ap(e,Ww,Ow)}function e$(e,t){if(!t)return"none";const n=Jw(e);return n<=0?"none":`blur(${n}px)`}function $d(e,t){const n=t*Math.PI*2,{offset:i,scale:o}=Uw(e.depthFactor,e.spreadFactor,n),r=Yw(e.width,e.orbitRadius,i);return{transform:Kw(e.scaled,r,o),zIndex:Qw(o),opacity:Zw(n),filter:e$(n,e.blurEnabled)}}function Fp(e,t){return(e%t+t)%t}function t$(e,t){return Xl(e,t)/t}function Xl(e,t){return Fp(e,t)}function n$(e,t){return Math.floor(e/t)}function i$(e,t,n,i){return n$(e,t)*n+Xl(e,t)*i}function Cd(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function ha(e){const t=e%1;return t<0?t+1:t}function o$(e,t,n){const i=t/Rp,o=n==="left"?-e*i:e*i;return ha(o)}function r$({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=A.useScopedStyles(),r=s.useRef(null),l=Is((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Pw),c=Is(e==null?void 0:e.imageWidth,Rw),d=Is(e==null?void 0:e.turnHeight,Mw),u=wd(e==null?void 0:e.itemsPerTurn,Ew,3,40),p=wd(e==null?void 0:e.turns,kw,1,30),v=Math.min(Nw,Math.max(0,Aw)),x=Math.min(1,Math.max(0,Fw)),m=Math.max(0,(e==null?void 0:e.speed)??Rp),h=(e==null?void 0:e.direction)==="left"?"left":"right",b=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",S=(e==null?void 0:e.cornerRadius)??0,M=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>zw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),$=y.display==="cover",R=T=>A.scalingValue(T,n??!1),X=s.useMemo(()=>Gw(v),[v]),B=s.useMemo(()=>qw(l,c,$,x),[l,c,$,x]),O=s.useMemo(()=>Bw(o),[o]),N=s.useMemo(()=>({scaled:T=>A.scalingValue(T,n??!1),width:l,orbitRadius:B,depthFactor:v,spreadFactor:X,blurEnabled:M}),[n,l,B,v,X,M]),z=s.useRef([]),C=s.useRef(0),I=s.useMemo(()=>(t??[]).filter(T=>{var le;return!!((le=T.image)!=null&&le.assetId)}),[t]),j=d/u,E=c*jw(y),w=Math.min(Iw,p*u),L=Lw*u,V=w+L*2,K=Math.max(0,p-1)*d+(u-1)*j,P=m>0,f=b==="scroll"&&P,U=b==="autoplay"&&P&&(n?!!i:!0),te=U?360/(m*Tw):0,ce=I.length===0?0:V,F=s.useMemo(()=>Array.from({length:ce},(T,le)=>t$(le-L,u)),[ce,L,u]);s.useEffect(()=>{if(!U&&!f)return;const T=r.current;if(!T)return;const le=re=>{C.current=re,F.forEach((ge,we)=>{const Ae=z.current[we];if(!Ae)return;const fe=$d(N,ha(ge+re));Ae.style.transform=fe.transform,Ae.style.zIndex=String(fe.zIndex),Ae.style.opacity=String(fe.opacity),Ae.style.filter=fe.filter})};if(f){const re=T.ownerDocument.defaultView??window,ge=()=>{const Ae=T.getBoundingClientRect(),fe=re.innerHeight||T.ownerDocument.documentElement.clientHeight,ve=fe+Ae.height;if(ve<=0)return;const xe=Math.min(1,Math.max(0,(fe-Ae.top)/ve));le(o$(xe,m,h))};ge(),re.addEventListener("scroll",ge,{passive:!0,capture:!0}),re.addEventListener("resize",ge);const we=new ResizeObserver(ge);return we.observe(T),()=>{re.removeEventListener("scroll",ge,{capture:!0}),re.removeEventListener("resize",ge),we.disconnect()}}const J=h==="left"?-1:1;let Se=null,Le=null;const me=re=>{if(Le!==null){const ge=(re-Le)/1e3/te*J;C.current=ha(C.current+ge)}Le=re,le(C.current),Se=requestAnimationFrame(me)},ye=()=>{Se===null&&(Le=null,Se=requestAnimationFrame(me))},ee=()=>{Se!==null&&cancelAnimationFrame(Se),Se=null},oe=new IntersectionObserver(([re])=>{re!=null&&re.isIntersecting?ye():ee()});return oe.observe(T),()=>{ee(),oe.disconnect()}},[U,f,F,N,te,m,h]);const ie=U||f?C.current:0;return I.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:R(l)}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:R(l),height:R(K)},children:Array.from({length:V},(T,le)=>{const J=le-L,Le=I[Fp(J,I.length)].image,me=Xl(J,u),ye=F[le],ee=i$(J,u,d,j),oe=x===0?0:(Cd(me+7.3)-.5)*x*j,re=$?1:1+(Cd(me+3.1)-.5)*2*Mp*(.35+x),ge=c*re,we={"--helix-base-w":R(ge),...$?{"--helix-base-h":R(E)}:{}},Ae={top:R(ee+oe),...we,...$d(N,ha(ye+ie))},fe=S>0?{borderRadius:R(S)}:{},ve=$?{...fe,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:fe,xe=Vw(Le)?a.jsx("video",{className:`${o}-media`,style:ve,src:Le.assetId,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:ve,src:Le.assetId,alt:Le.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{ref:g=>{z.current[le]=g},className:$?`${o}-item ${o}-item-cover`:`${o}-item`,style:Ae,children:$?a.jsx("div",{className:`${o}-cover`,style:fe,children:xe}):xe},`${p}-${u}-${J}`)})})]})}const a$=`import { useEffect, useMemo, useRef, type CSSProperties } from 'react';
|
|
23470
23470
|
import { CommonComponentProps } from '../props';
|
|
23471
23471
|
import { scalingValue } from '../utils/scalingValue';
|
|
23472
23472
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -24026,7 +24026,7 @@ export function Helix({
|
|
|
24026
24026
|
</>
|
|
24027
24027
|
);
|
|
24028
24028
|
}
|
|
24029
|
-
`,t$=["01M3QM74XEA13H9Z3AZF1NGY48","01M3QM74XEZJJC5STVP0WF2GN3","01M3QM74XE170PHTE4A34MKNP3","01M3QM74XEZD3SDVVQZ1TF9JPA","01M3QM74XEPJWV4ZR7R3JPS67H"],n$={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:t$.map(e=>({image:{assetId:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},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"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},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"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},i$={element:Jw,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:n$,sourceCode:e$,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Cn=300,tn=300,o$=8/1440,mo=.004,r$=50,a$=1440,ji=r$/a$;function s$(e){if(e==="default"||e==="compact"||e==="open")return e;if(e==="onScroll")return"compact"}function l$(e){return e==="center"||e==="right"?e:"left"}function c$(e){return e==="left"||e==="right"?e:"center"}function d$(e,t,n){const i=F.scalingValue(t,n);return e==="center"?`translateX(calc(-50% + ${i}))`:`translateX(${i})`}function u$(e,t){if(e&&typeof e=="object"){if(t&&typeof e[t]=="string")return e[t];for(const n in e)if(typeof e[n]=="string")return e[n];return}return e}function Rp(e,t){const n=(u$(e,t)??"always").trim().toLowerCase().replace(/[_-]+/g," ");return n==="open only"||n==="openonly"?"open only":n==="open and compact"||n==="openandcompact"?"open and compact":n==="default and open"||n==="defaultandopen"?"default and open":n==="default and compact"||n==="defaultandcompact"?"default and compact":"always"}function p$(e,t,n){switch(Rp(e.showIn,n)){case"open only":return!1;case"open and compact":return t==="compact";case"default and compact":return!0;case"default and open":return t==="default";default:return!0}}function g$(e,t){switch(Rp(e.showIn,t)){case"default and compact":return!1;default:return!0}}function m$(e){return(e==null?void 0:e.find(t=>t.slug===""))??(e==null?void 0:e[0])}function h$(e,t){const n=e?t==null?void 0:t.find(i=>i.id===e):m$(t);return!e&&!n?"":n?n.slug===""?"/":`/${n.slug}`:e.startsWith("/")||e.startsWith("#")||/^[a-z][a-z\d+\-.]*:/i.test(e)?e:t?`/${e}`:e}function Td(e){const t=(e??"").toLowerCase();return t==="blank"||t==="_blank"||t.includes("new")}function Mp(e){const t=e.link;if(t&&typeof t=="object"){const i=Td(t.target)?"_blank":void 0;if(t.type==="url")return{type:"url",value:t.value??t.url??"",target:i};if(t.type==="anchor")return{type:"anchor",value:t.value??"",target:i};if(t.type==="page")return{type:"page",value:t.value??"",target:i,anchor:t.anchor};if(typeof t.url=="string")return{type:"url",value:t.url,target:i}}const n=Td(e.openIn)?"_blank":void 0;return e.mode==="url"?{type:"url",value:e.url??"",target:n}:{type:"page",value:e.page??"",target:n,anchor:e.anchor}}function Qs(e,t){const n=e.label||"Link",i=Mp(e);if(i.type==="url")return{label:n,href:i.value,target:i.target};if(i.type==="anchor"){const c=i.value.replace(/^#/,"");return{label:n,href:c?`#${c}`:"",target:i.target}}const o=h$(i.value,t),r=(i.anchor??"").replace(/^#/,""),l=r?o?`${o}#${r}`:`#${r}`:o;return{label:n,href:l,target:i.target}}const bi=24,xi=bi*.125,Ep=bi*.125,Ls=(bi-(3*xi+2*Ep))/2,Id=xi+Ep;function f$({className:e,lineClassName:t}){return a.jsxs("svg",{className:e,viewBox:`0 0 ${bi} ${bi}`,"aria-hidden":"true",children:[a.jsx("rect",{className:`${t} ${t}-top`,x:"0",y:Ls,width:bi,height:xi,rx:xi/2}),a.jsx("rect",{className:`${t} ${t}-mid`,x:"0",y:Ls+Id,width:bi,height:xi,rx:xi/2}),a.jsx("rect",{className:`${t} ${t}-bot`,x:"0",y:Ls+2*Id,width:bi,height:xi,rx:xi/2})]})}function y$(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function v$(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:F.scalingValue((o-t)/2,i)}}const kp=.004;let er;function x$(){return er!==void 0?er:typeof document>"u"?(er=null,null):(er=document.createElement("canvas").getContext("2d"),er)}function b$(e){const t=getComputedStyle(e),n=parseFloat(t.fontSize)||0;if(n<=0)return 0;const i=x$();if(!i)return 0;i.font=`${t.fontStyle} ${t.fontWeight} ${n}px ${t.fontFamily}`;const o=i.measureText("H"),r=o.actualBoundingBoxAscent>0?o.actualBoundingBoxAscent:0,l=Math.max(0,o.actualBoundingBoxDescent||0),c=o.fontBoundingBoxAscent||0,d=o.fontBoundingBoxDescent||0;return r<=0||c<=0&&d<=0?0:(d-l-(c-r))/2/n}function Ld(e,t){const[n,i]=s.useState(0);return s.useLayoutEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const d=b$(o);i(u=>Math.abs(u-d)<kp?u:d)};r();const l=document.fonts;l.ready.then(r).catch(()=>{}),l.addEventListener("loadingdone",r);const c=new ResizeObserver(r);return c.observe(o),()=>{l.removeEventListener("loadingdone",r),c.disconnect()}},[e,t]),n}function Pd(e){if(!(Math.abs(e)<kp))return`translateY(${e}em)`}function Rd(e){var t,n;return[e.fontFamily??"",((t=e.fontSettings)==null?void 0:t.fontWeight)??400,((n=e.fontSettings)==null?void 0:n.fontStyle)??"normal",e.fontSize??"",e.lineHeight??""].join("\0")}function Md(e){return{fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontSize:e.fontSize,lineHeight:e.lineHeight,position:"absolute",top:0,left:0,visibility:"hidden",pointerEvents:"none",whiteSpace:"nowrap"}}function Ed(e,t={}){return{fontFamily:e.fontFamily??t.fontFamily,fontSettings:e.fontSettings??t.fontSettings,fontSize:e.fontSize??t.fontSize,lineHeight:e.lineHeight??t.lineHeight,letterSpacing:e.letterSpacing??t.letterSpacing??0,wordSpacing:e.wordSpacing??t.wordSpacing??0,textAlign:e.textAlign??t.textAlign??"left",textAppearance:e.textAppearance??t.textAppearance}}function kd(e,t,n){var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??.01,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing??0,wordSpacing:t.wordSpacing??0,textAlign:t.textAlign,textAppearance:t.textAppearance,color:""};return{css:{...un(en(i,n)),...v$(t.fontSize,t.lineHeight,e,n)},className:y$(t.fontSize,t.lineHeight,`${e}-link-text`,`${e}-text-tight-leading`)}}function Ad(e){const t=e.split(/\r?\n/);return t.length===1?e:t.map((n,i)=>a.jsxs(s.Fragment,{children:[n,i<t.length-1?a.jsx("br",{}):null]},i))}function Fd(e,t,n,i){const o=Math.max(0,n-i),r=e+t;if(r<=o||r<=0)return{start:e,end:t};const l=o/r;return{start:e*l,end:t*l}}function Ap(e){const n=Math.max(ji,e.fontSize??ji),{start:i,end:o}=Fd(e.textPaddingTop,e.textPaddingBottom,1,n),{start:r,end:l}=Fd(e.textPaddingLeft,e.textPaddingRight,1,ji);return{effectivePaddingLeft:r,effectivePaddingRight:l,effectivePaddingTop:i,effectivePaddingBottom:o,panelSize:1}}function S$(e){if(e==="center"||e==="center-center")return{horizontalAlign:"center",verticalAlign:"center"};const[t,n]=e.split("-");return{horizontalAlign:t,verticalAlign:n}}function w$(e){return e.position?S$(e.position):{horizontalAlign:e.horizontalAlign??"left",verticalAlign:e.verticalAlign??"top"}}function $$(e,t){return e.textPaddingLeft!==t.textPaddingLeft||e.textPaddingRight!==t.textPaddingRight||e.textPaddingTop!==t.textPaddingTop||e.textPaddingBottom!==t.textPaddingBottom}const C$=[["onScrollIconColor","compactIconColor"],["onScrollLinkColor","compactLinkColor"],["onScrollLogoColor","compactLogoColor"],["onScrollBackgroundColor","compactBackgroundColor"],["onScrollPanelColor","compactBackgroundColor"],["onScrollLogoMaxWidth","compactLogoMaxWidth"],["onScrollLogoMaxHeight","compactLogoMaxHeight"],["onScrollLogoPosition","compactLogoPosition"],["onScrollPanelHeight","compactPanelHeight"],["onScrollIconSize","compactIconSize"],["onScrollNavTextWidth","compactNavTextWidth"],["onScrollNavGap","compactNavGap"],["onScrollNavPaddingLeft","compactNavPaddingLeft"],["onScrollNavPaddingRight","compactNavPaddingRight"],["onScrollFontFamily","compactFontFamily"],["onScrollFontSettings","compactFontSettings"],["onScrollFontSize","compactFontSize"],["onScrollLineHeight","compactLineHeight"],["onScrollLetterSpacing","compactLetterSpacing"],["onScrollWordSpacing","compactWordSpacing"],["onScrollTextAlign","compactTextAlign"],["onScrollTextAppearance","compactTextAppearance"]];function Fp(e){var o,r;const t=e,n={};for(const[l,c]of C$)e[c]!==void 0||t[l]===void 0||(n[c]=t[l]);const i=t.stateOverrides;return i&&(i.onScroll!==void 0||i["onScroll-hover"]!==void 0)&&(n.stateOverrides={...e.stateOverrides},i.onScroll!==void 0&&((o=e.stateOverrides)==null?void 0:o.compact)===void 0&&(n.stateOverrides.compact=i.onScroll),i["onScroll-hover"]!==void 0&&((r=e.stateOverrides)==null?void 0:r["compact-hover"])===void 0&&(n.stateOverrides["compact-hover"]=i["onScroll-hover"])),Object.keys(n).length===0?e:{...e,...n}}function Nd(e){var o,r,l,c,d,u,p,y,v,g,m,x,b,M,f,S;e=Fp(e);const t=e,n={};if(e.backgroundColor===void 0&&t.panelColor!==void 0&&(n.backgroundColor=t.panelColor),e.openFontFamily===void 0&&e.fontFamily!==void 0&&(n.openFontFamily=e.fontFamily),e.openFontSettings===void 0&&e.fontSettings!==void 0&&(n.openFontSettings=e.fontSettings),e.openFontSize===void 0&&e.fontSize!==void 0&&(n.openFontSize=e.fontSize),e.openLineHeight===void 0&&e.lineHeight!==void 0&&(n.openLineHeight=e.lineHeight),e.openLetterSpacing===void 0&&e.letterSpacing!==void 0&&(n.openLetterSpacing=e.letterSpacing),e.openWordSpacing===void 0&&e.wordSpacing!==void 0&&(n.openWordSpacing=e.wordSpacing),e.openTextAlign===void 0&&e.textAlign!==void 0&&(n.openTextAlign=e.textAlign),e.openTextAppearance===void 0&&e.textAppearance!==void 0&&(n.openTextAppearance=e.textAppearance),e.openLinkColor===void 0){const W=((r=(o=e.stateOverrides)==null?void 0:o.open)==null?void 0:r.openLinkColor)??((c=(l=e.stateOverrides)==null?void 0:l.open)==null?void 0:c.linkColor)??e.linkColor;W!==void 0&&(n.openLinkColor=W)}if(e.compactIconColor===void 0){const W=((u=(d=e.stateOverrides)==null?void 0:d.compact)==null?void 0:u.iconColor)??e.iconColor;W!==void 0&&(n.compactIconColor=W)}if(e.compactLinkColor===void 0){const W=((y=(p=e.stateOverrides)==null?void 0:p.compact)==null?void 0:y.linkColor)??e.linkColor;W!==void 0&&(n.compactLinkColor=W)}if(e.compactLogoColor===void 0){const W=((g=(v=e.stateOverrides)==null?void 0:v.compact)==null?void 0:g.logoColor)??e.logoColor;W!==void 0&&(n.compactLogoColor=W)}if(e.openLogoColor===void 0){const W=((x=(m=e.stateOverrides)==null?void 0:m.open)==null?void 0:x.logoColor)??e.logoColor;W!==void 0&&(n.openLogoColor=W)}if(e.compactBackgroundColor===void 0){const W=((M=(b=e.stateOverrides)==null?void 0:b.compact)==null?void 0:M.backgroundColor)??((S=(f=t.stateOverrides)==null?void 0:f.compact)==null?void 0:S.panelColor)??t.compactPanelColor??t.onScrollPanelColor??e.backgroundColor??n.backgroundColor;W!==void 0&&(n.compactBackgroundColor=W)}e.logoMaxHeight===void 0&&e.logoMaxWidth!==void 0&&(n.logoMaxHeight=e.logoMaxWidth),e.compactLogoMaxHeight===void 0&&e.compactLogoMaxWidth!==void 0&&(n.compactLogoMaxHeight=e.compactLogoMaxWidth);const i=(W,q)=>{if(e[W]!==void 0)return;const z=e[q];z!==void 0&&(n[W]=z)};return i("compactLogoMaxHeight","logoMaxHeight"),i("compactLogoPosition","logoPosition"),i("compactPanelHeight","panelHeight"),i("compactShowIcon","showIcon"),i("compactIconSize","iconSize"),i("compactNavTextWidth","navTextWidth"),i("compactNavTextPosition","navTextPosition"),i("compactNavTextOffset","navTextOffset"),i("compactNavGap","navGap"),i("compactNavPaddingLeft","navPaddingLeft"),i("compactNavPaddingRight","navPaddingRight"),i("compactFontFamily","fontFamily"),i("compactFontSettings","fontSettings"),i("compactFontSize","fontSize"),i("compactLineHeight","lineHeight"),i("compactLetterSpacing","letterSpacing"),i("compactWordSpacing","wordSpacing"),i("compactTextAlign","textAlign"),i("compactTextAppearance","textAppearance"),Object.keys(n).length===0?e:{...e,...n}}function T$(e,t){const n=Ap({textPaddingLeft:e.textPaddingLeft??0,textPaddingRight:e.textPaddingRight??0,textPaddingTop:e.textPaddingTop??0,textPaddingBottom:e.textPaddingBottom??0,fontSize:e.openFontSize??e.fontSize??t.openFontSize??t.fontSize}),i={};return(e.textPaddingLeft??0)!==n.effectivePaddingLeft&&(i.textPaddingLeft=n.effectivePaddingLeft),(e.textPaddingRight??0)!==n.effectivePaddingRight&&(i.textPaddingRight=n.effectivePaddingRight),(e.textPaddingTop??0)!==n.effectivePaddingTop&&(i.textPaddingTop=n.effectivePaddingTop),(e.textPaddingBottom??0)!==n.effectivePaddingBottom&&(i.textPaddingBottom=n.effectivePaddingBottom),Object.keys(i).length===0?e:{...e,...i}}function I$(e,t){return{paddingLeft:F.scalingValue(e.effectivePaddingLeft,t),paddingRight:F.scalingValue(e.effectivePaddingRight,t),paddingTop:F.scalingValue(e.effectivePaddingTop,t),paddingBottom:F.scalingValue(e.effectivePaddingBottom,t)}}function L$(e,t,n,i){const o=Math.max(ji,n??ji),r=Math.max(t.effectivePaddingTop,mo),l=Math.max(t.effectivePaddingBottom,mo),c=Math.max(0,t.panelSize-t.effectivePaddingBottom-o),d=Math.max(0,t.panelSize-t.effectivePaddingTop-o),u=Math.max(t.effectivePaddingLeft,mo),p=Math.max(t.effectivePaddingRight,mo),y=Math.max(0,t.panelSize-t.effectivePaddingRight-ji),v=Math.max(0,t.panelSize-t.effectivePaddingLeft-ji);return a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:i(r)}}),a.jsx("div",{"data-controls":"textPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:i(l)}}),a.jsx("div",{"data-controls":"textPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(y),className:`${e}-control-anchor`,style:{top:0,left:0,width:i(u),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(v),className:`${e}-control-anchor`,style:{top:0,right:0,width:i(p),height:"100%"}})]})}const P$={iconColor:"icon-color",closeButtonColor:"close-button-color",linkColor:"link-color",openLinkColor:"menu-link-color",compactIconColor:"compact-icon-color",compactLinkColor:"compact-link-color",compactLogoColor:"compact-logo-color",compactBackgroundColor:"compact-background-color",openLogoColor:"open-logo-color",menuBackgroundColor:"menu-background-color",overlayColor:"overlay-color",backgroundColor:"background-color",logoColor:"logo-color"},R$=["hover","open"],M$={top:"flex-start",center:"center",bottom:"flex-end"},E$={left:"flex-start",center:"center",right:"flex-end"};function k$(e){return`
|
|
24029
|
+
`,s$=["01M3QM74XEA13H9Z3AZF1NGY48","01M3QM74XEZJJC5STVP0WF2GN3","01M3QM74XE170PHTE4A34MKNP3","01M3QM74XEZD3SDVVQZ1TF9JPA","01M3QM74XEPJWV4ZR7R3JPS67H"],l$={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{assetId:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:s$.map(e=>({image:{assetId:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},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"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},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"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},c$={element:r$,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:l$,sourceCode:a$,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Tn=300,rn=300,d$=8/1440,fo=.004,u$=50,p$=1440,Xi=u$/p$;function m$(e){if(e==="default"||e==="compact"||e==="open")return e;if(e==="onScroll")return"compact"}function g$(e){return e==="center"||e==="right"?e:"left"}function h$(e){return e==="left"||e==="right"?e:"center"}function f$(e,t,n){const i=A.scalingValue(t,n);return e==="center"?`translateX(calc(-50% + ${i}))`:`translateX(${i})`}function y$(e,t){if(e&&typeof e=="object"){if(t&&typeof e[t]=="string")return e[t];for(const n in e)if(typeof e[n]=="string")return e[n];return}return e}function Np(e,t){const n=(y$(e,t)??"always").trim().toLowerCase().replace(/[_-]+/g," ");return n==="open only"||n==="openonly"?"open only":n==="open and compact"||n==="openandcompact"?"open and compact":n==="default and open"||n==="defaultandopen"?"default and open":n==="default and compact"||n==="defaultandcompact"?"default and compact":"always"}function v$(e,t,n){switch(Np(e.showIn,n)){case"open only":return!1;case"open and compact":return t==="compact";case"default and compact":return!0;case"default and open":return t==="default";default:return!0}}function x$(e,t){switch(Np(e.showIn,t)){case"default and compact":return!1;default:return!0}}function b$(e){return(e==null?void 0:e.find(t=>t.slug===""))??(e==null?void 0:e[0])}function S$(e,t){const n=e?t==null?void 0:t.find(i=>i.id===e):b$(t);return!e&&!n?"":n?n.slug===""?"/":`/${n.slug}`:e.startsWith("/")||e.startsWith("#")||/^[a-z][a-z\d+\-.]*:/i.test(e)?e:t?`/${e}`:e}function Td(e){const t=(e??"").toLowerCase();return t==="blank"||t==="_blank"||t.includes("new")}function _p(e){const t=e.link;if(t&&typeof t=="object"){const i=Td(t.target)?"_blank":void 0;if(t.type==="url")return{type:"url",value:t.value??t.url??"",target:i};if(t.type==="anchor")return{type:"anchor",value:t.value??"",target:i};if(t.type==="page")return{type:"page",value:t.value??"",target:i,anchor:t.anchor};if(typeof t.url=="string")return{type:"url",value:t.url,target:i}}const n=Td(e.openIn)?"_blank":void 0;return e.mode==="url"?{type:"url",value:e.url??"",target:n}:{type:"page",value:e.page??"",target:n,anchor:e.anchor}}function Ks(e,t){const n=e.label||"Link",i=_p(e);if(i.type==="url")return{label:n,href:i.value,target:i.target};if(i.type==="anchor"){const c=i.value.replace(/^#/,"");return{label:n,href:c?`#${c}`:"",target:i.target}}const o=S$(i.value,t),r=(i.anchor??"").replace(/^#/,""),l=r?o?`${o}#${r}`:`#${r}`:o;return{label:n,href:l,target:i.target}}const $i=24,wi=$i*.125,Hp=$i*.125,Ls=($i-(3*wi+2*Hp))/2,Id=wi+Hp;function w$({className:e,lineClassName:t}){return a.jsxs("svg",{className:e,viewBox:`0 0 ${$i} ${$i}`,"aria-hidden":"true",children:[a.jsx("rect",{className:`${t} ${t}-top`,x:"0",y:Ls,width:$i,height:wi,rx:wi/2}),a.jsx("rect",{className:`${t} ${t}-mid`,x:"0",y:Ls+Id,width:$i,height:wi,rx:wi/2}),a.jsx("rect",{className:`${t} ${t}-bot`,x:"0",y:Ls+2*Id,width:$i,height:wi,rx:wi/2})]})}function $$(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function C$(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:A.scalingValue((o-t)/2,i)}}const Wp=.004;let er;function T$(){return er!==void 0?er:typeof document>"u"?(er=null,null):(er=document.createElement("canvas").getContext("2d"),er)}function I$(e){const t=getComputedStyle(e),n=parseFloat(t.fontSize)||0;if(n<=0)return 0;const i=T$();if(!i)return 0;i.font=`${t.fontStyle} ${t.fontWeight} ${n}px ${t.fontFamily}`;const o=i.measureText("H"),r=o.actualBoundingBoxAscent>0?o.actualBoundingBoxAscent:0,l=Math.max(0,o.actualBoundingBoxDescent||0),c=o.fontBoundingBoxAscent||0,d=o.fontBoundingBoxDescent||0;return r<=0||c<=0&&d<=0?0:(d-l-(c-r))/2/n}function Ld(e,t){const[n,i]=s.useState(0);return s.useLayoutEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const d=I$(o);i(u=>Math.abs(u-d)<Wp?u:d)};r();const l=document.fonts;l.ready.then(r).catch(()=>{}),l.addEventListener("loadingdone",r);const c=new ResizeObserver(r);return c.observe(o),()=>{l.removeEventListener("loadingdone",r),c.disconnect()}},[e,t]),n}function Pd(e){if(!(Math.abs(e)<Wp))return`translateY(${e}em)`}function Rd(e){var t,n;return[e.fontFamily??"",((t=e.fontSettings)==null?void 0:t.fontWeight)??400,((n=e.fontSettings)==null?void 0:n.fontStyle)??"normal",e.fontSize??"",e.lineHeight??""].join("\0")}function Md(e){return{fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontSize:e.fontSize,lineHeight:e.lineHeight,position:"absolute",top:0,left:0,visibility:"hidden",pointerEvents:"none",whiteSpace:"nowrap"}}function Ed(e,t={}){return{fontFamily:e.fontFamily??t.fontFamily,fontSettings:e.fontSettings??t.fontSettings,fontSize:e.fontSize??t.fontSize,lineHeight:e.lineHeight??t.lineHeight,letterSpacing:e.letterSpacing??t.letterSpacing??0,wordSpacing:e.wordSpacing??t.wordSpacing??0,textAlign:e.textAlign??t.textAlign??"left",textAppearance:e.textAppearance??t.textAppearance}}function kd(e,t,n){var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??.01,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing??0,wordSpacing:t.wordSpacing??0,textAlign:t.textAlign,textAppearance:t.textAppearance,color:""};return{css:{...pn(nn(i,n)),...C$(t.fontSize,t.lineHeight,e,n)},className:$$(t.fontSize,t.lineHeight,`${e}-link-text`,`${e}-text-tight-leading`)}}function Ad(e){const t=e.split(/\r?\n/);return t.length===1?e:t.map((n,i)=>a.jsxs(s.Fragment,{children:[n,i<t.length-1?a.jsx("br",{}):null]},i))}function Fd(e,t,n,i){const o=Math.max(0,n-i),r=e+t;if(r<=o||r<=0)return{start:e,end:t};const l=o/r;return{start:e*l,end:t*l}}function Op(e){const n=Math.max(Xi,e.fontSize??Xi),{start:i,end:o}=Fd(e.textPaddingTop,e.textPaddingBottom,1,n),{start:r,end:l}=Fd(e.textPaddingLeft,e.textPaddingRight,1,Xi);return{effectivePaddingLeft:r,effectivePaddingRight:l,effectivePaddingTop:i,effectivePaddingBottom:o,panelSize:1}}function L$(e){if(e==="center"||e==="center-center")return{horizontalAlign:"center",verticalAlign:"center"};const[t,n]=e.split("-");return{horizontalAlign:t,verticalAlign:n}}function P$(e){return e.position?L$(e.position):{horizontalAlign:e.horizontalAlign??"left",verticalAlign:e.verticalAlign??"top"}}function R$(e,t){return e.textPaddingLeft!==t.textPaddingLeft||e.textPaddingRight!==t.textPaddingRight||e.textPaddingTop!==t.textPaddingTop||e.textPaddingBottom!==t.textPaddingBottom}const M$=[["onScrollIconColor","compactIconColor"],["onScrollLinkColor","compactLinkColor"],["onScrollLogoColor","compactLogoColor"],["onScrollBackgroundColor","compactBackgroundColor"],["onScrollPanelColor","compactBackgroundColor"],["onScrollLogoMaxWidth","compactLogoMaxWidth"],["onScrollLogoMaxHeight","compactLogoMaxHeight"],["onScrollLogoPosition","compactLogoPosition"],["onScrollPanelHeight","compactPanelHeight"],["onScrollIconSize","compactIconSize"],["onScrollNavTextWidth","compactNavTextWidth"],["onScrollNavGap","compactNavGap"],["onScrollNavPaddingLeft","compactNavPaddingLeft"],["onScrollNavPaddingRight","compactNavPaddingRight"],["onScrollFontFamily","compactFontFamily"],["onScrollFontSettings","compactFontSettings"],["onScrollFontSize","compactFontSize"],["onScrollLineHeight","compactLineHeight"],["onScrollLetterSpacing","compactLetterSpacing"],["onScrollWordSpacing","compactWordSpacing"],["onScrollTextAlign","compactTextAlign"],["onScrollTextAppearance","compactTextAppearance"]];function Dp(e){var o,r;const t=e,n={};for(const[l,c]of M$)e[c]!==void 0||t[l]===void 0||(n[c]=t[l]);const i=t.stateOverrides;return i&&(i.onScroll!==void 0||i["onScroll-hover"]!==void 0)&&(n.stateOverrides={...e.stateOverrides},i.onScroll!==void 0&&((o=e.stateOverrides)==null?void 0:o.compact)===void 0&&(n.stateOverrides.compact=i.onScroll),i["onScroll-hover"]!==void 0&&((r=e.stateOverrides)==null?void 0:r["compact-hover"])===void 0&&(n.stateOverrides["compact-hover"]=i["onScroll-hover"])),Object.keys(n).length===0?e:{...e,...n}}function Nd(e){var o,r,l,c,d,u,p,v,x,m,h,b,S,M,y,$;e=Dp(e);const t=e,n={};if(e.backgroundColor===void 0&&t.panelColor!==void 0&&(n.backgroundColor=t.panelColor),e.openFontFamily===void 0&&e.fontFamily!==void 0&&(n.openFontFamily=e.fontFamily),e.openFontSettings===void 0&&e.fontSettings!==void 0&&(n.openFontSettings=e.fontSettings),e.openFontSize===void 0&&e.fontSize!==void 0&&(n.openFontSize=e.fontSize),e.openLineHeight===void 0&&e.lineHeight!==void 0&&(n.openLineHeight=e.lineHeight),e.openLetterSpacing===void 0&&e.letterSpacing!==void 0&&(n.openLetterSpacing=e.letterSpacing),e.openWordSpacing===void 0&&e.wordSpacing!==void 0&&(n.openWordSpacing=e.wordSpacing),e.openTextAlign===void 0&&e.textAlign!==void 0&&(n.openTextAlign=e.textAlign),e.openTextAppearance===void 0&&e.textAppearance!==void 0&&(n.openTextAppearance=e.textAppearance),e.openLinkColor===void 0){const R=((r=(o=e.stateOverrides)==null?void 0:o.open)==null?void 0:r.openLinkColor)??((c=(l=e.stateOverrides)==null?void 0:l.open)==null?void 0:c.linkColor)??e.linkColor;R!==void 0&&(n.openLinkColor=R)}if(e.compactIconColor===void 0){const R=((u=(d=e.stateOverrides)==null?void 0:d.compact)==null?void 0:u.iconColor)??e.iconColor;R!==void 0&&(n.compactIconColor=R)}if(e.compactLinkColor===void 0){const R=((v=(p=e.stateOverrides)==null?void 0:p.compact)==null?void 0:v.linkColor)??e.linkColor;R!==void 0&&(n.compactLinkColor=R)}if(e.compactLogoColor===void 0){const R=((m=(x=e.stateOverrides)==null?void 0:x.compact)==null?void 0:m.logoColor)??e.logoColor;R!==void 0&&(n.compactLogoColor=R)}if(e.openLogoColor===void 0){const R=((b=(h=e.stateOverrides)==null?void 0:h.open)==null?void 0:b.logoColor)??e.logoColor;R!==void 0&&(n.openLogoColor=R)}if(e.compactBackgroundColor===void 0){const R=((M=(S=e.stateOverrides)==null?void 0:S.compact)==null?void 0:M.backgroundColor)??(($=(y=t.stateOverrides)==null?void 0:y.compact)==null?void 0:$.panelColor)??t.compactPanelColor??t.onScrollPanelColor??e.backgroundColor??n.backgroundColor;R!==void 0&&(n.compactBackgroundColor=R)}e.logoMaxHeight===void 0&&e.logoMaxWidth!==void 0&&(n.logoMaxHeight=e.logoMaxWidth),e.compactLogoMaxHeight===void 0&&e.compactLogoMaxWidth!==void 0&&(n.compactLogoMaxHeight=e.compactLogoMaxWidth);const i=(R,X)=>{if(e[R]!==void 0)return;const B=e[X];B!==void 0&&(n[R]=B)};return i("compactLogoMaxHeight","logoMaxHeight"),i("compactLogoPosition","logoPosition"),i("compactPanelHeight","panelHeight"),i("compactShowIcon","showIcon"),i("compactIconSize","iconSize"),i("compactNavTextWidth","navTextWidth"),i("compactNavTextPosition","navTextPosition"),i("compactNavTextOffset","navTextOffset"),i("compactNavGap","navGap"),i("compactNavPaddingLeft","navPaddingLeft"),i("compactNavPaddingRight","navPaddingRight"),i("compactFontFamily","fontFamily"),i("compactFontSettings","fontSettings"),i("compactFontSize","fontSize"),i("compactLineHeight","lineHeight"),i("compactLetterSpacing","letterSpacing"),i("compactWordSpacing","wordSpacing"),i("compactTextAlign","textAlign"),i("compactTextAppearance","textAppearance"),Object.keys(n).length===0?e:{...e,...n}}function E$(e,t){const n=Op({textPaddingLeft:e.textPaddingLeft??0,textPaddingRight:e.textPaddingRight??0,textPaddingTop:e.textPaddingTop??0,textPaddingBottom:e.textPaddingBottom??0,fontSize:e.openFontSize??e.fontSize??t.openFontSize??t.fontSize}),i={};return(e.textPaddingLeft??0)!==n.effectivePaddingLeft&&(i.textPaddingLeft=n.effectivePaddingLeft),(e.textPaddingRight??0)!==n.effectivePaddingRight&&(i.textPaddingRight=n.effectivePaddingRight),(e.textPaddingTop??0)!==n.effectivePaddingTop&&(i.textPaddingTop=n.effectivePaddingTop),(e.textPaddingBottom??0)!==n.effectivePaddingBottom&&(i.textPaddingBottom=n.effectivePaddingBottom),Object.keys(i).length===0?e:{...e,...i}}function k$(e,t){return{paddingLeft:A.scalingValue(e.effectivePaddingLeft,t),paddingRight:A.scalingValue(e.effectivePaddingRight,t),paddingTop:A.scalingValue(e.effectivePaddingTop,t),paddingBottom:A.scalingValue(e.effectivePaddingBottom,t)}}function A$(e,t,n,i){const o=Math.max(Xi,n??Xi),r=Math.max(t.effectivePaddingTop,fo),l=Math.max(t.effectivePaddingBottom,fo),c=Math.max(0,t.panelSize-t.effectivePaddingBottom-o),d=Math.max(0,t.panelSize-t.effectivePaddingTop-o),u=Math.max(t.effectivePaddingLeft,fo),p=Math.max(t.effectivePaddingRight,fo),v=Math.max(0,t.panelSize-t.effectivePaddingRight-Xi),x=Math.max(0,t.panelSize-t.effectivePaddingLeft-Xi);return a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:i(r)}}),a.jsx("div",{"data-controls":"textPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:i(l)}}),a.jsx("div",{"data-controls":"textPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(v),className:`${e}-control-anchor`,style:{top:0,left:0,width:i(u),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(x),className:`${e}-control-anchor`,style:{top:0,right:0,width:i(p),height:"100%"}})]})}const F$={iconColor:"icon-color",closeButtonColor:"close-button-color",linkColor:"link-color",openLinkColor:"menu-link-color",compactIconColor:"compact-icon-color",compactLinkColor:"compact-link-color",compactLogoColor:"compact-logo-color",compactBackgroundColor:"compact-background-color",openLogoColor:"open-logo-color",menuBackgroundColor:"menu-background-color",overlayColor:"overlay-color",backgroundColor:"background-color",logoColor:"logo-color"},N$=["hover","open"],_$={top:"flex-start",center:"center",bottom:"flex-end"},H$={left:"flex-start",center:"center",right:"flex-end"};function W$(e){return`
|
|
24030
24030
|
.${e}-root {
|
|
24031
24031
|
position: relative;
|
|
24032
24032
|
display: block;
|
|
@@ -24056,7 +24056,7 @@ export function Helix({
|
|
|
24056
24056
|
background: none;
|
|
24057
24057
|
cursor: pointer;
|
|
24058
24058
|
color: var(--${e}-icon-color);
|
|
24059
|
-
transition: color ${
|
|
24059
|
+
transition: color ${Tn}ms ease;
|
|
24060
24060
|
line-height: 0;
|
|
24061
24061
|
font-size: 0;
|
|
24062
24062
|
-webkit-appearance: none;
|
|
@@ -24076,7 +24076,7 @@ export function Helix({
|
|
|
24076
24076
|
fill: currentColor;
|
|
24077
24077
|
transform-box: fill-box;
|
|
24078
24078
|
transform-origin: center;
|
|
24079
|
-
transition: transform ${
|
|
24079
|
+
transition: transform ${Tn}ms ease, opacity ${Tn}ms ease;
|
|
24080
24080
|
}
|
|
24081
24081
|
.${e}-root.${e}-open .${e}-icon-line-top {
|
|
24082
24082
|
transform: translateY(200%) rotate(45deg);
|
|
@@ -24131,7 +24131,7 @@ export function Helix({
|
|
|
24131
24131
|
margin: 0;
|
|
24132
24132
|
background-color: var(--${e}-overlay-color);
|
|
24133
24133
|
opacity: 0;
|
|
24134
|
-
transition: opacity ${
|
|
24134
|
+
transition: opacity ${Tn}ms ease, background-color ${Tn}ms ease;
|
|
24135
24135
|
}
|
|
24136
24136
|
.${e}-lightbox.${e}-lightbox-active .${e}-backdrop {
|
|
24137
24137
|
opacity: 1;
|
|
@@ -24146,7 +24146,7 @@ export function Helix({
|
|
|
24146
24146
|
flex-direction: column;
|
|
24147
24147
|
overflow-y: auto;
|
|
24148
24148
|
background-color: var(--${e}-menu-background-color);
|
|
24149
|
-
transition: transform ${
|
|
24149
|
+
transition: transform ${Tn}ms ease, opacity ${Tn}ms ease, background-color ${Tn}ms ease;
|
|
24150
24150
|
box-shadow: 0 0 24px rgba(0, 0, 0, 0.12);
|
|
24151
24151
|
}
|
|
24152
24152
|
.${e}-full-lightbox .${e}-panel {
|
|
@@ -24629,23 +24629,23 @@ export function Helix({
|
|
|
24629
24629
|
font-size: 0;
|
|
24630
24630
|
}
|
|
24631
24631
|
.${e}-nav-state-anim {
|
|
24632
|
-
transition: margin-top ${
|
|
24632
|
+
transition: margin-top ${rn}ms ease;
|
|
24633
24633
|
}
|
|
24634
24634
|
.${e}-nav-state-anim .${e}-nav-bar {
|
|
24635
24635
|
transition:
|
|
24636
|
-
background-color ${
|
|
24637
|
-
height ${
|
|
24638
|
-
min-height ${
|
|
24639
|
-
padding ${
|
|
24640
|
-
gap ${
|
|
24636
|
+
background-color ${Tn}ms ease,
|
|
24637
|
+
height ${rn}ms ease,
|
|
24638
|
+
min-height ${rn}ms ease,
|
|
24639
|
+
padding ${rn}ms ease,
|
|
24640
|
+
gap ${rn}ms ease;
|
|
24641
24641
|
}
|
|
24642
24642
|
.${e}-nav-state-anim .${e}-nav-logo,
|
|
24643
24643
|
.${e}-nav-state-anim .${e}-nav-toggle-wrap,
|
|
24644
24644
|
.${e}-nav-state-anim .${e}-nav-links {
|
|
24645
24645
|
transition:
|
|
24646
|
-
left ${
|
|
24647
|
-
right ${
|
|
24648
|
-
transform ${
|
|
24646
|
+
left ${rn}ms ease,
|
|
24647
|
+
right ${rn}ms ease,
|
|
24648
|
+
transform ${rn}ms ease;
|
|
24649
24649
|
}
|
|
24650
24650
|
.${e}-nav-state-anim .${e}-nav-logo-inner,
|
|
24651
24651
|
.${e}-nav-state-anim .${e}-nav-padding-left,
|
|
@@ -24653,26 +24653,26 @@ export function Helix({
|
|
|
24653
24653
|
.${e}-nav-state-anim .${e}-nav-gap-control,
|
|
24654
24654
|
.${e}-nav-state-anim .${e}-link-text-box {
|
|
24655
24655
|
transition:
|
|
24656
|
-
width ${
|
|
24657
|
-
height ${
|
|
24656
|
+
width ${rn}ms ease,
|
|
24657
|
+
height ${rn}ms ease;
|
|
24658
24658
|
}
|
|
24659
24659
|
.${e}-nav-state-anim .${e}-nav-logo-tint {
|
|
24660
24660
|
transition:
|
|
24661
|
-
background-color ${
|
|
24661
|
+
background-color ${rn}ms ease;
|
|
24662
24662
|
}
|
|
24663
24663
|
.${e}-nav-state-anim .${e}-nav-toggle-wrap .${e}-root {
|
|
24664
24664
|
transition:
|
|
24665
|
-
width ${
|
|
24666
|
-
height ${
|
|
24667
|
-
min-width ${
|
|
24668
|
-
min-height ${
|
|
24669
|
-
max-width ${
|
|
24670
|
-
max-height ${
|
|
24665
|
+
width ${rn}ms ease,
|
|
24666
|
+
height ${rn}ms ease,
|
|
24667
|
+
min-width ${rn}ms ease,
|
|
24668
|
+
min-height ${rn}ms ease,
|
|
24669
|
+
max-width ${rn}ms ease,
|
|
24670
|
+
max-height ${rn}ms ease;
|
|
24671
24671
|
}
|
|
24672
24672
|
.${e}-nav-state-anim .${e}-icon-line {
|
|
24673
24673
|
transition:
|
|
24674
|
-
transform ${
|
|
24675
|
-
opacity ${
|
|
24674
|
+
transform ${Tn}ms ease,
|
|
24675
|
+
opacity ${Tn}ms ease;
|
|
24676
24676
|
}
|
|
24677
24677
|
.${e}-nav-state-anim .${e}-nav-link,
|
|
24678
24678
|
.${e}-nav-state-anim .${e}-link,
|
|
@@ -24680,13 +24680,13 @@ export function Helix({
|
|
|
24680
24680
|
.${e}-nav-state-anim .${e}-text-tight-leading {
|
|
24681
24681
|
transition:
|
|
24682
24682
|
color 200ms ease,
|
|
24683
|
-
font-size ${
|
|
24684
|
-
line-height ${
|
|
24685
|
-
letter-spacing ${
|
|
24686
|
-
word-spacing ${
|
|
24687
|
-
padding ${
|
|
24683
|
+
font-size ${rn}ms ease,
|
|
24684
|
+
line-height ${rn}ms ease,
|
|
24685
|
+
letter-spacing ${rn}ms ease,
|
|
24686
|
+
word-spacing ${rn}ms ease,
|
|
24687
|
+
padding ${rn}ms ease;
|
|
24688
24688
|
}
|
|
24689
|
-
`}function Zs(e){return e?!e.startsWith("http://")&&!e.startsWith("https://")&&!e.startsWith("blob:")&&!e.startsWith("data:"):!1}function A$(e,t){var i;const n=(i=e.logo)==null?void 0:i.icon;return!e.logo||Zs(n)||!t?e:{...e,logo:{...e.logo,icon:t}}}function F$(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function N$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function _$(e){const t=N$(e),[n,i]=s.useState(!1);return s.useEffect(()=>{if(t||!e.startsWith("blob:")){i(!1);return}let o=!1;return fetch(e).then(r=>r.blob()).then(async r=>{if(o)return;if(r.type.includes("svg")){i(!0);return}if(r.type.startsWith("image/")&&!r.type.includes("svg")){i(!1);return}const l=await r.text();o||i(/<svg[\s>]/i.test(l.trim()))}).catch(()=>{o||i(!1)}),()=>{o=!0}},[t,e]),t||n}function H$(e,t){const[n,i]=s.useState(yr(e)?e:null);return s.useEffect(()=>{if(!t||!e){i(null);return}if(yr(e)){i(e);return}let o=!1;return zu(e).then(r=>{o||i(r)}).catch(()=>{o||i(null)}),()=>{o=!0}},[t,e]),t?n:null}function W$(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function O$(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function Np(e){if(!e)return null;const t=document.getElementById(e),n=document.querySelector(`[data-section-id="${CSS.escape(e)}"]`),i=t??n;return i instanceof HTMLElement?i:null}function _d(e){const t=Np(e);return t?(t.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function D$(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:c}=n,d=n.runAfterClose??(v=>v()),u=e.currentTarget.getAttribute("href")??"",p=W$(u),y=e.currentTarget.target==="_blank";if(r&&c){e.preventDefault(),e.stopPropagation();const v=Qs(r,l),g=Mp(r),m={mode:g.type==="url"?"url":"page",href:v.href||u,page:g.type==="page"?g.value:void 0,url:g.type==="url"?g.value:void 0,anchor:g.type==="anchor"?g.value.replace(/^#/,""):(g.anchor??"").replace(/^#/,""),target:v.target};m.target==="_blank"?c(m):d(()=>c(m)),t();return}if(i){e.preventDefault(),d(()=>_d(p)),t();return}!y&&p&&O$(u)&&Np(p)&&(e.preventDefault(),d(()=>_d(p))),t()}const B$=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function z$(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function j$(e){const t={},n=z$(e);if(!n)return t;const i=getComputedStyle(n);for(const o of B$){const r=i.getPropertyValue(o).trim();r&&(t[o]=r)}return t}function Hd(e,t,n,i,o){return a.jsx("span",{className:`${e}-link-text-box`,style:{width:o(n),maxWidth:"100%"},children:a.jsx("span",{className:i?`${e}-link-text-inner`:`${e}-link-text-inner-hidden`,style:{width:"100%"},children:t})})}function V$({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,activeEvent:o,currentState:r,isSwitchClone:l=!1,unavailableStates:c=[],layoutId:d,pages:u,onLinkNavigate:p,onUpdateSettings:y,onOpenChange:v}){var tc;const{prefix:g}=F.useScopedStyles(),m=s.useRef(null),x=s.useRef(null),b=s.useRef(null),M=s.useRef(null),f=s.useRef(null),S=s.useRef(0),W=s.useRef(null),q=s.useRef(null),z=s.useRef(d),L=s.useMemo(()=>k$(g),[g]),[_,G]=s.useState(!1),[$,I]=s.useState(!1),[D,E]=s.useState(!1),T=s$(r),C=s.useMemo(()=>new Set(c),[c]),V=Mt=>!!(Mt&&C.has(Mt)),U=!!(t&&!i&&T==="open"&&!V("open"))||!(t&&!i)&&_,P=!!(t&&!i),A=U&&!P;jl(A),s.useEffect(()=>{if(!U||!P)return;const Mt=document.documentElement,Xt=Mt.style.overflow;return Mt.style.overflow="hidden",()=>{Mt.style.overflow=Xt}},[U,P]);const j=!V("compact")&&!V("onScroll"),ie=!t||!!i&&!n,ae=o&&o!=="default"?o:void 0,O=j&&T==="compact"?"compact":"default",[re,N]=s.useState(O),[le,J]=s.useState(!1),be=!n;O!==re&&(N(O),be&&J(!0));const Le=Fp(e),{logo:ye,logoMaxHeight:ce=120/1440,logoPosition:K="left",panelHeight:se=60/1440,backgroundColor:pe="#b3b3b3",logoColor:fe="#000000",position:we,horizontalAlign:Re,verticalAlign:me,iconColor:xe="#000000",showIcon:Ce="on",iconSize:h=16/1440,linkColor:Y="#000000",openLinkColor:Q="#000000",compactIconColor:ne="#000000",compactLinkColor:ue="#000000",compactLogoColor:B="#000000",compactBackgroundColor:R="#ffffff",compactLogoMaxHeight:ee=120/1440,compactLogoPosition:te,compactPanelHeight:ge=60/1440,compactShowIcon:X="on",compactIconSize:Pe=16/1440,compactNavTextWidth:Se,compactNavTextPosition:Z,compactNavTextOffset:He,compactNavGap:We,compactNavPaddingLeft:ot=10/1440,compactNavPaddingRight:qe=10/1440,compactFontFamily:tt,compactFontSettings:et,compactFontSize:Ge,compactLineHeight:ve,compactLetterSpacing:_e=0,compactWordSpacing:ze=0,compactTextAlign:Qe="left",compactTextAppearance:$e,openLogoColor:Ne="#000000",menuBackgroundColor:Ye="#ffffff",overlayColor:Ze="rgba(0, 0, 0, 0.45)",closeButtonColor:st="#000000",effect:it="fade",openPanelSize:Oe=100,textWidth:Ae=280/1440,navTextWidth:mt,navTextPosition:Be="center",navTextOffset:De=0,gap:Ue=0,navGap:ct,navPaddingLeft:he=10/1440,navPaddingRight:Me=10/1440,textPaddingLeft:nt=10/1440,textPaddingRight:pt=10/1440,textPaddingTop:Ve=10/1440,textPaddingBottom:vt=10/1440,fontFamily:Pt,fontSettings:At,fontSize:wt,lineHeight:Vt,letterSpacing:jt=0,wordSpacing:Yt=0,textAlign:Kt="left",textAppearance:Rt,openFontFamily:zt,openFontSettings:on,openFontSize:xt,openLineHeight:yt,openLetterSpacing:ke,openWordSpacing:Je,openTextAlign:rt,openTextAppearance:dt,stateOverrides:Lt,link:St}=Le,{horizontalAlign:ht,verticalAlign:Wt}=w$({position:we,horizontalAlign:Re,verticalAlign:me}),Tt=O==="compact",Ot=Tt?ee:ce,Gt=l$(Tt?te:K),kt=Tt?ge:se,_t=Tt?Pe:h,Ft=Tt?Se:mt,ut=c$(Tt?Z:Be),H=(Tt?He:De)??0,Ie=Tt?We:ct,je=Tt?ot:he,Fe=Tt?qe:Me,ft=Ft??Ae,Ht=U||(Tt?X:Ce)!=="off",gt=F.buildColorVars(g,{iconColor:xe,closeButtonColor:st,linkColor:Y,openLinkColor:Q,compactIconColor:ne,compactLinkColor:ue,compactLogoColor:B,compactBackgroundColor:R,openLogoColor:Ne,menuBackgroundColor:Ye,overlayColor:Ze,backgroundColor:pe,logoColor:fe},P$,R$,Lt),It=Ed(Tt?{fontFamily:tt,fontSettings:et,fontSize:Ge,lineHeight:ve,letterSpacing:_e,wordSpacing:ze,textAlign:Qe,textAppearance:$e}:{fontFamily:Pt,fontSettings:At,fontSize:wt,lineHeight:Vt,letterSpacing:jt,wordSpacing:Yt,textAlign:Kt,textAppearance:Rt}),qt=Ed({fontFamily:zt,fontSettings:on,fontSize:xt,lineHeight:yt,letterSpacing:ke,wordSpacing:Je,textAlign:rt,textAppearance:dt},It),Dt=kd(g,It,t),an=kd(g,qt,t),cn=Ld(b,Rd(It)),qn=Ld(M,Rd(qt)),Yn={...an.css,whiteSpace:"pre-wrap",transform:Pd(qn)},Qi=an.className,hn=Mt=>F.scalingValue(Mt,t),Vo=Ie??Ue,Go=Math.max(je,mo),xn=Math.max(Fe,mo),di=Math.max(0,1-_t),Zi=Math.max(0,1-_t),bn=n??!1,Kn=bn&&!U,Ji=s.useMemo(()=>Ap({textPaddingLeft:nt,textPaddingRight:pt,textPaddingTop:Ve,textPaddingBottom:vt,fontSize:qt.fontSize}),[nt,pt,Ve,vt,qt.fontSize]),eo=Mt=>{const Xt=a.jsx("span",{className:Qi,style:Yn,children:Ad(Mt)});return Hd(g,Xt,Ae,bn,hn)},Ke=it==="left"||it==="right"?{width:`${Oe}%`}:{height:`${Oe}%`},k={...I$(Ji,t),...Ke,alignItems:E$[ht],justifyContent:M$[Wt]},oe=s.useRef(e),de=s.useRef(d),Ee=s.useRef(null);Zs((tc=e.logo)==null?void 0:tc.icon)&&(Ee.current=e.logo.icon),s.useEffect(()=>{var Nr;if(!y||!t){oe.current=e,de.current=d;return}const Mt=(Nr=e.logo)==null?void 0:Nr.icon;if(e.logo&&!Zs(Mt)&&!Ee.current){oe.current=e,de.current=d;return}const Xt=_r=>{y(A$(_r,Ee.current))};if(de.current!==d){oe.current=e,de.current=d;const _r=Nd(e);_r!==e&&Xt(_r);return}const ln=Nd(e),fn=oe.current,Sn=fn!==e,kn=Sn?T$(ln,fn):ln;oe.current=e;const to=ln!==e,Uo=Sn&&$$(ln,kn);!to&&!Uo||Xt(kn)},[e,y,t,d]);const Xe=F.scalingValue(_t,t),lt={width:Xe,height:Xe,minWidth:Xe,minHeight:Xe,maxWidth:Xe,maxHeight:Xe},Et={...Dt.css,textDecoration:"none",transform:Pd(cn)},Bt=Dt.className,rn=(ye==null?void 0:ye.mode)!=="Off",Zt=(ye==null?void 0:ye.icon)??"",ui=_$(Zt),En=H$(Zt,ui),Qn=!!En,kr=hn(Math.min(Ot,kt)),Xo=!!(rn&&Zt&&Gt==="right")?"left":"right",Ql=Array.isArray(St)?St:[],Ga=[O!=="default"?`${g}-state-${O}`:"",U||T==="open"?`${g}-state-open`:"",ae&&ae!==O&&ae!==T?`${g}-state-${ae}`:""].filter(Boolean).join(" "),Xp=t&&!i?`${g}-editor`:"",Zl=ie?`${g}-interactive`:"",Up=be&&(O!==re||le)?`${g}-nav-state-anim`:"",qp=U?`${g}-open`:"",Yp=s.useMemo(()=>j$(m.current),[$,U,d]),Xa=()=>{G(!1)},Ua=!t||i,Kp=Mt=>{if(A){q.current=Mt;return}Mt()};s.useEffect(()=>{if(U)return;const Mt=q.current;q.current=null,Mt==null||Mt()},[U]);const Jl=(Mt,Xt)=>{D$(Mt,Xa,{isEditor:t,isPreviewMode:i,item:Xt,pages:u,onLinkNavigate:p,runAfterClose:Kp})},Qp=()=>{t&&!i||G(Mt=>!Mt)},Zp=Mt=>{Mt.pointerType==="touch"&&Mt.currentTarget.blur()},Ar=()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)};s.useEffect(()=>{if(!le)return;const Mt=window.setTimeout(()=>{J(!1)},tn);return()=>window.clearTimeout(Mt)},[le,O]),s.useEffect(()=>{if(U){Ar(),I(!0);return}return S.current+=1,E(!1),Ar(),W.current=window.setTimeout(()=>{W.current=null,I(!1)},Cn),Ar},[U]),s.useLayoutEffect(()=>{z.current!==d&&(z.current=d,S.current+=1,Ar(),G(!1),E(!1),I(!1))},[d]),s.useLayoutEffect(()=>{var ln;if(!$||!U)return;const Mt=S.current+1;S.current=Mt,E(!1),(ln=x.current)==null||ln.offsetHeight;const Xt=requestAnimationFrame(()=>{S.current===Mt&&E(!0)});return()=>{cancelAnimationFrame(Xt)}},[$,U]),s.useLayoutEffect(()=>{if(!A||!$)return;const Mt=f.current;if(!Mt)return;const Xt=getComputedStyle(Mt).backgroundColor;if(!Xt)return;const ln=document.documentElement,{body:fn}=document,Sn=ln.style.backgroundColor,kn=fn.style.backgroundColor;return ln.style.backgroundColor=Xt,fn.style.backgroundColor=Xt,()=>{ln.style.backgroundColor=Sn,fn.style.backgroundColor=kn}},[A,$,Ga,Ye,Lt]),s.useEffect(()=>{v==null||v(U)},[U,v]),s.useEffect(()=>{if(!U)return;const Mt=Xt=>{Xt.key==="Escape"&&(t&&i||Xa())};return window.addEventListener("keydown",Mt),()=>window.removeEventListener("keydown",Mt)},[U,t,i]),s.useEffect(()=>{t&&!i&&T!=="open"&&G(!1)},[t,i,T]),s.useEffect(()=>{i&&G(!1)},[i]);const ec=bn&&U,Jp=Mt=>Ql.filter(Xt=>g$(Xt,d)).map((Xt,ln)=>{const{label:fn,href:Sn,target:kn}=Qs(Xt,u),to=Sn?a.jsx("a",{href:Sn,target:kn,rel:kn==="_blank"?"noopener noreferrer":void 0,className:`${Mt} ${g}-has-href`,onClick:Uo=>Jl(Uo,Xt),children:eo(fn)}):a.jsx("span",{className:Mt,children:eo(fn)});return a.jsxs(s.Fragment,{children:[ln>0&&a.jsx("div",{"data-controls":ec?"gap":void 0,"data-controls-axis":"y",className:ec?`${g}-gap-control`:void 0,style:{height:hn(Ue)}}),to]},ln)}),eg=$?a.jsxs("div",{ref:x,"data-selection":"none",className:[`${g}-lightbox`,`${g}-full-lightbox ${g}-effect-${it}`,D?`${g}-lightbox-active`:"",`${g}-lightbox-editor`,n?`${g}-lightbox-edit-mode`:"",Zl,Ga].filter(Boolean).join(" "),style:{...gt,...Yp},"aria-hidden":!D,children:[a.jsx("div",{className:[`${g}-backdrop`,Ua?`${g}-backdrop-clickable`:""].filter(Boolean).join(" "),"aria-hidden":"true",onClick:Ua?Xa:void 0}),a.jsxs("nav",{className:[`${g}-panel`,Ua?`${g}-panel-blocking`:""].filter(Boolean).join(" "),style:k,"aria-label":"Menu","data-lightbox-scrollable":"",children:[bn&&L$(g,Ji,qt.fontSize,hn),Jp(`${g}-link`)]}),A?a.jsx("div",{ref:f,className:`${g}-safari-tint`,"aria-hidden":"true"}):null]}):null,tg=()=>a.jsx("button",{type:"button",className:`${g}-toggle`,onClick:Qp,onPointerUp:Zp,"aria-expanded":U,"aria-label":U?"Close menu":"Open menu",children:a.jsx(f$,{className:`${g}-icon`,lineClassName:`${g}-icon-line`})}),Fr=Mt=>{const Xt=Mt==="left",ln=Xt?je:Fe,fn=Xt?Go:xn,Sn=Xt?di:Zi,kn=Tt?Xt?"compactNavPaddingLeft":"compactNavPaddingRight":Xt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Xt?`${g}-nav-padding-left`:`${g}-nav-padding-right`,style:{width:hn(ln),flexShrink:0},children:Kn?a.jsx("div",{"data-controls":kn,"data-controls-axis":"x","data-controls-variant":"column-padding",...Xt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(Sn),className:`${g}-control-anchor`,style:{top:0,[Xt?"left":"right"]:0,width:hn(fn),height:"100%"}}):null})},ng=(Mt,Xt)=>{const{label:ln,href:fn,target:Sn}=Qs(Mt,u),kn=a.jsx("span",{className:Bt,style:Et,children:Ad(ln)}),to=Hd(g,kn,ft,Kn,hn),Uo=fn?a.jsx("a",{href:fn,target:Sn,rel:Sn==="_blank"?"noopener noreferrer":void 0,className:`${g}-nav-link ${g}-has-href`,onClick:Nr=>Jl(Nr,Mt),children:to}):a.jsx("span",{className:`${g}-nav-link`,children:to});return a.jsxs(s.Fragment,{children:[Xt>0&&a.jsx("div",{"data-controls":Kn?Tt?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:Kn?`${g}-gap-control ${g}-nav-gap-control`:`${g}-nav-gap-control}`,style:{width:hn(Vo),flexShrink:0}}),Uo]},Xt)},ig={...gt,height:F.scalingValue(kt,t),minHeight:F.scalingValue(kt,t),[`--${g}-panel-height`]:F.scalingValue(kt,t)},og=l&&O==="default"&&T!=="open"&&!i?hn(se+o$):"0px";return a.jsxs("div",{ref:m,className:`${g}-root ${Ga} ${Xp} ${Zl} ${Up}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:og,...gt},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),a.jsx("span",{ref:b,"aria-hidden":!0,style:Md(Dt.css),children:"H"}),a.jsx("span",{ref:M,"aria-hidden":!0,style:Md(an.css),children:"H"}),a.jsx("div",{className:`${g}-nav-slide`,children:a.jsxs("div",{className:`${g}-nav-bar`,style:ig,children:[rn&&Zt?a.jsxs("div",{className:`${g}-nav-logo ${g}-nav-logo-${Gt}`,children:[Gt==="left"?Fr("left"):null,a.jsxs("div",{className:`${g}-nav-logo-inner${Qn?` ${g}-nav-logo-tinted`:""}`,style:{height:kr,...Qn&&En?{[`--${g}-logo-image`]:F$(En)}:{}},children:[a.jsx("img",{src:Qn&&En?En:Zt,alt:"",className:`${g}-nav-logo-img`}),Qn?a.jsx("span",{className:`${g}-nav-logo-tint`,"aria-hidden":"true"}):null]}),Gt==="right"?Fr("right"):null]}):null,a.jsx("nav",{className:`${g}-nav-links ${g}-nav-links-${ut}`,style:{transform:d$(ut,H,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${g}-nav-links-inner`,children:Ql.filter(Mt=>p$(Mt,O,d)).map((Mt,Xt)=>ng(Mt,Xt))})})]})}),eg,a.jsxs("div",{className:`${g}-nav-toggle-wrap ${g}-nav-toggle-wrap-${Xo}`,children:[Xo==="left"?Fr("left"):null,Ht?a.jsx("div",{className:`${g}-root ${qp}`.trim(),style:lt,children:tg()}):null,Xo==="right"?Fr("right"):null]})]})}const G$=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
|
|
24689
|
+
`}function Qs(e){return e?!e.startsWith("http://")&&!e.startsWith("https://")&&!e.startsWith("blob:")&&!e.startsWith("data:"):!1}function O$(e,t){var i;const n=(i=e.logo)==null?void 0:i.icon;return!e.logo||Qs(n)||!t?e:{...e,logo:{...e.logo,icon:t}}}function D$(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function B$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function z$(e){const t=B$(e),[n,i]=s.useState(!1);return s.useEffect(()=>{if(t||!e.startsWith("blob:")){i(!1);return}let o=!1;return fetch(e).then(r=>r.blob()).then(async r=>{if(o)return;if(r.type.includes("svg")){i(!0);return}if(r.type.startsWith("image/")&&!r.type.includes("svg")){i(!1);return}const l=await r.text();o||i(/<svg[\s>]/i.test(l.trim()))}).catch(()=>{o||i(!1)}),()=>{o=!0}},[t,e]),t||n}function j$(e,t){const[n,i]=s.useState(yr(e)?e:null);return s.useEffect(()=>{if(!t||!e){i(null);return}if(yr(e)){i(e);return}let o=!1;return Uu(e).then(r=>{o||i(r)}).catch(()=>{o||i(null)}),()=>{o=!0}},[t,e]),t?n:null}function V$(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function G$(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function Bp(e){if(!e)return null;const t=document.getElementById(e),n=document.querySelector(`[data-section-id="${CSS.escape(e)}"]`),i=t??n;return i instanceof HTMLElement?i:null}function _d(e){const t=Bp(e);return t?(t.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function X$(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:c}=n,d=n.runAfterClose??(x=>x()),u=e.currentTarget.getAttribute("href")??"",p=V$(u),v=e.currentTarget.target==="_blank";if(r&&c){e.preventDefault(),e.stopPropagation();const x=Ks(r,l),m=_p(r),h={mode:m.type==="url"?"url":"page",href:x.href||u,page:m.type==="page"?m.value:void 0,url:m.type==="url"?m.value:void 0,anchor:m.type==="anchor"?m.value.replace(/^#/,""):(m.anchor??"").replace(/^#/,""),target:x.target};h.target==="_blank"?c(h):d(()=>c(h)),t();return}if(i){e.preventDefault(),d(()=>_d(p)),t();return}!v&&p&&G$(u)&&Bp(p)&&(e.preventDefault(),d(()=>_d(p))),t()}const q$=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function U$(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function Y$(e){const t={},n=U$(e);if(!n)return t;const i=getComputedStyle(n);for(const o of q$){const r=i.getPropertyValue(o).trim();r&&(t[o]=r)}return t}function Hd(e,t,n,i,o){return a.jsx("span",{className:`${e}-link-text-box`,style:{width:o(n),maxWidth:"100%"},children:a.jsx("span",{className:i?`${e}-link-text-inner`:`${e}-link-text-inner-hidden`,style:{width:"100%"},children:t})})}function K$({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,activeEvent:o,currentState:r,isSwitchClone:l=!1,unavailableStates:c=[],layoutId:d,pages:u,onLinkNavigate:p,onUpdateSettings:v,onOpenChange:x}){var tc;const{prefix:m}=A.useScopedStyles(),h=s.useRef(null),b=s.useRef(null),S=s.useRef(null),M=s.useRef(null),y=s.useRef(null),$=s.useRef(0),R=s.useRef(null),X=s.useRef(null),B=s.useRef(d),O=s.useMemo(()=>W$(m),[m]),[N,z]=s.useState(!1),[C,I]=s.useState(!1),[j,E]=s.useState(!1),w=m$(r),L=s.useMemo(()=>new Set(c),[c]),V=Ft=>!!(Ft&&L.has(Ft)),K=!!(t&&!i&&w==="open"&&!V("open"))||!(t&&!i)&&N,P=!!(t&&!i),f=K&&!P;jl(f),s.useEffect(()=>{if(!K||!P)return;const Ft=document.documentElement,Kt=Ft.style.overflow;return Ft.style.overflow="hidden",()=>{Ft.style.overflow=Kt}},[K,P]);const U=!V("compact")&&!V("onScroll"),te=!t||!!i&&!n,ce=o&&o!=="default"?o:void 0,F=U&&w==="compact"?"compact":"default",[ie,T]=s.useState(F),[le,J]=s.useState(!1),Se=!n;F!==ie&&(T(F),Se&&J(!0));const Le=Dp(e),{logo:me,logoMaxHeight:ye=120/1440,logoPosition:ee="left",panelHeight:oe=60/1440,backgroundColor:re="#b3b3b3",logoColor:ge="#000000",position:we,horizontalAlign:Ae,verticalAlign:fe,iconColor:ve="#000000",showIcon:xe="on",iconSize:g=16/1440,linkColor:G="#000000",openLinkColor:Q="#000000",compactIconColor:ne="#000000",compactLinkColor:ue="#000000",compactLogoColor:q="#000000",compactBackgroundColor:D="#ffffff",compactLogoMaxHeight:se=120/1440,compactLogoPosition:Y,compactPanelHeight:pe=60/1440,compactShowIcon:H="on",compactIconSize:Ie=16/1440,compactNavTextWidth:de,compactNavTextPosition:Z,compactNavTextOffset:Ne,compactNavGap:Oe,compactNavPaddingLeft:Je=10/1440,compactNavPaddingRight:De=10/1440,compactFontFamily:Ze,compactFontSettings:at,compactFontSize:Xe,compactLineHeight:be,compactLetterSpacing:He=0,compactWordSpacing:je=0,compactTextAlign:Qe="left",compactTextAppearance:Ce,openLogoColor:_e="#000000",menuBackgroundColor:Ue="#ffffff",overlayColor:Ye="rgba(0, 0, 0, 0.45)",closeButtonColor:lt="#000000",effect:it="fade",openPanelSize:qe=100,textWidth:Ee=280/1440,navTextWidth:pt,navTextPosition:ke="center",navTextOffset:We=0,gap:Ve=0,navGap:ct,navPaddingLeft:ot=10/1440,navPaddingRight:xt=10/1440,textPaddingLeft:Pt=10/1440,textPaddingRight:Vt=10/1440,textPaddingTop:vt=10/1440,textPaddingBottom:Mt=10/1440,fontFamily:Ht,fontSettings:Gt,fontSize:kt,lineHeight:Pe,letterSpacing:Be=0,wordSpacing:ft=0,textAlign:$t="left",textAppearance:et,openFontFamily:Et,openFontSettings:Xt,openFontSize:mt,openLineHeight:gt,openLetterSpacing:Re,openWordSpacing:tt,openTextAlign:nt,openTextAppearance:st,stateOverrides:At,link:St}=Le,{horizontalAlign:ht,verticalAlign:Dt}=P$({position:we,horizontalAlign:Ae,verticalAlign:fe}),Ct=F==="compact",qt=Ct?se:ye,jt=g$(Ct?Y:ee),Nt=Ct?pe:oe,Bt=Ct?Ie:g,Wt=Ct?de:pt,wt=h$(Ct?Z:ke),W=(Ct?Ne:We)??0,Te=Ct?Oe:ct,ze=Ct?Je:ot,Fe=Ct?De:xt,yt=Wt??Ee,Ot=K||(Ct?H:xe)!=="off",ut=A.buildColorVars(m,{iconColor:ve,closeButtonColor:lt,linkColor:G,openLinkColor:Q,compactIconColor:ne,compactLinkColor:ue,compactLogoColor:q,compactBackgroundColor:D,openLogoColor:_e,menuBackgroundColor:Ue,overlayColor:Ye,backgroundColor:re,logoColor:ge},F$,N$,At),Tt=Ed(Ct?{fontFamily:Ze,fontSettings:at,fontSize:Xe,lineHeight:be,letterSpacing:He,wordSpacing:je,textAlign:Qe,textAppearance:Ce}:{fontFamily:Ht,fontSettings:Gt,fontSize:kt,lineHeight:Pe,letterSpacing:Be,wordSpacing:ft,textAlign:$t,textAppearance:et}),Yt=Ed({fontFamily:Et,fontSettings:Xt,fontSize:mt,lineHeight:gt,letterSpacing:Re,wordSpacing:tt,textAlign:nt,textAppearance:st},Tt),It=kd(m,Tt,t),Zt=kd(m,Yt,t),on=Ld(S,Rd(Tt)),Wn=Ld(M,Rd(Yt)),xn={...Zt.css,whiteSpace:"pre-wrap",transform:Pd(Wn)},ui=Zt.className,dn=Ft=>A.scalingValue(Ft,t),pi=Te??Ve,Kn=Math.max(ze,fo),bn=Math.max(Fe,fo),mi=Math.max(0,1-Bt),eo=Math.max(0,1-Bt),Sn=n??!1,Qn=Sn&&!K,to=s.useMemo(()=>Op({textPaddingLeft:Pt,textPaddingRight:Vt,textPaddingTop:vt,textPaddingBottom:Mt,fontSize:Yt.fontSize}),[Pt,Vt,vt,Mt,Yt.fontSize]),no=Ft=>{const Kt=a.jsx("span",{className:ui,style:xn,children:Ad(Ft)});return Hd(m,Kt,Ee,Sn,dn)},Ke=it==="left"||it==="right"?{width:`${qe}%`}:{height:`${qe}%`},k={...k$(to,t),...Ke,alignItems:H$[ht],justifyContent:_$[Dt]},ae=s.useRef(e),he=s.useRef(d),Me=s.useRef(null);Qs((tc=e.logo)==null?void 0:tc.icon)&&(Me.current=e.logo.icon),s.useEffect(()=>{var Nr;if(!v||!t){ae.current=e,he.current=d;return}const Ft=(Nr=e.logo)==null?void 0:Nr.icon;if(e.logo&&!Qs(Ft)&&!Me.current){ae.current=e,he.current=d;return}const Kt=_r=>{v(O$(_r,Me.current))};if(he.current!==d){ae.current=e,he.current=d;const _r=Nd(e);_r!==e&&Kt(_r);return}const cn=Nd(e),fn=ae.current,wn=fn!==e,An=wn?E$(cn,fn):cn;ae.current=e;const io=cn!==e,qo=wn&&R$(cn,An);!io&&!qo||Kt(An)},[e,v,t,d]);const Ge=A.scalingValue(Bt,t),dt={width:Ge,height:Ge,minWidth:Ge,minHeight:Ge,maxWidth:Ge,maxHeight:Ge},_t={...It.css,textDecoration:"none",transform:Pd(on)},Ut=It.className,sn=(me==null?void 0:me.mode)!=="Off",en=(me==null?void 0:me.icon)??"",gi=z$(en),kn=j$(en,gi),Zn=!!kn,kr=dn(Math.min(qt,Nt)),Xo=!!(sn&&en&&jt==="right")?"left":"right",Ql=Array.isArray(St)?St:[],Ga=[F!=="default"?`${m}-state-${F}`:"",K||w==="open"?`${m}-state-open`:"",ce&&ce!==F&&ce!==w?`${m}-state-${ce}`:""].filter(Boolean).join(" "),Zp=t&&!i?`${m}-editor`:"",Zl=te?`${m}-interactive`:"",Jp=Se&&(F!==ie||le)?`${m}-nav-state-anim`:"",em=K?`${m}-open`:"",tm=s.useMemo(()=>Y$(h.current),[C,K,d]),Xa=()=>{z(!1)},qa=!t||i,nm=Ft=>{if(f){X.current=Ft;return}Ft()};s.useEffect(()=>{if(K)return;const Ft=X.current;X.current=null,Ft==null||Ft()},[K]);const Jl=(Ft,Kt)=>{X$(Ft,Xa,{isEditor:t,isPreviewMode:i,item:Kt,pages:u,onLinkNavigate:p,runAfterClose:nm})},im=()=>{t&&!i||z(Ft=>!Ft)},om=Ft=>{Ft.pointerType==="touch"&&Ft.currentTarget.blur()},Ar=()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null)};s.useEffect(()=>{if(!le)return;const Ft=window.setTimeout(()=>{J(!1)},rn);return()=>window.clearTimeout(Ft)},[le,F]),s.useEffect(()=>{if(K){Ar(),I(!0);return}return $.current+=1,E(!1),Ar(),R.current=window.setTimeout(()=>{R.current=null,I(!1)},Tn),Ar},[K]),s.useLayoutEffect(()=>{B.current!==d&&(B.current=d,$.current+=1,Ar(),z(!1),E(!1),I(!1))},[d]),s.useLayoutEffect(()=>{var cn;if(!C||!K)return;const Ft=$.current+1;$.current=Ft,E(!1),(cn=b.current)==null||cn.offsetHeight;const Kt=requestAnimationFrame(()=>{$.current===Ft&&E(!0)});return()=>{cancelAnimationFrame(Kt)}},[C,K]),s.useLayoutEffect(()=>{if(!f||!C)return;const Ft=y.current;if(!Ft)return;const Kt=getComputedStyle(Ft).backgroundColor;if(!Kt)return;const cn=document.documentElement,{body:fn}=document,wn=cn.style.backgroundColor,An=fn.style.backgroundColor;return cn.style.backgroundColor=Kt,fn.style.backgroundColor=Kt,()=>{cn.style.backgroundColor=wn,fn.style.backgroundColor=An}},[f,C,Ga,Ue,At]),s.useEffect(()=>{x==null||x(K)},[K,x]),s.useEffect(()=>{if(!K)return;const Ft=Kt=>{Kt.key==="Escape"&&(t&&i||Xa())};return window.addEventListener("keydown",Ft),()=>window.removeEventListener("keydown",Ft)},[K,t,i]),s.useEffect(()=>{t&&!i&&w!=="open"&&z(!1)},[t,i,w]),s.useEffect(()=>{i&&z(!1)},[i]);const ec=Sn&&K,rm=Ft=>Ql.filter(Kt=>x$(Kt,d)).map((Kt,cn)=>{const{label:fn,href:wn,target:An}=Ks(Kt,u),io=wn?a.jsx("a",{href:wn,target:An,rel:An==="_blank"?"noopener noreferrer":void 0,className:`${Ft} ${m}-has-href`,onClick:qo=>Jl(qo,Kt),children:no(fn)}):a.jsx("span",{className:Ft,children:no(fn)});return a.jsxs(s.Fragment,{children:[cn>0&&a.jsx("div",{"data-controls":ec?"gap":void 0,"data-controls-axis":"y",className:ec?`${m}-gap-control`:void 0,style:{height:dn(Ve)}}),io]},cn)}),am=C?a.jsxs("div",{ref:b,"data-selection":"none",className:[`${m}-lightbox`,`${m}-full-lightbox ${m}-effect-${it}`,j?`${m}-lightbox-active`:"",`${m}-lightbox-editor`,n?`${m}-lightbox-edit-mode`:"",Zl,Ga].filter(Boolean).join(" "),style:{...ut,...tm},"aria-hidden":!j,children:[a.jsx("div",{className:[`${m}-backdrop`,qa?`${m}-backdrop-clickable`:""].filter(Boolean).join(" "),"aria-hidden":"true",onClick:qa?Xa:void 0}),a.jsxs("nav",{className:[`${m}-panel`,qa?`${m}-panel-blocking`:""].filter(Boolean).join(" "),style:k,"aria-label":"Menu","data-lightbox-scrollable":"",children:[Sn&&A$(m,to,Yt.fontSize,dn),rm(`${m}-link`)]}),f?a.jsx("div",{ref:y,className:`${m}-safari-tint`,"aria-hidden":"true"}):null]}):null,sm=()=>a.jsx("button",{type:"button",className:`${m}-toggle`,onClick:im,onPointerUp:om,"aria-expanded":K,"aria-label":K?"Close menu":"Open menu",children:a.jsx(w$,{className:`${m}-icon`,lineClassName:`${m}-icon-line`})}),Fr=Ft=>{const Kt=Ft==="left",cn=Kt?ze:Fe,fn=Kt?Kn:bn,wn=Kt?mi:eo,An=Ct?Kt?"compactNavPaddingLeft":"compactNavPaddingRight":Kt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Kt?`${m}-nav-padding-left`:`${m}-nav-padding-right`,style:{width:dn(cn),flexShrink:0},children:Qn?a.jsx("div",{"data-controls":An,"data-controls-axis":"x","data-controls-variant":"column-padding",...Kt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(wn),className:`${m}-control-anchor`,style:{top:0,[Kt?"left":"right"]:0,width:dn(fn),height:"100%"}}):null})},lm=(Ft,Kt)=>{const{label:cn,href:fn,target:wn}=Ks(Ft,u),An=a.jsx("span",{className:Ut,style:_t,children:Ad(cn)}),io=Hd(m,An,yt,Qn,dn),qo=fn?a.jsx("a",{href:fn,target:wn,rel:wn==="_blank"?"noopener noreferrer":void 0,className:`${m}-nav-link ${m}-has-href`,onClick:Nr=>Jl(Nr,Ft),children:io}):a.jsx("span",{className:`${m}-nav-link`,children:io});return a.jsxs(s.Fragment,{children:[Kt>0&&a.jsx("div",{"data-controls":Qn?Ct?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:Qn?`${m}-gap-control ${m}-nav-gap-control`:`${m}-nav-gap-control}`,style:{width:dn(pi),flexShrink:0}}),qo]},Kt)},cm={...ut,height:A.scalingValue(Nt,t),minHeight:A.scalingValue(Nt,t),[`--${m}-panel-height`]:A.scalingValue(Nt,t)},dm=l&&F==="default"&&w!=="open"&&!i?dn(oe+d$):"0px";return a.jsxs("div",{ref:h,className:`${m}-root ${Ga} ${Zp} ${Zl} ${Jp}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:dm,...ut},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),a.jsx("span",{ref:S,"aria-hidden":!0,style:Md(It.css),children:"H"}),a.jsx("span",{ref:M,"aria-hidden":!0,style:Md(Zt.css),children:"H"}),a.jsx("div",{className:`${m}-nav-slide`,children:a.jsxs("div",{className:`${m}-nav-bar`,style:cm,children:[sn&&en?a.jsxs("div",{className:`${m}-nav-logo ${m}-nav-logo-${jt}`,children:[jt==="left"?Fr("left"):null,a.jsxs("div",{className:`${m}-nav-logo-inner${Zn?` ${m}-nav-logo-tinted`:""}`,style:{height:kr,...Zn&&kn?{[`--${m}-logo-image`]:D$(kn)}:{}},children:[a.jsx("img",{src:Zn&&kn?kn:en,alt:"",className:`${m}-nav-logo-img`}),Zn?a.jsx("span",{className:`${m}-nav-logo-tint`,"aria-hidden":"true"}):null]}),jt==="right"?Fr("right"):null]}):null,a.jsx("nav",{className:`${m}-nav-links ${m}-nav-links-${wt}`,style:{transform:f$(wt,W,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${m}-nav-links-inner`,children:Ql.filter(Ft=>v$(Ft,F,d)).map((Ft,Kt)=>lm(Ft,Kt))})})]})}),am,a.jsxs("div",{className:`${m}-nav-toggle-wrap ${m}-nav-toggle-wrap-${Xo}`,children:[Xo==="left"?Fr("left"):null,Ot?a.jsx("div",{className:`${m}-root ${em}`.trim(),style:dt,children:sm()}):null,Xo==="right"?Fr("right"):null]})]})}const Q$=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
|
|
24690
24690
|
import { CommonComponentProps } from '../props';
|
|
24691
24691
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
24692
24692
|
import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
|
|
@@ -27327,7 +27327,8 @@ export function Burger({
|
|
|
27327
27327
|
</div>
|
|
27328
27328
|
);
|
|
27329
27329
|
}
|
|
27330
|
-
`;function tr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Di={fontSettings:{type:"object",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0},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 yi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function Ul(e){return{[yi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[yi(e,"fontSettings")]:{...Di.fontSettings,scope:"common",title:""},[yi(e,"fontSize")]:{...Di.fontSize,scope:"layout",title:""},[yi(e,"lineHeight")]:{...Di.lineHeight,scope:"layout",title:""},[yi(e,"letterSpacing")]:{...Di.letterSpacing,scope:"layout",title:""},[yi(e,"wordSpacing")]:{...Di.wordSpacing,scope:"layout",title:""},[yi(e,"textAlign")]:{...Di.textAlign,scope:"layout",title:""},[yi(e,"textAppearance")]:{...Di.textAppearance,scope:"layout",title:""}}}const X$=Ul(""),U$=Ul("open"),q$=Ul("compact"),Y$=["__componentName__",{type:"row",items:["panelHeight","navTextWidth"]},{type:"row",title:"",items:["navTextPosition","navTextOffset"]},{type:"row",title:"Logo",items:["logoMaxHeight","logoPosition"]},{type:"row",title:"Hamburger",items:["iconSize","showIcon"]},"fontFamily","fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAlign","textAppearance","navGap","navPaddingLeft","navPaddingRight"],K$=["__componentName__",{type:"row",items:["compactPanelHeight","compactNavTextWidth"]},{type:"row",title:"",items:["compactNavTextPosition","compactNavTextOffset"]},{type:"row",title:"Logo",items:["compactLogoMaxHeight","compactLogoPosition"]},{type:"row",title:"Hamburger",items:["compactIconSize","compactShowIcon"]},"compactFontFamily","compactFontSettings",{type:"row",items:["compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing"]},"compactTextAlign","compactTextAppearance","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight"],Q$=["__componentName__",{type:"row",title:"Text",items:["textWidth","position"]},{type:"row",title:"Menu",items:["openPanelSize","effect"]},"openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],Jn={textTransform:"none",textDecoration:"none",fontVariant:"normal"},Ps={fontWeight:400,fontStyle:"normal"},ea={d:"Always",t:"Open Only",m:"Open Only"},Z$=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],J$=["iconColor","logoColor","linkColor","backgroundColor"],eC={type:"object",version:1,settings:{sizing:"auto manual",properties:{link:{type:"array",scope:"common",display:{type:"page-url-link"},items:{type:"object",properties:{link:{type:"object",properties:{type:{type:"string",enum:["url","page","anchor"]},value:{type:"string",message:"Paste URL here..."},target:{type:"string",enum:["blank","self"]},anchor:{type:"string"}}},label:{type:"string"},showIn:{type:"string",scope:"layout",enum:["Always","Open Only","Open and Compact","Default and Open","Default and Compact"]}}}},logo:{type:"object",scope:"common",title:"Logo",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Logo",display:{type:"settings-image-input"}}}},logoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},logoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactLogoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},logoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{default:"Logo Default",hover:"Logo Hover"},display:{type:"palette-color-picker"}},panelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover"},display:{type:"palette-color-picker"}},showIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},iconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},linkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover"},display:{type:"palette-color-picker"}},compactShowIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},compactIconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{compact:"Icon Default","compact-hover":"Icon Hover"},display:{type:"palette-color-picker"}},compactLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{compact:"Text Default","compact-hover":"Text Hover"},display:{type:"palette-color-picker"}},compactLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{compact:"Logo Default","compact-hover":"Logo Hover"},display:{type:"palette-color-picker"}},compactBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},openLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{open:"Text Default","open-hover":"Text Hover"},display:{type:"palette-color-picker"}},openLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{open:"Logo Default","open-hover":"Logo Hover"},display:{type:"palette-color-picker"}},menuBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},overlayColor:{type:"string",scope:"common",title:"Overlay Default",display:{type:"palette-color-picker"}},closeButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{open:"Close Default","open-hover":"Close Hover"},display:{type:"palette-color-picker"}},effect:{type:"string",scope:"layout",title:"Effect",display:{type:"toggle-cycle",enum:["fade","left","top","right","bottom"]}},openPanelSize:{type:"number",scope:"layout",title:"Height",display:{type:"percentage-input"},min:0,max:100},textWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},navTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},navTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},navTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:[...Z$]}},stateOverrides:{type:"object",scope:"common"},gap:tr("Gap"),navGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},textPaddingLeft:tr("Text padding left"),textPaddingRight:tr("Text padding right"),textPaddingTop:tr("Text padding top"),textPaddingBottom:tr("Text padding bottom"),compactLogoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},compactPanelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},compactIconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},compactNavTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},compactNavTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactNavTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},compactNavGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},...X$,...U$,...q$},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"About",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:ea}],logo:{mode:"On",icon:"01M3QM74XE09DSJCWGD1XM6Y45"},backgroundColor:"#ffffff",logoColor:"#000000",iconColor:"#000000",linkColor:"#000000",openLinkColor:"#000000",compactIconColor:"#000000",compactLinkColor:"#000000",compactLogoColor:"#000000",compactBackgroundColor:"#ffffff",openLogoColor:"#000000",menuBackgroundColor:"#ffffff",overlayColor:"rgba(0, 0, 0, 0.45)",closeButtonColor:"#000000",effect:"fade",showIcon:"on",compactShowIcon:"on",logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",compactNavTextPosition:"center",navTextOffset:0,compactNavTextOffset:0,position:"left-top",fontFamily:"Goudy Bookletter 1911",fontSettings:Ps,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:Ps,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:Ps,compactTextAlign:"left",stateOverrides:{hover:{linkColor:"#666666",iconColor:"#666666",logoColor:"#666666"},"open-hover":{closeButtonColor:"#666666"}}},displayRules:[{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.openLogoColor.display.visible",value:!1}},{if:{name:"effect",value:"left"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"effect",value:"right"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconSize.display.visible",value:!1}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconSize.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconColor.display.visible",value:!1}}],layoutDefaults:{m:{position:"center",panelHeight:50/375,logoMaxHeight:30/375,logoPosition:"center",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:30/375,textWidth:240/375,openPanelSize:100,navTextWidth:120/375,gap:24/375,navGap:24/375,navPaddingLeft:20/375,navPaddingRight:20/375,textPaddingLeft:10/375,textPaddingRight:10/375,textPaddingTop:10/375,textPaddingBottom:10/375,fontSize:16/375,lineHeight:20/375,letterSpacing:0,wordSpacing:0,textAppearance:Jn,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Jn,openTextAlign:"center",compactPanelHeight:40/375,compactLogoMaxHeight:20/375,compactShowIcon:"on",compactIconSize:16/375,compactNavTextWidth:80/375,compactNavGap:24/375,compactNavPaddingLeft:20/375,compactNavPaddingRight:20/375,compactFontSize:16/375,compactLineHeight:20/375,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Jn},t:{textAlign:"center",position:"center",panelHeight:60/768,logoMaxHeight:30/768,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:16/768,textWidth:300/768,openPanelSize:100,navTextWidth:90/768,gap:32/768,navGap:32/768,navPaddingLeft:20/768,navPaddingRight:20/768,textPaddingLeft:10/768,textPaddingRight:10/768,textPaddingTop:10/768,textPaddingBottom:10/768,fontSize:18/768,lineHeight:20/768,letterSpacing:0,wordSpacing:0,textAppearance:Jn,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Jn,openTextAlign:"center",compactTextAlign:"center",compactPanelHeight:40/768,compactLogoMaxHeight:20/768,compactShowIcon:"on",compactIconSize:16/768,compactNavTextWidth:80/768,compactNavGap:32/768,compactNavPaddingLeft:20/768,compactNavPaddingRight:20/768,compactFontSize:16/768,compactLineHeight:20/768,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Jn},d:{position:"center",panelHeight:50/1440,logoMaxHeight:30/1440,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:20/1440,textWidth:300/1440,openPanelSize:100,navTextWidth:60/1440,gap:12/1440,navGap:64/1440,navPaddingLeft:10/1440,navPaddingRight:10/1440,textPaddingLeft:10/1440,textPaddingRight:10/1440,textPaddingTop:10/1440,textPaddingBottom:10/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:Jn,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Jn,openTextAlign:"center",compactPanelHeight:30/1440,compactLogoMaxHeight:20/1440,compactShowIcon:"on",compactIconSize:20/1440,compactNavTextWidth:60/1440,compactNavGap:20/1440,compactNavPaddingLeft:10/1440,compactNavPaddingRight:10/1440,compactFontSize:16/1440,compactLineHeight:16/1440,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Jn,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactLinkColor","compactLogoColor","compactBackgroundColor","compactLogoMaxHeight","compactLogoPosition","compactPanelHeight","compactIconSize","compactNavTextWidth","compactNavTextPosition","compactNavTextOffset","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight","compactFontFamily","compactFontSettings","compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing","compactTextAlign","compactTextAppearance","openLogoColor","menuBackgroundColor","overlayColor","closeButtonColor","effect","textWidth","navTextWidth","navTextPosition","navTextOffset","position","gap","navGap","navPaddingLeft","navPaddingRight","textPaddingLeft","textPaddingRight","textPaddingTop","textPaddingBottom","fontFamily","fontSettings","fontSize","lineHeight","letterSpacing","wordSpacing","textAlign","textAppearance","openFontFamily","openFontSettings","openFontSize","openLineHeight","openLetterSpacing","openWordSpacing","openTextAlign","openTextAppearance"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","logo"]},{id:"default",icon:"default",title:"Default",tooltip:"Default State",layout:Y$},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:K$,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:Q$},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...J$],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},tC={element:V$,id:"basic-burger",name:"Basic Burger",category:"navigation",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple Burger.png"},layoutMode:"navigation",defaultSize:{d:{width:"100%",height:60/1440},t:{width:"100%",height:60/768},m:{width:"100%",height:56/375}},defaultNavigationPosition:{d:"switch",t:"switch",m:"stickyTop"},schema:eC,sourceCode:G$,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},Wd=120,Od=3,nC=.12,ql={x:0,y:0,width:100,height:100};function wo(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function Ia(e){return e<0?0:e>1?1:e}function Dd(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function iC(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const d of e)for(const u of d){const p=u.x*t.width,y=u.y*t.height;p<n&&(n=p),p>o&&(o=p),y<i&&(i=y),y>r&&(r=y)}const l=o-n,c=r-i;return!isFinite(l)||!isFinite(c)||l<=0||c<=0?null:{x:n,y:i,width:l,height:c}}function oC(e){return e.map(([t,n])=>({x:t,y:n}))}function Rs(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const c of e)for(const d of c)d.x<t&&(t=d.x),d.x>i&&(i=d.x),d.y<n&&(n=d.y),d.y>o&&(o=d.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(c=>c.map(d=>({x:(d.x-t)/r,y:(d.y-n)/l})))}function rC(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],c=o[(r+1)%o.length];(l.y<=t&&c.y>t||c.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(c.y-l.y)*(c.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=Ia(n[o]),l=Ia(n[o+1]);l>r&&i.push({x0:r,x1:l})}return aC(i)}function aC(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function sC(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function lC(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function cC(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function dC(e,t,n,i){let o=null;for(let r=0;r<Od;r+=1){const l=Ia(t+(n-t)*r/Math.max(1,Od-1)),c=rC(e,l),d=i==="avoid"?lC(c):c;if(o=o===null?d:sC(o,d),o.length===0)return[]}return o??[]}function Bd(e,t="stretch",n=ql){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Ri(i),c=$r(l);if(c.length)return t==="viewbox"?wo(c,n):Rs(c);if(typeof document>"u")return null;const d=i.split(/(?=[Mm])/).map(y=>y.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const y of d){const v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",y),u.appendChild(v);let g=0;try{g=v.getTotalLength()}catch{g=0}if(!g)continue;const m=[];for(let x=0;x<Wd;x+=1){const b=v.getPointAtLength(x/Wd*g);m.push({x:b.x,y:b.y})}p.push(m)}return p.length?t==="viewbox"?wo(p,n):Rs(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?wo([r],n):Rs([r])}const Yl={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"},Js="0 0 100 100",La=100,el=16,uC=12,pC=16,Ms=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,gC=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,zd=Math.PI/4,mC=8,hC=Math.PI/18,fC=8,ho=24,fo=[];function yC(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function Es(e,t){return dn(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function vC(e){const t=Ci(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:dn(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function xC(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return dn(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function jd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=Es(t,i);else{const c=e.trim();if(c&&/^[Mm]/.test(c)){const d=Ri(c);d.length&&(l=n==="viewbox"?Es(d,i):vC(d))}if(!l.length){const d=o!=="custom"?Yl[o]:void 0;d?l=Es(Ri(d),ql):l=yC()}}return o==="circle"?xC(l,r):l}function Vd(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":_o(dn(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function tl(e){const t=e==="rectangle"||e==="custom"?void 0:Yl[e];return t?wo($r(Ri(t)),ql):[oC([[0,0],[1,0],[1,1],[0,1]])]}function bC(e){const t=e.match(gC);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function Tn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function nl(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function pn(e){return{x:e.x,y:e.y}}function SC(e){return{p:pn(e.p),in:e.in?pn(e.in):null,out:e.out?pn(e.out):null}}function zn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(SC)}))}function dn(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function Gd(e,t,n,i=n){return dn(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function wC(e,t,n,i,o,r,l){let c=Math.abs(t),d=Math.abs(n);if(!c||!d||e.x===l.x&&e.y===l.y)return[{c1:pn(e),c2:pn(l),p:pn(l)}];const u=i*Math.PI/180,p=Math.cos(u),y=Math.sin(u),v=(e.x-l.x)/2,g=(e.y-l.y)/2,m=p*v+y*g,x=-y*v+p*g,b=m*m/(c*c)+x*x/(d*d);if(b>1){const U=Math.sqrt(b);c*=U,d*=U}const M=o===r?-1:1,f=c*c*x*x+d*d*m*m,S=Math.max(0,c*c*d*d-f),W=f===0?0:M*Math.sqrt(S/f),q=W*c*x/d,z=-W*d*m/c,L=p*q-y*z+(e.x+l.x)/2,_=y*q+p*z+(e.y+l.y)/2,G=Math.atan2((x-z)/d,(m-q)/c);let I=Math.atan2((-x-z)/d,(-m-q)/c)-G;!r&&I>0&&(I-=Math.PI*2),r&&I<0&&(I+=Math.PI*2);const D=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2))),E=I/D,T=4/3*Math.tan(E/4),C=(U,P)=>({x:L+p*c*U-y*d*P,y:_+y*c*U+p*d*P}),V=[];let w=G;for(let U=0;U<D;U+=1){const P=w+E,A=Math.cos(w),j=Math.sin(w),ie=Math.cos(P),ae=Math.sin(P);V.push({c1:C(A-T*j,j+T*A),c2:C(ie+T*ae,ae-T*ie),p:U===D-1?pn(l):C(ie,ae)}),w=P}return V}function Ri(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},c=null,d=null;const u=()=>{if(o&&i.length>2){const g=i[0],m=i[i.length-1];Math.abs(g.p.x-m.p.x)<1e-6&&Math.abs(g.p.y-m.p.y)<1e-6&&(g.in=m.in??g.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(g,m)=>{i.push({p:g,in:Gn(m??null,g),out:null}),r=g},y=g=>{if(!i.length)return;const m=i[i.length-1];m.out=Gn(g,m.p)};Ms.lastIndex=0;let v=Ms.exec(t);for(;v!==null;){const g=v[1],m=g.toUpperCase(),x=g!==m,b=bC(v[2]),M=f=>x?{x:r.x+b[f],y:r.y+b[f+1]}:{x:b[f],y:b[f+1]};if(m==="Z")o=!0,u(),r=pn(l),c=null,d=null;else if(m==="M"){for(let f=0;f+1<b.length;f+=2){const S=M(f);f===0&&(u(),l=pn(S)),p(S)}c=null,d=null}else if(m==="L"){for(let f=0;f+1<b.length;f+=2)p(M(f));c=null,d=null}else if(m==="H"){for(const f of b)p({x:x?r.x+f:f,y:r.y});c=null,d=null}else if(m==="V"){for(const f of b)p({x:r.x,y:x?r.y+f:f});c=null,d=null}else if(m==="C"){for(let f=0;f+5<b.length;f+=6){const S=M(f),W=M(f+2),q=M(f+4);y(S),p(q,W),c=W}d=null}else if(m==="S"){for(let f=0;f+3<b.length;f+=4){const S=c?nl(c,r):pn(r),W=M(f),q=M(f+2);y(S),p(q,W),c=W}d=null}else if(m==="Q")for(let f=0;f+3<b.length;f+=4){const S=M(f),W=M(f+2);y(Tn(r,S,2/3)),p(W,Tn(W,S,2/3)),d=S,c=null}else if(m==="T")for(let f=0;f+1<b.length;f+=2){const S=d?nl(d,r):pn(r),W=M(f);y(Tn(r,S,2/3)),p(W,Tn(W,S,2/3)),d=S,c=null}else if(m==="A")for(let f=0;f+6<b.length;f+=7){const S=x?{x:r.x+b[f+5],y:r.y+b[f+6]}:{x:b[f+5],y:b[f+6]};for(const W of wC(r,b[f],b[f+1],b[f+2],b[f+3]!==0,b[f+4]!==0,S))y(W.c1),p(W.p,W.c2);c=null,d=null}v=Ms.exec(t)}return u(),n}function Dn(e){return`${Number(e.toFixed(2))}`}function Gn(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function _p(e){return!!(Gn(e.in,e.p)||Gn(e.out,e.p))}function jo(e,t){return!Gn(e.out,e.p)&&!Gn(t.in,t.p)}function Xd(e,t){if(jo(e,t))return`L${Dn(t.p.x)},${Dn(t.p.y)}`;const n=Gn(e.out,e.p)??e.p,i=Gn(t.in,t.p)??t.p;return`C${Dn(n.x)},${Dn(n.y)} ${Dn(i.x)},${Dn(i.y)} ${Dn(t.p.x)},${Dn(t.p.y)}`}function _o(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${Dn(i.p.x)},${Dn(i.p.y)}`);let r=i;for(const l of o)t.push(Xd(r,l)),r=l;if(n.closed){const l=Xd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Hp(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function il(e,t,n){if(jo(e,t))return Tn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,c=3*r*r*n,d=3*r*n*n,u=n*n*n;return{x:l*e.p.x+c*i.x+d*o.x+u*t.p.x,y:l*e.p.y+c*i.y+d*o.y+u*t.p.y}}function $r(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Hp(n)){if(jo(o.from,o.to)){i.push(pn(o.from.p));continue}for(let r=0;r<el;r+=1)i.push(il(o.from,o.to,r/el))}n.closed||i.push(pn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Ci(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of $r(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function $C(e){const t=Ci(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function Wp(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function Op(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=uC)return{closed:!0,nodes:t.map(r=>({p:pn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/pC)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:pn(r),...Wp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Dp(e,t,n=1){if(!e.length)return!1;const i=Ci(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),c=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-c||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+c}function CC(e,t,n,i,o,r,l){const c=t.width>0?n.width/t.width:1,d=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(c>0)||!(d>0)?e:dn(e,u=>{const p=i+(u.x-t.x)*r,y=o+(u.y-t.y)*l;return{x:t.x+p/c,y:t.y+y/d}})}function TC(e,t){if(!e.length)return e;const n=Ci(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),c=t.x+(t.width-i*l)/2,d=t.y+(t.height-o*l)/2;return dn(e,u=>({x:c+(u.x-n.minX)*l,y:d+(u.y-n.minY)*l}))}function Bp(e){const t={x:0,y:0,width:La,height:La},n=e!=="custom"?Yl[e]:void 0,i=n?dn(Ri(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):dn(Op(tl("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=TC(i,t);return{shape:e,customPath:_o(o),pathFit:"viewbox",pathViewBox:Js}}function ta(e,t){return t>0?Math.round(e/t)*t:e}function IC(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,c=zn(e),d=c[t].nodes[n];return d.p={x:o.p.x+r,y:o.p.y+l},d.in&&(d.in={x:d.in.x+r,y:d.in.y+l}),d.out&&(d.out={x:d.out.x+r,y:d.out.y+l}),c}function Ud(e,t,n,i){var r;if(!t.length)return e;const o=zn(e);for(const{contour:l,node:c}of t){const d=(r=o[l])==null?void 0:r.nodes[c];d&&(d.p={x:d.p.x+n,y:d.p.y+i},d.in&&(d.in={x:d.in.x+n,y:d.in.y+i}),d.out&&(d.out={x:d.out.x+n,y:d.out.y+i}))}return o}function LC(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((c,d)=>d-c);for(const c of l)i=zp(i,r,c)}),i}function PC(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const c=zn(e),d=c[t].nodes[n];if(d[i]=pn(o),r){const p=i==="in"?"out":"in";d[p]=nl(o,d.p)}return c}function RC(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=zn(e);return r[t].nodes[n][i]=null,r}function MC(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const c=zn(e),d=c[t].nodes,u=n+1;if(jo(r,l))return d.splice(u,0,{p:Tn(r.p,l.p,i),in:null,out:null}),{contours:c,nodeIndex:u};const p=r.out??r.p,y=l.in??l.p,v=Tn(r.p,p,i),g=Tn(p,y,i),m=Tn(y,l.p,i),x=Tn(v,g,i),b=Tn(g,m,i),M=Tn(x,b,i),f=(n+1)%o.nodes.length;return d[n].out=v,d[f].in=m,d.splice(u,0,{p:M,in:x,out:b}),{contours:c,nodeIndex:u}}function zp(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=zn(e);return o[t].nodes.splice(n,1),o}function qd(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=zn(e),l=r[t].nodes,c=l[n],d=l.length,u=(n-1+d)%d,p=(n+1)%d,y=!!Gn(l[u].out,l[u].p),v=!!Gn(l[p].in,l[p].p);if(_p(c)||y||v)return c.in=null,c.out=null,l[u].out=null,l[p].in=null,r;const g=Wp(l[u].p,c.p,l[p].p);return c.in=g.in,c.out=g.out,r}function EC(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),c={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-c.x,e.y-c.y),point:c}}function Yd(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Hp(i)){const l=jo(r.from,r.to)?1:el;for(let c=0;c<l;c+=1){const d=c/l,u=(c+1)/l,p=EC(t,il(r.from,r.to,d),il(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:d+(u-d)*p.t,distance:p.distance,point:p.point})}}}),n}function kC(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Kd(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(c=>Math.abs(c-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Qd(e,t,n,i,o){const r=i(t)[n];let l=null,c=1/0;for(const d of e){const u=n==="x"?{x:d.value,y:t.y}:{x:t.x,y:d.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=c||(l=d,c=p)}return l}function AC(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function FC(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function ol(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function NC(e,t){const n=ol(e,t);return n?{kind:"align",a:{x:e.x-n.x*ho,y:e.y-n.y*ho},b:{x:t.x+n.x*ho,y:t.y+n.y*ho}}:{kind:"align",a:e,b:t}}function rl(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Zd(e,t,n,i,o){if(e.axis===null)return NC(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return rl(o(r)[t],t,i)}function _C(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Zd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Zd(n,"y",l,i,o)),r}function HC(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return ol(i(l),r);const c=e.nodes.length,d=t+(n==="in"?1:-1);if(!e.closed&&(d<0||d>=c))return null;const u=e.nodes[(d+c)%c];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return ol(i(p),r)}function WC(e,t,n,i,o,r,l){const c=r(t),d=r(e),u=d.x-c.x,p=d.y-c.y,y=Math.hypot(u,p);if(y<1e-6)return{point:e,guides:fo};const v=Math.atan2(p,u),g=Math.round(v/zd)*zd;let m=o?g:null,x=!1;if(!o){const z=[];n&&z.push({angle:Math.atan2(n.y,n.x),smooth:!0}),z.push({angle:g,smooth:!1});for(const L of z){const _=FC(L.angle-v);if(!(Math.abs(_)>hC)&&!(Math.abs(Math.sin(_))*y>mC)){m=L.angle,x=L.smooth;break}}}const b=i!==null&&i>0&&Math.abs(y-i)<=fC;if(m===null&&!b)return{point:e,guides:fo};const M=m??v,f=b?i:y,S={x:Math.cos(M),y:Math.sin(M)},W=f+(m===null?0:ho),q=b?f:x?ho:0;return{point:l({x:c.x+S.x*f,y:c.y+S.y*f}),guides:[{kind:"angle",a:{x:c.x-S.x*q,y:c.y-S.y*q},b:{x:c.x+S.x*W,y:c.y+S.y*W}}]}}const al=.1,sl=8,OC=4,Jd=10,Pa=(e,t)=>{switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}},jp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},ll=(e,t)=>{const n=Pa(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Jd,y:n.y+o*Jd}},cl=(e,t)=>!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height),Vi=(e,t,n)=>{const i=cl(e,t)*n;return{width:t.width*i,height:t.height*i}},Bn=(e,t,n)=>(e-t)*n,yo=(e,t,n,i)=>{const o=e-t;if(Math.abs(o)<1e-6)return .5;const r=n/o;return(i==null?void 0:i.clamp)===!1?r:Math.abs(o)<OC?.5:Ia(r)},DC=(e,t,n,i,o,r)=>{const l=Vi(e,n,r),c=e.x+Bn(e.width,l.width,i),d=e.y+Bn(e.height,l.height,o),u=cl(e,n),p=cl(t,n),y=Math.min(sl,Math.max(al,p>0?r*(u/p):r)),v=Vi(t,n,y);return{focalX:yo(t.width,v.width,c-t.x,{clamp:!1}),focalY:yo(t.height,v.height,d-t.y,{clamp:!1}),scale:y}},eu=1.08,na=14,ia=8;function BC({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:c,focalX:d,focalY:u,scale:p,onChange:y,onCommit:v}){const g=s.useRef(null),m=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,x=s.useRef(null),b=s.useRef(null),M=s.useRef({focalX:d,focalY:u,scale:p});M.current={focalX:d,focalY:u,scale:p};const f=l==="image";s.useEffect(()=>{var E;f&&((E=g.current)==null||E.focus({preventScroll:!0}))},[f]);const S=s.useCallback((E,T)=>{var V;const C=(V=g.current)==null?void 0:V.getBoundingClientRect();return!C||C.width<=0||C.height<=0?{x:0,y:0}:{x:(E-C.left)/C.width*t.width,y:(T-C.top)/C.height*t.height}},[t.width,t.height]),W=E=>{var C,V;if(!i)return;E.stopPropagation(),E.preventDefault(),(C=g.current)==null||C.focus({preventScroll:!0});const T=Vi(n,i,p);x.current={pointerId:E.pointerId,origin:S(E.clientX,E.clientY),startX:Bn(n.width,T.width,d),startY:Bn(n.height,T.height,u),width:T.width,height:T.height,moved:!1},(V=g.current)==null||V.setPointerCapture(E.pointerId)},q=(E,T)=>{var ie,ae;if(!i)return;E.stopPropagation(),E.preventDefault(),(ie=g.current)==null||ie.focus({preventScroll:!0});const C=Vi(n,i,p),V=Bn(n.width,C.width,d),w=Bn(n.height,C.height,u),U={minX:V,minY:w,maxX:V+C.width,maxY:w+C.height},P=Pa(U,jp(T)),A=Pa(U,T),j=Math.hypot(A.x-P.x,A.y-P.y);!isFinite(j)||j<=0||(b.current={pointerId:E.pointerId,anchor:P,startDistance:j,startScale:p,startX:V,startY:w,moved:!1},(ae=g.current)==null||ae.setPointerCapture(E.pointerId))},z=E=>{if(!i)return;const T=b.current;if(T&&E.pointerId===T.pointerId){E.stopPropagation(),E.preventDefault();const V=S(E.clientX,E.clientY),w={x:V.x-n.x,y:V.y-n.y},U=Math.hypot(w.x-T.anchor.x,w.y-T.anchor.y),P=Math.min(sl,Math.max(al,T.startScale*(U/T.startDistance)));if(!T.moved&&Math.abs(P-T.startScale)<1e-4)return;T.moved=!0;const A=P/T.startScale,j=T.anchor.x+(T.startX-T.anchor.x)*A,ie=T.anchor.y+(T.startY-T.anchor.y)*A,ae=Vi(n,i,P);y({focalX:yo(n.width,ae.width,j),focalY:yo(n.height,ae.height,ie),scale:P});return}const C=x.current;if(C&&E.pointerId===C.pointerId){E.stopPropagation(),E.preventDefault();const V=S(E.clientX,E.clientY),w=V.x-C.origin.x,U=V.y-C.origin.y;if(!C.moved&&w===0&&U===0)return;C.moved=!0,y({focalX:yo(n.width,C.width,C.startX+w),focalY:yo(n.height,C.height,C.startY+U),scale:p})}},L=E=>{var V,w;const T=x.current;if(T&&E.pointerId===T.pointerId){x.current=null,E.stopPropagation(),(V=g.current)!=null&&V.hasPointerCapture(T.pointerId)&&g.current.releasePointerCapture(T.pointerId),T.moved&&v(M.current);return}const C=b.current;C&&E.pointerId===C.pointerId&&(b.current=null,E.stopPropagation(),(w=g.current)!=null&&w.hasPointerCapture(C.pointerId)&&g.current.releasePointerCapture(C.pointerId),C.moved&&v(M.current))},_=E=>{if(E.key==="Escape"){E.stopPropagation(),c("none");return}if(E.key==="="||E.key==="+"||E.key==="-"||E.key==="_"){E.preventDefault(),E.stopPropagation();const T=E.key==="="||E.key==="+",C=Math.min(sl,Math.max(al,p*(T?eu:1/eu))),V={focalX:d,focalY:u,scale:C};y(V),v(V)}},G=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},I=s.useMemo(()=>{const E=i??{width:n.width,height:n.height},T=Vi(n,E,p);return!(T.width>0)||!(T.height>0)?null:{x:n.x+Bn(n.width,T.width,d),y:n.y+Bn(n.height,T.height,u),width:T.width,height:T.height}},[i,n.x,n.y,n.width,n.height,d,u,p]),D=I?{minX:I.x,minY:I.y,maxX:I.x+I.width,maxY:I.y+I.height}:$;return a.jsxs("svg",{ref:g,className:`${e}-editor${f?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:_,onPointerMove:z,onPointerUp:L,onPointerCancel:L,onLostPointerCapture:L,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>c("none")}),f&&o&&I&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:m,maskUnits:"userSpaceOnUse",x:I.x,y:I.y,width:I.width,height:I.height,children:[a.jsx("rect",{x:I.x,y:I.y,width:I.width,height:I.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:I.x,y:I.y,width:I.width,height:I.height,preserveAspectRatio:"none",mask:`url(#${m})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:I.x,y:I.y,width:I.width,height:I.height})]}),f&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:W}),G.map(E=>{const T=ll(D,E),C=E==="ne"||E==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:T.x-ia/2,y:T.y-ia/2,width:ia,height:ia}),a.jsx("rect",{className:`${e}-editor-scale-grab${C?` ${e}-editor-scale-grab-nesw`:""}`,x:T.x-na/2,y:T.y-na/2,width:na,height:na,onPointerDown:V=>q(V,E)})]},E)})]})]})}const dl=10,zC=dl*2,On=7,jC=4,so=9,VC=3.5,tu=1.08,GC=.05,oa=14,XC=1,ra=14,aa=8;function UC({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:c,onStageChange:d,onSelectionChange:u,onChange:p,onCommit:y}){const v=s.useRef(null),g=s.useRef(null),m=s.useRef(i);m.current=i;const x=s.useRef(null),b=s.useRef(null),M=s.useRef(null),f=s.useRef(null),[S,W]=s.useState([]),[q,z]=s.useState(fo),[L,_]=s.useState(null),G=s.useCallback(h=>{z(Y=>AC(Y,h)?Y:h)},[]),$=c==="shape";s.useEffect(()=>{var h;$&&((h=v.current)==null||h.focus({preventScroll:!0}))},[$]),s.useEffect(()=>{$||W(h=>h.length?[]:h)},[$]);const I=S.length>0;s.useEffect(()=>{u==null||u(I)},[I,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const D=n.width>0?t.width/n.width:1,E=n.height>0?t.height/n.height:1,T=Math.min(D,E),C=r&&l?T:D,V=r&&l?T:E,w=r&&l?(t.width-n.width*T)/2:0,U=r&&l?(t.height-n.height*T)/2:0,P=s.useCallback(h=>r?{x:w+(h.x-n.x)*C,y:U+(h.y-n.y)*V}:{x:h.x-n.x,y:h.y-n.y},[r,n,C,V,w,U]),A=s.useCallback(h=>r?{x:n.x+(C>0?(h.x-w)/C:0),y:n.y+(V>0?(h.y-U)/V:0)}:{x:n.x+h.x,y:n.y+h.y},[r,n,C,V,w,U]),j=s.useMemo(()=>A({x:t.width/2,y:t.height/2}),[A,t.width,t.height]),ie=s.useCallback((h,Y)=>{var ne;const Q=(ne=v.current)==null?void 0:ne.getBoundingClientRect();if(!Q||Q.width<=0||Q.height<=0)return{x:0,y:0};if(r){const ue=(h-Q.left)/Q.width*t.width,B=(Y-Q.top)/Q.height*t.height;return{x:n.x+(C>0?(ue-w)/C:0),y:n.y+(V>0?(B-U)/V:0)}}return{x:n.x+(h-Q.left),y:n.y+(Y-Q.top)}},[r,n,t.width,t.height,C,V,w,U]),ae=s.useCallback((h,Y)=>{var ne;const Q=(ne=v.current)==null?void 0:ne.getBoundingClientRect();return!Q||Q.width<=0||Q.height<=0?{x:0,y:0}:{x:(h-Q.left)/Q.width*t.width,y:(Y-Q.top)/Q.height*t.height}},[t.width,t.height]),O=s.useCallback((h,Y)=>{const Q=l&&!(Y!=null&&Y.preserveShape)?CC(h,n,t,w,U,C,V):h;y(Q,Y)},[y,l,n,t,w,U,C,V]),re=s.useCallback(()=>{_(null)},[]),N=s.useCallback((h,Y,Q)=>{if(!Q||x.current||b.current||M.current||f.current){re();return}const ne=ae(h,Y),ue=dn(m.current,P);for(const X of ue)for(const Pe of X.nodes)if(Math.hypot(Pe.p.x-ne.x,Pe.p.y-ne.y)<=so){re();return}const B=Yd(ue,ne);if(!B||B.distance>dl){re();return}const R=ue[B.contour],ee=R==null?void 0:R.nodes[B.segment],te=R==null?void 0:R.nodes[(B.segment+1)%((R==null?void 0:R.nodes.length)??1)],ge=!!(ee&&te&&!jo(ee,te));_(X=>X&&X.curved===ge&&Math.hypot(X.point.x-B.point.x,X.point.y-B.point.y)<.25?X:{point:B.point,curved:ge})},[ae,P,re]),le=h=>{var We;const Y=h.metaKey||h.ctrlKey,Q=M.current;if(Q&&h.pointerId===Q.pointerId){if(h.stopPropagation(),h.preventDefault(),Q.startDistance<=0)return;const ot=ie(h.clientX,h.clientY),qe=Math.hypot(ot.x-Q.origin.x,ot.y-Q.origin.y),tt=Math.max(GC,qe/Q.startDistance);if(!Q.moved&&Math.abs(tt-1)<1e-4)return;Q.moved=!0,p(Gd(Q.startContours,Q.origin,tt));return}const ne=b.current;if(ne&&h.pointerId===ne.pointerId){h.stopPropagation(),h.preventDefault();const ot=ie(h.clientX,h.clientY),{bbox:qe}=ne,tt=qe.maxX-qe.minX,et=qe.maxY-qe.minY,Ge=ot.x-ne.origin.x,ve=ot.y-ne.origin.y;let _e=Ge,ze=ve;if(isFinite(tt)&&isFinite(et))if(r){let $e=n.x,Ne=n.x+n.width,Ye=n.y,Ze=n.y+n.height;l&&(C>0&&($e=n.x+(0-w)/C,Ne=n.x+(t.width-w)/C),V>0&&(Ye=n.y+(0-U)/V,Ze=n.y+(t.height-U)/V));const st=Math.min($e,Ne-tt),it=Math.max($e,Ne-tt),Oe=Math.min(Ye,Ze-et),Ae=Math.max(Ye,Ze-et),mt=Math.min(it,Math.max(st,qe.minX+Ge)),Be=Math.min(Ae,Math.max(Oe,qe.minY+ve));_e=mt-qe.minX,ze=Be-qe.minY}else{const $e=qe.minX-n.x,Ne=qe.minY-n.y,Ye=Math.min(0,t.width-tt),Ze=Math.max(0,t.width-tt),st=Math.min(0,t.height-et),it=Math.max(0,t.height-et),Oe=Math.min(Ze,Math.max(Ye,$e+Ge)),Ae=Math.min(it,Math.max(st,Ne+ve));_e=Oe-$e,ze=Ae-Ne}const Qe=[];if(!Y&&isFinite(tt)&&isFinite(et)){const $e=P({x:qe.minX+tt/2+_e,y:qe.minY+et/2+ze}),Ne={x:t.width/2,y:t.height/2};Math.abs($e.x-Ne.x)<=oa&&(_e=j.x-qe.minX-tt/2,Qe.push(rl(Ne.x,"x",t))),Math.abs($e.y-Ne.y)<=oa&&(ze=j.y-qe.minY-et/2,Qe.push(rl(Ne.y,"y",t)))}if(!ne.moved&&_e===0&&ze===0)return;ne.moved=!0,G(Qe.length?Qe:fo),p(dn(ne.startContours,$e=>({x:$e.x+_e,y:$e.y+ze})),{carryImage:!0});return}const ue=f.current;if(ue&&h.pointerId===ue.pointerId){h.stopPropagation(),h.preventDefault();const ot=ie(h.clientX,h.clientY);let qe=ot.x-ue.origin.x,tt=ot.y-ue.origin.y;if(h.shiftKey&&(Math.abs(qe)>Math.abs(tt)?tt=0:qe=0),!ue.moved&&qe===0&&tt===0)return;ue.moved=!0,p(Ud(ue.startContours,ue.selection,qe,tt));return}const B=x.current;if(!B||h.pointerId!==B.pointerId){N(h.clientX,h.clientY,S.length>0||$);return}re(),h.stopPropagation(),h.preventDefault();const R=ie(h.clientX,h.clientY);if(B.kind==="anchor"){const ot={x:B.anchor.x+(R.x-B.origin.x),y:B.anchor.y+(R.y-B.origin.y)},qe=Y?[]:kC(m.current,{contour:B.contour,node:B.node}),tt=Y||!B.center?[]:[B.center],et=Qd(Kd(qe,tt.map(_e=>_e.x),"x"),ot,"x",P,oa),Ge=Qd(Kd(qe,tt.map(_e=>_e.y),"y"),ot,"y",P,oa),ve=Y?ot:{x:(et==null?void 0:et.value)??ta(ot.x,o),y:(Ge==null?void 0:Ge.value)??ta(ot.y,o)};if(h.shiftKey&&(Math.abs(ve.x-B.anchor.x)>Math.abs(ve.y-B.anchor.y)?ve.y=B.anchor.y:ve.x=B.anchor.x),!B.moved&&ve.x===B.anchor.x&&ve.y===B.anchor.y)return;B.moved=!0,G(_C(ve,et,Ge,t,P)),p(IC(m.current,B.contour,B.node,ve));return}const ee=(We=m.current[B.contour])==null?void 0:We.nodes[B.node],te=B.mirror&&!h.altKey,ge=te||Y?null:B.kind==="in"?ee==null?void 0:ee.out:ee==null?void 0:ee.in,X=ee?P(ee.p):null,Pe=ge?P(ge):null,Se=ee&&(!Y||h.shiftKey)?WC(R,ee.p,te||Y?null:HC(m.current[B.contour],B.node,B.kind,P),X&&Pe?Math.hypot(Pe.x-X.x,Pe.y-X.y):null,h.shiftKey,P,A):{point:R,guides:fo},Z=Se.guides.length?Se.point:Y?R:{x:ta(R.x,o),y:ta(R.y,o)},He=B.kind==="in"?ee==null?void 0:ee.in:ee==null?void 0:ee.out;!B.moved&&He&&Z.x===He.x&&Z.y===He.y||(B.moved=!0,G(Se.guides),p(PC(m.current,B.contour,B.node,B.kind,Z,te)))},J=h=>{G(fo);const Y=M.current;if(Y&&h.pointerId===Y.pointerId){M.current=null,h.stopPropagation();const ge=v.current;ge!=null&&ge.hasPointerCapture(Y.pointerId)&&ge.releasePointerCapture(Y.pointerId),Y.moved&&O(m.current,{preserveShape:!0});return}const Q=b.current;if(Q&&h.pointerId===Q.pointerId){b.current=null,h.stopPropagation();const ge=v.current;ge!=null&&ge.hasPointerCapture(Q.pointerId)&&ge.releasePointerCapture(Q.pointerId),Q.moved?O(m.current,{preserveShape:!0}):W([]);return}const ne=f.current;if(ne&&h.pointerId===ne.pointerId){f.current=null,h.stopPropagation();const ge=v.current;ge!=null&&ge.hasPointerCapture(ne.pointerId)&&ge.releasePointerCapture(ne.pointerId),ne.moved&&O(m.current);return}const ue=x.current;if(!ue||h.pointerId!==ue.pointerId)return;x.current=null,h.stopPropagation();const B=v.current;B!=null&&B.hasPointerCapture(ue.pointerId)&&B.releasePointerCapture(ue.pointerId);const R=Math.hypot(h.clientX-ue.clientOrigin.x,h.clientY-ue.clientOrigin.y);if(ue.moved||R>jC){ue.moved&&O(m.current);return}if(!ue.toggleOnRelease||h.type!=="pointerup")return;const te=qd(m.current,ue.contour,ue.node);te!==m.current&&(p(te),O(te))},be=h=>{h.stopPropagation()},Le=h=>{var Y,Q;h.stopPropagation(),h.preventDefault(),re(),(Y=v.current)==null||Y.focus({preventScroll:!0}),b.current={pointerId:h.pointerId,origin:ie(h.clientX,h.clientY),startContours:zn(i),bbox:Ci(i),moved:!1},(Q=v.current)==null||Q.setPointerCapture(h.pointerId)},ye=(h,Y)=>{var R,ee;h.stopPropagation(),h.preventDefault(),re(),(R=v.current)==null||R.focus({preventScroll:!0}),W([]),d("shape");const Q=Ci(i),ne=Pa(Q,jp(Y)),ue=ll(Q,Y),B=Math.hypot(ue.x-ne.x,ue.y-ne.y);!isFinite(B)||B<=0||(M.current={pointerId:h.pointerId,corner:Y,origin:ne,startDistance:B,startContours:zn(i),moved:!1},(ee=v.current)==null||ee.setPointerCapture(h.pointerId))},ce=(h,Y,Q,ne)=>{var R,ee,te,ge;h.stopPropagation(),h.preventDefault(),re(),(R=v.current)==null||R.focus({preventScroll:!0});const ue=(ee=i[Q])==null?void 0:ee.nodes[ne];if(!ue)return;if(h.altKey){const X=Y==="anchor"?zp(i,Q,ne):RC(i,Q,ne,Y);if(X===i)return;W(Y==="anchor"?[]:[{contour:Q,node:ne}]),p(X),O(X);return}const B=h.metaKey||h.ctrlKey;if(Y==="anchor"&&h.shiftKey&&!B){W(X=>X.some(Pe=>Pe.contour===Q&&Pe.node===ne)?X.filter(Pe=>!(Pe.contour===Q&&Pe.node===ne)):[...X,{contour:Q,node:ne}]);return}if(Y==="anchor"&&!B&&S.length>1&&S.some(X=>X.contour===Q&&X.node===ne)){f.current={pointerId:h.pointerId,origin:ie(h.clientX,h.clientY),startContours:zn(i),selection:S,moved:!1},(te=v.current)==null||te.setPointerCapture(h.pointerId);return}W([{contour:Q,node:ne}]),x.current={kind:Y,contour:Q,node:ne,pointerId:h.pointerId,origin:ie(h.clientX,h.clientY),clientOrigin:{x:h.clientX,y:h.clientY},anchor:ue.p,center:$C(i),mirror:Y!=="anchor"&&!!(ue.in&&ue.out),toggleOnRelease:B,moved:!1},(ge=v.current)==null||ge.setPointerCapture(h.pointerId)},K=h=>{h.stopPropagation(),h.preventDefault(),re();const Y=dn(i,P),Q=Yd(Y,ae(h.clientX,h.clientY));if(!Q||Q.distance>dl)return;const{contours:ne,nodeIndex:ue}=MC(i,Q.contour,Q.segment,Q.t);ue<0||(W([{contour:Q.contour,node:ue}]),p(ne),O(ne))},se=h=>{if(h.key==="="||h.key==="+"||h.key==="-"||h.key==="_"){h.preventDefault(),h.stopPropagation();const B=Ci(i);if(!isFinite(B.minX)||!isFinite(B.maxX))return;const R={x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},te=h.key==="="||h.key==="+"?tu:1/tu,ge=Gd(i,R,te);p(ge),O(ge,{preserveShape:!0});return}if(h.key==="Escape"){h.stopPropagation(),W([]),d("none");return}if(!S.length)return;if(h.key==="Backspace"||h.key==="Delete"){h.preventDefault(),h.stopPropagation();const B=LC(i,S);if(B===i)return;W([]),p(B),O(B);return}const Y=o>0?o:XC,Q=h.shiftKey?Y*10:Y,ne={ArrowLeft:[-Q,0],ArrowRight:[Q,0],ArrowUp:[0,-Q],ArrowDown:[0,Q]}[h.key];if(!ne)return;h.preventDefault(),h.stopPropagation();const ue=Ud(i,S,ne[0],ne[1]);p(ue),O(ue)},pe=s.useMemo(()=>_o(dn(i,P)),[i,P]),fe=s.useMemo(()=>Ci(i),[i]),we=P({x:fe.minX,y:fe.minY}),Re={width:P({x:fe.maxX,y:fe.minY}).x-we.x,height:P({x:fe.minX,y:fe.maxY}).y-we.y},me=$&&S.length===0&&isFinite(fe.minX)&&isFinite(fe.maxX)&&fe.maxX>fe.minX&&fe.maxY>fe.minY,xe=S.length>0||$,Ce=xe;return a.jsxs("svg",{ref:v,className:`${e}-editor${xe?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:se,onPointerDown:()=>{var h;return(h=v.current)==null?void 0:h.focus({preventScroll:!0})},onPointerMove:le,onPointerLeave:re,onPointerUp:J,onPointerCancel:J,onLostPointerCapture:J,onContextMenu:h=>{h.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{W([]),d("none")},onClick:K}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:pe}),Ce&&q.map((h,Y)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${h.kind}`,x1:h.a.x,y1:h.a.y,x2:h.b.x,y2:h.b.y},`${h.kind}-${Y}`)),a.jsx("path",{ref:g,className:`${e}-editor-body`,d:pe,fillRule:"evenodd",onPointerDown:Le,onClick:K}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:pe,style:{strokeWidth:zC},onClick:K}),Ce&&L&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:L.point.x-On/2,y:L.point.y-On/2,width:On,height:On,rx:L.curved?On/2:0}),Ce&&i.map((h,Y)=>h.nodes.map((Q,ne)=>{const ue=S.some(R=>R.contour===Y&&R.node===ne),B=P(Q.p);return a.jsxs("g",{children:[ue&&S.length===1&&["in","out"].map(R=>{const ee=Q[R];if(!ee)return null;const te=P(ee);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:B.x,y1:B.y,x2:te.x,y2:te.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:te.x,cy:te.y,r:VC}),a.jsx("circle",{className:`${e}-editor-grab`,cx:te.x,cy:te.y,r:so,onPointerDown:ge=>ce(ge,R,Y,ne),onClick:be})]},R)}),a.jsx("rect",{className:`${e}-editor-anchor${ue?` ${e}-editor-anchor-selected`:""}`,x:B.x-On/2,y:B.y-On/2,width:On,height:On,rx:_p(Q)?On/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:B.x-so,y:B.y-so,width:so*2,height:so*2,onPointerDown:R=>ce(R,"anchor",Y,ne),onClick:be,onDoubleClick:R=>{R.stopPropagation(),R.preventDefault();const ee=qd(i,Y,ne);p(ee),O(ee)}})]},`${Y}-${ne}`)})),me&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:we.x,y:we.y,width:Re.width,height:Re.height}),["nw","ne","se","sw"].map(h=>{const Y=P(ll(fe,h)),Q=h==="ne"||h==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:Y.x-aa/2,y:Y.y-aa/2,width:aa,height:aa}),a.jsx("rect",{className:`${e}-editor-scale-grab${Q?` ${e}-editor-scale-grab-nesw`:""}`,x:Y.x-ra/2,y:Y.y-ra/2,width:ra,height:ra,onPointerDown:ne=>ye(ne,h),onClick:be})]},h)})]})]})}const qC=4e3,YC=/^(?:https?:|mailto:|tel:)/i;function Vp(e){return!!e&&typeof e=="object"&&e.type==="link"}function KC(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!YC.test(t)))return t}function QC(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,c)=>{for(const d of r){if(Vp(d)){o(d.children??[],KC(d.value),d.target);continue}const u=d,p=(u==null?void 0:u.text)??"";if(p.trim())for(const y of p.split(/\s+/))y&&t.push({text:y,leaf:u,href:l,target:c,para:i})}};o((n==null?void 0:n.children)??[])}),t}function nu(e){return{...e.fontFamily&&{fontFamily:Do(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"}}}function ZC(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Vp(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function JC(e,t,n,i,o){if(t<=0||!e.length||n<=0||i<=0)return e;const r=o==="avoid"?1:-1;return e.map(l=>{if(!l.length)return l;let c=1/0,d=-1/0,u=1/0,p=-1/0;for(const g of l){const m=g.x*n,x=g.y*i;m<c&&(c=m),m>d&&(d=m),x<u&&(u=x),x>p&&(p=x)}const y=(c+d)/2,v=(u+p)/2;return l.map(g=>{const m=g.x*n,x=g.y*i,b=m-y,M=x-v,f=Math.sqrt(b*b+M*M);if(f<1e-6)return g;const W=Math.max(0,f+r*t)/f;return{x:(y+b*W)/n,y:(v+M*W)/i}})})}const ks=2,As=2;function eT(e,t,n,i,o){if(e.kind!=="whole")return null;const r=t[e.originalIndex],l=e.token.text;if(!r||l.length<ks+As)return null;const c=Math.min(r.length-As,l.length-As);let d=-1;for(let u=c;u>=ks;u-=1)if(r[u-1]*i+o*i<=n){d=u;break}return d<ks?null:{fragmentText:`${l.slice(0,d)}-`,remainderText:l.slice(d),fragmentWidth:r[d-1]+o,remainderWidth:Math.max(0,e.width-r[d-1])}}function iu(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:c,height:d,allowOverflow:u,capInset:p,capLines:y}=e,v=!!e.hyphenate,g=e.charWidths??[],m=e.hyphenWidth??0,x=e.lineHeight*l,b=e.spaceWidth*l,M=Math.max(0,e.shapeMargin??0),f=[],S=t.map((C,V)=>({token:C,originalIndex:V,width:n[V],kind:"whole"}));if(!S.length||c<=0||x<=0)return{segments:f,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const W=Math.max(1,b*.5),q=x*nC,z=JC(i,M,c,d,o);let L=0,_=0,G=0,$=S[0].token.para,I=0,D=0,E=null;for(;L<S.length&&G<qC;){const C=_+x>d;if(C&&!u)break;const V=S[L].token.para;if(V>$+1){_+=x*(V-$-1),$=V-1,G+=1;continue}let w=C?[{x0:0,x1:c}]:dC(z,(_+q)/d,(_+x-q)/d,o).map(P=>({x0:P.x0*c,x1:P.x1*c}));p>0&&y>0&&!C&&w.length&&(E===null&&(E=G,I=w[0].x0,D=_),G-E<y&&(w=cC(w,{x0:I,x1:I+p})));const U=w.reduce((P,A)=>Math.max(P,A.x1-A.x0),0);for(const P of w){const A=P.x1-P.x0;if(A<W)continue;if(L>=S.length||S[L].token.para!==V)break;const j=L;let ie=0;for(;L<S.length&&S[L].token.para===V;){const ae=S[L],O=L===j,re=ae.width*l,N=O?re:b+re;if(ie+N<=A){ie+=N,L+=1;continue}if(O&&A>=U-.5&&re>c-.5){ie+=N,L+=1;continue}if(v){const J=A-ie-(O?0:b),be=eT(ae,g,J,l,m);if(be){const Le={token:{...ae.token,text:be.fragmentText},originalIndex:ae.originalIndex,width:be.fragmentWidth,kind:"fragment"},ye={token:{...ae.token,text:be.remainderText},originalIndex:ae.originalIndex,width:be.remainderWidth,kind:"remainder"};S.splice(L,1,Le,ye),ie+=(O?0:b)+be.fragmentWidth*l,L+=1}}break}if(L>j){const ae=L>=S.length||S[L].token.para!==V;f.push({top:_,left:P.x0,width:A,from:j,to:L,justify:r==="justify"&&!ae})}if(L>=S.length||S[L].token.para!==V)break}$=V,_+=x,G+=1}let T=0;if(L>0){const C=S[L-1];T=C.kind==="fragment"?C.originalIndex:C.originalIndex+1}return{segments:f,placed:T,height:f.length?_:0,capLeft:I,capTop:D,renderTokens:S.map(C=>C.token)}}const tT=.12,nT=2,iT=10,Fs=.25,oT=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},rT=(e,t)=>Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5,aT=(e,t)=>{const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e||!t){i(null);return}let o=0,r=null;const l=()=>{const c=oT(e);(!r||!rT(r,c))&&(r=c,i(c)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},Ns=(e,t)=>{if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))},nr=typeof window>"u"?s.useEffect:s.useLayoutEffect;function sT(){return typeof document>"u"?null:document.body}function lT({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:c,allowOverflow:d,fitEnabled:u,scale:p,onFitScale:y,padding:v,hyphenate:g,showOverflowIndicator:m,dropCapLines:x,dropCapSize:b,showGuides:M,typography:f,imageUrl:S,imageFocalX:W,imageFocalY:q,imageScale:z,imageCustomPath:L,pathDragActive:_,pathCarryImage:G,onCarryImageConsumed:$,pathEditor:I,imageEditor:D}){var Ue,ct;const E=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[T,C]=s.useState(null),V=s.useRef(null),[w,U]=s.useState({width:0,height:0}),[P,A]=s.useState(0),[j,ie]=s.useState(null),[ae,O]=s.useState(0),[re,N]=s.useState("none");s.useEffect(()=>{!I&&!D&&N("none")},[I,D]);const[le,J]=s.useState(null);s.useEffect(()=>{if(!S||typeof Image>"u"){J(null);return}let he=!1;const Me=new Image;return Me.onload=()=>{he||J({width:Me.naturalWidth,height:Me.naturalHeight})},Me.src=S,()=>{he=!0}},[S]);const be=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),Le=s.useMemo(()=>QC(be),[be]),ye=s.useMemo(()=>ZC(be),[be]),ce=x>0&&b>1?((ct=(Ue=Le[0])==null?void 0:Ue.text)==null?void 0:ct.charAt(0))??"":"",K=(I==null?void 0:I.contours)??null,se=s.useMemo(()=>{let he=[];if(K){const Me=$r(K);Me.length&&(he=wo(Me,r))}if(!he.length){const Me=i.trim(),nt=Me?Bd(Me,o,r):null;nt&&nt.length?he=nt:he=tl(n==="custom"?"rectangle":n)}return n==="circle"?Ns(he,w):he},[K,n,i,o,r,w.width,w.height]),pe=I==null?void 0:I.onConvert,fe=(I==null?void 0:I.needsConversion)??!1,we=s.useMemo(()=>{if(n==="circle")return!1;const he=K??(i.trim()?Ri(i):null);return!!(he&&Dp(he,r))},[K,i,r,n]),[Re,me]=s.useState(null);nr(()=>{if(!we){Re&&me(null);return}!Re&&w.width>0&&w.height>0&&me({width:w.width,height:w.height})},[we,w.width,w.height,Re]);const xe=s.useMemo(()=>{if(!we||w.width<=0||w.height<=0)return se;const he=Re??w,Me=r.width/he.width,nt=r.height/he.height;return se.map(pt=>pt.map(Ve=>({x:Ve.x*Me,y:Ve.y*nt})))},[se,we,Re,r.width,r.height,w.width,w.height]),Ce=s.useMemo(()=>{if(K){const pt=$r(K);if(pt.length){const Ve=wo(pt,r);return n==="circle"?Ns(Ve,w):Ve}}const he=L.trim(),Me=he?Bd(he,o,r):null,nt=Me&&Me.length?Me:tl(n==="custom"?"rectangle":n);return n==="circle"?Ns(nt,w):nt},[K,n,L,o,r,w.width,w.height]),h=s.useMemo(()=>{if(!we||w.width<=0||w.height<=0)return Ce;const he=Re??w,Me=r.width/he.width,nt=r.height/he.height;return Ce.map(pt=>pt.map(Ve=>({x:Ve.x*Me,y:Ve.y*nt})))},[Ce,we,Re,r.width,r.height,w.width,w.height]),Y=s.useRef(null),Q=s.useRef(!1);s.useEffect(()=>{if(!(!pe||w.width<=0||w.height<=0)){if(we){if(Y.current===i)return;const he=K??(i.trim()?Ri(i):null);if(!(he!=null&&he.length))return;const Me=dn(he,nt=>({x:r.x+(nt.x-r.x)/w.width*r.width,y:r.y+(nt.y-r.y)/w.height*r.height}));Y.current=_o(Me),pe(Me);return}!fe||!se.length||Q.current||(Q.current=!0,pe(dn(Op(se),he=>({x:he.x*La,y:he.y*La}))))}},[fe,we,pe,se,K,i,r,w.width,w.height]);const ne=s.useCallback(()=>{const he=T;if(!he)return;const Me=he.getBoundingClientRect(),nt=parseFloat(window.getComputedStyle(he).paddingTop)||0;A(Ve=>Math.abs(Ve-nt)<.5?Ve:nt);const pt={width:Me.width,height:Me.height};U(Ve=>Math.abs(Ve.width-pt.width)<.5&&Math.abs(Ve.height-pt.height)<.5?Ve:pt)},[T]);nr(()=>{const he=T;if(!he||typeof ResizeObserver>"u")return;ne();const Me=new ResizeObserver(ne);return Me.observe(he),()=>Me.disconnect()},[T,ne]),nr(()=>{ne()},[v,ne]),s.useEffect(()=>{const he=typeof document<"u"?document.fonts:void 0;he!=null&&he.ready&&he.ready.then(()=>{O(Me=>Me+1)})},[]),nr(()=>{const he=V.current;if(!he)return;if(!Le.length){ie(null);return}const Me=[],nt=document.createDocumentFragment();for(const ut of Le){const H=document.createElement("span");Object.assign(H.style,nu(ut.leaf)),H.textContent=ut.text,nt.appendChild(H),Me.push(H)}const pt=document.createElement("span");pt.textContent=" ",nt.appendChild(pt);const Ve=document.createElement("span");Ve.textContent="-",nt.appendChild(Ve);const vt=ce||"H",Pt=document.createElement("span");Pt.textContent=vt,Pt.style.lineHeight="1",nt.appendChild(Pt),he.replaceChildren(nt);const At=window.getComputedStyle(he),wt=parseFloat(At.fontSize)||16,Vt=parseFloat(At.lineHeight),jt=Number.isNaN(Vt)?wt*1.2:Vt,Yt=Math.max(jt,wt),Kt=document.createElement("span");Kt.textContent=vt,Kt.style.lineHeight=`${Yt}px`;const Rt=document.createElement("span");Rt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Kt.appendChild(Rt),he.appendChild(Kt);const zt=Kt.getBoundingClientRect().top,on=Rt.getBoundingClientRect().top,xt=Math.max(1,on-zt);Kt.remove();let yt=xt*.8;const Je=document.createElement("canvas").getContext("2d"),rt=ut=>`${At.fontStyle} ${At.fontWeight} ${ut}px ${At.fontFamily}`;if(Je){Je.font=rt(wt);const ut=Je.measureText(vt).actualBoundingBoxAscent;ut>0&&(yt=ut)}const dt=b>1?(b-1)*Yt+yt:yt;let Lt=wt*(dt/yt);if(Je){Je.font=rt(Lt);const ut=Je.measureText(vt).actualBoundingBoxAscent;ut>0&&(Lt=Lt*(dt/ut))}Pt.style.fontSize=`${Lt}px`,Pt.style.lineHeight=`${Lt}px`;const St=document.createElement("span");St.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Pt.appendChild(St);const ht=Math.max(1,St.getBoundingClientRect().top-Pt.getBoundingClientRect().top);St.remove();const Tt=(b-1)*Yt+xt-ht,Ot=Me.map(ut=>ut.getBoundingClientRect().width),Gt=pt.getBoundingClientRect().width,kt=Ve.getBoundingClientRect().width,_t=ce?Pt.getBoundingClientRect().width:0,Ft=g?Me.map(ut=>{const H=ut.firstChild;if(!(H instanceof Text)||H.data.length<4)return;const Ie=document.createRange(),je=ut.getBoundingClientRect().left,Fe=[];for(let ft=1;ft<=H.data.length;ft+=1)Ie.setStart(H,0),Ie.setEnd(H,ft),Fe.push(Ie.getBoundingClientRect().right-je);return Fe}):[];he.replaceChildren(),ie({widths:Ot,spaceWidth:Gt,dashWidth:kt,charWidths:Ft,lineHeight:Yt,capWidth:_t,dropCapFontSize:Lt,dropCapTopAdjust:Tt})},[Le,f,ce,x,b,ae,w.width,g]);const ue=j&&ce?j.capWidth+j.lineHeight*tT:0,B=Math.max(x,Math.ceil(b)),R=s.useMemo(()=>{if(!j||!Le.length||w.width<=0||w.height<=0||!u)return 1;const he=pt=>iu({tokens:Le,widths:j.widths,spaceWidth:j.spaceWidth,lineHeight:j.lineHeight,width:w.width,height:w.height,rings:xe,mode:l,align:c,scale:pt,allowOverflow:!1,capInset:ue*pt,capLines:ce?B:0,hyphenate:g,charWidths:j.charWidths,hyphenWidth:j.dashWidth,shapeMargin:P});if(he(1).placed>=Le.length)return 1;if(he(Fs).placed<Le.length)return Fs;let Me=Fs,nt=1;for(let pt=0;pt<iT;pt+=1){const Ve=(Me+nt)/2;he(Ve).placed>=Le.length?Me=Ve:nt=Ve}return Me},[j,Le,w.width,w.height,xe,l,c,u,ue,ce,B,g,P]);s.useEffect(()=>{y(R)},[R,y]);const ee=u?Math.min(p,R):1,te=s.useMemo(()=>!j||!Le.length||w.width<=0||w.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:Le}:iu({tokens:Le,widths:j.widths,spaceWidth:j.spaceWidth,lineHeight:j.lineHeight,width:w.width,height:w.height,rings:xe,mode:l,align:c,scale:ee,allowOverflow:d,capInset:ue*ee,capLines:ce?B:0,hyphenate:g,charWidths:j.charWidths,hyphenWidth:j.dashWidth,shapeMargin:P}),[j,Le,w.width,w.height,xe,l,c,ee,d,ue,ce,B,g,P]),ge=m&&Le.length>0&&te.placed<Le.length,X=j?j.dropCapFontSize*ee:0,Pe=j?j.dropCapTopAdjust*ee:0,Se=c==="justify"?"left":c,Z=j?j.lineHeight*ee:0,He=te.segments.length?te.segments[te.segments.length-1]:null,We=He?{top:He.top+Z,left:He.left+He.width/2}:{top:w.height,left:w.width/2},ot=!!(I&&K&&w.width>0&&w.height>0),qe=!!D,tt=(ot||qe)&&w.width>0&&w.height>0,et=aT(T,tt),Ge=tt&&et?sT():null,ve=s.useRef(!1),_e=s.useCallback(he=>{ve.current=he},[]);s.useEffect(()=>{if(!ot&&!qe)return;const he=Me=>{const nt=T;if(!nt)return;const pt=nt.getBoundingClientRect();Me.clientX>=pt.left&&Me.clientX<=pt.right&&Me.clientY>=pt.top&&Me.clientY<=pt.bottom&&(Me.preventDefault(),Me.stopPropagation(),N(vt=>vt==="shape"&&ve.current?vt:vt==="shape"&&qe?"image":ot?"shape":"image"))};return document.addEventListener("dblclick",he,!0),()=>document.removeEventListener("dblclick",he,!0)},[ot,qe,T]);const ze=s.useMemo(()=>S&&w.width>0&&w.height>0?iC(h,w):null,[S,h,w.width,w.height]),Qe=s.useRef(null),$e=(()=>{const he=Qe.current;return G||!D||!le||!ze||!he||L===he.customPath||he.shape!==n&&n!=="custom"?null:DC(he.bounds,ze,le,he.focalX,he.focalY,he.scale)})();nr(()=>{if(_||!D||!le||!ze)return;const he=Qe.current,Me=!!(he&&L!==he.customPath);Me&&$e&&D.onCommit($e),Me&&G&&($==null||$()),Qe.current={rings:h,bounds:ze,focalX:($e==null?void 0:$e.focalX)??W,focalY:($e==null?void 0:$e.focalY)??q,scale:($e==null?void 0:$e.scale)??z,customPath:L,shape:n}},[_,G,L,n,h,ze,D,le,W,q,z,$e,$]);const Ne=Qe.current,Ye=!!(_&&!G&&Ne&&!$e),Ze=Ye&&Ne?Ne.focalX:($e==null?void 0:$e.focalX)??W,st=Ye&&Ne?Ne.focalY:($e==null?void 0:$e.focalY)??q,it=Ye&&Ne?Ne.scale:($e==null?void 0:$e.scale)??z,Oe=Ye&&Ne?Ne.bounds:ze,Ae=s.useMemo(()=>{if(!(w.width>0)||!(w.height>0))return"";let he=jd(i,K,o,r,n,w);if(we){const Me=Re??w,nt=r.width/Me.width,pt=r.height/Me.height;he=dn(he,Ve=>({x:Ve.x*nt,y:Ve.y*pt}))}return Vd(he,w)||Dd(xe,w)},[i,K,o,r,n,w.width,w.height,we,Re,xe]),mt=s.useMemo(()=>{if(!S||!(w.width>0)||!(w.height>0))return"";let he=jd(L,K,o,r,n,w);if(we){const Me=Re??w,nt=r.width/Me.width,pt=r.height/Me.height;he=dn(he,Ve=>({x:Ve.x*nt,y:Ve.y*pt}))}return Vd(he,w)||Dd(h,w)},[S,L,K,o,r,n,w.width,w.height,we,Re,h]),Be=`${E}-clip`,De=s.useMemo(()=>{if(!Oe)return null;const he=le??{width:Oe.width,height:Oe.height},Me=Vi(Oe,he,it);return{x:Bn(Oe.width,Me.width,Ze),y:Bn(Oe.height,Me.height,st),width:Me.width,height:Me.height}},[Oe,le,Ze,st,it]);return a.jsxs("div",{className:`${e}-column`,style:{padding:v},ref:C,children:[Ae?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:w.width,height:w.height},viewBox:`0 0 ${w.width} ${w.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Ae,fillRule:"evenodd"}),S&&mt&&Oe&&De?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Be,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:mt,fillRule:"evenodd"})})}),a.jsx("image",{href:S,x:Oe.x+De.x,y:Oe.y+De.y,width:De.width,height:De.height,preserveAspectRatio:"none",clipPath:`url(#${Be})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${d?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:ee,top:0,left:0,width:w.width,height:w.height},children:[a.jsx("div",{className:`${e}-measure`,ref:V,style:f,"aria-hidden":!0}),te.segments.map((he,Me)=>{const nt=te.renderTokens.slice(he.from,he.to),pt=Me===0;return a.jsx("div",{className:`${e}-line${he.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${he.top}px`,left:`${he.left}px`,width:`${he.width}px`,textAlign:he.justify?void 0:Se},children:nt.map((Ve,vt)=>{const At=ce&&pt&&he.from===0&&vt===0?Ve.text.slice(1):Ve.text,wt=nu(Ve.leaf),Vt=Ve.href?a.jsx("a",{className:`${e}-link`,href:Ve.href,target:Ve.target,rel:Ve.target?"noopener noreferrer":void 0,style:wt,children:At}):a.jsx("span",{style:wt,children:At});return a.jsxs("span",{children:[!he.justify&&vt>0?" ":null,Vt]},vt)})},`${he.from}-${he.to}-${Me}`)}),M&&!K&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:xe.map((he,Me)=>a.jsx("polygon",{points:he.map(nt=>`${nt.x},${nt.y}`).join(" ")},Me))})]}),ce&&j&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${te.capTop+Pe}px`,left:`${te.capLeft}px`,fontSize:`${X}px`,lineHeight:`${X}px`},children:ce}),Ge&&et&&(K&&I||D)&&Xn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:et.top,left:et.left,width:et.width,height:et.height,zIndex:nT,pointerEvents:"none"},children:[K&&I&&a.jsx(UC,{P:e,box:{width:et.width,height:et.height},viewBox:r,contours:K,snap:I.snap,stretchToBox:!we,uniformStretch:n==="circle",stage:re,onStageChange:N,onSelectionChange:_e,onChange:I.onChange,onCommit:I.onCommit}),D&&Oe&&a.jsx(BC,{P:e,box:{width:et.width,height:et.height},bounds:Oe,natural:le,imageUrl:S,maskPath:mt,stage:re,onStageChange:N,focalX:Ze,focalY:st,scale:it,onChange:D.onChange,onCommit:D.onCommit})]}),Ge),a.jsx("div",{className:`${e}-a11y`,children:ye.map((he,Me)=>a.jsx("p",{children:he},Me))}),ge&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:We.top,left:We.left},"aria-hidden":!0,children:[a.jsx("path",{d:"M12.8,4 L20.2,4 C24.68042,4 26.9206301,4 28.631924,4.87194781 C31.3123488,6.23769248 33,8.99168887 33,12 C33,15.0083111 31.3123488,17.7623075 28.631924,19.1280522 C26.9206301,20 24.68042,20 20.2,20 L12.8,20 C8.31957995,20 6.07936993,20 4.368076,19.1280522 C1.68765116,17.7623075 0,15.0083111 0,12 C0,8.99168887 1.68765116,6.23769248 4.368076,4.87194781 C6.07936993,4 8.31957995,4 12.8,4 Z",fill:"#FF4400"}),a.jsx("path",{transform:"translate(5, 0)",fill:"#FFFFFF",d:"M12,5.625 C12.3846269,5.625 12.7016304,5.91453014 12.7449542,6.28753416 L12.75,6.375 L12.75,11.25 L17.625,11.25 C18.0392136,11.25 18.375,11.5857864 18.375,12 C18.375,12.3846269 18.0854699,12.7016304 17.7124658,12.7449542 L17.625,12.75 L12.75,12.75 L12.75,17.625 C12.75,18.0392136 12.4142136,18.375 12,18.375 C11.6153731,18.375 11.2983696,18.0854699 11.2550458,17.7124658 L11.25,17.625 L11.25,12.75 L6.375,12.75 C5.96078644,12.75 5.625,12.4142136 5.625,12 C5.625,11.6153731 5.91453014,11.2983696 6.28753416,11.2550458 L6.375,11.25 L11.25,11.25 L11.25,6.375 C11.25,5.96078644 11.5857864,5.625 12,5.625 Z"})]})]})}const Gp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],cT={x:0,y:0,width:100,height:100},dT=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?cT:{x:t[0],y:t[1],width:t[2],height:t[3]}},uT=e=>`
|
|
27330
|
+
`;function tr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ji={fontSettings:{type:"object",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0},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 bi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function ql(e){return{[bi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[bi(e,"fontSettings")]:{...ji.fontSettings,scope:"common",title:""},[bi(e,"fontSize")]:{...ji.fontSize,scope:"layout",title:""},[bi(e,"lineHeight")]:{...ji.lineHeight,scope:"layout",title:""},[bi(e,"letterSpacing")]:{...ji.letterSpacing,scope:"layout",title:""},[bi(e,"wordSpacing")]:{...ji.wordSpacing,scope:"layout",title:""},[bi(e,"textAlign")]:{...ji.textAlign,scope:"layout",title:""},[bi(e,"textAppearance")]:{...ji.textAppearance,scope:"layout",title:""}}}const Z$=ql(""),J$=ql("open"),eC=ql("compact"),tC=["__componentName__",{type:"row",items:["panelHeight","navTextWidth"]},{type:"row",title:"",items:["navTextPosition","navTextOffset"]},{type:"row",title:"Logo",items:["logoMaxHeight","logoPosition"]},{type:"row",title:"Hamburger",items:["iconSize","showIcon"]},"fontFamily","fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAlign","textAppearance","navGap","navPaddingLeft","navPaddingRight"],nC=["__componentName__",{type:"row",items:["compactPanelHeight","compactNavTextWidth"]},{type:"row",title:"",items:["compactNavTextPosition","compactNavTextOffset"]},{type:"row",title:"Logo",items:["compactLogoMaxHeight","compactLogoPosition"]},{type:"row",title:"Hamburger",items:["compactIconSize","compactShowIcon"]},"compactFontFamily","compactFontSettings",{type:"row",items:["compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing"]},"compactTextAlign","compactTextAppearance","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight"],iC=["__componentName__",{type:"row",title:"Text",items:["textWidth","position"]},{type:"row",title:"Menu",items:["openPanelSize","effect"]},"openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],ei={textTransform:"none",textDecoration:"none",fontVariant:"normal"},Ps={fontWeight:400,fontStyle:"normal"},ea={d:"Always",t:"Open Only",m:"Open Only"},oC=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],rC=["iconColor","logoColor","linkColor","backgroundColor"],aC={type:"object",version:1,settings:{sizing:"auto manual",properties:{link:{type:"array",scope:"common",display:{type:"page-url-link"},items:{type:"object",properties:{link:{type:"object",properties:{type:{type:"string",enum:["url","page","anchor"]},value:{type:"string",message:"Paste URL here..."},target:{type:"string",enum:["blank","self"]},anchor:{type:"string"}}},label:{type:"string"},showIn:{type:"string",scope:"layout",enum:["Always","Open Only","Open and Compact","Default and Open","Default and Compact"]}}}},logo:{type:"object",scope:"common",title:"Logo",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Logo",display:{type:"settings-image-input"}}}},logoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},logoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactLogoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},logoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{default:"Logo Default",hover:"Logo Hover"},display:{type:"palette-color-picker"}},panelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover"},display:{type:"palette-color-picker"}},showIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},iconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},linkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover"},display:{type:"palette-color-picker"}},compactShowIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},compactIconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{compact:"Icon Default","compact-hover":"Icon Hover"},display:{type:"palette-color-picker"}},compactLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{compact:"Text Default","compact-hover":"Text Hover"},display:{type:"palette-color-picker"}},compactLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{compact:"Logo Default","compact-hover":"Logo Hover"},display:{type:"palette-color-picker"}},compactBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},openLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{open:"Text Default","open-hover":"Text Hover"},display:{type:"palette-color-picker"}},openLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{open:"Logo Default","open-hover":"Logo Hover"},display:{type:"palette-color-picker"}},menuBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},overlayColor:{type:"string",scope:"common",title:"Overlay Default",display:{type:"palette-color-picker"}},closeButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{open:"Close Default","open-hover":"Close Hover"},display:{type:"palette-color-picker"}},effect:{type:"string",scope:"layout",title:"Effect",display:{type:"toggle-cycle",enum:["fade","left","top","right","bottom"]}},openPanelSize:{type:"number",scope:"layout",title:"Height",display:{type:"percentage-input"},min:0,max:100},textWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},navTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},navTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},navTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:[...oC]}},stateOverrides:{type:"object",scope:"common"},gap:tr("Gap"),navGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},textPaddingLeft:tr("Text padding left"),textPaddingRight:tr("Text padding right"),textPaddingTop:tr("Text padding top"),textPaddingBottom:tr("Text padding bottom"),compactLogoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},compactPanelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},compactIconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},compactNavTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},compactNavTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactNavTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},compactNavGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},...Z$,...J$,...eC},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"About",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:ea}],logo:{mode:"On",icon:"01M3QM74XE09DSJCWGD1XM6Y45"},backgroundColor:"#ffffff",logoColor:"#000000",iconColor:"#000000",linkColor:"#000000",openLinkColor:"#000000",compactIconColor:"#000000",compactLinkColor:"#000000",compactLogoColor:"#000000",compactBackgroundColor:"#ffffff",openLogoColor:"#000000",menuBackgroundColor:"#ffffff",overlayColor:"rgba(0, 0, 0, 0.45)",closeButtonColor:"#000000",effect:"fade",showIcon:"on",compactShowIcon:"on",logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",compactNavTextPosition:"center",navTextOffset:0,compactNavTextOffset:0,position:"left-top",fontFamily:"Goudy Bookletter 1911",fontSettings:Ps,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:Ps,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:Ps,compactTextAlign:"left",stateOverrides:{hover:{linkColor:"#666666",iconColor:"#666666",logoColor:"#666666"},"open-hover":{closeButtonColor:"#666666"}}},displayRules:[{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.openLogoColor.display.visible",value:!1}},{if:{name:"effect",value:"left"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"effect",value:"right"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconSize.display.visible",value:!1}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconSize.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconColor.display.visible",value:!1}}],layoutDefaults:{m:{position:"center",panelHeight:50/375,logoMaxHeight:30/375,logoPosition:"center",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:30/375,textWidth:240/375,openPanelSize:100,navTextWidth:120/375,gap:24/375,navGap:24/375,navPaddingLeft:20/375,navPaddingRight:20/375,textPaddingLeft:10/375,textPaddingRight:10/375,textPaddingTop:10/375,textPaddingBottom:10/375,fontSize:16/375,lineHeight:20/375,letterSpacing:0,wordSpacing:0,textAppearance:ei,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:ei,openTextAlign:"center",compactPanelHeight:40/375,compactLogoMaxHeight:20/375,compactShowIcon:"on",compactIconSize:16/375,compactNavTextWidth:80/375,compactNavGap:24/375,compactNavPaddingLeft:20/375,compactNavPaddingRight:20/375,compactFontSize:16/375,compactLineHeight:20/375,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:ei},t:{textAlign:"center",position:"center",panelHeight:60/768,logoMaxHeight:30/768,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:16/768,textWidth:300/768,openPanelSize:100,navTextWidth:90/768,gap:32/768,navGap:32/768,navPaddingLeft:20/768,navPaddingRight:20/768,textPaddingLeft:10/768,textPaddingRight:10/768,textPaddingTop:10/768,textPaddingBottom:10/768,fontSize:18/768,lineHeight:20/768,letterSpacing:0,wordSpacing:0,textAppearance:ei,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:ei,openTextAlign:"center",compactTextAlign:"center",compactPanelHeight:40/768,compactLogoMaxHeight:20/768,compactShowIcon:"on",compactIconSize:16/768,compactNavTextWidth:80/768,compactNavGap:32/768,compactNavPaddingLeft:20/768,compactNavPaddingRight:20/768,compactFontSize:16/768,compactLineHeight:20/768,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:ei},d:{position:"center",panelHeight:50/1440,logoMaxHeight:30/1440,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:20/1440,textWidth:300/1440,openPanelSize:100,navTextWidth:60/1440,gap:12/1440,navGap:64/1440,navPaddingLeft:10/1440,navPaddingRight:10/1440,textPaddingLeft:10/1440,textPaddingRight:10/1440,textPaddingTop:10/1440,textPaddingBottom:10/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:ei,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:ei,openTextAlign:"center",compactPanelHeight:30/1440,compactLogoMaxHeight:20/1440,compactShowIcon:"on",compactIconSize:20/1440,compactNavTextWidth:60/1440,compactNavGap:20/1440,compactNavPaddingLeft:10/1440,compactNavPaddingRight:10/1440,compactFontSize:16/1440,compactLineHeight:16/1440,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:ei,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactLinkColor","compactLogoColor","compactBackgroundColor","compactLogoMaxHeight","compactLogoPosition","compactPanelHeight","compactIconSize","compactNavTextWidth","compactNavTextPosition","compactNavTextOffset","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight","compactFontFamily","compactFontSettings","compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing","compactTextAlign","compactTextAppearance","openLogoColor","menuBackgroundColor","overlayColor","closeButtonColor","effect","textWidth","navTextWidth","navTextPosition","navTextOffset","position","gap","navGap","navPaddingLeft","navPaddingRight","textPaddingLeft","textPaddingRight","textPaddingTop","textPaddingBottom","fontFamily","fontSettings","fontSize","lineHeight","letterSpacing","wordSpacing","textAlign","textAppearance","openFontFamily","openFontSettings","openFontSize","openLineHeight","openLetterSpacing","openWordSpacing","openTextAlign","openTextAppearance"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","logo"]},{id:"default",icon:"default",title:"Default",tooltip:"Default State",layout:tC},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:nC,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:iC},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...rC],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},sC={element:K$,id:"basic-burger",name:"Basic Burger",category:"navigation",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple Burger.png"},layoutMode:"navigation",defaultSize:{d:{width:"100%",height:60/1440},t:{width:"100%",height:60/768},m:{width:"100%",height:56/375}},defaultNavigationPosition:{d:"switch",t:"switch",m:"stickyTop"},schema:aC,sourceCode:Q$,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},Wd=120,Od=3,lC=.12,Ul={x:0,y:0,width:100,height:100};function Co(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function Ia(e){return e<0?0:e>1?1:e}function Dd(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function cC(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const d of e)for(const u of d){const p=u.x*t.width,v=u.y*t.height;p<n&&(n=p),p>o&&(o=p),v<i&&(i=v),v>r&&(r=v)}const l=o-n,c=r-i;return!isFinite(l)||!isFinite(c)||l<=0||c<=0?null:{x:n,y:i,width:l,height:c}}function dC(e){return e.map(([t,n])=>({x:t,y:n}))}function Rs(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const c of e)for(const d of c)d.x<t&&(t=d.x),d.x>i&&(i=d.x),d.y<n&&(n=d.y),d.y>o&&(o=d.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(c=>c.map(d=>({x:(d.x-t)/r,y:(d.y-n)/l})))}function uC(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],c=o[(r+1)%o.length];(l.y<=t&&c.y>t||c.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(c.y-l.y)*(c.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=Ia(n[o]),l=Ia(n[o+1]);l>r&&i.push({x0:r,x1:l})}return pC(i)}function pC(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function mC(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function gC(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function hC(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function fC(e,t,n,i){let o=null;for(let r=0;r<Od;r+=1){const l=Ia(t+(n-t)*r/Math.max(1,Od-1)),c=uC(e,l),d=i==="avoid"?gC(c):c;if(o=o===null?d:mC(o,d),o.length===0)return[]}return o??[]}function Bd(e,t="stretch",n=Ul){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=ki(i),c=$r(l);if(c.length)return t==="viewbox"?Co(c,n):Rs(c);if(typeof document>"u")return null;const d=i.split(/(?=[Mm])/).map(v=>v.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const v of d){const x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",v),u.appendChild(x);let m=0;try{m=x.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let b=0;b<Wd;b+=1){const S=x.getPointAtLength(b/Wd*m);h.push({x:S.x,y:S.y})}p.push(h)}return p.length?t==="viewbox"?Co(p,n):Rs(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?Co([r],n):Rs([r])}const Yl={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"},Zs="0 0 100 100",La=100,Js=16,yC=12,vC=16,Ms=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,xC=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,zd=Math.PI/4,bC=8,SC=Math.PI/18,wC=8,yo=24,vo=[];function $C(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function Es(e,t){return un(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function CC(e){const t=Li(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:un(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function TC(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return un(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function jd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=Es(t,i);else{const c=e.trim();if(c&&/^[Mm]/.test(c)){const d=ki(c);d.length&&(l=n==="viewbox"?Es(d,i):CC(d))}if(!l.length){const d=o!=="custom"?Yl[o]:void 0;d?l=Es(ki(d),Ul):l=$C()}}return o==="circle"?TC(l,r):l}function Vd(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":Wo(un(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function el(e){const t=e==="rectangle"||e==="custom"?void 0:Yl[e];return t?Co($r(ki(t)),Ul):[dC([[0,0],[1,0],[1,1],[0,1]])]}function IC(e){const t=e.match(xC);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function In(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function tl(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function mn(e){return{x:e.x,y:e.y}}function LC(e){return{p:mn(e.p),in:e.in?mn(e.in):null,out:e.out?mn(e.out):null}}function Vn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(LC)}))}function un(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function Gd(e,t,n,i=n){return un(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function PC(e,t,n,i,o,r,l){let c=Math.abs(t),d=Math.abs(n);if(!c||!d||e.x===l.x&&e.y===l.y)return[{c1:mn(e),c2:mn(l),p:mn(l)}];const u=i*Math.PI/180,p=Math.cos(u),v=Math.sin(u),x=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*x+v*m,b=-v*x+p*m,S=h*h/(c*c)+b*b/(d*d);if(S>1){const K=Math.sqrt(S);c*=K,d*=K}const M=o===r?-1:1,y=c*c*b*b+d*d*h*h,$=Math.max(0,c*c*d*d-y),R=y===0?0:M*Math.sqrt($/y),X=R*c*b/d,B=-R*d*h/c,O=p*X-v*B+(e.x+l.x)/2,N=v*X+p*B+(e.y+l.y)/2,z=Math.atan2((b-B)/d,(h-X)/c);let I=Math.atan2((-b-B)/d,(-h-X)/c)-z;!r&&I>0&&(I-=Math.PI*2),r&&I<0&&(I+=Math.PI*2);const j=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2))),E=I/j,w=4/3*Math.tan(E/4),L=(K,P)=>({x:O+p*c*K-v*d*P,y:N+v*c*K+p*d*P}),V=[];let _=z;for(let K=0;K<j;K+=1){const P=_+E,f=Math.cos(_),U=Math.sin(_),te=Math.cos(P),ce=Math.sin(P);V.push({c1:L(f-w*U,U+w*f),c2:L(te+w*ce,ce-w*te),p:K===j-1?mn(l):L(te,ce)}),_=P}return V}function ki(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},c=null,d=null;const u=()=>{if(o&&i.length>2){const m=i[0],h=i[i.length-1];Math.abs(m.p.x-h.p.x)<1e-6&&Math.abs(m.p.y-h.p.y)<1e-6&&(m.in=h.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,h)=>{i.push({p:m,in:qn(h??null,m),out:null}),r=m},v=m=>{if(!i.length)return;const h=i[i.length-1];h.out=qn(m,h.p)};Ms.lastIndex=0;let x=Ms.exec(t);for(;x!==null;){const m=x[1],h=m.toUpperCase(),b=m!==h,S=IC(x[2]),M=y=>b?{x:r.x+S[y],y:r.y+S[y+1]}:{x:S[y],y:S[y+1]};if(h==="Z")o=!0,u(),r=mn(l),c=null,d=null;else if(h==="M"){for(let y=0;y+1<S.length;y+=2){const $=M(y);y===0&&(u(),l=mn($)),p($)}c=null,d=null}else if(h==="L"){for(let y=0;y+1<S.length;y+=2)p(M(y));c=null,d=null}else if(h==="H"){for(const y of S)p({x:b?r.x+y:y,y:r.y});c=null,d=null}else if(h==="V"){for(const y of S)p({x:r.x,y:b?r.y+y:y});c=null,d=null}else if(h==="C"){for(let y=0;y+5<S.length;y+=6){const $=M(y),R=M(y+2),X=M(y+4);v($),p(X,R),c=R}d=null}else if(h==="S"){for(let y=0;y+3<S.length;y+=4){const $=c?tl(c,r):mn(r),R=M(y),X=M(y+2);v($),p(X,R),c=R}d=null}else if(h==="Q")for(let y=0;y+3<S.length;y+=4){const $=M(y),R=M(y+2);v(In(r,$,2/3)),p(R,In(R,$,2/3)),d=$,c=null}else if(h==="T")for(let y=0;y+1<S.length;y+=2){const $=d?tl(d,r):mn(r),R=M(y);v(In(r,$,2/3)),p(R,In(R,$,2/3)),d=$,c=null}else if(h==="A")for(let y=0;y+6<S.length;y+=7){const $=b?{x:r.x+S[y+5],y:r.y+S[y+6]}:{x:S[y+5],y:S[y+6]};for(const R of PC(r,S[y],S[y+1],S[y+2],S[y+3]!==0,S[y+4]!==0,$))v(R.c1),p(R.p,R.c2);c=null,d=null}x=Ms.exec(t)}return u(),n}function zn(e){return`${Number(e.toFixed(2))}`}function qn(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function zp(e){return!!(qn(e.in,e.p)||qn(e.out,e.p))}function Go(e,t){return!qn(e.out,e.p)&&!qn(t.in,t.p)}function Xd(e,t){if(Go(e,t))return`L${zn(t.p.x)},${zn(t.p.y)}`;const n=qn(e.out,e.p)??e.p,i=qn(t.in,t.p)??t.p;return`C${zn(n.x)},${zn(n.y)} ${zn(i.x)},${zn(i.y)} ${zn(t.p.x)},${zn(t.p.y)}`}function Wo(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${zn(i.p.x)},${zn(i.p.y)}`);let r=i;for(const l of o)t.push(Xd(r,l)),r=l;if(n.closed){const l=Xd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function jp(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function nl(e,t,n){if(Go(e,t))return In(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,c=3*r*r*n,d=3*r*n*n,u=n*n*n;return{x:l*e.p.x+c*i.x+d*o.x+u*t.p.x,y:l*e.p.y+c*i.y+d*o.y+u*t.p.y}}function $r(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of jp(n)){if(Go(o.from,o.to)){i.push(mn(o.from.p));continue}for(let r=0;r<Js;r+=1)i.push(nl(o.from,o.to,r/Js))}n.closed||i.push(mn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Li(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of $r(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function RC(e){const t=Li(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function Vp(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function Gp(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=yC)return{closed:!0,nodes:t.map(r=>({p:mn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/vC)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:mn(r),...Vp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Xp(e,t,n=1){if(!e.length)return!1;const i=Li(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),c=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-c||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+c}function MC(e,t,n,i,o,r,l){const c=t.width>0?n.width/t.width:1,d=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(c>0)||!(d>0)?e:un(e,u=>{const p=i+(u.x-t.x)*r,v=o+(u.y-t.y)*l;return{x:t.x+p/c,y:t.y+v/d}})}function EC(e,t){if(!e.length)return e;const n=Li(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),c=t.x+(t.width-i*l)/2,d=t.y+(t.height-o*l)/2;return un(e,u=>({x:c+(u.x-n.minX)*l,y:d+(u.y-n.minY)*l}))}function qp(e){const t={x:0,y:0,width:La,height:La},n=e!=="custom"?Yl[e]:void 0,i=n?un(ki(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):un(Gp(el("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=EC(i,t);return{shape:e,customPath:Wo(o),pathFit:"viewbox",pathViewBox:Zs}}function ta(e,t){return t>0?Math.round(e/t)*t:e}function kC(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,c=Vn(e),d=c[t].nodes[n];return d.p={x:o.p.x+r,y:o.p.y+l},d.in&&(d.in={x:d.in.x+r,y:d.in.y+l}),d.out&&(d.out={x:d.out.x+r,y:d.out.y+l}),c}function qd(e,t,n,i){var r;if(!t.length)return e;const o=Vn(e);for(const{contour:l,node:c}of t){const d=(r=o[l])==null?void 0:r.nodes[c];d&&(d.p={x:d.p.x+n,y:d.p.y+i},d.in&&(d.in={x:d.in.x+n,y:d.in.y+i}),d.out&&(d.out={x:d.out.x+n,y:d.out.y+i}))}return o}function AC(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((c,d)=>d-c);for(const c of l)i=Up(i,r,c)}),i}function FC(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const c=Vn(e),d=c[t].nodes[n];if(d[i]=mn(o),r){const p=i==="in"?"out":"in";d[p]=tl(o,d.p)}return c}function NC(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=Vn(e);return r[t].nodes[n][i]=null,r}function _C(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const c=Vn(e),d=c[t].nodes,u=n+1;if(Go(r,l))return d.splice(u,0,{p:In(r.p,l.p,i),in:null,out:null}),{contours:c,nodeIndex:u};const p=r.out??r.p,v=l.in??l.p,x=In(r.p,p,i),m=In(p,v,i),h=In(v,l.p,i),b=In(x,m,i),S=In(m,h,i),M=In(b,S,i),y=(n+1)%o.nodes.length;return d[n].out=x,d[y].in=h,d.splice(u,0,{p:M,in:b,out:S}),{contours:c,nodeIndex:u}}function Up(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Vn(e);return o[t].nodes.splice(n,1),o}function Ud(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Vn(e),l=r[t].nodes,c=l[n],d=l.length,u=(n-1+d)%d,p=(n+1)%d,v=!!qn(l[u].out,l[u].p),x=!!qn(l[p].in,l[p].p);if(zp(c)||v||x)return c.in=null,c.out=null,l[u].out=null,l[p].in=null,r;const m=Vp(l[u].p,c.p,l[p].p);return c.in=m.in,c.out=m.out,r}function HC(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),c={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-c.x,e.y-c.y),point:c}}function Yd(e,t){let n=null;return e.forEach((i,o)=>{for(const r of jp(i)){const l=Go(r.from,r.to)?1:Js;for(let c=0;c<l;c+=1){const d=c/l,u=(c+1)/l,p=HC(t,nl(r.from,r.to,d),nl(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:d+(u-d)*p.t,distance:p.distance,point:p.point})}}}),n}function WC(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Kd(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(c=>Math.abs(c-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Qd(e,t,n,i,o){const r=i(t)[n];let l=null,c=1/0;for(const d of e){const u=n==="x"?{x:d.value,y:t.y}:{x:t.x,y:d.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=c||(l=d,c=p)}return l}function OC(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function DC(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function il(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function BC(e,t){const n=il(e,t);return n?{kind:"align",a:{x:e.x-n.x*yo,y:e.y-n.y*yo},b:{x:t.x+n.x*yo,y:t.y+n.y*yo}}:{kind:"align",a:e,b:t}}function ol(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Zd(e,t,n,i,o){if(e.axis===null)return BC(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return ol(o(r)[t],t,i)}function zC(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Zd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Zd(n,"y",l,i,o)),r}function jC(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return il(i(l),r);const c=e.nodes.length,d=t+(n==="in"?1:-1);if(!e.closed&&(d<0||d>=c))return null;const u=e.nodes[(d+c)%c];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return il(i(p),r)}function VC(e,t,n,i,o,r,l){const c=r(t),d=r(e),u=d.x-c.x,p=d.y-c.y,v=Math.hypot(u,p);if(v<1e-6)return{point:e,guides:vo};const x=Math.atan2(p,u),m=Math.round(x/zd)*zd;let h=o?m:null,b=!1;if(!o){const B=[];n&&B.push({angle:Math.atan2(n.y,n.x),smooth:!0}),B.push({angle:m,smooth:!1});for(const O of B){const N=DC(O.angle-x);if(!(Math.abs(N)>SC)&&!(Math.abs(Math.sin(N))*v>bC)){h=O.angle,b=O.smooth;break}}}const S=i!==null&&i>0&&Math.abs(v-i)<=wC;if(h===null&&!S)return{point:e,guides:vo};const M=h??x,y=S?i:v,$={x:Math.cos(M),y:Math.sin(M)},R=y+(h===null?0:yo),X=S?y:b?yo:0;return{point:l({x:c.x+$.x*y,y:c.y+$.y*y}),guides:[{kind:"angle",a:{x:c.x-$.x*X,y:c.y-$.y*X},b:{x:c.x+$.x*R,y:c.y+$.y*R}}]}}const rl=.1,al=8,GC=4,Jd=10,Pa=(e,t)=>{switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}},Yp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},sl=(e,t)=>{const n=Pa(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Jd,y:n.y+o*Jd}},ll=(e,t)=>!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height),qi=(e,t,n)=>{const i=ll(e,t)*n;return{width:t.width*i,height:t.height*i}},jn=(e,t,n)=>(e-t)*n,xo=(e,t,n,i)=>{const o=e-t;if(Math.abs(o)<1e-6)return .5;const r=n/o;return(i==null?void 0:i.clamp)===!1?r:Math.abs(o)<GC?.5:Ia(r)},XC=(e,t,n,i,o,r)=>{const l=qi(e,n,r),c=e.x+jn(e.width,l.width,i),d=e.y+jn(e.height,l.height,o),u=ll(e,n),p=ll(t,n),v=Math.min(al,Math.max(rl,p>0?r*(u/p):r)),x=qi(t,n,v);return{focalX:xo(t.width,x.width,c-t.x,{clamp:!1}),focalY:xo(t.height,x.height,d-t.y,{clamp:!1}),scale:v}},qC=6,UC=3,YC=2,ks="",KC=new RegExp("\\p{L}","gu"),eu=20,QC={arb:"ar",azj:"az",bel:"be",bos:"bs",bul:"bg",ces:"cs",deu:"de",eng:"en",fas:"fa",fra:"fr",hau:"ha",hin:"hi",hrv:"hr",hun:"hu",ibo:"ig",ind:"id",ita:"it",jav:"jv",kaz:"kk",kin:"rw",lin:"ln",mar:"mr",nep:"ne",nld:"nl",nya:"ny",pol:"pl",por:"pt",ron:"ro",run:"rn",rus:"ru",som:"so",spa:"es",srp:"sr",sun:"su",swe:"sv",swh:"sw",tgl:"tl",tur:"tr",ukr:"uk",urd:"ur",uzn:"uz",vie:"vi",yor:"yo",zlm:"ms",zul:"zu"},cl={be:()=>Promise.resolve().then(()=>require("./index-B1vNL0m-.js")).then(e=>e.index),bg:()=>Promise.resolve().then(()=>require("./index-kFrlcZxC.js")).then(e=>e.index),cs:()=>Promise.resolve().then(()=>require("./index-B6E31HBG.js")).then(e=>e.index),de:()=>Promise.resolve().then(()=>require("./index-CNFsG2yO.js")).then(e=>e.index),en:()=>Promise.resolve().then(()=>require("./index-x_p4zv7D.js")).then(e=>e.index),"en-gb":()=>Promise.resolve().then(()=>require("./index-BkmSPu6z.js")).then(e=>e.index),es:()=>Promise.resolve().then(()=>require("./index-CADju5Cy.js")).then(e=>e.index),fr:()=>Promise.resolve().then(()=>require("./index-Rwqfce2n.js")).then(e=>e.index),hi:()=>Promise.resolve().then(()=>require("./index-HhE2sJlU.js")).then(e=>e.index),hr:()=>Promise.resolve().then(()=>require("./index-DapMA5nM.js")).then(e=>e.index),hu:()=>Promise.resolve().then(()=>require("./index-kjKI70JX.js")).then(e=>e.index),id:()=>Promise.resolve().then(()=>require("./index-BlAuAthm.js")).then(e=>e.index),it:()=>Promise.resolve().then(()=>require("./index-BK-G0i5L.js")).then(e=>e.index),mr:()=>Promise.resolve().then(()=>require("./index-CIgabTwE.js")).then(e=>e.index),nl:()=>Promise.resolve().then(()=>require("./index-BrL2zv3x.js")).then(e=>e.index),pl:()=>Promise.resolve().then(()=>require("./index-DehKWXGA.js")).then(e=>e.index),pt:()=>Promise.resolve().then(()=>require("./index-C0cxTf5o.js")).then(e=>e.index),ro:()=>Promise.resolve().then(()=>require("./index-CJ0NMfJ3.js")).then(e=>e.index),ru:()=>Promise.resolve().then(()=>require("./index-gBhj9Tcu.js")).then(e=>e.index),sr:()=>Promise.resolve().then(()=>require("./index-1HMblVmZ.js")).then(e=>e.index),sv:()=>Promise.resolve().then(()=>require("./index-CDO1-R3j.js")).then(e=>e.index),tr:()=>Promise.resolve().then(()=>require("./index-CG_43X7q.js")).then(e=>e.index),uk:()=>Promise.resolve().then(()=>require("./index-Ypt3vHbi.js")).then(e=>e.index)},ZC=(e,t)=>{const n=e;return t(n)??t(n.default)??null};let tu=null;const JC=()=>(tu??(tu=Promise.resolve().then(()=>require("./index-2JTNRDR1.js")).then(e=>e.franc).catch(()=>null)),tu),nu=new Map,eT=e=>{let t=nu.get(e);return t||(t=cl[e]().then(n=>ZC(n,i=>i==null?void 0:i.hyphenateSync)).catch(()=>null),nu.set(e,t)),t},iu=e=>{if(!e)return null;const t=e.toLowerCase();if(cl[t])return t;const n=t.split("-")[0];return cl[n]?n:null},tT=(e,t)=>{const n=t.trim();if(n.length<eu)return;const i=e(n,{minLength:eu});if(i!=="und")return QC[i]??i},nT={hyphenateSync:null};function iT(e,t){const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e)return;let o=!1;return JC().then(async r=>{const l=r?tT(r,t):void 0,c=typeof document<"u"?document.documentElement.lang:"",d=iu(l)??iu(c)??"en",u=await eT(d);o||i({lang:l,hyphenateSync:u})}),()=>{o=!0}},[e,t]),e&&n?n:nT}const ou=e=>{var t;return((t=e.match(KC))==null?void 0:t.length)??0};function oT(e,t){if(e.length<2||e.includes(ks))return;const n=new Set;if(t){const o=t(e,{hyphenChar:ks,minWordLength:qC});let r=0;for(let l=0;l<o.length;l+=1)o[l]===ks?n.add(r):r+=1}for(let o=1;o<e.length-1;o+=1)e[o-1]==="-"&&n.add(o);const i=[...n].filter(o=>{const r=e[o-1]==="-";return o>0&&o<e.length&&ou(e.slice(0,o))>=(r?1:UC)&&ou(e.slice(o))>=(r?1:YC)}).sort((o,r)=>o-r);return i.length?i:void 0}const ru=1.08,na=14,ia=8;function rT({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:c,focalX:d,focalY:u,scale:p,onChange:v,onCommit:x}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,b=s.useRef(null),S=s.useRef(null),M=s.useRef({focalX:d,focalY:u,scale:p});M.current={focalX:d,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var E;y&&((E=m.current)==null||E.focus({preventScroll:!0}))},[y]);const $=s.useCallback((E,w)=>{var V;const L=(V=m.current)==null?void 0:V.getBoundingClientRect();return!L||L.width<=0||L.height<=0?{x:0,y:0}:{x:(E-L.left)/L.width*t.width,y:(w-L.top)/L.height*t.height}},[t.width,t.height]),R=E=>{var L,V;if(!i)return;E.stopPropagation(),E.preventDefault(),(L=m.current)==null||L.focus({preventScroll:!0});const w=qi(n,i,p);b.current={pointerId:E.pointerId,origin:$(E.clientX,E.clientY),startX:jn(n.width,w.width,d),startY:jn(n.height,w.height,u),width:w.width,height:w.height,moved:!1},(V=m.current)==null||V.setPointerCapture(E.pointerId)},X=(E,w)=>{var te,ce;if(!i)return;E.stopPropagation(),E.preventDefault(),(te=m.current)==null||te.focus({preventScroll:!0});const L=qi(n,i,p),V=jn(n.width,L.width,d),_=jn(n.height,L.height,u),K={minX:V,minY:_,maxX:V+L.width,maxY:_+L.height},P=Pa(K,Yp(w)),f=Pa(K,w),U=Math.hypot(f.x-P.x,f.y-P.y);!isFinite(U)||U<=0||(S.current={pointerId:E.pointerId,anchor:P,startDistance:U,startScale:p,startX:V,startY:_,moved:!1},(ce=m.current)==null||ce.setPointerCapture(E.pointerId))},B=E=>{if(!i)return;const w=S.current;if(w&&E.pointerId===w.pointerId){E.stopPropagation(),E.preventDefault();const V=$(E.clientX,E.clientY),_={x:V.x-n.x,y:V.y-n.y},K=Math.hypot(_.x-w.anchor.x,_.y-w.anchor.y),P=Math.min(al,Math.max(rl,w.startScale*(K/w.startDistance)));if(!w.moved&&Math.abs(P-w.startScale)<1e-4)return;w.moved=!0;const f=P/w.startScale,U=w.anchor.x+(w.startX-w.anchor.x)*f,te=w.anchor.y+(w.startY-w.anchor.y)*f,ce=qi(n,i,P);v({focalX:xo(n.width,ce.width,U),focalY:xo(n.height,ce.height,te),scale:P});return}const L=b.current;if(L&&E.pointerId===L.pointerId){E.stopPropagation(),E.preventDefault();const V=$(E.clientX,E.clientY),_=V.x-L.origin.x,K=V.y-L.origin.y;if(!L.moved&&_===0&&K===0)return;L.moved=!0,v({focalX:xo(n.width,L.width,L.startX+_),focalY:xo(n.height,L.height,L.startY+K),scale:p})}},O=E=>{var V,_;const w=b.current;if(w&&E.pointerId===w.pointerId){b.current=null,E.stopPropagation(),(V=m.current)!=null&&V.hasPointerCapture(w.pointerId)&&m.current.releasePointerCapture(w.pointerId),w.moved&&x(M.current);return}const L=S.current;L&&E.pointerId===L.pointerId&&(S.current=null,E.stopPropagation(),(_=m.current)!=null&&_.hasPointerCapture(L.pointerId)&&m.current.releasePointerCapture(L.pointerId),L.moved&&x(M.current))},N=E=>{if(E.key==="Escape"){E.stopPropagation(),c("none");return}if(E.key==="="||E.key==="+"||E.key==="-"||E.key==="_"){E.preventDefault(),E.stopPropagation();const w=E.key==="="||E.key==="+",L=Math.min(al,Math.max(rl,p*(w?ru:1/ru))),V={focalX:d,focalY:u,scale:L};v(V),x(V)}},z=["nw","ne","se","sw"],C={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},I=s.useMemo(()=>{const E=i??{width:n.width,height:n.height},w=qi(n,E,p);return!(w.width>0)||!(w.height>0)?null:{x:n.x+jn(n.width,w.width,d),y:n.y+jn(n.height,w.height,u),width:w.width,height:w.height}},[i,n.x,n.y,n.width,n.height,d,u,p]),j=I?{minX:I.x,minY:I.y,maxX:I.x+I.width,maxY:I.y+I.height}:C;return a.jsxs("svg",{ref:m,className:`${e}-editor${y?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:N,onPointerMove:B,onPointerUp:O,onPointerCancel:O,onLostPointerCapture:O,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>c("none")}),y&&o&&I&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:I.x,y:I.y,width:I.width,height:I.height,children:[a.jsx("rect",{x:I.x,y:I.y,width:I.width,height:I.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:I.x,y:I.y,width:I.width,height:I.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:I.x,y:I.y,width:I.width,height:I.height})]}),y&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:R}),z.map(E=>{const w=sl(j,E),L=E==="ne"||E==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:w.x-ia/2,y:w.y-ia/2,width:ia,height:ia}),a.jsx("rect",{className:`${e}-editor-scale-grab${L?` ${e}-editor-scale-grab-nesw`:""}`,x:w.x-na/2,y:w.y-na/2,width:na,height:na,onPointerDown:V=>X(V,E)})]},E)})]})]})}const dl=10,aT=dl*2,Bn=7,sT=4,co=9,lT=3.5,au=1.08,cT=.05,oa=14,dT=1,ra=14,aa=8;function uT({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:c,onStageChange:d,onSelectionChange:u,onChange:p,onCommit:v}){const x=s.useRef(null),m=s.useRef(null),h=s.useRef(i);h.current=i;const b=s.useRef(null),S=s.useRef(null),M=s.useRef(null),y=s.useRef(null),[$,R]=s.useState([]),[X,B]=s.useState(vo),[O,N]=s.useState(null),z=s.useCallback(g=>{B(G=>OC(G,g)?G:g)},[]),C=c==="shape";s.useEffect(()=>{var g;C&&((g=x.current)==null||g.focus({preventScroll:!0}))},[C]),s.useEffect(()=>{C||R(g=>g.length?[]:g)},[C]);const I=$.length>0;s.useEffect(()=>{u==null||u(I)},[I,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const j=n.width>0?t.width/n.width:1,E=n.height>0?t.height/n.height:1,w=Math.min(j,E),L=r&&l?w:j,V=r&&l?w:E,_=r&&l?(t.width-n.width*w)/2:0,K=r&&l?(t.height-n.height*w)/2:0,P=s.useCallback(g=>r?{x:_+(g.x-n.x)*L,y:K+(g.y-n.y)*V}:{x:g.x-n.x,y:g.y-n.y},[r,n,L,V,_,K]),f=s.useCallback(g=>r?{x:n.x+(L>0?(g.x-_)/L:0),y:n.y+(V>0?(g.y-K)/V:0)}:{x:n.x+g.x,y:n.y+g.y},[r,n,L,V,_,K]),U=s.useMemo(()=>f({x:t.width/2,y:t.height/2}),[f,t.width,t.height]),te=s.useCallback((g,G)=>{var ne;const Q=(ne=x.current)==null?void 0:ne.getBoundingClientRect();if(!Q||Q.width<=0||Q.height<=0)return{x:0,y:0};if(r){const ue=(g-Q.left)/Q.width*t.width,q=(G-Q.top)/Q.height*t.height;return{x:n.x+(L>0?(ue-_)/L:0),y:n.y+(V>0?(q-K)/V:0)}}return{x:n.x+(g-Q.left),y:n.y+(G-Q.top)}},[r,n,t.width,t.height,L,V,_,K]),ce=s.useCallback((g,G)=>{var ne;const Q=(ne=x.current)==null?void 0:ne.getBoundingClientRect();return!Q||Q.width<=0||Q.height<=0?{x:0,y:0}:{x:(g-Q.left)/Q.width*t.width,y:(G-Q.top)/Q.height*t.height}},[t.width,t.height]),F=s.useCallback((g,G)=>{const Q=l&&!(G!=null&&G.preserveShape)?MC(g,n,t,_,K,L,V):g;v(Q,G)},[v,l,n,t,_,K,L,V]),ie=s.useCallback(()=>{N(null)},[]),T=s.useCallback((g,G,Q)=>{if(!Q||b.current||S.current||M.current||y.current){ie();return}const ne=ce(g,G),ue=un(h.current,P);for(const H of ue)for(const Ie of H.nodes)if(Math.hypot(Ie.p.x-ne.x,Ie.p.y-ne.y)<=co){ie();return}const q=Yd(ue,ne);if(!q||q.distance>dl){ie();return}const D=ue[q.contour],se=D==null?void 0:D.nodes[q.segment],Y=D==null?void 0:D.nodes[(q.segment+1)%((D==null?void 0:D.nodes.length)??1)],pe=!!(se&&Y&&!Go(se,Y));N(H=>H&&H.curved===pe&&Math.hypot(H.point.x-q.point.x,H.point.y-q.point.y)<.25?H:{point:q.point,curved:pe})},[ce,P,ie]),le=g=>{var Oe;const G=g.metaKey||g.ctrlKey,Q=M.current;if(Q&&g.pointerId===Q.pointerId){if(g.stopPropagation(),g.preventDefault(),Q.startDistance<=0)return;const Je=te(g.clientX,g.clientY),De=Math.hypot(Je.x-Q.origin.x,Je.y-Q.origin.y),Ze=Math.max(cT,De/Q.startDistance);if(!Q.moved&&Math.abs(Ze-1)<1e-4)return;Q.moved=!0,p(Gd(Q.startContours,Q.origin,Ze));return}const ne=S.current;if(ne&&g.pointerId===ne.pointerId){g.stopPropagation(),g.preventDefault();const Je=te(g.clientX,g.clientY),{bbox:De}=ne,Ze=De.maxX-De.minX,at=De.maxY-De.minY,Xe=Je.x-ne.origin.x,be=Je.y-ne.origin.y;let He=Xe,je=be;if(isFinite(Ze)&&isFinite(at))if(r){let Ce=n.x,_e=n.x+n.width,Ue=n.y,Ye=n.y+n.height;l&&(L>0&&(Ce=n.x+(0-_)/L,_e=n.x+(t.width-_)/L),V>0&&(Ue=n.y+(0-K)/V,Ye=n.y+(t.height-K)/V));const lt=Math.min(Ce,_e-Ze),it=Math.max(Ce,_e-Ze),qe=Math.min(Ue,Ye-at),Ee=Math.max(Ue,Ye-at),pt=Math.min(it,Math.max(lt,De.minX+Xe)),ke=Math.min(Ee,Math.max(qe,De.minY+be));He=pt-De.minX,je=ke-De.minY}else{const Ce=De.minX-n.x,_e=De.minY-n.y,Ue=Math.min(0,t.width-Ze),Ye=Math.max(0,t.width-Ze),lt=Math.min(0,t.height-at),it=Math.max(0,t.height-at),qe=Math.min(Ye,Math.max(Ue,Ce+Xe)),Ee=Math.min(it,Math.max(lt,_e+be));He=qe-Ce,je=Ee-_e}const Qe=[];if(!G&&isFinite(Ze)&&isFinite(at)){const Ce=P({x:De.minX+Ze/2+He,y:De.minY+at/2+je}),_e={x:t.width/2,y:t.height/2};Math.abs(Ce.x-_e.x)<=oa&&(He=U.x-De.minX-Ze/2,Qe.push(ol(_e.x,"x",t))),Math.abs(Ce.y-_e.y)<=oa&&(je=U.y-De.minY-at/2,Qe.push(ol(_e.y,"y",t)))}if(!ne.moved&&He===0&&je===0)return;ne.moved=!0,z(Qe.length?Qe:vo),p(un(ne.startContours,Ce=>({x:Ce.x+He,y:Ce.y+je})),{carryImage:!0});return}const ue=y.current;if(ue&&g.pointerId===ue.pointerId){g.stopPropagation(),g.preventDefault();const Je=te(g.clientX,g.clientY);let De=Je.x-ue.origin.x,Ze=Je.y-ue.origin.y;if(g.shiftKey&&(Math.abs(De)>Math.abs(Ze)?Ze=0:De=0),!ue.moved&&De===0&&Ze===0)return;ue.moved=!0,p(qd(ue.startContours,ue.selection,De,Ze));return}const q=b.current;if(!q||g.pointerId!==q.pointerId){T(g.clientX,g.clientY,$.length>0||C);return}ie(),g.stopPropagation(),g.preventDefault();const D=te(g.clientX,g.clientY);if(q.kind==="anchor"){const Je={x:q.anchor.x+(D.x-q.origin.x),y:q.anchor.y+(D.y-q.origin.y)},De=G?[]:WC(h.current,{contour:q.contour,node:q.node}),Ze=G||!q.center?[]:[q.center],at=Qd(Kd(De,Ze.map(He=>He.x),"x"),Je,"x",P,oa),Xe=Qd(Kd(De,Ze.map(He=>He.y),"y"),Je,"y",P,oa),be=G?Je:{x:(at==null?void 0:at.value)??ta(Je.x,o),y:(Xe==null?void 0:Xe.value)??ta(Je.y,o)};if(g.shiftKey&&(Math.abs(be.x-q.anchor.x)>Math.abs(be.y-q.anchor.y)?be.y=q.anchor.y:be.x=q.anchor.x),!q.moved&&be.x===q.anchor.x&&be.y===q.anchor.y)return;q.moved=!0,z(zC(be,at,Xe,t,P)),p(kC(h.current,q.contour,q.node,be));return}const se=(Oe=h.current[q.contour])==null?void 0:Oe.nodes[q.node],Y=q.mirror&&!g.altKey,pe=Y||G?null:q.kind==="in"?se==null?void 0:se.out:se==null?void 0:se.in,H=se?P(se.p):null,Ie=pe?P(pe):null,de=se&&(!G||g.shiftKey)?VC(D,se.p,Y||G?null:jC(h.current[q.contour],q.node,q.kind,P),H&&Ie?Math.hypot(Ie.x-H.x,Ie.y-H.y):null,g.shiftKey,P,f):{point:D,guides:vo},Z=de.guides.length?de.point:G?D:{x:ta(D.x,o),y:ta(D.y,o)},Ne=q.kind==="in"?se==null?void 0:se.in:se==null?void 0:se.out;!q.moved&&Ne&&Z.x===Ne.x&&Z.y===Ne.y||(q.moved=!0,z(de.guides),p(FC(h.current,q.contour,q.node,q.kind,Z,Y)))},J=g=>{z(vo);const G=M.current;if(G&&g.pointerId===G.pointerId){M.current=null,g.stopPropagation();const pe=x.current;pe!=null&&pe.hasPointerCapture(G.pointerId)&&pe.releasePointerCapture(G.pointerId),G.moved&&F(h.current,{preserveShape:!0});return}const Q=S.current;if(Q&&g.pointerId===Q.pointerId){S.current=null,g.stopPropagation();const pe=x.current;pe!=null&&pe.hasPointerCapture(Q.pointerId)&&pe.releasePointerCapture(Q.pointerId),Q.moved?F(h.current,{preserveShape:!0}):R([]);return}const ne=y.current;if(ne&&g.pointerId===ne.pointerId){y.current=null,g.stopPropagation();const pe=x.current;pe!=null&&pe.hasPointerCapture(ne.pointerId)&&pe.releasePointerCapture(ne.pointerId),ne.moved&&F(h.current);return}const ue=b.current;if(!ue||g.pointerId!==ue.pointerId)return;b.current=null,g.stopPropagation();const q=x.current;q!=null&&q.hasPointerCapture(ue.pointerId)&&q.releasePointerCapture(ue.pointerId);const D=Math.hypot(g.clientX-ue.clientOrigin.x,g.clientY-ue.clientOrigin.y);if(ue.moved||D>sT){ue.moved&&F(h.current);return}if(!ue.toggleOnRelease||g.type!=="pointerup")return;const Y=Ud(h.current,ue.contour,ue.node);Y!==h.current&&(p(Y),F(Y))},Se=g=>{g.stopPropagation()},Le=g=>{var G,Q;g.stopPropagation(),g.preventDefault(),ie(),(G=x.current)==null||G.focus({preventScroll:!0}),S.current={pointerId:g.pointerId,origin:te(g.clientX,g.clientY),startContours:Vn(i),bbox:Li(i),moved:!1},(Q=x.current)==null||Q.setPointerCapture(g.pointerId)},me=(g,G)=>{var D,se;g.stopPropagation(),g.preventDefault(),ie(),(D=x.current)==null||D.focus({preventScroll:!0}),R([]),d("shape");const Q=Li(i),ne=Pa(Q,Yp(G)),ue=sl(Q,G),q=Math.hypot(ue.x-ne.x,ue.y-ne.y);!isFinite(q)||q<=0||(M.current={pointerId:g.pointerId,corner:G,origin:ne,startDistance:q,startContours:Vn(i),moved:!1},(se=x.current)==null||se.setPointerCapture(g.pointerId))},ye=(g,G,Q,ne)=>{var D,se,Y,pe;g.stopPropagation(),g.preventDefault(),ie(),(D=x.current)==null||D.focus({preventScroll:!0});const ue=(se=i[Q])==null?void 0:se.nodes[ne];if(!ue)return;if(g.altKey){const H=G==="anchor"?Up(i,Q,ne):NC(i,Q,ne,G);if(H===i)return;R(G==="anchor"?[]:[{contour:Q,node:ne}]),p(H),F(H);return}const q=g.metaKey||g.ctrlKey;if(G==="anchor"&&g.shiftKey&&!q){R(H=>H.some(Ie=>Ie.contour===Q&&Ie.node===ne)?H.filter(Ie=>!(Ie.contour===Q&&Ie.node===ne)):[...H,{contour:Q,node:ne}]);return}if(G==="anchor"&&!q&&$.length>1&&$.some(H=>H.contour===Q&&H.node===ne)){y.current={pointerId:g.pointerId,origin:te(g.clientX,g.clientY),startContours:Vn(i),selection:$,moved:!1},(Y=x.current)==null||Y.setPointerCapture(g.pointerId);return}R([{contour:Q,node:ne}]),b.current={kind:G,contour:Q,node:ne,pointerId:g.pointerId,origin:te(g.clientX,g.clientY),clientOrigin:{x:g.clientX,y:g.clientY},anchor:ue.p,center:RC(i),mirror:G!=="anchor"&&!!(ue.in&&ue.out),toggleOnRelease:q,moved:!1},(pe=x.current)==null||pe.setPointerCapture(g.pointerId)},ee=g=>{g.stopPropagation(),g.preventDefault(),ie();const G=un(i,P),Q=Yd(G,ce(g.clientX,g.clientY));if(!Q||Q.distance>dl)return;const{contours:ne,nodeIndex:ue}=_C(i,Q.contour,Q.segment,Q.t);ue<0||(R([{contour:Q.contour,node:ue}]),p(ne),F(ne))},oe=g=>{if(g.key==="="||g.key==="+"||g.key==="-"||g.key==="_"){g.preventDefault(),g.stopPropagation();const q=Li(i);if(!isFinite(q.minX)||!isFinite(q.maxX))return;const D={x:(q.minX+q.maxX)/2,y:(q.minY+q.maxY)/2},Y=g.key==="="||g.key==="+"?au:1/au,pe=Gd(i,D,Y);p(pe),F(pe,{preserveShape:!0});return}if(g.key==="Escape"){g.stopPropagation(),R([]),d("none");return}if(!$.length)return;if(g.key==="Backspace"||g.key==="Delete"){g.preventDefault(),g.stopPropagation();const q=AC(i,$);if(q===i)return;R([]),p(q),F(q);return}const G=o>0?o:dT,Q=g.shiftKey?G*10:G,ne={ArrowLeft:[-Q,0],ArrowRight:[Q,0],ArrowUp:[0,-Q],ArrowDown:[0,Q]}[g.key];if(!ne)return;g.preventDefault(),g.stopPropagation();const ue=qd(i,$,ne[0],ne[1]);p(ue),F(ue)},re=s.useMemo(()=>Wo(un(i,P)),[i,P]),ge=s.useMemo(()=>Li(i),[i]),we=P({x:ge.minX,y:ge.minY}),Ae={width:P({x:ge.maxX,y:ge.minY}).x-we.x,height:P({x:ge.minX,y:ge.maxY}).y-we.y},fe=C&&$.length===0&&isFinite(ge.minX)&&isFinite(ge.maxX)&&ge.maxX>ge.minX&&ge.maxY>ge.minY,ve=$.length>0||C,xe=ve;return a.jsxs("svg",{ref:x,className:`${e}-editor${ve?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:oe,onPointerDown:()=>{var g;return(g=x.current)==null?void 0:g.focus({preventScroll:!0})},onPointerMove:le,onPointerLeave:ie,onPointerUp:J,onPointerCancel:J,onLostPointerCapture:J,onContextMenu:g=>{g.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{R([]),d("none")},onClick:ee}),xe&&a.jsx("path",{className:`${e}-editor-outline`,d:re}),xe&&X.map((g,G)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${g.kind}`,x1:g.a.x,y1:g.a.y,x2:g.b.x,y2:g.b.y},`${g.kind}-${G}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:re,fillRule:"evenodd",onPointerDown:Le,onClick:ee}),xe&&a.jsx("path",{className:`${e}-editor-hit`,d:re,style:{strokeWidth:aT},onClick:ee}),xe&&O&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:O.point.x-Bn/2,y:O.point.y-Bn/2,width:Bn,height:Bn,rx:O.curved?Bn/2:0}),xe&&i.map((g,G)=>g.nodes.map((Q,ne)=>{const ue=$.some(D=>D.contour===G&&D.node===ne),q=P(Q.p);return a.jsxs("g",{children:[ue&&$.length===1&&["in","out"].map(D=>{const se=Q[D];if(!se)return null;const Y=P(se);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:q.x,y1:q.y,x2:Y.x,y2:Y.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:Y.x,cy:Y.y,r:lT}),a.jsx("circle",{className:`${e}-editor-grab`,cx:Y.x,cy:Y.y,r:co,onPointerDown:pe=>ye(pe,D,G,ne),onClick:Se})]},D)}),a.jsx("rect",{className:`${e}-editor-anchor${ue?` ${e}-editor-anchor-selected`:""}`,x:q.x-Bn/2,y:q.y-Bn/2,width:Bn,height:Bn,rx:zp(Q)?Bn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:q.x-co,y:q.y-co,width:co*2,height:co*2,onPointerDown:D=>ye(D,"anchor",G,ne),onClick:Se,onDoubleClick:D=>{D.stopPropagation(),D.preventDefault();const se=Ud(i,G,ne);p(se),F(se)}})]},`${G}-${ne}`)})),fe&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:we.x,y:we.y,width:Ae.width,height:Ae.height}),["nw","ne","se","sw"].map(g=>{const G=P(sl(ge,g)),Q=g==="ne"||g==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:G.x-aa/2,y:G.y-aa/2,width:aa,height:aa}),a.jsx("rect",{className:`${e}-editor-scale-grab${Q?` ${e}-editor-scale-grab-nesw`:""}`,x:G.x-ra/2,y:G.y-ra/2,width:ra,height:ra,onPointerDown:ne=>me(ne,g),onClick:Se})]},g)})]})]})}const pT=4e3,mT=/^(?:https?:|mailto:|tel:)/i;function Kp(e){return!!e&&typeof e=="object"&&e.type==="link"}function gT(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!mT.test(t)))return t}function hT(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,c)=>{for(const d of r){if(Kp(d)){o(d.children??[],gT(d.value),d.target);continue}const u=d,p=(u==null?void 0:u.text)??"";if(p.trim())for(const v of p.split(/\s+/))v&&t.push({text:v,leaf:u,href:l,target:c,para:i})}};o((n==null?void 0:n.children)??[])}),t}function su(e){return{...e.fontFamily&&{fontFamily:zo(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"}}}function fT(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Kp(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function yT(e,t,n,i,o){if(t<=0||!e.length||n<=0||i<=0)return e;const r=o==="avoid"?1:-1;return e.map(l=>{if(!l.length)return l;let c=1/0,d=-1/0,u=1/0,p=-1/0;for(const m of l){const h=m.x*n,b=m.y*i;h<c&&(c=h),h>d&&(d=h),b<u&&(u=b),b>p&&(p=b)}const v=(c+d)/2,x=(u+p)/2;return l.map(m=>{const h=m.x*n,b=m.y*i,S=h-v,M=b-x,y=Math.sqrt(S*S+M*M);if(y<1e-6)return m;const R=Math.max(0,y+r*t)/y;return{x:(v+S*R)/n,y:(x+M*R)/i}})})}const vT=.75;function lu(e,t,n,i,o,r){if(e.kind==="fragment"||!t)return null;const l=e.token.text,c=e.offset>0?t[e.offset-1]:0,d=n?n.map(u=>u-e.offset).filter(u=>u>=(e.offset>0?2:1)&&u<l.length):Array.from({length:l.length-1},(u,p)=>p+1);for(let u=d.length-1;u>=0;u-=1){const p=d[u];if(e.offset+p>t.length)continue;const v=!!n&&l[p-1]!=="-",x=t[e.offset+p-1]-c,m=x+(v?r:0);if(!(m*o>i))return{chars:p,fragmentText:v?`${l.slice(0,p)}-`:l.slice(0,p),remainderText:l.slice(p),fragmentWidth:m,remainderWidth:Math.max(0,e.width-x)}}return null}function cu(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:c,height:d,allowOverflow:u,capInset:p,capLines:v}=e,x=!!e.hyphenate,m=e.charWidths??[],h=e.hyphenPoints??[],b=e.hyphenWidth??0,S=e.lineHeight*l,M=e.spaceWidth*l,y=Math.max(0,e.shapeMargin??0),$=[],R=t.map((P,f)=>({token:P,originalIndex:f,width:n[f],kind:"whole",offset:0}));if(!R.length||c<=0||S<=0)return{segments:$,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const X=Math.max(1,M*.5),B=S*lC,O=yT(i,y,c,d,o),N=Math.max(1,Math.floor(e.columns??1)),z=N>1?Math.max(0,e.columnGap??0):0,C=(c-z*(N-1))/N;let I=0,j=0,E=0,w=0,L=0,V=null;const _=(P,f,U)=>fC(O,(P+B)/d,(P+S-B)/d,o).map(te=>({x0:Math.max(f,te.x0*c),x1:Math.min(U,te.x1*c)})).filter(te=>te.x1>te.x0);for(let P=0;P<N&&I<R.length&&C>0;P+=1){const f=P*(C+z),U=f+C,te=u&&P===N-1;let ce=0;for(let T=0;T+S<=d;T+=S)for(const le of _(T,f,U))ce=Math.max(ce,le.x1-le.x0);let F=R[I].token.para,ie=0;for(;I<R.length&&E<pT;){const T=ie+S>d;if(T&&!te)break;const le=R[I].token.para;if(le>F+1){ie+=S*(le-F-1),F=le-1,E+=1;continue}let J=T?[{x0:f,x1:U}]:_(ie,f,U);p>0&&v>0&&P===0&&!T&&J.length&&(V===null&&(V=E,w=J[0].x0,L=ie),E-V<v&&(J=hC(J,{x0:w,x1:w+p})));const Se=J.reduce((Le,me)=>Math.max(Le,me.x1-me.x0),0);for(const Le of J){const me=Le.x1-Le.x0;if(me<X)continue;if(I>=R.length||R[I].token.para!==le)break;const ye=I;let ee=0;for(;I<R.length&&R[I].token.para===le;){const oe=R[I],re=I===ye,ge=oe.width*l,we=re?ge:M+ge;if(ee+we<=me){ee+=we,I+=1;continue}const Ae=me-ee-(re?0:M),fe=re&&ge>C-.5,ve=me>=Se-.5&&me>=ce*vT,xe=m[oe.originalIndex],g=h[oe.originalIndex],G=(x&&g?lu(oe,xe,g,Ae,l,b):null)??(fe&&ve?lu(oe,xe,void 0,Ae,l,b):null);if(G){const Q={token:{...oe.token,text:G.fragmentText},originalIndex:oe.originalIndex,width:G.fragmentWidth,kind:"fragment",offset:oe.offset},ne={token:{...oe.token,text:G.remainderText},originalIndex:oe.originalIndex,width:G.remainderWidth,kind:"remainder",offset:oe.offset+G.chars};R.splice(I,1,Q,ne),ee+=(re?0:M)+G.fragmentWidth*l,I+=1;break}if(fe&&N===1&&me>=ce-.5){ee+=we,I+=1;continue}break}if(I>ye){const oe=I>=R.length||R[I].token.para!==le;$.push({top:ie,left:Le.x0,width:me,from:ye,to:I,justify:r==="justify"&&!oe})}if(I>=R.length||R[I].token.para!==le)break}F=le,ie+=S,E+=1}j=Math.max(j,ie)}let K=0;if(I>0){const P=R[I-1];K=P.kind==="fragment"?P.originalIndex:P.originalIndex+1}return{segments:$,placed:K,height:$.length?j:0,capLeft:w,capTop:L,renderTokens:R.map(P=>P.token)}}const xT=.12,bT=2,ST=10,As=.25,wT=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},$T=(e,t)=>Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5,CT=(e,t)=>{const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e||!t){i(null);return}let o=0,r=null;const l=()=>{const c=wT(e);(!r||!$T(r,c))&&(r=c,i(c)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},Fs=(e,t)=>{if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))},nr=typeof window>"u"?s.useEffect:s.useLayoutEffect;function TT(){return typeof document>"u"?null:document.body}function IT({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:c,allowOverflow:d,fitEnabled:u,scale:p,onFitScale:v,padding:x,columns:m,gutter:h,hyphenate:b,showOverflowIndicator:S,dropCapLines:M,dropCapSize:y,showGuides:$,typography:R,imageUrl:X,imageFocalX:B,imageFocalY:O,imageScale:N,imageCustomPath:z,imagePathEdited:C,pathDragActive:I,pathCarryImage:j,onCarryImageConsumed:E,pathEditor:w,imageEditor:L}){var Gt,kt;const V=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[_,K]=s.useState(null),P=s.useRef(null),[f,U]=s.useState({width:0,height:0}),[te,ce]=s.useState(0),[F,ie]=s.useState(0),[T,le]=s.useState(null),[J,Se]=s.useState(0),[Le,me]=s.useState("none");s.useEffect(()=>{!w&&!L&&me("none")},[w,L]);const[ye,ee]=s.useState(null);s.useEffect(()=>{if(!X||typeof Image>"u"){ee(null);return}let Pe=!1;const Be=new Image;return Be.onload=()=>{Pe||ee({width:Be.naturalWidth,height:Be.naturalHeight})},Be.src=X,()=>{Pe=!0}},[X]);const oe=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),re=s.useMemo(()=>hT(oe),[oe]),ge=s.useMemo(()=>fT(oe),[oe]),we=s.useMemo(()=>ge.join(`
|
|
27331
|
+
`),[ge]),{lang:Ae,hyphenateSync:fe}=iT(b,we),ve=s.useMemo(()=>b?re.map(Pe=>oT(Pe.text,fe)):[],[b,re,fe]),xe=M>0&&y>1?((kt=(Gt=re[0])==null?void 0:Gt.text)==null?void 0:kt.charAt(0))??"":"",g=(w==null?void 0:w.contours)??null,G=s.useMemo(()=>{let Pe=[];if(g){const Be=$r(g);Be.length&&(Pe=Co(Be,r))}if(!Pe.length){const Be=i.trim(),ft=Be?Bd(Be,o,r):null;ft&&ft.length?Pe=ft:Pe=el(n==="custom"?"rectangle":n)}return n==="circle"?Fs(Pe,f):Pe},[g,n,i,o,r,f.width,f.height]),Q=w==null?void 0:w.onConvert,ne=(w==null?void 0:w.needsConversion)??!1,ue=s.useMemo(()=>{if(n==="circle")return!1;const Pe=g??(i.trim()?ki(i):null);return!!(Pe&&Xp(Pe,r))},[g,i,r,n]),[q,D]=s.useState(null);nr(()=>{if(!ue){q&&D(null);return}!q&&f.width>0&&f.height>0&&D({width:f.width,height:f.height})},[ue,f.width,f.height,q]);const se=s.useMemo(()=>{if(!ue||f.width<=0||f.height<=0)return G;const Pe=q??f,Be=r.width/Pe.width,ft=r.height/Pe.height;return G.map($t=>$t.map(et=>({x:et.x*Be,y:et.y*ft})))},[G,ue,q,r.width,r.height,f.width,f.height]),Y=s.useMemo(()=>{if(g){const $t=$r(g);if($t.length){const et=Co($t,r);return n==="circle"?Fs(et,f):et}}const Pe=z.trim(),Be=Pe?Bd(Pe,o,r):null,ft=Be&&Be.length?Be:el(n==="custom"?"rectangle":n);return n==="circle"?Fs(ft,f):ft},[g,n,z,o,r,f.width,f.height]),pe=s.useMemo(()=>{if(!ue||f.width<=0||f.height<=0)return Y;const Pe=q??f,Be=r.width/Pe.width,ft=r.height/Pe.height;return Y.map($t=>$t.map(et=>({x:et.x*Be,y:et.y*ft})))},[Y,ue,q,r.width,r.height,f.width,f.height]),H=s.useRef(null),Ie=s.useRef(!1);s.useEffect(()=>{if(!(!Q||f.width<=0||f.height<=0)){if(ue){if(H.current===i)return;const Pe=g??(i.trim()?ki(i):null);if(!(Pe!=null&&Pe.length))return;const Be=un(Pe,ft=>({x:r.x+(ft.x-r.x)/f.width*r.width,y:r.y+(ft.y-r.y)/f.height*r.height}));H.current=Wo(Be),Q(Be);return}!ne||!G.length||Ie.current||(Ie.current=!0,Q(un(Gp(G),Pe=>({x:Pe.x*La,y:Pe.y*La}))))}},[ne,ue,Q,G,g,i,r,f.width,f.height]);const de=s.useCallback(()=>{const Pe=_;if(!Pe)return;const Be=Pe.getBoundingClientRect(),ft=window.getComputedStyle(Pe),$t=parseFloat(ft.paddingTop)||0;ce(Xt=>Math.abs(Xt-$t)<.5?Xt:$t);const et=parseFloat(ft.columnGap)||0;ie(Xt=>Math.abs(Xt-et)<.5?Xt:et);const Et={width:Be.width,height:Be.height};U(Xt=>Math.abs(Xt.width-Et.width)<.5&&Math.abs(Xt.height-Et.height)<.5?Xt:Et)},[_]);nr(()=>{const Pe=_;if(!Pe||typeof ResizeObserver>"u")return;de();const Be=new ResizeObserver(de);return Be.observe(Pe),()=>Be.disconnect()},[_,de]),nr(()=>{de()},[x,h,de]),s.useEffect(()=>{const Pe=typeof document<"u"?document.fonts:void 0;Pe!=null&&Pe.ready&&Pe.ready.then(()=>{Se(Be=>Be+1)})},[]),nr(()=>{const Pe=P.current;if(!Pe)return;if(!re.length){le(null);return}const Be=[],ft=document.createDocumentFragment();for(const It of re){const Zt=document.createElement("span");Object.assign(Zt.style,su(It.leaf)),Zt.textContent=It.text,ft.appendChild(Zt),Be.push(Zt)}const $t=document.createElement("span");$t.textContent=" ",ft.appendChild($t);const et=document.createElement("span");et.textContent="-",ft.appendChild(et);const Et=xe||"H",Xt=document.createElement("span");Xt.textContent=Et,Xt.style.lineHeight="1",ft.appendChild(Xt),Pe.replaceChildren(ft);const mt=window.getComputedStyle(Pe),gt=parseFloat(mt.fontSize)||16,Re=parseFloat(mt.lineHeight),tt=Number.isNaN(Re)?gt*1.2:Re,nt=Math.max(tt,gt),st=document.createElement("span");st.textContent=Et,st.style.lineHeight=`${nt}px`;const At=document.createElement("span");At.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",st.appendChild(At),Pe.appendChild(st);const St=st.getBoundingClientRect().top,ht=At.getBoundingClientRect().top,Dt=Math.max(1,ht-St);st.remove();let Ct=Dt*.8;const jt=document.createElement("canvas").getContext("2d"),Nt=It=>`${mt.fontStyle} ${mt.fontWeight} ${It}px ${mt.fontFamily}`;if(jt){jt.font=Nt(gt);const It=jt.measureText(Et).actualBoundingBoxAscent;It>0&&(Ct=It)}const Bt=y>1?(y-1)*nt+Ct:Ct;let Wt=gt*(Bt/Ct);if(jt){jt.font=Nt(Wt);const It=jt.measureText(Et).actualBoundingBoxAscent;It>0&&(Wt=Wt*(Bt/It))}Xt.style.fontSize=`${Wt}px`,Xt.style.lineHeight=`${Wt}px`;const wt=document.createElement("span");wt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Xt.appendChild(wt);const W=Math.max(1,wt.getBoundingClientRect().top-Xt.getBoundingClientRect().top);wt.remove();const ze=(y-1)*nt+Dt-W,Fe=Be.map(It=>It.getBoundingClientRect().width),yt=$t.getBoundingClientRect().width,Ot=et.getBoundingClientRect().width,ut=xe?Xt.getBoundingClientRect().width:0,Tt=(f.width-F*(m-1))/m,Yt=Be.map((It,Zt)=>{var pi;const on=It.firstChild;if(!(on instanceof Text)||on.data.length<2||!(Fe[Zt]>Tt-.5)&&!((pi=ve[Zt])!=null&&pi.length))return;const xn=document.createRange(),ui=It.getBoundingClientRect().left,dn=[];for(let Kn=1;Kn<=on.data.length;Kn+=1)xn.setStart(on,0),xn.setEnd(on,Kn),dn.push(xn.getBoundingClientRect().right-ui);return dn});Pe.replaceChildren(),le({widths:Fe,spaceWidth:yt,dashWidth:Ot,charWidths:Yt,lineHeight:nt,capWidth:ut,dropCapFontSize:Wt,dropCapTopAdjust:ze})},[re,R,xe,M,y,J,f.width,b,ve,m,F]);const Z=T&&xe?T.capWidth+T.lineHeight*xT:0,Ne=Math.max(M,Math.ceil(y)),Oe=s.useMemo(()=>{if(!T||!re.length||f.width<=0||f.height<=0||!u)return 1;const Pe=$t=>cu({tokens:re,widths:T.widths,spaceWidth:T.spaceWidth,lineHeight:T.lineHeight,width:f.width,height:f.height,rings:se,mode:l,align:c,scale:$t,allowOverflow:!1,capInset:Z*$t,capLines:xe?Ne:0,hyphenate:b,charWidths:T.charWidths,hyphenPoints:ve,hyphenWidth:T.dashWidth,shapeMargin:te,columns:m,columnGap:F});if(Pe(1).placed>=re.length)return 1;if(Pe(As).placed<re.length)return As;let Be=As,ft=1;for(let $t=0;$t<ST;$t+=1){const et=(Be+ft)/2;Pe(et).placed>=re.length?Be=et:ft=et}return Be},[T,re,f.width,f.height,se,l,c,u,Z,xe,Ne,b,ve,te,m,F]);s.useEffect(()=>{v(Oe)},[Oe,v]);const Je=u?Math.min(p,Oe):1,De=s.useMemo(()=>!T||!re.length||f.width<=0||f.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:re}:cu({tokens:re,widths:T.widths,spaceWidth:T.spaceWidth,lineHeight:T.lineHeight,width:f.width,height:f.height,rings:se,mode:l,align:c,scale:Je,allowOverflow:d,capInset:Z*Je,capLines:xe?Ne:0,hyphenate:b,charWidths:T.charWidths,hyphenPoints:ve,hyphenWidth:T.dashWidth,shapeMargin:te,columns:m,columnGap:F}),[T,re,f.width,f.height,se,l,c,Je,d,Z,xe,Ne,b,ve,te,m,F]),Ze=S&&re.length>0&&De.placed<re.length,at=T?T.dropCapFontSize*Je:0,Xe=T?T.dropCapTopAdjust*Je:0,be=c==="justify"?"left":c,He=T?T.lineHeight*Je:0,je=De.segments.length?De.segments[De.segments.length-1]:null,Qe=je?{top:je.top+He,left:je.left+je.width/2}:{top:f.height,left:f.width/2},Ce=!!(w&&g&&f.width>0&&f.height>0),_e=!!L,Ue=(Ce||_e)&&f.width>0&&f.height>0,Ye=CT(_,Ue),lt=Ue&&Ye?TT():null,it=s.useRef(!1),qe=s.useCallback(Pe=>{it.current=Pe},[]);s.useEffect(()=>{if(!Ce&&!_e)return;const Pe=Be=>{const ft=_;if(!ft)return;const $t=ft.getBoundingClientRect();Be.clientX>=$t.left&&Be.clientX<=$t.right&&Be.clientY>=$t.top&&Be.clientY<=$t.bottom&&(Be.preventDefault(),Be.stopPropagation(),me(Et=>Et==="shape"&&it.current?Et:Et==="shape"&&_e?"image":Ce?"shape":"image"))};return document.addEventListener("dblclick",Pe,!0),()=>document.removeEventListener("dblclick",Pe,!0)},[Ce,_e,_]);const Ee=s.useMemo(()=>X&&f.width>0&&f.height>0?cC(pe,f):null,[X,pe,f.width,f.height]),pt=s.useRef(null),ke=(()=>{const Pe=pt.current;return j||!C||!L||!ye||!Ee||!Pe||z===Pe.customPath||Pe.shape!==n&&n!=="custom"?null:XC(Pe.bounds,Ee,ye,Pe.focalX,Pe.focalY,Pe.scale)})();nr(()=>{if(!L){pt.current=null;return}if(I||!ye||!Ee)return;const Pe=pt.current,Be=!!(Pe&&z!==Pe.customPath);Be&&ke&&L.onCommit(ke),Be&&j&&(E==null||E()),pt.current={rings:pe,bounds:Ee,focalX:(ke==null?void 0:ke.focalX)??B,focalY:(ke==null?void 0:ke.focalY)??O,scale:(ke==null?void 0:ke.scale)??N,customPath:z,shape:n}},[I,j,z,n,pe,Ee,L,ye,B,O,N,ke,E]);const We=pt.current,Ve=!!(I&&!j&&We&&!ke),ct=Ve&&We?We.focalX:(ke==null?void 0:ke.focalX)??B,ot=Ve&&We?We.focalY:(ke==null?void 0:ke.focalY)??O,xt=Ve&&We?We.scale:(ke==null?void 0:ke.scale)??N,Pt=Ve&&We?We.bounds:Ee,Vt=s.useMemo(()=>{if(!(f.width>0)||!(f.height>0))return"";let Pe=jd(i,g,o,r,n,f);if(ue){const Be=q??f,ft=r.width/Be.width,$t=r.height/Be.height;Pe=un(Pe,et=>({x:et.x*ft,y:et.y*$t}))}return Vd(Pe,f)||Dd(se,f)},[i,g,o,r,n,f.width,f.height,ue,q,se]),vt=s.useMemo(()=>{if(!X||!(f.width>0)||!(f.height>0))return"";let Pe=jd(z,g,o,r,n,f);if(ue){const Be=q??f,ft=r.width/Be.width,$t=r.height/Be.height;Pe=un(Pe,et=>({x:et.x*ft,y:et.y*$t}))}return Vd(Pe,f)||Dd(pe,f)},[X,z,g,o,r,n,f.width,f.height,ue,q,pe]),Mt=`${V}-clip`,Ht=s.useMemo(()=>{if(!Pt)return null;const Pe=ye??{width:Pt.width,height:Pt.height},Be=qi(Pt,Pe,xt);return{x:jn(Pt.width,Be.width,ct),y:jn(Pt.height,Be.height,ot),width:Be.width,height:Be.height}},[Pt,ye,ct,ot,xt]);return a.jsxs("div",{className:`${e}-column`,style:{padding:x,columnGap:h},lang:Ae,ref:K,children:[Vt?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:f.width,height:f.height},viewBox:`0 0 ${f.width} ${f.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Vt,fillRule:"evenodd"}),X&&vt&&Pt&&Ht?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Mt,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:vt,fillRule:"evenodd"})})}),a.jsx("image",{href:X,x:Pt.x+Ht.x,y:Pt.y+Ht.y,width:Ht.width,height:Ht.height,preserveAspectRatio:"none",clipPath:`url(#${Mt})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${d?"":` ${e}-clip`}`,style:{...R,["--"+e+"-fit"]:Je,top:0,left:0,width:f.width,height:f.height},children:[a.jsx("div",{className:`${e}-measure`,ref:P,style:R,"aria-hidden":!0}),De.segments.map((Pe,Be)=>{const ft=De.renderTokens.slice(Pe.from,Pe.to),$t=Be===0;return a.jsx("div",{className:`${e}-line${Pe.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${Pe.top}px`,left:`${Pe.left}px`,width:`${Pe.width}px`,textAlign:Pe.justify?void 0:be},children:ft.map((et,Et)=>{const mt=xe&&$t&&Pe.from===0&&Et===0?et.text.slice(1):et.text,gt=su(et.leaf),Re=et.href?a.jsx("a",{className:`${e}-link`,href:et.href,target:et.target,rel:et.target?"noopener noreferrer":void 0,style:gt,children:mt}):a.jsx("span",{style:gt,children:mt});return a.jsxs("span",{children:[!Pe.justify&&Et>0?" ":null,Re]},Et)})},`${Pe.from}-${Pe.to}-${Be}`)}),$&&!g&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:se.map((Pe,Be)=>a.jsx("polygon",{points:Pe.map(ft=>`${ft.x},${ft.y}`).join(" ")},Be))})]}),xe&&T&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...R,top:`${De.capTop+Xe}px`,left:`${De.capLeft}px`,fontSize:`${at}px`,lineHeight:`${at}px`},children:xe}),lt&&Ye&&(g&&w||L)&&Un.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,zIndex:bT,pointerEvents:"none"},children:[g&&w&&a.jsx(uT,{P:e,box:{width:Ye.width,height:Ye.height},viewBox:r,contours:g,snap:w.snap,stretchToBox:!ue,uniformStretch:n==="circle",stage:Le,onStageChange:me,onSelectionChange:qe,onChange:w.onChange,onCommit:w.onCommit}),L&&Pt&&a.jsx(rT,{P:e,box:{width:Ye.width,height:Ye.height},bounds:Pt,natural:ye,imageUrl:X,maskPath:vt,stage:Le,onStageChange:me,focalX:ct,focalY:ot,scale:xt,onChange:L.onChange,onCommit:L.onCommit})]}),lt),a.jsx("div",{className:`${e}-a11y`,children:ge.map((Pe,Be)=>a.jsx("p",{children:Pe},Be))}),Ze&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:Qe.top,left:Qe.left},"aria-hidden":!0,children:[a.jsx("path",{d:"M12.8,4 L20.2,4 C24.68042,4 26.9206301,4 28.631924,4.87194781 C31.3123488,6.23769248 33,8.99168887 33,12 C33,15.0083111 31.3123488,17.7623075 28.631924,19.1280522 C26.9206301,20 24.68042,20 20.2,20 L12.8,20 C8.31957995,20 6.07936993,20 4.368076,19.1280522 C1.68765116,17.7623075 0,15.0083111 0,12 C0,8.99168887 1.68765116,6.23769248 4.368076,4.87194781 C6.07936993,4 8.31957995,4 12.8,4 Z",fill:"#FF4400"}),a.jsx("path",{transform:"translate(5, 0)",fill:"#FFFFFF",d:"M12,5.625 C12.3846269,5.625 12.7016304,5.91453014 12.7449542,6.28753416 L12.75,6.375 L12.75,11.25 L17.625,11.25 C18.0392136,11.25 18.375,11.5857864 18.375,12 C18.375,12.3846269 18.0854699,12.7016304 17.7124658,12.7449542 L17.625,12.75 L12.75,12.75 L12.75,17.625 C12.75,18.0392136 12.4142136,18.375 12,18.375 C11.6153731,18.375 11.2983696,18.0854699 11.2550458,17.7124658 L11.25,17.625 L11.25,12.75 L6.375,12.75 C5.96078644,12.75 5.625,12.4142136 5.625,12 C5.625,11.6153731 5.91453014,11.2983696 6.28753416,11.2550458 L6.375,11.25 L11.25,11.25 L11.25,6.375 C11.25,5.96078644 11.5857864,5.625 12,5.625 Z"})]})]})}const Qp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],LT={x:0,y:0,width:100,height:100},PT=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?LT:{x:t[0],y:t[1],width:t[2],height:t[3]}},RT=e=>`
|
|
27331
27332
|
.${e}-wrapper {
|
|
27332
27333
|
box-sizing: border-box;
|
|
27333
27334
|
display: flex;
|
|
@@ -27556,7 +27557,7 @@ export function Burger({
|
|
|
27556
27557
|
clip-path: inset(50%);
|
|
27557
27558
|
white-space: nowrap;
|
|
27558
27559
|
}
|
|
27559
|
-
`,
|
|
27560
|
+
`,MT=1;function ET({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:c}=A.useScopedStyles(),d=s.useMemo(()=>RT(c),[c]),u=n??!1,p=!!r||!!o,v=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),x=(e==null?void 0:e.shape)??"custom",m=(e==null?void 0:e.customPath)??"",h=(e==null?void 0:e.pathFit)??"stretch",b=s.useMemo(()=>PT(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),S=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",M=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",$=((e==null?void 0:e.fitText)??"off")==="on",R=((e==null?void 0:e.hyphenate)??"off")==="on",X=A.scalingValue((e==null?void 0:e.padding)??0,u),B=Math.max(1,Math.round((e==null?void 0:e.columns)??1)),O=A.scalingValue((e==null?void 0:e.columnGutter)??0,u),N=(e==null?void 0:e.dropCapSize)??MT,z=Math.max(1,Math.round((e==null?void 0:e.dropCapLines)??N)),C=u&&p&&!i,I=u&&!i,[j,E]=s.useState(!1);s.useEffect(()=>{if(!u||!p){E(!1);return}const Y=()=>E(!0),pe=()=>E(!1),H=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],Ie=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const de of H)window.addEventListener(de,Y);for(const de of Ie)window.addEventListener(de,pe);return()=>{for(const de of H)window.removeEventListener(de,Y);for(const de of Ie)window.removeEventListener(de,pe)}},[u,p]);const w=u&&p&&!i&&typeof l=="function",L=!j,V=Math.max(0,(e==null?void 0:e.pathSnap)??0),_=s.useRef(e??{}),K=s.useRef(""),P=[e==null?void 0:e.customPath,e==null?void 0:e.shape,e==null?void 0:e.pathFit,e==null?void 0:e.pathViewBox,e==null?void 0:e.imageScale,e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.image].join("\0");if(P!==K.current)K.current=P,_.current=e??{};else if(e){const{customPath:Y,shape:pe,pathFit:H,pathViewBox:Ie,imageScale:de,imageFocalX:Z,imageFocalY:Ne,image:Oe,...Je}=e,De=_.current;for(const Ze of Object.keys(Je))if(De[Ze]!==Je[Ze]){_.current={...De,...Je};break}}const[f,U]=s.useState(null),[te,ce]=s.useState(!1),[F,ie]=s.useState(!1),T=s.useCallback(()=>ie(!1),[]),le=_.current.shape??x,J=!!(f&&(f.base===m||f.serialized===m)),Se=J&&f?f.serialized:m;s.useEffect(()=>{w||(ce(!1),ie(!1))},[w]),s.useEffect(()=>{!f||te||f.serialized===m&&U(null)},[f,m,te]);const Le=s.useMemo(()=>{if(!w)return null;if(f&&(f.base===m||f.serialized===m))return f.contours;const Y=ki(m);return Y.length?Y:null},[w,f,m]),me=!!(h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Zs&&Le&&(x==="circle"||!Xp(Le,b))),ye=s.useCallback((Y,pe,H)=>{const Ie=Wo(Y);if(U(de=>({base:de&&(de.base===m||de.serialized===m)?de.base:m,serialized:Ie,contours:Y})),pe){const de=_.current,Z=H!=null&&H.preserveShape?de.shape:"custom",Ne={...de,shape:Z,customPath:Ie};_.current=Ne,l==null||l(Ne)}},[m,l]),ee=s.useMemo(()=>w?{contours:me?Le:null,snap:V,needsConversion:!me,onConvert:Y=>{const pe=Wo(Y);U({base:pe,serialized:pe,contours:Y});const H={..._.current,pathFit:"viewbox",pathViewBox:Zs,customPath:pe};_.current=H,l==null||l(H)},onChange:(Y,pe)=>{ce(!0),ie(!!(pe!=null&&pe.carryImage)),ye(Y,!1)},onCommit:(Y,pe)=>{ye(Y,!0,pe),ce(!1)}}:null,[w,me,Le,V,l,ye]),oe=S==="avoid"&&!!(e!=null&&e.image),re=s.useMemo(()=>({focalX:(e==null?void 0:e.imageFocalX)??.5,focalY:(e==null?void 0:e.imageFocalY)??.5,scale:(e==null?void 0:e.imageScale)??1}),[e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.imageScale]),[ge,we]=s.useState(null),Ae=ge??re,fe=s.useCallback(Y=>we(Y),[]),ve=s.useCallback(Y=>{we(Y);const pe={..._.current,imageFocalX:Y.focalX,imageFocalY:Y.focalY,imageScale:Y.scale};_.current=pe,l==null||l(pe)},[l]);s.useEffect(()=>{ge&&Math.abs(ge.focalX-re.focalX)<1e-9&&Math.abs(ge.focalY-re.focalY)<1e-9&&Math.abs(ge.scale-re.scale)<1e-9&&we(null)},[ge,re]);const xe=s.useMemo(()=>!w||!oe?null:{onChange:fe,onCommit:ve},[w,oe,fe,ve]),[g,G]=s.useState(void 0),Q=s.useRef(void 0),ne=s.useCallback(Y=>{const pe=Q.current;pe!==void 0&&Math.abs(pe-Y)<.005||(Q.current=Y,G(Y))},[]),ue=s.useMemo(()=>$&&typeof g=="number"?g:1,[g,$]),q=Y=>`calc(${Y} * var(--${c}-fit, 1))`,D=s.useMemo(()=>{var H,Ie,de,Z,Ne;const Y=(e==null?void 0:e.textFontSize)??.012,pe=Math.max((e==null?void 0:e.textLineHeight)??Y,Y);return{fontFamily:zo(e==null?void 0:e.textFontFamily),fontWeight:(H=e==null?void 0:e.textFontSettings)==null?void 0:H.fontWeight,fontStyle:(Ie=e==null?void 0:e.textFontSettings)==null?void 0:Ie.fontStyle,fontSize:q(A.scalingValue(Y,u)),lineHeight:q(A.scalingValue(pe,u)),letterSpacing:q(A.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:q(A.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(de=e==null?void 0:e.textTextAppearance)==null?void 0:de.textTransform,textDecoration:(Z=e==null?void 0:e.textTextAppearance)==null?void 0:Z.textDecoration,fontVariant:(Ne=e==null?void 0:e.textTextAppearance)==null?void 0:Ne.fontVariant}},[e,u,c]),se={[`--${c}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${c}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${c}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{className:`${c}-wrapper`,style:{...se},children:a.jsx(IT,{P:c,item:v,shape:le,customPath:m,pathFit:h,viewBox:b,mode:S,align:M,allowOverflow:y,fitEnabled:$,scale:ue,onFitScale:ne,padding:X,columns:B,gutter:O,hyphenate:R,showOverflowIndicator:I,dropCapLines:z,dropCapSize:N,showGuides:(C||w)&&L,typography:D,imageUrl:S==="avoid"?e==null?void 0:e.image:null,imageFocalX:Ae.focalX,imageFocalY:Ae.focalY,imageScale:Ae.scale,imageCustomPath:Se,imagePathEdited:J,pathDragActive:te,pathCarryImage:F,onCarryImageConsumed:T,pathEditor:L?ee:null,imageEditor:L?xe:null})})]})}const kT=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
27560
27561
|
import type React from 'react';
|
|
27561
27562
|
import { CommonComponentProps } from '../props';
|
|
27562
27563
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -27625,6 +27626,8 @@ export type PretextSettings = {
|
|
|
27625
27626
|
fitText?: 'on' | 'off';
|
|
27626
27627
|
hyphenate?: 'on' | 'off';
|
|
27627
27628
|
padding?: number;
|
|
27629
|
+
columns?: number;
|
|
27630
|
+
columnGutter?: number;
|
|
27628
27631
|
dropCapLines?: number;
|
|
27629
27632
|
dropCapSize?: number;
|
|
27630
27633
|
image?: string | null;
|
|
@@ -27761,6 +27764,8 @@ export type ColumnProps = {
|
|
|
27761
27764
|
scale: number;
|
|
27762
27765
|
onFitScale: (scale: number) => void;
|
|
27763
27766
|
padding: string;
|
|
27767
|
+
columns: number;
|
|
27768
|
+
gutter: string;
|
|
27764
27769
|
hyphenate: boolean;
|
|
27765
27770
|
showOverflowIndicator: boolean;
|
|
27766
27771
|
dropCapLines: number;
|
|
@@ -27772,6 +27777,7 @@ export type ColumnProps = {
|
|
|
27772
27777
|
imageFocalY: number;
|
|
27773
27778
|
imageScale: number;
|
|
27774
27779
|
imageCustomPath: string;
|
|
27780
|
+
imagePathEdited: boolean;
|
|
27775
27781
|
pathDragActive: boolean;
|
|
27776
27782
|
pathCarryImage: boolean;
|
|
27777
27783
|
onCarryImageConsumed?: () => void;
|
|
@@ -28108,6 +28114,8 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
28108
28114
|
const fitEnabled = (settings?.fitText ?? 'off') === 'on';
|
|
28109
28115
|
const hyphenate = (settings?.hyphenate ?? 'off') === 'on';
|
|
28110
28116
|
const paddingCss = scalingValue(settings?.padding ?? 0, editor);
|
|
28117
|
+
const columns = Math.max(1, Math.round(settings?.columns ?? 1));
|
|
28118
|
+
const gutterCss = scalingValue(settings?.columnGutter ?? 0, editor);
|
|
28111
28119
|
const dropCapSize = settings?.dropCapSize ?? DROP_CAP_SIZE_DEFAULT;
|
|
28112
28120
|
const dropCapLines = Math.max(1, Math.round(settings?.dropCapLines ?? dropCapSize));
|
|
28113
28121
|
const showGuides = editor && selected && !isPreviewMode;
|
|
@@ -28183,10 +28191,11 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
28183
28191
|
const onCarryImageConsumed = useCallback(() => setPathCarryImage(false), []);
|
|
28184
28192
|
|
|
28185
28193
|
const liveShape = settingsRef.current.shape ?? shape;
|
|
28186
|
-
|
|
28187
|
-
|
|
28188
|
-
|
|
28189
|
-
|
|
28194
|
+
// A draft only stands in for the path it was made from. Once customPath moves
|
|
28195
|
+
// on for another reason (layout switch, undo), the draft is stale and the
|
|
28196
|
+
// image must not treat that change as a path edit.
|
|
28197
|
+
const imagePathEdited = Boolean(draft && (draft.base === customPath || draft.serialized === customPath));
|
|
28198
|
+
const imageCustomPath = imagePathEdited && draft ? draft.serialized : customPath;
|
|
28190
28199
|
|
|
28191
28200
|
useEffect(() => {
|
|
28192
28201
|
if (!pathEditing) {
|
|
@@ -28362,6 +28371,8 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
28362
28371
|
scale={sharedScale}
|
|
28363
28372
|
onFitScale={handleFitScale}
|
|
28364
28373
|
padding={paddingCss}
|
|
28374
|
+
columns={columns}
|
|
28375
|
+
gutter={gutterCss}
|
|
28365
28376
|
hyphenate={hyphenate}
|
|
28366
28377
|
showOverflowIndicator={showOverflowIndicator}
|
|
28367
28378
|
dropCapLines={dropCapLines}
|
|
@@ -28373,6 +28384,7 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
28373
28384
|
imageFocalY={liveImageTransform.focalY}
|
|
28374
28385
|
imageScale={liveImageTransform.scale}
|
|
28375
28386
|
imageCustomPath={imageCustomPath}
|
|
28387
|
+
imagePathEdited={imagePathEdited}
|
|
28376
28388
|
pathDragActive={pathDragActive}
|
|
28377
28389
|
pathCarryImage={pathCarryImage}
|
|
28378
28390
|
onCarryImageConsumed={onCarryImageConsumed}
|
|
@@ -28383,4 +28395,4 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
28383
28395
|
</>
|
|
28384
28396
|
);
|
|
28385
28397
|
}
|
|
28386
|
-
`,
|
|
28398
|
+
`,du=[...Qp],AT={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},FT={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",display:{type:"shape-select",isFilled:!0,enum:du},enum:du},customPath:{type:"string",scope:"layout",title:"Path",tooltip:"SVG path (M…) or a point list (0,0 100,0 50,100). Used when Shape is set to custom.",display:{type:"full-width-input",placeholder:"M0,0 C…"}},pathSnap:{type:"number",scope:"common",title:"Snap",tooltip:"Grid the points snap to while dragging, in path units (the path box is 100 x 100). 0 is off.",min:0,max:25,step:.5,display:{type:"numeric-input"}},pathFit:{type:"string",scope:"common",title:"Path fit",tooltip:"Stretch — the drawing fills the box. Viewbox — the drawing keeps its position in path coordinates (0–100).",display:{type:"toggle-cycle",enum:["stretch","viewbox"]}},shapeMode:{type:"string",scope:"common",title:"",tooltip:"A — text fills the path. B — text flows around the path.",display:{type:"radio-group"},enum:["A","B"]},fitText:{type:"string",scope:"common",title:"Fit text",tooltip:"Scales the type down until all text fits the path.",display:{type:"toggle-cycle",enum:["off","on"]}},hyphenate:{type:"string",scope:"common",title:"Hyphenate",tooltip:"Breaks long words between syllables, using the detected language of the text.",display:{type:"toggle-cycle",enum:["off","on"]}},padding:{type:"number",scope:"layout",title:"Padding",tooltip:"Insets the shape and its text on all sides.",min:0,display:{type:"numeric-input"}},columns:{type:"number",scope:"layout",title:"Columns",tooltip:"Splits the text area into columns. Text fills them left to right.",min:1,max:24,step:1,display:{type:"common-numeric-input"}},columnGutter:{type:"number",scope:"layout",title:"Columns gap",tooltip:"Space between columns.",min:0,display:{type:"numeric-input"}},dropCapLines:{type:"number",scope:"common",title:"Drop cap lines",min:1,max:8,step:1,display:{type:"numeric-input"}},dropCapSize:{type:"number",scope:"common",title:"Drop cap size",tooltip:"Height of the drop cap, in lines of body text.",min:1,max:8,step:1,display:{type:"common-numeric-input"}},image:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},backgroundColor:{type:"string",scope:"common",title:"BG Shape",display:{type:"settings-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...AT.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},textAlign:{type:"string",scope:"layout",title:"",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"style-panel-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"style-panel-color-picker"}}},defaults:{...qp("circle"),pathSnap:0,shapeMode:"A",fitText:"off",hyphenate:"off",dropCapLines:1,dropCapSize:1,image:"01M3QM74XGCCGW8DXMAHA0RGGH",backgroundColor:"rgba(0, 0, 0, 0)",textFontFamily:"Basteleur",textFontSettings:{fontWeight:400,fontStyle:"normal"},textAlign:"center",textTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",linkColor:"#000000"},layoutDefaults:{m:{textFontSize:.037,textLineHeight:.048,textLetterSpacing:0,textWordSpacing:0,padding:0,columns:1,columnGutter:.04},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0,padding:0,columns:1,columnGutter:.02},d:{textFontSize:.032,textLineHeight:.0155,textLetterSpacing:-.001,textWordSpacing:0,padding:0,columns:1,columnGutter:.015}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","fitText","hyphenate","padding","columns","columnGutter","dropCapLines","dropCapSize","image"],displayRules:[{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.image.display.visible",value:!1}},{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.padding.display.visible",value:!1}},{if:{name:"shapeMode",value:"A"},then:{name:"properties.shape.display.isFilled",value:!0}},{if:{name:"shapeMode",value:"B"},then:{name:"properties.shape.display.isFilled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["shapeMode"]},{type:"row",title:"Shape",items:["shape"]},{type:"row",items:["dropCapSize","hyphenate"]},{type:"row",items:["padding","image"]},{type:"row",items:["columns","columnGutter"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textAlign","textTextAppearance"]}]}],paletteBookmark:{items:["textColor","linkColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",max:1,settings:{addItemWithoutImage:!0,addItemFromFileExplorer:!1},display:{type:"array"},items:{type:"object",properties:{text:{label:"Text",placeholder:"Add Text...",display:{type:"rich-text"}}}},default:[{text:[{type:"paragraph",children:[{text:"Le loro superficie, excelso Duca, fra loro similmente possiamo dire al medesimo modo esser proportionali commo de lor massa corporea s'è dicto, cioè irrationali per la malitia de la figura pentagona che in lo duodecedron se interpone. Ma de l'altre possano a le volte essere rationali, commo quelle del tetracedron, cubo, octocedron, per essere triangole e quadrate e note in proportione con lo diametro de la loro sphera in la quale si formano, commo s'è veduto di sopra."}]}]}]}},NT={element:ET,id:"pretext",name:"Shaped Type",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||Qp.indexOf(n)===-1||(t==null?void 0:t.shape)===n?e:{...e,...qp(n)}},defaultSize:{d:{width:1420,height:640},t:{width:710,height:320},m:{width:355,height:160}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/pretext.png"},schema:FT,sourceCode:kT,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},_T=[bh,Lh,Sb,bf,Rf,Of,oy,Ly,Fy,By,pv,a0,dx,xx,tb,pb,Ab,RS,Vb,XS,Cw,c$,sC,NT];exports.getAvailableStatePanels=A.getAvailableStatePanels;exports.getUnavailableStates=A.getUnavailableStates;exports.isPanelAvailable=A.isPanelAvailable;exports.components=_T;exports.isSchemaV1=um;
|