@bedrock-layout/solid 1.7.4 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("open-props"),l=require("solid-js"),M=require("@bedrock-layout/register-resize-callback"),p=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],ee=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...p]),te=new Set(["innerHTML","textContent","innerText","children"]),ne=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),ie=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function se(e,t){const n=ie[e];return typeof n=="object"?n[t]?n.$:void 0:n}const re=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),oe=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),ce={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function ae(e,t,n){let i=n.length,s=t.length,r=i,c=0,o=0,a=t[s-1].nextSibling,f=null;for(;c<s||o<r;){if(t[c]===n[o]){c++,o++;continue}for(;t[s-1]===n[r-1];)s--,r--;if(s===c){const u=r<i?o?n[o-1].nextSibling:n[r-o]:a;for(;o<r;)e.insertBefore(n[o++],u)}else if(r===o)for(;c<s;)(!f||!f.has(t[c]))&&t[c].remove(),c++;else if(t[c]===n[r-1]&&n[o]===t[s-1]){const u=t[--s].nextSibling;e.insertBefore(n[o++],t[c++].nextSibling),e.insertBefore(n[--r],u),t[s]=n[r]}else{if(!f){f=new Map;let g=o;for(;g<r;)f.set(n[g],g++)}const u=f.get(t[c]);if(u!=null)if(o<u&&u<r){let g=c,d=1,C;for(;++g<s&&g<r&&!((C=f.get(t[g]))==null||C!==u+d);)d++;if(d>u-o){const w=t[c];for(;o<u;)e.insertBefore(n[o++],w)}else e.replaceChild(n[o++],t[c++])}else c++;else t[c++].remove()}}}const L="_$DX_DELEGATE";function G(e,t,n,i){let s;const r=()=>{const o=document.createElement("template");return o.innerHTML=e,o.content.firstChild},c=t?()=>l.untrack(()=>document.importNode(s||(s=r()),!0)):()=>(s||(s=r())).cloneNode(!0);return c.cloneNode=c,c}function le(e,t=window.document){const n=t[L]||(t[L]=new Set);for(let i=0,s=e.length;i<s;i++){const r=e[i];n.has(r)||(n.add(r),t.addEventListener(r,Ce))}}function v(e,t,n){S(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function fe(e,t,n,i){S(e)||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function ue(e,t,n){S(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function de(e,t){S(e)||(t==null?e.removeAttribute("class"):e.className=t)}function ge(e,t,n,i){if(i)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const s=n[0];e.addEventListener(t,n[0]=r=>s.call(e,n[1],r))}else e.addEventListener(t,n,typeof n!="function"&&n)}function ye(e,t,n={}){const i=Object.keys(t||{}),s=Object.keys(n);let r,c;for(r=0,c=s.length;r<c;r++){const o=s[r];!o||o==="undefined"||t[o]||(R(e,o,!1),delete n[o])}for(r=0,c=i.length;r<c;r++){const o=i[r],a=!!t[o];!o||o==="undefined"||n[o]===a||!a||(R(e,o,!0),n[o]=a)}return n}function H(e,t,n){if(!t)return n?v(e,"style"):t;const i=e.style;if(typeof t=="string")return i.cssText=t;typeof n=="string"&&(i.cssText=n=void 0),n||(n={}),t||(t={});let s,r;for(r in n)t[r]==null&&i.removeProperty(r),delete n[r];for(r in t)s=t[r],s!==n[r]&&(i.setProperty(r,s),n[r]=s);return n}function me(e,t={},n,i){const s={};return l.createRenderEffect(()=>s.children=A(e,t.children,s.children)),l.createRenderEffect(()=>typeof t.ref=="function"&&_(t.ref,e)),l.createRenderEffect(()=>he(e,t,n,!0,s,!0)),s}function _(e,t,n){return l.untrack(()=>e(t,n))}function V(e,t,n,i){if(typeof t!="function")return A(e,t,i,n);l.createRenderEffect(s=>A(e,t(),s,n),i)}function he(e,t,n,i,s={},r=!1){t||(t={});for(const c in s)if(!(c in t)){if(c==="children")continue;s[c]=W(e,c,null,s[c],n,r,t)}for(const c in t){if(c==="children")continue;const o=t[c];s[c]=W(e,c,o,s[c],n,r,t)}}function be(e){let t,n;return!S()||!(t=l.sharedConfig.registry.get(n=Se()))?e():(l.sharedConfig.completed&&l.sharedConfig.completed.add(t),l.sharedConfig.registry.delete(n),t)}function S(e){return!!l.sharedConfig.context&&!l.sharedConfig.done&&(!e||e.isConnected)}function $e(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function R(e,t,n){const i=t.trim().split(/\s+/);for(let s=0,r=i.length;s<r;s++)e.classList.toggle(i[s],n)}function W(e,t,n,i,s,r,c){let o,a,f,u,g;if(t==="style")return H(e,n,i);if(t==="classList")return ye(e,n,i);if(n===i)return i;if(t==="ref")r||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);i&&e.removeEventListener(d,i,typeof i!="function"&&i),n&&e.addEventListener(d,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);i&&e.removeEventListener(d,i,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),C=re.has(d);if(!C&&i){const w=Array.isArray(i)?i[0]:i;e.removeEventListener(d,w)}(C||n)&&(ge(e,d,n,C),C&&le([d]))}else if(t.slice(0,5)==="attr:")v(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")ue(e,t.slice(5),n);else if((g=t.slice(0,5)==="prop:")||(f=te.has(t))||!s&&((u=se(t,e.tagName))||(a=ee.has(t)))||(o=e.nodeName.includes("-")||"is"in c)){if(g)t=t.slice(5),a=!0;else if(S(e))return n;t==="class"||t==="className"?de(e,n):o&&!a&&!f?e[$e(t)]=n:e[u||t]=n}else{const d=s&&t.indexOf(":")>-1&&ce[t.split(":")[0]];d?fe(e,d,t,n):v(e,ne[t]||t,n)}return n}function Ce(e){if(l.sharedConfig.registry&&l.sharedConfig.events&&l.sharedConfig.events.find(([a,f])=>f===e))return;let t=e.target;const n=`$$${e.type}`,i=e.target,s=e.currentTarget,r=a=>Object.defineProperty(e,"target",{configurable:!0,value:a}),c=()=>{const a=t[n];if(a&&!t.disabled){const f=t[`${n}Data`];if(f!==void 0?a.call(t,f,e):a.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&r(t.host),!0},o=()=>{for(;c()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),l.sharedConfig.registry&&!l.sharedConfig.done&&(l.sharedConfig.done=_$HY.done=!0),e.composedPath){const a=e.composedPath();r(a[0]);for(let f=0;f<a.length-2&&(t=a[f],!!c());f++){if(t._$host){t=t._$host,o();break}if(t.parentNode===s)break}}else o();r(i)}function A(e,t,n,i,s){const r=S(e);if(r){!n&&(n=[...e.childNodes]);let o=[];for(let a=0;a<n.length;a++){const f=n[a];f.nodeType===8&&f.data.slice(0,2)==="!$"?f.remove():o.push(f)}n=o}for(;typeof n=="function";)n=n();if(t===n)return n;const c=typeof t;if(e=e,c==="string"||c==="number"){if(r||c==="number"&&(t=t.toString(),t===n))return n;n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||c==="boolean"){if(r)return n;n=E(e,n,i)}else{if(c==="function")return l.createRenderEffect(()=>{let o=t();for(;typeof o=="function";)o=o();n=A(e,o,n,i)}),()=>n;if(Array.isArray(t)){const o=[],a=n&&Array.isArray(n);if(O(o,t,n,s))return l.createRenderEffect(()=>n=A(e,o,n,i,!0)),()=>n;if(r)return o.length?n=[...e.childNodes]:n;o.length===0?n=E(e,n,i):a?n.length===0?B(e,o,i):ae(e,n,o):(n&&E(e),B(e,o)),n=o}else if(t.nodeType){if(r&&t.parentNode)return n=t;Array.isArray(n)?E(e,n,null,t):n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild),n=t}}return n}function O(e,t,n,i){let s=!1;for(let r=0,c=t.length;r<c;r++){let o=t[r],a=n&&n[e.length],f;if(!(o==null||o===!0||o===!1))if((f=typeof o)=="object"&&o.nodeType)e.push(o);else if(Array.isArray(o))s=O(e,o,a)||s;else if(f==="function")if(i){for(;typeof o=="function";)o=o();s=O(e,Array.isArray(o)?o:[o],Array.isArray(a)?a:[a])||s}else e.push(o),s=!0;else{const u=String(o);a&&a.nodeType===3&&a.data===u?e.push(a):e.push(document.createTextNode(u))}}return s}function B(e,t,n=null){for(let i=0,s=t.length;i<s;i++)e.insertBefore(t[i],n)}function E(e,t,n,i){if(n===void 0)return e.textContent="";const s=i||document.createTextNode("");if(t.length){let r=!1;for(let c=t.length-1;c>=0;c--){const o=t[c];if(s!==o){const a=o.parentNode===e;!r&&!c?a?e.replaceChild(s,o):e.insertBefore(s,n):a&&o.remove()}else r=!0}}else e.insertBefore(s,n);return[s]}function Se(){return l.sharedConfig.getNextContextId()}const xe="http://www.w3.org/2000/svg";function we(e,t=!1){return t?document.createElementNS(xe,e):document.createElement(e)}function je(e,t){const n=l.createMemo(e);return l.createMemo(()=>{const i=n();switch(typeof i){case"function":return l.untrack(()=>i(t));case"string":const s=oe.has(i),r=l.sharedConfig.context?be():we(i,s);return me(r,t,s),r}})}function Ae(e){const[,t]=l.splitProps(e,["component"]);return je(()=>e.component,t)}function x(e){return e??void 0}function y(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,i)=>Object.defineProperty({...n},i,{get(){return e[i]},configurable:!0,enumerable:!0}),{})}function m(e,t){return l.createComponent(Ae,l.mergeProps({get component(){return e()}},t))}function h(e){return Object.values(e).every(t=>typeof t=="function")?Object.keys(e).reduce((t,n)=>{const i=e[n];return Object.defineProperty(t,n,{get(){return i()},configurable:!0,enumerable:!0})},{}):new Error("Please provide an object with accessor values only.")}const F=/^--\D{1}.{0,100}$/;function X(e){return F.test(e)}function T(e){return typeof e!="string"?!1:[/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/,/^var\(--\D{1}.{0,100}\)$/,F].some(t=>t.test(e))}const{sizeXxs:Pe,sizeXs:Ee,sizeSm:Me,sizeMd:Te,sizeLg:Ie,sizeXl:ve,sizeXxl:Oe,sizeContent1:ze,sizeContent2:Ne,sizeContent3:ke,sizeHeader1:Le,sizeHeader2:Re,sizeHeader3:We,size000:Be,size00:De,size1:Ge,size2:He,size3:_e,size4:Ve,size5:Fe,size6:Xe,size7:Ue,size8:qe,size9:Qe,size10:Je,size11:Ye,size12:Ze,size13:Ke,size14:pe,size15:et}=K,tt={size000:Be,size00:De,size1:Ge,size2:He,size3:_e,size4:Ve,size5:Fe,size6:Xe,size7:Ue,size8:qe,size9:Qe,size10:Je,size11:Ye,size12:Ze,size13:Ke,size14:pe,size15:et},nt={sizeXxs:Pe,sizeXs:Ee,sizeSm:Me,sizeMd:Te,sizeLg:Ie,sizeXl:ve,sizeXxl:Oe,sizeContent1:ze,sizeContent2:Ne,sizeContent3:ke,sizeHeader1:Le,sizeHeader2:Re,sizeHeader3:We},U=tt,q=nt;function Q(e){return e.reduce((t,[n,i])=>({...t,[n]:i}),{})}function z(e,t){if(t!==void 0)return typeof t=="number"&&t>=0?`${t}px`:typeof t=="string"&&T(t)?X(t)?`var(${t})`:t:x(b(e,t))}function b(e,t){const n=e.space??U,i=Q(Object.entries(n).map(([s,r])=>[s,typeof r=="number"?`${r}px`:r]));return x(i[t])}function P(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&T(t))return X(t)?`var(${t})`:t;const n=e.sizes??q,i=Q(Object.entries(n).map(([s,r])=>[s,typeof r=="number"?`${r}px`:r]));return x(i[t])}function it(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function st(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),n=()=>`--maxWidth: ${it(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",s=()=>e.centerChildren?"center-children":"",r=()=>[i(),s()].filter(Boolean).join(" "),c=()=>[t(),n()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","maxWidth","centerText","centerChildren"]),h({style:c,"data-br-center":r})))}const J=l.createContext({});function rt(e){return l.createComponent(J.Provider,{get value(){return e.theme},get children(){return e.children}})}function $(){try{return l.useContext(J)}catch{return{}}}function ot(e,t){return P(e,t)}function ct(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minItemWidth: ${ot(t,e.minItemWidth)}`,r=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",c=()=>[n(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter","minItemWidth","noStretchedColumns"]),h({style:c,"data-br-column-drop":r})))}function at(e,t){const[n,i]=l.createSignal(!1),[s,r]=l.createSignal();return l.onMount(()=>{M.init()}),l.createEffect(()=>{if(x(s())===void 0)return;t&&t(s());const c=M.registerCallback(s(),o=>{var f;const a=((f=o.borderBoxSize)==null?void 0:f.inlineSize)??o.contentRect.width;if(a>0){const u=a<=e;i(u)}});l.onCleanup(c)}),[n,r]}function lt(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000} {0,1}\/ {0,1}\d{1,1000}$/.test(e)}function ft(e){return Array.isArray(e)?e.join("/"):e}function ut(e){return lt(e)?ft(e):void 0}function dt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),n=()=>ut(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",s=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",r=()=>[t(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","ratio","position"]),h({style:r,"data-br-frame":()=>""})))}function Y(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,r=()=>[n(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter","minItemWidth"]),h({style:r,"data-br-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const j=96;function Z(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function k(e,t){if(!e)return;const n=t??document.body,i=(e??"px").trim().toLowerCase();switch(i){case"vmin":case"vmax":case"vh":case"vw":case"%":return;case"ch":case"ex":return gt(i,n);case"em":return N(n,"font-size");case"rem":return N(document.body,"font-size");case"in":return j;case"cm":return j/2.54;case"mm":return j/25.4;case"pt":return j/72;case"pc":return j/6;case"px":return 1;default:{const[s,r]=Z(i);if(isNaN(s))return;if(!r)return s;const c=k(r,t);return typeof c=="number"?s*c:void 0}}}function N(e,t){const[n,i]=Z(getComputedStyle(e).getPropertyValue(t));return n*(k(i,e)??1)}function gt(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=N(n,"height")/128;return t.removeChild(n),i}var yt=G("<div>");const I=1,mt=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,ht=e=>{const[t,n]=l.createSignal(1),[i,s]=l.createSignal(),r=$();return l.onMount(()=>(M.init(),0)),l.createEffect(()=>{const c=x(i());if(c===void 0)return;const o=M.registerCallback(c,({target:a})=>{n(1);const f=e.gutter?b(r,e.gutter)??"1px":"1px",u=mt?k(f,a):void 0,g=Math.max(u??I,I),[d]=Array.from(a.children),C=1+Math.min(a.scrollHeight,d.scrollHeight),w=Math.max(Math.ceil(C/g),I);return n(w),0});return l.onCleanup(o),0}),(()=>{var c=yt();return _(s,c),V(c,()=>e.children),l.createRenderEffect(o=>H(c,`grid-row: span ${t()};`,o)),c})()},bt=e=>{const t=l.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(s=>l.createComponent(ht,{get gutter(){return e.gutter},children:s}));return l.createComponent(Y,l.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},$t={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},Ct={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function St(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,u])=>a+`${f}:${u};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>e.justify!==void 0?$t[e.justify]:void 0,r=()=>e.align!==void 0?Ct[e.align]:void 0,c=()=>[n(),i()].join("; "),o=()=>[s(),r()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter","justify","align"]),h({style:c,"data-br-inline-cluster":o})))}const xt={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},wt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function jt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((g,[d,C])=>g+`${d}:${C};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,r=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",c=()=>e.justify!==void 0?xt[e.justify]:void 0,o=()=>e.align!==void 0?wt[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,f=()=>[n(),i(),r(),s()].join("; "),u=()=>[c(),o(),a()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter","justify","align","stretch","switchAt"]),h({style:f,"data-br-inline":u})))}const At=e=>({left:"padding-inline-start",right:"padding-inline-end",top:"padding-block-start",bottom:"padding-block-end",inlineStart:"padding-inline-start",inlineEnd:"padding-inline-end",blockStart:"padding-block-start",blockEnd:"padding-block-end"})[e],Pt=(e,t)=>{if(!t)return"";if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const n=typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((i,[s,r])=>({...i,[At(s)]:z(e,r)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>z(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[s,r])=>i+`${s}:${r};`,"")};function Et(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[c,o])=>r+`${c}:${o};`,""),i=()=>Pt(t,e.padding),s=()=>[n(),i()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","padding"]),h({style:s,"data-br-padbox":()=>""})))}function Mt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>{switch(e.snapType){case"none":return"snapType:none";case"proximity":return"snapType:proximity";case"mandatory":return"snapType:mandatory";default:return"snapType:none"}},r=()=>[n(),i()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter"]),h({style:r,"data-br-reel":s})))}const D={"1/4":"fraction:1/4","1/3":"fraction:1/3","1/2":"fraction:1/2","2/3":"fraction:2/3","3/4":"fraction:3/4","auto-start":"fraction:auto-start","auto-end":"fraction:auto-end"};function Tt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,u])=>a+`${f}:${u};`,""),i=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",s=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>D[e.fraction??"1/2"]??D["1/2"],c=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>[n(),s(),i(),c()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter","fraction"]),h({style:o,"data-br-split":r})))}const It={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function vt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>[n(),i()].join("; "),r=()=>e.align!==void 0?It[e.align]:void 0,c=()=>[r()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter"]),h({style:s,"data-br-stack":c})))}var Ot=G("<div data-br-cover-centered>");function zt(e){return typeof e=="number"?`${e}px`:e&&T(e)?e:"100vh"}function Nt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minHeight: ${zt(e.minHeight)};`,r=()=>e.variant==="stretch-content"||e.stretchContent===!0?"stretch-content":"",c=()=>[n(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","minHeight","stretchContent"]),h({style:c,"data-br-cover":r})))}function kt(e){const[t,n]=l.splitProps(e,["children","top","bottom"]);return l.createComponent(Nt,l.mergeProps(n,{get children(){return[l.createMemo(()=>t.top),(()=>{var i=Ot();return V(i,()=>t.children),i})(),l.createMemo(()=>t.bottom)]}}))}function Lt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--columns: ${x(Math.max(e.colCount??e.columns??1,1))??1};`,r=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",c=()=>[n(),i(),s(),r()].filter(Boolean).join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter","columns","colCount","switchAt"]),h({style:c,"data-br-columns":()=>""})))}const Rt=e=>typeof e=="number"?e:1;function Wt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),n=()=>`--span: ${Rt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",s=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",r=()=>[t(),n(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","span","offsetStart","offsetEnd"]),h({style:r,"data-br-column":()=>""})))}exports.Center=st;exports.Column=Wt;exports.ColumnDrop=ct;exports.Columns=Lt;exports.Cover=kt;exports.Frame=dt;exports.Grid=Y;exports.Inline=jt;exports.InlineCluster=St;exports.MasonryGrid=bt;exports.PadBox=Et;exports.Reel=Mt;exports.Split=Tt;exports.Stack=vt;exports.ThemeProvider=rt;exports.checkIsCSSLength=T;exports.createContainerQuery=at;exports.getSafeGutter=z;exports.getSizeValue=P;exports.getSpacingValue=b;exports.sizes=q;exports.spacing=U;exports.useTheme=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("open-props"),l=require("solid-js"),I=require("@bedrock-layout/register-resize-callback"),ee=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],te=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...ee]),ne=new Set(["innerHTML","textContent","innerText","children"]),ie=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),se=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function re(e,t){const n=se[e];return typeof n=="object"?n[t]?n.$:void 0:n}const oe=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ce=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),ae={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},N=e=>l.createMemo(()=>e());function le(e,t,n){let i=n.length,s=t.length,r=i,c=0,o=0,a=t[s-1].nextSibling,f=null;for(;c<s||o<r;){if(t[c]===n[o]){c++,o++;continue}for(;t[s-1]===n[r-1];)s--,r--;if(s===c){const u=r<i?o?n[o-1].nextSibling:n[r-o]:a;for(;o<r;)e.insertBefore(n[o++],u)}else if(r===o)for(;c<s;)(!f||!f.has(t[c]))&&t[c].remove(),c++;else if(t[c]===n[r-1]&&n[o]===t[s-1]){const u=t[--s].nextSibling;e.insertBefore(n[o++],t[c++].nextSibling),e.insertBefore(n[--r],u),t[s]=n[r]}else{if(!f){f=new Map;let g=o;for(;g<r;)f.set(n[g],g++)}const u=f.get(t[c]);if(u!=null)if(o<u&&u<r){let g=c,d=1,C;for(;++g<s&&g<r&&!((C=f.get(t[g]))==null||C!==u+d);)d++;if(d>u-o){const A=t[c];for(;o<u;)e.insertBefore(n[o++],A)}else e.replaceChild(n[o++],t[c++])}else c++;else t[c++].remove()}}}const L="_$DX_DELEGATE";function F(e,t,n,i){let s;const r=()=>{const o=document.createElement("template");return o.innerHTML=e,o.content.firstChild},c=t?()=>l.untrack(()=>document.importNode(s||(s=r()),!0)):()=>(s||(s=r())).cloneNode(!0);return c.cloneNode=c,c}function fe(e,t=window.document){const n=t[L]||(t[L]=new Set);for(let i=0,s=e.length;i<s;i++){const r=e[i];n.has(r)||(n.add(r),t.addEventListener(r,we))}}function O(e,t,n){w(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ue(e,t,n,i){w(e)||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function de(e,t,n){w(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function ge(e,t){w(e)||(t==null?e.removeAttribute("class"):e.className=t)}function he(e,t,n,i){if(i)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const s=n[0];e.addEventListener(t,n[0]=r=>s.call(e,n[1],r))}else e.addEventListener(t,n,typeof n!="function"&&n)}function me(e,t,n={}){const i=Object.keys(t||{}),s=Object.keys(n);let r,c;for(r=0,c=s.length;r<c;r++){const o=s[r];!o||o==="undefined"||t[o]||(D(e,o,!1),delete n[o])}for(r=0,c=i.length;r<c;r++){const o=i[r],a=!!t[o];!o||o==="undefined"||n[o]===a||!a||(D(e,o,!0),n[o]=a)}return n}function V(e,t,n){if(!t)return n?O(e,"style"):t;const i=e.style;if(typeof t=="string")return i.cssText=t;typeof n=="string"&&(i.cssText=n=void 0),n||(n={}),t||(t={});let s,r;for(r in n)t[r]==null&&i.removeProperty(r),delete n[r];for(r in t)s=t[r],s!==n[r]&&(i.setProperty(r,s),n[r]=s);return n}function ye(e,t={},n,i){const s={};return l.createRenderEffect(()=>s.children=j(e,t.children,s.children)),l.createRenderEffect(()=>typeof t.ref=="function"&&H(t.ref,e)),l.createRenderEffect(()=>be(e,t,n,!0,s,!0)),s}function H(e,t,n){return l.untrack(()=>e(t,n))}function _(e,t,n,i){if(typeof t!="function")return j(e,t,i,n);l.createRenderEffect(s=>j(e,t(),s,n),i)}function be(e,t,n,i,s={},r=!1){t||(t={});for(const c in s)if(!(c in t)){if(c==="children")continue;s[c]=W(e,c,null,s[c],n,r,t)}for(const c in t){if(c==="children")continue;const o=t[c];s[c]=W(e,c,o,s[c],n,r,t)}}function $e(e){let t,n;return!w()||!(t=l.sharedConfig.registry.get(n=Se()))?e():(l.sharedConfig.completed&&l.sharedConfig.completed.add(t),l.sharedConfig.registry.delete(n),t)}function w(e){return!!l.sharedConfig.context&&!l.sharedConfig.done&&(!e||e.isConnected)}function Ce(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function D(e,t,n){const i=t.trim().split(/\s+/);for(let s=0,r=i.length;s<r;s++)e.classList.toggle(i[s],n)}function W(e,t,n,i,s,r,c){let o,a,f,u,g;if(t==="style")return V(e,n,i);if(t==="classList")return me(e,n,i);if(n===i)return i;if(t==="ref")r||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);i&&e.removeEventListener(d,i,typeof i!="function"&&i),n&&e.addEventListener(d,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);i&&e.removeEventListener(d,i,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),C=oe.has(d);if(!C&&i){const A=Array.isArray(i)?i[0]:i;e.removeEventListener(d,A)}(C||n)&&(he(e,d,n,C),C&&fe([d]))}else if(t.slice(0,5)==="attr:")O(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")de(e,t.slice(5),n);else if((g=t.slice(0,5)==="prop:")||(f=ne.has(t))||!s&&((u=re(t,e.tagName))||(a=te.has(t)))||(o=e.nodeName.includes("-")||"is"in c)){if(g)t=t.slice(5),a=!0;else if(w(e))return n;t==="class"||t==="className"?ge(e,n):o&&!a&&!f?e[Ce(t)]=n:e[u||t]=n}else{const d=s&&t.indexOf(":")>-1&&ae[t.split(":")[0]];d?ue(e,d,t,n):O(e,ie[t]||t,n)}return n}function we(e){if(l.sharedConfig.registry&&l.sharedConfig.events&&l.sharedConfig.events.find(([a,f])=>f===e))return;let t=e.target;const n=`$$${e.type}`,i=e.target,s=e.currentTarget,r=a=>Object.defineProperty(e,"target",{configurable:!0,value:a}),c=()=>{const a=t[n];if(a&&!t.disabled){const f=t[`${n}Data`];if(f!==void 0?a.call(t,f,e):a.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&r(t.host),!0},o=()=>{for(;c()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),l.sharedConfig.registry&&!l.sharedConfig.done&&(l.sharedConfig.done=_$HY.done=!0),e.composedPath){const a=e.composedPath();r(a[0]);for(let f=0;f<a.length-2&&(t=a[f],!!c());f++){if(t._$host){t=t._$host,o();break}if(t.parentNode===s)break}}else o();r(i)}function j(e,t,n,i,s){const r=w(e);if(r){!n&&(n=[...e.childNodes]);let o=[];for(let a=0;a<n.length;a++){const f=n[a];f.nodeType===8&&f.data.slice(0,2)==="!$"?f.remove():o.push(f)}n=o}for(;typeof n=="function";)n=n();if(t===n)return n;const c=typeof t;if(e=e,c==="string"||c==="number"){if(r||c==="number"&&(t=t.toString(),t===n))return n;n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||c==="boolean"){if(r)return n;n=E(e,n,i)}else{if(c==="function")return l.createRenderEffect(()=>{let o=t();for(;typeof o=="function";)o=o();n=j(e,o,n,i)}),()=>n;if(Array.isArray(t)){const o=[],a=n&&Array.isArray(n);if(v(o,t,n,s))return l.createRenderEffect(()=>n=j(e,o,n,i,!0)),()=>n;if(r)return o.length?n=[...e.childNodes]:n;o.length===0?n=E(e,n,i):a?n.length===0?B(e,o,i):le(e,n,o):(n&&E(e),B(e,o)),n=o}else if(t.nodeType){if(r&&t.parentNode)return n=t;Array.isArray(n)?E(e,n,null,t):n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild),n=t}}return n}function v(e,t,n,i){let s=!1;for(let r=0,c=t.length;r<c;r++){let o=t[r],a=n&&n[e.length],f;if(!(o==null||o===!0||o===!1))if((f=typeof o)=="object"&&o.nodeType)e.push(o);else if(Array.isArray(o))s=v(e,o,a)||s;else if(f==="function")if(i){for(;typeof o=="function";)o=o();s=v(e,Array.isArray(o)?o:[o],Array.isArray(a)?a:[a])||s}else e.push(o),s=!0;else{const u=String(o);a&&a.nodeType===3&&a.data===u?e.push(a):e.push(document.createTextNode(u))}}return s}function B(e,t,n=null){for(let i=0,s=t.length;i<s;i++)e.insertBefore(t[i],n)}function E(e,t,n,i){if(n===void 0)return e.textContent="";const s=i||document.createTextNode("");if(t.length){let r=!1;for(let c=t.length-1;c>=0;c--){const o=t[c];if(s!==o){const a=o.parentNode===e;!r&&!c?a?e.replaceChild(s,o):e.insertBefore(s,n):a&&o.remove()}else r=!0}}else e.insertBefore(s,n);return[s]}function Se(){return l.sharedConfig.getNextContextId()}const Ae="http://www.w3.org/2000/svg";function xe(e,t=!1,n=void 0){return t?document.createElementNS(Ae,e):document.createElement(e,{is:n})}function je(e,t){const n=l.createMemo(e);return l.createMemo(()=>{const i=n();switch(typeof i){case"function":return l.untrack(()=>i(t));case"string":const s=ce.has(i),r=l.sharedConfig.context?$e():xe(i,s,l.untrack(()=>t.is));return ye(r,t,s),r}})}function Pe(e){const[,t]=l.splitProps(e,["component"]);return je(()=>e.component,t)}function S(e){return e??void 0}function h(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,i)=>Object.defineProperty({...n},i,{get(){return e[i]},configurable:!0,enumerable:!0}),{})}function m(e,t){return l.createComponent(Pe,l.mergeProps({get component(){return e()}},t))}function y(e){return Object.values(e).every(t=>typeof t=="function")?Object.keys(e).reduce((t,n)=>{const i=e[n];return Object.defineProperty(t,n,{get(){return i()},configurable:!0,enumerable:!0})},{}):new Error("Please provide an object with accessor values only.")}const U=/^--\D{1}.{0,100}$/;function X(e){return U.test(e)}function M(e){return typeof e!="string"?!1:[/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/,/^var\(--\D{1}.{0,100}\)$/,U].some(t=>t.test(e))}const{sizeXxs:Ee,sizeXs:Ie,sizeSm:Me,sizeMd:Te,sizeLg:Oe,sizeXl:ve,sizeXxl:ze,sizeContent1:ke,sizeContent2:Re,sizeContent3:Ne,sizeHeader1:Le,sizeHeader2:De,sizeHeader3:We,size000:Be,size00:Ge,size1:Fe,size2:Ve,size3:He,size4:_e,size5:Ue,size6:Xe,size7:qe,size8:Qe,size9:Je,size10:Ye,size11:Ze,size12:Ke,size13:pe,size14:et,size15:tt}=p,nt={size000:Be,size00:Ge,size1:Fe,size2:Ve,size3:He,size4:_e,size5:Ue,size6:Xe,size7:qe,size8:Qe,size9:Je,size10:Ye,size11:Ze,size12:Ke,size13:pe,size14:et,size15:tt},it={sizeXxs:Ee,sizeXs:Ie,sizeSm:Me,sizeMd:Te,sizeLg:Oe,sizeXl:ve,sizeXxl:ze,sizeContent1:ke,sizeContent2:Re,sizeContent3:Ne,sizeHeader1:Le,sizeHeader2:De,sizeHeader3:We},q=nt,Q=it;function J(e){return e.reduce((t,[n,i])=>({...t,[n]:i}),{})}function z(e,t){if(t!==void 0)return typeof t=="number"&&t>=0?`${t}px`:typeof t=="string"&&M(t)?X(t)?`var(${t})`:t:S(b(e,t))}function b(e,t){const n=e.space??q,i=J(Object.entries(n).map(([s,r])=>[s,typeof r=="number"?`${r}px`:r]));return S(i[t])}function P(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&M(t))return X(t)?`var(${t})`:t;const n=e.sizes??Q,i=J(Object.entries(n).map(([s,r])=>[s,typeof r=="number"?`${r}px`:r]));return S(i[t])}function st(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function rt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),n=()=>`--maxWidth: ${st(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",s=()=>e.centerChildren?"center-children":"",r=()=>[i(),s()].filter(Boolean).join(" "),c=()=>[t(),n()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","maxWidth","centerText","centerChildren"]),y({style:c,"data-br-center":r})))}const Y=l.createContext({});function ot(e){return l.createComponent(Y.Provider,{get value(){return e.theme},get children(){return e.children}})}function $(){try{return l.useContext(Y)}catch{return{}}}function ct(e,t){return P(e,t)}function at(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minItemWidth: ${ct(t,e.minItemWidth)}`,r=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",c=()=>[n(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter","minItemWidth","noStretchedColumns"]),y({style:c,"data-br-column-drop":r})))}function lt(e,t){const[n,i]=l.createSignal(!1),[s,r]=l.createSignal();return l.onMount(()=>{I.init()}),l.createEffect(()=>{if(S(s())===void 0)return;t&&t(s());const c=I.registerCallback(s(),o=>{var f;const a=((f=o.borderBoxSize)==null?void 0:f.inlineSize)??o.contentRect.width;if(a>0){const u=a<=e;i(u)}});l.onCleanup(c)}),[n,r]}function ft(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000} {0,1}\/ {0,1}\d{1,1000}$/.test(e)}function ut(e){return Array.isArray(e)?e.join("/"):e}function dt(e){return ft(e)?ut(e):void 0}function gt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),n=()=>dt(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",s=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",r=()=>[t(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","ratio","position"]),y({style:r,"data-br-frame":()=>""})))}function Z(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,r=()=>[n(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter","minItemWidth"]),y({style:r,"data-br-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const x=96;function K(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function R(e,t){if(!e)return;const n=t??document.body,i=(e??"px").trim().toLowerCase();switch(i){case"vmin":case"vmax":case"vh":case"vw":case"%":return;case"ch":case"ex":return ht(i,n);case"em":return k(n,"font-size");case"rem":return k(document.body,"font-size");case"in":return x;case"cm":return x/2.54;case"mm":return x/25.4;case"pt":return x/72;case"pc":return x/6;case"px":return 1;default:{const[s,r]=K(i);if(isNaN(s))return;if(!r)return s;const c=R(r,t);return typeof c=="number"?s*c:void 0}}}function k(e,t){const[n,i]=K(getComputedStyle(e).getPropertyValue(t));return n*(R(i,e)??1)}function ht(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=k(n,"height")/128;return t.removeChild(n),i}var mt=F("<div>");const T=1,yt=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,bt=e=>{const[t,n]=l.createSignal(1),[i,s]=l.createSignal(),r=$();return l.onMount(()=>(I.init(),0)),l.createEffect(()=>{const c=S(i());if(c===void 0)return;const o=I.registerCallback(c,({target:a})=>{n(1);const f=e.gutter?b(r,e.gutter)??"1px":"1px",u=yt?R(f,a):void 0,g=Math.max(u??T,T),[d]=Array.from(a.children),C=1+Math.min(a.scrollHeight,d.scrollHeight),A=Math.max(Math.ceil(C/g),T);return n(A),0});return l.onCleanup(o),0}),(()=>{var c=mt();return H(s,c),_(c,()=>e.children),l.createRenderEffect(o=>V(c,`grid-row: span ${t()};`,o)),c})()},$t=e=>{const t=l.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(s=>l.createComponent(bt,{get gutter(){return e.gutter},children:s}));return l.createComponent(Z,l.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},Ct={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},wt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function St(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,u])=>a+`${f}:${u};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>e.justify!==void 0?Ct[e.justify]:void 0,r=()=>e.align!==void 0?wt[e.align]:void 0,c=()=>[n(),i()].join("; "),o=()=>[s(),r()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter","justify","align"]),y({style:c,"data-br-inline-cluster":o})))}const At={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},xt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function jt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((g,[d,C])=>g+`${d}:${C};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,r=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",c=()=>e.justify!==void 0?At[e.justify]:void 0,o=()=>e.align!==void 0?xt[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,f=()=>[n(),i(),r(),s()].join("; "),u=()=>[c(),o(),a()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter","justify","align","stretch","switchAt"]),y({style:f,"data-br-inline":u})))}const Pt=e=>({left:"padding-inline-start",right:"padding-inline-end",top:"padding-block-start",bottom:"padding-block-end",inlineStart:"padding-inline-start",inlineEnd:"padding-inline-end",blockStart:"padding-block-start",blockEnd:"padding-block-end"})[e],Et=(e,t)=>{if(!t)return"";if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const n=typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((i,[s,r])=>({...i,[Pt(s)]:z(e,r)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>z(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[s,r])=>i+`${s}:${r};`,"")};function It(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[c,o])=>r+`${c}:${o};`,""),i=()=>Et(t,e.padding),s=()=>[n(),i()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","padding"]),y({style:s,"data-br-padbox":()=>""})))}function Mt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>{switch(e.snapType){case"none":return"snapType:none";case"proximity":return"snapType:proximity";case"mandatory":return"snapType:mandatory";default:return"snapType:none"}},r=()=>[n(),i()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter"]),y({style:r,"data-br-reel":s})))}const G={"1/4":"fraction:1/4","1/3":"fraction:1/3","1/2":"fraction:1/2","2/3":"fraction:2/3","3/4":"fraction:3/4","auto-start":"fraction:auto-start","auto-end":"fraction:auto-end"};function Tt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,u])=>a+`${f}:${u};`,""),i=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",s=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>G[e.fraction??"1/2"]??G["1/2"],c=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>[n(),s(),i(),c()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter","fraction"]),y({style:o,"data-br-split":r})))}const Ot={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function vt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>[n(),i()].join("; "),r=()=>e.align!==void 0?Ot[e.align]:void 0,c=()=>[r()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter"]),y({style:s,"data-br-stack":c})))}var zt=F("<div data-br-cover-centered>");function kt(e){return typeof e=="number"?`${e}px`:e&&M(e)?e:"100vh"}function Rt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minHeight: ${kt(e.minHeight)};`,r=()=>e.variant==="stretch-content"||e.stretchContent===!0?"stretch-content":"",c=()=>[n(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","minHeight","stretchContent"]),y({style:c,"data-br-cover":r})))}function Nt(e){const[t,n]=l.splitProps(e,["children","top","bottom"]);return l.createComponent(Rt,l.mergeProps(n,{get children(){return[N(()=>t.top),(()=>{var i=zt();return _(i,()=>t.children),i})(),N(()=>t.bottom)]}}))}function Lt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--columns: ${S(Math.max(e.colCount??e.columns??1,1))??1};`,r=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",c=()=>[n(),i(),s(),r()].filter(Boolean).join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter","columns","colCount","switchAt"]),y({style:c,"data-br-columns":()=>""})))}const Dt=e=>typeof e=="number"?e:1;function Wt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),n=()=>`--span: ${Dt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",s=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",r=()=>[t(),n(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","span","offsetStart","offsetEnd"]),y({style:r,"data-br-column":()=>""})))}exports.Center=rt;exports.Column=Wt;exports.ColumnDrop=at;exports.Columns=Lt;exports.Cover=Nt;exports.Frame=gt;exports.Grid=Z;exports.Inline=jt;exports.InlineCluster=St;exports.MasonryGrid=$t;exports.PadBox=It;exports.Reel=Mt;exports.Split=Tt;exports.Stack=vt;exports.ThemeProvider=ot;exports.checkIsCSSLength=M;exports.createContainerQuery=lt;exports.getSafeGutter=z;exports.getSizeValue=P;exports.getSpacingValue=b;exports.sizes=Q;exports.spacing=q;exports.useTheme=$;