@cntrl-site/components 1.0.107-alpha.4 → 1.0.107

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.
@@ -1,661 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),s=require("react"),T=require("./scalingValue-CSHYgTZl.js"),Ln=require("./buildColorVars-CE2D5cQV.js"),Cn=require("./useScopedStyles-Bf6yohVQ.js"),wn=require("./useLightboxScrollLock-Hf16Eq4g.js"),rt=require("./textStylesToCss-CNN3zZTV.js"),Ao=require("./loadSvgMaskUrl-DfF7ay6h.js"),y=300,h=300,Tn=8/1440,W=.004,Nn=50,An=1440,F=Nn/An;function zn(o){if(o==="default"||o==="compact"||o==="open")return o;if(o==="onScroll")return"compact"}function Bn(o){return o==="center"||o==="right"?o:"left"}function Rn(o){return o==="left"||o==="right"?o:"center"}function On(o,t,n){const e=T.scalingValue(t,n);return o==="center"?`translateX(calc(-50% + ${e}))`:`translateX(${e})`}function Hn(o,t){if(o&&typeof o=="object"){if(t&&typeof o[t]=="string")return o[t];for(const n in o)if(typeof o[n]=="string")return o[n];return}return o}function xt(o,t){const n=(Hn(o,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 Fn(o,t,n){switch(xt(o.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 In(o,t){switch(xt(o.showIn,t)){case"default and compact":return!1;default:return!0}}function jn(o){return(o==null?void 0:o.find(t=>t.slug===""))??(o==null?void 0:o[0])}function Mn(o,t){const n=o?t==null?void 0:t.find(e=>e.id===o):jn(t);return!o&&!n?"":n?n.slug===""?"/":`/${n.slug}`:o.startsWith("/")||o.startsWith("#")||/^[a-z][a-z\d+\-.]*:/i.test(o)?o:t?`/${o}`:o}function it(o){const t=(o??"").toLowerCase();return t==="blank"||t==="_blank"||t.includes("new")}function kt(o){const t=o.link;if(t&&typeof t=="object"){const e=it(t.target)?"_blank":void 0;if(t.type==="url")return{type:"url",value:t.value??t.url??"",target:e};if(t.type==="anchor")return{type:"anchor",value:t.value??"",target:e};if(t.type==="page")return{type:"page",value:t.value??"",target:e,anchor:t.anchor};if(typeof t.url=="string")return{type:"url",value:t.url,target:e}}const n=it(o.openIn)?"_blank":void 0;return o.mode==="url"?{type:"url",value:o.url??"",target:n}:{type:"page",value:o.page??"",target:n,anchor:o.anchor}}function Bo(o,t){const n=o.label||"Link",e=kt(o);if(e.type==="url")return{label:n,href:e.value,target:e.target};if(e.type==="anchor"){const p=e.value.replace(/^#/,"");return{label:n,href:p?`#${p}`:"",target:e.target}}const r=Mn(e.value,t),c=(e.anchor??"").replace(/^#/,""),f=c?r?`${r}#${c}`:`#${c}`:r;return{label:n,href:f,target:e.target}}const O=24,R=O*.125,St=O*.125,zo=(O-(3*R+2*St))/2,ct=R+St;function _n({className:o,lineClassName:t}){return l.jsxs("svg",{className:o,viewBox:`0 0 ${O} ${O}`,"aria-hidden":"true",children:[l.jsx("rect",{className:`${t} ${t}-top`,x:"0",y:zo,width:O,height:R,rx:R/2}),l.jsx("rect",{className:`${t} ${t}-mid`,x:"0",y:zo+ct,width:O,height:R,rx:R/2}),l.jsx("rect",{className:`${t} ${t}-bot`,x:"0",y:zo+2*ct,width:O,height:R,rx:R/2})]})}function Wn(o,t,n,e){return t!==void 0&&t<(o??.01)?`${n} ${e}`:n}function En(o,t,n,e){const r=o??.01;return t===void 0||t>=r?{}:{[`--${n}-text-leading-gap`]:T.scalingValue((r-t)/2,e)}}const bt=.004;let oo;function Vn(){return oo!==void 0?oo:typeof document>"u"?(oo=null,null):(oo=document.createElement("canvas").getContext("2d"),oo)}function Gn(o){const t=getComputedStyle(o),n=parseFloat(t.fontSize)||0;if(n<=0)return 0;const e=Vn();if(!e)return 0;e.font=`${t.fontStyle} ${t.fontWeight} ${n}px ${t.fontFamily}`;const r=e.measureText("H"),c=r.actualBoundingBoxAscent>0?r.actualBoundingBoxAscent:0,f=Math.max(0,r.actualBoundingBoxDescent||0),p=r.fontBoundingBoxAscent||0,g=r.fontBoundingBoxDescent||0;return c<=0||p<=0&&g<=0?0:(g-f-(p-c))/2/n}function lt(o,t){const[n,e]=s.useState(0);return s.useLayoutEffect(()=>{const r=o.current;if(!r)return;const c=()=>{const g=Gn(r);e(m=>Math.abs(m-g)<bt?m:g)};c();const f=document.fonts;f.ready.then(c).catch(()=>{}),f.addEventListener("loadingdone",c);const p=new ResizeObserver(c);return p.observe(r),()=>{f.removeEventListener("loadingdone",c),p.disconnect()}},[o,t]),n}function st(o){if(!(Math.abs(o)<bt))return`translateY(${o}em)`}function dt(o){var t,n;return[o.fontFamily??"",((t=o.fontSettings)==null?void 0:t.fontWeight)??400,((n=o.fontSettings)==null?void 0:n.fontStyle)??"normal",o.fontSize??"",o.lineHeight??""].join("\0")}function gt(o){return{fontFamily:o.fontFamily,fontWeight:o.fontWeight,fontStyle:o.fontStyle,fontSize:o.fontSize,lineHeight:o.lineHeight,position:"absolute",top:0,left:0,visibility:"hidden",pointerEvents:"none",whiteSpace:"nowrap"}}function ft(o,t={}){return{fontFamily:o.fontFamily??t.fontFamily,fontSettings:o.fontSettings??t.fontSettings,fontSize:o.fontSize??t.fontSize,lineHeight:o.lineHeight??t.lineHeight,letterSpacing:o.letterSpacing??t.letterSpacing??0,wordSpacing:o.wordSpacing??t.wordSpacing??0,textAlign:o.textAlign??t.textAlign??"left",textAppearance:o.textAppearance??t.textAppearance}}function vt(o,t,n){var r,c;const e={fontSettings:{fontFamily:t.fontFamily,fontWeight:((r=t.fontSettings)==null?void 0:r.fontWeight)??400,fontStyle:((c=t.fontSettings)==null?void 0:c.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:{...rt.omitTextColors(rt.textStylesToCss(e,n)),...En(t.fontSize,t.lineHeight,o,n)},className:Wn(t.fontSize,t.lineHeight,`${o}-link-text`,`${o}-text-tight-leading`)}}function pt(o){const t=o.split(/\r?\n/);return t.length===1?o:t.map((n,e)=>l.jsxs(s.Fragment,{children:[n,e<t.length-1?l.jsx("br",{}):null]},e))}function ht(o,t,n,e){const r=Math.max(0,n-e),c=o+t;if(c<=r||c<=0)return{start:o,end:t};const f=r/c;return{start:o*f,end:t*f}}function yt(o){const n=Math.max(F,o.fontSize??F),{start:e,end:r}=ht(o.textPaddingTop,o.textPaddingBottom,1,n),{start:c,end:f}=ht(o.textPaddingLeft,o.textPaddingRight,1,F);return{effectivePaddingLeft:c,effectivePaddingRight:f,effectivePaddingTop:e,effectivePaddingBottom:r,panelSize:1}}function Dn(o){if(o==="center"||o==="center-center")return{horizontalAlign:"center",verticalAlign:"center"};const[t,n]=o.split("-");return{horizontalAlign:t,verticalAlign:n}}function Un(o){return o.position?Dn(o.position):{horizontalAlign:o.horizontalAlign??"left",verticalAlign:o.verticalAlign??"top"}}function Xn(o,t){return o.textPaddingLeft!==t.textPaddingLeft||o.textPaddingRight!==t.textPaddingRight||o.textPaddingTop!==t.textPaddingTop||o.textPaddingBottom!==t.textPaddingBottom}const Yn=[["onScrollIconColor","compactIconColor"],["onScrollLinkColor","compactLinkColor"],["onScrollLogoColor","compactLogoColor"],["onScrollBackgroundColor","compactBackgroundColor"],["onScrollPanelColor","compactBackgroundColor"],["onScrollLogoMaxWidth","compactLogoMaxWidth"],["onScrollLogoMaxHeight","compactLogoMaxHeight"],["onScrollLogoPosition","compactLogoPosition"],["onScrollPanelHeight","compactPanelHeight"],["onScrollIconSize","compactIconSize"],["onScrollNavTextWidth","compactNavTextWidth"],["onScrollNavGap","compactNavGap"],["onScrollNavPaddingLeft","compactNavPaddingLeft"],["onScrollNavPaddingRight","compactNavPaddingRight"],["onScrollFontFamily","compactFontFamily"],["onScrollFontSettings","compactFontSettings"],["onScrollFontSize","compactFontSize"],["onScrollLineHeight","compactLineHeight"],["onScrollLetterSpacing","compactLetterSpacing"],["onScrollWordSpacing","compactWordSpacing"],["onScrollTextAlign","compactTextAlign"],["onScrollTextAppearance","compactTextAppearance"]];function Lt(o){var r,c;const t=o,n={};for(const[f,p]of Yn)o[p]!==void 0||t[f]===void 0||(n[p]=t[f]);const e=t.stateOverrides;return e&&(e.onScroll!==void 0||e["onScroll-hover"]!==void 0)&&(n.stateOverrides={...o.stateOverrides},e.onScroll!==void 0&&((r=o.stateOverrides)==null?void 0:r.compact)===void 0&&(n.stateOverrides.compact=e.onScroll),e["onScroll-hover"]!==void 0&&((c=o.stateOverrides)==null?void 0:c["compact-hover"])===void 0&&(n.stateOverrides["compact-hover"]=e["onScroll-hover"])),Object.keys(n).length===0?o:{...o,...n}}function ut(o){var r,c,f,p,g,m,L,N,x,a,A,E,V,G,D,B;o=Lt(o);const t=o,n={};if(o.backgroundColor===void 0&&t.panelColor!==void 0&&(n.backgroundColor=t.panelColor),o.openFontFamily===void 0&&o.fontFamily!==void 0&&(n.openFontFamily=o.fontFamily),o.openFontSettings===void 0&&o.fontSettings!==void 0&&(n.openFontSettings=o.fontSettings),o.openFontSize===void 0&&o.fontSize!==void 0&&(n.openFontSize=o.fontSize),o.openLineHeight===void 0&&o.lineHeight!==void 0&&(n.openLineHeight=o.lineHeight),o.openLetterSpacing===void 0&&o.letterSpacing!==void 0&&(n.openLetterSpacing=o.letterSpacing),o.openWordSpacing===void 0&&o.wordSpacing!==void 0&&(n.openWordSpacing=o.wordSpacing),o.openTextAlign===void 0&&o.textAlign!==void 0&&(n.openTextAlign=o.textAlign),o.openTextAppearance===void 0&&o.textAppearance!==void 0&&(n.openTextAppearance=o.textAppearance),o.openLinkColor===void 0){const v=((c=(r=o.stateOverrides)==null?void 0:r.open)==null?void 0:c.openLinkColor)??((p=(f=o.stateOverrides)==null?void 0:f.open)==null?void 0:p.linkColor)??o.linkColor;v!==void 0&&(n.openLinkColor=v)}if(o.compactIconColor===void 0){const v=((m=(g=o.stateOverrides)==null?void 0:g.compact)==null?void 0:m.iconColor)??o.iconColor;v!==void 0&&(n.compactIconColor=v)}if(o.compactLinkColor===void 0){const v=((N=(L=o.stateOverrides)==null?void 0:L.compact)==null?void 0:N.linkColor)??o.linkColor;v!==void 0&&(n.compactLinkColor=v)}if(o.compactLogoColor===void 0){const v=((a=(x=o.stateOverrides)==null?void 0:x.compact)==null?void 0:a.logoColor)??o.logoColor;v!==void 0&&(n.compactLogoColor=v)}if(o.openLogoColor===void 0){const v=((E=(A=o.stateOverrides)==null?void 0:A.open)==null?void 0:E.logoColor)??o.logoColor;v!==void 0&&(n.openLogoColor=v)}if(o.compactBackgroundColor===void 0){const v=((G=(V=o.stateOverrides)==null?void 0:V.compact)==null?void 0:G.backgroundColor)??((B=(D=t.stateOverrides)==null?void 0:D.compact)==null?void 0:B.panelColor)??t.compactPanelColor??t.onScrollPanelColor??o.backgroundColor??n.backgroundColor;v!==void 0&&(n.compactBackgroundColor=v)}o.logoMaxHeight===void 0&&o.logoMaxWidth!==void 0&&(n.logoMaxHeight=o.logoMaxWidth),o.compactLogoMaxHeight===void 0&&o.compactLogoMaxWidth!==void 0&&(n.compactLogoMaxHeight=o.compactLogoMaxWidth);const e=(v,U)=>{if(o[v]!==void 0)return;const X=o[U];X!==void 0&&(n[v]=X)};return e("compactLogoMaxHeight","logoMaxHeight"),e("compactLogoPosition","logoPosition"),e("compactPanelHeight","panelHeight"),e("compactShowIcon","showIcon"),e("compactIconSize","iconSize"),e("compactNavTextWidth","navTextWidth"),e("compactNavTextPosition","navTextPosition"),e("compactNavTextOffset","navTextOffset"),e("compactNavGap","navGap"),e("compactNavPaddingLeft","navPaddingLeft"),e("compactNavPaddingRight","navPaddingRight"),e("compactFontFamily","fontFamily"),e("compactFontSettings","fontSettings"),e("compactFontSize","fontSize"),e("compactLineHeight","lineHeight"),e("compactLetterSpacing","letterSpacing"),e("compactWordSpacing","wordSpacing"),e("compactTextAlign","textAlign"),e("compactTextAppearance","textAppearance"),Object.keys(n).length===0?o:{...o,...n}}function Ct(o,t){const n=yt({textPaddingLeft:o.textPaddingLeft??0,textPaddingRight:o.textPaddingRight??0,textPaddingTop:o.textPaddingTop??0,textPaddingBottom:o.textPaddingBottom??0,fontSize:o.openFontSize??o.fontSize??t.openFontSize??t.fontSize}),e={};return(o.textPaddingLeft??0)!==n.effectivePaddingLeft&&(e.textPaddingLeft=n.effectivePaddingLeft),(o.textPaddingRight??0)!==n.effectivePaddingRight&&(e.textPaddingRight=n.effectivePaddingRight),(o.textPaddingTop??0)!==n.effectivePaddingTop&&(e.textPaddingTop=n.effectivePaddingTop),(o.textPaddingBottom??0)!==n.effectivePaddingBottom&&(e.textPaddingBottom=n.effectivePaddingBottom),Object.keys(e).length===0?o:{...o,...e}}function qn(o,t){return{paddingLeft:T.scalingValue(o.effectivePaddingLeft,t),paddingRight:T.scalingValue(o.effectivePaddingRight,t),paddingTop:T.scalingValue(o.effectivePaddingTop,t),paddingBottom:T.scalingValue(o.effectivePaddingBottom,t)}}function Kn(o,t,n,e){const r=Math.max(F,n??F),c=Math.max(t.effectivePaddingTop,W),f=Math.max(t.effectivePaddingBottom,W),p=Math.max(0,t.panelSize-t.effectivePaddingBottom-r),g=Math.max(0,t.panelSize-t.effectivePaddingTop-r),m=Math.max(t.effectivePaddingLeft,W),L=Math.max(t.effectivePaddingRight,W),N=Math.max(0,t.panelSize-t.effectivePaddingRight-F),x=Math.max(0,t.panelSize-t.effectivePaddingLeft-F);return l.jsxs(l.Fragment,{children:[l.jsx("div",{"data-controls":"textPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-max-fraction":String(p),className:`${o}-control-anchor`,style:{top:0,left:0,width:"100%",height:e(c)}}),l.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(g),className:`${o}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:e(f)}}),l.jsx("div",{"data-controls":"textPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(N),className:`${o}-control-anchor`,style:{top:0,left:0,width:e(m),height:"100%"}}),l.jsx("div",{"data-controls":"textPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(x),className:`${o}-control-anchor`,style:{top:0,right:0,width:e(L),height:"100%"}})]})}const Zn={iconColor:"icon-color",closeButtonColor:"close-button-color",linkColor:"link-color",openLinkColor:"menu-link-color",compactIconColor:"compact-icon-color",compactLinkColor:"compact-link-color",compactLogoColor:"compact-logo-color",compactBackgroundColor:"compact-background-color",openLogoColor:"open-logo-color",menuBackgroundColor:"menu-background-color",overlayColor:"overlay-color",backgroundColor:"background-color",logoColor:"logo-color"},Jn=["hover","open"],Qn={top:"flex-start",center:"center",bottom:"flex-end"},Pn={left:"flex-start",center:"center",right:"flex-end"};function oa(o){return`
2
- .${o}-root {
3
- position: relative;
4
- display: block;
5
- box-sizing: border-box;
6
- overflow: hidden;
7
- flex-shrink: 0;
8
- line-height: 0;
9
- font-size: 0;
10
- }
11
- .${o}-nav-links-inner {
12
- display: flex;
13
- align-items: center;
14
- height: 100%;
15
- flex-shrink: 0;
16
- pointer-events: none;
17
- }
18
- .${o}-toggle {
19
- display: block;
20
- box-sizing: border-box;
21
- width: 100%;
22
- height: 100%;
23
- min-width: 0;
24
- min-height: 0;
25
- margin: 0;
26
- padding: 0;
27
- border: 0;
28
- background: none;
29
- cursor: pointer;
30
- color: var(--${o}-icon-color);
31
- transition: color ${y}ms ease;
32
- line-height: 0;
33
- font-size: 0;
34
- -webkit-appearance: none;
35
- appearance: none;
36
- }
37
- .${o}-toggle:focus,
38
- .${o}-toggle:focus-visible {
39
- outline: none;
40
- }
41
- .${o}-icon {
42
- display: block;
43
- width: 100%;
44
- height: 100%;
45
- overflow: visible;
46
- }
47
- .${o}-icon-line {
48
- fill: currentColor;
49
- transform-box: fill-box;
50
- transform-origin: center;
51
- transition: transform ${y}ms ease, opacity ${y}ms ease;
52
- }
53
- .${o}-root.${o}-open .${o}-icon-line-top {
54
- transform: translateY(200%) rotate(45deg);
55
- }
56
- .${o}-root.${o}-open .${o}-icon-line-mid {
57
- opacity: 0;
58
- }
59
- .${o}-root.${o}-open .${o}-icon-line-bot {
60
- transform: translateY(-200%) rotate(-45deg);
61
- }
62
- .${o}-root.${o}-open .${o}-toggle {
63
- color: var(--${o}-close-button-color);
64
- }
65
- @media (hover: hover) and (pointer: fine) {
66
- .${o}-interactive .${o}-toggle:hover {
67
- color: var(--${o}-hover-icon-color, var(--${o}-icon-color));
68
- }
69
- }
70
- .${o}-interactive .${o}-toggle:active {
71
- color: var(--${o}-hover-icon-color, var(--${o}-icon-color));
72
- }
73
- .${o}-interactive .${o}-toggle:focus-visible,
74
- .${o}-root.${o}-state-hover .${o}-toggle {
75
- color: var(--${o}-hover-icon-color, var(--${o}-icon-color));
76
- }
77
- .${o}-lightbox {
78
- position: fixed;
79
- inset: 0;
80
- z-index: 2;
81
- pointer-events: none;
82
- overscroll-behavior: none;
83
- overflow: hidden;
84
- }
85
- .${o}-lightbox-editor {
86
- inset: auto;
87
- top: var(--cntrl-article-top, 0);
88
- left: var(--cntrl-article-left, 0);
89
- width: var(--cntrl-article-width, 100vw) !important;
90
- height: var(--cntrl-viewport-height, 100vh) !important;
91
- }
92
- .${o}-lightbox-edit-mode {
93
- z-index: 1;
94
- }
95
- .${o}-lightbox.${o}-lightbox-active {
96
- pointer-events: auto;
97
- }
98
- .${o}-backdrop {
99
- position: absolute;
100
- inset: 0;
101
- border: none;
102
- padding: 0;
103
- margin: 0;
104
- background-color: var(--${o}-overlay-color);
105
- opacity: 0;
106
- transition: opacity ${y}ms ease, background-color ${y}ms ease;
107
- }
108
- .${o}-lightbox.${o}-lightbox-active .${o}-backdrop {
109
- opacity: 1;
110
- }
111
- .${o}-backdrop-clickable {
112
- cursor: pointer;
113
- }
114
- .${o}-panel {
115
- position: absolute;
116
- box-sizing: border-box;
117
- display: flex;
118
- flex-direction: column;
119
- overflow-y: auto;
120
- background-color: var(--${o}-menu-background-color);
121
- transition: transform ${y}ms ease, opacity ${y}ms ease, background-color ${y}ms ease;
122
- box-shadow: 0 0 24px rgba(0, 0, 0, 0.12);
123
- }
124
- .${o}-full-lightbox .${o}-panel {
125
- pointer-events: none;
126
- box-shadow: none;
127
- }
128
- .${o}-full-lightbox .${o}-panel.${o}-panel-blocking {
129
- pointer-events: auto;
130
- }
131
- .${o}-safari-tint {
132
- position: fixed;
133
- top: 0;
134
- left: 0;
135
- width: 0;
136
- height: 0;
137
- pointer-events: none;
138
- background-color: var(--${o}-menu-background-color);
139
- opacity: 0;
140
- }
141
- .${o}-full-lightbox .${o}-link,
142
- .${o}-full-lightbox .${o}-gap-control {
143
- pointer-events: auto;
144
- }
145
- .${o}-effect-fade .${o}-panel,
146
- .${o}-effect-left .${o}-panel,
147
- .${o}-effect-top .${o}-panel,
148
- .${o}-effect-right .${o}-panel,
149
- .${o}-effect-bottom .${o}-panel {
150
- top: 0;
151
- left: 0;
152
- width: 100%;
153
- height: 100%;
154
- max-width: 100%;
155
- max-height: 100%;
156
- }
157
- .${o}-effect-fade .${o}-panel {
158
- opacity: 0;
159
- transform: none;
160
- }
161
- .${o}-effect-fade.${o}-lightbox-active .${o}-panel {
162
- opacity: 1;
163
- }
164
- .${o}-effect-left .${o}-panel {
165
- transform: translateX(-100%);
166
- }
167
- .${o}-effect-left.${o}-lightbox-active .${o}-panel {
168
- transform: translateX(0);
169
- }
170
- .${o}-effect-right .${o}-panel {
171
- left: auto;
172
- right: 0;
173
- transform: translateX(100%);
174
- }
175
- .${o}-effect-right.${o}-lightbox-active .${o}-panel {
176
- transform: translateX(0);
177
- }
178
- .${o}-effect-top .${o}-panel {
179
- transform: translateY(-100%);
180
- }
181
- .${o}-effect-top.${o}-lightbox-active .${o}-panel {
182
- transform: translateY(0);
183
- }
184
- .${o}-effect-bottom .${o}-panel {
185
- top: auto;
186
- bottom: 0;
187
- transform: translateY(100%);
188
- }
189
- .${o}-effect-bottom.${o}-lightbox-active .${o}-panel {
190
- transform: translateY(0);
191
- }
192
- .${o}-effect-fade .${o}-link,
193
- .${o}-effect-left .${o}-link,
194
- .${o}-effect-top .${o}-link,
195
- .${o}-effect-right .${o}-link,
196
- .${o}-effect-bottom .${o}-link {
197
- width: fit-content;
198
- max-width: 100%;
199
- }
200
- .${o}-control-anchor {
201
- position: absolute;
202
- pointer-events: none;
203
- z-index: 2;
204
- }
205
- .${o}-gap-control {
206
- position: relative;
207
- flex-shrink: 0;
208
- width: 100%;
209
- z-index: 2;
210
- }
211
- .${o}-gap-control::before {
212
- content: "";
213
- position: absolute;
214
- top: 0;
215
- left: 0;
216
- width: 100%;
217
- height: 100%;
218
- min-height: 20px;
219
- pointer-events: auto;
220
- z-index: 10;
221
- }
222
- .${o}-link {
223
- display: block;
224
- width: 100%;
225
- color: var(--${o}-menu-link-color);
226
- text-decoration: none;
227
- cursor: default;
228
- transition: color 200ms ease;
229
- }
230
- .${o}-link-text-box {
231
- position: relative;
232
- display: flex;
233
- flex-direction: column;
234
- flex-shrink: 0;
235
- min-width: 0;
236
- box-sizing: border-box;
237
- }
238
- .${o}-link-text-inner {
239
- display: flex;
240
- flex-direction: column;
241
- flex-shrink: 0;
242
- box-sizing: border-box;
243
- outline: 1px solid #FF5C02;
244
- }
245
- .${o}-link-text-inner-hidden {
246
- display: flex;
247
- flex-direction: column;
248
- flex-shrink: 0;
249
- box-sizing: border-box;
250
- }
251
- .${o}-link-text {
252
- display: block;
253
- width: 100%;
254
- white-space: pre-wrap;
255
- overflow-wrap: anywhere;
256
- word-break: break-word;
257
- }
258
- .${o}-text-tight-leading {
259
- display: block;
260
- flex-shrink: 0;
261
- padding-top: var(--${o}-text-leading-gap, 0);
262
- padding-bottom: var(--${o}-text-leading-gap, 0);
263
- }
264
- .${o}-interactive .${o}-has-href {
265
- cursor: pointer;
266
- }
267
- @media (hover: hover) and (pointer: fine) {
268
- .${o}-interactive .${o}-has-href:hover {
269
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
270
- outline: none;
271
- }
272
- .${o}-interactive .${o}-lightbox .${o}-has-href:hover {
273
- color: var(--${o}-open-hover-menu-link-color, var(--${o}-menu-link-color));
274
- outline: none;
275
- }
276
- .${o}-interactive .${o}-has-href:hover .${o}-link-text {
277
- color: inherit;
278
- }
279
- }
280
- .${o}-interactive .${o}-has-href:active {
281
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
282
- outline: none;
283
- }
284
- .${o}-interactive .${o}-lightbox .${o}-has-href:active {
285
- color: var(--${o}-open-hover-menu-link-color, var(--${o}-menu-link-color));
286
- outline: none;
287
- }
288
- .${o}-interactive .${o}-has-href:active .${o}-link-text {
289
- color: inherit;
290
- }
291
- .${o}-interactive .${o}-has-href:focus-visible,
292
- .${o}-lightbox.${o}-state-hover .${o}-has-href {
293
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
294
- outline: none;
295
- }
296
- .${o}-interactive .${o}-lightbox .${o}-has-href:focus-visible,
297
- .${o}-lightbox.${o}-state-hover .${o}-link.${o}-has-href {
298
- color: var(--${o}-open-hover-menu-link-color, var(--${o}-menu-link-color));
299
- outline: none;
300
- }
301
- .${o}-interactive .${o}-has-href:focus-visible .${o}-link-text,
302
- .${o}-lightbox.${o}-state-hover .${o}-has-href .${o}-link-text {
303
- color: inherit;
304
- }
305
- .${o}-editor .${o}-toggle {
306
- cursor: default;
307
- pointer-events: none;
308
- }
309
- .${o}-nav-slide {
310
- position: relative;
311
- transform: translateY(var(--cntrl-nav-slide, 0%));
312
- transition: transform 320ms ease;
313
- }
314
- .${o}-nav-bar {
315
- position: relative;
316
- display: flex;
317
- align-items: center;
318
- box-sizing: border-box;
319
- width: 100%;
320
- height: 100%;
321
- background-color: var(--${o}-background-color);
322
- padding-left: var(--${o}-nav-padding-x, 0);
323
- padding-right: var(--${o}-nav-padding-x, 0);
324
- gap: var(--${o}-nav-inner-gap, 0);
325
- }
326
- .${o}-nav-logo {
327
- position: absolute;
328
- top: 0;
329
- z-index: 1;
330
- display: flex;
331
- flex-shrink: 0;
332
- align-items: center;
333
- height: 100%;
334
- min-width: 0;
335
- pointer-events: auto;
336
- }
337
- .${o}-nav-logo-left {
338
- left: 0;
339
- right: auto;
340
- transform: none;
341
- }
342
- .${o}-nav-logo-center {
343
- left: 50%;
344
- right: auto;
345
- transform: translateX(-50%);
346
- }
347
- .${o}-nav-logo-right {
348
- left: auto;
349
- right: 0;
350
- transform: none;
351
- }
352
- .${o}-nav-logo-inner {
353
- position: relative;
354
- flex-shrink: 0;
355
- width: auto;
356
- max-height: 100%;
357
- }
358
- .${o}-nav-logo-img {
359
- display: block;
360
- width: auto;
361
- height: 100%;
362
- max-height: 100%;
363
- object-fit: contain;
364
- }
365
- .${o}-nav-logo-tinted .${o}-nav-logo-img {
366
- opacity: 0;
367
- }
368
- .${o}-nav-logo-tint {
369
- display: none;
370
- }
371
- .${o}-nav-logo-tinted .${o}-nav-logo-tint {
372
- display: block;
373
- position: absolute;
374
- inset: 0;
375
- background-color: var(--${o}-logo-color);
376
- -webkit-mask: var(--${o}-logo-image) no-repeat center / contain;
377
- mask: var(--${o}-logo-image) no-repeat center / contain;
378
- -webkit-mask-source-type: alpha;
379
- mask-mode: alpha;
380
- pointer-events: none;
381
- transition: background-color 200ms ease;
382
- }
383
- .${o}-root.${o}-state-compact .${o}-nav-logo-tinted .${o}-nav-logo-tint {
384
- background-color: var(--${o}-compact-logo-color);
385
- }
386
- .${o}-root.${o}-state-open .${o}-nav-logo-tinted .${o}-nav-logo-tint {
387
- background-color: var(--${o}-open-logo-color, var(--${o}-logo-color));
388
- }
389
- @media (hover: hover) and (pointer: fine) {
390
- .${o}-interactive .${o}-nav-logo:hover .${o}-nav-logo-tint {
391
- background-color: var(--${o}-hover-logo-color, var(--${o}-logo-color));
392
- }
393
- .${o}-interactive.${o}-state-compact .${o}-nav-logo:hover .${o}-nav-logo-tint {
394
- background-color: var(--${o}-compact-hover-compact-logo-color, var(--${o}-compact-logo-color));
395
- }
396
- .${o}-interactive.${o}-state-open .${o}-nav-logo:hover .${o}-nav-logo-tint {
397
- background-color: var(--${o}-open-hover-open-logo-color, var(--${o}-open-logo-color, var(--${o}-logo-color)));
398
- }
399
- }
400
- .${o}-interactive .${o}-nav-logo:active .${o}-nav-logo-tint {
401
- background-color: var(--${o}-hover-logo-color, var(--${o}-logo-color));
402
- }
403
- .${o}-interactive.${o}-state-compact .${o}-nav-logo:active .${o}-nav-logo-tint {
404
- background-color: var(--${o}-compact-hover-compact-logo-color, var(--${o}-compact-logo-color));
405
- }
406
- .${o}-interactive.${o}-state-open .${o}-nav-logo:active .${o}-nav-logo-tint {
407
- background-color: var(--${o}-open-hover-open-logo-color, var(--${o}-open-logo-color, var(--${o}-logo-color)));
408
- }
409
- .${o}-root.${o}-state-hover .${o}-nav-logo-tinted .${o}-nav-logo-tint {
410
- background-color: var(--${o}-hover-logo-color, var(--${o}-logo-color));
411
- }
412
- .${o}-root.${o}-state-compact.${o}-state-hover .${o}-nav-logo-tinted .${o}-nav-logo-tint {
413
- background-color: var(--${o}-compact-hover-compact-logo-color, var(--${o}-compact-logo-color));
414
- }
415
- .${o}-root.${o}-state-open.${o}-state-hover .${o}-nav-logo-tinted .${o}-nav-logo-tint {
416
- background-color: var(--${o}-open-hover-open-logo-color, var(--${o}-open-logo-color, var(--${o}-logo-color)));
417
- }
418
- .${o}-nav-links {
419
- position: absolute;
420
- top: 0;
421
- height: 100%;
422
- display: flex;
423
- align-items: center;
424
- min-width: 0;
425
- flex-shrink: 0;
426
- pointer-events: none;
427
- z-index: 0;
428
- }
429
- .${o}-nav-links-left {
430
- left: 0;
431
- right: auto;
432
- }
433
- .${o}-nav-links-center {
434
- left: 50%;
435
- right: auto;
436
- }
437
- .${o}-nav-links-right {
438
- left: auto;
439
- right: 0;
440
- }
441
- .${o}-nav-links .${o}-nav-link,
442
- .${o}-nav-links .${o}-gap-control {
443
- pointer-events: auto;
444
- }
445
- .${o}-nav-gap-control {
446
- flex-shrink: 0;
447
- }
448
- .${o}-nav-links .${o}-gap-control {
449
- position: relative;
450
- width: auto;
451
- height: 100%;
452
- min-height: 20px;
453
- z-index: 2;
454
- }
455
- .${o}-nav-links .${o}-gap-control::before {
456
- width: 100%;
457
- height: 100%;
458
- min-width: 20px;
459
- min-height: 20px;
460
- }
461
- .${o}-nav-link {
462
- display: inline-flex;
463
- align-items: center;
464
- flex-shrink: 0;
465
- color: var(--${o}-link-color);
466
- text-decoration: none;
467
- cursor: default;
468
- transition: color 200ms ease;
469
- }
470
- @media (hover: hover) and (pointer: fine) {
471
- .${o}-interactive .${o}-nav-link.${o}-has-href:hover {
472
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
473
- outline: none;
474
- }
475
- .${o}-interactive.${o}-state-compact .${o}-nav-link.${o}-has-href:hover {
476
- color: var(--${o}-compact-hover-compact-link-color, var(--${o}-compact-link-color));
477
- }
478
- }
479
- .${o}-interactive .${o}-nav-link.${o}-has-href:active {
480
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
481
- outline: none;
482
- }
483
- .${o}-interactive.${o}-state-compact .${o}-nav-link.${o}-has-href:active {
484
- color: var(--${o}-compact-hover-compact-link-color, var(--${o}-compact-link-color));
485
- }
486
- .${o}-interactive .${o}-nav-link.${o}-has-href:focus-visible,
487
- .${o}-root.${o}-state-hover .${o}-nav-link.${o}-has-href {
488
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
489
- outline: none;
490
- }
491
- .${o}-interactive.${o}-state-compact .${o}-nav-link.${o}-has-href:focus-visible,
492
- .${o}-root.${o}-state-compact.${o}-state-hover .${o}-nav-link.${o}-has-href {
493
- color: var(--${o}-compact-hover-compact-link-color, var(--${o}-compact-link-color));
494
- }
495
- .${o}-root.${o}-state-compact .${o}-nav-bar {
496
- background-color: var(--${o}-compact-background-color);
497
- }
498
- .${o}-root.${o}-state-compact .${o}-toggle {
499
- color: var(--${o}-compact-icon-color);
500
- }
501
- @media (hover: hover) and (pointer: fine) {
502
- .${o}-interactive.${o}-state-compact .${o}-toggle:hover {
503
- color: var(--${o}-compact-hover-compact-icon-color, var(--${o}-compact-icon-color));
504
- }
505
- }
506
- .${o}-interactive.${o}-state-compact .${o}-toggle:active {
507
- color: var(--${o}-compact-hover-compact-icon-color, var(--${o}-compact-icon-color));
508
- }
509
- .${o}-interactive.${o}-state-compact .${o}-toggle:focus-visible,
510
- .${o}-root.${o}-state-compact.${o}-state-hover .${o}-toggle {
511
- color: var(--${o}-compact-hover-compact-icon-color, var(--${o}-compact-icon-color));
512
- }
513
- .${o}-root.${o}-state-compact .${o}-nav-link {
514
- color: var(--${o}-compact-link-color);
515
- }
516
- .${o}-lightbox.${o}-state-compact .${o}-panel {
517
- background-color: var(--${o}-compact-menu-background-color, var(--${o}-menu-background-color));
518
- }
519
- .${o}-lightbox.${o}-state-compact .${o}-safari-tint {
520
- background-color: var(--${o}-compact-menu-background-color, var(--${o}-menu-background-color));
521
- }
522
- .${o}-lightbox.${o}-state-compact .${o}-backdrop {
523
- background-color: var(--${o}-compact-overlay-color, var(--${o}-overlay-color));
524
- }
525
- @media (hover: hover) and (pointer: fine) {
526
- .${o}-interactive .${o}-has-href:hover {
527
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
528
- }
529
- }
530
- .${o}-interactive .${o}-has-href:active {
531
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
532
- }
533
- .${o}-interactive .${o}-has-href:focus-visible,
534
- .${o}-lightbox.${o}-state-hover .${o}-has-href,
535
- .${o}-root.${o}-state-hover .${o}-has-href {
536
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
537
- }
538
- .${o}-root.${o}-state-compact.${o}-state-hover .${o}-has-href {
539
- color: var(--${o}-compact-hover-compact-link-color, var(--${o}-compact-link-color));
540
- }
541
- .${o}-root.${o}-state-open .${o}-toggle {
542
- color: var(--${o}-close-button-color);
543
- }
544
- @media (hover: hover) and (pointer: fine) {
545
- .${o}-interactive.${o}-state-open .${o}-toggle:hover {
546
- color: var(--${o}-open-hover-close-button-color, var(--${o}-close-button-color));
547
- }
548
- }
549
- .${o}-interactive.${o}-state-open .${o}-toggle:active {
550
- color: var(--${o}-open-hover-close-button-color, var(--${o}-close-button-color));
551
- }
552
- .${o}-interactive.${o}-state-open .${o}-toggle:focus-visible,
553
- .${o}-root.${o}-state-open.${o}-state-hover .${o}-toggle {
554
- color: var(--${o}-open-hover-close-button-color, var(--${o}-close-button-color));
555
- }
556
- .${o}-lightbox .${o}-link {
557
- color: var(--${o}-menu-link-color);
558
- }
559
- .${o}-lightbox.${o}-state-open .${o}-panel {
560
- background-color: var(--${o}-open-menu-background-color, var(--${o}-menu-background-color));
561
- }
562
- .${o}-lightbox.${o}-state-open .${o}-safari-tint {
563
- background-color: var(--${o}-open-menu-background-color, var(--${o}-menu-background-color));
564
- }
565
- .${o}-lightbox.${o}-state-open .${o}-backdrop {
566
- background-color: var(--${o}-open-overlay-color, var(--${o}-overlay-color));
567
- }
568
- .${o}-lightbox.${o}-state-open.${o}-state-hover .${o}-has-href,
569
- .${o}-root.${o}-state-open.${o}-state-hover .${o}-has-href {
570
- color: var(--${o}-open-hover-menu-link-color, var(--${o}-menu-link-color));
571
- }
572
- .${o}-nav-toggle-wrap {
573
- position: absolute;
574
- top: 0;
575
- height: 100%;
576
- display: flex;
577
- flex-direction: row;
578
- flex-shrink: 0;
579
- align-items: center;
580
- z-index: 3;
581
- pointer-events: auto;
582
- transform: translateY(var(--cntrl-nav-slide, 0%));
583
- transition: transform 320ms ease;
584
- }
585
- .${o}-nav-toggle-wrap-right {
586
- right: 0;
587
- left: auto;
588
- }
589
- .${o}-nav-toggle-wrap-left {
590
- left: 0;
591
- right: auto;
592
- }
593
- .${o}-nav-padding-left,
594
- .${o}-nav-padding-right {
595
- position: relative;
596
- flex-shrink: 0;
597
- height: 100%;
598
- }
599
- .${o}-nav-toggle-wrap .${o}-root {
600
- line-height: 0;
601
- font-size: 0;
602
- }
603
- .${o}-nav-state-anim {
604
- transition: margin-top ${h}ms ease;
605
- }
606
- .${o}-nav-state-anim .${o}-nav-bar {
607
- transition:
608
- background-color ${y}ms ease,
609
- height ${h}ms ease,
610
- min-height ${h}ms ease,
611
- padding ${h}ms ease,
612
- gap ${h}ms ease;
613
- }
614
- .${o}-nav-state-anim .${o}-nav-logo,
615
- .${o}-nav-state-anim .${o}-nav-toggle-wrap,
616
- .${o}-nav-state-anim .${o}-nav-links {
617
- transition:
618
- left ${h}ms ease,
619
- right ${h}ms ease,
620
- transform ${h}ms ease;
621
- }
622
- .${o}-nav-state-anim .${o}-nav-logo-inner,
623
- .${o}-nav-state-anim .${o}-nav-padding-left,
624
- .${o}-nav-state-anim .${o}-nav-padding-right,
625
- .${o}-nav-state-anim .${o}-nav-gap-control,
626
- .${o}-nav-state-anim .${o}-link-text-box {
627
- transition:
628
- width ${h}ms ease,
629
- height ${h}ms ease;
630
- }
631
- .${o}-nav-state-anim .${o}-nav-logo-tint {
632
- transition:
633
- background-color ${h}ms ease;
634
- }
635
- .${o}-nav-state-anim .${o}-nav-toggle-wrap .${o}-root {
636
- transition:
637
- width ${h}ms ease,
638
- height ${h}ms ease,
639
- min-width ${h}ms ease,
640
- min-height ${h}ms ease,
641
- max-width ${h}ms ease,
642
- max-height ${h}ms ease;
643
- }
644
- .${o}-nav-state-anim .${o}-icon-line {
645
- transition:
646
- transform ${y}ms ease,
647
- opacity ${y}ms ease;
648
- }
649
- .${o}-nav-state-anim .${o}-nav-link,
650
- .${o}-nav-state-anim .${o}-link,
651
- .${o}-nav-state-anim .${o}-link-text,
652
- .${o}-nav-state-anim .${o}-text-tight-leading {
653
- transition:
654
- color 200ms ease,
655
- font-size ${h}ms ease,
656
- line-height ${h}ms ease,
657
- letter-spacing ${h}ms ease,
658
- word-spacing ${h}ms ease,
659
- padding ${h}ms ease;
660
- }
661
- `}function Ro(o){return o?!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("blob:")&&!o.startsWith("data:"):!1}function ta(o,t){var e;const n=(e=o.logo)==null?void 0:e.icon;return!o.logo||Ro(n)||!t?o:{...o,logo:{...o.logo,icon:t}}}function ea(o){return`url("${o.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function na(o){const t=o.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function aa(o){const t=na(o),[n,e]=s.useState(!1);return s.useEffect(()=>{if(t||!o.startsWith("blob:")){e(!1);return}let r=!1;return fetch(o).then(c=>c.blob()).then(async c=>{if(r)return;if(c.type.includes("svg")){e(!0);return}if(c.type.startsWith("image/")&&!c.type.includes("svg")){e(!1);return}const f=await c.text();r||e(/<svg[\s>]/i.test(f.trim()))}).catch(()=>{r||e(!1)}),()=>{r=!0}},[t,o]),t||n}function ra(o,t){const[n,e]=s.useState(Ao.isInlineMaskUrl(o)?o:null);return s.useEffect(()=>{if(!t||!o){e(null);return}if(Ao.isInlineMaskUrl(o)){e(o);return}let r=!1;return Ao.loadSvgMaskUrl(o).then(c=>{r||e(c)}).catch(()=>{r||e(null)}),()=>{r=!0}},[t,o]),t?n:null}function ia(o){const t=o.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(o.slice(t+1))}catch{return o.slice(t+1)}}function ca(o){if(!o||o.startsWith("#"))return!0;try{return new URL(o,window.location.href).pathname===window.location.pathname}catch{return!1}}function wt(o){if(!o)return null;const t=document.getElementById(o),n=document.querySelector(`[data-section-id="${CSS.escape(o)}"]`),e=t??n;return e instanceof HTMLElement?e:null}function $t(o){const t=wt(o);return t?(t.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function la(o,t,n={}){const{isEditor:e,isPreviewMode:r,item:c,pages:f,onLinkNavigate:p}=n,g=n.runAfterClose??(x=>x()),m=o.currentTarget.getAttribute("href")??"",L=ia(m),N=o.currentTarget.target==="_blank";if(c&&p){o.preventDefault(),o.stopPropagation();const x=Bo(c,f),a=kt(c),A={mode:a.type==="url"?"url":"page",href:x.href||m,page:a.type==="page"?a.value:void 0,url:a.type==="url"?a.value:void 0,anchor:a.type==="anchor"?a.value.replace(/^#/,""):(a.anchor??"").replace(/^#/,""),target:x.target};A.target==="_blank"?p(A):g(()=>p(A)),t();return}if(e){o.preventDefault(),g(()=>$t(L)),t();return}!N&&L&&ca(m)&&wt(L)&&(o.preventDefault(),g(()=>$t(L))),t()}const sa=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function da(o){let t=o;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return o}function ga(o){const t={},n=da(o);if(!n)return t;const e=getComputedStyle(n);for(const r of sa){const c=e.getPropertyValue(r).trim();c&&(t[r]=c)}return t}function mt(o,t,n,e,r){return l.jsx("span",{className:`${o}-link-text-box`,style:{width:r(n),maxWidth:"100%"},children:l.jsx("span",{className:e?`${o}-link-text-inner`:`${o}-link-text-inner-hidden`,style:{width:"100%"},children:t})})}function fa({settings:o,isEditor:t,isEditMode:n,isPreviewMode:e,activeEvent:r,currentState:c,isSwitchClone:f=!1,unavailableStates:p=[],layoutId:g,pages:m,onLinkNavigate:L,onUpdateSettings:N,onOpenChange:x}){var at;const{prefix:a}=Cn.useScopedStyles(),A=s.useRef(null),E=s.useRef(null),V=s.useRef(null),G=s.useRef(null),D=s.useRef(null),B=s.useRef(0),v=s.useRef(null),U=s.useRef(null),X=s.useRef(g),Tt=s.useMemo(()=>oa(a),[a]),[Nt,Y]=s.useState(!1),[I,po]=s.useState(!1),[Oo,to]=s.useState(!1),H=zn(c),At=s.useMemo(()=>new Set(p),[p]),ho=i=>!!(i&&At.has(i)),u=!!(t&&!e&&H==="open"&&!ho("open"))||!(t&&!e)&&Nt,uo=!!(t&&!e),q=u&&!uo;wn.useLightboxScrollLock(q),s.useEffect(()=>{if(!u||!uo)return;const i=document.documentElement,d=i.style.overflow;return i.style.overflow="hidden",()=>{i.style.overflow=d}},[u,uo]);const zt=!ho("compact")&&!ho("onScroll"),Bt=!t||!!e&&!n,eo=r&&r!=="default"?r:void 0,C=zt&&H==="compact"?"compact":"default",[Ho,Rt]=s.useState(C),[$o,Fo]=s.useState(!1),Io=!n;C!==Ho&&(Rt(C),Io&&Fo(!0));const Ot=Lt(o),{logo:j,logoMaxHeight:Ht=120/1440,logoPosition:Ft="left",panelHeight:jo=60/1440,backgroundColor:It="#b3b3b3",logoColor:jt="#000000",position:Mt,horizontalAlign:_t,verticalAlign:Wt,iconColor:Et="#000000",showIcon:Vt="on",iconSize:Gt=16/1440,linkColor:Dt="#000000",openLinkColor:Ut="#000000",compactIconColor:Xt="#000000",compactLinkColor:Yt="#000000",compactLogoColor:qt="#000000",compactBackgroundColor:Kt="#ffffff",compactLogoMaxHeight:Zt=120/1440,compactLogoPosition:Jt,compactPanelHeight:Qt=60/1440,compactShowIcon:Pt="on",compactIconSize:oe=16/1440,compactNavTextWidth:te,compactNavTextPosition:ee,compactNavTextOffset:ne,compactNavGap:ae,compactNavPaddingLeft:re=10/1440,compactNavPaddingRight:ie=10/1440,compactFontFamily:ce,compactFontSettings:le,compactFontSize:se,compactLineHeight:de,compactLetterSpacing:ge=0,compactWordSpacing:fe=0,compactTextAlign:ve="left",compactTextAppearance:pe,openLogoColor:he="#000000",menuBackgroundColor:Mo="#ffffff",overlayColor:ue="rgba(0, 0, 0, 0.45)",closeButtonColor:$e="#000000",effect:mo="fade",openPanelSize:_o=100,textWidth:Wo=280/1440,navTextWidth:me,navTextPosition:xe="center",navTextOffset:ke=0,gap:Eo=0,navGap:Se,navPaddingLeft:be=10/1440,navPaddingRight:ye=10/1440,textPaddingLeft:Vo=10/1440,textPaddingRight:Go=10/1440,textPaddingTop:Do=10/1440,textPaddingBottom:Uo=10/1440,fontFamily:Le,fontSettings:Ce,fontSize:we,lineHeight:Te,letterSpacing:Ne=0,wordSpacing:Ae=0,textAlign:ze="left",textAppearance:Be,openFontFamily:Re,openFontSettings:Oe,openFontSize:He,openLineHeight:Fe,openLetterSpacing:Ie,openWordSpacing:je,openTextAlign:Me,openTextAppearance:_e,stateOverrides:Xo,link:Yo}=Ot,{horizontalAlign:We,verticalAlign:Ee}=Un({position:Mt,horizontalAlign:_t,verticalAlign:Wt}),k=C==="compact",Ve=k?Zt:Ht,no=Bn(k?Jt:Ft),ao=k?Qt:jo,xo=k?oe:Gt,Ge=k?te:me,qo=Rn(k?ee:xe),De=(k?ne:ke)??0,Ue=k?ae:Se,Ko=k?re:be,Zo=k?ie:ye,Xe=Ge??Wo,Ye=u||(k?Pt:Vt)!=="off",ko=Ln.buildColorVars(a,{iconColor:Et,closeButtonColor:$e,linkColor:Dt,openLinkColor:Ut,compactIconColor:Xt,compactLinkColor:Yt,compactLogoColor:qt,compactBackgroundColor:Kt,openLogoColor:he,menuBackgroundColor:Mo,overlayColor:ue,backgroundColor:It,logoColor:jt},Zn,Jn,Xo),So=ft(k?{fontFamily:ce,fontSettings:le,fontSize:se,lineHeight:de,letterSpacing:ge,wordSpacing:fe,textAlign:ve,textAppearance:pe}:{fontFamily:Le,fontSettings:Ce,fontSize:we,lineHeight:Te,letterSpacing:Ne,wordSpacing:Ae,textAlign:ze,textAppearance:Be}),K=ft({fontFamily:Re,fontSettings:Oe,fontSize:He,lineHeight:Fe,letterSpacing:Ie,wordSpacing:je,textAlign:Me,textAppearance:_e},So),bo=vt(a,So,t),yo=vt(a,K,t),qe=lt(V,dt(So)),Ke=lt(G,dt(K)),Ze={...yo.css,whiteSpace:"pre-wrap",transform:st(Ke)},Je=yo.className,z=i=>T.scalingValue(i,t),Qe=Ue??Eo,Pe=Math.max(Ko,W),on=Math.max(Zo,W),tn=Math.max(0,1-xo),en=Math.max(0,1-xo),ro=n??!1,io=ro&&!u,Jo=s.useMemo(()=>yt({textPaddingLeft:Vo,textPaddingRight:Go,textPaddingTop:Do,textPaddingBottom:Uo,fontSize:K.fontSize}),[Vo,Go,Do,Uo,K.fontSize]),Qo=i=>{const d=l.jsx("span",{className:Je,style:Ze,children:pt(i)});return mt(a,d,Wo,ro,z)},nn=mo==="left"||mo==="right"?{width:`${_o}%`}:{height:`${_o}%`},an={...qn(Jo,t),...nn,alignItems:Pn[We],justifyContent:Qn[Ee]},Z=s.useRef(o),co=s.useRef(g),Lo=s.useRef(null);Ro((at=o.logo)==null?void 0:at.icon)&&(Lo.current=o.logo.icon),s.useEffect(()=>{var fo;if(!N||!t){Z.current=o,co.current=g;return}const i=(fo=o.logo)==null?void 0:fo.icon;if(o.logo&&!Ro(i)&&!Lo.current){Z.current=o,co.current=g;return}const d=vo=>{N(ta(vo,Lo.current))};if(co.current!==g){Z.current=o,co.current=g;const vo=ut(o);vo!==o&&d(vo);return}const $=ut(o),S=Z.current,b=S!==o,w=b?Ct($,S):$;Z.current=o;const _=$!==o,P=b&&Xn($,w);!_&&!P||d(w)},[o,N,t,g]);const M=T.scalingValue(xo,t),rn={width:M,height:M,minWidth:M,minHeight:M,maxWidth:M,maxHeight:M},cn={...bo.css,textDecoration:"none",transform:st(qe)},ln=bo.className,Po=(j==null?void 0:j.mode)!=="Off",J=(j==null?void 0:j.icon)??"",sn=aa(J),Q=ra(J,sn),lo=!!Q,dn=z(Math.min(Ve,ao)),Co=!!(Po&&J&&no==="right")?"left":"right",ot=Array.isArray(Yo)?Yo:[],wo=[C!=="default"?`${a}-state-${C}`:"",u||H==="open"?`${a}-state-open`:"",eo&&eo!==C&&eo!==H?`${a}-state-${eo}`:""].filter(Boolean).join(" "),gn=t&&!e?`${a}-editor`:"",tt=Bt?`${a}-interactive`:"",fn=Io&&(C!==Ho||$o)?`${a}-nav-state-anim`:"",vn=u?`${a}-open`:"",pn=s.useMemo(()=>ga(A.current),[I,u,g]),To=()=>{Y(!1)},No=!t||e,hn=i=>{if(q){U.current=i;return}i()};s.useEffect(()=>{if(u)return;const i=U.current;U.current=null,i==null||i()},[u]);const et=(i,d)=>{la(i,To,{isEditor:t,isPreviewMode:e,item:d,pages:m,onLinkNavigate:L,runAfterClose:hn})},un=()=>{t&&!e||Y(i=>!i)},$n=i=>{i.pointerType==="touch"&&i.currentTarget.blur()},so=()=>{v.current!==null&&(window.clearTimeout(v.current),v.current=null)};s.useEffect(()=>{if(!$o)return;const i=window.setTimeout(()=>{Fo(!1)},h);return()=>window.clearTimeout(i)},[$o,C]),s.useEffect(()=>{if(u){so(),po(!0);return}return B.current+=1,to(!1),so(),v.current=window.setTimeout(()=>{v.current=null,po(!1)},y),so},[u]),s.useLayoutEffect(()=>{X.current!==g&&(X.current=g,B.current+=1,so(),Y(!1),to(!1),po(!1))},[g]),s.useLayoutEffect(()=>{var $;if(!I||!u)return;const i=B.current+1;B.current=i,to(!1),($=E.current)==null||$.offsetHeight;const d=requestAnimationFrame(()=>{B.current===i&&to(!0)});return()=>{cancelAnimationFrame(d)}},[I,u]),s.useLayoutEffect(()=>{if(!q||!I)return;const i=D.current;if(!i)return;const d=getComputedStyle(i).backgroundColor;if(!d)return;const $=document.documentElement,{body:S}=document,b=$.style.backgroundColor,w=S.style.backgroundColor;return $.style.backgroundColor=d,S.style.backgroundColor=d,()=>{$.style.backgroundColor=b,S.style.backgroundColor=w}},[q,I,wo,Mo,Xo]),s.useEffect(()=>{x==null||x(u)},[u,x]),s.useEffect(()=>{if(!u)return;const i=d=>{d.key==="Escape"&&(t&&e||To())};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[u,t,e]),s.useEffect(()=>{t&&!e&&H!=="open"&&Y(!1)},[t,e,H]),s.useEffect(()=>{e&&Y(!1)},[e]);const nt=ro&&u,mn=i=>ot.filter(d=>In(d,g)).map((d,$)=>{const{label:S,href:b,target:w}=Bo(d,m),_=b?l.jsx("a",{href:b,target:w,rel:w==="_blank"?"noopener noreferrer":void 0,className:`${i} ${a}-has-href`,onClick:P=>et(P,d),children:Qo(S)}):l.jsx("span",{className:i,children:Qo(S)});return l.jsxs(s.Fragment,{children:[$>0&&l.jsx("div",{"data-controls":nt?"gap":void 0,"data-controls-axis":"y",className:nt?`${a}-gap-control`:void 0,style:{height:z(Eo)}}),_]},$)}),xn=I?l.jsxs("div",{ref:E,"data-selection":"none",className:[`${a}-lightbox`,`${a}-full-lightbox ${a}-effect-${mo}`,Oo?`${a}-lightbox-active`:"",`${a}-lightbox-editor`,n?`${a}-lightbox-edit-mode`:"",tt,wo].filter(Boolean).join(" "),style:{...ko,...pn},"aria-hidden":!Oo,children:[l.jsx("div",{className:[`${a}-backdrop`,No?`${a}-backdrop-clickable`:""].filter(Boolean).join(" "),"aria-hidden":"true",onClick:No?To:void 0}),l.jsxs("nav",{className:[`${a}-panel`,No?`${a}-panel-blocking`:""].filter(Boolean).join(" "),style:an,"aria-label":"Menu","data-lightbox-scrollable":"",children:[ro&&Kn(a,Jo,K.fontSize,z),mn(`${a}-link`)]}),q?l.jsx("div",{ref:D,className:`${a}-safari-tint`,"aria-hidden":"true"}):null]}):null,kn=()=>l.jsx("button",{type:"button",className:`${a}-toggle`,onClick:un,onPointerUp:$n,"aria-expanded":u,"aria-label":u?"Close menu":"Open menu",children:l.jsx(_n,{className:`${a}-icon`,lineClassName:`${a}-icon-line`})}),go=i=>{const d=i==="left",$=d?Ko:Zo,S=d?Pe:on,b=d?tn:en,w=k?d?"compactNavPaddingLeft":"compactNavPaddingRight":d?"navPaddingLeft":"navPaddingRight";return l.jsx("div",{className:d?`${a}-nav-padding-left`:`${a}-nav-padding-right`,style:{width:z($),flexShrink:0},children:io?l.jsx("div",{"data-controls":w,"data-controls-axis":"x","data-controls-variant":"column-padding",...d?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(b),className:`${a}-control-anchor`,style:{top:0,[d?"left":"right"]:0,width:z(S),height:"100%"}}):null})},Sn=(i,d)=>{const{label:$,href:S,target:b}=Bo(i,m),w=l.jsx("span",{className:ln,style:cn,children:pt($)}),_=mt(a,w,Xe,io,z),P=S?l.jsx("a",{href:S,target:b,rel:b==="_blank"?"noopener noreferrer":void 0,className:`${a}-nav-link ${a}-has-href`,onClick:fo=>et(fo,i),children:_}):l.jsx("span",{className:`${a}-nav-link`,children:_});return l.jsxs(s.Fragment,{children:[d>0&&l.jsx("div",{"data-controls":io?k?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:io?`${a}-gap-control ${a}-nav-gap-control`:`${a}-nav-gap-control}`,style:{width:z(Qe),flexShrink:0}}),P]},d)},bn={...ko,height:T.scalingValue(ao,t),minHeight:T.scalingValue(ao,t),[`--${a}-panel-height`]:T.scalingValue(ao,t)},yn=f&&C==="default"&&H!=="open"&&!e?z(jo+Tn):"0px";return l.jsxs("div",{ref:A,className:`${a}-root ${wo} ${gn} ${tt} ${fn}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:yn,...ko},children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Tt}}),l.jsx("span",{ref:V,"aria-hidden":!0,style:gt(bo.css),children:"H"}),l.jsx("span",{ref:G,"aria-hidden":!0,style:gt(yo.css),children:"H"}),l.jsx("div",{className:`${a}-nav-slide`,children:l.jsxs("div",{className:`${a}-nav-bar`,style:bn,children:[Po&&J?l.jsxs("div",{className:`${a}-nav-logo ${a}-nav-logo-${no}`,children:[no==="left"?go("left"):null,l.jsxs("div",{className:`${a}-nav-logo-inner${lo?` ${a}-nav-logo-tinted`:""}`,style:{height:dn,...lo&&Q?{[`--${a}-logo-image`]:ea(Q)}:{}},children:[l.jsx("img",{src:lo&&Q?Q:J,alt:"",className:`${a}-nav-logo-img`}),lo?l.jsx("span",{className:`${a}-nav-logo-tint`,"aria-hidden":"true"}):null]}),no==="right"?go("right"):null]}):null,l.jsx("nav",{className:`${a}-nav-links ${a}-nav-links-${qo}`,style:{transform:On(qo,De,t)},"aria-label":"Navigation",children:l.jsx("div",{className:`${a}-nav-links-inner`,children:ot.filter(i=>Fn(i,C,g)).map((i,d)=>Sn(i,d))})})]})}),xn,l.jsxs("div",{className:`${a}-nav-toggle-wrap ${a}-nav-toggle-wrap-${Co}`,children:[Co==="left"?go("left"):null,Ye?l.jsx("div",{className:`${a}-root ${vn}`.trim(),style:rn,children:kn()}):null,Co==="right"?go("right"):null]})]})}exports.Burger=fa;exports.applyBurgerSettingsChange=Ct;