@cntrl-site/components 1.0.84 → 1.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/Form/Form.d.ts +1 -0
- package/dist/Components/Form/FormComponent.d.ts +11 -0
- package/dist/index.js +56 -52
- package/dist/index.mjs +6518 -6474
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),Ct=require("classnames"),F=require("./panelAvailability-D8c7cdbu.js"),ai=require("react-dom");function Ep(e){return e.type==="object"&&e.version===1}const Mp="ControlSlider-module__wrapper___sHEkd",Ap="ControlSlider-module__hoverArrow___A-dOH",Fp="ControlSlider-module__sliderItem___QQSkR",Np="ControlSlider-module__sliderImage___9hRl-",_p="ControlSlider-module__arrow___05ghY",Wp="ControlSlider-module__arrowVertical___tBfVN",Hp="ControlSlider-module__nextArrow___-30Yc",Op="ControlSlider-module__arrowInner___aEra3",Dp="ControlSlider-module__arrowIcon___S4ztF",zp="ControlSlider-module__arrowImg___2dwJW",Bp="ControlSlider-module__mirror___brd6U",jp="ControlSlider-module__pagination___bicLF",Vp="ControlSlider-module__paginationInner___bT-P-",Gp="ControlSlider-module__paginationVertical___zYqKw",Xp="ControlSlider-module__paginationItem___nTRbk",qp="ControlSlider-module__dot___p1Qun",Up="ControlSlider-module__activeDot___LHFaj",Yp="ControlSlider-module__paginationInsideBottom___R3FWn",Kp="ControlSlider-module__paginationInsideTop___V-qb-",Zp="ControlSlider-module__paginationOutsideBottom___14w8D",Jp="ControlSlider-module__paginationOutsideTop___SCLqB",Qp="ControlSlider-module__paginationInsideLeft___yOBRZ",em="ControlSlider-module__paginationInsideRight___Rtt3o",tm="ControlSlider-module__paginationOutsideLeft___lahaw",nm="ControlSlider-module__paginationOutsideRight___EtuQa",im="ControlSlider-module__imgWrapper___UjEgB",om="ControlSlider-module__captionBlock___dJ6-j",rm="ControlSlider-module__captionTextWrapper___HFlpf",am="ControlSlider-module__captionText___uGBVc",sm="ControlSlider-module__active___WZK4G",lm="ControlSlider-module__withPointerEvents___t-18M",cm="ControlSlider-module__topLeftAlignment___zjnGM",dm="ControlSlider-module__topCenterAlignment___gD1xW",um="ControlSlider-module__topRightAlignment___NMapS",pm="ControlSlider-module__middleLeftAlignment___OnUrY",mm="ControlSlider-module__middleCenterAlignment___Tdkl0",gm="ControlSlider-module__middleRightAlignment___wEbfX",hm="ControlSlider-module__bottomLeftAlignment___cTP2-",fm="ControlSlider-module__bottomCenterAlignment___c54fB",ym="ControlSlider-module__bottomRightAlignment___kEwrz",vm="ControlSlider-module__clickOverlay___DZA28",xm="ControlSlider-module__contain___pLyq7",bm="ControlSlider-module__cover___KdDat",$t={wrapper:Mp,hoverArrow:Ap,sliderItem:Fp,sliderImage:Np,arrow:_p,arrowVertical:Wp,nextArrow:Hp,arrowInner:Op,arrowIcon:Dp,arrowImg:zp,mirror:Bp,pagination:jp,paginationInner:Vp,paginationVertical:Gp,paginationItem:Xp,dot:qp,activeDot:Up,paginationInsideBottom:Yp,paginationInsideTop:Kp,paginationOutsideBottom:Zp,paginationOutsideTop:Jp,paginationInsideLeft:Qp,paginationInsideRight:em,paginationOutsideLeft:tm,paginationOutsideRight:nm,imgWrapper:im,captionBlock:om,captionTextWrapper:rm,captionText:am,active:sm,withPointerEvents:lm,topLeftAlignment:cm,topCenterAlignment:dm,topRightAlignment:um,middleLeftAlignment:pm,middleCenterAlignment:mm,middleRightAlignment:gm,bottomLeftAlignment:hm,bottomCenterAlignment:fm,bottomRightAlignment:ym,clickOverlay:vm,contain:xm,cover:bm};function Sm(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 wm(e,t,n){return t&&Sm(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var _l="(prefers-reduced-motion: reduce)",go=1,$m=2,Co=3,Ho=4,br=5,ea=6,sa=7,Cm={CREATED:go,MOUNTED:$m,IDLE:Co,MOVING:Ho,SCROLLING:br,DRAGGING:ea,DESTROYED:sa};function oi(e){e.length=0}function Ii(e,t,n){return Array.prototype.slice.call(e,t,n)}function Jt(e){return e.bind.apply(e,[null].concat(Ii(arguments,1)))}var Wd=setTimeout,Cs=function(){};function Wl(e){return requestAnimationFrame(e)}function ba(e,t){return typeof t===e}function sr(e){return!el(e)&&ba("object",e)}var Qs=Array.isArray,Hd=Jt(ba,"function"),wi=Jt(ba,"string"),Sr=Jt(ba,"undefined");function el(e){return e===null}function Od(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function wr(e){return Qs(e)?e:[e]}function In(e,t){wr(e).forEach(t)}function tl(e,t){return e.indexOf(t)>-1}function ta(e,t){return e.push.apply(e,wr(t)),e}function Qn(e,t,n){e&&In(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Bn(e,t){Qn(e,wi(t)?t.split(" "):t,!0)}function $r(e,t){In(t,e.appendChild.bind(e))}function nl(e,t){In(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function lr(e,t){return Od(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Dd(e,t){var n=e?Ii(e.children):[];return t?n.filter(function(i){return lr(i,t)}):n}function Cr(e,t){return t?Dd(e,t)[0]:e.firstElementChild}var cr=Object.keys;function Xi(e,t,n){return e&&(n?cr(e).reverse():cr(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function dr(e){return Ii(arguments,1).forEach(function(t){Xi(t,function(n,i){e[i]=t[i]})}),e}function yi(e){return Ii(arguments,1).forEach(function(t){Xi(t,function(n,i){Qs(n)?e[i]=n.slice():sr(n)?e[i]=yi({},sr(e[i])?e[i]:{},n):e[i]=n})}),e}function Hl(e,t){In(t||cr(e),function(n){delete e[n]})}function jn(e,t){In(e,function(n){In(t,function(i){n&&n.removeAttribute(i)})})}function kt(e,t,n){sr(t)?Xi(t,function(i,o){kt(e,o,i)}):In(e,function(i){el(n)||n===""?jn(i,t):i.setAttribute(t,String(n))})}function xo(e,t,n){var i=document.createElement(e);return t&&(wi(t)?Bn(i,t):kt(i,t)),n&&$r(n,i),i}function kn(e,t,n){if(Sr(n))return getComputedStyle(e)[t];el(n)||(e.style[t]=""+n)}function ur(e,t){kn(e,"display",t)}function zd(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function En(e,t){return e.getAttribute(t)}function Ol(e,t){return e&&e.classList.contains(t)}function $n(e){return e.getBoundingClientRect()}function Ui(e){In(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Bd(e){return Cr(new DOMParser().parseFromString(e,"text/html").body)}function Jn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function jd(e,t){return e&&e.querySelector(t)}function il(e,t){return t?Ii(e.querySelectorAll(t)):[]}function ei(e,t){Qn(e,t,!1)}function Ts(e){return e.timeStamp}function Ai(e){return wi(e)?e:e?e+"px":""}var Tr="splide",ol="data-"+Tr;function ir(e,t){if(!e)throw new Error("["+Tr+"] "+(t||""))}var $i=Math.min,la=Math.max,ca=Math.floor,pr=Math.ceil,fn=Math.abs;function Vd(e,t,n){return fn(e-t)<n}function na(e,t,n,i){var o=$i(t,n),r=la(t,n);return i?o<e&&e<r:o<=e&&e<=r}function co(e,t,n){var i=$i(t,n),o=la(t,n);return $i(la(i,e),o)}function Ls(e){return+(e>0)-+(e<0)}function Is(e,t){return In(t,function(n){e=e.replace("%s",""+n)}),e}function rl(e){return e<10?"0"+e:""+e}var Dl={};function Tm(e){return""+e+rl(Dl[e]=(Dl[e]||0)+1)}function Gd(){var e=[];function t(l,d,c,u){o(l,d,function(p,v,y){var m="addEventListener"in p,g=m?p.removeEventListener.bind(p,v,c,u):p.removeListener.bind(p,c);m?p.addEventListener(v,c,u):p.addListener(c),e.push([p,v,y,c,g])})}function n(l,d,c){o(l,d,function(u,p,v){e=e.filter(function(y){return y[0]===u&&y[1]===p&&y[2]===v&&(!c||y[3]===c)?(y[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){In(l,function(u){u&&In(d,function(p){p.split(" ").forEach(function(v){var y=v.split(".");c(u,y[0],y[1])})})})}function r(){e.forEach(function(l){l[4]()}),oi(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var Ri="mounted",Rs="ready",ri="move",Oo="moved",al="click",Xd="active",qd="inactive",Ud="visible",Yd="hidden",an="refresh",mn="updated",To="resize",Sa="resized",Kd="drag",Zd="dragging",Jd="dragged",wa="scroll",Zi="scrolled",Lm="overflow",sl="destroy",Qd="arrows:mounted",eu="arrows:updated",tu="pagination:mounted",nu="pagination:updated",ll="navigation:mounted",cl="autoplay:play",iu="autoplay:playing",dl="autoplay:pause",ul="lazyload:loaded",ou="sk",ru="sh",da="ei";function tn(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Gd();function i(r,l){n.bind(t,wr(r).join(" "),function(d){l.apply(l,Qs(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,Ii(arguments,1))}return e&&e.event.on(sl,n.destroy),dr(n,{bus:t,on:i,off:Jt(n.unbind,t),emit:o})}function $a(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?$i((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return y();d=Wl(p)}}function v(R){R||g(),r=o()-(R?l*e:0),c=!1,d=Wl(p)}function y(){c=!0}function m(){r=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(R){e=R}function x(){return c}return{start:v,rewind:m,pause:y,cancel:g,set:f,isPaused:x}}function Im(e){var t=e;function n(o){t=o}function i(o){return tl(wr(o),t)}return{set:n,is:i}}function Rm(e,t){var n=$a(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Pm(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Gd(),d=[];function c(){var g=n.mediaQuery==="min";cr(o).sort(function(f,x){return g?+f-+x:+x-+f}).forEach(function(f){p(o[f],"("+(g?"min":"max")+"-width:"+f+"px)")}),p(r,_l),v()}function u(g){g&&l.destroy()}function p(g,f){var x=matchMedia(f);l.bind(x,"change",v),d.push([g,x])}function v(){var g=i.is(sa),f=n.direction,x=d.reduce(function(R,b){return yi(R,b[1].matches?b[0]:{})},{});Hl(n),m(x),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function y(g){matchMedia(_l).matches&&(g?yi(n,r):Hl(n,cr(r)))}function m(g,f,x){yi(n,g),f&&yi(Object.getPrototypeOf(n),g),(x||!i.is(go))&&e.emit(mn,n)}return{setup:c,destroy:u,reduce:y,set:m}}var Ca="Arrow",Ta=Ca+"Left",La=Ca+"Right",au=Ca+"Up",su=Ca+"Down",zl="rtl",Ia="ttb",Ha={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[au,La],ArrowRight:[su,Ta]};function km(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===zl&&!l?1:d===Ia?0:-1;return Ha[r]&&Ha[r][c]||r.replace(/width|left|right/i,function(u,p){var v=Ha[u.toLowerCase()][c]||u;return p>0?v.charAt(0).toUpperCase()+v.slice(1):v})}function o(r){return r*(n.direction===zl?1:-1)}return{resolve:i,orient:o}}var ti="role",bo="tabindex",Em="disabled",Mn="aria-",Lr=Mn+"controls",lu=Mn+"current",Bl=Mn+"selected",Tn=Mn+"label",pl=Mn+"labelledby",cu=Mn+"hidden",ml=Mn+"orientation",mr=Mn+"roledescription",jl=Mn+"live",Vl=Mn+"busy",Gl=Mn+"atomic",gl=[ti,bo,Em,Lr,lu,Tn,pl,cu,ml,mr],Gn=Tr+"__",Pi="is-",Oa=Tr,Xl=Gn+"track",Mm=Gn+"list",Ra=Gn+"slide",du=Ra+"--clone",Am=Ra+"__container",hl=Gn+"arrows",Pa=Gn+"arrow",uu=Pa+"--prev",pu=Pa+"--next",ka=Gn+"pagination",mu=ka+"__page",Fm=Gn+"progress",Nm=Fm+"__bar",_m=Gn+"toggle",Wm=Gn+"spinner",Hm=Gn+"sr",Om=Pi+"initialized",Yi=Pi+"active",gu=Pi+"prev",hu=Pi+"next",Ps=Pi+"visible",ks=Pi+"loading",fu=Pi+"focus-in",yu=Pi+"overflow",Dm=[Yi,Ps,gu,hu,ks,fu,yu],zm={slide:Ra,clone:du,arrows:hl,arrow:Pa,prev:uu,next:pu,pagination:ka,page:mu,spinner:Wm};function Bm(e,t){if(Hd(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!lr(n,t);)n=n.parentElement;return n}var jm=5,ql=200,vu="touchstart mousedown",Da="touchmove mousemove",za="touchend touchcancel mouseup click";function Vm(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],v=[],y,m,g;function f(){S(),G(),b()}function x(){o(an,R),o(an,f),o(mn,b),r(document,vu+" keydown",function(P){g=P.type==="keydown"},{capture:!0}),r(l,"focusin",function(){Qn(l,fu,!!g)})}function R(P){var M=gl.concat("style");oi(u),ei(l,p),ei(y,v),jn([y,m],M),jn(l,P?M:["style",mr])}function b(){ei(l,p),ei(y,v),p=j(Oa),v=j(Xl),Bn(l,p),Bn(y,v),kt(l,Tn,n.label),kt(l,pl,n.labelledby)}function S(){y=D("."+Xl),m=Cr(y,"."+Mm),ir(y&&m,"A track/list element is missing."),ta(u,Dd(m,"."+Ra+":not(."+du+")")),Xi({arrows:hl,pagination:ka,prev:uu,next:pu,bar:Nm,toggle:_m},function(P,M){c[M]=D("."+P)}),dr(c,{root:l,track:y,list:m,slides:u})}function G(){var P=l.id||Tm(Tr),M=n.role;l.id=P,y.id=y.id||P+"-track",m.id=m.id||P+"-list",!En(l,ti)&&l.tagName!=="SECTION"&&M&&kt(l,ti,M),kt(l,mr,d.carousel),kt(m,ti,"presentation")}function D(P){var M=jd(l,P);return M&&Bm(M,"."+Oa)===l?M:void 0}function j(P){return[P+"--"+n.type,P+"--"+n.direction,n.drag&&P+"--draggable",n.isNavigation&&P+"--nav",P===Oa&&Yi]}return dr(c,{setup:f,mount:x,destroy:R})}var Lo="slide",Do="loop",Ir="fade";function Gm(e,t,n,i){var o=tn(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,v=p.isNavigation,y=p.updateOnMove,m=p.i18n,g=p.pagination,f=p.slideFocus,x=c.Direction.resolve,R=En(i,"style"),b=En(i,Tn),S=n>-1,G=Cr(i,"."+Am),D;function j(){S||(i.id=u.id+"-slide"+rl(t+1),kt(i,ti,g?"tabpanel":"group"),kt(i,mr,m.slide),kt(i,Tn,b||Is(m.slideLabel,[t+1,e.length]))),P()}function P(){d(i,"click",Jt(l,al,U)),d(i,"keydown",Jt(l,ou,U)),r([Oo,ru,Zi],L),r(ll,K),y&&r(ri,T)}function M(){D=!0,o.destroy(),ei(i,Dm),jn(i,gl),kt(i,"style",R),kt(i,Tn,b||"")}function K(){var C=e.splides.map(function(O){var V=O.splide.Components.Slides.getAt(t);return V?V.slide.id:""}).join(" ");kt(i,Tn,Is(m.slideX,(S?n:t)+1)),kt(i,Lr,C),kt(i,ti,f?"button":""),f&&jn(i,mr)}function T(){D||L()}function L(){if(!D){var C=e.index;_(),z(),Qn(i,gu,t===C-1),Qn(i,hu,t===C+1)}}function _(){var C=k();C!==Ol(i,Yi)&&(Qn(i,Yi,C),kt(i,lu,v&&C||""),l(C?Xd:qd,U))}function z(){var C=W(),O=!C&&(!k()||S);if(e.state.is([Ho,br])||kt(i,cu,O||""),kt(il(i,p.focusableNodes||""),bo,O?-1:""),f&&kt(i,bo,O?-1:0),C!==Ol(i,Ps)&&(Qn(i,Ps,C),l(C?Ud:Yd,U)),!C&&document.activeElement===i){var V=c.Slides.getAt(e.index);V&&zd(V.slide)}}function $(C,O,V){kn(V&&G||i,C,O)}function k(){var C=e.index;return C===t||p.cloneStatus&&C===n}function W(){if(e.is(Ir))return k();var C=$n(c.Elements.track),O=$n(i),V=x("left",!0),se=x("right",!0);return ca(C[V])<=pr(O[V])&&ca(O[se])<=pr(C[se])}function w(C,O){var V=fn(C-t);return!S&&(p.rewind||e.is(Do))&&(V=$i(V,e.length-V)),V<=O}var U={index:t,slideIndex:n,slide:i,container:G,isClone:S,mount:j,destroy:M,update:L,style:$,isWithin:w};return U}function Xm(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function v(){y(),o(an,m),o(an,y)}function y(){c.forEach(function(L,_){f(L,_,-1)})}function m(){D(function(L){L.destroy()}),oi(p)}function g(){D(function(L){L.update()})}function f(L,_,z){var $=Gm(e,_,z,L);$.mount(),p.push($),p.sort(function(k,W){return k.index-W.index})}function x(L){return L?j(function(_){return!_.isClone}):p}function R(L){var _=t.Controller,z=_.toIndex(L),$=_.hasFocus()?1:n.perPage;return j(function(k){return na(k.index,z,z+$-1)})}function b(L){return j(L)[0]}function S(L,_){In(L,function(z){if(wi(z)&&(z=Bd(z)),Od(z)){var $=c[_];$?nl(z,$):$r(u,z),Bn(z,n.classes.slide),M(z,Jt(r,To))}}),r(an)}function G(L){Ui(j(L).map(function(_){return _.slide})),r(an)}function D(L,_){x(_).forEach(L)}function j(L){return p.filter(Hd(L)?L:function(_){return wi(L)?lr(_.slide,L):tl(wr(L),_.index)})}function P(L,_,z){D(function($){$.style(L,_,z)})}function M(L,_){var z=il(L,"img"),$=z.length;$?z.forEach(function(k){l(k,"load error",function(){--$||_()})}):_()}function K(L){return L?c.length:p.length}function T(){return p.length>n.perPage}return{mount:v,destroy:m,update:g,register:f,get:x,getIn:R,getAt:b,add:S,remove:G,forEach:D,filter:j,style:P,getLength:K,isEnough:T}}function qm(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,v=u.track,y=u.list,m=d.getAt,g=d.style,f,x,R;function b(){S(),r(window,"resize load",Rm(Jt(l,To))),o([mn,an],S),o(To,G)}function S(){f=n.direction===Ia,kn(p,"maxWidth",Ai(n.width)),kn(v,c("paddingLeft"),D(!1)),kn(v,c("paddingRight"),D(!0)),G(!0)}function G(U){var C=$n(p);(U||x.width!==C.width||x.height!==C.height)&&(kn(v,"height",j()),g(c("marginRight"),Ai(n.gap)),g("width",M()),g("height",K(),!0),x=C,l(Sa),R!==(R=w())&&(Qn(p,yu,R),l(Lm,R)))}function D(U){var C=n.padding,O=c(U?"right":"left");return C&&Ai(C[O]||(sr(C)?0:C))||"0px"}function j(){var U="";return f&&(U=P(),ir(U,"height or heightRatio is missing."),U="calc("+U+" - "+D(!1)+" - "+D(!0)+")"),U}function P(){return Ai(n.height||$n(y).width*n.heightRatio)}function M(){return n.autoWidth?null:Ai(n.fixedWidth)||(f?"":T())}function K(){return Ai(n.fixedHeight)||(f?n.autoHeight?null:T():P())}function T(){var U=Ai(n.gap);return"calc((100%"+(U&&" + "+U)+")/"+(n.perPage||1)+(U&&" - "+U)+")"}function L(){return $n(y)[c("width")]}function _(U,C){var O=m(U||0);return O?$n(O.slide)[c("width")]+(C?0:k()):0}function z(U,C){var O=m(U);if(O){var V=$n(O.slide)[c("right")],se=$n(y)[c("left")];return fn(V-se)+(C?0:k())}return 0}function $(U){return z(e.length-1)-z(0)+_(0,U)}function k(){var U=m(0);return U&&parseFloat(kn(U.slide,c("marginRight")))||0}function W(U){return parseFloat(kn(v,c("padding"+(U?"Right":"Left"))))||0}function w(){return e.is(Ir)||$(!0)>L()}return{mount:b,resize:G,listSize:L,slideSize:_,sliderSize:$,totalSize:z,getPadding:W,isOverflow:w}}var Um=2;function Ym(e,t,n){var i=tn(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(an,v),o([mn,To],m),(u=x())&&(g(u),t.Layout.resize(!0))}function v(){y(),p()}function y(){Ui(c),oi(c),i.destroy()}function m(){var R=x();u!==R&&(u<R||!R)&&i.emit(an)}function g(R){var b=l.get().slice(),S=b.length;if(S){for(;b.length<R;)ta(b,b);ta(b.slice(-R),b.slice(0,R)).forEach(function(G,D){var j=D<R,P=f(G.slide,D);j?nl(P,b[0].slide):$r(r.list,P),ta(c,P),l.register(P,D-R+(j?0:S),G.index)})}}function f(R,b){var S=R.cloneNode(!0);return Bn(S,n.classes.clone),S.id=e.root.id+"-clone"+rl(b+1),S}function x(){var R=n.clones;if(!e.is(Do))R=0;else if(Sr(R)){var b=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=b&&pr($n(r.track)[d("width")]/b);R=S||n[d("autoWidth")]&&e.length||n.perPage*Um}return R}return{mount:p,destroy:y}}function Km(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,v=d.listSize,y=d.sliderSize,m=t.Direction,g=m.resolve,f=m.orient,x=t.Elements,R=x.list,b=x.track,S;function G(){S=t.Transition,o([Ri,Sa,mn,an],D)}function D(){t.Controller.isBusy()||(t.Scroll.cancel(),P(e.index),t.Slides.update())}function j(O,V,se,ie){O!==V&&U(O>se)&&(L(),M(T($(),O>se),!0)),l(Ho),r(ri,V,se,O),S.start(V,function(){l(Co),r(Oo,V,se,O),ie&&ie()})}function P(O){M(z(O,!0))}function M(O,V){if(!e.is(Ir)){var se=V?O:K(O);kn(R,"transform","translate"+g("X")+"("+se+"px)"),O!==se&&r(ru)}}function K(O){if(e.is(Do)){var V=_(O),se=V>t.Controller.getEnd(),ie=V<0;(ie||se)&&(O=T(O,se))}return O}function T(O,V){var se=O-w(V),ie=y();return O-=f(ie*(pr(fn(se)/ie)||1))*(V?1:-1),O}function L(){M($(),!0),S.cancel()}function _(O){for(var V=t.Slides.get(),se=0,ie=1/0,N=0;N<V.length;N++){var de=V[N].index,X=fn(z(de,!0)-O);if(X<=ie)ie=X,se=de;else break}return se}function z(O,V){var se=f(p(O-1)-W(O));return V?k(se):se}function $(){var O=g("left");return $n(R)[O]-$n(b)[O]+f(u(!1))}function k(O){return n.trimSpace&&e.is(Lo)&&(O=co(O,0,f(y(!0)-v()))),O}function W(O){var V=n.focus;return V==="center"?(v()-c(O,!0))/2:+V*c(O)||0}function w(O){return z(O?t.Controller.getEnd():0,!!n.trimSpace)}function U(O){var V=f(T($(),O));return O?V>=0:V<=R[g("scrollWidth")]-$n(b)[g("width")]}function C(O,V){V=Sr(V)?$():V;var se=O!==!0&&f(V)<f(w(!1)),ie=O!==!1&&f(V)>f(w(!0));return se||ie}return{mount:G,move:j,jump:P,translate:M,shift:T,cancel:L,toIndex:_,toPosition:z,getPosition:$,getLimit:w,exceededLimit:C,reposition:D}}function Zm(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,v=p.isEnough,y=p.getLength,m=n.omitEnd,g=e.is(Do),f=e.is(Lo),x=Jt($,!1),R=Jt($,!0),b=n.start||0,S,G=b,D,j,P;function M(){K(),o([mn,an,da],K),o(Sa,T)}function K(){D=y(!0),j=n.perMove,P=n.perPage,S=U();var X=co(b,0,m?S:D-1);X!==b&&(b=X,l.reposition())}function T(){S!==U()&&r(da)}function L(X,ce,oe){if(!de()){var fe=z(X),Pe=w(fe);Pe>-1&&(ce||Pe!==b)&&(se(Pe),l.move(fe,Pe,G,oe))}}function _(X,ce,oe,fe){t.Scroll.scroll(X,ce,oe,function(){var Pe=w(l.toIndex(d()));se(m?$i(Pe,S):Pe),fe&&fe()})}function z(X){var ce=b;if(wi(X)){var oe=X.match(/([+\-<>])(\d+)?/)||[],fe=oe[1],Pe=oe[2];fe==="+"||fe==="-"?ce=k(b+ +(""+fe+(+Pe||1)),b):fe===">"?ce=Pe?C(+Pe):x(!0):fe==="<"&&(ce=R(!0))}else ce=g?X:co(X,0,S);return ce}function $(X,ce){var oe=j||(N()?1:P),fe=k(b+oe*(X?-1:1),b,!(j||N()));return fe===-1&&f&&!Vd(d(),c(!X),1)?X?0:S:ce?fe:w(fe)}function k(X,ce,oe){if(v()||N()){var fe=W(X);fe!==X&&(ce=X,X=fe,oe=!1),X<0||X>S?!j&&(na(0,X,ce,!0)||na(S,ce,X,!0))?X=C(O(X)):g?X=oe?X<0?-(D%P||P):D:X:n.rewind?X=X<0?S:0:X=-1:oe&&X!==ce&&(X=C(O(ce)+(X<ce?-1:1)))}else X=-1;return X}function W(X){if(f&&n.trimSpace==="move"&&X!==b)for(var ce=d();ce===u(X,!0)&&na(X,0,e.length-1,!n.rewind);)X<b?--X:++X;return X}function w(X){return g?(X+D)%D||0:X}function U(){for(var X=D-(N()||g&&j?1:P);m&&X-- >0;)if(u(D-1,!0)!==u(X,!0)){X++;break}return co(X,0,D-1)}function C(X){return co(N()?X:P*X,0,S)}function O(X){return N()?$i(X,S):ca((X>=S?D-1:X)/P)}function V(X){var ce=l.toIndex(X);return f?co(ce,0,S):ce}function se(X){X!==b&&(G=b,b=X)}function ie(X){return X?G:b}function N(){return!Sr(n.focus)||n.isNavigation}function de(){return e.state.is([Ho,br])&&!!n.waitForTransition}return{mount:M,go:L,scroll:_,getNext:x,getPrev:R,getAdjacent:$,getEnd:U,setIndex:se,getIndex:ie,toIndex:C,toPage:O,toDest:V,hasFocus:N,isBusy:de}}var Jm="http://www.w3.org/2000/svg",Qm="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",Er=40;function eg(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,v=u.arrows,y=u.track,m=v,g=u.prev,f=u.next,x,R,b={};function S(){D(),o(mn,G)}function G(){j(),S()}function D(){var _=n.arrows;_&&!(g&&f)&&K(),g&&f&&(dr(b,{prev:g,next:f}),ur(m,_?"":"none"),Bn(m,R=hl+"--"+n.direction),_&&(P(),L(),kt([g,f],Lr,y.id),l(Qd,g,f)))}function j(){i.destroy(),ei(m,R),x?(Ui(v?[g,f]:m),g=f=null):jn([g,f],gl)}function P(){o([Ri,Oo,an,Zi,da],L),r(f,"click",Jt(M,">")),r(g,"click",Jt(M,"<"))}function M(_){p.go(_,!0)}function K(){m=v||xo("div",d.arrows),g=T(!0),f=T(!1),x=!0,$r(m,[g,f]),!v&&nl(m,y)}function T(_){var z='<button class="'+d.arrow+" "+(_?d.prev:d.next)+'" type="button"><svg xmlns="'+Jm+'" viewBox="0 0 '+Er+" "+Er+'" width="'+Er+'" height="'+Er+'" focusable="false"><path d="'+(n.arrowPath||Qm)+'" />';return Bd(z)}function L(){if(g&&f){var _=e.index,z=p.getPrev(),$=p.getNext(),k=z>-1&&_<z?c.last:c.prev,W=$>-1&&_>$?c.first:c.next;g.disabled=z<0,f.disabled=$<0,kt(g,Tn,k),kt(f,Tn,W),l(eu,g,f,z,$)}}return{arrows:b,mount:S,destroy:j,update:L}}var tg=ol+"-interval";function ng(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,d=$a(n.interval,e.go.bind(e,">"),P),c=d.isPaused,u=t.Elements,p=t.Elements,v=p.root,y=p.toggle,m=n.autoplay,g,f,x=m==="pause";function R(){m&&(b(),y&&kt(y,Lr,u.track.id),x||S(),j())}function b(){n.pauseOnHover&&r(v,"mouseenter mouseleave",function(K){g=K.type==="mouseenter",D()}),n.pauseOnFocus&&r(v,"focusin focusout",function(K){f=K.type==="focusin",D()}),y&&r(y,"click",function(){x?S():G(!0)}),o([ri,wa,an],d.rewind),o(ri,M)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=g=x=!1,j(),l(cl))}function G(K){K===void 0&&(K=!0),x=!!K,j(),c()||(d.pause(),l(dl))}function D(){x||(g||f?G(!1):S())}function j(){y&&(Qn(y,Yi,!x),kt(y,Tn,n.i18n[x?"play":"pause"]))}function P(K){var T=u.bar;T&&kn(T,"width",K*100+"%"),l(iu,K)}function M(K){var T=t.Slides.getAt(K);d.set(T&&+En(T.slide,tg)||n.interval)}return{mount:R,destroy:d.cancel,play:S,pause:G,isPaused:c}}function ig(e,t,n){var i=tn(e),o=i.on;function r(){n.cover&&(o(ul,Jt(d,!0)),o([Ri,mn,an],Jt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Cr(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),ur(u,c?"none":"")}return{mount:r,destroy:Jt(l,!1)}}var og=10,rg=600,ag=.6,sg=1.5,lg=800;function cg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,v=d.translate,y=e.is(Lo),m,g,f=1;function x(){o(ri,G),o([mn,an],D)}function R(P,M,K,T,L){var _=c();if(G(),K&&(!y||!p())){var z=t.Layout.sliderSize(),$=Ls(P)*z*ca(fn(P)/z)||0;P=d.toPosition(t.Controller.toDest(P%z))+$}var k=Vd(_,P,1);f=1,M=k?0:M||la(fn(P-_)/sg,lg),g=T,m=$a(M,b,Jt(S,_,P,L),1),l(br),r(wa),m.start()}function b(){l(Co),g&&g(),r(Zi)}function S(P,M,K,T){var L=c(),_=P+(M-P)*j(T),z=(_-L)*f;v(L+z),y&&!K&&p()&&(f*=ag,fn(z)<og&&R(u(p(!0)),rg,!1,g,!0))}function G(){m&&m.cancel()}function D(){m&&!m.isPaused()&&(G(),b())}function j(P){var M=n.easingFunc;return M?M(P):1-Math.pow(1-P,4)}return{mount:x,destroy:G,scroll:R,cancel:D}}var uo={passive:!1,capture:!0};function dg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,v=t.Controller,y=t.Elements.track,m=t.Media.reduce,g=t.Direction,f=g.resolve,x=g.orient,R=u.getPosition,b=u.exceededLimit,S,G,D,j,P,M=!1,K,T,L;function _(){l(y,Da,Cs,uo),l(y,za,Cs,uo),l(y,vu,$,uo),l(y,"click",w,{capture:!0}),l(y,"dragstart",Jn),o([Ri,mn],z)}function z(){var Z=n.drag;pe(!Z),j=Z==="free"}function $(Z){if(K=!1,!T){var le=Pe(Z);fe(Z.target)&&(le||!Z.button)&&(v.isBusy()?Jn(Z,!0):(L=le?y:window,P=c.is([Ho,br]),D=null,l(L,Da,k,uo),l(L,za,W,uo),u.cancel(),p.cancel(),U(Z)))}}function k(Z){if(c.is(ea)||(c.set(ea),r(Kd)),Z.cancelable)if(P){u.translate(S+oe(N(Z)));var le=de(Z)>ql,re=M!==(M=b());(le||re)&&U(Z),K=!0,r(Zd),Jn(Z)}else V(Z)&&(P=O(Z),Jn(Z))}function W(Z){c.is(ea)&&(c.set(Co),r(Jd)),P&&(C(Z),Jn(Z)),d(L,Da,k),d(L,za,W),P=!1}function w(Z){!T&&K&&Jn(Z,!0)}function U(Z){D=G,G=Z,S=R()}function C(Z){var le=se(Z),re=ie(le),Ie=n.rewind&&n.rewindByDrag;m(!1),j?v.scroll(re,0,n.snap):e.is(Ir)?v.go(x(Ls(le))<0?Ie?"<":"-":Ie?">":"+"):e.is(Lo)&&M&&Ie?v.go(b(!0)?">":"<"):v.go(v.toDest(re),!0),m(!0)}function O(Z){var le=n.dragMinThreshold,re=sr(le),Ie=re&&le.mouse||0,we=(re?le.touch:+le)||10;return fn(N(Z))>(Pe(Z)?we:Ie)}function V(Z){return fn(N(Z))>fn(N(Z,!0))}function se(Z){if(e.is(Do)||!M){var le=de(Z);if(le&&le<ql)return N(Z)/le}return 0}function ie(Z){return R()+Ls(Z)*$i(fn(Z)*(n.flickPower||600),j?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function N(Z,le){return ce(Z,le)-ce(X(Z),le)}function de(Z){return Ts(Z)-Ts(X(Z))}function X(Z){return G===Z&&D||G}function ce(Z,le){return(Pe(Z)?Z.changedTouches[0]:Z)["page"+f(le?"Y":"X")]}function oe(Z){return Z/(M&&e.is(Lo)?jm:1)}function fe(Z){var le=n.noDrag;return!lr(Z,"."+mu+", ."+Pa)&&(!le||!lr(Z,le))}function Pe(Z){return typeof TouchEvent<"u"&&Z instanceof TouchEvent}function xe(){return P}function pe(Z){T=Z}return{mount:_,disable:pe,isDragging:xe}}var ug={Spacebar:" ",Right:La,Left:Ta,Up:au,Down:su};function fl(e){return e=wi(e)?e:e.key,ug[e]||e}var Ul="keydown";function pg(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function v(){y(),o(mn,m),o(mn,y),o(ri,f)}function y(){var R=n.keyboard;R&&(u=R==="global"?window:d,r(u,Ul,x))}function m(){l(u,Ul)}function g(R){p=R}function f(){var R=p;p=!0,Wd(function(){p=R})}function x(R){if(!p){var b=fl(R);b===c(Ta)?e.go("<"):b===c(La)&&e.go(">")}}return{mount:v,destroy:m,disable:g}}var or=ol+"-lazy",ia=or+"-srcset",mg="["+or+"], ["+ia+"]";function gg(e,t,n){var i=tn(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Oo,Zi],p=[];function v(){n.lazyLoad&&(y(),o(an,y))}function y(){oi(p),m(),c?R():(r(u),o(u,g),g())}function m(){t.Slides.forEach(function(b){il(b.slide,mg).forEach(function(S){var G=En(S,or),D=En(S,ia);if(G!==S.src||D!==S.srcset){var j=n.classes.spinner,P=S.parentElement,M=Cr(P,"."+j)||xo("span",j,P);p.push([S,b,M]),S.src||ur(S,"none")}})})}function g(){p=p.filter(function(b){var S=n.perPage*((n.preloadPages||1)+1)-1;return b[1].isWithin(e.index,S)?f(b):!0}),p.length||r(u)}function f(b){var S=b[0];Bn(b[1].slide,ks),l(S,"load error",Jt(x,b)),kt(S,"src",En(S,or)),kt(S,"srcset",En(S,ia)),jn(S,or),jn(S,ia)}function x(b,S){var G=b[0],D=b[1];ei(D.slide,ks),S.type!=="error"&&(Ui(b[2]),ur(G,""),d(ul,G,D),d(To)),c&&R()}function R(){p.length&&f(p.shift())}return{mount:v,destroy:Jt(oi,p),check:g}}function hg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,v=u.getIndex,y=u.go,m=t.Direction.resolve,g=c.pagination,f=[],x,R;function b(){S(),o([mn,an,da],b);var T=n.pagination;g&&ur(g,T?"":"none"),T&&(o([ri,wa,Zi],K),G(),K(),r(tu,{list:x,items:f},M(e.index)))}function S(){x&&(Ui(g?Ii(x.children):x),ei(x,R),oi(f),x=null),i.destroy()}function G(){var T=e.length,L=n.classes,_=n.i18n,z=n.perPage,$=p()?u.getEnd()+1:pr(T/z);x=g||xo("ul",L.pagination,c.track.parentElement),Bn(x,R=ka+"--"+P()),kt(x,ti,"tablist"),kt(x,Tn,_.select),kt(x,ml,P()===Ia?"vertical":"");for(var k=0;k<$;k++){var W=xo("li",null,x),w=xo("button",{class:L.page,type:"button"},W),U=d.getIn(k).map(function(O){return O.slide.id}),C=!p()&&z>1?_.pageX:_.slideX;l(w,"click",Jt(D,k)),n.paginationKeyboard&&l(w,"keydown",Jt(j,k)),kt(W,ti,"presentation"),kt(w,ti,"tab"),kt(w,Lr,U.join(" ")),kt(w,Tn,Is(C,k+1)),kt(w,bo,-1),f.push({li:W,button:w,page:k})}}function D(T){y(">"+T,!0)}function j(T,L){var _=f.length,z=fl(L),$=P(),k=-1;z===m(La,!1,$)?k=++T%_:z===m(Ta,!1,$)?k=(--T+_)%_:z==="Home"?k=0:z==="End"&&(k=_-1);var W=f[k];W&&(zd(W.button),y(">"+k),Jn(L,!0))}function P(){return n.paginationDirection||n.direction}function M(T){return f[u.toPage(T)]}function K(){var T=M(v(!0)),L=M(v());if(T){var _=T.button;ei(_,Yi),jn(_,Bl),kt(_,bo,-1)}if(L){var z=L.button;Bn(z,Yi),kt(z,Bl,!0),kt(z,bo,"")}r(nu,{list:x,items:f},T,L)}return{items:f,mount:b,destroy:S,getAt:M,update:K}}var fg=[" ","Enter"];function yg(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){r.forEach(function(g){g.destroy()}),oi(r)}function c(){d(),l()}function u(g,f){var x=tn(g);x.on(ri,function(R,b,S){f.go(f.is(Do)?S:R)}),r.push(x)}function p(){var g=tn(e),f=g.on;f(al,y),f(ou,m),f([Ri,mn],v),r.push(g),g.emit(ll,e.splides)}function v(){kt(t.Elements.list,ml,n.direction===Ia?"vertical":"")}function y(g){e.go(g.index)}function m(g,f){tl(fg,fl(f))&&(y(g),Jn(f))}return{setup:Jt(t.Media.set,{slideFocus:Sr(o)?i:o},!0),mount:l,destroy:d,remount:c}}function vg(e,t,n){var i=tn(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,uo)}function d(u){if(u.cancelable){var p=u.deltaY,v=p<0,y=Ts(u),m=n.wheelMinThreshold||0,g=n.wheelSleep||0;fn(p)>m&&y-r>g&&(e.go(v?"<":">"),r=y),c(v)&&Jn(u)}}function c(u){return!n.releaseWheel||e.state.is(Ho)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var xg=90;function bg(e,t,n){var i=tn(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=xo("span",Hm),c=$a(xg,Jt(p,!1));function u(){l&&(y(!t.Autoplay.isPaused()),kt(r,Gl,!0),d.textContent="…",o(cl,Jt(y,!0)),o(dl,Jt(y,!1)),o([Oo,Zi],Jt(p,!0)))}function p(m){kt(r,Vl,m),m?($r(r,d),c.start()):(Ui(d),c.cancel())}function v(){jn(r,[jl,Gl,Vl]),Ui(d)}function y(m){l&&kt(r,jl,m?"off":"polite")}return{mount:u,disable:y,destroy:v}}var Sg=Object.freeze({__proto__:null,Media:Pm,Direction:km,Elements:Vm,Slides:Xm,Layout:qm,Clones:Ym,Move:Km,Controller:Zm,Arrows:eg,Autoplay:ng,Cover:ig,Scroll:cg,Drag:dg,Keyboard:pg,LazyLoad:gg,Pagination:hg,Sync:yg,Wheel:vg,Live:bg}),wg={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"},$g={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:zm,i18n:wg,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Cg(e,t,n){var i=t.Slides;function o(){tn(e).on([Ri,an],r)}function r(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Wd(c)}return{mount:o,start:l,cancel:Cs}}function Tg(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Jt(kn,l,"transition"),c;function u(){tn(e).bind(l,"transitionend",function(m){m.target===l&&c&&(v(),c())})}function p(m,g){var f=i.toPosition(m,!0),x=i.getPosition(),R=y(m);fn(f-x)>=1&&R>=1?n.useScroll?r.scroll(f,R,!1,g):(d("transform "+R+"ms "+n.easing),i.translate(f,!0),c=g):(i.jump(m),g())}function v(){d(""),r.cancel()}function y(m){var g=n.rewindSpeed;if(e.is(Lo)&&g){var f=o.getIndex(!0),x=o.getEnd();if(f===0&&m>=x||f>=x&&m===0)return g}return n.speed}return{mount:u,start:p,cancel:v}}var Lg=(function(){function e(n,i){this.event=tn(),this.Components={},this.state=Im(go),this.splides=[],this._o={},this._E={};var o=wi(n)?jd(document,n):n;ir(o,o+" is invalid."),this.root=o,i=yi({label:En(o,Tn)||"",labelledby:En(o,pl)||""},$g,e.defaults,i||{});try{yi(i,JSON.parse(En(o,ol)))}catch{ir(!1,"Invalid JSON")}this._o=Object.create(yi({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;ir(l.is([go,sa]),"Already mounted!"),l.set(go),this._C=d,this._T=o||this._T||(this.is(Ir)?Cg:Tg),this._E=i||this._E;var c=dr({},Sg,this._E,{Transition:this._T});return Xi(c,function(u,p){var v=u(r,d,r._o);d[p]=v,v.setup&&v.setup()}),Xi(d,function(u){u.mount&&u.mount()}),this.emit(Ri),Bn(this.root,Om),l.set(Co),this.emit(Rs),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Co)&&(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(Ii(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(an),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(go)?tn(this).on(Rs,this.destroy.bind(this,i)):(Xi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(sl),o.destroy(),i&&oi(this.splides),r.set(sa)),this},wm(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})(),yl=Lg;yl.defaults={};yl.STATES=Cm;var Yl=[[Ri,"onMounted"],[Rs,"onReady"],[ri,"onMove"],[Oo,"onMoved"],[al,"onClick"],[Xd,"onActive"],[qd,"onInactive"],[Ud,"onVisible"],[Yd,"onHidden"],[an,"onRefresh"],[mn,"onUpdated"],[To,"onResize"],[Sa,"onResized"],[Kd,"onDrag"],[Zd,"onDragging"],[Jd,"onDragged"],[wa,"onScroll"],[Zi,"onScrolled"],[sl,"onDestroy"],[Qd,"onArrowsMounted"],[eu,"onArrowsUpdated"],[tu,"onPaginationMounted"],[nu,"onPaginationUpdated"],[ll,"onNavigationMounted"],[cl,"onAutoplayPlay"],[iu,"onAutoplayPlaying"],[dl,"onAutoplayPause"],[ul,"onLazyLoadLoaded"]];function vl(...e){return e.filter(Boolean).join(" ")}function ua(e){return e!==null&&typeof e=="object"}function Es(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Es(n,t[i]));if(ua(e)&&ua(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Es(e[o],t[o]))}return e===t}function Ig(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Rg(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 Ms(e,t){const n=e;return Rg(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ua(i)?n[o]=Ms(ua(n[o])?n[o]:{},i):n[o]=i}),n}var Pg=({children:e,className:t,...n})=>s.createElement("div",{className:vl("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),xl=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 yl(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ms({},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&&!Es(this.options,e)&&(this.splide.options=e,this.options=Ms({},e));const t=this.getSlides();Ig(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){Yl.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:vl("splide",e),ref:this.splideRef,...this.omit(o,["options",...Yl.map(r=>r[1])])},n?s.createElement(Pg,null,i):i)}},bl=({children:e,className:t,...n})=>s.createElement("li",{className:vl("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),Ct=require("classnames"),N=require("./panelAvailability-D8c7cdbu.js"),si=require("react-dom");function Ep(e){return e.type==="object"&&e.version===1}const Mp="ControlSlider-module__wrapper___sHEkd",Ap="ControlSlider-module__hoverArrow___A-dOH",Fp="ControlSlider-module__sliderItem___QQSkR",Np="ControlSlider-module__sliderImage___9hRl-",_p="ControlSlider-module__arrow___05ghY",Wp="ControlSlider-module__arrowVertical___tBfVN",Hp="ControlSlider-module__nextArrow___-30Yc",Op="ControlSlider-module__arrowInner___aEra3",Dp="ControlSlider-module__arrowIcon___S4ztF",zp="ControlSlider-module__arrowImg___2dwJW",Bp="ControlSlider-module__mirror___brd6U",jp="ControlSlider-module__pagination___bicLF",Vp="ControlSlider-module__paginationInner___bT-P-",Gp="ControlSlider-module__paginationVertical___zYqKw",Xp="ControlSlider-module__paginationItem___nTRbk",qp="ControlSlider-module__dot___p1Qun",Up="ControlSlider-module__activeDot___LHFaj",Yp="ControlSlider-module__paginationInsideBottom___R3FWn",Kp="ControlSlider-module__paginationInsideTop___V-qb-",Zp="ControlSlider-module__paginationOutsideBottom___14w8D",Jp="ControlSlider-module__paginationOutsideTop___SCLqB",Qp="ControlSlider-module__paginationInsideLeft___yOBRZ",em="ControlSlider-module__paginationInsideRight___Rtt3o",tm="ControlSlider-module__paginationOutsideLeft___lahaw",nm="ControlSlider-module__paginationOutsideRight___EtuQa",im="ControlSlider-module__imgWrapper___UjEgB",om="ControlSlider-module__captionBlock___dJ6-j",rm="ControlSlider-module__captionTextWrapper___HFlpf",am="ControlSlider-module__captionText___uGBVc",sm="ControlSlider-module__active___WZK4G",lm="ControlSlider-module__withPointerEvents___t-18M",cm="ControlSlider-module__topLeftAlignment___zjnGM",dm="ControlSlider-module__topCenterAlignment___gD1xW",um="ControlSlider-module__topRightAlignment___NMapS",pm="ControlSlider-module__middleLeftAlignment___OnUrY",mm="ControlSlider-module__middleCenterAlignment___Tdkl0",gm="ControlSlider-module__middleRightAlignment___wEbfX",hm="ControlSlider-module__bottomLeftAlignment___cTP2-",fm="ControlSlider-module__bottomCenterAlignment___c54fB",ym="ControlSlider-module__bottomRightAlignment___kEwrz",vm="ControlSlider-module__clickOverlay___DZA28",xm="ControlSlider-module__contain___pLyq7",bm="ControlSlider-module__cover___KdDat",$t={wrapper:Mp,hoverArrow:Ap,sliderItem:Fp,sliderImage:Np,arrow:_p,arrowVertical:Wp,nextArrow:Hp,arrowInner:Op,arrowIcon:Dp,arrowImg:zp,mirror:Bp,pagination:jp,paginationInner:Vp,paginationVertical:Gp,paginationItem:Xp,dot:qp,activeDot:Up,paginationInsideBottom:Yp,paginationInsideTop:Kp,paginationOutsideBottom:Zp,paginationOutsideTop:Jp,paginationInsideLeft:Qp,paginationInsideRight:em,paginationOutsideLeft:tm,paginationOutsideRight:nm,imgWrapper:im,captionBlock:om,captionTextWrapper:rm,captionText:am,active:sm,withPointerEvents:lm,topLeftAlignment:cm,topCenterAlignment:dm,topRightAlignment:um,middleLeftAlignment:pm,middleCenterAlignment:mm,middleRightAlignment:gm,bottomLeftAlignment:hm,bottomCenterAlignment:fm,bottomRightAlignment:ym,clickOverlay:vm,contain:xm,cover:bm};function Sm(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 wm(e,t,n){return t&&Sm(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var _l="(prefers-reduced-motion: reduce)",go=1,$m=2,Co=3,Ho=4,br=5,ea=6,sa=7,Cm={CREATED:go,MOUNTED:$m,IDLE:Co,MOVING:Ho,SCROLLING:br,DRAGGING:ea,DESTROYED:sa};function ri(e){e.length=0}function Ii(e,t,n){return Array.prototype.slice.call(e,t,n)}function Jt(e){return e.bind.apply(e,[null].concat(Ii(arguments,1)))}var Wd=setTimeout,Cs=function(){};function Wl(e){return requestAnimationFrame(e)}function ba(e,t){return typeof t===e}function sr(e){return!el(e)&&ba("object",e)}var Qs=Array.isArray,Hd=Jt(ba,"function"),wi=Jt(ba,"string"),Sr=Jt(ba,"undefined");function el(e){return e===null}function Od(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function wr(e){return Qs(e)?e:[e]}function In(e,t){wr(e).forEach(t)}function tl(e,t){return e.indexOf(t)>-1}function ta(e,t){return e.push.apply(e,wr(t)),e}function ei(e,t,n){e&&In(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Bn(e,t){ei(e,wi(t)?t.split(" "):t,!0)}function $r(e,t){In(t,e.appendChild.bind(e))}function nl(e,t){In(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function lr(e,t){return Od(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Dd(e,t){var n=e?Ii(e.children):[];return t?n.filter(function(i){return lr(i,t)}):n}function Cr(e,t){return t?Dd(e,t)[0]:e.firstElementChild}var cr=Object.keys;function Xi(e,t,n){return e&&(n?cr(e).reverse():cr(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function dr(e){return Ii(arguments,1).forEach(function(t){Xi(t,function(n,i){e[i]=t[i]})}),e}function vi(e){return Ii(arguments,1).forEach(function(t){Xi(t,function(n,i){Qs(n)?e[i]=n.slice():sr(n)?e[i]=vi({},sr(e[i])?e[i]:{},n):e[i]=n})}),e}function Hl(e,t){In(t||cr(e),function(n){delete e[n]})}function jn(e,t){In(e,function(n){In(t,function(i){n&&n.removeAttribute(i)})})}function kt(e,t,n){sr(t)?Xi(t,function(i,o){kt(e,o,i)}):In(e,function(i){el(n)||n===""?jn(i,t):i.setAttribute(t,String(n))})}function xo(e,t,n){var i=document.createElement(e);return t&&(wi(t)?Bn(i,t):kt(i,t)),n&&$r(n,i),i}function kn(e,t,n){if(Sr(n))return getComputedStyle(e)[t];el(n)||(e.style[t]=""+n)}function ur(e,t){kn(e,"display",t)}function zd(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function En(e,t){return e.getAttribute(t)}function Ol(e,t){return e&&e.classList.contains(t)}function $n(e){return e.getBoundingClientRect()}function Ui(e){In(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Bd(e){return Cr(new DOMParser().parseFromString(e,"text/html").body)}function Jn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function jd(e,t){return e&&e.querySelector(t)}function il(e,t){return t?Ii(e.querySelectorAll(t)):[]}function ti(e,t){ei(e,t,!1)}function Ts(e){return e.timeStamp}function Ai(e){return wi(e)?e:e?e+"px":""}var Tr="splide",ol="data-"+Tr;function ir(e,t){if(!e)throw new Error("["+Tr+"] "+(t||""))}var $i=Math.min,la=Math.max,ca=Math.floor,pr=Math.ceil,fn=Math.abs;function Vd(e,t,n){return fn(e-t)<n}function na(e,t,n,i){var o=$i(t,n),r=la(t,n);return i?o<e&&e<r:o<=e&&e<=r}function co(e,t,n){var i=$i(t,n),o=la(t,n);return $i(la(i,e),o)}function Ls(e){return+(e>0)-+(e<0)}function Is(e,t){return In(t,function(n){e=e.replace("%s",""+n)}),e}function rl(e){return e<10?"0"+e:""+e}var Dl={};function Tm(e){return""+e+rl(Dl[e]=(Dl[e]||0)+1)}function Gd(){var e=[];function t(l,d,c,u){o(l,d,function(p,x,v){var m="addEventListener"in p,g=m?p.removeEventListener.bind(p,x,c,u):p.removeListener.bind(p,c);m?p.addEventListener(x,c,u):p.addListener(c),e.push([p,x,v,c,g])})}function n(l,d,c){o(l,d,function(u,p,x){e=e.filter(function(v){return v[0]===u&&v[1]===p&&v[2]===x&&(!c||v[3]===c)?(v[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){In(l,function(u){u&&In(d,function(p){p.split(" ").forEach(function(x){var v=x.split(".");c(u,v[0],v[1])})})})}function r(){e.forEach(function(l){l[4]()}),ri(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var Ri="mounted",Rs="ready",ai="move",Oo="moved",al="click",Xd="active",qd="inactive",Ud="visible",Yd="hidden",an="refresh",mn="updated",To="resize",Sa="resized",Kd="drag",Zd="dragging",Jd="dragged",wa="scroll",Zi="scrolled",Lm="overflow",sl="destroy",Qd="arrows:mounted",eu="arrows:updated",tu="pagination:mounted",nu="pagination:updated",ll="navigation:mounted",cl="autoplay:play",iu="autoplay:playing",dl="autoplay:pause",ul="lazyload:loaded",ou="sk",ru="sh",da="ei";function tn(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Gd();function i(r,l){n.bind(t,wr(r).join(" "),function(d){l.apply(l,Qs(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,Ii(arguments,1))}return e&&e.event.on(sl,n.destroy),dr(n,{bus:t,on:i,off:Jt(n.unbind,t),emit:o})}function $a(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?$i((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return v();d=Wl(p)}}function x(E){E||g(),r=o()-(E?l*e:0),c=!1,d=Wl(p)}function v(){c=!0}function m(){r=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function h(E){e=E}function b(){return c}return{start:x,rewind:m,pause:v,cancel:g,set:h,isPaused:b}}function Im(e){var t=e;function n(o){t=o}function i(o){return tl(wr(o),t)}return{set:n,is:i}}function Rm(e,t){var n=$a(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Pm(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Gd(),d=[];function c(){var g=n.mediaQuery==="min";cr(o).sort(function(h,b){return g?+h-+b:+b-+h}).forEach(function(h){p(o[h],"("+(g?"min":"max")+"-width:"+h+"px)")}),p(r,_l),x()}function u(g){g&&l.destroy()}function p(g,h){var b=matchMedia(h);l.bind(b,"change",x),d.push([g,b])}function x(){var g=i.is(sa),h=n.direction,b=d.reduce(function(E,y){return vi(E,y[1].matches?y[0]:{})},{});Hl(n),m(b),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):h!==n.direction&&e.refresh()}function v(g){matchMedia(_l).matches&&(g?vi(n,r):Hl(n,cr(r)))}function m(g,h,b){vi(n,g),h&&vi(Object.getPrototypeOf(n),g),(b||!i.is(go))&&e.emit(mn,n)}return{setup:c,destroy:u,reduce:v,set:m}}var Ca="Arrow",Ta=Ca+"Left",La=Ca+"Right",au=Ca+"Up",su=Ca+"Down",zl="rtl",Ia="ttb",Ha={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[au,La],ArrowRight:[su,Ta]};function km(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===zl&&!l?1:d===Ia?0:-1;return Ha[r]&&Ha[r][c]||r.replace(/width|left|right/i,function(u,p){var x=Ha[u.toLowerCase()][c]||u;return p>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(r){return r*(n.direction===zl?1:-1)}return{resolve:i,orient:o}}var ni="role",bo="tabindex",Em="disabled",Mn="aria-",Lr=Mn+"controls",lu=Mn+"current",Bl=Mn+"selected",Tn=Mn+"label",pl=Mn+"labelledby",cu=Mn+"hidden",ml=Mn+"orientation",mr=Mn+"roledescription",jl=Mn+"live",Vl=Mn+"busy",Gl=Mn+"atomic",gl=[ni,bo,Em,Lr,lu,Tn,pl,cu,ml,mr],Gn=Tr+"__",Pi="is-",Oa=Tr,Xl=Gn+"track",Mm=Gn+"list",Ra=Gn+"slide",du=Ra+"--clone",Am=Ra+"__container",hl=Gn+"arrows",Pa=Gn+"arrow",uu=Pa+"--prev",pu=Pa+"--next",ka=Gn+"pagination",mu=ka+"__page",Fm=Gn+"progress",Nm=Fm+"__bar",_m=Gn+"toggle",Wm=Gn+"spinner",Hm=Gn+"sr",Om=Pi+"initialized",Yi=Pi+"active",gu=Pi+"prev",hu=Pi+"next",Ps=Pi+"visible",ks=Pi+"loading",fu=Pi+"focus-in",yu=Pi+"overflow",Dm=[Yi,Ps,gu,hu,ks,fu,yu],zm={slide:Ra,clone:du,arrows:hl,arrow:Pa,prev:uu,next:pu,pagination:ka,page:mu,spinner:Wm};function Bm(e,t){if(Hd(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!lr(n,t);)n=n.parentElement;return n}var jm=5,ql=200,vu="touchstart mousedown",Da="touchmove mousemove",za="touchend touchcancel mouseup click";function Vm(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],x=[],v,m,g;function h(){w(),j(),y()}function b(){o(an,E),o(an,h),o(mn,y),r(document,vu+" keydown",function(P){g=P.type==="keydown"},{capture:!0}),r(l,"focusin",function(){ei(l,fu,!!g)})}function E(P){var W=gl.concat("style");ri(u),ti(l,p),ti(v,x),jn([v,m],W),jn(l,P?W:["style",mr])}function y(){ti(l,p),ti(v,x),p=A(Oa),x=A(Xl),Bn(l,p),Bn(v,x),kt(l,Tn,n.label),kt(l,pl,n.labelledby)}function w(){v=G("."+Xl),m=Cr(v,"."+Mm),ir(v&&m,"A track/list element is missing."),ta(u,Dd(m,"."+Ra+":not(."+du+")")),Xi({arrows:hl,pagination:ka,prev:uu,next:pu,bar:Nm,toggle:_m},function(P,W){c[W]=G("."+P)}),dr(c,{root:l,track:v,list:m,slides:u})}function j(){var P=l.id||Tm(Tr),W=n.role;l.id=P,v.id=v.id||P+"-track",m.id=m.id||P+"-list",!En(l,ni)&&l.tagName!=="SECTION"&&W&&kt(l,ni,W),kt(l,mr,d.carousel),kt(m,ni,"presentation")}function G(P){var W=jd(l,P);return W&&Bm(W,"."+Oa)===l?W:void 0}function A(P){return[P+"--"+n.type,P+"--"+n.direction,n.drag&&P+"--draggable",n.isNavigation&&P+"--nav",P===Oa&&Yi]}return dr(c,{setup:h,mount:b,destroy:E})}var Lo="slide",Do="loop",Ir="fade";function Gm(e,t,n,i){var o=tn(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,x=p.isNavigation,v=p.updateOnMove,m=p.i18n,g=p.pagination,h=p.slideFocus,b=c.Direction.resolve,E=En(i,"style"),y=En(i,Tn),w=n>-1,j=Cr(i,"."+Am),G;function A(){w||(i.id=u.id+"-slide"+rl(t+1),kt(i,ni,g?"tabpanel":"group"),kt(i,mr,m.slide),kt(i,Tn,y||Is(m.slideLabel,[t+1,e.length]))),P()}function P(){d(i,"click",Jt(l,al,U)),d(i,"keydown",Jt(l,ou,U)),r([Oo,ru,Zi],I),r(ll,Y),v&&r(ai,$)}function W(){G=!0,o.destroy(),ti(i,Dm),jn(i,gl),kt(i,"style",E),kt(i,Tn,y||"")}function Y(){var T=e.splides.map(function(_){var B=_.splide.Components.Slides.getAt(t);return B?B.slide.id:""}).join(" ");kt(i,Tn,Is(m.slideX,(w?n:t)+1)),kt(i,Lr,T),kt(i,ni,h?"button":""),h&&jn(i,mr)}function $(){G||I()}function I(){if(!G){var T=e.index;H(),O(),ei(i,gu,t===T-1),ei(i,hu,t===T+1)}}function H(){var T=L();T!==Ol(i,Yi)&&(ei(i,Yi,T),kt(i,lu,x&&T||""),l(T?Xd:qd,U))}function O(){var T=D(),_=!T&&(!L()||w);if(e.state.is([Ho,br])||kt(i,cu,_||""),kt(il(i,p.focusableNodes||""),bo,_?-1:""),h&&kt(i,bo,_?-1:0),T!==Ol(i,Ps)&&(ei(i,Ps,T),l(T?Ud:Yd,U)),!T&&document.activeElement===i){var B=c.Slides.getAt(e.index);B&&zd(B.slide)}}function C(T,_,B){kn(B&&j||i,T,_)}function L(){var T=e.index;return T===t||p.cloneStatus&&T===n}function D(){if(e.is(Ir))return L();var T=$n(c.Elements.track),_=$n(i),B=b("left",!0),ae=b("right",!0);return ca(T[B])<=pr(_[B])&&ca(_[ae])<=pr(T[ae])}function S(T,_){var B=fn(T-t);return!w&&(p.rewind||e.is(Do))&&(B=$i(B,e.length-B)),B<=_}var U={index:t,slideIndex:n,slide:i,container:j,isClone:w,mount:A,destroy:W,update:I,style:C,isWithin:S};return U}function Xm(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function x(){v(),o(an,m),o(an,v)}function v(){c.forEach(function(I,H){h(I,H,-1)})}function m(){G(function(I){I.destroy()}),ri(p)}function g(){G(function(I){I.update()})}function h(I,H,O){var C=Gm(e,H,O,I);C.mount(),p.push(C),p.sort(function(L,D){return L.index-D.index})}function b(I){return I?A(function(H){return!H.isClone}):p}function E(I){var H=t.Controller,O=H.toIndex(I),C=H.hasFocus()?1:n.perPage;return A(function(L){return na(L.index,O,O+C-1)})}function y(I){return A(I)[0]}function w(I,H){In(I,function(O){if(wi(O)&&(O=Bd(O)),Od(O)){var C=c[H];C?nl(O,C):$r(u,O),Bn(O,n.classes.slide),W(O,Jt(r,To))}}),r(an)}function j(I){Ui(A(I).map(function(H){return H.slide})),r(an)}function G(I,H){b(H).forEach(I)}function A(I){return p.filter(Hd(I)?I:function(H){return wi(I)?lr(H.slide,I):tl(wr(I),H.index)})}function P(I,H,O){G(function(C){C.style(I,H,O)})}function W(I,H){var O=il(I,"img"),C=O.length;C?O.forEach(function(L){l(L,"load error",function(){--C||H()})}):H()}function Y(I){return I?c.length:p.length}function $(){return p.length>n.perPage}return{mount:x,destroy:m,update:g,register:h,get:b,getIn:E,getAt:y,add:w,remove:j,forEach:G,filter:A,style:P,getLength:Y,isEnough:$}}function qm(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,x=u.track,v=u.list,m=d.getAt,g=d.style,h,b,E;function y(){w(),r(window,"resize load",Rm(Jt(l,To))),o([mn,an],w),o(To,j)}function w(){h=n.direction===Ia,kn(p,"maxWidth",Ai(n.width)),kn(x,c("paddingLeft"),G(!1)),kn(x,c("paddingRight"),G(!0)),j(!0)}function j(U){var T=$n(p);(U||b.width!==T.width||b.height!==T.height)&&(kn(x,"height",A()),g(c("marginRight"),Ai(n.gap)),g("width",W()),g("height",Y(),!0),b=T,l(Sa),E!==(E=S())&&(ei(p,yu,E),l(Lm,E)))}function G(U){var T=n.padding,_=c(U?"right":"left");return T&&Ai(T[_]||(sr(T)?0:T))||"0px"}function A(){var U="";return h&&(U=P(),ir(U,"height or heightRatio is missing."),U="calc("+U+" - "+G(!1)+" - "+G(!0)+")"),U}function P(){return Ai(n.height||$n(v).width*n.heightRatio)}function W(){return n.autoWidth?null:Ai(n.fixedWidth)||(h?"":$())}function Y(){return Ai(n.fixedHeight)||(h?n.autoHeight?null:$():P())}function $(){var U=Ai(n.gap);return"calc((100%"+(U&&" + "+U)+")/"+(n.perPage||1)+(U&&" - "+U)+")"}function I(){return $n(v)[c("width")]}function H(U,T){var _=m(U||0);return _?$n(_.slide)[c("width")]+(T?0:L()):0}function O(U,T){var _=m(U);if(_){var B=$n(_.slide)[c("right")],ae=$n(v)[c("left")];return fn(B-ae)+(T?0:L())}return 0}function C(U){return O(e.length-1)-O(0)+H(0,U)}function L(){var U=m(0);return U&&parseFloat(kn(U.slide,c("marginRight")))||0}function D(U){return parseFloat(kn(x,c("padding"+(U?"Right":"Left"))))||0}function S(){return e.is(Ir)||C(!0)>I()}return{mount:y,resize:j,listSize:I,slideSize:H,sliderSize:C,totalSize:O,getPadding:D,isOverflow:S}}var Um=2;function Ym(e,t,n){var i=tn(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(an,x),o([mn,To],m),(u=b())&&(g(u),t.Layout.resize(!0))}function x(){v(),p()}function v(){Ui(c),ri(c),i.destroy()}function m(){var E=b();u!==E&&(u<E||!E)&&i.emit(an)}function g(E){var y=l.get().slice(),w=y.length;if(w){for(;y.length<E;)ta(y,y);ta(y.slice(-E),y.slice(0,E)).forEach(function(j,G){var A=G<E,P=h(j.slide,G);A?nl(P,y[0].slide):$r(r.list,P),ta(c,P),l.register(P,G-E+(A?0:w),j.index)})}}function h(E,y){var w=E.cloneNode(!0);return Bn(w,n.classes.clone),w.id=e.root.id+"-clone"+rl(y+1),w}function b(){var E=n.clones;if(!e.is(Do))E=0;else if(Sr(E)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),w=y&&pr($n(r.track)[d("width")]/y);E=w||n[d("autoWidth")]&&e.length||n.perPage*Um}return E}return{mount:p,destroy:v}}function Km(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,x=d.listSize,v=d.sliderSize,m=t.Direction,g=m.resolve,h=m.orient,b=t.Elements,E=b.list,y=b.track,w;function j(){w=t.Transition,o([Ri,Sa,mn,an],G)}function G(){t.Controller.isBusy()||(t.Scroll.cancel(),P(e.index),t.Slides.update())}function A(_,B,ae,ie){_!==B&&U(_>ae)&&(I(),W($(C(),_>ae),!0)),l(Ho),r(ai,B,ae,_),w.start(B,function(){l(Co),r(Oo,B,ae,_),ie&&ie()})}function P(_){W(O(_,!0))}function W(_,B){if(!e.is(Ir)){var ae=B?_:Y(_);kn(E,"transform","translate"+g("X")+"("+ae+"px)"),_!==ae&&r(ru)}}function Y(_){if(e.is(Do)){var B=H(_),ae=B>t.Controller.getEnd(),ie=B<0;(ie||ae)&&(_=$(_,ae))}return _}function $(_,B){var ae=_-S(B),ie=v();return _-=h(ie*(pr(fn(ae)/ie)||1))*(B?1:-1),_}function I(){W(C(),!0),w.cancel()}function H(_){for(var B=t.Slides.get(),ae=0,ie=1/0,k=0;k<B.length;k++){var ue=B[k].index,X=fn(O(ue,!0)-_);if(X<=ie)ie=X,ae=ue;else break}return ae}function O(_,B){var ae=h(p(_-1)-D(_));return B?L(ae):ae}function C(){var _=g("left");return $n(E)[_]-$n(y)[_]+h(u(!1))}function L(_){return n.trimSpace&&e.is(Lo)&&(_=co(_,0,h(v(!0)-x()))),_}function D(_){var B=n.focus;return B==="center"?(x()-c(_,!0))/2:+B*c(_)||0}function S(_){return O(_?t.Controller.getEnd():0,!!n.trimSpace)}function U(_){var B=h($(C(),_));return _?B>=0:B<=E[g("scrollWidth")]-$n(y)[g("width")]}function T(_,B){B=Sr(B)?C():B;var ae=_!==!0&&h(B)<h(S(!1)),ie=_!==!1&&h(B)>h(S(!0));return ae||ie}return{mount:j,move:A,jump:P,translate:W,shift:$,cancel:I,toIndex:H,toPosition:O,getPosition:C,getLimit:S,exceededLimit:T,reposition:G}}function Zm(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,x=p.isEnough,v=p.getLength,m=n.omitEnd,g=e.is(Do),h=e.is(Lo),b=Jt(C,!1),E=Jt(C,!0),y=n.start||0,w,j=y,G,A,P;function W(){Y(),o([mn,an,da],Y),o(Sa,$)}function Y(){G=v(!0),A=n.perMove,P=n.perPage,w=U();var X=co(y,0,m?w:G-1);X!==y&&(y=X,l.reposition())}function $(){w!==U()&&r(da)}function I(X,le,te){if(!ue()){var we=O(X),ke=S(we);ke>-1&&(le||ke!==y)&&(ae(ke),l.move(we,ke,j,te))}}function H(X,le,te,we){t.Scroll.scroll(X,le,te,function(){var ke=S(l.toIndex(d()));ae(m?$i(ke,w):ke),we&&we()})}function O(X){var le=y;if(wi(X)){var te=X.match(/([+\-<>])(\d+)?/)||[],we=te[1],ke=te[2];we==="+"||we==="-"?le=L(y+ +(""+we+(+ke||1)),y):we===">"?le=ke?T(+ke):b(!0):we==="<"&&(le=E(!0))}else le=g?X:co(X,0,w);return le}function C(X,le){var te=A||(k()?1:P),we=L(y+te*(X?-1:1),y,!(A||k()));return we===-1&&h&&!Vd(d(),c(!X),1)?X?0:w:le?we:S(we)}function L(X,le,te){if(x()||k()){var we=D(X);we!==X&&(le=X,X=we,te=!1),X<0||X>w?!A&&(na(0,X,le,!0)||na(w,le,X,!0))?X=T(_(X)):g?X=te?X<0?-(G%P||P):G:X:n.rewind?X=X<0?w:0:X=-1:te&&X!==le&&(X=T(_(le)+(X<le?-1:1)))}else X=-1;return X}function D(X){if(h&&n.trimSpace==="move"&&X!==y)for(var le=d();le===u(X,!0)&&na(X,0,e.length-1,!n.rewind);)X<y?--X:++X;return X}function S(X){return g?(X+G)%G||0:X}function U(){for(var X=G-(k()||g&&A?1:P);m&&X-- >0;)if(u(G-1,!0)!==u(X,!0)){X++;break}return co(X,0,G-1)}function T(X){return co(k()?X:P*X,0,w)}function _(X){return k()?$i(X,w):ca((X>=w?G-1:X)/P)}function B(X){var le=l.toIndex(X);return h?co(le,0,w):le}function ae(X){X!==y&&(j=y,y=X)}function ie(X){return X?j:y}function k(){return!Sr(n.focus)||n.isNavigation}function ue(){return e.state.is([Ho,br])&&!!n.waitForTransition}return{mount:W,go:I,scroll:H,getNext:b,getPrev:E,getAdjacent:C,getEnd:U,setIndex:ae,getIndex:ie,toIndex:T,toPage:_,toDest:B,hasFocus:k,isBusy:ue}}var Jm="http://www.w3.org/2000/svg",Qm="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",Er=40;function eg(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,x=u.arrows,v=u.track,m=x,g=u.prev,h=u.next,b,E,y={};function w(){G(),o(mn,j)}function j(){A(),w()}function G(){var H=n.arrows;H&&!(g&&h)&&Y(),g&&h&&(dr(y,{prev:g,next:h}),ur(m,H?"":"none"),Bn(m,E=hl+"--"+n.direction),H&&(P(),I(),kt([g,h],Lr,v.id),l(Qd,g,h)))}function A(){i.destroy(),ti(m,E),b?(Ui(x?[g,h]:m),g=h=null):jn([g,h],gl)}function P(){o([Ri,Oo,an,Zi,da],I),r(h,"click",Jt(W,">")),r(g,"click",Jt(W,"<"))}function W(H){p.go(H,!0)}function Y(){m=x||xo("div",d.arrows),g=$(!0),h=$(!1),b=!0,$r(m,[g,h]),!x&&nl(m,v)}function $(H){var O='<button class="'+d.arrow+" "+(H?d.prev:d.next)+'" type="button"><svg xmlns="'+Jm+'" viewBox="0 0 '+Er+" "+Er+'" width="'+Er+'" height="'+Er+'" focusable="false"><path d="'+(n.arrowPath||Qm)+'" />';return Bd(O)}function I(){if(g&&h){var H=e.index,O=p.getPrev(),C=p.getNext(),L=O>-1&&H<O?c.last:c.prev,D=C>-1&&H>C?c.first:c.next;g.disabled=O<0,h.disabled=C<0,kt(g,Tn,L),kt(h,Tn,D),l(eu,g,h,O,C)}}return{arrows:y,mount:w,destroy:A,update:I}}var tg=ol+"-interval";function ng(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,d=$a(n.interval,e.go.bind(e,">"),P),c=d.isPaused,u=t.Elements,p=t.Elements,x=p.root,v=p.toggle,m=n.autoplay,g,h,b=m==="pause";function E(){m&&(y(),v&&kt(v,Lr,u.track.id),b||w(),A())}function y(){n.pauseOnHover&&r(x,"mouseenter mouseleave",function(Y){g=Y.type==="mouseenter",G()}),n.pauseOnFocus&&r(x,"focusin focusout",function(Y){h=Y.type==="focusin",G()}),v&&r(v,"click",function(){b?w():j(!0)}),o([ai,wa,an],d.rewind),o(ai,W)}function w(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=g=b=!1,A(),l(cl))}function j(Y){Y===void 0&&(Y=!0),b=!!Y,A(),c()||(d.pause(),l(dl))}function G(){b||(g||h?j(!1):w())}function A(){v&&(ei(v,Yi,!b),kt(v,Tn,n.i18n[b?"play":"pause"]))}function P(Y){var $=u.bar;$&&kn($,"width",Y*100+"%"),l(iu,Y)}function W(Y){var $=t.Slides.getAt(Y);d.set($&&+En($.slide,tg)||n.interval)}return{mount:E,destroy:d.cancel,play:w,pause:j,isPaused:c}}function ig(e,t,n){var i=tn(e),o=i.on;function r(){n.cover&&(o(ul,Jt(d,!0)),o([Ri,mn,an],Jt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Cr(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),ur(u,c?"none":"")}return{mount:r,destroy:Jt(l,!1)}}var og=10,rg=600,ag=.6,sg=1.5,lg=800;function cg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,x=d.translate,v=e.is(Lo),m,g,h=1;function b(){o(ai,j),o([mn,an],G)}function E(P,W,Y,$,I){var H=c();if(j(),Y&&(!v||!p())){var O=t.Layout.sliderSize(),C=Ls(P)*O*ca(fn(P)/O)||0;P=d.toPosition(t.Controller.toDest(P%O))+C}var L=Vd(H,P,1);h=1,W=L?0:W||la(fn(P-H)/sg,lg),g=$,m=$a(W,y,Jt(w,H,P,I),1),l(br),r(wa),m.start()}function y(){l(Co),g&&g(),r(Zi)}function w(P,W,Y,$){var I=c(),H=P+(W-P)*A($),O=(H-I)*h;x(I+O),v&&!Y&&p()&&(h*=ag,fn(O)<og&&E(u(p(!0)),rg,!1,g,!0))}function j(){m&&m.cancel()}function G(){m&&!m.isPaused()&&(j(),y())}function A(P){var W=n.easingFunc;return W?W(P):1-Math.pow(1-P,4)}return{mount:b,destroy:j,scroll:E,cancel:G}}var uo={passive:!1,capture:!0};function dg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,x=t.Controller,v=t.Elements.track,m=t.Media.reduce,g=t.Direction,h=g.resolve,b=g.orient,E=u.getPosition,y=u.exceededLimit,w,j,G,A,P,W=!1,Y,$,I;function H(){l(v,Da,Cs,uo),l(v,za,Cs,uo),l(v,vu,C,uo),l(v,"click",S,{capture:!0}),l(v,"dragstart",Jn),o([Ri,mn],O)}function O(){var Z=n.drag;me(!Z),A=Z==="free"}function C(Z){if(Y=!1,!$){var se=ke(Z);we(Z.target)&&(se||!Z.button)&&(x.isBusy()?Jn(Z,!0):(I=se?v:window,P=c.is([Ho,br]),G=null,l(I,Da,L,uo),l(I,za,D,uo),u.cancel(),p.cancel(),U(Z)))}}function L(Z){if(c.is(ea)||(c.set(ea),r(Kd)),Z.cancelable)if(P){u.translate(w+te(k(Z)));var se=ue(Z)>ql,oe=W!==(W=y());(se||oe)&&U(Z),Y=!0,r(Zd),Jn(Z)}else B(Z)&&(P=_(Z),Jn(Z))}function D(Z){c.is(ea)&&(c.set(Co),r(Jd)),P&&(T(Z),Jn(Z)),d(I,Da,L),d(I,za,D),P=!1}function S(Z){!$&&Y&&Jn(Z,!0)}function U(Z){G=j,j=Z,w=E()}function T(Z){var se=ae(Z),oe=ie(se),Pe=n.rewind&&n.rewindByDrag;m(!1),A?x.scroll(oe,0,n.snap):e.is(Ir)?x.go(b(Ls(se))<0?Pe?"<":"-":Pe?">":"+"):e.is(Lo)&&W&&Pe?x.go(y(!0)?">":"<"):x.go(x.toDest(oe),!0),m(!0)}function _(Z){var se=n.dragMinThreshold,oe=sr(se),Pe=oe&&se.mouse||0,$e=(oe?se.touch:+se)||10;return fn(k(Z))>(ke(Z)?$e:Pe)}function B(Z){return fn(k(Z))>fn(k(Z,!0))}function ae(Z){if(e.is(Do)||!W){var se=ue(Z);if(se&&se<ql)return k(Z)/se}return 0}function ie(Z){return E()+Ls(Z)*$i(fn(Z)*(n.flickPower||600),A?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function k(Z,se){return le(Z,se)-le(X(Z),se)}function ue(Z){return Ts(Z)-Ts(X(Z))}function X(Z){return j===Z&&G||j}function le(Z,se){return(ke(Z)?Z.changedTouches[0]:Z)["page"+h(se?"Y":"X")]}function te(Z){return Z/(W&&e.is(Lo)?jm:1)}function we(Z){var se=n.noDrag;return!lr(Z,"."+mu+", ."+Pa)&&(!se||!lr(Z,se))}function ke(Z){return typeof TouchEvent<"u"&&Z instanceof TouchEvent}function fe(){return P}function me(Z){$=Z}return{mount:H,disable:me,isDragging:fe}}var ug={Spacebar:" ",Right:La,Left:Ta,Up:au,Down:su};function fl(e){return e=wi(e)?e:e.key,ug[e]||e}var Ul="keydown";function pg(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function x(){v(),o(mn,m),o(mn,v),o(ai,h)}function v(){var E=n.keyboard;E&&(u=E==="global"?window:d,r(u,Ul,b))}function m(){l(u,Ul)}function g(E){p=E}function h(){var E=p;p=!0,Wd(function(){p=E})}function b(E){if(!p){var y=fl(E);y===c(Ta)?e.go("<"):y===c(La)&&e.go(">")}}return{mount:x,destroy:m,disable:g}}var or=ol+"-lazy",ia=or+"-srcset",mg="["+or+"], ["+ia+"]";function gg(e,t,n){var i=tn(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Oo,Zi],p=[];function x(){n.lazyLoad&&(v(),o(an,v))}function v(){ri(p),m(),c?E():(r(u),o(u,g),g())}function m(){t.Slides.forEach(function(y){il(y.slide,mg).forEach(function(w){var j=En(w,or),G=En(w,ia);if(j!==w.src||G!==w.srcset){var A=n.classes.spinner,P=w.parentElement,W=Cr(P,"."+A)||xo("span",A,P);p.push([w,y,W]),w.src||ur(w,"none")}})})}function g(){p=p.filter(function(y){var w=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,w)?h(y):!0}),p.length||r(u)}function h(y){var w=y[0];Bn(y[1].slide,ks),l(w,"load error",Jt(b,y)),kt(w,"src",En(w,or)),kt(w,"srcset",En(w,ia)),jn(w,or),jn(w,ia)}function b(y,w){var j=y[0],G=y[1];ti(G.slide,ks),w.type!=="error"&&(Ui(y[2]),ur(j,""),d(ul,j,G),d(To)),c&&E()}function E(){p.length&&h(p.shift())}return{mount:x,destroy:Jt(ri,p),check:g}}function hg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,x=u.getIndex,v=u.go,m=t.Direction.resolve,g=c.pagination,h=[],b,E;function y(){w(),o([mn,an,da],y);var $=n.pagination;g&&ur(g,$?"":"none"),$&&(o([ai,wa,Zi],Y),j(),Y(),r(tu,{list:b,items:h},W(e.index)))}function w(){b&&(Ui(g?Ii(b.children):b),ti(b,E),ri(h),b=null),i.destroy()}function j(){var $=e.length,I=n.classes,H=n.i18n,O=n.perPage,C=p()?u.getEnd()+1:pr($/O);b=g||xo("ul",I.pagination,c.track.parentElement),Bn(b,E=ka+"--"+P()),kt(b,ni,"tablist"),kt(b,Tn,H.select),kt(b,ml,P()===Ia?"vertical":"");for(var L=0;L<C;L++){var D=xo("li",null,b),S=xo("button",{class:I.page,type:"button"},D),U=d.getIn(L).map(function(_){return _.slide.id}),T=!p()&&O>1?H.pageX:H.slideX;l(S,"click",Jt(G,L)),n.paginationKeyboard&&l(S,"keydown",Jt(A,L)),kt(D,ni,"presentation"),kt(S,ni,"tab"),kt(S,Lr,U.join(" ")),kt(S,Tn,Is(T,L+1)),kt(S,bo,-1),h.push({li:D,button:S,page:L})}}function G($){v(">"+$,!0)}function A($,I){var H=h.length,O=fl(I),C=P(),L=-1;O===m(La,!1,C)?L=++$%H:O===m(Ta,!1,C)?L=(--$+H)%H:O==="Home"?L=0:O==="End"&&(L=H-1);var D=h[L];D&&(zd(D.button),v(">"+L),Jn(I,!0))}function P(){return n.paginationDirection||n.direction}function W($){return h[u.toPage($)]}function Y(){var $=W(x(!0)),I=W(x());if($){var H=$.button;ti(H,Yi),jn(H,Bl),kt(H,bo,-1)}if(I){var O=I.button;Bn(O,Yi),kt(O,Bl,!0),kt(O,bo,"")}r(nu,{list:b,items:h},$,I)}return{items:h,mount:y,destroy:w,getAt:W,update:Y}}var fg=[" ","Enter"];function yg(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){r.forEach(function(g){g.destroy()}),ri(r)}function c(){d(),l()}function u(g,h){var b=tn(g);b.on(ai,function(E,y,w){h.go(h.is(Do)?w:E)}),r.push(b)}function p(){var g=tn(e),h=g.on;h(al,v),h(ou,m),h([Ri,mn],x),r.push(g),g.emit(ll,e.splides)}function x(){kt(t.Elements.list,ml,n.direction===Ia?"vertical":"")}function v(g){e.go(g.index)}function m(g,h){tl(fg,fl(h))&&(v(g),Jn(h))}return{setup:Jt(t.Media.set,{slideFocus:Sr(o)?i:o},!0),mount:l,destroy:d,remount:c}}function vg(e,t,n){var i=tn(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,uo)}function d(u){if(u.cancelable){var p=u.deltaY,x=p<0,v=Ts(u),m=n.wheelMinThreshold||0,g=n.wheelSleep||0;fn(p)>m&&v-r>g&&(e.go(x?"<":">"),r=v),c(x)&&Jn(u)}}function c(u){return!n.releaseWheel||e.state.is(Ho)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var xg=90;function bg(e,t,n){var i=tn(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=xo("span",Hm),c=$a(xg,Jt(p,!1));function u(){l&&(v(!t.Autoplay.isPaused()),kt(r,Gl,!0),d.textContent="…",o(cl,Jt(v,!0)),o(dl,Jt(v,!1)),o([Oo,Zi],Jt(p,!0)))}function p(m){kt(r,Vl,m),m?($r(r,d),c.start()):(Ui(d),c.cancel())}function x(){jn(r,[jl,Gl,Vl]),Ui(d)}function v(m){l&&kt(r,jl,m?"off":"polite")}return{mount:u,disable:v,destroy:x}}var Sg=Object.freeze({__proto__:null,Media:Pm,Direction:km,Elements:Vm,Slides:Xm,Layout:qm,Clones:Ym,Move:Km,Controller:Zm,Arrows:eg,Autoplay:ng,Cover:ig,Scroll:cg,Drag:dg,Keyboard:pg,LazyLoad:gg,Pagination:hg,Sync:yg,Wheel:vg,Live:bg}),wg={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"},$g={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:zm,i18n:wg,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Cg(e,t,n){var i=t.Slides;function o(){tn(e).on([Ri,an],r)}function r(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Wd(c)}return{mount:o,start:l,cancel:Cs}}function Tg(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Jt(kn,l,"transition"),c;function u(){tn(e).bind(l,"transitionend",function(m){m.target===l&&c&&(x(),c())})}function p(m,g){var h=i.toPosition(m,!0),b=i.getPosition(),E=v(m);fn(h-b)>=1&&E>=1?n.useScroll?r.scroll(h,E,!1,g):(d("transform "+E+"ms "+n.easing),i.translate(h,!0),c=g):(i.jump(m),g())}function x(){d(""),r.cancel()}function v(m){var g=n.rewindSpeed;if(e.is(Lo)&&g){var h=o.getIndex(!0),b=o.getEnd();if(h===0&&m>=b||h>=b&&m===0)return g}return n.speed}return{mount:u,start:p,cancel:x}}var Lg=(function(){function e(n,i){this.event=tn(),this.Components={},this.state=Im(go),this.splides=[],this._o={},this._E={};var o=wi(n)?jd(document,n):n;ir(o,o+" is invalid."),this.root=o,i=vi({label:En(o,Tn)||"",labelledby:En(o,pl)||""},$g,e.defaults,i||{});try{vi(i,JSON.parse(En(o,ol)))}catch{ir(!1,"Invalid JSON")}this._o=Object.create(vi({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;ir(l.is([go,sa]),"Already mounted!"),l.set(go),this._C=d,this._T=o||this._T||(this.is(Ir)?Cg:Tg),this._E=i||this._E;var c=dr({},Sg,this._E,{Transition:this._T});return Xi(c,function(u,p){var x=u(r,d,r._o);d[p]=x,x.setup&&x.setup()}),Xi(d,function(u){u.mount&&u.mount()}),this.emit(Ri),Bn(this.root,Om),l.set(Co),this.emit(Rs),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Co)&&(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(Ii(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(an),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(go)?tn(this).on(Rs,this.destroy.bind(this,i)):(Xi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(sl),o.destroy(),i&&ri(this.splides),r.set(sa)),this},wm(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})(),yl=Lg;yl.defaults={};yl.STATES=Cm;var Yl=[[Ri,"onMounted"],[Rs,"onReady"],[ai,"onMove"],[Oo,"onMoved"],[al,"onClick"],[Xd,"onActive"],[qd,"onInactive"],[Ud,"onVisible"],[Yd,"onHidden"],[an,"onRefresh"],[mn,"onUpdated"],[To,"onResize"],[Sa,"onResized"],[Kd,"onDrag"],[Zd,"onDragging"],[Jd,"onDragged"],[wa,"onScroll"],[Zi,"onScrolled"],[sl,"onDestroy"],[Qd,"onArrowsMounted"],[eu,"onArrowsUpdated"],[tu,"onPaginationMounted"],[nu,"onPaginationUpdated"],[ll,"onNavigationMounted"],[cl,"onAutoplayPlay"],[iu,"onAutoplayPlaying"],[dl,"onAutoplayPause"],[ul,"onLazyLoadLoaded"]];function vl(...e){return e.filter(Boolean).join(" ")}function ua(e){return e!==null&&typeof e=="object"}function Es(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Es(n,t[i]));if(ua(e)&&ua(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Es(e[o],t[o]))}return e===t}function Ig(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Rg(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 Ms(e,t){const n=e;return Rg(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ua(i)?n[o]=Ms(ua(n[o])?n[o]:{},i):n[o]=i}),n}var Pg=({children:e,className:t,...n})=>s.createElement("div",{className:vl("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),xl=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 yl(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ms({},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&&!Es(this.options,e)&&(this.splide.options=e,this.options=Ms({},e));const t=this.getSlides();Ig(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){Yl.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:vl("splide",e),ref:this.splideRef,...this.omit(o,["options",...Yl.map(r=>r[1])])},n?s.createElement(Pg,null,i):i)}},bl=({children:e,className:t,...n})=>s.createElement("li",{className:vl("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 kg="RichTextRenderer-module__link___BWeZ2",Eg={link:kg},Mg=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=>Mg(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function dn(e){const{color:t,...n}=e;return n}function Qt(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: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}}const Ki=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Eg.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Ag(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:t(o)},i)})})};function Ag(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 Fg="SvgImage-module__svg___q3xE-",Ng="SvgImage-module__img___VsTm-",Kl={svg:Fg,img:Ng},_g=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Wg=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,pn=({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("")'));return s.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!_g(e)||!r?a.jsx("img",{src:e,alt:"",className:Ct(Kl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:Ct(Kl.svg,i),style:{"--svg":Wg(e),"--fill":t,"--hover-fill":n,...o??{}}})},Hg={"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 Og({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:v,textAppearance:y,color:m}=n.imageCaption??{},[g,f]=s.useState(void 0),[x,R]=s.useState(null),[b,S]=s.useState(0),[G,D]=s.useState(0),{direction:j,transition:P,controls:M,pagination:K,imageCaption:T,triggers:L}=e,_=s.useRef(P.type),{x:z,y:$}=e.controls.offset,k=W=>{o&&o.go(W)};return s.useEffect(()=>{if(!x)return;const W=new ResizeObserver(w=>{if(!o)return;const[U]=w;f({width:Math.round(U.contentRect.width),height:Math.round(U.contentRect.height)})});return W.observe(x),()=>W.unobserve(x)},[x]),s.useEffect(()=>{!o||_.current===P.type||(D(W=>W+1),_.current=P.type)},[P.type]),a.jsx("div",{className:Ct($t.wrapper,{[$t.editor]:i}),ref:R,children:a.jsxs("div",{className:$t.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:P.backgroundColor&&P.type==="fade in"?P.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:Ct($t.captionBlock),children:a.jsx("div",{className:$t.captionTextWrapper,children:t.map((W,w)=>a.jsx("div",{className:Ct($t.captionText,Hg[T.alignment],{[$t.withPointerEvents]:w===b&&i,[$t.active]:w===b}),style:{fontFamily:zo(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":F.scalingValue(l.width,i),letterSpacing:F.scalingValue(c,i),wordSpacing:F.scalingValue(p,i),textAlign:u,fontSize:F.scalingValue(v.fontSize,i),lineHeight:F.scalingValue(v.lineHeight,i),textTransform:y.textTransform??"none",textDecoration:y.textDecoration??"none",fontVariant:y.fontVariant??"normal",color:m,transitionDuration:P.duration?`${Math.round(parseInt(P.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:$t.captionTextInner,style:{"--link-hover-color":T.linkHoverColor,"--link-color":T.linkColor,position:"relative",top:F.scalingValue(T.offset.y,i),left:F.scalingValue(T.offset.x,i)},children:a.jsx(Ki,{content:W.imageCaption})})},w))})}),a.jsx(xl,{onMove:W=>{S(W.index)},ref:r,options:{arrows:!1,speed:P.duration?parseInt(P.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:j==="horiz"||P.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:P.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((W,w)=>a.jsx(bl,{children:a.jsx("div",{className:$t.sliderItem,children:a.jsx("div",{className:$t.imgWrapper,children:a.jsx("img",{className:Ct($t.sliderImage,{[$t.contain]:W.image.objectFit==="contain",[$t.cover]:W.image.objectFit==="cover"}),src:W.image.url,alt:W.image.name??""})})})},w))},G),M.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct($t.arrow,{[$t.arrowVertical]:j==="vert",[$t.hoverArrow]:M.show==="on hover"}),style:{color:M.color,"--arrow-hover-color":M.hover},children:a.jsxs("button",{onClick:()=>{k("-1")},className:$t.arrowInner,style:{transform:`translate(${F.scalingValue(z,i)}, ${F.scalingValue($*(j==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:[M.arrowsImgUrl&&a.jsx(pn,{url:M.arrowsImgUrl,fill:M.color,hoverFill:M.hover,className:Ct($t.arrowImg,$t.mirror)}),!M.arrowsImgUrl&&a.jsx(Zl,{color:M.color,className:Ct($t.arrowIcon,$t.arrowImg,$t.mirror)})]})}),a.jsx("div",{className:Ct($t.arrow,$t.nextArrow,{[$t.arrowVertical]:j==="vert",[$t.hoverArrow]:M.show==="on hover"}),style:{color:M.color,"--arrow-hover-color":M.hover},children:a.jsxs("button",{className:$t.arrowInner,onClick:()=>k("+1"),style:{transform:`translate(${F.scalingValue(z*(j==="horiz"?-1:1),i)}, ${F.scalingValue($,i)}) scale(${e.controls.scale/100}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:[M.arrowsImgUrl&&a.jsx(pn,{url:M.arrowsImgUrl,fill:M.color,hoverFill:M.hover,className:$t.arrowImg}),!M.arrowsImgUrl&&a.jsx(Zl,{color:M.color,className:Ct($t.arrowIcon,$t.arrowImg)})]})})]}),L.triggersList.click&&a.jsx("div",{className:$t.clickOverlay,onClick:()=>{o&&o.go("+1")}}),K.isActive&&a.jsx("div",{className:Ct($t.pagination,{[$t.paginationInsideBottom]:K.position==="inside-1"&&j==="horiz",[$t.paginationInsideTop]:K.position==="inside-2"&&j==="horiz",[$t.paginationOutsideBottom]:K.position==="outside-1"&&j==="horiz",[$t.paginationOutsideTop]:K.position==="outside-2"&&j==="horiz",[$t.paginationInsideLeft]:K.position==="inside-1"&&j==="vert",[$t.paginationInsideRight]:K.position==="inside-2"&&j==="vert",[$t.paginationOutsideLeft]:K.position==="outside-1"&&j==="vert",[$t.paginationOutsideRight]:K.position==="outside-2"&&j==="vert",[$t.paginationVertical]:j==="vert"}),children:a.jsx("div",{className:$t.paginationInner,style:{backgroundColor:K.colors[2],transform:`scale(${K.scale/100}) translate(${F.scalingValue(K.offset.x,i)}, ${F.scalingValue(K.offset.y,i)}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:t.map((W,w)=>a.jsx("button",{onClick:()=>{o&&o.go(w)},className:Ct($t.paginationItem),children:a.jsx("div",{className:Ct($t.dot,{[$t.activeDot]:w===b}),style:{backgroundColor:w===b?K.colors[0]:K.colors[1],"--pagination-hover-color":K.hover}})},w))})})]})})}function Zl({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 Dg={element:Og,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},zg="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Bg="ImageRevealSlider-module__image___Qjt-e",jg="ImageRevealSlider-module__link___N-iLG",Vg="ImageRevealSlider-module__cursor___2U03d",no={imageRevealSlider:zg,image:Bg,link:jg,cursor:Vg};function Jl(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,d=r/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function Ba(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Gg(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await Ba(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Ba(e);r=l.height/l.width*o}else{const l=await Ba(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Xg({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[d,c]=s.useState(0),u=s.useRef(0),[p,v]=s.useState({x:0,y:0}),[y,m]=s.useState(1),[g,f]=s.useState("none"),x=s.useRef({x:0,y:0}),[R,b]=s.useState(!1),{sizeType:S,imageWidth:G,randomRangeImageWidth:D}=e.imageSize,{revealPosition:j,visible:P}=e.position,{cursorType:M,target:K,defaultCursorScale:T,defaultCursor:L,hoverCursorScale:_,hoverCursor:z}=e.cursor;s.useEffect(()=>{if(!i)return;const W=(C,O)=>{const V=i.getBoundingClientRect(),se=C-V.left,ie=O-V.top;if(v({x:se,y:ie}),M==="system"){f("none"),m(1);return}const N=se,de=ie,X=document.elementFromPoint(V.left+N,V.top+de);if(X&&X.closest("a")){f("none"),m(1);return}const ce=Jl(N,de,r)||K==="area"?{img:z??"none",scale:_}:{img:L??"none",scale:T};f(ce.img),m(ce.scale)},w=C=>{C.stopPropagation(),x.current={x:C.clientX,y:C.clientY},W(C.clientX,C.clientY)},U=()=>{R&&W(x.current.x,x.current.y)};return i.addEventListener("mousemove",w),window.addEventListener("scroll",U,!0),()=>{i.removeEventListener("mousemove",w),window.removeEventListener("scroll",U,!0)}},[i,R,p,M,K,z,L,_,T,r]),s.useEffect(()=>{R||(f("none"),m(0))},[R]);const $=async(W,w,U,C={})=>{const{width:O,height:V,finalWidth:se}=await Gg(W.image.url,S,G,D);let ie=0,N=0;j==="same"?(ie=w/2,N=U/2):(ie=C.x??Math.random()*w,N=C.y??Math.random()*U);const de=Math.min(Math.max(ie,O/2),w-O/2),X=Math.min(Math.max(N,V/2),U-V/2);return{id:u.current++,url:W.image.url,link:W.link,name:W.image.name,x:de,y:X,width:se}};s.useEffect(()=>{if(!i||t.length===0)return;const W=i.getBoundingClientRect(),w=W.width,U=W.height,C=[];(async()=>{const V=t[0],se=await $(V,w,U);C.push(se),l(C),c(1)})()},[S,G,D,j,i]),s.useEffect(()=>{P==="last One"&&l(W=>W.length>0?[W[W.length-1]]:[])},[P]);const k=async W=>{if(!i)return;const w=i.getBoundingClientRect(),U=W.clientX-w.left,C=W.clientY-w.top;if(K==="image"&&!Jl(U,C,r))return;let O=0,V=0;j==="on Click"?(O=U,V=C):j==="same"?(O=w.width/2,V=w.height/2):(O=Math.random()*w.width,V=Math.random()*w.height);const se=t[d],ie=await $(se,w.width,w.height,{x:O,y:V});l(N=>P==="all"?[...N,ie]:[ie]),c(N=>N>=t.length-1?0:N+1)};return a.jsxs("div",{ref:o,onClick:k,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),className:no.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[r.map(W=>a.jsx("div",{className:no.wrapper,style:{top:`${W.y}px`,left:`${W.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:W.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:K==="area"&&W.link?a.jsx("a",{href:W.link,target:"_blank",className:no.link,children:a.jsx("img",{src:W.url,alt:W.name,className:no.image},W.id)}):a.jsx("img",{src:W.url,alt:W.name,className:no.image},W.id)},W.id)),R&&a.jsx("div",{className:no.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${y})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const qg={element:Xg,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},Ug="LightBox-module__hidden___9s-9x",Yg="LightBox-module__heroImage___sTxNF",Kg="LightBox-module__background___rm9ml",Zg="LightBox-module__editor___4ACaY",Jg="LightBox-module__contentStyle___Bgnsq",Qg="LightBox-module__imageStyle___tLIlB",eh="LightBox-module__imgWrapper___LuFUp",th="LightBox-module__contain___8-yaS",nh="LightBox-module__cover___hNvOG",ih="LightBox-module__caption___b6L2I",oh="LightBox-module__captionTextInner___rCGNH",rh="LightBox-module__lightboxSplide___XFuWC",ah="LightBox-module__arrow___iz38X",sh="LightBox-module__arrowVertical___Zfz81",lh="LightBox-module__nextArrow___zkAQN",ch="LightBox-module__arrowInner___p48sW",dh="LightBox-module__arrowIcon___3VaFf",uh="LightBox-module__arrowImg___pNV88",ph="LightBox-module__mirror___pjeXc",mh="LightBox-module__thumbsWrapper___GB-nU",gh="LightBox-module__thumbsContainerVertical___wttk5",hh="LightBox-module__thumbsContainer___osSma",fh="LightBox-module__thumbsAlignStart___MO6tY",yh="LightBox-module__thumbsAlignCenter___Q4sUx",vh="LightBox-module__thumbsAlignEnd___p4y9R",xh="LightBox-module__thumbItem___HvnF3",bh="LightBox-module__closeButton___g2khP",Sh="LightBox-module__fadeIn___0m5GW",wh="LightBox-module__slideInLeft___gPYwC",$h="LightBox-module__slideInRight___S-pPp",Ch="LightBox-module__slideInTop___DFdAj",Th="LightBox-module__slideInBottom___m27kZ",Lh="LightBox-module__fadeOut___55qBR",Ih="LightBox-module__slideOutLeft___NvU7P",Rh="LightBox-module__slideOutRight___SK7eC",Ph="LightBox-module__slideOutTop___Vgg0z",kh="LightBox-module__slideOutBottom___nJ0Ef",Eh="LightBox-module__scaleSlide___vZriG",at={hidden:Ug,heroImage:Yg,background:Kg,editor:Zg,contentStyle:Jg,imageStyle:Qg,imgWrapper:eh,contain:th,cover:nh,caption:ih,captionTextInner:oh,lightboxSplide:rh,arrow:ah,arrowVertical:sh,nextArrow:lh,arrowInner:ch,arrowIcon:dh,arrowImg:uh,mirror:ph,thumbsWrapper:mh,thumbsContainerVertical:gh,thumbsContainer:hh,thumbsAlignStart:fh,thumbsAlignCenter:yh,thumbsAlignEnd:vh,thumbItem:xh,closeButton:bh,fadeIn:Sh,slideInLeft:wh,slideInRight:$h,slideInTop:Ch,slideInBottom:Th,fadeOut:Lh,slideOutLeft:Ih,slideOutRight:Rh,slideOutTop:Ph,slideOutBottom:kh,scaleSlide:Eh},Mr=(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 xu(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 Mh(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 bu(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 d=e;return{renderedW:d,renderedH:d/r}}const l=t;return{renderedW:l*r,renderedH:l}}function Ah(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 d=t;return{renderedW:d*r,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/r}}function Su(e,t,n,i,o){const{x:r,y:l}=Mh(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Fh(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:d}=window.getComputedStyle(e),c=l==="cover"?Ah:bu,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:v,offsetY:y}=Su(n,i,u,p,d),m=(v+u/2)/n*100,g=(y+p/2)/i*100;return`${m}% ${g}%`}function Nh(e){return Fh(e)}function pa(e){const t=e.getBoundingClientRect(),n=xu(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:d,renderedH:c}=bu(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:v}=Su(i,o,d,c,u),y=t.left+n.left,m=t.top+n.top;return{x:p+y,y:v+m,width:d,height:c}}function Ql(e){const t=e.getBoundingClientRect(),n=xu(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function _h(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 Wh=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[d,c]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:at.heroImage,onClick:()=>c(!0)}),a.jsx(Hh,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Hh=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var Ce;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:v,wordSpacing:y,fontSizeLineHeight:m,textAppearance:g,color:f}=i.imageCaption??{},[x,R]=s.useState(0),[b,S]=s.useState(0),[G,D]=s.useState(!1),[j,P]=s.useState(!1),[M,K]=s.useState({}),T=s.useRef(null),L=s.useRef(null),_=s.useRef(null),z=s.useRef(!1),$=s.useRef(null),k=s.useRef(null),W=s.useRef(null),w=s.useRef(null),U=s.useRef(!1),C=s.useRef(null),[O,V]=s.useState(!1),{appear:se,triggers:ie,slider:N,thumbnail:de,controls:X,area:ce,caption:oe,layout:fe}=o.lightboxBlock,{appearClass:Pe,backdropAppearClass:xe,backdropDisappearClass:pe,disappearClass:Z}=_h(se.type,se.direction),le=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const h=()=>{setTimeout(()=>{var Y,ee;(ee=(Y=T.current)==null?void 0:Y.splide)==null||ee.refresh()},16)},q=()=>{S(Y=>Y+1)};return window.addEventListener("ArticleEditor.Layout:change",h),window.addEventListener("ArticleEditor.ComponentContent:change",q),()=>{window.removeEventListener("ArticleEditor.Layout:change",h),window.removeEventListener("ArticleEditor.ComponentContent:change",q)}},[]),s.useEffect(()=>{if(!e||!de.isActive){V(!1);return}const h=C.current;if(!h)return;const q=()=>{N.direction==="horiz"?V(h.scrollWidth>h.clientWidth):V(h.scrollHeight>h.clientHeight)};q();const Y=new ResizeObserver(q);return Y.observe(h),()=>Y.disconnect()},[e,de.isActive,n.length,M,N.direction]);const re=s.useCallback(()=>{const h=window.matchMedia("(max-width: 768px)").matches,q=F.getColorAlpha(ce.color);h&&!l&&q>.9&&(document.body.style.backgroundColor=""),D(!0),z.current=!0;const Y=ee=>{ee.target===$.current&&ee.animationName&&($.current&&k.current&&$.current.removeEventListener("animationend",k.current),k.current=null,z.current&&(z.current=!1,t()),D(!1))};$.current&&(k.current=Y,$.current.addEventListener("animationend",Y))},[t,ce.color,l]),Ie=(h,q,Y)=>{var ee,ve;if(h){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&x===n.length-1?re():(ee=T.current)==null||ee.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const B=h.getBoundingClientRect(),I=q-B.left,Q=Y-B.top,ne=B.width,H=B.height;let te;N.direction==="horiz"?te=I<ne/2?"-1":"+1":te=Q<H/2?"-1":"+1",(ve=T.current)==null||ve.go(te)}}},we=h=>{if(U.current){U.current=!1;return}const q=n[x],Y=(q==null?void 0:q.image.objectFit)==="cover";let ee,ve;if("changedTouches"in h&&h.changedTouches.length>0)ee=h.changedTouches[0].clientX,ve=h.changedTouches[0].clientY;else if("clientX"in h)ee=h.clientX,ve=h.clientY;else return;let B;if(Y&&_.current){const I=Ql(_.current);B=ee>=I.left&&ee<=I.right&&ve>=I.top&&ve<=I.bottom}else{const I=_.current?pa(_.current):null;if(!I){h.target===h.currentTarget&&re();return}B=ee>=I.x&&ee<=I.x+I.width&&ve>=I.y&&ve<=I.y+I.height}B?Ie(_.current,ee,ve):re()},Me=h=>{const q=h.target;(q.classList.contains(at.thumbsWrapper)||q.classList.contains(at.thumbsContainer))&&we(h)};s.useEffect(()=>{if(!e)return;const h=q=>{var Y,ee;if(q.key==="Escape"){re();return}if(q.key==="ArrowRight"){R(ve=>(ve+1)%Math.max(n.length,1)),(Y=T.current)==null||Y.go("+1");return}q.key==="ArrowLeft"&&(R(ve=>(ve-1+Math.max(n.length,1))%Math.max(n.length,1)),(ee=T.current)==null||ee.go("-1"))};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[e,re,n.length]),s.useEffect(()=>{if(e){if(R(0),S(q=>q+1),z.current=!1,D(!1),P(!1),K({}),!le)return;const h=new CustomEvent("page-overlay",{detail:{itemId:le}});window.dispatchEvent(h)}return()=>{$.current&&k.current&&($.current.removeEventListener("animationend",k.current),k.current=null),P(!1)}},[e,le]),s.useEffect(()=>{L.current!==null&&L.current!==N.type&&S(h=>h+1),L.current=N.type},[N.type]),s.useEffect(()=>{if(!e)return;const h=document.body.style.overflow,q=window.matchMedia("(max-width: 768px)").matches,Y=F.getColorAlpha(ce.color);document.body.style.overflow="hidden",P(!1);const ee=B=>{B.target===$.current&&!z.current&&B.animationName&&(q&&!l&&Y>.9&&(document.body.style.backgroundColor=ce.color),P(!0),$.current&&W.current&&$.current.removeEventListener("animationend",W.current),W.current=null)};$.current&&(W.current=ee,$.current.addEventListener("animationend",ee));const ve=B=>{const I=B.target;I&&(I.closest(`.${at.thumbsWrapper}`)||I.closest(`.${at.thumbsContainer}`))||N.type!=="slide"&&B.preventDefault()};return document.addEventListener("touchmove",ve,{passive:!1}),()=>{document.body.style.overflow=h,document.removeEventListener("touchmove",ve),$.current&&W.current&&($.current.removeEventListener("animationend",W.current),W.current=null),P(!1)}},[e,l,ce.color,N.type]),s.useEffect(()=>{if(!e)return;const h=q=>{var ee,ve;if(z.current){q.stopPropagation();return}if(U.current){U.current=!1;return}const Y=q.target;if(!(Y&&(Y.closest(`.${at.thumbsContainer}`)||Y.closest(`.${at.thumbItem}`)||Y.closest(`.${at.arrow}`)||Y.closest(`.${at.closeButton}`)||Y.closest(`.${at.caption}`)))){if(N.type==="slide"&&ie.type==="drag"&&((ve=(ee=T.current)==null?void 0:ee.splide)!=null&&ve.root)){const B=T.current.splide.root;if(Y&&(B.contains(Y)||B===Y))return}if(q.touches.length===0&&q.changedTouches.length>0){const B=n[x],I=(B==null?void 0:B.image.objectFit)==="cover",Q=q.changedTouches[0];let ne;if(I&&_.current){const H=Ql(_.current);ne=Q.clientX>=H.left&&Q.clientX<=H.right&&Q.clientY>=H.top&&Q.clientY<=H.bottom}else{const H=_.current?pa(_.current):null;if(!H)return;ne=Q.clientX>=H.x&&Q.clientX<=H.x+H.width&&Q.clientY>=H.y&&Q.clientY<=H.y+H.height}if(!ne){q.stopPropagation(),z.current=!0;const H=te=>{te.stopPropagation(),te.preventDefault(),document.removeEventListener("click",H,!0)};document.addEventListener("click",H,!0),re()}}}};return document.addEventListener("touchend",h,{passive:!0}),()=>{document.removeEventListener("touchend",h)}},[e,re,x,n]);const ye=(N.type==="scale"||N.type==="fade")&&N.direction==="vert"&&ie.type==="drag";s.useEffect(()=>{var te,ke;if(!e||!ye||!((ke=(te=T.current)==null?void 0:te.splide)!=null&&ke.root))return;const h=T.current.splide.root,q=30,Y=(ge,J)=>{if(w.current){const Ye=Math.abs(ge-w.current.x),je=Math.abs(J-w.current.y);(Ye>0||je>0)&&(U.current=!0)}},ee=ge=>{w.current&&(ge.preventDefault(),Y(ge.clientX,ge.clientY))},ve=ge=>{w.current&&ge.touches.length>0&&(ge.preventDefault(),Y(ge.touches[0].clientX,ge.touches[0].clientY))},B=(ge,J)=>{if(!w.current||!T.current){w.current=null;return}const Ye=Math.abs(ge-w.current.x),je=Math.abs(J-w.current.y);je>q&&je>Ye&&T.current.go(J<w.current.y?"+1":"-1"),w.current=null},I=ge=>{w.current&&B(ge.clientX,ge.clientY),document.removeEventListener("pointerup",I),document.removeEventListener("pointercancel",I),document.removeEventListener("pointermove",ee)},Q=ge=>{if(w.current){if(ge.changedTouches.length>0){const J=ge.changedTouches[0];B(J.clientX,J.clientY)}document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),document.removeEventListener("touchmove",ve)}},ne=ge=>{w.current={x:ge.clientX,y:ge.clientY},U.current=!1,document.addEventListener("pointermove",ee,{passive:!1}),document.addEventListener("pointerup",I),document.addEventListener("pointercancel",I)},H=ge=>{ge.touches.length>0&&(w.current={x:ge.touches[0].clientX,y:ge.touches[0].clientY},U.current=!1,document.addEventListener("touchmove",ve,{passive:!1}),document.addEventListener("touchend",Q),document.addEventListener("touchcancel",Q))};return h.addEventListener("pointerdown",ne),h.addEventListener("touchstart",H),()=>{h.removeEventListener("pointerdown",ne),h.removeEventListener("touchstart",H),document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",I),document.removeEventListener("pointercancel",I),document.removeEventListener("touchmove",ve),document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),w.current=null,U.current=!1}},[e,ye,b]);const be={backgroundColor:ce.color,backdropFilter:`blur(${ce.blur}px)`,animationDuration:`${parseInt(se.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:ai.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:$,className:Ct(at.background,G?pe:xe,{[at.editor]:l},{[at.hidden]:!e}),style:{...be,...j&&!l&&!G?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?$:null,className:Ct(at.contentStyle,G?Z:Pe,{[at.editor]:l},{[at.hidden]:!e}),style:{animationDuration:`${parseInt(se.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(xl,{onMove:h=>R(h.index),ref:T,className:at.lightboxSplide,options:{arrows:!1,speed:N.duration?parseInt(N.duration):500,direction:N.direction==="horiz"||N.type==="fade"||N.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!ye,perPage:1,width:"100%",height:"100%",type:N.type==="fade"||N.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":N.duration},children:n.map((h,q)=>{const Y=Mr(fe.position,fe.offset,l),ee=`${F.scalingValue(fe.padding.top,l)} ${F.scalingValue(fe.padding.right,l)} ${F.scalingValue(fe.padding.bottom,l)} ${F.scalingValue(fe.padding.left,l)}`,ve=N.type==="scale"?(()=>{const{transform:B,...I}=Y;return{...I,position:"absolute",padding:ee,boxSizing:"border-box","--position-transform":B||"none"}})():{...Y,position:"absolute",padding:ee,boxSizing:"border-box"};return a.jsx(bl,{children:a.jsx("div",{className:at.imgWrapper,onClick:we,children:a.jsx("img",{ref:q===x?_:null,className:Ct(at.imageStyle,{[at.contain]:h.image.objectFit==="contain",[at.cover]:h.image.objectFit==="cover",[at.scaleSlide]:N.type==="scale"}),src:h.image.url,alt:h.image.name??"",style:{...ve,pointerEvents:h.image.objectFit==="contain"?"none":"auto"}})})},q)})},b),X.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(at.arrow,{[at.arrowVertical]:N.direction==="vert"}),style:{color:X.color,"--arrow-hover-color":X.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${F.scalingValue(X.offset.x,l)}, ${F.scalingValue(X.offset.y*(N.direction==="horiz"?1:-1),l)}) scale(${X.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=T.current)==null?void 0:h.go("-1")},"aria-label":"Previous",children:[X.arrowsImgUrl&&a.jsx(pn,{url:X.arrowsImgUrl,fill:X.color,hoverFill:X.hover,className:Ct(at.arrowImg,at.mirror)}),!X.arrowsImgUrl&&a.jsx(ec,{color:X.color,className:Ct(at.arrowIcon,at.arrowImg,at.mirror)})]})}),a.jsx("div",{className:Ct(at.arrow,at.nextArrow,{[at.arrowVertical]:N.direction==="vert"}),style:{color:X.color,"--arrow-hover-color":X.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${F.scalingValue(X.offset.x*(N.direction==="horiz"?-1:1),l)}, ${F.scalingValue(X.offset.y,l)}) scale(${X.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=T.current)==null?void 0:h.go("+1")},"aria-label":"Next",children:[X.arrowsImgUrl&&a.jsx(pn,{url:X.arrowsImgUrl,fill:X.color,hoverFill:X.hover,className:at.arrowImg}),!X.arrowsImgUrl&&a.jsx(ec,{color:X.color,className:Ct(at.arrowIcon,at.arrowImg)})]})})]}),ce.closeIconUrl&&(()=>{const h=Mr(ce.closeIconAlign,ce.closeIconOffset,l),q=`scale(${ce.closeIconScale})`,Y=h.transform?`${h.transform} ${q}`:q;return a.jsx("button",{className:at.closeButton,style:{...h,transform:Y},onClick:re,"aria-label":"Close lightbox",children:a.jsx(pn,{url:ce.closeIconUrl,fill:ce.closeIconColor??"#000000",hoverFill:ce.closeIconHover??"#cccccc"})})})(),oe&&oe.isActive&&i.imageCaption&&((Ce=n[x])==null?void 0:Ce.imageCaption)&&a.jsx("div",{className:at.caption,style:{...Mr(oe.alignment,oe.offset,l),fontFamily:zo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":F.scalingValue(c.width,l),letterSpacing:F.scalingValue(p,l),wordSpacing:F.scalingValue(y,l),textAlign:v,fontSize:F.scalingValue(m.fontSize,l),lineHeight:F.scalingValue(m.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:f},onClick:h=>h.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:at.captionTextInner,style:{"--link-color":oe.linkColor,"--link-hover-color":oe.linkHoverColor},children:a.jsx(Ki,{content:n[x].imageCaption})})}),de.isActive&&(()=>{const[h,q]=de.position.split("-"),Y=N.direction==="horiz"?`${h}-left`:de.position,ee=Mr(Y,de.offset,l),ve=()=>{if(N.direction==="horiz"){if(q==="left")return"flex-start";if(q==="center")return"center";if(q==="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:C,className:at.thumbsWrapper,onClick:B=>Me(B),style:{position:l?"absolute":"fixed",...ee,...N.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]:N.direction==="vert",[at.thumbsAlignStart]:de.align==="start",[at.thumbsAlignCenter]:de.align==="center",[at.thumbsAlignEnd]:de.align==="end"}),style:{gap:F.scalingValue(de.grid.gap,l),justifyContent:O?"flex-start":ve()},children:n.map((B,I)=>{const Q=I===x,ne=M[I],te=de.grid.size*(Q?de.activeState.scale:1),ke=()=>{if(de.fit!=="fit")return{};if(!ne)return N.direction==="horiz"?{height:F.scalingValue(te,l)}:{width:F.scalingValue(te,l)};const ge=ne.width/ne.height;if(N.direction==="horiz"){const J=te,Ye=J*ge;return{width:F.scalingValue(Ye,l),height:F.scalingValue(J,l)}}else{const J=te,Ye=J/ge;return{width:F.scalingValue(J,l),height:F.scalingValue(Ye,l)}}};return a.jsx("button",{className:at.thumbItem,style:{...N.direction==="horiz"&&de.fit!=="fit"?{height:F.scalingValue(te,l)}:{},...N.direction==="vert"&&de.fit!=="fit"?{width:F.scalingValue(te,l)}:{},...de.fit==="cover"?{width:F.scalingValue(te,l),height:F.scalingValue(te,l)}:{},...ke(),transition:Q?"all 0.25s ease-out":"none",opacity:Q?de.activeState.opacity/100:de.opacity/100,"--thumb-hover":de.activeState.opacity/100},onClick:ge=>{var J;ge.stopPropagation(),R(I),(J=T.current)==null||J.go(I)},onMouseEnter:()=>{var ge;de.triggers==="hov"&&((ge=T.current)==null||ge.go(I))},children:a.jsx("img",{src:B.image.url,alt:B.image.name??"",onLoad:ge=>{const J=ge.currentTarget;J.naturalWidth&&J.naturalHeight&&K(Ye=>({...Ye,[I]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:de.fit==="cover"?"cover":"contain",...de.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...de.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${B.image.name}-${I}`)})})})})()]})]}),document.getElementById(r))};function ec({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 Oh={element:Wh,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function Ar(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Dh(e){return`
|
|
6
|
+
*/const kg="RichTextRenderer-module__link___BWeZ2",Eg={link:kg},Mg=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=>Mg(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function dn(e){const{color:t,...n}=e;return n}function Qt(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:N.scalingValue(e.letterSpacing,t),wordSpacing:N.scalingValue(e.wordSpacing,t),fontSize:N.scalingValue(n,t),lineHeight:i!==void 0?N.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Ki=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Eg.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Ag(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:t(o)},i)})})};function Ag(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 Fg="SvgImage-module__svg___q3xE-",Ng="SvgImage-module__img___VsTm-",Kl={svg:Fg,img:Ng},_g=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Wg=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,pn=({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("")'));return s.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!_g(e)||!r?a.jsx("img",{src:e,alt:"",className:Ct(Kl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:Ct(Kl.svg,i),style:{"--svg":Wg(e),"--fill":t,"--hover-fill":n,...o??{}}})},Hg={"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 Og({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:x,textAppearance:v,color:m}=n.imageCaption??{},[g,h]=s.useState(void 0),[b,E]=s.useState(null),[y,w]=s.useState(0),[j,G]=s.useState(0),{direction:A,transition:P,controls:W,pagination:Y,imageCaption:$,triggers:I}=e,H=s.useRef(P.type),{x:O,y:C}=e.controls.offset,L=D=>{o&&o.go(D)};return s.useEffect(()=>{if(!b)return;const D=new ResizeObserver(S=>{if(!o)return;const[U]=S;h({width:Math.round(U.contentRect.width),height:Math.round(U.contentRect.height)})});return D.observe(b),()=>D.unobserve(b)},[b]),s.useEffect(()=>{!o||H.current===P.type||(G(D=>D+1),H.current=P.type)},[P.type]),a.jsx("div",{className:Ct($t.wrapper,{[$t.editor]:i}),ref:E,children:a.jsxs("div",{className:$t.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:P.backgroundColor&&P.type==="fade in"?P.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:Ct($t.captionBlock),children:a.jsx("div",{className:$t.captionTextWrapper,children:t.map((D,S)=>a.jsx("div",{className:Ct($t.captionText,Hg[$.alignment],{[$t.withPointerEvents]:S===y&&i,[$t.active]:S===y}),style:{fontFamily:zo(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":N.scalingValue(l.width,i),letterSpacing:N.scalingValue(c,i),wordSpacing:N.scalingValue(p,i),textAlign:u,fontSize:N.scalingValue(x.fontSize,i),lineHeight:N.scalingValue(x.lineHeight,i),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:m,transitionDuration:P.duration?`${Math.round(parseInt(P.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:N.scalingValue($.offset.y,i),left:N.scalingValue($.offset.x,i)},children:a.jsx(Ki,{content:D.imageCaption})})},S))})}),a.jsx(xl,{onMove:D=>{w(D.index)},ref:r,options:{arrows:!1,speed:P.duration?parseInt(P.duration):500,autoplay:I.autoPlay!==null,...I.autoPlay!==null&&{interval:parseInt(I.autoPlay)*1e3},direction:A==="horiz"||P.type==="fade in"?"ltr":"ttb",pagination:!1,drag:I.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:P.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((D,S)=>a.jsx(bl,{children:a.jsx("div",{className:$t.sliderItem,children:a.jsx("div",{className:$t.imgWrapper,children:a.jsx("img",{className:Ct($t.sliderImage,{[$t.contain]:D.image.objectFit==="contain",[$t.cover]:D.image.objectFit==="cover"}),src:D.image.url,alt:D.image.name??""})})})},S))},j),W.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct($t.arrow,{[$t.arrowVertical]:A==="vert",[$t.hoverArrow]:W.show==="on hover"}),style:{color:W.color,"--arrow-hover-color":W.hover},children:a.jsxs("button",{onClick:()=>{L("-1")},className:$t.arrowInner,style:{transform:`translate(${N.scalingValue(O,i)}, ${N.scalingValue(C*(A==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${A==="horiz"?"0deg":"90deg"})`},children:[W.arrowsImgUrl&&a.jsx(pn,{url:W.arrowsImgUrl,fill:W.color,hoverFill:W.hover,className:Ct($t.arrowImg,$t.mirror)}),!W.arrowsImgUrl&&a.jsx(Zl,{color:W.color,className:Ct($t.arrowIcon,$t.arrowImg,$t.mirror)})]})}),a.jsx("div",{className:Ct($t.arrow,$t.nextArrow,{[$t.arrowVertical]:A==="vert",[$t.hoverArrow]:W.show==="on hover"}),style:{color:W.color,"--arrow-hover-color":W.hover},children:a.jsxs("button",{className:$t.arrowInner,onClick:()=>L("+1"),style:{transform:`translate(${N.scalingValue(O*(A==="horiz"?-1:1),i)}, ${N.scalingValue(C,i)}) scale(${e.controls.scale/100}) rotate(${A==="horiz"?"0deg":"90deg"})`},children:[W.arrowsImgUrl&&a.jsx(pn,{url:W.arrowsImgUrl,fill:W.color,hoverFill:W.hover,className:$t.arrowImg}),!W.arrowsImgUrl&&a.jsx(Zl,{color:W.color,className:Ct($t.arrowIcon,$t.arrowImg)})]})})]}),I.triggersList.click&&a.jsx("div",{className:$t.clickOverlay,onClick:()=>{o&&o.go("+1")}}),Y.isActive&&a.jsx("div",{className:Ct($t.pagination,{[$t.paginationInsideBottom]:Y.position==="inside-1"&&A==="horiz",[$t.paginationInsideTop]:Y.position==="inside-2"&&A==="horiz",[$t.paginationOutsideBottom]:Y.position==="outside-1"&&A==="horiz",[$t.paginationOutsideTop]:Y.position==="outside-2"&&A==="horiz",[$t.paginationInsideLeft]:Y.position==="inside-1"&&A==="vert",[$t.paginationInsideRight]:Y.position==="inside-2"&&A==="vert",[$t.paginationOutsideLeft]:Y.position==="outside-1"&&A==="vert",[$t.paginationOutsideRight]:Y.position==="outside-2"&&A==="vert",[$t.paginationVertical]:A==="vert"}),children:a.jsx("div",{className:$t.paginationInner,style:{backgroundColor:Y.colors[2],transform:`scale(${Y.scale/100}) translate(${N.scalingValue(Y.offset.x,i)}, ${N.scalingValue(Y.offset.y,i)}) rotate(${A==="horiz"?"0deg":"90deg"})`},children:t.map((D,S)=>a.jsx("button",{onClick:()=>{o&&o.go(S)},className:Ct($t.paginationItem),children:a.jsx("div",{className:Ct($t.dot,{[$t.activeDot]:S===y}),style:{backgroundColor:S===y?Y.colors[0]:Y.colors[1],"--pagination-hover-color":Y.hover}})},S))})})]})})}function Zl({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 Dg={element:Og,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},zg="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Bg="ImageRevealSlider-module__image___Qjt-e",jg="ImageRevealSlider-module__link___N-iLG",Vg="ImageRevealSlider-module__cursor___2U03d",no={imageRevealSlider:zg,image:Bg,link:jg,cursor:Vg};function Jl(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,d=r/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function Ba(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Gg(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await Ba(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Ba(e);r=l.height/l.width*o}else{const l=await Ba(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Xg({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[d,c]=s.useState(0),u=s.useRef(0),[p,x]=s.useState({x:0,y:0}),[v,m]=s.useState(1),[g,h]=s.useState("none"),b=s.useRef({x:0,y:0}),[E,y]=s.useState(!1),{sizeType:w,imageWidth:j,randomRangeImageWidth:G}=e.imageSize,{revealPosition:A,visible:P}=e.position,{cursorType:W,target:Y,defaultCursorScale:$,defaultCursor:I,hoverCursorScale:H,hoverCursor:O}=e.cursor;s.useEffect(()=>{if(!i)return;const D=(T,_)=>{const B=i.getBoundingClientRect(),ae=T-B.left,ie=_-B.top;if(x({x:ae,y:ie}),W==="system"){h("none"),m(1);return}const k=ae,ue=ie,X=document.elementFromPoint(B.left+k,B.top+ue);if(X&&X.closest("a")){h("none"),m(1);return}const le=Jl(k,ue,r)||Y==="area"?{img:O??"none",scale:H}:{img:I??"none",scale:$};h(le.img),m(le.scale)},S=T=>{T.stopPropagation(),b.current={x:T.clientX,y:T.clientY},D(T.clientX,T.clientY)},U=()=>{E&&D(b.current.x,b.current.y)};return i.addEventListener("mousemove",S),window.addEventListener("scroll",U,!0),()=>{i.removeEventListener("mousemove",S),window.removeEventListener("scroll",U,!0)}},[i,E,p,W,Y,O,I,H,$,r]),s.useEffect(()=>{E||(h("none"),m(0))},[E]);const C=async(D,S,U,T={})=>{const{width:_,height:B,finalWidth:ae}=await Gg(D.image.url,w,j,G);let ie=0,k=0;A==="same"?(ie=S/2,k=U/2):(ie=T.x??Math.random()*S,k=T.y??Math.random()*U);const ue=Math.min(Math.max(ie,_/2),S-_/2),X=Math.min(Math.max(k,B/2),U-B/2);return{id:u.current++,url:D.image.url,link:D.link,name:D.image.name,x:ue,y:X,width:ae}};s.useEffect(()=>{if(!i||t.length===0)return;const D=i.getBoundingClientRect(),S=D.width,U=D.height,T=[];(async()=>{const B=t[0],ae=await C(B,S,U);T.push(ae),l(T),c(1)})()},[w,j,G,A,i]),s.useEffect(()=>{P==="last One"&&l(D=>D.length>0?[D[D.length-1]]:[])},[P]);const L=async D=>{if(!i)return;const S=i.getBoundingClientRect(),U=D.clientX-S.left,T=D.clientY-S.top;if(Y==="image"&&!Jl(U,T,r))return;let _=0,B=0;A==="on Click"?(_=U,B=T):A==="same"?(_=S.width/2,B=S.height/2):(_=Math.random()*S.width,B=Math.random()*S.height);const ae=t[d],ie=await C(ae,S.width,S.height,{x:_,y:B});l(k=>P==="all"?[...k,ie]:[ie]),c(k=>k>=t.length-1?0:k+1)};return a.jsxs("div",{ref:o,onClick:L,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:no.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[r.map(D=>a.jsx("div",{className:no.wrapper,style:{top:`${D.y}px`,left:`${D.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:D.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:Y==="area"&&D.link?a.jsx("a",{href:D.link,target:"_blank",className:no.link,children:a.jsx("img",{src:D.url,alt:D.name,className:no.image},D.id)}):a.jsx("img",{src:D.url,alt:D.name,className:no.image},D.id)},D.id)),E&&a.jsx("div",{className:no.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const qg={element:Xg,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},Ug="LightBox-module__hidden___9s-9x",Yg="LightBox-module__heroImage___sTxNF",Kg="LightBox-module__background___rm9ml",Zg="LightBox-module__editor___4ACaY",Jg="LightBox-module__contentStyle___Bgnsq",Qg="LightBox-module__imageStyle___tLIlB",eh="LightBox-module__imgWrapper___LuFUp",th="LightBox-module__contain___8-yaS",nh="LightBox-module__cover___hNvOG",ih="LightBox-module__caption___b6L2I",oh="LightBox-module__captionTextInner___rCGNH",rh="LightBox-module__lightboxSplide___XFuWC",ah="LightBox-module__arrow___iz38X",sh="LightBox-module__arrowVertical___Zfz81",lh="LightBox-module__nextArrow___zkAQN",ch="LightBox-module__arrowInner___p48sW",dh="LightBox-module__arrowIcon___3VaFf",uh="LightBox-module__arrowImg___pNV88",ph="LightBox-module__mirror___pjeXc",mh="LightBox-module__thumbsWrapper___GB-nU",gh="LightBox-module__thumbsContainerVertical___wttk5",hh="LightBox-module__thumbsContainer___osSma",fh="LightBox-module__thumbsAlignStart___MO6tY",yh="LightBox-module__thumbsAlignCenter___Q4sUx",vh="LightBox-module__thumbsAlignEnd___p4y9R",xh="LightBox-module__thumbItem___HvnF3",bh="LightBox-module__closeButton___g2khP",Sh="LightBox-module__fadeIn___0m5GW",wh="LightBox-module__slideInLeft___gPYwC",$h="LightBox-module__slideInRight___S-pPp",Ch="LightBox-module__slideInTop___DFdAj",Th="LightBox-module__slideInBottom___m27kZ",Lh="LightBox-module__fadeOut___55qBR",Ih="LightBox-module__slideOutLeft___NvU7P",Rh="LightBox-module__slideOutRight___SK7eC",Ph="LightBox-module__slideOutTop___Vgg0z",kh="LightBox-module__slideOutBottom___nJ0Ef",Eh="LightBox-module__scaleSlide___vZriG",rt={hidden:Ug,heroImage:Yg,background:Kg,editor:Zg,contentStyle:Jg,imageStyle:Qg,imgWrapper:eh,contain:th,cover:nh,caption:ih,captionTextInner:oh,lightboxSplide:rh,arrow:ah,arrowVertical:sh,nextArrow:lh,arrowInner:ch,arrowIcon:dh,arrowImg:uh,mirror:ph,thumbsWrapper:mh,thumbsContainerVertical:gh,thumbsContainer:hh,thumbsAlignStart:fh,thumbsAlignCenter:yh,thumbsAlignEnd:vh,thumbItem:xh,closeButton:bh,fadeIn:Sh,slideInLeft:wh,slideInRight:$h,slideInTop:Ch,slideInBottom:Th,fadeOut:Lh,slideOutLeft:Ih,slideOutRight:Rh,slideOutTop:Ph,slideOutBottom:kh,scaleSlide:Eh},Mr=(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% + ${N.scalingValue(t.x,n)}), calc(-50% + ${N.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${N.scalingValue(t.x,n)}, calc(-50% + ${N.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${N.scalingValue(t.x,n)}), ${N.scalingValue(t.y,n)})`:i.transform=`translate(${N.scalingValue(t.x,n)}, ${N.scalingValue(t.y,n)})`,i};function xu(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 Mh(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 bu(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 d=e;return{renderedW:d,renderedH:d/r}}const l=t;return{renderedW:l*r,renderedH:l}}function Ah(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 d=t;return{renderedW:d*r,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/r}}function Su(e,t,n,i,o){const{x:r,y:l}=Mh(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Fh(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:d}=window.getComputedStyle(e),c=l==="cover"?Ah:bu,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:x,offsetY:v}=Su(n,i,u,p,d),m=(x+u/2)/n*100,g=(v+p/2)/i*100;return`${m}% ${g}%`}function Nh(e){return Fh(e)}function pa(e){const t=e.getBoundingClientRect(),n=xu(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:d,renderedH:c}=bu(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:x}=Su(i,o,d,c,u),v=t.left+n.left,m=t.top+n.top;return{x:p+v,y:x+m,width:d,height:c}}function Ql(e){const t=e.getBoundingClientRect(),n=xu(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function _h(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 Wh=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[d,c]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:rt.heroImage,onClick:()=>c(!0)}),a.jsx(Hh,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Hh=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var Ce;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:x,wordSpacing:v,fontSizeLineHeight:m,textAppearance:g,color:h}=i.imageCaption??{},[b,E]=s.useState(0),[y,w]=s.useState(0),[j,G]=s.useState(!1),[A,P]=s.useState(!1),[W,Y]=s.useState({}),$=s.useRef(null),I=s.useRef(null),H=s.useRef(null),O=s.useRef(!1),C=s.useRef(null),L=s.useRef(null),D=s.useRef(null),S=s.useRef(null),U=s.useRef(!1),T=s.useRef(null),[_,B]=s.useState(!1),{appear:ae,triggers:ie,slider:k,thumbnail:ue,controls:X,area:le,caption:te,layout:we}=o.lightboxBlock,{appearClass:ke,backdropAppearClass:fe,backdropDisappearClass:me,disappearClass:Z}=_h(ae.type,ae.direction),se=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const f=()=>{setTimeout(()=>{var K,ne;(ne=(K=$.current)==null?void 0:K.splide)==null||ne.refresh()},16)},q=()=>{w(K=>K+1)};return window.addEventListener("ArticleEditor.Layout:change",f),window.addEventListener("ArticleEditor.ComponentContent:change",q),()=>{window.removeEventListener("ArticleEditor.Layout:change",f),window.removeEventListener("ArticleEditor.ComponentContent:change",q)}},[]),s.useEffect(()=>{if(!e||!ue.isActive){B(!1);return}const f=T.current;if(!f)return;const q=()=>{k.direction==="horiz"?B(f.scrollWidth>f.clientWidth):B(f.scrollHeight>f.clientHeight)};q();const K=new ResizeObserver(q);return K.observe(f),()=>K.disconnect()},[e,ue.isActive,n.length,W,k.direction]);const oe=s.useCallback(()=>{const f=window.matchMedia("(max-width: 768px)").matches,q=N.getColorAlpha(le.color);f&&!l&&q>.9&&(document.body.style.backgroundColor=""),G(!0),O.current=!0;const K=ne=>{ne.target===C.current&&ne.animationName&&(C.current&&L.current&&C.current.removeEventListener("animationend",L.current),L.current=null,O.current&&(O.current=!1,t()),G(!1))};C.current&&(L.current=K,C.current.addEventListener("animationend",K))},[t,le.color,l]),Pe=(f,q,K)=>{var ne,ge;if(f){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&b===n.length-1?oe():(ne=$.current)==null||ne.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const z=f.getBoundingClientRect(),R=q-z.left,Q=K-z.top,ee=z.width,ce=z.height;let V;k.direction==="horiz"?V=R<ee/2?"-1":"+1":V=Q<ce/2?"-1":"+1",(ge=$.current)==null||ge.go(V)}}},$e=f=>{if(U.current){U.current=!1;return}const q=n[b],K=(q==null?void 0:q.image.objectFit)==="cover";let ne,ge;if("changedTouches"in f&&f.changedTouches.length>0)ne=f.changedTouches[0].clientX,ge=f.changedTouches[0].clientY;else if("clientX"in f)ne=f.clientX,ge=f.clientY;else return;let z;if(K&&H.current){const R=Ql(H.current);z=ne>=R.left&&ne<=R.right&&ge>=R.top&&ge<=R.bottom}else{const R=H.current?pa(H.current):null;if(!R){f.target===f.currentTarget&&oe();return}z=ne>=R.x&&ne<=R.x+R.width&&ge>=R.y&&ge<=R.y+R.height}z?Pe(H.current,ne,ge):oe()},Me=f=>{const q=f.target;(q.classList.contains(rt.thumbsWrapper)||q.classList.contains(rt.thumbsContainer))&&$e(f)};s.useEffect(()=>{if(!e)return;const f=q=>{var K,ne;if(q.key==="Escape"){oe();return}if(q.key==="ArrowRight"){E(ge=>(ge+1)%Math.max(n.length,1)),(K=$.current)==null||K.go("+1");return}q.key==="ArrowLeft"&&(E(ge=>(ge-1+Math.max(n.length,1))%Math.max(n.length,1)),(ne=$.current)==null||ne.go("-1"))};return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}},[e,oe,n.length]),s.useEffect(()=>{if(e){if(E(0),w(q=>q+1),O.current=!1,G(!1),P(!1),Y({}),!se)return;const f=new CustomEvent("page-overlay",{detail:{itemId:se}});window.dispatchEvent(f)}return()=>{C.current&&L.current&&(C.current.removeEventListener("animationend",L.current),L.current=null),P(!1)}},[e,se]),s.useEffect(()=>{I.current!==null&&I.current!==k.type&&w(f=>f+1),I.current=k.type},[k.type]),s.useEffect(()=>{if(!e)return;const f=document.body.style.overflow,q=window.matchMedia("(max-width: 768px)").matches,K=N.getColorAlpha(le.color);document.body.style.overflow="hidden",P(!1);const ne=z=>{z.target===C.current&&!O.current&&z.animationName&&(q&&!l&&K>.9&&(document.body.style.backgroundColor=le.color),P(!0),C.current&&D.current&&C.current.removeEventListener("animationend",D.current),D.current=null)};C.current&&(D.current=ne,C.current.addEventListener("animationend",ne));const ge=z=>{const R=z.target;R&&(R.closest(`.${rt.thumbsWrapper}`)||R.closest(`.${rt.thumbsContainer}`))||k.type!=="slide"&&z.preventDefault()};return document.addEventListener("touchmove",ge,{passive:!1}),()=>{document.body.style.overflow=f,document.removeEventListener("touchmove",ge),C.current&&D.current&&(C.current.removeEventListener("animationend",D.current),D.current=null),P(!1)}},[e,l,le.color,k.type]),s.useEffect(()=>{if(!e)return;const f=q=>{var ne,ge;if(O.current){q.stopPropagation();return}if(U.current){U.current=!1;return}const K=q.target;if(!(K&&(K.closest(`.${rt.thumbsContainer}`)||K.closest(`.${rt.thumbItem}`)||K.closest(`.${rt.arrow}`)||K.closest(`.${rt.closeButton}`)||K.closest(`.${rt.caption}`)))){if(k.type==="slide"&&ie.type==="drag"&&((ge=(ne=$.current)==null?void 0:ne.splide)!=null&&ge.root)){const z=$.current.splide.root;if(K&&(z.contains(K)||z===K))return}if(q.touches.length===0&&q.changedTouches.length>0){const z=n[b],R=(z==null?void 0:z.image.objectFit)==="cover",Q=q.changedTouches[0];let ee;if(R&&H.current){const ce=Ql(H.current);ee=Q.clientX>=ce.left&&Q.clientX<=ce.right&&Q.clientY>=ce.top&&Q.clientY<=ce.bottom}else{const ce=H.current?pa(H.current):null;if(!ce)return;ee=Q.clientX>=ce.x&&Q.clientX<=ce.x+ce.width&&Q.clientY>=ce.y&&Q.clientY<=ce.y+ce.height}if(!ee){q.stopPropagation(),O.current=!0;const ce=V=>{V.stopPropagation(),V.preventDefault(),document.removeEventListener("click",ce,!0)};document.addEventListener("click",ce,!0),oe()}}}};return document.addEventListener("touchend",f,{passive:!0}),()=>{document.removeEventListener("touchend",f)}},[e,oe,b,n]);const ye=(k.type==="scale"||k.type==="fade")&&k.direction==="vert"&&ie.type==="drag";s.useEffect(()=>{var V,Le;if(!e||!ye||!((Le=(V=$.current)==null?void 0:V.splide)!=null&&Le.root))return;const f=$.current.splide.root,q=30,K=(ve,J)=>{if(S.current){const _e=Math.abs(ve-S.current.x),Be=Math.abs(J-S.current.y);(_e>0||Be>0)&&(U.current=!0)}},ne=ve=>{S.current&&(ve.preventDefault(),K(ve.clientX,ve.clientY))},ge=ve=>{S.current&&ve.touches.length>0&&(ve.preventDefault(),K(ve.touches[0].clientX,ve.touches[0].clientY))},z=(ve,J)=>{if(!S.current||!$.current){S.current=null;return}const _e=Math.abs(ve-S.current.x),Be=Math.abs(J-S.current.y);Be>q&&Be>_e&&$.current.go(J<S.current.y?"+1":"-1"),S.current=null},R=ve=>{S.current&&z(ve.clientX,ve.clientY),document.removeEventListener("pointerup",R),document.removeEventListener("pointercancel",R),document.removeEventListener("pointermove",ne)},Q=ve=>{if(S.current){if(ve.changedTouches.length>0){const J=ve.changedTouches[0];z(J.clientX,J.clientY)}document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),document.removeEventListener("touchmove",ge)}},ee=ve=>{S.current={x:ve.clientX,y:ve.clientY},U.current=!1,document.addEventListener("pointermove",ne,{passive:!1}),document.addEventListener("pointerup",R),document.addEventListener("pointercancel",R)},ce=ve=>{ve.touches.length>0&&(S.current={x:ve.touches[0].clientX,y:ve.touches[0].clientY},U.current=!1,document.addEventListener("touchmove",ge,{passive:!1}),document.addEventListener("touchend",Q),document.addEventListener("touchcancel",Q))};return f.addEventListener("pointerdown",ee),f.addEventListener("touchstart",ce),()=>{f.removeEventListener("pointerdown",ee),f.removeEventListener("touchstart",ce),document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",R),document.removeEventListener("pointercancel",R),document.removeEventListener("touchmove",ge),document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),S.current=null,U.current=!1}},[e,ye,y]);const be={backgroundColor:le.color,backdropFilter:`blur(${le.blur}px)`,animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:si.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:C,className:Ct(rt.background,j?me:fe,{[rt.editor]:l},{[rt.hidden]:!e}),style:{...be,...A&&!l&&!j?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?C:null,className:Ct(rt.contentStyle,j?Z:ke,{[rt.editor]:l},{[rt.hidden]:!e}),style:{animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(xl,{onMove:f=>E(f.index),ref:$,className:rt.lightboxSplide,options:{arrows:!1,speed:k.duration?parseInt(k.duration):500,direction:k.direction==="horiz"||k.type==="fade"||k.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!ye,perPage:1,width:"100%",height:"100%",type:k.type==="fade"||k.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":k.duration},children:n.map((f,q)=>{const K=Mr(we.position,we.offset,l),ne=`${N.scalingValue(we.padding.top,l)} ${N.scalingValue(we.padding.right,l)} ${N.scalingValue(we.padding.bottom,l)} ${N.scalingValue(we.padding.left,l)}`,ge=k.type==="scale"?(()=>{const{transform:z,...R}=K;return{...R,position:"absolute",padding:ne,boxSizing:"border-box","--position-transform":z||"none"}})():{...K,position:"absolute",padding:ne,boxSizing:"border-box"};return a.jsx(bl,{children:a.jsx("div",{className:rt.imgWrapper,onClick:$e,children:a.jsx("img",{ref:q===b?H:null,className:Ct(rt.imageStyle,{[rt.contain]:f.image.objectFit==="contain",[rt.cover]:f.image.objectFit==="cover",[rt.scaleSlide]:k.type==="scale"}),src:f.image.url,alt:f.image.name??"",style:{...ge,pointerEvents:f.image.objectFit==="contain"?"none":"auto"}})})},q)})},y),X.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(rt.arrow,{[rt.arrowVertical]:k.direction==="vert"}),style:{color:X.color,"--arrow-hover-color":X.hover},children:a.jsxs("button",{className:rt.arrowInner,style:{transform:`translate(${N.scalingValue(X.offset.x,l)}, ${N.scalingValue(X.offset.y*(k.direction==="horiz"?1:-1),l)}) scale(${X.scale}) rotate(${k.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var f;return(f=$.current)==null?void 0:f.go("-1")},"aria-label":"Previous",children:[X.arrowsImgUrl&&a.jsx(pn,{url:X.arrowsImgUrl,fill:X.color,hoverFill:X.hover,className:Ct(rt.arrowImg,rt.mirror)}),!X.arrowsImgUrl&&a.jsx(ec,{color:X.color,className:Ct(rt.arrowIcon,rt.arrowImg,rt.mirror)})]})}),a.jsx("div",{className:Ct(rt.arrow,rt.nextArrow,{[rt.arrowVertical]:k.direction==="vert"}),style:{color:X.color,"--arrow-hover-color":X.hover},children:a.jsxs("button",{className:rt.arrowInner,style:{transform:`translate(${N.scalingValue(X.offset.x*(k.direction==="horiz"?-1:1),l)}, ${N.scalingValue(X.offset.y,l)}) scale(${X.scale}) rotate(${k.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var f;return(f=$.current)==null?void 0:f.go("+1")},"aria-label":"Next",children:[X.arrowsImgUrl&&a.jsx(pn,{url:X.arrowsImgUrl,fill:X.color,hoverFill:X.hover,className:rt.arrowImg}),!X.arrowsImgUrl&&a.jsx(ec,{color:X.color,className:Ct(rt.arrowIcon,rt.arrowImg)})]})})]}),le.closeIconUrl&&(()=>{const f=Mr(le.closeIconAlign,le.closeIconOffset,l),q=`scale(${le.closeIconScale})`,K=f.transform?`${f.transform} ${q}`:q;return a.jsx("button",{className:rt.closeButton,style:{...f,transform:K},onClick:oe,"aria-label":"Close lightbox",children:a.jsx(pn,{url:le.closeIconUrl,fill:le.closeIconColor??"#000000",hoverFill:le.closeIconHover??"#cccccc"})})})(),te&&te.isActive&&i.imageCaption&&((Ce=n[b])==null?void 0:Ce.imageCaption)&&a.jsx("div",{className:rt.caption,style:{...Mr(te.alignment,te.offset,l),fontFamily:zo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":N.scalingValue(c.width,l),letterSpacing:N.scalingValue(p,l),wordSpacing:N.scalingValue(v,l),textAlign:x,fontSize:N.scalingValue(m.fontSize,l),lineHeight:N.scalingValue(m.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:h},onClick:f=>f.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:rt.captionTextInner,style:{"--link-color":te.linkColor,"--link-hover-color":te.linkHoverColor},children:a.jsx(Ki,{content:n[b].imageCaption})})}),ue.isActive&&(()=>{const[f,q]=ue.position.split("-"),K=k.direction==="horiz"?`${f}-left`:ue.position,ne=Mr(K,ue.offset,l),ge=()=>{if(k.direction==="horiz"){if(q==="left")return"flex-start";if(q==="center")return"center";if(q==="right")return"flex-end"}else{if(f==="top")return"flex-start";if(f==="middle")return"center";if(f==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:T,className:rt.thumbsWrapper,onClick:z=>Me(z),style:{position:l?"absolute":"fixed",...ne,...k.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:Ct(rt.thumbsContainer,{[rt.thumbsContainerVertical]:k.direction==="vert",[rt.thumbsAlignStart]:ue.align==="start",[rt.thumbsAlignCenter]:ue.align==="center",[rt.thumbsAlignEnd]:ue.align==="end"}),style:{gap:N.scalingValue(ue.grid.gap,l),justifyContent:_?"flex-start":ge()},children:n.map((z,R)=>{const Q=R===b,ee=W[R],V=ue.grid.size*(Q?ue.activeState.scale:1),Le=()=>{if(ue.fit!=="fit")return{};if(!ee)return k.direction==="horiz"?{height:N.scalingValue(V,l)}:{width:N.scalingValue(V,l)};const ve=ee.width/ee.height;if(k.direction==="horiz"){const J=V,_e=J*ve;return{width:N.scalingValue(_e,l),height:N.scalingValue(J,l)}}else{const J=V,_e=J/ve;return{width:N.scalingValue(J,l),height:N.scalingValue(_e,l)}}};return a.jsx("button",{className:rt.thumbItem,style:{...k.direction==="horiz"&&ue.fit!=="fit"?{height:N.scalingValue(V,l)}:{},...k.direction==="vert"&&ue.fit!=="fit"?{width:N.scalingValue(V,l)}:{},...ue.fit==="cover"?{width:N.scalingValue(V,l),height:N.scalingValue(V,l)}:{},...Le(),transition:Q?"all 0.25s ease-out":"none",opacity:Q?ue.activeState.opacity/100:ue.opacity/100,"--thumb-hover":ue.activeState.opacity/100},onClick:ve=>{var J;ve.stopPropagation(),E(R),(J=$.current)==null||J.go(R)},onMouseEnter:()=>{var ve;ue.triggers==="hov"&&((ve=$.current)==null||ve.go(R))},children:a.jsx("img",{src:z.image.url,alt:z.image.name??"",onLoad:ve=>{const J=ve.currentTarget;J.naturalWidth&&J.naturalHeight&&Y(_e=>({..._e,[R]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:ue.fit==="cover"?"cover":"contain",...ue.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ue.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${z.image.name}-${R}`)})})})})()]})]}),document.getElementById(r))};function ec({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 Oh={element:Wh,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function Ar(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Dh(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 zh({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=
|
|
158
|
+
`}function zh({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=N.useScopedStyles(),{type:u="A",fieldsToShow:p=2,textareaRows:x=1,fields:v=[],buttonLabel:m,gap:g,fieldsGap:h,buttonCorners:b,buttonStroke:E,buttonPadding:y,isButtonFullWidth:w,inputCorners:j,inputStroke:G,inputPadding:A,inputColor:P,inputTextColor:W,inputBorderColor:Y,placeholderColor:$,buttonColor:I,buttonTextColor:H,buttonBorderColor:O,labelTextColor:C,successColor:L,errorColor:D,fontFamily:S,inputFontSettings:U,inputFontSize:T,inputLineHeight:_,inputLetterSpacing:B,inputWordSpacing:ae,inputTextAppearance:ie,buttonFontSettings:k,buttonFontSize:ue,buttonLineHeight:X,buttonLetterSpacing:le,buttonWordSpacing:te,buttonTextAppearance:we,labelFontSettings:ke,labelFontSize:fe,labelLineHeight:me,labelLetterSpacing:Z,labelWordSpacing:se,labelTextAppearance:oe,statusFontSettings:Pe,statusFontSize:$e,statusLineHeight:Me,statusLetterSpacing:ye,statusWordSpacing:be,statusTextAppearance:Ce,successMessage:f,errorMessage:q,stateOverrides:K}=e,ne=u==="B",ge=v.slice(0,Math.min(p,v.length)),z={fontSettings:{fontFamily:S,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:T??.01,lineHeight:_,letterSpacing:B??0,wordSpacing:ae??0,textAppearance:ie,color:W},R=dn(Qt(z,t)),Q=N.scalingValue(G??0,t),ee=qe=>N.scalingValue((_??T??.01)*qe+((A==null?void 0:A.top)??0)+((A==null?void 0:A.bottom)??0)+(u==="C"?G??0:(G??0)*2),t),ce=ee(1),V=ee(Math.max(1,x)),Le={...R,borderStyle:"solid",borderRadius:u==="C"?0:N.scalingValue(j??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:Q,borderLeftWidth:0}:{borderWidth:Q},paddingTop:N.scalingValue((A==null?void 0:A.top)??0,t),paddingRight:N.scalingValue((A==null?void 0:A.right)??0,t),paddingBottom:N.scalingValue((A==null?void 0:A.bottom)??0,t),paddingLeft:N.scalingValue((A==null?void 0:A.left)??0,t),height:ce,minHeight:ce},ve={fontSettings:{fontFamily:S,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:ue??.01,lineHeight:X,letterSpacing:le??0,wordSpacing:te??0,textAppearance:we,color:H},J=dn(Qt(ve,t)),_e=N.scalingValue(E??0,t),Be={fontSettings:{fontFamily:S,fontWeight:(ke==null?void 0:ke.fontWeight)??400,fontStyle:(ke==null?void 0:ke.fontStyle)??"normal"},fontSize:fe??.01,lineHeight:me,letterSpacing:Z??0,wordSpacing:se??0,textAppearance:oe,color:C},at=Qt(Be,t),Ue={fontSettings:{fontFamily:S,fontWeight:(Pe==null?void 0:Pe.fontWeight)??400,fontStyle:(Pe==null?void 0:Pe.fontStyle)??"normal"},fontSize:$e??.01,lineHeight:Me,letterSpacing:ye??0,wordSpacing:be??0,textAppearance:Ce,color:L},et=dn(Qt(Ue,t)),Je=N.buildColorVars(c,{inputColor:P,inputTextColor:W,inputBorderColor:Y,placeholderColor:$!=null&&$.trim()?$:"#cccccc",buttonColor:I,buttonTextColor:H,buttonBorderColor:O,labelTextColor:C,successColor:L,errorColor:D},Bh,jh,K),[Ye,xe]=s.useState(()=>Object.fromEntries(ge.map(qe=>[qe.name,""]))),[We,He]=s.useState("idle"),[Qe,he]=s.useState(null),Ne=r==="success"?"success":r==="error"?"error":We,Ve=r==="error"?q:Qe,tt=r==="filled",mt=s.useMemo(()=>{if(!tt)return Ye;let qe=null;for(const nt of ge)(Ye[nt.name]??"").trim().length>0||(qe=qe??{...Ye},qe[nt.name]="Filled");return qe??Ye},[Ye,tt,ge]),st=Ne==="error"?N.getFormFieldValidationError(ge,mt):null,Fe=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),Xe=o==null?void 0:o.submitUrl,ot=(qe,nt)=>{xe(de=>({...de,[qe]:nt}))},Oe=async qe=>{if(qe.preventDefault(),!d)return;const nt=Object.fromEntries(ge.map(Ie=>{var it;return[Ie.name,((it=Ye[Ie.name])==null?void 0:it.trim())??""]}).filter(([,Ie])=>Ie));if(!Xe){He("error"),he("No integrations were found for this form.");return}if(Object.keys(nt).length===0)return;const de=N.getFormFieldValidationError(ge,Ye);if(de){He("error"),he(de);return}He("submitting"),he(null);try{const Ie=await fetch(Xe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(nt)});if(!Ie.ok){const it=await Ie.text();throw new Error(it||`Request failed: ${Ie.status}`)}He("success"),xe(Object.fromEntries(ge.map(it=>[it.name,""])))}catch(Ie){He("error"),he(Ie instanceof Error?Ie.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${Fe}`.trim(),style:Je,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Dh(c)}}),a.jsxs("form",{onSubmit:Oe,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:ge.map((qe,nt)=>a.jsxs(s.Fragment,{children:[nt>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:N.scalingValue(h??0,t)}}),a.jsxs("div",{className:`${c}-field-group${ne?` ${c}-labeled`:""}`,children:[ne&&a.jsx("span",{className:`${c}-field-label`,style:at?{...at,lineHeight:at.fontSize}:void 0,children:qe.label||qe.name}),qe.type==="textarea"?a.jsx("textarea",{name:qe.name,autoComplete:"off",value:mt[qe.name]??"",onChange:de=>ot(qe.name,de.target.value),placeholder:qe.placeholder,className:`${c}-input`,style:{...Le,height:V,minHeight:V},rows:x,"data-filled":tt||(mt[qe.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:qe.type==="phone"?"tel":qe.type==="email"?"email":"text",name:qe.name,autoComplete:"off",value:mt[qe.name]??"",onChange:de=>ot(qe.name,de.target.value),placeholder:qe.placeholder,required:qe.isRequired??qe.type==="email",className:`${c}-input`,style:Le,"data-filled":tt||(mt[qe.name]??"").trim().length>0})]})]},nt))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:N.scalingValue(g??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:N.scalingValue(b??0,t),borderWidth:_e,paddingTop:N.scalingValue((y==null?void 0:y.top)??0,t),paddingRight:N.scalingValue((y==null?void 0:y.right)??0,t),paddingBottom:N.scalingValue((y==null?void 0:y.bottom)??0,t),paddingLeft:N.scalingValue((y==null?void 0:y.left)??0,t),pointerEvents:d?"auto":void 0,...J,...w?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:w?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:We==="submitting"?"...":m})})})]}),Ne==="success"&&a.jsx("p",{className:`${c}-success`,style:{...et},children:f}),Ne==="error"&&a.jsx("p",{className:`${c}-error`,style:{...et},role:"alert",children:st??Ve??q})]})}const Bh={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"},jh=["hover","focus","filled","success","error"],Vh=`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';
|
|
@@ -337,6 +337,7 @@ export function Form({ settings, isEditor, isEditMode, isPreviewMode, metadata,
|
|
|
337
337
|
const {
|
|
338
338
|
type = 'A',
|
|
339
339
|
fieldsToShow = 2,
|
|
340
|
+
textareaRows = 1,
|
|
340
341
|
fields = [],
|
|
341
342
|
buttonLabel,
|
|
342
343
|
gap,
|
|
@@ -406,13 +407,15 @@ export function Form({ settings, isEditor, isEditMode, isPreviewMode, metadata,
|
|
|
406
407
|
};
|
|
407
408
|
const inputTypographyCss = omitTextColors(textStylesToCss(resolvedInputTextStyle, isEditor));
|
|
408
409
|
const strokeForInput = scalingValue(inputStroke ?? 0, isEditor);
|
|
409
|
-
const
|
|
410
|
-
(inputLineHeight ?? inputFontSize ?? 0.01) +
|
|
410
|
+
const getInputHeight = (rows: number) => scalingValue(
|
|
411
|
+
(inputLineHeight ?? inputFontSize ?? 0.01) * rows +
|
|
411
412
|
(inputPadding?.top ?? 0) +
|
|
412
413
|
(inputPadding?.bottom ?? 0) +
|
|
413
414
|
(type === 'C' ? (inputStroke ?? 0) : (inputStroke ?? 0) * 2),
|
|
414
415
|
isEditor,
|
|
415
416
|
);
|
|
417
|
+
const inputBaseHeight = getInputHeight(1);
|
|
418
|
+
const textareaHeight = getInputHeight(Math.max(1, textareaRows));
|
|
416
419
|
const inputFieldCss = {
|
|
417
420
|
...inputTypographyCss,
|
|
418
421
|
borderStyle: 'solid',
|
|
@@ -601,8 +604,8 @@ export function Form({ settings, isEditor, isEditMode, isPreviewMode, metadata,
|
|
|
601
604
|
onChange={(e) => handleFieldChange(field.name, e.target.value)}
|
|
602
605
|
placeholder={field.placeholder}
|
|
603
606
|
className={\`\${P}-input\`}
|
|
604
|
-
style={inputFieldCss}
|
|
605
|
-
rows={
|
|
607
|
+
style={{ ...inputFieldCss, height: textareaHeight, minHeight: textareaHeight }}
|
|
608
|
+
rows={textareaRows}
|
|
606
609
|
data-filled={isFilledPreview || ((displayValues[field.name] ?? '') as string).trim().length > 0}
|
|
607
610
|
data-field-type="textarea"
|
|
608
611
|
/>
|
|
@@ -725,6 +728,7 @@ type FormSettings = {
|
|
|
725
728
|
type: 'A' | 'B' | 'C';
|
|
726
729
|
fontFamily: string;
|
|
727
730
|
fieldsToShow: number;
|
|
731
|
+
textareaRows?: number;
|
|
728
732
|
fields: FormFieldItem[];
|
|
729
733
|
buttonLabel?: string;
|
|
730
734
|
gap?: number;
|
|
@@ -789,7 +793,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
789
793
|
};
|
|
790
794
|
|
|
791
795
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
792
|
-
`,Gh=[{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"}],Fr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Xh=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],qh={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...Fr.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:{...Fr.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:{...Fr.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:{...Fr.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:Gh,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!0,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Xh],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"]},Uh={element:zh,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:qh,sourceCode:Vh,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Nr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Yh(e){return`
|
|
796
|
+
`,Gh=[{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"}],Fr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Xh=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],qh={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:{...Fr.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:{...Fr.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:{...Fr.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:{...Fr.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:Gh,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:[...Xh],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"]},Uh={element:zh,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:qh,sourceCode:Vh,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Nr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Yh(e){return`
|
|
793
797
|
.${e}-wrapper {
|
|
794
798
|
display: flex;
|
|
795
799
|
flex-direction: column;
|
|
@@ -982,7 +986,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
982
986
|
font-size: ${Nr(14)};
|
|
983
987
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
984
988
|
}
|
|
985
|
-
`}const Kh=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=
|
|
989
|
+
`}const Kh=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=N.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:x,inputFontSettings:v,inputFontSize:m,inputLineHeight:g,inputLetterSpacing:h,inputWordSpacing:b,inputTextAppearance:E,buttonFontSettings:y,buttonFontSize:w,buttonLineHeight:j,buttonLetterSpacing:G,buttonWordSpacing:A,buttonTextAppearance:P,statusFontSettings:W,statusFontSize:Y,statusLineHeight:$,statusLetterSpacing:I,statusWordSpacing:H,statusTextAppearance:O,iconMaxWidth:C,minHeight:L,corners:D,stroke:S,stateOverrides:U,inputPadding:T,buttonPadding:_,successMessage:B="Thanks for subscribing!",errorMessage:ae="Please, fill all required fields."}=e,ie=d.slice(0,Math.min(p,d.length)),[k,ue]=s.useState(()=>Object.fromEntries(ie.map(ve=>[ve.name,""]))),[X,le]=s.useState("idle"),[te,we]=s.useState(null),ke=o==="success"?"success":o==="error"?"error":X,fe=o==="error"?ae:te,me=o==="filled",Z=s.useMemo(()=>{if(!me)return k;let ve=null;for(const J of ie)(k[J.name]??"").trim().length>0||(ve=ve??{...k},ve[J.name]="Filled");return ve??k},[me,k,ie]),se=ke==="error"?N.getFormFieldValidationError(ie,Z):null,oe=o&&o!=="default"?`${r}-state-${o}`:"",Pe=ie.some(ve=>(Z[ve.name]??"").trim().length>0),$e=oe!==`${r}-state-filled`&&Pe?`${r}-state-filled`:"",Me=`${oe} ${$e}`.trim(),ye=i==null?void 0:i.submitUrl,be=u??"",Ce=(c==null?void 0:c.icon)??"",f=(c==null?void 0:c.mode)==="On",q=be||"Submit",K={fontSettings:{fontFamily:x,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:m??.01,lineHeight:g,letterSpacing:h??0,wordSpacing:b??0,textAppearance:E,color:e.inputTextColor??"#111111"},ne={fontSettings:{fontFamily:x,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:w??.01,lineHeight:j,letterSpacing:G??0,wordSpacing:A??0,textAppearance:P,color:e.buttonTextColor??"#ffffff"},ge={fontSettings:{fontFamily:x,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:Y??.01,lineHeight:$,letterSpacing:I??0,wordSpacing:H??0,textAppearance:O,color:e.successColor??"#22c55e"},z=dn(Qt(K,t)),R=dn(Qt(ne,t)),Q=dn(Qt(ge,t)),ee=N.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(K==null?void 0:K.color)??"#111111",buttonTextColor:e.buttonTextColor??(ne==null?void 0:ne.color)??"#ffffff"},Zh,Jh,U),ce={borderRadius:N.scalingValue(D,t),borderWidth:N.scalingValue(S,t),borderStyle:"solid"},V={borderLeftWidth:N.scalingValue(S,t)},Le=async ve=>{if(ve.preventDefault(),!l)return;const J=Object.fromEntries(ie.map(Be=>{var at;return[Be.name,((at=k[Be.name])==null?void 0:at.trim())??""]}).filter(([,Be])=>Be));if(!ye){le("error"),we("No integrations were found for this form.");return}if(Object.keys(J).length===0)return;const _e=N.getFormFieldValidationError(ie,k);if(_e){le("error"),we(_e);return}le("submitting"),we(null);try{const Be=await fetch(ye,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!Be.ok){const at=await Be.text();throw new Error(at||`Request failed: ${Be.status}`)}le("success"),ue(Object.fromEntries(ie.map(at=>[at.name,""])))}catch(Be){le("error"),we(Be instanceof Error?Be.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Me}`.trim(),style:ee,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Yh(r)}}),a.jsxs("form",{onSubmit:Le,className:`${r}-form`,style:{...ce,height:N.scalingValue(L,t),minHeight:N.scalingValue(L,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ie.map(ve=>a.jsx("input",{type:ve.type==="email"?"email":ve.type==="phone"?"tel":"text",name:ve.name,autoComplete:"off",value:Z[ve.name]??"",onChange:J=>ue(_e=>({..._e,[ve.name]:J.target.value})),placeholder:ve.placeholder,required:ve.isRequired??ve.type==="email",className:`${r}-input`,style:{...z,paddingRight:N.scalingValue(T.right,t),paddingLeft:N.scalingValue(T.left,t),paddingTop:N.scalingValue(T.top,t),paddingBottom:N.scalingValue(T.bottom,t)}},ve.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":q,style:{...R,...V,paddingRight:N.scalingValue(_.right,t),paddingLeft:N.scalingValue(_.left,t),paddingTop:N.scalingValue(_.top,t),paddingBottom:N.scalingValue(_.bottom,t),pointerEvents:l?"auto":void 0},children:X==="submitting"?"...":f?Ce&&a.jsx(pn,{url:Ce,className:`${r}-submitBtnIcon`,style:{maxWidth:N.scalingValue(C??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):be})})]}),ke==="success"&&a.jsx("p",{className:`${r}-success`,style:{...Q},children:B}),ke==="error"&&a.jsx("p",{className:`${r}-error`,style:{...Q},role:"alert",children:se??fe??ae})]})},Zh={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"},Jh=["hover","focus","filled","success","error"],Qh=`import React, { useMemo, useState } from 'react';
|
|
986
990
|
import { CommonComponentProps } from '../props';
|
|
987
991
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
988
992
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1693,7 +1697,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1693
1697
|
.${e}-image-hover-grayscale:hover video {
|
|
1694
1698
|
filter: grayscale(100%);
|
|
1695
1699
|
}
|
|
1696
|
-
`}const sf=30,lf=20,Va=3,cf=12,df=32,uf=3,pf=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")},mf=(e,t)=>Array.from({length:t},()=>e).flat(),gf=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},wu=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),tc=(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 d=Array.from({length:t},(u,p)=>e.children[p]),c=wu(d);return c<=0?0:c+r*Math.max(0,t-1)},hf=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=wu(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},ff=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},yf=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>ff(i,e))},vf=e=>{if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")},xf=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,bf=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var
|
|
1700
|
+
`}const sf=30,lf=20,Va=3,cf=12,df=32,uf=3,pf=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")},mf=(e,t)=>Array.from({length:t},()=>e).flat(),gf=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},wu=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),tc=(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 d=Array.from({length:t},(u,p)=>e.children[p]),c=wu(d);return c<=0?0:c+r*Math.max(0,t-1)},hf=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=wu(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},ff=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},yf=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>ff(i,e))},vf=e=>{if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")},xf=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,bf=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var H,O,C,L;const p=s.useRef(null),x=!!((H=e.image)!=null&&H.url&&vf(e.image));s.useLayoutEffect(()=>{d&&xf(p.current)&&(u==null||u())},[d,(O=e.image)==null?void 0:O.url,u]);const v=n.display==="cover",m=n.ratioValue??"1:1",g=n.reversed??!1,[h,b]=m.split(":").map(Number),w=(g?b:h)/(g?h:b),j=i/w,G=j>o?o:j,A=j>o?o*w:i,P=c(A),W=c(G),Y={borderRadius:c(r)},$=v?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...Y}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...Y},I=((C=e.image)==null?void 0:C.url)&&(x?a.jsx("video",{ref:D=>{p.current=D},src:e.image.url,style:$,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:D=>{p.current=D},src:e.image.url,alt:((L=e.image)==null?void 0:L.name)??"",style:$,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...v?{width:P}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...v?{width:P,height:W,overflow:"hidden",...Y}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:I&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:Ct(`${t}-marquee-link`,!v&&`${t}-marquee-link-contain`),children:I}):I})})},Sf=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=N.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>af(r,c),[r,c]),{speed:p,direction:x,pauseOnHover:v,gap:m,imageMaxWidth:g,imageMaxHeight:h,hoverEffect:b,cornerRadius:E=0}=e,y=s.useMemo(()=>gf(e.imageFit),[e.imageFit]),w=(t==null?void 0:t.length)??0,j=!!o,G=!n||!!i,A=G&&b!=="off"&&b!=="randomize"?`${r}-image-hover-${b}`:void 0,P=n?!!i:!0,Y=((t==null?void 0:t.length)??0)>0&&(P||!!n),$=Math.max(0,p)*sf,I=$e=>N.scalingValue($e,n??!1),H=s.useRef(null),O=s.useRef(null),C=s.useRef(null),[L,D]=s.useState(0),S=P&&v==="on",[U,T]=s.useState(!1),[_,B]=s.useState({}),ae=s.useRef(_);ae.current=_;const ie=s.useRef(null),k=s.useRef(0),ue=s.useRef(null),X=s.useMemo(()=>(t??[]).map($e=>{var Me;return((Me=$e.image)==null?void 0:Me.url)??""}).join("\0"),[t]),[le,te]=s.useState(Va),we=s.useMemo(()=>{const $e=t??[];return $e.length===0||!(P||!!n)?$e:mf($e,le)},[t,P,le,n]),ke=s.useMemo(()=>(t??[]).filter($e=>{var Me;return!!((Me=$e.image)!=null&&Me.url)}).length,[t]),fe=Y?uf:1;s.useLayoutEffect(()=>{k.current=0,B({}),ie.current=null,te(Va),d(0)},[X]),s.useEffect(()=>{if(!G||b!=="randomize")return;const $e=H.current;if(!$e)return;const Me=f=>{B(q=>{const K=Array.from(f).filter(ge=>ge in q&&!yf($e,ge));if(K.length===0)return q;const ne={...q};return K.forEach(ge=>{delete ne[ge]}),ne})},ye=new IntersectionObserver(f=>{const q=new Set;for(const K of f){const ne=K.target.dataset.marqueeItemIndex,ge=ne!==void 0?Number(ne):NaN;Number.isNaN(ge)||q.add(ge)}q.size>0&&Me(q)},{root:$e,threshold:0});Object.keys(_).forEach(f=>{const q=Number(f);$e.querySelectorAll(`[data-marquee-item-index="${q}"]`).forEach(K=>ye.observe(K))});const be={current:0},Ce=()=>{const f=Object.keys(ae.current);f.length!==0&&(Me(f.map(Number)),be.current=requestAnimationFrame(Ce))};return Object.keys(ae.current).length>0&&(be.current=requestAnimationFrame(Ce)),()=>{cancelAnimationFrame(be.current),ye.disconnect()}},[b,_,G]),s.useLayoutEffect(()=>{if(!Y)return;const $e=H.current,Me=C.current;if(!$e||!Me)return;const ye={current:0},be=()=>{const q=$e.getBoundingClientRect().width||$e.offsetWidth,K=hf(Me),ne=ie.current,ge=typeof ne=="number"&&Math.abs(ne-K)<=.25;ie.current=K;let z=le,R=0;if((P||n)&&w>0&&q>0){const ce=tc(Me,w);if(ce>=df){R=ce;const V=Math.min(cf,Math.max(Va,Math.ceil(q/ce)+1));z=V,V!==le&&te(V)}}const ee=z!==le&&R>0?R*z:K>0?K:R>0?R*z:(()=>{const ce=tc(Me,w);return ce>0?ce*z:0})();ee>0?d(ce=>ce<=0?ee:!ge||Math.round(ce)===Math.round(ee)?ce:ee):!ge&&l<=0&&(cancelAnimationFrame(ye.current),ye.current=requestAnimationFrame(be))},Ce=()=>{cancelAnimationFrame(ye.current),ye.current=requestAnimationFrame(be)};ue.current=Ce,Ce();const f=new ResizeObserver(Ce);return f.observe($e),f.observe(Me),()=>{ue.current=null,cancelAnimationFrame(ye.current),f.disconnect()}},[P,Y,l,X,le,w,n]),s.useLayoutEffect(()=>{if(!Y||c<=0)return;const $e=O.current;$e&&pf($e)},[Y,c,x,$]),s.useLayoutEffect(()=>{if(!Y||l<=0){D(0);return}const $e=O.current,Me=C.current;if(!$e||!Me)return;const ye=()=>{const Ce=$e.offsetHeight||$e.getBoundingClientRect().height,f=Array.from(Me.children).reduce((K,ne)=>Math.max(K,ne.offsetHeight||ne.getBoundingClientRect().height),0),q=Ce>0?Ce:f;D(q>0?q:0)};ye();const be=new ResizeObserver(ye);return be.observe($e),be.observe(Me),()=>be.disconnect()},[Y,fe,we,n,m,g,h,l,y,_]),s.useLayoutEffect(()=>{if(!n||!j||!Y||typeof window>"u")return;const $e=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame($e)},[n,j,Y,x,l,L,m,we]);const me=()=>{S&&T(!0)},Z=()=>{S&&T(!1)},se=s.useCallback(()=>{var $e;k.current=Math.min(ke,k.current+1),($e=ue.current)==null||$e.call(ue)},[ke]),oe=s.useCallback(($e,Me)=>{B(ye=>{const be=ye[$e]??Me,Ce=(t??[]).filter(q=>q!==be);if(Ce.length===0)return ye;const f=Ce[Math.floor(Math.random()*Ce.length)];return{...ye,[$e]:f}})},[t]),Pe=($e,Me,ye,be)=>{const Ce=G&&b==="randomize"&&y.display==="cover"?_[ye]??$e:$e,f=`max(${I(m)}, ${lf}px)`,q=`calc(-0.5 * (${f} + ${I(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":ye,onMouseEnter:G&&b==="randomize"&&y.display==="cover"?()=>oe(ye,$e):void 0,children:[a.jsx(bf,{item:Ce,prefix:r,imageFit:y,imageMaxWidth:g,imageMaxHeight:h,cornerRadius:E,imageHoverClass:A,isEditor:n,isFirstSet:be,scaled:I,onFirstSetImageDone:se}),j&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:q,width:f,height:"100%"}})]},`${Me}-${ye}`)};if(Y){const $e=P?S&&U?"paused":"running":"paused",Me=c>0&&$>0?c/$*1e3:0,ye=`${Math.max(0,Me)/1e3}s`;return a.jsxs("div",{ref:H,className:Ct(`${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:O,className:`${r}-marquee-track`,"data-direction":x,onMouseEnter:me,onMouseLeave:Z,style:{WebkitAnimationDuration:ye,animationDuration:ye,WebkitAnimationPlayState:$e,animationPlayState:$e},children:Array.from({length:fe},(be,Ce)=>a.jsx("div",{ref:Ce===0?C:void 0,className:Ct(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:I(m),paddingRight:I(m)},"aria-hidden":Ce>0,children:we.map((f,q)=>Pe(f,Ce,q,Ce===0&&q<w))},`set-${Ce}`))})]})}return a.jsxs("div",{ref:H,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:Ct(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:I(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map(($e,Me)=>Pe($e,0,Me))},"marquee-static")]})},wf=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1697
1701
|
import cn from 'classnames';
|
|
1698
1702
|
import { CommonComponentProps } from '../props';
|
|
1699
1703
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2605,7 +2609,7 @@ ${o}
|
|
|
2605
2609
|
left: -9999px;
|
|
2606
2610
|
top: 0;
|
|
2607
2611
|
}
|
|
2608
|
-
`}const Lf=30,Ga=3,If=12,Rf=96,nc=3,As=.72,Pf=100,kf=10,Ef=e=>e/Pf,Mf=e=>Math.max(0,e)/kf,Af=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")},Ff=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),io={ctx:void 0},Nf=()=>io.ctx!==void 0?io.ctx:typeof document>"u"?(io.ctx=null,io.ctx):(io.ctx=document.createElement("canvas").getContext("2d"),io.ctx),_f=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},ic=e=>{e.style.transform=""},Wf=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Hf=(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)},$u=96,Cu=(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,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const v=p*c,y=v+c;o[p+1]=y,r[p+1]=r[p]+(d(v)+d(y))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Of=(e,t)=>{const n=Cu(e,t,$u);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},Df=(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:d}=e,c=(m,g)=>{if(g-m<=1)return[m,g];const f=m+g>>1;return l[f]<=r?c(f,g):c(m,f)},[u,p]=c(0,l.length-1),v=l[p]-l[u],y=v>0?(r-l[u])/v:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*y)},zf=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,d=g=>i+t*Math.sin(l*g),c=g=>t*l*Math.cos(l*g),u=-o,v=e+o-u,y=Math.max(4,Math.ceil(r*4*(v/Math.max(e,1)))),m=Array.from({length:y},(g,f)=>{const x=u+f/y*v,R=u+(f+1)/y*v,b=R-x,S=d(x),G=d(R),D=x+b/3,j=S+c(x)*b/3,P=R-b/3,M=G-c(R)*b/3;return`C${D.toFixed(2)} ${j.toFixed(2)} ${P.toFixed(2)} ${M.toFixed(2)} ${R.toFixed(2)} ${G.toFixed(2)}`});return[`M${u.toFixed(2)} ${d(u).toFixed(2)}`,...m].join(" ")},Bf=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${As}em`},u=((m=e.image)==null?void 0:m.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),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:d,children:Array.from(e.text).map((g,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:g===" "?" ":g})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),y=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:y}):y})},jf=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=F.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:v,layoutType:y,curveAmplitude:m,curveFrequency:g,textFontFamily:f,textFontSettings:x,textFontSize:R,textLineHeight:b,textLetterSpacing:S,textWordSpacing:G,textTextAppearance:D,textColor:j,backgroundColor:P,ribbonWidth:M}=e,K=M??b,T=y==="curve",L=Ef(m),_=Mf(g),z=s.useMemo(()=>Tf(o,d,T),[o,d,T]),$=s.useMemo(()=>Qt({fontSettings:{fontFamily:f,fontWeight:x.fontWeight,fontStyle:x.fontStyle},letterSpacing:S,wordSpacing:G,fontSize:R,lineHeight:b,textAppearance:D,color:j},n),[f,x,S,G,R,b,D,j,n]),k=Oe=>F.scalingValue(Oe,n??!1),W=((t==null?void 0:t.length)??0)>0,w=n?!!i:!0,U=W&&(w||!!n),C=Math.max(0,c)*Lf,O=w&&p==="on",[V,se]=s.useState(!1),ie=w?O&&V?"paused":"running":"paused",N=ie==="running"&&C>0&&d>0,de=d>0&&C>0?d/C*1e3:0,X=s.useRef(null),ce=s.useRef(null),oe=s.useRef(null),fe=s.useRef(null),Pe=s.useRef(null),xe=s.useRef(null),pe=s.useRef(N),Z=s.useRef(null),le=s.useRef(null),re=s.useRef(L),Ie=s.useRef(_);pe.current=N,re.current=L,Ie.current=_;const[we,Me]=s.useState(0),[ye,be]=s.useState(0),[Ce,h]=s.useState(0),[q,Y]=s.useState(0),[ee,ve]=s.useState(0),B=s.useMemo(()=>(t??[]).map(Oe=>{var Fe;return`${Oe.text}\0${((Fe=Oe.image)==null?void 0:Fe.url)??""}\0${Oe.link??""}`}).join("\0"),[t]),[I,Q]=s.useState(Ga),ne=s.useMemo(()=>{const Oe=t??[];return Oe.length===0||!(w||n)?Oe:Ff(Oe,I)},[t,w,I,n]),H=U?nc:1;s.useLayoutEffect(()=>{Q(Ga),l(0)},[B]),s.useLayoutEffect(()=>{var We;const Oe=xe.current;if(!Oe)return;const Fe=()=>{const ot=getComputedStyle(Oe),nt=parseFloat(ot.fontSize)||0;if(nt<=0)return;const me=Nf();if(!me){Me(nt*As),be(0);return}me.font=`${ot.fontStyle} ${ot.fontWeight} ${nt}px ${ot.fontFamily}`;const Ne=me.measureText("H"),st=Ne.actualBoundingBoxAscent>0?Ne.actualBoundingBoxAscent:nt*As,ut=Math.max(0,Ne.actualBoundingBoxDescent||0),Be=Ne.fontBoundingBoxAscent||0,pt=Ne.fontBoundingBoxDescent||0;Me(Lt=>Math.abs(Lt-st)>.5?st:Lt);const Tt=Be>0||pt>0?(pt-ut-(Be-st))/2:0;be(Lt=>Math.abs(Lt-Tt)>.25?Tt:Lt)};Fe();const Ee=typeof document<"u"?document.fonts:void 0;(We=Ee==null?void 0:Ee.ready)==null||We.then(Fe).catch(()=>{});const Ze=new ResizeObserver(Fe);return Ze.observe(Oe),()=>Ze.disconnect()},[$.fontFamily,$.fontWeight,$.fontStyle,$.fontSize,$.lineHeight]),s.useLayoutEffect(()=>{if(!U)return;const Oe=X.current,Fe=fe.current;if(!Oe||!Fe)return;const Ee={id:0},Ze=()=>{const me=Oe.offsetWidth||Oe.getBoundingClientRect().width,Ne=Fe.offsetWidth||Fe.getBoundingClientRect().width;if(W&&me>0&&Ne>0){const st=Ne/I;if(st>0){let ut=me,Be=If;if(T){const Tt=me*re.current,Lt=Ie.current,xt=Lt>0?2*Math.PI*Lt/me:0,Et=Of(Tt,xt);ut=Math.max(me,Et*me/(nc-1)),Be=Rf}const pt=Math.min(Be,Math.max(Ga,Math.ceil(ut/st)+1));if(pt!==I){Q(pt);return}}}Ne>0&&l(Ne)},We=()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Ze)};We();const ot=new ResizeObserver(We);ot.observe(Oe),ot.observe(Fe);const nt=()=>{document.hidden||We()};return document.addEventListener("visibilitychange",nt),window.addEventListener("pageshow",nt),window.addEventListener("focus",nt),()=>{cancelAnimationFrame(Ee.id),ot.disconnect(),document.removeEventListener("visibilitychange",nt),window.removeEventListener("pageshow",nt),window.removeEventListener("focus",nt)}},[U,B,I,W,we,T,L,_]),s.useLayoutEffect(()=>{const Oe=Pe.current;if(!Oe)return;const Fe={id:0},Ee=()=>{const We=Oe.offsetHeight;We>0&&ve(ot=>Math.abs(ot-We)>.5?We:ot)};Fe.id=requestAnimationFrame(Ee);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Fe.id),Fe.id=requestAnimationFrame(Ee)});return Ze.observe(Oe),()=>{cancelAnimationFrame(Fe.id),Ze.disconnect()}},[K,n]),s.useLayoutEffect(()=>{if(!T){h(0),Y(0);return}const Oe=X.current,Fe=fe.current;if(!Oe||!Fe)return;const Ee={id:0},Ze=()=>{const ot=Oe.offsetWidth,nt=Fe.offsetHeight;ot>0&&Y(me=>Math.abs(me-ot)>.5?ot:me),nt>0&&h(me=>Math.abs(me-nt)>.5?nt:me)};Ee.id=requestAnimationFrame(Ze);const We=new ResizeObserver(()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Ze)});return We.observe(Oe),We.observe(Fe),()=>{cancelAnimationFrame(Ee.id),We.disconnect()}},[T,B,we,b,R,U]),s.useLayoutEffect(()=>{if(!U||d<=0)return;const Oe=oe.current;Oe&&Af(Oe)},[U,d,u,C]),s.useLayoutEffect(()=>{if(!T||!W)return;const Oe=X.current;if(!Oe)return;const Fe={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Ee=()=>{for(const st of Fe.itemsCache)for(const ut of st.glyphs)ic(ut.inner)},Ze=()=>{const st=ce.current??Oe;Fe.itemsCache=Array.from(Oe.querySelectorAll("[data-marquee-text-item]"),ut=>{const Be=[];return ut.querySelectorAll("[data-marquee-wave-node]").forEach(pt=>{const Tt=pt.firstElementChild;Tt&&Be.push({inner:Tt,layoutLocalX:Hf(pt,st)})}),{item:ut,glyphs:Be}}),Fe.cacheDirty=!1},We=()=>{Fe.cacheDirty&&Ze();const ut=(ce.current??Oe).offsetWidth||1,Be=ut*re.current,pt=Ie.current,Tt=2*Math.PI*pt/ut,Lt=`${ut}|${Be}|${Tt}`;if(Lt!==Fe.lutKey&&(Fe.lutKey=Lt,Fe.lut=Cu(Be,Tt,$u)),Math.abs(Be)<=0||Tt<=0){Ee();return}const xt=oe.current,Et=xt?Wf(getComputedStyle(xt).transform):0,Vt=Oe.getBoundingClientRect(),Ut=Vt.left,Kt=Vt.right,Pt=Fe.lut&&Fe.lut.wavelength>0?Math.max(0,(Fe.lut.periodArc/Fe.lut.wavelength-1)*ut):0;for(const{item:jt,glyphs:on}of Fe.itemsCache){const vt=jt.getBoundingClientRect();if(vt.right<Ut||vt.left>Kt+Pt){for(const Le of on)ic(Le.inner);continue}for(const Le of on){const Xe=Le.layoutLocalX+Et,lt=Fe.lut?Df(Fe.lut,Xe):Xe,ct=Tt*lt,wt=Be*Math.sin(ct),It=Be*Tt*Math.cos(ct),gt=Math.atan(It)*(180/Math.PI);_f(Le.inner,lt-Xe,wt,gt)}}},ot=()=>{Fe.cancelled||(Fe.raf=0,We(),pe.current&&!document.hidden&&(Fe.raf=requestAnimationFrame(ot)))},nt=()=>{Fe.cancelled||Fe.raf||(Fe.raf=requestAnimationFrame(ot))},me=()=>{Fe.cacheDirty=!0,We(),nt()};Z.current=nt,le.current=me,We(),nt();const Ne=()=>{if(document.hidden){cancelAnimationFrame(Fe.raf),Fe.raf=0;return}cancelAnimationFrame(Fe.raf),Fe.raf=0,me()};return document.addEventListener("visibilitychange",Ne),window.addEventListener("pageshow",Ne),window.addEventListener("focus",Ne),()=>{Fe.cancelled=!0,Z.current=null,le.current=null,cancelAnimationFrame(Fe.raf),document.removeEventListener("visibilitychange",Ne),window.removeEventListener("pageshow",Ne),window.removeEventListener("focus",Ne),Ee()}},[T,W]),s.useLayoutEffect(()=>{var Oe;!T||!W||(Oe=le.current)==null||Oe.call(le)},[T,W,r,B,I,we,L,_,q]),s.useLayoutEffect(()=>{var Oe;(Oe=Z.current)==null||Oe.call(Z)},[N,u]);const te=()=>{O&&se(!0)},ke=()=>{O&&se(!1)},ge=T?Math.abs(L)*100:0,J=k(K),Ye={minHeight:J,...T?{paddingTop:`${ge}%`,paddingBottom:`${ge}%`}:{}},je={height:J,...T?{visibility:"hidden"}:{backgroundColor:P}},it={gap:k(v),minHeight:J},qe=q*L,et=Math.abs(qe),Je=ee>0?ee:Ce,Ge=Math.max(Ce,Je),$e=et+Ge/2,He=Math.max(Je,1),De=T&&q>0&&Ge>0?zf(q,qe,_,$e,He):"",Qe=et*2+Ge,he=De?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${q} ${Qe}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:De,fill:"none",stroke:P,strokeWidth:Je,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,_e=a.jsx("div",{ref:Pe,className:`${o}-ribbon`,style:je,"aria-hidden":!0}),Ve=(Oe,Fe,Ee)=>a.jsx(Bf,{item:Oe,prefix:o,textCss:$,capHeightPx:we,opticalOffsetY:ye,imageGapPx:k(v),isCurve:T},`${Fe}-${Ee}`),tt=a.jsx("span",{ref:xe,"aria-hidden":!0,className:`${o}-cap-ref`,style:$,children:"H"}),ft=`${Math.max(0,de)/1e3}s`,rt=U?a.jsx("div",{ref:oe,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:te,onMouseLeave:ke,style:{WebkitAnimationDuration:ft,animationDuration:ft,WebkitAnimationPlayState:ie,animationPlayState:ie},children:Array.from({length:H},(Oe,Fe)=>a.jsx("div",{ref:Fe===0?fe:void 0,className:`${o}-marquee-set`,style:{...it,paddingRight:k(v)},"aria-hidden":Fe>0,children:ne.map((Ee,Ze)=>Ve(Ee,Fe,Ze))},`set-${Fe}`))}):a.jsx("div",{ref:fe,className:Ct(`${o}-marquee-set`,`${o}-marquee-static`),style:it,children:t==null?void 0:t.map((Oe,Fe)=>Ve(Oe,0,Fe))});return a.jsxs("div",{ref:X,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:z}}),tt,a.jsxs("div",{ref:ce,className:`${o}-marquee-wrapper`,style:Ye,children:[_e,he,rt]})]})},Vf=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2612
|
+
`}const Lf=30,Ga=3,If=12,Rf=96,nc=3,As=.72,Pf=100,kf=10,Ef=e=>e/Pf,Mf=e=>Math.max(0,e)/kf,Af=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")},Ff=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),io={ctx:void 0},Nf=()=>io.ctx!==void 0?io.ctx:typeof document>"u"?(io.ctx=null,io.ctx):(io.ctx=document.createElement("canvas").getContext("2d"),io.ctx),_f=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},ic=e=>{e.style.transform=""},Wf=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Hf=(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)},$u=96,Cu=(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,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const x=p*c,v=x+c;o[p+1]=v,r[p+1]=r[p]+(d(x)+d(v))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Of=(e,t)=>{const n=Cu(e,t,$u);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},Df=(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:d}=e,c=(m,g)=>{if(g-m<=1)return[m,g];const h=m+g>>1;return l[h]<=r?c(h,g):c(m,h)},[u,p]=c(0,l.length-1),x=l[p]-l[u],v=x>0?(r-l[u])/x:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*v)},zf=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,d=g=>i+t*Math.sin(l*g),c=g=>t*l*Math.cos(l*g),u=-o,x=e+o-u,v=Math.max(4,Math.ceil(r*4*(x/Math.max(e,1)))),m=Array.from({length:v},(g,h)=>{const b=u+h/v*x,E=u+(h+1)/v*x,y=E-b,w=d(b),j=d(E),G=b+y/3,A=w+c(b)*y/3,P=E-y/3,W=j-c(E)*y/3;return`C${G.toFixed(2)} ${A.toFixed(2)} ${P.toFixed(2)} ${W.toFixed(2)} ${E.toFixed(2)} ${j.toFixed(2)}`});return[`M${u.toFixed(2)} ${d(u).toFixed(2)}`,...m].join(" ")},Bf=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${As}em`},u=((m=e.image)==null?void 0:m.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),x=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((g,h)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:g===" "?" ":g})},h))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),v=a.jsxs(a.Fragment,{children:[p,x]});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})},jf=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=N.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:x,layoutType:v,curveAmplitude:m,curveFrequency:g,textFontFamily:h,textFontSettings:b,textFontSize:E,textLineHeight:y,textLetterSpacing:w,textWordSpacing:j,textTextAppearance:G,textColor:A,backgroundColor:P,ribbonWidth:W}=e,Y=W??y,$=v==="curve",I=Ef(m),H=Mf(g),O=s.useMemo(()=>Tf(o,d,$),[o,d,$]),C=s.useMemo(()=>Qt({fontSettings:{fontFamily:h,fontWeight:b.fontWeight,fontStyle:b.fontStyle},letterSpacing:w,wordSpacing:j,fontSize:E,lineHeight:y,textAppearance:G,color:A},n),[h,b,w,j,E,y,G,A,n]),L=De=>N.scalingValue(De,n??!1),D=((t==null?void 0:t.length)??0)>0,S=n?!!i:!0,U=D&&(S||!!n),T=Math.max(0,c)*Lf,_=S&&p==="on",[B,ae]=s.useState(!1),ie=S?_&&B?"paused":"running":"paused",k=ie==="running"&&T>0&&d>0,ue=d>0&&T>0?d/T*1e3:0,X=s.useRef(null),le=s.useRef(null),te=s.useRef(null),we=s.useRef(null),ke=s.useRef(null),fe=s.useRef(null),me=s.useRef(k),Z=s.useRef(null),se=s.useRef(null),oe=s.useRef(I),Pe=s.useRef(H);me.current=k,oe.current=I,Pe.current=H;const[$e,Me]=s.useState(0),[ye,be]=s.useState(0),[Ce,f]=s.useState(0),[q,K]=s.useState(0),[ne,ge]=s.useState(0),z=s.useMemo(()=>(t??[]).map(De=>{var Fe;return`${De.text}\0${((Fe=De.image)==null?void 0:Fe.url)??""}\0${De.link??""}`}).join("\0"),[t]),[R,Q]=s.useState(Ga),ee=s.useMemo(()=>{const De=t??[];return De.length===0||!(S||n)?De:Ff(De,R)},[t,S,R,n]),ce=U?nc:1;s.useLayoutEffect(()=>{Q(Ga),l(0)},[z]),s.useLayoutEffect(()=>{var Oe;const De=fe.current;if(!De)return;const Fe=()=>{const qe=getComputedStyle(De),nt=parseFloat(qe.fontSize)||0;if(nt<=0)return;const de=Nf();if(!de){Me(nt*As),be(0);return}de.font=`${qe.fontStyle} ${qe.fontWeight} ${nt}px ${qe.fontFamily}`;const Ie=de.measureText("H"),it=Ie.actualBoundingBoxAscent>0?Ie.actualBoundingBoxAscent:nt*As,ut=Math.max(0,Ie.actualBoundingBoxDescent||0),je=Ie.fontBoundingBoxAscent||0,pt=Ie.fontBoundingBoxDescent||0;Me(Lt=>Math.abs(Lt-it)>.5?it:Lt);const Tt=je>0||pt>0?(pt-ut-(je-it))/2:0;be(Lt=>Math.abs(Lt-Tt)>.25?Tt:Lt)};Fe();const Xe=typeof document<"u"?document.fonts:void 0;(Oe=Xe==null?void 0:Xe.ready)==null||Oe.then(Fe).catch(()=>{});const ot=new ResizeObserver(Fe);return ot.observe(De),()=>ot.disconnect()},[C.fontFamily,C.fontWeight,C.fontStyle,C.fontSize,C.lineHeight]),s.useLayoutEffect(()=>{if(!U)return;const De=X.current,Fe=we.current;if(!De||!Fe)return;const Xe={id:0},ot=()=>{const de=De.offsetWidth||De.getBoundingClientRect().width,Ie=Fe.offsetWidth||Fe.getBoundingClientRect().width;if(D&&de>0&&Ie>0){const it=Ie/R;if(it>0){let ut=de,je=If;if($){const Tt=de*oe.current,Lt=Pe.current,xt=Lt>0?2*Math.PI*Lt/de:0,Et=Of(Tt,xt);ut=Math.max(de,Et*de/(nc-1)),je=Rf}const pt=Math.min(je,Math.max(Ga,Math.ceil(ut/it)+1));if(pt!==R){Q(pt);return}}}Ie>0&&l(Ie)},Oe=()=>{cancelAnimationFrame(Xe.id),Xe.id=requestAnimationFrame(ot)};Oe();const qe=new ResizeObserver(Oe);qe.observe(De),qe.observe(Fe);const nt=()=>{document.hidden||Oe()};return document.addEventListener("visibilitychange",nt),window.addEventListener("pageshow",nt),window.addEventListener("focus",nt),()=>{cancelAnimationFrame(Xe.id),qe.disconnect(),document.removeEventListener("visibilitychange",nt),window.removeEventListener("pageshow",nt),window.removeEventListener("focus",nt)}},[U,z,R,D,$e,$,I,H]),s.useLayoutEffect(()=>{const De=ke.current;if(!De)return;const Fe={id:0},Xe=()=>{const Oe=De.offsetHeight;Oe>0&&ge(qe=>Math.abs(qe-Oe)>.5?Oe:qe)};Fe.id=requestAnimationFrame(Xe);const ot=new ResizeObserver(()=>{cancelAnimationFrame(Fe.id),Fe.id=requestAnimationFrame(Xe)});return ot.observe(De),()=>{cancelAnimationFrame(Fe.id),ot.disconnect()}},[Y,n]),s.useLayoutEffect(()=>{if(!$){f(0),K(0);return}const De=X.current,Fe=we.current;if(!De||!Fe)return;const Xe={id:0},ot=()=>{const qe=De.offsetWidth,nt=Fe.offsetHeight;qe>0&&K(de=>Math.abs(de-qe)>.5?qe:de),nt>0&&f(de=>Math.abs(de-nt)>.5?nt:de)};Xe.id=requestAnimationFrame(ot);const Oe=new ResizeObserver(()=>{cancelAnimationFrame(Xe.id),Xe.id=requestAnimationFrame(ot)});return Oe.observe(De),Oe.observe(Fe),()=>{cancelAnimationFrame(Xe.id),Oe.disconnect()}},[$,z,$e,y,E,U]),s.useLayoutEffect(()=>{if(!U||d<=0)return;const De=te.current;De&&Af(De)},[U,d,u,T]),s.useLayoutEffect(()=>{if(!$||!D)return;const De=X.current;if(!De)return;const Fe={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Xe=()=>{for(const it of Fe.itemsCache)for(const ut of it.glyphs)ic(ut.inner)},ot=()=>{const it=le.current??De;Fe.itemsCache=Array.from(De.querySelectorAll("[data-marquee-text-item]"),ut=>{const je=[];return ut.querySelectorAll("[data-marquee-wave-node]").forEach(pt=>{const Tt=pt.firstElementChild;Tt&&je.push({inner:Tt,layoutLocalX:Hf(pt,it)})}),{item:ut,glyphs:je}}),Fe.cacheDirty=!1},Oe=()=>{Fe.cacheDirty&&ot();const ut=(le.current??De).offsetWidth||1,je=ut*oe.current,pt=Pe.current,Tt=2*Math.PI*pt/ut,Lt=`${ut}|${je}|${Tt}`;if(Lt!==Fe.lutKey&&(Fe.lutKey=Lt,Fe.lut=Cu(je,Tt,$u)),Math.abs(je)<=0||Tt<=0){Xe();return}const xt=te.current,Et=xt?Wf(getComputedStyle(xt).transform):0,Vt=De.getBoundingClientRect(),Ut=Vt.left,Kt=Vt.right,Pt=Fe.lut&&Fe.lut.wavelength>0?Math.max(0,(Fe.lut.periodArc/Fe.lut.wavelength-1)*ut):0;for(const{item:jt,glyphs:on}of Fe.itemsCache){const vt=jt.getBoundingClientRect();if(vt.right<Ut||vt.left>Kt+Pt){for(const Re of on)ic(Re.inner);continue}for(const Re of on){const Ge=Re.layoutLocalX+Et,lt=Fe.lut?Df(Fe.lut,Ge):Ge,ct=Tt*lt,wt=je*Math.sin(ct),It=je*Tt*Math.cos(ct),ht=Math.atan(It)*(180/Math.PI);_f(Re.inner,lt-Ge,wt,ht)}}},qe=()=>{Fe.cancelled||(Fe.raf=0,Oe(),me.current&&!document.hidden&&(Fe.raf=requestAnimationFrame(qe)))},nt=()=>{Fe.cancelled||Fe.raf||(Fe.raf=requestAnimationFrame(qe))},de=()=>{Fe.cacheDirty=!0,Oe(),nt()};Z.current=nt,se.current=de,Oe(),nt();const Ie=()=>{if(document.hidden){cancelAnimationFrame(Fe.raf),Fe.raf=0;return}cancelAnimationFrame(Fe.raf),Fe.raf=0,de()};return document.addEventListener("visibilitychange",Ie),window.addEventListener("pageshow",Ie),window.addEventListener("focus",Ie),()=>{Fe.cancelled=!0,Z.current=null,se.current=null,cancelAnimationFrame(Fe.raf),document.removeEventListener("visibilitychange",Ie),window.removeEventListener("pageshow",Ie),window.removeEventListener("focus",Ie),Xe()}},[$,D]),s.useLayoutEffect(()=>{var De;!$||!D||(De=se.current)==null||De.call(se)},[$,D,r,z,R,$e,I,H,q]),s.useLayoutEffect(()=>{var De;(De=Z.current)==null||De.call(Z)},[k,u]);const V=()=>{_&&ae(!0)},Le=()=>{_&&ae(!1)},ve=$?Math.abs(I)*100:0,J=L(Y),_e={minHeight:J,...$?{paddingTop:`${ve}%`,paddingBottom:`${ve}%`}:{}},Be={height:J,...$?{visibility:"hidden"}:{backgroundColor:P}},at={gap:L(x),minHeight:J},Ue=q*I,et=Math.abs(Ue),Je=ne>0?ne:Ce,Ye=Math.max(Ce,Je),xe=et+Ye/2,We=Math.max(Je,1),He=$&&q>0&&Ye>0?zf(q,Ue,H,xe,We):"",Qe=et*2+Ye,he=He?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${q} ${Qe}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:He,fill:"none",stroke:P,strokeWidth:Je,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,Ne=a.jsx("div",{ref:ke,className:`${o}-ribbon`,style:Be,"aria-hidden":!0}),Ve=(De,Fe,Xe)=>a.jsx(Bf,{item:De,prefix:o,textCss:C,capHeightPx:$e,opticalOffsetY:ye,imageGapPx:L(x),isCurve:$},`${Fe}-${Xe}`),tt=a.jsx("span",{ref:fe,"aria-hidden":!0,className:`${o}-cap-ref`,style:C,children:"H"}),mt=`${Math.max(0,ue)/1e3}s`,st=U?a.jsx("div",{ref:te,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:V,onMouseLeave:Le,style:{WebkitAnimationDuration:mt,animationDuration:mt,WebkitAnimationPlayState:ie,animationPlayState:ie},children:Array.from({length:ce},(De,Fe)=>a.jsx("div",{ref:Fe===0?we:void 0,className:`${o}-marquee-set`,style:{...at,paddingRight:L(x)},"aria-hidden":Fe>0,children:ee.map((Xe,ot)=>Ve(Xe,Fe,ot))},`set-${Fe}`))}):a.jsx("div",{ref:we,className:Ct(`${o}-marquee-set`,`${o}-marquee-static`),style:at,children:t==null?void 0:t.map((De,Fe)=>Ve(De,0,Fe))});return a.jsxs("div",{ref:X,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),tt,a.jsxs("div",{ref:le,className:`${o}-marquee-wrapper`,style:_e,children:[Ne,he,st]})]})},Vf=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2609
2613
|
import cn from 'classnames';
|
|
2610
2614
|
import { CommonComponentProps } from '../props';
|
|
2611
2615
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -3624,7 +3628,7 @@ type MarqueeTextProps = {
|
|
|
3624
3628
|
pointer-events: auto;
|
|
3625
3629
|
z-index: 10;
|
|
3626
3630
|
}
|
|
3627
|
-
`}const Yf=30,oc=2,Kf=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")},Zf=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=
|
|
3631
|
+
`}const Yf=30,oc=2,Kf=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")},Zf=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=N.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:x,corners:v,stroke:m,strokeColor:g,bgColor:h,padding:b,logoMarginTop:E,logoWidth:y,logoHeight:w,captionMarginTop:j}=e,G=!!o,A=((t==null?void 0:t.length)??0)>0,P=d>0&&(!n||i),W=A&&(P||n),Y=Math.max(0,d)*Yf,$=R=>N.scalingValue(R,n??!1),I=s.useRef(null),H=s.useRef(null),O=s.useRef(null),[C,L]=s.useState(0),[D,S]=s.useState(0),U=D>0?D:0,T=s.useMemo(()=>Uf(r,U),[r,U]),[_,B]=s.useState(0),ae=P&&u==="on",[ie,k]=s.useState(!1),ue=s.useRef(null),[X,le]=s.useState(0),[te,we]=s.useState(0),ke=s.useRef(null),fe=R=>{var ee,ce,V,Le,ve;return{fontSettings:{fontFamily:(e==null?void 0:e[`${R}FontFamily`])??"Arial",fontWeight:((ee=e==null?void 0:e[`${R}FontSettings`])==null?void 0:ee.fontWeight)??400,fontStyle:((ce=e==null?void 0:e[`${R}FontSettings`])==null?void 0:ce.fontStyle)??"normal"},textAppearance:{textTransform:((V=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:V.textTransform)??"none",textDecoration:((Le=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:Le.textDecoration)??"none",fontVariant:((ve=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:ve.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${R}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${R}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${R}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${R}LineHeight`])??.01,color:(e==null?void 0:e[`${R}Color`])??"#000000"}},me=fe("text"),Z=fe("caption"),se=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(R=>{var Q,ee;return(((Q=R.text)==null?void 0:Q.length)??0)>0||(((ee=R.caption)==null?void 0:ee.length)??0)>0}),[t]),oe=s.useMemo(()=>!W||(t==null?void 0:t.length)===0?1:D<=0||C<=0?oc:Math.max(oc,Math.ceil(C/D)+1),[W,t==null?void 0:t.length,D,C]);s.useLayoutEffect(()=>{if(!W)return;const R=I.current,Q=O.current;if(!R||!Q)return;let ee=0;const ce=()=>{const ve=R.getBoundingClientRect().width,J=Q.getBoundingClientRect().width,_e=ke.current,Be=typeof _e=="number"&&Math.abs(_e-J)<=.25;if(ke.current=J,L(ve),typeof J=="number"&&J>0&&D<=0){S(J);return}Be&&J!==D?S(J):!Be&&D<=0&&(cancelAnimationFrame(ee),ee=requestAnimationFrame(ce))},V=()=>{cancelAnimationFrame(ee),ee=requestAnimationFrame(ce)};V();const Le=new ResizeObserver(V);return Le.observe(R),Le.observe(Q),()=>{cancelAnimationFrame(ee),Le.disconnect()}},[P,W,D]);const Pe=U>0&&Y>0?U/Y*1e3:0,$e=`${Math.max(0,Pe)/1e3}s`;s.useLayoutEffect(()=>{if(!W||U<=0)return;const R=H.current;R&&Kf(R)},[W,U,c]),s.useLayoutEffect(()=>{if(!W){B(0);return}const R=O.current,Q=H.current;if(!R||!Q)return;const ee=()=>{let V=0;for(let Le=0;Le<R.children.length;Le++){const J=R.children[Le].firstElementChild;J&&(V=Math.max(V,J.offsetHeight))}V<=0&&(V=Q.offsetHeight),B(V>0?V:0)};ee();const ce=new ResizeObserver(ee);return ce.observe(R),ce.observe(Q),()=>{ce.disconnect()}},[W,oe,t,n,p,x,b,m,v,y,w,X,te]);const Me=()=>{ae&&k(!0)},ye=()=>{ae&&k(!1)},be=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),Ce=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),f=s.useCallback((R,Q,ee,ce)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:be,width:"100%"},children:[a.jsx("div",{"data-controls":G?ce==null?void 0:ce.controlsName:void 0,"data-controls-axis":G?"y":void 0,className:G?`${r}-control`:void 0,style:{height:$((ce==null?void 0:ce.marginTop)??0)}}),a.jsx("div",{...ce!=null&&ce.dataMeasureKind?{"data-testimonial-measure":ce.dataMeasureKind}:{},style:{...Qt(R,n),textAlign:Ce,pointerEvents:"auto",...typeof(ce==null?void 0:ce.minHeightPx)=="number"&&ce.minHeightPx>0?{minHeight:ce.minHeightPx}:{}},children:a.jsx(Ki,{content:Q})})]},ee),[be,Ce,n,G,r,$]),q=s.useCallback((R,Q,ee)=>{var ce,V,Le;return a.jsxs("div",{style:{padding:`${$(b.top)} ${$(b.right)} ${$(b.bottom)} ${$(b.left)}`,width:$(x+m*2),height:"100%",borderRadius:$(v),border:`${$(m)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:h}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:be,textAlign:Ce},children:[R.text&&f(me,R.text,"text",ee!=null&&ee.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ee==null?void 0:ee.textMinHeightPx)=="number"&&ee.textMinHeightPx>0?{minHeightPx:ee.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:be,width:"100%"},children:[a.jsx("div",{"data-controls":G&&!(ee!=null&&ee.dataMeasureAttrs)?"logoMarginTop":void 0,className:G&&!(ee!=null&&ee.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(E)}}),a.jsx("div",{style:{width:$(y),height:$(w)},children:((ce=R.logo)==null?void 0:ce.url)&&a.jsx("img",{src:R.logo.url,alt:((V=R.logo)==null?void 0:V.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Le=R.logo)==null?void 0:Le.objectFit)||"contain"}})})]}),R.caption&&f(Z,R.caption,"caption",{...ee!=null&&ee.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:j,...ee!=null&&ee.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ee==null?void 0:ee.captionMinHeightPx)=="number"&&ee.captionMinHeightPx>0?{minHeightPx:ee.captionMinHeightPx}:{}})]})]},Q)},[h,j,Z,x,v,w,E,y,be,Ce,b.bottom,b.left,b.right,b.top,f,m,g,me,n,G,r]),K=s.useCallback(R=>{le(R.maxTextPx),we(R.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!se){K({maxTextPx:0,maxCaptionPx:0});return}const R=ue.current;if(!R)return;const Q=()=>{N.readTestimonialTextMeasure(R,K)};Q();const ee=new ResizeObserver(Q);return ee.observe(R),()=>{ee.disconnect()}},[se,K,t,q]);const ne=se?{textMinHeightPx:X,captionMinHeightPx:te}:void 0,ge=se?a.jsx("div",{ref:ue,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((R,Q)=>q(R,`measure-${Q}`,{dataMeasureAttrs:!0}))}):null,z=(R,Q)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[q(R,`card-${Q}`,ne),G&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${$(p)})`,width:$(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},Q);if(W){const R=P?ae&&ie?"paused":"running":"paused";return a.jsxs("div",{ref:I,className:Ct(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",..._>0?{height:_}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:T}}),ge,a.jsx("div",{ref:H,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:Me,onMouseLeave:ye,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:$e,WebkitAnimationDuration:$e,animationPlayState:R,WebkitAnimationPlayState:R},children:Array.from({length:oe},(Q,ee)=>a.jsx("div",{ref:ee===0?O:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":ee>0,children:t==null?void 0:t.map((ce,V)=>z(ce,`${ee}-${V}`))},`set-${ee}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:T}}),ge,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((R,Q)=>z(R,Q))})]})},Jf=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3628
3632
|
import cn from 'classnames';
|
|
3629
3633
|
import { CommonComponentProps } from '../props';
|
|
3630
3634
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4379,7 +4383,7 @@ type TestimonialsSettings = {
|
|
|
4379
4383
|
width: 100%;
|
|
4380
4384
|
height: 100%;
|
|
4381
4385
|
}
|
|
4382
|
-
`}const ny=3e3,iy=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=
|
|
4386
|
+
`}const ny=3e3,iy=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=N.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:x,captionMarginTop:v,imageWidth:m,imageHeight:g,controlsWidth:h,controlsColor:b,controlsHoverColor:E}=e,y=d>0&&(!n||!!i),[w,j]=s.useState(0),[G,A]=s.useState(null),[P,W]=s.useState(!1),Y=s.useRef(null),$=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),I=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{j(0),A(null),W(!1)},[l.length]);const H=l[w],O=G===null?null:l[G],C=fe=>{var Z,se,oe,Pe,$e;return{fontSettings:{fontFamily:(e==null?void 0:e[`${fe}FontFamily`])??"Arial",fontWeight:((Z=e==null?void 0:e[`${fe}FontSettings`])==null?void 0:Z.fontWeight)??400,fontStyle:((se=e==null?void 0:e[`${fe}FontSettings`])==null?void 0:se.fontStyle)??"normal"},textAppearance:{textTransform:((oe=e==null?void 0:e[`${fe}TextAppearance`])==null?void 0:oe.textTransform)??"none",textDecoration:((Pe=e==null?void 0:e[`${fe}TextAppearance`])==null?void 0:Pe.textDecoration)??"none",fontVariant:(($e=e==null?void 0:e[`${fe}TextAppearance`])==null?void 0:$e.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${fe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${fe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${fe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${fe}WordSpacing`])??0,color:(e==null?void 0:e[`${fe}Color`])??"#000000"}},L=C("text"),D=C("caption"),S=l.length>1&&l.some(fe=>{var me,Z;return(((me=fe.text)==null?void 0:me.length)??0)>0||(((Z=fe.caption)==null?void 0:Z.length)??0)>0}),U=s.useRef(null),[T,_]=s.useState(0),[B,ae]=s.useState(0),ie=e.controls??{mode:"Off",icon:null},k=l.length>1,ue=s.useCallback((fe,me)=>!k||me===fe?fe:(Y.current&&window.clearTimeout(Y.current),A(fe),W(!0),Y.current=window.setTimeout(()=>{A(null),W(!1),Y.current=null},300),me),[k]),X=s.useCallback(()=>{k&&j(fe=>ue(fe,(fe-1+l.length)%l.length))},[k,ue,l.length]),le=s.useCallback(()=>{k&&j(fe=>ue(fe,(fe+1)%l.length))},[k,ue,l.length]);s.useEffect(()=>{if(!y||!k)return;const fe=Math.max(300,ny/d),me=window.setInterval(()=>{j(Z=>ue(Z,(Z+1)%l.length))},fe);return()=>{window.clearInterval(me)}},[y,k,ue,l.length,d]),s.useEffect(()=>()=>{Y.current&&window.clearTimeout(Y.current)},[]);const te=(fe,me)=>{var $e,Me,ye,be;const Z=me==null?void 0:me.textMinHeightPx,se=me==null?void 0:me.captionMinHeightPx,oe=me==null?void 0:me.dataMeasureAttrs,Pe=o&&!(me!=null&&me.dataMeasureAttrs)&&!(me!=null&&me.hideControls);return a.jsxs(a.Fragment,{children:[fe.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Pe?"textMarginTop":void 0,className:Pe?`${r}-control`:void 0,style:{height:N.scalingValue(x??0,n??!1)}}),a.jsx("div",{...oe&&{"data-testimonial-measure":"text"},style:{...Qt(L,n),...Z&&Z>0?{minHeight:Z}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Ki,{content:fe.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Pe?"imageMarginTop":void 0,className:Pe?`${r}-control`:void 0,style:{height:N.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:N.scalingValue(m??0,n??!1),height:N.scalingValue(g??0,n??!1)},children:(($e=fe.image)==null?void 0:$e.url)&&a.jsx("img",{src:(Me=fe.image)==null?void 0:Me.url,alt:((ye=fe.image)==null?void 0:ye.name)??"",className:`${r}-icon`,style:{objectFit:((be=fe.image)==null?void 0:be.objectFit)||"contain"}})})]}),fe.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Pe?"captionMarginTop":void 0,className:Pe?`${r}-control`:void 0,style:{height:N.scalingValue(v??0,n??!1)}}),a.jsx("div",{...oe?{"data-testimonial-measure":"caption"}:{},style:{...Qt(D,n),...se&&se>0?{minHeight:se}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Ki,{content:fe.caption})})]})]})},we=s.useCallback(fe=>{_(fe.maxTextPx),ae(fe.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!S){we({maxTextPx:0,maxCaptionPx:0});return}const fe=U.current;if(!fe)return;const me=()=>{N.readTestimonialTextMeasure(fe,we)};me();const Z=new ResizeObserver(me);return Z.observe(fe),()=>{Z.disconnect()}},[S,we,t]),!H)return a.jsx(a.Fragment,{});const ke=S?{textMinHeightPx:T,captionMinHeightPx:B}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ty(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:N.scalingValue(u??0,n??!1),alignItems:$},children:[S&&a.jsx("div",{ref:U,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((fe,me)=>a.jsx("div",{style:{width:"100%"},children:te(fe,{dataMeasureAttrs:!0})},me))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[O&&P&&a.jsx("div",{className:Ct(`${r}-fade-item-prev`,`${r}-fade-out`),children:te(O,{...ke,hideControls:!0})}),a.jsx("div",{className:Ct(`${r}-fade-item-current`,P?`${r}-fade-in`:void 0),children:te(H,ke)})]})]}),ie.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:N.scalingValue(h??.02,n??!1),height:N.scalingValue(h??.02,n??!1),"--arrow-hover-color":E},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:X,disabled:!k,"aria-label":"Previous testimonial",children:ie.icon&&a.jsx(pn,{url:ie.icon,fill:b,hoverFill:E,className:Ct(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:Ct(`${r}-arrow`,`${r}-next-arrow`),style:{width:N.scalingValue(h??.02,n??!1),height:N.scalingValue(h??.02,n??!1),"--arrow-hover-color":E},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:le,disabled:!k,"aria-label":"Next testimonial",children:ie.icon&&a.jsx(pn,{url:ie.icon,fill:b,hoverFill:E,className:`${r}-arrow-img`})})})]})]})})},oy=`import cn from 'classnames';
|
|
4383
4387
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4384
4388
|
import { CommonComponentProps } from '../props';
|
|
4385
4389
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4875,7 +4879,7 @@ type TestimonialsSettings = {
|
|
|
4875
4879
|
icon?: string | null;
|
|
4876
4880
|
};
|
|
4877
4881
|
};
|
|
4878
|
-
`,ry="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" d="M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),ac={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},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:{...ac.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:{...ac.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:ry},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},sy={element:iy,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:ay,sourceCode:oy,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function ly(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function sc(e){return((e==null?void 0:e.trim().length)??0)>0}function Xa(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function qa(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:
|
|
4882
|
+
`,ry="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" d="M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),ac={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},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:{...ac.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:{...ac.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:ry},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},sy={element:iy,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:ay,sourceCode:oy,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function ly(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function sc(e){return((e==null?void 0:e.trim().length)??0)>0}function Xa(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function qa(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:N.scalingValue((o-t)/2,i)}}function cy(e){return`
|
|
4879
4883
|
.${e}-wrapper {
|
|
4880
4884
|
display: grid;
|
|
4881
4885
|
align-items: start;
|
|
@@ -5222,7 +5226,7 @@ type TestimonialsSettings = {
|
|
|
5222
5226
|
z-index: 2;
|
|
5223
5227
|
width: 100%;
|
|
5224
5228
|
}
|
|
5225
|
-
`}function dy(){return Math.random()<.5?"ltr":"ttb"}function uy(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function py(e){const t=dy();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{uy(e)})})}const Pn=500,my=750,ci="cubic-bezier(0.22, 1, 0.36, 1)",gy=72,hy=50;function fy(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 yy(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function vy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Tu(e){return!Array.isArray(e)||e.length===0?[]:fy(e)?e.flatMap(t=>{const n=yy(t);if(!n)return[];const i=vy(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function qi(e){return e.type==="video"}function xy(e){const t=new Set,n=[];for(const i of e){const o=Tu(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function by({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=>qi(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Sy(e){e.pause(),e.removeAttribute("src"),e.load()}function lc({media:e,className:t,style:n,onMediaClick:i}){return qi(e)?a.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function cc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function wy(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 $y({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{Sy(d)}},[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 Cy({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",v=s.useRef(null),y=s.useRef(null),m=s.useRef(null),g=s.useRef(null),f=s.useRef(0),x=s.useRef(0),R=s.useRef("none"),b=s.useRef(!1),S=s.useRef(!1),G=s.useRef(null),D=s.useRef(0),j=s.useRef(null),P=s.useRef(!1),M=s.useRef(null),K=s.useRef(null),T=s.useRef(null),L=s.useRef(()=>{}),[_,z]=s.useState(null),[$,k]=s.useState(null),[W,w]=s.useState("opening"),[U,C]=s.useState(0),[O,V]=s.useState(0),[se,ie]=s.useState(null),[N,de]=s.useState(!1),[X,ce]=s.useState(!1),[oe,fe]=s.useState(!1),[Pe,xe]=s.useState(null),pe=s.useRef(n),Z=s.useRef(void 0),le=t[n],re=le?qi(le):!1,Ie=O!==0||N,we=se!==null,Me=s.useCallback(he=>{const _e=he.currentTarget,Ve=_e instanceof HTMLVideoElement?{width:_e.videoWidth,height:_e.videoHeight}:{width:_e.naturalWidth,height:_e.naturalHeight};!Ve.width||!Ve.height||xe(Ve)},[]);s.useEffect(()=>{G.current=$},[$]),s.useEffect(()=>{const he=v.current;if(!he)return;const _e=()=>k(cc(he));_e();const Ve=new ResizeObserver(_e);return Ve.observe(he),()=>Ve.disconnect()},[]);const ye=s.useCallback(()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),be=s.useCallback(()=>{const he=K.current;K.current=null,ye(),j.current=null,P.current=!1,ie(null),de(!1),V(0),D.current=0,ce(!1),b.current=!1,x.current=0,R.current="none",he===1?d():he===-1&&l()},[ye,d,l]),Ce=s.useCallback(()=>{ye(),K.current=null,j.current=null,P.current=!1,ie(null),de(!1),V(0),D.current=0},[ye]),h=s.useCallback(()=>{ye(),M.current=window.setTimeout(()=>{K.current!==null&&be()},Pn+32)},[ye,be]),q=s.useCallback((he,_e)=>{var tt;const Ve=((tt=G.current)==null?void 0:tt.width)??0;if(ye(),j.current=he,ie(he),P.current=!0,de(!0),_e){K.current=he;const ft=-he*Ve;D.current=ft,V(ft),h();return}D.current=0,V(0),M.current=window.setTimeout(()=>{M.current=null,Ce()},Pn+32)},[ye,Ce,h]),Y=s.useCallback(he=>{if(!(t.length<=1)){if(P.current){if(K.current===he){T.current=he,be();return}Ce()}ye(),j.current=he,ie(he),P.current=!1,de(!1),D.current=0,V(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(he,!0)})})}},[t.length,q,be,Ce,ye]);L.current=Y;const ee=s.useCallback(he=>{he.propertyName!=="transform"||!P.current||K.current!==null&&be()},[be]),ve=s.useCallback(()=>{const he=y.current;if(!he)return;const _e=cc(he);!_e.width||!_e.height||z(_e)},[]);s.useEffect(()=>{ve();const he=y.current;if(!he)return;const _e=new ResizeObserver(()=>ve());return _e.observe(he),()=>_e.disconnect()},[ve]),s.useEffect(()=>{W==="opening"&&_&&w("open")},[W,_]),s.useEffect(()=>{if(W!=="closing")return;const he=setTimeout(()=>r(),Pn);return()=>clearTimeout(he)},[W,r]),s.useEffect(()=>()=>{ye()},[ye]),s.useLayoutEffect(()=>{pe.current===n&&Z.current===(le==null?void 0:le.url)||(ye(),K.current=null,ie(null),C(0),V(0),de(!1),fe(!1),ce(!1),xe(null),f.current=0,x.current=0,R.current="none",b.current=!1,P.current=!1,D.current=0,j.current=null,g.current=null,S.current=!1,pe.current=n,Z.current=le==null?void 0:le.url)},[n,le==null?void 0:le.url,ye]),s.useLayoutEffect(()=>{const he=T.current;he!==null&&(T.current=null,requestAnimationFrame(()=>{L.current(he)}))},[n,le==null?void 0:le.url]),s.useEffect(()=>{if(W!=="open")return;let he=null;const _e=()=>{he&&(document.removeEventListener("click",he,!0),he=null)},Ve=()=>{_e(),he=Fe=>{Fe.stopPropagation(),Fe.preventDefault(),_e()},document.addEventListener("click",he,!0)},tt=Fe=>{const Ee=Fe<0?1:-1;if(Math.abs(Fe)>hy&&t.length>1){q(Ee,!0);return}q(Ee,!1)},ft=Fe=>{if(Fe.touches.length!==1||P.current)return;const Ee=Fe.touches[0];S.current=!0,g.current={x:Ee.clientX,y:Ee.clientY},R.current="none",x.current=0,b.current=!1},rt=Fe=>{if(!g.current||Fe.touches.length!==1||P.current)return;const Ee=Fe.touches[0],Ze=Ee.clientX-g.current.x,We=Ee.clientY-g.current.y;if(R.current==="none"){if(Math.abs(Ze)<10&&Math.abs(We)<10)return;if(Math.abs(Ze)>Math.abs(We)){if(t.length<=1)return;R.current="horizontal"}else if(We>0)R.current="vertical";else return}if(R.current==="horizontal"){b.current=!0,ce(!0),x.current=Ze;const ot=Ze<0?1:-1;j.current!==ot&&(j.current=ot,ie(ot)),D.current=Ze,V(Ze),Fe.preventDefault();return}R.current==="vertical"&&(b.current=!0,ce(!0),f.current=We,C(We),Fe.preventDefault())},Oe=()=>{if(!g.current)return;const Fe=R.current,Ee=b.current;if(Ee&&Fe==="horizontal")tt(x.current),Ve();else if(Ee&&Fe==="vertical")if(f.current>gy){const We=window.innerHeight;f.current=We,fe(!0),C(We),w("closing")}else f.current=0,C(0),Ve();else Fe==="horizontal"&&Math.abs(x.current)>0&&(tt(x.current),Ve());g.current=null,R.current="none",x.current=0,b.current=!1,ce(!1)};return document.addEventListener("touchstart",ft,{passive:!0}),document.addEventListener("touchmove",rt,{passive:!1}),document.addEventListener("touchend",Oe),document.addEventListener("touchcancel",Oe),()=>{document.removeEventListener("touchstart",ft),document.removeEventListener("touchmove",rt),document.removeEventListener("touchend",Oe),document.removeEventListener("touchcancel",Oe),_e()}},[W,t.length,q]),s.useEffect(()=>{const he=_e=>{_e.key==="Escape"&&(_e.preventDefault(),_e.stopPropagation(),W!=="closing"&&w("closing"))};return window.addEventListener("keydown",he,!0),()=>window.removeEventListener("keydown",he,!0)},[W]);const B=()=>{W!=="closing"&&w("closing")},I=W==="open",Q=W==="closing",ne=U>0?Math.max(0,1-U/500):1,H=U>0?Math.max(.35,1-U/500):1,te=_?p?_:wy(_,Pe):null,ke=he=>{if(he.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const _e=te??he.currentTarget.getBoundingClientRect(),Ve=he.clientY-_e.top,tt=Math.min(52,_e.height*.2);if(!(Ve>_e.height-tt)){if(he.clientX-_e.left<_e.width/2){Y(-1);return}Y(1)}},ge=he=>{if(t.length<=1)return;const _e=te??he.currentTarget.getBoundingClientRect(),Ve=he.clientX-_e.left,tt=he.clientY-_e.top,ft=Math.min(52,_e.height*.2);if(tt>_e.height-ft){he.currentTarget.style.cursor="default";return}he.currentTarget.style.cursor=Ve<_e.width/2?"w-resize":"e-resize"},J={position:"fixed",top:$==null?void 0:$.top,left:$==null?void 0:$.left,width:$==null?void 0:$.width,height:$==null?void 0:$.height,zIndex:9998},Ye=p?"cover":"contain",je=O!==0||U>0?`translate(${O}px, ${U}px)`:void 0,it=X&&!N?"none":N?`transform ${Pn}ms ${ci}`:oe?`transform ${Pn}ms ${ci}, opacity ${Pn}ms ${ci}`:W==="opening"||Q?`opacity ${Pn}ms ${ci}`:"none",qe={...J,transform:je,opacity:U>0?H:W==="opening"||Q?0:1,transition:it,pointerEvents:"none"},et={position:"absolute",top:((te==null?void 0:te.top)??0)-(($==null?void 0:$.top)??0),left:((te==null?void 0:te.left)??0)-(($==null?void 0:$.left)??0),width:te==null?void 0:te.width,height:te==null?void 0:te.height,objectFit:Ye,pointerEvents:re&&I&&!Ie?"auto":"none",touchAction:re&&I?"none":void 0},Je=($==null?void 0:$.width)??0,Ge=we?(n+se+t.length)%t.length:null,$e=Ge!==null?t[Ge]:null,He={...J,transform:we?`translateX(${se*Je+O}px)`:void 0,opacity:1,transition:N?`transform ${Pn}ms ${ci}`:"none",pointerEvents:"none"},De={position:"absolute",top:((_==null?void 0:_.top)??0)-(($==null?void 0:$.top)??0),left:((_==null?void 0:_.left)??0)-(($==null?void 0:$.left)??0),width:_==null?void 0:_.width,height:_==null?void 0:_.height,objectFit:Ye,pointerEvents:"none"},Qe=te?{position:"fixed",top:te.top,height:te.height,width:te.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:v,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:W==="open"?"none":void 0},onClick:B,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:I?ne:0,transition:X?"none":`opacity ${Pn}ms ${ci}`,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:y,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:I?1:0,transition:`opacity ${Pn}ms ${ci}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:I?1:0,transition:`opacity ${Pn}ms ${ci}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),_&&$&&$e&&a.jsx("div",{style:He,onTransitionEnd:ee,children:qi($e)?a.jsx("video",{src:$e.url,muted:!0,playsInline:!0,preload:"auto",style:De},`neighbor-${Ge}-${$e.url}`):a.jsx("img",{src:$e.url,alt:$e.name,style:De},`neighbor-${Ge}-${$e.url}`)}),_&&$&&le&&a.jsx("div",{style:qe,onTransitionEnd:ee,children:re?a.jsx($y,{src:le.url,phase:W,mediaRef:m,mediaStyle:et,onLoadedMetadata:Me,onClick:ke,onMouseMove:ge},`${n}-${le.url}`):a.jsx("img",{ref:m,src:le.url,alt:le.name,onLoad:Me,style:et},`${n}-${le.url}`)}),I&&Qe&&t.length>1&&!re&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Qe,left:te.left,cursor:"w-resize",pointerEvents:X?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),Y(-1)}}),a.jsx("div",{style:{...Qe,left:te.left+te.width/2,cursor:"e-resize",pointerEvents:X?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),Y(1)}})]})]})}function Ty(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ly({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=F.useScopedStyles(),{type:p="a",gridLayout:v,textBoxWidth:y=100,verticalGap:m,entriesCount:g,lightbox:f,imageDisplay:x,imageCorners:R,lightboxImageDisplay:b,slider:S,sliderTiming:G,direction:D,transition:j,titleMarginTop:P,subtitleMarginTop:M,titleColor:K,subtitleColor:T,lightboxCounterColor:L,titleFontFamily:_,titleFontSettings:z,titleFontSize:$,titleLineHeight:k,titleLetterSpacing:W,titleWordSpacing:w,titleTextAppearance:U,subtitleFontFamily:C,subtitleFontSettings:O,subtitleFontSize:V,subtitleLineHeight:se,subtitleLetterSpacing:ie,subtitleWordSpacing:N,subtitleTextAppearance:de,lightboxCounterFontFamily:X,lightboxCounterFontSettings:ce,lightboxCounterFontSize:oe,lightboxCounterLineHeight:fe,lightboxCounterLetterSpacing:Pe,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:pe,showText:Z="always",alignEntries:le="off",align:re="top"}=e,Ie={fontSettings:{fontFamily:_,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:$??.01,lineHeight:k,letterSpacing:W??0,wordSpacing:w??0,textAppearance:U,color:K},Me={...dn(Qt(Ie,n))},ye={fontSettings:{fontFamily:C,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:V??.01,lineHeight:se,letterSpacing:ie??0,wordSpacing:N??0,textAppearance:de,color:T},Ce={...dn(Qt(ye,n))},h={fontSettings:{fontFamily:X,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:oe??.01,lineHeight:fe,letterSpacing:Pe??0,wordSpacing:xe??0,textAppearance:pe,color:L},Y={...dn(Qt(h,n)),...qa(oe,fe,u,n)},ee=Xa($,k,`${u}-item-title`,`${u}-text-tight-leading`),ve=Xa(V,se,`${u}-item-subtitle`,`${u}-text-tight-leading`),B=qa($,k,u,n),I=qa(V,se,u,n),Q=Xa(oe,fe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ne=F.buildColorVars(u,{titleColor:K,subtitleColor:T,lightboxCounterColor:L},Iy,Ry),ke=`${l&&l!=="default"?`${u}-state-${l}`:""}${Z==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ge=g===0?1/0:g,J=(t??[]).slice(0,ge),Ye=s.useMemo(()=>f==="on"?xy(J):[],[J,f]),je=v.entryWidth??.2,it=(x==null?void 0:x.display)==="cover",qe=(x==null?void 0:x.ratioValue)??"1:1",et=(x==null?void 0:x.reversed)??!1,[Je,Ge]=qe.split(":").map(Number),De=`${et?Ge:Je} / ${et?Je:Ge}`,Qe=v.columnsCount,he=F.scalingValue(je??0,n),_e=he,Ve=!it&&S!=="off",tt=J.length%Qe||Qe,ft=tt<Qe&&J.length>0,rt=J.length-tt,Oe=ft?Math.floor((Qe-tt)/2)+1:1,Fe=R?F.scalingValue(R,n):void 0,Ee={width:_e,...it?{aspectRatio:De,height:"auto",overflow:"hidden"}:{height:"auto"},...Fe?{borderRadius:Fe,overflow:"hidden"}:{}},Ze=`${u}-item-image-wrapper${Ve?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),We=p==="d"||p==="e"||p==="f",ot=le==="on",nt=`calc(${F.scalingValue(je??0,n)} * (${y} / 100))`,me=F.scalingValue(je*y/100,n),Ne=it?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Fe?{borderRadius:Fe}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Fe?{borderRadius:Fe}:{}},[st,ut]=s.useState(0),Be=s.useRef(null),pt=j==="fade"||D==="horizontal"?"ltr":D==="vertical"?"ttb":"ltr";s.useEffect(()=>{const vt=Be.current;if(!vt)return;const Le=new ResizeObserver(Xe=>{ut(Math.round(Xe[0].contentRect.width))});return Le.observe(vt),()=>Le.disconnect()},[]);const Tt=(()=>{const vt={...ne},Le=Be.current?getComputedStyle(Be.current).getPropertyValue("--cntrl-article-width").trim():"";return Le&&(vt["--cntrl-article-width"]=Le),vt})(),[Lt,xt]=s.useState(!1),[Et,Vt]=s.useState([]),[Ut,Kt]=s.useState(0),Pt=f==="on"&&(!n||i),jt=(vt,Le)=>{n&&!i||f!=="off"&&(Vt(vt),Kt(Le),xt(!0))};s.useEffect(()=>{if(!Lt||f!=="on"||typeof document>"u")return;const vt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=vt}},[Lt,f]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const on=s.useMemo(()=>cy(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:on}}),f==="on"&&a.jsx(by,{mediaList:Ye}),a.jsx("div",{style:ne,children:a.jsx("div",{ref:Be,className:`${u}-wrapper ${u}-type-${p}${ot?` ${u}-align-entries`:""} ${u}-image-align-${re} ${ke}`.trim(),style:{gridTemplateColumns:`repeat(${Qe}, ${he})`,rowGap:ot?0:F.scalingValue(m??0,n),columnGap:F.scalingValue(v.horizontalGap??0,n),width:F.scalingValue(v.wrapperWidth??0,n),...ot?{[`--${u}-align-entries-row-gap`]:F.scalingValue(m??0,n)}:{}},children:J.map((vt,Le)=>{var Bt;const Xe=sc(vt.title),lt=sc(vt.subtitle),ct=(((Bt=vt.link)==null?void 0:Bt.length)??0)>0&&f==="off"?vt.link:void 0,wt=Math.floor(Le/Qe)===Math.ceil(J.length/Qe)-1,It=ft&&Le>=rt?`${Oe+(Le-rt)}`:void 0,gt=We?a.jsxs("div",{className:`${u}-item-text-block`,children:[Xe&&a.jsx("p",{className:ee,style:{width:nt,...Me,...B},children:vt.title}),Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(P??0,n),width:me}}),lt&&a.jsx("p",{className:ve,style:{width:nt,...Ce,...I},children:vt.subtitle}),lt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(M??0,n),width:me}})]}):null,Ot=ot?a.jsxs("div",{className:`${u}-item-title-row`,children:[!We&&a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?F.scalingValue(P??0,n):0,width:me}}),Xe&&a.jsx("p",{className:ee,style:{width:nt,...Me,...B},children:vt.title}),We&&Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(P??0,n),width:me}})]}):null,_t=ot?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!We&&a.jsx("div",{"data-controls":o&<?"subtitleMarginTop":void 0,className:o&<?`${u}-control`:void 0,style:{height:lt?F.scalingValue(M??0,n):0,width:me}}),lt&&a.jsx("p",{className:ve,style:{width:nt,...Ce,...I},children:vt.subtitle}),We&<&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(M??0,n),width:me}})]}):null,Mt=ct?a.jsxs("a",{href:ct,target:"_blank",className:`${u}-item-text-link`,children:[Ot,_t]}):a.jsxs(a.Fragment,{children:[Ot,_t]}),Gt=Tu(vt.gallery),Xt=Gt.filter(bt=>bt.lightboxMedia).map(bt=>bt.lightboxMedia),Dt=a.jsx("div",{className:Ze,style:Ee,children:Gt.length===0?null:S==="off"?(()=>{const{displayMedia:bt,lightboxMedia:A}=Gt[0],Te=A?Xt.findIndex(Ae=>Ae.url===A.url):-1;return a.jsx(lc,{media:bt,className:`${u}-item-${qi(bt)?"video":"image"}`.trim(),style:Ne,onMediaClick:Pt&&Te>=0?()=>jt(Xt,Te):void 0})})():a.jsxs(a.Fragment,{children:[Ve&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Gt.map(({displayMedia:bt})=>qi(bt)?a.jsx("video",{src:bt.url,muted:!0,playsInline:!0},`sizer-${bt.url}`):a.jsx("img",{src:bt.url,alt:""},`sizer-${bt.url}`))}),a.jsx(xl,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:G*1e3,width:"100%",height:"100%",speed:my,type:j==="fade"?"fade":"loop",rewind:j==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:pt},onMoved:bt=>{D!=="random"||j==="fade"||py(bt)},children:Gt.map(({displayMedia:bt,lightboxMedia:A},Te)=>{const Ae=A?Xt.findIndex(ze=>ze.url===A.url):-1;return a.jsx(bl,{children:a.jsx(lc,{media:bt,className:`${u}-item-${qi(bt)?"video":"image"}`.trim(),style:Ne,onMediaClick:Pt&&Ae>=0?()=>jt(Xt,Ae):void 0})},Te)})},`${j}-${je}-${D}-${G}-${st}-${d}`)]})}),zt=We?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?F.scalingValue(P??0,n):0,width:me}}),a.jsx("p",{className:ee,style:{width:nt,...Me,...B},children:vt.title}),a.jsx("div",{"data-controls":o&<?"subtitleMarginTop":void 0,className:o&<?`${u}-control`:void 0,style:{height:lt?F.scalingValue(M??0,n):0,width:me}}),a.jsx("p",{className:ve,style:{width:nt,...Ce,...I},children:vt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:It&&!ot?{gridColumn:It}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${ot&&wt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(y??0)>100?`calc(${he} * (${y} / 100))`:he,...It&&ot?{gridColumn:It}:{}},children:ot?a.jsx(a.Fragment,{children:We?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:ct,target:"_blank",className:`${u}-item-image-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:ct,target:"_blank",className:`${u}-item-image-link`,children:Dt}),Mt]})}):ct?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:ct,target:"_blank",className:`${u}-item-image-link`,children:[gt,Dt]}),!We&&a.jsx("a",{href:ct,target:"_blank",className:`${u}-item-text-link`,children:zt})]}):a.jsxs(a.Fragment,{children:[gt,Dt,zt]})})},Le)})})}),(!n||i)&&Lt&&typeof document<"u"&&f==="on"&&(()=>{const vt=(c?document.getElementById(c):null)??document.body;return ai.createPortal(a.jsx("div",{style:Tt,"data-selection":"none",children:a.jsx(Cy,{prefix:u,items:Et,index:Ut,imageDisplay:Ty(b),isEditor:n,onClose:()=>xt(!1),onPrev:()=>Kt(Le=>(Le-1+Et.length)%Et.length),onNext:()=>Kt(Le=>(Le+1)%Et.length),counterClassName:Q,counterStyle:Y})}),vt)})()]})}const Iy={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Ry=["hover","focus","filled","success","error"],Py=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5229
|
+
`}function dy(){return Math.random()<.5?"ltr":"ttb"}function uy(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function py(e){const t=dy();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{uy(e)})})}const Pn=500,my=750,di="cubic-bezier(0.22, 1, 0.36, 1)",gy=72,hy=50;function fy(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 yy(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function vy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Tu(e){return!Array.isArray(e)||e.length===0?[]:fy(e)?e.flatMap(t=>{const n=yy(t);if(!n)return[];const i=vy(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function qi(e){return e.type==="video"}function xy(e){const t=new Set,n=[];for(const i of e){const o=Tu(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function by({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=>qi(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Sy(e){e.pause(),e.removeAttribute("src"),e.load()}function lc({media:e,className:t,style:n,onMediaClick:i}){return qi(e)?a.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function cc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function wy(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 $y({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{Sy(d)}},[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 Cy({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",x=s.useRef(null),v=s.useRef(null),m=s.useRef(null),g=s.useRef(null),h=s.useRef(0),b=s.useRef(0),E=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),j=s.useRef(null),G=s.useRef(0),A=s.useRef(null),P=s.useRef(!1),W=s.useRef(null),Y=s.useRef(null),$=s.useRef(null),I=s.useRef(()=>{}),[H,O]=s.useState(null),[C,L]=s.useState(null),[D,S]=s.useState("opening"),[U,T]=s.useState(0),[_,B]=s.useState(0),[ae,ie]=s.useState(null),[k,ue]=s.useState(!1),[X,le]=s.useState(!1),[te,we]=s.useState(!1),[ke,fe]=s.useState(null),me=s.useRef(n),Z=s.useRef(void 0),se=t[n],oe=se?qi(se):!1,Pe=_!==0||k,$e=ae!==null,Me=s.useCallback(he=>{const Ne=he.currentTarget,Ve=Ne instanceof HTMLVideoElement?{width:Ne.videoWidth,height:Ne.videoHeight}:{width:Ne.naturalWidth,height:Ne.naturalHeight};!Ve.width||!Ve.height||fe(Ve)},[]);s.useEffect(()=>{j.current=C},[C]),s.useEffect(()=>{const he=x.current;if(!he)return;const Ne=()=>L(cc(he));Ne();const Ve=new ResizeObserver(Ne);return Ve.observe(he),()=>Ve.disconnect()},[]);const ye=s.useCallback(()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),be=s.useCallback(()=>{const he=Y.current;Y.current=null,ye(),A.current=null,P.current=!1,ie(null),ue(!1),B(0),G.current=0,le(!1),y.current=!1,b.current=0,E.current="none",he===1?d():he===-1&&l()},[ye,d,l]),Ce=s.useCallback(()=>{ye(),Y.current=null,A.current=null,P.current=!1,ie(null),ue(!1),B(0),G.current=0},[ye]),f=s.useCallback(()=>{ye(),W.current=window.setTimeout(()=>{Y.current!==null&&be()},Pn+32)},[ye,be]),q=s.useCallback((he,Ne)=>{var tt;const Ve=((tt=j.current)==null?void 0:tt.width)??0;if(ye(),A.current=he,ie(he),P.current=!0,ue(!0),Ne){Y.current=he;const mt=-he*Ve;G.current=mt,B(mt),f();return}G.current=0,B(0),W.current=window.setTimeout(()=>{W.current=null,Ce()},Pn+32)},[ye,Ce,f]),K=s.useCallback(he=>{if(!(t.length<=1)){if(P.current){if(Y.current===he){$.current=he,be();return}Ce()}ye(),A.current=he,ie(he),P.current=!1,ue(!1),G.current=0,B(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(he,!0)})})}},[t.length,q,be,Ce,ye]);I.current=K;const ne=s.useCallback(he=>{he.propertyName!=="transform"||!P.current||Y.current!==null&&be()},[be]),ge=s.useCallback(()=>{const he=v.current;if(!he)return;const Ne=cc(he);!Ne.width||!Ne.height||O(Ne)},[]);s.useEffect(()=>{ge();const he=v.current;if(!he)return;const Ne=new ResizeObserver(()=>ge());return Ne.observe(he),()=>Ne.disconnect()},[ge]),s.useEffect(()=>{D==="opening"&&H&&S("open")},[D,H]),s.useEffect(()=>{if(D!=="closing")return;const he=setTimeout(()=>r(),Pn);return()=>clearTimeout(he)},[D,r]),s.useEffect(()=>()=>{ye()},[ye]),s.useLayoutEffect(()=>{me.current===n&&Z.current===(se==null?void 0:se.url)||(ye(),Y.current=null,ie(null),T(0),B(0),ue(!1),we(!1),le(!1),fe(null),h.current=0,b.current=0,E.current="none",y.current=!1,P.current=!1,G.current=0,A.current=null,g.current=null,w.current=!1,me.current=n,Z.current=se==null?void 0:se.url)},[n,se==null?void 0:se.url,ye]),s.useLayoutEffect(()=>{const he=$.current;he!==null&&($.current=null,requestAnimationFrame(()=>{I.current(he)}))},[n,se==null?void 0:se.url]),s.useEffect(()=>{if(D!=="open")return;let he=null;const Ne=()=>{he&&(document.removeEventListener("click",he,!0),he=null)},Ve=()=>{Ne(),he=Fe=>{Fe.stopPropagation(),Fe.preventDefault(),Ne()},document.addEventListener("click",he,!0)},tt=Fe=>{const Xe=Fe<0?1:-1;if(Math.abs(Fe)>hy&&t.length>1){q(Xe,!0);return}q(Xe,!1)},mt=Fe=>{if(Fe.touches.length!==1||P.current)return;const Xe=Fe.touches[0];w.current=!0,g.current={x:Xe.clientX,y:Xe.clientY},E.current="none",b.current=0,y.current=!1},st=Fe=>{if(!g.current||Fe.touches.length!==1||P.current)return;const Xe=Fe.touches[0],ot=Xe.clientX-g.current.x,Oe=Xe.clientY-g.current.y;if(E.current==="none"){if(Math.abs(ot)<10&&Math.abs(Oe)<10)return;if(Math.abs(ot)>Math.abs(Oe)){if(t.length<=1)return;E.current="horizontal"}else if(Oe>0)E.current="vertical";else return}if(E.current==="horizontal"){y.current=!0,le(!0),b.current=ot;const qe=ot<0?1:-1;A.current!==qe&&(A.current=qe,ie(qe)),G.current=ot,B(ot),Fe.preventDefault();return}E.current==="vertical"&&(y.current=!0,le(!0),h.current=Oe,T(Oe),Fe.preventDefault())},De=()=>{if(!g.current)return;const Fe=E.current,Xe=y.current;if(Xe&&Fe==="horizontal")tt(b.current),Ve();else if(Xe&&Fe==="vertical")if(h.current>gy){const Oe=window.innerHeight;h.current=Oe,we(!0),T(Oe),S("closing")}else h.current=0,T(0),Ve();else Fe==="horizontal"&&Math.abs(b.current)>0&&(tt(b.current),Ve());g.current=null,E.current="none",b.current=0,y.current=!1,le(!1)};return document.addEventListener("touchstart",mt,{passive:!0}),document.addEventListener("touchmove",st,{passive:!1}),document.addEventListener("touchend",De),document.addEventListener("touchcancel",De),()=>{document.removeEventListener("touchstart",mt),document.removeEventListener("touchmove",st),document.removeEventListener("touchend",De),document.removeEventListener("touchcancel",De),Ne()}},[D,t.length,q]),s.useEffect(()=>{const he=Ne=>{Ne.key==="Escape"&&(Ne.preventDefault(),Ne.stopPropagation(),D!=="closing"&&S("closing"))};return window.addEventListener("keydown",he,!0),()=>window.removeEventListener("keydown",he,!0)},[D]);const z=()=>{D!=="closing"&&S("closing")},R=D==="open",Q=D==="closing",ee=U>0?Math.max(0,1-U/500):1,ce=U>0?Math.max(.35,1-U/500):1,V=H?p?H:wy(H,ke):null,Le=he=>{if(he.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const Ne=V??he.currentTarget.getBoundingClientRect(),Ve=he.clientY-Ne.top,tt=Math.min(52,Ne.height*.2);if(!(Ve>Ne.height-tt)){if(he.clientX-Ne.left<Ne.width/2){K(-1);return}K(1)}},ve=he=>{if(t.length<=1)return;const Ne=V??he.currentTarget.getBoundingClientRect(),Ve=he.clientX-Ne.left,tt=he.clientY-Ne.top,mt=Math.min(52,Ne.height*.2);if(tt>Ne.height-mt){he.currentTarget.style.cursor="default";return}he.currentTarget.style.cursor=Ve<Ne.width/2?"w-resize":"e-resize"},J={position:"fixed",top:C==null?void 0:C.top,left:C==null?void 0:C.left,width:C==null?void 0:C.width,height:C==null?void 0:C.height,zIndex:9998},_e=p?"cover":"contain",Be=_!==0||U>0?`translate(${_}px, ${U}px)`:void 0,at=X&&!k?"none":k?`transform ${Pn}ms ${di}`:te?`transform ${Pn}ms ${di}, opacity ${Pn}ms ${di}`:D==="opening"||Q?`opacity ${Pn}ms ${di}`:"none",Ue={...J,transform:Be,opacity:U>0?ce:D==="opening"||Q?0:1,transition:at,pointerEvents:"none"},et={position:"absolute",top:((V==null?void 0:V.top)??0)-((C==null?void 0:C.top)??0),left:((V==null?void 0:V.left)??0)-((C==null?void 0:C.left)??0),width:V==null?void 0:V.width,height:V==null?void 0:V.height,objectFit:_e,pointerEvents:oe&&R&&!Pe?"auto":"none",touchAction:oe&&R?"none":void 0},Je=(C==null?void 0:C.width)??0,Ye=$e?(n+ae+t.length)%t.length:null,xe=Ye!==null?t[Ye]:null,We={...J,transform:$e?`translateX(${ae*Je+_}px)`:void 0,opacity:1,transition:k?`transform ${Pn}ms ${di}`:"none",pointerEvents:"none"},He={position:"absolute",top:((H==null?void 0:H.top)??0)-((C==null?void 0:C.top)??0),left:((H==null?void 0:H.left)??0)-((C==null?void 0:C.left)??0),width:H==null?void 0:H.width,height:H==null?void 0:H.height,objectFit:_e,pointerEvents:"none"},Qe=V?{position:"fixed",top:V.top,height:V.height,width:V.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:D==="open"?"none":void 0},onClick:z,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:R?ee:0,transition:X?"none":`opacity ${Pn}ms ${di}`,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 ${Pn}ms ${di}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,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 ${Pn}ms ${di}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),H&&C&&xe&&a.jsx("div",{style:We,onTransitionEnd:ne,children:qi(xe)?a.jsx("video",{src:xe.url,muted:!0,playsInline:!0,preload:"auto",style:He},`neighbor-${Ye}-${xe.url}`):a.jsx("img",{src:xe.url,alt:xe.name,style:He},`neighbor-${Ye}-${xe.url}`)}),H&&C&&se&&a.jsx("div",{style:Ue,onTransitionEnd:ne,children:oe?a.jsx($y,{src:se.url,phase:D,mediaRef:m,mediaStyle:et,onLoadedMetadata:Me,onClick:Le,onMouseMove:ve},`${n}-${se.url}`):a.jsx("img",{ref:m,src:se.url,alt:se.name,onLoad:Me,style:et},`${n}-${se.url}`)}),R&&Qe&&t.length>1&&!oe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Qe,left:V.left,cursor:"w-resize",pointerEvents:X?"none":"auto"},onClick:he=>{if(w.current){w.current=!1;return}he.stopPropagation(),K(-1)}}),a.jsx("div",{style:{...Qe,left:V.left+V.width/2,cursor:"e-resize",pointerEvents:X?"none":"auto"},onClick:he=>{if(w.current){w.current=!1;return}he.stopPropagation(),K(1)}})]})]})}function Ty(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ly({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=N.useScopedStyles(),{type:p="a",gridLayout:x,textBoxWidth:v=100,verticalGap:m,entriesCount:g,lightbox:h,imageDisplay:b,imageCorners:E,lightboxImageDisplay:y,slider:w,sliderTiming:j,direction:G,transition:A,titleMarginTop:P,subtitleMarginTop:W,titleColor:Y,subtitleColor:$,lightboxCounterColor:I,titleFontFamily:H,titleFontSettings:O,titleFontSize:C,titleLineHeight:L,titleLetterSpacing:D,titleWordSpacing:S,titleTextAppearance:U,subtitleFontFamily:T,subtitleFontSettings:_,subtitleFontSize:B,subtitleLineHeight:ae,subtitleLetterSpacing:ie,subtitleWordSpacing:k,subtitleTextAppearance:ue,lightboxCounterFontFamily:X,lightboxCounterFontSettings:le,lightboxCounterFontSize:te,lightboxCounterLineHeight:we,lightboxCounterLetterSpacing:ke,lightboxCounterWordSpacing:fe,lightboxCounterTextAppearance:me,showText:Z="always",alignEntries:se="off",align:oe="top"}=e,Pe={fontSettings:{fontFamily:H,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:C??.01,lineHeight:L,letterSpacing:D??0,wordSpacing:S??0,textAppearance:U,color:Y},Me={...dn(Qt(Pe,n))},ye={fontSettings:{fontFamily:T,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:B??.01,lineHeight:ae,letterSpacing:ie??0,wordSpacing:k??0,textAppearance:ue,color:$},Ce={...dn(Qt(ye,n))},f={fontSettings:{fontFamily:X,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:te??.01,lineHeight:we,letterSpacing:ke??0,wordSpacing:fe??0,textAppearance:me,color:I},K={...dn(Qt(f,n)),...qa(te,we,u,n)},ne=Xa(C,L,`${u}-item-title`,`${u}-text-tight-leading`),ge=Xa(B,ae,`${u}-item-subtitle`,`${u}-text-tight-leading`),z=qa(C,L,u,n),R=qa(B,ae,u,n),Q=Xa(te,we,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ee=N.buildColorVars(u,{titleColor:Y,subtitleColor:$,lightboxCounterColor:I},Iy,Ry),Le=`${l&&l!=="default"?`${u}-state-${l}`:""}${Z==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ve=g===0?1/0:g,J=(t??[]).slice(0,ve),_e=s.useMemo(()=>h==="on"?xy(J):[],[J,h]),Be=x.entryWidth??.2,at=(b==null?void 0:b.display)==="cover",Ue=(b==null?void 0:b.ratioValue)??"1:1",et=(b==null?void 0:b.reversed)??!1,[Je,Ye]=Ue.split(":").map(Number),He=`${et?Ye:Je} / ${et?Je:Ye}`,Qe=x.columnsCount,he=N.scalingValue(Be??0,n),Ne=he,Ve=!at&&w!=="off",tt=J.length%Qe||Qe,mt=tt<Qe&&J.length>0,st=J.length-tt,De=mt?Math.floor((Qe-tt)/2)+1:1,Fe=E?N.scalingValue(E,n):void 0,Xe={width:Ne,...at?{aspectRatio:He,height:"auto",overflow:"hidden"}:{height:"auto"},...Fe?{borderRadius:Fe,overflow:"hidden"}:{}},ot=`${u}-item-image-wrapper${Ve?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Oe=p==="d"||p==="e"||p==="f",qe=se==="on",nt=`calc(${N.scalingValue(Be??0,n)} * (${v} / 100))`,de=N.scalingValue(Be*v/100,n),Ie=at?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Fe?{borderRadius:Fe}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Fe?{borderRadius:Fe}:{}},[it,ut]=s.useState(0),je=s.useRef(null),pt=A==="fade"||G==="horizontal"?"ltr":G==="vertical"?"ttb":"ltr";s.useEffect(()=>{const vt=je.current;if(!vt)return;const Re=new ResizeObserver(Ge=>{ut(Math.round(Ge[0].contentRect.width))});return Re.observe(vt),()=>Re.disconnect()},[]);const Tt=(()=>{const vt={...ee},Re=je.current?getComputedStyle(je.current).getPropertyValue("--cntrl-article-width").trim():"";return Re&&(vt["--cntrl-article-width"]=Re),vt})(),[Lt,xt]=s.useState(!1),[Et,Vt]=s.useState([]),[Ut,Kt]=s.useState(0),Pt=h==="on"&&(!n||i),jt=(vt,Re)=>{n&&!i||h!=="off"&&(Vt(vt),Kt(Re),xt(!0))};s.useEffect(()=>{if(!Lt||h!=="on"||typeof document>"u")return;const vt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=vt}},[Lt,h]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const on=s.useMemo(()=>cy(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:on}}),h==="on"&&a.jsx(by,{mediaList:_e}),a.jsx("div",{style:ee,children:a.jsx("div",{ref:je,className:`${u}-wrapper ${u}-type-${p}${qe?` ${u}-align-entries`:""} ${u}-image-align-${oe} ${Le}`.trim(),style:{gridTemplateColumns:`repeat(${Qe}, ${he})`,rowGap:qe?0:N.scalingValue(m??0,n),columnGap:N.scalingValue(x.horizontalGap??0,n),width:N.scalingValue(x.wrapperWidth??0,n),...qe?{[`--${u}-align-entries-row-gap`]:N.scalingValue(m??0,n)}:{}},children:J.map((vt,Re)=>{var Bt;const Ge=sc(vt.title),lt=sc(vt.subtitle),ct=(((Bt=vt.link)==null?void 0:Bt.length)??0)>0&&h==="off"?vt.link:void 0,wt=Math.floor(Re/Qe)===Math.ceil(J.length/Qe)-1,It=mt&&Re>=st?`${De+(Re-st)}`:void 0,ht=Oe?a.jsxs("div",{className:`${u}-item-text-block`,children:[Ge&&a.jsx("p",{className:ne,style:{width:nt,...Me,...z},children:vt.title}),Ge&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:N.scalingValue(P??0,n),width:de}}),lt&&a.jsx("p",{className:ge,style:{width:nt,...Ce,...R},children:vt.subtitle}),lt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:N.scalingValue(W??0,n),width:de}})]}):null,Ot=qe?a.jsxs("div",{className:`${u}-item-title-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&Ge?"titleMarginTop":void 0,className:o&&Ge?`${u}-control`:void 0,style:{height:Ge?N.scalingValue(P??0,n):0,width:de}}),Ge&&a.jsx("p",{className:ne,style:{width:nt,...Me,...z},children:vt.title}),Oe&&Ge&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:N.scalingValue(P??0,n),width:de}})]}):null,_t=qe?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&<?"subtitleMarginTop":void 0,className:o&<?`${u}-control`:void 0,style:{height:lt?N.scalingValue(W??0,n):0,width:de}}),lt&&a.jsx("p",{className:ge,style:{width:nt,...Ce,...R},children:vt.subtitle}),Oe&<&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:N.scalingValue(W??0,n),width:de}})]}):null,Mt=ct?a.jsxs("a",{href:ct,target:"_blank",className:`${u}-item-text-link`,children:[Ot,_t]}):a.jsxs(a.Fragment,{children:[Ot,_t]}),Gt=Tu(vt.gallery),Xt=Gt.filter(bt=>bt.lightboxMedia).map(bt=>bt.lightboxMedia),Dt=a.jsx("div",{className:ot,style:Xe,children:Gt.length===0?null:w==="off"?(()=>{const{displayMedia:bt,lightboxMedia:F}=Gt[0],Te=F?Xt.findIndex(Ae=>Ae.url===F.url):-1;return a.jsx(lc,{media:bt,className:`${u}-item-${qi(bt)?"video":"image"}`.trim(),style:Ie,onMediaClick:Pt&&Te>=0?()=>jt(Xt,Te):void 0})})():a.jsxs(a.Fragment,{children:[Ve&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Gt.map(({displayMedia:bt})=>qi(bt)?a.jsx("video",{src:bt.url,muted:!0,playsInline:!0},`sizer-${bt.url}`):a.jsx("img",{src:bt.url,alt:""},`sizer-${bt.url}`))}),a.jsx(xl,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:j*1e3,width:"100%",height:"100%",speed:my,type:A==="fade"?"fade":"loop",rewind:A==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:pt},onMoved:bt=>{G!=="random"||A==="fade"||py(bt)},children:Gt.map(({displayMedia:bt,lightboxMedia:F},Te)=>{const Ae=F?Xt.findIndex(ze=>ze.url===F.url):-1;return a.jsx(bl,{children:a.jsx(lc,{media:bt,className:`${u}-item-${qi(bt)?"video":"image"}`.trim(),style:Ie,onMediaClick:Pt&&Ae>=0?()=>jt(Xt,Ae):void 0})},Te)})},`${A}-${Be}-${G}-${j}-${it}-${d}`)]})}),zt=Oe?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Ge?"titleMarginTop":void 0,className:o&&Ge?`${u}-control`:void 0,style:{height:Ge?N.scalingValue(P??0,n):0,width:de}}),a.jsx("p",{className:ne,style:{width:nt,...Me,...z},children:vt.title}),a.jsx("div",{"data-controls":o&<?"subtitleMarginTop":void 0,className:o&<?`${u}-control`:void 0,style:{height:lt?N.scalingValue(W??0,n):0,width:de}}),a.jsx("p",{className:ge,style:{width:nt,...Ce,...R},children:vt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:It&&!qe?{gridColumn:It}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${qe&&wt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(v??0)>100?`calc(${he} * (${v} / 100))`:he,...It&&qe?{gridColumn:It}:{}},children:qe?a.jsx(a.Fragment,{children:Oe?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:ct,target:"_blank",className:`${u}-item-image-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:ct,target:"_blank",className:`${u}-item-image-link`,children:Dt}),Mt]})}):ct?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:ct,target:"_blank",className:`${u}-item-image-link`,children:[ht,Dt]}),!Oe&&a.jsx("a",{href:ct,target:"_blank",className:`${u}-item-text-link`,children:zt})]}):a.jsxs(a.Fragment,{children:[ht,Dt,zt]})})},Re)})})}),(!n||i)&&Lt&&typeof document<"u"&&h==="on"&&(()=>{const vt=(c?document.getElementById(c):null)??document.body;return si.createPortal(a.jsx("div",{style:Tt,"data-selection":"none",children:a.jsx(Cy,{prefix:u,items:Et,index:Ut,imageDisplay:Ty(y),isEditor:n,onClose:()=>xt(!1),onPrev:()=>Kt(Re=>(Re-1+Et.length)%Et.length),onNext:()=>Kt(Re=>(Re+1)%Et.length),counterClassName:Q,counterStyle:K})}),vt)})()]})}const Iy={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Ry=["hover","focus","filled","success","error"],Py=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5226
5230
|
import '@splidejs/react-splide/css/core';
|
|
5227
5231
|
import { CommonComponentProps } from '../props';
|
|
5228
5232
|
import {
|
|
@@ -7275,7 +7279,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
7275
7279
|
};
|
|
7276
7280
|
|
|
7277
7281
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
7278
|
-
`,Ua={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ky=["titleColor","subtitleColor","lightboxCounterColor"],Ey={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ua.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:{...Ua.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:{...Ua.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:[...ky],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},My={element:Ly,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:Ey,sourceCode:Py},Ay=50,dc=10,Sl="cntrl-lightbox-journal",Ea=Sl,Fs=`${Sl}-`,Ma=e=>`${Sl}-${e}`,wl=e=>e===Ea||e.startsWith(Fs),uc=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},pc=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=uc(t.get(Ma(e)));if(i)return i}const n=uc(t.get(Ea));if(n)return n;for(const[i]of t){if(!i.startsWith(Fs))continue;const o=i.slice(Fs.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},mc=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Lu=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{wl(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Ma(t),String(e)):i.searchParams.set(Ea,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Fy=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Ma(e)||i===Ea:wl(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)}},Iu=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Ma(e)):[...t.keys()].some(n=>wl(n))},Ny=(e,t)=>{if(Iu(t)){if(e){window.history.back();return}Fy(t)}},_y=20,Wy=2,Ya=e=>`max(${e}, ${_y}px)`,Io=e=>((e==null?void 0:e.image)??[]).slice(0,Wy),Ru=e=>e.reduce((t,n)=>t+Io(n).length,0),Hy=(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}},Oy=(e,t)=>{const n=Ru(e),{start:i,end:o}=Hy(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},oa=(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)})),Dy=(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 Oy(i,o)},gc=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",zy=(e,t,n)=>e==="B"?t.length>1:Ru(n)>1,Cn=.004,vi=.004,So={title1Width:.13,title2Width:.13,title3Width:.14},xi=(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},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},gr=(e,t)=>Ro(e,t),hn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},bi=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ro(e.length,n),effective:gr(e.length,n)}},Pu=(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),ku=(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),Ci=["title1","title2","title3","count"],yt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,$l={title1:"1",title2:"2",title3:"3",count:"Count"},Cl=e=>[yt(e,"fontFamily"),yt(e,"fontSettings"),{type:"row",items:[yt(e,"fontSize"),yt(e,"lineHeight"),yt(e,"letterSpacing"),yt(e,"wordSpacing")]},yt(e,"textAlign"),yt(e,"textAppearance")],By=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ci.map(e=>[$l[e],Cl(e)]))}),jy={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Vy={title1:.02,title2:.02,title3:.02,count:.017},Bi=(e,t)=>{const n=i=>{const o=yt(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[jy[t]]}},ji=(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??Vy[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)};function Eu({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:v=0,title3MarginLeft:y=0,titleRowMarginBottom:m=0,titleHeaderLayout:g="desktop",contentMarginTop:f=0,iconMarginRight:x=0,closeIcon:R=null,closeIconMaxWidth:b=0,closeIconColor:S="#000000",closeIconHoverColor:G="#cccccc"}=n,D=F.scalingValue(f,i),j=F.scalingValue(x,i),P=F.scalingValue(m,i),M=g==="mobile",K=ji("title1",Bi(n,"title1"),i),T=ji("title2",Bi(n,"title2"),i),L=ji("title3",Bi(n,"title3"),i),_=s.useMemo(()=>({title1Width:d??So.title1Width,title2Width:c??So.title2Width,title3Width:u??So.title3Width}),[d,c,u]),z=s.useMemo(()=>({title2MarginLeft:v,title3MarginLeft:y}),[v,y]),$=s.useMemo(()=>xi(e,t,K,T,L),[e,t,K,T,L]),k=s.useMemo(()=>$.map(H=>_[H.widthKey]),[$,_]),W=s.useMemo(()=>Ro($.length,k),[$.length,k]),w=s.useMemo(()=>gr($.length,k),[$.length,k]),U=s.useMemo(()=>$.filter(H=>H.prefix==="title1"),[$]),C=s.useMemo(()=>$.filter(H=>H.prefix==="title2"||H.prefix==="title3"),[$]),O=s.useMemo(()=>bi(U,_),[U,_]),V=s.useMemo(()=>bi(C,_),[C,_]),se=!!(t.title1||t.title2||t.title3),ie=R!==null;if(!(se||ie))return null;const de=(p??0)>0||o,X=(H,te)=>{const ke=$.findIndex(J=>J.prefix===H.prefix);if(!M||te==="single-row")return{effectiveWidth:w[ke]??0,resolvedWidth:W[ke]??0,maxWidth:hn(ke,W)};if(te==="two-row-top"){const J=U.findIndex(Ye=>Ye.prefix===H.prefix);return{effectiveWidth:O.effective[J]??0,resolvedWidth:O.resolved[J]??0,maxWidth:hn(J,O.resolved)}}const ge=C.findIndex(J=>J.prefix===H.prefix);return{effectiveWidth:V.effective[ge]??0,resolvedWidth:V.resolved[ge]??0,maxWidth:hn(ge,V.resolved)}},ce=(H,te,ke)=>{if(!M||ke==="single-row"){const it=H.findIndex(Ge=>Ge.prefix===te.prefix),qe=H.map(Ge=>_[Ge.widthKey]),et=Ro(H.length,qe);return{effectiveWidth:gr(H.length,qe)[it]??0,resolvedWidth:et[it]??0,maxWidth:hn(it,et)}}if(ke==="two-row-top"){const it=H.filter(Ge=>Ge.prefix==="title1"),qe=it.findIndex(Ge=>Ge.prefix===te.prefix),{resolved:et,effective:Je}=bi(it,_);return{effectiveWidth:Je[qe]??0,resolvedWidth:et[qe]??0,maxWidth:hn(qe,et)}}const ge=H.filter(it=>it.prefix==="title2"||it.prefix==="title3"),J=ge.findIndex(it=>it.prefix===te.prefix),{resolved:Ye,effective:je}=bi(ge,_);return{effectiveWidth:je[J]??0,resolvedWidth:Ye[J]??0,maxWidth:hn(J,Ye)}},oe=H=>ku($,W,z,H)+(M?0:p??0),fe=()=>M?0:p??0,Pe=H=>C.slice(0,H).reduce((te,ke,ge)=>te+(ke.marginLeftKey?z[ke.marginLeftKey]??0:0)+(V.resolved[ge]??0),0),xe=H=>{const te=C[H];return Pe(H)+(te.marginLeftKey?z[te.marginLeftKey]??0:0)+(V.resolved[H]??0)},pe=(H,te,ke)=>{const ge=H.marginLeftKey?z[H.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Ye,maxWidth:je}=ke??X(H,te),it=Math.max(ge,vi),qe=o&&te==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":H.prefix,style:{width:F.scalingValue(J,i),...ge>0?{marginLeft:F.scalingValue(ge,i)}:{}},children:[a.jsx("p",{className:H.className,style:H.style,children:H.text}),qe&&H.marginLeftKey?a.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ye),style:{position:"absolute",top:0,left:F.scalingValue(-ge,i),width:F.scalingValue(it,i),height:"100%",pointerEvents:"auto"}}):null,qe?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:F.scalingValue(-Cn/2,i),width:F.scalingValue(Cn,i),height:"100%",pointerEvents:"auto"}}):null]},H.className)},Z=(H="two-row")=>{const te=$.findIndex(J=>J.prefix==="title1"),ke=te>=0?W[te]:_.title1Width,ge=H==="two-row"&&o;return a.jsx("div",{...ge?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke)}:{},style:{width:F.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ge?{pointerEvents:"auto"}:{}}})},le=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:K,"aria-hidden":"true",children:" "}),re=H=>{const te=xi(e,H,K,T,L);return a.jsx(a.Fragment,{children:te.map(ke=>pe(ke,"single-row",ce(te,ke,"single-row")))})},Ie=H=>{const te=xi(e,H,K,T,L),ke=te.find(ge=>ge.prefix==="title1");return ke?pe(ke,"two-row-top",ce(te,ke,"two-row-top")):null},we=(H,te=!1)=>{const ke=xi(e,H,K,T,L),ge=ke.filter(je=>je.prefix==="title2"||je.prefix==="title3"),J=o&&te;return ge.length>0||J||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ge.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:ge.map(je=>pe(je,"two-row-bottom",ce(ke,je,"two-row-bottom")))}),te&&o?a.jsxs(a.Fragment,{children:[ee(),ve()]}):null]}):null,(m??0)>0||J?a.jsx("div",{"data-controls":J?"titleRowMarginBottom":void 0,"data-controls-axis":J?"y":void 0,"data-controls-reverse":J?"":void 0,className:J?`${e}-control`:void 0,style:{height:P,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},Me=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(b??0,i),height:F.scalingValue(b??0,i),marginRight:j,"--close-icon-hover-color":G},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:H=>{H.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(pn,{url:R??"",fill:S,hoverFill:i&&!r?S:G,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:j,height:"100%",pointerEvents:"auto"}})]}),ye=()=>ie?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:Me()}):null,be=H=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:H})}),Ce=H=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[ie||se?le():null,de?Z("two-row"):null,be(H),ye()]}),h=(H,te=!1)=>a.jsxs(a.Fragment,{children:[Ce(Ie(H)),we(H,te)]}),q=()=>{const H=M?-1:$.findIndex(ge=>ge.prefix==="title1"),te=!M&&(o||(p??0)>0)?(()=>{const ge=p??0,J=H>=0?W[H]:_.title1Width,Ye=Math.max(ge,vi);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(J),style:{position:"absolute",top:0,left:0,width:F.scalingValue(Ye,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ke=$.flatMap((ge,J)=>{if(!ge.marginLeftKey)return[];const Ye=z[ge.marginLeftKey]??0,je=Pu($,W,z,J)+fe(),it=Math.max(Ye,vi);return a.jsx("div",{"data-controls":ge.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(W[J]),style:{position:"absolute",top:0,left:F.scalingValue(je,i),width:F.scalingValue(it,i),height:"100%",pointerEvents:"auto"}},ge.marginLeftKey)});return te?[te,...ke]:ke},Y=()=>$.map((H,te)=>{const ke=hn(te,W),J=oe(te)-Cn/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(ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:F.scalingValue(J,i),width:F.scalingValue(Cn,i),height:"100%",pointerEvents:"auto"}})},`${H.widthKey}-junction`)}),ee=()=>C.flatMap((H,te)=>{if(!H.marginLeftKey)return[];const ke=z[H.marginLeftKey]??0,ge=Pe(te),J=Math.max(ke,vi),{resolvedWidth:Ye}=X(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(Ye),style:{position:"absolute",top:0,left:F.scalingValue(ge,i),width:F.scalingValue(J,i),height:"100%",pointerEvents:"auto"}},H.marginLeftKey)}),ve=()=>C.map((H,te)=>{const{maxWidth:ke}=X(H,"two-row-bottom"),J=xe(te)-Cn/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(ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:F.scalingValue(J,i),width:F.scalingValue(Cn,i),height:"100%",pointerEvents:"auto"}})},`${H.widthKey}-junction`)}),B=()=>!o||M?null:a.jsxs(a.Fragment,{children:[q(),Y()]}),I=!!(t.title2||t.title3||(m??0)>0||o),Q=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ie||se?le():null,de?Z("single-row"):null,se?be(re(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ye(),B()]}),ne=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...I?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:I?void 0:{flex:"0 0 auto",height:"auto"},children:h(t,!0)}),B()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:D,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...M?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${M?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${M?` ${e}-text-bar-cell-stacked`:""}`,style:M?void 0:{flex:1,minWidth:0,width:"100%"},children:M?ne():Q()})})})]})}function Gy(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xy(e){return`
|
|
7282
|
+
`,Ua={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ky=["titleColor","subtitleColor","lightboxCounterColor"],Ey={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ua.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:{...Ua.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:{...Ua.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:[...ky],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},My={element:Ly,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:Ey,sourceCode:Py},Ay=50,dc=10,Sl="cntrl-lightbox-journal",Ea=Sl,Fs=`${Sl}-`,Ma=e=>`${Sl}-${e}`,wl=e=>e===Ea||e.startsWith(Fs),uc=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},pc=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=uc(t.get(Ma(e)));if(i)return i}const n=uc(t.get(Ea));if(n)return n;for(const[i]of t){if(!i.startsWith(Fs))continue;const o=i.slice(Fs.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},mc=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Lu=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{wl(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Ma(t),String(e)):i.searchParams.set(Ea,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Fy=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Ma(e)||i===Ea:wl(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)}},Iu=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Ma(e)):[...t.keys()].some(n=>wl(n))},Ny=(e,t)=>{if(Iu(t)){if(e){window.history.back();return}Fy(t)}},_y=20,Wy=2,Ya=e=>`max(${e}, ${_y}px)`,Io=e=>((e==null?void 0:e.image)??[]).slice(0,Wy),Ru=e=>e.reduce((t,n)=>t+Io(n).length,0),Hy=(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}},Oy=(e,t)=>{const n=Ru(e),{start:i,end:o}=Hy(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},oa=(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)})),Dy=(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 Oy(i,o)},gc=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",zy=(e,t,n)=>e==="B"?t.length>1:Ru(n)>1,Cn=.004,Qn=.004,So={title1Width:.13,title2Width:.13,title3Width:.14},xi=(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},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},gr=(e,t)=>Ro(e,t),hn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},bi=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ro(e.length,n),effective:gr(e.length,n)}},Pu=(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),ku=(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),Ci=["title1","title2","title3","count"],yt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,$l={title1:"1",title2:"2",title3:"3",count:"Count"},Cl=e=>[yt(e,"fontFamily"),yt(e,"fontSettings"),{type:"row",items:[yt(e,"fontSize"),yt(e,"lineHeight"),yt(e,"letterSpacing"),yt(e,"wordSpacing")]},yt(e,"textAlign"),yt(e,"textAppearance")],By=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ci.map(e=>[$l[e],Cl(e)]))}),jy={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Vy={title1:.02,title2:.02,title3:.02,count:.017},Bi=(e,t)=>{const n=i=>{const o=yt(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[jy[t]]}},ji=(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??Vy[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)};function Eu({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:x=0,title3MarginLeft:v=0,titleRowMarginBottom:m=0,titleHeaderLayout:g="desktop",contentMarginTop:h=0,iconMarginRight:b=0,closeIcon:E=null,closeIconMaxWidth:y=0,closeIconColor:w="#000000",closeIconHoverColor:j="#cccccc"}=n,G=N.scalingValue(h,i),A=N.scalingValue(Math.max(h,Qn),i),P=N.scalingValue(b,i),W=N.scalingValue(m,i),Y=g==="mobile",$=ji("title1",Bi(n,"title1"),i),I=ji("title2",Bi(n,"title2"),i),H=ji("title3",Bi(n,"title3"),i),O=s.useMemo(()=>({title1Width:d??So.title1Width,title2Width:c??So.title2Width,title3Width:u??So.title3Width}),[d,c,u]),C=s.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:v}),[x,v]),L=s.useMemo(()=>xi(e,t,$,I,H),[e,t,$,I,H]),D=s.useMemo(()=>L.map(V=>O[V.widthKey]),[L,O]),S=s.useMemo(()=>Ro(L.length,D),[L.length,D]),U=s.useMemo(()=>gr(L.length,D),[L.length,D]),T=s.useMemo(()=>L.filter(V=>V.prefix==="title1"),[L]),_=s.useMemo(()=>L.filter(V=>V.prefix==="title2"||V.prefix==="title3"),[L]),B=s.useMemo(()=>bi(T,O),[T,O]),ae=s.useMemo(()=>bi(_,O),[_,O]),ie=!!(t.title1||t.title2||t.title3),k=E!==null;if(!(ie||k))return null;const X=(p??0)>0||o,le=(V,Le)=>{const ve=L.findIndex(_e=>_e.prefix===V.prefix);if(!Y||Le==="single-row")return{effectiveWidth:U[ve]??0,resolvedWidth:S[ve]??0,maxWidth:hn(ve,S)};if(Le==="two-row-top"){const _e=T.findIndex(Be=>Be.prefix===V.prefix);return{effectiveWidth:B.effective[_e]??0,resolvedWidth:B.resolved[_e]??0,maxWidth:hn(_e,B.resolved)}}const J=_.findIndex(_e=>_e.prefix===V.prefix);return{effectiveWidth:ae.effective[J]??0,resolvedWidth:ae.resolved[J]??0,maxWidth:hn(J,ae.resolved)}},te=(V,Le,ve)=>{if(!Y||ve==="single-row"){const Ue=V.findIndex(xe=>xe.prefix===Le.prefix),et=V.map(xe=>O[xe.widthKey]),Je=Ro(V.length,et);return{effectiveWidth:gr(V.length,et)[Ue]??0,resolvedWidth:Je[Ue]??0,maxWidth:hn(Ue,Je)}}if(ve==="two-row-top"){const Ue=V.filter(xe=>xe.prefix==="title1"),et=Ue.findIndex(xe=>xe.prefix===Le.prefix),{resolved:Je,effective:Ye}=bi(Ue,O);return{effectiveWidth:Ye[et]??0,resolvedWidth:Je[et]??0,maxWidth:hn(et,Je)}}const J=V.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),_e=J.findIndex(Ue=>Ue.prefix===Le.prefix),{resolved:Be,effective:at}=bi(J,O);return{effectiveWidth:at[_e]??0,resolvedWidth:Be[_e]??0,maxWidth:hn(_e,Be)}},we=V=>ku(L,S,C,V)+(Y?0:p??0),ke=()=>Y?0:p??0,fe=V=>_.slice(0,V).reduce((Le,ve,J)=>Le+(ve.marginLeftKey?C[ve.marginLeftKey]??0:0)+(ae.resolved[J]??0),0),me=V=>{const Le=_[V];return fe(V)+(Le.marginLeftKey?C[Le.marginLeftKey]??0:0)+(ae.resolved[V]??0)},Z=(V,Le,ve)=>{const J=V.marginLeftKey?C[V.marginLeftKey]??0:0,{effectiveWidth:_e,resolvedWidth:Be,maxWidth:at}=ve??le(V,Le),Ue=Math.max(J,Qn),et=o&&Le==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":V.prefix,style:{width:N.scalingValue(_e,i),...J>0?{marginLeft:N.scalingValue(J,i)}:{}},children:[a.jsx("p",{className:V.className,style:V.style,children:V.text}),et&&V.marginLeftKey?a.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Be),style:{position:"absolute",top:0,left:N.scalingValue(-J,i),width:N.scalingValue(Ue,i),height:"100%",pointerEvents:"auto"}}):null,et?a.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(at),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:N.scalingValue(-Cn/2,i),width:N.scalingValue(Cn,i),height:"100%",pointerEvents:"auto"}}):null]},V.className)},se=(V="two-row")=>{const Le=L.findIndex(_e=>_e.prefix==="title1"),ve=Le>=0?S[Le]:O.title1Width,J=V==="two-row"&&o;return a.jsx("div",{...J?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ve)}:{},style:{width:N.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...J?{pointerEvents:"auto"}:{}}})},oe=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:$,"aria-hidden":"true",children:" "}),Pe=V=>{const Le=xi(e,V,$,I,H);return a.jsx(a.Fragment,{children:Le.map(ve=>Z(ve,"single-row",te(Le,ve,"single-row")))})},$e=V=>{const Le=xi(e,V,$,I,H),ve=Le.find(J=>J.prefix==="title1");return ve?Z(ve,"two-row-top",te(Le,ve,"two-row-top")):null},Me=(V,Le=!1)=>{const ve=xi(e,V,$,I,H),J=ve.filter(at=>at.prefix==="title2"||at.prefix==="title3"),_e=o&&Le;return J.length>0||_e||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[J.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:J.map(at=>Z(at,"two-row-bottom",te(ve,at,"two-row-bottom")))}),Le&&o?a.jsxs(a.Fragment,{children:[ge(),z()]}):null]}):null,(m??0)>0||_e?a.jsx("div",{"data-controls":_e?"titleRowMarginBottom":void 0,"data-controls-axis":_e?"y":void 0,"data-controls-reverse":_e?"":void 0,className:_e?`${e}-control`:void 0,style:{height:W,width:"100%",flexShrink:0,pointerEvents:_e?"auto":"none"}}):null]}):null},ye=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:N.scalingValue(y??0,i),height:N.scalingValue(y??0,i),marginRight:P,"--close-icon-hover-color":j},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:V=>{V.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(pn,{url:E??"",fill:w,hoverFill:i&&!r?w:j,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:P,height:"100%",pointerEvents:"auto"}})]}),be=()=>k?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:ye()}):null,Ce=V=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:V})}),f=V=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[k||ie?oe():null,X?se("two-row"):null,Ce(V),be()]}),q=(V,Le=!1)=>a.jsxs(a.Fragment,{children:[f($e(V)),Me(V,Le)]}),K=()=>{const V=Y?-1:L.findIndex(J=>J.prefix==="title1"),Le=!Y&&(o||(p??0)>0)?(()=>{const J=p??0,_e=V>=0?S[V]:O.title1Width,Be=Math.max(J,Qn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(_e),style:{position:"absolute",top:0,left:0,width:N.scalingValue(Be,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ve=L.flatMap((J,_e)=>{if(!J.marginLeftKey)return[];const Be=C[J.marginLeftKey]??0,at=Pu(L,S,C,_e)+ke(),Ue=Math.max(Be,Qn);return a.jsx("div",{"data-controls":J.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(S[_e]),style:{position:"absolute",top:0,left:N.scalingValue(at,i),width:N.scalingValue(Ue,i),height:"100%",pointerEvents:"auto"}},J.marginLeftKey)});return Le?[Le,...ve]:ve},ne=()=>L.map((V,Le)=>{const ve=hn(Le,S),_e=we(Le)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ve),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:N.scalingValue(_e,i),width:N.scalingValue(Cn,i),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),ge=()=>_.flatMap((V,Le)=>{if(!V.marginLeftKey)return[];const ve=C[V.marginLeftKey]??0,J=fe(Le),_e=Math.max(ve,Qn),{resolvedWidth:Be}=le(V,"two-row-bottom");return a.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Be),style:{position:"absolute",top:0,left:N.scalingValue(J,i),width:N.scalingValue(_e,i),height:"100%",pointerEvents:"auto"}},V.marginLeftKey)}),z=()=>_.map((V,Le)=>{const{maxWidth:ve}=le(V,"two-row-bottom"),_e=me(Le)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ve),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:N.scalingValue(_e,i),width:N.scalingValue(Cn,i),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),R=()=>!o||Y?null:a.jsxs(a.Fragment,{children:[K(),ne()]}),Q=!!(t.title2||t.title3||(m??0)>0||o),ee=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[k||ie?oe():null,X?se("single-row"):null,ie?Ce(Pe(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),be(),R()]}),ce=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Q?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Q?void 0:{flex:"0 0 auto",height:"auto"},children:q(t,!0)}),R()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:G,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:A,pointerEvents:"auto"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Y?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${Y?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${Y?` ${e}-text-bar-cell-stacked`:""}`,style:Y?void 0:{flex:1,minWidth:0,width:"100%"},children:Y?ce():ee()})})})]})}function Gy(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xy(e){return`
|
|
7279
7283
|
.${e}-wrapper {
|
|
7280
7284
|
display: grid;
|
|
7281
7285
|
align-items: start;
|
|
@@ -7595,7 +7599,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7595
7599
|
pointer-events: auto;
|
|
7596
7600
|
flex-shrink: 0;
|
|
7597
7601
|
}
|
|
7598
|
-
`}const hc={url:"",name:"",objectFit:"cover"},_n=500,qo=650,xn="cubic-bezier(0.22, 1, 0.36, 1)",qy=72,Uy=50,Yy=1e4,Ky=650,Zy=500;function Jy(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 Mu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=pa(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Qy(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Mu(i,n):null}function ev(e){return e.reduce((t,n,i)=>{const o=Tl(n.gallery),l=Ll(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function er(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 fc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return er(e,i,n)}const tv=.03;function Au(e){return e.width*tv}const Ka={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function _r(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function yc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function nv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ns(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function iv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ns(e,t.width,t.height)}function ov(e,t){if(Bo(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function rv(e){const t=new Set,n=[];for(const i of e){const o=Tl(i.gallery),r=Ll(o);for(const l of r)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function av({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.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Po(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Au(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function ma(e,t,n){const i=Po(e,t,n);return{...i,left:2*i.left-e.left}}function sv(e,t,n){const{left:i,width:o}=n,r=Au(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 Fu(e,t,n,i){const o=Po(e,"left",i),r=Po(e,"right",i),l=ma(e,"left",i),d=ma(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:d,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:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function lv(e,t,n,i){const{start:o,end:r}=Fu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function cv(e,t,n){const i=Po(e,t,n),o=ma(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Nu(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 Tl(e){if(!e)return;if(Nu(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??hc,i??o??hc]}]}function dv(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function uv(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ll(e){if(!Array.isArray(e)||e.length===0)return[];if(Nu(e)){const t=[];for(const n of e){const i=dv(n);if(!i)continue;const o=uv(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Bo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function pv({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Bo(e)?a.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):a.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function mv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function Wr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Bo(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function gv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:y,resolveCloseSourceRect:m,onClose:g,onPrev:f,onNext:x}){const R=s.useRef(null),b=s.useRef(null),S=s.useRef(null),G=s.useRef(new Map),[D,j]=s.useState(0),P=s.useRef(null),M=s.useRef(0),K=s.useRef(0),T=s.useRef("none"),L=s.useRef(!1),_=s.useRef(!1),z=s.useRef(!1),$=s.useRef(null),k=s.useRef(null),W=s.useRef(null),w=s.useRef(()=>{}),U=s.useRef(null),C=s.useRef(null),O=s.useRef(null),V=s.useRef(!1),[se,ie]=s.useState(null),[N,de]=s.useState(Ka),[X,ce]=s.useState(0),[oe,fe]=s.useState("opening"),[Pe,xe]=s.useState(0),[pe,Z]=s.useState(0),[le,re]=s.useState(!1),[Ie,we]=s.useState(null),[Me,ye]=s.useState(null),[be,Ce]=s.useState(null),[h,q]=s.useState(!1),[Y,ee]=s.useState(null),[ve,B]=s.useState(!1),I=s.useRef(!1),[Q,ne]=s.useState(!1),[H,te]=s.useState(!1),ke=s.useRef(n),ge=s.useRef(void 0),J=t[n],Ye=J?Bo(J):!1,je=pe!==0||le,it=!l&&(!r||!!d),qe=c&&!l,et=u.length>1,Je=s.useCallback((A,Te)=>t.length<=1?null:t[(A+Te+t.length)%t.length]??null,[t]),Ge=et?er(u,p,-1):Je(n,-1),$e=et?er(u,p,1):Je(n,1),He=Ie===-1&&je?et&&Me!==null?er(u,Me,-1):be!==null?Je(be,-1):null:null,De=Ie===1&&je?et&&Me!==null?er(u,Me,1):be!==null?Je(be,1):null:null,Qe=He&&He.url!==(Ge==null?void 0:Ge.url)?He:null,he=De&&De.url!==($e==null?void 0:$e.url)?De:null,_e=Ge&&qe?(()=>{const A=et?fc(u,p,-1):t.length>2?Je((n-1+t.length)%t.length,-1):null;return A&&A.url!==Ge.url?A:null})():null,Ve=$e&&qe?(()=>{const A=et?fc(u,p,1):t.length>2?Je((n+1)%t.length,1):null;return A&&A.url!==$e.url?A:null})():null,tt=Qe??_e,ft=he??Ve,rt=s.useCallback((A,Te,Ae)=>{if(!A||!Te||!Ae)return;const ze=G.current,mt=ze.get(A);(mt==null?void 0:mt.width)===Te&&(mt==null?void 0:mt.height)===Ae||(ze.set(A,{width:Te,height:Ae}),j(Nt=>Nt+1))},[]),Oe=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const Te=G.current.get(A.url);return iv(b.current,Te)},[D,X]),Fe=s.useCallback(()=>{if(!J)return;const A=Oe(J);if(A){ie(A);return}const Te=b.current;Te&&ie(yc(Te))},[J,Oe]),Ee=s.useCallback(A=>{if(et){const Te=u.length;ye((p+A+Te)%Te),Ce(null);return}t.length>1&&(Ce((n+A+t.length)%t.length),ye(null))},[et,u.length,p,t.length,n]),Ze=s.useCallback(A=>{z.current=A,re(A)},[]),We=s.useCallback(()=>{$.current!==null&&(window.clearTimeout($.current),$.current=null)},[]),ot=s.useCallback(()=>{We(),$.current=window.setTimeout(()=>{We(),Ze(!1)},qo+32)},[We,Ze]),nt=s.useCallback(()=>{const A=R.current;if(!A){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ka.width,height:typeof window<"u"?window.innerHeight:Ka.height});return}const Te=A.getBoundingClientRect();de({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),me=s.useCallback((A,Te)=>{if(je){if(Q&&!le)return`translate(${pe}px, 0px)`;if(le&&Ie!==null){const Ae=Oe(A);if(!Ae)return;const{x:ze,y:mt}=lv(Ae,Te,Ie,N);return`translate(${ze}px, ${mt}px)`}if(le)return"translate(0px, 0px)"}},[je,Q,le,pe,Ie,N,Oe]),Ne=s.useCallback(()=>{const A=k.current;k.current=null,We(),Ze(!1),we(null),ye(null),Ce(null),Z(0),ne(!1),L.current=!1,K.current=0,T.current="none",A===-1?f():A===1&&x()},[We,Ze,f,x]),st=s.useCallback(()=>{We(),$.current=window.setTimeout(()=>{k.current!==null&&Ne()},qo+32)},[We,Ne]),ut=s.useCallback(()=>{We(),k.current=null,Ze(!1),we(null),ye(null),Ce(null),Z(0),ne(!1),L.current=!1,K.current=0,T.current="none"},[We,Ze]),Be=s.useCallback(A=>{if(!(!qe||!se)){if(z.current){if(k.current===A){W.current=A,Ne();return}ut()}We(),Ee(A),k.current=A,we(A),Ze(!0),st()}},[qe,se,Ne,ut,We,Ee,Ze,st]);w.current=Be;const pt=s.useCallback(()=>{U.current=null,V.current=!1,C.current!==null&&(window.clearInterval(C.current),C.current=null),O.current!==null&&(window.clearTimeout(O.current),O.current=null)},[]),Tt=s.useCallback(A=>{C.current!==null&&window.clearInterval(C.current);const Te=V.current?Zy:Ky;C.current=window.setInterval(()=>{w.current(A)},Te)},[]),Lt=s.useCallback(A=>{U.current!==A&&(pt(),U.current=A,V.current=!1,w.current(A),Tt(A),O.current=window.setTimeout(()=>{O.current=null,U.current===A&&(V.current=!0,Tt(A))},Yy))},[pt,Tt]),xt=s.useCallback(()=>{const A=b.current;if(!A)return;const Te=J==null?void 0:J.url,Ae=Te?G.current.get(Te):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){ie(Ns(A,Ae.width,Ae.height));return}const ze=S.current;if(ze&&Te&&(ze.src===Te||ze.currentSrc===Te)){const{width:Nt,height:ht}=nv(ze);if(Nt&&ht){rt(Te,Nt,ht),ie(Ns(A,Nt,ht));return}}const mt=yc(A);!mt.width||!mt.height||ie(mt)},[J==null?void 0:J.url,rt]),Et=s.useCallback(A=>{if(S.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&xt();return}A.complete&&A.naturalWidth>0&&xt()}},[xt]),Vt=s.useCallback(()=>{nt(),xt(),ce(A=>A+1)},[nt,xt]);s.useEffect(()=>{Vt();const A=b.current,Te=R.current,Ae=new ResizeObserver(()=>Vt());return A&&Ae.observe(A),Te&&Ae.observe(Te),window.addEventListener("resize",Vt),()=>{Ae.disconnect(),window.removeEventListener("resize",Vt)}},[Vt,n,v]),s.useLayoutEffect(()=>{if(!J)return;const A=S.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){xt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Fe()},[Fe,D]),s.useEffect(()=>{const A=new Set,Te=[],Ae=ze=>{!(ze!=null&&ze.url)||A.has(ze.url)||(A.add(ze.url),Te.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Te.forEach(ze=>{G.current.has(ze.url)||ov(ze,rt)})},[t,u,rt]),s.useEffect(()=>{if(oe!=="opening"||!se)return;if(!y){fe("open");return}q(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),fe("open")})});return()=>cancelAnimationFrame(A)},[oe,se,y]),s.useEffect(()=>{if(oe!=="closing")return;const A=setTimeout(()=>g(),_n);return()=>clearTimeout(A)},[oe,g]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{ke.current===n&&ge.current===(J==null?void 0:J.url)||(We(),k.current=null,we(null),ye(null),Ce(null),xe(0),Z(0),Ze(!1),te(!1),ne(!1),M.current=0,K.current=0,T.current="none",L.current=!1,P.current=null,_.current=!1,S.current=null,Fe(),ke.current=n,ge.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Ze,We,Fe]),s.useLayoutEffect(()=>{const A=W.current;A!==null&&(W.current=null,requestAnimationFrame(()=>{w.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(oe==="opening"){I.current=!1,B(!1);return}if(oe!=="open"||I.current)return;if(!Ge&&!$e){I.current=!0;return}B(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),I.current=!0})});return()=>cancelAnimationFrame(A)},[oe,Ge==null?void 0:Ge.url,$e==null?void 0:$e.url]),s.useEffect(()=>{if(oe!=="open")return;const A=()=>{const ht=St=>{St.stopPropagation(),St.preventDefault(),document.removeEventListener("click",ht,!0)};document.addEventListener("click",ht,!0)},Te=ht=>{const St=ht<0?1:-1;We(),Ee(St),k.current=St,we(St),Ze(!0),st()},Ae=ht=>{if(Math.abs(ht)>Uy&&qe){Te(ht);return}k.current=null,we(null),ye(null),Ce(null),Ze(!0),Z(0),ot()},ze=ht=>{if(ht.touches.length!==1||z.current)return;const St=ht.touches[0];_.current=!0,P.current={x:St.clientX,y:St.clientY},T.current="none",K.current=0,L.current=!1},mt=ht=>{if(!P.current||ht.touches.length!==1||z.current)return;const St=ht.touches[0],qt=St.clientX-P.current.x,At=St.clientY-P.current.y;if(T.current==="none"){if(Math.abs(qt)<10&&Math.abs(At)<10)return;if(Math.abs(qt)>Math.abs(At)){if(!qe)return;T.current="horizontal"}else if(At>0){if(!it)return;T.current="vertical"}else return}if(T.current==="horizontal"){L.current=!0,ne(!0),K.current=qt,Z(qt),ht.preventDefault();return}T.current==="vertical"&&(L.current=!0,ne(!0),M.current=At,xe(At),ht.preventDefault())},Nt=()=>{if(!P.current)return;const ht=T.current,St=L.current;if(St&&ht==="horizontal")Ae(K.current),A();else if(St&&ht==="vertical"){const qt=M.current;if(it&&qt>qy){const At=window.innerHeight;M.current=At,te(!0),xe(At),fe("closing")}else M.current=0,xe(0);A()}else ht==="horizontal"&&Math.abs(K.current)>0&&(Ae(K.current),A());P.current=null,T.current="none",K.current=0,L.current=!1,ne(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",mt,{passive:!1}),document.addEventListener("touchend",Nt),document.addEventListener("touchcancel",Nt),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",mt),document.removeEventListener("touchend",Nt),document.removeEventListener("touchcancel",Nt)}},[oe,qe,Ze,ot,We,it,st,Ee]);const Ut=s.useCallback(()=>{const A=(m==null?void 0:m())??y??null;A&&se&&(ee(A),q(!0)),fe("closing")},[m,y,se]);s.useEffect(()=>{const A=ze=>{if(ze.key==="Escape"){if(r&&d||oe==="closing")return;pt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||oe!=="open"||!qe)return;ze.preventDefault();const mt=ze.key==="ArrowLeft"?-1:1;ze.repeat&&U.current===mt||Lt(mt)},Te=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const mt=ze.key==="ArrowLeft"?-1:1;U.current===mt&&pt()},Ae=()=>{pt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",Te),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",Te),window.removeEventListener("blur",Ae),pt()}},[oe,r,d,Ut,qe,Lt,pt]),s.useEffect(()=>{oe!=="open"&&pt()},[oe,pt]);const Kt=()=>{oe==="closing"||l||Ut()},Pt=oe==="open",jt=oe==="closing",on=Pe>0?Math.max(0,1-Pe/500):1,vt=Pe>0?Math.max(.35,1-Pe/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!z.current)){if(k.current!==null){Ne();return}We(),Ze(!1)}},[We,Ze,Ne]),Xe=oe==="closing"?Y??y:y,lt=Xe&&se&&(oe==="opening"||jt)?Jy(Xe,se):void 0,ct=je&&J?me(J,"center"):Pe>0?`translateY(${Pe}px)`:lt,wt=se?_r(se,N):null,It=!!(Xe&&se),gt=It&&(oe==="closing"||oe==="open"&&h),Ot={position:"absolute",top:wt==null?void 0:wt.top,left:wt==null?void 0:wt.left,width:wt==null?void 0:wt.width,height:wt==null?void 0:wt.height,objectFit:"contain",transformOrigin:"top left",transform:ct,opacity:Pe>0?vt:It?1:oe==="opening"||jt?0:1,transition:Q&&!le?"none":le?`transform ${qo}ms ${xn}`:H?`transform ${_n}ms ${xn}, opacity ${_n}ms ${xn}`:gt?`transform ${_n}ms ${xn}`:oe==="opening"||jt?`opacity ${_n}ms ${xn}`:"none",pointerEvents:Ye&&Pt&&!je?"auto":"none",touchAction:Ye&&Pt?"none":void 0,zIndex:1,overflow:Ye?"hidden":void 0},_t={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Pt&&!je?"auto":"none"},Mt=(A,Te,Ae="adjacent")=>{const ze=Oe(A);if(!ze)return{display:"none"};const mt=Ae==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:Nt}=Ie!==null?Fu(ze,mt,Ie,N):{start:Ae==="far"?ma(ze,Te,N):Po(ze,Te,N)},ht=_r(Nt,N),St=me(A,mt),qt=!je&&Ae==="adjacent"&&Pt&&!ve?cv(ze,Te,N):null,At=Ae==="far"&&je&&Ie===(Te==="left"?-1:1),sn=Q&&!le?!1:le,gn=Ae==="adjacent"&&Pt&&ve&&!je;return{position:"absolute",top:ht.top,left:ht.left,width:ht.width,height:ht.height,objectFit:"contain",transform:St??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:Ae==="far"?Pt&&At?1:0:Pt?1:0,transition:sn?Ae==="far"?`transform ${qo}ms ${xn}`:`transform ${qo}ms ${xn}, opacity ${_n}ms ${xn}`:gn?`transform ${_n}ms ${xn}`:oe==="opening"||jt?`opacity ${_n}ms ${xn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(A,Te)=>{const Ae=Oe(A);return Ae?sv(Po(Ae,Te,N),Te,N):null},Xt=A=>Te=>{if(!l){if(_.current){_.current=!1;return}Te.stopPropagation(),Be(A)}},Dt=Ge?Gt(Ge,"left"):null,zt=$e?Gt($e,"right"):null,Bt=Dt?_r(Dt,N):null,bt=zt?_r(zt,N):null;return a.jsxs("div",{ref:R,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:oe==="open"?"none":void 0},onClick:Kt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Pt?on:0,transition:Q?"none":`opacity ${_n}ms ${xn}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Pt?1:0,transition:Q?"none":`opacity ${_n}ms ${xn}`,pointerEvents:"none"},children:a.jsx(Eu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Kt})})]}),Pt&&tt&&a.jsx(Wr,{media:tt,style:Mt(tt,"left","far"),onMeasure:rt,onTransitionEnd:Le},`far-prev-${tt.url}`),Pt&&Ge&&a.jsxs(a.Fragment,{children:[a.jsx(Wr,{media:Ge,style:Mt(Ge,"left"),onMeasure:rt,onTransitionEnd:Le},`prev-${Ge.url}`),Bt&&a.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Pt&&$e&&a.jsxs(a.Fragment,{children:[a.jsx(Wr,{media:$e,style:Mt($e,"right"),onMeasure:rt,onTransitionEnd:Le},`next-${$e.url}`),bt&&a.jsx("div",{style:{position:"absolute",top:bt.top,left:bt.left,width:bt.width,height:bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Pt&&ft&&a.jsx(Wr,{media:ft,style:Mt(ft,"right","far"),onMeasure:rt,onTransitionEnd:Le},`far-next-${ft.url}`),se&&J&&(Ye?a.jsx(mv,{src:J.url,phase:oe,onMediaElement:Et,wrapperStyle:Ot,videoStyle:_t,onLoadedMetadata:xt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Et,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Le,style:Ot},`${n}-${J.url}`))]})}function hv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=F.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:v}=e,y=(v==null?void 0:v.display)==="cover",m=(v==null?void 0:v.ratioValue)??"1:1",g=(v==null?void 0:v.reversed)??!1,[f,x]=m.split(":").map(Number),S=`${g?x:f} / ${g?f:x}`,G=c.entryWidth??.2,D=c.columnsCount,j=F.scalingValue(G,n),P=F.scalingValue(c.horizontalGap??0,n),M=j,K=j,T={width:M,...y?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},L=y?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},_=s.useRef(null),[z,$]=s.useState(!1),[k,W]=s.useState([]),[w,U]=s.useState(0),[C,O]=s.useState(0),[V,se]=s.useState(null),[ie,N]=s.useState({title1:"",title2:"",title3:""}),de=(()=>{const be={},Ce=_.current?getComputedStyle(_.current).getPropertyValue("--cntrl-article-width").trim():"";return Ce&&(be["--cntrl-article-width"]=Ce),be})(),X=!n||i||o,ce=s.useMemo(()=>Xy(d),[d]),oe=t??[],fe=oe.length%D||D,Pe=fe<D&&oe.length>0,xe=oe.length-fe,pe=Pe?Math.floor((D-fe)/2)+1:1,Z=s.useMemo(()=>ev(oe),[oe]),le=s.useMemo(()=>rv(oe),[oe]),re=(be,Ce,h)=>{if(n&&!o&&!i)return;const q=Z.findIndex(ee=>ee.gridIndex===be);if(q<0)return;const Y=Z[q];O(q),W(Y.items),U(Ce),N(Y.entry),se(h??null),$(!0)},Ie=s.useCallback(()=>{$(!1),se(null)},[]),we=s.useCallback(()=>{const be=Z[C];return!be||!_.current?V:Qy(_.current,be.gridIndex,y?"cover":"contain")??V},[Z,C,V,y]),Me=s.useCallback(be=>{if(Z.length>1){const Ce=Z.length,h=(C+be+Ce)%Ce,q=Z[h],Y=Math.min(w,q.items.length-1);O(h),W(q.items),U(Y),N(q.entry);return}U(Ce=>(Ce+be+k.length)%k.length)},[Z,C,w,k.length]),ye=Z.length>1||k.length>1;return s.useEffect(()=>{if(!z||typeof document>"u")return;const be=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=be}},[z]),s.useEffect(()=>{!n||o||i||$(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ce}}),a.jsx(av,{mediaList:le}),a.jsx("div",{ref:_,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${D}, ${j})`,rowGap:0,columnGap:P,width:F.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:F.scalingValue(u??0,n)},children:oe.map((be,Ce)=>{const h=Tl(be.gallery),q=Ll(h),Y=q.filter(ne=>ne.lightboxMedia).map(ne=>ne.lightboxMedia),ee=Math.floor(Ce/D)===Math.ceil(oe.length/D)-1,ve=Pe&&Ce>=xe?`${pe+(Ce-xe)}`:void 0,B=q[0],I=B!=null&&B.lightboxMedia?Y.findIndex(ne=>ne.url===B.lightboxMedia.url):-1,Q=a.jsx("div",{className:`${d}-item-image-wrapper`,style:T,children:q.length>0&&a.jsx(pv,{media:B.displayMedia,gridIndex:Ce,className:`${d}-item-${Bo(B.displayMedia)?"video":"image"}`.trim(),style:L,onMediaClick:X&&I>=0?ne=>re(Ce,I,Mu(ne.currentTarget,y?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,ee?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:j,...ve?{gridColumn:ve}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:K}})}),a.jsx("a",{className:`${d}-item-image-link`,children:Q}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:K}})})]})},Ce)})}),z&&typeof document<"u"&&(()=>{const be=(l?document.getElementById(l):null)??document.body;return ai.createPortal(a.jsx("div",{style:de,"data-selection":"none",children:a.jsx(gv,{prefix:d,items:k,index:w,entry:ie,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ye,lightboxEntries:Z,entryIdx:C,layoutId:r,sourceRect:V,resolveCloseSourceRect:we,onClose:Ie,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),be)})()]})}const fv=`import { CommonComponentProps } from '../props';
|
|
7602
|
+
`}const hc={url:"",name:"",objectFit:"cover"},_n=500,qo=650,xn="cubic-bezier(0.22, 1, 0.36, 1)",qy=72,Uy=50,Yy=1e4,Ky=650,Zy=500;function Jy(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 Mu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=pa(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Qy(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Mu(i,n):null}function ev(e){return e.reduce((t,n,i)=>{const o=Tl(n.gallery),l=Ll(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function er(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 fc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return er(e,i,n)}const tv=.03;function Au(e){return e.width*tv}const Ka={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function _r(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function yc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function nv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ns(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function iv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ns(e,t.width,t.height)}function ov(e,t){if(Bo(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function rv(e){const t=new Set,n=[];for(const i of e){const o=Tl(i.gallery),r=Ll(o);for(const l of r)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function av({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.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Po(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Au(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function ma(e,t,n){const i=Po(e,t,n);return{...i,left:2*i.left-e.left}}function sv(e,t,n){const{left:i,width:o}=n,r=Au(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 Fu(e,t,n,i){const o=Po(e,"left",i),r=Po(e,"right",i),l=ma(e,"left",i),d=ma(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:d,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:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function lv(e,t,n,i){const{start:o,end:r}=Fu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function cv(e,t,n){const i=Po(e,t,n),o=ma(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Nu(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 Tl(e){if(!e)return;if(Nu(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??hc,i??o??hc]}]}function dv(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function uv(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ll(e){if(!Array.isArray(e)||e.length===0)return[];if(Nu(e)){const t=[];for(const n of e){const i=dv(n);if(!i)continue;const o=uv(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Bo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function pv({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Bo(e)?a.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):a.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function mv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function Wr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Bo(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function gv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:v,resolveCloseSourceRect:m,onClose:g,onPrev:h,onNext:b}){const E=s.useRef(null),y=s.useRef(null),w=s.useRef(null),j=s.useRef(new Map),[G,A]=s.useState(0),P=s.useRef(null),W=s.useRef(0),Y=s.useRef(0),$=s.useRef("none"),I=s.useRef(!1),H=s.useRef(!1),O=s.useRef(!1),C=s.useRef(null),L=s.useRef(null),D=s.useRef(null),S=s.useRef(()=>{}),U=s.useRef(null),T=s.useRef(null),_=s.useRef(null),B=s.useRef(!1),[ae,ie]=s.useState(null),[k,ue]=s.useState(Ka),[X,le]=s.useState(0),[te,we]=s.useState("opening"),[ke,fe]=s.useState(0),[me,Z]=s.useState(0),[se,oe]=s.useState(!1),[Pe,$e]=s.useState(null),[Me,ye]=s.useState(null),[be,Ce]=s.useState(null),[f,q]=s.useState(!1),[K,ne]=s.useState(null),[ge,z]=s.useState(!1),R=s.useRef(!1),[Q,ee]=s.useState(!1),[ce,V]=s.useState(!1),Le=s.useRef(n),ve=s.useRef(void 0),J=t[n],_e=J?Bo(J):!1,Be=me!==0||se,at=!l&&(!r||!!d),Ue=c&&!l,et=u.length>1,Je=s.useCallback((F,Te)=>t.length<=1?null:t[(F+Te+t.length)%t.length]??null,[t]),Ye=et?er(u,p,-1):Je(n,-1),xe=et?er(u,p,1):Je(n,1),We=Pe===-1&&Be?et&&Me!==null?er(u,Me,-1):be!==null?Je(be,-1):null:null,He=Pe===1&&Be?et&&Me!==null?er(u,Me,1):be!==null?Je(be,1):null:null,Qe=We&&We.url!==(Ye==null?void 0:Ye.url)?We:null,he=He&&He.url!==(xe==null?void 0:xe.url)?He:null,Ne=Ye&&Ue?(()=>{const F=et?fc(u,p,-1):t.length>2?Je((n-1+t.length)%t.length,-1):null;return F&&F.url!==Ye.url?F:null})():null,Ve=xe&&Ue?(()=>{const F=et?fc(u,p,1):t.length>2?Je((n+1)%t.length,1):null;return F&&F.url!==xe.url?F:null})():null,tt=Qe??Ne,mt=he??Ve,st=s.useCallback((F,Te,Ae)=>{if(!F||!Te||!Ae)return;const ze=j.current,gt=ze.get(F);(gt==null?void 0:gt.width)===Te&&(gt==null?void 0:gt.height)===Ae||(ze.set(F,{width:Te,height:Ae}),A(Nt=>Nt+1))},[]),De=s.useCallback(F=>{if(!(F!=null&&F.url))return null;const Te=j.current.get(F.url);return iv(y.current,Te)},[G,X]),Fe=s.useCallback(()=>{if(!J)return;const F=De(J);if(F){ie(F);return}const Te=y.current;Te&&ie(yc(Te))},[J,De]),Xe=s.useCallback(F=>{if(et){const Te=u.length;ye((p+F+Te)%Te),Ce(null);return}t.length>1&&(Ce((n+F+t.length)%t.length),ye(null))},[et,u.length,p,t.length,n]),ot=s.useCallback(F=>{O.current=F,oe(F)},[]),Oe=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),qe=s.useCallback(()=>{Oe(),C.current=window.setTimeout(()=>{Oe(),ot(!1)},qo+32)},[Oe,ot]),nt=s.useCallback(()=>{const F=E.current;if(!F){ue({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ka.width,height:typeof window<"u"?window.innerHeight:Ka.height});return}const Te=F.getBoundingClientRect();ue({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),de=s.useCallback((F,Te)=>{if(Be){if(Q&&!se)return`translate(${me}px, 0px)`;if(se&&Pe!==null){const Ae=De(F);if(!Ae)return;const{x:ze,y:gt}=lv(Ae,Te,Pe,k);return`translate(${ze}px, ${gt}px)`}if(se)return"translate(0px, 0px)"}},[Be,Q,se,me,Pe,k,De]),Ie=s.useCallback(()=>{const F=L.current;L.current=null,Oe(),ot(!1),$e(null),ye(null),Ce(null),Z(0),ee(!1),I.current=!1,Y.current=0,$.current="none",F===-1?h():F===1&&b()},[Oe,ot,h,b]),it=s.useCallback(()=>{Oe(),C.current=window.setTimeout(()=>{L.current!==null&&Ie()},qo+32)},[Oe,Ie]),ut=s.useCallback(()=>{Oe(),L.current=null,ot(!1),$e(null),ye(null),Ce(null),Z(0),ee(!1),I.current=!1,Y.current=0,$.current="none"},[Oe,ot]),je=s.useCallback(F=>{if(!(!Ue||!ae)){if(O.current){if(L.current===F){D.current=F,Ie();return}ut()}Oe(),Xe(F),L.current=F,$e(F),ot(!0),it()}},[Ue,ae,Ie,ut,Oe,Xe,ot,it]);S.current=je;const pt=s.useCallback(()=>{U.current=null,B.current=!1,T.current!==null&&(window.clearInterval(T.current),T.current=null),_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),Tt=s.useCallback(F=>{T.current!==null&&window.clearInterval(T.current);const Te=B.current?Zy:Ky;T.current=window.setInterval(()=>{S.current(F)},Te)},[]),Lt=s.useCallback(F=>{U.current!==F&&(pt(),U.current=F,B.current=!1,S.current(F),Tt(F),_.current=window.setTimeout(()=>{_.current=null,U.current===F&&(B.current=!0,Tt(F))},Yy))},[pt,Tt]),xt=s.useCallback(()=>{const F=y.current;if(!F)return;const Te=J==null?void 0:J.url,Ae=Te?j.current.get(Te):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){ie(Ns(F,Ae.width,Ae.height));return}const ze=w.current;if(ze&&Te&&(ze.src===Te||ze.currentSrc===Te)){const{width:Nt,height:ft}=nv(ze);if(Nt&&ft){st(Te,Nt,ft),ie(Ns(F,Nt,ft));return}}const gt=yc(F);!gt.width||!gt.height||ie(gt)},[J==null?void 0:J.url,st]),Et=s.useCallback(F=>{if(w.current=F,!!F){if(F instanceof HTMLVideoElement){F.readyState>=1&&F.videoWidth>0&&xt();return}F.complete&&F.naturalWidth>0&&xt()}},[xt]),Vt=s.useCallback(()=>{nt(),xt(),le(F=>F+1)},[nt,xt]);s.useEffect(()=>{Vt();const F=y.current,Te=E.current,Ae=new ResizeObserver(()=>Vt());return F&&Ae.observe(F),Te&&Ae.observe(Te),window.addEventListener("resize",Vt),()=>{Ae.disconnect(),window.removeEventListener("resize",Vt)}},[Vt,n,x]),s.useLayoutEffect(()=>{if(!J)return;const F=w.current;if(F){if(F instanceof HTMLImageElement&&F.complete&&F.naturalWidth>0){xt();return}F instanceof HTMLVideoElement&&F.readyState>=1&&F.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Fe()},[Fe,G]),s.useEffect(()=>{const F=new Set,Te=[],Ae=ze=>{!(ze!=null&&ze.url)||F.has(ze.url)||(F.add(ze.url),Te.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Te.forEach(ze=>{j.current.has(ze.url)||ov(ze,st)})},[t,u,st]),s.useEffect(()=>{if(te!=="opening"||!ae)return;if(!v){we("open");return}q(!1);const F=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),we("open")})});return()=>cancelAnimationFrame(F)},[te,ae,v]),s.useEffect(()=>{if(te!=="closing")return;const F=setTimeout(()=>g(),_n);return()=>clearTimeout(F)},[te,g]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{Le.current===n&&ve.current===(J==null?void 0:J.url)||(Oe(),L.current=null,$e(null),ye(null),Ce(null),fe(0),Z(0),ot(!1),V(!1),ee(!1),W.current=0,Y.current=0,$.current="none",I.current=!1,P.current=null,H.current=!1,w.current=null,Fe(),Le.current=n,ve.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,ot,Oe,Fe]),s.useLayoutEffect(()=>{const F=D.current;F!==null&&(D.current=null,requestAnimationFrame(()=>{S.current(F)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(te==="opening"){R.current=!1,z(!1);return}if(te!=="open"||R.current)return;if(!Ye&&!xe){R.current=!0;return}z(!1);const F=requestAnimationFrame(()=>{requestAnimationFrame(()=>{z(!0),R.current=!0})});return()=>cancelAnimationFrame(F)},[te,Ye==null?void 0:Ye.url,xe==null?void 0:xe.url]),s.useEffect(()=>{if(te!=="open")return;const F=()=>{const ft=St=>{St.stopPropagation(),St.preventDefault(),document.removeEventListener("click",ft,!0)};document.addEventListener("click",ft,!0)},Te=ft=>{const St=ft<0?1:-1;Oe(),Xe(St),L.current=St,$e(St),ot(!0),it()},Ae=ft=>{if(Math.abs(ft)>Uy&&Ue){Te(ft);return}L.current=null,$e(null),ye(null),Ce(null),ot(!0),Z(0),qe()},ze=ft=>{if(ft.touches.length!==1||O.current)return;const St=ft.touches[0];H.current=!0,P.current={x:St.clientX,y:St.clientY},$.current="none",Y.current=0,I.current=!1},gt=ft=>{if(!P.current||ft.touches.length!==1||O.current)return;const St=ft.touches[0],qt=St.clientX-P.current.x,At=St.clientY-P.current.y;if($.current==="none"){if(Math.abs(qt)<10&&Math.abs(At)<10)return;if(Math.abs(qt)>Math.abs(At)){if(!Ue)return;$.current="horizontal"}else if(At>0){if(!at)return;$.current="vertical"}else return}if($.current==="horizontal"){I.current=!0,ee(!0),Y.current=qt,Z(qt),ft.preventDefault();return}$.current==="vertical"&&(I.current=!0,ee(!0),W.current=At,fe(At),ft.preventDefault())},Nt=()=>{if(!P.current)return;const ft=$.current,St=I.current;if(St&&ft==="horizontal")Ae(Y.current),F();else if(St&&ft==="vertical"){const qt=W.current;if(at&&qt>qy){const At=window.innerHeight;W.current=At,V(!0),fe(At),we("closing")}else W.current=0,fe(0);F()}else ft==="horizontal"&&Math.abs(Y.current)>0&&(Ae(Y.current),F());P.current=null,$.current="none",Y.current=0,I.current=!1,ee(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",gt,{passive:!1}),document.addEventListener("touchend",Nt),document.addEventListener("touchcancel",Nt),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",gt),document.removeEventListener("touchend",Nt),document.removeEventListener("touchcancel",Nt)}},[te,Ue,ot,qe,Oe,at,it,Xe]);const Ut=s.useCallback(()=>{const F=(m==null?void 0:m())??v??null;F&&ae&&(ne(F),q(!0)),we("closing")},[m,v,ae]);s.useEffect(()=>{const F=ze=>{if(ze.key==="Escape"){if(r&&d||te==="closing")return;pt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||te!=="open"||!Ue)return;ze.preventDefault();const gt=ze.key==="ArrowLeft"?-1:1;ze.repeat&&U.current===gt||Lt(gt)},Te=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const gt=ze.key==="ArrowLeft"?-1:1;U.current===gt&&pt()},Ae=()=>{pt()};return window.addEventListener("keydown",F),window.addEventListener("keyup",Te),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",F),window.removeEventListener("keyup",Te),window.removeEventListener("blur",Ae),pt()}},[te,r,d,Ut,Ue,Lt,pt]),s.useEffect(()=>{te!=="open"&&pt()},[te,pt]);const Kt=()=>{te==="closing"||l||Ut()},Pt=te==="open",jt=te==="closing",on=ke>0?Math.max(0,1-ke/500):1,vt=ke>0?Math.max(.35,1-ke/500):1,Re=s.useCallback(F=>{if(!(F.propertyName!=="transform"||!O.current)){if(L.current!==null){Ie();return}Oe(),ot(!1)}},[Oe,ot,Ie]),Ge=te==="closing"?K??v:v,lt=Ge&&ae&&(te==="opening"||jt)?Jy(Ge,ae):void 0,ct=Be&&J?de(J,"center"):ke>0?`translateY(${ke}px)`:lt,wt=ae?_r(ae,k):null,It=!!(Ge&&ae),ht=It&&(te==="closing"||te==="open"&&f),Ot={position:"absolute",top:wt==null?void 0:wt.top,left:wt==null?void 0:wt.left,width:wt==null?void 0:wt.width,height:wt==null?void 0:wt.height,objectFit:"contain",transformOrigin:"top left",transform:ct,opacity:ke>0?vt:It?1:te==="opening"||jt?0:1,transition:Q&&!se?"none":se?`transform ${qo}ms ${xn}`:ce?`transform ${_n}ms ${xn}, opacity ${_n}ms ${xn}`:ht?`transform ${_n}ms ${xn}`:te==="opening"||jt?`opacity ${_n}ms ${xn}`:"none",pointerEvents:_e&&Pt&&!Be?"auto":"none",touchAction:_e&&Pt?"none":void 0,zIndex:1,overflow:_e?"hidden":void 0},_t={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Pt&&!Be?"auto":"none"},Mt=(F,Te,Ae="adjacent")=>{const ze=De(F);if(!ze)return{display:"none"};const gt=Ae==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:Nt}=Pe!==null?Fu(ze,gt,Pe,k):{start:Ae==="far"?ma(ze,Te,k):Po(ze,Te,k)},ft=_r(Nt,k),St=de(F,gt),qt=!Be&&Ae==="adjacent"&&Pt&&!ge?cv(ze,Te,k):null,At=Ae==="far"&&Be&&Pe===(Te==="left"?-1:1),sn=Q&&!se?!1:se,gn=Ae==="adjacent"&&Pt&&ge&&!Be;return{position:"absolute",top:ft.top,left:ft.left,width:ft.width,height:ft.height,objectFit:"contain",transform:St??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:Ae==="far"?Pt&&At?1:0:Pt?1:0,transition:sn?Ae==="far"?`transform ${qo}ms ${xn}`:`transform ${qo}ms ${xn}, opacity ${_n}ms ${xn}`:gn?`transform ${_n}ms ${xn}`:te==="opening"||jt?`opacity ${_n}ms ${xn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(F,Te)=>{const Ae=De(F);return Ae?sv(Po(Ae,Te,k),Te,k):null},Xt=F=>Te=>{if(!l){if(H.current){H.current=!1;return}Te.stopPropagation(),je(F)}},Dt=Ye?Gt(Ye,"left"):null,zt=xe?Gt(xe,"right"):null,Bt=Dt?_r(Dt,k):null,bt=zt?_r(zt,k):null;return a.jsxs("div",{ref:E,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:te==="open"?"none":void 0},onClick:Kt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Pt?on:0,transition:Q?"none":`opacity ${_n}ms ${xn}`,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:Pt?1:0,transition:Q?"none":`opacity ${_n}ms ${xn}`,pointerEvents:"none"},children:a.jsx(Eu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Kt})})]}),Pt&&tt&&a.jsx(Wr,{media:tt,style:Mt(tt,"left","far"),onMeasure:st,onTransitionEnd:Re},`far-prev-${tt.url}`),Pt&&Ye&&a.jsxs(a.Fragment,{children:[a.jsx(Wr,{media:Ye,style:Mt(Ye,"left"),onMeasure:st,onTransitionEnd:Re},`prev-${Ye.url}`),Bt&&a.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Pt&&xe&&a.jsxs(a.Fragment,{children:[a.jsx(Wr,{media:xe,style:Mt(xe,"right"),onMeasure:st,onTransitionEnd:Re},`next-${xe.url}`),bt&&a.jsx("div",{style:{position:"absolute",top:bt.top,left:bt.left,width:bt.width,height:bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Pt&&mt&&a.jsx(Wr,{media:mt,style:Mt(mt,"right","far"),onMeasure:st,onTransitionEnd:Re},`far-next-${mt.url}`),ae&&J&&(_e?a.jsx(mv,{src:J.url,phase:te,onMediaElement:Et,wrapperStyle:Ot,videoStyle:_t,onLoadedMetadata:xt,onTransitionEnd:Re},`${n}-${J.url}`):a.jsx("img",{ref:Et,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Re,style:Ot},`${n}-${J.url}`))]})}function hv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=N.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:x}=e,v=(x==null?void 0:x.display)==="cover",m=(x==null?void 0:x.ratioValue)??"1:1",g=(x==null?void 0:x.reversed)??!1,[h,b]=m.split(":").map(Number),w=`${g?b:h} / ${g?h:b}`,j=c.entryWidth??.2,G=c.columnsCount,A=N.scalingValue(j,n),P=N.scalingValue(c.horizontalGap??0,n),W=A,Y=A,$={width:W,...v?{aspectRatio:w,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%"},H=s.useRef(null),[O,C]=s.useState(!1),[L,D]=s.useState([]),[S,U]=s.useState(0),[T,_]=s.useState(0),[B,ae]=s.useState(null),[ie,k]=s.useState({title1:"",title2:"",title3:""}),ue=(()=>{const be={},Ce=H.current?getComputedStyle(H.current).getPropertyValue("--cntrl-article-width").trim():"";return Ce&&(be["--cntrl-article-width"]=Ce),be})(),X=!n||i||o,le=s.useMemo(()=>Xy(d),[d]),te=t??[],we=te.length%G||G,ke=we<G&&te.length>0,fe=te.length-we,me=ke?Math.floor((G-we)/2)+1:1,Z=s.useMemo(()=>ev(te),[te]),se=s.useMemo(()=>rv(te),[te]),oe=(be,Ce,f)=>{if(n&&!o&&!i)return;const q=Z.findIndex(ne=>ne.gridIndex===be);if(q<0)return;const K=Z[q];_(q),D(K.items),U(Ce),k(K.entry),ae(f??null),C(!0)},Pe=s.useCallback(()=>{C(!1),ae(null)},[]),$e=s.useCallback(()=>{const be=Z[T];return!be||!H.current?B:Qy(H.current,be.gridIndex,v?"cover":"contain")??B},[Z,T,B,v]),Me=s.useCallback(be=>{if(Z.length>1){const Ce=Z.length,f=(T+be+Ce)%Ce,q=Z[f],K=Math.min(S,q.items.length-1);_(f),D(q.items),U(K),k(q.entry);return}U(Ce=>(Ce+be+L.length)%L.length)},[Z,T,S,L.length]),ye=Z.length>1||L.length>1;return s.useEffect(()=>{if(!O||typeof document>"u")return;const be=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=be}},[O]),s.useEffect(()=>{!n||o||i||C(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:le}}),a.jsx(av,{mediaList:se}),a.jsx("div",{ref:H,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${G}, ${A})`,rowGap:0,columnGap:P,width:N.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:N.scalingValue(u??0,n)},children:te.map((be,Ce)=>{const f=Tl(be.gallery),q=Ll(f),K=q.filter(ee=>ee.lightboxMedia).map(ee=>ee.lightboxMedia),ne=Math.floor(Ce/G)===Math.ceil(te.length/G)-1,ge=ke&&Ce>=fe?`${me+(Ce-fe)}`:void 0,z=q[0],R=z!=null&&z.lightboxMedia?K.findIndex(ee=>ee.url===z.lightboxMedia.url):-1,Q=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:q.length>0&&a.jsx(pv,{media:z.displayMedia,gridIndex:Ce,className:`${d}-item-${Bo(z.displayMedia)?"video":"image"}`.trim(),style:I,onMediaClick:X&&R>=0?ee=>oe(Ce,R,Mu(ee.currentTarget,v?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,ne?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:A,...ge?{gridColumn:ge}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:Y}})}),a.jsx("a",{className:`${d}-item-image-link`,children:Q}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:Y}})})]})},Ce)})}),O&&typeof document<"u"&&(()=>{const be=(l?document.getElementById(l):null)??document.body;return si.createPortal(a.jsx("div",{style:ue,"data-selection":"none",children:a.jsx(gv,{prefix:d,items:L,index:S,entry:ie,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ye,lightboxEntries:Z,entryIdx:T,layoutId:r,sourceRect:B,resolveCloseSourceRect:$e,onClose:Pe,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),be)})()]})}const fv=`import { CommonComponentProps } from '../props';
|
|
7599
7603
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7600
7604
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7601
7605
|
import { createPortal } from 'react-dom';
|
|
@@ -9938,7 +9942,7 @@ export function Hive({
|
|
|
9938
9942
|
</>
|
|
9939
9943
|
);
|
|
9940
9944
|
}
|
|
9941
|
-
`,yv="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),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 vv(e){const t={};return t[yt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[yt(e,"fontSettings")]={...Fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[yt(e,"fontSize")]={...Fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[yt(e,"lineHeight")]={...Fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[yt(e,"letterSpacing")]={...Fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[yt(e,"wordSpacing")]={...Fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[yt(e,"textAlign")]={...Fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[yt(e,"textAppearance")]={...Fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const ko=Ci.filter(e=>e!=="count"),xv=ko.reduce((e,t)=>({...e,...vv(t)}),{}),bv=ko.reduce((e,t)=>({...e,[yt(t,"fontFamily")]:"Arial",[yt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[yt(t,"letterSpacing")]:0,[yt(t,"wordSpacing")]:0,[yt(t,"textAlign")]:"left",[yt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Za(e){return ko.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[yt(n,"fontSize")]=i),o!==void 0&&(t[yt(n,"lineHeight")]=o),t},{})}const Sv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ko.map(e=>[$l[e],Cl(e)]))},wv={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},$v=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...wv,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Cv={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",max:1,display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:$v},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"}},...xv},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:yv,closeIconColor:"#000000",closeIconHoverColor:"#999999",...bv},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,...Za({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,...Za({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,...Za({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:[Sv]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Tv={element:hv,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...ko.map(e=>({path:`${yt(e,"fontFamily")}`}))]},fontRelations:{...ko.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${yt(t,"fontFamily")}`}),{})},schema:Cv,sourceCode:fv};function Lv(e){if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function Iv({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.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Ja(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Rv(e){return String(e??"").trim().length>0}function vc(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 xc(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 bc(e,t,n,i,o,r,l){const d=F.scalingValue(r,l),c=F.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Pv(e,t,n){const i=F.scalingValue(t,n),o=F.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Sc=10,wc=10,Uo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function kv(e,t,n){return Math.max(t,Math.min(n,e))}function Qa(e,t,n){return e+(t-e)*n}function Ev(e,t,n,i){if(!t)return{x:0,y:0};const o=t.offsetWidth,l=t.offsetHeight/2;if(e==="cursor"&&n){const d=t.getBoundingClientRect();return{x:n.clientX-d.left+Sc,y:n.clientY-d.top+Sc}}switch(e){case"left":return{x:wc+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-wc-i/2,y:l};default:return{x:o/2,y:l}}}function Mv(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,g=i.current;m&&(m.style.transform=`translate3d(${g.x}px, ${g.y}px, 0) translate(-50%, -50%) rotate(${g.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const m=i.current;t?(m.x=Qa(m.x,m.targetX,Uo.positionEase),m.y=Qa(m.y,m.targetY,Uo.positionEase),m.rotation=Qa(m.rotation,m.targetRotation,Uo.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const g=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,f=Math.abs(m.rotation-m.targetRotation)<.08;!g||!f?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((m,g)=>{const f=i.current;f.targetX=m,f.targetY=g,f.targetRotation=0,f.x=m,f.y=g,f.rotation=0,f.lastX=m,f.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((m,g)=>{if(!e)return;const f=i.current;if(t&&f.hasLastX){const x=m-f.lastX;f.targetRotation=kv(x*Uo.rotationFactor,-20,Uo.maxRotation)}else f.targetRotation=0;if(f.lastX=m,f.hasLastX=!0,f.targetX=m,f.targetY=g,t){c();return}f.x=m,f.y=g,f.rotation=f.targetRotation,r()},[e,r,t,c]),v=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[l]),y=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||y(),l),[e,y,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:v,reset:y}}function Av(e){return`
|
|
9945
|
+
`,yv="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),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 vv(e){const t={};return t[yt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[yt(e,"fontSettings")]={...Fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[yt(e,"fontSize")]={...Fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[yt(e,"lineHeight")]={...Fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[yt(e,"letterSpacing")]={...Fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[yt(e,"wordSpacing")]={...Fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[yt(e,"textAlign")]={...Fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[yt(e,"textAppearance")]={...Fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const ko=Ci.filter(e=>e!=="count"),xv=ko.reduce((e,t)=>({...e,...vv(t)}),{}),bv=ko.reduce((e,t)=>({...e,[yt(t,"fontFamily")]:"Arial",[yt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[yt(t,"letterSpacing")]:0,[yt(t,"wordSpacing")]:0,[yt(t,"textAlign")]:"left",[yt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Za(e){return ko.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[yt(n,"fontSize")]=i),o!==void 0&&(t[yt(n,"lineHeight")]=o),t},{})}const Sv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ko.map(e=>[$l[e],Cl(e)]))},wv={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},$v=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...wv,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Cv={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",max:1,display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:$v},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"}},...xv},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:yv,closeIconColor:"#000000",closeIconHoverColor:"#999999",...bv},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,...Za({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,...Za({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,...Za({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:[Sv]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Tv={element:hv,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...ko.map(e=>({path:`${yt(e,"fontFamily")}`}))]},fontRelations:{...ko.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${yt(t,"fontFamily")}`}),{})},schema:Cv,sourceCode:fv};function Lv(e){if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function Iv({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.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Ja(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Rv(e){return String(e??"").trim().length>0}function vc(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 xc(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 bc(e,t,n,i,o,r,l){const d=N.scalingValue(r,l),c=N.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Pv(e,t,n){const i=N.scalingValue(t,n),o=N.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Sc=10,wc=10,Uo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function kv(e,t,n){return Math.max(t,Math.min(n,e))}function Qa(e,t,n){return e+(t-e)*n}function Ev(e,t,n,i){if(!t)return{x:0,y:0};const o=t.offsetWidth,l=t.offsetHeight/2;if(e==="cursor"&&n){const d=t.getBoundingClientRect();return{x:n.clientX-d.left+Sc,y:n.clientY-d.top+Sc}}switch(e){case"left":return{x:wc+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-wc-i/2,y:l};default:return{x:o/2,y:l}}}function Mv(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,g=i.current;m&&(m.style.transform=`translate3d(${g.x}px, ${g.y}px, 0) translate(-50%, -50%) rotate(${g.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const m=i.current;t?(m.x=Qa(m.x,m.targetX,Uo.positionEase),m.y=Qa(m.y,m.targetY,Uo.positionEase),m.rotation=Qa(m.rotation,m.targetRotation,Uo.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const g=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,h=Math.abs(m.rotation-m.targetRotation)<.08;!g||!h?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((m,g)=>{const h=i.current;h.targetX=m,h.targetY=g,h.targetRotation=0,h.x=m,h.y=g,h.rotation=0,h.lastX=m,h.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((m,g)=>{if(!e)return;const h=i.current;if(t&&h.hasLastX){const b=m-h.lastX;h.targetRotation=kv(b*Uo.rotationFactor,-20,Uo.maxRotation)}else h.targetRotation=0;if(h.lastX=m,h.hasLastX=!0,h.targetX=m,h.targetY=g,t){c();return}h.x=m,h.y=g,h.rotation=h.targetRotation,r()},[e,r,t,c]),x=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[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:x,reset:v}}function Av(e){return`
|
|
9942
9946
|
.${e}-wrapper {
|
|
9943
9947
|
display: grid;
|
|
9944
9948
|
align-items: start;
|
|
@@ -10314,7 +10318,7 @@ a.${e}-list-item {
|
|
|
10314
10318
|
overflow-wrap: anywhere;
|
|
10315
10319
|
word-break: break-word;
|
|
10316
10320
|
}
|
|
10317
|
-
`}const Ti=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Il=["AColumn","BColumn","CColumn","DColumn","EColumn"],ni="cutLabel",hr=[...Il,ni],Aa=["A","B","C","D","E"];function _u(e){return`${e}ColumnVerticalAlign`}const _s=["Top","Center","Bottom"];function Rl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Aa.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Fv(e){const t=Rl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Nv(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Aa.includes(n)?n:null}function Wu(e,t,n){const i=Nv(e);return i?i===t?!1:Fv(n[_u(i)]):!0}function fr(e){const t=Rl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Aa.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function _v(e,t,n){if(Hu(e,t,n))return fr(e);const i=fr(e);return i.kind==="baseline"?{kind:"top"}:i}function Wv(e){const t=fr(e);return t.kind==="baseline"?{kind:"top"}:t}function Hu(e,t,n){return Wu(e,n,t)?fr(e).kind==="baseline":!1}function Hv(e){const t={};let n=!1;for(const i of Aa){const o=_u(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}Wu(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Ov(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Dv(e){const t=fr(e).kind;return t==="baseline"?"center":t}function zv(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function $c(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Bv(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 es(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Bv(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=r.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+l}function jv(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 Vv(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Gv={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Ht(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Xv={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function qv(e){return[Ht(e,"textFontFamily"),Ht(e,"textFontSettings"),{type:"row",items:[Ht(e,"textFontSize"),Ht(e,"textLineHeight"),Ht(e,"textLetterSpacing"),Ht(e,"textWordSpacing")]},Ht(e,"textTextAlign"),Ht(e,"textTextAppearance"),`${e}VerticalAlign`]}function Uv(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(hr.map(e=>[Xv[e],qv(e)]))}}function ga(e,t){const n=i=>{const o=Ht(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===ni?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Cc(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 dn(Qt(n,t))}function Tc(e,t,n,i){const o=ga(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Lc(e,t,n,i){const o=ga(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 Ln=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Eo=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Mo=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ao=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Yv={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Kv=["hover","focus","filled","success","error"],Ic=.004,po=.004,ts=po,Pl=50,yr=1440,vr=Pl/yr;function Ou(e){const t=typeof e=="number"&&e>0?e:yr;return Pl/t}function Zv(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 yr}const Du={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function rr(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Jv(e,t=1){const n=t/e;return Object.fromEntries(Ln.map(i=>[i,n]))}function Qv(){return Object.fromEntries([...Eo.map(e=>[e,0]),...Mo.map(e=>[e,0])])}function e0(){return Object.fromEntries(Ao.map(e=>[e,0]))}function Hr(e){return Object.fromEntries(Ln.map(t=>[t,typeof e[t]=="number"?e[t]:Du[t]]))}function zu(e,t,n){const i=e-vr,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 ra(e,t,n){const i=kl(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 t0(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Eo[o],l=Mo[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=zu(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function kl(e,t,n){if(e<=0)return[];const i=Ln.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)+vr;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-vr;if(p<=0)continue;const v=Math.min(c,p);d[u]-=v,c-=v}return[...d,i[e-1]]}function n0(e,t,n){if(e<=1)return{};const i=kl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=Ln[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Rc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Ti]}function i0(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,Ln.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=Ln[c],p=Eo[c],v=Mo[c],y=Ao[c],m=Ln[l],g=Eo[l],f=Mo[l],x=Ao[l],R=n[u],b=n[p],S=n[v],G=n[y];typeof R=="number"&&(r[m]=R),typeof b=="number"&&(r[g]=b),typeof S=="number"&&(r[f]=S),typeof G=="number"&&(r[x]=G)}return r}function Bu(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 r0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=rr(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Jv(n,o),...Qv()};if(r)for(const d of Ao)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,e0());return Bu(e,l)?l:e}function a0(e,t,n){const i=Hv(e);i&&(e={...e,...i});const o=Ou(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=rr(e),c=rr(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Ti.length,v=S=>{if(u)return S;const G=Hr({...t,...S}),D=rr(S),j=ra(p,D,G),P=t0(p,j,{...t,...S});return Object.keys(P).length===0?S:{...S,...P}};if(typeof r=="number"&&r!==l)return e;const y=Rc(e),m=Rc(t);if(!i0(y,m))return v({...e,...o0(y,m,t,p)});if(d<c&&typeof p=="number"&&!u){const S=Hr({...t,...e});return v({...e,...n0(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,G=Math.max(0,(d-o)/2);return S>G?{...e,textPaddingLR:G}:e}const g=Hr({...t,...e}),f=ra(p,c,Hr(t)),R=ra(p,d,g).some((S,G)=>S<(f[G]??S)),b=Ln.some(S=>{const G=e[S],D=t[S];return typeof G=="number"&&typeof D=="number"&&G!==D});return R||b?v(e):e}function s0(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),r=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(vr,i-o-r-vr)}function l0(e,t){return Math.random()*(t-e)+e}function c0(e){return Object.fromEntries(Ln.map(t=>[t,typeof e[t]=="number"?e[t]:Du[t]]))}function ns(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function d0(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=Eo[d],u=Mo[d],p=Ao[d];return{key:l,textPrefix:Gv[l],widthKey:Ln[d],width:n[Ln[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function u0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=F.useScopedStyles(),u=!!o,{columns:p,type:v,wrapperWidth:y,entriesCount:m,cellMinHeight:g,dividerWidth:f,showVisibility:x,cut:R,showCut:b,cutCellMinHeight:S,cutLabel:G,imageSize:D,imageOnHover:j,imagePosition:P="cursor",imageInterpolation:M="on",entryHoverEffect:K,entryHoverShowOption:T,rowPaddingTop:L,rowPaddingBottom:_,rowPaddingTopB:z,columnsOrder:$,textPaddingLR:k,textColor:W,backgroundColor:w,dividerColor:U,textHoverColor:C,backgroundHoverColor:O,dividerHoverColor:V}=e,[se,ie]=s.useState(void 0),[N,de]=s.useState(null),X=s.useRef(null),ce=j==="on"&&(!n||i),oe=P==="cursor",fe=oe&&M==="on",{anchorRef:Pe,onShow:xe,onCursorMove:pe,exit:Z}=Mv(!!(ce&&N!==null),fe),le=(R??0)>0,re=v==="b",Ie=s.useRef(null),we=s.useRef(null),[Me,ye]=s.useState(null),[be,Ce]=s.useState(yr),h=Ou(be),q=Math.max(0,((y??0)-h)/2),Y=Math.min(k??0,q),ee=Math.max(Y,po),ve=((y??0)+h)/2;s.useLayoutEffect(()=>{if(!n){Ce(yr);return}const Le=()=>{Ce(Zv(Ie.current))};Le();const Xe=Ie.current;if(!Xe)return;const lt=new ResizeObserver(Le);lt.observe(Xe);let ct=Xe;for(;ct&&!ct.style.getPropertyValue("--cntrl-article-width");)ct=ct.parentElement;return ct&<.observe(ct),()=>lt.disconnect()},[n,l]),s.useEffect(()=>{ie(void 0)},[R,b,t,m]),s.useEffect(()=>{n&&!i&&ie(void 0)},[n,i]);const B=F.buildColorVars(c,{textColor:W,backgroundColor:w,dividerColor:U,textHoverColor:C,backgroundHoverColor:O,dividerHoverColor:V},Yv,Kv),I=r&&r!=="default"?`${c}-state-${r}`:"",ne=`${!n||i?K==="default"?`${c}-entry-hover-default`:K==="blinds"?`${c}-entry-hover-blinds`:K==="reveal"?`${c}-entry-hover-reveal`:"":""} ${I}`.trim(),H=K==="reveal"&&(!n||i),te=(x==null?void 0:x[0])??!1,ke=(x==null?void 0:x[1])??!1,ge=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){ge.current=e,J.current=l;return}if(J.current!==l){ge.current=e,J.current=l;return}const Le=ge.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){ge.current=e;return}const lt=a0(e,Le,{designWidth:be});ge.current=e,Bu(e,lt)&&d(lt)},[e,d,n,l,be]);const Ye=s.useMemo(()=>c0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),je=s.useMemo(()=>ns(e,Eo),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),it=s.useMemo(()=>ns(e,Mo),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),qe=s.useMemo(()=>ns(e,Ao),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),et=s.useMemo(()=>Array.isArray($)&&$.length>0?$:[...Ti],[$]),Je=s.useMemo(()=>d0(et,p,Ye,je,it,qe),[et,p,Ye,je,it,qe]),Ge=rr(e),$e=s.useMemo(()=>Ln.slice(0,p).map(Le=>Ye[Le]),[p,Ye]),He=s.useMemo(()=>kl(p,Ge,Ye),[p,Ge,Ye]),De=s.useMemo(()=>ra(p,Ge,Ye),[p,Ge,Ye]),Qe=s.useMemo(()=>Je.map((Le,Xe)=>zu(De[Xe]??0,Le.paddingLeft,Le.paddingRight)),[Je,De]),he=s.useMemo(()=>{const Le=m===0?1/0:m;return(t??[]).slice(0,Le).map((lt,ct)=>({id:ct,cells:Object.fromEntries(Ti.map(wt=>[wt,lt[wt]??""])),image:lt.image,link:lt.link}))},[t,m]),_e=le?se??R:he.length,Ve=s.useMemo(()=>le?he.slice(0,_e):he,[he,le,_e]),tt=le&&_e<he.length,ft=Ve.length>1||tt,rt=[te?`${c}-divider-top`:"",ke||ft?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Oe=!n||i,Fe=()=>{if(!Oe)return;const Le=se??R;if(!b){ie(he.length);return}ie(Math.min(Le+b,he.length))},Ee=Le=>F.scalingValue(Le,n??!1),Ze=re?z??0:L??0,We=_??0,ot=g??0,nt=Math.max(We,ts),me=bc(0,Ve.length,te,ke,tt,f??0,n??!1).borderTopWidth,Ne=re?"rowPaddingTopB":"rowPaddingTop",st=Je[0],ut=Je[Je.length-1],Be=Qe[0],pt=Qe[Qe.length-1],Tt=st&&Be?Math.max(Be.paddingLeft,po):0,Lt=ut&&pt?Math.max(pt.paddingRight,po):0,xt=Ge,Et=(Le,Xe)=>Ev(P,Ie.current,oe?Le:null,Xe),Vt=(Le,Xe)=>{if(!ce)return;const lt=Le.image;if(!(lt!=null&<.url)){Z(()=>de(null));return}const ct=(D==null?void 0:D.min)??80,wt=(D==null?void 0:D.max)??320,It=(N==null?void 0:N.rowId)===Le.id,gt=It?N.widthPx:l0(ct,wt),{x:Ot,y:_t}=Et(Xe,gt);if(It&&oe){pe(Ot,_t);return}de({rowId:Le.id,url:lt.url,objectFit:"contain",isVideo:Lv(lt),widthPx:gt}),X.current={x:Ot,y:_t}},Ut=Le=>{if(!ce||!N||!oe)return;const{x:Xe,y:lt}=Et(Le,N.widthPx);pe(Xe,lt)},Kt=()=>{N&&Z(()=>de(null))},Pt=Le=>{H&&vc(Le,c),!(!ce||!N)&&Z(()=>de(null))},jt=Le=>{H&&xc(Le,c)};s.useLayoutEffect(()=>{if(!N||!X.current)return;const{x:Le,y:Xe}=X.current;X.current=null,xe(Le,Xe)},[N==null?void 0:N.rowId,N==null?void 0:N.url,xe]),s.useLayoutEffect(()=>{if(!u||re){ye(null);return}const Le=we.current,Xe=Le==null?void 0:Le.parentElement;if(!Le||!Xe){ye(null);return}const lt=()=>{const wt=Le.querySelector("[data-list-row]");if(!wt){ye(null);return}const It=Xe.getBoundingClientRect(),gt=wt.getBoundingClientRect();ye(gt.top-It.top+gt.height/2)};lt();const ct=new ResizeObserver(lt);return ct.observe(Le),ct.observe(Xe),()=>ct.disconnect()},[u,re,Ve,Ze,We,ot,t,e,Je,De,be,f,te,ke,tt]);const on=s.useMemo(()=>!re&&Il.some(Le=>{const Xe=Le.charAt(0),lt=e[`${Le}VerticalAlign`];return Hu(lt,e,Xe)}),[re,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Ot;const Le=Ie.current;if(!Le)return;const Xe=()=>{Le.querySelectorAll("[data-list-col]").forEach(_t=>{_t.style.transform="";const Mt=_t.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Gt=_t.querySelector(`.${c}-list-col-title`);Gt&&(Gt.style.transform="")})};if(re||!on){Xe();return}const lt=()=>{const _t=Array.from(Le.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Gt=`${c}-baseline-probe`;_t.forEach(Xt=>{Xt.querySelectorAll("[data-list-col]").forEach(Dt=>{Dt.style.transform="";const zt=Dt.querySelector(`.${Mt}`);zt&&(zt.style.minHeight="",zt.style.height="");const Bt=Dt.querySelector(`.${c}-list-col-title`);Bt&&(Bt.style.transform="")})}),_t.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]"));jv(Xt,Dt,Mt)}),Le.offsetHeight,_t.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]")),zt=Xt.getBoundingClientRect().top,Bt=new Map,bt=Dt.map(Ae=>{const ze=Ae.querySelector(`.${c}-list-col-title`),mt={el:Ae,titleEl:ze,letter:Ae.getAttribute("data-col-letter")??"",kind:Ae.getAttribute("data-valign")??"top",anchor:Ae.getAttribute("data-valign-anchor")};return Bt.set(mt.letter,mt),mt}),A=new Map,Te=(Ae,ze)=>{const mt=A.get(Ae.letter);if(mt!==void 0)return mt;const Nt=Ae.anchor?Bt.get(Ae.anchor):void 0;if(Ae.kind!=="baseline"||!Nt||ze.has(Ae.letter)){const sn=es(Ae,zt,Mt,Gt);return A.set(Ae.letter,sn),sn}ze.add(Ae.letter);const ht=Te(Nt,ze);ze.delete(Ae.letter);const St=es(Ae,zt,Mt,Gt),qt=ht-St;Vv(Ae.titleEl,qt);const At=es(Ae,zt,Mt,Gt);return A.set(Ae.letter,At),At};bt.forEach(Ae=>Te(Ae,new Set))})};let ct=null;const wt=()=>{ct===null&&(ct=requestAnimationFrame(()=>{ct=null,lt()}))};lt();const It=new ResizeObserver(()=>wt());It.observe(Le);let gt=!1;return typeof document<"u"&&((Ot=document.fonts)!=null&&Ot.ready)&&document.fonts.ready.then(()=>{gt||wt()}),()=>{gt=!0,ct!==null&&(cancelAnimationFrame(ct),ct=null),It.disconnect(),Xe()}},[on,re,e,t,be,Ve,De]);const vt=s.useMemo(()=>Av(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:vt}}),a.jsx("div",{style:B,children:a.jsxs("div",{ref:Ie,className:`${c}-wrapper ${ne}${rt?` ${rt}`:""}${re?` ${c}-type-b`:""}`.trim(),style:{width:F.scalingValue(y??0,n)},onMouseMove:ce?Ut:void 0,onMouseLeave:ce?Kt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ve.map((Le,Xe)=>{var It;const lt=(((It=Le.link)==null?void 0:It.length)??0)>0,ct=lt&&(!n||i)?"a":"div",wt=bc(Xe,Ve.length,te,ke,tt,f??0,n??!1);return a.jsxs(ct,{ref:Xe===0?gt=>{we.current=gt}:void 0,className:`${c}-list-item${lt||T==="always"?` ${c}-list-item-has-link`:""}${tt&&Xe===Ve.length-1?` ${c}-list-item-before-cut`:""}`,...lt?{href:Le.link,target:"_blank"}:{},style:wt,onMouseEnter:gt=>{H&&(lt||T==="always")&&vc(gt,c),ce&&Vt(Le,gt)},onMouseLeave:gt=>{H&&(lt||T==="always")&&xc(gt,c)},children:[Ze>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ee(Ze)}}),a.jsxs("div",{className:`${c}-list-cols-row${re?"":` ${c}-list-cols-row-h`}${u&&Xe===0&&re?` ${c}-list-cols-row-controls`:""}`,...re?{}:{"data-list-row":""},style:re?void 0:{minHeight:Ee(ot)},children:[Je.map((gt,Ot)=>{const _t=Ot===Je.length-1,Mt=Qe[Ot],Gt=gt.paddingBottom,Xt=Rv(Le.cells[gt.key]),Dt=re&&Xt&&Gt>0,zt=re?{minHeight:Ee(ot)}:{width:Ee(De[Ot])},Bt=re?{paddingLeft:Ee(Y),paddingRight:Ee(Y)}:{paddingLeft:Ee(Mt.paddingLeft),paddingRight:Ee(Mt.paddingRight)},bt=gt.textPrefix.charAt(0),A=re?Wv(e[`${gt.textPrefix}VerticalAlign`]):_v(e[`${gt.textPrefix}VerticalAlign`],e,bt),Te=re&&Xt&&u&&Xe===0;return re&&!Xt?null:a.jsxs("div",{className:re?`${c}-list-col-wrap`:void 0,...re?{}:{"data-list-col":"","data-col-letter":bt,"data-valign":A.kind,...A.kind==="baseline"?{"data-valign-anchor":A.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${_t?` ${c}-list-col-last`:""}`,style:{...Bt,...zt,...re?{justifyContent:$c(A.kind)}:{}},"data-test":gt.width,children:a.jsx("span",{className:Tc(e,gt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Cc(ga(e,gt.textPrefix),n),...Lc(e,gt.textPrefix,c,n),...re?{}:Ov(A.kind)},children:Le.cells[gt.key]??null})}),Dt&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ee(Gt)}}),Te&&a.jsx("div",{"data-controls":gt.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ee(Math.max(Gt,ts))}})]},gt.key)}),u&&Xe===0&&re&&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(ve),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Ee(ee),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(ve),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Ee(Math.max(ee,Ge-ee)),width:Ee(ee),height:"100%"}})]})]}),!re&&We>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ee(We)}}),u&&Xe===0&&!re&&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:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ee(nt)}})]},Le.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ne,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":re?"center":"left-y",className:`${c}-control-anchor`,style:{top:me,left:0,width:"100%",height:Ee(Math.max(Ze,ts))}})},"row-padding-handles"),u&&!re&&st&&ut&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":st.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[0]-((Be==null?void 0:Be.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Ee(Tt),height:"100%"}}),a.jsx("div",{"data-controls":ut.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[Je.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:`${c}-control-anchor`,style:{top:0,left:Ee(xt-Lt),width:Ee(Lt),height:"100%"}})]},"column-edge-padding-handles"),u&&!re&&Je.slice(0,-1).map((Le,Xe)=>{const lt=Je[Xe+1],ct=He.slice(0,Xe+1).reduce((_t,Mt)=>_t+Mt,0),wt=Qe[Xe],It=Qe[Xe+1],gt=Math.max(wt.paddingRight,po),Ot=Math.max(It.paddingLeft,po);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Le.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[Xe]-wt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ee(ct-gt),width:Ee(gt),height:"100%"}}),a.jsx("div",{"data-controls":lt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[Xe+1]-It.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ee(ct),width:Ee(Ot),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!re&&Je.slice(0,-1).map((Le,Xe)=>{const lt=s0(Xe,He,$e,Ge),wt=He.slice(0,Xe+1).reduce((It,gt)=>It+gt,0)-Ic/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Le.widthKey,"data-controls-axis":"x","data-controls-min":String(Pl),"data-controls-max-fraction":String(lt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ee(wt),width:Ee(Ic),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),tt&&(()=>{const Le=ga(e,ni),Xe=Dv(e.cutLabelVerticalAlign),lt=Le.textTextAlign==="justify"||re;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ee(S??0),cursor:Oe?"pointer":"default",...Pv(ke,f??0,n??!1)},onClick:Oe?Fe:void 0,onMouseEnter:H||ce?Pt:void 0,onMouseLeave:H?jt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...re?{paddingLeft:Ee(Y),paddingRight:Ee(Y)}:{},justifyContent:zv(Le.textTextAlign),alignItems:$c(Xe)},children:a.jsx("span",{className:Tc(e,ni,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Cc(Le,n),...Lc(e,ni,c,n),...lt?{width:"100%"}:{}},children:G})})})})(),ce&&N&&(()=>{const Le=`${N.widthPx}px`,Xe={width:Le,height:"auto",maxHeight:Le,objectFit:"contain"};return a.jsx("div",{ref:Pe,className:`${c}-hover-media-anchor`,children:a.jsx(Iv,{media:N,className:N.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Xe},`${N.rowId}-${N.url}`)})})()]})})]})}const p0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10321
|
+
`}const Ti=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Il=["AColumn","BColumn","CColumn","DColumn","EColumn"],ii="cutLabel",hr=[...Il,ii],Aa=["A","B","C","D","E"];function _u(e){return`${e}ColumnVerticalAlign`}const _s=["Top","Center","Bottom"];function Rl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Aa.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Fv(e){const t=Rl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Nv(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Aa.includes(n)?n:null}function Wu(e,t,n){const i=Nv(e);return i?i===t?!1:Fv(n[_u(i)]):!0}function fr(e){const t=Rl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Aa.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function _v(e,t,n){if(Hu(e,t,n))return fr(e);const i=fr(e);return i.kind==="baseline"?{kind:"top"}:i}function Wv(e){const t=fr(e);return t.kind==="baseline"?{kind:"top"}:t}function Hu(e,t,n){return Wu(e,n,t)?fr(e).kind==="baseline":!1}function Hv(e){const t={};let n=!1;for(const i of Aa){const o=_u(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}Wu(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Ov(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Dv(e){const t=fr(e).kind;return t==="baseline"?"center":t}function zv(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function $c(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Bv(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 es(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Bv(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=r.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+l}function jv(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 Vv(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Gv={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Ht(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Xv={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function qv(e){return[Ht(e,"textFontFamily"),Ht(e,"textFontSettings"),{type:"row",items:[Ht(e,"textFontSize"),Ht(e,"textLineHeight"),Ht(e,"textLetterSpacing"),Ht(e,"textWordSpacing")]},Ht(e,"textTextAlign"),Ht(e,"textTextAppearance"),`${e}VerticalAlign`]}function Uv(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(hr.map(e=>[Xv[e],qv(e)]))}}function ga(e,t){const n=i=>{const o=Ht(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===ii?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Cc(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 dn(Qt(n,t))}function Tc(e,t,n,i){const o=ga(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Lc(e,t,n,i){const o=ga(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:N.scalingValue((r-l)/2,i)}}const Ln=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Eo=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Mo=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ao=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Yv={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Kv=["hover","focus","filled","success","error"],Ic=.004,po=.004,ts=po,Pl=50,yr=1440,vr=Pl/yr;function Ou(e){const t=typeof e=="number"&&e>0?e:yr;return Pl/t}function Zv(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 yr}const Du={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function rr(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Jv(e,t=1){const n=t/e;return Object.fromEntries(Ln.map(i=>[i,n]))}function Qv(){return Object.fromEntries([...Eo.map(e=>[e,0]),...Mo.map(e=>[e,0])])}function e0(){return Object.fromEntries(Ao.map(e=>[e,0]))}function Hr(e){return Object.fromEntries(Ln.map(t=>[t,typeof e[t]=="number"?e[t]:Du[t]]))}function zu(e,t,n){const i=e-vr,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 ra(e,t,n){const i=kl(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 t0(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Eo[o],l=Mo[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=zu(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function kl(e,t,n){if(e<=0)return[];const i=Ln.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)+vr;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-vr;if(p<=0)continue;const x=Math.min(c,p);d[u]-=x,c-=x}return[...d,i[e-1]]}function n0(e,t,n){if(e<=1)return{};const i=kl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=Ln[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Rc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Ti]}function i0(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,Ln.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=Ln[c],p=Eo[c],x=Mo[c],v=Ao[c],m=Ln[l],g=Eo[l],h=Mo[l],b=Ao[l],E=n[u],y=n[p],w=n[x],j=n[v];typeof E=="number"&&(r[m]=E),typeof y=="number"&&(r[g]=y),typeof w=="number"&&(r[h]=w),typeof j=="number"&&(r[b]=j)}return r}function Bu(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 r0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=rr(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Jv(n,o),...Qv()};if(r)for(const d of Ao)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,e0());return Bu(e,l)?l:e}function a0(e,t,n){const i=Hv(e);i&&(e={...e,...i});const o=Ou(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=rr(e),c=rr(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Ti.length,x=w=>{if(u)return w;const j=Hr({...t,...w}),G=rr(w),A=ra(p,G,j),P=t0(p,A,{...t,...w});return Object.keys(P).length===0?w:{...w,...P}};if(typeof r=="number"&&r!==l)return e;const v=Rc(e),m=Rc(t);if(!i0(v,m))return x({...e,...o0(v,m,t,p)});if(d<c&&typeof p=="number"&&!u){const w=Hr({...t,...e});return x({...e,...n0(p,d,w)})}if(u){const w=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,j=Math.max(0,(d-o)/2);return w>j?{...e,textPaddingLR:j}:e}const g=Hr({...t,...e}),h=ra(p,c,Hr(t)),E=ra(p,d,g).some((w,j)=>w<(h[j]??w)),y=Ln.some(w=>{const j=e[w],G=t[w];return typeof j=="number"&&typeof G=="number"&&j!==G});return E||y?x(e):e}function s0(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),r=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(vr,i-o-r-vr)}function l0(e,t){return Math.random()*(t-e)+e}function c0(e){return Object.fromEntries(Ln.map(t=>[t,typeof e[t]=="number"?e[t]:Du[t]]))}function ns(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function d0(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=Eo[d],u=Mo[d],p=Ao[d];return{key:l,textPrefix:Gv[l],widthKey:Ln[d],width:n[Ln[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function u0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=N.useScopedStyles(),u=!!o,{columns:p,type:x,wrapperWidth:v,entriesCount:m,cellMinHeight:g,dividerWidth:h,showVisibility:b,cut:E,showCut:y,cutCellMinHeight:w,cutLabel:j,imageSize:G,imageOnHover:A,imagePosition:P="cursor",imageInterpolation:W="on",entryHoverEffect:Y,entryHoverShowOption:$,rowPaddingTop:I,rowPaddingBottom:H,rowPaddingTopB:O,columnsOrder:C,textPaddingLR:L,textColor:D,backgroundColor:S,dividerColor:U,textHoverColor:T,backgroundHoverColor:_,dividerHoverColor:B}=e,[ae,ie]=s.useState(void 0),[k,ue]=s.useState(null),X=s.useRef(null),le=A==="on"&&(!n||i),te=P==="cursor",we=te&&W==="on",{anchorRef:ke,onShow:fe,onCursorMove:me,exit:Z}=Mv(!!(le&&k!==null),we),se=(E??0)>0,oe=x==="b",Pe=s.useRef(null),$e=s.useRef(null),[Me,ye]=s.useState(null),[be,Ce]=s.useState(yr),f=Ou(be),q=Math.max(0,((v??0)-f)/2),K=Math.min(L??0,q),ne=Math.max(K,po),ge=((v??0)+f)/2;s.useLayoutEffect(()=>{if(!n){Ce(yr);return}const Re=()=>{Ce(Zv(Pe.current))};Re();const Ge=Pe.current;if(!Ge)return;const lt=new ResizeObserver(Re);lt.observe(Ge);let ct=Ge;for(;ct&&!ct.style.getPropertyValue("--cntrl-article-width");)ct=ct.parentElement;return ct&<.observe(ct),()=>lt.disconnect()},[n,l]),s.useEffect(()=>{ie(void 0)},[E,y,t,m]),s.useEffect(()=>{n&&!i&&ie(void 0)},[n,i]);const z=N.buildColorVars(c,{textColor:D,backgroundColor:S,dividerColor:U,textHoverColor:T,backgroundHoverColor:_,dividerHoverColor:B},Yv,Kv),R=r&&r!=="default"?`${c}-state-${r}`:"",ee=`${!n||i?Y==="default"?`${c}-entry-hover-default`:Y==="blinds"?`${c}-entry-hover-blinds`:Y==="reveal"?`${c}-entry-hover-reveal`:"":""} ${R}`.trim(),ce=Y==="reveal"&&(!n||i),V=(b==null?void 0:b[0])??!1,Le=(b==null?void 0:b[1])??!1,ve=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){ve.current=e,J.current=l;return}if(J.current!==l){ve.current=e,J.current=l;return}const Re=ve.current;if(!(Re!==e))return;if(typeof Re.columns=="number"&&typeof e.columns=="number"&&Re.columns!==e.columns){ve.current=e;return}const lt=a0(e,Re,{designWidth:be});ve.current=e,Bu(e,lt)&&d(lt)},[e,d,n,l,be]);const _e=s.useMemo(()=>c0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Be=s.useMemo(()=>ns(e,Eo),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),at=s.useMemo(()=>ns(e,Mo),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ue=s.useMemo(()=>ns(e,Ao),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),et=s.useMemo(()=>Array.isArray(C)&&C.length>0?C:[...Ti],[C]),Je=s.useMemo(()=>d0(et,p,_e,Be,at,Ue),[et,p,_e,Be,at,Ue]),Ye=rr(e),xe=s.useMemo(()=>Ln.slice(0,p).map(Re=>_e[Re]),[p,_e]),We=s.useMemo(()=>kl(p,Ye,_e),[p,Ye,_e]),He=s.useMemo(()=>ra(p,Ye,_e),[p,Ye,_e]),Qe=s.useMemo(()=>Je.map((Re,Ge)=>zu(He[Ge]??0,Re.paddingLeft,Re.paddingRight)),[Je,He]),he=s.useMemo(()=>{const Re=m===0?1/0:m;return(t??[]).slice(0,Re).map((lt,ct)=>({id:ct,cells:Object.fromEntries(Ti.map(wt=>[wt,lt[wt]??""])),image:lt.image,link:lt.link}))},[t,m]),Ne=se?ae??E:he.length,Ve=s.useMemo(()=>se?he.slice(0,Ne):he,[he,se,Ne]),tt=se&&Ne<he.length,mt=Ve.length>1||tt,st=[V?`${c}-divider-top`:"",Le||mt?`${c}-divider-bottom`:""].filter(Boolean).join(" "),De=!n||i,Fe=()=>{if(!De)return;const Re=ae??E;if(!y){ie(he.length);return}ie(Math.min(Re+y,he.length))},Xe=Re=>N.scalingValue(Re,n??!1),ot=oe?O??0:I??0,Oe=H??0,qe=g??0,nt=Math.max(Oe,ts),de=bc(0,Ve.length,V,Le,tt,h??0,n??!1).borderTopWidth,Ie=oe?"rowPaddingTopB":"rowPaddingTop",it=Je[0],ut=Je[Je.length-1],je=Qe[0],pt=Qe[Qe.length-1],Tt=it&&je?Math.max(je.paddingLeft,po):0,Lt=ut&&pt?Math.max(pt.paddingRight,po):0,xt=Ye,Et=(Re,Ge)=>Ev(P,Pe.current,te?Re:null,Ge),Vt=(Re,Ge)=>{if(!le)return;const lt=Re.image;if(!(lt!=null&<.url)){Z(()=>ue(null));return}const ct=(G==null?void 0:G.min)??80,wt=(G==null?void 0:G.max)??320,It=(k==null?void 0:k.rowId)===Re.id,ht=It?k.widthPx:l0(ct,wt),{x:Ot,y:_t}=Et(Ge,ht);if(It&&te){me(Ot,_t);return}ue({rowId:Re.id,url:lt.url,objectFit:"contain",isVideo:Lv(lt),widthPx:ht}),X.current={x:Ot,y:_t}},Ut=Re=>{if(!le||!k||!te)return;const{x:Ge,y:lt}=Et(Re,k.widthPx);me(Ge,lt)},Kt=()=>{k&&Z(()=>ue(null))},Pt=Re=>{ce&&vc(Re,c),!(!le||!k)&&Z(()=>ue(null))},jt=Re=>{ce&&xc(Re,c)};s.useLayoutEffect(()=>{if(!k||!X.current)return;const{x:Re,y:Ge}=X.current;X.current=null,fe(Re,Ge)},[k==null?void 0:k.rowId,k==null?void 0:k.url,fe]),s.useLayoutEffect(()=>{if(!u||oe){ye(null);return}const Re=$e.current,Ge=Re==null?void 0:Re.parentElement;if(!Re||!Ge){ye(null);return}const lt=()=>{const wt=Re.querySelector("[data-list-row]");if(!wt){ye(null);return}const It=Ge.getBoundingClientRect(),ht=wt.getBoundingClientRect();ye(ht.top-It.top+ht.height/2)};lt();const ct=new ResizeObserver(lt);return ct.observe(Re),ct.observe(Ge),()=>ct.disconnect()},[u,oe,Ve,ot,Oe,qe,t,e,Je,He,be,h,V,Le,tt]);const on=s.useMemo(()=>!oe&&Il.some(Re=>{const Ge=Re.charAt(0),lt=e[`${Re}VerticalAlign`];return Hu(lt,e,Ge)}),[oe,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Ot;const Re=Pe.current;if(!Re)return;const Ge=()=>{Re.querySelectorAll("[data-list-col]").forEach(_t=>{_t.style.transform="";const Mt=_t.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Gt=_t.querySelector(`.${c}-list-col-title`);Gt&&(Gt.style.transform="")})};if(oe||!on){Ge();return}const lt=()=>{const _t=Array.from(Re.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Gt=`${c}-baseline-probe`;_t.forEach(Xt=>{Xt.querySelectorAll("[data-list-col]").forEach(Dt=>{Dt.style.transform="";const zt=Dt.querySelector(`.${Mt}`);zt&&(zt.style.minHeight="",zt.style.height="");const Bt=Dt.querySelector(`.${c}-list-col-title`);Bt&&(Bt.style.transform="")})}),_t.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]"));jv(Xt,Dt,Mt)}),Re.offsetHeight,_t.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]")),zt=Xt.getBoundingClientRect().top,Bt=new Map,bt=Dt.map(Ae=>{const ze=Ae.querySelector(`.${c}-list-col-title`),gt={el:Ae,titleEl:ze,letter:Ae.getAttribute("data-col-letter")??"",kind:Ae.getAttribute("data-valign")??"top",anchor:Ae.getAttribute("data-valign-anchor")};return Bt.set(gt.letter,gt),gt}),F=new Map,Te=(Ae,ze)=>{const gt=F.get(Ae.letter);if(gt!==void 0)return gt;const Nt=Ae.anchor?Bt.get(Ae.anchor):void 0;if(Ae.kind!=="baseline"||!Nt||ze.has(Ae.letter)){const sn=es(Ae,zt,Mt,Gt);return F.set(Ae.letter,sn),sn}ze.add(Ae.letter);const ft=Te(Nt,ze);ze.delete(Ae.letter);const St=es(Ae,zt,Mt,Gt),qt=ft-St;Vv(Ae.titleEl,qt);const At=es(Ae,zt,Mt,Gt);return F.set(Ae.letter,At),At};bt.forEach(Ae=>Te(Ae,new Set))})};let ct=null;const wt=()=>{ct===null&&(ct=requestAnimationFrame(()=>{ct=null,lt()}))};lt();const It=new ResizeObserver(()=>wt());It.observe(Re);let ht=!1;return typeof document<"u"&&((Ot=document.fonts)!=null&&Ot.ready)&&document.fonts.ready.then(()=>{ht||wt()}),()=>{ht=!0,ct!==null&&(cancelAnimationFrame(ct),ct=null),It.disconnect(),Ge()}},[on,oe,e,t,be,Ve,He]);const vt=s.useMemo(()=>Av(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:vt}}),a.jsx("div",{style:z,children:a.jsxs("div",{ref:Pe,className:`${c}-wrapper ${ee}${st?` ${st}`:""}${oe?` ${c}-type-b`:""}`.trim(),style:{width:N.scalingValue(v??0,n)},onMouseMove:le?Ut:void 0,onMouseLeave:le?Kt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ve.map((Re,Ge)=>{var It;const lt=(((It=Re.link)==null?void 0:It.length)??0)>0,ct=lt&&(!n||i)?"a":"div",wt=bc(Ge,Ve.length,V,Le,tt,h??0,n??!1);return a.jsxs(ct,{ref:Ge===0?ht=>{$e.current=ht}:void 0,className:`${c}-list-item${lt||$==="always"?` ${c}-list-item-has-link`:""}${tt&&Ge===Ve.length-1?` ${c}-list-item-before-cut`:""}`,...lt?{href:Re.link,target:"_blank"}:{},style:wt,onMouseEnter:ht=>{ce&&(lt||$==="always")&&vc(ht,c),le&&Vt(Re,ht)},onMouseLeave:ht=>{ce&&(lt||$==="always")&&xc(ht,c)},children:[ot>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Xe(ot)}}),a.jsxs("div",{className:`${c}-list-cols-row${oe?"":` ${c}-list-cols-row-h`}${u&&Ge===0&&oe?` ${c}-list-cols-row-controls`:""}`,...oe?{}:{"data-list-row":""},style:oe?void 0:{minHeight:Xe(qe)},children:[Je.map((ht,Ot)=>{const _t=Ot===Je.length-1,Mt=Qe[Ot],Gt=ht.paddingBottom,Xt=Rv(Re.cells[ht.key]),Dt=oe&&Xt&&Gt>0,zt=oe?{minHeight:Xe(qe)}:{width:Xe(He[Ot])},Bt=oe?{paddingLeft:Xe(K),paddingRight:Xe(K)}:{paddingLeft:Xe(Mt.paddingLeft),paddingRight:Xe(Mt.paddingRight)},bt=ht.textPrefix.charAt(0),F=oe?Wv(e[`${ht.textPrefix}VerticalAlign`]):_v(e[`${ht.textPrefix}VerticalAlign`],e,bt),Te=oe&&Xt&&u&&Ge===0;return oe&&!Xt?null:a.jsxs("div",{className:oe?`${c}-list-col-wrap`:void 0,...oe?{}:{"data-list-col":"","data-col-letter":bt,"data-valign":F.kind,...F.kind==="baseline"?{"data-valign-anchor":F.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${_t?` ${c}-list-col-last`:""}`,style:{...Bt,...zt,...oe?{justifyContent:$c(F.kind)}:{}},"data-test":ht.width,children:a.jsx("span",{className:Tc(e,ht.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Cc(ga(e,ht.textPrefix),n),...Lc(e,ht.textPrefix,c,n),...oe?{}:Ov(F.kind)},children:Re.cells[ht.key]??null})}),Dt&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Xe(Gt)}}),Te&&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:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Xe(Math.max(Gt,ts))}})]},ht.key)}),u&&Ge===0&&oe&&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(ge),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Xe(ne),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(ge),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Xe(Math.max(ne,Ye-ne)),width:Xe(ne),height:"100%"}})]})]}),!oe&&Oe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Xe(Oe)}}),u&&Ge===0&&!oe&&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:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Xe(nt)}})]},Re.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ie,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":oe?"center":"left-y",className:`${c}-control-anchor`,style:{top:de,left:0,width:"100%",height:Xe(Math.max(ot,ts))}})},"row-padding-handles"),u&&!oe&&it&&ut&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":it.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(He[0]-((je==null?void 0:je.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Xe(Tt),height:"100%"}}),a.jsx("div",{"data-controls":ut.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(He[Je.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:`${c}-control-anchor`,style:{top:0,left:Xe(xt-Lt),width:Xe(Lt),height:"100%"}})]},"column-edge-padding-handles"),u&&!oe&&Je.slice(0,-1).map((Re,Ge)=>{const lt=Je[Ge+1],ct=We.slice(0,Ge+1).reduce((_t,Mt)=>_t+Mt,0),wt=Qe[Ge],It=Qe[Ge+1],ht=Math.max(wt.paddingRight,po),Ot=Math.max(It.paddingLeft,po);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(He[Ge]-wt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:Xe(ct-ht),width:Xe(ht),height:"100%"}}),a.jsx("div",{"data-controls":lt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(He[Ge+1]-It.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:Xe(ct),width:Xe(Ot),height:"100%"}})]},`${Re.paddingRightKey}-padding`)}),u&&!oe&&Je.slice(0,-1).map((Re,Ge)=>{const lt=s0(Ge,We,xe,Ye),wt=We.slice(0,Ge+1).reduce((It,ht)=>It+ht,0)-Ic/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(Pl),"data-controls-max-fraction":String(lt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Xe(wt),width:Xe(Ic),height:"calc(100%)",pointerEvents:"auto"}})},`${Re.widthKey}-junction`)})]}),tt&&(()=>{const Re=ga(e,ii),Ge=Dv(e.cutLabelVerticalAlign),lt=Re.textTextAlign==="justify"||oe;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Xe(w??0),cursor:De?"pointer":"default",...Pv(Le,h??0,n??!1)},onClick:De?Fe:void 0,onMouseEnter:ce||le?Pt:void 0,onMouseLeave:ce?jt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...oe?{paddingLeft:Xe(K),paddingRight:Xe(K)}:{},justifyContent:zv(Re.textTextAlign),alignItems:$c(Ge)},children:a.jsx("span",{className:Tc(e,ii,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Cc(Re,n),...Lc(e,ii,c,n),...lt?{width:"100%"}:{}},children:j})})})})(),le&&k&&(()=>{const Re=`${k.widthPx}px`,Ge={width:Re,height:"auto",maxHeight:Re,objectFit:"contain"};return a.jsx("div",{ref:ke,className:`${c}-hover-media-anchor`,children:a.jsx(Iv,{media:k,className:k.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Ge},`${k.rowId}-${k.url}`)})})()]})})]})}const p0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10318
10322
|
import { CommonComponentProps } from '../props';
|
|
10319
10323
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
10320
10324
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -13402,7 +13406,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13402
13406
|
</>
|
|
13403
13407
|
);
|
|
13404
13408
|
}
|
|
13405
|
-
`,jo=["A","B","C","D","E"],Pc=[..._s,"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 m0(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Or(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function g0(){return Object.fromEntries(jo.map((e,t)=>{const n=Ti[t],i=`${e} column`;return[n,m0(i)]}))}function h0(){const e={};for(const t of jo)e[`${t}ColumnWidth`]=Or(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Or(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Or(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Or(`${t} column padding bottom`);return e}function kc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Ti]};for(const r of jo)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 f0(e){const t={};if(e===ni)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[..._s]},enum:[..._s]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Pc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Pc]}}return t[Ht(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Ht(e,"textFontSettings")]={...Ni.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Ht(e,"textFontSize")]={...Ni.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ht(e,"textLineHeight")]={...Ni.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ht(e,"textLetterSpacing")]={...Ni.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ht(e,"textWordSpacing")]={...Ni.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ht(e,"textTextAlign")]={...Ni.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ht(e,"textTextAppearance")]={...Ni.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const y0=hr.reduce((e,t)=>({...e,...f0(t)}),{});function v0(e){return{verticalAlign:e===ni?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===ni?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function x0(e,t={}){var n;return{...v0(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ec=new Set(["textFontFamily","textFontSettings"]);function b0(e,t,n){const i=r=>n===void 0?!0:n==="common"?Ec.has(r):!Ec.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Rl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Ht(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Ht(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Ht(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Ht(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Ht(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Ht(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Ht(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Ht(e,"textTextAppearance")]=t.textTextAppearance),o}function aa(e={},t){return hr.reduce((n,i)=>({...n,...b0(i,x0(i,e),t)}),{})}const S0=aa(),w0=Uv();function ju(e){return[Ht(e,"textFontFamily"),Ht(e,"textFontSettings"),Ht(e,"textFontSize"),Ht(e,"textLineHeight"),Ht(e,"textLetterSpacing"),Ht(e,"textWordSpacing"),Ht(e,"textTextAlign"),Ht(e,"textTextAppearance"),`${e}VerticalAlign`]}function $0(){const e=[];return Il.forEach((t,n)=>{const i=Ti[n],o=ju(t);for(let r=1;r<Ti.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const C0=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];ju(ni);const T0=[...jo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],_i=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],L0=[{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:""}],I0=[...jo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],R0={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:{...g0(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:L0},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"}},...h0(),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"}},...y0,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",...S0,...aa({},"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},...aa({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},...aa({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...$0(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...T0.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}},...jo.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",...I0]},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__",w0]}],paletteBookmark:{items:[...C0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},P0={element:u0,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>r0(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...hr.map(e=>({path:`${Ht(e,"textFontFamily")}`}))]},fontRelations:{...hr.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Ht(t,"textFontFamily")}`}),{})},schema:R0,sourceCode:p0},Mc=300,di=.004,k0={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"},E0=["hover","focus","filled","success","error"];function M0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ac(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Fc(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 A0(e){return`
|
|
13409
|
+
`,jo=["A","B","C","D","E"],Pc=[..._s,"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 m0(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Or(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function g0(){return Object.fromEntries(jo.map((e,t)=>{const n=Ti[t],i=`${e} column`;return[n,m0(i)]}))}function h0(){const e={};for(const t of jo)e[`${t}ColumnWidth`]=Or(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Or(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Or(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Or(`${t} column padding bottom`);return e}function kc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Ti]};for(const r of jo)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 f0(e){const t={};if(e===ii)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[..._s]},enum:[..._s]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Pc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Pc]}}return t[Ht(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Ht(e,"textFontSettings")]={...Ni.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Ht(e,"textFontSize")]={...Ni.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ht(e,"textLineHeight")]={...Ni.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ht(e,"textLetterSpacing")]={...Ni.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ht(e,"textWordSpacing")]={...Ni.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ht(e,"textTextAlign")]={...Ni.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ht(e,"textTextAppearance")]={...Ni.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const y0=hr.reduce((e,t)=>({...e,...f0(t)}),{});function v0(e){return{verticalAlign:e===ii?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===ii?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function x0(e,t={}){var n;return{...v0(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ec=new Set(["textFontFamily","textFontSettings"]);function b0(e,t,n){const i=r=>n===void 0?!0:n==="common"?Ec.has(r):!Ec.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Rl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Ht(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Ht(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Ht(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Ht(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Ht(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Ht(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Ht(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Ht(e,"textTextAppearance")]=t.textTextAppearance),o}function aa(e={},t){return hr.reduce((n,i)=>({...n,...b0(i,x0(i,e),t)}),{})}const S0=aa(),w0=Uv();function ju(e){return[Ht(e,"textFontFamily"),Ht(e,"textFontSettings"),Ht(e,"textFontSize"),Ht(e,"textLineHeight"),Ht(e,"textLetterSpacing"),Ht(e,"textWordSpacing"),Ht(e,"textTextAlign"),Ht(e,"textTextAppearance"),`${e}VerticalAlign`]}function $0(){const e=[];return Il.forEach((t,n)=>{const i=Ti[n],o=ju(t);for(let r=1;r<Ti.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const C0=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];ju(ii);const T0=[...jo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],_i=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],L0=[{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:""}],I0=[...jo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],R0={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:{...g0(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:L0},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"}},...h0(),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"}},...y0,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",...S0,...aa({},"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},...aa({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},...aa({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...$0(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...T0.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}},...jo.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",...I0]},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__",w0]}],paletteBookmark:{items:[...C0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},P0={element:u0,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>r0(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...hr.map(e=>({path:`${Ht(e,"textFontFamily")}`}))]},fontRelations:{...hr.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Ht(t,"textFontFamily")}`}),{})},schema:R0,sourceCode:p0},Mc=300,ui=.004,k0={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"},E0=["hover","focus","filled","success","error"];function M0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ac(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Fc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:N.scalingValue((o-t)/2,i)}}function A0(e){return`
|
|
13406
13410
|
.${e}-wrapper {
|
|
13407
13411
|
box-sizing: border-box;
|
|
13408
13412
|
display: flex;
|
|
@@ -13567,7 +13571,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13567
13571
|
pointer-events: none;
|
|
13568
13572
|
z-index: 2;
|
|
13569
13573
|
}
|
|
13570
|
-
`}function Nc(e,t,n,i,o,r,l,d){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:r??0,textAppearance:l,color:d??"#000000"}}function F0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=
|
|
13574
|
+
`}function Nc(e,t,n,i,o,r,l,d){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:r??0,textAppearance:l,color:d??"#000000"}}function F0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=N.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:x="solid",entryHoverEffect:v="default",autoclose:m="off",icon:g,iconMaxWidth:h=.00833,iconPaddingRight:b=0,iconAnimation:E="rotate 45",questionColor:y="#000000",answerColor:w="#000000",dividerColor:j="#0000001F",iconColor:G="#000000",questionHoverColor:A="#666666",iconHoverColor:P="#666666",iconActiveColor:W="#000000",dividerHoverColor:Y="#000000",questionFontFamily:$,questionFontSettings:I,questionFontSize:H,questionLineHeight:O,questionLetterSpacing:C,questionWordSpacing:L,questionTextAppearance:D,answerFontFamily:S,answerFontSettings:U,answerFontSize:T,answerLineHeight:_,answerLetterSpacing:B,answerWordSpacing:ae,answerTextAppearance:ie,questionPaddingLeft:k=0,questionPaddingTop:ue=0,questionPaddingBottom:X=0,answerPaddingLeft:le=0,answerPaddingRight:te=0,answerPaddingTop:we=0,answerPaddingBottom:ke=0}=e,fe=t??[],[me,Z]=s.useState(()=>new Set),se=!n||i;s.useEffect(()=>{Z(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&Z(new Set)},[n,o,i]);const oe=Qe=>N.scalingValue(Qe,n??!1),Pe=Math.max(k,ui),$e=Math.max(ue,ui),Me=Math.max(X,ui),ye=Math.max(le,ui),be=Math.max(te,ui),Ce=Math.max(we,ui),f=Math.max(ke,ui),q=Math.max(0,(c??1)-b-h),K=Math.max(0,(c??1)-te),ne=Math.max(0,(c??1)-le),ge=Math.max(b,ui),z=Math.max(0,(c??1)-k-h),R=s.useMemo(()=>me.size===0?0:Math.min(...me),[me]),Q=s.useCallback(Qe=>me.has(Qe),[me]),ee=se&&v==="default"?`${l}-entry-hover-default`:"",ce=g??"",V=ce!=="",Le=E.replace(/^rotate /,""),ve=`${l}-icon-anim-${Le}`,J=dn(Qt(Nc($,I,H,O,C,L,D,y),n)),_e=dn(Qt(Nc(S,U,T,_,B,ae,ie,w),n)),Be=Ac(H,O,`${l}-question`,`${l}-text-tight-leading`),at=Ac(T,_,`${l}-answer-text`,`${l}-text-tight-leading`),Ue=Fc(H,O,l,n),et=Fc(T,_,l,n),Je=N.buildColorVars(l,{questionColor:y,answerColor:w,dividerColor:j,iconColor:G,questionHoverColor:A,iconHoverColor:P,iconActiveColor:W,dividerHoverColor:Y},k0,E0),Ye=r&&r!=="default"?`${l}-state-${r}`:"",xe=s.useCallback(Qe=>{se&&Z(he=>{if(he.has(Qe)){const Ve=new Set(he);return Ve.delete(Qe),Ve}if(m==="on")return new Set([Qe]);const Ne=new Set(he);return Ne.add(Qe),Ne})},[se,m]),We=s.useMemo(()=>A0(l),[l]),He={[`--${l}-divider-width`]:N.scalingValue(p,n??!1),[`--${l}-divider-style`]:x,[`--${l}-icon-max-width`]:N.scalingValue(h,n??!1),...u>0?{[`--${l}-question-min-height`]:N.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:We}}),a.jsx("div",{style:Je,children:a.jsx("div",{className:Ct(`${l}-wrapper`,n&&!i&&`${l}-editor`,ee,Ye),style:{width:N.scalingValue(c,n??!1),maxWidth:"100%",...He},children:fe.map((Qe,he)=>{var De;const Ne=Q(he),Ve=((De=Qe.question)==null?void 0:De.trim())??"",tt=Qe.answer,mt=((tt==null?void 0:tt.length)??0)>0,st=d&&he===R;return a.jsxs("div",{className:Ct(`${l}-item`,Ne&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[st&&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:oe($e)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","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:oe(Pe),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(z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:oe(ge),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":Ne,style:{...J,...Ue,paddingLeft:oe(k),paddingRight:oe(b)},onClick:()=>xe(he),children:[ue>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:oe(ue)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:Be,children:Ve}),mt&&(V?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${ve}`,"aria-hidden":"true",children:a.jsx(pn,{url:ce,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 ${ve}`,"aria-hidden":"true"}))]}),X>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:oe(X)},"aria-hidden":"true"})]}),st&&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:oe(Me)}})]}),mt&&tt&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!Ne,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[st&&Ne&&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:oe(Ce)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(K),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:oe(ye),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:oe(be),height:"100%"}})]}),we>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:oe(we)}}),a.jsx("div",{className:`${l}-answer`,style:{..._e,...et,paddingLeft:oe(le),paddingRight:oe(te)},children:a.jsx("div",{className:at,children:a.jsx(Ki,{content:tt})})}),ke>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:oe(ke)}}),st&&Ne&&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:oe(f)}})]})})})]},he)})})})]})}const N0=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13571
13575
|
import cn from 'classnames';
|
|
13572
13576
|
import { CommonComponentProps } from '../props';
|
|
13573
13577
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -14315,7 +14319,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14315
14319
|
</>
|
|
14316
14320
|
);
|
|
14317
14321
|
}
|
|
14318
|
-
`;function ui(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const _c={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},_0=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],W0={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:ui("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:{..._c.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:{..._c.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:ui("Question Padding Left"),questionPaddingTop:ui("Question Padding Top"),questionPaddingBottom:ui("Question Padding Bottom"),answerPaddingLeft:ui("Answer Padding Left"),answerPaddingRight:ui("Answer Padding Right"),answerPaddingTop:ui("Answer Padding Top"),answerPaddingBottom:ui("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01M0GB8Z9EQFMGYA20F2J0ACA8.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[..._0],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},H0={element:F0,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:W0,sourceCode:N0},ii=e=>e.display==="cover",Fa=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Wc=100,O0=.2,Hc=8,Vu=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,d]=s.useState(!1),c=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?Wc:Math.max(Wc,window.innerHeight*O0),[]),v=s.useCallback(T=>Math.max(0,1-T/(p*1.5)),[p]),y=s.useCallback(T=>Math.max(0,1-T/(p*.45)),[p]),m=s.useCallback(T=>{const L=typeof window<"u"?window.innerHeight:800,_=Math.max(.88,1-T/L*.12);return`translateY(${T}px) scale(${_})`},[]),g=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),x=s.useCallback(()=>{const T=typeof window<"u"?window.innerHeight:800;d(!0),r(T),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),R=s.useCallback(T=>{!e||l||T.pointerType==="touch"&&(i!=null&&i(T.target)||(c.current={startX:T.clientX,startY:T.clientY,isLocked:null,pointerId:T.pointerId}))},[e,l,i]),b=s.useCallback(T=>{const L=c.current;if(!e||!L||T.pointerType!=="touch"||L.pointerId!==T.pointerId)return;const _=T.clientX-L.startX,z=T.clientY-L.startY;if(L.isLocked===null){if(Math.abs(_)<Hc&&Math.abs(z)<Hc)return;if(z>0&&z>Math.abs(_))L.isLocked=!0,T.currentTarget.setPointerCapture(T.pointerId);else{L.isLocked=!1,g();return}}if(!L.isLocked)return;T.preventDefault();const $=Math.max(0,z);u.current=$,r($)},[e,g]),S=s.useCallback(T=>{const L=c.current;if(!e||!L||T.pointerType!=="touch"||L.pointerId!==T.pointerId)return;const _=L.isLocked===!0;if(T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId),!_){g();return}T.clientY-L.startY>=p?x():f()},[p,x,e,g,f]),G=s.useCallback(T=>{S(T)},[S]),D=s.useCallback(T=>{S(T)},[S]),j=o>0,P=l?`transform ${n}ms ease`:"none",M=l?`opacity ${n}ms ease`:"none",K=o>0||l;return{isSwipeDragging:j,backdropStyle:{opacity:v(o),transition:M},mediaAreaStyle:{transform:m(o),transition:P,touchAction:j?"none":void 0,willChange:j?"transform":void 0},overlayContentStyle:K?{opacity:y(o),transition:M}:void 0,swipeHandlers:e?{onPointerDown:R,onPointerMove:b,onPointerUp:G,onPointerCancel:D}:{},dismissAreaStyle:e?{touchAction:j?"none":"pan-x"}:void 0}},D0="[data-lightbox-scrollable]",Gu=()=>{s.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,r=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const l=d=>{const c=d.target;c instanceof Element&&c.closest(D0)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=r,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},z0=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},B0=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},j0=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},V0=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(g,f)=>{B0(t),e.scrollLeft=g,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,v=0;const y=()=>{t.removeEventListener("transitionend",m),clearTimeout(v)},m=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,y(),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(${c}px, 0, 0)`,v=window.setTimeout(()=>{p||(p=!0,y(),u(n,!0))},i+64),()=>{p||(p=!0,y(),u(l-j0(t),!1))}},ar=300,G0=900,X0=1500,q0="cubic-bezier(0.16, 1, 0.3, 1)",U0=3e3,Y0=2,K0=16,Z0=.05,J0=1,Dr=.3,Q0=50,ex=20,oo=.004,Fo=["title1","title2","title3"],tx={title1:"1",title2:"2",title3:"3"},nx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},ix={title1:.02,title2:.02,title3:.02},zr=e=>`max(${e}, ${ex}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]}},rx=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??""}},Zt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,ax=e=>[Zt(e,"fontFamily"),Zt(e,"fontSettings"),{type:"row",items:[Zt(e,"fontSize"),Zt(e,"lineHeight"),Zt(e,"letterSpacing"),Zt(e,"wordSpacing")]},Zt(e,"textAlign"),Zt(e,"textAppearance")],sx=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Fo.map(e=>[tx[e],ax(e)]))}),El=(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},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Xu=(e,t)=>El(e,t),Br=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Oc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:El(e.length,n),effective:Xu(e.length,n)}},lx=(e,t,n,i,o,r,l)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},is=(e,t)=>{const n=i=>{const o=Zt(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[nx[t]]}},cx=(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),os=(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??ix[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)},dx=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:v,closeIcon:y,closeIconMaxWidth:m,closeIconColor:g,closeIconHoverColor:f,thumbnailTrigger:x,thumbnailVisibility:R,thumbnailObjectFit:b,thumbnailActive:S,thumbnailActiveColor:G,title1Width:D,title2Width:j,title3Width:P,title1MarginLeft:M=0,title2MarginLeft:K=0,title3MarginLeft:T=0,titleRowMarginBottom:L=0,titleHeaderLayout:_="desktop",contentMarginTop:z,iconMarginLeft:$}=n,k=E=>F.scalingValue(E,i??!1),W=c??n.thumnailSize??.03,w=k(W),U=k(u),C=k(p??.02),O=k(v??0),V=k(z??0),se=zr(V),ie=k($??0),[N,de]=s.useState(0),X=s.useRef(N);X.current=N;const ce=t[N],{title1:oe,title2:fe,title3:Pe}=rx(ce),xe=os("title1",is(n,"title1"),i),pe=os("title2",is(n,"title2"),i),Z=os("title3",is(n,"title3"),i),le=_==="mobile",re=!o&&(!i||r),Ie=re,we=re,Me=re,ye=ii(b),be=ye?{"--image-aspect-ratio":Fa(b)}:void 0,Ce=!!(oe||fe||Pe),h=s.useMemo(()=>lx(e,oe,fe,Pe,xe,pe,Z),[e,N,oe,fe,Pe,xe,pe,Z]),q=s.useMemo(()=>({title1Width:D,title2Width:j,title3Width:P}),[D,j,P]),Y=s.useMemo(()=>h.map(E=>q[E.widthKey]),[h,q]),ee=s.useMemo(()=>El(h.length,Y),[h.length,Y]),ve=s.useMemo(()=>Xu(h.length,Y),[h.length,Y]),B=s.useMemo(()=>h.filter(E=>E.prefix==="title1"),[h]),I=s.useMemo(()=>h.filter(E=>E.prefix==="title2"||E.prefix==="title3"),[h]),Q=s.useMemo(()=>Oc(B,q),[B,q]),ne=s.useMemo(()=>Oc(I,q),[I,q]),H=s.useCallback((E,ae)=>{const ue=h.indexOf(E);if(!le||ae==="single-row")return{effectiveWidth:ve[ue]??0,resolvedWidth:ee[ue]??0,maxWidth:Br(ue,ee)};if(ae==="two-row-top"){const Ue=B.indexOf(E);return{effectiveWidth:Q.effective[Ue]??0,resolvedWidth:Q.resolved[Ue]??0,maxWidth:Br(Ue,Q.resolved)}}const Re=I.indexOf(E);return{effectiveWidth:ne.effective[Re]??0,resolvedWidth:ne.resolved[Re]??0,maxWidth:Br(Re,ne.resolved)}},[I,ne,ve,ee,h,B,Q,le]),te=s.useCallback(E=>F.scalingValue(E,i??!1),[i]),ke=te(L??0),ge=s.useMemo(()=>({title1MarginLeft:M,title2MarginLeft:K,title3MarginLeft:T}),[M,K,T]),J=s.useCallback(E=>h.slice(0,E+1).reduce((ae,ue,Re)=>ae+(ue!=null&&ue.marginLeftKey?ge[ue.marginLeftKey]??0:0)+(ee[Re]??0),0)+(le?0:M??0),[h,ge,ee,le,M]),Ye=s.useCallback(()=>le?0:M??0,[le,M]),je=s.useCallback(E=>I.slice(0,E).reduce((ae,ue,Re)=>ae+(ue.marginLeftKey?ge[ue.marginLeftKey]??0:0)+(ne.resolved[Re]??0),0),[I,ne.resolved,ge]),it=s.useCallback(E=>{const ae=I[E];return je(E)+(ae.marginLeftKey?ge[ae.marginLeftKey]??0:0)+(ne.resolved[E]??0)},[I,ne.resolved,je,ge]),qe=(E,ae)=>{const ue=E.marginLeftKey?ge[E.marginLeftKey]??0:0,{effectiveWidth:Re,resolvedWidth:Ue,maxWidth:dt}=H(E,ae),Rt=o&&ae==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":E.prefix,style:{...ae==="single-row"?{gridArea:E.prefix}:{},width:te(Re),...ue>0?{marginLeft:te(ue)}:{}},children:[a.jsx("p",{className:E.className,style:E.style,children:E.text}),Rt&&E.marginLeftKey&&a.jsx("div",{"data-controls":E.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:te(-ue),width:`max(${te(ue)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Rt&&a.jsx("div",{"data-controls":E.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:te(-oo/2),width:te(oo),height:"100%",pointerEvents:"auto"}})]},E.className)},et=()=>{const E=le?-1:h.findIndex(Re=>Re.prefix==="title1"),ae=!le&&(o||(M??0)>0)?(()=>{const Re=M??0,Ue=E>=0?ee[E]:D??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:0,width:`max(${te(Re)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ue=h.flatMap((Re,Ue)=>{if(!Re.marginLeftKey)return[];const dt=ge[Re.marginLeftKey]??0,Rt=cx(h,ee,ge,Ue)+Ye();return a.jsx("div",{"data-controls":Re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ee[Ue]),style:{position:"absolute",top:0,left:te(Rt),width:`max(${te(dt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Re.marginLeftKey)});return ae?[ae,...ue]:ue},Je=()=>h.map((E,ae)=>{const ue=Br(ae,ee),Ue=J(ae)-oo/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(ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:te(Ue),width:te(oo),height:"100%",pointerEvents:"auto"}})},`${E.widthKey}-junction`)}),Ge=()=>I.flatMap((E,ae)=>{if(!E.marginLeftKey)return[];const ue=ge[E.marginLeftKey]??0,Re=je(ae),{resolvedWidth:Ue}=H(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(Ue),style:{position:"absolute",top:0,left:te(Re),width:`max(${te(ue)}, 10px)`,height:"100%",pointerEvents:"auto"}},E.marginLeftKey)}),$e=()=>I.map((E,ae)=>{const{maxWidth:ue}=H(E,"two-row-bottom"),Ue=it(ae)-oo/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(ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:te(Ue),width:te(oo),height:"100%",pointerEvents:"auto"}})},`${E.widthKey}-junction`)}),He=s.useRef(null),De=s.useRef(null),Qe=s.useRef(null),he=s.useRef(null),_e=s.useRef([]),Ve=s.useRef([]),tt=s.useRef(0),ft=s.useRef(null),rt=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Oe=s.useRef(null),Fe=s.useRef(null),Ee=s.useRef(0),Ze=s.useRef("forward"),We=s.useRef(0),ot=s.useRef(null),nt=s.useRef(!1),me=t.length>1&&(!o||!!r),Ne=me?3:1,st=s.useMemo(()=>Array.from({length:Ne},()=>t).flat(),[t,Ne]),[ut,Be]=s.useState(!1),[pt,Tt]=s.useState(!1),[Lt,xt]=s.useState(!0),Et=s.useRef(null),Vt=s.useRef(null),Ut=s.useRef(!1),Kt=s.useRef(!1),Pt=s.useRef(null),jt=s.useRef(null),on=Ie&&!Lt,vt=s.useCallback(()=>{Ie&&(xt(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{rt.current.isActive||xt(!1)},U0))},[Ie]),Le=s.useCallback(()=>{o||Kt.current||(Kt.current=!0,Tt(!1),Pt.current=setTimeout(()=>{l()},ar))},[o,l]),Xe=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":on?"true":"false",style:{width:F.scalingValue(m??0,i),height:F.scalingValue(m??0,i),marginRight:ie,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Le,"aria-label":"Close",children:a.jsx(pn,{url:y,fill:g,hoverFill:i&&!r?g:f,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:ie,height:"100%",pointerEvents:"auto"}})]}),lt=(E="two-row")=>a.jsx("div",{...E==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:te(M??0),flexShrink:0,...E==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...E==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ct=()=>{const E=h.find(Re=>Re.prefix==="title1"),ae=h.filter(Re=>Re.prefix==="title2"||Re.prefix==="title3"),ue=ae.length>0||o||(L??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(M??0)>0||o?lt():null,E&&qe(E,"two-row-top"),y&&Xe()]}),ue?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[ae.map(Re=>qe(Re,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ge(),$e()]})]}):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:ke,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},wt=()=>a.jsxs(a.Fragment,{children:[(M??0)>0||o?lt("single-row"):null,h.map(E=>qe(E,"single-row")),o?a.jsxs(a.Fragment,{children:[et(),Je()]}):null,y?Xe():null]}),It=s.useCallback(E=>!!(E.closest("[data-controls]")||E.closest(`.${e}-thumbnails`)||E.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:gt,backdropStyle:Ot,mediaAreaStyle:_t,overlayContentStyle:Mt,swipeHandlers:Gt,dismissAreaStyle:Xt}=Vu({enabled:re??!1,onClose:Le,animMs:ar,isBlockedTarget:It}),Dt=()=>{if(!me||t.length===0)return tt.current=0,0;const E=Ve.current[0],ae=Ve.current[t.length];if(!E||!ae)return tt.current;const ue=ae.offsetLeft-E.offsetLeft;return ue>0&&(tt.current=ue),tt.current},zt=(E=!1)=>{if(!me)return;const ae=De.current,ue=Dt();!ae||ue<=0||ue<ae.clientWidth*.25||(ae.scrollLeft<=0?(ae.scrollLeft+=ue,E&&(rt.current.scrollLeft+=ue),nt.current&&(We.current+=ue)):ae.scrollLeft>=ue*2&&(ae.scrollLeft-=ue,E&&(rt.current.scrollLeft-=ue),nt.current&&(We.current-=ue)))},Bt=(E,ae=(ue=>(ue=De.current)==null?void 0:ue.scrollLeft)()??0)=>{if(!me)return E;let Re=t.length+E,Ue=1/0;for(let dt=0;dt<Ne;dt++){const Rt=dt*t.length+E,Ft=Ve.current[Rt];if(!Ft)continue;const rn=Math.abs(Ft.offsetLeft-ae);rn<Ue&&(Ue=rn,Re=Rt)}return Re},bt=E=>{const ae=De.current;return!E||!ae?!1:E.offsetWidth>ae.clientWidth+1},A=E=>{const ae=De.current;if(!E||!ae||!bt(E))return!1;const ue=E.offsetLeft,Re=ue+E.offsetWidth;return ae.scrollLeft>=ue-1&&ae.scrollLeft+ae.clientWidth<=Re+1},Te=(E=(ae=>(ae=De.current)==null?void 0:ae.scrollLeft)()??0)=>{for(let Re=0;Re<Ve.current.length;Re+=1){const Ue=Ve.current[Re];if(Ue&&A(Ue))return Re}let ue={flatIndex:0,distance:1/0};return Ve.current.forEach((Re,Ue)=>{if(!Re)return;const dt=Math.abs(Re.offsetLeft-E);dt<ue.distance&&(ue={flatIndex:Ue,distance:dt})}),ue.flatIndex},Ae=E=>{De.current&&Ve.current.forEach(ae=>{ae&&(ae.style.scrollSnapAlign=bt(ae)&&E==="backward"?"end":"start")})},ze=(E,ae,ue)=>{const Re=E-ae,Ue=Te(ae),dt=Ve.current[Ue];if(A(dt))return Te(E)%t.length;const Rt=Ve.current[Ue+1],Ft=dt?Rt?Rt.offsetLeft-dt.offsetLeft:dt.offsetWidth:0,rn=Ft>0?Re>Ft*Dr?1:Re<-Ft*Dr?-1:0:0;return rn===0?ue:me?(ue+rn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ue+rn))},mt=s.useCallback((E=!1)=>{if(R!=="on"||o)return;const ae=he.current,ue=X.current,Re=_e.current[ue];if(!ae||!Re||ae.scrollWidth<=ae.clientWidth)return;const Ue=ae.scrollLeft,dt=Ue+ae.clientWidth,Rt=Re.offsetLeft,Ft=Rt+Re.offsetWidth;if(Rt>=Ue&&Ft<=dt)return;const rn=ae.scrollWidth-ae.clientWidth;let nn=Ue;if(!E&&Et.current===null){const Fn=_e.current[ue-1],si=_e.current[ue+1],to=Fn?Re.offsetLeft-Fn.offsetLeft:si?si.offsetLeft-Re.offsetLeft:Re.offsetWidth;Ft>dt?nn+=to:Rt<Ue&&(nn-=to)}else Ft>dt?nn=Ft-ae.clientWidth:nn=Rt;ae.scrollLeft=Math.max(0,Math.min(rn,nn))},[o,R]),Nt=s.useCallback((E=!1)=>{E&&(Ut.current=!0),Vt.current===null&&(Vt.current=requestAnimationFrame(()=>{Vt.current=null;const ae=Ut.current;Ut.current=!1,mt(ae)}))},[mt]),ht=s.useCallback(E=>{if(E===X.current)return;const ae=X.current;X.current=E;const ue=Math.abs(E-ae)>1,Re=me&&t.length>1&&(ae===t.length-1&&E===0||ae===0&&E===t.length-1);de(E),Nt(ue||Re)},[t.length,me,Nt]),St=()=>{if(!De.current||t.length===0||Et.current!==null||rt.current.isActive&&rt.current.hasMoved)return;const E=De.current.scrollLeft,ae=Te(E)%t.length;ae!==X.current&&ht(ae)},qt=()=>{Et.current=null},At=E=>{const ae=De.current;ae&&(ae.style.scrollSnapType=E?"":"none")},sn=()=>{var E;(E=Fe.current)==null||E.call(Fe),Fe.current=null},gn=()=>{ot.current!==null&&(cancelAnimationFrame(ot.current),ot.current=null),nt.current=!1},Xn=()=>{const E=De.current;if(!E){ot.current=null,nt.current=!1;return}const ae=We.current-E.scrollLeft;if(Math.abs(ae)<.5){E.scrollLeft=We.current,zt(),St(),ot.current=null,nt.current=!1;return}E.scrollLeft+=ae*Z0,zt(),St(),vt(),ot.current=requestAnimationFrame(Xn)},yn=()=>{const E=Qe.current;E&&(E.style.transition="",E.style.transform="",E.style.willChange="")},qn=(E,ae,ue,Re)=>{yn(),E.scrollLeft=ae,Ee.current=E.scrollLeft,zt(),ue!==void 0?(X.current=ue,de(ue)):St(),At(!0),Re==null||Re()},ki=(E,{behavior:ae="smooth",activeIndex:ue,onComplete:Re}={})=>{const Ue=De.current,dt=Qe.current;if(!Ue||!dt)return;if(gn(),sn(),At(!1),ae==="auto"){qn(Ue,E,ue,Re);return}const Rt=Math.abs(E-Ue.scrollLeft),Ft=z0(Rt,G0,X0,Ue.clientWidth*.55);Fe.current=V0(Ue,dt,E,{duration:Ft,easing:q0,onComplete:()=>{Fe.current=null,qn(Ue,E,ue,Re)}})},Ji=(E="smooth")=>{const ae=De.current;if(!ae||t.length===0)return;const ue=Te()%t.length,Re=Bt(ue,ae.scrollLeft),Ue=Ve.current[Re];Ue&&ki(Ue.offsetLeft,{behavior:E,activeIndex:ue})},Go=(E,ae="smooth",ue,Re)=>{const Ue=De.current;if(!Ue||t.length===0)return;const dt=(Re??Ue.scrollLeft)-E,Rt=Te(E),Ft=Ve.current[Rt];if(A(Ft)){At(!0),St();return}const rn=Ve.current[Rt+1],nn=Ft?rn?rn.offsetLeft-Ft.offsetLeft:Ft.offsetWidth:0;if((nn>0?dt>nn*Dr?1:dt<-nn*Dr?-1:0:0)!==0){const Pr=ue??Rt%t.length,_a=ze(Re??Ue.scrollLeft,E,Pr);un(_a,ae);return}const si=Re??Ue.scrollLeft,to=Te(si),Ei=Ve.current[to];if(Ei&&Math.abs(Ei.offsetLeft-si)<1){At(!0),St();return}Ji("auto")},un=(E,ae="smooth")=>{const ue=De.current;if(!ue||t.length===0)return;const Re=Bt(E,ue.scrollLeft),Ue=Ve.current[Re];Ue&&(ae==="smooth"?Et.current=E:Et.current=null,X.current=E,de(E),Nt(!0),ki(Ue.offsetLeft,{behavior:ae,activeIndex:E,onComplete:ae==="smooth"?qt:void 0}))},An=()=>{Oe.current&&(window.removeEventListener("pointerup",Oe.current),window.removeEventListener("pointercancel",Oe.current),Oe.current=null)},Rn=(E,ae,ue,Re,Ue)=>{const dt=ue-E,Rt=Re-ae,Ft=Math.abs(dt),rn=Math.abs(Rt);if(Ft<Q0||Ft<=rn)return!1;const nn=dt<0?1:-1,Fn=me?(Ue+nn+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ue+nn));return Fn===Ue?!1:(un(Fn),!0)},Un=E=>{if(!rt.current.isActive)return;An();const ae=De.current;if(!ae)return;const{scrollLeft:ue,startActiveIndex:Re,hasMoved:Ue}=rt.current,dt=ae.scrollLeft;zt(!0),rt.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Be(!1),E!==void 0&&ae.hasPointerCapture(E)&&ae.releasePointerCapture(E),Ue?Go(ue,"smooth",Re,dt):(At(!0),St()),vt()},Qi=(E,ae)=>{const ue=ft.current;ft.current=null,ue&&(Rn(ue.startX,ue.startY,E,ae,ue.startActiveIndex),vt())},Xo=E=>{if(!we)return;if(E.pointerType==="touch"){if(gn(),At(!0),It(E.target))return;ft.current={startX:E.clientX,startY:E.clientY,startActiveIndex:X.current};return}if(E.pointerType!=="mouse"||E.button!==0||It(E.target))return;const ae=De.current;if(!ae)return;gn(),sn(),yn(),Et.current=null,rt.current={isActive:!0,startX:E.clientX,scrollLeft:ae.scrollLeft,startActiveIndex:X.current,hasMoved:!1},At(!1),vt(),ae.setPointerCapture(E.pointerId),An();const ue=Re=>{Re.pointerType==="mouse"&&Un(Re.pointerId)};Oe.current=ue,window.addEventListener("pointerup",ue),window.addEventListener("pointercancel",ue)},eo=E=>{if(!we||E.pointerType!=="mouse")return;const ae=De.current;if(!ae||!rt.current.isActive)return;if(E.buttons===0){Un(E.pointerId);return}const ue=E.clientX-rt.current.startX;Math.abs(ue)>J0&&(rt.current.hasMoved=!0,Be(!0)),rt.current.hasMoved&&(E.preventDefault(),ae.scrollLeft=rt.current.scrollLeft-ue,zt(!0),St(),vt())},Se=E=>{if(we){if(E.pointerType==="touch"){E.type==="pointerup"?Qi(E.clientX,E.clientY):ft.current=null;return}E.pointerType==="mouse"&&Un(E.pointerId)}},Ke=E=>{!we||E.pointerType!=="mouse"||Un(E.pointerId)};return Gu(),s.useEffect(()=>{const E=requestAnimationFrame(()=>Tt(!0));return()=>{cancelAnimationFrame(E),sn(),An(),Vt.current!==null&&(cancelAnimationFrame(Vt.current),Vt.current=null),Pt.current&&clearTimeout(Pt.current),jt.current&&clearTimeout(jt.current)}},[]),s.useEffect(()=>{if(!Ie){xt(!0);return}vt();const E=()=>vt();return document.addEventListener("pointermove",E,{passive:!0}),document.addEventListener("pointerdown",E,{passive:!0}),()=>{document.removeEventListener("pointermove",E),document.removeEventListener("pointerdown",E),jt.current&&clearTimeout(jt.current)}},[Ie,vt]),s.useEffect(()=>{const E=ae=>{ae.key==="Escape"&&Le()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[Le]),s.useLayoutEffect(()=>{Dt()},[O,t.length,me]),s.useLayoutEffect(()=>{o||un(X.current,"auto")},[O,o]),s.useLayoutEffect(()=>{un(0,"auto")},[t.length,me]),s.useEffect(()=>{const E=De.current;if(!E||o||!re)return;const ae=ue=>{if(ue.preventDefault(),Math.abs(ue.deltaY)<=Math.abs(ue.deltaX))return;const Re=ue.deltaMode===1?K0:ue.deltaMode===2?E.clientHeight:1,Ue=ue.deltaY*Re*Y0;if(Ue!==0){if(sn(),nt.current||(nt.current=!0,We.current=E.scrollLeft,Et.current=null,At(!1)),We.current+=Ue,!me){const dt=E.scrollWidth-E.clientWidth;We.current=Math.max(0,Math.min(dt,We.current))}vt(),ot.current===null&&(ot.current=requestAnimationFrame(Xn))}};return E.addEventListener("wheel",ae,{passive:!1}),()=>{E.removeEventListener("wheel",ae),gn()}},[o,re,me]),s.useEffect(()=>{const E=De.current;if(!E)return;const ae=()=>{zt(rt.current.isActive);const Re=E.scrollLeft,Ue=Re-Ee.current;Ee.current=Re;const dt=tt.current>0?tt.current*.5:1/0;if(Ue!==0&&Math.abs(Ue)<dt){const Rt=Ue>0?"forward":"backward";Rt!==Ze.current&&(Ze.current=Rt,Ae(Rt))}rt.current.isActive&&rt.current.hasMoved||St()};E.addEventListener("scroll",ae,{passive:!0});const ue=new ResizeObserver(()=>{Dt(),zt(rt.current.isActive),Ae(Ze.current),St()});return ue.observe(E),()=>{sn(),E.removeEventListener("scroll",ae),ue.disconnect()}},[t.length,me]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{gt||Le()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:pt?1:0,transition:`opacity ${ar}ms ease`,pointerEvents:pt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ot}}),a.jsxs("div",{ref:He,className:`${e}-lightbox-dismiss-area`,style:Xt,...Gt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:_t,onClick:E=>E.stopPropagation(),children:a.jsx("div",{ref:De,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":we&&t.length>0?"true":"false","data-mouse-dragging":ut?"true":"false",onPointerDown:Xo,onPointerMove:eo,onPointerUp:Se,onPointerCancel:Se,onLostPointerCapture:Ke,children:a.jsx("div",{ref:Qe,className:`${e}-lightbox-strip-track`,style:{gap:O},children:st.map((E,ae)=>{const ue=E.image.objectFit??"contain",Re=ae%t.length,Ue=Math.floor(ae/t.length),dt=zr(O),Rt=`calc(-0.5 * (${dt} + ${O}))`;return a.jsxs("div",{ref:Ft=>Ve.current[ae]=Ft,className:`${e}-strip-item`,style:{height:_==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:E.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ue}}),o&&Re<t.length-1&&Ue===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Rt,width:dt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ue}-${E.image.url}-${Re}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":on?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:V,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:se,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${le?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ce||y)&&a.jsx("div",{className:`${e}-header ${le?`${e}-header-two-row`:`${e}-header-single-row`}`,children:le?ct():Ce||y?wt():null})})})]}),t.length>1&&R==="on"&&(()=>{const E=zr(C),ae=`calc(-0.5 * (${C} + ${E}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:C},children:a.jsx("div",{ref:he,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ue=>ue.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:U,"--thumbnail-active-color":G},children:[t.map((ue,Re)=>{const Ue=zr(U),dt=`calc(-0.5 * (${Ue} + ${U}))`;return a.jsxs("div",{ref:Rt=>{_e.current[Re]=Rt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":N===Re?"true":"false",onClick:()=>re&&x==="click"&&un(Re),onMouseEnter:()=>Me&&x==="hover"&&un(Re),"aria-label":ue.image.name?`View ${ue.image.name}`:`View image ${Re+1}`,"aria-current":N===Re?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ye?` ${e}-thumb-image-cover`:""}`,src:ue.image.url,alt:"",draggable:!1,style:{...be,maxWidth:w,maxHeight:w,width:b.display==="cover"?"auto":"100%",height:"auto",objectFit:b.display==="cover"?"cover":"contain"}})}),o&&Re<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:dt,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ue.image.url}-${Re}`)}),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:E,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function ux(e){return`
|
|
14322
|
+
`;function pi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const _c={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},_0=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],W0={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:pi("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:{..._c.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:{..._c.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:pi("Question Padding Left"),questionPaddingTop:pi("Question Padding Top"),questionPaddingBottom:pi("Question Padding Bottom"),answerPaddingLeft:pi("Answer Padding Left"),answerPaddingRight:pi("Answer Padding Right"),answerPaddingTop:pi("Answer Padding Top"),answerPaddingBottom:pi("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01M0GB8Z9EQFMGYA20F2J0ACA8.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[..._0],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},H0={element:F0,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:W0,sourceCode:N0},oi=e=>e.display==="cover",Fa=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Wc=100,O0=.2,Hc=8,Vu=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,d]=s.useState(!1),c=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?Wc:Math.max(Wc,window.innerHeight*O0),[]),x=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),v=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),m=s.useCallback($=>{const I=typeof window<"u"?window.innerHeight:800,H=Math.max(.88,1-$/I*.12);return`translateY(${$}px) scale(${H})`},[]),g=s.useCallback(()=>{c.current=null},[]),h=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),b=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;d(!0),r($),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),E=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(c.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),y=s.useCallback($=>{const I=c.current;if(!e||!I||$.pointerType!=="touch"||I.pointerId!==$.pointerId)return;const H=$.clientX-I.startX,O=$.clientY-I.startY;if(I.isLocked===null){if(Math.abs(H)<Hc&&Math.abs(O)<Hc)return;if(O>0&&O>Math.abs(H))I.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{I.isLocked=!1,g();return}}if(!I.isLocked)return;$.preventDefault();const C=Math.max(0,O);u.current=C,r(C)},[e,g]),w=s.useCallback($=>{const I=c.current;if(!e||!I||$.pointerType!=="touch"||I.pointerId!==$.pointerId)return;const H=I.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!H){g();return}$.clientY-I.startY>=p?b():h()},[p,b,e,g,h]),j=s.useCallback($=>{w($)},[w]),G=s.useCallback($=>{w($)},[w]),A=o>0,P=l?`transform ${n}ms ease`:"none",W=l?`opacity ${n}ms ease`:"none",Y=o>0||l;return{isSwipeDragging:A,backdropStyle:{opacity:x(o),transition:W},mediaAreaStyle:{transform:m(o),transition:P,touchAction:A?"none":void 0,willChange:A?"transform":void 0},overlayContentStyle:Y?{opacity:v(o),transition:W}:void 0,swipeHandlers:e?{onPointerDown:E,onPointerMove:y,onPointerUp:j,onPointerCancel:G}:{},dismissAreaStyle:e?{touchAction:A?"none":"pan-x"}:void 0}},D0="[data-lightbox-scrollable]",Gu=()=>{s.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,r=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const l=d=>{const c=d.target;c instanceof Element&&c.closest(D0)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=r,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},z0=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},B0=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},j0=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},V0=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(g,h)=>{B0(t),e.scrollLeft=g,h&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,x=0;const v=()=>{t.removeEventListener("transitionend",m),clearTimeout(x)},m=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,v(),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(${c}px, 0, 0)`,x=window.setTimeout(()=>{p||(p=!0,v(),u(n,!0))},i+64),()=>{p||(p=!0,v(),u(l-j0(t),!1))}},ar=300,G0=900,X0=1500,q0="cubic-bezier(0.16, 1, 0.3, 1)",U0=3e3,Y0=2,K0=16,Z0=.05,J0=1,Dr=.3,Q0=50,ex=20,oo=.004,Fo=["title1","title2","title3"],tx={title1:"1",title2:"2",title3:"3"},nx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},ix={title1:.02,title2:.02,title3:.02},zr=e=>`max(${e}, ${ex}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]}},rx=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??""}},Zt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,ax=e=>[Zt(e,"fontFamily"),Zt(e,"fontSettings"),{type:"row",items:[Zt(e,"fontSize"),Zt(e,"lineHeight"),Zt(e,"letterSpacing"),Zt(e,"wordSpacing")]},Zt(e,"textAlign"),Zt(e,"textAppearance")],sx=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Fo.map(e=>[tx[e],ax(e)]))}),El=(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},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Xu=(e,t)=>El(e,t),Br=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Oc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:El(e.length,n),effective:Xu(e.length,n)}},lx=(e,t,n,i,o,r,l)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},is=(e,t)=>{const n=i=>{const o=Zt(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[nx[t]]}},cx=(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),os=(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??ix[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)},dx=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:x,closeIcon:v,closeIconMaxWidth:m,closeIconColor:g,closeIconHoverColor:h,thumbnailTrigger:b,thumbnailVisibility:E,thumbnailObjectFit:y,thumbnailActive:w,thumbnailActiveColor:j,title1Width:G,title2Width:A,title3Width:P,title1MarginLeft:W=0,title2MarginLeft:Y=0,title3MarginLeft:$=0,titleRowMarginBottom:I=0,titleHeaderLayout:H="desktop",contentMarginTop:O,iconMarginLeft:C}=n,L=M=>N.scalingValue(M,i??!1),D=c??n.thumnailSize??.03,S=L(D),U=L(u),T=L(p??.02),_=L(x??0),B=L(O??0),ae=zr(B),ie=L(C??0),[k,ue]=s.useState(0),X=s.useRef(k);X.current=k;const le=t[k],{title1:te,title2:we,title3:ke}=rx(le),fe=os("title1",is(n,"title1"),i),me=os("title2",is(n,"title2"),i),Z=os("title3",is(n,"title3"),i),se=H==="mobile",oe=!o&&(!i||r),Pe=oe,$e=oe,Me=oe,ye=oi(y),be=ye?{"--image-aspect-ratio":Fa(y)}:void 0,Ce=!!(te||we||ke),f=s.useMemo(()=>lx(e,te,we,ke,fe,me,Z),[e,k,te,we,ke,fe,me,Z]),q=s.useMemo(()=>({title1Width:G,title2Width:A,title3Width:P}),[G,A,P]),K=s.useMemo(()=>f.map(M=>q[M.widthKey]),[f,q]),ne=s.useMemo(()=>El(f.length,K),[f.length,K]),ge=s.useMemo(()=>Xu(f.length,K),[f.length,K]),z=s.useMemo(()=>f.filter(M=>M.prefix==="title1"),[f]),R=s.useMemo(()=>f.filter(M=>M.prefix==="title2"||M.prefix==="title3"),[f]),Q=s.useMemo(()=>Oc(z,q),[z,q]),ee=s.useMemo(()=>Oc(R,q),[R,q]),ce=s.useCallback((M,re)=>{const pe=f.indexOf(M);if(!se||re==="single-row")return{effectiveWidth:ge[pe]??0,resolvedWidth:ne[pe]??0,maxWidth:Br(pe,ne)};if(re==="two-row-top"){const Ke=z.indexOf(M);return{effectiveWidth:Q.effective[Ke]??0,resolvedWidth:Q.resolved[Ke]??0,maxWidth:Br(Ke,Q.resolved)}}const Ee=R.indexOf(M);return{effectiveWidth:ee.effective[Ee]??0,resolvedWidth:ee.resolved[Ee]??0,maxWidth:Br(Ee,ee.resolved)}},[R,ee,ge,ne,f,z,Q,se]),V=s.useCallback(M=>N.scalingValue(M,i??!1),[i]),Le=V(I??0),ve=s.useMemo(()=>({title1MarginLeft:W,title2MarginLeft:Y,title3MarginLeft:$}),[W,Y,$]),J=s.useCallback(M=>f.slice(0,M+1).reduce((re,pe,Ee)=>re+(pe!=null&&pe.marginLeftKey?ve[pe.marginLeftKey]??0:0)+(ne[Ee]??0),0)+(se?0:W??0),[f,ve,ne,se,W]),_e=s.useCallback(()=>se?0:W??0,[se,W]),Be=s.useCallback(M=>R.slice(0,M).reduce((re,pe,Ee)=>re+(pe.marginLeftKey?ve[pe.marginLeftKey]??0:0)+(ee.resolved[Ee]??0),0),[R,ee.resolved,ve]),at=s.useCallback(M=>{const re=R[M];return Be(M)+(re.marginLeftKey?ve[re.marginLeftKey]??0:0)+(ee.resolved[M]??0)},[R,ee.resolved,Be,ve]),Ue=(M,re)=>{const pe=M.marginLeftKey?ve[M.marginLeftKey]??0:0,{effectiveWidth:Ee,resolvedWidth:Ke,maxWidth:dt}=ce(M,re),Rt=o&&re==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":M.prefix,style:{...re==="single-row"?{gridArea:M.prefix}:{},width:V(Ee),...pe>0?{marginLeft:V(pe)}:{}},children:[a.jsx("p",{className:M.className,style:M.style,children:M.text}),Rt&&M.marginLeftKey&&a.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:V(-pe),width:`max(${V(pe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Rt&&a.jsx("div",{"data-controls":M.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:V(-oo/2),width:V(oo),height:"100%",pointerEvents:"auto"}})]},M.className)},et=()=>{const M=se?-1:f.findIndex(Ee=>Ee.prefix==="title1"),re=!se&&(o||(W??0)>0)?(()=>{const Ee=W??0,Ke=M>=0?ne[M]:G??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:0,width:`max(${V(Ee)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,pe=f.flatMap((Ee,Ke)=>{if(!Ee.marginLeftKey)return[];const dt=ve[Ee.marginLeftKey]??0,Rt=cx(f,ne,ve,Ke)+_e();return a.jsx("div",{"data-controls":Ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ne[Ke]),style:{position:"absolute",top:0,left:V(Rt),width:`max(${V(dt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Ee.marginLeftKey)});return re?[re,...pe]:pe},Je=()=>f.map((M,re)=>{const pe=Br(re,ne),Ke=J(re)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(pe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:V(Ke),width:V(oo),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),Ye=()=>R.flatMap((M,re)=>{if(!M.marginLeftKey)return[];const pe=ve[M.marginLeftKey]??0,Ee=Be(re),{resolvedWidth:Ke}=ce(M,"two-row-bottom");return a.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:V(Ee),width:`max(${V(pe)}, 10px)`,height:"100%",pointerEvents:"auto"}},M.marginLeftKey)}),xe=()=>R.map((M,re)=>{const{maxWidth:pe}=ce(M,"two-row-bottom"),Ke=at(re)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(pe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:V(Ke),width:V(oo),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),We=s.useRef(null),He=s.useRef(null),Qe=s.useRef(null),he=s.useRef(null),Ne=s.useRef([]),Ve=s.useRef([]),tt=s.useRef(0),mt=s.useRef(null),st=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),De=s.useRef(null),Fe=s.useRef(null),Xe=s.useRef(0),ot=s.useRef("forward"),Oe=s.useRef(0),qe=s.useRef(null),nt=s.useRef(!1),de=t.length>1&&(!o||!!r),Ie=de?3:1,it=s.useMemo(()=>Array.from({length:Ie},()=>t).flat(),[t,Ie]),[ut,je]=s.useState(!1),[pt,Tt]=s.useState(!1),[Lt,xt]=s.useState(!0),Et=s.useRef(null),Vt=s.useRef(null),Ut=s.useRef(!1),Kt=s.useRef(!1),Pt=s.useRef(null),jt=s.useRef(null),on=Pe&&!Lt,vt=s.useCallback(()=>{Pe&&(xt(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{st.current.isActive||xt(!1)},U0))},[Pe]),Re=s.useCallback(()=>{o||Kt.current||(Kt.current=!0,Tt(!1),Pt.current=setTimeout(()=>{l()},ar))},[o,l]),Ge=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":on?"true":"false",style:{width:N.scalingValue(m??0,i),height:N.scalingValue(m??0,i),marginRight:ie,"--close-icon-hover-color":h},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Re,"aria-label":"Close",children:a.jsx(pn,{url:v,fill:g,hoverFill:i&&!r?g:h,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:ie,height:"100%",pointerEvents:"auto"}})]}),lt=(M="two-row")=>a.jsx("div",{...M==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:V(W??0),flexShrink:0,...M==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...M==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ct=()=>{const M=f.find(Ee=>Ee.prefix==="title1"),re=f.filter(Ee=>Ee.prefix==="title2"||Ee.prefix==="title3"),pe=re.length>0||o||(I??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(W??0)>0||o?lt():null,M&&Ue(M,"two-row-top"),v&&Ge()]}),pe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[re.map(Ee=>Ue(Ee,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ye(),xe()]})]}):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:Le,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},wt=()=>a.jsxs(a.Fragment,{children:[(W??0)>0||o?lt("single-row"):null,f.map(M=>Ue(M,"single-row")),o?a.jsxs(a.Fragment,{children:[et(),Je()]}):null,v?Ge():null]}),It=s.useCallback(M=>!!(M.closest("[data-controls]")||M.closest(`.${e}-thumbnails`)||M.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ht,backdropStyle:Ot,mediaAreaStyle:_t,overlayContentStyle:Mt,swipeHandlers:Gt,dismissAreaStyle:Xt}=Vu({enabled:oe??!1,onClose:Re,animMs:ar,isBlockedTarget:It}),Dt=()=>{if(!de||t.length===0)return tt.current=0,0;const M=Ve.current[0],re=Ve.current[t.length];if(!M||!re)return tt.current;const pe=re.offsetLeft-M.offsetLeft;return pe>0&&(tt.current=pe),tt.current},zt=(M=!1)=>{if(!de)return;const re=He.current,pe=Dt();!re||pe<=0||pe<re.clientWidth*.25||(re.scrollLeft<=0?(re.scrollLeft+=pe,M&&(st.current.scrollLeft+=pe),nt.current&&(Oe.current+=pe)):re.scrollLeft>=pe*2&&(re.scrollLeft-=pe,M&&(st.current.scrollLeft-=pe),nt.current&&(Oe.current-=pe)))},Bt=(M,re=(pe=>(pe=He.current)==null?void 0:pe.scrollLeft)()??0)=>{if(!de)return M;let Ee=t.length+M,Ke=1/0;for(let dt=0;dt<Ie;dt++){const Rt=dt*t.length+M,Ft=Ve.current[Rt];if(!Ft)continue;const rn=Math.abs(Ft.offsetLeft-re);rn<Ke&&(Ke=rn,Ee=Rt)}return Ee},bt=M=>{const re=He.current;return!M||!re?!1:M.offsetWidth>re.clientWidth+1},F=M=>{const re=He.current;if(!M||!re||!bt(M))return!1;const pe=M.offsetLeft,Ee=pe+M.offsetWidth;return re.scrollLeft>=pe-1&&re.scrollLeft+re.clientWidth<=Ee+1},Te=(M=(re=>(re=He.current)==null?void 0:re.scrollLeft)()??0)=>{for(let Ee=0;Ee<Ve.current.length;Ee+=1){const Ke=Ve.current[Ee];if(Ke&&F(Ke))return Ee}let pe={flatIndex:0,distance:1/0};return Ve.current.forEach((Ee,Ke)=>{if(!Ee)return;const dt=Math.abs(Ee.offsetLeft-M);dt<pe.distance&&(pe={flatIndex:Ke,distance:dt})}),pe.flatIndex},Ae=M=>{He.current&&Ve.current.forEach(re=>{re&&(re.style.scrollSnapAlign=bt(re)&&M==="backward"?"end":"start")})},ze=(M,re,pe)=>{const Ee=M-re,Ke=Te(re),dt=Ve.current[Ke];if(F(dt))return Te(M)%t.length;const Rt=Ve.current[Ke+1],Ft=dt?Rt?Rt.offsetLeft-dt.offsetLeft:dt.offsetWidth:0,rn=Ft>0?Ee>Ft*Dr?1:Ee<-Ft*Dr?-1:0:0;return rn===0?pe:de?(pe+rn+t.length)%t.length:Math.max(0,Math.min(t.length-1,pe+rn))},gt=s.useCallback((M=!1)=>{if(E!=="on"||o)return;const re=he.current,pe=X.current,Ee=Ne.current[pe];if(!re||!Ee||re.scrollWidth<=re.clientWidth)return;const Ke=re.scrollLeft,dt=Ke+re.clientWidth,Rt=Ee.offsetLeft,Ft=Rt+Ee.offsetWidth;if(Rt>=Ke&&Ft<=dt)return;const rn=re.scrollWidth-re.clientWidth;let nn=Ke;if(!M&&Et.current===null){const Fn=Ne.current[pe-1],li=Ne.current[pe+1],to=Fn?Ee.offsetLeft-Fn.offsetLeft:li?li.offsetLeft-Ee.offsetLeft:Ee.offsetWidth;Ft>dt?nn+=to:Rt<Ke&&(nn-=to)}else Ft>dt?nn=Ft-re.clientWidth:nn=Rt;re.scrollLeft=Math.max(0,Math.min(rn,nn))},[o,E]),Nt=s.useCallback((M=!1)=>{M&&(Ut.current=!0),Vt.current===null&&(Vt.current=requestAnimationFrame(()=>{Vt.current=null;const re=Ut.current;Ut.current=!1,gt(re)}))},[gt]),ft=s.useCallback(M=>{if(M===X.current)return;const re=X.current;X.current=M;const pe=Math.abs(M-re)>1,Ee=de&&t.length>1&&(re===t.length-1&&M===0||re===0&&M===t.length-1);ue(M),Nt(pe||Ee)},[t.length,de,Nt]),St=()=>{if(!He.current||t.length===0||Et.current!==null||st.current.isActive&&st.current.hasMoved)return;const M=He.current.scrollLeft,re=Te(M)%t.length;re!==X.current&&ft(re)},qt=()=>{Et.current=null},At=M=>{const re=He.current;re&&(re.style.scrollSnapType=M?"":"none")},sn=()=>{var M;(M=Fe.current)==null||M.call(Fe),Fe.current=null},gn=()=>{qe.current!==null&&(cancelAnimationFrame(qe.current),qe.current=null),nt.current=!1},Xn=()=>{const M=He.current;if(!M){qe.current=null,nt.current=!1;return}const re=Oe.current-M.scrollLeft;if(Math.abs(re)<.5){M.scrollLeft=Oe.current,zt(),St(),qe.current=null,nt.current=!1;return}M.scrollLeft+=re*Z0,zt(),St(),vt(),qe.current=requestAnimationFrame(Xn)},yn=()=>{const M=Qe.current;M&&(M.style.transition="",M.style.transform="",M.style.willChange="")},qn=(M,re,pe,Ee)=>{yn(),M.scrollLeft=re,Xe.current=M.scrollLeft,zt(),pe!==void 0?(X.current=pe,ue(pe)):St(),At(!0),Ee==null||Ee()},ki=(M,{behavior:re="smooth",activeIndex:pe,onComplete:Ee}={})=>{const Ke=He.current,dt=Qe.current;if(!Ke||!dt)return;if(gn(),sn(),At(!1),re==="auto"){qn(Ke,M,pe,Ee);return}const Rt=Math.abs(M-Ke.scrollLeft),Ft=z0(Rt,G0,X0,Ke.clientWidth*.55);Fe.current=V0(Ke,dt,M,{duration:Ft,easing:q0,onComplete:()=>{Fe.current=null,qn(Ke,M,pe,Ee)}})},Ji=(M="smooth")=>{const re=He.current;if(!re||t.length===0)return;const pe=Te()%t.length,Ee=Bt(pe,re.scrollLeft),Ke=Ve.current[Ee];Ke&&ki(Ke.offsetLeft,{behavior:M,activeIndex:pe})},Go=(M,re="smooth",pe,Ee)=>{const Ke=He.current;if(!Ke||t.length===0)return;const dt=(Ee??Ke.scrollLeft)-M,Rt=Te(M),Ft=Ve.current[Rt];if(F(Ft)){At(!0),St();return}const rn=Ve.current[Rt+1],nn=Ft?rn?rn.offsetLeft-Ft.offsetLeft:Ft.offsetWidth:0;if((nn>0?dt>nn*Dr?1:dt<-nn*Dr?-1:0:0)!==0){const Pr=pe??Rt%t.length,_a=ze(Ee??Ke.scrollLeft,M,Pr);un(_a,re);return}const li=Ee??Ke.scrollLeft,to=Te(li),Ei=Ve.current[to];if(Ei&&Math.abs(Ei.offsetLeft-li)<1){At(!0),St();return}Ji("auto")},un=(M,re="smooth")=>{const pe=He.current;if(!pe||t.length===0)return;const Ee=Bt(M,pe.scrollLeft),Ke=Ve.current[Ee];Ke&&(re==="smooth"?Et.current=M:Et.current=null,X.current=M,ue(M),Nt(!0),ki(Ke.offsetLeft,{behavior:re,activeIndex:M,onComplete:re==="smooth"?qt:void 0}))},An=()=>{De.current&&(window.removeEventListener("pointerup",De.current),window.removeEventListener("pointercancel",De.current),De.current=null)},Rn=(M,re,pe,Ee,Ke)=>{const dt=pe-M,Rt=Ee-re,Ft=Math.abs(dt),rn=Math.abs(Rt);if(Ft<Q0||Ft<=rn)return!1;const nn=dt<0?1:-1,Fn=de?(Ke+nn+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ke+nn));return Fn===Ke?!1:(un(Fn),!0)},Un=M=>{if(!st.current.isActive)return;An();const re=He.current;if(!re)return;const{scrollLeft:pe,startActiveIndex:Ee,hasMoved:Ke}=st.current,dt=re.scrollLeft;zt(!0),st.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},je(!1),M!==void 0&&re.hasPointerCapture(M)&&re.releasePointerCapture(M),Ke?Go(pe,"smooth",Ee,dt):(At(!0),St()),vt()},Qi=(M,re)=>{const pe=mt.current;mt.current=null,pe&&(Rn(pe.startX,pe.startY,M,re,pe.startActiveIndex),vt())},Xo=M=>{if(!$e)return;if(M.pointerType==="touch"){if(gn(),At(!0),It(M.target))return;mt.current={startX:M.clientX,startY:M.clientY,startActiveIndex:X.current};return}if(M.pointerType!=="mouse"||M.button!==0||It(M.target))return;const re=He.current;if(!re)return;gn(),sn(),yn(),Et.current=null,st.current={isActive:!0,startX:M.clientX,scrollLeft:re.scrollLeft,startActiveIndex:X.current,hasMoved:!1},At(!1),vt(),re.setPointerCapture(M.pointerId),An();const pe=Ee=>{Ee.pointerType==="mouse"&&Un(Ee.pointerId)};De.current=pe,window.addEventListener("pointerup",pe),window.addEventListener("pointercancel",pe)},eo=M=>{if(!$e||M.pointerType!=="mouse")return;const re=He.current;if(!re||!st.current.isActive)return;if(M.buttons===0){Un(M.pointerId);return}const pe=M.clientX-st.current.startX;Math.abs(pe)>J0&&(st.current.hasMoved=!0,je(!0)),st.current.hasMoved&&(M.preventDefault(),re.scrollLeft=st.current.scrollLeft-pe,zt(!0),St(),vt())},Se=M=>{if($e){if(M.pointerType==="touch"){M.type==="pointerup"?Qi(M.clientX,M.clientY):mt.current=null;return}M.pointerType==="mouse"&&Un(M.pointerId)}},Ze=M=>{!$e||M.pointerType!=="mouse"||Un(M.pointerId)};return Gu(),s.useEffect(()=>{const M=requestAnimationFrame(()=>Tt(!0));return()=>{cancelAnimationFrame(M),sn(),An(),Vt.current!==null&&(cancelAnimationFrame(Vt.current),Vt.current=null),Pt.current&&clearTimeout(Pt.current),jt.current&&clearTimeout(jt.current)}},[]),s.useEffect(()=>{if(!Pe){xt(!0);return}vt();const M=()=>vt();return document.addEventListener("pointermove",M,{passive:!0}),document.addEventListener("pointerdown",M,{passive:!0}),()=>{document.removeEventListener("pointermove",M),document.removeEventListener("pointerdown",M),jt.current&&clearTimeout(jt.current)}},[Pe,vt]),s.useEffect(()=>{const M=re=>{re.key==="Escape"&&Re()};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[Re]),s.useLayoutEffect(()=>{Dt()},[_,t.length,de]),s.useLayoutEffect(()=>{o||un(X.current,"auto")},[_,o]),s.useLayoutEffect(()=>{un(0,"auto")},[t.length,de]),s.useEffect(()=>{const M=He.current;if(!M||o||!oe)return;const re=pe=>{if(pe.preventDefault(),Math.abs(pe.deltaY)<=Math.abs(pe.deltaX))return;const Ee=pe.deltaMode===1?K0:pe.deltaMode===2?M.clientHeight:1,Ke=pe.deltaY*Ee*Y0;if(Ke!==0){if(sn(),nt.current||(nt.current=!0,Oe.current=M.scrollLeft,Et.current=null,At(!1)),Oe.current+=Ke,!de){const dt=M.scrollWidth-M.clientWidth;Oe.current=Math.max(0,Math.min(dt,Oe.current))}vt(),qe.current===null&&(qe.current=requestAnimationFrame(Xn))}};return M.addEventListener("wheel",re,{passive:!1}),()=>{M.removeEventListener("wheel",re),gn()}},[o,oe,de]),s.useEffect(()=>{const M=He.current;if(!M)return;const re=()=>{zt(st.current.isActive);const Ee=M.scrollLeft,Ke=Ee-Xe.current;Xe.current=Ee;const dt=tt.current>0?tt.current*.5:1/0;if(Ke!==0&&Math.abs(Ke)<dt){const Rt=Ke>0?"forward":"backward";Rt!==ot.current&&(ot.current=Rt,Ae(Rt))}st.current.isActive&&st.current.hasMoved||St()};M.addEventListener("scroll",re,{passive:!0});const pe=new ResizeObserver(()=>{Dt(),zt(st.current.isActive),Ae(ot.current),St()});return pe.observe(M),()=>{sn(),M.removeEventListener("scroll",re),pe.disconnect()}},[t.length,de]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ht||Re()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:pt?1:0,transition:`opacity ${ar}ms ease`,pointerEvents:pt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ot}}),a.jsxs("div",{ref:We,className:`${e}-lightbox-dismiss-area`,style:Xt,...Gt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:_t,onClick:M=>M.stopPropagation(),children:a.jsx("div",{ref:He,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":$e&&t.length>0?"true":"false","data-mouse-dragging":ut?"true":"false",onPointerDown:Xo,onPointerMove:eo,onPointerUp:Se,onPointerCancel:Se,onLostPointerCapture:Ze,children:a.jsx("div",{ref:Qe,className:`${e}-lightbox-strip-track`,style:{gap:_},children:it.map((M,re)=>{const pe=M.image.objectFit??"contain",Ee=re%t.length,Ke=Math.floor(re/t.length),dt=zr(_),Rt=`calc(-0.5 * (${dt} + ${_}))`;return a.jsxs("div",{ref:Ft=>Ve.current[re]=Ft,className:`${e}-strip-item`,style:{height:H==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:M.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:pe}}),o&&Ee<t.length-1&&Ke===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Rt,width:dt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ke}-${M.image.url}-${Ee}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":on?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:B,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:ae,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?ct():Ce||v?wt():null})})})]}),t.length>1&&E==="on"&&(()=>{const M=zr(T),re=`calc(-0.5 * (${T} + ${M}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:T},children:a.jsx("div",{ref:he,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:pe=>pe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":w,style:{gap:U,"--thumbnail-active-color":j},children:[t.map((pe,Ee)=>{const Ke=zr(U),dt=`calc(-0.5 * (${Ke} + ${U}))`;return a.jsxs("div",{ref:Rt=>{Ne.current[Ee]=Rt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":k===Ee?"true":"false",onClick:()=>oe&&b==="click"&&un(Ee),onMouseEnter:()=>Me&&b==="hover"&&un(Ee),"aria-label":pe.image.name?`View ${pe.image.name}`:`View image ${Ee+1}`,"aria-current":k===Ee?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ye?` ${e}-thumb-image-cover`:""}`,src:pe.image.url,alt:"",draggable:!1,style:{...be,maxWidth:S,maxHeight:S,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.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:dt,width:Ke,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${pe.image.url}-${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:re,height:M,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function ux(e){return`
|
|
14319
14323
|
.${e}-wrapper {
|
|
14320
14324
|
position: relative;
|
|
14321
14325
|
width: 100%;
|
|
@@ -14700,7 +14704,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14700
14704
|
pointer-events: auto;
|
|
14701
14705
|
z-index: 10;
|
|
14702
14706
|
}
|
|
14703
|
-
`}const px=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=
|
|
14707
|
+
`}const px=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=N.useScopedStyles(),{cover:d,coverFit:c}=e,u=s.useRef(null),[p,x]=s.useState(!1),v=t??[],m=p&&v.length>0,g=()=>{v.length!==0&&x(!0)};return s.useEffect(()=>{!n||i||o||x(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ux(l)}}),d&&a.jsx("div",{className:`${l}-cover ${oi(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>g(),style:{...oi(c)?{"--image-aspect-ratio":Fa(c)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${oi(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),m&&typeof document<"u"&&(()=>{const h=(r?document.getElementById(r):null)??document.body;return si.createPortal(a.jsx(dx,{prefix:l,images:v,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>x(!1)}),h)})()]})},mx=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
14704
14708
|
import { createPortal } from 'react-dom';
|
|
14705
14709
|
import { CommonComponentProps } from '../props';
|
|
14706
14710
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15246,7 +15250,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15246
15250
|
</>
|
|
15247
15251
|
);
|
|
15248
15252
|
};
|
|
15249
|
-
`,gx="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),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 hx(e){const t={};return t[Zt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Zt(e,"fontSettings")]={...Wi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Zt(e,"fontSize")]={...Wi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Zt(e,"lineHeight")]={...Wi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Zt(e,"letterSpacing")]={...Wi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Zt(e,"wordSpacing")]={...Wi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Zt(e,"textAlign")]={...Wi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Zt(e,"textAppearance")]={...Wi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const fx=Fo.reduce((e,t)=>({...e,...hx(t)}),{}),yx=Fo.reduce((e,t)=>({...e,[Zt(t,"fontFamily")]:"Goudy Bookletter 1911",[Zt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Zt(t,"letterSpacing")]:0,[Zt(t,"wordSpacing")]:0,[Zt(t,"textAlign")]:"left",[Zt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function rs(e){return Fo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Zt(n,"fontSize")]=i),o!==void 0&&(t[Zt(n,"lineHeight")]=o),t},{})}const vx=sx(),xx={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"}},...fx,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:gx,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...yx},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,...rs({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,...rs({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,...rs({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:[vx]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},bx={element:px,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:xx,sourceCode:mx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Fo.map(e=>({path:`${Zt(e,"fontFamily")}`}))]},fontRelations:{...Fo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Zt(t,"fontFamily")}`}),{})}},Sx=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:v,coverFit:y,backgroundColor:m,imageGap:g,maxWidth:f,maxHeight:x,textTransition:R,title1Width:b,title2Width:S,title3Width:G,title1MarginLeft:D=0,title2MarginLeft:j=0,title3MarginLeft:P=0,titleRowMarginBottom:M=0,titleHeaderLayout:K="single-row",countCloseGap:T=0,closeIcon:L,closeIconMaxWidth:_,closeIconColor:z,closeIconHoverColor:$,contentMarginTop:k=0,iconMarginRight:W=0}=n,w=s.useCallback(Se=>F.scalingValue(Se,i??!1),[i]),U=w(g??0),C=`${f}%`,O=`${x}%`,V=w(T),se=w(k),ie=w(W),N=ji("title1",Bi(n,"title1"),i),de=ji("title2",Bi(n,"title2"),i),X=ji("title3",Bi(n,"title3"),i),ce=ji("count",Bi(n,"count"),i),oe=K==="mobile",fe=!i||!!r,Pe=!o&&(!i||!!r),xe=s.useMemo(()=>oa(t,v),[t,v]),[pe,Z]=s.useState(l),le=xe[pe],re=le==null?void 0:le.entry,[Ie,we]=s.useState(!1),[Me,ye]=s.useState(null),[be,Ce]=s.useState(!1),[h,q]=s.useState(null),[Y,ee]=s.useState(!1),[ve,B]=s.useState(0),[I,Q]=s.useState(),[ne,H]=s.useState(),[te,ke]=s.useState(null),ge=s.useRef(null),J=s.useRef(0),Ye=s.useRef(0),je=s.useRef(0),it=s.useRef(!1),qe=s.useRef(null),et=s.useRef(null),Je=s.useRef(null),Ge=s.useRef(null),$e=s.useRef(null),He=s.useRef(null),De=s.useRef(null),Qe=s.useCallback(()=>{const Se=et.current;if(!Se)return;const Ke=Se.closest(`.${e}-lightbox-content-area`);if(!Ke)return Se.getBoundingClientRect().width;const E=Array.from(Ke.children).reduce((ae,ue)=>!(ue instanceof HTMLElement)||ue.contains(Se)?ae:ae+ue.getBoundingClientRect().width,0);return Ke.getBoundingClientRect().width-E},[e]),he=s.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null)},[]),_e=s.useCallback(Se=>{Se===J.current&&(q(null),ee(!1))},[]),Ve=s.useCallback(()=>{o||it.current||(it.current=!0,u==null||u(),we(!1),qe.current=setTimeout(()=>{p()},300))},[o,u,p]),tt=s.useCallback(Se=>!!(Se.closest("[data-controls]")||Se.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ft,backdropStyle:rt,mediaAreaStyle:Oe,overlayContentStyle:Fe,swipeHandlers:Ee,dismissAreaStyle:Ze}=Vu({enabled:Pe,onClose:Ve,animMs:300,isBlockedTarget:tt}),We=s.useCallback(Se=>{d&&Lu(Se+1,c,!0)},[d,c]),ot=s.useCallback(Se=>{if(Se)return Se.getBoundingClientRect().height},[]),nt=s.useCallback(Se=>{if(xe.length===0)return;const Ke=(Se%xe.length+xe.length)%xe.length;if(Ke===pe)return;const E=xe[pe],ae=xe[Ke];J.current+=1;const ue=J.current,Re=R==="fade"&&gc(E==null?void 0:E.entry)!==gc(ae==null?void 0:ae.entry),Ue=ot(Je.current),dt=Re?(()=>{const Ft=Qe();ai.flushSync(()=>{ke(ae.entry)}),Je.current&&Ft&&(Je.current.style.width=`${Ft}px`);const rn=ot(Je.current);return Je.current&&(Je.current.style.width=""),{measuredIncomingTitlesHeight:rn,incomingTitlesMeasureWidth:Ft}})():void 0,Rt=Math.max(Ue??0,(dt==null?void 0:dt.measuredIncomingTitlesHeight)??0)||void 0;B(ue),q(pe),ee(!0),Z(Ke),We(Ke),je.current=Ke,Re?(he(),Rt&&Q(Rt),dt!=null&&dt.incomingTitlesMeasureWidth&&H(dt.incomingTitlesMeasureWidth),ye((E==null?void 0:E.entryIndex)??null),Ce(!0),Ye.current=ae.entryIndex,ge.current=setTimeout(()=>{ye(null),Ce(!1),Q(void 0),H(void 0),ke(null),ge.current=null},400)):(he(),ye(null),Ce(!1),Q(void 0),H(void 0),ke(null),Ye.current=ae.entryIndex)},[pe,he,Qe,ot,xe,We,R]),me=s.useCallback(()=>{De.current=null},[]),Ne=s.useCallback(Se=>{!fe||xe.length<=1||Se.pointerType==="mouse"&&Se.button!==0||Se.target.closest("[data-controls]")||(De.current={startX:Se.clientX,startY:Se.clientY,pointerId:Se.pointerId})},[fe,xe.length]),st=s.useCallback(Se=>{var Ft;if(!fe||xe.length<=1||Se.pointerType==="mouse"&&Se.button!==0)return;if(ft){me();return}const Ke=De.current;if(!Ke||Ke.pointerId!==Se.pointerId||(me(),Se.target.closest("[data-controls]")))return;const ae=Se.clientX-Ke.startX,ue=Se.clientY-Ke.startY,Re=Math.abs(ae),Ue=Math.abs(ue);if(Re>=Ay&&Re>Ue){nt(ae>0?pe-1:pe+1);return}if(Re>dc||Ue>dc)return;const dt=(Ft=Ge.current)==null?void 0:Ft.getBoundingClientRect(),Rt=dt?dt.left+dt.width/2:window.innerWidth/2;nt(Se.clientX<Rt?pe-1:pe+1)},[pe,fe,nt,ft,me,xe.length]),ut=s.useCallback(Se=>{const Ke=De.current;(Ke==null?void 0:Ke.pointerId)===Se.pointerId&&me()},[me]);Gu(),s.useEffect(()=>{He.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const Se=requestAnimationFrame(()=>{we(!0),requestAnimationFrame(()=>{$e.current?$e.current.focus():Ge.current&&Ge.current.focus()})});return()=>{cancelAnimationFrame(Se),qe.current&&clearTimeout(qe.current),ge.current&&clearTimeout(ge.current);const Ke=He.current;Ke&&document.contains(Ke)&&Ke.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var Se;R!=="fade"&&(Ye.current=((Se=xe[pe])==null?void 0:Se.entryIndex)??0,he(),ye(null),Ce(!1),Q(void 0),H(void 0))},[pe,he,xe,R]),s.useEffect(()=>{const Se=Ke=>{if(Ke.key==="Escape"){Ve();return}if(Ke.key==="ArrowLeft"&&xe.length>1){nt(pe-1);return}if(Ke.key==="ArrowRight"&&xe.length>1){nt(pe+1);return}if(Ke.key==="Tab"&&Ge.current){const E=Ge.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ae=Array.from(E).filter(dt=>!dt.closest('[aria-hidden="true"]'));if(ae.length===0)return;const ue=ae[0],Re=ae[ae.length-1],Ue=document.activeElement;Ke.shiftKey?(Ue===ue||!Ge.current.contains(Ue))&&(Ke.preventDefault(),Re.focus()):(Ue===Re||!Ge.current.contains(Ue))&&(Ke.preventDefault(),ue.focus())}};return window.addEventListener("keydown",Se),()=>window.removeEventListener("keydown",Se)},[nt,Ve,pe,xe.length]),s.useLayoutEffect(()=>{he(),J.current=0,B(0),q(null),ee(!1),ye(null),Ce(!1),Q(void 0),H(void 0),ke(null),Z(Se=>{const Ke=Math.max(0,xe.length-1);return Math.min(Se,Ke)})},[he,t.length,v,xe.length]),s.useLayoutEffect(()=>{var E;const Se=Math.max(0,xe.length-1),Ke=Math.min(Math.max(0,l),Se);je.current=Ke,Ye.current=((E=xe[Ke])==null?void 0:E.entryIndex)??0,Z(Ke)},[l]);const Be=Me!==null?t[Me]:null,pt=h!==null?xe[h]:null,Tt=(re==null?void 0:re.title1)||(re==null?void 0:re.title2)||(re==null?void 0:re.title3)||(Be==null?void 0:Be.title1)||(Be==null?void 0:Be.title2)||(Be==null?void 0:Be.title3),Lt=zy(v,xe,t),xt=L!==null,Et=Tt||Lt||xt,Vt=Lt&&xt?{gap:V}:void 0,Ut=`${e}-titles-stack${oe?` ${e}-titles-stack-stacked`:""}`,Kt=`${e}-titles-layer-out${oe?` ${e}-titles-layer-out-stacked`:""}`,Pt=`${e}-titles-layer-out`,jt=(D??0)>0||o,on=w(M),vt=s.useMemo(()=>({title1Width:b??So.title1Width,title2Width:S??So.title2Width,title3Width:G??So.title3Width}),[b,S,G]),Le=s.useMemo(()=>({title2MarginLeft:j,title3MarginLeft:P}),[j,P]),Xe=s.useMemo(()=>re?xi(e,re,N,de,X):[],[e,re,N,de,X]),lt=s.useMemo(()=>Xe.map(Se=>vt[Se.widthKey]),[Xe,vt]),ct=s.useMemo(()=>Ro(Xe.length,lt),[Xe.length,lt]),wt=s.useMemo(()=>gr(Xe.length,lt),[Xe.length,lt]),It=s.useMemo(()=>Xe.filter(Se=>Se.prefix==="title1"),[Xe]),gt=s.useMemo(()=>Xe.filter(Se=>Se.prefix==="title2"||Se.prefix==="title3"),[Xe]),Ot=s.useMemo(()=>bi(It,vt),[It,vt]),_t=s.useMemo(()=>bi(gt,vt),[gt,vt]),Mt=s.useCallback((Se,Ke)=>{const E=Xe.findIndex(ue=>ue.prefix===Se.prefix);if(!oe||Ke==="single-row")return{effectiveWidth:wt[E]??0,resolvedWidth:ct[E]??0,maxWidth:hn(E,ct)};if(Ke==="two-row-top"){const ue=It.findIndex(Re=>Re.prefix===Se.prefix);return{effectiveWidth:Ot.effective[ue]??0,resolvedWidth:Ot.resolved[ue]??0,maxWidth:hn(ue,Ot.resolved)}}const ae=gt.findIndex(ue=>ue.prefix===Se.prefix);return{effectiveWidth:_t.effective[ae]??0,resolvedWidth:_t.resolved[ae]??0,maxWidth:hn(ae,_t.resolved)}},[Xe,gt,_t,wt,ct,It,Ot,oe]),Gt=s.useCallback(Se=>ku(Xe,ct,Le,Se)+(oe?0:D??0),[Xe,ct,Le,oe,D]),Xt=s.useCallback(()=>oe?0:D??0,[oe,D]),Dt=s.useCallback(Se=>gt.slice(0,Se).reduce((Ke,E,ae)=>Ke+(E.marginLeftKey?Le[E.marginLeftKey]??0:0)+(_t.resolved[ae]??0),0),[gt,_t.resolved,Le]),zt=s.useCallback(Se=>{const Ke=gt[Se];return Dt(Se)+(Ke.marginLeftKey?Le[Ke.marginLeftKey]??0:0)+(_t.resolved[Se]??0)},[gt,_t.resolved,Dt,Le]),Bt=s.useCallback((Se,Ke,E)=>{if(!oe||E==="single-row"){const dt=Se.findIndex(nn=>nn.prefix===Ke.prefix),Rt=Se.map(nn=>vt[nn.widthKey]),Ft=Ro(Se.length,Rt);return{effectiveWidth:gr(Se.length,Rt)[dt]??0,resolvedWidth:Ft[dt]??0,maxWidth:hn(dt,Ft)}}if(E==="two-row-top"){const dt=Se.filter(nn=>nn.prefix==="title1"),Rt=dt.findIndex(nn=>nn.prefix===Ke.prefix),{resolved:Ft,effective:rn}=bi(dt,vt);return{effectiveWidth:rn[Rt]??0,resolvedWidth:Ft[Rt]??0,maxWidth:hn(Rt,Ft)}}const ae=Se.filter(dt=>dt.prefix==="title2"||dt.prefix==="title3"),ue=ae.findIndex(dt=>dt.prefix===Ke.prefix),{resolved:Re,effective:Ue}=bi(ae,vt);return{effectiveWidth:Ue[ue]??0,resolvedWidth:Re[ue]??0,maxWidth:hn(ue,Re)}},[vt,oe]),bt=(Se,Ke,E)=>{const ae=Se.marginLeftKey?Le[Se.marginLeftKey]??0:0,{effectiveWidth:ue,resolvedWidth:Re,maxWidth:Ue}=E??Mt(Se,Ke),dt=Math.max(ae,vi),Rt=o&&Ke==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Se.prefix,style:{width:w(ue),...ae>0?{marginLeft:w(ae)}:{}},children:[a.jsx("p",{className:Se.className,style:Se.style,children:Se.text}),Rt&&Se.marginLeftKey?a.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re),style:{position:"absolute",top:0,left:w(-ae),width:w(dt),height:"100%",pointerEvents:"auto"}}):null,Rt?a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:w(-Cn/2),width:w(Cn),height:"100%",pointerEvents:"auto"}}):null]},Se.className)},A=(Se="two-row")=>{const Ke=Xe.findIndex(ue=>ue.prefix==="title1"),E=Ke>=0?ct[Ke]:vt.title1Width,ae=Se==="two-row"&&o;return a.jsx("div",{...ae?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(E)}:{},style:{width:w(D??0),flexShrink:0,alignSelf:"stretch",...ae?{pointerEvents:"auto"}:{}}})},Te=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:N,"aria-hidden":"true",children:" "}),Ae=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ce,"aria-live":"polite","aria-atomic":"true",children:Dy(xe,pe,v,t)}),ze=()=>Lt?o&&xt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ae(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ya(V)} + ${V}))`,width:Ya(V),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ae():null,mt=()=>!Lt&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Vt,children:[ze(),xt?St():null]}),Nt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Tt?Te():null,jt?A("single-row"):null,At(re),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),mt(),un()]}),ht=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Tt?Te():null,jt?A("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:be&&I?{minHeight:I}:void 0,children:[a.jsx("div",{ref:Je,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:yn(te||re)}),a.jsxs("div",{ref:et,className:Ut,style:{position:be?"absolute":"relative",inset:be?0:void 0,width:"100%",...be&&ne?{width:ne,maxWidth:"100%"}:void 0},children:[Be&&be?a.jsx("div",{className:`${Kt} ${e}-titles-fade-out`,children:yn(Be)}):null,a.jsx("div",{className:`${e}-titles-layer-in${be?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:yn(re)})]})]}),mt(),un()]}),St=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(_??0,i),height:F.scalingValue(_??0,i),marginRight:ie,"--close-icon-hover-color":$},children:[a.jsx("button",{ref:$e,type:"button",className:`${e}-close-icon-inner`,onClick:Ve,"aria-label":"Close",children:a.jsx(pn,{url:L??"",fill:z,hoverFill:i&&!r?z:$,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:ie,height:"100%",pointerEvents:"auto"}})]}),qt=(Se,Ke)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Lt||Tt?Te():null,jt?A("two-row"):null,Ke!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ke},children:Se}):a.jsxs(a.Fragment,{children:[Se,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),mt()]}),At=Se=>{if(!Se)return null;const Ke=xi(e,Se,N,de,X);return a.jsx(a.Fragment,{children:Ke.map(E=>bt(E,"single-row",Bt(Ke,E,"single-row")))})},sn=Se=>{if(!Se)return null;const Ke=xi(e,Se,N,de,X),E=Ke.find(ae=>ae.prefix==="title1");return E?bt(E,"two-row-top",Bt(Ke,E,"two-row-top")):null},gn=(Se,Ke=!1)=>{const E=Se?xi(e,Se,N,de,X):[],ae=E.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),ue=o&&Ke;return ae.length>0||ue||(M??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(Ue=>bt(Ue,"two-row-bottom",Bt(E,Ue,"two-row-bottom"))),Ke&&o?a.jsxs(a.Fragment,{children:[Ji(),Go()]}):null]}):null,(M??0)>0||ue?a.jsx("div",{"data-controls":ue?"titleRowMarginBottom":void 0,"data-controls-axis":ue?"y":void 0,"data-controls-reverse":ue?"":void 0,className:ue?`${e}-control`:void 0,style:{height:on,width:"100%",flexShrink:0,pointerEvents:ue?"auto":"none"}}):null]}):null},Xn=(Se,Ke=!1)=>a.jsxs(a.Fragment,{children:[qt(sn(Se)),gn(Se,Ke)]}),yn=Se=>oe?a.jsx("div",{className:`${e}-titles-row-two-row`,children:Xn(Se)}):Se?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:At(Se)}):null,qn=()=>{const Se=oe?-1:Xe.findIndex(ae=>ae.prefix==="title1"),Ke=!oe&&(o||(D??0)>0)?(()=>{const ae=D??0,ue=Se>=0?ct[Se]:vt.title1Width,Re=Math.max(ae,vi);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ue),style:{position:"absolute",top:0,left:0,width:w(Re),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,E=Xe.flatMap((ae,ue)=>{if(!ae.marginLeftKey)return[];const Re=Le[ae.marginLeftKey]??0,Ue=Pu(Xe,ct,Le,ue)+Xt(),dt=Math.max(Re,vi);return a.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ct[ue]),style:{position:"absolute",top:0,left:w(Ue),width:w(dt),height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)});return Ke?[Ke,...E]:E},ki=()=>Xe.map((Se,Ke)=>{const E=hn(Ke,ct),ue=Gt(Ke)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(E),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:w(ue),width:w(Cn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),Ji=()=>gt.flatMap((Se,Ke)=>{if(!Se.marginLeftKey)return[];const E=Le[Se.marginLeftKey]??0,ae=Dt(Ke),ue=Math.max(E,vi),{resolvedWidth:Re}=Mt(Se,"two-row-bottom");return a.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re),style:{position:"absolute",top:0,left:w(ae),width:w(ue),height:"100%",pointerEvents:"auto"}},Se.marginLeftKey)}),Go=()=>gt.map((Se,Ke)=>{const{maxWidth:E}=Mt(Se,"two-row-bottom"),ue=zt(Ke)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(E),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:w(ue),width:w(Cn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),un=()=>!o||oe?null:a.jsxs(a.Fragment,{children:[qn(),ki()]}),An=Se=>{const Ke=!Se.objectFit&&ii(y);return{className:`${e}-slide-image-cell${Ke?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:C,maxHeight:O,...Ke?{"--image-aspect-ratio":Fa(y)}:{}}}},Rn=Se=>Se.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":Se.objectFit}}:ii(y)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Un=Se=>{if(Se.length===0)return null;const Ke=Se.length>1,E=Ya(U),ae=`calc(-0.5 * (${E} + ${U}))`;if(Se.length===1){const ue=Se[0];return a.jsx("div",{...An(ue),children:a.jsx("img",{...Rn(ue),src:ue.url,alt:ue.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ke?{gap:U}:void 0,children:Se.map((ue,Re)=>a.jsxs("div",{...An(ue),children:[a.jsx("img",{...Rn(ue),src:ue.url,alt:ue.name??"",draggable:!1}),o&&Ke&&Re<Se.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ae,width:E,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ue.url}-${Re}`))})},Qi=!!(re!=null&&re.title2||re!=null&&re.title3||Be!=null&&Be.title2||Be!=null&&Be.title3||(M??0)>0||o),Xo=()=>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:Je,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Xn(te||re)}),a.jsxs("div",{ref:et,className:`${e}-titles-row-two-row`,style:{...be&&I?{minHeight:I}:void 0,...be&&ne?{width:ne,maxWidth:"100%"}:void 0},children:[qt(a.jsxs("div",{className:Ut,style:{position:be?"absolute":"relative",inset:be?0:void 0,width:"100%"},children:[Be&&be?a.jsx("div",{className:`${Pt} ${e}-titles-fade-out`,children:sn(Be)}):null,a.jsx("div",{className:`${e}-titles-layer-in${be?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:sn(re)})]}),be&&I?I:void 0),Qi?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Be&&be?a.jsx("div",{className:`${Kt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:gn(Be)}):null,a.jsx("div",{className:`${e}-titles-layer-in${be?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${oe?` ${e}-titles-layer-in-stacked`:""}`,children:gn(re,!0)})]}):null]})]}),eo=()=>{const Se=Qi;return 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:Xn(re,!0)}),un()]})};return a.jsxs("div",{ref:Ge,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ft||Ve()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Ie?1:0,transition:"opacity 300ms ease",pointerEvents:Ie?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...rt}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ze,...Ee,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Oe,onClick:Se=>Se.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":fe&&xe.length>1?"true":"false",onPointerDown:fe?Ne:void 0,onPointerUp:fe?st:void 0,onPointerCancel:fe?ut:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[pt&&Y?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:Se=>{Se.target===Se.currentTarget&&_e(ve)},children:a.jsx("div",{className:`${e}-slide-area`,children:Un(pt.images)})},`slide-out-${ve}`):null,a.jsx("div",{className:`${e}-slide-layer-in${Y?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:le?Un(le.images):null})},`slide-in-${ve}-${pe}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Fe,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:se,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...oe?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${oe?` ${e}-lightbox-content-area-stacked`:""}`,children:Et&&a.jsx("div",{className:`${e}-text-bar-cell${oe?` ${e}-text-bar-cell-stacked`:""}`,style:oe?void 0:{flex:1,minWidth:0,width:"100%"},children:oe?R==="fade"?Xo():eo():R==="fade"?ht():Nt()})})})]})]})]})};function wx(e){return`
|
|
15253
|
+
`,gx="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),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 hx(e){const t={};return t[Zt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Zt(e,"fontSettings")]={...Wi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Zt(e,"fontSize")]={...Wi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Zt(e,"lineHeight")]={...Wi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Zt(e,"letterSpacing")]={...Wi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Zt(e,"wordSpacing")]={...Wi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Zt(e,"textAlign")]={...Wi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Zt(e,"textAppearance")]={...Wi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const fx=Fo.reduce((e,t)=>({...e,...hx(t)}),{}),yx=Fo.reduce((e,t)=>({...e,[Zt(t,"fontFamily")]:"Goudy Bookletter 1911",[Zt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Zt(t,"letterSpacing")]:0,[Zt(t,"wordSpacing")]:0,[Zt(t,"textAlign")]:"left",[Zt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function rs(e){return Fo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Zt(n,"fontSize")]=i),o!==void 0&&(t[Zt(n,"lineHeight")]=o),t},{})}const vx=sx(),xx={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"}},...fx,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:gx,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...yx},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,...rs({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,...rs({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,...rs({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:[vx]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},bx={element:px,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:xx,sourceCode:mx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Fo.map(e=>({path:`${Zt(e,"fontFamily")}`}))]},fontRelations:{...Fo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Zt(t,"fontFamily")}`}),{})}},Sx=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:x,coverFit:v,backgroundColor:m,imageGap:g,maxWidth:h,maxHeight:b,textTransition:E,title1Width:y,title2Width:w,title3Width:j,title1MarginLeft:G=0,title2MarginLeft:A=0,title3MarginLeft:P=0,titleRowMarginBottom:W=0,titleHeaderLayout:Y="single-row",countCloseGap:$=0,closeIcon:I,closeIconMaxWidth:H,closeIconColor:O,closeIconHoverColor:C,contentMarginTop:L=0,iconMarginRight:D=0}=n,S=s.useCallback(Se=>N.scalingValue(Se,i??!1),[i]),U=S(g??0),T=`${h}%`,_=`${b}%`,B=S($),ae=S(L),ie=S(D),k=ji("title1",Bi(n,"title1"),i),ue=ji("title2",Bi(n,"title2"),i),X=ji("title3",Bi(n,"title3"),i),le=ji("count",Bi(n,"count"),i),te=Y==="mobile",we=!i||!!r,ke=!o&&(!i||!!r),fe=s.useMemo(()=>oa(t,x),[t,x]),[me,Z]=s.useState(l),se=fe[me],oe=se==null?void 0:se.entry,[Pe,$e]=s.useState(!1),[Me,ye]=s.useState(null),[be,Ce]=s.useState(!1),[f,q]=s.useState(null),[K,ne]=s.useState(!1),[ge,z]=s.useState(0),[R,Q]=s.useState(),[ee,ce]=s.useState(),[V,Le]=s.useState(null),ve=s.useRef(null),J=s.useRef(0),_e=s.useRef(0),Be=s.useRef(0),at=s.useRef(!1),Ue=s.useRef(null),et=s.useRef(null),Je=s.useRef(null),Ye=s.useRef(null),xe=s.useRef(null),We=s.useRef(null),He=s.useRef(null),Qe=s.useCallback(()=>{const Se=et.current;if(!Se)return;const Ze=Se.closest(`.${e}-lightbox-content-area`);if(!Ze)return Se.getBoundingClientRect().width;const M=Array.from(Ze.children).reduce((re,pe)=>!(pe instanceof HTMLElement)||pe.contains(Se)?re:re+pe.getBoundingClientRect().width,0);return Ze.getBoundingClientRect().width-M},[e]),he=s.useCallback(()=>{ve.current&&(clearTimeout(ve.current),ve.current=null)},[]),Ne=s.useCallback(Se=>{Se===J.current&&(q(null),ne(!1))},[]),Ve=s.useCallback(()=>{o||at.current||(at.current=!0,u==null||u(),$e(!1),Ue.current=setTimeout(()=>{p()},300))},[o,u,p]),tt=s.useCallback(Se=>!!(Se.closest("[data-controls]")||Se.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:mt,backdropStyle:st,mediaAreaStyle:De,overlayContentStyle:Fe,swipeHandlers:Xe,dismissAreaStyle:ot}=Vu({enabled:ke,onClose:Ve,animMs:300,isBlockedTarget:tt}),Oe=s.useCallback(Se=>{d&&Lu(Se+1,c,!0)},[d,c]),qe=s.useCallback(Se=>{if(Se)return Se.getBoundingClientRect().height},[]),nt=s.useCallback(Se=>{if(fe.length===0)return;const Ze=(Se%fe.length+fe.length)%fe.length;if(Ze===me)return;const M=fe[me],re=fe[Ze];J.current+=1;const pe=J.current,Ee=E==="fade"&&gc(M==null?void 0:M.entry)!==gc(re==null?void 0:re.entry),Ke=qe(Je.current),dt=Ee?(()=>{const Ft=Qe();si.flushSync(()=>{Le(re.entry)}),Je.current&&Ft&&(Je.current.style.width=`${Ft}px`);const rn=qe(Je.current);return Je.current&&(Je.current.style.width=""),{measuredIncomingTitlesHeight:rn,incomingTitlesMeasureWidth:Ft}})():void 0,Rt=Math.max(Ke??0,(dt==null?void 0:dt.measuredIncomingTitlesHeight)??0)||void 0;z(pe),q(me),ne(!0),Z(Ze),Oe(Ze),Be.current=Ze,Ee?(he(),Rt&&Q(Rt),dt!=null&&dt.incomingTitlesMeasureWidth&&ce(dt.incomingTitlesMeasureWidth),ye((M==null?void 0:M.entryIndex)??null),Ce(!0),_e.current=re.entryIndex,ve.current=setTimeout(()=>{ye(null),Ce(!1),Q(void 0),ce(void 0),Le(null),ve.current=null},400)):(he(),ye(null),Ce(!1),Q(void 0),ce(void 0),Le(null),_e.current=re.entryIndex)},[me,he,Qe,qe,fe,Oe,E]),de=s.useCallback(()=>{He.current=null},[]),Ie=s.useCallback(Se=>{!we||fe.length<=1||Se.pointerType==="mouse"&&Se.button!==0||Se.target.closest("[data-controls]")||(He.current={startX:Se.clientX,startY:Se.clientY,pointerId:Se.pointerId})},[we,fe.length]),it=s.useCallback(Se=>{var Ft;if(!we||fe.length<=1||Se.pointerType==="mouse"&&Se.button!==0)return;if(mt){de();return}const Ze=He.current;if(!Ze||Ze.pointerId!==Se.pointerId||(de(),Se.target.closest("[data-controls]")))return;const re=Se.clientX-Ze.startX,pe=Se.clientY-Ze.startY,Ee=Math.abs(re),Ke=Math.abs(pe);if(Ee>=Ay&&Ee>Ke){nt(re>0?me-1:me+1);return}if(Ee>dc||Ke>dc)return;const dt=(Ft=Ye.current)==null?void 0:Ft.getBoundingClientRect(),Rt=dt?dt.left+dt.width/2:window.innerWidth/2;nt(Se.clientX<Rt?me-1:me+1)},[me,we,nt,mt,de,fe.length]),ut=s.useCallback(Se=>{const Ze=He.current;(Ze==null?void 0:Ze.pointerId)===Se.pointerId&&de()},[de]);Gu(),s.useEffect(()=>{We.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const Se=requestAnimationFrame(()=>{$e(!0),requestAnimationFrame(()=>{xe.current?xe.current.focus():Ye.current&&Ye.current.focus()})});return()=>{cancelAnimationFrame(Se),Ue.current&&clearTimeout(Ue.current),ve.current&&clearTimeout(ve.current);const Ze=We.current;Ze&&document.contains(Ze)&&Ze.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var Se;E!=="fade"&&(_e.current=((Se=fe[me])==null?void 0:Se.entryIndex)??0,he(),ye(null),Ce(!1),Q(void 0),ce(void 0))},[me,he,fe,E]),s.useEffect(()=>{const Se=Ze=>{if(Ze.key==="Escape"){Ve();return}if(Ze.key==="ArrowLeft"&&fe.length>1){nt(me-1);return}if(Ze.key==="ArrowRight"&&fe.length>1){nt(me+1);return}if(Ze.key==="Tab"&&Ye.current){const M=Ye.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),re=Array.from(M).filter(dt=>!dt.closest('[aria-hidden="true"]'));if(re.length===0)return;const pe=re[0],Ee=re[re.length-1],Ke=document.activeElement;Ze.shiftKey?(Ke===pe||!Ye.current.contains(Ke))&&(Ze.preventDefault(),Ee.focus()):(Ke===Ee||!Ye.current.contains(Ke))&&(Ze.preventDefault(),pe.focus())}};return window.addEventListener("keydown",Se),()=>window.removeEventListener("keydown",Se)},[nt,Ve,me,fe.length]),s.useLayoutEffect(()=>{he(),J.current=0,z(0),q(null),ne(!1),ye(null),Ce(!1),Q(void 0),ce(void 0),Le(null),Z(Se=>{const Ze=Math.max(0,fe.length-1);return Math.min(Se,Ze)})},[he,t.length,x,fe.length]),s.useLayoutEffect(()=>{var M;const Se=Math.max(0,fe.length-1),Ze=Math.min(Math.max(0,l),Se);Be.current=Ze,_e.current=((M=fe[Ze])==null?void 0:M.entryIndex)??0,Z(Ze)},[l]);const je=Me!==null?t[Me]:null,pt=f!==null?fe[f]:null,Tt=(oe==null?void 0:oe.title1)||(oe==null?void 0:oe.title2)||(oe==null?void 0:oe.title3)||(je==null?void 0:je.title1)||(je==null?void 0:je.title2)||(je==null?void 0:je.title3),Lt=zy(x,fe,t),xt=I!==null,Et=Tt||Lt||xt,Vt=Lt&&xt?{gap:B}:void 0,Ut=`${e}-titles-stack${te?` ${e}-titles-stack-stacked`:""}`,Kt=`${e}-titles-layer-out${te?` ${e}-titles-layer-out-stacked`:""}`,Pt=`${e}-titles-layer-out`,jt=(G??0)>0||o,on=S(W),vt=s.useMemo(()=>({title1Width:y??So.title1Width,title2Width:w??So.title2Width,title3Width:j??So.title3Width}),[y,w,j]),Re=s.useMemo(()=>({title2MarginLeft:A,title3MarginLeft:P}),[A,P]),Ge=s.useMemo(()=>oe?xi(e,oe,k,ue,X):[],[e,oe,k,ue,X]),lt=s.useMemo(()=>Ge.map(Se=>vt[Se.widthKey]),[Ge,vt]),ct=s.useMemo(()=>Ro(Ge.length,lt),[Ge.length,lt]),wt=s.useMemo(()=>gr(Ge.length,lt),[Ge.length,lt]),It=s.useMemo(()=>Ge.filter(Se=>Se.prefix==="title1"),[Ge]),ht=s.useMemo(()=>Ge.filter(Se=>Se.prefix==="title2"||Se.prefix==="title3"),[Ge]),Ot=s.useMemo(()=>bi(It,vt),[It,vt]),_t=s.useMemo(()=>bi(ht,vt),[ht,vt]),Mt=s.useCallback((Se,Ze)=>{const M=Ge.findIndex(pe=>pe.prefix===Se.prefix);if(!te||Ze==="single-row")return{effectiveWidth:wt[M]??0,resolvedWidth:ct[M]??0,maxWidth:hn(M,ct)};if(Ze==="two-row-top"){const pe=It.findIndex(Ee=>Ee.prefix===Se.prefix);return{effectiveWidth:Ot.effective[pe]??0,resolvedWidth:Ot.resolved[pe]??0,maxWidth:hn(pe,Ot.resolved)}}const re=ht.findIndex(pe=>pe.prefix===Se.prefix);return{effectiveWidth:_t.effective[re]??0,resolvedWidth:_t.resolved[re]??0,maxWidth:hn(re,_t.resolved)}},[Ge,ht,_t,wt,ct,It,Ot,te]),Gt=s.useCallback(Se=>ku(Ge,ct,Re,Se)+(te?0:G??0),[Ge,ct,Re,te,G]),Xt=s.useCallback(()=>te?0:G??0,[te,G]),Dt=s.useCallback(Se=>ht.slice(0,Se).reduce((Ze,M,re)=>Ze+(M.marginLeftKey?Re[M.marginLeftKey]??0:0)+(_t.resolved[re]??0),0),[ht,_t.resolved,Re]),zt=s.useCallback(Se=>{const Ze=ht[Se];return Dt(Se)+(Ze.marginLeftKey?Re[Ze.marginLeftKey]??0:0)+(_t.resolved[Se]??0)},[ht,_t.resolved,Dt,Re]),Bt=s.useCallback((Se,Ze,M)=>{if(!te||M==="single-row"){const dt=Se.findIndex(nn=>nn.prefix===Ze.prefix),Rt=Se.map(nn=>vt[nn.widthKey]),Ft=Ro(Se.length,Rt);return{effectiveWidth:gr(Se.length,Rt)[dt]??0,resolvedWidth:Ft[dt]??0,maxWidth:hn(dt,Ft)}}if(M==="two-row-top"){const dt=Se.filter(nn=>nn.prefix==="title1"),Rt=dt.findIndex(nn=>nn.prefix===Ze.prefix),{resolved:Ft,effective:rn}=bi(dt,vt);return{effectiveWidth:rn[Rt]??0,resolvedWidth:Ft[Rt]??0,maxWidth:hn(Rt,Ft)}}const re=Se.filter(dt=>dt.prefix==="title2"||dt.prefix==="title3"),pe=re.findIndex(dt=>dt.prefix===Ze.prefix),{resolved:Ee,effective:Ke}=bi(re,vt);return{effectiveWidth:Ke[pe]??0,resolvedWidth:Ee[pe]??0,maxWidth:hn(pe,Ee)}},[vt,te]),bt=(Se,Ze,M)=>{const re=Se.marginLeftKey?Re[Se.marginLeftKey]??0:0,{effectiveWidth:pe,resolvedWidth:Ee,maxWidth:Ke}=M??Mt(Se,Ze),dt=Math.max(re,Qn),Rt=o&&Ze==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Se.prefix,style:{width:S(pe),...re>0?{marginLeft:S(re)}:{}},children:[a.jsx("p",{className:Se.className,style:Se.style,children:Se.text}),Rt&&Se.marginLeftKey?a.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ee),style:{position:"absolute",top:0,left:S(-re),width:S(dt),height:"100%",pointerEvents:"auto"}}):null,Rt?a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:S(-Cn/2),width:S(Cn),height:"100%",pointerEvents:"auto"}}):null]},Se.className)},F=(Se="two-row")=>{const Ze=Ge.findIndex(pe=>pe.prefix==="title1"),M=Ze>=0?ct[Ze]:vt.title1Width,re=Se==="two-row"&&o;return a.jsx("div",{...re?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(M)}:{},style:{width:S(G??0),flexShrink:0,alignSelf:"stretch",...re?{pointerEvents:"auto"}:{}}})},Te=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:k,"aria-hidden":"true",children:" "}),Ae=()=>a.jsx("span",{className:`${e}-entry-counter`,style:le,"aria-live":"polite","aria-atomic":"true",children:Dy(fe,me,x,t)}),ze=()=>Lt?o&&xt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ae(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ya(B)} + ${B}))`,width:Ya(B),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ae():null,gt=()=>!Lt&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Vt,children:[ze(),xt?St():null]}),Nt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Tt?Te():null,jt?F("single-row"):null,At(oe),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),gt(),un()]}),ft=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Tt?Te():null,jt?F("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:be&&R?{minHeight:R}:void 0,children:[a.jsx("div",{ref:Je,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:yn(V||oe)}),a.jsxs("div",{ref:et,className:Ut,style:{position:be?"absolute":"relative",inset:be?0:void 0,width:"100%",...be&&ee?{width:ee,maxWidth:"100%"}:void 0},children:[je&&be?a.jsx("div",{className:`${Kt} ${e}-titles-fade-out`,children:yn(je)}):null,a.jsx("div",{className:`${e}-titles-layer-in${be?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:yn(oe)})]})]}),gt(),un()]}),St=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:N.scalingValue(H??0,i),height:N.scalingValue(H??0,i),marginRight:ie,"--close-icon-hover-color":C},children:[a.jsx("button",{ref:xe,type:"button",className:`${e}-close-icon-inner`,onClick:Ve,"aria-label":"Close",children:a.jsx(pn,{url:I??"",fill:O,hoverFill:i&&!r?O:C,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:ie,height:"100%",pointerEvents:"auto"}})]}),qt=(Se,Ze)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Lt||Tt?Te():null,jt?F("two-row"):null,Ze!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ze},children:Se}):a.jsxs(a.Fragment,{children:[Se,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),gt()]}),At=Se=>{if(!Se)return null;const Ze=xi(e,Se,k,ue,X);return a.jsx(a.Fragment,{children:Ze.map(M=>bt(M,"single-row",Bt(Ze,M,"single-row")))})},sn=Se=>{if(!Se)return null;const Ze=xi(e,Se,k,ue,X),M=Ze.find(re=>re.prefix==="title1");return M?bt(M,"two-row-top",Bt(Ze,M,"two-row-top")):null},gn=(Se,Ze=!1)=>{const M=Se?xi(e,Se,k,ue,X):[],re=M.filter(Ke=>Ke.prefix==="title2"||Ke.prefix==="title3"),pe=o&&Ze;return re.length>0||pe||(W??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[re.map(Ke=>bt(Ke,"two-row-bottom",Bt(M,Ke,"two-row-bottom"))),Ze&&o?a.jsxs(a.Fragment,{children:[Ji(),Go()]}):null]}):null,(W??0)>0||pe?a.jsx("div",{"data-controls":pe?"titleRowMarginBottom":void 0,"data-controls-axis":pe?"y":void 0,"data-controls-reverse":pe?"":void 0,className:pe?`${e}-control`:void 0,style:{height:on,width:"100%",flexShrink:0,pointerEvents:pe?"auto":"none"}}):null]}):null},Xn=(Se,Ze=!1)=>a.jsxs(a.Fragment,{children:[qt(sn(Se)),gn(Se,Ze)]}),yn=Se=>te?a.jsx("div",{className:`${e}-titles-row-two-row`,children:Xn(Se)}):Se?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:At(Se)}):null,qn=()=>{const Se=te?-1:Ge.findIndex(re=>re.prefix==="title1"),Ze=!te&&(o||(G??0)>0)?(()=>{const re=G??0,pe=Se>=0?ct[Se]:vt.title1Width,Ee=Math.max(re,Qn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(pe),style:{position:"absolute",top:0,left:0,width:S(Ee),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,M=Ge.flatMap((re,pe)=>{if(!re.marginLeftKey)return[];const Ee=Re[re.marginLeftKey]??0,Ke=Pu(Ge,ct,Re,pe)+Xt(),dt=Math.max(Ee,Qn);return a.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ct[pe]),style:{position:"absolute",top:0,left:S(Ke),width:S(dt),height:"100%",pointerEvents:"auto"}},re.marginLeftKey)});return Ze?[Ze,...M]:M},ki=()=>Ge.map((Se,Ze)=>{const M=hn(Ze,ct),pe=Gt(Ze)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(M),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S(pe),width:S(Cn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),Ji=()=>ht.flatMap((Se,Ze)=>{if(!Se.marginLeftKey)return[];const M=Re[Se.marginLeftKey]??0,re=Dt(Ze),pe=Math.max(M,Qn),{resolvedWidth:Ee}=Mt(Se,"two-row-bottom");return a.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ee),style:{position:"absolute",top:0,left:S(re),width:S(pe),height:"100%",pointerEvents:"auto"}},Se.marginLeftKey)}),Go=()=>ht.map((Se,Ze)=>{const{maxWidth:M}=Mt(Se,"two-row-bottom"),pe=zt(Ze)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(M),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S(pe),width:S(Cn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),un=()=>!o||te?null:a.jsxs(a.Fragment,{children:[qn(),ki()]}),An=Se=>{const Ze=!Se.objectFit&&oi(v);return{className:`${e}-slide-image-cell${Ze?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:T,maxHeight:_,...Ze?{"--image-aspect-ratio":Fa(v)}:{}}}},Rn=Se=>Se.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":Se.objectFit}}:oi(v)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Un=Se=>{if(Se.length===0)return null;const Ze=Se.length>1,M=Ya(U),re=`calc(-0.5 * (${M} + ${U}))`;if(Se.length===1){const pe=Se[0];return a.jsx("div",{...An(pe),children:a.jsx("img",{...Rn(pe),src:pe.url,alt:pe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ze?{gap:U}:void 0,children:Se.map((pe,Ee)=>a.jsxs("div",{...An(pe),children:[a.jsx("img",{...Rn(pe),src:pe.url,alt:pe.name??"",draggable:!1}),o&&Ze&&Ee<Se.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:re,width:M,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${pe.url}-${Ee}`))})},Qi=!!(oe!=null&&oe.title2||oe!=null&&oe.title3||je!=null&&je.title2||je!=null&&je.title3||(W??0)>0||o),Xo=()=>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:Je,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Xn(V||oe)}),a.jsxs("div",{ref:et,className:`${e}-titles-row-two-row`,style:{...be&&R?{minHeight:R}:void 0,...be&&ee?{width:ee,maxWidth:"100%"}:void 0},children:[qt(a.jsxs("div",{className:Ut,style:{position:be?"absolute":"relative",inset:be?0:void 0,width:"100%"},children:[je&&be?a.jsx("div",{className:`${Pt} ${e}-titles-fade-out`,children:sn(je)}):null,a.jsx("div",{className:`${e}-titles-layer-in${be?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:sn(oe)})]}),be&&R?R:void 0),Qi?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[je&&be?a.jsx("div",{className:`${Kt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:gn(je)}):null,a.jsx("div",{className:`${e}-titles-layer-in${be?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${te?` ${e}-titles-layer-in-stacked`:""}`,children:gn(oe,!0)})]}):null]})]}),eo=()=>{const Se=Qi;return 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:Xn(oe,!0)}),un()]})};return a.jsxs("div",{ref:Ye,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{mt||Ve()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Pe?1:0,transition:"opacity 300ms ease",pointerEvents:Pe?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...st}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:ot,...Xe,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:De,onClick:Se=>Se.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":we&&fe.length>1?"true":"false",onPointerDown:we?Ie:void 0,onPointerUp:we?it:void 0,onPointerCancel:we?ut:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[pt&&K?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:Se=>{Se.target===Se.currentTarget&&Ne(ge)},children:a.jsx("div",{className:`${e}-slide-area`,children:Un(pt.images)})},`slide-out-${ge}`):null,a.jsx("div",{className:`${e}-slide-layer-in${K?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:se?Un(se.images):null})},`slide-in-${ge}-${me}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Fe,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ae,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...te?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${te?` ${e}-lightbox-content-area-stacked`:""}`,children:Et&&a.jsx("div",{className:`${e}-text-bar-cell${te?` ${e}-text-bar-cell-stacked`:""}`,style:te?void 0:{flex:1,minWidth:0,width:"100%"},children:te?E==="fade"?Xo():eo():E==="fade"?ft():Nt()})})})]})]})]})};function wx(e){return`
|
|
15250
15254
|
.${e}-wrapper {
|
|
15251
15255
|
position: relative;
|
|
15252
15256
|
width: 100%;
|
|
@@ -15768,7 +15772,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15768
15772
|
pointer-events: auto;
|
|
15769
15773
|
z-index: 10;
|
|
15770
15774
|
}
|
|
15771
|
-
`}const $x=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=
|
|
15775
|
+
`}const $x=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=N.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:x}=e,v=s.useRef(null),[m,g]=s.useState(!1),[h,b]=s.useState(0),E=s.useRef(!1),y=s.useRef(!1),w=s.useRef(!1),j=s.useMemo(()=>(t??[]).filter($=>Io($).length>0),[t]),G=m&&j.length>0,A=!n,P=s.useCallback(()=>{A&&(w.current=!0,Ny(y.current,c),y.current=!1)},[A,c]),W=($=0)=>{if(j.length===0||n&&!i&&!o)return;const I=oa(j,x),H=Math.max(0,Math.min($,I.length-1));if(b(H),A){const O=Iu();Lu(H+1,c,O),y.current=!O}g(!0)},Y=s.useCallback(()=>{g(!1),w.current=!1},[]);return s.useEffect(()=>{!n||i||o||g(!1)},[n,i,o]),s.useEffect(()=>{if(!A||typeof window>"u")return;const $=window.history.scrollRestoration;return window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration=$}},[A]),s.useEffect(()=>{if(!A||E.current)return;E.current=!0;const $=pc(c);if(!$)return;const I=mc($,oa(j,x).length);I<0||(b(I),g(!0))},[j,c,A,x]),s.useEffect(()=>{if(!A)return;const $=()=>{if(w.current){w.current=!1,g(!1);return}const I=pc(c);if(!I){g(!1);return}const H=mc(I,oa(j,x).length);if(H<0){g(!1);return}y.current=!1,b(H),g(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[j,c,A,x]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:v,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:wx(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${oi(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>W(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...oi(p)?{"--image-aspect-ratio":Fa(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${oi(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),G&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return si.createPortal(a.jsx(Sx,{prefix:d,entries:j,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:h,enableUrlSync:A,journalItemId:c,onBeforeClose:P,onClose:Y}),$)})()]})},Cx=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
15772
15776
|
import { createPortal } from 'react-dom';
|
|
15773
15777
|
import { CommonComponentProps } from '../props';
|
|
15774
15778
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16568,7 +16572,7 @@ export type LightboxJournalSettings = {
|
|
|
16568
16572
|
width: 32px;
|
|
16569
16573
|
height: 32px;
|
|
16570
16574
|
}
|
|
16571
|
-
`}function Nx(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 _x(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Nx(i)]));return new Map(n)}function Wx({settings:e,content:t=[],isEditor:n}){const{prefix:i}=
|
|
16575
|
+
`}function Nx(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 _x(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Nx(i)]));return new Map(n)}function Wx({settings:e,content:t=[],isEditor:n}){const{prefix:i}=N.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[x,v]=s.useState({x:0,y:0}),[m,g]=s.useState("none"),h=s.useRef({x:0,y:0}),[b,E]=s.useState(!1),[y,w]=s.useState(!1),j=s.useRef(new Map),{imageSize:G=Mx,cursor:A="system",target:P="area",position:W="random",visible:Y="all",defaultCursor:$=null,hoverCursor:I=null}=e,H=t.filter(T=>{var _;return!!((_=T==null?void 0:T.image)!=null&&_.url)}),O=s.useMemo(()=>Fx(i),[i]),C=s.useCallback((T,_,B=l)=>{if(!o)return;const ae=o.getBoundingClientRect(),ie=T-ae.left,k=_-ae.top;v({x:ie,y:k}),g(Ax(ie,k,B,o,A,P,I,$))},[o,l,A,P,I,$]);s.useEffect(()=>{const T=[...H.map(B=>B.image.url),$,I].filter(B=>!!B);if(T.length===0){j.current=new Map,w(!0);return}let _=!1;return w(!1),_x(T).then(B=>{_||(j.current=B,w(!0))}),()=>{_=!0}},[t,$,I]),s.useEffect(()=>{if(!o)return;const T=B=>{B.stopPropagation(),h.current={x:B.clientX,y:B.clientY},C(B.clientX,B.clientY)},_=()=>{b&&C(h.current.x,h.current.y)};return o.addEventListener("mousemove",T),window.addEventListener("scroll",_,!0),()=>{o.removeEventListener("mousemove",T),window.removeEventListener("scroll",_,!0)}},[o,b,C]),s.useEffect(()=>{!o||!b||C(h.current.x,h.current.y)},[l,o,b,C]),s.useEffect(()=>{b||g("none")},[b]);const L=(T,_,B,ae={})=>{var te,we;if(!((te=T==null?void 0:T.image)!=null&&te.url))return null;const ie=((we=j.current.get(T.image.url))==null?void 0:we.aspectRatio)??1,k=zc(T.image.url,G,j.current),{heightPx:ue}=ha(k,ie);let X=0,le=0;return W==="same"?{x:X,y:le}=Dc(_,B,k,ie):(X=ae.x??Math.random()*_,le=ae.y??Math.random()*B,{x:X,y:le}=Ws(X,le,_,B,k,ue)),{id:p.current++,url:T.image.url,link:T.link,name:T.image.name,x:X,y:le,xRatio:X/_,yRatio:le/B,aspectRatio:ie,widthPx:k}},D=()=>{if(!o)return;const T=o.getBoundingClientRect(),_=T.width,B=T.height;_===0||B===0||d(ae=>ae.length===0?ae:ae.map(ie=>{const k=G.sizeType==="random"?ie.widthPx:zc(ie.url,G,j.current),{heightPx:ue}=ha(k,ie.aspectRatio);if(W==="same"){const{x:te,y:we}=Dc(_,B,k,ie.aspectRatio);return{...ie,x:te,y:we,widthPx:k}}const{x:X,y:le}=Ws(ie.xRatio*_,ie.yRatio*B,_,B,k,ue);return{...ie,x:X,y:le,widthPx:k}}))};s.useEffect(()=>{if(!o||H.length===0||!y)return;const T=o.getBoundingClientRect(),_=T.width,B=T.height,ae=L(H[0],_,B);ae&&(d([ae]),u(H.length>1?1:0))},[G,W,o,t,y]),s.useEffect(()=>{if(!o)return;D();const T=new ResizeObserver(D);return T.observe(o),window.addEventListener("resize",D),()=>{T.disconnect(),window.removeEventListener("resize",D)}},[o,W,G,l.length]),s.useEffect(()=>{Y==="last One"&&d(T=>T.length>0?[T[T.length-1]]:[])},[Y]);const S=T=>{if(!o||H.length===0||!y)return;const _=o.getBoundingClientRect(),B=T.clientX-_.left,ae=T.clientY-_.top;if(P==="image"&&!qu(B,ae,l))return;let ie=0,k=0;W==="on Click"?(ie=B,k=ae):W==="same"?(ie=_.width/2,k=_.height/2):(ie=Math.random()*_.width,k=Math.random()*_.height);const ue=H[c%H.length],X=L(ue,_.width,_.height,{x:ie,y:k});if(!X)return;const le=Y==="all"?[...l,X]:[X];d(le),u(te=>(te+1)%H.length),C(T.clientX,T.clientY,le)},U=A==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),a.jsxs("div",{ref:r,onClick:S,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),className:`${i}-root`,style:{cursor:U?"none":"default"},children:[l.map(T=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${T.y}px`,left:`${T.x}px`,width:`${T.widthPx}px`,cursor:U?"none":"default"},children:P==="area"&&T.link?a.jsx("a",{href:T.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:T.url,alt:T.name,className:`${i}-image`})}):a.jsx("img",{src:T.url,alt:T.name,className:`${i}-image`})},T.id)),b&&U&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${x.x}px`,top:`${x.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Hx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16572
16576
|
import { CommonComponentProps } from '../props';
|
|
16573
16577
|
import { useScopedStyles } from '../utils/index';
|
|
16574
16578
|
|
|
@@ -17098,7 +17102,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17098
17102
|
</>
|
|
17099
17103
|
);
|
|
17100
17104
|
}
|
|
17101
|
-
`,Ox={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},Dx={element:Wx,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:Ox,sourceCode:Hx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},zx=100,Bx=70,
|
|
17105
|
+
`,Ox={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},Dx={element:Wx,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:Ox,sourceCode:Hx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},zx=100,Bx=70,mi="cubic-bezier(0.86, 0, 0.07, 1)";function jx(e){return`
|
|
17102
17106
|
.${e}-wrapper {
|
|
17103
17107
|
position: relative;
|
|
17104
17108
|
width: 100%;
|
|
@@ -17133,34 +17137,34 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17133
17137
|
}
|
|
17134
17138
|
.${e}-incoming-next {
|
|
17135
17139
|
z-index: 4;
|
|
17136
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
17140
|
+
transition: transform var(--${e}-transition-ms) ${mi};
|
|
17137
17141
|
}
|
|
17138
17142
|
.${e}-incoming-prev {
|
|
17139
17143
|
z-index: 4;
|
|
17140
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
17144
|
+
transition: transform var(--${e}-transition-ms) ${mi};
|
|
17141
17145
|
}
|
|
17142
17146
|
.${e}-outgoing {
|
|
17143
17147
|
will-change: transform;
|
|
17144
17148
|
}
|
|
17145
17149
|
.${e}-outgoing-next {
|
|
17146
17150
|
z-index: 3;
|
|
17147
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
17151
|
+
transition: transform var(--${e}-transition-ms) ${mi};
|
|
17148
17152
|
}
|
|
17149
17153
|
.${e}-outgoing-prev {
|
|
17150
17154
|
z-index: 3;
|
|
17151
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
17155
|
+
transition: transform var(--${e}-transition-ms) ${mi};
|
|
17152
17156
|
}
|
|
17153
17157
|
.${e}-outgoing-next .${e}-effect-image {
|
|
17154
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
17158
|
+
transition: filter var(--${e}-transition-ms) ${mi};
|
|
17155
17159
|
}
|
|
17156
17160
|
.${e}-outgoing-prev .${e}-effect-image {
|
|
17157
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
17161
|
+
transition: filter var(--${e}-transition-ms) ${mi};
|
|
17158
17162
|
}
|
|
17159
17163
|
.${e}-incoming .${e}-effect-image {
|
|
17160
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
17164
|
+
transition: filter var(--${e}-transition-ms) ${mi};
|
|
17161
17165
|
}
|
|
17162
17166
|
.${e}-background .${e}-effect-image {
|
|
17163
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
17167
|
+
transition: filter var(--${e}-transition-ms) ${mi};
|
|
17164
17168
|
}
|
|
17165
17169
|
.${e}-snap .${e}-incoming,
|
|
17166
17170
|
.${e}-snap .${e}-outgoing,
|
|
@@ -17208,7 +17212,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17208
17212
|
display: block;
|
|
17209
17213
|
pointer-events: none;
|
|
17210
17214
|
}
|
|
17211
|
-
`}function Vx(e){return e==="blur"?Bx:e==="greyscale"?zx:0}function Yo(e,t=1,n=1){const i=Vx(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 Bc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Gx(e,t){return t<=1?0:(e-1+t)%t}function Xx(e,t=1){return!e||e.height===0?t:e.width/e.height}function qx(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 d=r,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function jc(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 Uu(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function Vc(e,t,n){return{...Uu(e),[`--${n}-stage-scale`]:t}}function Ux(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 Yx({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ce,
|
|
17215
|
+
`}function Vx(e){return e==="blur"?Bx:e==="greyscale"?zx:0}function Yo(e,t=1,n=1){const i=Vx(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 Bc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Gx(e,t){return t<=1?0:(e-1+t)%t}function Xx(e,t=1){return!e||e.height===0?t:e.width/e.height}function qx(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 d=r,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function jc(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 Uu(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function Vc(e,t,n){return{...Uu(e),[`--${n}-stage-scale`]:t}}function Ux(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 Yx({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ce,f,q,K,ne,ge,z;const{prefix:o}=N.useScopedStyles(),r=s.useMemo(()=>jx(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,x=t??[],v=Bc(x.length),[m,g]=s.useState(v.activeIndex),[h,b]=s.useState(v.backgroundIndex),[E,y]=s.useState(!1),[w,j]=s.useState(!1),[G,A]=s.useState(null),[P,W]=s.useState(null),[Y,$]=s.useState(0),[I,H]=s.useState(1),[O,C]=s.useState("none"),[L,D]=s.useState("next"),[S,U]=s.useState({}),[T,_]=s.useState({width:0,height:0}),B=s.useRef(null),ae=s.useRef(null),ie=!n||!!i,k=l??60,ue=Math.max(10,Math.min(100,d??k)),X=Math.max(10,Math.min(100,c??k)),le=Math.max(100,u),te=Yo(p),we=s.useCallback(R=>{const Q=Xx(R?S[R]:void 0);return qx(T.width,T.height,Q,ue,X)},[T.height,T.width,S,X,ue]);s.useEffect(()=>{const R=ae.current;if(!R)return;const Q=new ResizeObserver(([ee])=>{const{width:ce,height:V}=ee.contentRect;_({width:ce,height:V})});return Q.observe(R),()=>Q.disconnect()},[]),s.useEffect(()=>{const R=(t??[]).map(Q=>{var ee;return(ee=Q.image)==null?void 0:ee.url}).filter(Q=>!!Q);Ux(R,(Q,ee)=>{U(ce=>{var V,Le;return((V=ce[Q])==null?void 0:V.width)===ee.width&&((Le=ce[Q])==null?void 0:Le.height)===ee.height?ce:{...ce,[Q]:ee}})})},[t]),s.useEffect(()=>{const{backgroundIndex:R,activeIndex:Q}=Bc(x.length);g(Q),b(R),y(!1),j(!1),A(null),W(null),$(0),H(1),C("none"),D("next")},[x.length,t]),s.useEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]);const ke=s.useCallback(R=>{var ve,J,_e,Be;if(!ie||E||x.length<=1)return;const Q=R==="next"?(m+1)%x.length:(m-1+x.length)%x.length,ee=we((J=(ve=x[m])==null?void 0:ve.image)==null?void 0:J.url),ce=we((Be=(_e=x[Q])==null?void 0:_e.image)==null?void 0:Be.url),V=jc(T.width,T.height,ee),Le=jc(T.width,T.height,ce);B.current&&clearTimeout(B.current),D(R),j(!0),y(!0),R==="next"?(A(m),W(Q),$(0),H(1),C(Yo(p,0,1))):(b(Gx(Q,x.length)),A(Q),W(m),$(1),H(Le),C(Yo(p,1,Le))),requestAnimationFrame(()=>{j(!1),requestAnimationFrame(()=>{R==="next"?($(1),H(V),C(Yo(p,1,V))):($(0),H(1),C(Yo(p,0,1)))})}),B.current=setTimeout(()=>{R==="next"&&b(m),g(Q),A(null),W(null),y(!1)},le)},[m,p,T.height,T.width,we,E,ie,x,le]),fe=x[m],me=h!==null?x[h]:null,Z=G!==null?x[G]:null,se=P!==null?x[P]:null,oe=x.length<=1?0:(m-1+x.length)%x.length,Pe=x.length<=1?0:(m+1)%x.length,$e=we((Ce=fe==null?void 0:fe.image)==null?void 0:Ce.url),Me=we((f=Z==null?void 0:Z.image)==null?void 0:f.url),ye=we((q=se==null?void 0:se.image)==null?void 0:q.url),be={[`--${o}-transition-ms`]:`${le}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:ae,className:Ct(`${o}-wrapper`,w&&`${o}-snap`,n&&!i&&`${o}-editor`),style:be,"aria-label":"Zoom gallery",children:[((K=me==null?void 0:me.image)==null?void 0:K.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:me.image.url,alt:"",style:{filter:te}})}),E&&((ne=Z==null?void 0:Z.image)==null?void 0:ne.url)&&a.jsx("div",{className:Ct(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${L}`),style:Vc(Me,I,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:Z.image.url,alt:"",style:{filter:O}})}),E&&((ge=se==null?void 0:se.image)==null?void 0:ge.url)&&a.jsx("div",{className:Ct(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${L}`),style:Vc(ye,Y,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:se.image.url,alt:""})}),!E&&((z=fe==null?void 0:fe.image)==null?void 0:z.url)&&a.jsx("div",{className:Ct(`${o}-stage`,`${o}-foreground`),style:Uu($e),children:a.jsx("img",{className:`${o}-image`,src:fe.image.url,alt:fe.image.name??""})}),ie&&x.length>1&&!E&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:Ct(`${o}-nav`,`${o}-nav-prev`),onClick:()=>ke("prev"),"aria-label":`Show previous image (${oe+1} of ${x.length})`}),a.jsx("button",{type:"button",className:Ct(`${o}-nav`,`${o}-nav-next`),onClick:()=>ke("next"),"aria-label":`Show next image (${Pe+1} of ${x.length})`})]})]})]})}const Kx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17212
17216
|
import cn from 'classnames';
|
|
17213
17217
|
import { CommonComponentProps } from '../props';
|
|
17214
17218
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -17727,7 +17731,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
17727
17731
|
</>
|
|
17728
17732
|
);
|
|
17729
17733
|
}
|
|
17730
|
-
`,Zx={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},Jx={element:Yx,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:Zx,sourceCode:Kx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Qx={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},eb=["hover","active"],ss={left:"flex-start",center:"center",right:"flex-end"};function tb(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 nb(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 ib(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}`,d=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,c=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${d}, ${c}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,
|
|
17734
|
+
`,Zx={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},Jx={element:Yx,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:Zx,sourceCode:Kx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Qx={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},eb=["hover","active"],ss={left:"flex-start",center:"center",right:"flex-end"};function tb(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 nb(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 ib(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}`,d=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,c=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${d}, ${c}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,x=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,v=`.${e}-button:hover, ${x}`,m=g=>`.${e}-hover-effect-${g}:hover, .${e}-hover-effect-${g}:focus-visible, a:focus-visible .${e}-hover-effect-${g}`;return`
|
|
17731
17735
|
.${e}-root {
|
|
17732
17736
|
line-height: 0;
|
|
17733
17737
|
}
|
|
@@ -17890,7 +17894,7 @@ a:focus-visible .${e}-hover-effect-content-roll .${e}-content-roll-layer-hover,
|
|
|
17890
17894
|
transform: translateY(-50%);
|
|
17891
17895
|
opacity: 1;
|
|
17892
17896
|
}
|
|
17893
|
-
${
|
|
17897
|
+
${v} {
|
|
17894
17898
|
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
17895
17899
|
color: var(--${e}-hover-text-color, var(--${e}-text-color));
|
|
17896
17900
|
border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
|
|
@@ -17969,7 +17973,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
17969
17973
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
17970
17974
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
17971
17975
|
}
|
|
17972
|
-
`}function ls(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 Gc(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(pn,{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 d=
|
|
17976
|
+
`}function ls(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 Gc(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(pn,{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 d=N.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"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}=N.useScopedStyles(),l=s.useMemo(()=>ib(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:x,order:v="text-icon",gap:m=0,iconSize:g=0,iconWidthC:h=0,dimensions:b=!1,padding:E={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:w={top:0,left:0,right:0,bottom:0},boxShadowColor:j="rgba(0, 0, 0, 0)",innerBoxShadow:G={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:A="rgba(0, 0, 0, 0)",stroke:P=0,blur:W=0,backgroundColor:Y="#000000",textColor:$="#ffffff",borderColor:I="#ffffff",iconColor:H="#ffffff",hoverEffect:O="none",fontFamily:C,fontSettings:L,fontSize:D,lineHeight:S,letterSpacing:U=0,wordSpacing:T=0,textAppearance:_,stateOverrides:B,minWidth:ae=0,minHeight:ie=0,width:k=0,height:ue=0}=e,X=N.buildColorVars(r,{backgroundColor:Y,textColor:$,borderColor:I,iconColor:H,boxShadowColor:j,innerBoxShadowColor:A},Qx,eb,B),le=i&&i!=="default"?`${r}-state-${i}`:"",te=t&&!n?`${r}-editing`:"",we=O!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${O}`:"",ke=O==="reveal"||O==="swipe",fe=O==="content-roll",me=O==="reveal"&&(!t||n),Z=b===!0,oe=d==="a"?x??p:p,Pe=d==="c",$e=d!=="b",Me={fontSettings:{fontFamily:C,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:D??.01,lineHeight:S,letterSpacing:U,wordSpacing:T,textAppearance:_,color:$},be={...$e?dn(Qt(Me,t)):{},[`--${r}-box-shadow-x`]:N.scalingValue(w.left,t),[`--${r}-box-shadow-y`]:N.scalingValue(w.top,t),[`--${r}-box-shadow-blur`]:N.scalingValue(w.right,t),[`--${r}-box-shadow-spread`]:N.scalingValue(w.bottom,t),[`--${r}-inner-box-shadow-x`]:N.scalingValue(G.left,t),[`--${r}-inner-box-shadow-y`]:N.scalingValue(G.top,t),[`--${r}-inner-box-shadow-blur`]:N.scalingValue(G.right,t),[`--${r}-inner-box-shadow-spread`]:N.scalingValue(G.bottom,t),[`--${r}-backdrop-blur`]:W>0?`blur(${N.scalingValue(W,t)})`:void 0,paddingTop:N.scalingValue(E.top,t),paddingRight:N.scalingValue(E.right,t),paddingBottom:N.scalingValue(E.bottom,t),paddingLeft:N.scalingValue(E.left,t),borderRadius:N.scalingValue(y,t),borderWidth:N.scalingValue(P,t),...Pe?{}:{justifyContent:ss[oe],textAlign:oe},...Pe&&!fe?{gap:N.scalingValue(m,t)}:{},...Z?{width:N.scalingValue(k,t),height:N.scalingValue(ue,t)}:{minWidth:N.scalingValue(ae,t),minHeight:N.scalingValue(ie,t),...Pe?{width:"100%"}:{}}};let Ce;const f={display:"inline-flex",alignItems:"center",justifyContent:Pe?ss[oe]:ss[d==="a"?oe:"center"],gap:Pe?N.scalingValue(m,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:oe}:{}};if(d==="b"){const ne=()=>Gc(r,u,g>0?"fixed":"fill",100,g,t);Ce=fe?ls(r,ne,`${r}-icon-roll`,void 0,f):ne()}else if(d==="c"){const ne=()=>{const ge=a.jsx("span",{className:`${r}-text`,style:{textAlign:oe},children:c}),z=Gc(r,u,h>0?"fixed":"fill",100,h,t);return v==="icon-text"?a.jsxs(a.Fragment,{children:[z,ge]}):a.jsxs(a.Fragment,{children:[ge,z]})};Ce=fe?ls(r,ne,`${r}-icon-text-roll`,void 0,f):ne()}else Ce=fe?ls(r,()=>c,`${r}-label-roll`,void 0,f):ke?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const q=me?ne=>tb(ne,r):void 0,K=me?ne=>nb(ne,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:X,children:a.jsx("div",{className:`${r}-wrapper ${le} ${te}`.trim(),children:a.jsx("div",{className:`${r}-button ${we}`.trim(),style:be,onMouseEnter:q,onMouseLeave:K,role:"button",tabIndex:o||t&&!n?void 0:0,children:Ce})})})]})}const rb=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
17973
17977
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
17974
17978
|
import { CommonComponentProps } from '../props';
|
|
17975
17979
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -18799,7 +18803,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18799
18803
|
pointer-events: auto;
|
|
18800
18804
|
flex-shrink: 0;
|
|
18801
18805
|
}
|
|
18802
|
-
`}const Wn=500,Ko=650,bn="cubic-bezier(0.22, 1, 0.36, 1)",ub=72,pb=50,mb=1e4,gb=650,hb=500;function fb(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 Yu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=pa(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 yb(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Yu(i,n):null}function vb(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function tr(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 Xc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return tr(e,i,n)}const xb=.03;function Ku(e){return e.width*xb}const cs={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function jr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function qc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function bb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Hs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function Sb(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Hs(e,t.width,t.height)}function wb(e,t){if(Na(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function $b(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function Cb({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=>Na(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function No(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Ku(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function fa(e,t,n){const i=No(e,t,n);return{...i,left:2*i.left-e.left}}function Tb(e,t,n){const{left:i,width:o}=n,r=Ku(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 Zu(e,t,n,i){const o=No(e,"left",i),r=No(e,"right",i),l=fa(e,"left",i),d=fa(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:d,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:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Lb(e,t,n,i){const{start:o,end:r}=Zu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Ib(e,t,n){const i=No(e,t,n),o=fa(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Na(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Rb({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function Vr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Na(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Pb({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:y,resolveCloseSourceRect:m,onClose:g,onPrev:f,onNext:x}){const R=s.useRef(null),b=s.useRef(null),S=s.useRef(null),G=s.useRef(new Map),[D,j]=s.useState(0),P=s.useRef(null),M=s.useRef(0),K=s.useRef(0),T=s.useRef("none"),L=s.useRef(!1),_=s.useRef(!1),z=s.useRef(!1),$=s.useRef(null),k=s.useRef(null),W=s.useRef(null),w=s.useRef(()=>{}),U=s.useRef(null),C=s.useRef(null),O=s.useRef(null),V=s.useRef(!1),[se,ie]=s.useState(null),[N,de]=s.useState(cs),[X,ce]=s.useState(0),[oe,fe]=s.useState("opening"),[Pe,xe]=s.useState(0),[pe,Z]=s.useState(0),[le,re]=s.useState(!1),[Ie,we]=s.useState(null),[Me,ye]=s.useState(null),[be,Ce]=s.useState(null),[h,q]=s.useState(!1),[Y,ee]=s.useState(null),[ve,B]=s.useState(!1),I=s.useRef(!1),[Q,ne]=s.useState(!1),[H,te]=s.useState(!1),ke=s.useRef(n),ge=s.useRef(void 0),J=t[n],Ye=J?Na(J):!1,je=pe!==0||le,it=!l&&(!r||!!d),qe=c&&!l,et=u.length>1,Je=s.useCallback((A,Te)=>t.length<=1?null:t[(A+Te+t.length)%t.length]??null,[t]),Ge=et?tr(u,p,-1):Je(n,-1),$e=et?tr(u,p,1):Je(n,1),He=Ie===-1&&je?et&&Me!==null?tr(u,Me,-1):be!==null?Je(be,-1):null:null,De=Ie===1&&je?et&&Me!==null?tr(u,Me,1):be!==null?Je(be,1):null:null,Qe=He&&He.url!==(Ge==null?void 0:Ge.url)?He:null,he=De&&De.url!==($e==null?void 0:$e.url)?De:null,_e=Ge&&qe?(()=>{const A=et?Xc(u,p,-1):t.length>2?Je((n-1+t.length)%t.length,-1):null;return A&&A.url!==Ge.url?A:null})():null,Ve=$e&&qe?(()=>{const A=et?Xc(u,p,1):t.length>2?Je((n+1)%t.length,1):null;return A&&A.url!==$e.url?A:null})():null,tt=Qe??_e,ft=he??Ve,rt=s.useCallback((A,Te,Ae)=>{if(!A||!Te||!Ae)return;const ze=G.current,mt=ze.get(A);(mt==null?void 0:mt.width)===Te&&(mt==null?void 0:mt.height)===Ae||(ze.set(A,{width:Te,height:Ae}),j(Nt=>Nt+1))},[]),Oe=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const Te=G.current.get(A.url);return Sb(b.current,Te)},[D,X]),Fe=s.useCallback(()=>{if(!J)return;const A=Oe(J);if(A){ie(A);return}const Te=b.current;Te&&ie(qc(Te))},[J,Oe]),Ee=s.useCallback(A=>{if(et){const Te=u.length;ye((p+A+Te)%Te),Ce(null);return}t.length>1&&(Ce((n+A+t.length)%t.length),ye(null))},[et,u.length,p,t.length,n]),Ze=s.useCallback(A=>{z.current=A,re(A)},[]),We=s.useCallback(()=>{$.current!==null&&(window.clearTimeout($.current),$.current=null)},[]),ot=s.useCallback(()=>{We(),$.current=window.setTimeout(()=>{We(),Ze(!1)},Ko+32)},[We,Ze]),nt=s.useCallback(()=>{const A=R.current;if(!A){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:cs.width,height:typeof window<"u"?window.innerHeight:cs.height});return}const Te=A.getBoundingClientRect();de({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),me=s.useCallback((A,Te)=>{if(je){if(Q&&!le)return`translate(${pe}px, 0px)`;if(le&&Ie!==null){const Ae=Oe(A);if(!Ae)return;const{x:ze,y:mt}=Lb(Ae,Te,Ie,N);return`translate(${ze}px, ${mt}px)`}if(le)return"translate(0px, 0px)"}},[je,Q,le,pe,Ie,N,Oe]),Ne=s.useCallback(()=>{const A=k.current;k.current=null,We(),Ze(!1),we(null),ye(null),Ce(null),Z(0),ne(!1),L.current=!1,K.current=0,T.current="none",A===-1?f():A===1&&x()},[We,Ze,f,x]),st=s.useCallback(()=>{We(),$.current=window.setTimeout(()=>{k.current!==null&&Ne()},Ko+32)},[We,Ne]),ut=s.useCallback(()=>{We(),k.current=null,Ze(!1),we(null),ye(null),Ce(null),Z(0),ne(!1),L.current=!1,K.current=0,T.current="none"},[We,Ze]),Be=s.useCallback(A=>{if(!(!qe||!se)){if(z.current){if(k.current===A){W.current=A,Ne();return}ut()}We(),Ee(A),k.current=A,we(A),Ze(!0),st()}},[qe,se,Ne,ut,We,Ee,Ze,st]);w.current=Be;const pt=s.useCallback(()=>{U.current=null,V.current=!1,C.current!==null&&(window.clearInterval(C.current),C.current=null),O.current!==null&&(window.clearTimeout(O.current),O.current=null)},[]),Tt=s.useCallback(A=>{C.current!==null&&window.clearInterval(C.current);const Te=V.current?hb:gb;C.current=window.setInterval(()=>{w.current(A)},Te)},[]),Lt=s.useCallback(A=>{U.current!==A&&(pt(),U.current=A,V.current=!1,w.current(A),Tt(A),O.current=window.setTimeout(()=>{O.current=null,U.current===A&&(V.current=!0,Tt(A))},mb))},[pt,Tt]),xt=s.useCallback(()=>{const A=b.current;if(!A)return;const Te=J==null?void 0:J.url,Ae=Te?G.current.get(Te):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){ie(Hs(A,Ae.width,Ae.height));return}const ze=S.current;if(ze&&Te&&(ze.src===Te||ze.currentSrc===Te)){const{width:Nt,height:ht}=bb(ze);if(Nt&&ht){rt(Te,Nt,ht),ie(Hs(A,Nt,ht));return}}const mt=qc(A);!mt.width||!mt.height||ie(mt)},[J==null?void 0:J.url,rt]),Et=s.useCallback(A=>{if(S.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&xt();return}A.complete&&A.naturalWidth>0&&xt()}},[xt]),Vt=s.useCallback(()=>{nt(),xt(),ce(A=>A+1)},[nt,xt]);s.useEffect(()=>{Vt();const A=b.current,Te=R.current,Ae=new ResizeObserver(()=>Vt());return A&&Ae.observe(A),Te&&Ae.observe(Te),window.addEventListener("resize",Vt),()=>{Ae.disconnect(),window.removeEventListener("resize",Vt)}},[Vt,n,v]),s.useLayoutEffect(()=>{if(!J)return;const A=S.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){xt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Fe()},[Fe,D]),s.useEffect(()=>{const A=new Set,Te=[],Ae=ze=>{!(ze!=null&&ze.url)||A.has(ze.url)||(A.add(ze.url),Te.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Te.forEach(ze=>{G.current.has(ze.url)||wb(ze,rt)})},[t,u,rt]),s.useEffect(()=>{if(oe!=="opening"||!se)return;if(!y){fe("open");return}q(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),fe("open")})});return()=>cancelAnimationFrame(A)},[oe,se,y]),s.useEffect(()=>{if(oe!=="closing")return;const A=setTimeout(()=>g(),Wn);return()=>clearTimeout(A)},[oe,g]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{ke.current===n&&ge.current===(J==null?void 0:J.url)||(We(),k.current=null,we(null),ye(null),Ce(null),xe(0),Z(0),Ze(!1),te(!1),ne(!1),M.current=0,K.current=0,T.current="none",L.current=!1,P.current=null,_.current=!1,S.current=null,Fe(),ke.current=n,ge.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Ze,We,Fe]),s.useLayoutEffect(()=>{const A=W.current;A!==null&&(W.current=null,requestAnimationFrame(()=>{w.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(oe==="opening"){I.current=!1,B(!1);return}if(oe!=="open"||I.current)return;if(!Ge&&!$e){I.current=!0;return}B(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),I.current=!0})});return()=>cancelAnimationFrame(A)},[oe,Ge==null?void 0:Ge.url,$e==null?void 0:$e.url]),s.useEffect(()=>{if(oe!=="open")return;const A=()=>{const ht=St=>{St.stopPropagation(),St.preventDefault(),document.removeEventListener("click",ht,!0)};document.addEventListener("click",ht,!0)},Te=ht=>{const St=ht<0?1:-1;We(),Ee(St),k.current=St,we(St),Ze(!0),st()},Ae=ht=>{if(Math.abs(ht)>pb&&qe){Te(ht);return}k.current=null,we(null),ye(null),Ce(null),Ze(!0),Z(0),ot()},ze=ht=>{if(ht.touches.length!==1||z.current)return;const St=ht.touches[0];_.current=!0,P.current={x:St.clientX,y:St.clientY},T.current="none",K.current=0,L.current=!1},mt=ht=>{if(!P.current||ht.touches.length!==1||z.current)return;const St=ht.touches[0],qt=St.clientX-P.current.x,At=St.clientY-P.current.y;if(T.current==="none"){if(Math.abs(qt)<10&&Math.abs(At)<10)return;if(Math.abs(qt)>Math.abs(At)){if(!qe)return;T.current="horizontal"}else if(At>0){if(!it)return;T.current="vertical"}else return}if(T.current==="horizontal"){L.current=!0,ne(!0),K.current=qt,Z(qt),ht.preventDefault();return}T.current==="vertical"&&(L.current=!0,ne(!0),M.current=At,xe(At),ht.preventDefault())},Nt=()=>{if(!P.current)return;const ht=T.current,St=L.current;if(St&&ht==="horizontal")Ae(K.current),A();else if(St&&ht==="vertical"){const qt=M.current;if(it&&qt>ub){const At=window.innerHeight;M.current=At,te(!0),xe(At),fe("closing")}else M.current=0,xe(0);A()}else ht==="horizontal"&&Math.abs(K.current)>0&&(Ae(K.current),A());P.current=null,T.current="none",K.current=0,L.current=!1,ne(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",mt,{passive:!1}),document.addEventListener("touchend",Nt),document.addEventListener("touchcancel",Nt),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",mt),document.removeEventListener("touchend",Nt),document.removeEventListener("touchcancel",Nt)}},[oe,qe,Ze,ot,We,it,st,Ee]);const Ut=s.useCallback(()=>{const A=(m==null?void 0:m())??y??null;A&&se&&(ee(A),q(!0)),fe("closing")},[m,y,se]);s.useEffect(()=>{const A=ze=>{if(ze.key==="Escape"){if(r&&d||oe==="closing")return;pt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||oe!=="open"||!qe)return;ze.preventDefault();const mt=ze.key==="ArrowLeft"?-1:1;ze.repeat&&U.current===mt||Lt(mt)},Te=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const mt=ze.key==="ArrowLeft"?-1:1;U.current===mt&&pt()},Ae=()=>{pt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",Te),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",Te),window.removeEventListener("blur",Ae),pt()}},[oe,r,d,Ut,qe,Lt,pt]),s.useEffect(()=>{oe!=="open"&&pt()},[oe,pt]);const Kt=()=>{oe==="closing"||l||Ut()},Pt=oe==="open",jt=oe==="closing",on=Pe>0?Math.max(0,1-Pe/500):1,vt=Pe>0?Math.max(.35,1-Pe/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!z.current)){if(k.current!==null){Ne();return}We(),Ze(!1)}},[We,Ze,Ne]),Xe=oe==="closing"?Y??y:y,lt=Xe&&se&&(oe==="opening"||jt)?fb(Xe,se):void 0,ct=je&&J?me(J,"center"):Pe>0?`translateY(${Pe}px)`:lt,wt=se?jr(se,N):null,It=!!(Xe&&se),gt=It&&(oe==="closing"||oe==="open"&&h),Ot={position:"absolute",top:wt==null?void 0:wt.top,left:wt==null?void 0:wt.left,width:wt==null?void 0:wt.width,height:wt==null?void 0:wt.height,objectFit:"contain",transformOrigin:"top left",transform:ct,opacity:Pe>0?vt:It?1:oe==="opening"||jt?0:1,transition:Q&&!le?"none":le?`transform ${Ko}ms ${bn}`:H?`transform ${Wn}ms ${bn}, opacity ${Wn}ms ${bn}`:gt?`transform ${Wn}ms ${bn}`:oe==="opening"||jt?`opacity ${Wn}ms ${bn}`:"none",pointerEvents:Ye&&Pt&&!je?"auto":"none",touchAction:Ye&&Pt?"none":void 0,zIndex:1,overflow:Ye?"hidden":void 0},_t={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Pt&&!je?"auto":"none"},Mt=(A,Te,Ae="adjacent")=>{const ze=Oe(A);if(!ze)return{display:"none"};const mt=Ae==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:Nt}=Ie!==null?Zu(ze,mt,Ie,N):{start:Ae==="far"?fa(ze,Te,N):No(ze,Te,N)},ht=jr(Nt,N),St=me(A,mt),qt=!je&&Ae==="adjacent"&&Pt&&!ve?Ib(ze,Te,N):null,At=Ae==="far"&&je&&Ie===(Te==="left"?-1:1),sn=Q&&!le?!1:le,gn=Ae==="adjacent"&&Pt&&ve&&!je;return{position:"absolute",top:ht.top,left:ht.left,width:ht.width,height:ht.height,objectFit:"contain",transform:St??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:Ae==="far"?Pt&&At?1:0:Pt?1:0,transition:sn?Ae==="far"?`transform ${Ko}ms ${bn}`:`transform ${Ko}ms ${bn}, opacity ${Wn}ms ${bn}`:gn?`transform ${Wn}ms ${bn}`:oe==="opening"||jt?`opacity ${Wn}ms ${bn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(A,Te)=>{const Ae=Oe(A);return Ae?Tb(No(Ae,Te,N),Te,N):null},Xt=A=>Te=>{if(!l){if(_.current){_.current=!1;return}Te.stopPropagation(),Be(A)}},Dt=Ge?Gt(Ge,"left"):null,zt=$e?Gt($e,"right"):null,Bt=Dt?jr(Dt,N):null,bt=zt?jr(zt,N):null;return a.jsxs("div",{ref:R,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:oe==="open"?"none":void 0},onClick:Kt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Pt?on:0,transition:Q?"none":`opacity ${Wn}ms ${bn}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Pt?1:0,transition:Q?"none":`opacity ${Wn}ms ${bn}`,pointerEvents:"none"},children:a.jsx(Eu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Kt})})]}),Pt&&tt&&a.jsx(Vr,{media:tt,style:Mt(tt,"left","far"),onMeasure:rt,onTransitionEnd:Le},`far-prev-${tt.url}`),Pt&&Ge&&a.jsxs(a.Fragment,{children:[a.jsx(Vr,{media:Ge,style:Mt(Ge,"left"),onMeasure:rt,onTransitionEnd:Le},`prev-${Ge.url}`),Bt&&a.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Pt&&$e&&a.jsxs(a.Fragment,{children:[a.jsx(Vr,{media:$e,style:Mt($e,"right"),onMeasure:rt,onTransitionEnd:Le},`next-${$e.url}`),bt&&a.jsx("div",{style:{position:"absolute",top:bt.top,left:bt.left,width:bt.width,height:bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Pt&&ft&&a.jsx(Vr,{media:ft,style:Mt(ft,"right","far"),onMeasure:rt,onTransitionEnd:Le},`far-next-${ft.url}`),se&&J&&(Ye?a.jsx(Rb,{src:J.url,phase:oe,onMediaElement:Et,wrapperStyle:Ot,videoStyle:_t,onLoadedMetadata:xt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Et,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Le,style:Ot},`${n}-${J.url}`))]})}const kb=20,Eb=.18;function Mb(e){return`
|
|
18806
|
+
`}const Wn=500,Ko=650,bn="cubic-bezier(0.22, 1, 0.36, 1)",ub=72,pb=50,mb=1e4,gb=650,hb=500;function fb(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 Yu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=pa(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 yb(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Yu(i,n):null}function vb(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function tr(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 Xc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return tr(e,i,n)}const xb=.03;function Ku(e){return e.width*xb}const cs={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function jr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function qc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function bb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Hs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function Sb(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Hs(e,t.width,t.height)}function wb(e,t){if(Na(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function $b(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function Cb({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=>Na(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function No(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Ku(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function fa(e,t,n){const i=No(e,t,n);return{...i,left:2*i.left-e.left}}function Tb(e,t,n){const{left:i,width:o}=n,r=Ku(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 Zu(e,t,n,i){const o=No(e,"left",i),r=No(e,"right",i),l=fa(e,"left",i),d=fa(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:d,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:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Lb(e,t,n,i){const{start:o,end:r}=Zu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Ib(e,t,n){const i=No(e,t,n),o=fa(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Na(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Rb({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function Vr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Na(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Pb({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:v,resolveCloseSourceRect:m,onClose:g,onPrev:h,onNext:b}){const E=s.useRef(null),y=s.useRef(null),w=s.useRef(null),j=s.useRef(new Map),[G,A]=s.useState(0),P=s.useRef(null),W=s.useRef(0),Y=s.useRef(0),$=s.useRef("none"),I=s.useRef(!1),H=s.useRef(!1),O=s.useRef(!1),C=s.useRef(null),L=s.useRef(null),D=s.useRef(null),S=s.useRef(()=>{}),U=s.useRef(null),T=s.useRef(null),_=s.useRef(null),B=s.useRef(!1),[ae,ie]=s.useState(null),[k,ue]=s.useState(cs),[X,le]=s.useState(0),[te,we]=s.useState("opening"),[ke,fe]=s.useState(0),[me,Z]=s.useState(0),[se,oe]=s.useState(!1),[Pe,$e]=s.useState(null),[Me,ye]=s.useState(null),[be,Ce]=s.useState(null),[f,q]=s.useState(!1),[K,ne]=s.useState(null),[ge,z]=s.useState(!1),R=s.useRef(!1),[Q,ee]=s.useState(!1),[ce,V]=s.useState(!1),Le=s.useRef(n),ve=s.useRef(void 0),J=t[n],_e=J?Na(J):!1,Be=me!==0||se,at=!l&&(!r||!!d),Ue=c&&!l,et=u.length>1,Je=s.useCallback((F,Te)=>t.length<=1?null:t[(F+Te+t.length)%t.length]??null,[t]),Ye=et?tr(u,p,-1):Je(n,-1),xe=et?tr(u,p,1):Je(n,1),We=Pe===-1&&Be?et&&Me!==null?tr(u,Me,-1):be!==null?Je(be,-1):null:null,He=Pe===1&&Be?et&&Me!==null?tr(u,Me,1):be!==null?Je(be,1):null:null,Qe=We&&We.url!==(Ye==null?void 0:Ye.url)?We:null,he=He&&He.url!==(xe==null?void 0:xe.url)?He:null,Ne=Ye&&Ue?(()=>{const F=et?Xc(u,p,-1):t.length>2?Je((n-1+t.length)%t.length,-1):null;return F&&F.url!==Ye.url?F:null})():null,Ve=xe&&Ue?(()=>{const F=et?Xc(u,p,1):t.length>2?Je((n+1)%t.length,1):null;return F&&F.url!==xe.url?F:null})():null,tt=Qe??Ne,mt=he??Ve,st=s.useCallback((F,Te,Ae)=>{if(!F||!Te||!Ae)return;const ze=j.current,gt=ze.get(F);(gt==null?void 0:gt.width)===Te&&(gt==null?void 0:gt.height)===Ae||(ze.set(F,{width:Te,height:Ae}),A(Nt=>Nt+1))},[]),De=s.useCallback(F=>{if(!(F!=null&&F.url))return null;const Te=j.current.get(F.url);return Sb(y.current,Te)},[G,X]),Fe=s.useCallback(()=>{if(!J)return;const F=De(J);if(F){ie(F);return}const Te=y.current;Te&&ie(qc(Te))},[J,De]),Xe=s.useCallback(F=>{if(et){const Te=u.length;ye((p+F+Te)%Te),Ce(null);return}t.length>1&&(Ce((n+F+t.length)%t.length),ye(null))},[et,u.length,p,t.length,n]),ot=s.useCallback(F=>{O.current=F,oe(F)},[]),Oe=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),qe=s.useCallback(()=>{Oe(),C.current=window.setTimeout(()=>{Oe(),ot(!1)},Ko+32)},[Oe,ot]),nt=s.useCallback(()=>{const F=E.current;if(!F){ue({left:0,top:0,width:typeof window<"u"?window.innerWidth:cs.width,height:typeof window<"u"?window.innerHeight:cs.height});return}const Te=F.getBoundingClientRect();ue({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),de=s.useCallback((F,Te)=>{if(Be){if(Q&&!se)return`translate(${me}px, 0px)`;if(se&&Pe!==null){const Ae=De(F);if(!Ae)return;const{x:ze,y:gt}=Lb(Ae,Te,Pe,k);return`translate(${ze}px, ${gt}px)`}if(se)return"translate(0px, 0px)"}},[Be,Q,se,me,Pe,k,De]),Ie=s.useCallback(()=>{const F=L.current;L.current=null,Oe(),ot(!1),$e(null),ye(null),Ce(null),Z(0),ee(!1),I.current=!1,Y.current=0,$.current="none",F===-1?h():F===1&&b()},[Oe,ot,h,b]),it=s.useCallback(()=>{Oe(),C.current=window.setTimeout(()=>{L.current!==null&&Ie()},Ko+32)},[Oe,Ie]),ut=s.useCallback(()=>{Oe(),L.current=null,ot(!1),$e(null),ye(null),Ce(null),Z(0),ee(!1),I.current=!1,Y.current=0,$.current="none"},[Oe,ot]),je=s.useCallback(F=>{if(!(!Ue||!ae)){if(O.current){if(L.current===F){D.current=F,Ie();return}ut()}Oe(),Xe(F),L.current=F,$e(F),ot(!0),it()}},[Ue,ae,Ie,ut,Oe,Xe,ot,it]);S.current=je;const pt=s.useCallback(()=>{U.current=null,B.current=!1,T.current!==null&&(window.clearInterval(T.current),T.current=null),_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),Tt=s.useCallback(F=>{T.current!==null&&window.clearInterval(T.current);const Te=B.current?hb:gb;T.current=window.setInterval(()=>{S.current(F)},Te)},[]),Lt=s.useCallback(F=>{U.current!==F&&(pt(),U.current=F,B.current=!1,S.current(F),Tt(F),_.current=window.setTimeout(()=>{_.current=null,U.current===F&&(B.current=!0,Tt(F))},mb))},[pt,Tt]),xt=s.useCallback(()=>{const F=y.current;if(!F)return;const Te=J==null?void 0:J.url,Ae=Te?j.current.get(Te):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){ie(Hs(F,Ae.width,Ae.height));return}const ze=w.current;if(ze&&Te&&(ze.src===Te||ze.currentSrc===Te)){const{width:Nt,height:ft}=bb(ze);if(Nt&&ft){st(Te,Nt,ft),ie(Hs(F,Nt,ft));return}}const gt=qc(F);!gt.width||!gt.height||ie(gt)},[J==null?void 0:J.url,st]),Et=s.useCallback(F=>{if(w.current=F,!!F){if(F instanceof HTMLVideoElement){F.readyState>=1&&F.videoWidth>0&&xt();return}F.complete&&F.naturalWidth>0&&xt()}},[xt]),Vt=s.useCallback(()=>{nt(),xt(),le(F=>F+1)},[nt,xt]);s.useEffect(()=>{Vt();const F=y.current,Te=E.current,Ae=new ResizeObserver(()=>Vt());return F&&Ae.observe(F),Te&&Ae.observe(Te),window.addEventListener("resize",Vt),()=>{Ae.disconnect(),window.removeEventListener("resize",Vt)}},[Vt,n,x]),s.useLayoutEffect(()=>{if(!J)return;const F=w.current;if(F){if(F instanceof HTMLImageElement&&F.complete&&F.naturalWidth>0){xt();return}F instanceof HTMLVideoElement&&F.readyState>=1&&F.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Fe()},[Fe,G]),s.useEffect(()=>{const F=new Set,Te=[],Ae=ze=>{!(ze!=null&&ze.url)||F.has(ze.url)||(F.add(ze.url),Te.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Te.forEach(ze=>{j.current.has(ze.url)||wb(ze,st)})},[t,u,st]),s.useEffect(()=>{if(te!=="opening"||!ae)return;if(!v){we("open");return}q(!1);const F=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),we("open")})});return()=>cancelAnimationFrame(F)},[te,ae,v]),s.useEffect(()=>{if(te!=="closing")return;const F=setTimeout(()=>g(),Wn);return()=>clearTimeout(F)},[te,g]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{Le.current===n&&ve.current===(J==null?void 0:J.url)||(Oe(),L.current=null,$e(null),ye(null),Ce(null),fe(0),Z(0),ot(!1),V(!1),ee(!1),W.current=0,Y.current=0,$.current="none",I.current=!1,P.current=null,H.current=!1,w.current=null,Fe(),Le.current=n,ve.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,ot,Oe,Fe]),s.useLayoutEffect(()=>{const F=D.current;F!==null&&(D.current=null,requestAnimationFrame(()=>{S.current(F)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(te==="opening"){R.current=!1,z(!1);return}if(te!=="open"||R.current)return;if(!Ye&&!xe){R.current=!0;return}z(!1);const F=requestAnimationFrame(()=>{requestAnimationFrame(()=>{z(!0),R.current=!0})});return()=>cancelAnimationFrame(F)},[te,Ye==null?void 0:Ye.url,xe==null?void 0:xe.url]),s.useEffect(()=>{if(te!=="open")return;const F=()=>{const ft=St=>{St.stopPropagation(),St.preventDefault(),document.removeEventListener("click",ft,!0)};document.addEventListener("click",ft,!0)},Te=ft=>{const St=ft<0?1:-1;Oe(),Xe(St),L.current=St,$e(St),ot(!0),it()},Ae=ft=>{if(Math.abs(ft)>pb&&Ue){Te(ft);return}L.current=null,$e(null),ye(null),Ce(null),ot(!0),Z(0),qe()},ze=ft=>{if(ft.touches.length!==1||O.current)return;const St=ft.touches[0];H.current=!0,P.current={x:St.clientX,y:St.clientY},$.current="none",Y.current=0,I.current=!1},gt=ft=>{if(!P.current||ft.touches.length!==1||O.current)return;const St=ft.touches[0],qt=St.clientX-P.current.x,At=St.clientY-P.current.y;if($.current==="none"){if(Math.abs(qt)<10&&Math.abs(At)<10)return;if(Math.abs(qt)>Math.abs(At)){if(!Ue)return;$.current="horizontal"}else if(At>0){if(!at)return;$.current="vertical"}else return}if($.current==="horizontal"){I.current=!0,ee(!0),Y.current=qt,Z(qt),ft.preventDefault();return}$.current==="vertical"&&(I.current=!0,ee(!0),W.current=At,fe(At),ft.preventDefault())},Nt=()=>{if(!P.current)return;const ft=$.current,St=I.current;if(St&&ft==="horizontal")Ae(Y.current),F();else if(St&&ft==="vertical"){const qt=W.current;if(at&&qt>ub){const At=window.innerHeight;W.current=At,V(!0),fe(At),we("closing")}else W.current=0,fe(0);F()}else ft==="horizontal"&&Math.abs(Y.current)>0&&(Ae(Y.current),F());P.current=null,$.current="none",Y.current=0,I.current=!1,ee(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",gt,{passive:!1}),document.addEventListener("touchend",Nt),document.addEventListener("touchcancel",Nt),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",gt),document.removeEventListener("touchend",Nt),document.removeEventListener("touchcancel",Nt)}},[te,Ue,ot,qe,Oe,at,it,Xe]);const Ut=s.useCallback(()=>{const F=(m==null?void 0:m())??v??null;F&&ae&&(ne(F),q(!0)),we("closing")},[m,v,ae]);s.useEffect(()=>{const F=ze=>{if(ze.key==="Escape"){if(r&&d||te==="closing")return;pt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||te!=="open"||!Ue)return;ze.preventDefault();const gt=ze.key==="ArrowLeft"?-1:1;ze.repeat&&U.current===gt||Lt(gt)},Te=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const gt=ze.key==="ArrowLeft"?-1:1;U.current===gt&&pt()},Ae=()=>{pt()};return window.addEventListener("keydown",F),window.addEventListener("keyup",Te),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",F),window.removeEventListener("keyup",Te),window.removeEventListener("blur",Ae),pt()}},[te,r,d,Ut,Ue,Lt,pt]),s.useEffect(()=>{te!=="open"&&pt()},[te,pt]);const Kt=()=>{te==="closing"||l||Ut()},Pt=te==="open",jt=te==="closing",on=ke>0?Math.max(0,1-ke/500):1,vt=ke>0?Math.max(.35,1-ke/500):1,Re=s.useCallback(F=>{if(!(F.propertyName!=="transform"||!O.current)){if(L.current!==null){Ie();return}Oe(),ot(!1)}},[Oe,ot,Ie]),Ge=te==="closing"?K??v:v,lt=Ge&&ae&&(te==="opening"||jt)?fb(Ge,ae):void 0,ct=Be&&J?de(J,"center"):ke>0?`translateY(${ke}px)`:lt,wt=ae?jr(ae,k):null,It=!!(Ge&&ae),ht=It&&(te==="closing"||te==="open"&&f),Ot={position:"absolute",top:wt==null?void 0:wt.top,left:wt==null?void 0:wt.left,width:wt==null?void 0:wt.width,height:wt==null?void 0:wt.height,objectFit:"contain",transformOrigin:"top left",transform:ct,opacity:ke>0?vt:It?1:te==="opening"||jt?0:1,transition:Q&&!se?"none":se?`transform ${Ko}ms ${bn}`:ce?`transform ${Wn}ms ${bn}, opacity ${Wn}ms ${bn}`:ht?`transform ${Wn}ms ${bn}`:te==="opening"||jt?`opacity ${Wn}ms ${bn}`:"none",pointerEvents:_e&&Pt&&!Be?"auto":"none",touchAction:_e&&Pt?"none":void 0,zIndex:1,overflow:_e?"hidden":void 0},_t={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Pt&&!Be?"auto":"none"},Mt=(F,Te,Ae="adjacent")=>{const ze=De(F);if(!ze)return{display:"none"};const gt=Ae==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:Nt}=Pe!==null?Zu(ze,gt,Pe,k):{start:Ae==="far"?fa(ze,Te,k):No(ze,Te,k)},ft=jr(Nt,k),St=de(F,gt),qt=!Be&&Ae==="adjacent"&&Pt&&!ge?Ib(ze,Te,k):null,At=Ae==="far"&&Be&&Pe===(Te==="left"?-1:1),sn=Q&&!se?!1:se,gn=Ae==="adjacent"&&Pt&&ge&&!Be;return{position:"absolute",top:ft.top,left:ft.left,width:ft.width,height:ft.height,objectFit:"contain",transform:St??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:Ae==="far"?Pt&&At?1:0:Pt?1:0,transition:sn?Ae==="far"?`transform ${Ko}ms ${bn}`:`transform ${Ko}ms ${bn}, opacity ${Wn}ms ${bn}`:gn?`transform ${Wn}ms ${bn}`:te==="opening"||jt?`opacity ${Wn}ms ${bn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(F,Te)=>{const Ae=De(F);return Ae?Tb(No(Ae,Te,k),Te,k):null},Xt=F=>Te=>{if(!l){if(H.current){H.current=!1;return}Te.stopPropagation(),je(F)}},Dt=Ye?Gt(Ye,"left"):null,zt=xe?Gt(xe,"right"):null,Bt=Dt?jr(Dt,k):null,bt=zt?jr(zt,k):null;return a.jsxs("div",{ref:E,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:te==="open"?"none":void 0},onClick:Kt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Pt?on:0,transition:Q?"none":`opacity ${Wn}ms ${bn}`,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:Pt?1:0,transition:Q?"none":`opacity ${Wn}ms ${bn}`,pointerEvents:"none"},children:a.jsx(Eu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Kt})})]}),Pt&&tt&&a.jsx(Vr,{media:tt,style:Mt(tt,"left","far"),onMeasure:st,onTransitionEnd:Re},`far-prev-${tt.url}`),Pt&&Ye&&a.jsxs(a.Fragment,{children:[a.jsx(Vr,{media:Ye,style:Mt(Ye,"left"),onMeasure:st,onTransitionEnd:Re},`prev-${Ye.url}`),Bt&&a.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Pt&&xe&&a.jsxs(a.Fragment,{children:[a.jsx(Vr,{media:xe,style:Mt(xe,"right"),onMeasure:st,onTransitionEnd:Re},`next-${xe.url}`),bt&&a.jsx("div",{style:{position:"absolute",top:bt.top,left:bt.left,width:bt.width,height:bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Pt&&mt&&a.jsx(Vr,{media:mt,style:Mt(mt,"right","far"),onMeasure:st,onTransitionEnd:Re},`far-next-${mt.url}`),ae&&J&&(_e?a.jsx(Rb,{src:J.url,phase:te,onMediaElement:Et,wrapperStyle:Ot,videoStyle:_t,onLoadedMetadata:xt,onTransitionEnd:Re},`${n}-${J.url}`):a.jsx("img",{ref:Et,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Re,style:Ot},`${n}-${J.url}`))]})}const kb=20,Eb=.18;function Mb(e){return`
|
|
18803
18807
|
.${e}-wrapper {
|
|
18804
18808
|
box-sizing: border-box;
|
|
18805
18809
|
max-width: 100%;
|
|
@@ -18887,7 +18891,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18887
18891
|
pointer-events: auto;
|
|
18888
18892
|
}
|
|
18889
18893
|
${db(e)}
|
|
18890
|
-
`}function Ab(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,d=i?o:r;return d>0?l/d:1}function Fb(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 Nb(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:
|
|
18894
|
+
`}function Ab(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,d=i?o:r;return d>0?l/d:1}function Fb(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 Nb(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:N.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:N.scalingValue(i*Eb,n??!1),[`--${t}-image-aspect`]:Ab(e)}}function _b(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 Qt(n,t)}function Wb(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 Hb(e,t,n,i,o,r){if(!(!e||!t))return l=>{var c;const d=((c=l.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);r(n,d?Yu(d,o):void 0)}}function Ob({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=N.useScopedStyles(),c=s.useMemo(()=>Mb(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",x=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,v=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=N.scalingValue(v,n??!1),g=`max(${m}, ${kb}px)`,{objectFitMode:h,imageStyle:b}=Wb(e),E=_b(e,n),y=s.useRef(null),[w,j]=s.useState(!1),[G,A]=s.useState([]),[P,W]=s.useState(0),[Y,$]=s.useState(0),[I,H]=s.useState(null),[O,C]=s.useState({title1:"",title2:"",title3:""}),L=(!n||i)&&!w,D=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},S=D.sizeType??"none",U=L&&S!=="none"?`${d}-item-image-hover-${S}`:void 0,T=(D.value??120)/100,_=s.useCallback(me=>{!me||S!=="scale"||(me.style.transformOrigin=Nh(me))},[S]),B=s.useCallback(me=>{if(me){if(h==="contain"){const Z=Fb(me);if(Z){const se=me.closest(`.${d}-item-image`);se instanceof HTMLElement&&se.style.setProperty(`--${d}-item-media-aspect`,String(Z))}}_(me)}},[d,_,h]),ae={width:N.scalingValue(x,n??!1),...E,...Nb(e,d,n),[`--${d}-image-hover-scale`]:String(T)},ie=(()=>{const me={},Z=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return Z&&(me["--cntrl-article-width"]=Z),me})(),k=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),ue=s.useMemo(()=>vb(u),[u]),X=s.useMemo(()=>$b(u),[u]),le=(me,Z)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const se=ue.findIndex(Pe=>Pe.gridIndex===me);if(se<0)return;const oe=ue[se];$(se),A(oe.items),W(0),C(oe.entry),H(Z??null),j(!0)},te=s.useCallback(()=>{j(!1),H(null)},[]),we=s.useCallback(()=>{const me=ue[Y];return!me||!y.current?I:yb(y.current,me.gridIndex,h)??I},[ue,Y,I,h]),ke=s.useCallback(me=>{if(ue.length>1){const Z=ue.length,se=(Y+me+Z)%Z,oe=ue[se];$(se),A(oe.items),W(0),C(oe.entry);return}W(Z=>(Z+me+G.length)%G.length)},[ue,Y,G.length]),fe=ue.length>1||G.length>1;return s.useEffect(()=>{if(!w||typeof document>"u")return;const me=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=me}},[w]),s.useEffect(()=>{!n||o||i||j(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&j(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(Cb,{mediaList:X}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:ae,children:u.map((me,Z)=>{var Pe,$e;const se=!!((Pe=me.image)!=null&&Pe.url),oe=Hb(!!k,se,Z,d,h,le);return a.jsxs("div",{className:`${d}-item`,children:[me.title?a.jsx("span",{className:`${d}-item-title`,onClick:oe,style:oe?{cursor:"pointer"}:void 0,children:me.title}):null,($e=me.image)!=null&&$e.url?a.jsx("span",{className:[`${d}-item-image`,h==="contain"?`${d}-item-image-fit`:void 0,U].filter(Boolean).join(" "),children:me.image.type==="video"?a.jsx("video",{ref:B,src:me.image.url,"data-waterfall-index":Z,style:b,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:oe,onLoadedData:Me=>B(Me.currentTarget)}):a.jsx("img",{ref:B,src:me.image.url,alt:me.image.name??"","data-waterfall-index":Z,style:b,onClick:oe,onLoad:Me=>B(Me.currentTarget)})}):null,Z<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:m},children:o&&!w&&a.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:g,height:"100%"}})})]},Z)})}),w&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const me=(l?document.getElementById(l):null)??document.body;return si.createPortal(a.jsx("div",{style:ie,"data-selection":"none",children:a.jsx(Pb,{prefix:d,items:G,index:P,entry:O,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:fe,lightboxEntries:ue,entryIdx:Y,layoutId:r,sourceRect:I,resolveCloseSourceRect:we,onClose:te,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),me)})()]})}const Db=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18891
18895
|
import type React from 'react';
|
|
18892
18896
|
import { createPortal } from 'react-dom';
|
|
18893
18897
|
import { CommonComponentProps } from '../props';
|
|
@@ -19401,7 +19405,7 @@ export function Waterfall({
|
|
|
19401
19405
|
</>
|
|
19402
19406
|
);
|
|
19403
19407
|
}
|
|
19404
|
-
`,zb="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),gi={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 Bb(e){const t={};return t[yt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[yt(e,"fontSettings")]={...gi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[yt(e,"fontSize")]={...gi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[yt(e,"lineHeight")]={...gi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[yt(e,"letterSpacing")]={...gi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[yt(e,"wordSpacing")]={...gi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[yt(e,"textAlign")]={...gi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[yt(e,"textAppearance")]={...gi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const _o=Ci.filter(e=>e!=="count"),jb=_o.reduce((e,t)=>({...e,...Bb(t)}),{}),Vb=_o.reduce((e,t)=>({...e,[yt(t,"fontFamily")]:"Arial",[yt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[yt(t,"letterSpacing")]:0,[yt(t,"wordSpacing")]:0,[yt(t,"textAlign")]:"left",[yt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ds(e){return _o.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[yt(n,"fontSize")]=i),o!==void 0&&(t[yt(n,"lineHeight")]=o),t},{})}const Gb={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(_o.map(e=>[$l[e],Cl(e)]))},Gr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},Xb=[{title:"Salton Sea from Above",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],qb={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}},required:["image"]},default:Xb},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:{...gi.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"]}}},...jb},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:zb,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...Vb},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,...ds({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,...ds({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,...ds({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:[Gb]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},Ub={element:Ob,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},..._o.map(e=>({path:`${yt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",..._o.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${yt(t,"fontFamily")}`}),{})},schema:qb,sourceCode:Db},wo=500,Ju="cubic-bezier(0.25, 1, 0.5, 1)",Yb=300,Kb=5,Zb=.15,Jb=.4,Qb=100,ro=100,Uc={color:"#000000",hover:"#cccccc"},Zo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},eS={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}},us={offset:{x:0,y:0},linkColor:"#cccccc"},Yc={sizeType:"drag",value:3},tS="left";function nS(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:tS,color:(e==null?void 0:e.titleColor)??"#000000"};return Qt(n,t)}function ao(e,t,n){return`${e}: ${F.scalingValue(t/1440,n)};`}function nr(e,t){return t<=0?0:(e%t+t)%t}function iS(e,t,n,i){if(!i)return{position:nr(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 rS(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 y=n.getBoundingClientRect();return{x:y.left,y:y.top}},o=i(0,0),r=i(ro,0),l=i(0,ro);e.removeChild(n);const d={x:(r.x-o.x)/ro,y:(r.y-o.y)/ro},c={x:(l.x-o.x)/ro,y:(l.y-o.y)/ro},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function aS(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 sS(e,t){return`
|
|
19408
|
+
`,zb="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),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 Bb(e){const t={};return t[yt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[yt(e,"fontSettings")]={...hi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[yt(e,"fontSize")]={...hi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[yt(e,"lineHeight")]={...hi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[yt(e,"letterSpacing")]={...hi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[yt(e,"wordSpacing")]={...hi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[yt(e,"textAlign")]={...hi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[yt(e,"textAppearance")]={...hi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const _o=Ci.filter(e=>e!=="count"),jb=_o.reduce((e,t)=>({...e,...Bb(t)}),{}),Vb=_o.reduce((e,t)=>({...e,[yt(t,"fontFamily")]:"Arial",[yt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[yt(t,"letterSpacing")]:0,[yt(t,"wordSpacing")]:0,[yt(t,"textAlign")]:"left",[yt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ds(e){return _o.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[yt(n,"fontSize")]=i),o!==void 0&&(t[yt(n,"lineHeight")]=o),t},{})}const Gb={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(_o.map(e=>[$l[e],Cl(e)]))},Gr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},Xb=[{title:"Salton Sea from Above",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],qb={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}},required:["image"]},default:Xb},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:{...hi.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"]}}},...jb},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:zb,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...Vb},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,...ds({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,...ds({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,...ds({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:[Gb]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},Ub={element:Ob,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},..._o.map(e=>({path:`${yt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",..._o.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${yt(t,"fontFamily")}`}),{})},schema:qb,sourceCode:Db},wo=500,Ju="cubic-bezier(0.25, 1, 0.5, 1)",Yb=300,Kb=5,Zb=.15,Jb=.4,Qb=100,ro=100,Uc={color:"#000000",hover:"#cccccc"},Zo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},eS={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}},us={offset:{x:0,y:0},linkColor:"#cccccc"},Yc={sizeType:"drag",value:3},tS="left";function nS(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:tS,color:(e==null?void 0:e.titleColor)??"#000000"};return Qt(n,t)}function ao(e,t,n){return`${e}: ${N.scalingValue(t/1440,n)};`}function nr(e,t){return t<=0?0:(e%t+t)%t}function iS(e,t,n,i){if(!i)return{position:nr(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 rS(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,x)=>{n.style.transform=`translate(${p}px, ${x}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 d={x:(r.x-o.x)/ro,y:(r.y-o.y)/ro},c={x:(l.x-o.x)/ro,y:(l.y-o.y)/ro},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function aS(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 sS(e,t){return`
|
|
19405
19409
|
.${e}-wrapper {
|
|
19406
19410
|
position: relative;
|
|
19407
19411
|
width: 100%;
|
|
@@ -19671,7 +19675,7 @@ export function Waterfall({
|
|
|
19671
19675
|
from { clip-path: inset(100% 0 0 0); }
|
|
19672
19676
|
to { clip-path: inset(0 0 0 0); }
|
|
19673
19677
|
}
|
|
19674
|
-
`}function lS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=F.useScopedStyles(),l=nS(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??Yc,p=u.sizeType??"drag",v=u.value??Yc.value,y=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",x=eS[f],R=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,b=$e=>F.scalingValue($e*R,n),S=(e==null?void 0:e.show)??"always",G=(e==null?void 0:e.controls)??null,D=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,j=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,P=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,M=(e==null?void 0:e.controlsColor)??Uc.color,K=(e==null?void 0:e.controlsHoverColor)??Uc.hover,T=(e==null?void 0:e.navColor)??Zo.colors.inactive,L=(e==null?void 0:e.navPaginationColor)??Zo.colors.pagination,_=(e==null?void 0:e.navBackgroundColor)??Zo.colors.background,z=(e==null?void 0:e.linkColor)??us.linkColor,$=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,k=y==="horizontal",W=p==="click",w=p==="drag",U=p==="auto"&&(!n||!!i),C=!n,O=m==="slide",V=g==="classic",se=S!=="never"&&D>0,ie=S==="on hover",N=F.scalingValue(D,n),de={width:N,height:N,maxWidth:N},X=O&&c>1,[ce,oe]=s.useState(0),[fe,Pe]=s.useState(X?1:0),[xe,pe]=s.useState(!1),[Z,le]=s.useState(!1),[re,Ie]=s.useState(!1),[we,Me]=s.useState(0),[ye,be]=s.useState(!1),[Ce,h]=s.useState(!1),q=s.useRef(!1),Y=s.useRef(fe);Y.current=fe;const ee=s.useRef(null),ve=s.useRef(0),B=s.useRef(null),I=s.useRef(null),Q=s.useRef(null),ne=s.useRef(null),H=s.useCallback($e=>{q.current=$e,pe($e)},[]),te=s.useCallback($e=>{if(c<2||$e===0)return;const He=$e>0?1:-1,De=Math.abs($e);if(be(!0),H(!0),!O){oe(ft=>nr(ft+$e,c));return}let Qe=Y.current;const he=X&&(Qe===0||Qe===c+1),_e=he?ce+1:null;he&&(Qe=ce+1);let Ve=De;for(;Ve>0;){const ft=iS(Qe,He,c,X);if(Qe=ft.position,Ve-=1,ft.hitBoundary){ve.current=Ve*He;break}}const tt=De-Ve;if(tt>0&&oe(ft=>nr(ft+tt*He,c)),Y.current=Qe,_e!==null){if(Y.current=_e,Qe===_e){le(!0),Pe(Qe);return}ee.current=Qe,le(!0),Pe(_e);return}le(!1),Pe(Qe)},[ce,c,X,O,H]),ke=s.useCallback($e=>{te($e)},[te]),ge=s.useCallback($e=>{if(c<2)return;const He=nr($e,c);if(!(He===ce&&!q.current)&&(be(!0),H(!0),oe(He),O)){const De=He+(X?1:0);ee.current=null,ve.current=0,Y.current=De,le(!1),Pe(De)}},[ce,c,X,O,H]);s.useEffect(()=>{if(!xe)return;const $e=window.setTimeout(()=>{if(X&&(fe===0||fe===c+1)){ee.current=null,le(!0),Pe(ce+1);return}H(!1)},wo);return()=>window.clearTimeout($e)},[ce,c,X,xe,H,fe]),s.useEffect(()=>{if(!Z)return;let $e=0;const He=requestAnimationFrame(()=>{$e=requestAnimationFrame(()=>{const De=ee.current;ee.current=null;const Qe=ve.current;if(ve.current=0,le(!1),De!==null){Y.current=De,Pe(De);return}if(Qe!==0){te(Qe);return}H(!1)})});return()=>{cancelAnimationFrame(He),cancelAnimationFrame($e)}},[te,H,Z]);const J=`${X}:${c}`,Ye=s.useRef(J);s.useEffect(()=>{if(Ye.current===J)return;Ye.current=J;const $e=c>0?Math.min(ce,c-1):0;Q.current=null,ne.current=null,Ie(!1),Me(0),oe($e),le(!0),Pe($e+(X?1:0))},[ce,c,X,J]),s.useEffect(()=>{if(!ye)return;const $e=window.setTimeout(()=>be(!1),Yb);return()=>window.clearTimeout($e)},[ye,ce]),s.useEffect(()=>{if(!U||c<2)return;const $e=Math.max(v,.1)*1e3,He=window.setInterval(()=>{C&&Ce||ke(1)},$e);return()=>window.clearInterval(He)},[v,c,ke,U,Ce,C]);const je=s.useCallback($e=>{const He=Q.current;if(!He||He.pointerId!==$e.pointerId)return;Q.current=null,ne.current=null;const De=B.current;if(De!=null&&De.hasPointerCapture($e.pointerId)&&De.releasePointerCapture($e.pointerId),!He.isActive){O&&Me(0);return}const he=!($e.timeStamp-He.lastTime>Qb)&&Math.abs(He.velocity)>Jb,_e=He.size>0&&Math.abs(He.offset-He.baseOffset)>He.size*Zb;if(Ie(!1),!he&&!_e){Me(0);return}const Ve=_e?He.offset-He.baseOffset:He.velocity;let tt=1;_e&&He.size>0&&(tt=Math.max(1,Math.round(Math.abs(Ve)/He.size))),Me(0),te(Ve<0?tt:-tt)},[te,O]);s.useEffect(()=>{const $e=He=>{ne.current===null||He.pointerId!==ne.current||je(He)};return window.addEventListener("pointerup",$e),window.addEventListener("pointercancel",$e),()=>{window.removeEventListener("pointerup",$e),window.removeEventListener("pointercancel",$e)}},[je]);const it=$e=>{const He=B.current;if(!w||c<2||!He||$e.pointerType==="mouse"&&$e.button!==0)return;ee.current=null,ve.current=0,q.current&&H(!1);let De=0;const Qe=I.current;if(O&&Qe){const he=k?Qe.offsetWidth:Qe.offsetHeight;if(he>0){const _e=oS(Qe,k);let Ve=Y.current;X&&(Ve===0||Ve===c+1)?(Ve=ce+1,Y.current=Ve,le(!0),Pe(Ve),De=0):De=_e+Ve*he,Me(De)}}He.setPointerCapture($e.pointerId),ne.current=$e.pointerId,Q.current={pointerId:$e.pointerId,startClientX:$e.clientX,startClientY:$e.clientY,axes:rS(He,`${r}-axis-probe`),size:k?He.offsetWidth:He.offsetHeight,isActive:!1,baseOffset:De,offset:De,lastTime:$e.timeStamp,velocity:0}},qe=$e=>{const He=Q.current;if(!He||He.pointerId!==$e.pointerId)return;if($e.pointerType==="mouse"&&$e.buttons===0){je($e);return}const De=$e.clientX-He.startClientX,Qe=$e.clientY-He.startClientY,he=He.axes?aS(He.axes,De,Qe):{x:De,y:Qe},_e=k?he.x:he.y,Ve=k?he.y:he.x,tt=He.baseOffset+_e;if(!He.isActive){if(Math.max(Math.abs(_e),Math.abs(Ve))<Kb)return;if(Math.abs(Ve)>Math.abs(_e)){const rt=B.current;rt!=null&&rt.hasPointerCapture(He.pointerId)&&rt.releasePointerCapture(He.pointerId),Q.current=null,ne.current=null,O&&Me(0);return}He.isActive=!0,Ie(!0)}const ft=$e.timeStamp-He.lastTime;ft>0&&(He.velocity=(tt-He.offset)/ft,He.lastTime=$e.timeStamp),He.offset=tt,O&&Me(tt)},et=$e=>{je($e)},Je=k?`translate3d(calc(${-fe*100}% + ${we}px), 0, 0)`:`translate3d(0, calc(${-fe*100}% + ${we}px), 0)`,Ge=X?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:sS(r,n)}}),a.jsxs("div",{className:Ct(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!k}),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&&!k}),onPointerDown:it,onPointerMove:qe,onPointerUp:et,onPointerCancel:et,onLostPointerCapture:$e=>{ne.current===$e.pointerId&&je($e)},children:a.jsx("div",{ref:I,className:Ct(`${r}-list`,{[`${r}-list-slide`]:O,[`${r}-list-slide-vertical`]:O&&!k,[`${r}-list-fade`]:!O}),style:O?{transform:Je,transition:re||Z?"none":`transform ${wo}ms ${Ju}`}:void 0,children:Ge.map(($e,He)=>{const De=X?nr(He-1,c):He,he=X&&(He===0||He===c+1)?`clone-${He===0?"start":"end"}`:`slide-${De}`;return a.jsx("div",{className:Ct(`${r}-slide`,{[`${r}-is-active`]:!O&&De===ce}),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`]:$e.image.objectFit==="contain",[`${r}-cover`]:$e.image.objectFit==="cover"}),src:$e.image.url,alt:$e.image.name??"",draggable:!1})})})},he)})})}),se&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-prev`]:k,[`${r}-arrow-prev-vertical`]:!k,[`${r}-hover-arrow`]:ie}),style:{color:M,"--arrow-hover-color":K,...de},children:a.jsxs("button",{onClick:$e=>{$e.stopPropagation(),ke(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${F.scalingValue(j,n)}, ${F.scalingValue(P*(k?1:-1),n)}) rotate(${k?"0deg":"90deg"})`},children:[G&&a.jsx(pn,{url:G,fill:M,hoverFill:K,className:Ct(`${r}-arrow-img`,`${r}-mirror`),style:de}),!G&&a.jsx(Kc,{color:M,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-next`]:k,[`${r}-arrow-next-vertical`]:!k,[`${r}-hover-arrow`]:ie}),style:{color:M,"--arrow-hover-color":K,...de},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:$e=>{$e.stopPropagation(),ke(1)},style:{transform:`translate(${F.scalingValue(j*(k?-1:1),n)}, ${F.scalingValue(P,n)}) rotate(${k?"0deg":"90deg"})`},children:[G&&a.jsx(pn,{url:G,fill:M,hoverFill:K,className:`${r}-arrow-img`,style:de}),!G&&a.jsx(Kc,{color:M,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),W&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>ke(1)}),V&&a.jsx("div",{className:Ct(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:k,[`${r}-pagination-inside-left`]:!k}),style:k?{bottom:b(x.inset)}:{left:b(x.inset)},children:a.jsx("div",{className:Ct(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!k,[`${r}-animate-dots`]:ye}),style:{backgroundColor:_,gap:b(x.gapInactive-x.activeDot+x.dot),...k?{height:b(x.activeDot+x.paddingY*2),paddingTop:b(x.paddingY),paddingBottom:b(x.paddingY),paddingLeft:b(x.paddingActive),paddingRight:b(x.paddingActive)}:{width:b(x.activeDot+x.paddingY*2),paddingLeft:b(x.paddingY),paddingRight:b(x.paddingY),paddingTop:b(x.paddingActive),paddingBottom:b(x.paddingActive)},borderRadius:b(x.borderRadius),transform:`translate(${F.scalingValue(Zo.offset.x,n)}, ${F.scalingValue(Zo.offset.y,n)})`},children:d.map(($e,He)=>{const De=He===ce,Qe=De?x.activeDot:x.dot;return a.jsx("button",{onClick:()=>ge(He),className:`${r}-pagination-item`,style:{width:b(x.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:De?L:T,width:b(Qe)}})},He)})},`${f}-${y}`)})]}),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($,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map(($e,He)=>a.jsx("div",{className:Ct(`${r}-caption-text`,{[`${r}-with-pointer-events`]:He===ce&&n,[`${r}-active`]:He===ce}),style:{...l,width:"max-content",transitionDuration:`${Math.round(wo/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":z,"--link-hover-color":z,position:"relative",top:F.scalingValue(us.offset.y,n),left:F.scalingValue(us.offset.x,n)},children:a.jsx(Ki,{content:$e.imageCaption})})},He))})]})]})]})}function Kc({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 cS=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19678
|
+
`}function lS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=N.useScopedStyles(),l=nS(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??Yc,p=u.sizeType??"drag",x=u.value??Yc.value,v=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",h=(e==null?void 0:e.navSize)??"m",b=eS[h],E=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=xe=>N.scalingValue(xe*E,n),w=(e==null?void 0:e.show)??"always",j=(e==null?void 0:e.controls)??null,G=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,A=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,P=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,W=(e==null?void 0:e.controlsColor)??Uc.color,Y=(e==null?void 0:e.controlsHoverColor)??Uc.hover,$=(e==null?void 0:e.navColor)??Zo.colors.inactive,I=(e==null?void 0:e.navPaginationColor)??Zo.colors.pagination,H=(e==null?void 0:e.navBackgroundColor)??Zo.colors.background,O=(e==null?void 0:e.linkColor)??us.linkColor,C=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,L=v==="horizontal",D=p==="click",S=p==="drag",U=p==="auto"&&(!n||!!i),T=!n,_=m==="slide",B=g==="classic",ae=w!=="never"&&G>0,ie=w==="on hover",k=N.scalingValue(G,n),ue={width:k,height:k,maxWidth:k},X=_&&c>1,[le,te]=s.useState(0),[we,ke]=s.useState(X?1:0),[fe,me]=s.useState(!1),[Z,se]=s.useState(!1),[oe,Pe]=s.useState(!1),[$e,Me]=s.useState(0),[ye,be]=s.useState(!1),[Ce,f]=s.useState(!1),q=s.useRef(!1),K=s.useRef(we);K.current=we;const ne=s.useRef(null),ge=s.useRef(0),z=s.useRef(null),R=s.useRef(null),Q=s.useRef(null),ee=s.useRef(null),ce=s.useCallback(xe=>{q.current=xe,me(xe)},[]),V=s.useCallback(xe=>{if(c<2||xe===0)return;const We=xe>0?1:-1,He=Math.abs(xe);if(be(!0),ce(!0),!_){te(mt=>nr(mt+xe,c));return}let Qe=K.current;const he=X&&(Qe===0||Qe===c+1),Ne=he?le+1:null;he&&(Qe=le+1);let Ve=He;for(;Ve>0;){const mt=iS(Qe,We,c,X);if(Qe=mt.position,Ve-=1,mt.hitBoundary){ge.current=Ve*We;break}}const tt=He-Ve;if(tt>0&&te(mt=>nr(mt+tt*We,c)),K.current=Qe,Ne!==null){if(K.current=Ne,Qe===Ne){se(!0),ke(Qe);return}ne.current=Qe,se(!0),ke(Ne);return}se(!1),ke(Qe)},[le,c,X,_,ce]),Le=s.useCallback(xe=>{V(xe)},[V]),ve=s.useCallback(xe=>{if(c<2)return;const We=nr(xe,c);if(!(We===le&&!q.current)&&(be(!0),ce(!0),te(We),_)){const He=We+(X?1:0);ne.current=null,ge.current=0,K.current=He,se(!1),ke(He)}},[le,c,X,_,ce]);s.useEffect(()=>{if(!fe)return;const xe=window.setTimeout(()=>{if(X&&(we===0||we===c+1)){ne.current=null,se(!0),ke(le+1);return}ce(!1)},wo);return()=>window.clearTimeout(xe)},[le,c,X,fe,ce,we]),s.useEffect(()=>{if(!Z)return;let xe=0;const We=requestAnimationFrame(()=>{xe=requestAnimationFrame(()=>{const He=ne.current;ne.current=null;const Qe=ge.current;if(ge.current=0,se(!1),He!==null){K.current=He,ke(He);return}if(Qe!==0){V(Qe);return}ce(!1)})});return()=>{cancelAnimationFrame(We),cancelAnimationFrame(xe)}},[V,ce,Z]);const J=`${X}:${c}`,_e=s.useRef(J);s.useEffect(()=>{if(_e.current===J)return;_e.current=J;const xe=c>0?Math.min(le,c-1):0;Q.current=null,ee.current=null,Pe(!1),Me(0),te(xe),se(!0),ke(xe+(X?1:0))},[le,c,X,J]),s.useEffect(()=>{if(!ye)return;const xe=window.setTimeout(()=>be(!1),Yb);return()=>window.clearTimeout(xe)},[ye,le]),s.useEffect(()=>{if(!U||c<2)return;const xe=Math.max(x,.1)*1e3,We=window.setInterval(()=>{T&&Ce||Le(1)},xe);return()=>window.clearInterval(We)},[x,c,Le,U,Ce,T]);const Be=s.useCallback(xe=>{const We=Q.current;if(!We||We.pointerId!==xe.pointerId)return;Q.current=null,ee.current=null;const He=z.current;if(He!=null&&He.hasPointerCapture(xe.pointerId)&&He.releasePointerCapture(xe.pointerId),!We.isActive){_&&Me(0);return}const he=!(xe.timeStamp-We.lastTime>Qb)&&Math.abs(We.velocity)>Jb,Ne=We.size>0&&Math.abs(We.offset-We.baseOffset)>We.size*Zb;if(Pe(!1),!he&&!Ne){Me(0);return}const Ve=Ne?We.offset-We.baseOffset:We.velocity;let tt=1;Ne&&We.size>0&&(tt=Math.max(1,Math.round(Math.abs(Ve)/We.size))),Me(0),V(Ve<0?tt:-tt)},[V,_]);s.useEffect(()=>{const xe=We=>{ee.current===null||We.pointerId!==ee.current||Be(We)};return window.addEventListener("pointerup",xe),window.addEventListener("pointercancel",xe),()=>{window.removeEventListener("pointerup",xe),window.removeEventListener("pointercancel",xe)}},[Be]);const at=xe=>{const We=z.current;if(!S||c<2||!We||xe.pointerType==="mouse"&&xe.button!==0)return;ne.current=null,ge.current=0,q.current&&ce(!1);let He=0;const Qe=R.current;if(_&&Qe){const he=L?Qe.offsetWidth:Qe.offsetHeight;if(he>0){const Ne=oS(Qe,L);let Ve=K.current;X&&(Ve===0||Ve===c+1)?(Ve=le+1,K.current=Ve,se(!0),ke(Ve),He=0):He=Ne+Ve*he,Me(He)}}We.setPointerCapture(xe.pointerId),ee.current=xe.pointerId,Q.current={pointerId:xe.pointerId,startClientX:xe.clientX,startClientY:xe.clientY,axes:rS(We,`${r}-axis-probe`),size:L?We.offsetWidth:We.offsetHeight,isActive:!1,baseOffset:He,offset:He,lastTime:xe.timeStamp,velocity:0}},Ue=xe=>{const We=Q.current;if(!We||We.pointerId!==xe.pointerId)return;if(xe.pointerType==="mouse"&&xe.buttons===0){Be(xe);return}const He=xe.clientX-We.startClientX,Qe=xe.clientY-We.startClientY,he=We.axes?aS(We.axes,He,Qe):{x:He,y:Qe},Ne=L?he.x:he.y,Ve=L?he.y:he.x,tt=We.baseOffset+Ne;if(!We.isActive){if(Math.max(Math.abs(Ne),Math.abs(Ve))<Kb)return;if(Math.abs(Ve)>Math.abs(Ne)){const st=z.current;st!=null&&st.hasPointerCapture(We.pointerId)&&st.releasePointerCapture(We.pointerId),Q.current=null,ee.current=null,_&&Me(0);return}We.isActive=!0,Pe(!0)}const mt=xe.timeStamp-We.lastTime;mt>0&&(We.velocity=(tt-We.offset)/mt,We.lastTime=xe.timeStamp),We.offset=tt,_&&Me(tt)},et=xe=>{Be(xe)},Je=L?`translate3d(calc(${-we*100}% + ${$e}px), 0, 0)`:`translate3d(0, calc(${-we*100}% + ${$e}px), 0)`,Ye=X?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:sS(r,n)}}),a.jsxs("div",{className:Ct(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!L}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:z,className:Ct(`${r}-track`,{[`${r}-track-draggable`]:S,[`${r}-track-draggable-vertical`]:S&&!L}),onPointerDown:at,onPointerMove:Ue,onPointerUp:et,onPointerCancel:et,onLostPointerCapture:xe=>{ee.current===xe.pointerId&&Be(xe)},children:a.jsx("div",{ref:R,className:Ct(`${r}-list`,{[`${r}-list-slide`]:_,[`${r}-list-slide-vertical`]:_&&!L,[`${r}-list-fade`]:!_}),style:_?{transform:Je,transition:oe||Z?"none":`transform ${wo}ms ${Ju}`}:void 0,children:Ye.map((xe,We)=>{const He=X?nr(We-1,c):We,he=X&&(We===0||We===c+1)?`clone-${We===0?"start":"end"}`:`slide-${He}`;return a.jsx("div",{className:Ct(`${r}-slide`,{[`${r}-is-active`]:!_&&He===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`]:xe.image.objectFit==="contain",[`${r}-cover`]:xe.image.objectFit==="cover"}),src:xe.image.url,alt:xe.image.name??"",draggable:!1})})})},he)})})}),ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-prev`]:L,[`${r}-arrow-prev-vertical`]:!L,[`${r}-hover-arrow`]:ie}),style:{color:W,"--arrow-hover-color":Y,...ue},children:a.jsxs("button",{onClick:xe=>{xe.stopPropagation(),Le(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${N.scalingValue(A,n)}, ${N.scalingValue(P*(L?1:-1),n)}) rotate(${L?"0deg":"90deg"})`},children:[j&&a.jsx(pn,{url:j,fill:W,hoverFill:Y,className:Ct(`${r}-arrow-img`,`${r}-mirror`),style:ue}),!j&&a.jsx(Kc,{color:W,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-next`]:L,[`${r}-arrow-next-vertical`]:!L,[`${r}-hover-arrow`]:ie}),style:{color:W,"--arrow-hover-color":Y,...ue},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:xe=>{xe.stopPropagation(),Le(1)},style:{transform:`translate(${N.scalingValue(A*(L?-1:1),n)}, ${N.scalingValue(P,n)}) rotate(${L?"0deg":"90deg"})`},children:[j&&a.jsx(pn,{url:j,fill:W,hoverFill:Y,className:`${r}-arrow-img`,style:ue}),!j&&a.jsx(Kc,{color:W,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),D&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Le(1)}),B&&a.jsx("div",{className:Ct(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:L,[`${r}-pagination-inside-left`]:!L}),style:L?{bottom:y(b.inset)}:{left:y(b.inset)},children:a.jsx("div",{className:Ct(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!L,[`${r}-animate-dots`]:ye}),style:{backgroundColor:H,gap:y(b.gapInactive-b.activeDot+b.dot),...L?{height:y(b.activeDot+b.paddingY*2),paddingTop:y(b.paddingY),paddingBottom:y(b.paddingY),paddingLeft:y(b.paddingActive),paddingRight:y(b.paddingActive)}:{width:y(b.activeDot+b.paddingY*2),paddingLeft:y(b.paddingY),paddingRight:y(b.paddingY),paddingTop:y(b.paddingActive),paddingBottom:y(b.paddingActive)},borderRadius:y(b.borderRadius),transform:`translate(${N.scalingValue(Zo.offset.x,n)}, ${N.scalingValue(Zo.offset.y,n)})`},children:d.map((xe,We)=>{const He=We===le,Qe=He?b.activeDot:b.dot;return a.jsx("button",{onClick:()=>ve(We),className:`${r}-pagination-item`,style:{width:y(b.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:He?I:$,width:y(Qe)}})},We)})},`${h}-${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:N.scalingValue(C,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((xe,We)=>a.jsx("div",{className:Ct(`${r}-caption-text`,{[`${r}-with-pointer-events`]:We===le&&n,[`${r}-active`]:We===le}),style:{...l,width:"max-content",transitionDuration:`${Math.round(wo/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":O,"--link-hover-color":O,position:"relative",top:N.scalingValue(us.offset.y,n),left:N.scalingValue(us.offset.x,n)},children:a.jsx(Ki,{content:xe.imageCaption})})},We))})]})]})]})}function Kc({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 cS=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19675
19679
|
import cn from 'classnames';
|
|
19676
19680
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
19677
19681
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -20852,7 +20856,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20852
20856
|
</svg>
|
|
20853
20857
|
);
|
|
20854
20858
|
}
|
|
20855
|
-
`,dS={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},uS={element:lS,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:dS,sourceCode:cS,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},mo=300/1440,pS=8/1440,zi=.004;function mS(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Zc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Jc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:
|
|
20859
|
+
`,dS={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},uS={element:lS,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:dS,sourceCode:cS,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},mo=300/1440,pS=8/1440,zi=.004;function mS(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Zc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Jc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:N.scalingValue((o-t)/2,i)}}function gS(e){return`
|
|
20856
20860
|
.${e}-wrapper {
|
|
20857
20861
|
box-sizing: border-box;
|
|
20858
20862
|
display: flex;
|
|
@@ -21069,7 +21073,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
21069
21073
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
21070
21074
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
21071
21075
|
}
|
|
21072
|
-
`}const hS="rgba(28,31,34,0.9)",Kn=500,Oi="cubic-bezier(0.22, 1, 0.36, 1)",fS=72,yS=50,vS={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},xS=[];function bS(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 SS(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function wS(e){const[t]=e.media;return t!=null&&t.url?t:null}function $S(e){if(!Array.isArray(e)||e.length===0)return[];if(bS(e)){const t=[];for(const n of e){const i=SS(n);if(!i)continue;const o=wS(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Os(e){return e.type==="video"}function CS(e){e.pause(),e.removeAttribute("src"),e.load()}function Xr(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}}const LS=1140/1440;function IS(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 RS(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 PS(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function kS({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{CS(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d,style:i})}function ES({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const v=i==="cover",y=s.useRef(null),m=s.useRef(null),g=s.useRef(null),f=s.useRef(0),x=s.useRef(0),R=s.useRef("none"),b=s.useRef(!1),S=s.useRef(!1),G=s.useRef(!1),D=s.useRef(null),[j,P]=s.useState(null),[M,K]=s.useState("opening"),[T,L]=s.useState(0),[_,z]=s.useState(0),[$,k]=s.useState(!1),[W,w]=s.useState(!1),[U,C]=s.useState(!1),O=s.useRef(n),V=t[n],se=V?Os(V):!1,ie=_!==0||$,N=s.useCallback(ye=>{G.current=ye,k(ye)},[]),de=s.useCallback(()=>{D.current!==null&&(window.clearTimeout(D.current),D.current=null)},[]),X=s.useCallback(()=>{de(),D.current=window.setTimeout(()=>{de(),N(!1)},Kn+32)},[de,N]),ce=s.useCallback(()=>{const ye=y.current,be=m.current;if(!ye)return;const Ce=ye.getBoundingClientRect(),h=Ce.width,q=Ce.height;if(!h||!q)return;if(i==="cover"){P({width:h,height:q,left:Ce.left,top:Ce.top});return}if(!be){P(Xr(ye));return}const{width:Y,height:ee}=TS(be);if(!Y||!ee){P(Xr(ye));return}const ve=Y/ee,B=h/q;if(ve>B){const I=h/ve;P({width:h,height:I,left:Ce.left,top:Ce.top+(q-I)/2})}else{const I=q*ve;P({width:I,height:q,left:Ce.left+(h-I)/2,top:Ce.top})}},[i]);s.useEffect(()=>{ce();const ye=y.current;if(!ye)return;const be=new ResizeObserver(()=>ce());return be.observe(ye),()=>be.disconnect()},[ce,n]),s.useEffect(()=>{M==="opening"&&j&&K("open")},[M,j]),s.useEffect(()=>{if(M!=="closing")return;const ye=setTimeout(()=>r(),Kn);return()=>clearTimeout(ye)},[M,r]),s.useEffect(()=>()=>{de()},[de]),s.useLayoutEffect(()=>{if(O.current===n)return;de(),L(0),z(0),N(!1),C(!1),w(!1),f.current=0,x.current=0,R.current="none",b.current=!1,g.current=null,S.current=!1;const ye=y.current;ye&&P(Xr(ye)),O.current=n},[n,N,de]),s.useEffect(()=>{if(M!=="open")return;let ye=null;const be=()=>{ye&&(document.removeEventListener("click",ye,!0),ye=null)},Ce=()=>{be(),ye=B=>{B.stopPropagation(),B.preventDefault(),be()},document.addEventListener("click",ye,!0)},h=B=>{de(),G.current=!1,k(!1),z(0),w(!1),b.current=!1,x.current=0,R.current="none";const I=y.current;I&&P(Xr(I)),B<0?d():l()},q=B=>{if(Math.abs(B)>yS&&t.length>1){h(B);return}N(!0),z(0),X()},Y=B=>{if(B.touches.length!==1||G.current)return;const I=B.touches[0];S.current=!0,g.current={x:I.clientX,y:I.clientY},R.current="none",x.current=0,b.current=!1},ee=B=>{if(!g.current||B.touches.length!==1||G.current)return;const I=B.touches[0],Q=I.clientX-g.current.x,ne=I.clientY-g.current.y;if(R.current==="none"){if(Math.abs(Q)<10&&Math.abs(ne)<10)return;if(Math.abs(Q)>Math.abs(ne)){if(t.length<=1)return;R.current="horizontal"}else if(ne>0)R.current="vertical";else return}if(R.current==="horizontal"){b.current=!0,w(!0),x.current=Q,z(Q),B.preventDefault();return}R.current==="vertical"&&(b.current=!0,w(!0),f.current=ne,L(ne),B.preventDefault())},ve=()=>{if(!g.current)return;const B=R.current,I=b.current;if(I&&B==="horizontal")q(x.current),Ce();else if(I&&B==="vertical")if(f.current>fS){const ne=window.innerHeight;f.current=ne,C(!0),L(ne),K("closing")}else f.current=0,L(0),Ce();else B==="horizontal"&&Math.abs(x.current)>0&&(q(x.current),Ce());g.current=null,R.current="none",x.current=0,b.current=!1,w(!1)};return document.addEventListener("touchstart",Y,{passive:!0}),document.addEventListener("touchmove",ee,{passive:!1}),document.addEventListener("touchend",ve),document.addEventListener("touchcancel",ve),()=>{document.removeEventListener("touchstart",Y),document.removeEventListener("touchmove",ee),document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),be()}},[M,t.length,d,l,N,X,de]),s.useEffect(()=>{const ye=be=>{be.key==="Escape"&&(be.preventDefault(),be.stopPropagation(),M!=="closing"&&K("closing"))};return window.addEventListener("keydown",ye,!0),()=>window.removeEventListener("keydown",ye,!0)},[M]);const oe=()=>{M!=="closing"&&K("closing")},fe=M==="open",Pe=M==="closing",xe=T>0?Math.max(0,1-T/500):1,pe=T>0?Math.max(.35,1-T/500):1,Z=ye=>{if(ye.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const be=ye.currentTarget.getBoundingClientRect(),Ce=ye.clientY-be.top,h=Math.min(52,be.height*.2);if(!(Ce>be.height-h)){if(ye.clientX-be.left<be.width/2){l();return}d()}},le=ye=>{if(t.length<=1)return;const be=ye.currentTarget.getBoundingClientRect(),Ce=ye.clientX-be.left,h=ye.clientY-be.top,q=Math.min(52,be.height*.2);if(h>be.height-q){ye.currentTarget.style.cursor="default";return}ye.currentTarget.style.cursor=Ce<be.width/2?"w-resize":"e-resize"},re=s.useCallback(ye=>{ye.propertyName!=="transform"||!G.current||(de(),N(!1))},[de,N]),Ie=ie?`translateX(${_}px)`:T>0?`translateY(${T}px)`:void 0,we={position:"fixed",top:j==null?void 0:j.top,left:j==null?void 0:j.left,width:j==null?void 0:j.width,height:j==null?void 0:j.height,objectFit:i==="cover"?"cover":"contain",transform:Ie,opacity:T>0?pe:M==="opening"||Pe?0:1,transition:W&&!$?"none":$?`transform ${Kn}ms ${Oi}`:U?`transform ${Kn}ms ${Oi}, opacity ${Kn}ms ${Oi}`:M==="opening"||Pe?`opacity ${Kn}ms ${Oi}`:"none",pointerEvents:se&&fe&&!ie?"auto":"none",touchAction:se&&fe?"none":void 0,zIndex:9998},Me=j?{position:"fixed",top:j.top,height:j.height,width:j.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:M==="open"?"none":void 0},onClick:oe,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:fe?xe:0,transition:W?"none":`opacity ${Kn}ms ${Oi}`,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:y,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:fe?1:0,transition:`opacity ${Kn}ms ${Oi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:fe?1:0,transition:`opacity ${Kn}ms ${Oi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),j&&V&&(se?a.jsx(kS,{src:V.url,phase:M,mediaRef:m,mediaStyle:we,onLoadedMetadata:ce,onClick:Z,onMouseMove:le,onTransitionEnd:re},`${n}-${V.url}`):a.jsx("img",{ref:m,src:V.url,alt:V.name,onLoad:ce,onTransitionEnd:re,style:we},`${n}-${V.url}`)),fe&&Me&&t.length>1&&!se&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Me,left:j.left,cursor:"w-resize",pointerEvents:ie?"none":"auto"},onClick:ye=>{if(S.current){S.current=!1;return}ye.stopPropagation(),l()}}),a.jsx("div",{style:{...Me,left:j.left+j.width/2,cursor:"e-resize",pointerEvents:ie?"none":"auto"},onClick:ye=>{if(S.current){S.current=!1;return}ye.stopPropagation(),d()}})]})]})}function Qc({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const v=`${e}-gallery-${Os(t)?"video":"image"}`,y=r.display==="cover",m=RS(r),g=M=>F.scalingValue(M,l??!1),f=n??mo,x=o?{width:"100%",maxWidth:"100%"}:{width:g(f),maxWidth:"100%"},R=i?{borderRadius:g(i)}:{},b={...x,...y?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...R},S={...y?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...y?{}:R},D={className:v,style:S,onClick:p?M=>{M.stopPropagation(),p()}:void 0},j=Math.max(d,zi),P=Os(t)?a.jsx("video",{...D,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...D,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[y?a.jsx("div",{style:b,children:P}):P,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:g(d)},"aria-hidden":"true"}),u&&c&&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:g(j)}})]})}function MS({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const v=t==="a"?i:t==="c"?o:0,y=v>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&y&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&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(d),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"&&y&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&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(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function AS(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function ed({P:e,scaled:t,height:n,paired:i}){return a.jsx("div",{"data-controls":"titleTopPadding",...i?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:t(n)}})}function td({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:d}){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%",...d}})}function ps({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:r,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=s.useRef(null),[v,y]=s.useState(0),m=t??"",g=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!g)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const x=()=>y(f.offsetHeight);x();const R=new ResizeObserver(x);return R.observe(f),()=>R.disconnect()},[m,g]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...g?{[`--${e}-title-height`]:`${v}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:m})})]})})}const nd=45;function id(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 FS(e){const t=id(e,"--cntrl-viewport-height",window.innerHeight),n=id(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function NS(e,t,n){const{top:i,centerY:o}=FS(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const r=e.top+e.height/2;return Math.abs(r-o)}function _S(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=NS(u,n,c);return Math.exp(-(p*p)/(2*nd*nd))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function WS(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(c,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 c=0;const u=()=>{l(_S(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:r}}function HS(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),d=Math.max(r.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...r.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function OS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var ot;const{prefix:l}=F.useScopedStyles(),d=s.useMemo(()=>gS(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",v=(e==null?void 0:e.imgWidth)??mo,y=(e==null?void 0:e.titleWidth)??LS,m=IS(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??pS,f=(e==null?void 0:e.position)??"center",x=(e==null?void 0:e.titleTopPadding)??0,R=(e==null?void 0:e.titleLeftPadding)??0,b=(e==null?void 0:e.titleRightPadding)??0,S=AS(e==null?void 0:e.transition),G=(e==null?void 0:e.lightbox)??"on",D=p==="b",j=S==="fade"||S==="retype",{setTitleRef:P,dominantIndex:M}=WS(c.length,j,f),K=((ot=c[M])==null?void 0:ot.title)??"",T=HS(K,S==="retype"),L=S==="fade"||S==="retype",_=S==="retype"?T:K,z=D?void 0:{width:F.scalingValue(v,n??!1)},$=G==="on"&&(!n||i||o),k=o??!1,W=(e==null?void 0:e.galleryPaddingRight)??0,w=(e==null?void 0:e.galleryPaddingLeft)??0,U=(e==null?void 0:e.galleryPaddingBetween)??0,C=nt=>F.scalingValue(nt,n??!1),V={width:C(y)},se=p==="a"?W:w,ie=D?{width:"100%"}:{width:`calc(100% - ${C(v)} - ${C(se)})`,...p==="c"?{marginLeft:"auto"}:{}},N=Math.max(W,zi),de=Math.max(w,zi),X=Math.max(U,zi),ce=Math.max(x,zi),oe=Math.max(R,zi),fe=Math.max(b,zi),Pe=Math.max(0,(u??1)-(v??mo)),xe=p==="a"?Math.max(0,(u??1)-(v??mo)-W):p==="c"?Math.max(0,(u??1)-(v??mo)-w):p==="b"?u??1:1,pe=k&&(p==="a"||p==="b"||p==="c")&&f==="top",Z=k&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),le=k&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),re=c.length>1,Ie=D?void 0:C((p==="c"?w:W)+(v??mo)),we=p==="c"&&Ie?{left:Ie}:void 0,Me=p==="a"&&Ie?{right:Ie}:void 0,ye=D?{left:0,width:"100%"}:p==="a"?{right:C(W),width:C(v)}:{left:C(w),width:C(v)},{titleColor:be,titleFontFamily:Ce,titleFontSettings:h,titleFontSize:q,titleLineHeight:Y,titleLetterSpacing:ee,titleWordSpacing:ve,titleAlign:B,titleTextAppearance:I,lightboxCounterColor:Q,lightboxCounterFontFamily:ne,lightboxCounterFontSettings:H,lightboxCounterFontSize:te,lightboxCounterLineHeight:ke,lightboxCounterLetterSpacing:ge,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:Ye}=e??{},je={fontSettings:{fontFamily:Ce,fontWeight:(h==null?void 0:h.fontWeight)??400,fontStyle:(h==null?void 0:h.fontStyle)??"normal"},fontSize:q??.01,lineHeight:Y,letterSpacing:ee??0,wordSpacing:ve??0,textAlign:B??"left",textAppearance:I,color:be??"#000000"},qe=dn(Qt(je,n)),et=V,Je=Jc(q,Y,l,n),Ge=Zc(q,Y,`${l}-title`,`${l}-text-tight-leading`),$e={fontSettings:{fontFamily:ne,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:te??.01,lineHeight:ke,letterSpacing:ge??0,wordSpacing:J??0,textAppearance:Ye,color:Q??"#DEDDDD"},De={...dn(Qt($e,n)),...Jc(te,ke,l,n)},Qe=Zc(te,ke,`${l}-lightbox-counter`,`${l}-text-tight-leading`),he=F.buildColorVars(l,{titleColor:be??"#000000",lightboxCounterColor:Q??"#DEDDDD"},vS,xS),_e=s.useRef(null),[Ve,tt]=s.useState(!1),[ft,rt]=s.useState([]),[Oe,Fe]=s.useState(0),Ee=s.useCallback((nt,me)=>{$&&(rt(nt),Fe(me),tt(!0))},[$]),Ze=s.useCallback(()=>{tt(!1)},[]),We=s.useMemo(()=>{const nt={...he},me=_e.current?getComputedStyle(_e.current).getPropertyValue("--cntrl-article-width").trim():"";return me&&(nt["--cntrl-article-width"]=me),nt},[he,Ve]);return s.useEffect(()=>{if(!Ve||G!=="on"||typeof document>"u")return;const nt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=nt}},[Ve,G]),s.useEffect(()=>{!n||o||i||tt(!1)},[n,o,i]),s.useEffect(()=>{G==="off"&&tt(!1)},[G]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:he,children:a.jsxs("div",{ref:_e,className:`${l}-wrapper`,style:{width:F.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?C(x):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?C(R):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?C(b):void 0},children:[L&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(ps,{P:l,title:_,position:f,titleRef:()=>{},titleClassName:`${Ge} ${l}-single-title`,titleContainerStyle:{...Je,...ie},titleTextBoxStyle:et,titleStyle:qe,showTextBoxOutline:k,topPaddingControl:pe?ed({P:l,scaled:C,height:ce,paired:!1}):void 0})}),c.map((nt,me)=>{const Ne=$S(nt.gallery),st=me<c.length-1,ut=Ne.filter(pt=>pt.lightboxMedia).map(pt=>pt.lightboxMedia),Be={P:l,position:f,titleRef:P(me),titleClassName:Ge,titleContainerStyle:Je,titleTextBoxStyle:L?{maxWidth:"100%"}:et,titleStyle:qe,showTextBoxOutline:k&&!L,topPaddingControl:pe&&!L?ed({P:l,scaled:C,height:ce,paired:re}):void 0};return a.jsxs("div",{"data-item-index":me,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:st?C(U):void 0},children:[Z&&td({P:l,controlKey:"titleLeftPadding",scaled:C,width:oe,maxFraction:xe,side:"left",paired:re,anchorStyle:we}),le&&td({P:l,controlKey:"titleRightPadding",scaled:C,width:fe,maxFraction:xe,side:"right",paired:re,anchorStyle:Me}),k&&st&&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:C(X),...ye}}),D?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Ne.map(({displayMedia:pt,lightboxMedia:Tt},Lt)=>{const xt=Tt?ut.findIndex(Et=>Et.url===Tt.url):-1;return a.jsx(Qc,{P:l,media:pt,imgWidth:v||void 0,cornerRadius:g||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:U,showPaddingAfter:Lt<Ne.length-1,showControls:k,onMediaClick:$&&xt>=0?()=>Ee(ut,xt):void 0},`${pt.url}-${Lt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(ps,{...Be,title:L?"":nt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(ps,{...Be,title:L?"":nt.title}),Ne.length>0&&a.jsx(MS,{P:l,layoutType:p,galleryWidthStyle:z,galleryPaddingRight:W,galleryPaddingLeft:w,galleryPaddingRightWidth:N,galleryPaddingLeftWidth:de,galleryPaddingMaxFraction:Pe,showControls:k,scaled:C,children:Ne.map(({displayMedia:pt,lightboxMedia:Tt},Lt)=>{const xt=Tt?ut.findIndex(Et=>Et.url===Tt.url):-1;return a.jsx(Qc,{P:l,media:pt,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:U,showPaddingAfter:Lt<Ne.length-1,showControls:k,onMediaClick:$&&xt>=0?()=>Ee(ut,xt):void 0},`${pt.url}-${Lt}`)})})]})]},me)})]})}),Ve&&G==="on"&&typeof document<"u"&&e&&(()=>{const nt=(r?document.getElementById(r):null)??document.body;return ai.createPortal(a.jsx("div",{style:We,"data-selection":"none",children:a.jsx(ES,{prefix:l,items:ft,index:Oe,imageDisplay:PS(e.lightboxImageDisplay),isEditor:n,onClose:Ze,onPrev:()=>Fe(me=>(me-1+ft.length)%ft.length),onNext:()=>Fe(me=>(me+1)%ft.length),counterClassName:Qe,counterStyle:De,backgroundColor:e.backgroundColor??hS})}),nt)})()]})}const DS=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21076
|
+
`}const hS="rgba(28,31,34,0.9)",Kn=500,Oi="cubic-bezier(0.22, 1, 0.36, 1)",fS=72,yS=50,vS={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},xS=[];function bS(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 SS(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function wS(e){const[t]=e.media;return t!=null&&t.url?t:null}function $S(e){if(!Array.isArray(e)||e.length===0)return[];if(bS(e)){const t=[];for(const n of e){const i=SS(n);if(!i)continue;const o=wS(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Os(e){return e.type==="video"}function CS(e){e.pause(),e.removeAttribute("src"),e.load()}function Xr(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}}const LS=1140/1440;function IS(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 RS(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 PS(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function kS({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{CS(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d,style:i})}function ES({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const x=i==="cover",v=s.useRef(null),m=s.useRef(null),g=s.useRef(null),h=s.useRef(0),b=s.useRef(0),E=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),j=s.useRef(!1),G=s.useRef(null),[A,P]=s.useState(null),[W,Y]=s.useState("opening"),[$,I]=s.useState(0),[H,O]=s.useState(0),[C,L]=s.useState(!1),[D,S]=s.useState(!1),[U,T]=s.useState(!1),_=s.useRef(n),B=t[n],ae=B?Os(B):!1,ie=H!==0||C,k=s.useCallback(ye=>{j.current=ye,L(ye)},[]),ue=s.useCallback(()=>{G.current!==null&&(window.clearTimeout(G.current),G.current=null)},[]),X=s.useCallback(()=>{ue(),G.current=window.setTimeout(()=>{ue(),k(!1)},Kn+32)},[ue,k]),le=s.useCallback(()=>{const ye=v.current,be=m.current;if(!ye)return;const Ce=ye.getBoundingClientRect(),f=Ce.width,q=Ce.height;if(!f||!q)return;if(i==="cover"){P({width:f,height:q,left:Ce.left,top:Ce.top});return}if(!be){P(Xr(ye));return}const{width:K,height:ne}=TS(be);if(!K||!ne){P(Xr(ye));return}const ge=K/ne,z=f/q;if(ge>z){const R=f/ge;P({width:f,height:R,left:Ce.left,top:Ce.top+(q-R)/2})}else{const R=q*ge;P({width:R,height:q,left:Ce.left+(f-R)/2,top:Ce.top})}},[i]);s.useEffect(()=>{le();const ye=v.current;if(!ye)return;const be=new ResizeObserver(()=>le());return be.observe(ye),()=>be.disconnect()},[le,n]),s.useEffect(()=>{W==="opening"&&A&&Y("open")},[W,A]),s.useEffect(()=>{if(W!=="closing")return;const ye=setTimeout(()=>r(),Kn);return()=>clearTimeout(ye)},[W,r]),s.useEffect(()=>()=>{ue()},[ue]),s.useLayoutEffect(()=>{if(_.current===n)return;ue(),I(0),O(0),k(!1),T(!1),S(!1),h.current=0,b.current=0,E.current="none",y.current=!1,g.current=null,w.current=!1;const ye=v.current;ye&&P(Xr(ye)),_.current=n},[n,k,ue]),s.useEffect(()=>{if(W!=="open")return;let ye=null;const be=()=>{ye&&(document.removeEventListener("click",ye,!0),ye=null)},Ce=()=>{be(),ye=z=>{z.stopPropagation(),z.preventDefault(),be()},document.addEventListener("click",ye,!0)},f=z=>{ue(),j.current=!1,L(!1),O(0),S(!1),y.current=!1,b.current=0,E.current="none";const R=v.current;R&&P(Xr(R)),z<0?d():l()},q=z=>{if(Math.abs(z)>yS&&t.length>1){f(z);return}k(!0),O(0),X()},K=z=>{if(z.touches.length!==1||j.current)return;const R=z.touches[0];w.current=!0,g.current={x:R.clientX,y:R.clientY},E.current="none",b.current=0,y.current=!1},ne=z=>{if(!g.current||z.touches.length!==1||j.current)return;const R=z.touches[0],Q=R.clientX-g.current.x,ee=R.clientY-g.current.y;if(E.current==="none"){if(Math.abs(Q)<10&&Math.abs(ee)<10)return;if(Math.abs(Q)>Math.abs(ee)){if(t.length<=1)return;E.current="horizontal"}else if(ee>0)E.current="vertical";else return}if(E.current==="horizontal"){y.current=!0,S(!0),b.current=Q,O(Q),z.preventDefault();return}E.current==="vertical"&&(y.current=!0,S(!0),h.current=ee,I(ee),z.preventDefault())},ge=()=>{if(!g.current)return;const z=E.current,R=y.current;if(R&&z==="horizontal")q(b.current),Ce();else if(R&&z==="vertical")if(h.current>fS){const ee=window.innerHeight;h.current=ee,T(!0),I(ee),Y("closing")}else h.current=0,I(0),Ce();else z==="horizontal"&&Math.abs(b.current)>0&&(q(b.current),Ce());g.current=null,E.current="none",b.current=0,y.current=!1,S(!1)};return document.addEventListener("touchstart",K,{passive:!0}),document.addEventListener("touchmove",ne,{passive:!1}),document.addEventListener("touchend",ge),document.addEventListener("touchcancel",ge),()=>{document.removeEventListener("touchstart",K),document.removeEventListener("touchmove",ne),document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),be()}},[W,t.length,d,l,k,X,ue]),s.useEffect(()=>{const ye=be=>{be.key==="Escape"&&(be.preventDefault(),be.stopPropagation(),W!=="closing"&&Y("closing"))};return window.addEventListener("keydown",ye,!0),()=>window.removeEventListener("keydown",ye,!0)},[W]);const te=()=>{W!=="closing"&&Y("closing")},we=W==="open",ke=W==="closing",fe=$>0?Math.max(0,1-$/500):1,me=$>0?Math.max(.35,1-$/500):1,Z=ye=>{if(ye.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const be=ye.currentTarget.getBoundingClientRect(),Ce=ye.clientY-be.top,f=Math.min(52,be.height*.2);if(!(Ce>be.height-f)){if(ye.clientX-be.left<be.width/2){l();return}d()}},se=ye=>{if(t.length<=1)return;const be=ye.currentTarget.getBoundingClientRect(),Ce=ye.clientX-be.left,f=ye.clientY-be.top,q=Math.min(52,be.height*.2);if(f>be.height-q){ye.currentTarget.style.cursor="default";return}ye.currentTarget.style.cursor=Ce<be.width/2?"w-resize":"e-resize"},oe=s.useCallback(ye=>{ye.propertyName!=="transform"||!j.current||(ue(),k(!1))},[ue,k]),Pe=ie?`translateX(${H}px)`:$>0?`translateY(${$}px)`:void 0,$e={position:"fixed",top:A==null?void 0:A.top,left:A==null?void 0:A.left,width:A==null?void 0:A.width,height:A==null?void 0:A.height,objectFit:i==="cover"?"cover":"contain",transform:Pe,opacity:$>0?me:W==="opening"||ke?0:1,transition:D&&!C?"none":C?`transform ${Kn}ms ${Oi}`:U?`transform ${Kn}ms ${Oi}, opacity ${Kn}ms ${Oi}`:W==="opening"||ke?`opacity ${Kn}ms ${Oi}`:"none",pointerEvents:ae&&we&&!ie?"auto":"none",touchAction:ae&&we?"none":void 0,zIndex:9998},Me=A?{position:"fixed",top:A.top,height:A.height,width:A.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:W==="open"?"none":void 0},onClick:te,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:we?fe:0,transition:D?"none":`opacity ${Kn}ms ${Oi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:x?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:we?1:0,transition:`opacity ${Kn}ms ${Oi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,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:we?1:0,transition:`opacity ${Kn}ms ${Oi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),A&&B&&(ae?a.jsx(kS,{src:B.url,phase:W,mediaRef:m,mediaStyle:$e,onLoadedMetadata:le,onClick:Z,onMouseMove:se,onTransitionEnd:oe},`${n}-${B.url}`):a.jsx("img",{ref:m,src:B.url,alt:B.name,onLoad:le,onTransitionEnd:oe,style:$e},`${n}-${B.url}`)),we&&Me&&t.length>1&&!ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Me,left:A.left,cursor:"w-resize",pointerEvents:ie?"none":"auto"},onClick:ye=>{if(w.current){w.current=!1;return}ye.stopPropagation(),l()}}),a.jsx("div",{style:{...Me,left:A.left+A.width/2,cursor:"e-resize",pointerEvents:ie?"none":"auto"},onClick:ye=>{if(w.current){w.current=!1;return}ye.stopPropagation(),d()}})]})]})}function Qc({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const x=`${e}-gallery-${Os(t)?"video":"image"}`,v=r.display==="cover",m=RS(r),g=W=>N.scalingValue(W,l??!1),h=n??mo,b=o?{width:"100%",maxWidth:"100%"}:{width:g(h),maxWidth:"100%"},E=i?{borderRadius:g(i)}:{},y={...b,...v?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...E},w={...v?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(h)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...v?{}:E},G={className:x,style:w,onClick:p?W=>{W.stopPropagation(),p()}:void 0},A=Math.max(d,zi),P=Os(t)?a.jsx("video",{...G,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...G,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[v?a.jsx("div",{style:y,children:P}):P,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:g(d)},"aria-hidden":"true"}),u&&c&&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:g(A)}})]})}function MS({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const x=t==="a"?i:t==="c"?o:0,v=x>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"aria-hidden":"true"}),c&&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(d),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(x)},"aria-hidden":"true"}),c&&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(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function AS(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function ed({P:e,scaled:t,height:n,paired:i}){return a.jsx("div",{"data-controls":"titleTopPadding",...i?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:t(n)}})}function td({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:d}){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%",...d}})}function ps({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:r,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=s.useRef(null),[x,v]=s.useState(0),m=t??"",g=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!g)return;const h=p.current;if(!h||typeof ResizeObserver>"u")return;const b=()=>v(h.offsetHeight);b();const E=new ResizeObserver(b);return E.observe(h),()=>E.disconnect()},[m,g]),a.jsx("div",{ref:h=>{p.current=h,i(h)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...g?{[`--${e}-title-height`]:`${x}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:m})})]})})}const nd=45;function id(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 FS(e){const t=id(e,"--cntrl-viewport-height",window.innerHeight),n=id(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function NS(e,t,n){const{top:i,centerY:o}=FS(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const r=e.top+e.height/2;return Math.abs(r-o)}function _S(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=NS(u,n,c);return Math.exp(-(p*p)/(2*nd*nd))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function WS(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(c,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 c=0;const u=()=>{l(_S(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:r}}function HS(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),d=Math.max(r.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...r.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function OS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var qe;const{prefix:l}=N.useScopedStyles(),d=s.useMemo(()=>gS(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",x=(e==null?void 0:e.imgWidth)??mo,v=(e==null?void 0:e.titleWidth)??LS,m=IS(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??pS,h=(e==null?void 0:e.position)??"center",b=(e==null?void 0:e.titleTopPadding)??0,E=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,w=AS(e==null?void 0:e.transition),j=(e==null?void 0:e.lightbox)??"on",G=p==="b",A=w==="fade"||w==="retype",{setTitleRef:P,dominantIndex:W}=WS(c.length,A,h),Y=((qe=c[W])==null?void 0:qe.title)??"",$=HS(Y,w==="retype"),I=w==="fade"||w==="retype",H=w==="retype"?$:Y,O=G?void 0:{width:N.scalingValue(x,n??!1)},C=j==="on"&&(!n||i||o),L=o??!1,D=(e==null?void 0:e.galleryPaddingRight)??0,S=(e==null?void 0:e.galleryPaddingLeft)??0,U=(e==null?void 0:e.galleryPaddingBetween)??0,T=nt=>N.scalingValue(nt,n??!1),B={width:T(v)},ae=p==="a"?D:S,ie=G?{width:"100%"}:{width:`calc(100% - ${T(x)} - ${T(ae)})`,...p==="c"?{marginLeft:"auto"}:{}},k=Math.max(D,zi),ue=Math.max(S,zi),X=Math.max(U,zi),le=Math.max(b,zi),te=Math.max(E,zi),we=Math.max(y,zi),ke=Math.max(0,(u??1)-(x??mo)),fe=p==="a"?Math.max(0,(u??1)-(x??mo)-D):p==="c"?Math.max(0,(u??1)-(x??mo)-S):p==="b"?u??1:1,me=L&&(p==="a"||p==="b"||p==="c")&&h==="top",Z=L&&((p==="a"||p==="b")&&(h==="left"||h==="top")||p==="c"&&(h==="left"||h==="top")),se=L&&((p==="c"||p==="b")&&h==="right"||p==="a"&&h==="right"),oe=c.length>1,Pe=G?void 0:T((p==="c"?S:D)+(x??mo)),$e=p==="c"&&Pe?{left:Pe}:void 0,Me=p==="a"&&Pe?{right:Pe}:void 0,ye=G?{left:0,width:"100%"}:p==="a"?{right:T(D),width:T(x)}:{left:T(S),width:T(x)},{titleColor:be,titleFontFamily:Ce,titleFontSettings:f,titleFontSize:q,titleLineHeight:K,titleLetterSpacing:ne,titleWordSpacing:ge,titleAlign:z,titleTextAppearance:R,lightboxCounterColor:Q,lightboxCounterFontFamily:ee,lightboxCounterFontSettings:ce,lightboxCounterFontSize:V,lightboxCounterLineHeight:Le,lightboxCounterLetterSpacing:ve,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:_e}=e??{},Be={fontSettings:{fontFamily:Ce,fontWeight:(f==null?void 0:f.fontWeight)??400,fontStyle:(f==null?void 0:f.fontStyle)??"normal"},fontSize:q??.01,lineHeight:K,letterSpacing:ne??0,wordSpacing:ge??0,textAlign:z??"left",textAppearance:R,color:be??"#000000"},Ue=dn(Qt(Be,n)),et=B,Je=Jc(q,K,l,n),Ye=Zc(q,K,`${l}-title`,`${l}-text-tight-leading`),xe={fontSettings:{fontFamily:ee,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:V??.01,lineHeight:Le,letterSpacing:ve??0,wordSpacing:J??0,textAppearance:_e,color:Q??"#DEDDDD"},He={...dn(Qt(xe,n)),...Jc(V,Le,l,n)},Qe=Zc(V,Le,`${l}-lightbox-counter`,`${l}-text-tight-leading`),he=N.buildColorVars(l,{titleColor:be??"#000000",lightboxCounterColor:Q??"#DEDDDD"},vS,xS),Ne=s.useRef(null),[Ve,tt]=s.useState(!1),[mt,st]=s.useState([]),[De,Fe]=s.useState(0),Xe=s.useCallback((nt,de)=>{C&&(st(nt),Fe(de),tt(!0))},[C]),ot=s.useCallback(()=>{tt(!1)},[]),Oe=s.useMemo(()=>{const nt={...he},de=Ne.current?getComputedStyle(Ne.current).getPropertyValue("--cntrl-article-width").trim():"";return de&&(nt["--cntrl-article-width"]=de),nt},[he,Ve]);return s.useEffect(()=>{if(!Ve||j!=="on"||typeof document>"u")return;const nt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=nt}},[Ve,j]),s.useEffect(()=>{!n||o||i||tt(!1)},[n,o,i]),s.useEffect(()=>{j==="off"&&tt(!1)},[j]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:he,children:a.jsxs("div",{ref:Ne,className:`${l}-wrapper`,style:{width:N.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&h==="top"?T(b):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(h==="left"||h==="top")||p==="c"&&(h==="left"||h==="top")?T(E):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&h==="right"||p==="a"&&h==="right"?T(y):void 0},children:[I&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(ps,{P:l,title:H,position:h,titleRef:()=>{},titleClassName:`${Ye} ${l}-single-title`,titleContainerStyle:{...Je,...ie},titleTextBoxStyle:et,titleStyle:Ue,showTextBoxOutline:L,topPaddingControl:me?ed({P:l,scaled:T,height:le,paired:!1}):void 0})}),c.map((nt,de)=>{const Ie=$S(nt.gallery),it=de<c.length-1,ut=Ie.filter(pt=>pt.lightboxMedia).map(pt=>pt.lightboxMedia),je={P:l,position:h,titleRef:P(de),titleClassName:Ye,titleContainerStyle:Je,titleTextBoxStyle:I?{maxWidth:"100%"}:et,titleStyle:Ue,showTextBoxOutline:L&&!I,topPaddingControl:me&&!I?ed({P:l,scaled:T,height:le,paired:oe}):void 0};return a.jsxs("div",{"data-item-index":de,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:it?T(U):void 0},children:[Z&&td({P:l,controlKey:"titleLeftPadding",scaled:T,width:te,maxFraction:fe,side:"left",paired:oe,anchorStyle:$e}),se&&td({P:l,controlKey:"titleRightPadding",scaled:T,width:we,maxFraction:fe,side:"right",paired:oe,anchorStyle:Me}),L&&it&&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(X),...ye}}),G?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Ie.map(({displayMedia:pt,lightboxMedia:Tt},Lt)=>{const xt=Tt?ut.findIndex(Et=>Et.url===Tt.url):-1;return a.jsx(Qc,{P:l,media:pt,imgWidth:x||void 0,cornerRadius:g||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:U,showPaddingAfter:Lt<Ie.length-1,showControls:L,onMediaClick:C&&xt>=0?()=>Xe(ut,xt):void 0},`${pt.url}-${Lt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(ps,{...je,title:I?"":nt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(ps,{...je,title:I?"":nt.title}),Ie.length>0&&a.jsx(MS,{P:l,layoutType:p,galleryWidthStyle:O,galleryPaddingRight:D,galleryPaddingLeft:S,galleryPaddingRightWidth:k,galleryPaddingLeftWidth:ue,galleryPaddingMaxFraction:ke,showControls:L,scaled:T,children:Ie.map(({displayMedia:pt,lightboxMedia:Tt},Lt)=>{const xt=Tt?ut.findIndex(Et=>Et.url===Tt.url):-1;return a.jsx(Qc,{P:l,media:pt,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:U,showPaddingAfter:Lt<Ie.length-1,showControls:L,onMediaClick:C&&xt>=0?()=>Xe(ut,xt):void 0},`${pt.url}-${Lt}`)})})]})]},de)})]})}),Ve&&j==="on"&&typeof document<"u"&&e&&(()=>{const nt=(r?document.getElementById(r):null)??document.body;return si.createPortal(a.jsx("div",{style:Oe,"data-selection":"none",children:a.jsx(ES,{prefix:l,items:mt,index:De,imageDisplay:PS(e.lightboxImageDisplay),isEditor:n,onClose:ot,onPrev:()=>Fe(de=>(de-1+mt.length)%mt.length),onNext:()=>Fe(de=>(de+1)%mt.length),counterClassName:Qe,counterStyle:He,backgroundColor:e.backgroundColor??hS})}),nt)})()]})}const DS=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21073
21077
|
import { createPortal } from 'react-dom';
|
|
21074
21078
|
import type React from 'react';
|
|
21075
21079
|
import { CommonComponentProps } from '../props';
|
|
@@ -23164,10 +23168,10 @@ export function Mercury({
|
|
|
23164
23168
|
object-position: center;
|
|
23165
23169
|
}
|
|
23166
23170
|
${t}
|
|
23167
|
-
`}function Rr(e){return Number(e.toFixed(4))}function rd(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 gs(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 aw(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 sw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function lw(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.url??"")}function tp(e,t){return(1-e)/(1-e*Math.cos(t))}function cw(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)*tp(e,i)))}return t||1}function dw(e,t){return e?1:1+ep*(.35+t)}function uw(e,t,n,i){const o=t*dw(n,i);return Math.max(0,(e-o)/2)}function np(e,t,n){const i=tp(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function ip(e,t,n){return e/2+t*n}function pw(e,t,n){return e(t-n/2)}function mw(e,t){return e*t}function op(e){return Math.round(e*1e3)}function rp(e,t,n){const i=Math.cos(e),o=Math.cos(ow*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return Rr(t+(n-t)*r)}function ap(e){return rp(e,ew,tw)}function gw(e){return rp(e,nw,iw)}function sp(e,t){if(!t)return"none";const n=gw(e);return n<=0?"none":`blur(${n}px)`}function hw(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=np(i,o,r*Math.PI*2),p=r*Math.PI*2,
|
|
23171
|
+
`}function Rr(e){return Number(e.toFixed(4))}function rd(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 gs(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 aw(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 sw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function lw(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.url??"")}function tp(e,t){return(1-e)/(1-e*Math.cos(t))}function cw(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)*tp(e,i)))}return t||1}function dw(e,t){return e?1:1+ep*(.35+t)}function uw(e,t,n,i){const o=t*dw(n,i);return Math.max(0,(e-o)/2)}function np(e,t,n){const i=tp(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function ip(e,t,n){return e/2+t*n}function pw(e,t,n){return e(t-n/2)}function mw(e,t){return e*t}function op(e){return Math.round(e*1e3)}function rp(e,t,n){const i=Math.cos(e),o=Math.cos(ow*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return Rr(t+(n-t)*r)}function ap(e){return rp(e,ew,tw)}function gw(e){return rp(e,nw,iw)}function sp(e,t){if(!t)return"none";const n=gw(e);return n<=0?"none":`blur(${n}px)`}function hw(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=np(i,o,r*Math.PI*2),p=r*Math.PI*2,x=ip(t,n,c),v=Rr(u),m=`calc(${e(x)} - var(--helix-base-w) * ${v} / 2)`,g=`calc(var(--helix-base-w) * ${v})`,h=l?`height: calc(var(--helix-base-h) * ${v});`:"";return`left: ${m}; width: ${g}; ${h} z-index: ${op(u)}; transform: translateY(-50%); opacity: ${ap(p)}; filter: ${sp(p,d)};`}function fw(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=od;u+=1){const p=u/od;c.push(` ${Rr(p*100)}% { ${hw(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
|
|
23168
23172
|
${c.join(`
|
|
23169
23173
|
`)}
|
|
23170
|
-
}`}function lp(e,t){return(e%t+t)%t}function yw(e,t){return Ml(e,t)/t}function Ml(e,t){return lp(e,t)}function vw(e,t){return Math.floor(e/t)}function xw(e,t,n,i){return vw(e,t)*n+Ml(e,t)*i}function bw(e,t,n){const i=n==="left"?1-e:e;return`${Rr(-i*t)}s`}function ad(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function cp(e){const t=e%1;return t<0?t+1:t}function Sw(e,t,n){const i=t/Qu,o=n==="left"?-e*i:e*i;return cp(o)}function ww({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=
|
|
23174
|
+
}`}function lp(e,t){return(e%t+t)%t}function yw(e,t){return Ml(e,t)/t}function Ml(e,t){return lp(e,t)}function vw(e,t){return Math.floor(e/t)}function xw(e,t,n,i){return vw(e,t)*n+Ml(e,t)*i}function bw(e,t,n){const i=n==="left"?1-e:e;return`${Rr(-i*t)}s`}function ad(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function cp(e){const t=e%1;return t<0?t+1:t}function Sw(e,t,n){const i=t/Qu,o=n==="left"?-e*i:e*i;return cp(o)}function ww({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=N.useScopedStyles(),r=s.useRef(null),l=gs((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),XS),d=gs(e==null?void 0:e.imageWidth,qS),c=gs(e==null?void 0:e.turnHeight,US),u=rd(e==null?void 0:e.itemsPerTurn,YS,3,40),p=rd(e==null?void 0:e.turns,KS,1,30),x=Math.min(QS,Math.max(0,ZS)),v=Math.min(1,Math.max(0,JS)),m=Math.max(0,(e==null?void 0:e.speed)??Qu),g=(e==null?void 0:e.direction)==="left"?"left":"right",h=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",b=(e==null?void 0:e.cornerRadius)??0,E=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>aw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),w=y.display==="cover",j=ie=>N.scalingValue(ie,n??!1),G=s.useMemo(()=>cw(x),[x]),A=s.useMemo(()=>uw(l,d,w,v),[l,d,w,v]),P=s.useMemo(()=>rw(o,fw(o,j,l,A,x,G,w,E)),[o,l,A,x,G,w,E,n]),W=s.useMemo(()=>(t??[]).filter(ie=>{var k;return!!((k=ie.image)!=null&&k.url)}),[t]),Y=c/u,$=d*sw(y),I=Math.min(VS,p*u),H=GS*u,O=I+H*2,L=Math.max(0,p-1)*c+(u-1)*Y,D=m>0,S=h==="scroll"&&D,U=h==="autoplay"&&D&&(n?!!i:!0),[T,_]=s.useState(0);s.useEffect(()=>{if(!S)return;const ie=r.current;if(!ie)return;const k=()=>{const X=ie.getBoundingClientRect(),le=window.innerHeight||document.documentElement.clientHeight,te=le+X.height;te<=0||_(Math.min(1,Math.max(0,(le-X.top)/te)))};k(),window.addEventListener("scroll",k,{passive:!0}),window.addEventListener("resize",k);const ue=new ResizeObserver(k);return ue.observe(ie),()=>{window.removeEventListener("scroll",k),window.removeEventListener("resize",k),ue.disconnect()}},[S]);const B=S?Sw(T,m,g):0,ae=D&&h==="autoplay"?360/(m*jS):0;return W.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:j(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:j(l),height:j(L),marginInline:"auto"},children:Array.from({length:O},(ie,k)=>{const ue=k-H,le=W[lp(ue,W.length)].image,te=Ml(ue,u),we=yw(ue,u),ke=S?cp(we+B):we,fe=xw(ue,u,c,Y),me=v===0?0:(ad(te+7.3)-.5)*v*Y,Z=w?1:1+(ad(te+3.1)-.5)*2*ep*(.35+v),se=ke*Math.PI*2,{offset:oe,scale:Pe}=np(x,G,se),$e=d*Z,Me=mw($e,Pe),ye=ip(l,A,oe),be={"--helix-base-w":j($e),...w?{"--helix-base-h":j($)}:{}},Ce={top:j(fe+me),transform:"translateY(-50%)",...be,...U?{animationDuration:`${Rr(ae)}s`,animationDelay:bw(we,ae,g),animationDirection:g==="left"?"reverse":"normal"}:{left:pw(j,ye,Me),width:j(Me),...w?{height:j($*Pe)}:{},zIndex:op(Pe),opacity:ap(se),filter:sp(se,E)}},f=b>0?{borderRadius:j(b)}:{},q=w?{...f,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:f,K=lw(le)?a.jsx("video",{className:`${o}-media`,style:q,src:le.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:q,src:le.url,alt:le.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:U?`${o}-item`:`${o}-item ${o}-item-static`,style:Ce,children:w?a.jsx("div",{className:`${o}-cover`,style:f,children:K}):K},`${p}-${u}-${ue}`)})})]})}const $w=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
23171
23175
|
import { CommonComponentProps } from '../props';
|
|
23172
23176
|
import { scalingValue } from '../utils/scalingValue';
|
|
23173
23177
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -23705,7 +23709,7 @@ export function Helix({
|
|
|
23705
23709
|
</>
|
|
23706
23710
|
);
|
|
23707
23711
|
}
|
|
23708
|
-
`,Cw=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],Tw={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:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:Cw.map(e=>({image:{url: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"]}]}]},Lw={element:ww,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:Tw,sourceCode:$w,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Sn=300,en=300,Iw=8/1440,ho=.004,Rw=50,Pw=1440,Vi=Rw/Pw;function kw(e){if(e==="default"||e==="compact"||e==="open")return e;if(e==="onScroll")return"compact"}function Ew(e){return e==="center"||e==="right"?e:"left"}function Mw(e){return e==="left"||e==="right"?e:"center"}function Aw(e,t,n){const i=F.scalingValue(t,n);return e==="center"?`translateX(calc(-50% + ${i}))`:`translateX(${i})`}function Fw(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 dp(e,t){const n=(Fw(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 Nw(e,t,n){switch(dp(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 _w(e,t){switch(dp(e.showIn,t)){case"default and compact":return!1;default:return!0}}function Ww(e,t){if(!e)return"";const n=t==null?void 0:t.find(i=>i.id===e);return n?n.slug===""?"/":`/${n.slug}`:e.startsWith("/")||e.startsWith("#")||/^[a-z][a-z\d+\-.]*:/i.test(e)?e:t?`/${e}`:e}function sd(e){const t=(e??"").toLowerCase();return t==="blank"||t==="_blank"||t.includes("new")}function up(e){const t=e.link;if(t&&typeof t=="object"){const i=sd(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=sd(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 Ds(e,t){const n=e.label||"Link",i=up(e);if(i.type==="url")return{label:n,href:i.value,target:i.target};if(i.type==="anchor"){const d=i.value.replace(/^#/,"");return{label:n,href:d?`#${d}`:"",target:i.target}}const o=Ww(i.value,t),r=(i.anchor??"").replace(/^#/,""),l=r?o?`${o}#${r}`:`#${r}`:o;return{label:n,href:l,target:i.target}}const fi=24,hi=fi*.125,pp=fi*.125,hs=(fi-(3*hi+2*pp))/2,ld=hi+pp;function Hw({className:e,lineClassName:t}){return a.jsxs("svg",{className:e,viewBox:`0 0 ${fi} ${fi}`,"aria-hidden":"true",children:[a.jsx("rect",{className:`${t} ${t}-top`,x:"0",y:hs,width:fi,height:hi,rx:hi/2}),a.jsx("rect",{className:`${t} ${t}-mid`,x:"0",y:hs+ld,width:fi,height:hi,rx:hi/2}),a.jsx("rect",{className:`${t} ${t}-bot`,x:"0",y:hs+2*ld,width:fi,height:hi,rx:hi/2})]})}function Ow(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Dw(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 cd(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 dd(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:{...dn(Qt(i,n)),...Dw(t.fontSize,t.lineHeight,e,n)},className:Ow(t.fontSize,t.lineHeight,`${e}-link-text`,`${e}-text-tight-leading`)}}function ud(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 pd(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 mp(e){const n=Math.max(Vi,e.fontSize??Vi),{start:i,end:o}=pd(e.textPaddingTop,e.textPaddingBottom,1,n),{start:r,end:l}=pd(e.textPaddingLeft,e.textPaddingRight,1,Vi);return{effectivePaddingLeft:r,effectivePaddingRight:l,effectivePaddingTop:i,effectivePaddingBottom:o,panelSize:1}}function zw(e){if(e==="center"||e==="center-center")return{horizontalAlign:"center",verticalAlign:"center"};const[t,n]=e.split("-");return{horizontalAlign:t,verticalAlign:n}}function Bw(e){return e.position?zw(e.position):{horizontalAlign:e.horizontalAlign??"left",verticalAlign:e.verticalAlign??"top"}}function jw(e,t){return e.textPaddingLeft!==t.textPaddingLeft||e.textPaddingRight!==t.textPaddingRight||e.textPaddingTop!==t.textPaddingTop||e.textPaddingBottom!==t.textPaddingBottom}const Vw=[["onScrollIconColor","compactIconColor"],["onScrollCloseButtonColor","compactCloseButtonColor"],["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 gp(e){var o,r;const t=e,n={};for(const[l,d]of Vw)e[d]!==void 0||t[l]===void 0||(n[d]=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 md(e){var o,r,l,d,c,u,p,v,y,m,g,f,x,R,b,S,G,D;e=gp(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 j=((r=(o=e.stateOverrides)==null?void 0:o.open)==null?void 0:r.openLinkColor)??((d=(l=e.stateOverrides)==null?void 0:l.open)==null?void 0:d.linkColor)??e.linkColor;j!==void 0&&(n.openLinkColor=j)}if(e.compactIconColor===void 0){const j=((u=(c=e.stateOverrides)==null?void 0:c.compact)==null?void 0:u.iconColor)??e.iconColor;j!==void 0&&(n.compactIconColor=j)}if(e.compactCloseButtonColor===void 0){const j=((v=(p=e.stateOverrides)==null?void 0:p.compact)==null?void 0:v.closeButtonColor)??e.closeButtonColor;j!==void 0&&(n.compactCloseButtonColor=j)}if(e.compactLinkColor===void 0){const j=((m=(y=e.stateOverrides)==null?void 0:y.compact)==null?void 0:m.linkColor)??e.linkColor;j!==void 0&&(n.compactLinkColor=j)}if(e.compactLogoColor===void 0){const j=((f=(g=e.stateOverrides)==null?void 0:g.compact)==null?void 0:f.logoColor)??e.logoColor;j!==void 0&&(n.compactLogoColor=j)}if(e.openLogoColor===void 0){const j=((R=(x=e.stateOverrides)==null?void 0:x.open)==null?void 0:R.logoColor)??e.logoColor;j!==void 0&&(n.openLogoColor=j)}if(e.compactBackgroundColor===void 0){const j=((S=(b=e.stateOverrides)==null?void 0:b.compact)==null?void 0:S.backgroundColor)??((D=(G=t.stateOverrides)==null?void 0:G.compact)==null?void 0:D.panelColor)??t.compactPanelColor??t.onScrollPanelColor??e.backgroundColor??n.backgroundColor;j!==void 0&&(n.compactBackgroundColor=j)}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=(j,P)=>{if(e[j]!==void 0)return;const M=e[P];M!==void 0&&(n[j]=M)};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 Gw(e,t){const n=mp({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 Xw(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 qw(e,t,n,i){const o=Math.max(Vi,n??Vi),r=Math.max(t.effectivePaddingTop,ho),l=Math.max(t.effectivePaddingBottom,ho),d=Math.max(0,t.panelSize-t.effectivePaddingBottom-o),c=Math.max(0,t.panelSize-t.effectivePaddingTop-o),u=Math.max(t.effectivePaddingLeft,ho),p=Math.max(t.effectivePaddingRight,ho),v=Math.max(0,t.panelSize-t.effectivePaddingRight-Vi),y=Math.max(0,t.panelSize-t.effectivePaddingLeft-Vi);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(d),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(c),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(y),className:`${e}-control-anchor`,style:{top:0,right:0,width:i(p),height:"100%"}})]})}const Uw={iconColor:"icon-color",closeButtonColor:"close-button-color",linkColor:"link-color",openLinkColor:"menu-link-color",compactIconColor:"compact-icon-color",compactCloseButtonColor:"compact-close-button-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"},Yw=["hover","open"],Kw={top:"flex-start",center:"center",bottom:"flex-end"},Zw={left:"flex-start",center:"center",right:"flex-end"};function Jw(e){return`
|
|
23712
|
+
`,Cw=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],Tw={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:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:Cw.map(e=>({image:{url: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"]}]}]},Lw={element:ww,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:Tw,sourceCode:$w,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Sn=300,en=300,Iw=8/1440,ho=.004,Rw=50,Pw=1440,Vi=Rw/Pw;function kw(e){if(e==="default"||e==="compact"||e==="open")return e;if(e==="onScroll")return"compact"}function Ew(e){return e==="center"||e==="right"?e:"left"}function Mw(e){return e==="left"||e==="right"?e:"center"}function Aw(e,t,n){const i=N.scalingValue(t,n);return e==="center"?`translateX(calc(-50% + ${i}))`:`translateX(${i})`}function Fw(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 dp(e,t){const n=(Fw(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 Nw(e,t,n){switch(dp(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 _w(e,t){switch(dp(e.showIn,t)){case"default and compact":return!1;default:return!0}}function Ww(e,t){if(!e)return"";const n=t==null?void 0:t.find(i=>i.id===e);return n?n.slug===""?"/":`/${n.slug}`:e.startsWith("/")||e.startsWith("#")||/^[a-z][a-z\d+\-.]*:/i.test(e)?e:t?`/${e}`:e}function sd(e){const t=(e??"").toLowerCase();return t==="blank"||t==="_blank"||t.includes("new")}function up(e){const t=e.link;if(t&&typeof t=="object"){const i=sd(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=sd(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 Ds(e,t){const n=e.label||"Link",i=up(e);if(i.type==="url")return{label:n,href:i.value,target:i.target};if(i.type==="anchor"){const d=i.value.replace(/^#/,"");return{label:n,href:d?`#${d}`:"",target:i.target}}const o=Ww(i.value,t),r=(i.anchor??"").replace(/^#/,""),l=r?o?`${o}#${r}`:`#${r}`:o;return{label:n,href:l,target:i.target}}const yi=24,fi=yi*.125,pp=yi*.125,hs=(yi-(3*fi+2*pp))/2,ld=fi+pp;function Hw({className:e,lineClassName:t}){return a.jsxs("svg",{className:e,viewBox:`0 0 ${yi} ${yi}`,"aria-hidden":"true",children:[a.jsx("rect",{className:`${t} ${t}-top`,x:"0",y:hs,width:yi,height:fi,rx:fi/2}),a.jsx("rect",{className:`${t} ${t}-mid`,x:"0",y:hs+ld,width:yi,height:fi,rx:fi/2}),a.jsx("rect",{className:`${t} ${t}-bot`,x:"0",y:hs+2*ld,width:yi,height:fi,rx:fi/2})]})}function Ow(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Dw(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:N.scalingValue((o-t)/2,i)}}function cd(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 dd(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:{...dn(Qt(i,n)),...Dw(t.fontSize,t.lineHeight,e,n)},className:Ow(t.fontSize,t.lineHeight,`${e}-link-text`,`${e}-text-tight-leading`)}}function ud(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 pd(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 mp(e){const n=Math.max(Vi,e.fontSize??Vi),{start:i,end:o}=pd(e.textPaddingTop,e.textPaddingBottom,1,n),{start:r,end:l}=pd(e.textPaddingLeft,e.textPaddingRight,1,Vi);return{effectivePaddingLeft:r,effectivePaddingRight:l,effectivePaddingTop:i,effectivePaddingBottom:o,panelSize:1}}function zw(e){if(e==="center"||e==="center-center")return{horizontalAlign:"center",verticalAlign:"center"};const[t,n]=e.split("-");return{horizontalAlign:t,verticalAlign:n}}function Bw(e){return e.position?zw(e.position):{horizontalAlign:e.horizontalAlign??"left",verticalAlign:e.verticalAlign??"top"}}function jw(e,t){return e.textPaddingLeft!==t.textPaddingLeft||e.textPaddingRight!==t.textPaddingRight||e.textPaddingTop!==t.textPaddingTop||e.textPaddingBottom!==t.textPaddingBottom}const Vw=[["onScrollIconColor","compactIconColor"],["onScrollCloseButtonColor","compactCloseButtonColor"],["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 gp(e){var o,r;const t=e,n={};for(const[l,d]of Vw)e[d]!==void 0||t[l]===void 0||(n[d]=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 md(e){var o,r,l,d,c,u,p,x,v,m,g,h,b,E,y,w,j,G;e=gp(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 A=((r=(o=e.stateOverrides)==null?void 0:o.open)==null?void 0:r.openLinkColor)??((d=(l=e.stateOverrides)==null?void 0:l.open)==null?void 0:d.linkColor)??e.linkColor;A!==void 0&&(n.openLinkColor=A)}if(e.compactIconColor===void 0){const A=((u=(c=e.stateOverrides)==null?void 0:c.compact)==null?void 0:u.iconColor)??e.iconColor;A!==void 0&&(n.compactIconColor=A)}if(e.compactCloseButtonColor===void 0){const A=((x=(p=e.stateOverrides)==null?void 0:p.compact)==null?void 0:x.closeButtonColor)??e.closeButtonColor;A!==void 0&&(n.compactCloseButtonColor=A)}if(e.compactLinkColor===void 0){const A=((m=(v=e.stateOverrides)==null?void 0:v.compact)==null?void 0:m.linkColor)??e.linkColor;A!==void 0&&(n.compactLinkColor=A)}if(e.compactLogoColor===void 0){const A=((h=(g=e.stateOverrides)==null?void 0:g.compact)==null?void 0:h.logoColor)??e.logoColor;A!==void 0&&(n.compactLogoColor=A)}if(e.openLogoColor===void 0){const A=((E=(b=e.stateOverrides)==null?void 0:b.open)==null?void 0:E.logoColor)??e.logoColor;A!==void 0&&(n.openLogoColor=A)}if(e.compactBackgroundColor===void 0){const A=((w=(y=e.stateOverrides)==null?void 0:y.compact)==null?void 0:w.backgroundColor)??((G=(j=t.stateOverrides)==null?void 0:j.compact)==null?void 0:G.panelColor)??t.compactPanelColor??t.onScrollPanelColor??e.backgroundColor??n.backgroundColor;A!==void 0&&(n.compactBackgroundColor=A)}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=(A,P)=>{if(e[A]!==void 0)return;const W=e[P];W!==void 0&&(n[A]=W)};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 Gw(e,t){const n=mp({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 Xw(e,t){return{paddingLeft:N.scalingValue(e.effectivePaddingLeft,t),paddingRight:N.scalingValue(e.effectivePaddingRight,t),paddingTop:N.scalingValue(e.effectivePaddingTop,t),paddingBottom:N.scalingValue(e.effectivePaddingBottom,t)}}function qw(e,t,n,i){const o=Math.max(Vi,n??Vi),r=Math.max(t.effectivePaddingTop,ho),l=Math.max(t.effectivePaddingBottom,ho),d=Math.max(0,t.panelSize-t.effectivePaddingBottom-o),c=Math.max(0,t.panelSize-t.effectivePaddingTop-o),u=Math.max(t.effectivePaddingLeft,ho),p=Math.max(t.effectivePaddingRight,ho),x=Math.max(0,t.panelSize-t.effectivePaddingRight-Vi),v=Math.max(0,t.panelSize-t.effectivePaddingLeft-Vi);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(d),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(c),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(x),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 Uw={iconColor:"icon-color",closeButtonColor:"close-button-color",linkColor:"link-color",openLinkColor:"menu-link-color",compactIconColor:"compact-icon-color",compactCloseButtonColor:"compact-close-button-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"},Yw=["hover","open"],Kw={top:"flex-start",center:"center",bottom:"flex-end"},Zw={left:"flex-start",center:"center",right:"flex-end"};function Jw(e){return`
|
|
23709
23713
|
.${e}-root {
|
|
23710
23714
|
position: relative;
|
|
23711
23715
|
display: block;
|
|
@@ -24273,7 +24277,7 @@ export function Helix({
|
|
|
24273
24277
|
word-spacing ${en}ms ease,
|
|
24274
24278
|
padding ${en}ms ease;
|
|
24275
24279
|
}
|
|
24276
|
-
`}function Qw(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function e$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function t$(e){const t=e$(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 n$(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function i$(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function gd(e){if(!e)return!1;const t=document.getElementById(e),n=document.querySelector(`[data-section-id="${CSS.escape(e)}"]`),i=t??n;return i instanceof HTMLElement?(i.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function o$(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:d}=n,c=e.currentTarget.getAttribute("href")??"",u=n$(c),p=e.currentTarget.target==="_blank";if(r&&d){e.preventDefault(),e.stopPropagation();const v=Ds(r,l),y=up(r);d({mode:y.type==="url"?"url":"page",href:v.href||c,page:y.type==="page"?y.value:void 0,url:y.type==="url"?y.value:void 0,anchor:y.type==="anchor"?y.value.replace(/^#/,""):(y.anchor??"").replace(/^#/,""),target:v.target}),t();return}if(i){e.preventDefault(),gd(u),t();return}!p&&u&&i$(c)&&gd(u)&&e.preventDefault(),t()}const r$=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function a$(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function s$(e){const t={},n=a$(e);if(!n)return t;const i=getComputedStyle(n);for(const o of r$){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 l$({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,activeEvent:o,currentState:r,isSwitchClone:l=!1,unavailableStates:d=[],layoutId:c,pages:u,onLinkNavigate:p,onUpdateSettings:v,onOpenChange:y}){const{prefix:m}=F.useScopedStyles(),g=s.useRef(null),f=s.useRef(null),x=s.useRef(0),R=s.useRef(null),b=s.useRef(c),S=s.useMemo(()=>Jw(m),[m]),[G,D]=s.useState(!1),[j,P]=s.useState(!1),[M,K]=s.useState(!1),T=kw(r),L=s.useMemo(()=>new Set(d),[d]),_=Wt=>!!(Wt&&L.has(Wt)),$=!!(t&&!i&&T==="open"&&!_("open"))||!(t&&!i)&&G,k=!_("compact")&&!_("onScroll"),W=!t||!!i&&!n,w=o&&o!=="default"?o:void 0,U=k&&T==="compact"?"compact":"default",[C,O]=s.useState(U),[V,se]=s.useState(!1),ie=!n;U!==C&&(O(U),ie&&se(!0));const N=gp(e),{logo:de,logoMaxHeight:X=120/1440,logoPosition:ce="left",panelHeight:oe=60/1440,backgroundColor:fe="#b3b3b3",logoColor:Pe="#000000",position:xe,horizontalAlign:pe,verticalAlign:Z,iconColor:le="#000000",showIcon:re="on",iconSize:Ie=16/1440,linkColor:we="#000000",openLinkColor:Me="#000000",compactIconColor:ye="#000000",compactCloseButtonColor:be="#000000",compactLinkColor:Ce="#000000",compactLogoColor:h="#000000",compactBackgroundColor:q="#ffffff",compactLogoMaxHeight:Y=120/1440,compactLogoPosition:ee,compactPanelHeight:ve=60/1440,compactShowIcon:B="on",compactIconSize:I=16/1440,compactNavTextWidth:Q,compactNavTextPosition:ne,compactNavTextOffset:H,compactNavGap:te,compactNavPaddingLeft:ke=10/1440,compactNavPaddingRight:ge=10/1440,compactFontFamily:J,compactFontSettings:Ye,compactFontSize:je,compactLineHeight:it,compactLetterSpacing:qe=0,compactWordSpacing:et=0,compactTextAlign:Je="left",compactTextAppearance:Ge,openLogoColor:$e="#000000",menuBackgroundColor:He="#ffffff",overlayColor:De="rgba(0, 0, 0, 0.45)",closeButtonColor:Qe="#000000",effect:he="fade",textWidth:_e=280/1440,navTextWidth:Ve,navTextPosition:tt="center",navTextOffset:ft=0,gap:rt=0,navGap:Oe,navPaddingLeft:Fe=10/1440,navPaddingRight:Ee=10/1440,textPaddingLeft:Ze=10/1440,textPaddingRight:We=10/1440,textPaddingTop:ot=10/1440,textPaddingBottom:nt=10/1440,fontFamily:me,fontSettings:Ne,fontSize:st,lineHeight:ut,letterSpacing:Be=0,wordSpacing:pt=0,textAlign:Tt="left",textAppearance:Lt,openFontFamily:xt,openFontSettings:Et,openFontSize:Vt,openLineHeight:Ut,openLetterSpacing:Kt,openWordSpacing:Pt,openTextAlign:jt,openTextAppearance:on,stateOverrides:vt,link:Le}=N,{horizontalAlign:Xe,verticalAlign:lt}=Bw({position:xe,horizontalAlign:pe,verticalAlign:Z}),ct=U==="compact",wt=ct?Y:X,It=Ew(ct?ee:ce),gt=ct?ve:oe,Ot=ct?I:Ie,_t=ct?Q:Ve,Mt=Mw(ct?ne:tt),Gt=(ct?H:ft)??0,Xt=ct?te:Oe,Dt=ct?ke:Fe,zt=ct?ge:Ee,Bt=_t??_e,bt=$||(ct?B:re)!=="off",A=F.buildColorVars(m,{iconColor:le,closeButtonColor:Qe,linkColor:we,openLinkColor:Me,compactIconColor:ye,compactCloseButtonColor:be,compactLinkColor:Ce,compactLogoColor:h,compactBackgroundColor:q,openLogoColor:$e,menuBackgroundColor:He,overlayColor:De,backgroundColor:fe,logoColor:Pe},Uw,Yw,vt),Te=cd(ct?{fontFamily:J,fontSettings:Ye,fontSize:je,lineHeight:it,letterSpacing:qe,wordSpacing:et,textAlign:Je,textAppearance:Ge}:{fontFamily:me,fontSettings:Ne,fontSize:st,lineHeight:ut,letterSpacing:Be,wordSpacing:pt,textAlign:Tt,textAppearance:Lt}),Ae=cd({fontFamily:xt,fontSettings:Et,fontSize:Vt,lineHeight:Ut,letterSpacing:Kt,wordSpacing:Pt,textAlign:jt,textAppearance:on},Te),ze=dd(m,Te,t),mt=dd(m,Ae,t),Nt={...mt.css,whiteSpace:"pre-wrap"},ht=mt.className,St=Wt=>F.scalingValue(Wt,t),qt=Xt??rt,At=Math.max(Dt,ho),sn=Math.max(zt,ho),gn=Math.max(0,1-Ot),Xn=Math.max(0,1-Ot),yn=n??!1,qn=yn&&!$,ki=s.useMemo(()=>mp({textPaddingLeft:Ze,textPaddingRight:We,textPaddingTop:ot,textPaddingBottom:nt,fontSize:Ae.fontSize}),[Ze,We,ot,nt,Ae.fontSize]),Ji=Wt=>{const Yt=a.jsx("span",{className:ht,style:Nt,children:ud(Wt)});return hd(m,Yt,_e,yn,St)},Go={...Xw(ki,t),alignItems:Zw[Xe],justifyContent:Kw[lt]},un=s.useRef(e),An=s.useRef(c);s.useEffect(()=>{if(!v||!t){un.current=e,An.current=c;return}if(An.current!==c){un.current=e,An.current=c;const Mi=md(e);Mi!==e&&v(Mi);return}const Wt=md(e),Yt=un.current,vn=Yt!==e,Nn=vn?Gw(Wt,Yt):Wt;un.current=e;const Yn=Wt!==e,li=vn&&jw(Wt,Nn);!Yn&&!li||v(Nn)},[e,v,t,c]);const Rn=F.scalingValue(Ot,t),Un={width:Rn,height:Rn,minWidth:Rn,minHeight:Rn,maxWidth:Rn,maxHeight:Rn},Qi={...ze.css,textDecoration:"none"},Xo=ze.className,eo=(de==null?void 0:de.mode)!=="Off",Se=(de==null?void 0:de.icon)??"",Ke=t$(Se),E=St(Math.min(wt,gt)),ue=!!(eo&&Se&&It==="right")?"left":"right",Re=Array.isArray(Le)?Le:[],Ue=[U!=="default"?`${m}-state-${U}`:"",T==="open"?`${m}-state-open`:"",w&&w!==U&&w!==T?`${m}-state-${w}`:""].filter(Boolean).join(" "),dt=t&&!i?`${m}-editor`:"",Rt=W?`${m}-interactive`:"",Ft=ie&&(U!==C||V)?`${m}-nav-state-anim`:"",rn=$?`${m}-open`:"",nn=s.useMemo(()=>s$(g.current),[j,$,c]),Fn=()=>{D(!1)},si=(Wt,Yt)=>{o$(Wt,Fn,{isEditor:t,isPreviewMode:i,item:Yt,pages:u,onLinkNavigate:p})},to=()=>{t&&!i||D(Wt=>!Wt)},Ei=()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null)};s.useEffect(()=>{if(!V)return;const Wt=window.setTimeout(()=>{se(!1)},en);return()=>window.clearTimeout(Wt)},[V,U]),s.useEffect(()=>{if($){Ei(),P(!0);return}return x.current+=1,K(!1),Ei(),R.current=window.setTimeout(()=>{R.current=null,P(!1)},Sn),Ei},[$]),s.useLayoutEffect(()=>{b.current!==c&&(b.current=c,x.current+=1,Ei(),D(!1),K(!1),P(!1))},[c]),s.useLayoutEffect(()=>{var vn;if(!j||!$)return;const Wt=x.current+1;x.current=Wt,K(!1),(vn=f.current)==null||vn.offsetHeight;const Yt=requestAnimationFrame(()=>{x.current===Wt&&K(!0)});return()=>{cancelAnimationFrame(Yt)}},[j,$]),s.useEffect(()=>{y==null||y($)},[$,y]),s.useEffect(()=>{if(!$)return;const Wt=Yt=>{Yt.key==="Escape"&&(t&&i||Fn())};return window.addEventListener("keydown",Wt),()=>window.removeEventListener("keydown",Wt)},[$,t,i]),s.useEffect(()=>{t&&!i&&T!=="open"&&D(!1)},[t,i,T]),s.useEffect(()=>{i&&D(!1)},[i]);const Pr=yn&&$,_a=Wt=>Re.filter(Yt=>_w(Yt,c)).map((Yt,vn)=>{const{label:Nn,href:Yn,target:li}=Ds(Yt,u),Mi=Yn?a.jsx("a",{href:Yn,target:li,rel:li==="_blank"?"noopener noreferrer":void 0,className:`${Wt} ${m}-has-href`,onClick:Wa=>si(Wa,Yt),children:Ji(Nn)}):a.jsx("span",{className:Wt,children:Ji(Nn)});return a.jsxs(s.Fragment,{children:[vn>0&&a.jsx("div",{"data-controls":Pr?"gap":void 0,"data-controls-axis":"y",className:Pr?`${m}-gap-control`:void 0,style:{height:St(rt)}}),Mi]},vn)}),Tp=j?a.jsxs("div",{ref:f,"data-selection":"none",className:[`${m}-lightbox`,`${m}-full-lightbox ${m}-effect-${he}`,M?`${m}-lightbox-active`:"",`${m}-lightbox-editor`,n?`${m}-lightbox-edit-mode`:"",Rt,Ue].filter(Boolean).join(" "),style:{...A,...nn},"aria-hidden":!M,children:[a.jsx("button",{type:"button",className:`${m}-backdrop`,onClick:Fn,"aria-label":"Close menu"}),a.jsxs("nav",{className:`${m}-panel`,style:Go,"aria-label":"Menu",children:[yn&&qw(m,ki,Ae.fontSize,St),_a(`${m}-link`)]})]}):null,Lp=()=>a.jsx("button",{type:"button",className:`${m}-toggle`,onClick:to,"aria-expanded":$,"aria-label":$?"Close menu":"Open menu",children:a.jsx(Hw,{className:`${m}-icon`,lineClassName:`${m}-icon-line`})}),kr=Wt=>{const Yt=Wt==="left",vn=Yt?Dt:zt,Nn=Yt?At:sn,Yn=Yt?gn:Xn,li=ct?Yt?"compactNavPaddingLeft":"compactNavPaddingRight":Yt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Yt?`${m}-nav-padding-left`:`${m}-nav-padding-right`,style:{width:St(vn),flexShrink:0},children:qn?a.jsx("div",{"data-controls":li,"data-controls-axis":"x","data-controls-variant":"column-padding",...Yt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(Yn),className:`${m}-control-anchor`,style:{top:0,[Yt?"left":"right"]:0,width:St(Nn),height:"100%"}}):null})},Ip=(Wt,Yt)=>{const{label:vn,href:Nn,target:Yn}=Ds(Wt,u),li=a.jsx("span",{className:Xo,style:Qi,children:ud(vn)}),Mi=hd(m,li,Bt,qn,St),Wa=Nn?a.jsx("a",{href:Nn,target:Yn,rel:Yn==="_blank"?"noopener noreferrer":void 0,className:`${m}-nav-link ${m}-has-href`,onClick:kp=>si(kp,Wt),children:Mi}):a.jsx("span",{className:`${m}-nav-link`,children:Mi});return a.jsxs(s.Fragment,{children:[Yt>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:St(qt),flexShrink:0}}),Wa]},Yt)},Rp={...A,height:F.scalingValue(gt,t),minHeight:F.scalingValue(gt,t),[`--${m}-panel-height`]:F.scalingValue(gt,t)},Pp=l&&U==="default"&&T!=="open"&&!i?St(oe+Iw):"0px";return a.jsxs("div",{ref:g,className:`${m}-root ${Ue} ${dt} ${Rt} ${Ft}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:Pp,...A},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:S}}),a.jsx("div",{className:`${m}-nav-slide`,children:a.jsxs("div",{className:`${m}-nav-bar`,style:Rp,children:[eo&&Se?a.jsxs("div",{className:`${m}-nav-logo ${m}-nav-logo-${It}`,children:[It==="left"?kr("left"):null,a.jsxs("div",{className:`${m}-nav-logo-inner${Ke?` ${m}-nav-logo-tinted`:""}`,style:{height:E,...Ke?{[`--${m}-logo-image`]:Qw(Se)}:{}},children:[a.jsx("img",{src:Se,alt:"",className:`${m}-nav-logo-img`}),Ke?a.jsx("span",{className:`${m}-nav-logo-tint`,"aria-hidden":"true"}):null]}),It==="right"?kr("right"):null]}):null,a.jsx("nav",{className:`${m}-nav-links ${m}-nav-links-${Mt}`,style:{transform:Aw(Mt,Gt,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${m}-nav-links-inner`,children:Re.filter(Wt=>Nw(Wt,U,c)).map((Wt,Yt)=>Ip(Wt,Yt))})})]})}),Tp,a.jsxs("div",{className:`${m}-nav-toggle-wrap ${m}-nav-toggle-wrap-${ue}`,children:[ue==="left"?kr("left"):null,bt?a.jsx("div",{className:`${m}-root ${rn}`.trim(),style:Un,children:Lp()}):null,ue==="right"?kr("right"):null]})]})}const c$=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
24280
|
+
`}function Qw(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function e$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function t$(e){const t=e$(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 n$(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function i$(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function gd(e){if(!e)return!1;const t=document.getElementById(e),n=document.querySelector(`[data-section-id="${CSS.escape(e)}"]`),i=t??n;return i instanceof HTMLElement?(i.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function o$(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:d}=n,c=e.currentTarget.getAttribute("href")??"",u=n$(c),p=e.currentTarget.target==="_blank";if(r&&d){e.preventDefault(),e.stopPropagation();const x=Ds(r,l),v=up(r);d({mode:v.type==="url"?"url":"page",href:x.href||c,page:v.type==="page"?v.value:void 0,url:v.type==="url"?v.value:void 0,anchor:v.type==="anchor"?v.value.replace(/^#/,""):(v.anchor??"").replace(/^#/,""),target:x.target}),t();return}if(i){e.preventDefault(),gd(u),t();return}!p&&u&&i$(c)&&gd(u)&&e.preventDefault(),t()}const r$=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function a$(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function s$(e){const t={},n=a$(e);if(!n)return t;const i=getComputedStyle(n);for(const o of r$){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 l$({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,activeEvent:o,currentState:r,isSwitchClone:l=!1,unavailableStates:d=[],layoutId:c,pages:u,onLinkNavigate:p,onUpdateSettings:x,onOpenChange:v}){const{prefix:m}=N.useScopedStyles(),g=s.useRef(null),h=s.useRef(null),b=s.useRef(0),E=s.useRef(null),y=s.useRef(c),w=s.useMemo(()=>Jw(m),[m]),[j,G]=s.useState(!1),[A,P]=s.useState(!1),[W,Y]=s.useState(!1),$=kw(r),I=s.useMemo(()=>new Set(d),[d]),H=Wt=>!!(Wt&&I.has(Wt)),C=!!(t&&!i&&$==="open"&&!H("open"))||!(t&&!i)&&j,L=!H("compact")&&!H("onScroll"),D=!t||!!i&&!n,S=o&&o!=="default"?o:void 0,U=L&&$==="compact"?"compact":"default",[T,_]=s.useState(U),[B,ae]=s.useState(!1),ie=!n;U!==T&&(_(U),ie&&ae(!0));const k=gp(e),{logo:ue,logoMaxHeight:X=120/1440,logoPosition:le="left",panelHeight:te=60/1440,backgroundColor:we="#b3b3b3",logoColor:ke="#000000",position:fe,horizontalAlign:me,verticalAlign:Z,iconColor:se="#000000",showIcon:oe="on",iconSize:Pe=16/1440,linkColor:$e="#000000",openLinkColor:Me="#000000",compactIconColor:ye="#000000",compactCloseButtonColor:be="#000000",compactLinkColor:Ce="#000000",compactLogoColor:f="#000000",compactBackgroundColor:q="#ffffff",compactLogoMaxHeight:K=120/1440,compactLogoPosition:ne,compactPanelHeight:ge=60/1440,compactShowIcon:z="on",compactIconSize:R=16/1440,compactNavTextWidth:Q,compactNavTextPosition:ee,compactNavTextOffset:ce,compactNavGap:V,compactNavPaddingLeft:Le=10/1440,compactNavPaddingRight:ve=10/1440,compactFontFamily:J,compactFontSettings:_e,compactFontSize:Be,compactLineHeight:at,compactLetterSpacing:Ue=0,compactWordSpacing:et=0,compactTextAlign:Je="left",compactTextAppearance:Ye,openLogoColor:xe="#000000",menuBackgroundColor:We="#ffffff",overlayColor:He="rgba(0, 0, 0, 0.45)",closeButtonColor:Qe="#000000",effect:he="fade",textWidth:Ne=280/1440,navTextWidth:Ve,navTextPosition:tt="center",navTextOffset:mt=0,gap:st=0,navGap:De,navPaddingLeft:Fe=10/1440,navPaddingRight:Xe=10/1440,textPaddingLeft:ot=10/1440,textPaddingRight:Oe=10/1440,textPaddingTop:qe=10/1440,textPaddingBottom:nt=10/1440,fontFamily:de,fontSettings:Ie,fontSize:it,lineHeight:ut,letterSpacing:je=0,wordSpacing:pt=0,textAlign:Tt="left",textAppearance:Lt,openFontFamily:xt,openFontSettings:Et,openFontSize:Vt,openLineHeight:Ut,openLetterSpacing:Kt,openWordSpacing:Pt,openTextAlign:jt,openTextAppearance:on,stateOverrides:vt,link:Re}=k,{horizontalAlign:Ge,verticalAlign:lt}=Bw({position:fe,horizontalAlign:me,verticalAlign:Z}),ct=U==="compact",wt=ct?K:X,It=Ew(ct?ne:le),ht=ct?ge:te,Ot=ct?R:Pe,_t=ct?Q:Ve,Mt=Mw(ct?ee:tt),Gt=(ct?ce:mt)??0,Xt=ct?V:De,Dt=ct?Le:Fe,zt=ct?ve:Xe,Bt=_t??Ne,bt=C||(ct?z:oe)!=="off",F=N.buildColorVars(m,{iconColor:se,closeButtonColor:Qe,linkColor:$e,openLinkColor:Me,compactIconColor:ye,compactCloseButtonColor:be,compactLinkColor:Ce,compactLogoColor:f,compactBackgroundColor:q,openLogoColor:xe,menuBackgroundColor:We,overlayColor:He,backgroundColor:we,logoColor:ke},Uw,Yw,vt),Te=cd(ct?{fontFamily:J,fontSettings:_e,fontSize:Be,lineHeight:at,letterSpacing:Ue,wordSpacing:et,textAlign:Je,textAppearance:Ye}:{fontFamily:de,fontSettings:Ie,fontSize:it,lineHeight:ut,letterSpacing:je,wordSpacing:pt,textAlign:Tt,textAppearance:Lt}),Ae=cd({fontFamily:xt,fontSettings:Et,fontSize:Vt,lineHeight:Ut,letterSpacing:Kt,wordSpacing:Pt,textAlign:jt,textAppearance:on},Te),ze=dd(m,Te,t),gt=dd(m,Ae,t),Nt={...gt.css,whiteSpace:"pre-wrap"},ft=gt.className,St=Wt=>N.scalingValue(Wt,t),qt=Xt??st,At=Math.max(Dt,ho),sn=Math.max(zt,ho),gn=Math.max(0,1-Ot),Xn=Math.max(0,1-Ot),yn=n??!1,qn=yn&&!C,ki=s.useMemo(()=>mp({textPaddingLeft:ot,textPaddingRight:Oe,textPaddingTop:qe,textPaddingBottom:nt,fontSize:Ae.fontSize}),[ot,Oe,qe,nt,Ae.fontSize]),Ji=Wt=>{const Yt=a.jsx("span",{className:ft,style:Nt,children:ud(Wt)});return hd(m,Yt,Ne,yn,St)},Go={...Xw(ki,t),alignItems:Zw[Ge],justifyContent:Kw[lt]},un=s.useRef(e),An=s.useRef(c);s.useEffect(()=>{if(!x||!t){un.current=e,An.current=c;return}if(An.current!==c){un.current=e,An.current=c;const Mi=md(e);Mi!==e&&x(Mi);return}const Wt=md(e),Yt=un.current,vn=Yt!==e,Nn=vn?Gw(Wt,Yt):Wt;un.current=e;const Yn=Wt!==e,ci=vn&&jw(Wt,Nn);!Yn&&!ci||x(Nn)},[e,x,t,c]);const Rn=N.scalingValue(Ot,t),Un={width:Rn,height:Rn,minWidth:Rn,minHeight:Rn,maxWidth:Rn,maxHeight:Rn},Qi={...ze.css,textDecoration:"none"},Xo=ze.className,eo=(ue==null?void 0:ue.mode)!=="Off",Se=(ue==null?void 0:ue.icon)??"",Ze=t$(Se),M=St(Math.min(wt,ht)),pe=!!(eo&&Se&&It==="right")?"left":"right",Ee=Array.isArray(Re)?Re:[],Ke=[U!=="default"?`${m}-state-${U}`:"",$==="open"?`${m}-state-open`:"",S&&S!==U&&S!==$?`${m}-state-${S}`:""].filter(Boolean).join(" "),dt=t&&!i?`${m}-editor`:"",Rt=D?`${m}-interactive`:"",Ft=ie&&(U!==T||B)?`${m}-nav-state-anim`:"",rn=C?`${m}-open`:"",nn=s.useMemo(()=>s$(g.current),[A,C,c]),Fn=()=>{G(!1)},li=(Wt,Yt)=>{o$(Wt,Fn,{isEditor:t,isPreviewMode:i,item:Yt,pages:u,onLinkNavigate:p})},to=()=>{t&&!i||G(Wt=>!Wt)},Ei=()=>{E.current!==null&&(window.clearTimeout(E.current),E.current=null)};s.useEffect(()=>{if(!B)return;const Wt=window.setTimeout(()=>{ae(!1)},en);return()=>window.clearTimeout(Wt)},[B,U]),s.useEffect(()=>{if(C){Ei(),P(!0);return}return b.current+=1,Y(!1),Ei(),E.current=window.setTimeout(()=>{E.current=null,P(!1)},Sn),Ei},[C]),s.useLayoutEffect(()=>{y.current!==c&&(y.current=c,b.current+=1,Ei(),G(!1),Y(!1),P(!1))},[c]),s.useLayoutEffect(()=>{var vn;if(!A||!C)return;const Wt=b.current+1;b.current=Wt,Y(!1),(vn=h.current)==null||vn.offsetHeight;const Yt=requestAnimationFrame(()=>{b.current===Wt&&Y(!0)});return()=>{cancelAnimationFrame(Yt)}},[A,C]),s.useEffect(()=>{v==null||v(C)},[C,v]),s.useEffect(()=>{if(!C)return;const Wt=Yt=>{Yt.key==="Escape"&&(t&&i||Fn())};return window.addEventListener("keydown",Wt),()=>window.removeEventListener("keydown",Wt)},[C,t,i]),s.useEffect(()=>{t&&!i&&$!=="open"&&G(!1)},[t,i,$]),s.useEffect(()=>{i&&G(!1)},[i]);const Pr=yn&&C,_a=Wt=>Ee.filter(Yt=>_w(Yt,c)).map((Yt,vn)=>{const{label:Nn,href:Yn,target:ci}=Ds(Yt,u),Mi=Yn?a.jsx("a",{href:Yn,target:ci,rel:ci==="_blank"?"noopener noreferrer":void 0,className:`${Wt} ${m}-has-href`,onClick:Wa=>li(Wa,Yt),children:Ji(Nn)}):a.jsx("span",{className:Wt,children:Ji(Nn)});return a.jsxs(s.Fragment,{children:[vn>0&&a.jsx("div",{"data-controls":Pr?"gap":void 0,"data-controls-axis":"y",className:Pr?`${m}-gap-control`:void 0,style:{height:St(st)}}),Mi]},vn)}),Tp=A?a.jsxs("div",{ref:h,"data-selection":"none",className:[`${m}-lightbox`,`${m}-full-lightbox ${m}-effect-${he}`,W?`${m}-lightbox-active`:"",`${m}-lightbox-editor`,n?`${m}-lightbox-edit-mode`:"",Rt,Ke].filter(Boolean).join(" "),style:{...F,...nn},"aria-hidden":!W,children:[a.jsx("button",{type:"button",className:`${m}-backdrop`,onClick:Fn,"aria-label":"Close menu"}),a.jsxs("nav",{className:`${m}-panel`,style:Go,"aria-label":"Menu",children:[yn&&qw(m,ki,Ae.fontSize,St),_a(`${m}-link`)]})]}):null,Lp=()=>a.jsx("button",{type:"button",className:`${m}-toggle`,onClick:to,"aria-expanded":C,"aria-label":C?"Close menu":"Open menu",children:a.jsx(Hw,{className:`${m}-icon`,lineClassName:`${m}-icon-line`})}),kr=Wt=>{const Yt=Wt==="left",vn=Yt?Dt:zt,Nn=Yt?At:sn,Yn=Yt?gn:Xn,ci=ct?Yt?"compactNavPaddingLeft":"compactNavPaddingRight":Yt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Yt?`${m}-nav-padding-left`:`${m}-nav-padding-right`,style:{width:St(vn),flexShrink:0},children:qn?a.jsx("div",{"data-controls":ci,"data-controls-axis":"x","data-controls-variant":"column-padding",...Yt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(Yn),className:`${m}-control-anchor`,style:{top:0,[Yt?"left":"right"]:0,width:St(Nn),height:"100%"}}):null})},Ip=(Wt,Yt)=>{const{label:vn,href:Nn,target:Yn}=Ds(Wt,u),ci=a.jsx("span",{className:Xo,style:Qi,children:ud(vn)}),Mi=hd(m,ci,Bt,qn,St),Wa=Nn?a.jsx("a",{href:Nn,target:Yn,rel:Yn==="_blank"?"noopener noreferrer":void 0,className:`${m}-nav-link ${m}-has-href`,onClick:kp=>li(kp,Wt),children:Mi}):a.jsx("span",{className:`${m}-nav-link`,children:Mi});return a.jsxs(s.Fragment,{children:[Yt>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:St(qt),flexShrink:0}}),Wa]},Yt)},Rp={...F,height:N.scalingValue(ht,t),minHeight:N.scalingValue(ht,t),[`--${m}-panel-height`]:N.scalingValue(ht,t)},Pp=l&&U==="default"&&$!=="open"&&!i?St(te+Iw):"0px";return a.jsxs("div",{ref:g,className:`${m}-root ${Ke} ${dt} ${Rt} ${Ft}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:Pp,...F},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:w}}),a.jsx("div",{className:`${m}-nav-slide`,children:a.jsxs("div",{className:`${m}-nav-bar`,style:Rp,children:[eo&&Se?a.jsxs("div",{className:`${m}-nav-logo ${m}-nav-logo-${It}`,children:[It==="left"?kr("left"):null,a.jsxs("div",{className:`${m}-nav-logo-inner${Ze?` ${m}-nav-logo-tinted`:""}`,style:{height:M,...Ze?{[`--${m}-logo-image`]:Qw(Se)}:{}},children:[a.jsx("img",{src:Se,alt:"",className:`${m}-nav-logo-img`}),Ze?a.jsx("span",{className:`${m}-nav-logo-tint`,"aria-hidden":"true"}):null]}),It==="right"?kr("right"):null]}):null,a.jsx("nav",{className:`${m}-nav-links ${m}-nav-links-${Mt}`,style:{transform:Aw(Mt,Gt,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${m}-nav-links-inner`,children:Ee.filter(Wt=>Nw(Wt,U,c)).map((Wt,Yt)=>Ip(Wt,Yt))})})]})}),Tp,a.jsxs("div",{className:`${m}-nav-toggle-wrap ${m}-nav-toggle-wrap-${pe}`,children:[pe==="left"?kr("left"):null,bt?a.jsx("div",{className:`${m}-root ${rn}`.trim(),style:Un,children:Lp()}):null,pe==="right"?kr("right"):null]})]})}const c$=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
24277
24281
|
import { CommonComponentProps } from '../props';
|
|
24278
24282
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
24279
24283
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -26572,7 +26576,7 @@ export function Burger({
|
|
|
26572
26576
|
</div>
|
|
26573
26577
|
);
|
|
26574
26578
|
}
|
|
26575
|
-
`;function Jo(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 mi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function Al(e){return{[mi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[mi(e,"fontSettings")]:{...Di.fontSettings,scope:"common",title:""},[mi(e,"fontSize")]:{...Di.fontSize,scope:"layout",title:""},[mi(e,"lineHeight")]:{...Di.lineHeight,scope:"layout",title:""},[mi(e,"letterSpacing")]:{...Di.letterSpacing,scope:"layout",title:""},[mi(e,"wordSpacing")]:{...Di.wordSpacing,scope:"layout",title:""},[mi(e,"textAlign")]:{...Di.textAlign,scope:"layout",title:""},[mi(e,"textAppearance")]:{...Di.textAppearance,scope:"layout",title:""}}}const d$=Al(""),u$=Al("open"),p$=Al("compact"),m$=["__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"],g$=["__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"],h$=["__componentName__",{type:"row",items:["textWidth","effect"]},"position","openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],Zn={textTransform:"none",textDecoration:"none",fontVariant:"normal"},fs={fontWeight:400,fontStyle:"normal"},qr={d:"Always",t:"Open Only",m:"Open Only"},f$=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],y$=["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],v$={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:"Link Default",titleByState:{default:"Link Default",hover:"Link 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"}},compactCloseButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{compact:"Close Default","compact-hover":"Close Hover"},display:{type:"palette-color-picker"}},compactLinkColor:{type:"string",scope:"common",title:"Link Default",titleByState:{compact:"Link Default","compact-hover":"Link 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:"Link Default",titleByState:{open:"Link Default","open-hover":"Link 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:{default:"Close Default",hover:"Close Hover",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"]}},textWidth:{type:"number",scope:"layout",title:"Text 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:[...f$]}},stateOverrides:{type:"object",scope:"common"},gap:Jo("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:Jo("Text padding left"),textPaddingRight:Jo("Text padding right"),textPaddingTop:Jo("Text padding top"),textPaddingBottom:Jo("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}},...d$,...u$,...p$},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:qr},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:qr},{link:{type:"page",value:"",target:"self"},label:"About",showIn:qr},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:qr}],logo:{mode:"On",icon:"https://cdn.cntrl.site/component-assets/hamburger-logo.svg"},backgroundColor:"#ffffff",logoColor:"#000000",iconColor:"#000000",linkColor:"#000000",openLinkColor:"#000000",compactIconColor:"#000000",compactCloseButtonColor:"#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:fs,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:fs,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:fs,compactTextAlign:"left",stateOverrides:{hover:{linkColor:"#666666",iconColor:"#666666",logoColor:"#666666",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:"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,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:Zn,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,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:Zn},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,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:Zn,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,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:Zn},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,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:Zn,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,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:Zn,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactCloseButtonColor","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:m$},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:g$,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:h$},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...y$],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","closeButtonColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactCloseButtonColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactCloseButtonColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},x$={element:l$,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:v$,sourceCode:c$,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},fd=120,yd=3,b$=.12,Fl={x:0,y:0,width:100,height:100};function $o(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function ya(e){return e<0?0:e>1?1:e}function vd(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 S$(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){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,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function w$(e){return e.map(([t,n])=>({x:t,y:n}))}function ys(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}function $$(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=ya(n[o]),l=ya(n[o+1]);l>r&&i.push({x0:r,x1:l})}return C$(i)}function C$(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 T$(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 L$(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 I$(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 R$(e,t,n,i){let o=null;for(let r=0;r<yd;r+=1){const l=ya(t+(n-t)*r/Math.max(1,yd-1)),d=$$(e,l),c=i==="avoid"?L$(d):d;if(o=o===null?c:T$(o,c),o.length===0)return[]}return o??[]}function xd(e,t="stretch",n=Fl){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Li(i),d=xr(l);if(d.length)return t==="viewbox"?$o(d,n):ys(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(v=>v.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const v of c){const y=document.createElementNS("http://www.w3.org/2000/svg","path");y.setAttribute("d",v),u.appendChild(y);let m=0;try{m=y.getTotalLength()}catch{m=0}if(!m)continue;const g=[];for(let f=0;f<fd;f+=1){const x=y.getPointAtLength(f/fd*m);g.push({x:x.x,y:x.y})}p.push(g)}return p.length?t==="viewbox"?$o(p,n):ys(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"?$o([r],n):ys([r])}const Nl={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",va=100,Bs=16,P$=12,k$=16,vs=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,E$=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,bd=Math.PI/4,M$=8,A$=Math.PI/18,F$=8,fo=24,yo=[];function N$(){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 xs(e,t){return ln(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function _$(e){const t=Si(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:ln(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function W$(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 ln(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function Sd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=xs(t,i);else{const d=e.trim();if(d&&/^[Mm]/.test(d)){const c=Li(d);c.length&&(l=n==="viewbox"?xs(c,i):_$(c))}if(!l.length){const c=o!=="custom"?Nl[o]:void 0;c?l=xs(Li(c),Fl):l=N$()}}return o==="circle"?W$(l,r):l}function wd(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":Wo(ln(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function js(e){const t=e==="rectangle"||e==="custom"?void 0:Nl[e];return t?$o(xr(Li(t)),Fl):[w$([[0,0],[1,0],[1,1],[0,1]])]}function H$(e){const t=e.match(E$);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function wn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Vs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function cn(e){return{x:e.x,y:e.y}}function O$(e){return{p:cn(e.p),in:e.in?cn(e.in):null,out:e.out?cn(e.out):null}}function zn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(O$)}))}function ln(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 $d(e,t,n,i=n){return ln(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function D$(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:cn(e),c2:cn(l),p:cn(l)}];const u=i*Math.PI/180,p=Math.cos(u),v=Math.sin(u),y=(e.x-l.x)/2,m=(e.y-l.y)/2,g=p*y+v*m,f=-v*y+p*m,x=g*g/(d*d)+f*f/(c*c);if(x>1){const U=Math.sqrt(x);d*=U,c*=U}const R=o===r?-1:1,b=d*d*f*f+c*c*g*g,S=Math.max(0,d*d*c*c-b),G=b===0?0:R*Math.sqrt(S/b),D=G*d*f/c,j=-G*c*g/d,P=p*D-v*j+(e.x+l.x)/2,M=v*D+p*j+(e.y+l.y)/2,K=Math.atan2((f-j)/c,(g-D)/d);let L=Math.atan2((-f-j)/c,(-g-D)/d)-K;!r&&L>0&&(L-=Math.PI*2),r&&L<0&&(L+=Math.PI*2);const _=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2))),z=L/_,$=4/3*Math.tan(z/4),k=(U,C)=>({x:P+p*d*U-v*c*C,y:M+v*d*U+p*c*C}),W=[];let w=K;for(let U=0;U<_;U+=1){const C=w+z,O=Math.cos(w),V=Math.sin(w),se=Math.cos(C),ie=Math.sin(C);W.push({c1:k(O-$*V,V+$*O),c2:k(se+$*ie,ie-$*se),p:U===_-1?cn(l):k(se,ie)}),w=C}return W}function Li(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const m=i[0],g=i[i.length-1];Math.abs(m.p.x-g.p.x)<1e-6&&Math.abs(m.p.y-g.p.y)<1e-6&&(m.in=g.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,g)=>{i.push({p:m,in:Vn(g??null,m),out:null}),r=m},v=m=>{if(!i.length)return;const g=i[i.length-1];g.out=Vn(m,g.p)};vs.lastIndex=0;let y=vs.exec(t);for(;y!==null;){const m=y[1],g=m.toUpperCase(),f=m!==g,x=H$(y[2]),R=b=>f?{x:r.x+x[b],y:r.y+x[b+1]}:{x:x[b],y:x[b+1]};if(g==="Z")o=!0,u(),r=cn(l),d=null,c=null;else if(g==="M"){for(let b=0;b+1<x.length;b+=2){const S=R(b);b===0&&(u(),l=cn(S)),p(S)}d=null,c=null}else if(g==="L"){for(let b=0;b+1<x.length;b+=2)p(R(b));d=null,c=null}else if(g==="H"){for(const b of x)p({x:f?r.x+b:b,y:r.y});d=null,c=null}else if(g==="V"){for(const b of x)p({x:r.x,y:f?r.y+b:b});d=null,c=null}else if(g==="C"){for(let b=0;b+5<x.length;b+=6){const S=R(b),G=R(b+2),D=R(b+4);v(S),p(D,G),d=G}c=null}else if(g==="S"){for(let b=0;b+3<x.length;b+=4){const S=d?Vs(d,r):cn(r),G=R(b),D=R(b+2);v(S),p(D,G),d=G}c=null}else if(g==="Q")for(let b=0;b+3<x.length;b+=4){const S=R(b),G=R(b+2);v(wn(r,S,2/3)),p(G,wn(G,S,2/3)),c=S,d=null}else if(g==="T")for(let b=0;b+1<x.length;b+=2){const S=c?Vs(c,r):cn(r),G=R(b);v(wn(r,S,2/3)),p(G,wn(G,S,2/3)),c=S,d=null}else if(g==="A")for(let b=0;b+6<x.length;b+=7){const S=f?{x:r.x+x[b+5],y:r.y+x[b+6]}:{x:x[b+5],y:x[b+6]};for(const G of D$(r,x[b],x[b+1],x[b+2],x[b+3]!==0,x[b+4]!==0,S))v(G.c1),p(G.p,G.c2);d=null,c=null}y=vs.exec(t)}return u(),n}function On(e){return`${Number(e.toFixed(2))}`}function Vn(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function hp(e){return!!(Vn(e.in,e.p)||Vn(e.out,e.p))}function Vo(e,t){return!Vn(e.out,e.p)&&!Vn(t.in,t.p)}function Cd(e,t){if(Vo(e,t))return`L${On(t.p.x)},${On(t.p.y)}`;const n=Vn(e.out,e.p)??e.p,i=Vn(t.in,t.p)??t.p;return`C${On(n.x)},${On(n.y)} ${On(i.x)},${On(i.y)} ${On(t.p.x)},${On(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${On(i.p.x)},${On(i.p.y)}`);let r=i;for(const l of o)t.push(Cd(r,l)),r=l;if(n.closed){const l=Cd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function fp(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 Gs(e,t,n){if(Vo(e,t))return wn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function xr(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of fp(n)){if(Vo(o.from,o.to)){i.push(cn(o.from.p));continue}for(let r=0;r<Bs;r+=1)i.push(Gs(o.from,o.to,r/Bs))}n.closed||i.push(cn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Si(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of xr(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 z$(e){const t=Si(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 yp(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 vp(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=P$)return{closed:!0,nodes:t.map(r=>({p:cn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/k$)),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:cn(r),...yp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function xp(e,t,n=1){if(!e.length)return!1;const i=Si(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),d=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-d||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+d}function B$(e,t,n,i,o,r,l){const d=t.width>0?n.width/t.width:1,c=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(d>0)||!(c>0)?e:ln(e,u=>{const p=i+(u.x-t.x)*r,v=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+v/c}})}function j$(e,t){if(!e.length)return e;const n=Si(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),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return ln(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function bp(e){const t={x:0,y:0,width:va,height:va},n=e!=="custom"?Nl[e]:void 0,i=n?ln(Li(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):ln(vp(js("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=j$(i,t);return{shape:e,customPath:Wo(o),pathFit:"viewbox",pathViewBox:zs}}function Ur(e,t){return t>0?Math.round(e/t)*t:e}function V$(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,d=zn(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function Td(e,t,n,i){var r;if(!t.length)return e;const o=zn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function G$(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((d,c)=>c-d);for(const d of l)i=Sp(i,r,d)}),i}function X$(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=zn(e),c=d[t].nodes[n];if(c[i]=cn(o),r){const p=i==="in"?"out":"in";c[p]=Vs(o,c.p)}return d}function q$(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 U$(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 d=zn(e),c=d[t].nodes,u=n+1;if(Vo(r,l))return c.splice(u,0,{p:wn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,v=l.in??l.p,y=wn(r.p,p,i),m=wn(p,v,i),g=wn(v,l.p,i),f=wn(y,m,i),x=wn(m,g,i),R=wn(f,x,i),b=(n+1)%o.nodes.length;return c[n].out=y,c[b].in=g,c.splice(u,0,{p:R,in:f,out:x}),{contours:d,nodeIndex:u}}function Sp(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 Ld(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,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,v=!!Vn(l[u].out,l[u].p),y=!!Vn(l[p].in,l[p].p);if(hp(d)||v||y)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const m=yp(l[u].p,d.p,l[p].p);return d.in=m.in,d.out=m.out,r}function Y$(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)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y),point:d}}function Id(e,t){let n=null;return e.forEach((i,o)=>{for(const r of fp(i)){const l=Vo(r.from,r.to)?1:Bs;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Y$(t,Gs(r.from,r.to,c),Gs(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance,point:p.point})}}}),n}function K$(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 Rd(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-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 Pd(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}function Z$(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 J$(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function Xs(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 Q$(e,t){const n=Xs(e,t);return n?{kind:"align",a:{x:e.x-n.x*fo,y:e.y-n.y*fo},b:{x:t.x+n.x*fo,y:t.y+n.y*fo}}:{kind:"align",a:e,b:t}}function qs(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 kd(e,t,n,i,o){if(e.axis===null)return Q$(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return qs(o(r)[t],t,i)}function eC(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(kd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(kd(n,"y",l,i,o)),r}function tC(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 Xs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return Xs(i(p),r)}function nC(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,v=Math.hypot(u,p);if(v<1e-6)return{point:e,guides:yo};const y=Math.atan2(p,u),m=Math.round(y/bd)*bd;let g=o?m:null,f=!1;if(!o){const j=[];n&&j.push({angle:Math.atan2(n.y,n.x),smooth:!0}),j.push({angle:m,smooth:!1});for(const P of j){const M=J$(P.angle-y);if(!(Math.abs(M)>A$)&&!(Math.abs(Math.sin(M))*v>M$)){g=P.angle,f=P.smooth;break}}}const x=i!==null&&i>0&&Math.abs(v-i)<=F$;if(g===null&&!x)return{point:e,guides:yo};const R=g??y,b=x?i:v,S={x:Math.cos(R),y:Math.sin(R)},G=b+(g===null?0:fo),D=x?b:f?fo:0;return{point:l({x:d.x+S.x*b,y:d.y+S.y*b}),guides:[{kind:"angle",a:{x:d.x-S.x*D,y:d.y-S.y*D},b:{x:d.x+S.x*G,y:d.y+S.y*G}}]}}const Us=.1,Ys=8,iC=4,Ed=10,xa=(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}}},wp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},Ks=(e,t)=>{const n=xa(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Ed,y:n.y+o*Ed}},Zs=(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),Gi=(e,t,n)=>{const i=Zs(e,t)*n;return{width:t.width*i,height:t.height*i}},Dn=(e,t,n)=>(e-t)*n,vo=(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)<iC?.5:ya(r)},oC=(e,t,n,i,o,r)=>{const l=Gi(e,n,r),d=e.x+Dn(e.width,l.width,i),c=e.y+Dn(e.height,l.height,o),u=Zs(e,n),p=Zs(t,n),v=Math.min(Ys,Math.max(Us,p>0?r*(u/p):r)),y=Gi(t,n,v);return{focalX:vo(t.width,y.width,d-t.x,{clamp:!1}),focalY:vo(t.height,y.height,c-t.y,{clamp:!1}),scale:v}},Md=1.08,Yr=14,Kr=8;function rC({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:v,onCommit:y}){const m=s.useRef(null),g=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),x=s.useRef(null),R=s.useRef({focalX:c,focalY:u,scale:p});R.current={focalX:c,focalY:u,scale:p};const b=l==="image";s.useEffect(()=>{var z;b&&((z=m.current)==null||z.focus({preventScroll:!0}))},[b]);const S=s.useCallback((z,$)=>{var W;const k=(W=m.current)==null?void 0:W.getBoundingClientRect();return!k||k.width<=0||k.height<=0?{x:0,y:0}:{x:(z-k.left)/k.width*t.width,y:($-k.top)/k.height*t.height}},[t.width,t.height]),G=z=>{var k,W;if(!i)return;z.stopPropagation(),z.preventDefault(),(k=m.current)==null||k.focus({preventScroll:!0});const $=Gi(n,i,p);f.current={pointerId:z.pointerId,origin:S(z.clientX,z.clientY),startX:Dn(n.width,$.width,c),startY:Dn(n.height,$.height,u),width:$.width,height:$.height,moved:!1},(W=m.current)==null||W.setPointerCapture(z.pointerId)},D=(z,$)=>{var se,ie;if(!i)return;z.stopPropagation(),z.preventDefault(),(se=m.current)==null||se.focus({preventScroll:!0});const k=Gi(n,i,p),W=Dn(n.width,k.width,c),w=Dn(n.height,k.height,u),U={minX:W,minY:w,maxX:W+k.width,maxY:w+k.height},C=xa(U,wp($)),O=xa(U,$),V=Math.hypot(O.x-C.x,O.y-C.y);!isFinite(V)||V<=0||(x.current={pointerId:z.pointerId,anchor:C,startDistance:V,startScale:p,startX:W,startY:w,moved:!1},(ie=m.current)==null||ie.setPointerCapture(z.pointerId))},j=z=>{if(!i)return;const $=x.current;if($&&z.pointerId===$.pointerId){z.stopPropagation(),z.preventDefault();const W=S(z.clientX,z.clientY),w={x:W.x-n.x,y:W.y-n.y},U=Math.hypot(w.x-$.anchor.x,w.y-$.anchor.y),C=Math.min(Ys,Math.max(Us,$.startScale*(U/$.startDistance)));if(!$.moved&&Math.abs(C-$.startScale)<1e-4)return;$.moved=!0;const O=C/$.startScale,V=$.anchor.x+($.startX-$.anchor.x)*O,se=$.anchor.y+($.startY-$.anchor.y)*O,ie=Gi(n,i,C);v({focalX:vo(n.width,ie.width,V),focalY:vo(n.height,ie.height,se),scale:C});return}const k=f.current;if(k&&z.pointerId===k.pointerId){z.stopPropagation(),z.preventDefault();const W=S(z.clientX,z.clientY),w=W.x-k.origin.x,U=W.y-k.origin.y;if(!k.moved&&w===0&&U===0)return;k.moved=!0,v({focalX:vo(n.width,k.width,k.startX+w),focalY:vo(n.height,k.height,k.startY+U),scale:p})}},P=z=>{var W,w;const $=f.current;if($&&z.pointerId===$.pointerId){f.current=null,z.stopPropagation(),(W=m.current)!=null&&W.hasPointerCapture($.pointerId)&&m.current.releasePointerCapture($.pointerId),$.moved&&y(R.current);return}const k=x.current;k&&z.pointerId===k.pointerId&&(x.current=null,z.stopPropagation(),(w=m.current)!=null&&w.hasPointerCapture(k.pointerId)&&m.current.releasePointerCapture(k.pointerId),k.moved&&y(R.current))},M=z=>{if(z.key==="Escape"){z.stopPropagation(),d("none");return}if(z.key==="="||z.key==="+"||z.key==="-"||z.key==="_"){z.preventDefault(),z.stopPropagation();const $=z.key==="="||z.key==="+",k=Math.min(Ys,Math.max(Us,p*($?Md:1/Md))),W={focalX:c,focalY:u,scale:k};v(W),y(W)}},K=["nw","ne","se","sw"],T={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},L=s.useMemo(()=>{const z=i??{width:n.width,height:n.height},$=Gi(n,z,p);return!($.width>0)||!($.height>0)?null:{x:n.x+Dn(n.width,$.width,c),y:n.y+Dn(n.height,$.height,u),width:$.width,height:$.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),_=L?{minX:L.x,minY:L.y,maxX:L.x+L.width,maxY:L.y+L.height}:T;return a.jsxs("svg",{ref:m,className:`${e}-editor${b?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:M,onPointerMove:j,onPointerUp:P,onPointerCancel:P,onLostPointerCapture:P,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),b&&o&&L&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:g,maskUnits:"userSpaceOnUse",x:L.x,y:L.y,width:L.width,height:L.height,children:[a.jsx("rect",{x:L.x,y:L.y,width:L.width,height:L.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:L.x,y:L.y,width:L.width,height:L.height,preserveAspectRatio:"none",mask:`url(#${g})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:L.x,y:L.y,width:L.width,height:L.height})]}),b&&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:G}),K.map(z=>{const $=Ks(_,z),k=z==="ne"||z==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:$.x-Kr/2,y:$.y-Kr/2,width:Kr,height:Kr}),a.jsx("rect",{className:`${e}-editor-scale-grab${k?` ${e}-editor-scale-grab-nesw`:""}`,x:$.x-Yr/2,y:$.y-Yr/2,width:Yr,height:Yr,onPointerDown:W=>D(W,z)})]},z)})]})]})}const Js=10,aC=Js*2,Hn=7,sC=4,lo=9,lC=3.5,Ad=1.08,cC=.05,Zr=14,dC=1,Jr=14,Qr=8;function uC({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:d,onStageChange:c,onSelectionChange:u,onChange:p,onCommit:v}){const y=s.useRef(null),m=s.useRef(null),g=s.useRef(i);g.current=i;const f=s.useRef(null),x=s.useRef(null),R=s.useRef(null),b=s.useRef(null),[S,G]=s.useState([]),[D,j]=s.useState(yo),[P,M]=s.useState(null),K=s.useCallback(h=>{j(q=>Z$(q,h)?q:h)},[]),T=d==="shape";s.useEffect(()=>{var h;T&&((h=y.current)==null||h.focus({preventScroll:!0}))},[T]),s.useEffect(()=>{T||G(h=>h.length?[]:h)},[T]);const L=S.length>0;s.useEffect(()=>{u==null||u(L)},[L,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const _=n.width>0?t.width/n.width:1,z=n.height>0?t.height/n.height:1,$=Math.min(_,z),k=r&&l?$:_,W=r&&l?$:z,w=r&&l?(t.width-n.width*$)/2:0,U=r&&l?(t.height-n.height*$)/2:0,C=s.useCallback(h=>r?{x:w+(h.x-n.x)*k,y:U+(h.y-n.y)*W}:{x:h.x-n.x,y:h.y-n.y},[r,n,k,W,w,U]),O=s.useCallback(h=>r?{x:n.x+(k>0?(h.x-w)/k:0),y:n.y+(W>0?(h.y-U)/W:0)}:{x:n.x+h.x,y:n.y+h.y},[r,n,k,W,w,U]),V=s.useMemo(()=>O({x:t.width/2,y:t.height/2}),[O,t.width,t.height]),se=s.useCallback((h,q)=>{var ee;const Y=(ee=y.current)==null?void 0:ee.getBoundingClientRect();if(!Y||Y.width<=0||Y.height<=0)return{x:0,y:0};if(r){const ve=(h-Y.left)/Y.width*t.width,B=(q-Y.top)/Y.height*t.height;return{x:n.x+(k>0?(ve-w)/k:0),y:n.y+(W>0?(B-U)/W:0)}}return{x:n.x+(h-Y.left),y:n.y+(q-Y.top)}},[r,n,t.width,t.height,k,W,w,U]),ie=s.useCallback((h,q)=>{var ee;const Y=(ee=y.current)==null?void 0:ee.getBoundingClientRect();return!Y||Y.width<=0||Y.height<=0?{x:0,y:0}:{x:(h-Y.left)/Y.width*t.width,y:(q-Y.top)/Y.height*t.height}},[t.width,t.height]),N=s.useCallback((h,q)=>{const Y=l&&!(q!=null&&q.preserveShape)?B$(h,n,t,w,U,k,W):h;v(Y,q)},[v,l,n,t,w,U,k,W]),de=s.useCallback(()=>{M(null)},[]),X=s.useCallback((h,q,Y)=>{if(!Y||f.current||x.current||R.current||b.current){de();return}const ee=ie(h,q),ve=ln(g.current,C);for(const te of ve)for(const ke of te.nodes)if(Math.hypot(ke.p.x-ee.x,ke.p.y-ee.y)<=lo){de();return}const B=Id(ve,ee);if(!B||B.distance>Js){de();return}const I=ve[B.contour],Q=I==null?void 0:I.nodes[B.segment],ne=I==null?void 0:I.nodes[(B.segment+1)%((I==null?void 0:I.nodes.length)??1)],H=!!(Q&&ne&&!Vo(Q,ne));M(te=>te&&te.curved===H&&Math.hypot(te.point.x-B.point.x,te.point.y-B.point.y)<.25?te:{point:B.point,curved:H})},[ie,C,de]),ce=h=>{var je;const q=h.metaKey||h.ctrlKey,Y=R.current;if(Y&&h.pointerId===Y.pointerId){if(h.stopPropagation(),h.preventDefault(),Y.startDistance<=0)return;const it=se(h.clientX,h.clientY),qe=Math.hypot(it.x-Y.origin.x,it.y-Y.origin.y),et=Math.max(cC,qe/Y.startDistance);if(!Y.moved&&Math.abs(et-1)<1e-4)return;Y.moved=!0,p($d(Y.startContours,Y.origin,et));return}const ee=x.current;if(ee&&h.pointerId===ee.pointerId){h.stopPropagation(),h.preventDefault();const it=se(h.clientX,h.clientY),{bbox:qe}=ee,et=qe.maxX-qe.minX,Je=qe.maxY-qe.minY,Ge=it.x-ee.origin.x,$e=it.y-ee.origin.y;let He=Ge,De=$e;if(isFinite(et)&&isFinite(Je))if(r){let he=n.x,_e=n.x+n.width,Ve=n.y,tt=n.y+n.height;l&&(k>0&&(he=n.x+(0-w)/k,_e=n.x+(t.width-w)/k),W>0&&(Ve=n.y+(0-U)/W,tt=n.y+(t.height-U)/W));const ft=Math.min(he,_e-et),rt=Math.max(he,_e-et),Oe=Math.min(Ve,tt-Je),Fe=Math.max(Ve,tt-Je),Ee=Math.min(rt,Math.max(ft,qe.minX+Ge)),Ze=Math.min(Fe,Math.max(Oe,qe.minY+$e));He=Ee-qe.minX,De=Ze-qe.minY}else{const he=qe.minX-n.x,_e=qe.minY-n.y,Ve=Math.min(0,t.width-et),tt=Math.max(0,t.width-et),ft=Math.min(0,t.height-Je),rt=Math.max(0,t.height-Je),Oe=Math.min(tt,Math.max(Ve,he+Ge)),Fe=Math.min(rt,Math.max(ft,_e+$e));He=Oe-he,De=Fe-_e}const Qe=[];if(!q&&isFinite(et)&&isFinite(Je)){const he=C({x:qe.minX+et/2+He,y:qe.minY+Je/2+De}),_e={x:t.width/2,y:t.height/2};Math.abs(he.x-_e.x)<=Zr&&(He=V.x-qe.minX-et/2,Qe.push(qs(_e.x,"x",t))),Math.abs(he.y-_e.y)<=Zr&&(De=V.y-qe.minY-Je/2,Qe.push(qs(_e.y,"y",t)))}if(!ee.moved&&He===0&&De===0)return;ee.moved=!0,K(Qe.length?Qe:yo),p(ln(ee.startContours,he=>({x:he.x+He,y:he.y+De})),{carryImage:!0});return}const ve=b.current;if(ve&&h.pointerId===ve.pointerId){h.stopPropagation(),h.preventDefault();const it=se(h.clientX,h.clientY);let qe=it.x-ve.origin.x,et=it.y-ve.origin.y;if(h.shiftKey&&(Math.abs(qe)>Math.abs(et)?et=0:qe=0),!ve.moved&&qe===0&&et===0)return;ve.moved=!0,p(Td(ve.startContours,ve.selection,qe,et));return}const B=f.current;if(!B||h.pointerId!==B.pointerId){X(h.clientX,h.clientY,S.length>0||T);return}de(),h.stopPropagation(),h.preventDefault();const I=se(h.clientX,h.clientY);if(B.kind==="anchor"){const it={x:B.anchor.x+(I.x-B.origin.x),y:B.anchor.y+(I.y-B.origin.y)},qe=q?[]:K$(g.current,{contour:B.contour,node:B.node}),et=q||!B.center?[]:[B.center],Je=Pd(Rd(qe,et.map(He=>He.x),"x"),it,"x",C,Zr),Ge=Pd(Rd(qe,et.map(He=>He.y),"y"),it,"y",C,Zr),$e=q?it:{x:(Je==null?void 0:Je.value)??Ur(it.x,o),y:(Ge==null?void 0:Ge.value)??Ur(it.y,o)};if(h.shiftKey&&(Math.abs($e.x-B.anchor.x)>Math.abs($e.y-B.anchor.y)?$e.y=B.anchor.y:$e.x=B.anchor.x),!B.moved&&$e.x===B.anchor.x&&$e.y===B.anchor.y)return;B.moved=!0,K(eC($e,Je,Ge,t,C)),p(V$(g.current,B.contour,B.node,$e));return}const Q=(je=g.current[B.contour])==null?void 0:je.nodes[B.node],ne=B.mirror&&!h.altKey,H=ne||q?null:B.kind==="in"?Q==null?void 0:Q.out:Q==null?void 0:Q.in,te=Q?C(Q.p):null,ke=H?C(H):null,ge=Q&&(!q||h.shiftKey)?nC(I,Q.p,ne||q?null:tC(g.current[B.contour],B.node,B.kind,C),te&&ke?Math.hypot(ke.x-te.x,ke.y-te.y):null,h.shiftKey,C,O):{point:I,guides:yo},J=ge.guides.length?ge.point:q?I:{x:Ur(I.x,o),y:Ur(I.y,o)},Ye=B.kind==="in"?Q==null?void 0:Q.in:Q==null?void 0:Q.out;!B.moved&&Ye&&J.x===Ye.x&&J.y===Ye.y||(B.moved=!0,K(ge.guides),p(X$(g.current,B.contour,B.node,B.kind,J,ne)))},oe=h=>{K(yo);const q=R.current;if(q&&h.pointerId===q.pointerId){R.current=null,h.stopPropagation();const H=y.current;H!=null&&H.hasPointerCapture(q.pointerId)&&H.releasePointerCapture(q.pointerId),q.moved&&N(g.current,{preserveShape:!0});return}const Y=x.current;if(Y&&h.pointerId===Y.pointerId){x.current=null,h.stopPropagation();const H=y.current;H!=null&&H.hasPointerCapture(Y.pointerId)&&H.releasePointerCapture(Y.pointerId),Y.moved?N(g.current,{preserveShape:!0}):G([]);return}const ee=b.current;if(ee&&h.pointerId===ee.pointerId){b.current=null,h.stopPropagation();const H=y.current;H!=null&&H.hasPointerCapture(ee.pointerId)&&H.releasePointerCapture(ee.pointerId),ee.moved&&N(g.current);return}const ve=f.current;if(!ve||h.pointerId!==ve.pointerId)return;f.current=null,h.stopPropagation();const B=y.current;B!=null&&B.hasPointerCapture(ve.pointerId)&&B.releasePointerCapture(ve.pointerId);const I=Math.hypot(h.clientX-ve.clientOrigin.x,h.clientY-ve.clientOrigin.y);if(ve.moved||I>sC){ve.moved&&N(g.current);return}if(!ve.toggleOnRelease||h.type!=="pointerup")return;const ne=Ld(g.current,ve.contour,ve.node);ne!==g.current&&(p(ne),N(ne))},fe=h=>{h.stopPropagation()},Pe=h=>{var q,Y;h.stopPropagation(),h.preventDefault(),de(),(q=y.current)==null||q.focus({preventScroll:!0}),x.current={pointerId:h.pointerId,origin:se(h.clientX,h.clientY),startContours:zn(i),bbox:Si(i),moved:!1},(Y=y.current)==null||Y.setPointerCapture(h.pointerId)},xe=(h,q)=>{var I,Q;h.stopPropagation(),h.preventDefault(),de(),(I=y.current)==null||I.focus({preventScroll:!0}),G([]),c("shape");const Y=Si(i),ee=xa(Y,wp(q)),ve=Ks(Y,q),B=Math.hypot(ve.x-ee.x,ve.y-ee.y);!isFinite(B)||B<=0||(R.current={pointerId:h.pointerId,corner:q,origin:ee,startDistance:B,startContours:zn(i),moved:!1},(Q=y.current)==null||Q.setPointerCapture(h.pointerId))},pe=(h,q,Y,ee)=>{var I,Q,ne,H;h.stopPropagation(),h.preventDefault(),de(),(I=y.current)==null||I.focus({preventScroll:!0});const ve=(Q=i[Y])==null?void 0:Q.nodes[ee];if(!ve)return;if(h.altKey){const te=q==="anchor"?Sp(i,Y,ee):q$(i,Y,ee,q);if(te===i)return;G(q==="anchor"?[]:[{contour:Y,node:ee}]),p(te),N(te);return}const B=h.metaKey||h.ctrlKey;if(q==="anchor"&&h.shiftKey&&!B){G(te=>te.some(ke=>ke.contour===Y&&ke.node===ee)?te.filter(ke=>!(ke.contour===Y&&ke.node===ee)):[...te,{contour:Y,node:ee}]);return}if(q==="anchor"&&!B&&S.length>1&&S.some(te=>te.contour===Y&&te.node===ee)){b.current={pointerId:h.pointerId,origin:se(h.clientX,h.clientY),startContours:zn(i),selection:S,moved:!1},(ne=y.current)==null||ne.setPointerCapture(h.pointerId);return}G([{contour:Y,node:ee}]),f.current={kind:q,contour:Y,node:ee,pointerId:h.pointerId,origin:se(h.clientX,h.clientY),clientOrigin:{x:h.clientX,y:h.clientY},anchor:ve.p,center:z$(i),mirror:q!=="anchor"&&!!(ve.in&&ve.out),toggleOnRelease:B,moved:!1},(H=y.current)==null||H.setPointerCapture(h.pointerId)},Z=h=>{h.stopPropagation(),h.preventDefault(),de();const q=ln(i,C),Y=Id(q,ie(h.clientX,h.clientY));if(!Y||Y.distance>Js)return;const{contours:ee,nodeIndex:ve}=U$(i,Y.contour,Y.segment,Y.t);ve<0||(G([{contour:Y.contour,node:ve}]),p(ee),N(ee))},le=h=>{if(h.key==="="||h.key==="+"||h.key==="-"||h.key==="_"){h.preventDefault(),h.stopPropagation();const B=Si(i);if(!isFinite(B.minX)||!isFinite(B.maxX))return;const I={x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},ne=h.key==="="||h.key==="+"?Ad:1/Ad,H=$d(i,I,ne);p(H),N(H,{preserveShape:!0});return}if(h.key==="Escape"){h.stopPropagation(),G([]),c("none");return}if(!S.length)return;if(h.key==="Backspace"||h.key==="Delete"){h.preventDefault(),h.stopPropagation();const B=G$(i,S);if(B===i)return;G([]),p(B),N(B);return}const q=o>0?o:dC,Y=h.shiftKey?q*10:q,ee={ArrowLeft:[-Y,0],ArrowRight:[Y,0],ArrowUp:[0,-Y],ArrowDown:[0,Y]}[h.key];if(!ee)return;h.preventDefault(),h.stopPropagation();const ve=Td(i,S,ee[0],ee[1]);p(ve),N(ve)},re=s.useMemo(()=>Wo(ln(i,C)),[i,C]),Ie=s.useMemo(()=>Si(i),[i]),we=C({x:Ie.minX,y:Ie.minY}),Me={width:C({x:Ie.maxX,y:Ie.minY}).x-we.x,height:C({x:Ie.minX,y:Ie.maxY}).y-we.y},ye=T&&S.length===0&&isFinite(Ie.minX)&&isFinite(Ie.maxX)&&Ie.maxX>Ie.minX&&Ie.maxY>Ie.minY,be=S.length>0||T,Ce=be;return a.jsxs("svg",{ref:y,className:`${e}-editor${be?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:le,onPointerDown:()=>{var h;return(h=y.current)==null?void 0:h.focus({preventScroll:!0})},onPointerMove:ce,onPointerLeave:de,onPointerUp:oe,onPointerCancel:oe,onLostPointerCapture:oe,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:()=>{G([]),c("none")},onClick:Z}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:re}),Ce&&D.map((h,q)=>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}-${q}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:re,fillRule:"evenodd",onPointerDown:Pe,onClick:Z}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:re,style:{strokeWidth:aC},onClick:Z}),Ce&&P&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:P.point.x-Hn/2,y:P.point.y-Hn/2,width:Hn,height:Hn,rx:P.curved?Hn/2:0}),Ce&&i.map((h,q)=>h.nodes.map((Y,ee)=>{const ve=S.some(I=>I.contour===q&&I.node===ee),B=C(Y.p);return a.jsxs("g",{children:[ve&&S.length===1&&["in","out"].map(I=>{const Q=Y[I];if(!Q)return null;const ne=C(Q);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:B.x,y1:B.y,x2:ne.x,y2:ne.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ne.x,cy:ne.y,r:lC}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ne.x,cy:ne.y,r:lo,onPointerDown:H=>pe(H,I,q,ee),onClick:fe})]},I)}),a.jsx("rect",{className:`${e}-editor-anchor${ve?` ${e}-editor-anchor-selected`:""}`,x:B.x-Hn/2,y:B.y-Hn/2,width:Hn,height:Hn,rx:hp(Y)?Hn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:B.x-lo,y:B.y-lo,width:lo*2,height:lo*2,onPointerDown:I=>pe(I,"anchor",q,ee),onClick:fe,onDoubleClick:I=>{I.stopPropagation(),I.preventDefault();const Q=Ld(i,q,ee);p(Q),N(Q)}})]},`${q}-${ee}`)})),ye&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:we.x,y:we.y,width:Me.width,height:Me.height}),["nw","ne","se","sw"].map(h=>{const q=C(Ks(Ie,h)),Y=h==="ne"||h==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:q.x-Qr/2,y:q.y-Qr/2,width:Qr,height:Qr}),a.jsx("rect",{className:`${e}-editor-scale-grab${Y?` ${e}-editor-scale-grab-nesw`:""}`,x:q.x-Jr/2,y:q.y-Jr/2,width:Jr,height:Jr,onPointerDown:ee=>xe(ee,h),onClick:fe})]},h)})]})]})}const pC=4e3,mC=/^(?:https?:|mailto:|tel:)/i;function $p(e){return!!e&&typeof e=="object"&&e.type==="link"}function gC(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!mC.test(t)))return t}function hC(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if($p(c)){o(c.children??[],gC(c.value),c.target);continue}const u=c,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:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Fd(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 fC(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if($p(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function yC(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 d=1/0,c=-1/0,u=1/0,p=-1/0;for(const m of l){const g=m.x*n,f=m.y*i;g<d&&(d=g),g>c&&(c=g),f<u&&(u=f),f>p&&(p=f)}const v=(d+c)/2,y=(u+p)/2;return l.map(m=>{const g=m.x*n,f=m.y*i,x=g-v,R=f-y,b=Math.sqrt(x*x+R*R);if(b<1e-6)return m;const G=Math.max(0,b+r*t)/b;return{x:(v+x*G)/n,y:(y+R*G)/i}})})}const bs=2,Ss=2;function vC(e,t,n,i,o){if(e.kind!=="whole")return null;const r=t[e.originalIndex],l=e.token.text;if(!r||l.length<bs+Ss)return null;const d=Math.min(r.length-Ss,l.length-Ss);let c=-1;for(let u=d;u>=bs;u-=1)if(r[u-1]*i+o*i<=n){c=u;break}return c<bs?null:{fragmentText:`${l.slice(0,c)}-`,remainderText:l.slice(c),fragmentWidth:r[c-1]+o,remainderWidth:Math.max(0,e.width-r[c-1])}}function Nd(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:v}=e,y=!!e.hyphenate,m=e.charWidths??[],g=e.hyphenWidth??0,f=e.lineHeight*l,x=e.spaceWidth*l,R=Math.max(0,e.shapeMargin??0),b=[],S=t.map((k,W)=>({token:k,originalIndex:W,width:n[W],kind:"whole"}));if(!S.length||d<=0||f<=0)return{segments:b,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const G=Math.max(1,x*.5),D=f*b$,j=yC(i,R,d,c,o);let P=0,M=0,K=0,T=S[0].token.para,L=0,_=0,z=null;for(;P<S.length&&K<pC;){const k=M+f>c;if(k&&!u)break;const W=S[P].token.para;if(W>T+1){M+=f*(W-T-1),T=W-1,K+=1;continue}let w=k?[{x0:0,x1:d}]:R$(j,(M+D)/c,(M+f-D)/c,o).map(C=>({x0:C.x0*d,x1:C.x1*d}));p>0&&v>0&&!k&&w.length&&(z===null&&(z=K,L=w[0].x0,_=M),K-z<v&&(w=I$(w,{x0:L,x1:L+p})));const U=w.reduce((C,O)=>Math.max(C,O.x1-O.x0),0);for(const C of w){const O=C.x1-C.x0;if(O<G)continue;if(P>=S.length||S[P].token.para!==W)break;const V=P;let se=0;for(;P<S.length&&S[P].token.para===W;){const ie=S[P],N=P===V,de=ie.width*l,X=N?de:x+de;if(se+X<=O){se+=X,P+=1;continue}if(N&&O>=U-.5&&de>d-.5){se+=X,P+=1;continue}if(y){const oe=O-se-(N?0:x),fe=vC(ie,m,oe,l,g);if(fe){const Pe={token:{...ie.token,text:fe.fragmentText},originalIndex:ie.originalIndex,width:fe.fragmentWidth,kind:"fragment"},xe={token:{...ie.token,text:fe.remainderText},originalIndex:ie.originalIndex,width:fe.remainderWidth,kind:"remainder"};S.splice(P,1,Pe,xe),se+=(N?0:x)+fe.fragmentWidth*l,P+=1}}break}if(P>V){const ie=P>=S.length||S[P].token.para!==W;b.push({top:M,left:C.x0,width:O,from:V,to:P,justify:r==="justify"&&!ie})}if(P>=S.length||S[P].token.para!==W)break}T=W,M+=f,K+=1}let $=0;if(P>0){const k=S[P-1];$=k.kind==="fragment"?k.originalIndex:k.originalIndex+1}return{segments:b,placed:$,height:b.length?M:0,capLeft:L,capTop:_,renderTokens:S.map(k=>k.token)}}const xC=.12,bC=2,SC=10,ws=.25,wC=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},$C=(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,CC=(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 d=wC(e);(!r||!$C(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},$s=(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})))},Qo=typeof window>"u"?s.useEffect:s.useLayoutEffect;function TC(){return typeof document>"u"?null:document.body}function LC({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:v,padding:y,hyphenate:m,showOverflowIndicator:g,dropCapLines:f,dropCapSize:x,showGuides:R,typography:b,imageUrl:S,imageFocalX:G,imageFocalY:D,imageScale:j,imageCustomPath:P,pathDragActive:M,pathCarryImage:K,onCarryImageConsumed:T,pathEditor:L,imageEditor:_}){var ot,nt;const z=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[$,k]=s.useState(null),W=s.useRef(null),[w,U]=s.useState({width:0,height:0}),[C,O]=s.useState(0),[V,se]=s.useState(null),[ie,N]=s.useState(0),[de,X]=s.useState("none");s.useEffect(()=>{!L&&!_&&X("none")},[L,_]);const[ce,oe]=s.useState(null);s.useEffect(()=>{if(!S||typeof Image>"u"){oe(null);return}let me=!1;const Ne=new Image;return Ne.onload=()=>{me||oe({width:Ne.naturalWidth,height:Ne.naturalHeight})},Ne.src=S,()=>{me=!0}},[S]);const fe=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),Pe=s.useMemo(()=>hC(fe),[fe]),xe=s.useMemo(()=>fC(fe),[fe]),pe=f>0&&x>1?((nt=(ot=Pe[0])==null?void 0:ot.text)==null?void 0:nt.charAt(0))??"":"",Z=(L==null?void 0:L.contours)??null,le=s.useMemo(()=>{let me=[];if(Z){const Ne=xr(Z);Ne.length&&(me=$o(Ne,r))}if(!me.length){const Ne=i.trim(),st=Ne?xd(Ne,o,r):null;st&&st.length?me=st:me=js(n==="custom"?"rectangle":n)}return n==="circle"?$s(me,w):me},[Z,n,i,o,r,w.width,w.height]),re=L==null?void 0:L.onConvert,Ie=(L==null?void 0:L.needsConversion)??!1,we=s.useMemo(()=>{if(n==="circle")return!1;const me=Z??(i.trim()?Li(i):null);return!!(me&&xp(me,r))},[Z,i,r,n]),[Me,ye]=s.useState(null);Qo(()=>{if(!we){Me&&ye(null);return}!Me&&w.width>0&&w.height>0&&ye({width:w.width,height:w.height})},[we,w.width,w.height,Me]);const be=s.useMemo(()=>{if(!we||w.width<=0||w.height<=0)return le;const me=Me??w,Ne=r.width/me.width,st=r.height/me.height;return le.map(ut=>ut.map(Be=>({x:Be.x*Ne,y:Be.y*st})))},[le,we,Me,r.width,r.height,w.width,w.height]),Ce=s.useMemo(()=>{if(Z){const ut=xr(Z);if(ut.length){const Be=$o(ut,r);return n==="circle"?$s(Be,w):Be}}const me=P.trim(),Ne=me?xd(me,o,r):null,st=Ne&&Ne.length?Ne:js(n==="custom"?"rectangle":n);return n==="circle"?$s(st,w):st},[Z,n,P,o,r,w.width,w.height]),h=s.useMemo(()=>{if(!we||w.width<=0||w.height<=0)return Ce;const me=Me??w,Ne=r.width/me.width,st=r.height/me.height;return Ce.map(ut=>ut.map(Be=>({x:Be.x*Ne,y:Be.y*st})))},[Ce,we,Me,r.width,r.height,w.width,w.height]),q=s.useRef(null),Y=s.useRef(!1);s.useEffect(()=>{if(!(!re||w.width<=0||w.height<=0)){if(we){if(q.current===i)return;const me=Z??(i.trim()?Li(i):null);if(!(me!=null&&me.length))return;const Ne=ln(me,st=>({x:r.x+(st.x-r.x)/w.width*r.width,y:r.y+(st.y-r.y)/w.height*r.height}));q.current=Wo(Ne),re(Ne);return}!Ie||!le.length||Y.current||(Y.current=!0,re(ln(vp(le),me=>({x:me.x*va,y:me.y*va}))))}},[Ie,we,re,le,Z,i,r,w.width,w.height]);const ee=s.useCallback(()=>{const me=$;if(!me)return;const Ne=me.getBoundingClientRect(),st=parseFloat(window.getComputedStyle(me).paddingTop)||0;O(Be=>Math.abs(Be-st)<.5?Be:st);const ut={width:Ne.width,height:Ne.height};U(Be=>Math.abs(Be.width-ut.width)<.5&&Math.abs(Be.height-ut.height)<.5?Be:ut)},[$]);Qo(()=>{const me=$;if(!me||typeof ResizeObserver>"u")return;ee();const Ne=new ResizeObserver(ee);return Ne.observe(me),()=>Ne.disconnect()},[$,ee]),Qo(()=>{ee()},[y,ee]),s.useEffect(()=>{const me=typeof document<"u"?document.fonts:void 0;me!=null&&me.ready&&me.ready.then(()=>{N(Ne=>Ne+1)})},[]),Qo(()=>{const me=W.current;if(!me)return;if(!Pe.length){se(null);return}const Ne=[],st=document.createDocumentFragment();for(const bt of Pe){const A=document.createElement("span");Object.assign(A.style,Fd(bt.leaf)),A.textContent=bt.text,st.appendChild(A),Ne.push(A)}const ut=document.createElement("span");ut.textContent=" ",st.appendChild(ut);const Be=document.createElement("span");Be.textContent="-",st.appendChild(Be);const pt=pe||"H",Tt=document.createElement("span");Tt.textContent=pt,Tt.style.lineHeight="1",st.appendChild(Tt),me.replaceChildren(st);const Lt=window.getComputedStyle(me),xt=parseFloat(Lt.fontSize)||16,Et=parseFloat(Lt.lineHeight),Vt=Number.isNaN(Et)?xt*1.2:Et,Ut=Math.max(Vt,xt),Kt=document.createElement("span");Kt.textContent=pt,Kt.style.lineHeight=`${Ut}px`;const Pt=document.createElement("span");Pt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Kt.appendChild(Pt),me.appendChild(Kt);const jt=Kt.getBoundingClientRect().top,on=Pt.getBoundingClientRect().top,vt=Math.max(1,on-jt);Kt.remove();let Le=vt*.8;const lt=document.createElement("canvas").getContext("2d"),ct=bt=>`${Lt.fontStyle} ${Lt.fontWeight} ${bt}px ${Lt.fontFamily}`;if(lt){lt.font=ct(xt);const bt=lt.measureText(pt).actualBoundingBoxAscent;bt>0&&(Le=bt)}const wt=x>1?(x-1)*Ut+Le:Le;let It=xt*(wt/Le);if(lt){lt.font=ct(It);const bt=lt.measureText(pt).actualBoundingBoxAscent;bt>0&&(It=It*(wt/bt))}Tt.style.fontSize=`${It}px`,Tt.style.lineHeight=`${It}px`;const gt=document.createElement("span");gt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Tt.appendChild(gt);const Ot=Math.max(1,gt.getBoundingClientRect().top-Tt.getBoundingClientRect().top);gt.remove();const Mt=(x-1)*Ut+vt-Ot,Gt=Ne.map(bt=>bt.getBoundingClientRect().width),Xt=ut.getBoundingClientRect().width,Dt=Be.getBoundingClientRect().width,zt=pe?Tt.getBoundingClientRect().width:0,Bt=m?Ne.map(bt=>{const A=bt.firstChild;if(!(A instanceof Text)||A.data.length<4)return;const Te=document.createRange(),Ae=bt.getBoundingClientRect().left,ze=[];for(let mt=1;mt<=A.data.length;mt+=1)Te.setStart(A,0),Te.setEnd(A,mt),ze.push(Te.getBoundingClientRect().right-Ae);return ze}):[];me.replaceChildren(),se({widths:Gt,spaceWidth:Xt,dashWidth:Dt,charWidths:Bt,lineHeight:Ut,capWidth:zt,dropCapFontSize:It,dropCapTopAdjust:Mt})},[Pe,b,pe,f,x,ie,w.width,m]);const ve=V&&pe?V.capWidth+V.lineHeight*xC:0,B=Math.max(f,Math.ceil(x)),I=s.useMemo(()=>{if(!V||!Pe.length||w.width<=0||w.height<=0||!u)return 1;const me=ut=>Nd({tokens:Pe,widths:V.widths,spaceWidth:V.spaceWidth,lineHeight:V.lineHeight,width:w.width,height:w.height,rings:be,mode:l,align:d,scale:ut,allowOverflow:!1,capInset:ve*ut,capLines:pe?B:0,hyphenate:m,charWidths:V.charWidths,hyphenWidth:V.dashWidth,shapeMargin:C});if(me(1).placed>=Pe.length)return 1;if(me(ws).placed<Pe.length)return ws;let Ne=ws,st=1;for(let ut=0;ut<SC;ut+=1){const Be=(Ne+st)/2;me(Be).placed>=Pe.length?Ne=Be:st=Be}return Ne},[V,Pe,w.width,w.height,be,l,d,u,ve,pe,B,m,C]);s.useEffect(()=>{v(I)},[I,v]);const Q=u?Math.min(p,I):1,ne=s.useMemo(()=>!V||!Pe.length||w.width<=0||w.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:Pe}:Nd({tokens:Pe,widths:V.widths,spaceWidth:V.spaceWidth,lineHeight:V.lineHeight,width:w.width,height:w.height,rings:be,mode:l,align:d,scale:Q,allowOverflow:c,capInset:ve*Q,capLines:pe?B:0,hyphenate:m,charWidths:V.charWidths,hyphenWidth:V.dashWidth,shapeMargin:C}),[V,Pe,w.width,w.height,be,l,d,Q,c,ve,pe,B,m,C]),H=g&&Pe.length>0&&ne.placed<Pe.length,te=V?V.dropCapFontSize*Q:0,ke=V?V.dropCapTopAdjust*Q:0,ge=d==="justify"?"left":d,J=V?V.lineHeight*Q:0,Ye=ne.segments.length?ne.segments[ne.segments.length-1]:null,je=Ye?{top:Ye.top+J,left:Ye.left+Ye.width/2}:{top:w.height,left:w.width/2},it=!!(L&&Z&&w.width>0&&w.height>0),qe=!!_,et=(it||qe)&&w.width>0&&w.height>0,Je=CC($,et),Ge=et&&Je?TC():null,$e=s.useRef(!1),He=s.useCallback(me=>{$e.current=me},[]);s.useEffect(()=>{if(!it&&!qe)return;const me=Ne=>{const st=$;if(!st)return;const ut=st.getBoundingClientRect();Ne.clientX>=ut.left&&Ne.clientX<=ut.right&&Ne.clientY>=ut.top&&Ne.clientY<=ut.bottom&&(Ne.preventDefault(),Ne.stopPropagation(),X(pt=>pt==="shape"&&$e.current?pt:pt==="shape"&&qe?"image":it?"shape":"image"))};return document.addEventListener("dblclick",me,!0),()=>document.removeEventListener("dblclick",me,!0)},[it,qe,$]);const De=s.useMemo(()=>S&&w.width>0&&w.height>0?S$(h,w):null,[S,h,w.width,w.height]),Qe=s.useRef(null),he=(()=>{const me=Qe.current;return K||!_||!ce||!De||!me||P===me.customPath||me.shape!==n&&n!=="custom"?null:oC(me.bounds,De,ce,me.focalX,me.focalY,me.scale)})();Qo(()=>{if(M||!_||!ce||!De)return;const me=Qe.current,Ne=!!(me&&P!==me.customPath);Ne&&he&&_.onCommit(he),Ne&&K&&(T==null||T()),Qe.current={rings:h,bounds:De,focalX:(he==null?void 0:he.focalX)??G,focalY:(he==null?void 0:he.focalY)??D,scale:(he==null?void 0:he.scale)??j,customPath:P,shape:n}},[M,K,P,n,h,De,_,ce,G,D,j,he,T]);const _e=Qe.current,Ve=!!(M&&!K&&_e&&!he),tt=Ve&&_e?_e.focalX:(he==null?void 0:he.focalX)??G,ft=Ve&&_e?_e.focalY:(he==null?void 0:he.focalY)??D,rt=Ve&&_e?_e.scale:(he==null?void 0:he.scale)??j,Oe=Ve&&_e?_e.bounds:De,Fe=s.useMemo(()=>{if(!(w.width>0)||!(w.height>0))return"";let me=Sd(i,Z,o,r,n,w);if(we){const Ne=Me??w,st=r.width/Ne.width,ut=r.height/Ne.height;me=ln(me,Be=>({x:Be.x*st,y:Be.y*ut}))}return wd(me,w)||vd(be,w)},[i,Z,o,r,n,w.width,w.height,we,Me,be]),Ee=s.useMemo(()=>{if(!S||!(w.width>0)||!(w.height>0))return"";let me=Sd(P,Z,o,r,n,w);if(we){const Ne=Me??w,st=r.width/Ne.width,ut=r.height/Ne.height;me=ln(me,Be=>({x:Be.x*st,y:Be.y*ut}))}return wd(me,w)||vd(h,w)},[S,P,Z,o,r,n,w.width,w.height,we,Me,h]),Ze=`${z}-clip`,We=s.useMemo(()=>{if(!Oe)return null;const me=ce??{width:Oe.width,height:Oe.height},Ne=Gi(Oe,me,rt);return{x:Dn(Oe.width,Ne.width,tt),y:Dn(Oe.height,Ne.height,ft),width:Ne.width,height:Ne.height}},[Oe,ce,tt,ft,rt]);return a.jsxs("div",{className:`${e}-column`,style:{padding:y},ref:k,children:[Fe?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:Fe,fillRule:"evenodd"}),S&&Ee&&Oe&&We?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Ze,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Ee,fillRule:"evenodd"})})}),a.jsx("image",{href:S,x:Oe.x+We.x,y:Oe.y+We.y,width:We.width,height:We.height,preserveAspectRatio:"none",clipPath:`url(#${Ze})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...b,["--"+e+"-fit"]:Q,top:0,left:0,width:w.width,height:w.height},children:[a.jsx("div",{className:`${e}-measure`,ref:W,style:b,"aria-hidden":!0}),ne.segments.map((me,Ne)=>{const st=ne.renderTokens.slice(me.from,me.to),ut=Ne===0;return a.jsx("div",{className:`${e}-line${me.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${me.top}px`,left:`${me.left}px`,width:`${me.width}px`,textAlign:me.justify?void 0:ge},children:st.map((Be,pt)=>{const Lt=pe&&ut&&me.from===0&&pt===0?Be.text.slice(1):Be.text,xt=Fd(Be.leaf),Et=Be.href?a.jsx("a",{className:`${e}-link`,href:Be.href,target:Be.target,rel:Be.target?"noopener noreferrer":void 0,style:xt,children:Lt}):a.jsx("span",{style:xt,children:Lt});return a.jsxs("span",{children:[!me.justify&&pt>0?" ":null,Et]},pt)})},`${me.from}-${me.to}-${Ne}`)}),R&&!Z&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:be.map((me,Ne)=>a.jsx("polygon",{points:me.map(st=>`${st.x},${st.y}`).join(" ")},Ne))})]}),pe&&V&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...b,top:`${ne.capTop+ke}px`,left:`${ne.capLeft}px`,fontSize:`${te}px`,lineHeight:`${te}px`},children:pe}),Ge&&Je&&(Z&&L||_)&&ai.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:Je.top,left:Je.left,width:Je.width,height:Je.height,zIndex:bC,pointerEvents:"none"},children:[Z&&L&&a.jsx(uC,{P:e,box:{width:Je.width,height:Je.height},viewBox:r,contours:Z,snap:L.snap,stretchToBox:!we,uniformStretch:n==="circle",stage:de,onStageChange:X,onSelectionChange:He,onChange:L.onChange,onCommit:L.onCommit}),_&&Oe&&a.jsx(rC,{P:e,box:{width:Je.width,height:Je.height},bounds:Oe,natural:ce,imageUrl:S,maskPath:Ee,stage:de,onStageChange:X,focalX:tt,focalY:ft,scale:rt,onChange:_.onChange,onCommit:_.onCommit})]}),Ge),a.jsx("div",{className:`${e}-a11y`,children:xe.map((me,Ne)=>a.jsx("p",{children:me},Ne))}),H&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:je.top,left:je.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 Cp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],IC={x:0,y:0,width:100,height:100},RC=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?IC:{x:t[0],y:t[1],width:t[2],height:t[3]}},PC=e=>`
|
|
26579
|
+
`;function Jo(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 gi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function Al(e){return{[gi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[gi(e,"fontSettings")]:{...Di.fontSettings,scope:"common",title:""},[gi(e,"fontSize")]:{...Di.fontSize,scope:"layout",title:""},[gi(e,"lineHeight")]:{...Di.lineHeight,scope:"layout",title:""},[gi(e,"letterSpacing")]:{...Di.letterSpacing,scope:"layout",title:""},[gi(e,"wordSpacing")]:{...Di.wordSpacing,scope:"layout",title:""},[gi(e,"textAlign")]:{...Di.textAlign,scope:"layout",title:""},[gi(e,"textAppearance")]:{...Di.textAppearance,scope:"layout",title:""}}}const d$=Al(""),u$=Al("open"),p$=Al("compact"),m$=["__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"],g$=["__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"],h$=["__componentName__",{type:"row",items:["textWidth","effect"]},"position","openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],Zn={textTransform:"none",textDecoration:"none",fontVariant:"normal"},fs={fontWeight:400,fontStyle:"normal"},qr={d:"Always",t:"Open Only",m:"Open Only"},f$=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],y$=["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],v$={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:"Link Default",titleByState:{default:"Link Default",hover:"Link 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"}},compactCloseButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{compact:"Close Default","compact-hover":"Close Hover"},display:{type:"palette-color-picker"}},compactLinkColor:{type:"string",scope:"common",title:"Link Default",titleByState:{compact:"Link Default","compact-hover":"Link 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:"Link Default",titleByState:{open:"Link Default","open-hover":"Link 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:{default:"Close Default",hover:"Close Hover",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"]}},textWidth:{type:"number",scope:"layout",title:"Text 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:[...f$]}},stateOverrides:{type:"object",scope:"common"},gap:Jo("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:Jo("Text padding left"),textPaddingRight:Jo("Text padding right"),textPaddingTop:Jo("Text padding top"),textPaddingBottom:Jo("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}},...d$,...u$,...p$},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:qr},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:qr},{link:{type:"page",value:"",target:"self"},label:"About",showIn:qr},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:qr}],logo:{mode:"On",icon:"https://cdn.cntrl.site/component-assets/hamburger-logo.svg"},backgroundColor:"#ffffff",logoColor:"#000000",iconColor:"#000000",linkColor:"#000000",openLinkColor:"#000000",compactIconColor:"#000000",compactCloseButtonColor:"#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:fs,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:fs,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:fs,compactTextAlign:"left",stateOverrides:{hover:{linkColor:"#666666",iconColor:"#666666",logoColor:"#666666",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:"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,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:Zn,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,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:Zn},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,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:Zn,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,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:Zn},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,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:Zn,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,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:Zn,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactCloseButtonColor","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:m$},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:g$,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:h$},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...y$],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","closeButtonColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactCloseButtonColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactCloseButtonColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},x$={element:l$,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:v$,sourceCode:c$,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},fd=120,yd=3,b$=.12,Fl={x:0,y:0,width:100,height:100};function $o(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function ya(e){return e<0?0:e>1?1:e}function vd(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 S$(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,x=u.y*t.height;p<n&&(n=p),p>o&&(o=p),x<i&&(i=x),x>r&&(r=x)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function w$(e){return e.map(([t,n])=>({x:t,y:n}))}function ys(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}function $$(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=ya(n[o]),l=ya(n[o+1]);l>r&&i.push({x0:r,x1:l})}return C$(i)}function C$(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 T$(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 L$(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 I$(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 R$(e,t,n,i){let o=null;for(let r=0;r<yd;r+=1){const l=ya(t+(n-t)*r/Math.max(1,yd-1)),d=$$(e,l),c=i==="avoid"?L$(d):d;if(o=o===null?c:T$(o,c),o.length===0)return[]}return o??[]}function xd(e,t="stretch",n=Fl){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Li(i),d=xr(l);if(d.length)return t==="viewbox"?$o(d,n):ys(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(x=>x.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const x of c){const v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",x),u.appendChild(v);let m=0;try{m=v.getTotalLength()}catch{m=0}if(!m)continue;const g=[];for(let h=0;h<fd;h+=1){const b=v.getPointAtLength(h/fd*m);g.push({x:b.x,y:b.y})}p.push(g)}return p.length?t==="viewbox"?$o(p,n):ys(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"?$o([r],n):ys([r])}const Nl={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",va=100,Bs=16,P$=12,k$=16,vs=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,E$=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,bd=Math.PI/4,M$=8,A$=Math.PI/18,F$=8,fo=24,yo=[];function N$(){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 xs(e,t){return ln(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function _$(e){const t=Si(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:ln(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function W$(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 ln(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function Sd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=xs(t,i);else{const d=e.trim();if(d&&/^[Mm]/.test(d)){const c=Li(d);c.length&&(l=n==="viewbox"?xs(c,i):_$(c))}if(!l.length){const c=o!=="custom"?Nl[o]:void 0;c?l=xs(Li(c),Fl):l=N$()}}return o==="circle"?W$(l,r):l}function wd(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":Wo(ln(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function js(e){const t=e==="rectangle"||e==="custom"?void 0:Nl[e];return t?$o(xr(Li(t)),Fl):[w$([[0,0],[1,0],[1,1],[0,1]])]}function H$(e){const t=e.match(E$);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function wn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Vs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function cn(e){return{x:e.x,y:e.y}}function O$(e){return{p:cn(e.p),in:e.in?cn(e.in):null,out:e.out?cn(e.out):null}}function zn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(O$)}))}function ln(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 $d(e,t,n,i=n){return ln(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function D$(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:cn(e),c2:cn(l),p:cn(l)}];const u=i*Math.PI/180,p=Math.cos(u),x=Math.sin(u),v=(e.x-l.x)/2,m=(e.y-l.y)/2,g=p*v+x*m,h=-x*v+p*m,b=g*g/(d*d)+h*h/(c*c);if(b>1){const U=Math.sqrt(b);d*=U,c*=U}const E=o===r?-1:1,y=d*d*h*h+c*c*g*g,w=Math.max(0,d*d*c*c-y),j=y===0?0:E*Math.sqrt(w/y),G=j*d*h/c,A=-j*c*g/d,P=p*G-x*A+(e.x+l.x)/2,W=x*G+p*A+(e.y+l.y)/2,Y=Math.atan2((h-A)/c,(g-G)/d);let I=Math.atan2((-h-A)/c,(-g-G)/d)-Y;!r&&I>0&&(I-=Math.PI*2),r&&I<0&&(I+=Math.PI*2);const H=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2))),O=I/H,C=4/3*Math.tan(O/4),L=(U,T)=>({x:P+p*d*U-x*c*T,y:W+x*d*U+p*c*T}),D=[];let S=Y;for(let U=0;U<H;U+=1){const T=S+O,_=Math.cos(S),B=Math.sin(S),ae=Math.cos(T),ie=Math.sin(T);D.push({c1:L(_-C*B,B+C*_),c2:L(ae+C*ie,ie-C*ae),p:U===H-1?cn(l):L(ae,ie)}),S=T}return D}function Li(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const m=i[0],g=i[i.length-1];Math.abs(m.p.x-g.p.x)<1e-6&&Math.abs(m.p.y-g.p.y)<1e-6&&(m.in=g.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,g)=>{i.push({p:m,in:Vn(g??null,m),out:null}),r=m},x=m=>{if(!i.length)return;const g=i[i.length-1];g.out=Vn(m,g.p)};vs.lastIndex=0;let v=vs.exec(t);for(;v!==null;){const m=v[1],g=m.toUpperCase(),h=m!==g,b=H$(v[2]),E=y=>h?{x:r.x+b[y],y:r.y+b[y+1]}:{x:b[y],y:b[y+1]};if(g==="Z")o=!0,u(),r=cn(l),d=null,c=null;else if(g==="M"){for(let y=0;y+1<b.length;y+=2){const w=E(y);y===0&&(u(),l=cn(w)),p(w)}d=null,c=null}else if(g==="L"){for(let y=0;y+1<b.length;y+=2)p(E(y));d=null,c=null}else if(g==="H"){for(const y of b)p({x:h?r.x+y:y,y:r.y});d=null,c=null}else if(g==="V"){for(const y of b)p({x:r.x,y:h?r.y+y:y});d=null,c=null}else if(g==="C"){for(let y=0;y+5<b.length;y+=6){const w=E(y),j=E(y+2),G=E(y+4);x(w),p(G,j),d=j}c=null}else if(g==="S"){for(let y=0;y+3<b.length;y+=4){const w=d?Vs(d,r):cn(r),j=E(y),G=E(y+2);x(w),p(G,j),d=j}c=null}else if(g==="Q")for(let y=0;y+3<b.length;y+=4){const w=E(y),j=E(y+2);x(wn(r,w,2/3)),p(j,wn(j,w,2/3)),c=w,d=null}else if(g==="T")for(let y=0;y+1<b.length;y+=2){const w=c?Vs(c,r):cn(r),j=E(y);x(wn(r,w,2/3)),p(j,wn(j,w,2/3)),c=w,d=null}else if(g==="A")for(let y=0;y+6<b.length;y+=7){const w=h?{x:r.x+b[y+5],y:r.y+b[y+6]}:{x:b[y+5],y:b[y+6]};for(const j of D$(r,b[y],b[y+1],b[y+2],b[y+3]!==0,b[y+4]!==0,w))x(j.c1),p(j.p,j.c2);d=null,c=null}v=vs.exec(t)}return u(),n}function On(e){return`${Number(e.toFixed(2))}`}function Vn(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function hp(e){return!!(Vn(e.in,e.p)||Vn(e.out,e.p))}function Vo(e,t){return!Vn(e.out,e.p)&&!Vn(t.in,t.p)}function Cd(e,t){if(Vo(e,t))return`L${On(t.p.x)},${On(t.p.y)}`;const n=Vn(e.out,e.p)??e.p,i=Vn(t.in,t.p)??t.p;return`C${On(n.x)},${On(n.y)} ${On(i.x)},${On(i.y)} ${On(t.p.x)},${On(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${On(i.p.x)},${On(i.p.y)}`);let r=i;for(const l of o)t.push(Cd(r,l)),r=l;if(n.closed){const l=Cd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function fp(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 Gs(e,t,n){if(Vo(e,t))return wn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function xr(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of fp(n)){if(Vo(o.from,o.to)){i.push(cn(o.from.p));continue}for(let r=0;r<Bs;r+=1)i.push(Gs(o.from,o.to,r/Bs))}n.closed||i.push(cn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Si(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of xr(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 z$(e){const t=Si(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 yp(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 vp(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=P$)return{closed:!0,nodes:t.map(r=>({p:cn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/k$)),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:cn(r),...yp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function xp(e,t,n=1){if(!e.length)return!1;const i=Si(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),d=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-d||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+d}function B$(e,t,n,i,o,r,l){const d=t.width>0?n.width/t.width:1,c=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(d>0)||!(c>0)?e:ln(e,u=>{const p=i+(u.x-t.x)*r,x=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+x/c}})}function j$(e,t){if(!e.length)return e;const n=Si(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),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return ln(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function bp(e){const t={x:0,y:0,width:va,height:va},n=e!=="custom"?Nl[e]:void 0,i=n?ln(Li(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):ln(vp(js("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=j$(i,t);return{shape:e,customPath:Wo(o),pathFit:"viewbox",pathViewBox:zs}}function Ur(e,t){return t>0?Math.round(e/t)*t:e}function V$(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,d=zn(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function Td(e,t,n,i){var r;if(!t.length)return e;const o=zn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function G$(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((d,c)=>c-d);for(const d of l)i=Sp(i,r,d)}),i}function X$(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=zn(e),c=d[t].nodes[n];if(c[i]=cn(o),r){const p=i==="in"?"out":"in";c[p]=Vs(o,c.p)}return d}function q$(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 U$(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 d=zn(e),c=d[t].nodes,u=n+1;if(Vo(r,l))return c.splice(u,0,{p:wn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,x=l.in??l.p,v=wn(r.p,p,i),m=wn(p,x,i),g=wn(x,l.p,i),h=wn(v,m,i),b=wn(m,g,i),E=wn(h,b,i),y=(n+1)%o.nodes.length;return c[n].out=v,c[y].in=g,c.splice(u,0,{p:E,in:h,out:b}),{contours:d,nodeIndex:u}}function Sp(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 Ld(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,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,x=!!Vn(l[u].out,l[u].p),v=!!Vn(l[p].in,l[p].p);if(hp(d)||x||v)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const m=yp(l[u].p,d.p,l[p].p);return d.in=m.in,d.out=m.out,r}function Y$(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)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y),point:d}}function Id(e,t){let n=null;return e.forEach((i,o)=>{for(const r of fp(i)){const l=Vo(r.from,r.to)?1:Bs;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Y$(t,Gs(r.from,r.to,c),Gs(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance,point:p.point})}}}),n}function K$(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 Rd(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-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 Pd(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}function Z$(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 J$(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function Xs(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 Q$(e,t){const n=Xs(e,t);return n?{kind:"align",a:{x:e.x-n.x*fo,y:e.y-n.y*fo},b:{x:t.x+n.x*fo,y:t.y+n.y*fo}}:{kind:"align",a:e,b:t}}function qs(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 kd(e,t,n,i,o){if(e.axis===null)return Q$(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return qs(o(r)[t],t,i)}function eC(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(kd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(kd(n,"y",l,i,o)),r}function tC(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 Xs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return Xs(i(p),r)}function nC(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,x=Math.hypot(u,p);if(x<1e-6)return{point:e,guides:yo};const v=Math.atan2(p,u),m=Math.round(v/bd)*bd;let g=o?m:null,h=!1;if(!o){const A=[];n&&A.push({angle:Math.atan2(n.y,n.x),smooth:!0}),A.push({angle:m,smooth:!1});for(const P of A){const W=J$(P.angle-v);if(!(Math.abs(W)>A$)&&!(Math.abs(Math.sin(W))*x>M$)){g=P.angle,h=P.smooth;break}}}const b=i!==null&&i>0&&Math.abs(x-i)<=F$;if(g===null&&!b)return{point:e,guides:yo};const E=g??v,y=b?i:x,w={x:Math.cos(E),y:Math.sin(E)},j=y+(g===null?0:fo),G=b?y:h?fo:0;return{point:l({x:d.x+w.x*y,y:d.y+w.y*y}),guides:[{kind:"angle",a:{x:d.x-w.x*G,y:d.y-w.y*G},b:{x:d.x+w.x*j,y:d.y+w.y*j}}]}}const Us=.1,Ys=8,iC=4,Ed=10,xa=(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}}},wp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},Ks=(e,t)=>{const n=xa(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Ed,y:n.y+o*Ed}},Zs=(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),Gi=(e,t,n)=>{const i=Zs(e,t)*n;return{width:t.width*i,height:t.height*i}},Dn=(e,t,n)=>(e-t)*n,vo=(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)<iC?.5:ya(r)},oC=(e,t,n,i,o,r)=>{const l=Gi(e,n,r),d=e.x+Dn(e.width,l.width,i),c=e.y+Dn(e.height,l.height,o),u=Zs(e,n),p=Zs(t,n),x=Math.min(Ys,Math.max(Us,p>0?r*(u/p):r)),v=Gi(t,n,x);return{focalX:vo(t.width,v.width,d-t.x,{clamp:!1}),focalY:vo(t.height,v.height,c-t.y,{clamp:!1}),scale:x}},Md=1.08,Yr=14,Kr=8;function rC({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:x,onCommit:v}){const m=s.useRef(null),g=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,h=s.useRef(null),b=s.useRef(null),E=s.useRef({focalX:c,focalY:u,scale:p});E.current={focalX:c,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var O;y&&((O=m.current)==null||O.focus({preventScroll:!0}))},[y]);const w=s.useCallback((O,C)=>{var D;const L=(D=m.current)==null?void 0:D.getBoundingClientRect();return!L||L.width<=0||L.height<=0?{x:0,y:0}:{x:(O-L.left)/L.width*t.width,y:(C-L.top)/L.height*t.height}},[t.width,t.height]),j=O=>{var L,D;if(!i)return;O.stopPropagation(),O.preventDefault(),(L=m.current)==null||L.focus({preventScroll:!0});const C=Gi(n,i,p);h.current={pointerId:O.pointerId,origin:w(O.clientX,O.clientY),startX:Dn(n.width,C.width,c),startY:Dn(n.height,C.height,u),width:C.width,height:C.height,moved:!1},(D=m.current)==null||D.setPointerCapture(O.pointerId)},G=(O,C)=>{var ae,ie;if(!i)return;O.stopPropagation(),O.preventDefault(),(ae=m.current)==null||ae.focus({preventScroll:!0});const L=Gi(n,i,p),D=Dn(n.width,L.width,c),S=Dn(n.height,L.height,u),U={minX:D,minY:S,maxX:D+L.width,maxY:S+L.height},T=xa(U,wp(C)),_=xa(U,C),B=Math.hypot(_.x-T.x,_.y-T.y);!isFinite(B)||B<=0||(b.current={pointerId:O.pointerId,anchor:T,startDistance:B,startScale:p,startX:D,startY:S,moved:!1},(ie=m.current)==null||ie.setPointerCapture(O.pointerId))},A=O=>{if(!i)return;const C=b.current;if(C&&O.pointerId===C.pointerId){O.stopPropagation(),O.preventDefault();const D=w(O.clientX,O.clientY),S={x:D.x-n.x,y:D.y-n.y},U=Math.hypot(S.x-C.anchor.x,S.y-C.anchor.y),T=Math.min(Ys,Math.max(Us,C.startScale*(U/C.startDistance)));if(!C.moved&&Math.abs(T-C.startScale)<1e-4)return;C.moved=!0;const _=T/C.startScale,B=C.anchor.x+(C.startX-C.anchor.x)*_,ae=C.anchor.y+(C.startY-C.anchor.y)*_,ie=Gi(n,i,T);x({focalX:vo(n.width,ie.width,B),focalY:vo(n.height,ie.height,ae),scale:T});return}const L=h.current;if(L&&O.pointerId===L.pointerId){O.stopPropagation(),O.preventDefault();const D=w(O.clientX,O.clientY),S=D.x-L.origin.x,U=D.y-L.origin.y;if(!L.moved&&S===0&&U===0)return;L.moved=!0,x({focalX:vo(n.width,L.width,L.startX+S),focalY:vo(n.height,L.height,L.startY+U),scale:p})}},P=O=>{var D,S;const C=h.current;if(C&&O.pointerId===C.pointerId){h.current=null,O.stopPropagation(),(D=m.current)!=null&&D.hasPointerCapture(C.pointerId)&&m.current.releasePointerCapture(C.pointerId),C.moved&&v(E.current);return}const L=b.current;L&&O.pointerId===L.pointerId&&(b.current=null,O.stopPropagation(),(S=m.current)!=null&&S.hasPointerCapture(L.pointerId)&&m.current.releasePointerCapture(L.pointerId),L.moved&&v(E.current))},W=O=>{if(O.key==="Escape"){O.stopPropagation(),d("none");return}if(O.key==="="||O.key==="+"||O.key==="-"||O.key==="_"){O.preventDefault(),O.stopPropagation();const C=O.key==="="||O.key==="+",L=Math.min(Ys,Math.max(Us,p*(C?Md:1/Md))),D={focalX:c,focalY:u,scale:L};x(D),v(D)}},Y=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},I=s.useMemo(()=>{const O=i??{width:n.width,height:n.height},C=Gi(n,O,p);return!(C.width>0)||!(C.height>0)?null:{x:n.x+Dn(n.width,C.width,c),y:n.y+Dn(n.height,C.height,u),width:C.width,height:C.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),H=I?{minX:I.x,minY:I.y,maxX:I.x+I.width,maxY:I.y+I.height}:$;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:W,onPointerMove:A,onPointerUp:P,onPointerCancel:P,onLostPointerCapture:P,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&I&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:g,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(#${g})`}),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:j}),Y.map(O=>{const C=Ks(H,O),L=O==="ne"||O==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:C.x-Kr/2,y:C.y-Kr/2,width:Kr,height:Kr}),a.jsx("rect",{className:`${e}-editor-scale-grab${L?` ${e}-editor-scale-grab-nesw`:""}`,x:C.x-Yr/2,y:C.y-Yr/2,width:Yr,height:Yr,onPointerDown:D=>G(D,O)})]},O)})]})]})}const Js=10,aC=Js*2,Hn=7,sC=4,lo=9,lC=3.5,Ad=1.08,cC=.05,Zr=14,dC=1,Jr=14,Qr=8;function uC({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:d,onStageChange:c,onSelectionChange:u,onChange:p,onCommit:x}){const v=s.useRef(null),m=s.useRef(null),g=s.useRef(i);g.current=i;const h=s.useRef(null),b=s.useRef(null),E=s.useRef(null),y=s.useRef(null),[w,j]=s.useState([]),[G,A]=s.useState(yo),[P,W]=s.useState(null),Y=s.useCallback(f=>{A(q=>Z$(q,f)?q:f)},[]),$=d==="shape";s.useEffect(()=>{var f;$&&((f=v.current)==null||f.focus({preventScroll:!0}))},[$]),s.useEffect(()=>{$||j(f=>f.length?[]:f)},[$]);const I=w.length>0;s.useEffect(()=>{u==null||u(I)},[I,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const H=n.width>0?t.width/n.width:1,O=n.height>0?t.height/n.height:1,C=Math.min(H,O),L=r&&l?C:H,D=r&&l?C:O,S=r&&l?(t.width-n.width*C)/2:0,U=r&&l?(t.height-n.height*C)/2:0,T=s.useCallback(f=>r?{x:S+(f.x-n.x)*L,y:U+(f.y-n.y)*D}:{x:f.x-n.x,y:f.y-n.y},[r,n,L,D,S,U]),_=s.useCallback(f=>r?{x:n.x+(L>0?(f.x-S)/L:0),y:n.y+(D>0?(f.y-U)/D:0)}:{x:n.x+f.x,y:n.y+f.y},[r,n,L,D,S,U]),B=s.useMemo(()=>_({x:t.width/2,y:t.height/2}),[_,t.width,t.height]),ae=s.useCallback((f,q)=>{var ne;const K=(ne=v.current)==null?void 0:ne.getBoundingClientRect();if(!K||K.width<=0||K.height<=0)return{x:0,y:0};if(r){const ge=(f-K.left)/K.width*t.width,z=(q-K.top)/K.height*t.height;return{x:n.x+(L>0?(ge-S)/L:0),y:n.y+(D>0?(z-U)/D:0)}}return{x:n.x+(f-K.left),y:n.y+(q-K.top)}},[r,n,t.width,t.height,L,D,S,U]),ie=s.useCallback((f,q)=>{var ne;const K=(ne=v.current)==null?void 0:ne.getBoundingClientRect();return!K||K.width<=0||K.height<=0?{x:0,y:0}:{x:(f-K.left)/K.width*t.width,y:(q-K.top)/K.height*t.height}},[t.width,t.height]),k=s.useCallback((f,q)=>{const K=l&&!(q!=null&&q.preserveShape)?B$(f,n,t,S,U,L,D):f;x(K,q)},[x,l,n,t,S,U,L,D]),ue=s.useCallback(()=>{W(null)},[]),X=s.useCallback((f,q,K)=>{if(!K||h.current||b.current||E.current||y.current){ue();return}const ne=ie(f,q),ge=ln(g.current,T);for(const V of ge)for(const Le of V.nodes)if(Math.hypot(Le.p.x-ne.x,Le.p.y-ne.y)<=lo){ue();return}const z=Id(ge,ne);if(!z||z.distance>Js){ue();return}const R=ge[z.contour],Q=R==null?void 0:R.nodes[z.segment],ee=R==null?void 0:R.nodes[(z.segment+1)%((R==null?void 0:R.nodes.length)??1)],ce=!!(Q&&ee&&!Vo(Q,ee));W(V=>V&&V.curved===ce&&Math.hypot(V.point.x-z.point.x,V.point.y-z.point.y)<.25?V:{point:z.point,curved:ce})},[ie,T,ue]),le=f=>{var Be;const q=f.metaKey||f.ctrlKey,K=E.current;if(K&&f.pointerId===K.pointerId){if(f.stopPropagation(),f.preventDefault(),K.startDistance<=0)return;const at=ae(f.clientX,f.clientY),Ue=Math.hypot(at.x-K.origin.x,at.y-K.origin.y),et=Math.max(cC,Ue/K.startDistance);if(!K.moved&&Math.abs(et-1)<1e-4)return;K.moved=!0,p($d(K.startContours,K.origin,et));return}const ne=b.current;if(ne&&f.pointerId===ne.pointerId){f.stopPropagation(),f.preventDefault();const at=ae(f.clientX,f.clientY),{bbox:Ue}=ne,et=Ue.maxX-Ue.minX,Je=Ue.maxY-Ue.minY,Ye=at.x-ne.origin.x,xe=at.y-ne.origin.y;let We=Ye,He=xe;if(isFinite(et)&&isFinite(Je))if(r){let he=n.x,Ne=n.x+n.width,Ve=n.y,tt=n.y+n.height;l&&(L>0&&(he=n.x+(0-S)/L,Ne=n.x+(t.width-S)/L),D>0&&(Ve=n.y+(0-U)/D,tt=n.y+(t.height-U)/D));const mt=Math.min(he,Ne-et),st=Math.max(he,Ne-et),De=Math.min(Ve,tt-Je),Fe=Math.max(Ve,tt-Je),Xe=Math.min(st,Math.max(mt,Ue.minX+Ye)),ot=Math.min(Fe,Math.max(De,Ue.minY+xe));We=Xe-Ue.minX,He=ot-Ue.minY}else{const he=Ue.minX-n.x,Ne=Ue.minY-n.y,Ve=Math.min(0,t.width-et),tt=Math.max(0,t.width-et),mt=Math.min(0,t.height-Je),st=Math.max(0,t.height-Je),De=Math.min(tt,Math.max(Ve,he+Ye)),Fe=Math.min(st,Math.max(mt,Ne+xe));We=De-he,He=Fe-Ne}const Qe=[];if(!q&&isFinite(et)&&isFinite(Je)){const he=T({x:Ue.minX+et/2+We,y:Ue.minY+Je/2+He}),Ne={x:t.width/2,y:t.height/2};Math.abs(he.x-Ne.x)<=Zr&&(We=B.x-Ue.minX-et/2,Qe.push(qs(Ne.x,"x",t))),Math.abs(he.y-Ne.y)<=Zr&&(He=B.y-Ue.minY-Je/2,Qe.push(qs(Ne.y,"y",t)))}if(!ne.moved&&We===0&&He===0)return;ne.moved=!0,Y(Qe.length?Qe:yo),p(ln(ne.startContours,he=>({x:he.x+We,y:he.y+He})),{carryImage:!0});return}const ge=y.current;if(ge&&f.pointerId===ge.pointerId){f.stopPropagation(),f.preventDefault();const at=ae(f.clientX,f.clientY);let Ue=at.x-ge.origin.x,et=at.y-ge.origin.y;if(f.shiftKey&&(Math.abs(Ue)>Math.abs(et)?et=0:Ue=0),!ge.moved&&Ue===0&&et===0)return;ge.moved=!0,p(Td(ge.startContours,ge.selection,Ue,et));return}const z=h.current;if(!z||f.pointerId!==z.pointerId){X(f.clientX,f.clientY,w.length>0||$);return}ue(),f.stopPropagation(),f.preventDefault();const R=ae(f.clientX,f.clientY);if(z.kind==="anchor"){const at={x:z.anchor.x+(R.x-z.origin.x),y:z.anchor.y+(R.y-z.origin.y)},Ue=q?[]:K$(g.current,{contour:z.contour,node:z.node}),et=q||!z.center?[]:[z.center],Je=Pd(Rd(Ue,et.map(We=>We.x),"x"),at,"x",T,Zr),Ye=Pd(Rd(Ue,et.map(We=>We.y),"y"),at,"y",T,Zr),xe=q?at:{x:(Je==null?void 0:Je.value)??Ur(at.x,o),y:(Ye==null?void 0:Ye.value)??Ur(at.y,o)};if(f.shiftKey&&(Math.abs(xe.x-z.anchor.x)>Math.abs(xe.y-z.anchor.y)?xe.y=z.anchor.y:xe.x=z.anchor.x),!z.moved&&xe.x===z.anchor.x&&xe.y===z.anchor.y)return;z.moved=!0,Y(eC(xe,Je,Ye,t,T)),p(V$(g.current,z.contour,z.node,xe));return}const Q=(Be=g.current[z.contour])==null?void 0:Be.nodes[z.node],ee=z.mirror&&!f.altKey,ce=ee||q?null:z.kind==="in"?Q==null?void 0:Q.out:Q==null?void 0:Q.in,V=Q?T(Q.p):null,Le=ce?T(ce):null,ve=Q&&(!q||f.shiftKey)?nC(R,Q.p,ee||q?null:tC(g.current[z.contour],z.node,z.kind,T),V&&Le?Math.hypot(Le.x-V.x,Le.y-V.y):null,f.shiftKey,T,_):{point:R,guides:yo},J=ve.guides.length?ve.point:q?R:{x:Ur(R.x,o),y:Ur(R.y,o)},_e=z.kind==="in"?Q==null?void 0:Q.in:Q==null?void 0:Q.out;!z.moved&&_e&&J.x===_e.x&&J.y===_e.y||(z.moved=!0,Y(ve.guides),p(X$(g.current,z.contour,z.node,z.kind,J,ee)))},te=f=>{Y(yo);const q=E.current;if(q&&f.pointerId===q.pointerId){E.current=null,f.stopPropagation();const ce=v.current;ce!=null&&ce.hasPointerCapture(q.pointerId)&&ce.releasePointerCapture(q.pointerId),q.moved&&k(g.current,{preserveShape:!0});return}const K=b.current;if(K&&f.pointerId===K.pointerId){b.current=null,f.stopPropagation();const ce=v.current;ce!=null&&ce.hasPointerCapture(K.pointerId)&&ce.releasePointerCapture(K.pointerId),K.moved?k(g.current,{preserveShape:!0}):j([]);return}const ne=y.current;if(ne&&f.pointerId===ne.pointerId){y.current=null,f.stopPropagation();const ce=v.current;ce!=null&&ce.hasPointerCapture(ne.pointerId)&&ce.releasePointerCapture(ne.pointerId),ne.moved&&k(g.current);return}const ge=h.current;if(!ge||f.pointerId!==ge.pointerId)return;h.current=null,f.stopPropagation();const z=v.current;z!=null&&z.hasPointerCapture(ge.pointerId)&&z.releasePointerCapture(ge.pointerId);const R=Math.hypot(f.clientX-ge.clientOrigin.x,f.clientY-ge.clientOrigin.y);if(ge.moved||R>sC){ge.moved&&k(g.current);return}if(!ge.toggleOnRelease||f.type!=="pointerup")return;const ee=Ld(g.current,ge.contour,ge.node);ee!==g.current&&(p(ee),k(ee))},we=f=>{f.stopPropagation()},ke=f=>{var q,K;f.stopPropagation(),f.preventDefault(),ue(),(q=v.current)==null||q.focus({preventScroll:!0}),b.current={pointerId:f.pointerId,origin:ae(f.clientX,f.clientY),startContours:zn(i),bbox:Si(i),moved:!1},(K=v.current)==null||K.setPointerCapture(f.pointerId)},fe=(f,q)=>{var R,Q;f.stopPropagation(),f.preventDefault(),ue(),(R=v.current)==null||R.focus({preventScroll:!0}),j([]),c("shape");const K=Si(i),ne=xa(K,wp(q)),ge=Ks(K,q),z=Math.hypot(ge.x-ne.x,ge.y-ne.y);!isFinite(z)||z<=0||(E.current={pointerId:f.pointerId,corner:q,origin:ne,startDistance:z,startContours:zn(i),moved:!1},(Q=v.current)==null||Q.setPointerCapture(f.pointerId))},me=(f,q,K,ne)=>{var R,Q,ee,ce;f.stopPropagation(),f.preventDefault(),ue(),(R=v.current)==null||R.focus({preventScroll:!0});const ge=(Q=i[K])==null?void 0:Q.nodes[ne];if(!ge)return;if(f.altKey){const V=q==="anchor"?Sp(i,K,ne):q$(i,K,ne,q);if(V===i)return;j(q==="anchor"?[]:[{contour:K,node:ne}]),p(V),k(V);return}const z=f.metaKey||f.ctrlKey;if(q==="anchor"&&f.shiftKey&&!z){j(V=>V.some(Le=>Le.contour===K&&Le.node===ne)?V.filter(Le=>!(Le.contour===K&&Le.node===ne)):[...V,{contour:K,node:ne}]);return}if(q==="anchor"&&!z&&w.length>1&&w.some(V=>V.contour===K&&V.node===ne)){y.current={pointerId:f.pointerId,origin:ae(f.clientX,f.clientY),startContours:zn(i),selection:w,moved:!1},(ee=v.current)==null||ee.setPointerCapture(f.pointerId);return}j([{contour:K,node:ne}]),h.current={kind:q,contour:K,node:ne,pointerId:f.pointerId,origin:ae(f.clientX,f.clientY),clientOrigin:{x:f.clientX,y:f.clientY},anchor:ge.p,center:z$(i),mirror:q!=="anchor"&&!!(ge.in&&ge.out),toggleOnRelease:z,moved:!1},(ce=v.current)==null||ce.setPointerCapture(f.pointerId)},Z=f=>{f.stopPropagation(),f.preventDefault(),ue();const q=ln(i,T),K=Id(q,ie(f.clientX,f.clientY));if(!K||K.distance>Js)return;const{contours:ne,nodeIndex:ge}=U$(i,K.contour,K.segment,K.t);ge<0||(j([{contour:K.contour,node:ge}]),p(ne),k(ne))},se=f=>{if(f.key==="="||f.key==="+"||f.key==="-"||f.key==="_"){f.preventDefault(),f.stopPropagation();const z=Si(i);if(!isFinite(z.minX)||!isFinite(z.maxX))return;const R={x:(z.minX+z.maxX)/2,y:(z.minY+z.maxY)/2},ee=f.key==="="||f.key==="+"?Ad:1/Ad,ce=$d(i,R,ee);p(ce),k(ce,{preserveShape:!0});return}if(f.key==="Escape"){f.stopPropagation(),j([]),c("none");return}if(!w.length)return;if(f.key==="Backspace"||f.key==="Delete"){f.preventDefault(),f.stopPropagation();const z=G$(i,w);if(z===i)return;j([]),p(z),k(z);return}const q=o>0?o:dC,K=f.shiftKey?q*10:q,ne={ArrowLeft:[-K,0],ArrowRight:[K,0],ArrowUp:[0,-K],ArrowDown:[0,K]}[f.key];if(!ne)return;f.preventDefault(),f.stopPropagation();const ge=Td(i,w,ne[0],ne[1]);p(ge),k(ge)},oe=s.useMemo(()=>Wo(ln(i,T)),[i,T]),Pe=s.useMemo(()=>Si(i),[i]),$e=T({x:Pe.minX,y:Pe.minY}),Me={width:T({x:Pe.maxX,y:Pe.minY}).x-$e.x,height:T({x:Pe.minX,y:Pe.maxY}).y-$e.y},ye=$&&w.length===0&&isFinite(Pe.minX)&&isFinite(Pe.maxX)&&Pe.maxX>Pe.minX&&Pe.maxY>Pe.minY,be=w.length>0||$,Ce=be;return a.jsxs("svg",{ref:v,className:`${e}-editor${be?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:se,onPointerDown:()=>{var f;return(f=v.current)==null?void 0:f.focus({preventScroll:!0})},onPointerMove:le,onPointerLeave:ue,onPointerUp:te,onPointerCancel:te,onLostPointerCapture:te,onContextMenu:f=>{f.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{j([]),c("none")},onClick:Z}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:oe}),Ce&&G.map((f,q)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${f.kind}`,x1:f.a.x,y1:f.a.y,x2:f.b.x,y2:f.b.y},`${f.kind}-${q}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:oe,fillRule:"evenodd",onPointerDown:ke,onClick:Z}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:oe,style:{strokeWidth:aC},onClick:Z}),Ce&&P&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:P.point.x-Hn/2,y:P.point.y-Hn/2,width:Hn,height:Hn,rx:P.curved?Hn/2:0}),Ce&&i.map((f,q)=>f.nodes.map((K,ne)=>{const ge=w.some(R=>R.contour===q&&R.node===ne),z=T(K.p);return a.jsxs("g",{children:[ge&&w.length===1&&["in","out"].map(R=>{const Q=K[R];if(!Q)return null;const ee=T(Q);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:z.x,y1:z.y,x2:ee.x,y2:ee.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ee.x,cy:ee.y,r:lC}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ee.x,cy:ee.y,r:lo,onPointerDown:ce=>me(ce,R,q,ne),onClick:we})]},R)}),a.jsx("rect",{className:`${e}-editor-anchor${ge?` ${e}-editor-anchor-selected`:""}`,x:z.x-Hn/2,y:z.y-Hn/2,width:Hn,height:Hn,rx:hp(K)?Hn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:z.x-lo,y:z.y-lo,width:lo*2,height:lo*2,onPointerDown:R=>me(R,"anchor",q,ne),onClick:we,onDoubleClick:R=>{R.stopPropagation(),R.preventDefault();const Q=Ld(i,q,ne);p(Q),k(Q)}})]},`${q}-${ne}`)})),ye&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:$e.x,y:$e.y,width:Me.width,height:Me.height}),["nw","ne","se","sw"].map(f=>{const q=T(Ks(Pe,f)),K=f==="ne"||f==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:q.x-Qr/2,y:q.y-Qr/2,width:Qr,height:Qr}),a.jsx("rect",{className:`${e}-editor-scale-grab${K?` ${e}-editor-scale-grab-nesw`:""}`,x:q.x-Jr/2,y:q.y-Jr/2,width:Jr,height:Jr,onPointerDown:ne=>fe(ne,f),onClick:we})]},f)})]})]})}const pC=4e3,mC=/^(?:https?:|mailto:|tel:)/i;function $p(e){return!!e&&typeof e=="object"&&e.type==="link"}function gC(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!mC.test(t)))return t}function hC(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if($p(c)){o(c.children??[],gC(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const x of p.split(/\s+/))x&&t.push({text:x,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Fd(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 fC(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if($p(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function yC(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 d=1/0,c=-1/0,u=1/0,p=-1/0;for(const m of l){const g=m.x*n,h=m.y*i;g<d&&(d=g),g>c&&(c=g),h<u&&(u=h),h>p&&(p=h)}const x=(d+c)/2,v=(u+p)/2;return l.map(m=>{const g=m.x*n,h=m.y*i,b=g-x,E=h-v,y=Math.sqrt(b*b+E*E);if(y<1e-6)return m;const j=Math.max(0,y+r*t)/y;return{x:(x+b*j)/n,y:(v+E*j)/i}})})}const bs=2,Ss=2;function vC(e,t,n,i,o){if(e.kind!=="whole")return null;const r=t[e.originalIndex],l=e.token.text;if(!r||l.length<bs+Ss)return null;const d=Math.min(r.length-Ss,l.length-Ss);let c=-1;for(let u=d;u>=bs;u-=1)if(r[u-1]*i+o*i<=n){c=u;break}return c<bs?null:{fragmentText:`${l.slice(0,c)}-`,remainderText:l.slice(c),fragmentWidth:r[c-1]+o,remainderWidth:Math.max(0,e.width-r[c-1])}}function Nd(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:x}=e,v=!!e.hyphenate,m=e.charWidths??[],g=e.hyphenWidth??0,h=e.lineHeight*l,b=e.spaceWidth*l,E=Math.max(0,e.shapeMargin??0),y=[],w=t.map((L,D)=>({token:L,originalIndex:D,width:n[D],kind:"whole"}));if(!w.length||d<=0||h<=0)return{segments:y,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const j=Math.max(1,b*.5),G=h*b$,A=yC(i,E,d,c,o);let P=0,W=0,Y=0,$=w[0].token.para,I=0,H=0,O=null;for(;P<w.length&&Y<pC;){const L=W+h>c;if(L&&!u)break;const D=w[P].token.para;if(D>$+1){W+=h*(D-$-1),$=D-1,Y+=1;continue}let S=L?[{x0:0,x1:d}]:R$(A,(W+G)/c,(W+h-G)/c,o).map(T=>({x0:T.x0*d,x1:T.x1*d}));p>0&&x>0&&!L&&S.length&&(O===null&&(O=Y,I=S[0].x0,H=W),Y-O<x&&(S=I$(S,{x0:I,x1:I+p})));const U=S.reduce((T,_)=>Math.max(T,_.x1-_.x0),0);for(const T of S){const _=T.x1-T.x0;if(_<j)continue;if(P>=w.length||w[P].token.para!==D)break;const B=P;let ae=0;for(;P<w.length&&w[P].token.para===D;){const ie=w[P],k=P===B,ue=ie.width*l,X=k?ue:b+ue;if(ae+X<=_){ae+=X,P+=1;continue}if(k&&_>=U-.5&&ue>d-.5){ae+=X,P+=1;continue}if(v){const te=_-ae-(k?0:b),we=vC(ie,m,te,l,g);if(we){const ke={token:{...ie.token,text:we.fragmentText},originalIndex:ie.originalIndex,width:we.fragmentWidth,kind:"fragment"},fe={token:{...ie.token,text:we.remainderText},originalIndex:ie.originalIndex,width:we.remainderWidth,kind:"remainder"};w.splice(P,1,ke,fe),ae+=(k?0:b)+we.fragmentWidth*l,P+=1}}break}if(P>B){const ie=P>=w.length||w[P].token.para!==D;y.push({top:W,left:T.x0,width:_,from:B,to:P,justify:r==="justify"&&!ie})}if(P>=w.length||w[P].token.para!==D)break}$=D,W+=h,Y+=1}let C=0;if(P>0){const L=w[P-1];C=L.kind==="fragment"?L.originalIndex:L.originalIndex+1}return{segments:y,placed:C,height:y.length?W:0,capLeft:I,capTop:H,renderTokens:w.map(L=>L.token)}}const xC=.12,bC=2,SC=10,ws=.25,wC=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},$C=(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,CC=(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 d=wC(e);(!r||!$C(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},$s=(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})))},Qo=typeof window>"u"?s.useEffect:s.useLayoutEffect;function TC(){return typeof document>"u"?null:document.body}function LC({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:x,padding:v,hyphenate:m,showOverflowIndicator:g,dropCapLines:h,dropCapSize:b,showGuides:E,typography:y,imageUrl:w,imageFocalX:j,imageFocalY:G,imageScale:A,imageCustomPath:P,pathDragActive:W,pathCarryImage:Y,onCarryImageConsumed:$,pathEditor:I,imageEditor:H}){var qe,nt;const O=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[C,L]=s.useState(null),D=s.useRef(null),[S,U]=s.useState({width:0,height:0}),[T,_]=s.useState(0),[B,ae]=s.useState(null),[ie,k]=s.useState(0),[ue,X]=s.useState("none");s.useEffect(()=>{!I&&!H&&X("none")},[I,H]);const[le,te]=s.useState(null);s.useEffect(()=>{if(!w||typeof Image>"u"){te(null);return}let de=!1;const Ie=new Image;return Ie.onload=()=>{de||te({width:Ie.naturalWidth,height:Ie.naturalHeight})},Ie.src=w,()=>{de=!0}},[w]);const we=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),ke=s.useMemo(()=>hC(we),[we]),fe=s.useMemo(()=>fC(we),[we]),me=h>0&&b>1?((nt=(qe=ke[0])==null?void 0:qe.text)==null?void 0:nt.charAt(0))??"":"",Z=(I==null?void 0:I.contours)??null,se=s.useMemo(()=>{let de=[];if(Z){const Ie=xr(Z);Ie.length&&(de=$o(Ie,r))}if(!de.length){const Ie=i.trim(),it=Ie?xd(Ie,o,r):null;it&&it.length?de=it:de=js(n==="custom"?"rectangle":n)}return n==="circle"?$s(de,S):de},[Z,n,i,o,r,S.width,S.height]),oe=I==null?void 0:I.onConvert,Pe=(I==null?void 0:I.needsConversion)??!1,$e=s.useMemo(()=>{if(n==="circle")return!1;const de=Z??(i.trim()?Li(i):null);return!!(de&&xp(de,r))},[Z,i,r,n]),[Me,ye]=s.useState(null);Qo(()=>{if(!$e){Me&&ye(null);return}!Me&&S.width>0&&S.height>0&&ye({width:S.width,height:S.height})},[$e,S.width,S.height,Me]);const be=s.useMemo(()=>{if(!$e||S.width<=0||S.height<=0)return se;const de=Me??S,Ie=r.width/de.width,it=r.height/de.height;return se.map(ut=>ut.map(je=>({x:je.x*Ie,y:je.y*it})))},[se,$e,Me,r.width,r.height,S.width,S.height]),Ce=s.useMemo(()=>{if(Z){const ut=xr(Z);if(ut.length){const je=$o(ut,r);return n==="circle"?$s(je,S):je}}const de=P.trim(),Ie=de?xd(de,o,r):null,it=Ie&&Ie.length?Ie:js(n==="custom"?"rectangle":n);return n==="circle"?$s(it,S):it},[Z,n,P,o,r,S.width,S.height]),f=s.useMemo(()=>{if(!$e||S.width<=0||S.height<=0)return Ce;const de=Me??S,Ie=r.width/de.width,it=r.height/de.height;return Ce.map(ut=>ut.map(je=>({x:je.x*Ie,y:je.y*it})))},[Ce,$e,Me,r.width,r.height,S.width,S.height]),q=s.useRef(null),K=s.useRef(!1);s.useEffect(()=>{if(!(!oe||S.width<=0||S.height<=0)){if($e){if(q.current===i)return;const de=Z??(i.trim()?Li(i):null);if(!(de!=null&&de.length))return;const Ie=ln(de,it=>({x:r.x+(it.x-r.x)/S.width*r.width,y:r.y+(it.y-r.y)/S.height*r.height}));q.current=Wo(Ie),oe(Ie);return}!Pe||!se.length||K.current||(K.current=!0,oe(ln(vp(se),de=>({x:de.x*va,y:de.y*va}))))}},[Pe,$e,oe,se,Z,i,r,S.width,S.height]);const ne=s.useCallback(()=>{const de=C;if(!de)return;const Ie=de.getBoundingClientRect(),it=parseFloat(window.getComputedStyle(de).paddingTop)||0;_(je=>Math.abs(je-it)<.5?je:it);const ut={width:Ie.width,height:Ie.height};U(je=>Math.abs(je.width-ut.width)<.5&&Math.abs(je.height-ut.height)<.5?je:ut)},[C]);Qo(()=>{const de=C;if(!de||typeof ResizeObserver>"u")return;ne();const Ie=new ResizeObserver(ne);return Ie.observe(de),()=>Ie.disconnect()},[C,ne]),Qo(()=>{ne()},[v,ne]),s.useEffect(()=>{const de=typeof document<"u"?document.fonts:void 0;de!=null&&de.ready&&de.ready.then(()=>{k(Ie=>Ie+1)})},[]),Qo(()=>{const de=D.current;if(!de)return;if(!ke.length){ae(null);return}const Ie=[],it=document.createDocumentFragment();for(const bt of ke){const F=document.createElement("span");Object.assign(F.style,Fd(bt.leaf)),F.textContent=bt.text,it.appendChild(F),Ie.push(F)}const ut=document.createElement("span");ut.textContent=" ",it.appendChild(ut);const je=document.createElement("span");je.textContent="-",it.appendChild(je);const pt=me||"H",Tt=document.createElement("span");Tt.textContent=pt,Tt.style.lineHeight="1",it.appendChild(Tt),de.replaceChildren(it);const Lt=window.getComputedStyle(de),xt=parseFloat(Lt.fontSize)||16,Et=parseFloat(Lt.lineHeight),Vt=Number.isNaN(Et)?xt*1.2:Et,Ut=Math.max(Vt,xt),Kt=document.createElement("span");Kt.textContent=pt,Kt.style.lineHeight=`${Ut}px`;const Pt=document.createElement("span");Pt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Kt.appendChild(Pt),de.appendChild(Kt);const jt=Kt.getBoundingClientRect().top,on=Pt.getBoundingClientRect().top,vt=Math.max(1,on-jt);Kt.remove();let Re=vt*.8;const lt=document.createElement("canvas").getContext("2d"),ct=bt=>`${Lt.fontStyle} ${Lt.fontWeight} ${bt}px ${Lt.fontFamily}`;if(lt){lt.font=ct(xt);const bt=lt.measureText(pt).actualBoundingBoxAscent;bt>0&&(Re=bt)}const wt=b>1?(b-1)*Ut+Re:Re;let It=xt*(wt/Re);if(lt){lt.font=ct(It);const bt=lt.measureText(pt).actualBoundingBoxAscent;bt>0&&(It=It*(wt/bt))}Tt.style.fontSize=`${It}px`,Tt.style.lineHeight=`${It}px`;const ht=document.createElement("span");ht.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Tt.appendChild(ht);const Ot=Math.max(1,ht.getBoundingClientRect().top-Tt.getBoundingClientRect().top);ht.remove();const Mt=(b-1)*Ut+vt-Ot,Gt=Ie.map(bt=>bt.getBoundingClientRect().width),Xt=ut.getBoundingClientRect().width,Dt=je.getBoundingClientRect().width,zt=me?Tt.getBoundingClientRect().width:0,Bt=m?Ie.map(bt=>{const F=bt.firstChild;if(!(F instanceof Text)||F.data.length<4)return;const Te=document.createRange(),Ae=bt.getBoundingClientRect().left,ze=[];for(let gt=1;gt<=F.data.length;gt+=1)Te.setStart(F,0),Te.setEnd(F,gt),ze.push(Te.getBoundingClientRect().right-Ae);return ze}):[];de.replaceChildren(),ae({widths:Gt,spaceWidth:Xt,dashWidth:Dt,charWidths:Bt,lineHeight:Ut,capWidth:zt,dropCapFontSize:It,dropCapTopAdjust:Mt})},[ke,y,me,h,b,ie,S.width,m]);const ge=B&&me?B.capWidth+B.lineHeight*xC:0,z=Math.max(h,Math.ceil(b)),R=s.useMemo(()=>{if(!B||!ke.length||S.width<=0||S.height<=0||!u)return 1;const de=ut=>Nd({tokens:ke,widths:B.widths,spaceWidth:B.spaceWidth,lineHeight:B.lineHeight,width:S.width,height:S.height,rings:be,mode:l,align:d,scale:ut,allowOverflow:!1,capInset:ge*ut,capLines:me?z:0,hyphenate:m,charWidths:B.charWidths,hyphenWidth:B.dashWidth,shapeMargin:T});if(de(1).placed>=ke.length)return 1;if(de(ws).placed<ke.length)return ws;let Ie=ws,it=1;for(let ut=0;ut<SC;ut+=1){const je=(Ie+it)/2;de(je).placed>=ke.length?Ie=je:it=je}return Ie},[B,ke,S.width,S.height,be,l,d,u,ge,me,z,m,T]);s.useEffect(()=>{x(R)},[R,x]);const Q=u?Math.min(p,R):1,ee=s.useMemo(()=>!B||!ke.length||S.width<=0||S.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:ke}:Nd({tokens:ke,widths:B.widths,spaceWidth:B.spaceWidth,lineHeight:B.lineHeight,width:S.width,height:S.height,rings:be,mode:l,align:d,scale:Q,allowOverflow:c,capInset:ge*Q,capLines:me?z:0,hyphenate:m,charWidths:B.charWidths,hyphenWidth:B.dashWidth,shapeMargin:T}),[B,ke,S.width,S.height,be,l,d,Q,c,ge,me,z,m,T]),ce=g&&ke.length>0&&ee.placed<ke.length,V=B?B.dropCapFontSize*Q:0,Le=B?B.dropCapTopAdjust*Q:0,ve=d==="justify"?"left":d,J=B?B.lineHeight*Q:0,_e=ee.segments.length?ee.segments[ee.segments.length-1]:null,Be=_e?{top:_e.top+J,left:_e.left+_e.width/2}:{top:S.height,left:S.width/2},at=!!(I&&Z&&S.width>0&&S.height>0),Ue=!!H,et=(at||Ue)&&S.width>0&&S.height>0,Je=CC(C,et),Ye=et&&Je?TC():null,xe=s.useRef(!1),We=s.useCallback(de=>{xe.current=de},[]);s.useEffect(()=>{if(!at&&!Ue)return;const de=Ie=>{const it=C;if(!it)return;const ut=it.getBoundingClientRect();Ie.clientX>=ut.left&&Ie.clientX<=ut.right&&Ie.clientY>=ut.top&&Ie.clientY<=ut.bottom&&(Ie.preventDefault(),Ie.stopPropagation(),X(pt=>pt==="shape"&&xe.current?pt:pt==="shape"&&Ue?"image":at?"shape":"image"))};return document.addEventListener("dblclick",de,!0),()=>document.removeEventListener("dblclick",de,!0)},[at,Ue,C]);const He=s.useMemo(()=>w&&S.width>0&&S.height>0?S$(f,S):null,[w,f,S.width,S.height]),Qe=s.useRef(null),he=(()=>{const de=Qe.current;return Y||!H||!le||!He||!de||P===de.customPath||de.shape!==n&&n!=="custom"?null:oC(de.bounds,He,le,de.focalX,de.focalY,de.scale)})();Qo(()=>{if(W||!H||!le||!He)return;const de=Qe.current,Ie=!!(de&&P!==de.customPath);Ie&&he&&H.onCommit(he),Ie&&Y&&($==null||$()),Qe.current={rings:f,bounds:He,focalX:(he==null?void 0:he.focalX)??j,focalY:(he==null?void 0:he.focalY)??G,scale:(he==null?void 0:he.scale)??A,customPath:P,shape:n}},[W,Y,P,n,f,He,H,le,j,G,A,he,$]);const Ne=Qe.current,Ve=!!(W&&!Y&&Ne&&!he),tt=Ve&&Ne?Ne.focalX:(he==null?void 0:he.focalX)??j,mt=Ve&&Ne?Ne.focalY:(he==null?void 0:he.focalY)??G,st=Ve&&Ne?Ne.scale:(he==null?void 0:he.scale)??A,De=Ve&&Ne?Ne.bounds:He,Fe=s.useMemo(()=>{if(!(S.width>0)||!(S.height>0))return"";let de=Sd(i,Z,o,r,n,S);if($e){const Ie=Me??S,it=r.width/Ie.width,ut=r.height/Ie.height;de=ln(de,je=>({x:je.x*it,y:je.y*ut}))}return wd(de,S)||vd(be,S)},[i,Z,o,r,n,S.width,S.height,$e,Me,be]),Xe=s.useMemo(()=>{if(!w||!(S.width>0)||!(S.height>0))return"";let de=Sd(P,Z,o,r,n,S);if($e){const Ie=Me??S,it=r.width/Ie.width,ut=r.height/Ie.height;de=ln(de,je=>({x:je.x*it,y:je.y*ut}))}return wd(de,S)||vd(f,S)},[w,P,Z,o,r,n,S.width,S.height,$e,Me,f]),ot=`${O}-clip`,Oe=s.useMemo(()=>{if(!De)return null;const de=le??{width:De.width,height:De.height},Ie=Gi(De,de,st);return{x:Dn(De.width,Ie.width,tt),y:Dn(De.height,Ie.height,mt),width:Ie.width,height:Ie.height}},[De,le,tt,mt,st]);return a.jsxs("div",{className:`${e}-column`,style:{padding:v},ref:L,children:[Fe?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:S.width,height:S.height},viewBox:`0 0 ${S.width} ${S.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Fe,fillRule:"evenodd"}),w&&Xe&&De&&Oe?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:ot,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Xe,fillRule:"evenodd"})})}),a.jsx("image",{href:w,x:De.x+Oe.x,y:De.y+Oe.y,width:Oe.width,height:Oe.height,preserveAspectRatio:"none",clipPath:`url(#${ot})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...y,["--"+e+"-fit"]:Q,top:0,left:0,width:S.width,height:S.height},children:[a.jsx("div",{className:`${e}-measure`,ref:D,style:y,"aria-hidden":!0}),ee.segments.map((de,Ie)=>{const it=ee.renderTokens.slice(de.from,de.to),ut=Ie===0;return a.jsx("div",{className:`${e}-line${de.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${de.top}px`,left:`${de.left}px`,width:`${de.width}px`,textAlign:de.justify?void 0:ve},children:it.map((je,pt)=>{const Lt=me&&ut&&de.from===0&&pt===0?je.text.slice(1):je.text,xt=Fd(je.leaf),Et=je.href?a.jsx("a",{className:`${e}-link`,href:je.href,target:je.target,rel:je.target?"noopener noreferrer":void 0,style:xt,children:Lt}):a.jsx("span",{style:xt,children:Lt});return a.jsxs("span",{children:[!de.justify&&pt>0?" ":null,Et]},pt)})},`${de.from}-${de.to}-${Ie}`)}),E&&!Z&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:be.map((de,Ie)=>a.jsx("polygon",{points:de.map(it=>`${it.x},${it.y}`).join(" ")},Ie))})]}),me&&B&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...y,top:`${ee.capTop+Le}px`,left:`${ee.capLeft}px`,fontSize:`${V}px`,lineHeight:`${V}px`},children:me}),Ye&&Je&&(Z&&I||H)&&si.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:Je.top,left:Je.left,width:Je.width,height:Je.height,zIndex:bC,pointerEvents:"none"},children:[Z&&I&&a.jsx(uC,{P:e,box:{width:Je.width,height:Je.height},viewBox:r,contours:Z,snap:I.snap,stretchToBox:!$e,uniformStretch:n==="circle",stage:ue,onStageChange:X,onSelectionChange:We,onChange:I.onChange,onCommit:I.onCommit}),H&&De&&a.jsx(rC,{P:e,box:{width:Je.width,height:Je.height},bounds:De,natural:le,imageUrl:w,maskPath:Xe,stage:ue,onStageChange:X,focalX:tt,focalY:mt,scale:st,onChange:H.onChange,onCommit:H.onCommit})]}),Ye),a.jsx("div",{className:`${e}-a11y`,children:fe.map((de,Ie)=>a.jsx("p",{children:de},Ie))}),ce&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:Be.top,left:Be.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 Cp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],IC={x:0,y:0,width:100,height:100},RC=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?IC:{x:t[0],y:t[1],width:t[2],height:t[3]}},PC=e=>`
|
|
26576
26580
|
.${e}-wrapper {
|
|
26577
26581
|
box-sizing: border-box;
|
|
26578
26582
|
display: flex;
|
|
@@ -26801,7 +26805,7 @@ export function Burger({
|
|
|
26801
26805
|
clip-path: inset(50%);
|
|
26802
26806
|
white-space: nowrap;
|
|
26803
26807
|
}
|
|
26804
|
-
`,kC=1;function EC({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=
|
|
26808
|
+
`,kC=1;function EC({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=N.useScopedStyles(),c=s.useMemo(()=>PC(d),[d]),u=n??!1,p=!!r||!!o,x=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),v=(e==null?void 0:e.shape)??"custom",m=(e==null?void 0:e.customPath)??"",g=(e==null?void 0:e.pathFit)??"stretch",h=s.useMemo(()=>RC(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),b=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",E=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",w=((e==null?void 0:e.fitText)??"off")==="on",j=((e==null?void 0:e.hyphenate)??"off")==="on",G=N.scalingValue((e==null?void 0:e.padding)??0,u),A=(e==null?void 0:e.dropCapSize)??kC,P=Math.max(1,Math.round((e==null?void 0:e.dropCapLines)??A)),W=u&&p&&!i,Y=u&&!i,[$,I]=s.useState(!1);s.useEffect(()=>{if(!u||!p){I(!1);return}const z=()=>I(!0),R=()=>I(!1),Q=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],ee=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const ce of Q)window.addEventListener(ce,z);for(const ce of ee)window.addEventListener(ce,R);return()=>{for(const ce of Q)window.removeEventListener(ce,z);for(const ce of ee)window.removeEventListener(ce,R)}},[u,p]);const H=u&&p&&!i&&typeof l=="function",O=!$,C=Math.max(0,(e==null?void 0:e.pathSnap)??0),L=s.useRef(e??{}),D=s.useRef(""),S=[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(S!==D.current)D.current=S,L.current=e??{};else if(e){const{customPath:z,shape:R,pathFit:Q,pathViewBox:ee,imageScale:ce,imageFocalX:V,imageFocalY:Le,image:ve,...J}=e,_e=L.current;for(const Be of Object.keys(J))if(_e[Be]!==J[Be]){L.current={..._e,...J};break}}const[U,T]=s.useState(null),[_,B]=s.useState(!1),[ae,ie]=s.useState(!1),k=s.useCallback(()=>ie(!1),[]),ue=L.current.shape??v,X=s.useMemo(()=>!U||U.serialized===m?m:U.serialized,[U,m]);s.useEffect(()=>{H||(B(!1),ie(!1))},[H]),s.useEffect(()=>{!U||_||U.serialized===m&&T(null)},[U,m,_]);const le=s.useMemo(()=>{if(!H)return null;if(U&&(U.base===m||U.serialized===m))return U.contours;const z=Li(m);return z.length?z:null},[H,U,m]),te=!!(g==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===zs&&le&&(v==="circle"||!xp(le,h))),we=s.useCallback((z,R,Q)=>{const ee=Wo(z);if(T(ce=>({base:ce&&(ce.base===m||ce.serialized===m)?ce.base:m,serialized:ee,contours:z})),R){const ce=L.current,V=Q!=null&&Q.preserveShape?ce.shape:"custom",Le={...ce,shape:V,customPath:ee};L.current=Le,l==null||l(Le)}},[m,l]),ke=s.useMemo(()=>H?{contours:te?le:null,snap:C,needsConversion:!te,onConvert:z=>{const R=Wo(z);T({base:R,serialized:R,contours:z});const Q={...L.current,pathFit:"viewbox",pathViewBox:zs,customPath:R};L.current=Q,l==null||l(Q)},onChange:(z,R)=>{B(!0),ie(!!(R!=null&&R.carryImage)),we(z,!1)},onCommit:(z,R)=>{we(z,!0,R),B(!1)}}:null,[H,te,le,C,l,we]),fe=b==="avoid"&&!!(e!=null&&e.image),me=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]),[Z,se]=s.useState(null),oe=Z??me,Pe=s.useCallback(z=>se(z),[]),$e=s.useCallback(z=>{se(z);const R={...L.current,imageFocalX:z.focalX,imageFocalY:z.focalY,imageScale:z.scale};L.current=R,l==null||l(R)},[l]);s.useEffect(()=>{Z&&Math.abs(Z.focalX-me.focalX)<1e-9&&Math.abs(Z.focalY-me.focalY)<1e-9&&Math.abs(Z.scale-me.scale)<1e-9&&se(null)},[Z,me]);const Me=s.useMemo(()=>!H||!fe?null:{onChange:Pe,onCommit:$e},[H,fe,Pe,$e]),[ye,be]=s.useState(void 0),Ce=s.useRef(void 0),f=s.useCallback(z=>{const R=Ce.current;R!==void 0&&Math.abs(R-z)<.005||(Ce.current=z,be(z))},[]),q=s.useMemo(()=>w&&typeof ye=="number"?ye:1,[ye,w]),K=z=>`calc(${z} * var(--${d}-fit, 1))`,ne=s.useMemo(()=>{var Q,ee,ce,V,Le;const z=(e==null?void 0:e.textFontSize)??.012,R=Math.max((e==null?void 0:e.textLineHeight)??z,z);return{fontFamily:zo(e==null?void 0:e.textFontFamily),fontWeight:(Q=e==null?void 0:e.textFontSettings)==null?void 0:Q.fontWeight,fontStyle:(ee=e==null?void 0:e.textFontSettings)==null?void 0:ee.fontStyle,fontSize:K(N.scalingValue(z,u)),lineHeight:K(N.scalingValue(R,u)),letterSpacing:K(N.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:K(N.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(ce=e==null?void 0:e.textTextAppearance)==null?void 0:ce.textTransform,textDecoration:(V=e==null?void 0:e.textTextAppearance)==null?void 0:V.textDecoration,fontVariant:(Le=e==null?void 0:e.textTextAppearance)==null?void 0:Le.fontVariant}},[e,u,d]),ge={[`--${d}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${d}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${d}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{className:`${d}-wrapper`,style:{...ge},children:a.jsx(LC,{P:d,item:x,shape:ue,customPath:m,pathFit:g,viewBox:h,mode:b,align:E,allowOverflow:y,fitEnabled:w,scale:q,onFitScale:f,padding:G,hyphenate:j,showOverflowIndicator:Y,dropCapLines:P,dropCapSize:A,showGuides:(W||H)&&O,typography:ne,imageUrl:b==="avoid"?e==null?void 0:e.image:null,imageFocalX:oe.focalX,imageFocalY:oe.focalY,imageScale:oe.scale,imageCustomPath:X,pathDragActive:_,pathCarryImage:ae,onCarryImageConsumed:k,pathEditor:O?ke:null,imageEditor:O?Me:null})})]})}const MC=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
26805
26809
|
import type React from 'react';
|
|
26806
26810
|
import { CommonComponentProps } from '../props';
|
|
26807
26811
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -27628,4 +27632,4 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
27628
27632
|
</>
|
|
27629
27633
|
);
|
|
27630
27634
|
}
|
|
27631
|
-
`,_d=[...Cp],AC={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},FC={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",display:{type:"shape-select",isFilled:!0,enum:_d},enum:_d},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 with a hyphen when they don’t fit on a line.",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"}},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:{...AC.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:{...bp("circle"),pathSnap:0,shapeMode:"A",fitText:"off",hyphenate:"off",dropCapLines:1,dropCapSize:1,image:"https://cdn.cntrl.site/component-assets/shapedType_img.jpg",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},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0,padding:0},d:{textFontSize:.032,textLineHeight:.0155,textLetterSpacing:-.001,textWordSpacing:0,padding:0}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","fitText","hyphenate","padding","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"]}]},{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."}]}]}]}},NC={element:EC,id:"pretext",name:"Shaped Type",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||Cp.indexOf(n)===-1||(t==null?void 0:t.shape)===n?e:{...e,...bp(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:FC,sourceCode:MC,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},_C=[Dg,qg,Dx,Oh,Uh,rf,Cf,qf,ey,sy,My,Tv,P0,H0,bx,Ex,Jx,Ub,cb,uS,BS,Lw,x$,NC];exports.getAvailableStatePanels=
|
|
27635
|
+
`,_d=[...Cp],AC={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},FC={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",display:{type:"shape-select",isFilled:!0,enum:_d},enum:_d},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 with a hyphen when they don’t fit on a line.",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"}},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:{...AC.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:{...bp("circle"),pathSnap:0,shapeMode:"A",fitText:"off",hyphenate:"off",dropCapLines:1,dropCapSize:1,image:"https://cdn.cntrl.site/component-assets/shapedType_img.jpg",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},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0,padding:0},d:{textFontSize:.032,textLineHeight:.0155,textLetterSpacing:-.001,textWordSpacing:0,padding:0}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","fitText","hyphenate","padding","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"]}]},{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."}]}]}]}},NC={element:EC,id:"pretext",name:"Shaped Type",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||Cp.indexOf(n)===-1||(t==null?void 0:t.shape)===n?e:{...e,...bp(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:FC,sourceCode:MC,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},_C=[Dg,qg,Dx,Oh,Uh,rf,Cf,qf,ey,sy,My,Tv,P0,H0,bx,Ex,Jx,Ub,cb,uS,BS,Lw,x$,NC];exports.getAvailableStatePanels=N.getAvailableStatePanels;exports.getUnavailableStates=N.getUnavailableStates;exports.isPanelAvailable=N.isPanelAvailable;exports.components=_C;exports.isSchemaV1=Ep;
|