webim-adapter 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,5 +10,5 @@ Error generating stack: `+e.message+`
10
10
  `)}var ee=[{key:`tablet`,max:991},{key:`mobileLandscape`,max:767},{key:`mobile`,max:478}],S=e=>Object.entries(m(e)).map(([e,t])=>`${y(e)}: ${t} !important;`).join(` `);function C(e,t){return ee.map(({key:n,max:r})=>{let i=t?.[n]?S(t[n]):``;return i?`@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }`:``}).filter(Boolean).join(`
11
11
  `)}function te(e,t){let n=[],r=e=>{for(let[t,r]of Object.entries(e||{})){let e=C(t,r.props);e&&n.push(e)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return n.join(`
12
12
  `)}function ne(e,t){let n=[],r=e=>{for(let[t,r]of Object.entries(e||{})){let e=x(t,r.props);e&&n.push(e)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return n.join(`
13
- `)}var re=`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,w={light:{background:`#ffffff`,text:`#111827`,accent:`#111827`,accentText:`#ffffff`,primary:{light:`#4b5563`,main:`#111827`,dark:`#030712`,contrastText:`#ffffff`},secondary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`}},dark:{background:`#0f172a`,text:`#e2e8f0`,accent:`#6366f1`,accentText:`#ffffff`,primary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`},secondary:{light:`#5eead4`,main:`#14b8a6`,dark:`#0f766e`,contrastText:`#052e2b`}}},ie={font:`system`,headingFont:`inherit`,light:w.light,dark:w.dark},ae={system:{label:`System`,value:re},inter:{label:`Inter`,value:`"Inter", ${re}`},outfit:{label:`Outfit`,value:`"Outfit", ${re}`},serif:{label:`Serif`,value:`Georgia, "Times New Roman", serif`},mono:{label:`Mono`,value:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`}},oe=(e,t)=>ae[e]?.value??t,se=(e,...t)=>{let n=Object.assign({},e,...t);return n.primary={...e.primary,...t.reduce((e,t)=>({...e,...t?.primary}),{})},n.secondary={...e.secondary,...t.reduce((e,t)=>({...e,...t?.secondary}),{})},n};function ce(e){let{light:t,dark:n,font:r,headingFont:i,...a}=e??{};return{font:r??ie.font,headingFont:i??ie.headingFont,light:se(w.light,a,t),dark:se(w.dark,n)}}function le(e){return{"--page-bg":e.background,"--page-text":e.text,"--page-accent":e.accent,"--page-accent-text":e.accentText,"--page-primary-light":e.primary.light,"--page-primary":e.primary.main,"--page-primary-dark":e.primary.dark,"--page-primary-contrast":e.primary.contrastText,"--page-secondary-light":e.secondary.light,"--page-secondary":e.secondary.main,"--page-secondary-dark":e.secondary.dark,"--page-secondary-contrast":e.secondary.contrastText}}function ue(e){let t=ce(e);return{backgroundColor:`var(--page-bg)`,color:`var(--page-text)`,fontFamily:oe(t.font,re),"--page-heading-font":t.headingFont===`inherit`?`inherit`:oe(t.headingFont,`inherit`)}}function T(e,t=`light`){let n=ce(e);return{...ue(e),...le(n[t]??n.light)}}function E(e,t){return e?.themeRef&&t?.[e.themeRef]||e?.theme}function de({page:e,settings:t,tenant:n,apiUrl:r,locale:i}){let a={...t?.global??{},...t?.tenant??{}},o=e.meta??{};return{schema:1,title:e.title,slug:e.slug,blocks:i&&o.i18n?.[i]?.blocks||e.blocks,theme:E(o,a.builder_themes?.themes),components:a.builder_components?.components??{},custom:o.custom,seo:o.seo,locales:a.locales,tenant:n??``,apiUrl:r??``}}var fe=async e=>{let t=await e.json().catch(()=>null);if(!e.ok||t?.success===!1)throw Error(t?.error?.message||`Request failed (${e.status})`);return t?.payload??t};async function pe({apiUrl:e,tenant:t,slug:n,locale:r,preview:i,fetch:a}){if(!e)throw Error(`fetchPage: apiUrl is required`);if(!n)throw Error(`fetchPage: slug is required`);let o=a??fetch,s=e.replace(/\/$/,``),c=t?{"x-tenant":t}:{},[l,u]=await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i?`?preview=${encodeURIComponent(i)}`:``}`,{headers:c}).then(fe),o(`${s}/settings/public`,{headers:c}).then(fe)]);return de({page:l,settings:u,tenant:t,apiUrl:s,locale:r})}new Map([{family:`Bebas Neue`,fallback:`sans-serif`},{family:`Crimson Text`,fallback:`serif`},{family:`DM Sans`,fallback:`sans-serif`},{family:`Fira Sans`,fallback:`sans-serif`},{family:`Inter`,fallback:`sans-serif`},{family:`JetBrains Mono`,fallback:`monospace`},{family:`Josefin Sans`,fallback:`sans-serif`},{family:`Karla`,fallback:`sans-serif`},{family:`Lato`,fallback:`sans-serif`},{family:`Lora`,fallback:`serif`},{family:`Manrope`,fallback:`sans-serif`},{family:`Merriweather`,fallback:`serif`},{family:`Montserrat`,fallback:`sans-serif`},{family:`Nunito`,fallback:`sans-serif`},{family:`Open Sans`,fallback:`sans-serif`},{family:`Oswald`,fallback:`sans-serif`},{family:`Outfit`,fallback:`sans-serif`},{family:`Playfair Display`,fallback:`serif`},{family:`Poppins`,fallback:`sans-serif`},{family:`Quicksand`,fallback:`sans-serif`},{family:`Raleway`,fallback:`sans-serif`},{family:`Roboto`,fallback:`sans-serif`},{family:`Rubik`,fallback:`sans-serif`},{family:`Source Sans 3`,fallback:`sans-serif`},{family:`Space Grotesk`,fallback:`sans-serif`},{family:`Work Sans`,fallback:`sans-serif`}].map(e=>[e.family,e]));function me(e){return e.length?`https://fonts.googleapis.com/css2?${e.map(e=>`family=${e.replace(/ /g,`+`)}:wght@100..900`).join(`&`)}&display=swap`:null}var D=e=>me([e]),O=e=>{let t=typeof e==`string`&&e.match(/^"([^"]+)"/);return t?t[1]:null};function he(e,t){let n=new Set,r=e=>{for(let t of Object.values(e||{}))for(let e of[`style`,`hover`,`pressed`,`focused`]){let r=O(t.props?.[e]?.fontFamily);r&&n.add(r)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return[...n].sort()}var ge=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),k=e(((e,t)=>{t.exports=ge()}))(),_e=(0,l.createContext)({tenant:``,apiUrl:`/api`}),ve={margin:0,fontWeight:700,lineHeight:1.2,fontFamily:`var(--page-heading-font, inherit)`},ye={margin:0},be={display:`inline-block`,textDecoration:`none`,cursor:`pointer`,backgroundColor:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`},xe={flexGrow:1,display:`flex`,flexDirection:`column`,position:`relative`},Se={display:`flex`,flexDirection:`column`};function Ce({style:e}){let t=e?.backgroundVideo;if(!t)return null;let n={position:`absolute`,inset:0,width:`100%`,height:`100%`,zIndex:-1,pointerEvents:`none`},r=e?.overlayColor?`color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity??50}%, transparent)`:null;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`video`,{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{...n,objectFit:`cover`}}),r&&(0,k.jsx)(`div`,{style:{...n,background:r}})]})}var we=(e,t)=>e?.backgroundVideo?{position:`relative`,...t,...m(e)}:{...t,...m(e)};function Te({style:e,nodeRef:t,children:n}){return(0,k.jsxs)(`div`,{ref:t,style:{...xe,...m(e)},children:[(0,k.jsx)(Ce,{style:e}),n]})}function Ee({style:e,nodeRef:t,children:n}){return(0,k.jsxs)(`section`,{ref:t,style:we(e,Se),children:[(0,k.jsx)(Ce,{style:e}),n]})}function De({style:e,freeLayout:t,nodeRef:n,children:r}){let i=t?{position:`relative`,minHeight:240}:null;return(0,k.jsxs)(`div`,{ref:n,style:i?{...i,...we(e)}:we(e),children:[(0,k.jsx)(Ce,{style:e}),r]})}function Oe({text:e,parts:t,tag:n=`h2`,style:r,linked:i,nodeRef:a}){return(0,k.jsx)(n,{ref:a,style:{...ve,...m(r)},children:je(t,e,i)})}var ke={fontFamily:ae.mono.value,background:`rgba(148, 163, 184, 0.18)`,padding:`1px 5px`,borderRadius:4,fontSize:`0.9em`};function Ae(e,t=[],n){let r=e;return t.includes(`sup`)?r=(0,k.jsx)(`sup`,{children:r}):t.includes(`sub`)&&(r=(0,k.jsx)(`sub`,{children:r})),t.includes(`code`)&&(r=(0,k.jsx)(`code`,{style:ke,children:r})),t.includes(`strike`)&&(r=(0,k.jsx)(`s`,{children:r})),t.includes(`underline`)&&(r=(0,k.jsx)(`u`,{children:r})),t.includes(`italic`)&&(r=(0,k.jsx)(`em`,{children:r})),t.includes(`bold`)&&(r=(0,k.jsx)(`strong`,{children:r})),n&&(r=(0,k.jsx)(`a`,{href:n,style:{color:`inherit`},children:r})),r}function je(e,t,n){return e?.length?e.map((e,t)=>{if(e.slot)return(0,k.jsx)(l.Fragment,{children:n?.[e.slot]??null},t);if(e.parts)return(0,k.jsx)(l.Fragment,{children:je(e.parts,``,n)},t);let r=e.text;return e.sup?r=(0,k.jsx)(`sup`,{children:r}):e.sub&&(r=(0,k.jsx)(`sub`,{children:r})),e.code&&(r=(0,k.jsx)(`code`,{style:ke,children:r})),e.strike&&(r=(0,k.jsx)(`s`,{children:r})),e.underline&&(r=(0,k.jsx)(`u`,{children:r})),e.italic&&(r=(0,k.jsx)(`em`,{children:r})),e.bold&&(r=(0,k.jsx)(`strong`,{children:r})),e.href&&(r=(0,k.jsx)(`a`,{href:e.href,style:{color:`inherit`},children:r})),(0,k.jsx)(l.Fragment,{children:r},t)}):t}function Me({parts:e,text:t,marks:n,href:r,style:i}){return(0,k.jsx)(`span`,{style:m(i),children:e?.length?je(e,t):Ae(t,n,r)})}var Ne={h1:40,h2:32,h3:26,h4:22,h5:19,h6:16};function Pe({align:e=`center`,width:t}={}){let n=t?`${t}%`:void 0;return e===`full`?{width:`100%`}:e===`left`?{float:`left`,width:n??`50%`,marginTop:4,marginRight:20,marginBottom:12,marginLeft:0}:e===`right`?{float:`right`,width:n??`50%`,marginTop:4,marginLeft:20,marginBottom:12,marginRight:0}:{width:n??`fit-content`,maxWidth:`100%`,marginLeft:`auto`,marginRight:`auto`}}function Fe(e=[],t,n){let r=n??((e,n)=>je(e,n,t));return e.map((t,n)=>{let i={marginTop:0,marginBottom:n===e.length-1?0:14};if(t.type===`image`){if(!t.src)return null;let e=(0,k.jsx)(`img`,{src:t.src,alt:t.alt||``,style:{width:`100%`,display:`block`,borderRadius:6}});return(0,k.jsxs)(`figure`,{style:{marginLeft:0,marginRight:0,...i,...Pe(t)},children:[t.href?(0,k.jsx)(`a`,{href:t.href,style:{display:`block`},children:e}):e,t.caption&&(0,k.jsx)(`figcaption`,{style:{fontSize:13,opacity:.65,marginTop:6,textAlign:`center`},children:t.caption})]},n)}if(t.type===`video`)return Ke(t.url)?(0,k.jsx)(`div`,{style:{...i,...Pe({align:t.align,width:t.width??100})},children:(0,k.jsx)(qe,{url:t.url,autoplay:t.autoplay,muted:t.muted,loop:t.loop,controls:t.controls??!0,start:t.start})},n):null;if(t.type===`divider`)return(0,k.jsx)(`hr`,{style:{...i,border:0,borderTop:`1px solid rgba(148, 163, 184, 0.4)`}},n);if(t.type===`ul`||t.type===`ol`){let e=t.type;return(0,k.jsx)(e,{style:{...i,paddingLeft:24},children:(t.items??[]).map((e,t)=>(0,k.jsx)(`li`,{style:{marginBottom:4},children:r(e.parts,e.text)},t))},n)}if(t.type===`quote`)return(0,k.jsx)(`blockquote`,{style:{...Le,...i},children:r(t.parts,t.text)},n);if(Ne[t.type]){let e=t.type;return(0,k.jsx)(e,{style:{...ve,fontSize:Ne[t.type],...i},children:r(t.parts,t.text)},n)}return(0,k.jsx)(`p`,{style:{...ye,...i},children:r(t.parts,t.text)},n)})}function Ie({content:e,style:t,linked:n,nodeRef:r}){return(0,k.jsx)(`div`,{ref:r,style:{display:`flow-root`,...m(t)},children:Fe(e,n)})}var Le={margin:0,padding:`8px 0 8px 20px`,borderLeft:`4px solid var(--page-accent, rgba(148, 163, 184, 0.6))`};function Re({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,k.jsx)(`blockquote`,{ref:i,style:{...Le,...m(n)},children:je(t,e,r)})}function ze({ordered:e,items:t=[],style:n,nodeRef:r}){return(0,k.jsx)(e?`ol`:`ul`,{ref:r,style:{margin:0,paddingLeft:24,...m(n)},children:t.map((e,t)=>(0,k.jsx)(`li`,{style:{marginBottom:4},children:je(e.parts,e.text)},t))})}function Be({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,k.jsx)(`p`,{ref:i,style:{...ye,...m(n)},children:je(t,e,r)})}var Ve={color:`var(--page-accent, inherit)`,textDecoration:`underline`,textUnderlineOffset:3,cursor:`pointer`};function He({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,k.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...Ve,...m(i)},children:je(t,e,a)})}function Ue({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,k.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...be,...m(i)},children:je(t,e,a)})}function We({src:e,alt:t,style:n,nodeRef:r}){return e?(0,k.jsx)(`img`,{ref:r,src:e,alt:t||``,style:{display:`block`,maxWidth:`100%`,...m(n)}}):null}function Ge({src:e,poster:t,controls:n=!0,autoplay:r=!1,loop:i=!1,muted:a=!1,style:o,nodeRef:s}){return e?(0,k.jsx)(`video`,{ref:s,src:e,poster:t||void 0,controls:n,autoPlay:r,muted:a||r,loop:i,playsInline:!0,style:{display:`block`,width:`100%`,maxWidth:`100%`,...m(o)}}):null}var Ke=(e=``)=>(e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/)||e.match(/^([\w-]{11})$/))?.[1];function qe({url:e,autoplay:t=!1,muted:n=!1,loop:r=!1,controls:i=!0,start:a,style:o,nodeRef:s}){let c=Ke(e);if(!c)return null;let l=new URLSearchParams({rel:`0`});return t&&l.set(`autoplay`,`1`),(n||t)&&l.set(`mute`,`1`),i||l.set(`controls`,`0`),r&&(l.set(`loop`,`1`),l.set(`playlist`,c)),Number(a)>0&&l.set(`start`,String(Math.floor(Number(a)))),(0,k.jsx)(`div`,{ref:s,style:{position:`relative`,width:`100%`,paddingTop:`56.25%`,...m(o)},children:(0,k.jsx)(`iframe`,{src:`https://www.youtube-nocookie.com/embed/${c}?${l}`,title:`YouTube video`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,allowFullScreen:!0,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,border:0}})})}function Je({src:e,title:t,allowFullscreen:n=!0,style:r,nodeRef:i}){return e?(0,k.jsx)(`iframe`,{ref:i,src:e,title:t||`Embedded frame`,loading:`lazy`,allowFullScreen:n,style:{display:`block`,width:`100%`,height:300,border:0,...m(r)}}):null}function Ye({code:e,runScripts:t=!0,style:n,nodeRef:r}){let[i,a]=(0,l.useState)(null);return(0,l.useEffect)(()=>{i&&(i.innerHTML=e||``,t&&i.querySelectorAll(`script`).forEach(e=>{let t=document.createElement(`script`);for(let{name:n,value:r}of e.attributes)t.setAttribute(n,r);t.text=e.textContent,e.replaceWith(t)}))},[i,e,t]),(0,k.jsx)(`div`,{ref:e=>{a(e),r&&r(e)},style:m(n)})}function Xe({height:e,nodeRef:t}){return(0,k.jsx)(`div`,{ref:t,style:{height:e||32,flexShrink:0,alignSelf:`stretch`}})}function Ze({style:e,nodeRef:t}){return(0,k.jsx)(`div`,{ref:t,style:{height:1,alignSelf:`stretch`,flexShrink:0,...m(e)}})}var Qe={position:`absolute`,top:`50%`,transform:`translateY(-50%)`,width:36,height:36,borderRadius:`50%`,border:0,cursor:`pointer`,background:`rgba(17, 24, 39, 0.45)`,color:`#fff`,fontSize:20,lineHeight:1,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:0},$e={bottom:{inset:`auto 0 0 0`,padding:`40px 24px 20px`,background:`linear-gradient(transparent, rgba(0, 0, 0, 0.55))`},top:{inset:`0 0 auto 0`,padding:`20px 24px 40px`,background:`linear-gradient(rgba(0, 0, 0, 0.55), transparent)`},middle:{inset:0,display:`flex`,flexDirection:`column`,justifyContent:`center`,padding:24,textShadow:`0 2px 12px rgba(0, 0, 0, 0.6)`}},et=48;function tt({count:e,renderSlide:t,autoplay:n=!0,interval:r=5,height:i=320,swipe:a=!0,style:o,nodeRef:s}){let[c,u]=(0,l.useState)(0),[d,f]=(0,l.useState)(!1),[p,h]=(0,l.useState)(null),g=e?Math.min(c,e-1):0;if((0,l.useEffect)(()=>{if(!n||d||p||e<2)return;let t=setInterval(()=>u(t=>(t+1)%e),Math.max(2,Number(r)||5)*1e3);return()=>clearInterval(t)},[n,d,p,r,e]),!e)return null;let _=t=>u((t+e)%e),v=()=>{if(!p)return;let{dx:e}=p;h(null),e<-48?_(g+1):e>et&&_(g-1)};return(0,k.jsxs)(`div`,{ref:s,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onPointerDown:a&&e>1?e=>{e.pointerType===`mouse`&&e.button!==0||e.target.closest(`button`)||(e.currentTarget.setPointerCapture(e.pointerId),h({startX:e.clientX,dx:0}))}:void 0,onPointerMove:p?e=>h(t=>t&&{...t,dx:e.clientX-t.startX}):void 0,onPointerUp:v,onPointerCancel:v,style:{position:`relative`,overflow:`hidden`,width:`100%`,touchAction:`pan-y`,userSelect:p?`none`:void 0,cursor:p?`grabbing`:void 0,...m(o)},children:[(0,k.jsx)(`div`,{style:{display:`flex`,height:i,transform:`translateX(calc(${-g*100}% + ${p?.dx??0}px))`,transition:p?`none`:`transform 450ms ease`},children:Array.from({length:e},(e,n)=>(0,k.jsx)(`div`,{style:{position:`relative`,width:`100%`,flexShrink:0,overflow:`hidden`},children:t(n)},n))}),e>1&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`button`,{type:`button`,"aria-label":`Previous slide`,style:{...Qe,left:12},onClick:()=>_(g-1),children:`‹`}),(0,k.jsx)(`button`,{type:`button`,"aria-label":`Next slide`,style:{...Qe,right:12},onClick:()=>_(g+1),children:`›`}),(0,k.jsx)(`div`,{style:{position:`absolute`,bottom:10,left:0,right:0,display:`flex`,justifyContent:`center`,gap:6},children:Array.from({length:e},(e,t)=>(0,k.jsx)(`button`,{type:`button`,"aria-label":`Go to slide ${t+1}`,onClick:()=>_(t),style:{width:8,height:8,borderRadius:`50%`,border:0,padding:0,cursor:`pointer`,background:t===g?`#ffffff`:`rgba(255, 255, 255, 0.45)`}},t))})]})]})}var nt=(e,t)=>({position:`absolute`,inset:0,backgroundImage:e?`url(${e})`:`none`,backgroundColor:t||(e?void 0:`rgba(148, 163, 184, 0.25)`),backgroundSize:`cover`,backgroundPosition:`center`});function rt({slides:e=[],captionPosition:t=`bottom`,captionAlign:n=`left`,...r}){return e.length?(0,k.jsx)(tt,{...r,count:e.length,renderSlide:r=>{let i=e[r];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{style:nt(i.image)}),(i.title||i.text)&&(0,k.jsxs)(`div`,{style:{position:`absolute`,color:`#fff`,textAlign:n,...$e[t]??$e.bottom},children:[i.title&&(0,k.jsx)(`div`,{style:{fontSize:22,fontWeight:700},children:i.title}),i.text&&(0,k.jsx)(`div`,{style:{fontSize:14,opacity:.9,marginTop:4},children:i.text})]})]})}}):null}function it({slides:e=[],linked:t,...n}){return e.length?(0,k.jsx)(tt,{...n,count:e.length,renderSlide:n=>{let r=e[n];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{style:nt(r.image,r.color)}),(0,k.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`},children:t?.[r.key]??null})]})}}):null}var at={color:`inherit`,textDecoration:`none`,fontSize:14,opacity:.85},ot={background:`var(--page-bg, #ffffff)`,color:`var(--page-text, #111827)`,border:`1px solid rgba(148, 163, 184, 0.25)`,boxShadow:`0 16px 40px rgba(15, 23, 42, 0.16)`,zIndex:60};function st({brand:e,logo:t,links:n=[],style:r,nodeRef:i,menu:a=`auto`,breakpoint:o=768}){let[s,c]=(0,l.useState)(null),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(!1),[h,g]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!s)return;let e=new ResizeObserver(()=>d(s.offsetWidth<o));return e.observe(s),()=>e.disconnect()},[s,o]);let _=a===`hamburger`||a===`auto`&&u,v=(e,t)=>(0,k.jsxs)(`a`,{href:e.href||`#`,style:{...at,display:`block`,...t},children:[e.label,e.desc&&(0,k.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6,marginTop:2},children:e.desc})]},e.key);return(0,k.jsxs)(`nav`,{ref:e=>{c(e),i&&i(e)},style:{display:`flex`,alignItems:`center`,gap:24,flexWrap:`wrap`,padding:`14px 24px`,width:`100%`,position:`relative`,...m(r)},children:[t&&(0,k.jsx)(`img`,{src:t,alt:e||`Logo`,style:{height:28,display:`block`}}),e&&(0,k.jsx)(`div`,{style:{fontWeight:700,fontSize:18,fontFamily:`var(--page-heading-font, inherit)`},children:e}),(0,k.jsx)(`div`,{style:{flexGrow:1}}),_?(0,k.jsx)(`button`,{type:`button`,"aria-label":f?`Close menu`:`Open menu`,onClick:()=>p(!f),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:4},children:f?`✕`:`☰`}):(0,k.jsx)(`div`,{style:{display:`flex`,gap:20,alignItems:`center`,flexWrap:`wrap`},children:n.map(e=>{let t=e.children??[];if(!t.length)return(0,k.jsx)(`a`,{href:e.href||`#`,style:at,children:e.label},e.key);let n=e.type===`mega`;return(0,k.jsxs)(`span`,{style:{position:n?`static`:`relative`,display:`inline-flex`},onMouseEnter:()=>g(e.key),onMouseLeave:()=>g(null),children:[(0,k.jsxs)(`a`,{href:e.href||`#`,style:{...at,cursor:`pointer`},children:[e.label,` `,(0,k.jsx)(`span`,{style:{fontSize:9,opacity:.6},children:`▼`})]}),h===e.key&&(n?(0,k.jsx)(`div`,{style:{...ot,position:`absolute`,left:0,right:0,top:`100%`,padding:24,display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(170px, 1fr))`,gap:16},children:t.map(e=>v(e,{padding:`6px 8px`,borderRadius:6}))}):(0,k.jsx)(`div`,{style:{...ot,position:`absolute`,top:`100%`,left:0,minWidth:190,borderRadius:8,padding:8,display:`flex`,flexDirection:`column`},children:t.map(e=>v(e,{padding:`8px 12px`,borderRadius:6}))}))]},e.key)})}),_&&f&&(0,k.jsx)(`div`,{style:{flexBasis:`100%`,width:`100%`,display:`flex`,flexDirection:`column`,paddingTop:10},children:n.map(e=>(0,k.jsxs)(l.Fragment,{children:[(0,k.jsx)(`a`,{href:e.href||`#`,style:{...at,padding:`10px 4px`,fontWeight:(e.children??[]).length?600:400,opacity:1},children:e.label}),(e.children??[]).map(e=>v(e,{padding:`8px 4px 8px 22px`}))]},e.key))})]})}function ct({tabs:e=[],linked:t,style:n,nodeRef:r}){let[i,a]=(0,l.useState)(0),o=e.length?Math.min(i,e.length-1):0;return e.length?(0,k.jsxs)(`div`,{ref:r,style:{width:`100%`,...m(n)},children:[(0,k.jsx)(`div`,{style:{display:`flex`,gap:4,borderBottom:`1px solid rgba(148, 163, 184, 0.35)`},children:e.map((e,t)=>(0,k.jsx)(`button`,{type:`button`,onClick:()=>a(t),style:{background:`transparent`,border:0,padding:`10px 16px`,fontSize:14,fontFamily:`inherit`,color:`inherit`,cursor:`pointer`,opacity:t===o?1:.6,fontWeight:t===o?600:500,boxShadow:t===o?`inset 0 -2px 0 var(--page-accent, #111827)`:`none`},children:e.label||`Tab ${t+1}`},e.key))}),e.map((e,n)=>(0,k.jsx)(`div`,{style:{display:n===o?`flex`:`none`,flexDirection:`column`},children:t?.[e.key]??null},e.key))]}):null}function lt({items:e=[],linked:t,multiple:n=!1,style:r,nodeRef:i}){let[a,o]=(0,l.useState)(()=>new Set(e.length?[e[0].key]:[]));if(!e.length)return null;let s=e=>o(t=>{let r=new Set(n?t:[]);return t.has(e)?r.delete(e):r.add(e),r});return(0,k.jsx)(`div`,{ref:i,style:{width:`100%`,...m(r)},children:e.map((n,r)=>{let i=a.has(n.key);return(0,k.jsxs)(`div`,{style:{borderBottom:r<e.length-1?`1px solid rgba(148, 163, 184, 0.35)`:`none`},children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>s(n.key),style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,background:`transparent`,border:0,padding:`14px 4px`,fontSize:15,fontWeight:600,fontFamily:`inherit`,color:`inherit`,textAlign:`left`,cursor:`pointer`},children:[n.title||`Item ${r+1}`,(0,k.jsx)(`span`,{"aria-hidden":!0,style:{fontSize:12,opacity:.6,transform:i?`rotate(180deg)`:`none`,transition:`transform 180ms`},children:`▼`})]}),(0,k.jsx)(`div`,{style:{display:i?`flex`:`none`,flexDirection:`column`},children:t?.[n.key]??null})]},n.key)})})}var ut={display:`flex`,flexDirection:`column`,gap:`12px`},dt={fontSize:`14px`,fontWeight:500,color:`var(--page-text, #111827)`},ft={padding:`10px 12px`,border:`1px solid #d1d5db`,borderRadius:`6px`,fontSize:`14px`,fontFamily:`inherit`,width:`100%`,boxSizing:`border-box`,backgroundColor:`#ffffff`,color:`#111827`},pt={display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`14px`,color:`var(--page-text, #111827)`},mt=e=>e?{readOnly:!0,tabIndex:-1,onMouseDown:e=>e.preventDefault()}:{};function ht({style:e,action:t,method:n,name:r,enctype:i,formSlug:a,nodeRef:o,inert:s,children:c,linked:u,show:d}){let{tenant:f,apiUrl:p}=(0,l.useContext)(_e),[h,g]=(0,l.useState)(`form`),_=s?d||`form`:h;return(0,k.jsxs)(`div`,{ref:o,style:m(e),children:[(0,k.jsx)(`form`,{action:t||void 0,method:n||`post`,name:r||void 0,encType:i||void 0,onSubmit:async e=>{if(e.preventDefault(),!s){if(a){let t={};for(let[n,r]of new FormData(e.currentTarget).entries())typeof r==`string`&&(t[n]=r===`on`||r);try{let e=await fetch(`${p||`/api`}/forms/${a}/submit`,{method:`post`,headers:{"content-type":`application/json`,...f?{"x-tenant":f}:{}},body:JSON.stringify(t)}),n=await e.json().catch(()=>null);g(e.ok&&n?.success!==!1?`success`:`error`)}catch{g(`error`)}return}if(!t){g(`success`);return}try{let r=await fetch(t,{method:n||`post`,body:new FormData(e.currentTarget)});g(r.ok?`success`:`error`)}catch{g(`error`)}}},style:{...ut,display:_===`success`?`none`:`flex`},children:c}),(0,k.jsx)(`div`,{style:{display:_===`success`?`block`:`none`},children:u?.success??null}),(0,k.jsx)(`div`,{style:{display:_===`error`?`block`:`none`,marginTop:12},children:u?.error??null})]})}function gt({text:e,parts:t,style:n,nodeRef:r,linked:i}){return(0,k.jsx)(`label`,{ref:r,style:{...dt,...m(n)},children:je(t,e,i)})}function _t({type:e=`text`,name:t,placeholder:n,required:r,style:i,nodeRef:a,inert:o}){return(0,k.jsx)(`input`,{ref:a,type:e,name:t||void 0,placeholder:n,required:!o&&!!r,style:{...ft,...m(i)},...mt(o)})}function vt({name:e,placeholder:t,rows:n=4,required:r,style:i,nodeRef:a,inert:o}){return(0,k.jsx)(`textarea`,{ref:a,name:e||void 0,placeholder:t,rows:n,required:!o&&!!r,style:{...ft,resize:`vertical`,...m(i)},...mt(o)})}function yt({kind:e=`checkbox`,label:t,name:n,value:r,required:i,style:a,nodeRef:o,inert:s}){return(0,k.jsxs)(`label`,{ref:o,style:{...pt,...m(a)},children:[(0,k.jsx)(`input`,{type:e,name:n||void 0,value:r||void 0,required:!s&&!!i,onClick:s?e=>e.preventDefault():void 0,tabIndex:s?-1:void 0,style:{margin:0,accentColor:`var(--page-accent, #111827)`}}),t]})}function bt({name:e,placeholder:t,options:n=[],required:r,style:i,nodeRef:a,inert:o}){return(0,k.jsxs)(`select`,{ref:a,name:e||void 0,required:!o&&!!r,defaultValue:``,onMouseDown:o?e=>e.preventDefault():void 0,tabIndex:o?-1:void 0,style:{...ft,appearance:`auto`,...m(i)},children:[t!==``&&(0,k.jsx)(`option`,{value:``,disabled:!0,children:t??`Select…`}),n.map((e,t)=>(0,k.jsx)(`option`,{value:e,children:e},t))]})}function xt({name:e,accept:t,required:n,text:r=`Choose a file…`,style:i,nodeRef:a,inert:o}){let[s,c]=(0,l.useState)(null);return(0,k.jsxs)(`label`,{ref:a,style:{...ft,display:`flex`,alignItems:`center`,gap:`8px`,cursor:o?`default`:`pointer`,borderStyle:`dashed`,color:s?`#111827`:`#6b7280`,...m(i)},children:[(0,k.jsx)(`input`,{type:`file`,name:e||void 0,accept:t||void 0,required:!o&&!!n,disabled:!!o,onChange:e=>c(e.target.files?.[0]?.name??null),style:{display:`none`}}),(0,k.jsx)(`span`,{"aria-hidden":!0,children:`📎`}),s??r]})}function St({text:e=`Submit`,style:t,nodeRef:n,inert:r}){return(0,k.jsx)(`button`,{ref:n,type:r?`button`:`submit`,style:{...be,border:0,cursor:`pointer`,alignSelf:`flex-start`,...m(t)},children:e})}function Ct({cols:e=2,rows:t=1,style:n,nodeRef:r,linked:i}){let a=Math.max(1,(Number(e)||1)*(Number(t)||1));return(0,k.jsx)(`div`,{ref:r,style:{display:`grid`,gridTemplateColumns:`repeat(${Math.max(1,Number(e)||1)}, minmax(0, 1fr))`,gap:16,width:`100%`,...m(n)},children:Array.from({length:a},(e,t)=>(0,k.jsx)(`div`,{style:{minWidth:0},children:i?.[`cell-${t}`]??null},t))})}var wt={PageRoot:Te,Section:Ee,Container:De,Heading:Oe,TextBlock:Be,ButtonBlock:Ue,ImageBlock:We,Spacer:Xe,Divider:Ze,SliderBlock:rt,CanvasSlider:it,TabsBlock:ct,QuickStack:Ct,AccordionBlock:lt,NavbarBlock:st,ListBlock:ze,TextSpan:Me,QuoteBlock:Re,TextLink:He,RichTextBlock:Ie,RichContentBlock:Ie,VideoBlock:Ge,YouTubeBlock:qe,IframeBlock:Je,EmbedBlock:Ye,FormBlock:ht,FormLabel:gt,FormInput:_t,FormTextarea:vt,FormCheckbox:e=>(0,k.jsx)(yt,{kind:`checkbox`,...e}),FormRadio:e=>(0,k.jsx)(yt,{kind:`radio`,...e}),FormSelect:bt,FormFile:xt,FormSubmit:St};function Tt(e,t,n,r=new Set){let i=t[e];if(!i||i.hidden)return null;let a=i.type?.resolvedName;if(a===`ComponentInstance`){let t=i.props?.componentId,a=n?.[t];if(!a?.template||r.has(t))return null;let o=new Set(r).add(t);return(0,k.jsx)(l.Fragment,{children:Tt(a.template.rootId,a.template.nodes,n,o)},e)}let o=wt[a];if(!o)return null;let s=(i.nodes??[]).map(e=>Tt(e,t,n,r)).filter(Boolean),c=Object.entries(i.linkedNodes??{}),u=c.length?Object.fromEntries(c.map(([e,i])=>[e,Tt(i,t,n,r)])):void 0;return(0,k.jsx)(o,{...i.props,linked:u,nodeRef:t=>{t&&(t.setAttribute(`data-wb`,e),v(t,i.props??{}))},children:s.length?s:void 0},e)}var Et=e=>Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(` `);function Dt({blocks:e,theme:t,components:n,mode:r=`auto`,style:i,custom:a,tenant:o,apiUrl:s}){let c=a?.js?.trim();if((0,l.useEffect)(()=>{if(!c)return;let e=document.createElement(`script`);return e.text=c,document.body.appendChild(e),()=>e.remove()},[c]),!e?.ROOT)return null;let u={minHeight:`100%`,display:`flex`,flexDirection:`column`},d=Tt(`ROOT`,e,n),f=ne(e,n),p=te(e,n),m=a?.css?.trim(),h=he(e,n).map(e=>(0,k.jsx)(`link`,{rel:`stylesheet`,precedence:`default`,href:D(e)},e));if(r!==`auto`)return(0,k.jsx)(_e.Provider,{value:{tenant:o||``,apiUrl:s||`/api`},children:(0,k.jsxs)(`div`,{style:{...u,...T(t,r),...i},children:[h,f&&(0,k.jsx)(`style`,{children:f}),p&&(0,k.jsx)(`style`,{children:p}),m&&(0,k.jsx)(`style`,{children:m}),d]})});let g=ce(t);return(0,k.jsx)(_e.Provider,{value:{tenant:o||``,apiUrl:s||`/api`},children:(0,k.jsxs)(`div`,{className:`webim-page`,style:{...u,...ue(t),...i},children:[(0,k.jsx)(`style`,{children:`.webim-page { ${Et(le(g.light))} }
14
- @media (prefers-color-scheme: dark) { .webim-page { ${Et(le(g.dark))} } }`}),h,f&&(0,k.jsx)(`style`,{children:f}),p&&(0,k.jsx)(`style`,{children:p}),m&&(0,k.jsx)(`style`,{children:m}),d]})})}function A({bundle:e,mode:t=`auto`,style:n}){return e?.blocks?.ROOT?(0,k.jsx)(Dt,{blocks:e.blocks,theme:e.theme,components:e.components,custom:e.custom,tenant:e.tenant,apiUrl:e.apiUrl,mode:t,style:n}):null}function Ot({apiUrl:e,tenant:t,slug:n,locale:r,preview:i,mode:a=`auto`,style:o,fallback:s=null,errorFallback:c=null,onLoad:u,onError:d}){let[f,p]=(0,l.useState)({status:`loading`}),m=(0,l.useRef)({onLoad:u,onError:d});return m.current={onLoad:u,onError:d},(0,l.useEffect)(()=>{let a=!0;return p({status:`loading`}),pe({apiUrl:e,tenant:t,slug:n,locale:r,preview:i}).then(e=>{a&&(p({status:`ready`,bundle:e}),m.current.onLoad?.(e))}).catch(e=>{a&&(p({status:`error`,error:e}),m.current.onError?.(e))}),()=>{a=!1}},[e,t,n,r,i]),f.status===`loading`?s:f.status===`error`?typeof c==`function`?c(f.error):c:(0,k.jsx)(A,{bundle:f.bundle,mode:a,style:o})}function kt(e,t={}){let n=(0,u.createRoot)(e);return n.render((0,k.jsx)(Ot,{apiUrl:t.apiUrl||t.api,tenant:t.tenant,slug:t.slug,locale:t.locale||void 0,mode:t.mode||`auto`,onError:e=>console.error(`[webim-embed]`,t.slug,e)})),n}function At(e=document){for(let t of e.querySelectorAll(`[data-webim-page]:not([data-webim-mounted])`))t.setAttribute(`data-webim-mounted`,``),kt(t,t.dataset)}var jt=document.currentScript,Mt=()=>{if(At(),jt?.dataset.slug){let e=document.createElement(`div`);e.setAttribute(`data-webim-mounted`,``),jt.parentElement&&jt.parentElement!==document.head?jt.insertAdjacentElement(`beforebegin`,e):document.body.appendChild(e),kt(e,jt.dataset)}};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Mt,{once:!0}):Mt(),window.WebimEmbed={mount:kt,scan:At}})();
13
+ `)}var re=`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,w={light:{background:`#ffffff`,text:`#111827`,accent:`#111827`,accentText:`#ffffff`,primary:{light:`#4b5563`,main:`#111827`,dark:`#030712`,contrastText:`#ffffff`},secondary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`}},dark:{background:`#0f172a`,text:`#e2e8f0`,accent:`#6366f1`,accentText:`#ffffff`,primary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`},secondary:{light:`#5eead4`,main:`#14b8a6`,dark:`#0f766e`,contrastText:`#052e2b`}}},ie={font:`system`,headingFont:`inherit`,light:w.light,dark:w.dark},ae={system:{label:`System`,value:re},inter:{label:`Inter`,value:`"Inter", ${re}`},outfit:{label:`Outfit`,value:`"Outfit", ${re}`},serif:{label:`Serif`,value:`Georgia, "Times New Roman", serif`},mono:{label:`Mono`,value:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`}},oe=(e,t)=>ae[e]?.value??t,se=(e,...t)=>{let n=Object.assign({},e,...t);return n.primary={...e.primary,...t.reduce((e,t)=>({...e,...t?.primary}),{})},n.secondary={...e.secondary,...t.reduce((e,t)=>({...e,...t?.secondary}),{})},n};function ce(e){let{light:t,dark:n,font:r,headingFont:i,...a}=e??{};return{font:r??ie.font,headingFont:i??ie.headingFont,light:se(w.light,a,t),dark:se(w.dark,n)}}function le(e){return{"--page-bg":e.background,"--page-text":e.text,"--page-accent":e.accent,"--page-accent-text":e.accentText,"--page-primary-light":e.primary.light,"--page-primary":e.primary.main,"--page-primary-dark":e.primary.dark,"--page-primary-contrast":e.primary.contrastText,"--page-secondary-light":e.secondary.light,"--page-secondary":e.secondary.main,"--page-secondary-dark":e.secondary.dark,"--page-secondary-contrast":e.secondary.contrastText}}function ue(e){let t=ce(e);return{backgroundColor:`var(--page-bg)`,color:`var(--page-text)`,fontFamily:oe(t.font,re),"--page-heading-font":t.headingFont===`inherit`?`inherit`:oe(t.headingFont,`inherit`)}}function T(e,t=`light`){let n=ce(e);return{...ue(e),...le(n[t]??n.light)}}function E(e,t){return e?.themeRef&&t?.[e.themeRef]||e?.theme}function de({page:e,settings:t,tenant:n,apiUrl:r,locale:i}){let a={...t?.global??{},...t?.tenant??{}},o=e.meta??{};return{schema:1,title:e.title,slug:e.slug,blocks:i&&o.i18n?.[i]?.blocks||e.blocks,theme:E(o,a.builder_themes?.themes),components:a.builder_components?.components??{},custom:o.custom,seo:o.seo,locales:a.locales,tenant:n??``,apiUrl:r??``}}var fe=async e=>{let t=await e.json().catch(()=>null);if(!e.ok||t?.success===!1)throw Error(t?.error?.message||`Request failed (${e.status})`);return t?.payload??t};async function pe({apiUrl:e,tenant:t,slug:n,locale:r,preview:i,fetch:a}){if(!e)throw Error(`fetchPage: apiUrl is required`);if(!n)throw Error(`fetchPage: slug is required`);let o=a??fetch,s=e.replace(/\/$/,``),c=t?{"x-tenant":t}:{},[l,u]=await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i?`?preview=${encodeURIComponent(i)}`:``}`,{headers:c}).then(fe),o(`${s}/settings/public`,{headers:c}).then(fe)]),d=de({page:l,settings:u,tenant:t,apiUrl:s,locale:r}),f=[...new Set(Object.values(d.blocks??{}).filter(e=>e?.type?.resolvedName===`CollectionList`&&e.props?.collection).map(e=>e.props.collection))];if(f.length){let e=e=>e.startsWith(`api:`)?`${s}/data/${encodeURIComponent(e.slice(4))}`:`${s}/dynamic/${encodeURIComponent(e)}${r?`?locale=${encodeURIComponent(r)}`:``}`,t=await Promise.all(f.map(t=>o(e(t),{headers:c}).then(fe).then(e=>[t,Array.isArray(e)?e:[]]).catch(()=>[t,[]])));d.datasets=Object.fromEntries(t)}return d}new Map([{family:`Bebas Neue`,fallback:`sans-serif`},{family:`Crimson Text`,fallback:`serif`},{family:`DM Sans`,fallback:`sans-serif`},{family:`Fira Sans`,fallback:`sans-serif`},{family:`Inter`,fallback:`sans-serif`},{family:`JetBrains Mono`,fallback:`monospace`},{family:`Josefin Sans`,fallback:`sans-serif`},{family:`Karla`,fallback:`sans-serif`},{family:`Lato`,fallback:`sans-serif`},{family:`Lora`,fallback:`serif`},{family:`Manrope`,fallback:`sans-serif`},{family:`Merriweather`,fallback:`serif`},{family:`Montserrat`,fallback:`sans-serif`},{family:`Nunito`,fallback:`sans-serif`},{family:`Open Sans`,fallback:`sans-serif`},{family:`Oswald`,fallback:`sans-serif`},{family:`Outfit`,fallback:`sans-serif`},{family:`Playfair Display`,fallback:`serif`},{family:`Poppins`,fallback:`sans-serif`},{family:`Quicksand`,fallback:`sans-serif`},{family:`Raleway`,fallback:`sans-serif`},{family:`Roboto`,fallback:`sans-serif`},{family:`Rubik`,fallback:`sans-serif`},{family:`Source Sans 3`,fallback:`sans-serif`},{family:`Space Grotesk`,fallback:`sans-serif`},{family:`Work Sans`,fallback:`sans-serif`}].map(e=>[e.family,e]));function me(e){return e.length?`https://fonts.googleapis.com/css2?${e.map(e=>`family=${e.replace(/ /g,`+`)}:wght@100..900`).join(`&`)}&display=swap`:null}var D=e=>me([e]),O=e=>{let t=typeof e==`string`&&e.match(/^"([^"]+)"/);return t?t[1]:null};function he(e,t){let n=new Set,r=e=>{for(let t of Object.values(e||{}))for(let e of[`style`,`hover`,`pressed`,`focused`]){let r=O(t.props?.[e]?.fontFamily);r&&n.add(r)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return[...n].sort()}var ge=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),k=e(((e,t)=>{t.exports=ge()}))(),_e=(0,l.createContext)({tenant:``,apiUrl:`/api`}),ve=(0,l.createContext)(null),ye=(0,l.createContext)(null),be=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function xe(e,t){if(t)return t.includes(`.`)?t.split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e):e?.[t]}var Se=e=>{let t=[];for(let[n,r]of Object.entries(e??{})){if(!/^[\w-]+$/.test(n))continue;t.push(n);let e=Array.isArray(r)?r[0]:r,i=Array.isArray(r)?`${n}.0`:n;if(e&&typeof e==`object`&&!Array.isArray(e))for(let n of Object.keys(e))/^[\w-]+$/.test(n)&&t.push(`${i}.${n}`)}return t};function Ce(e){return e==null?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?e.map(e=>typeof e==`string`?e:Array.isArray(e?.parts)?e.parts.map(e=>e?.text??``).join(``):Array.isArray(e?.items)?e.items.map(e=>e?.text??``).join(` `):``).filter(Boolean).join(` `):``}function we(e,t){let n=t?.data??{},r=Se(n);if(!r.length)return e;let i=RegExp(`:(${r.map(be).sort((e,t)=>t.length-e.length).join(`|`)})`,`g`),a=e=>typeof e==`string`?e.replace(i,(e,t)=>Ce(xe(n,t))):Array.isArray(e)?e.map(a):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,a(t)])):e;return a(e)}var Te={margin:0,fontWeight:700,lineHeight:1.2,fontFamily:`var(--page-heading-font, inherit)`},Ee={margin:0},De={display:`inline-block`,textDecoration:`none`,cursor:`pointer`,backgroundColor:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`},Oe={flexGrow:1,display:`flex`,flexDirection:`column`,position:`relative`},ke={display:`flex`,flexDirection:`column`};function Ae({style:e}){let t=e?.backgroundVideo;if(!t)return null;let n={position:`absolute`,inset:0,width:`100%`,height:`100%`,zIndex:-1,pointerEvents:`none`},r=e?.overlayColor?`color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity??50}%, transparent)`:null;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`video`,{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{...n,objectFit:`cover`}}),r&&(0,k.jsx)(`div`,{style:{...n,background:r}})]})}var je=(e,t)=>e?.backgroundVideo?{position:`relative`,...t,...m(e)}:{...t,...m(e)};function Me({style:e,nodeRef:t,children:n}){return(0,k.jsxs)(`div`,{ref:t,style:{...Oe,...m(e)},children:[(0,k.jsx)(Ae,{style:e}),n]})}function Ne({style:e,nodeRef:t,children:n}){return(0,k.jsxs)(`section`,{ref:t,style:je(e,ke),children:[(0,k.jsx)(Ae,{style:e}),n]})}function Pe({style:e,freeLayout:t,nodeRef:n,children:r}){let i=t?{position:`relative`,minHeight:240}:null;return(0,k.jsxs)(`div`,{ref:n,style:i?{...i,...je(e)}:je(e),children:[(0,k.jsx)(Ae,{style:e}),r]})}function Fe({text:e,parts:t,tag:n=`h2`,style:r,linked:i,nodeRef:a}){return(0,k.jsx)(n,{ref:a,style:{...Te,...m(r)},children:Re(t,e,i)})}var Ie={fontFamily:ae.mono.value,background:`rgba(148, 163, 184, 0.18)`,padding:`1px 5px`,borderRadius:4,fontSize:`0.9em`};function Le(e,t=[],n){let r=e;return t.includes(`sup`)?r=(0,k.jsx)(`sup`,{children:r}):t.includes(`sub`)&&(r=(0,k.jsx)(`sub`,{children:r})),t.includes(`code`)&&(r=(0,k.jsx)(`code`,{style:Ie,children:r})),t.includes(`strike`)&&(r=(0,k.jsx)(`s`,{children:r})),t.includes(`underline`)&&(r=(0,k.jsx)(`u`,{children:r})),t.includes(`italic`)&&(r=(0,k.jsx)(`em`,{children:r})),t.includes(`bold`)&&(r=(0,k.jsx)(`strong`,{children:r})),n&&(r=(0,k.jsx)(`a`,{href:n,style:{color:`inherit`},children:r})),r}function Re(e,t,n){return e?.length?e.map((e,t)=>{if(e.slot)return(0,k.jsx)(l.Fragment,{children:n?.[e.slot]??null},t);if(e.parts)return(0,k.jsx)(l.Fragment,{children:Re(e.parts,``,n)},t);let r=e.text;return e.sup?r=(0,k.jsx)(`sup`,{children:r}):e.sub&&(r=(0,k.jsx)(`sub`,{children:r})),e.code&&(r=(0,k.jsx)(`code`,{style:Ie,children:r})),e.strike&&(r=(0,k.jsx)(`s`,{children:r})),e.underline&&(r=(0,k.jsx)(`u`,{children:r})),e.italic&&(r=(0,k.jsx)(`em`,{children:r})),e.bold&&(r=(0,k.jsx)(`strong`,{children:r})),e.href&&(r=(0,k.jsx)(`a`,{href:e.href,style:{color:`inherit`},children:r})),(0,k.jsx)(l.Fragment,{children:r},t)}):t}function ze({parts:e,text:t,marks:n,href:r,style:i}){return(0,k.jsx)(`span`,{style:m(i),children:e?.length?Re(e,t):Le(t,n,r)})}var Be={h1:40,h2:32,h3:26,h4:22,h5:19,h6:16};function Ve({align:e=`center`,width:t}={}){let n=t?`${t}%`:void 0;return e===`full`?{width:`100%`}:e===`left`?{float:`left`,width:n??`50%`,marginTop:4,marginRight:20,marginBottom:12,marginLeft:0}:e===`right`?{float:`right`,width:n??`50%`,marginTop:4,marginLeft:20,marginBottom:12,marginRight:0}:{width:n??`fit-content`,maxWidth:`100%`,marginLeft:`auto`,marginRight:`auto`}}function He(e=[],t,n){let r=n??((e,n)=>Re(e,n,t));return e.map((t,n)=>{let i={marginTop:0,marginBottom:n===e.length-1?0:14};if(t.type===`image`){if(!t.src)return null;let e=(0,k.jsx)(`img`,{src:t.src,alt:t.alt||``,style:{width:`100%`,display:`block`,borderRadius:6}});return(0,k.jsxs)(`figure`,{style:{marginLeft:0,marginRight:0,...i,...Ve(t)},children:[t.href?(0,k.jsx)(`a`,{href:t.href,style:{display:`block`},children:e}):e,t.caption&&(0,k.jsx)(`figcaption`,{style:{fontSize:13,opacity:.65,marginTop:6,textAlign:`center`},children:t.caption})]},n)}if(t.type===`video`)return $e(t.url)?(0,k.jsx)(`div`,{style:{...i,...Ve({align:t.align,width:t.width??100})},children:(0,k.jsx)(et,{url:t.url,autoplay:t.autoplay,muted:t.muted,loop:t.loop,controls:t.controls??!0,start:t.start})},n):null;if(t.type===`divider`)return(0,k.jsx)(`hr`,{style:{...i,border:0,borderTop:`1px solid rgba(148, 163, 184, 0.4)`}},n);if(t.type===`ul`||t.type===`ol`){let e=t.type;return(0,k.jsx)(e,{style:{...i,paddingLeft:24},children:(t.items??[]).map((e,t)=>(0,k.jsx)(`li`,{style:{marginBottom:4},children:r(e.parts,e.text)},t))},n)}if(t.type===`quote`)return(0,k.jsx)(`blockquote`,{style:{...We,...i},children:r(t.parts,t.text)},n);if(Be[t.type]){let e=t.type;return(0,k.jsx)(e,{style:{...Te,fontSize:Be[t.type],...i},children:r(t.parts,t.text)},n)}return(0,k.jsx)(`p`,{style:{...Ee,...i},children:r(t.parts,t.text)},n)})}function Ue({content:e,style:t,linked:n,nodeRef:r}){return(0,k.jsx)(`div`,{ref:r,style:{display:`flow-root`,...m(t)},children:He(e,n)})}var We={margin:0,padding:`8px 0 8px 20px`,borderLeft:`4px solid var(--page-accent, rgba(148, 163, 184, 0.6))`};function Ge({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,k.jsx)(`blockquote`,{ref:i,style:{...We,...m(n)},children:Re(t,e,r)})}function Ke({ordered:e,items:t=[],style:n,nodeRef:r}){return(0,k.jsx)(e?`ol`:`ul`,{ref:r,style:{margin:0,paddingLeft:24,...m(n)},children:t.map((e,t)=>(0,k.jsx)(`li`,{style:{marginBottom:4},children:Re(e.parts,e.text)},t))})}function qe({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,k.jsx)(`p`,{ref:i,style:{...Ee,...m(n)},children:Re(t,e,r)})}var Je={color:`var(--page-accent, inherit)`,textDecoration:`underline`,textUnderlineOffset:3,cursor:`pointer`};function Ye({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,k.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...Je,...m(i)},children:Re(t,e,a)})}function Xe({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,k.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...De,...m(i)},children:Re(t,e,a)})}function Ze({src:e,alt:t,style:n,nodeRef:r}){return e?(0,k.jsx)(`img`,{ref:r,src:e,alt:t||``,style:{display:`block`,maxWidth:`100%`,...m(n)}}):null}function Qe({src:e,poster:t,controls:n=!0,autoplay:r=!1,loop:i=!1,muted:a=!1,style:o,nodeRef:s}){return e?(0,k.jsx)(`video`,{ref:s,src:e,poster:t||void 0,controls:n,autoPlay:r,muted:a||r,loop:i,playsInline:!0,style:{display:`block`,width:`100%`,maxWidth:`100%`,...m(o)}}):null}var $e=(e=``)=>(e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/)||e.match(/^([\w-]{11})$/))?.[1];function et({url:e,autoplay:t=!1,muted:n=!1,loop:r=!1,controls:i=!0,start:a,style:o,nodeRef:s}){let c=$e(e);if(!c)return null;let l=new URLSearchParams({rel:`0`});return t&&l.set(`autoplay`,`1`),(n||t)&&l.set(`mute`,`1`),i||l.set(`controls`,`0`),r&&(l.set(`loop`,`1`),l.set(`playlist`,c)),Number(a)>0&&l.set(`start`,String(Math.floor(Number(a)))),(0,k.jsx)(`div`,{ref:s,style:{position:`relative`,width:`100%`,paddingTop:`56.25%`,...m(o)},children:(0,k.jsx)(`iframe`,{src:`https://www.youtube-nocookie.com/embed/${c}?${l}`,title:`YouTube video`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,allowFullScreen:!0,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,border:0}})})}function tt({src:e,title:t,allowFullscreen:n=!0,style:r,nodeRef:i}){return e?(0,k.jsx)(`iframe`,{ref:i,src:e,title:t||`Embedded frame`,loading:`lazy`,allowFullScreen:n,style:{display:`block`,width:`100%`,height:300,border:0,...m(r)}}):null}function nt({code:e,runScripts:t=!0,style:n,nodeRef:r}){let[i,a]=(0,l.useState)(null);return(0,l.useEffect)(()=>{i&&(i.innerHTML=e||``,t&&i.querySelectorAll(`script`).forEach(e=>{let t=document.createElement(`script`);for(let{name:n,value:r}of e.attributes)t.setAttribute(n,r);t.text=e.textContent,e.replaceWith(t)}))},[i,e,t]),(0,k.jsx)(`div`,{ref:e=>{a(e),r&&r(e)},style:m(n)})}function rt({height:e,nodeRef:t}){return(0,k.jsx)(`div`,{ref:t,style:{height:e||32,flexShrink:0,alignSelf:`stretch`}})}function it({style:e,nodeRef:t}){return(0,k.jsx)(`div`,{ref:t,style:{height:1,alignSelf:`stretch`,flexShrink:0,...m(e)}})}var at={position:`absolute`,top:`50%`,transform:`translateY(-50%)`,width:36,height:36,borderRadius:`50%`,border:0,cursor:`pointer`,background:`rgba(17, 24, 39, 0.45)`,color:`#fff`,fontSize:20,lineHeight:1,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:0},ot={bottom:{inset:`auto 0 0 0`,padding:`40px 24px 20px`,background:`linear-gradient(transparent, rgba(0, 0, 0, 0.55))`},top:{inset:`0 0 auto 0`,padding:`20px 24px 40px`,background:`linear-gradient(rgba(0, 0, 0, 0.55), transparent)`},middle:{inset:0,display:`flex`,flexDirection:`column`,justifyContent:`center`,padding:24,textShadow:`0 2px 12px rgba(0, 0, 0, 0.6)`}},st=48;function ct({count:e,renderSlide:t,autoplay:n=!0,interval:r=5,height:i=320,swipe:a=!0,style:o,nodeRef:s}){let[c,u]=(0,l.useState)(0),[d,f]=(0,l.useState)(!1),[p,h]=(0,l.useState)(null),g=e?Math.min(c,e-1):0;if((0,l.useEffect)(()=>{if(!n||d||p||e<2)return;let t=setInterval(()=>u(t=>(t+1)%e),Math.max(2,Number(r)||5)*1e3);return()=>clearInterval(t)},[n,d,p,r,e]),!e)return null;let _=t=>u((t+e)%e),v=()=>{if(!p)return;let{dx:e}=p;h(null),e<-48?_(g+1):e>st&&_(g-1)};return(0,k.jsxs)(`div`,{ref:s,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onPointerDown:a&&e>1?e=>{e.pointerType===`mouse`&&e.button!==0||e.target.closest(`button`)||(e.currentTarget.setPointerCapture(e.pointerId),h({startX:e.clientX,dx:0}))}:void 0,onPointerMove:p?e=>h(t=>t&&{...t,dx:e.clientX-t.startX}):void 0,onPointerUp:v,onPointerCancel:v,style:{position:`relative`,overflow:`hidden`,width:`100%`,touchAction:`pan-y`,userSelect:p?`none`:void 0,cursor:p?`grabbing`:void 0,...m(o)},children:[(0,k.jsx)(`div`,{style:{display:`flex`,height:i,transform:`translateX(calc(${-g*100}% + ${p?.dx??0}px))`,transition:p?`none`:`transform 450ms ease`},children:Array.from({length:e},(e,n)=>(0,k.jsx)(`div`,{style:{position:`relative`,width:`100%`,flexShrink:0,overflow:`hidden`},children:t(n)},n))}),e>1&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`button`,{type:`button`,"aria-label":`Previous slide`,style:{...at,left:12},onClick:()=>_(g-1),children:`‹`}),(0,k.jsx)(`button`,{type:`button`,"aria-label":`Next slide`,style:{...at,right:12},onClick:()=>_(g+1),children:`›`}),(0,k.jsx)(`div`,{style:{position:`absolute`,bottom:10,left:0,right:0,display:`flex`,justifyContent:`center`,gap:6},children:Array.from({length:e},(e,t)=>(0,k.jsx)(`button`,{type:`button`,"aria-label":`Go to slide ${t+1}`,onClick:()=>_(t),style:{width:8,height:8,borderRadius:`50%`,border:0,padding:0,cursor:`pointer`,background:t===g?`#ffffff`:`rgba(255, 255, 255, 0.45)`}},t))})]})]})}var lt=(e,t)=>({position:`absolute`,inset:0,backgroundImage:e?`url(${e})`:`none`,backgroundColor:t||(e?void 0:`rgba(148, 163, 184, 0.25)`),backgroundSize:`cover`,backgroundPosition:`center`});function ut({slides:e=[],captionPosition:t=`bottom`,captionAlign:n=`left`,...r}){return e.length?(0,k.jsx)(ct,{...r,count:e.length,renderSlide:r=>{let i=e[r];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{style:lt(i.image)}),(i.title||i.text)&&(0,k.jsxs)(`div`,{style:{position:`absolute`,color:`#fff`,textAlign:n,...ot[t]??ot.bottom},children:[i.title&&(0,k.jsx)(`div`,{style:{fontSize:22,fontWeight:700},children:i.title}),i.text&&(0,k.jsx)(`div`,{style:{fontSize:14,opacity:.9,marginTop:4},children:i.text})]})]})}}):null}function dt({slides:e=[],linked:t,...n}){return e.length?(0,k.jsx)(ct,{...n,count:e.length,renderSlide:n=>{let r=e[n];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{style:lt(r.image,r.color)}),(0,k.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`},children:t?.[r.key]??null})]})}}):null}var ft={color:`inherit`,textDecoration:`none`,fontSize:14,opacity:.85},pt={background:`var(--page-bg, #ffffff)`,color:`var(--page-text, #111827)`,border:`1px solid rgba(148, 163, 184, 0.25)`,boxShadow:`0 16px 40px rgba(15, 23, 42, 0.16)`,zIndex:60};function mt({brand:e,logo:t,links:n=[],style:r,nodeRef:i,menu:a=`auto`,breakpoint:o=768}){let[s,c]=(0,l.useState)(null),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(!1),[h,g]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!s)return;let e=new ResizeObserver(()=>d(s.offsetWidth<o));return e.observe(s),()=>e.disconnect()},[s,o]);let _=a===`hamburger`||a===`auto`&&u,v=(e,t)=>(0,k.jsxs)(`a`,{href:e.href||`#`,style:{...ft,display:`block`,...t},children:[e.label,e.desc&&(0,k.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6,marginTop:2},children:e.desc})]},e.key);return(0,k.jsxs)(`nav`,{ref:e=>{c(e),i&&i(e)},style:{display:`flex`,alignItems:`center`,gap:24,flexWrap:`wrap`,padding:`14px 24px`,width:`100%`,position:`relative`,...m(r)},children:[t&&(0,k.jsx)(`img`,{src:t,alt:e||`Logo`,style:{height:28,display:`block`}}),e&&(0,k.jsx)(`div`,{style:{fontWeight:700,fontSize:18,fontFamily:`var(--page-heading-font, inherit)`},children:e}),(0,k.jsx)(`div`,{style:{flexGrow:1}}),_?(0,k.jsx)(`button`,{type:`button`,"aria-label":f?`Close menu`:`Open menu`,onClick:()=>p(!f),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:4},children:f?`✕`:`☰`}):(0,k.jsx)(`div`,{style:{display:`flex`,gap:20,alignItems:`center`,flexWrap:`wrap`},children:n.map(e=>{let t=e.children??[];if(!t.length)return(0,k.jsx)(`a`,{href:e.href||`#`,style:ft,children:e.label},e.key);let n=e.type===`mega`;return(0,k.jsxs)(`span`,{style:{position:n?`static`:`relative`,display:`inline-flex`},onMouseEnter:()=>g(e.key),onMouseLeave:()=>g(null),children:[(0,k.jsxs)(`a`,{href:e.href||`#`,style:{...ft,cursor:`pointer`},children:[e.label,` `,(0,k.jsx)(`span`,{style:{fontSize:9,opacity:.6},children:`▼`})]}),h===e.key&&(n?(0,k.jsx)(`div`,{style:{...pt,position:`absolute`,left:0,right:0,top:`100%`,padding:24,display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(170px, 1fr))`,gap:16},children:t.map(e=>v(e,{padding:`6px 8px`,borderRadius:6}))}):(0,k.jsx)(`div`,{style:{...pt,position:`absolute`,top:`100%`,left:0,minWidth:190,borderRadius:8,padding:8,display:`flex`,flexDirection:`column`},children:t.map(e=>v(e,{padding:`8px 12px`,borderRadius:6}))}))]},e.key)})}),_&&f&&(0,k.jsx)(`div`,{style:{flexBasis:`100%`,width:`100%`,display:`flex`,flexDirection:`column`,paddingTop:10},children:n.map(e=>(0,k.jsxs)(l.Fragment,{children:[(0,k.jsx)(`a`,{href:e.href||`#`,style:{...ft,padding:`10px 4px`,fontWeight:(e.children??[]).length?600:400,opacity:1},children:e.label}),(e.children??[]).map(e=>v(e,{padding:`8px 4px 8px 22px`}))]},e.key))})]})}function ht({tabs:e=[],linked:t,style:n,nodeRef:r}){let[i,a]=(0,l.useState)(0),o=e.length?Math.min(i,e.length-1):0;return e.length?(0,k.jsxs)(`div`,{ref:r,style:{width:`100%`,...m(n)},children:[(0,k.jsx)(`div`,{style:{display:`flex`,gap:4,borderBottom:`1px solid rgba(148, 163, 184, 0.35)`},children:e.map((e,t)=>(0,k.jsx)(`button`,{type:`button`,onClick:()=>a(t),style:{background:`transparent`,border:0,padding:`10px 16px`,fontSize:14,fontFamily:`inherit`,color:`inherit`,cursor:`pointer`,opacity:t===o?1:.6,fontWeight:t===o?600:500,boxShadow:t===o?`inset 0 -2px 0 var(--page-accent, #111827)`:`none`},children:e.label||`Tab ${t+1}`},e.key))}),e.map((e,n)=>(0,k.jsx)(`div`,{style:{display:n===o?`flex`:`none`,flexDirection:`column`},children:t?.[e.key]??null},e.key))]}):null}function gt({items:e=[],linked:t,multiple:n=!1,style:r,nodeRef:i}){let[a,o]=(0,l.useState)(()=>new Set(e.length?[e[0].key]:[]));if(!e.length)return null;let s=e=>o(t=>{let r=new Set(n?t:[]);return t.has(e)?r.delete(e):r.add(e),r});return(0,k.jsx)(`div`,{ref:i,style:{width:`100%`,...m(r)},children:e.map((n,r)=>{let i=a.has(n.key);return(0,k.jsxs)(`div`,{style:{borderBottom:r<e.length-1?`1px solid rgba(148, 163, 184, 0.35)`:`none`},children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>s(n.key),style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,background:`transparent`,border:0,padding:`14px 4px`,fontSize:15,fontWeight:600,fontFamily:`inherit`,color:`inherit`,textAlign:`left`,cursor:`pointer`},children:[n.title||`Item ${r+1}`,(0,k.jsx)(`span`,{"aria-hidden":!0,style:{fontSize:12,opacity:.6,transform:i?`rotate(180deg)`:`none`,transition:`transform 180ms`},children:`▼`})]}),(0,k.jsx)(`div`,{style:{display:i?`flex`:`none`,flexDirection:`column`},children:t?.[n.key]??null})]},n.key)})})}var _t={display:`flex`,flexDirection:`column`,gap:`12px`},vt={fontSize:`14px`,fontWeight:500,color:`var(--page-text, #111827)`},yt={padding:`10px 12px`,border:`1px solid #d1d5db`,borderRadius:`6px`,fontSize:`14px`,fontFamily:`inherit`,width:`100%`,boxSizing:`border-box`,backgroundColor:`#ffffff`,color:`#111827`},bt={display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`14px`,color:`var(--page-text, #111827)`},xt=e=>e?{readOnly:!0,tabIndex:-1,onMouseDown:e=>e.preventDefault()}:{};function St({style:e,action:t,method:n,name:r,enctype:i,formSlug:a,nodeRef:o,inert:s,children:c,linked:u,show:d}){let{tenant:f,apiUrl:p}=(0,l.useContext)(_e),[h,g]=(0,l.useState)(`form`),_=s?d||`form`:h;return(0,k.jsxs)(`div`,{ref:o,style:m(e),children:[(0,k.jsx)(`form`,{action:t||void 0,method:n||`post`,name:r||void 0,encType:i||void 0,onSubmit:async e=>{if(e.preventDefault(),!s){if(a){let t={};for(let[n,r]of new FormData(e.currentTarget).entries())typeof r==`string`&&(t[n]=r===`on`||r);try{let e=await fetch(`${p||`/api`}/forms/${a}/submit`,{method:`post`,headers:{"content-type":`application/json`,...f?{"x-tenant":f}:{}},body:JSON.stringify(t)}),n=await e.json().catch(()=>null);g(e.ok&&n?.success!==!1?`success`:`error`)}catch{g(`error`)}return}if(!t){g(`success`);return}try{let r=await fetch(t,{method:n||`post`,body:new FormData(e.currentTarget)});g(r.ok?`success`:`error`)}catch{g(`error`)}}},style:{..._t,display:_===`success`?`none`:`flex`},children:c}),(0,k.jsx)(`div`,{style:{display:_===`success`?`block`:`none`},children:u?.success??null}),(0,k.jsx)(`div`,{style:{display:_===`error`?`block`:`none`,marginTop:12},children:u?.error??null})]})}function Ct({text:e,parts:t,style:n,nodeRef:r,linked:i}){return(0,k.jsx)(`label`,{ref:r,style:{...vt,...m(n)},children:Re(t,e,i)})}function wt({type:e=`text`,name:t,placeholder:n,required:r,style:i,nodeRef:a,inert:o}){return(0,k.jsx)(`input`,{ref:a,type:e,name:t||void 0,placeholder:n,required:!o&&!!r,style:{...yt,...m(i)},...xt(o)})}function Tt({name:e,placeholder:t,rows:n=4,required:r,style:i,nodeRef:a,inert:o}){return(0,k.jsx)(`textarea`,{ref:a,name:e||void 0,placeholder:t,rows:n,required:!o&&!!r,style:{...yt,resize:`vertical`,...m(i)},...xt(o)})}function Et({kind:e=`checkbox`,label:t,name:n,value:r,required:i,style:a,nodeRef:o,inert:s}){return(0,k.jsxs)(`label`,{ref:o,style:{...bt,...m(a)},children:[(0,k.jsx)(`input`,{type:e,name:n||void 0,value:r||void 0,required:!s&&!!i,onClick:s?e=>e.preventDefault():void 0,tabIndex:s?-1:void 0,style:{margin:0,accentColor:`var(--page-accent, #111827)`}}),t]})}function Dt({name:e,placeholder:t,options:n=[],required:r,style:i,nodeRef:a,inert:o}){return(0,k.jsxs)(`select`,{ref:a,name:e||void 0,required:!o&&!!r,defaultValue:``,onMouseDown:o?e=>e.preventDefault():void 0,tabIndex:o?-1:void 0,style:{...yt,appearance:`auto`,...m(i)},children:[t!==``&&(0,k.jsx)(`option`,{value:``,disabled:!0,children:t??`Select…`}),n.map((e,t)=>(0,k.jsx)(`option`,{value:e,children:e},t))]})}function A({name:e,accept:t,required:n,text:r=`Choose a file…`,style:i,nodeRef:a,inert:o}){let[s,c]=(0,l.useState)(null);return(0,k.jsxs)(`label`,{ref:a,style:{...yt,display:`flex`,alignItems:`center`,gap:`8px`,cursor:o?`default`:`pointer`,borderStyle:`dashed`,color:s?`#111827`:`#6b7280`,...m(i)},children:[(0,k.jsx)(`input`,{type:`file`,name:e||void 0,accept:t||void 0,required:!o&&!!n,disabled:!!o,onChange:e=>c(e.target.files?.[0]?.name??null),style:{display:`none`}}),(0,k.jsx)(`span`,{"aria-hidden":!0,children:`📎`}),s??r]})}function Ot({text:e=`Submit`,style:t,nodeRef:n,inert:r}){return(0,k.jsx)(`button`,{ref:n,type:r?`button`:`submit`,style:{...De,border:0,cursor:`pointer`,alignSelf:`flex-start`,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,lineHeight:1.4,fontFamily:`inherit`,...m(t)},children:e})}function kt({cols:e=2,rows:t=1,style:n,nodeRef:r,linked:i}){let a=Math.max(1,(Number(e)||1)*(Number(t)||1));return(0,k.jsx)(`div`,{ref:r,style:{display:`grid`,gridTemplateColumns:`repeat(${Math.max(1,Number(e)||1)}, minmax(0, 1fr))`,gap:16,width:`100%`,...m(n)},children:Array.from({length:a},(e,t)=>(0,k.jsx)(`div`,{style:{minWidth:0},children:i?.[`cell-${t}`]??null},t))})}function At({collection:e,limit:t=6,layout:n=`grid`,columns:r=3,imageField:i,titleField:a=`name`,textField:o,custom:s,templateId:c,style:u,nodeRef:d}){let{tenant:f,apiUrl:p}=(0,l.useContext)(_e),h=(0,l.useContext)(ye),g=(0,l.useContext)(ve)?.[e],[_,v]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!e||g)return;let t=!0,n=e.startsWith(`api:`)?`${p}/data/${encodeURIComponent(e.slice(4))}`:`${p}/dynamic/${encodeURIComponent(e)}`;return fetch(n,{headers:f?{"x-tenant":f}:{}}).then(e=>e.json()).then(e=>t&&v(Array.isArray(e?.payload)?e.payload:[])).catch(()=>t&&v([])),()=>{t=!1}},[e,f,p,g]),!e)return null;let y=(g??_??[]).slice(0,Math.max(1,Number(t)||6)),b=Math.min(Math.max(Number(r)||3,1),6),x=n===`list`?{display:`flex`,flexDirection:`column`,gap:20}:{display:`grid`,gridTemplateColumns:`repeat(${b}, minmax(0, 1fr))`,gap:24};return s&&c&&h?.render?(0,k.jsx)(`div`,{ref:d,style:{width:`100%`,...x,...m(u)},children:y.map(e=>(0,k.jsx)(`div`,{style:{minWidth:0},children:h.render(c,t=>we(t,e))},e.id??e?.data?.slug))}):(0,k.jsx)(`div`,{ref:d,style:{width:`100%`,...x,...m(u)},children:y.map(e=>{let t=i?xe(e?.data,i):null,r=a?Ce(xe(e?.data,a)):null,s=o?xe(e?.data,o):null,c=Array.isArray(s)?s:null,l=c||s==null?null:Ce(s),u=n===`list`;return(0,k.jsxs)(`div`,{style:{display:`flex`,flexDirection:u?`row`:`column`,gap:u?20:12,alignItems:u?`center`:`stretch`,minWidth:0},children:[t&&(0,k.jsx)(`img`,{src:t,alt:r??``,style:{width:u?160:`100%`,aspectRatio:`3 / 2`,objectFit:`cover`,borderRadius:10,flexShrink:0,display:`block`}}),(0,k.jsxs)(`div`,{style:{minWidth:0},children:[r&&(0,k.jsx)(`h3`,{style:{margin:0,fontSize:18,fontWeight:700},children:r}),l&&(0,k.jsx)(`p`,{style:{margin:`6px 0 0`,fontSize:14,lineHeight:1.55,opacity:.75},children:l}),c&&(0,k.jsx)(`div`,{style:{marginTop:6,fontSize:14,lineHeight:1.55,opacity:.85},children:He(c)})]})]},e.id??e?.data?.slug)})})}function jt({items:e=[],separator:t=`/`,style:n,nodeRef:r}){return e.length?(0,k.jsx)(`nav`,{ref:r,"aria-label":`Breadcrumb`,style:{...m(n)},children:(0,k.jsx)(`ol`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:8,listStyle:`none`,margin:0,padding:0,fontSize:14},children:e.map((n,r)=>{let i=r===e.length-1;return(0,k.jsxs)(`li`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[r>0&&(0,k.jsx)(`span`,{style:{opacity:.4},"aria-hidden":!0,children:t}),i||!n.href?(0,k.jsx)(`span`,{style:{fontWeight:i?600:400,opacity:i?1:.7},"aria-current":i?`page`:void 0,children:n.label}):(0,k.jsx)(`a`,{href:n.href,style:{color:`inherit`,opacity:.7,textDecoration:`none`},children:n.label})]},r)})})}):null}function Mt({pages:e=5,current:t=1,prevNext:n=!0,href:r=`#`,style:i,nodeRef:a}){let o=Math.min(Math.max(Number(e)||1,1),50),s=Math.min(Math.max(Number(t)||1,1),o),c=e=>r&&r!==`#`?r.replace(`{page}`,String(e)):`#`,l=e=>({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:36,height:36,padding:`0 8px`,borderRadius:8,fontSize:14,textDecoration:`none`,color:e?`var(--page-accent-text, #ffffff)`:`inherit`,background:e?`var(--page-accent, #111827)`:`transparent`,border:e?`1px solid transparent`:`1px solid rgba(148, 163, 184, 0.4)`});return(0,k.jsxs)(`nav`,{ref:a,"aria-label":`Pagination`,style:{display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`,...m(i)},children:[n&&(0,k.jsx)(`a`,{href:s>1?c(s-1):`#`,"aria-label":`Previous`,style:{...l(!1),opacity:s>1?1:.4},children:`‹`}),Array.from({length:o},(e,t)=>t+1).map(e=>(0,k.jsx)(`a`,{href:c(e),"aria-current":e===s?`page`:void 0,style:l(e===s),children:e},e)),n&&(0,k.jsx)(`a`,{href:s<o?c(s+1):`#`,"aria-label":`Next`,style:{...l(!1),opacity:s<o?1:.4},children:`›`})]})}function Nt({steps:e=[],active:t=1,vertical:n=!1,style:r,nodeRef:i}){if(!e.length)return null;let a=Math.min(Math.max(Number(t)||1,1),e.length),o=e=>({width:32,height:32,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:14,fontWeight:600,flexShrink:0,color:e===`todo`?`inherit`:`var(--page-accent-text, #ffffff)`,background:e===`todo`?`transparent`:`var(--page-accent, #111827)`,border:e===`todo`?`1px solid rgba(148, 163, 184, 0.5)`:`1px solid transparent`,opacity:e===`todo`?.6:1,boxShadow:e===`active`?`0 0 0 4px rgba(99, 102, 241, 0.2)`:`none`}),s=e=>({flexGrow:1,alignSelf:`center`,background:e?`var(--page-accent, #111827)`:`rgba(148, 163, 184, 0.4)`,...n?{width:2,minHeight:24,marginLeft:15,alignSelf:`auto`}:{height:2,minWidth:24}});return(0,k.jsx)(`div`,{ref:i,style:{display:`flex`,flexDirection:n?`column`:`row`,alignItems:n?`stretch`:`flex-start`,gap:n?4:8,...m(r)},children:e.map((e,t)=>{let r=t+1,i=r<a?`done`:r===a?`active`:`todo`;return(0,k.jsxs)(l.Fragment,{children:[t>0&&(0,k.jsx)(`div`,{style:s(r<=a),"aria-hidden":!0}),(0,k.jsxs)(`div`,{style:{display:`flex`,flexDirection:n?`row`:`column`,alignItems:`center`,gap:8,minWidth:0,textAlign:n?`left`:`center`},children:[(0,k.jsx)(`div`,{style:o(i),children:i===`done`?`✓`:r}),(0,k.jsxs)(`div`,{style:{minWidth:0},children:[(0,k.jsx)(`div`,{style:{fontSize:13,fontWeight:i===`active`?700:500,opacity:i===`todo`?.6:1},children:e.label}),e.description&&(0,k.jsx)(`div`,{style:{fontSize:12,opacity:.6},children:e.description})]})]})]},t)})})}function Pt({columns:e=[],rows:t=[],striped:n=!0,bordered:r=!1,compact:i=!1,style:a,nodeRef:o}){if(!e.length)return null;let s=i?`6px 10px`:`10px 14px`,c=`1px solid rgba(148, 163, 184, 0.35)`,l=r?{border:c}:{borderBottom:c};return(0,k.jsx)(`div`,{ref:o,style:{width:`100%`,overflowX:`auto`,...m(a)},children:(0,k.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:14,...r?{border:c}:{}},children:[(0,k.jsx)(`thead`,{children:(0,k.jsx)(`tr`,{children:e.map((e,t)=>(0,k.jsx)(`th`,{style:{textAlign:`left`,fontWeight:600,padding:s,background:`rgba(148, 163, 184, 0.12)`,...l},children:e.label??e},t))})}),(0,k.jsx)(`tbody`,{children:t.map((t,r)=>(0,k.jsx)(`tr`,{style:n&&r%2==1?{background:`rgba(148, 163, 184, 0.07)`}:void 0,children:e.map((e,n)=>(0,k.jsx)(`td`,{style:{padding:s,...l},children:t?.[n]??``},n))},r))})]})})}var Ft={PageRoot:Me,Section:Ne,Container:Pe,Heading:Fe,TextBlock:qe,ButtonBlock:Xe,ImageBlock:Ze,Spacer:rt,Divider:it,SliderBlock:ut,CanvasSlider:dt,TabsBlock:ht,QuickStack:kt,CollectionList:At,BreadcrumbsBlock:jt,PaginationBlock:Mt,StepperBlock:Nt,TableBlock:Pt,AccordionBlock:gt,NavbarBlock:mt,ListBlock:Ke,TextSpan:ze,QuoteBlock:Ge,TextLink:Ye,RichTextBlock:Ue,RichContentBlock:Ue,VideoBlock:Qe,YouTubeBlock:et,IframeBlock:tt,EmbedBlock:nt,FormBlock:St,FormLabel:Ct,FormInput:wt,FormTextarea:Tt,FormCheckbox:e=>(0,k.jsx)(Et,{kind:`checkbox`,...e}),FormRadio:e=>(0,k.jsx)(Et,{kind:`radio`,...e}),FormSelect:Dt,FormFile:A,FormSubmit:Ot};function It(e,t,n,r=new Set,i=void 0){let a=t[e];if(!a||a.hidden)return null;let o=a.type?.resolvedName,s=i?.mapProps?i.mapProps(a.props??{},o):a.props??{};if(o===`ComponentInstance`){let t=a.props?.componentId,o=n?.[t];if(!o?.template||r.has(t))return null;let s=new Set(r).add(t);return(0,k.jsx)(l.Fragment,{children:It(o.template.rootId,o.template.nodes,n,s,i)},e)}let c=Ft[o];if(!c)return null;let u=(a.nodes??[]).map(e=>It(e,t,n,r,i)).filter(Boolean),d=Object.entries(a.linkedNodes??{}),f=d.length?Object.fromEntries(d.map(([e,i])=>[e,It(i,t,n,r)])):void 0;return(0,k.jsx)(c,{...s,...o===`CollectionList`?{templateId:a.linkedNodes?.card}:null,linked:f,nodeRef:t=>{t&&(t.setAttribute(`data-wb`,e),v(t,s))},children:u.length?u:void 0},e)}var Lt=e=>Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(` `);function Rt({blocks:e,theme:t,components:n,mode:r=`auto`,style:i,custom:a,tenant:o,apiUrl:s,datasets:c}){let u=a?.js?.trim();if((0,l.useEffect)(()=>{if(!u)return;let e=document.createElement(`script`);return e.text=u,document.body.appendChild(e),()=>e.remove()},[u]),!e?.ROOT)return null;let d={minHeight:`100%`,display:`flex`,flexDirection:`column`},f=It(`ROOT`,e,n),p=(0,l.useMemo)(()=>({render:(t,r)=>It(t,e,n,void 0,{mapProps:r})}),[e,n]),m=ne(e,n),h=te(e,n),g=a?.css?.trim(),_=he(e,n).map(e=>(0,k.jsx)(`link`,{rel:`stylesheet`,precedence:`default`,href:D(e)},e));if(r!==`auto`)return(0,k.jsx)(_e.Provider,{value:{tenant:o||``,apiUrl:s||`/api`},children:(0,k.jsx)(ve.Provider,{value:c??null,children:(0,k.jsx)(ye.Provider,{value:p,children:(0,k.jsxs)(`div`,{style:{...d,...T(t,r),...i},children:[_,m&&(0,k.jsx)(`style`,{children:m}),h&&(0,k.jsx)(`style`,{children:h}),g&&(0,k.jsx)(`style`,{children:g}),f]})})})});let v=ce(t);return(0,k.jsx)(_e.Provider,{value:{tenant:o||``,apiUrl:s||`/api`},children:(0,k.jsx)(ve.Provider,{value:c??null,children:(0,k.jsx)(ye.Provider,{value:p,children:(0,k.jsxs)(`div`,{className:`webim-page`,style:{...d,...ue(t),...i},children:[(0,k.jsx)(`style`,{children:`.webim-page { ${Lt(le(v.light))} }
14
+ @media (prefers-color-scheme: dark) { .webim-page { ${Lt(le(v.dark))} } }`}),_,m&&(0,k.jsx)(`style`,{children:m}),h&&(0,k.jsx)(`style`,{children:h}),g&&(0,k.jsx)(`style`,{children:g}),f]})})})})}function zt({bundle:e,mode:t=`auto`,style:n}){return e?.blocks?.ROOT?(0,k.jsx)(Rt,{blocks:e.blocks,theme:e.theme,components:e.components,custom:e.custom,tenant:e.tenant,apiUrl:e.apiUrl,datasets:e.datasets,mode:t,style:n}):null}function Bt({apiUrl:e,tenant:t,slug:n,locale:r,preview:i,mode:a=`auto`,style:o,fallback:s=null,errorFallback:c=null,onLoad:u,onError:d}){let[f,p]=(0,l.useState)({status:`loading`}),m=(0,l.useRef)({onLoad:u,onError:d});return m.current={onLoad:u,onError:d},(0,l.useEffect)(()=>{let a=!0;return p({status:`loading`}),pe({apiUrl:e,tenant:t,slug:n,locale:r,preview:i}).then(e=>{a&&(p({status:`ready`,bundle:e}),m.current.onLoad?.(e))}).catch(e=>{a&&(p({status:`error`,error:e}),m.current.onError?.(e))}),()=>{a=!1}},[e,t,n,r,i]),f.status===`loading`?s:f.status===`error`?typeof c==`function`?c(f.error):c:(0,k.jsx)(zt,{bundle:f.bundle,mode:a,style:o})}function Vt(e,t={}){let n=(0,u.createRoot)(e);return n.render((0,k.jsx)(Bt,{apiUrl:t.apiUrl||t.api,tenant:t.tenant,slug:t.slug,locale:t.locale||void 0,mode:t.mode||`auto`,onError:e=>console.error(`[webim-embed]`,t.slug,e)})),n}function Ht(e=document){for(let t of e.querySelectorAll(`[data-webim-page]:not([data-webim-mounted])`))t.setAttribute(`data-webim-mounted`,``),Vt(t,t.dataset)}var Ut=document.currentScript,Wt=()=>{if(Ht(),Ut?.dataset.slug){let e=document.createElement(`div`);e.setAttribute(`data-webim-mounted`,``),Ut.parentElement&&Ut.parentElement!==document.head?Ut.insertAdjacentElement(`beforebegin`,e):document.body.appendChild(e),Vt(e,Ut.dataset)}};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Wt,{once:!0}):Wt(),window.WebimEmbed={mount:Vt,scan:Ht}})();