@pure-ds/core 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- var kr=Object.defineProperty;var Sr=(r,e)=>()=>(r&&(e=r(r=0)),e);var ft=(r,e)=>{for(var t in e)kr(r,t,{get:e[t],enumerable:!0})};var ar={};ft(ar,{AutoDefiner:()=>ct});async function no(...r){let e={};r.length&&typeof r[r.length-1]=="object"&&(e=r.pop()||{});let t=r,{baseURL:s,mapper:o=l=>`${l}.js`,onError:i=(l,d)=>console.error(`[defineWebComponents] ${l}:`,d)}=e,a=s?new URL(s,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),n=l=>l.toLowerCase().replace(/(^|-)([a-z])/g,(d,p,h)=>h.toUpperCase()),c=async l=>{try{if(customElements.get(l))return{tag:l,status:"already-defined"};let d=o(l),h=await import(d instanceof URL?d.href:new URL(d,a).href),m=h?.default??h?.[n(l)];if(!m){if(customElements.get(l))return{tag:l,status:"self-defined"};throw new Error(`No export found for ${l}. Expected default export or named export "${n(l)}".`)}return customElements.get(l)?{tag:l,status:"race-already-defined"}:(customElements.define(l,m),{tag:l,status:"defined"})}catch(d){throw i(l,d),d}};return Promise.all(t.map(c))}var ct,nr=Sr(()=>{ct=class{constructor(e={}){let{baseURL:t,mapper:s,onError:o,predicate:i=()=>!0,attributeModule:a="data-module",root:n=document,scanExisting:c=!0,debounceMs:l=16,observeShadows:d=!0,enhancers:p=[],patchAttachShadow:h=!0}=e,m=new Set,b=new Set,f=new Set,y=new Map,T=new WeakMap,N=new WeakMap,R=0,C=!1,A=null,_=v=>{if(!v||!p.length)return;let x=N.get(v);x||(x=new Set,N.set(v,x));for(let w of p)if(!(!w.selector||!w.run)&&!x.has(w.selector))try{v.matches&&v.matches(w.selector)&&(w.run(v),x.add(w.selector))}catch(D){console.warn(`[AutoDefiner] Error applying enhancer for selector "${w.selector}":`,D)}},F=(v,x)=>{if(!C&&!(!v||!v.includes("-"))&&!customElements.get(v)&&!b.has(v)&&!f.has(v)){if(x&&x.getAttribute){let w=x.getAttribute(a);w&&!y.has(v)&&y.set(v,w)}m.add(v),qe()}},qe=()=>{R||(R=setTimeout(ht,l))},L=v=>{if(v){if(v.nodeType===1){let x=v,w=x.tagName?.toLowerCase();w&&w.includes("-")&&!customElements.get(w)&&i(w,x)&&F(w,x),_(x),d&&x.shadowRoot&&Ge(x.shadowRoot)}v.querySelectorAll&&v.querySelectorAll("*").forEach(x=>{let w=x.tagName?.toLowerCase();w&&w.includes("-")&&!customElements.get(w)&&i(w,x)&&F(w,x),_(x),d&&x.shadowRoot&&Ge(x.shadowRoot)})}},Ge=v=>{if(!v||T.has(v))return;L(v);let x=new MutationObserver(w=>{for(let D of w)D.addedNodes?.forEach(te=>{L(te)}),D.type==="attributes"&&D.target&&L(D.target)});x.observe(v,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[a,...p.map(w=>w.selector).filter(w=>w.startsWith("data-"))]}),T.set(v,x)};async function ht(){if(clearTimeout(R),R=0,!m.size)return;let v=Array.from(m);m.clear(),v.forEach(x=>b.add(x));try{let x=w=>y.get(w)??(s?s(w):`${w}.js`);await no(...v,{baseURL:t,mapper:x,onError:(w,D)=>{f.add(w),o?.(w,D)}})}catch{}finally{v.forEach(x=>b.delete(x))}}let gt=n===document?document.documentElement:n,mt=new MutationObserver(v=>{for(let x of v)x.addedNodes?.forEach(w=>{L(w)}),x.type==="attributes"&&x.target&&L(x.target)});if(mt.observe(gt,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[a,...p.map(v=>v.selector).filter(v=>v.startsWith("data-"))]}),d&&h&&Element.prototype.attachShadow){let v=Element.prototype.attachShadow;Element.prototype.attachShadow=function(w){let D=v.call(this,w);if(w&&w.mode==="open"){Ge(D);let te=this.tagName?.toLowerCase();te&&te.includes("-")&&!customElements.get(te)&&F(te,this)}return D},A=()=>Element.prototype.attachShadow=v}return c&&L(gt),{stop(){C=!0,mt.disconnect(),A&&A(),R&&(clearTimeout(R),R=0),T.forEach(v=>v.disconnect())},flush:ht}}static async define(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let s=e,{baseURL:o,mapper:i=d=>`${d}.js`,onError:a=(d,p)=>console.error(`[defineWebComponents] ${d}:`,p)}=t,n=o?new URL(o,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),c=d=>d.toLowerCase().replace(/(^|-)([a-z])/g,(p,h,m)=>m.toUpperCase()),l=async d=>{try{if(customElements.get(d))return{tag:d,status:"already-defined"};let p=i(d),m=await import(p instanceof URL?p.href:new URL(p,n).href),b=m?.default??m?.[c(d)];if(!b){if(customElements.get(d))return{tag:d,status:"self-defined"};throw new Error(`No export found for ${d}. Expected default export or named export "${c(d)}".`)}return customElements.get(d)?{tag:d,status:"race-already-defined"}:(customElements.define(d,b),{tag:d,status:"defined"})}catch(p){throw a(d,p),p}};return Promise.all(s.map(l))}}});var ye=globalThis,we=ye.ShadowRoot&&(ye.ShadyCSS===void 0||ye.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,yt=Symbol(),bt=new WeakMap,ve=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==yt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(we&&e===void 0){let s=t!==void 0&&t.length===1;s&&(e=bt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&bt.set(t,e))}return e}toString(){return this.cssText}},vt=r=>new ve(typeof r=="string"?r:r+"",void 0,yt);var wt=(r,e)=>{if(we)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let s=document.createElement("style"),o=ye.litNonce;o!==void 0&&s.setAttribute("nonce",o),s.textContent=t.cssText,r.appendChild(s)}},Ve=we?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let s of e.cssRules)t+=s.cssText;return vt(t)})(r):r;var{is:Cr,defineProperty:Er,getOwnPropertyDescriptor:Tr,getOwnPropertyNames:Ar,getOwnPropertySymbols:zr,getPrototypeOf:_r}=Object,xe=globalThis,xt=xe.trustedTypes,Mr=xt?xt.emptyScript:"",Lr=xe.reactiveElementPolyfillSupport,ae=(r,e)=>r,Ke={toAttribute(r,e){switch(e){case Boolean:r=r?Mr:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},St=(r,e)=>!Cr(r,e),kt={attribute:!0,type:String,converter:Ke,reflect:!1,useDefault:!1,hasChanged:St};Symbol.metadata??=Symbol("metadata"),xe.litPropertyMetadata??=new WeakMap;var I=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=kt){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let s=Symbol(),o=this.getPropertyDescriptor(e,s,t);o!==void 0&&Er(this.prototype,e,o)}}static getPropertyDescriptor(e,t,s){let{get:o,set:i}=Tr(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:o,set(a){let n=o?.call(this);i?.call(this,a),this.requestUpdate(e,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??kt}static _$Ei(){if(this.hasOwnProperty(ae("elementProperties")))return;let e=_r(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ae("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ae("properties"))){let t=this.properties,s=[...Ar(t),...zr(t)];for(let o of s)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[s,o]of t)this.elementProperties.set(s,o)}this._$Eh=new Map;for(let[t,s]of this.elementProperties){let o=this._$Eu(t,s);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let s=new Set(e.flat(1/0).reverse());for(let o of s)t.unshift(Ve(o))}else e!==void 0&&t.push(Ve(e));return t}static _$Eu(e,t){let s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return wt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){let s=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,s);if(o!==void 0&&s.reflect===!0){let i=(s.converter?.toAttribute!==void 0?s.converter:Ke).toAttribute(t,s.type);this._$Em=e,i==null?this.removeAttribute(o):this.setAttribute(o,i),this._$Em=null}}_$AK(e,t){let s=this.constructor,o=s._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let i=s.getPropertyOptions(o),a=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:Ke;this._$Em=o;let n=a.fromAttribute(t,i.type);this[o]=n??this._$Ej?.get(o)??n,this._$Em=null}}requestUpdate(e,t,s){if(e!==void 0){let o=this.constructor,i=this[e];if(s??=o.getPropertyOptions(e),!((s.hasChanged??St)(i,t)||s.useDefault&&s.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:o,wrapped:i},a){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),i!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),o===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,i]of this._$Ep)this[o]=i;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[o,i]of s){let{wrapped:a}=i,n=this[o];a!==!0||this._$AL.has(o)||n===void 0||this.C(o,void 0,i,n)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};I.elementStyles=[],I.shadowRootOptions={mode:"open"},I[ae("elementProperties")]=new Map,I[ae("finalized")]=new Map,Lr?.({ReactiveElement:I}),(xe.reactiveElementVersions??=[]).push("2.1.1");var Qe=globalThis,ke=Qe.trustedTypes,$t=ke?ke.createPolicy("lit-html",{createHTML:r=>r}):void 0,Ye="$lit$",B=`lit$${Math.random().toFixed(9).slice(2)}$`,Ze="?"+B,Dr=`<${Ze}>`,V=document,ce=()=>V.createComment(""),le=r=>r===null||typeof r!="object"&&typeof r!="function",Xe=Array.isArray,_t=r=>Xe(r)||typeof r?.[Symbol.iterator]=="function",Je=`[
2
- \f\r]`,ne=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ct=/-->/g,Et=/>/g,q=RegExp(`>|${Je}(?:([^\\s"'>=/]+)(${Je}*=${Je}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Tt=/'/g,At=/"/g,Mt=/^(?:script|style|textarea|title)$/i,et=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),Ae=et(1),tt=et(2),Lt=et(3),E=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),zt=new WeakMap,G=V.createTreeWalker(V,129);function Dt(r,e){if(!Xe(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return $t!==void 0?$t.createHTML(e):e}var Pt=(r,e)=>{let t=r.length-1,s=[],o,i=e===2?"<svg>":e===3?"<math>":"",a=ne;for(let n=0;n<t;n++){let c=r[n],l,d,p=-1,h=0;for(;h<c.length&&(a.lastIndex=h,d=a.exec(c),d!==null);)h=a.lastIndex,a===ne?d[1]==="!--"?a=Ct:d[1]!==void 0?a=Et:d[2]!==void 0?(Mt.test(d[2])&&(o=RegExp("</"+d[2],"g")),a=q):d[3]!==void 0&&(a=q):a===q?d[0]===">"?(a=o??ne,p=-1):d[1]===void 0?p=-2:(p=a.lastIndex-d[2].length,l=d[1],a=d[3]===void 0?q:d[3]==='"'?At:Tt):a===At||a===Tt?a=q:a===Ct||a===Et?a=ne:(a=q,o=void 0);let m=a===q&&r[n+1].startsWith("/>")?" ":"";i+=a===ne?c+Dr:p>=0?(s.push(l),c.slice(0,p)+Ye+c.slice(p)+B+m):c+B+(p===-2?n:m)}return[Dt(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]},de=class r{constructor({strings:e,_$litType$:t},s){let o;this.parts=[];let i=0,a=0,n=e.length-1,c=this.parts,[l,d]=Pt(e,t);if(this.el=r.createElement(l,s),G.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=G.nextNode())!==null&&c.length<n;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(Ye)){let h=d[a++],m=o.getAttribute(p).split(B),b=/([.?@])?(.*)/.exec(h);c.push({type:1,index:i,name:b[2],strings:m,ctor:b[1]==="."?$e:b[1]==="?"?Ce:b[1]==="@"?Ee:J}),o.removeAttribute(p)}else p.startsWith(B)&&(c.push({type:6,index:i}),o.removeAttribute(p));if(Mt.test(o.tagName)){let p=o.textContent.split(B),h=p.length-1;if(h>0){o.textContent=ke?ke.emptyScript:"";for(let m=0;m<h;m++)o.append(p[m],ce()),G.nextNode(),c.push({type:2,index:++i});o.append(p[h],ce())}}}else if(o.nodeType===8)if(o.data===Ze)c.push({type:2,index:i});else{let p=-1;for(;(p=o.data.indexOf(B,p+1))!==-1;)c.push({type:7,index:i}),p+=B.length-1}i++}}static createElement(e,t){let s=V.createElement("template");return s.innerHTML=e,s}};function K(r,e,t=r,s){if(e===E)return e;let o=s!==void 0?t._$Co?.[s]:t._$Cl,i=le(e)?void 0:e._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),i===void 0?o=void 0:(o=new i(r),o._$AT(r,t,s)),s!==void 0?(t._$Co??=[])[s]=o:t._$Cl=o),o!==void 0&&(e=K(r,o._$AS(r,e.values),o,s)),e}var Se=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:s}=this._$AD,o=(e?.creationScope??V).importNode(t,!0);G.currentNode=o;let i=G.nextNode(),a=0,n=0,c=s[0];for(;c!==void 0;){if(a===c.index){let l;c.type===2?l=new re(i,i.nextSibling,this,e):c.type===1?l=new c.ctor(i,c.name,c.strings,this,e):c.type===6&&(l=new Te(i,this,e)),this._$AV.push(l),c=s[++n]}a!==c?.index&&(i=G.nextNode(),a++)}return G.currentNode=V,o}p(e){let t=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}},re=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,o){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=K(this,e,t),le(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==E&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):_t(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==k&&le(this._$AH)?this._$AA.nextSibling.data=e:this.T(V.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:s}=e,o=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=de.createElement(Dt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(t);else{let i=new Se(o,this),a=i.u(this.options);i.p(t),this.T(a),this._$AH=i}}_$AC(e){let t=zt.get(e.strings);return t===void 0&&zt.set(e.strings,t=new de(e)),t}k(e){Xe(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,s,o=0;for(let i of e)o===t.length?t.push(s=new r(this.O(ce()),this.O(ce()),this,this.options)):s=t[o],s._$AI(i),o++;o<t.length&&(this._$AR(s&&s._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let s=e.nextSibling;e.remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},J=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,o,i){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=k}_$AI(e,t=this,s,o){let i=this.strings,a=!1;if(i===void 0)e=K(this,e,t,0),a=!le(e)||e!==this._$AH&&e!==E,a&&(this._$AH=e);else{let n=e,c,l;for(e=i[0],c=0;c<i.length-1;c++)l=K(this,n[s+c],t,c),l===E&&(l=this._$AH[c]),a||=!le(l)||l!==this._$AH[c],l===k?e=k:e!==k&&(e+=(l??"")+i[c+1]),this._$AH[c]=l}a&&!o&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},$e=class extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},Ce=class extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},Ee=class extends J{constructor(e,t,s,o,i){super(e,t,s,o,i),this.type=5}_$AI(e,t=this){if((e=K(this,e,t,0)??k)===E)return;let s=this._$AH,o=e===k&&s!==k||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==k&&(s===k||o);o&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Te=class{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){K(this,e)}},Rt={M:Ye,P:B,A:Ze,C:1,L:Pt,R:Se,D:_t,V:K,I:re,H:J,N:Ce,U:Ee,B:$e,F:Te},Pr=Qe.litHtmlPolyfillSupport;Pr?.(de,re),(Qe.litHtmlVersions??=[]).push("3.3.1");var O=(r,e,t)=>{let s=t?.renderBefore??e,o=s._$litPart$;if(o===void 0){let i=t?.renderBefore??null;s._$litPart$=o=new re(e.insertBefore(ce(),i),i,void 0,t??{})}return o._$AI(r),o};var rt=globalThis,P=class extends I{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=O(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return E}};P._$litElement$=!0,P.finalized=!0,rt.litElementHydrateSupport?.({LitElement:P});var Rr=rt.litElementPolyfillSupport;Rr?.({LitElement:P});(rt.litElementVersions??=[]).push("4.2.1");var j={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},z=r=>(...e)=>({_$litDirective$:r,values:e}),M=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,s){this._$Ct=e,this._$AM=t,this._$Ci=s}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Fr}=Rt,It=r=>r===null||typeof r!="object"&&typeof r!="function";var Bt=r=>r.strings===void 0,Ft=()=>document.createComment(""),oe=(r,e,t)=>{let s=r._$AA.parentNode,o=e===void 0?r._$AB:e._$AA;if(t===void 0){let i=s.insertBefore(Ft(),o),a=s.insertBefore(Ft(),o);t=new Fr(i,a,r,r.options)}else{let i=t._$AB.nextSibling,a=t._$AM,n=a!==r;if(n){let c;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(c=r._$AU)!==a._$AU&&t._$AP(c)}if(i!==o||n){let c=t._$AA;for(;c!==i;){let l=c.nextSibling;s.insertBefore(c,o),c=l}}}return t},H=(r,e,t=r)=>(r._$AI(e,t),r),Ir={},ze=(r,e=Ir)=>r._$AH=e,Nt=r=>r._$AH,_e=r=>{r._$AR(),r._$AA.remove()};var Ot=(r,e,t)=>{let s=new Map;for(let o=e;o<=t;o++)s.set(r[o],o);return s},No=z(class extends M{constructor(r){if(super(r),r.type!==j.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let s;t===void 0?t=e:e!==void 0&&(s=e);let o=[],i=[],a=0;for(let n of r)o[a]=s?s(n,a):a,i[a]=t(n,a),a++;return{values:i,keys:o}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,s]){let o=Nt(r),{values:i,keys:a}=this.dt(e,t,s);if(!Array.isArray(o))return this.ut=a,i;let n=this.ut??=[],c=[],l,d,p=0,h=o.length-1,m=0,b=i.length-1;for(;p<=h&&m<=b;)if(o[p]===null)p++;else if(o[h]===null)h--;else if(n[p]===a[m])c[m]=H(o[p],i[m]),p++,m++;else if(n[h]===a[b])c[b]=H(o[h],i[b]),h--,b--;else if(n[p]===a[b])c[b]=H(o[p],i[b]),oe(r,c[b+1],o[p]),p++,b--;else if(n[h]===a[m])c[m]=H(o[h],i[m]),oe(r,o[p],o[h]),h--,m++;else if(l===void 0&&(l=Ot(a,m,b),d=Ot(n,p,h)),l.has(n[p]))if(l.has(n[h])){let f=d.get(a[m]),y=f!==void 0?o[f]:null;if(y===null){let T=oe(r,o[p]);H(T,i[m]),c[m]=T}else c[m]=H(y,i[m]),oe(r,o[p],y),o[f]=null;m++}else _e(o[h]),h--;else _e(o[p]),p++;for(;m<=b;){let f=oe(r,c[b+1]);H(f,i[m]),c[m++]=f}for(;p<=h;){let f=o[p++];f!==null&&_e(f)}return this.ut=a,ze(r,c),E}});var Vo=z(class extends M{constructor(){super(...arguments),this.key=k}render(r,e){return this.key=r,e}update(r,[e,t]){return e!==this.key&&(ze(r),this.key=e),t}});var es=z(class extends M{constructor(r){if(super(r),r.type!==j.ATTRIBUTE||r.name!=="class"||r.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter(e=>r[e]).join(" ")+" "}update(r,[e]){if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(let s in e)e[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(e)}let t=r.element.classList;for(let s of this.st)s in e||(t.remove(s),this.st.delete(s));for(let s in e){let o=!!e[s];o===this.st.has(s)||this.nt?.has(s)||(o?(t.add(s),this.st.add(s)):(t.remove(s),this.st.delete(s)))}return E}});var pe=(r,e)=>{let t=r._$AN;if(t===void 0)return!1;for(let s of t)s._$AO?.(e,!1),pe(s,e);return!0},Me=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while(t?.size===0)},jt=r=>{for(let e;e=r._$AM;r=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(r))break;t.add(r),Or(e)}};function Br(r){this._$AN!==void 0?(Me(this),this._$AM=r,jt(this)):this._$AM=r}function Nr(r,e=!1,t=0){let s=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(s))for(let i=t;i<s.length;i++)pe(s[i],!1),Me(s[i]);else s!=null&&(pe(s,!1),Me(s));else pe(this,r)}var Or=r=>{r.type==j.CHILD&&(r._$AP??=Nr,r._$AQ??=Br)},se=class extends M{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,s){super._$AT(e,t,s),jt(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(pe(this,e),Me(this))}setValue(e){if(Bt(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var ot=new WeakMap,jr=z(class extends se{render(r){return k}update(r,[e]){let t=e!==this.G;return t&&this.G!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=r.options?.host,this.rt(this.ct=r.element)),k}rt(r){if(this.isConnected||(r=void 0),typeof this.G=="function"){let e=this.ht??globalThis,t=ot.get(e);t===void 0&&(t=new WeakMap,ot.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,r),r!==void 0&&this.G.call(this.ht,r)}else this.G.value=r}get lt(){return typeof this.G=="function"?ot.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var Le=class{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}},De=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(e=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}};var Ht=r=>!It(r)&&typeof r.then=="function",Ut=1073741823,st=class extends se{constructor(){super(...arguments),this._$Cwt=Ut,this._$Cbt=[],this._$CK=new Le(this),this._$CX=new De}render(...e){return e.find(t=>!Ht(t))??E}update(e,t){let s=this._$Cbt,o=s.length;this._$Cbt=t;let i=this._$CK,a=this._$CX;this.isConnected||this.disconnected();for(let n=0;n<t.length&&!(n>this._$Cwt);n++){let c=t[n];if(!Ht(c))return this._$Cwt=n,c;n<o&&c===s[n]||(this._$Cwt=Ut,o=0,Promise.resolve(c).then(async l=>{for(;a.get();)await a.get();let d=i.deref();if(d!==void 0){let p=d._$Cbt.indexOf(c);p>-1&&p<d._$Cwt&&(d._$Cwt=p,d.setValue(l))}}))}return E}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},Hr=z(st);var Q=class extends M{constructor(e){if(super(e),this.it=k,e.type!==j.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===k||e==null)return this._t=void 0,this.it=e;if(e===E)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Q.directiveName="unsafeHTML",Q.resultType=1;var Pe=z(Q);var ue=class extends Q{};ue.directiveName="unsafeSVG",ue.resultType=2;var Ur=z(ue);var Ns=["127.0.0.1","localhost"].includes(window.location.hostname);var Wr=Symbol.for(""),qr=r=>{if(r?.r===Wr)return r?._$litStatic$};var Wt=new Map,it=r=>(e,...t)=>{let s=t.length,o,i,a=[],n=[],c,l=0,d=!1;for(;l<s;){for(c=e[l];l<s&&(i=t[l],(o=qr(i))!==void 0);)c+=o+e[++l],d=!0;l!==s&&n.push(i),a.push(c),l++}if(l===s&&a.push(e[s]),d){let p=a.join("$$lit$$");(e=Wt.get(p))===void 0&&(a.raw=a,Wt.set(p,e=a)),t=n}return r(e,...t)},Gr=it(Ae),Hs=it(tt),Us=it(Lt);var S=Ae;var u={FontWeights:{light:300,normal:400,medium:500,semibold:600,bold:700},LineHeights:{tight:1.25,normal:1.5,relaxed:1.75},BorderWidths:{hairline:.5,thin:1,medium:2,thick:3},RadiusSizes:{none:0,small:4,medium:8,large:16,xlarge:24,xxlarge:32},ShadowDepths:{none:"none",light:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",medium:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",deep:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",extreme:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},TransitionSpeeds:{fast:150,normal:250,slow:350},AnimationEasings:{linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},TouchTargetSizes:{compact:36,standard:44,comfortable:48,spacious:56},LinkStyles:{inline:"inline",block:"block",button:"button"},FocusStyles:{ring:"ring",outline:"outline",border:"border",glow:"glow"},TabSizes:{compact:2,standard:4,wide:8},SelectIcons:{chevron:"chevron",arrow:"arrow",caret:"caret",none:"none"}};var Re={meta:{name:"Pure Design System Ontology",version:"0.1"},tokens:{colors:["primary","secondary","accent","success","warning","danger","info"],spacing:["xs","sm","md","lg","xl"],typography:["heading","body","mono"],themes:["light","dark"]},primitives:[{id:"badge",name:"Badge / Pill",selectors:[".badge",".pill",".tag",".chip"]},{id:"card",name:"Card",selectors:[".card",".card-basic",".card-elevated",".card-outlined",".card-interactive"]},{id:"surface",name:"Surface",selectors:[".surface",".surface-base",".surface-raised",".surface-overlay",".surface-subtle",".surface-elevated",".surface-sunken"]},{id:"alert",name:"Alert",selectors:[".alert",".alert-info",".alert-success",".alert-warning",".alert-danger"]},{id:"dialog",name:"Dialog",selectors:["dialog",".dialog"]},{id:"table",name:"Table",selectors:["table",".table-responsive",".data-table"]},{id:"button",name:"Button",selectors:["button","[class^='btn-']",".icon-only"]},{id:"fieldset",name:"Fieldset Group",selectors:["fieldset[role='group']","fieldset[role='radiogroup']"]},{id:"label-field",name:"Label+Input",selectors:["label"]},{id:"accordion",name:"Accordion",selectors:[".accordion",".accordion-item","details"]},{id:"icon",name:"Icon",selectors:["pds-icon",".icon",".icon-*"]},{id:"figure",name:"Figure/Media",selectors:["figure","figure.media"]},{id:"gallery",name:"Gallery",selectors:[".gallery",".gallery-grid"]}],components:[{id:"pds-tabstrip",name:"Tab Strip",selectors:["pds-tabstrip"]},{id:"pds-drawer",name:"Drawer",selectors:["pds-drawer"]},{id:"pds-upload",name:"Upload",selectors:["pds-upload"]}],layoutPatterns:[{id:"grid",name:"Grid Container",selectors:[".grid",".demo-grid"],description:"CSS Grid layout container"},{id:"grid-auto",name:"Auto-fit Grid",selectors:[".grid-auto-sm",".grid-auto-md",".grid-auto-lg",".grid-auto-xl"],description:"Responsive auto-fit grid"},{id:"grid-cols",name:"Grid Columns",selectors:[".grid-cols-1",".grid-cols-2",".grid-cols-3",".grid-cols-4",".grid-cols-6"],description:"Fixed column grid"},{id:"flex",name:"Flex Container",selectors:[".flex",".flex-wrap"],description:"Flexbox layout container"},{id:"container",name:"Container",selectors:[".container"],description:"Centered max-width container"},{id:"media-grid",name:"Media Grid",selectors:[".media-grid"],description:"Grid for media elements"}],utilities:[".btn-group",".demo-grid",".color-scale",".gap-*",".items-*",".justify-*",".border-gradient",".border-gradient-primary",".border-gradient-accent",".border-gradient-secondary",".border-gradient-soft",".border-gradient-medium",".border-gradient-strong",".border-glow",".border-glow-sm",".border-glow-lg",".border-gradient-glow",".border-glow-*"],styles:{typography:["headings","body","code"],icons:{source:"svg",sets:["core","brand"]},interactive:["focus","hover","active"]}};function Y(r,e){if(!r||!e)return!1;try{return r.matches(e)}catch{return!1}}function qt(r,e){if(!r||!e||!r.closest)return null;try{return r.closest(e)}catch{return null}}function Gt(r,{maxDepth:e=5}={}){if(!r||r.closest&&r.closest(".showcase-toc"))return null;let t=r,s=0;for(;t&&s<e;){if(s++,t.tagName==="DS-SHOWCASE")return null;if(t.classList&&t.classList.contains("showcase-section")){t=t.parentElement;continue}for(let i of PDS.ontology.enhancements)if(Y(t,i))return{element:t,componentType:"enhanced-component",displayName:i};if(t.tagName==="FIELDSET"){let i=t.getAttribute("role");if(i==="group"||i==="radiogroup")return{element:t,componentType:"form-group",displayName:i==="radiogroup"?"radio group":"form group"}}if(t.tagName==="LABEL"&&t.querySelector&&t.querySelector("input,select,textarea"))return{element:t,componentType:"form-control",displayName:"label with input"};let o=t.closest?t.closest("label"):null;if(o&&o.querySelector&&o.querySelector("input,select,textarea"))return{element:o,componentType:"form-control",displayName:"label with input"};for(let i of PDS.ontology.primitives){for(let a of i.selectors||[]){let n=String(a||"").trim();if(n.includes("*")){if(n.startsWith(".")){let l=n.slice(1).replace(/\*/g,"");if(t.classList&&Array.from(t.classList).some(h=>h.startsWith(l)))return{element:t,componentType:"pds-primitive",displayName:i.name||i.id};let d=t.parentElement,p=0;for(;d&&p<e;){if(d.classList&&Array.from(d.classList).some(h=>h.startsWith(l))&&d.tagName!=="DS-SHOWCASE")return{element:d,componentType:"pds-primitive",displayName:i.name||i.id};d=d.parentElement,p++}continue}continue}if(Y(t,n))return{element:t,componentType:"pds-primitive",displayName:i.name||i.id};let c=qt(t,n);if(c&&c.tagName!=="DS-SHOWCASE")return{element:c,componentType:"pds-primitive",displayName:i.name||i.id}}if(t.classList){let a=Array.from(t.classList);for(let n of i.selectors||[])if(typeof n=="string"&&n.includes("*")&&n.startsWith(".")){let c=n.slice(1).replace(/\*/g,"");if(a.some(l=>l.startsWith(c)))return{element:t,componentType:"pds-primitive",displayName:i.name||i.id}}}}for(let i of PDS.ontology.layoutPatterns||[])for(let a of i.selectors||[]){let n=String(a||"").trim();if(n.includes("*")){if(n.startsWith(".")){let l=n.slice(1).replace(/\*/g,"");if(t.classList&&Array.from(t.classList).some(d=>d.startsWith(l)))return{element:t,componentType:"layout-pattern",displayName:i.name||i.id}}continue}if(Y(t,n))return{element:t,componentType:"layout-pattern",displayName:i.name||i.id};let c=qt(t,n);if(c&&c.tagName!=="DS-SHOWCASE")return{element:c,componentType:"layout-pattern",displayName:i.name||i.id}}if(t.tagName&&t.tagName.includes("-"))return{element:t,componentType:"web-component",displayName:t.tagName.toLowerCase()};if(t.tagName==="BUTTON"){let i=t.querySelector&&t.querySelector("pds-icon");return{element:t,componentType:"button",displayName:i?"button with icon":"button"}}if(Y(t,"pds-icon")||t.closest&&t.closest("pds-icon")){let i=Y(t,"pds-icon")?t:t.closest("pds-icon");return{element:i,componentType:"icon",displayName:`pds-icon (${i.getAttribute&&i.getAttribute("icon")||"unknown"})`}}if(Y(t,"nav[data-dropdown]")||t.closest&&t.closest("nav[data-dropdown]"))return{element:Y(t,"nav[data-dropdown]")?t:t.closest("nav[data-dropdown]"),componentType:"navigation",displayName:"dropdown menu"};t=t.parentElement}return null}var Vt=Re;var U=class r{#e;#r;constructor(e={}){this.options={debug:!1,...e},this.options.design||(this.options.design={}),this.options.debug&&this.options.log?.("debug","Generator options:",this.options),this.tokens=this.generateTokens(),this.options.debug&&this.options.log?.("debug","Generated tokens:",this.tokens),this.#me(),typeof CSSStyleSheet<"u"?this.#we():this.options.debug&&this.options.log?.("debug","[Generator] Skipping browser features (CSSStyleSheet not available)")}generateTokens(){let e=this.options.design||{};return{colors:this.#i(e.colors||{}),spacing:this.generateSpacingTokens(e.spatialRhythm||{}),radius:this.#z(e.shape||{}),borderWidths:this.#_(e.shape||{}),typography:this.generateTypographyTokens(e.typography||{}),shadows:this.#M(e.layers||{}),layout:this.#L(e.layout||{}),transitions:this.#D(e.behavior||{}),zIndex:this.#P(e.layers||{}),icons:this.#R(e.icons||{})}}#i(e){let{primary:t="#3b82f6",secondary:s="#64748b",accent:o="#ec4899",background:i="#ffffff",success:a=null,warning:n="#FFBF00",danger:c=null,info:l=null,darkMode:d={}}=e,p={primary:this.#o(t),secondary:this.#o(s),accent:this.#o(o),success:this.#o(a||this.#n(t)),warning:this.#o(n||o),danger:this.#o(c||this.#w(t)),info:this.#o(l||t),gray:this.#u(s),surface:this.#h(i)};return p.surface.fieldset=this.#x(p.surface),p.surfaceSmart=this.#y(p.surface),p.dark=this.#S(p,i,d),p.dark&&p.dark.surface&&(p.dark.surfaceSmart=this.#y(p.dark.surface)),p.interactive={light:{fill:this.#b(p.primary,4.5),text:p.primary[600]},dark:{fill:this.#b(p.dark.primary,4.5),text:this.#T(p.dark.primary,p.dark.surface.base,4.5)}},p}#o(e){let t=this.#s(e);return{50:this.#t(t.h,Math.max(t.s-10,10),Math.min(t.l+45,95)),100:this.#t(t.h,Math.max(t.s-5,15),Math.min(t.l+35,90)),200:this.#t(t.h,t.s,Math.min(t.l+25,85)),300:this.#t(t.h,t.s,Math.min(t.l+15,75)),400:this.#t(t.h,t.s,Math.min(t.l+5,65)),500:e,600:this.#t(t.h,t.s,Math.max(t.l-10,25)),700:this.#t(t.h,t.s,Math.max(t.l-20,20)),800:this.#t(t.h,t.s,Math.max(t.l-30,15)),900:this.#t(t.h,t.s,Math.max(t.l-40,10))}}#n(e){let t=this.#s(e);return this.#t(120,Math.max(t.s,60),45)}#w(e){let t=this.#s(e);return this.#t(0,Math.max(t.s,70),50)}#u(e){let t=this.#s(e),s=t.h,o=Math.min(t.s,10);return{50:this.#t(s,o,98),100:this.#t(s,o,95),200:this.#t(s,o,88),300:this.#t(s,o,78),400:this.#t(s,o,60),500:e,600:this.#t(s,Math.min(o+5,15),45),700:this.#t(s,Math.min(o+8,18),35),800:this.#t(s,Math.min(o+10,20),20),900:this.#t(s,Math.min(o+12,22),10)}}#h(e){let t=this.#s(e);return{base:e,subtle:this.#t(t.h,Math.max(t.s,2),Math.max(t.l-2,2)),elevated:this.#t(t.h,Math.max(t.s,3),Math.max(t.l-4,5)),sunken:this.#t(t.h,Math.max(t.s,4),Math.max(t.l-6,8)),overlay:this.#t(t.h,Math.max(t.s,2),Math.min(t.l+2,98)),inverse:this.#g(e),hover:"color-mix(in oklab, var(--color-surface-base) 92%, var(--color-text-primary) 8%);"}}#x(e){return{base:e.subtle,subtle:e.elevated,elevated:e.sunken,sunken:this.#k(e.sunken,.05),overlay:e.elevated}}#k(e,t=.05){let s=this.#s(e),o=Math.max(s.l-s.l*t,5);return this.#t(s.h,s.s,o)}#g(e){let t=this.#s(e);if(t.l>50){let s=Math.min(t.s+5,25),o=Math.max(12-(t.l-50)*.1,8);return this.#t(t.h,s,o)}else{let s=Math.max(t.s-10,5),o=Math.min(85+(50-t.l)*.3,95);return this.#t(t.h,s,o)}}#S(e,t="#ffffff",s={}){let o=s.background?s.background:this.#g(t),i=this.#h(o),a=s.primary?this.#o(s.primary):this.#a(e.primary);return{surface:{...i,fieldset:this.#E(i)},primary:a,secondary:s.secondary?this.#o(s.secondary):this.#a(e.secondary),accent:s.accent?this.#o(s.accent):this.#a(e.accent),gray:s.secondary?this.#u(s.secondary):e.gray,success:this.#a(e.success),info:this.#a(e.info),warning:this.#a(e.warning),danger:this.#a(e.danger)}}#l(e){let t=String(e||"").replace("#",""),s=t.length===3?t.split("").map(i=>i+i).join(""):t,o=parseInt(s,16);return{r:o>>16&255,g:o>>8&255,b:o&255}}#p(e){let{r:t,g:s,b:o}=this.#l(e),i=[t/255,s/255,o/255].map(a=>a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4));return .2126*i[0]+.7152*i[1]+.0722*i[2]}#d(e,t){let s=this.#p(e),o=this.#p(t),i=Math.max(s,o),a=Math.min(s,o);return(i+.05)/(a+.05)}#m(e,t=4.5){if(!e)return"#000000";let s="#ffffff",o="#000000",i=this.#d(e,s);if(i>=t)return s;let a=this.#d(e,o);return a>=t||a>i?o:s}#f(e,t=1){let{r:s,g:o,b:i}=this.#l(e);return`rgba(${s}, ${o}, ${i}, ${t})`}#$(e,t,s=.5){let o=this.#l(e),i=this.#l(t),a=Math.round(o.r+(i.r-o.r)*s),n=Math.round(o.g+(i.g-o.g)*s),c=Math.round(o.b+(i.b-o.b)*s);return this.#C(a,n,c)}#C(e,t,s){let o=i=>{let a=Math.max(0,Math.min(255,Math.round(i))).toString(16);return a.length===1?"0"+a:a};return`#${o(e)}${o(t)}${o(s)}`}#E(e){return{base:e.elevated,subtle:e.overlay,elevated:this.#v(e.elevated,.08),sunken:e.elevated,overlay:this.#v(e.overlay,.05)}}#T(e={},t="#000000",s=4.5){let o=["600","700","800","500","400","900","300","200"],i={shade:null,color:null,ratio:0};for(let a of o){let n=e?.[a];if(!n||typeof n!="string")continue;let c=this.#d(n,t);if(c>i.ratio&&(i={shade:a,color:n,ratio:c}),c>=s)return n}return i.color||e?.["600"]||e?.["500"]}#b(e={},t=4.5){let s=["600","700","800","500","400","900"],o={shade:null,color:null,ratio:0};for(let i of s){let a=e?.[i];if(!a||typeof a!="string")continue;let n=this.#d(a,"#ffffff");if(n>o.ratio&&(o={shade:i,color:a,ratio:n}),n>=t)return a}return o.color||e?.["600"]||e?.["500"]}#y(e){let t={};return Object.entries(e).forEach(([s,o])=>{if(!o||typeof o!="string"||!o.startsWith("#"))return;let i=this.#p(o)<.5,a=this.#m(o,4.5),n=this.#m(o,3),c=this.#$(a,o,.4),l=a,d=c,p=i?"#ffffff":"#000000",h=i?.25:.1,m=this.#f(p,h),b=i?"#ffffff":"#000000",f=i?.15:.1,y=this.#f(b,f);t[s]={bg:o,text:a,textSecondary:n,textMuted:c,icon:l,iconSubtle:d,shadow:m,border:y,scheme:i?"dark":"light"}}),t}#v(e,t=.05){let s=this.#s(e),o=Math.min(s.l+(100-s.l)*t,95);return this.#t(s.h,s.s,o)}#a(e){let t={};return Object.entries({50:{source:"900",dimFactor:.8},100:{source:"800",dimFactor:.8},200:{source:"700",dimFactor:.8},300:{source:"600",dimFactor:.8},400:{source:"500",dimFactor:.85},500:{source:"400",dimFactor:.85},600:{source:"300",dimFactor:.85},700:{source:"200",dimFactor:.85},800:{source:"100",dimFactor:.95},900:{source:"50",dimFactor:.95}}).forEach(([o,i])=>{let a=e[i.source];t[o]=this.#A(a,i.dimFactor)}),t}#A(e,t=.8){let s=this.#s(e),o=Math.max(s.s*t,5),i=Math.max(s.l*t,5);return this.#t(s.h,o,i)}generateSpacingTokens(e){let{baseUnit:t=4,scaleRatio:s=1.25,maxSpacingSteps:o=12}=e,i=Number.isFinite(Number(t))?Number(t):4,a=Math.min(Number.isFinite(Number(o))?Number(o):12,12),n={0:"0"};for(let c=1;c<=a;c++)n[c]=`${i*c}px`;return n}#z(e){let{radiusSize:t="medium",customRadius:s=null}=e,o;s!=null?o=s:typeof t=="number"?o=t:typeof t=="string"?o=u.RadiusSizes[t]??u.RadiusSizes.medium:o=u.RadiusSizes.medium;let i=Number.isFinite(Number(o))?Number(o):u.RadiusSizes.medium;return{none:"0",xs:`${Number.isFinite(i*.25)?Math.round(i*.25):0}px`,sm:`${Number.isFinite(i*.5)?Math.round(i*.5):0}px`,md:`${i}px`,lg:`${Number.isFinite(i*1.5)?Math.round(i*1.5):0}px`,xl:`${Number.isFinite(i*2)?Math.round(i*2):0}px`,full:"9999px"}}#_(e){let{borderWidth:t="medium"}=e,s;return typeof t=="number"?s=t:typeof t=="string"?s=u.BorderWidths[t]??u.BorderWidths.medium:s=u.BorderWidths.medium,{hairline:`${u.BorderWidths.hairline}px`,thin:`${u.BorderWidths.thin}px`,medium:`${u.BorderWidths.medium}px`,thick:`${u.BorderWidths.thick}px`}}generateTypographyTokens(e){let{fontFamilyHeadings:t="system-ui, -apple-system, sans-serif",fontFamilyBody:s="system-ui, -apple-system, sans-serif",fontFamilyMono:o='ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',baseFontSize:i=16,fontScale:a=1.25,fontWeightLight:n=u.FontWeights.light,fontWeightNormal:c=u.FontWeights.normal,fontWeightMedium:l=u.FontWeights.medium,fontWeightSemibold:d=u.FontWeights.semibold,fontWeightBold:p=u.FontWeights.bold,lineHeightTight:h=u.LineHeights.tight,lineHeightNormal:m=u.LineHeights.normal,lineHeightRelaxed:b=u.LineHeights.relaxed}=e,f=Number.isFinite(Number(i))?Number(i):16,y=Number.isFinite(Number(a))?Number(a):1.25;return{fontFamily:{headings:t,body:s,mono:o},fontSize:{xs:`${Math.round(f/Math.pow(y,2))}px`,sm:`${Math.round(f/y)}px`,base:`${f}px`,lg:`${Math.round(f*y)}px`,xl:`${Math.round(f*Math.pow(y,2))}px`,"2xl":`${Math.round(f*Math.pow(y,3))}px`,"3xl":`${Math.round(f*Math.pow(y,4))}px`,"4xl":`${Math.round(f*Math.pow(y,5))}px`},fontWeight:{light:n?.toString()||"300",normal:c?.toString()||"400",medium:l?.toString()||"500",semibold:d?.toString()||"600",bold:p?.toString()||"700"},lineHeight:{tight:h?.toString()||"1.25",normal:m?.toString()||"1.5",relaxed:b?.toString()||"1.75"}}}#M(e){let{baseShadowOpacity:t=.1,shadowBlurMultiplier:s=1,shadowOffsetMultiplier:o=1}=e,i=`rgba(0, 0, 0, ${t})`,a=`rgba(0, 0, 0, ${t*.5})`;return{sm:`0 ${1*o}px ${2*s}px 0 ${a}`,base:`0 ${1*o}px ${3*s}px 0 ${i}, 0 ${1*o}px ${2*s}px 0 ${a}`,md:`0 ${4*o}px ${6*s}px ${-1*o}px ${i}, 0 ${2*o}px ${4*s}px ${-1*o}px ${a}`,lg:`0 ${10*o}px ${15*s}px ${-3*o}px ${i}, 0 ${4*o}px ${6*s}px ${-2*o}px ${a}`,xl:`0 ${20*o}px ${25*s}px ${-5*o}px ${i}, 0 ${10*o}px ${10*s}px ${-5*o}px ${a}`,inner:`inset 0 ${2*o}px ${4*s}px 0 ${a}`}}#L(e){let{maxWidth:t=1200,containerPadding:s=16,breakpoints:o={sm:640,md:768,lg:1024,xl:1280}}=e;return{maxWidth:`${t}px`,minHeight:"100vh",containerPadding:`${s}px`,breakpoints:{sm:`${o.sm}px`,md:`${o.md}px`,lg:`${o.lg}px`,xl:`${o.xl}px`},pageMargin:"120px",sectionGap:"160px",containerGap:"200px",heroSpacing:"240px",footerSpacing:"160px"}}#D(e){let{transitionSpeed:t=u.TransitionSpeeds.normal,animationEasing:s=u.AnimationEasings["ease-out"]}=e,o;return typeof t=="number"?o=t:typeof t=="string"&&u.TransitionSpeeds[t]?o=u.TransitionSpeeds[t]:o=u.TransitionSpeeds.normal,{fast:`${Math.round(o*.6)}ms`,normal:`${o}ms`,slow:`${Math.round(o*1.4)}ms`}}#P(e){let{baseZIndex:t=1e3,zIndexStep:s=10}=e;return{dropdown:t.toString(),sticky:(t+s*2).toString(),fixed:(t+s*3).toString(),modal:(t+s*4).toString(),drawer:(t+s*5).toString(),popover:(t+s*6).toString(),tooltip:(t+s*7).toString(),notification:(t+s*8).toString()}}#R(e){let{set:t="phosphor",weight:s="regular",defaultSize:o=24,sizes:i={xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64},spritePath:a="/assets/pds/icons/pds-icons.svg"}=e;return{set:t,weight:s,defaultSize:`${o}px`,sizes:Object.fromEntries(Object.entries(i).map(([n,c])=>[n,`${c}px`])),spritePath:a}}#F(e){let t=[];t.push(` /* Colors */
1
+ var kr=Object.defineProperty;var Sr=(r,e)=>()=>(r&&(e=r(r=0)),e);var bt=(r,e)=>{for(var t in e)kr(r,t,{get:e[t],enumerable:!0})};var ar={};bt(ar,{AutoDefiner:()=>lt});async function no(...r){let e={};r.length&&typeof r[r.length-1]=="object"&&(e=r.pop()||{});let t=r,{baseURL:s,mapper:o=l=>`${l}.js`,onError:i=(l,d)=>console.error(`[defineWebComponents] ${l}:`,d)}=e,a=s?new URL(s,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),n=l=>l.toLowerCase().replace(/(^|-)([a-z])/g,(d,p,h)=>h.toUpperCase()),c=async l=>{try{if(customElements.get(l))return{tag:l,status:"already-defined"};let d=o(l),h=await import(d instanceof URL?d.href:new URL(d,a).href),m=h?.default??h?.[n(l)];if(!m){if(customElements.get(l))return{tag:l,status:"self-defined"};throw new Error(`No export found for ${l}. Expected default export or named export "${n(l)}".`)}return customElements.get(l)?{tag:l,status:"race-already-defined"}:(customElements.define(l,m),{tag:l,status:"defined"})}catch(d){throw i(l,d),d}};return Promise.all(t.map(c))}var lt,nr=Sr(()=>{lt=class{constructor(e={}){let{baseURL:t,mapper:s,onError:o,predicate:i=()=>!0,attributeModule:a="data-module",root:n=document,scanExisting:c=!0,debounceMs:l=16,observeShadows:d=!0,enhancers:p=[],patchAttachShadow:h=!0}=e,m=new Set,b=new Set,f=new Set,y=new Map,T=new WeakMap,N=new WeakMap,R=0,C=!1,A=null,_=v=>{if(!v||!p.length)return;let x=N.get(v);x||(x=new Set,N.set(v,x));for(let w of p)if(!(!w.selector||!w.run)&&!x.has(w.selector))try{v.matches&&v.matches(w.selector)&&(w.run(v),x.add(w.selector))}catch(D){console.warn(`[AutoDefiner] Error applying enhancer for selector "${w.selector}":`,D)}},F=(v,x)=>{if(!C&&!(!v||!v.includes("-"))&&!customElements.get(v)&&!b.has(v)&&!f.has(v)){if(x&&x.getAttribute){let w=x.getAttribute(a);w&&!y.has(v)&&y.set(v,w)}m.add(v),Ge()}},Ge=()=>{R||(R=setTimeout(gt,l))},L=v=>{if(v){if(v.nodeType===1){let x=v,w=x.tagName?.toLowerCase();w&&w.includes("-")&&!customElements.get(w)&&i(w,x)&&F(w,x),_(x),d&&x.shadowRoot&&Ve(x.shadowRoot)}v.querySelectorAll&&v.querySelectorAll("*").forEach(x=>{let w=x.tagName?.toLowerCase();w&&w.includes("-")&&!customElements.get(w)&&i(w,x)&&F(w,x),_(x),d&&x.shadowRoot&&Ve(x.shadowRoot)})}},Ve=v=>{if(!v||T.has(v))return;L(v);let x=new MutationObserver(w=>{for(let D of w)D.addedNodes?.forEach(te=>{L(te)}),D.type==="attributes"&&D.target&&L(D.target)});x.observe(v,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[a,...p.map(w=>w.selector).filter(w=>w.startsWith("data-"))]}),T.set(v,x)};async function gt(){if(clearTimeout(R),R=0,!m.size)return;let v=Array.from(m);m.clear(),v.forEach(x=>b.add(x));try{let x=w=>y.get(w)??(s?s(w):`${w}.js`);await no(...v,{baseURL:t,mapper:x,onError:(w,D)=>{f.add(w),o?.(w,D)}})}catch{}finally{v.forEach(x=>b.delete(x))}}let mt=n===document?document.documentElement:n,ft=new MutationObserver(v=>{for(let x of v)x.addedNodes?.forEach(w=>{L(w)}),x.type==="attributes"&&x.target&&L(x.target)});if(ft.observe(mt,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[a,...p.map(v=>v.selector).filter(v=>v.startsWith("data-"))]}),d&&h&&Element.prototype.attachShadow){let v=Element.prototype.attachShadow;Element.prototype.attachShadow=function(w){let D=v.call(this,w);if(w&&w.mode==="open"){Ve(D);let te=this.tagName?.toLowerCase();te&&te.includes("-")&&!customElements.get(te)&&F(te,this)}return D},A=()=>Element.prototype.attachShadow=v}return c&&L(mt),{stop(){C=!0,ft.disconnect(),A&&A(),R&&(clearTimeout(R),R=0),T.forEach(v=>v.disconnect())},flush:gt}}static async define(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let s=e,{baseURL:o,mapper:i=d=>`${d}.js`,onError:a=(d,p)=>console.error(`[defineWebComponents] ${d}:`,p)}=t,n=o?new URL(o,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),c=d=>d.toLowerCase().replace(/(^|-)([a-z])/g,(p,h,m)=>m.toUpperCase()),l=async d=>{try{if(customElements.get(d))return{tag:d,status:"already-defined"};let p=i(d),m=await import(p instanceof URL?p.href:new URL(p,n).href),b=m?.default??m?.[c(d)];if(!b){if(customElements.get(d))return{tag:d,status:"self-defined"};throw new Error(`No export found for ${d}. Expected default export or named export "${c(d)}".`)}return customElements.get(d)?{tag:d,status:"race-already-defined"}:(customElements.define(d,b),{tag:d,status:"defined"})}catch(p){throw a(d,p),p}};return Promise.all(s.map(l))}}});var ye=globalThis,we=ye.ShadowRoot&&(ye.ShadyCSS===void 0||ye.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vt=Symbol(),yt=new WeakMap,ve=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==vt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(we&&e===void 0){let s=t!==void 0&&t.length===1;s&&(e=yt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&yt.set(t,e))}return e}toString(){return this.cssText}},wt=r=>new ve(typeof r=="string"?r:r+"",void 0,vt);var xt=(r,e)=>{if(we)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let s=document.createElement("style"),o=ye.litNonce;o!==void 0&&s.setAttribute("nonce",o),s.textContent=t.cssText,r.appendChild(s)}},Ke=we?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let s of e.cssRules)t+=s.cssText;return wt(t)})(r):r;var{is:Cr,defineProperty:Er,getOwnPropertyDescriptor:Tr,getOwnPropertyNames:Ar,getOwnPropertySymbols:zr,getPrototypeOf:_r}=Object,xe=globalThis,kt=xe.trustedTypes,Mr=kt?kt.emptyScript:"",Lr=xe.reactiveElementPolyfillSupport,ae=(r,e)=>r,Je={toAttribute(r,e){switch(e){case Boolean:r=r?Mr:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},$t=(r,e)=>!Cr(r,e),St={attribute:!0,type:String,converter:Je,reflect:!1,useDefault:!1,hasChanged:$t};Symbol.metadata??=Symbol("metadata"),xe.litPropertyMetadata??=new WeakMap;var I=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=St){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let s=Symbol(),o=this.getPropertyDescriptor(e,s,t);o!==void 0&&Er(this.prototype,e,o)}}static getPropertyDescriptor(e,t,s){let{get:o,set:i}=Tr(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:o,set(a){let n=o?.call(this);i?.call(this,a),this.requestUpdate(e,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??St}static _$Ei(){if(this.hasOwnProperty(ae("elementProperties")))return;let e=_r(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ae("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ae("properties"))){let t=this.properties,s=[...Ar(t),...zr(t)];for(let o of s)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[s,o]of t)this.elementProperties.set(s,o)}this._$Eh=new Map;for(let[t,s]of this.elementProperties){let o=this._$Eu(t,s);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let s=new Set(e.flat(1/0).reverse());for(let o of s)t.unshift(Ke(o))}else e!==void 0&&t.push(Ke(e));return t}static _$Eu(e,t){let s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){let s=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,s);if(o!==void 0&&s.reflect===!0){let i=(s.converter?.toAttribute!==void 0?s.converter:Je).toAttribute(t,s.type);this._$Em=e,i==null?this.removeAttribute(o):this.setAttribute(o,i),this._$Em=null}}_$AK(e,t){let s=this.constructor,o=s._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let i=s.getPropertyOptions(o),a=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:Je;this._$Em=o;let n=a.fromAttribute(t,i.type);this[o]=n??this._$Ej?.get(o)??n,this._$Em=null}}requestUpdate(e,t,s){if(e!==void 0){let o=this.constructor,i=this[e];if(s??=o.getPropertyOptions(e),!((s.hasChanged??$t)(i,t)||s.useDefault&&s.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:o,wrapped:i},a){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),i!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),o===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,i]of this._$Ep)this[o]=i;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[o,i]of s){let{wrapped:a}=i,n=this[o];a!==!0||this._$AL.has(o)||n===void 0||this.C(o,void 0,i,n)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};I.elementStyles=[],I.shadowRootOptions={mode:"open"},I[ae("elementProperties")]=new Map,I[ae("finalized")]=new Map,Lr?.({ReactiveElement:I}),(xe.reactiveElementVersions??=[]).push("2.1.1");var Ye=globalThis,ke=Ye.trustedTypes,Ct=ke?ke.createPolicy("lit-html",{createHTML:r=>r}):void 0,Ze="$lit$",B=`lit$${Math.random().toFixed(9).slice(2)}$`,Xe="?"+B,Dr=`<${Xe}>`,V=document,ce=()=>V.createComment(""),le=r=>r===null||typeof r!="object"&&typeof r!="function",et=Array.isArray,Mt=r=>et(r)||typeof r?.[Symbol.iterator]=="function",Qe=`[
2
+ \f\r]`,ne=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Et=/-->/g,Tt=/>/g,q=RegExp(`>|${Qe}(?:([^\\s"'>=/]+)(${Qe}*=${Qe}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),At=/'/g,zt=/"/g,Lt=/^(?:script|style|textarea|title)$/i,tt=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),Ae=tt(1),rt=tt(2),Dt=tt(3),E=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),_t=new WeakMap,G=V.createTreeWalker(V,129);function Pt(r,e){if(!et(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ct!==void 0?Ct.createHTML(e):e}var Rt=(r,e)=>{let t=r.length-1,s=[],o,i=e===2?"<svg>":e===3?"<math>":"",a=ne;for(let n=0;n<t;n++){let c=r[n],l,d,p=-1,h=0;for(;h<c.length&&(a.lastIndex=h,d=a.exec(c),d!==null);)h=a.lastIndex,a===ne?d[1]==="!--"?a=Et:d[1]!==void 0?a=Tt:d[2]!==void 0?(Lt.test(d[2])&&(o=RegExp("</"+d[2],"g")),a=q):d[3]!==void 0&&(a=q):a===q?d[0]===">"?(a=o??ne,p=-1):d[1]===void 0?p=-2:(p=a.lastIndex-d[2].length,l=d[1],a=d[3]===void 0?q:d[3]==='"'?zt:At):a===zt||a===At?a=q:a===Et||a===Tt?a=ne:(a=q,o=void 0);let m=a===q&&r[n+1].startsWith("/>")?" ":"";i+=a===ne?c+Dr:p>=0?(s.push(l),c.slice(0,p)+Ze+c.slice(p)+B+m):c+B+(p===-2?n:m)}return[Pt(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]},de=class r{constructor({strings:e,_$litType$:t},s){let o;this.parts=[];let i=0,a=0,n=e.length-1,c=this.parts,[l,d]=Rt(e,t);if(this.el=r.createElement(l,s),G.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=G.nextNode())!==null&&c.length<n;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(Ze)){let h=d[a++],m=o.getAttribute(p).split(B),b=/([.?@])?(.*)/.exec(h);c.push({type:1,index:i,name:b[2],strings:m,ctor:b[1]==="."?$e:b[1]==="?"?Ce:b[1]==="@"?Ee:J}),o.removeAttribute(p)}else p.startsWith(B)&&(c.push({type:6,index:i}),o.removeAttribute(p));if(Lt.test(o.tagName)){let p=o.textContent.split(B),h=p.length-1;if(h>0){o.textContent=ke?ke.emptyScript:"";for(let m=0;m<h;m++)o.append(p[m],ce()),G.nextNode(),c.push({type:2,index:++i});o.append(p[h],ce())}}}else if(o.nodeType===8)if(o.data===Xe)c.push({type:2,index:i});else{let p=-1;for(;(p=o.data.indexOf(B,p+1))!==-1;)c.push({type:7,index:i}),p+=B.length-1}i++}}static createElement(e,t){let s=V.createElement("template");return s.innerHTML=e,s}};function K(r,e,t=r,s){if(e===E)return e;let o=s!==void 0?t._$Co?.[s]:t._$Cl,i=le(e)?void 0:e._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),i===void 0?o=void 0:(o=new i(r),o._$AT(r,t,s)),s!==void 0?(t._$Co??=[])[s]=o:t._$Cl=o),o!==void 0&&(e=K(r,o._$AS(r,e.values),o,s)),e}var Se=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:s}=this._$AD,o=(e?.creationScope??V).importNode(t,!0);G.currentNode=o;let i=G.nextNode(),a=0,n=0,c=s[0];for(;c!==void 0;){if(a===c.index){let l;c.type===2?l=new re(i,i.nextSibling,this,e):c.type===1?l=new c.ctor(i,c.name,c.strings,this,e):c.type===6&&(l=new Te(i,this,e)),this._$AV.push(l),c=s[++n]}a!==c?.index&&(i=G.nextNode(),a++)}return G.currentNode=V,o}p(e){let t=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}},re=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,o){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=K(this,e,t),le(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==E&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Mt(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==k&&le(this._$AH)?this._$AA.nextSibling.data=e:this.T(V.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:s}=e,o=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=de.createElement(Pt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(t);else{let i=new Se(o,this),a=i.u(this.options);i.p(t),this.T(a),this._$AH=i}}_$AC(e){let t=_t.get(e.strings);return t===void 0&&_t.set(e.strings,t=new de(e)),t}k(e){et(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,s,o=0;for(let i of e)o===t.length?t.push(s=new r(this.O(ce()),this.O(ce()),this,this.options)):s=t[o],s._$AI(i),o++;o<t.length&&(this._$AR(s&&s._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let s=e.nextSibling;e.remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},J=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,o,i){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=k}_$AI(e,t=this,s,o){let i=this.strings,a=!1;if(i===void 0)e=K(this,e,t,0),a=!le(e)||e!==this._$AH&&e!==E,a&&(this._$AH=e);else{let n=e,c,l;for(e=i[0],c=0;c<i.length-1;c++)l=K(this,n[s+c],t,c),l===E&&(l=this._$AH[c]),a||=!le(l)||l!==this._$AH[c],l===k?e=k:e!==k&&(e+=(l??"")+i[c+1]),this._$AH[c]=l}a&&!o&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},$e=class extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},Ce=class extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},Ee=class extends J{constructor(e,t,s,o,i){super(e,t,s,o,i),this.type=5}_$AI(e,t=this){if((e=K(this,e,t,0)??k)===E)return;let s=this._$AH,o=e===k&&s!==k||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==k&&(s===k||o);o&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Te=class{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){K(this,e)}},Ft={M:Ze,P:B,A:Xe,C:1,L:Rt,R:Se,D:Mt,V:K,I:re,H:J,N:Ce,U:Ee,B:$e,F:Te},Pr=Ye.litHtmlPolyfillSupport;Pr?.(de,re),(Ye.litHtmlVersions??=[]).push("3.3.1");var O=(r,e,t)=>{let s=t?.renderBefore??e,o=s._$litPart$;if(o===void 0){let i=t?.renderBefore??null;s._$litPart$=o=new re(e.insertBefore(ce(),i),i,void 0,t??{})}return o._$AI(r),o};var ot=globalThis,P=class extends I{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=O(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return E}};P._$litElement$=!0,P.finalized=!0,ot.litElementHydrateSupport?.({LitElement:P});var Rr=ot.litElementPolyfillSupport;Rr?.({LitElement:P});(ot.litElementVersions??=[]).push("4.2.1");var j={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},z=r=>(...e)=>({_$litDirective$:r,values:e}),M=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,s){this._$Ct=e,this._$AM=t,this._$Ci=s}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Fr}=Ft,Bt=r=>r===null||typeof r!="object"&&typeof r!="function";var Nt=r=>r.strings===void 0,It=()=>document.createComment(""),oe=(r,e,t)=>{let s=r._$AA.parentNode,o=e===void 0?r._$AB:e._$AA;if(t===void 0){let i=s.insertBefore(It(),o),a=s.insertBefore(It(),o);t=new Fr(i,a,r,r.options)}else{let i=t._$AB.nextSibling,a=t._$AM,n=a!==r;if(n){let c;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(c=r._$AU)!==a._$AU&&t._$AP(c)}if(i!==o||n){let c=t._$AA;for(;c!==i;){let l=c.nextSibling;s.insertBefore(c,o),c=l}}}return t},H=(r,e,t=r)=>(r._$AI(e,t),r),Ir={},ze=(r,e=Ir)=>r._$AH=e,Ot=r=>r._$AH,_e=r=>{r._$AR(),r._$AA.remove()};var jt=(r,e,t)=>{let s=new Map;for(let o=e;o<=t;o++)s.set(r[o],o);return s},No=z(class extends M{constructor(r){if(super(r),r.type!==j.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let s;t===void 0?t=e:e!==void 0&&(s=e);let o=[],i=[],a=0;for(let n of r)o[a]=s?s(n,a):a,i[a]=t(n,a),a++;return{values:i,keys:o}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,s]){let o=Ot(r),{values:i,keys:a}=this.dt(e,t,s);if(!Array.isArray(o))return this.ut=a,i;let n=this.ut??=[],c=[],l,d,p=0,h=o.length-1,m=0,b=i.length-1;for(;p<=h&&m<=b;)if(o[p]===null)p++;else if(o[h]===null)h--;else if(n[p]===a[m])c[m]=H(o[p],i[m]),p++,m++;else if(n[h]===a[b])c[b]=H(o[h],i[b]),h--,b--;else if(n[p]===a[b])c[b]=H(o[p],i[b]),oe(r,c[b+1],o[p]),p++,b--;else if(n[h]===a[m])c[m]=H(o[h],i[m]),oe(r,o[p],o[h]),h--,m++;else if(l===void 0&&(l=jt(a,m,b),d=jt(n,p,h)),l.has(n[p]))if(l.has(n[h])){let f=d.get(a[m]),y=f!==void 0?o[f]:null;if(y===null){let T=oe(r,o[p]);H(T,i[m]),c[m]=T}else c[m]=H(y,i[m]),oe(r,o[p],y),o[f]=null;m++}else _e(o[h]),h--;else _e(o[p]),p++;for(;m<=b;){let f=oe(r,c[b+1]);H(f,i[m]),c[m++]=f}for(;p<=h;){let f=o[p++];f!==null&&_e(f)}return this.ut=a,ze(r,c),E}});var Vo=z(class extends M{constructor(){super(...arguments),this.key=k}render(r,e){return this.key=r,e}update(r,[e,t]){return e!==this.key&&(ze(r),this.key=e),t}});var es=z(class extends M{constructor(r){if(super(r),r.type!==j.ATTRIBUTE||r.name!=="class"||r.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter(e=>r[e]).join(" ")+" "}update(r,[e]){if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(let s in e)e[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(e)}let t=r.element.classList;for(let s of this.st)s in e||(t.remove(s),this.st.delete(s));for(let s in e){let o=!!e[s];o===this.st.has(s)||this.nt?.has(s)||(o?(t.add(s),this.st.add(s)):(t.remove(s),this.st.delete(s)))}return E}});var pe=(r,e)=>{let t=r._$AN;if(t===void 0)return!1;for(let s of t)s._$AO?.(e,!1),pe(s,e);return!0},Me=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while(t?.size===0)},Ht=r=>{for(let e;e=r._$AM;r=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(r))break;t.add(r),Or(e)}};function Br(r){this._$AN!==void 0?(Me(this),this._$AM=r,Ht(this)):this._$AM=r}function Nr(r,e=!1,t=0){let s=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(s))for(let i=t;i<s.length;i++)pe(s[i],!1),Me(s[i]);else s!=null&&(pe(s,!1),Me(s));else pe(this,r)}var Or=r=>{r.type==j.CHILD&&(r._$AP??=Nr,r._$AQ??=Br)},se=class extends M{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,s){super._$AT(e,t,s),Ht(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(pe(this,e),Me(this))}setValue(e){if(Nt(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var st=new WeakMap,jr=z(class extends se{render(r){return k}update(r,[e]){let t=e!==this.G;return t&&this.G!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=r.options?.host,this.rt(this.ct=r.element)),k}rt(r){if(this.isConnected||(r=void 0),typeof this.G=="function"){let e=this.ht??globalThis,t=st.get(e);t===void 0&&(t=new WeakMap,st.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,r),r!==void 0&&this.G.call(this.ht,r)}else this.G.value=r}get lt(){return typeof this.G=="function"?st.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var Le=class{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}},De=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(e=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}};var Ut=r=>!Bt(r)&&typeof r.then=="function",Wt=1073741823,it=class extends se{constructor(){super(...arguments),this._$Cwt=Wt,this._$Cbt=[],this._$CK=new Le(this),this._$CX=new De}render(...e){return e.find(t=>!Ut(t))??E}update(e,t){let s=this._$Cbt,o=s.length;this._$Cbt=t;let i=this._$CK,a=this._$CX;this.isConnected||this.disconnected();for(let n=0;n<t.length&&!(n>this._$Cwt);n++){let c=t[n];if(!Ut(c))return this._$Cwt=n,c;n<o&&c===s[n]||(this._$Cwt=Wt,o=0,Promise.resolve(c).then(async l=>{for(;a.get();)await a.get();let d=i.deref();if(d!==void 0){let p=d._$Cbt.indexOf(c);p>-1&&p<d._$Cwt&&(d._$Cwt=p,d.setValue(l))}}))}return E}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},Hr=z(it);var Q=class extends M{constructor(e){if(super(e),this.it=k,e.type!==j.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===k||e==null)return this._t=void 0,this.it=e;if(e===E)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Q.directiveName="unsafeHTML",Q.resultType=1;var Pe=z(Q);var ue=class extends Q{};ue.directiveName="unsafeSVG",ue.resultType=2;var Ur=z(ue);var Ns=["127.0.0.1","localhost"].includes(window.location.hostname);var Wr=Symbol.for(""),qr=r=>{if(r?.r===Wr)return r?._$litStatic$};var qt=new Map,at=r=>(e,...t)=>{let s=t.length,o,i,a=[],n=[],c,l=0,d=!1;for(;l<s;){for(c=e[l];l<s&&(i=t[l],(o=qr(i))!==void 0);)c+=o+e[++l],d=!0;l!==s&&n.push(i),a.push(c),l++}if(l===s&&a.push(e[s]),d){let p=a.join("$$lit$$");(e=qt.get(p))===void 0&&(a.raw=a,qt.set(p,e=a)),t=n}return r(e,...t)},Gr=at(Ae),Hs=at(rt),Us=at(Dt);var S=Ae;var nt=class{constructor(){this._mode="static",this._designer=null,this._staticPaths={tokens:"/assets/pds/styles/pds-tokens.css.js",primitives:"/assets/pds/styles/pds-primitives.css.js",components:"/assets/pds/styles/pds-components.css.js",utilities:"/assets/pds/styles/pds-utilities.css.js",styles:"/assets/pds/styles/pds-styles.css.js"}}setDesigner(e,t={}){this._designer=e,this._mode="live";let s=t?.presetName;s?e?.options?.log?.("log",`PDS live with preset "${s}"`):e?.options?.log?.("log","PDS live with custom config")}setStaticMode(e={}){this._mode="static",this._staticPaths={...this._staticPaths,...e},console.log("[PDS Registry] Switched to STATIC mode",this._staticPaths)}async getStylesheet(e){if(this._mode==="live"&&this._designer)switch(e){case"tokens":return this._designer.tokensStylesheet;case"primitives":return this._designer.primitivesStylesheet;case"components":return this._designer.componentsStylesheet;case"utilities":return this._designer.utilitiesStylesheet;default:return this._designer?.options?.log?.("warn",`[PDS Registry] Unknown layer: ${e}`),null}else try{return(await import(this._staticPaths[e]))[e]}catch(t){console.error(`[PDS Registry] Failed to load static ${e}:`,t),console.error(`[PDS Registry] Looking for: ${this._staticPaths[e]}`),console.error("[PDS Registry] Make sure you've run 'npm run pds:export' and configured PDS.start() with the correct static.root path");let s=new CSSStyleSheet;return s.replaceSync("/* Failed to load "+e+" */"),s}}get mode(){return this._mode}get isLive(){return this._mode==="live"&&this._designer!==null}get hasDesigner(){return this._designer!==null}},Re=new nt;var u={FontWeights:{light:300,normal:400,medium:500,semibold:600,bold:700},LineHeights:{tight:1.25,normal:1.5,relaxed:1.75},BorderWidths:{hairline:.5,thin:1,medium:2,thick:3},RadiusSizes:{none:0,small:4,medium:8,large:16,xlarge:24,xxlarge:32},ShadowDepths:{none:"none",light:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",medium:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",deep:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",extreme:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},TransitionSpeeds:{fast:150,normal:250,slow:350},AnimationEasings:{linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},TouchTargetSizes:{compact:36,standard:44,comfortable:48,spacious:56},LinkStyles:{inline:"inline",block:"block",button:"button"},FocusStyles:{ring:"ring",outline:"outline",border:"border",glow:"glow"},TabSizes:{compact:2,standard:4,wide:8},SelectIcons:{chevron:"chevron",arrow:"arrow",caret:"caret",none:"none"}};var Fe={meta:{name:"Pure Design System Ontology",version:"0.1"},tokens:{colors:["primary","secondary","accent","success","warning","danger","info"],spacing:["xs","sm","md","lg","xl"],typography:["heading","body","mono"],themes:["light","dark"]},primitives:[{id:"badge",name:"Badge / Pill",selectors:[".badge",".pill",".tag",".chip"]},{id:"card",name:"Card",selectors:[".card",".card-basic",".card-elevated",".card-outlined",".card-interactive"]},{id:"surface",name:"Surface",selectors:[".surface",".surface-base",".surface-raised",".surface-overlay",".surface-subtle",".surface-elevated",".surface-sunken"]},{id:"alert",name:"Alert",selectors:[".alert",".alert-info",".alert-success",".alert-warning",".alert-danger"]},{id:"dialog",name:"Dialog",selectors:["dialog",".dialog"]},{id:"table",name:"Table",selectors:["table",".table-responsive",".data-table"]},{id:"button",name:"Button",selectors:["button","[class^='btn-']",".icon-only"]},{id:"fieldset",name:"Fieldset Group",selectors:["fieldset[role='group']","fieldset[role='radiogroup']"]},{id:"label-field",name:"Label+Input",selectors:["label"]},{id:"accordion",name:"Accordion",selectors:[".accordion",".accordion-item","details"]},{id:"icon",name:"Icon",selectors:["pds-icon",".icon",".icon-*"]},{id:"figure",name:"Figure/Media",selectors:["figure","figure.media"]},{id:"gallery",name:"Gallery",selectors:[".gallery",".gallery-grid"]}],components:[{id:"pds-tabstrip",name:"Tab Strip",selectors:["pds-tabstrip"]},{id:"pds-drawer",name:"Drawer",selectors:["pds-drawer"]},{id:"pds-upload",name:"Upload",selectors:["pds-upload"]}],layoutPatterns:[{id:"grid",name:"Grid Container",selectors:[".grid",".demo-grid"],description:"CSS Grid layout container"},{id:"grid-auto",name:"Auto-fit Grid",selectors:[".grid-auto-sm",".grid-auto-md",".grid-auto-lg",".grid-auto-xl"],description:"Responsive auto-fit grid"},{id:"grid-cols",name:"Grid Columns",selectors:[".grid-cols-1",".grid-cols-2",".grid-cols-3",".grid-cols-4",".grid-cols-6"],description:"Fixed column grid"},{id:"flex",name:"Flex Container",selectors:[".flex",".flex-wrap"],description:"Flexbox layout container"},{id:"container",name:"Container",selectors:[".container"],description:"Centered max-width container"},{id:"media-grid",name:"Media Grid",selectors:[".media-grid"],description:"Grid for media elements"}],utilities:[".btn-group",".demo-grid",".color-scale",".gap-*",".items-*",".justify-*",".border-gradient",".border-gradient-primary",".border-gradient-accent",".border-gradient-secondary",".border-gradient-soft",".border-gradient-medium",".border-gradient-strong",".border-glow",".border-glow-sm",".border-glow-lg",".border-gradient-glow",".border-glow-*"],styles:{typography:["headings","body","code"],icons:{source:"svg",sets:["core","brand"]},interactive:["focus","hover","active"]}};function Y(r,e){if(!r||!e)return!1;try{return r.matches(e)}catch{return!1}}function Gt(r,e){if(!r||!e||!r.closest)return null;try{return r.closest(e)}catch{return null}}function Vt(r,{maxDepth:e=5}={}){if(!r||r.closest&&r.closest(".showcase-toc"))return null;let t=r,s=0;for(;t&&s<e;){if(s++,t.tagName==="DS-SHOWCASE")return null;if(t.classList&&t.classList.contains("showcase-section")){t=t.parentElement;continue}for(let i of PDS.ontology.enhancements)if(Y(t,i))return{element:t,componentType:"enhanced-component",displayName:i};if(t.tagName==="FIELDSET"){let i=t.getAttribute("role");if(i==="group"||i==="radiogroup")return{element:t,componentType:"form-group",displayName:i==="radiogroup"?"radio group":"form group"}}if(t.tagName==="LABEL"&&t.querySelector&&t.querySelector("input,select,textarea"))return{element:t,componentType:"form-control",displayName:"label with input"};let o=t.closest?t.closest("label"):null;if(o&&o.querySelector&&o.querySelector("input,select,textarea"))return{element:o,componentType:"form-control",displayName:"label with input"};for(let i of PDS.ontology.primitives){for(let a of i.selectors||[]){let n=String(a||"").trim();if(n.includes("*")){if(n.startsWith(".")){let l=n.slice(1).replace(/\*/g,"");if(t.classList&&Array.from(t.classList).some(h=>h.startsWith(l)))return{element:t,componentType:"pds-primitive",displayName:i.name||i.id};let d=t.parentElement,p=0;for(;d&&p<e;){if(d.classList&&Array.from(d.classList).some(h=>h.startsWith(l))&&d.tagName!=="DS-SHOWCASE")return{element:d,componentType:"pds-primitive",displayName:i.name||i.id};d=d.parentElement,p++}continue}continue}if(Y(t,n))return{element:t,componentType:"pds-primitive",displayName:i.name||i.id};let c=Gt(t,n);if(c&&c.tagName!=="DS-SHOWCASE")return{element:c,componentType:"pds-primitive",displayName:i.name||i.id}}if(t.classList){let a=Array.from(t.classList);for(let n of i.selectors||[])if(typeof n=="string"&&n.includes("*")&&n.startsWith(".")){let c=n.slice(1).replace(/\*/g,"");if(a.some(l=>l.startsWith(c)))return{element:t,componentType:"pds-primitive",displayName:i.name||i.id}}}}for(let i of PDS.ontology.layoutPatterns||[])for(let a of i.selectors||[]){let n=String(a||"").trim();if(n.includes("*")){if(n.startsWith(".")){let l=n.slice(1).replace(/\*/g,"");if(t.classList&&Array.from(t.classList).some(d=>d.startsWith(l)))return{element:t,componentType:"layout-pattern",displayName:i.name||i.id}}continue}if(Y(t,n))return{element:t,componentType:"layout-pattern",displayName:i.name||i.id};let c=Gt(t,n);if(c&&c.tagName!=="DS-SHOWCASE")return{element:c,componentType:"layout-pattern",displayName:i.name||i.id}}if(t.tagName&&t.tagName.includes("-"))return{element:t,componentType:"web-component",displayName:t.tagName.toLowerCase()};if(t.tagName==="BUTTON"){let i=t.querySelector&&t.querySelector("pds-icon");return{element:t,componentType:"button",displayName:i?"button with icon":"button"}}if(Y(t,"pds-icon")||t.closest&&t.closest("pds-icon")){let i=Y(t,"pds-icon")?t:t.closest("pds-icon");return{element:i,componentType:"icon",displayName:`pds-icon (${i.getAttribute&&i.getAttribute("icon")||"unknown"})`}}if(Y(t,"nav[data-dropdown]")||t.closest&&t.closest("nav[data-dropdown]"))return{element:Y(t,"nav[data-dropdown]")?t:t.closest("nav[data-dropdown]"),componentType:"navigation",displayName:"dropdown menu"};t=t.parentElement}return null}var Kt=Fe;var U=class r{#e;#r;constructor(e={}){this.options={debug:!1,...e},this.options.design||(this.options.design={}),this.options.debug&&this.options.log?.("debug","Generator options:",this.options),this.tokens=this.generateTokens(),this.options.debug&&this.options.log?.("debug","Generated tokens:",this.tokens),this.#me(),typeof CSSStyleSheet<"u"?this.#we():this.options.debug&&this.options.log?.("debug","[Generator] Skipping browser features (CSSStyleSheet not available)")}generateTokens(){let e=this.options.design||{};return{colors:this.#i(e.colors||{}),spacing:this.generateSpacingTokens(e.spatialRhythm||{}),radius:this.#z(e.shape||{}),borderWidths:this.#_(e.shape||{}),typography:this.generateTypographyTokens(e.typography||{}),shadows:this.#M(e.layers||{}),layout:this.#L(e.layout||{}),transitions:this.#D(e.behavior||{}),zIndex:this.#P(e.layers||{}),icons:this.#R(e.icons||{})}}#i(e){let{primary:t="#3b82f6",secondary:s="#64748b",accent:o="#ec4899",background:i="#ffffff",success:a=null,warning:n="#FFBF00",danger:c=null,info:l=null,darkMode:d={}}=e,p={primary:this.#o(t),secondary:this.#o(s),accent:this.#o(o),success:this.#o(a||this.#n(t)),warning:this.#o(n||o),danger:this.#o(c||this.#w(t)),info:this.#o(l||t),gray:this.#u(s),surface:this.#h(i)};return p.surface.fieldset=this.#x(p.surface),p.surfaceSmart=this.#y(p.surface),p.dark=this.#S(p,i,d),p.dark&&p.dark.surface&&(p.dark.surfaceSmart=this.#y(p.dark.surface)),p.interactive={light:{fill:this.#b(p.primary,4.5),text:p.primary[600]},dark:{fill:this.#b(p.dark.primary,4.5),text:this.#T(p.dark.primary,p.dark.surface.base,4.5)}},p}#o(e){let t=this.#s(e);return{50:this.#t(t.h,Math.max(t.s-10,10),Math.min(t.l+45,95)),100:this.#t(t.h,Math.max(t.s-5,15),Math.min(t.l+35,90)),200:this.#t(t.h,t.s,Math.min(t.l+25,85)),300:this.#t(t.h,t.s,Math.min(t.l+15,75)),400:this.#t(t.h,t.s,Math.min(t.l+5,65)),500:e,600:this.#t(t.h,t.s,Math.max(t.l-10,25)),700:this.#t(t.h,t.s,Math.max(t.l-20,20)),800:this.#t(t.h,t.s,Math.max(t.l-30,15)),900:this.#t(t.h,t.s,Math.max(t.l-40,10))}}#n(e){let t=this.#s(e);return this.#t(120,Math.max(t.s,60),45)}#w(e){let t=this.#s(e);return this.#t(0,Math.max(t.s,70),50)}#u(e){let t=this.#s(e),s=t.h,o=Math.min(t.s,10);return{50:this.#t(s,o,98),100:this.#t(s,o,95),200:this.#t(s,o,88),300:this.#t(s,o,78),400:this.#t(s,o,60),500:e,600:this.#t(s,Math.min(o+5,15),45),700:this.#t(s,Math.min(o+8,18),35),800:this.#t(s,Math.min(o+10,20),20),900:this.#t(s,Math.min(o+12,22),10)}}#h(e){let t=this.#s(e);return{base:e,subtle:this.#t(t.h,Math.max(t.s,2),Math.max(t.l-2,2)),elevated:this.#t(t.h,Math.max(t.s,3),Math.max(t.l-4,5)),sunken:this.#t(t.h,Math.max(t.s,4),Math.max(t.l-6,8)),overlay:this.#t(t.h,Math.max(t.s,2),Math.min(t.l+2,98)),inverse:this.#g(e),hover:"color-mix(in oklab, var(--color-surface-base) 92%, var(--color-text-primary) 8%);"}}#x(e){return{base:e.subtle,subtle:e.elevated,elevated:e.sunken,sunken:this.#k(e.sunken,.05),overlay:e.elevated}}#k(e,t=.05){let s=this.#s(e),o=Math.max(s.l-s.l*t,5);return this.#t(s.h,s.s,o)}#g(e){let t=this.#s(e);if(t.l>50){let s=Math.min(t.s+5,25),o=Math.max(12-(t.l-50)*.1,8);return this.#t(t.h,s,o)}else{let s=Math.max(t.s-10,5),o=Math.min(85+(50-t.l)*.3,95);return this.#t(t.h,s,o)}}#S(e,t="#ffffff",s={}){let o=s.background?s.background:this.#g(t),i=this.#h(o),a=s.primary?this.#o(s.primary):this.#a(e.primary);return{surface:{...i,fieldset:this.#E(i)},primary:a,secondary:s.secondary?this.#o(s.secondary):this.#a(e.secondary),accent:s.accent?this.#o(s.accent):this.#a(e.accent),gray:s.secondary?this.#u(s.secondary):e.gray,success:this.#a(e.success),info:this.#a(e.info),warning:this.#a(e.warning),danger:this.#a(e.danger)}}#l(e){let t=String(e||"").replace("#",""),s=t.length===3?t.split("").map(i=>i+i).join(""):t,o=parseInt(s,16);return{r:o>>16&255,g:o>>8&255,b:o&255}}#p(e){let{r:t,g:s,b:o}=this.#l(e),i=[t/255,s/255,o/255].map(a=>a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4));return .2126*i[0]+.7152*i[1]+.0722*i[2]}#d(e,t){let s=this.#p(e),o=this.#p(t),i=Math.max(s,o),a=Math.min(s,o);return(i+.05)/(a+.05)}#m(e,t=4.5){if(!e)return"#000000";let s="#ffffff",o="#000000",i=this.#d(e,s);if(i>=t)return s;let a=this.#d(e,o);return a>=t||a>i?o:s}#f(e,t=1){let{r:s,g:o,b:i}=this.#l(e);return`rgba(${s}, ${o}, ${i}, ${t})`}#$(e,t,s=.5){let o=this.#l(e),i=this.#l(t),a=Math.round(o.r+(i.r-o.r)*s),n=Math.round(o.g+(i.g-o.g)*s),c=Math.round(o.b+(i.b-o.b)*s);return this.#C(a,n,c)}#C(e,t,s){let o=i=>{let a=Math.max(0,Math.min(255,Math.round(i))).toString(16);return a.length===1?"0"+a:a};return`#${o(e)}${o(t)}${o(s)}`}#E(e){return{base:e.elevated,subtle:e.overlay,elevated:this.#v(e.elevated,.08),sunken:e.elevated,overlay:this.#v(e.overlay,.05)}}#T(e={},t="#000000",s=4.5){let o=["600","700","800","500","400","900","300","200"],i={shade:null,color:null,ratio:0};for(let a of o){let n=e?.[a];if(!n||typeof n!="string")continue;let c=this.#d(n,t);if(c>i.ratio&&(i={shade:a,color:n,ratio:c}),c>=s)return n}return i.color||e?.["600"]||e?.["500"]}#b(e={},t=4.5){let s=["600","700","800","500","400","900"],o={shade:null,color:null,ratio:0};for(let i of s){let a=e?.[i];if(!a||typeof a!="string")continue;let n=this.#d(a,"#ffffff");if(n>o.ratio&&(o={shade:i,color:a,ratio:n}),n>=t)return a}return o.color||e?.["600"]||e?.["500"]}#y(e){let t={};return Object.entries(e).forEach(([s,o])=>{if(!o||typeof o!="string"||!o.startsWith("#"))return;let i=this.#p(o)<.5,a=this.#m(o,4.5),n=this.#m(o,3),c=this.#$(a,o,.4),l=a,d=c,p=i?"#ffffff":"#000000",h=i?.25:.1,m=this.#f(p,h),b=i?"#ffffff":"#000000",f=i?.15:.1,y=this.#f(b,f);t[s]={bg:o,text:a,textSecondary:n,textMuted:c,icon:l,iconSubtle:d,shadow:m,border:y,scheme:i?"dark":"light"}}),t}#v(e,t=.05){let s=this.#s(e),o=Math.min(s.l+(100-s.l)*t,95);return this.#t(s.h,s.s,o)}#a(e){let t={};return Object.entries({50:{source:"900",dimFactor:.8},100:{source:"800",dimFactor:.8},200:{source:"700",dimFactor:.8},300:{source:"600",dimFactor:.8},400:{source:"500",dimFactor:.85},500:{source:"400",dimFactor:.85},600:{source:"300",dimFactor:.85},700:{source:"200",dimFactor:.85},800:{source:"100",dimFactor:.95},900:{source:"50",dimFactor:.95}}).forEach(([o,i])=>{let a=e[i.source];t[o]=this.#A(a,i.dimFactor)}),t}#A(e,t=.8){let s=this.#s(e),o=Math.max(s.s*t,5),i=Math.max(s.l*t,5);return this.#t(s.h,o,i)}generateSpacingTokens(e){let{baseUnit:t=4,scaleRatio:s=1.25,maxSpacingSteps:o=12}=e,i=Number.isFinite(Number(t))?Number(t):4,a=Math.min(Number.isFinite(Number(o))?Number(o):12,12),n={0:"0"};for(let c=1;c<=a;c++)n[c]=`${i*c}px`;return n}#z(e){let{radiusSize:t="medium",customRadius:s=null}=e,o;s!=null?o=s:typeof t=="number"?o=t:typeof t=="string"?o=u.RadiusSizes[t]??u.RadiusSizes.medium:o=u.RadiusSizes.medium;let i=Number.isFinite(Number(o))?Number(o):u.RadiusSizes.medium;return{none:"0",xs:`${Number.isFinite(i*.25)?Math.round(i*.25):0}px`,sm:`${Number.isFinite(i*.5)?Math.round(i*.5):0}px`,md:`${i}px`,lg:`${Number.isFinite(i*1.5)?Math.round(i*1.5):0}px`,xl:`${Number.isFinite(i*2)?Math.round(i*2):0}px`,full:"9999px"}}#_(e){let{borderWidth:t="medium"}=e,s;return typeof t=="number"?s=t:typeof t=="string"?s=u.BorderWidths[t]??u.BorderWidths.medium:s=u.BorderWidths.medium,{hairline:`${u.BorderWidths.hairline}px`,thin:`${u.BorderWidths.thin}px`,medium:`${u.BorderWidths.medium}px`,thick:`${u.BorderWidths.thick}px`}}generateTypographyTokens(e){let{fontFamilyHeadings:t="system-ui, -apple-system, sans-serif",fontFamilyBody:s="system-ui, -apple-system, sans-serif",fontFamilyMono:o='ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',baseFontSize:i=16,fontScale:a=1.25,fontWeightLight:n=u.FontWeights.light,fontWeightNormal:c=u.FontWeights.normal,fontWeightMedium:l=u.FontWeights.medium,fontWeightSemibold:d=u.FontWeights.semibold,fontWeightBold:p=u.FontWeights.bold,lineHeightTight:h=u.LineHeights.tight,lineHeightNormal:m=u.LineHeights.normal,lineHeightRelaxed:b=u.LineHeights.relaxed}=e,f=Number.isFinite(Number(i))?Number(i):16,y=Number.isFinite(Number(a))?Number(a):1.25;return{fontFamily:{headings:t,body:s,mono:o},fontSize:{xs:`${Math.round(f/Math.pow(y,2))}px`,sm:`${Math.round(f/y)}px`,base:`${f}px`,lg:`${Math.round(f*y)}px`,xl:`${Math.round(f*Math.pow(y,2))}px`,"2xl":`${Math.round(f*Math.pow(y,3))}px`,"3xl":`${Math.round(f*Math.pow(y,4))}px`,"4xl":`${Math.round(f*Math.pow(y,5))}px`},fontWeight:{light:n?.toString()||"300",normal:c?.toString()||"400",medium:l?.toString()||"500",semibold:d?.toString()||"600",bold:p?.toString()||"700"},lineHeight:{tight:h?.toString()||"1.25",normal:m?.toString()||"1.5",relaxed:b?.toString()||"1.75"}}}#M(e){let{baseShadowOpacity:t=.1,shadowBlurMultiplier:s=1,shadowOffsetMultiplier:o=1}=e,i=`rgba(0, 0, 0, ${t})`,a=`rgba(0, 0, 0, ${t*.5})`;return{sm:`0 ${1*o}px ${2*s}px 0 ${a}`,base:`0 ${1*o}px ${3*s}px 0 ${i}, 0 ${1*o}px ${2*s}px 0 ${a}`,md:`0 ${4*o}px ${6*s}px ${-1*o}px ${i}, 0 ${2*o}px ${4*s}px ${-1*o}px ${a}`,lg:`0 ${10*o}px ${15*s}px ${-3*o}px ${i}, 0 ${4*o}px ${6*s}px ${-2*o}px ${a}`,xl:`0 ${20*o}px ${25*s}px ${-5*o}px ${i}, 0 ${10*o}px ${10*s}px ${-5*o}px ${a}`,inner:`inset 0 ${2*o}px ${4*s}px 0 ${a}`}}#L(e){let{maxWidth:t=1200,containerPadding:s=16,breakpoints:o={sm:640,md:768,lg:1024,xl:1280}}=e;return{maxWidth:`${t}px`,minHeight:"100vh",containerPadding:`${s}px`,breakpoints:{sm:`${o.sm}px`,md:`${o.md}px`,lg:`${o.lg}px`,xl:`${o.xl}px`},pageMargin:"120px",sectionGap:"160px",containerGap:"200px",heroSpacing:"240px",footerSpacing:"160px"}}#D(e){let{transitionSpeed:t=u.TransitionSpeeds.normal,animationEasing:s=u.AnimationEasings["ease-out"]}=e,o;return typeof t=="number"?o=t:typeof t=="string"&&u.TransitionSpeeds[t]?o=u.TransitionSpeeds[t]:o=u.TransitionSpeeds.normal,{fast:`${Math.round(o*.6)}ms`,normal:`${o}ms`,slow:`${Math.round(o*1.4)}ms`}}#P(e){let{baseZIndex:t=1e3,zIndexStep:s=10}=e;return{dropdown:t.toString(),sticky:(t+s*2).toString(),fixed:(t+s*3).toString(),modal:(t+s*4).toString(),drawer:(t+s*5).toString(),popover:(t+s*6).toString(),tooltip:(t+s*7).toString(),notification:(t+s*8).toString()}}#R(e){let{set:t="phosphor",weight:s="regular",defaultSize:o=24,sizes:i={xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64},spritePath:a="/assets/pds/icons/pds-icons.svg"}=e;return{set:t,weight:s,defaultSize:`${o}px`,sizes:Object.fromEntries(Object.entries(i).map(([n,c])=>[n,`${c}px`])),spritePath:a}}#F(e){let t=[];t.push(` /* Colors */
4
4
  `);let s=(o,i="")=>{Object.entries(o).forEach(([a,n])=>{typeof n=="object"&&n!==null?s(n,`${i}${a}-`):typeof n=="string"&&t.push(` --color-${i}${a}: ${n};
5
5
  `)})};return Object.entries(e).forEach(([o,i])=>{o!=="dark"&&o!=="surfaceSmart"&&o!=="interactive"&&typeof i=="object"&&i!==null&&s(i,`${o}-`)}),e.surfaceSmart&&(t.push(` /* Smart Surface Tokens (context-aware) */
6
6
  `),Object.entries(e.surfaceSmart).forEach(([o,i])=>{t.push(` --surface-${o}-bg: ${i.bg};
@@ -3296,14 +3296,14 @@ ${this.#ge()}
3296
3296
  `}#we(){this.#r={tokens:new CSSStyleSheet,primitives:new CSSStyleSheet,components:new CSSStyleSheet,utilities:new CSSStyleSheet},this.#xe()}#xe(){this.#r.tokens.replaceSync(this.#e.tokens),this.#r.primitives.replaceSync(this.#e.primitives),this.#r.components.replaceSync(this.#e.components),this.#r.utilities.replaceSync(this.#e.utilities)}get tokensCSS(){return this.#e?.tokens||""}get primitivesCSS(){return this.#e?.primitives||""}get componentsCSS(){return this.#e?.components||""}get utilitiesCSS(){return this.#e?.utilities||""}get layeredCSS(){return this.#e?`${this.#e.tokens}
3297
3297
  ${this.#e.primitives}
3298
3298
  ${this.#e.components}
3299
- ${this.#e.utilities}`:""}get compiled(){return{tokens:{colors:this.tokens.colors,spacing:this.tokens.spacing,radius:this.tokens.radius,borderWidths:this.tokens.borderWidths,typography:this.tokens.typography,shadows:this.tokens.shadows,layout:this.tokens.layout,transitions:this.tokens.transitions,zIndex:this.tokens.zIndex,icons:this.tokens.icons},layers:{tokens:{css:this.#e?.tokens||"",size:this.#e?.tokens?.length||0,sizeKB:((this.#e?.tokens?.length||0)/1024).toFixed(2)},primitives:{css:this.#e?.primitives||"",size:this.#e?.primitives?.length||0,sizeKB:((this.#e?.primitives?.length||0)/1024).toFixed(2)},components:{css:this.#e?.components||"",size:this.#e?.components?.length||0,sizeKB:((this.#e?.components?.length||0)/1024).toFixed(2)},utilities:{css:this.#e?.utilities||"",size:this.#e?.utilities?.length||0,sizeKB:((this.#e?.utilities?.length||0)/1024).toFixed(2)},combined:{css:this.layeredCSS,size:this.layeredCSS?.length||0,sizeKB:((this.layeredCSS?.length||0)/1024).toFixed(2)}},config:{design:this.options.design||{},preset:this.options.preset||null,debug:this.options.debug||!1},capabilities:{constructableStylesheets:typeof CSSStyleSheet<"u",blobURLs:typeof Blob<"u"&&typeof URL<"u",shadowDOM:typeof ShadowRoot<"u"},references:{ontology:typeof Re<"u"?Re:null,enums:typeof u<"u"?u:null},meta:{generatedAt:new Date().toISOString(),totalSize:(this.#e?.tokens?.length||0)+(this.#e?.primitives?.length||0)+(this.#e?.components?.length||0)+(this.#e?.utilities?.length||0),totalSizeKB:(((this.#e?.tokens?.length||0)+(this.#e?.primitives?.length||0)+(this.#e?.components?.length||0)+(this.#e?.utilities?.length||0))/1024).toFixed(2),layerCount:4,tokenGroups:Object.keys(this.tokens).length},helpers:{getColorScales:()=>{let e=[],t=this.tokens.colors;for(let[s,o]of Object.entries(t))typeof o=="object"&&o!==null&&e.push({name:s,scale:o});return e},getColorScale:e=>this.tokens.colors[e]||null,getSpacingValues:()=>Object.entries(this.tokens.spacing).map(([e,t])=>({key:e,value:t})),getTypography:()=>this.tokens.typography,getLayerCSS:e=>{let t=["tokens","primitives","components","utilities"];if(!t.includes(e))throw new Error(`Invalid layer: ${e}. Must be one of ${t.join(", ")}`);return this.#e?.[e]||""},usesEnumValue:(e,t)=>{let s=this.options.design||{};return JSON.stringify(s).includes(t)}}}}get tokensStylesheet(){return this.#r?.tokens}get primitivesStylesheet(){return this.#r?.primitives}get componentsStylesheet(){return this.#r?.components}get utilitiesStylesheet(){return this.#r?.utilities}getCSSModules(){return{"pds-tokens.css.js":this.#c("tokens",this.#e.tokens),"pds-primitives.css.js":this.#c("primitives",this.#e.primitives),"pds-components.css.js":this.#c("components",this.#e.components),"pds-utilities.css.js":this.#c("utilities",this.#e.utilities),"pds-styles.css.js":this.#c("styles",this.layeredCSS)}}#c(e,t){let s=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$");return`// Pure Design System - ${e}
3299
+ ${this.#e.utilities}`:""}get compiled(){return{tokens:{colors:this.tokens.colors,spacing:this.tokens.spacing,radius:this.tokens.radius,borderWidths:this.tokens.borderWidths,typography:this.tokens.typography,shadows:this.tokens.shadows,layout:this.tokens.layout,transitions:this.tokens.transitions,zIndex:this.tokens.zIndex,icons:this.tokens.icons},layers:{tokens:{css:this.#e?.tokens||"",size:this.#e?.tokens?.length||0,sizeKB:((this.#e?.tokens?.length||0)/1024).toFixed(2)},primitives:{css:this.#e?.primitives||"",size:this.#e?.primitives?.length||0,sizeKB:((this.#e?.primitives?.length||0)/1024).toFixed(2)},components:{css:this.#e?.components||"",size:this.#e?.components?.length||0,sizeKB:((this.#e?.components?.length||0)/1024).toFixed(2)},utilities:{css:this.#e?.utilities||"",size:this.#e?.utilities?.length||0,sizeKB:((this.#e?.utilities?.length||0)/1024).toFixed(2)},combined:{css:this.layeredCSS,size:this.layeredCSS?.length||0,sizeKB:((this.layeredCSS?.length||0)/1024).toFixed(2)}},config:{design:this.options.design||{},preset:this.options.preset||null,debug:this.options.debug||!1},capabilities:{constructableStylesheets:typeof CSSStyleSheet<"u",blobURLs:typeof Blob<"u"&&typeof URL<"u",shadowDOM:typeof ShadowRoot<"u"},references:{ontology:typeof Fe<"u"?Fe:null,enums:typeof u<"u"?u:null},meta:{generatedAt:new Date().toISOString(),totalSize:(this.#e?.tokens?.length||0)+(this.#e?.primitives?.length||0)+(this.#e?.components?.length||0)+(this.#e?.utilities?.length||0),totalSizeKB:(((this.#e?.tokens?.length||0)+(this.#e?.primitives?.length||0)+(this.#e?.components?.length||0)+(this.#e?.utilities?.length||0))/1024).toFixed(2),layerCount:4,tokenGroups:Object.keys(this.tokens).length},helpers:{getColorScales:()=>{let e=[],t=this.tokens.colors;for(let[s,o]of Object.entries(t))typeof o=="object"&&o!==null&&e.push({name:s,scale:o});return e},getColorScale:e=>this.tokens.colors[e]||null,getSpacingValues:()=>Object.entries(this.tokens.spacing).map(([e,t])=>({key:e,value:t})),getTypography:()=>this.tokens.typography,getLayerCSS:e=>{let t=["tokens","primitives","components","utilities"];if(!t.includes(e))throw new Error(`Invalid layer: ${e}. Must be one of ${t.join(", ")}`);return this.#e?.[e]||""},usesEnumValue:(e,t)=>{let s=this.options.design||{};return JSON.stringify(s).includes(t)}}}}get tokensStylesheet(){return this.#r?.tokens}get primitivesStylesheet(){return this.#r?.primitives}get componentsStylesheet(){return this.#r?.components}get utilitiesStylesheet(){return this.#r?.utilities}getCSSModules(){return{"pds-tokens.css.js":this.#c("tokens",this.#e.tokens),"pds-primitives.css.js":this.#c("primitives",this.#e.primitives),"pds-components.css.js":this.#c("components",this.#e.components),"pds-utilities.css.js":this.#c("utilities",this.#e.utilities),"pds-styles.css.js":this.#c("styles",this.layeredCSS)}}#c(e,t){let s=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$");return`// Pure Design System - ${e}
3300
3300
  // Auto-generated - do not edit directly
3301
3301
 
3302
3302
  export const ${e} = new CSSStyleSheet();
3303
3303
  ${e}.replaceSync(\`${s}\`);
3304
3304
 
3305
3305
  export const ${e}CSS = \`${s}\`;
3306
- `}static applyStyles(e){if(!e||typeof e!="object"){e?.options?.log?.("error","[Generator] applyStyles requires a generator object");return}let t=e.layeredCSS||e.css||"";if(!t){e?.options?.log?.("warn","[Generator] No CSS available on designer to apply");return}r.installRuntimeStyles(t)}static installRuntimeStyles(e){try{if(typeof document>"u")return;if(typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype){let o=new CSSStyleSheet;o.replaceSync(e),o._pds=!0;let i=(document.adoptedStyleSheets||[]).filter(a=>a._pds!==!0);document.adoptedStyleSheets=[...i,o],r.__pdsRuntimeSheet=o;return}let t="pds-runtime-stylesheet",s=document.getElementById(t);if(!s){s=document.createElement("style"),s.id=t,s.type="text/css";let o=document.head||document.getElementsByTagName("head")[0];o?o.appendChild(s):document.documentElement.appendChild(s)}s.textContent=e}catch(t){console.warn("Generator.installRuntimeStyles failed:",t)}}};async function Kt(r,e=[]){try{let t=await PDS.registry.getStylesheet("primitives");if(r.adoptedStyleSheets=[t,...e],PDS.registry.isLive){let s=r.host?.tagName?.toLowerCase()||"unknown"}}catch(t){let s=r.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${s}> failed to adopt primitives:`,t),r.adoptedStyleSheets=e}}async function Jt(r,e=["primitives"],t=[]){try{let o=(await Promise.all(e.map(i=>PDS.registry.getStylesheet(i)))).filter(i=>i!==null);if(r.adoptedStyleSheets=[...o,...t],PDS.registry.isLive){let i=r.host?.tagName?.toLowerCase()||"unknown"}}catch(s){let o=r.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${o}> failed to adopt layers:`,s),r.adoptedStyleSheets=t}}function Qt(r){let e=new CSSStyleSheet;return e.replaceSync(r),e}function Yt(){return pdsRegistry.isLive}var $={"ocean-breeze":{id:"ocean-breeze",name:"Ocean Breeze",tags:["playful"],description:"Fresh and calming ocean-inspired palette with professional undertones",options:{liquidGlassEffects:!0,backgroundMesh:3},colors:{primary:"#0891b2",secondary:"#64748b",accent:"#06b6d4",background:"#f0f9ff",darkMode:{background:"#0c1821",secondary:"#94a3b8",primary:"#0891b2"}},typography:{baseFontSize:17,fontScale:1.5,fontFamilyHeadings:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyBody:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif'},spatialRhythm:{baseUnit:6,scaleRatio:1.2},shape:{radiusSize:u.RadiusSizes.xxlarge}},"midnight-steel":{id:"midnight-steel",name:"Midnight Steel",description:"Bold industrial aesthetic with sharp contrasts and urban edge",colors:{primary:"#3b82f6",secondary:"#52525b",accent:"#f59e0b",background:"#fafaf9",darkMode:{background:"#18181b",secondary:"#71717a",primary:"#3b82f6"}},typography:{baseFontSize:16,fontScale:1.333,fontFamilyHeadings:"'IBM Plex Sans', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, sans-serif",fontWeightSemibold:600},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:u.RadiusSizes.small,borderWidth:u.BorderWidths.thin}},"neural-glow":{id:"neural-glow",name:"Neural Glow",description:"AI-inspired with vibrant purple-blue gradients and futuristic vibes",colors:{primary:"#8b5cf6",secondary:"#6366f1",accent:"#ec4899",background:"#faf5ff",darkMode:{background:"#0f0a1a",secondary:"#818cf8",primary:"#8b5cf6"}},typography:{baseFontSize:16,fontScale:1.618,fontFamilyHeadings:"'Space Grotesk', system-ui, sans-serif",fontFamilyBody:"'Space Grotesk', system-ui, sans-serif"},spatialRhythm:{baseUnit:4,scaleRatio:1.5},shape:{radiusSize:u.RadiusSizes.xlarge,borderWidth:u.BorderWidths.medium},behavior:{transitionSpeed:u.TransitionSpeeds.fast}},"paper-and-ink":{id:"paper-and-ink",name:"Paper & Ink",tags:["app","featured"],description:"Ultra-minimal design with focus on typography and whitespace",colors:{primary:"#171717",secondary:"#737373",accent:"#525252",background:"#ffffff",darkMode:{background:"#0a0a0a",secondary:"#a3a3a3",primary:"#737373"}},typography:{baseFontSize:18,fontScale:1.333,fontFamilyHeadings:"'Helvetica Neue', 'Arial', sans-serif",fontFamilyBody:"'Georgia', 'Times New Roman', serif",fontWeightNormal:400,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.2},shape:{radiusSize:u.RadiusSizes.none,borderWidth:u.BorderWidths.thin}},"sunset-paradise":{id:"sunset-paradise",name:"Sunset Paradise",description:"Warm tropical colors evoking golden hour by the beach",options:{liquidGlassEffects:!0,backgroundMesh:2},colors:{primary:"#ea580c",secondary:"#d4a373",accent:"#fb923c",background:"#fffbeb",darkMode:{background:"#1a0f0a",secondary:"#c9a482",primary:"#f97316"}},typography:{baseFontSize:16,fontScale:1.5,fontFamilyHeadings:"'Quicksand', 'Comfortaa', sans-serif",fontFamilyBody:"'Quicksand', 'Comfortaa', sans-serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.5},shape:{radiusSize:u.RadiusSizes.xxlarge,borderWidth:u.BorderWidths.medium}},"retro-wave":{id:"retro-wave",name:"Retro Wave",description:"Nostalgic 80s-inspired palette with neon undertones",colors:{primary:"#c026d3",secondary:"#a78bfa",accent:"#22d3ee",background:"#fef3ff",darkMode:{background:"#1a0a1f",secondary:"#c4b5fd",primary:"#d946ef"}},typography:{baseFontSize:15,fontScale:1.5,fontFamilyHeadings:"'Orbitron', 'Impact', monospace",fontFamilyBody:"'Courier New', 'Courier', monospace",fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:u.RadiusSizes.none,borderWidth:u.BorderWidths.thick},behavior:{transitionSpeed:u.TransitionSpeeds.instant}},"forest-canopy":{id:"forest-canopy",name:"Forest Canopy",description:"Natural earth tones with organic, calming green hues",colors:{primary:"#059669",secondary:"#78716c",accent:"#84cc16",background:"#f0fdf4",darkMode:{background:"#0a1410",secondary:"#a8a29e",primary:"#10b981"}},typography:{baseFontSize:16,fontScale:1.414,fontFamilyHeadings:"'Merriweather Sans', 'Arial', sans-serif",fontFamilyBody:"'Merriweather', 'Georgia', serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.3},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin}},"ruby-elegance":{id:"ruby-elegance",name:"Ruby Elegance",description:"Sophisticated palette with rich ruby reds and warm accents",colors:{primary:"#dc2626",secondary:"#9ca3af",accent:"#be123c",background:"#fef2f2",darkMode:{background:"#1b0808",secondary:"#d1d5db",primary:"#ef4444"}},typography:{baseFontSize:17,fontScale:1.5,fontFamilyHeadings:"'Playfair Display', 'Georgia', serif",fontFamilyBody:"'Crimson Text', 'Garamond', serif",fontWeightNormal:400,fontWeightSemibold:600},spatialRhythm:{baseUnit:4,scaleRatio:1.333},shape:{radiusSize:u.RadiusSizes.small,borderWidth:u.BorderWidths.thin}},"desert-dawn":{id:"desert-dawn",name:"Desert Dawn",description:"Sun-baked neutrals with grounded terracotta and cool oasis accents",colors:{primary:"#b45309",secondary:"#a8a29e",accent:"#0ea5a8",background:"#fcf6ef",darkMode:{background:"#12100e",secondary:"#d1d5db",primary:"#f59e0b"}},typography:{baseFontSize:16,fontScale:1.414,fontFamilyHeadings:"'Source Sans Pro', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Source Serif Pro', Georgia, serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.3},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.medium}},"contrast-pro":{id:"contrast-pro",name:"Contrast Pro",description:"Accessibility-first, high-contrast UI with assertive clarity",colors:{primary:"#1f2937",secondary:"#111827",accent:"#eab308",background:"#ffffff",darkMode:{background:"#0b0f14",secondary:"#9ca3af",primary:"#9ca3af"}},typography:{baseFontSize:17,fontScale:1.2,fontFamilyHeadings:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontFamilyBody:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontWeightBold:700},spatialRhythm:{baseUnit:3,scaleRatio:1.2},shape:{radiusSize:u.RadiusSizes.small,borderWidth:u.BorderWidths.thick},behavior:{transitionSpeed:u.TransitionSpeeds.fast,focusRingWidth:4}},"pastel-play":{id:"pastel-play",name:"Pastel Play",description:"Playful pastels with soft surfaces and friendly rounded shapes",colors:{primary:"#db2777",secondary:"#a78bfa",accent:"#34d399",background:"#fff7fa",darkMode:{background:"#1a1016",secondary:"#c4b5fd",primary:"#ec4899"}},typography:{baseFontSize:16,fontScale:1.333,fontFamilyHeadings:"'Nunito', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Nunito', system-ui, -apple-system, sans-serif",lineHeightRelaxed:u.LineHeights.relaxed},spatialRhythm:{baseUnit:6,scaleRatio:1.4},shape:{radiusSize:u.RadiusSizes.xxlarge,borderWidth:u.BorderWidths.thin},behavior:{transitionSpeed:u.TransitionSpeeds.slow,animationEasing:u.AnimationEasings["ease-out"]}},"brutalist-tech":{id:"brutalist-tech",name:"Brutalist Tech",description:"Stark grayscale with engineered accents and unapologetically bold structure",colors:{primary:"#111111",secondary:"#4b5563",accent:"#06b6d4",background:"#f8fafc",darkMode:{background:"#0b0b0b",secondary:"#9ca3af",primary:"#06b6d4"}},typography:{baseFontSize:15,fontScale:1.25,fontFamilyHeadings:"'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace",fontFamilyBody:"'Inter', system-ui, -apple-system, sans-serif",letterSpacingTight:-.02},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:u.RadiusSizes.none,borderWidth:u.BorderWidths.thick},behavior:{transitionSpeed:u.TransitionSpeeds.instant}},"zen-garden":{id:"zen-garden",name:"Zen Garden",description:"Soft botanicals with contemplative spacing and balanced motion",colors:{primary:"#3f6212",secondary:"#6b7280",accent:"#7c3aed",background:"#f7fbef",darkMode:{background:"#0d130a",secondary:"#a3a3a3",primary:"#84cc16"}},typography:{baseFontSize:17,fontScale:1.414,fontFamilyHeadings:"'Merriweather', Georgia, serif",fontFamilyBody:"'Noto Sans', system-ui, -apple-system, sans-serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.35},shape:{radiusSize:u.RadiusSizes.large,borderWidth:u.BorderWidths.medium},behavior:{transitionSpeed:u.TransitionSpeeds.normal,animationEasing:u.AnimationEasings.ease}},"fitness-pro":{id:"fitness-pro",name:"Fitness Pro",tags:["app","featured"],description:"Health and fitness tracking aesthetic with data-driven dark surfaces and vibrant accent rings",options:{liquidGlassEffects:!0,backgroundMesh:2},colors:{primary:"#e91e63",secondary:"#78909c",accent:"#ab47bc",background:"#fafafa",darkMode:{background:"#1a1d21",secondary:"#78909c",primary:"#0a4ca4"}},typography:{baseFontSize:15,fontScale:1.25,fontFamilyHeadings:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:u.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerPadding:1.25,sectionSpacing:2.5},shape:{radiusSize:u.RadiusSizes.large,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"medium",blurMedium:12},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-out"],focusRingWidth:2}},"travel-market":{id:"travel-market",name:"Travel Market",description:"Hospitality marketplace design with clean cards, subtle shadows, and trust-building neutrals",options:{liquidGlassEffects:!0,backgroundMesh:3},colors:{primary:"#d93251",secondary:"#717171",accent:"#144990",background:"#ffffff",darkMode:{background:"#222222",secondary:"#b0b0b0",primary:"#ff5a7a"}},typography:{baseFontSize:16,fontScale:1.2,fontFamilyHeadings:"'Circular', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Circular', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightRelaxed:u.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:1440,containerPadding:1.5,sectionSpacing:3},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:8},behavior:{transitionSpeed:u.TransitionSpeeds.normal,animationEasing:u.AnimationEasings["ease-in-out"],hoverOpacity:.9}},"mobility-app":{id:"mobility-app",name:"Mobility App",tags:["app","featured"],description:"On-demand service platform with bold typography, map-ready colors, and action-driven UI",options:{liquidGlassEffects:!0,backgroundMesh:0},colors:{primary:"#000000",secondary:"#545454",accent:"#06c167",background:"#f6f6f6",darkMode:{background:"#0f0f0f",secondary:"#8a8a8a",primary:"#06c167"}},typography:{baseFontSize:16,fontScale:1.3,fontFamilyHeadings:"'UberMove', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'UberMove', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25,buttonPadding:1.25,inputPadding:1},shape:{radiusSize:u.RadiusSizes.small,borderWidth:u.BorderWidths.medium},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-out"],focusRingWidth:3},a11y:{minTouchTarget:u.TouchTargetSizes.comfortable,focusStyle:u.FocusStyles.ring}},"fintech-secure":{id:"fintech-secure",name:"Fintech Secure",description:"Financial services app UI with trust-building blues, precise spacing, and security-first design",options:{liquidGlassEffects:!1,backgroundMesh:0},colors:{primary:"#0a2540",secondary:"#425466",accent:"#00d4ff",background:"#f7fafc",darkMode:{background:"#0a1929",secondary:"#8796a5",primary:"#00d4ff"}},typography:{baseFontSize:16,fontScale:1.25,fontFamilyHeadings:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyMono:"'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:1280,sectionSpacing:2.5},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:6},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-in-out"],focusRingWidth:3,focusRingOpacity:.4},a11y:{minTouchTarget:u.TouchTargetSizes.standard,focusStyle:u.FocusStyles.ring}},"social-feed":{id:"social-feed",name:"Social Feed",tags:["app","featured"],description:"Content-first social platform with minimal chrome, bold actions, and vibrant media presentation",options:{liquidGlassEffects:!0,backgroundMesh:4},colors:{primary:"#1877f2",secondary:"#65676b",accent:"#fe2c55",background:"#ffffff",darkMode:{background:"#18191a",secondary:"#b0b3b8",primary:"#2d88ff"}},typography:{baseFontSize:15,fontScale:1.2,fontFamilyHeadings:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontFamilyBody:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:u.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:680,sectionSpacing:1.5},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-out"],hoverOpacity:.85}},"enterprise-dash":{id:"enterprise-dash",tags:["app","featured"],name:"Enterprise Dashboard",description:"Data-dense business intelligence app interface with organized hierarchy and professional polish",options:{liquidGlassEffects:!1,backgroundMesh:2},colors:{primary:"#0066cc",secondary:"#5f6368",accent:"#1a73e8",background:"#ffffff",success:"#34a853",warning:"#fbbc04",danger:"#ea4335",darkMode:{background:"#202124",secondary:"#9aa0a6",primary:"#8ab4f8"}},typography:{baseFontSize:14,fontScale:1.2,fontFamilyHeadings:"'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyMono:"'Roboto Mono', ui-monospace, Consolas, monospace",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:u.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.2,containerMaxWidth:1600,containerPadding:1.5,sectionSpacing:2},shape:{radiusSize:u.RadiusSizes.small,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:4},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-in-out"],focusRingWidth:2},layout:{densityCompact:.85,gridColumns:12}}};$.default={id:"default",name:"Default",tags:["app","featured"],description:"Fresh and modern design system with balanced aesthetics and usability",options:{liquidGlassEffects:!0,backgroundMesh:4},form:{options:{widgets:{booleans:"toggle",numbers:"input",selects:"standard"},layouts:{fieldsets:"default",arrays:"default"},enhancements:{icons:!0,datalists:!0,rangeOutput:!0},validation:{showErrors:!0,validateOnChange:!1}}},colors:{primary:"#0e7490",secondary:"#a99b95",accent:"#e54271",background:"#e7e6de",darkMode:{background:"#16171a",secondary:"#8b9199",primary:"#06b6d4"},success:null,warning:"#B38600",danger:null,info:null,gradientStops:3,elevationOpacity:.05},typography:{baseFontSize:16,fontScale:1.2,fontFamilyHeadings:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyBody:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyMono:'ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',fontWeightLight:u.FontWeights.light,fontWeightNormal:u.FontWeights.normal,fontWeightMedium:u.FontWeights.medium,fontWeightSemibold:u.FontWeights.semibold,fontWeightBold:u.FontWeights.bold,lineHeightTight:u.LineHeights.tight,lineHeightNormal:u.LineHeights.normal,lineHeightRelaxed:u.LineHeights.relaxed,letterSpacingTight:-.025,letterSpacingNormal:0,letterSpacingWide:.025},spatialRhythm:{baseUnit:4,scaleRatio:1.25,maxSpacingSteps:32,containerMaxWidth:1200,containerPadding:1,inputPadding:.75,buttonPadding:1,sectionSpacing:2},layers:{shadowDepth:"medium",blurLight:4,blurMedium:8,blurHeavy:16,zIndexBase:0,zIndexDropdown:1e3,zIndexSticky:1020,zIndexFixed:1030,zIndexModal:1040,zIndexPopover:1050,zIndexTooltip:1060,zIndexNotification:1070},shape:{radiusSize:u.RadiusSizes.large,borderWidth:u.BorderWidths.medium,customRadius:null},behavior:{transitionSpeed:u.TransitionSpeeds.normal,animationEasing:u.AnimationEasings["ease-out"],customTransitionSpeed:null,customEasing:null,focusRingWidth:3,focusRingOpacity:.3,hoverOpacity:.8},layout:{gridColumns:12,gridGutter:1,breakpoints:{sm:640,md:768,lg:1024,xl:1280},densityCompact:.8,densityNormal:1,densityComfortable:1.2,buttonMinHeight:u.TouchTargetSizes.standard,inputMinHeight:40,utilities:{grid:!0,flex:!0,spacing:!0,container:!0},gridSystem:{columns:[1,2,3,4,6],autoFitBreakpoints:{sm:"150px",md:"250px",lg:"350px",xl:"450px"},enableGapUtilities:!0},containerMaxWidth:"1400px",containerPadding:"var(--spacing-6)"},advanced:{linkStyle:u.LinkStyles.inline,colorDerivation:"hsl"},a11y:{minTouchTarget:u.TouchTargetSizes.standard,prefersReducedMotion:!0,focusStyle:u.FocusStyles.ring},icons:{set:"phosphor",weight:"regular",defaultSize:24,sizes:{xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64},include:{navigation:["arrow-left","arrow-right","arrow-up","arrow-down","arrow-counter-clockwise","caret-left","caret-right","caret-down","caret-up","x","list","list-dashes","dots-three-vertical","dots-three","house","gear","magnifying-glass","funnel","tabs","sidebar"],actions:["plus","minus","check","trash","pencil","floppy-disk","copy","download","upload","share","link","eye","eye-slash","heart","star","bookmark","note-pencil","cursor-click","clipboard","magic-wand","sparkle"],communication:["envelope","bell","bell-ringing","bell-simple","chat-circle","phone","paper-plane-tilt","user","users","user-gear","at"],content:["image","file","file-text","file-css","file-js","folder","folder-open","book-open","camera","video-camera","play","pause","microphone","brackets-curly","code","folder-simple","grid-four","briefcase","chart-line","chart-bar","database","map-pin"],status:["info","warning","check-circle","x-circle","question","shield","shield-check","shield-warning","lock","lock-open","fingerprint","circle-notch"],time:["calendar","clock","timer","hourglass"],commerce:["shopping-cart","credit-card","currency-dollar","tag","receipt","storefront"],formatting:["text-align-left","text-align-center","text-align-right","text-b","text-italic","text-underline","list-bullets","list-numbers","text-aa"],system:["cloud","cloud-arrow-up","cloud-arrow-down","desktop","device-mobile","globe","wifi-high","battery-charging","sun","moon","moon-stars","palette","rocket","feather","square","circle","squares-four","lightning","wrench"]},spritePath:"public/assets/pds/icons/pds-icons.svg"},gap:4,debug:!1};function Fe(r="log",e,...t){if(this?.debug||this?.design?.debug||!1||r==="error"||r==="warn"){let o=console[r]||console.log;t.length>0?o(e,...t):o(e)}}var at=class{constructor(){this._mode="static",this._designer=null,this._staticPaths={tokens:"/assets/pds/styles/pds-tokens.css.js",primitives:"/assets/pds/styles/pds-primitives.css.js",components:"/assets/pds/styles/pds-components.css.js",utilities:"/assets/pds/styles/pds-utilities.css.js",styles:"/assets/pds/styles/pds-styles.css.js"}}setDesigner(e,t={}){this._designer=e,this._mode="live";let s=t?.presetName;s?e?.options?.log?.("log",`PDS live with preset "${s}"`):e?.options?.log?.("log","PDS live with custom config")}setStaticMode(e={}){this._mode="static",this._staticPaths={...this._staticPaths,...e},console.log("[PDS Registry] Switched to STATIC mode",this._staticPaths)}async getStylesheet(e){if(this._mode==="live"&&this._designer)switch(e){case"tokens":return this._designer.tokensStylesheet;case"primitives":return this._designer.primitivesStylesheet;case"components":return this._designer.componentsStylesheet;case"utilities":return this._designer.utilitiesStylesheet;default:return this._designer?.options?.log?.("warn",`[PDS Registry] Unknown layer: ${e}`),null}else try{return(await import(this._staticPaths[e]))[e]}catch(t){console.error(`[PDS Registry] Failed to load static ${e}:`,t),console.error(`[PDS Registry] Looking for: ${this._staticPaths[e]}`),console.error("[PDS Registry] Make sure you've run 'npm run pds:export' and configured PDS.start() with the correct static.root path");let s=new CSSStyleSheet;return s.replaceSync("/* Failed to load "+e+" */"),s}}get mode(){return this._mode}get isLive(){return this._mode==="live"&&this._designer!==null}get hasDesigner(){return this._designer!==null}},Zt=new at;var Ie={mode:"live",preset:"default",static:{root:"public/assets/pds/"},autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(r,e,...t){console[r](e,...t)}};async function Xt(r,e={}){return e={...{title:"Confirm",type:"confirm",buttons:{ok:{name:"OK",primary:!0},cancel:{name:"Cancel",cancel:!0}}},...e},new Promise(s=>{let o=document.createElement("dialog");Ie.options?.liquidGlassEffects&&o.classList.add("liquid-glass"),e.size&&o.classList.add(`dialog-${e.size}`),e.type&&o.classList.add(`dialog-${e.type}`),e.class&&(Array.isArray(e.class)?o.classList.add(...e.class):o.classList.add(e.class));let i=Object.entries(e.buttons).map(([n,c])=>{let l=c.primary?"btn-primary btn-sm":"btn-outline btn-sm";return`<button type="${c.cancel?"button":"submit"}" class="${l}" value="${n}">${c.name}</button>`});if(e.useForm){o.innerHTML=`
3306
+ `}static applyStyles(e){if(!e||typeof e!="object"){e?.options?.log?.("error","[Generator] applyStyles requires a generator object");return}let t=e.layeredCSS||e.css||"";if(!t){e?.options?.log?.("warn","[Generator] No CSS available on designer to apply");return}r.installRuntimeStyles(t)}static installRuntimeStyles(e){try{if(typeof document>"u")return;if(typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype){let o=new CSSStyleSheet;o.replaceSync(e),o._pds=!0;let i=(document.adoptedStyleSheets||[]).filter(a=>a._pds!==!0);document.adoptedStyleSheets=[...i,o],r.__pdsRuntimeSheet=o;return}let t="pds-runtime-stylesheet",s=document.getElementById(t);if(!s){s=document.createElement("style"),s.id=t,s.type="text/css";let o=document.head||document.getElementsByTagName("head")[0];o?o.appendChild(s):document.documentElement.appendChild(s)}s.textContent=e}catch(t){console.warn("Generator.installRuntimeStyles failed:",t)}}};async function Jt(r,e=[]){try{let t=await PDS.registry.getStylesheet("primitives");if(r.adoptedStyleSheets=[t,...e],PDS.registry.isLive){let s=r.host?.tagName?.toLowerCase()||"unknown"}}catch(t){let s=r.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${s}> failed to adopt primitives:`,t),r.adoptedStyleSheets=e}}async function Qt(r,e=["primitives"],t=[]){try{let o=(await Promise.all(e.map(i=>PDS.registry.getStylesheet(i)))).filter(i=>i!==null);if(r.adoptedStyleSheets=[...o,...t],PDS.registry.isLive){let i=r.host?.tagName?.toLowerCase()||"unknown"}}catch(s){let o=r.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${o}> failed to adopt layers:`,s),r.adoptedStyleSheets=t}}function Yt(r){let e=new CSSStyleSheet;return e.replaceSync(r),e}function Zt(){return Re.isLive}var $={"ocean-breeze":{id:"ocean-breeze",name:"Ocean Breeze",tags:["playful"],description:"Fresh and calming ocean-inspired palette with professional undertones",options:{liquidGlassEffects:!0,backgroundMesh:3},colors:{primary:"#0891b2",secondary:"#64748b",accent:"#06b6d4",background:"#f0f9ff",darkMode:{background:"#0c1821",secondary:"#94a3b8",primary:"#0891b2"}},typography:{baseFontSize:17,fontScale:1.5,fontFamilyHeadings:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyBody:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif'},spatialRhythm:{baseUnit:6,scaleRatio:1.2},shape:{radiusSize:u.RadiusSizes.xxlarge}},"midnight-steel":{id:"midnight-steel",name:"Midnight Steel",description:"Bold industrial aesthetic with sharp contrasts and urban edge",colors:{primary:"#3b82f6",secondary:"#52525b",accent:"#f59e0b",background:"#fafaf9",darkMode:{background:"#18181b",secondary:"#71717a",primary:"#3b82f6"}},typography:{baseFontSize:16,fontScale:1.333,fontFamilyHeadings:"'IBM Plex Sans', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, sans-serif",fontWeightSemibold:600},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:u.RadiusSizes.small,borderWidth:u.BorderWidths.thin}},"neural-glow":{id:"neural-glow",name:"Neural Glow",description:"AI-inspired with vibrant purple-blue gradients and futuristic vibes",colors:{primary:"#8b5cf6",secondary:"#6366f1",accent:"#ec4899",background:"#faf5ff",darkMode:{background:"#0f0a1a",secondary:"#818cf8",primary:"#8b5cf6"}},typography:{baseFontSize:16,fontScale:1.618,fontFamilyHeadings:"'Space Grotesk', system-ui, sans-serif",fontFamilyBody:"'Space Grotesk', system-ui, sans-serif"},spatialRhythm:{baseUnit:4,scaleRatio:1.5},shape:{radiusSize:u.RadiusSizes.xlarge,borderWidth:u.BorderWidths.medium},behavior:{transitionSpeed:u.TransitionSpeeds.fast}},"paper-and-ink":{id:"paper-and-ink",name:"Paper & Ink",tags:["app","featured"],description:"Ultra-minimal design with focus on typography and whitespace",colors:{primary:"#171717",secondary:"#737373",accent:"#525252",background:"#ffffff",darkMode:{background:"#0a0a0a",secondary:"#a3a3a3",primary:"#737373"}},typography:{baseFontSize:18,fontScale:1.333,fontFamilyHeadings:"'Helvetica Neue', 'Arial', sans-serif",fontFamilyBody:"'Georgia', 'Times New Roman', serif",fontWeightNormal:400,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.2},shape:{radiusSize:u.RadiusSizes.none,borderWidth:u.BorderWidths.thin}},"sunset-paradise":{id:"sunset-paradise",name:"Sunset Paradise",description:"Warm tropical colors evoking golden hour by the beach",options:{liquidGlassEffects:!0,backgroundMesh:2},colors:{primary:"#ea580c",secondary:"#d4a373",accent:"#fb923c",background:"#fffbeb",darkMode:{background:"#1a0f0a",secondary:"#c9a482",primary:"#f97316"}},typography:{baseFontSize:16,fontScale:1.5,fontFamilyHeadings:"'Quicksand', 'Comfortaa', sans-serif",fontFamilyBody:"'Quicksand', 'Comfortaa', sans-serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.5},shape:{radiusSize:u.RadiusSizes.xxlarge,borderWidth:u.BorderWidths.medium}},"retro-wave":{id:"retro-wave",name:"Retro Wave",description:"Nostalgic 80s-inspired palette with neon undertones",colors:{primary:"#c026d3",secondary:"#a78bfa",accent:"#22d3ee",background:"#fef3ff",darkMode:{background:"#1a0a1f",secondary:"#c4b5fd",primary:"#d946ef"}},typography:{baseFontSize:15,fontScale:1.5,fontFamilyHeadings:"'Orbitron', 'Impact', monospace",fontFamilyBody:"'Courier New', 'Courier', monospace",fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:u.RadiusSizes.none,borderWidth:u.BorderWidths.thick},behavior:{transitionSpeed:u.TransitionSpeeds.instant}},"forest-canopy":{id:"forest-canopy",name:"Forest Canopy",description:"Natural earth tones with organic, calming green hues",colors:{primary:"#059669",secondary:"#78716c",accent:"#84cc16",background:"#f0fdf4",darkMode:{background:"#0a1410",secondary:"#a8a29e",primary:"#10b981"}},typography:{baseFontSize:16,fontScale:1.414,fontFamilyHeadings:"'Merriweather Sans', 'Arial', sans-serif",fontFamilyBody:"'Merriweather', 'Georgia', serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.3},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin}},"ruby-elegance":{id:"ruby-elegance",name:"Ruby Elegance",description:"Sophisticated palette with rich ruby reds and warm accents",colors:{primary:"#dc2626",secondary:"#9ca3af",accent:"#be123c",background:"#fef2f2",darkMode:{background:"#1b0808",secondary:"#d1d5db",primary:"#ef4444"}},typography:{baseFontSize:17,fontScale:1.5,fontFamilyHeadings:"'Playfair Display', 'Georgia', serif",fontFamilyBody:"'Crimson Text', 'Garamond', serif",fontWeightNormal:400,fontWeightSemibold:600},spatialRhythm:{baseUnit:4,scaleRatio:1.333},shape:{radiusSize:u.RadiusSizes.small,borderWidth:u.BorderWidths.thin}},"desert-dawn":{id:"desert-dawn",name:"Desert Dawn",description:"Sun-baked neutrals with grounded terracotta and cool oasis accents",colors:{primary:"#b45309",secondary:"#a8a29e",accent:"#0ea5a8",background:"#fcf6ef",darkMode:{background:"#12100e",secondary:"#d1d5db",primary:"#f59e0b"}},typography:{baseFontSize:16,fontScale:1.414,fontFamilyHeadings:"'Source Sans Pro', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Source Serif Pro', Georgia, serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.3},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.medium}},"contrast-pro":{id:"contrast-pro",name:"Contrast Pro",description:"Accessibility-first, high-contrast UI with assertive clarity",colors:{primary:"#1f2937",secondary:"#111827",accent:"#eab308",background:"#ffffff",darkMode:{background:"#0b0f14",secondary:"#9ca3af",primary:"#9ca3af"}},typography:{baseFontSize:17,fontScale:1.2,fontFamilyHeadings:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontFamilyBody:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontWeightBold:700},spatialRhythm:{baseUnit:3,scaleRatio:1.2},shape:{radiusSize:u.RadiusSizes.small,borderWidth:u.BorderWidths.thick},behavior:{transitionSpeed:u.TransitionSpeeds.fast,focusRingWidth:4}},"pastel-play":{id:"pastel-play",name:"Pastel Play",description:"Playful pastels with soft surfaces and friendly rounded shapes",colors:{primary:"#db2777",secondary:"#a78bfa",accent:"#34d399",background:"#fff7fa",darkMode:{background:"#1a1016",secondary:"#c4b5fd",primary:"#ec4899"}},typography:{baseFontSize:16,fontScale:1.333,fontFamilyHeadings:"'Nunito', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Nunito', system-ui, -apple-system, sans-serif",lineHeightRelaxed:u.LineHeights.relaxed},spatialRhythm:{baseUnit:6,scaleRatio:1.4},shape:{radiusSize:u.RadiusSizes.xxlarge,borderWidth:u.BorderWidths.thin},behavior:{transitionSpeed:u.TransitionSpeeds.slow,animationEasing:u.AnimationEasings["ease-out"]}},"brutalist-tech":{id:"brutalist-tech",name:"Brutalist Tech",description:"Stark grayscale with engineered accents and unapologetically bold structure",colors:{primary:"#111111",secondary:"#4b5563",accent:"#06b6d4",background:"#f8fafc",darkMode:{background:"#0b0b0b",secondary:"#9ca3af",primary:"#06b6d4"}},typography:{baseFontSize:15,fontScale:1.25,fontFamilyHeadings:"'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace",fontFamilyBody:"'Inter', system-ui, -apple-system, sans-serif",letterSpacingTight:-.02},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:u.RadiusSizes.none,borderWidth:u.BorderWidths.thick},behavior:{transitionSpeed:u.TransitionSpeeds.instant}},"zen-garden":{id:"zen-garden",name:"Zen Garden",description:"Soft botanicals with contemplative spacing and balanced motion",colors:{primary:"#3f6212",secondary:"#6b7280",accent:"#7c3aed",background:"#f7fbef",darkMode:{background:"#0d130a",secondary:"#a3a3a3",primary:"#84cc16"}},typography:{baseFontSize:17,fontScale:1.414,fontFamilyHeadings:"'Merriweather', Georgia, serif",fontFamilyBody:"'Noto Sans', system-ui, -apple-system, sans-serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.35},shape:{radiusSize:u.RadiusSizes.large,borderWidth:u.BorderWidths.medium},behavior:{transitionSpeed:u.TransitionSpeeds.normal,animationEasing:u.AnimationEasings.ease}},"fitness-pro":{id:"fitness-pro",name:"Fitness Pro",tags:["app","featured"],description:"Health and fitness tracking aesthetic with data-driven dark surfaces and vibrant accent rings",options:{liquidGlassEffects:!0,backgroundMesh:2},colors:{primary:"#e91e63",secondary:"#78909c",accent:"#ab47bc",background:"#fafafa",darkMode:{background:"#1a1d21",secondary:"#78909c",primary:"#0a4ca4"}},typography:{baseFontSize:15,fontScale:1.25,fontFamilyHeadings:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:u.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerPadding:1.25,sectionSpacing:2.5},shape:{radiusSize:u.RadiusSizes.large,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"medium",blurMedium:12},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-out"],focusRingWidth:2}},"travel-market":{id:"travel-market",name:"Travel Market",description:"Hospitality marketplace design with clean cards, subtle shadows, and trust-building neutrals",options:{liquidGlassEffects:!0,backgroundMesh:3},colors:{primary:"#d93251",secondary:"#717171",accent:"#144990",background:"#ffffff",darkMode:{background:"#222222",secondary:"#b0b0b0",primary:"#ff5a7a"}},typography:{baseFontSize:16,fontScale:1.2,fontFamilyHeadings:"'Circular', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Circular', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightRelaxed:u.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:1440,containerPadding:1.5,sectionSpacing:3},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:8},behavior:{transitionSpeed:u.TransitionSpeeds.normal,animationEasing:u.AnimationEasings["ease-in-out"],hoverOpacity:.9}},"mobility-app":{id:"mobility-app",name:"Mobility App",tags:["app","featured"],description:"On-demand service platform with bold typography, map-ready colors, and action-driven UI",options:{liquidGlassEffects:!0,backgroundMesh:0},colors:{primary:"#000000",secondary:"#545454",accent:"#06c167",background:"#f6f6f6",darkMode:{background:"#0f0f0f",secondary:"#8a8a8a",primary:"#06c167"}},typography:{baseFontSize:16,fontScale:1.3,fontFamilyHeadings:"'UberMove', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'UberMove', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25,buttonPadding:1.25,inputPadding:1},shape:{radiusSize:u.RadiusSizes.small,borderWidth:u.BorderWidths.medium},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-out"],focusRingWidth:3},a11y:{minTouchTarget:u.TouchTargetSizes.comfortable,focusStyle:u.FocusStyles.ring}},"fintech-secure":{id:"fintech-secure",name:"Fintech Secure",description:"Financial services app UI with trust-building blues, precise spacing, and security-first design",options:{liquidGlassEffects:!1,backgroundMesh:0},colors:{primary:"#0a2540",secondary:"#425466",accent:"#00d4ff",background:"#f7fafc",darkMode:{background:"#0a1929",secondary:"#8796a5",primary:"#00d4ff"}},typography:{baseFontSize:16,fontScale:1.25,fontFamilyHeadings:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyMono:"'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:1280,sectionSpacing:2.5},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:6},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-in-out"],focusRingWidth:3,focusRingOpacity:.4},a11y:{minTouchTarget:u.TouchTargetSizes.standard,focusStyle:u.FocusStyles.ring}},"social-feed":{id:"social-feed",name:"Social Feed",tags:["app","featured"],description:"Content-first social platform with minimal chrome, bold actions, and vibrant media presentation",options:{liquidGlassEffects:!0,backgroundMesh:4},colors:{primary:"#1877f2",secondary:"#65676b",accent:"#fe2c55",background:"#ffffff",darkMode:{background:"#18191a",secondary:"#b0b3b8",primary:"#2d88ff"}},typography:{baseFontSize:15,fontScale:1.2,fontFamilyHeadings:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontFamilyBody:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:u.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:680,sectionSpacing:1.5},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-out"],hoverOpacity:.85}},"enterprise-dash":{id:"enterprise-dash",tags:["app","featured"],name:"Enterprise Dashboard",description:"Data-dense business intelligence app interface with organized hierarchy and professional polish",options:{liquidGlassEffects:!1,backgroundMesh:2},colors:{primary:"#0066cc",secondary:"#5f6368",accent:"#1a73e8",background:"#ffffff",success:"#34a853",warning:"#fbbc04",danger:"#ea4335",darkMode:{background:"#202124",secondary:"#9aa0a6",primary:"#8ab4f8"}},typography:{baseFontSize:14,fontScale:1.2,fontFamilyHeadings:"'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyMono:"'Roboto Mono', ui-monospace, Consolas, monospace",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:u.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.2,containerMaxWidth:1600,containerPadding:1.5,sectionSpacing:2},shape:{radiusSize:u.RadiusSizes.small,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:4},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-in-out"],focusRingWidth:2},layout:{densityCompact:.85,gridColumns:12}}};$.default={id:"default",name:"Default",tags:["app","featured"],description:"Fresh and modern design system with balanced aesthetics and usability",options:{liquidGlassEffects:!0,backgroundMesh:4},form:{options:{widgets:{booleans:"toggle",numbers:"input",selects:"standard"},layouts:{fieldsets:"default",arrays:"default"},enhancements:{icons:!0,datalists:!0,rangeOutput:!0},validation:{showErrors:!0,validateOnChange:!1}}},colors:{primary:"#0e7490",secondary:"#a99b95",accent:"#e54271",background:"#e7e6de",darkMode:{background:"#16171a",secondary:"#8b9199",primary:"#06b6d4"},success:null,warning:"#B38600",danger:null,info:null,gradientStops:3,elevationOpacity:.05},typography:{baseFontSize:16,fontScale:1.2,fontFamilyHeadings:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyBody:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyMono:'ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',fontWeightLight:u.FontWeights.light,fontWeightNormal:u.FontWeights.normal,fontWeightMedium:u.FontWeights.medium,fontWeightSemibold:u.FontWeights.semibold,fontWeightBold:u.FontWeights.bold,lineHeightTight:u.LineHeights.tight,lineHeightNormal:u.LineHeights.normal,lineHeightRelaxed:u.LineHeights.relaxed,letterSpacingTight:-.025,letterSpacingNormal:0,letterSpacingWide:.025},spatialRhythm:{baseUnit:4,scaleRatio:1.25,maxSpacingSteps:32,containerMaxWidth:1200,containerPadding:1,inputPadding:.75,buttonPadding:1,sectionSpacing:2},layers:{shadowDepth:"medium",blurLight:4,blurMedium:8,blurHeavy:16,zIndexBase:0,zIndexDropdown:1e3,zIndexSticky:1020,zIndexFixed:1030,zIndexModal:1040,zIndexPopover:1050,zIndexTooltip:1060,zIndexNotification:1070},shape:{radiusSize:u.RadiusSizes.large,borderWidth:u.BorderWidths.medium,customRadius:null},behavior:{transitionSpeed:u.TransitionSpeeds.normal,animationEasing:u.AnimationEasings["ease-out"],customTransitionSpeed:null,customEasing:null,focusRingWidth:3,focusRingOpacity:.3,hoverOpacity:.8},layout:{gridColumns:12,gridGutter:1,breakpoints:{sm:640,md:768,lg:1024,xl:1280},densityCompact:.8,densityNormal:1,densityComfortable:1.2,buttonMinHeight:u.TouchTargetSizes.standard,inputMinHeight:40,utilities:{grid:!0,flex:!0,spacing:!0,container:!0},gridSystem:{columns:[1,2,3,4,6],autoFitBreakpoints:{sm:"150px",md:"250px",lg:"350px",xl:"450px"},enableGapUtilities:!0},containerMaxWidth:"1400px",containerPadding:"var(--spacing-6)"},advanced:{linkStyle:u.LinkStyles.inline,colorDerivation:"hsl"},a11y:{minTouchTarget:u.TouchTargetSizes.standard,prefersReducedMotion:!0,focusStyle:u.FocusStyles.ring},icons:{set:"phosphor",weight:"regular",defaultSize:24,sizes:{xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64},include:{navigation:["arrow-left","arrow-right","arrow-up","arrow-down","arrow-counter-clockwise","caret-left","caret-right","caret-down","caret-up","x","list","list-dashes","dots-three-vertical","dots-three","house","gear","magnifying-glass","funnel","tabs","sidebar"],actions:["plus","minus","check","trash","pencil","floppy-disk","copy","download","upload","share","link","eye","eye-slash","heart","star","bookmark","note-pencil","cursor-click","clipboard","magic-wand","sparkle"],communication:["envelope","bell","bell-ringing","bell-simple","chat-circle","phone","paper-plane-tilt","user","users","user-gear","at"],content:["image","file","file-text","file-css","file-js","folder","folder-open","book-open","camera","video-camera","play","pause","microphone","brackets-curly","code","folder-simple","grid-four","briefcase","chart-line","chart-bar","database","map-pin"],status:["info","warning","check-circle","x-circle","question","shield","shield-check","shield-warning","lock","lock-open","fingerprint","circle-notch"],time:["calendar","clock","timer","hourglass"],commerce:["shopping-cart","credit-card","currency-dollar","tag","receipt","storefront"],formatting:["text-align-left","text-align-center","text-align-right","text-b","text-italic","text-underline","list-bullets","list-numbers","text-aa"],system:["cloud","cloud-arrow-up","cloud-arrow-down","desktop","device-mobile","globe","wifi-high","battery-charging","sun","moon","moon-stars","palette","rocket","feather","square","circle","squares-four","lightning","wrench"]},spritePath:"public/assets/pds/icons/pds-icons.svg"},gap:4,debug:!1};function Ie(r="log",e,...t){if(this?.debug||this?.design?.debug||!1||r==="error"||r==="warn"){let o=console[r]||console.log;t.length>0?o(e,...t):o(e)}}var Be={mode:"live",preset:"default",static:{root:"public/assets/pds/"},autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(r,e,...t){console[r](e,...t)}};async function Xt(r,e={}){return e={...{title:"Confirm",type:"confirm",buttons:{ok:{name:"OK",primary:!0},cancel:{name:"Cancel",cancel:!0}}},...e},new Promise(s=>{let o=document.createElement("dialog");Be.options?.liquidGlassEffects&&o.classList.add("liquid-glass"),e.size&&o.classList.add(`dialog-${e.size}`),e.type&&o.classList.add(`dialog-${e.type}`),e.class&&(Array.isArray(e.class)?o.classList.add(...e.class):o.classList.add(e.class));let i=Object.entries(e.buttons).map(([n,c])=>{let l=c.primary?"btn-primary btn-sm":"btn-outline btn-sm";return`<button type="${c.cancel?"button":"submit"}" class="${l}" value="${n}">${c.name}</button>`});if(e.useForm){o.innerHTML=`
3307
3307
  <header>
3308
3308
  <h2>${e.title}</h2>
3309
3309
  </header>
@@ -3321,7 +3321,7 @@ export const ${e}CSS = \`${s}\`;
3321
3321
  ${i.join("")}
3322
3322
  </footer>
3323
3323
  </form>
3324
- `;let n=o.querySelector("#msg-container");typeof r=="object"&&r._$litType$?O(r,n):typeof r=="string"?n.textContent=r:O(r,n)}o.addEventListener("click",n=>{n.target.closest('button[value="cancel"]')&&(o.close(),s(!1))});let a=()=>{let n=o.querySelector("form");n?n.addEventListener("submit",c=>{c.preventDefault();let l;e.useForm&&c.submitter.value==="ok"?(console.log("Found form:",n),console.log("Form elements:",n?Array.from(n.elements):"no form"),l=new FormData(n),console.log("FormData entries:",Array.from(l.entries()))):l=c.submitter.value==="ok",o.close(),s(l)}):requestAnimationFrame(a)};a(),o.addEventListener("close",()=>{setTimeout(()=>o.remove(),200)}),document.body.appendChild(o),typeof e.rendered=="function"&&e.rendered(o),o.showModal()})}var Be=class{constructor(e){this.pds=e,this.intents={color:["color","colours","shade","tint","hue","foreground","background","text","fill","bg","fg"],spacing:["spacing","space","gap","padding","margin","distance","rhythm"],typography:["font","text","type","typography","heading","body","size","weight","family"],border:["border","outline","stroke","edge","frame"],radius:["radius","rounded","corner","curve","round"],shadow:["shadow","elevation","depth","glow","drop-shadow"],component:["component","element","widget"],utility:["utility","class","helper","css"],layout:["layout","container","grid","flex","group","arrange","organize"],pattern:["pattern","example","template","structure"],interaction:["hover","focus","active","disabled","pressed","selected","checked"]},this.entities={button:["button","btn","cta"],input:["input","field","textbox","text-field","form-control"],card:["card","panel"],badge:["badge","pill","tag","chip"],surface:["surface","background","layer","container"],icon:["icon","svg","glyph","symbol"],link:["link","anchor","hyperlink"],nav:["nav","navigation","menu"],modal:["modal","dialog","popup","overlay"],drawer:["drawer","sidebar","panel"],tab:["tab","tabstrip"],toast:["toast","notification","alert","message"]},this.questionWords=["what","which","how","where","when","show","find","get","give","tell"]}async search(e){if(!e||e.length<2)return[];let t=e.toLowerCase().trim(),s=this.tokenize(t),o=this.analyzeQuery(s,t),i=[];o.intents.has("color")&&i.push(...this.queryColors(o,t)),(o.intents.has("utility")||o.intents.has("border")||o.intents.has("layout")||t.includes("class"))&&i.push(...this.queryUtilities(o,t)),(o.intents.has("component")||o.entities.size>0)&&i.push(...this.queryComponents(o,t)),(o.intents.has("layout")||o.intents.has("pattern"))&&i.push(...this.queryPatterns(o,t)),o.intents.has("typography")&&i.push(...this.queryTypography(o,t)),o.intents.has("spacing")&&i.push(...this.querySpacing(o,t));let a=new Map;for(let n of i){let c=n.value;(!a.has(c)||a.get(c).score<n.score)&&a.set(c,n)}return Array.from(a.values()).sort((n,c)=>c.score-n.score).slice(0,10)}tokenize(e){return e.toLowerCase().replace(/[?!.]/g,"").split(/\s+/).filter(t=>t.length>0)}analyzeQuery(e,t){let s={intents:new Set,entities:new Set,modifiers:new Set,isQuestion:!1,tokens:e,fullText:t};s.isQuestion=this.questionWords.some(o=>e.includes(o));for(let[o,i]of Object.entries(this.intents))i.some(a=>e.includes(a)||t.includes(a))&&s.intents.add(o);for(let[o,i]of Object.entries(this.entities))i.some(a=>e.includes(a)||t.includes(a))&&s.entities.add(o);return(e.includes("hover")||t.includes("hover"))&&s.modifiers.add("hover"),(e.includes("focus")||t.includes("focus"))&&s.modifiers.add("focus"),(e.includes("active")||t.includes("active"))&&s.modifiers.add("active"),(e.includes("disabled")||t.includes("disabled"))&&s.modifiers.add("disabled"),s}queryColors(e,t){let s=[],o=this.pds.compiled;if(!o?.tokens?.colors)return s;let i=o.tokens.colors,a=Array.from(e.entities),n=Array.from(e.modifiers);if(n.includes("focus")&&e.intents.has("border")&&a.includes("input")&&s.push({text:"Focus border color: var(--color-primary-500)",value:"--color-primary-500",icon:"palette",category:"Color Token",score:100,cssVar:"var(--color-primary-500)",description:"Primary color used for focus states on form inputs"}),(t.includes("foreground")||t.includes("text"))&&(t.includes("surface")||e.entities.has("surface"))&&(s.push({text:"Text on surface: var(--surface-text)",value:"--surface-text",icon:"palette",category:"Surface Token",score:95,cssVar:"var(--surface-text)",description:"Default text color for current surface"}),s.push({text:"Secondary text: var(--surface-text-secondary)",value:"--surface-text-secondary",icon:"palette",category:"Surface Token",score:90,cssVar:"var(--surface-text-secondary)",description:"Secondary/muted text on surface"})),t.includes("primary")||t.includes("accent")||t.includes("secondary")){let c=t.includes("primary")?"primary":t.includes("accent")?"accent":"secondary";for(let l of[500,600,700]){let d=`--color-${c}-${l}`;s.push({text:`${c.charAt(0).toUpperCase()+c.slice(1)} ${l}: var(${d})`,value:d,icon:"palette",category:"Color Scale",score:80-(l-500)/100,cssVar:`var(${d})`,description:`${c} color scale shade ${l}`})}}if(a.includes("button")&&e.intents.has("color")){let c=n[0];c?s.push({text:`Button ${c} fill: var(--primary-fill-${c})`,value:`--primary-fill-${c}`,icon:"palette",category:"Interactive Token",score:92,description:`Button background color in ${c} state`}):s.push({text:"Button fill: var(--primary-fill)",value:"--primary-fill",icon:"palette",category:"Interactive Token",score:88,description:"Default button background color"})}return s}queryUtilities(e,t){let s=[],o=this.pds.ontology;if(!o?.utilities)return s;let i=o.utilities;return e.intents.has("border")&&i.filter(n=>n.includes("border")||n.includes("outline")).forEach(n=>{let c=80;t.includes("gradient")&&n.includes("gradient")&&(c=95),t.includes("glow")&&n.includes("glow")&&(c=95),s.push({text:`${n} - Border utility class`,value:n,icon:"code",category:"Utility Class",score:c,code:`<div class="${n}">...</div>`,description:this.describeUtility(n)})}),e.intents.has("layout")&&i.filter(n=>n.includes("flex")||n.includes("grid")||n.includes("items-")||n.includes("justify-")||n.includes("gap-")).forEach(n=>{s.push({text:`${n} - Layout utility`,value:n,icon:"layout",category:"Utility Class",score:85,code:`<div class="${n}">...</div>`,description:this.describeUtility(n)})}),t.includes("group")&&e.entities.has("button")&&s.push({text:".btn-group - Group buttons together",value:".btn-group",icon:"code",category:"Utility Class",score:90,code:`<div class="btn-group">
3324
+ `;let n=o.querySelector("#msg-container");typeof r=="object"&&r._$litType$?O(r,n):typeof r=="string"?n.textContent=r:O(r,n)}o.addEventListener("click",n=>{n.target.closest('button[value="cancel"]')&&(o.close(),s(!1))});let a=()=>{let n=o.querySelector("form");n?n.addEventListener("submit",c=>{c.preventDefault();let l;e.useForm&&c.submitter.value==="ok"?(console.log("Found form:",n),console.log("Form elements:",n?Array.from(n.elements):"no form"),l=new FormData(n),console.log("FormData entries:",Array.from(l.entries()))):l=c.submitter.value==="ok",o.close(),s(l)}):requestAnimationFrame(a)};a(),o.addEventListener("close",()=>{setTimeout(()=>o.remove(),200)}),document.body.appendChild(o),typeof e.rendered=="function"&&e.rendered(o),o.showModal()})}var Ne=class{constructor(e){this.pds=e,this.intents={color:["color","colours","shade","tint","hue","foreground","background","text","fill","bg","fg"],spacing:["spacing","space","gap","padding","margin","distance","rhythm"],typography:["font","text","type","typography","heading","body","size","weight","family"],border:["border","outline","stroke","edge","frame"],radius:["radius","rounded","corner","curve","round"],shadow:["shadow","elevation","depth","glow","drop-shadow"],component:["component","element","widget"],utility:["utility","class","helper","css"],layout:["layout","container","grid","flex","group","arrange","organize"],pattern:["pattern","example","template","structure"],interaction:["hover","focus","active","disabled","pressed","selected","checked"]},this.entities={button:["button","btn","cta"],input:["input","field","textbox","text-field","form-control"],card:["card","panel"],badge:["badge","pill","tag","chip"],surface:["surface","background","layer","container"],icon:["icon","svg","glyph","symbol"],link:["link","anchor","hyperlink"],nav:["nav","navigation","menu"],modal:["modal","dialog","popup","overlay"],drawer:["drawer","sidebar","panel"],tab:["tab","tabstrip"],toast:["toast","notification","alert","message"]},this.questionWords=["what","which","how","where","when","show","find","get","give","tell"]}async search(e){if(!e||e.length<2)return[];let t=e.toLowerCase().trim(),s=this.tokenize(t),o=this.analyzeQuery(s,t),i=[];o.intents.has("color")&&i.push(...this.queryColors(o,t)),(o.intents.has("utility")||o.intents.has("border")||o.intents.has("layout")||t.includes("class"))&&i.push(...this.queryUtilities(o,t)),(o.intents.has("component")||o.entities.size>0)&&i.push(...this.queryComponents(o,t)),(o.intents.has("layout")||o.intents.has("pattern"))&&i.push(...this.queryPatterns(o,t)),o.intents.has("typography")&&i.push(...this.queryTypography(o,t)),o.intents.has("spacing")&&i.push(...this.querySpacing(o,t));let a=new Map;for(let n of i){let c=n.value;(!a.has(c)||a.get(c).score<n.score)&&a.set(c,n)}return Array.from(a.values()).sort((n,c)=>c.score-n.score).slice(0,10)}tokenize(e){return e.toLowerCase().replace(/[?!.]/g,"").split(/\s+/).filter(t=>t.length>0)}analyzeQuery(e,t){let s={intents:new Set,entities:new Set,modifiers:new Set,isQuestion:!1,tokens:e,fullText:t};s.isQuestion=this.questionWords.some(o=>e.includes(o));for(let[o,i]of Object.entries(this.intents))i.some(a=>e.includes(a)||t.includes(a))&&s.intents.add(o);for(let[o,i]of Object.entries(this.entities))i.some(a=>e.includes(a)||t.includes(a))&&s.entities.add(o);return(e.includes("hover")||t.includes("hover"))&&s.modifiers.add("hover"),(e.includes("focus")||t.includes("focus"))&&s.modifiers.add("focus"),(e.includes("active")||t.includes("active"))&&s.modifiers.add("active"),(e.includes("disabled")||t.includes("disabled"))&&s.modifiers.add("disabled"),s}queryColors(e,t){let s=[],o=this.pds.compiled;if(!o?.tokens?.colors)return s;let i=o.tokens.colors,a=Array.from(e.entities),n=Array.from(e.modifiers);if(n.includes("focus")&&e.intents.has("border")&&a.includes("input")&&s.push({text:"Focus border color: var(--color-primary-500)",value:"--color-primary-500",icon:"palette",category:"Color Token",score:100,cssVar:"var(--color-primary-500)",description:"Primary color used for focus states on form inputs"}),(t.includes("foreground")||t.includes("text"))&&(t.includes("surface")||e.entities.has("surface"))&&(s.push({text:"Text on surface: var(--surface-text)",value:"--surface-text",icon:"palette",category:"Surface Token",score:95,cssVar:"var(--surface-text)",description:"Default text color for current surface"}),s.push({text:"Secondary text: var(--surface-text-secondary)",value:"--surface-text-secondary",icon:"palette",category:"Surface Token",score:90,cssVar:"var(--surface-text-secondary)",description:"Secondary/muted text on surface"})),t.includes("primary")||t.includes("accent")||t.includes("secondary")){let c=t.includes("primary")?"primary":t.includes("accent")?"accent":"secondary";for(let l of[500,600,700]){let d=`--color-${c}-${l}`;s.push({text:`${c.charAt(0).toUpperCase()+c.slice(1)} ${l}: var(${d})`,value:d,icon:"palette",category:"Color Scale",score:80-(l-500)/100,cssVar:`var(${d})`,description:`${c} color scale shade ${l}`})}}if(a.includes("button")&&e.intents.has("color")){let c=n[0];c?s.push({text:`Button ${c} fill: var(--primary-fill-${c})`,value:`--primary-fill-${c}`,icon:"palette",category:"Interactive Token",score:92,description:`Button background color in ${c} state`}):s.push({text:"Button fill: var(--primary-fill)",value:"--primary-fill",icon:"palette",category:"Interactive Token",score:88,description:"Default button background color"})}return s}queryUtilities(e,t){let s=[],o=this.pds.ontology;if(!o?.utilities)return s;let i=o.utilities;return e.intents.has("border")&&i.filter(n=>n.includes("border")||n.includes("outline")).forEach(n=>{let c=80;t.includes("gradient")&&n.includes("gradient")&&(c=95),t.includes("glow")&&n.includes("glow")&&(c=95),s.push({text:`${n} - Border utility class`,value:n,icon:"code",category:"Utility Class",score:c,code:`<div class="${n}">...</div>`,description:this.describeUtility(n)})}),e.intents.has("layout")&&i.filter(n=>n.includes("flex")||n.includes("grid")||n.includes("items-")||n.includes("justify-")||n.includes("gap-")).forEach(n=>{s.push({text:`${n} - Layout utility`,value:n,icon:"layout",category:"Utility Class",score:85,code:`<div class="${n}">...</div>`,description:this.describeUtility(n)})}),t.includes("group")&&e.entities.has("button")&&s.push({text:".btn-group - Group buttons together",value:".btn-group",icon:"code",category:"Utility Class",score:90,code:`<div class="btn-group">
3325
3325
  <button class="btn-primary">One</button>
3326
3326
  <button class="btn-primary">Two</button>
3327
3327
  </div>`,description:"Container for grouped buttons with connected styling"}),s}queryComponents(e,t){let s=[],o=this.pds.ontology;return!o?.components&&!o?.primitives||(o.components&&o.components.forEach(i=>{let a=this.scoreMatch(t,i.name+" "+i.id);a>50&&s.push({text:`<${i.id}> - ${i.name}`,value:i.id,icon:"brackets-curly",category:"Web Component",score:a,code:`<${i.id}></${i.id}>`,description:i.description||`${i.name} web component`})}),o.primitives&&o.primitives.forEach(i=>{let a=this.scoreMatch(t,i.name+" "+i.id);if(a>50){let n=i.selectors?.[0]||i.id;s.push({text:`${n} - ${i.name}`,value:i.id,icon:"tag",category:"Primitive",score:a-5,code:this.generatePrimitiveExample(i),description:i.description||`${i.name} primitive element`})}}),t.includes("icon")&&(t.includes("only")||t.includes("button"))&&s.push({text:'Icon-only button: <button class="btn-icon">',value:"btn-icon",icon:"star",category:"Pattern",score:95,code:`<button class="btn-icon btn-primary">
@@ -3339,7 +3339,7 @@ export const ${e}CSS = \`${s}\`;
3339
3339
  </section>`,description:"Semantic section element for content grouping"}))),s}queryTypography(e,t){let s=[],o=this.pds.compiled;if(!o?.tokens?.typography)return s;let i=o.tokens.typography;return(t.includes("heading")||t.includes("title"))&&s.push({text:"Heading font: var(--font-family-heading)",value:"--font-family-heading",icon:"text-aa",category:"Typography Token",score:85,cssVar:"var(--font-family-heading)",description:"Font family for headings"}),(t.includes("body")||t.includes("text"))&&s.push({text:"Body font: var(--font-family-body)",value:"--font-family-body",icon:"text-aa",category:"Typography Token",score:85,cssVar:"var(--font-family-body)",description:"Font family for body text"}),s}querySpacing(e,t){let s=[],o=this.pds.compiled;if(!o?.tokens?.spacing)return s;let i=o.tokens.spacing;for(let[a,n]of Object.entries(i))["2","4","6","8"].includes(a)&&s.push({text:`Spacing ${a}: var(--spacing-${a})`,value:`--spacing-${a}`,icon:"ruler",category:"Spacing Token",score:75,cssVar:`var(--spacing-${a})`,description:`Spacing value: ${n}`});return s}scoreMatch(e,t){let s=e.toLowerCase(),o=t.toLowerCase(),i=0;if(s===o)return 100;o.includes(s)&&(i+=80);let a=this.tokenize(s),n=this.tokenize(o),c=a.filter(l=>n.includes(l)).length;return i+=c/a.length*40,o.startsWith(s)&&(i+=20),Math.min(100,i)}generatePrimitiveExample(e){let t=e.selectors?.[0]||e.id;return t.includes("button")||e.id==="button"?'<button class="btn-primary">Click me</button>':t.includes("card")||e.id==="card"?`<article class="card">
3340
3340
  <h3>Title</h3>
3341
3341
  <p>Content</p>
3342
- </article>`:t.includes("badge")||e.id==="badge"?'<span class="badge">New</span>':`<${t}>Content</${t}>`}describeUtility(e){return e.includes("border-gradient")?"Apply animated gradient border effect":e.includes("border-glow")?"Apply glowing border effect":e.includes("flex")?"Flexbox container utility":e.includes("grid")?"Grid container utility":e.includes("gap-")?"Set gap between flex/grid children":e.includes("items-")?"Align items in flex container":e.includes("justify-")?"Justify content in flex container":e===".btn-group"?"Group buttons with connected styling":"Utility class for styling"}};var nt={};ft(nt,{deepMerge:()=>Z,isObject:()=>Ne});function Ne(r){return r&&typeof r=="object"&&!Array.isArray(r)}function Z(r,e){let t={...r};return Ne(r)&&Ne(e)&&Object.keys(e).forEach(s=>{Ne(e[s])?s in r?t[s]=Z(r[s],e[s]):Object.assign(t,{[s]:e[s]}):Object.assign(t,{[s]:e[s]})}),t}var er=[{selector:"nav[data-dropdown]",description:"Enhances a nav element with data-dropdown to function as a dropdown menu.",demoHtml:`
3342
+ </article>`:t.includes("badge")||e.id==="badge"?'<span class="badge">New</span>':`<${t}>Content</${t}>`}describeUtility(e){return e.includes("border-gradient")?"Apply animated gradient border effect":e.includes("border-glow")?"Apply glowing border effect":e.includes("flex")?"Flexbox container utility":e.includes("grid")?"Grid container utility":e.includes("gap-")?"Set gap between flex/grid children":e.includes("items-")?"Align items in flex container":e.includes("justify-")?"Justify content in flex container":e===".btn-group"?"Group buttons with connected styling":"Utility class for styling"}};var ct={};bt(ct,{deepMerge:()=>Z,isObject:()=>Oe});function Oe(r){return r&&typeof r=="object"&&!Array.isArray(r)}function Z(r,e){let t={...r};return Oe(r)&&Oe(e)&&Object.keys(e).forEach(s=>{Oe(e[s])?s in r?t[s]=Z(r[s],e[s]):Object.assign(t,{[s]:e[s]}):Object.assign(t,{[s]:e[s]})}),t}var er=[{selector:"nav[data-dropdown]",description:"Enhances a nav element with data-dropdown to function as a dropdown menu.",demoHtml:`
3343
3343
  <nav data-dropdown>
3344
3344
  <button class="btn-primary">Menu</button>
3345
3345
  <menu>
@@ -3378,18 +3378,18 @@ export const ${e}CSS = \`${s}\`;
3378
3378
  <button class="btn-primary btn-working">
3379
3379
  <span>Saving</span>
3380
3380
  </button>
3381
- `.trim()}];function Vr(r){if(r.dataset.enhancedDropdown)return;r.dataset.enhancedDropdown="true";let e=r.querySelector("menu");if(!e)return;let t=r.querySelector("[data-dropdown-toggle]")||r.querySelector("button");t&&!t.hasAttribute("type")&&t.setAttribute("type","button"),e.id||(e.id=`dropdown-${Math.random().toString(36).slice(2,9)}`),e.setAttribute("role",e.getAttribute("role")||"menu"),e.hasAttribute("aria-hidden")||e.setAttribute("aria-hidden","true"),t&&(t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"));let s=()=>{let n=(r.getAttribute("data-mode")||"auto").toLowerCase();if(n==="up"||n==="down")return n;let c=r.getBoundingClientRect(),l=Math.max(0,window.innerHeight-c.bottom);return Math.max(0,c.top)>l?"up":"down"},o=()=>{r.dataset.dropdownDirection=s(),e.setAttribute("aria-hidden","false"),t?.setAttribute("aria-expanded","true")},i=()=>{e.setAttribute("aria-hidden","true"),t?.setAttribute("aria-expanded","false")},a=()=>{e.getAttribute("aria-hidden")==="false"?i():o()};t?.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),a()}),document.addEventListener("click",n=>{r.contains(n.target)||i()}),r.addEventListener("keydown",n=>{n.key==="Escape"&&(i(),t?.focus())}),r.addEventListener("focusout",n=>{(!n.relatedTarget||!r.contains(n.relatedTarget))&&i()})}function Kr(r){if(r.dataset.enhancedToggle)return;r.dataset.enhancedToggle="true";let e=r.querySelector('input[type="checkbox"]');if(!e)return;r.hasAttribute("tabindex")||r.setAttribute("tabindex","0"),r.setAttribute("role","switch"),r.setAttribute("aria-checked",e.checked?"true":"false");let t=document.createElement("span");t.className="toggle-switch",t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true");let s=document.createElement("span");s.className="toggle-knob",t.appendChild(s),r.insertBefore(t,e.nextSibling);let o=()=>{r.setAttribute("aria-checked",e.checked?"true":"false")},i=()=>{e.disabled||(e.checked=!e.checked,o(),e.dispatchEvent(new Event("change",{bubbles:!0})))};r.addEventListener("click",a=>{a.preventDefault(),i()}),r.addEventListener("keydown",a=>{(a.key===" "||a.key==="Enter")&&(a.preventDefault(),i())}),e.addEventListener("change",o)}function Jr(r){if(r.dataset.enhancedRange)return;let e=r.closest("label"),t=e?.classList.contains("range-output"),s=r.id||`range-${Math.random().toString(36).substring(2,11)}`,o=`${s}-output`;if(r.id=s,t){let i=e.querySelector("span");if(i&&!i.classList.contains("range-output-wrapper")){let a=document.createElement("span");a.className="range-output-wrapper",a.style.display="flex",a.style.justifyContent="space-between",a.style.alignItems="center";let n=document.createElement("span");n.textContent=i.textContent,a.appendChild(n);let c=document.createElement("output");c.id=o,c.setAttribute("for",s),c.style.color="var(--surface-text-secondary, var(--color-text-secondary))",c.style.fontSize="0.875rem",c.textContent=r.value,a.appendChild(c),i.textContent="",i.appendChild(a);let l=()=>{c.textContent=r.value};r.addEventListener("input",l)}}else{let i=r.closest(".range-container");i||(i=document.createElement("div"),i.className="range-container",r.parentNode?.insertBefore(i,r),i.appendChild(r)),i.style.position="relative";let a=document.createElement("output");a.id=o,a.setAttribute("for",s),a.className="range-bubble",a.setAttribute("aria-live","polite"),i.appendChild(a);let n=()=>{let d=parseFloat(r.min)||0,p=parseFloat(r.max)||100,h=parseFloat(r.value),m=(h-d)/(p-d);a.style.left=`calc(${m*100}% )`,a.textContent=String(h)},c=()=>a.classList.add("visible"),l=()=>a.classList.remove("visible");r.addEventListener("input",n),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerleave",l),r.addEventListener("focus",c),r.addEventListener("blur",l),n()}r.dataset.enhancedRange="1"}function Qr(r){let e=r.closest("label");if(!e||e.querySelector(".required-asterisk"))return;let t=document.createElement("span");t.classList.add("required-asterisk"),t.textContent="*",t.style.marginLeft="4px",e.querySelector("span").appendChild(t);let s=r.closest("form");if(s&&!s.querySelector(".required-legend")){let o=document.createElement("div");o.classList.add("required-legend","pill","pill-outline"),o.style.fontSize="0.9em",o.style.marginBottom="8px",o.textContent="* Required fields",s.insertBefore(o,s.querySelector(".form-actions")||s.lastElementChild)}}function Yr(r){if(r.dataset.enhancedOpenGroup)return;r.dataset.enhancedOpenGroup="true",r.classList.add("flex","flex-wrap","buttons");let e=document.createElement("input");e.type="text",e.placeholder="Add item...",e.classList.add("input-text","input-sm"),e.style.width="auto";let t=r.querySelector('input[type="radio"], input[type="checkbox"]');r.appendChild(e),e.addEventListener("keydown",s=>{if(s.key==="Enter"||s.key==="Tab"){let o=e.value.trim();if(o){s.preventDefault();let i=t.type==="radio"?"radio":"checkbox",a=`open-group-${Math.random().toString(36).substring(2,11)}`,n=document.createElement("label"),c=document.createElement("span");c.setAttribute("data-label",""),c.textContent=o;let l=document.createElement("input");l.type=i,l.name=t.name||r.getAttribute("data-name")||"open-group",l.value=o,l.id=a,n.appendChild(c),n.appendChild(l),r.insertBefore(n,e),e.value=""}}else if(s.key==="Backspace"&&e.value===""){s.preventDefault();let o=r.querySelectorAll("label");o.length>0&&o[o.length-1].remove()}})}function Zr(r){if(r.dataset.enhancedBtnWorking)return;r.dataset.enhancedBtnWorking="true";let e=null,t=!1;new MutationObserver(o=>{o.forEach(i=>{if(i.attributeName==="class"){let a=r.classList.contains("btn-working"),n=r.querySelector("pds-icon");if(a)if(n)e||(e=n.getAttribute("icon")),n.setAttribute("icon","circle-notch");else{let c=document.createElement("pds-icon");c.setAttribute("icon","circle-notch"),c.setAttribute("size","sm"),r.insertBefore(c,r.firstChild),t=!0}else i.oldValue?.includes("btn-working")&&n&&(t?(n.remove(),t=!1):e&&(n.setAttribute("icon",e),e=null))}})}).observe(r,{attributes:!0,attributeFilter:["class"],attributeOldValue:!0})}var Xr=new Map([["nav[data-dropdown]",Vr],["label[data-toggle]",Kr],['input[type="range"]',Jr],["form [required]",Qr],["fieldset[role=group][data-open]",Yr],["button, a[class*='btn-']",Zr]]),tr=er.map(r=>({...r,run:Xr.get(r.selector)||(()=>{})}));var or="pds",eo=/^([a-z][a-z0-9+\-.]*:)?\/\//i,rr=/^[a-z]:/i;function he(r=""){return r.endsWith("/")?r:`${r}/`}function to(r="",e=or){let t=r.replace(/\/+$/,"");return new RegExp(`(?:^|/)${e}$`,"i").test(t)?t:`${t}/${e}`}function ro(r){return r.replace(/^\.\/+/,"")}function oo(r){return rr.test(r)?r.replace(rr,"").replace(/^\/+/,""):r}function so(r){return r.startsWith("public/")?r.substring(7):r}function sr(r,e={}){let t=e.segment||or,s=e.defaultRoot||`/assets/${t}/`,o=r?.public&&r.public?.root||r?.static&&r.static?.root||null;if(!o||typeof o!="string")return he(s);let i=o.trim();return i?(i=i.replace(/\\/g,"/"),i=to(i,t),i=he(i),eo.test(i)?i:(i=ro(i),i=oo(i),i.startsWith("/")||(i=so(i),i.startsWith("/")||(i=`/${i}`),i=i.replace(/\/+/g,(a,n)=>n===0?a:"/")),he(i))):he(s)}function ir(r){let e=r.replace(/['"]/g,"").trim();if(["system-ui","-apple-system","sans-serif","serif","monospace","cursive","fantasy","ui-sans-serif","ui-serif","ui-monospace","ui-rounded"].includes(e.toLowerCase()))return!0;let o=document.createElement("canvas").getContext("2d");if(!o)return!1;let i="mmmmmmmmmmlli",a="72px",n="monospace";o.font=`${a} ${n}`;let c=o.measureText(i).width;o.font=`${a} "${e}", ${n}`;let l=o.measureText(i).width;return c!==l}function io(r){return r?r.split(",").map(s=>s.trim())[0].replace(/['"]/g,"").trim():null}async function ao(r,e={}){if(!r)return Promise.resolve();let{weights:t=[400,500,600,700],italic:s=!1}=e,o=io(r);if(!o||ir(o))return Promise.resolve();let i=encodeURIComponent(o);return document.querySelector(`link[href*="fonts.googleapis.com"][href*="${i}"]`)?(console.log(`Font "${o}" is already loading or loaded`),Promise.resolve()):(console.log(`Loading font "${o}" from Google Fonts...`),new Promise((n,c)=>{let l=document.createElement("link");l.rel="stylesheet";let d=s?`ital,wght@0,${t.join(";0,")};1,${t.join(";1,")}`:`wght@${t.join(";")}`;l.href=`https://fonts.googleapis.com/css2?family=${i}:${d}&display=swap`,l.setAttribute("data-font-loader",o),l.onload=()=>{console.log(`Successfully loaded font "${o}"`),n()},l.onerror=()=>{console.warn(`Failed to load font "${o}" from Google Fonts`),c(new Error(`Failed to load font: ${o}`))},document.head.appendChild(l),setTimeout(()=>{ir(o)||console.warn(`Font "${o}" did not load within timeout`),n()},5e3)}))}async function Oe(r){if(!r)return Promise.resolve();let e=new Set;r.fontFamilyHeadings&&e.add(r.fontFamilyHeadings),r.fontFamilyBody&&e.add(r.fontFamilyBody),r.fontFamilyMono&&e.add(r.fontFamilyMono);let t=Array.from(e).map(s=>ao(s).catch(o=>{console.warn(`Could not load font: ${s}`,o)}));await Promise.all(t)}var dt=class extends EventTarget{},g=new dt;g.Generator=U;g.registry=Zt;g.ontology=Vt;g.adoptLayers=Jt;g.adoptPrimitives=Kt;g.createStylesheet=Qt;g.isLiveMode=Yt;g.enums=u;g.ask=Xt;g.common=nt;g.presets=$;g.findComponentForElement=Gt;g.query=async function(r){return await new Be(g).search(r)};function lr(r){let e=typeof CustomEvent=="function";try{let t=e?new CustomEvent("pds:ready",{detail:r}):new Event("pds:ready");g.dispatchEvent(t)}catch{}if(typeof document<"u")if(e){let t={detail:r,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",t))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",t))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}Object.defineProperty(g,"currentConfig",{value:null,writable:!0,enumerable:!0,configurable:!1});Object.defineProperty(g,"compiled",{get(){return g.registry?.isLive&&g.registry?._designer?g.registry._designer.compiled:null},enumerable:!0,configurable:!1});typeof window<"u"&&(window.PDS=g);typeof document<"u"&&g.addEventListener("pds:ready",r=>{let e=r.detail?.mode;e&&(document.documentElement.classList.add(`pds-${e}`),e==="live"&&document.documentElement.classList.add("pds-ready"))});var lt="pure-ds-theme",X=null,ge=null;function dr(r){try{if(typeof document>"u")return;let e="light";r?r==="system"?e=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e=r:e=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",e)}catch{}}function pr(r){try{if(X&&ge){try{typeof X.removeEventListener=="function"?X.removeEventListener("change",ge):typeof X.removeListener=="function"&&X.removeListener(ge)}catch{}X=null,ge=null}if(r==="system"&&typeof window<"u"&&window.matchMedia){let e=window.matchMedia("(prefers-color-scheme: dark)"),t=s=>{let o=s?.matches===void 0?e.matches:s.matches;try{let i=o?"dark":"light";document.documentElement.setAttribute("data-theme",i),g.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:i,source:"system"}}))}catch{}};X=e,ge=t,typeof e.addEventListener=="function"?e.addEventListener("change",t):typeof e.addListener=="function"&&e.addListener(t)}}catch{}}Object.defineProperty(g,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(lt)||null}catch{return null}},set(r){try{if(typeof window>"u")return;r==null?localStorage.removeItem(lt):localStorage.setItem(lt,r),dr(r),pr(r),g.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"api"}}))}catch{}}});g.defaultEnhancers=tr;function je(r={},e={}){let t=Number(e.minContrast||4.5),s=n=>{let c=String(n||"").replace("#",""),l=c.length===3?c.split("").map(p=>p+p).join(""):c,d=parseInt(l||"0",16);return{r:d>>16&255,g:d>>8&255,b:d&255}},o=n=>{let{r:c,g:l,b:d}=s(n),p=[c/255,l/255,d/255].map(h=>h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4));return .2126*p[0]+.7152*p[1]+.0722*p[2]},i=(n,c)=>{if(!n||!c)return 0;let l=o(n),d=o(c),p=Math.max(l,d),h=Math.min(l,d);return(p+.05)/(h+.05)},a=[];try{let c=new g.Generator({design:structuredClone(r)}).tokens.colors,l={surfaceBg:c.surface?.base,surfaceText:c.gray?.[900]||"#000000",primaryFill:c.interactive?.light?.fill||c.primary?.[600],primaryText:c.interactive?.light?.text||c.primary?.[600]},d=i(l.primaryFill,"#ffffff");d<t&&a.push({path:"/colors/primary",message:`Primary button contrast too low in light theme (${d.toFixed(2)} < ${t}). Choose a darker primary.`,ratio:d,min:t,context:"light/btn-primary"});let p=i(l.surfaceBg,l.surfaceText);p<t&&a.push({path:"/colors/background",message:`Base text contrast on surface (light) is too low (${p.toFixed(2)} < ${t}). Adjust background or secondary (gray).`,ratio:p,min:t,context:"light/surface-text"});let h=i(l.primaryText,l.surfaceBg);h<t&&a.push({path:"/colors/primary",message:`Primary text on surface is too low for outline/link styles (light) (${h.toFixed(2)} < ${t}). Choose a darker primary or lighter surface.`,ratio:h,min:t,context:"light/outline"});let m=c.dark;if(m){let b={surfaceBg:m.surface?.base||c.surface?.inverse,primaryFill:c.interactive?.dark?.fill||m.primary?.[600],primaryText:c.interactive?.dark?.text||m.primary?.[600]},f=i(b.primaryFill,"#ffffff");f<t&&a.push({path:"/colors/darkMode/primary",message:`Primary button contrast too low in dark theme (${f.toFixed(2)} < ${t}). Override darkMode.primary or pick a brighter hue.`,ratio:f,min:t,context:"dark/btn-primary"});let y=i(b.primaryText,b.surfaceBg);y<t&&a.push({path:"/colors/darkMode/primary",message:`Primary text on surface is too low for outline/link styles (dark) (${y.toFixed(2)} < ${t}). Override darkMode.primary/background.`,ratio:y,min:t,context:"dark/outline"})}}catch(n){a.push({path:"/",message:`Validation failed: ${String(n?.message||n)}`,ratio:0,min:0})}return{ok:a.length===0,issues:a}}g.validateDesign=je;function co(r=[],e={}){let t=[],s=Array.isArray(r)?r:r&&typeof r=="object"?Object.values(r):[];for(let o of s){let i,a=null;if(typeof o=="string"){let l=String(o).toLowerCase(),d=$?.[l]||Object.values($||{}).find(p=>me(p.name)===l||String(p.name||"").toLowerCase()===l);if(!d){t.push({name:o,ok:!1,issues:[{path:"/",message:`Preset not found: ${o}`,ratio:0,min:0}]});continue}i=d.name||l,a=structuredClone(d)}else if(o&&typeof o=="object")if(i=o.name||o.preset||void 0,"preset"in o||"design"in o){let l=String(o.preset||"default").toLowerCase(),d=$?.[l]||Object.values($||{}).find(h=>me(h.name)===l||String(h.name||"").toLowerCase()===l);if(!d){t.push({name:i,ok:!1,issues:[{path:"/",message:`Preset not found: ${o.preset}`,ratio:0,min:0}]});continue}let p=structuredClone(d);o.design&&typeof o.design=="object"&&(p=pt(p,structuredClone(o.design))),a=p}else a=o;if(!a){t.push({name:i,ok:!1,issues:[{path:"/",message:"Invalid design entry",ratio:0,min:0}]});continue}let{ok:n,issues:c}=je(a,e);t.push({name:i,ok:n,issues:c})}return{ok:t.every(o=>o.ok),results:t}}g.validateDesigns=co;function ur({manageTheme:r,themeStorageKey:e}){let t="light",s=null;if(r&&typeof window<"u"){try{s=localStorage.getItem(e)||null}catch{s=null}try{dr(s),pr(s)}catch{}s?s==="system"?t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t=s:t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:t,storedTheme:s}}function pt(r={},e={}){if(!e||typeof e!="object")return r;let t=Array.isArray(r)?[...r]:{...r};for(let[s,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?t[s]=pt(t[s]&&typeof t[s]=="object"?t[s]:{},o):t[s]=o;return t}function me(r=""){return String(r).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function be(r){if(r==null)return r;if(typeof r=="function")return;if(typeof r!="object")return r;if(Array.isArray(r))return r.map(t=>be(t)).filter(t=>t!==void 0);let e={};for(let t in r)if(r.hasOwnProperty(t)){let s=r[t];if(typeof s!="function"){let o=be(s);o!==void 0&&(e[t]=o)}}return e}var lo=/^[a-z][a-z0-9+\-.]*:\/\//i,fe=(()=>{try{return import.meta.url}catch{return}})();function He(r,e={}){if(!r||lo.test(r))return r;let{preferModule:t=!0}=e,s=()=>{if(!fe)return null;try{return new URL(r,fe).href}catch{return null}},o=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(r,window.location.origin).href}catch{return null}};return(t?s()||o():o()||s())||r}var Ue=r=>typeof r=="string"&&r.length&&!r.endsWith("/")?`${r}/`:r,cr=(()=>{if(fe)try{let r=new URL(fe);if(/\/public\/assets\/js\//.test(r.pathname))return new URL("../pds/",fe).href}catch{return}})();function hr(r){let e=!!(r?.public?.root||r?.static?.root),t=sr(r);return!e&&cr&&(t=cr),Ue(He(t))}function gr(r={},e={}){let t=typeof r=="object"&&("colors"in r||"typography"in r||"spatialRhythm"in r||"shape"in r||"behavior"in r||"layout"in r||"advanced"in r||"a11y"in r||"components"in r||"icons"in r),s=r&&r.enhancers;s&&!Array.isArray(s)&&(s=Object.values(s));let o=s??e.enhancers??[],i=r&&r.preset,a=r&&r.design,n="preset"in(r||{})||"design"in(r||{})||"enhancers"in(r||{}),c,l=null;if(n){let d=String(i||"default").toLowerCase(),p=$?.[d]||Object.values($||{}).find(L=>me(L.name)===d||String(L.name||"").toLowerCase()===d);if(!p)throw new Error(`PDS preset not found: "${i||"default"}"`);l={id:p.id||me(p.name),name:p.name||p.id||String(d)};let h=structuredClone(p);if(a&&typeof a=="object"){let L=be(a);h=pt(h,structuredClone(L))}let{mode:m,autoDefine:b,applyGlobalStyles:f,manageTheme:y,themeStorageKey:T,preloadStyles:N,criticalLayers:R,preset:C,design:A,enhancers:_,log:F,...qe}=r;c={...qe,design:h,preset:l.name,log:F||Fe}}else if(t){let{log:d,...p}=r;c={design:structuredClone(p),log:d||Fe}}else{let d=$?.default||Object.values($||{}).find(p=>me(p.name)==="default");if(!d)throw new Error("PDS default preset not available");l={id:d.id||"default",name:d.name||"Default"},c={design:structuredClone(d),preset:l.name,log:Fe}}return{generatorConfig:c,enhancers:o,presetInfo:l}}async function mr(r){let{autoDefineBaseURL:e="/auto-define/",autoDefinePreload:t=[],autoDefineMapper:s=null,enhancers:o=[],autoDefineOverrides:i=null,autoDefinePreferModule:a=!0}=r,n=(()=>{let l=new Map;return(g.defaultEnhancers||[]).forEach(d=>l.set(d.selector,d)),(o||[]).forEach(d=>l.set(d.selector,d)),Array.from(l.values())})(),c=null;if(typeof window<"u"&&typeof document<"u"){let l=null;try{let f=await Promise.resolve().then(()=>(nr(),ar));l=f?.AutoDefiner||f?.default?.AutoDefiner||f?.default||null}catch(f){console.warn("AutoDefiner not available:",f?.message||f)}let d=f=>{switch(f){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${f}.js`}},{mapper:p,...h}=i&&typeof i=="object"?i:{},b={baseURL:e&&Ue(He(e,{preferModule:a})),predefine:t,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:n,onError:(f,y)=>{typeof f=="string"&&f.startsWith("pds-")?console.warn(`\u26A0\uFE0F PDS component <${f}> not found. Assets may not be installed.`):console.error(`\u274C Auto-define error for <${f}>:`,y)},...h,mapper:f=>{if(customElements.get(f))return null;if(typeof s=="function")try{let y=s(f);return y===void 0?d(f):y}catch(y){return console.warn("Custom autoDefine.mapper error; falling back to default:",y?.message||y),d(f)}return d(f)}};l&&(c=new l(b),t.length>0&&typeof l.define=="function"&&await l.define(...t,{baseURL:e,mapper:b.mapper,onError:b.onError}))}return{autoDefiner:c}}async function po(r){if(!r||typeof r!="object")throw new Error("PDS.start({ mode: 'live', ... }) requires a valid configuration object");if(typeof document<"u"&&document.adoptedStyleSheets){let n=`
3381
+ `.trim()}];function Vr(r){if(r.dataset.enhancedDropdown)return;r.dataset.enhancedDropdown="true";let e=r.querySelector("menu");if(!e)return;let t=r.querySelector("[data-dropdown-toggle]")||r.querySelector("button");t&&!t.hasAttribute("type")&&t.setAttribute("type","button"),e.id||(e.id=`dropdown-${Math.random().toString(36).slice(2,9)}`),e.setAttribute("role",e.getAttribute("role")||"menu"),e.hasAttribute("aria-hidden")||e.setAttribute("aria-hidden","true"),t&&(t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"));let s=()=>{let n=(r.getAttribute("data-mode")||"auto").toLowerCase();if(n==="up"||n==="down")return n;let c=r.getBoundingClientRect(),l=Math.max(0,window.innerHeight-c.bottom);return Math.max(0,c.top)>l?"up":"down"},o=()=>{r.dataset.dropdownDirection=s(),e.setAttribute("aria-hidden","false"),t?.setAttribute("aria-expanded","true")},i=()=>{e.setAttribute("aria-hidden","true"),t?.setAttribute("aria-expanded","false")},a=()=>{e.getAttribute("aria-hidden")==="false"?i():o()};t?.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),a()}),document.addEventListener("click",n=>{r.contains(n.target)||i()}),r.addEventListener("keydown",n=>{n.key==="Escape"&&(i(),t?.focus())}),r.addEventListener("focusout",n=>{(!n.relatedTarget||!r.contains(n.relatedTarget))&&i()})}function Kr(r){if(r.dataset.enhancedToggle)return;r.dataset.enhancedToggle="true";let e=r.querySelector('input[type="checkbox"]');if(!e)return;r.hasAttribute("tabindex")||r.setAttribute("tabindex","0"),r.setAttribute("role","switch"),r.setAttribute("aria-checked",e.checked?"true":"false");let t=document.createElement("span");t.className="toggle-switch",t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true");let s=document.createElement("span");s.className="toggle-knob",t.appendChild(s),r.insertBefore(t,e.nextSibling);let o=()=>{r.setAttribute("aria-checked",e.checked?"true":"false")},i=()=>{e.disabled||(e.checked=!e.checked,o(),e.dispatchEvent(new Event("change",{bubbles:!0})))};r.addEventListener("click",a=>{a.preventDefault(),i()}),r.addEventListener("keydown",a=>{(a.key===" "||a.key==="Enter")&&(a.preventDefault(),i())}),e.addEventListener("change",o)}function Jr(r){if(r.dataset.enhancedRange)return;let e=r.closest("label"),t=e?.classList.contains("range-output"),s=r.id||`range-${Math.random().toString(36).substring(2,11)}`,o=`${s}-output`;if(r.id=s,t){let i=e.querySelector("span");if(i&&!i.classList.contains("range-output-wrapper")){let a=document.createElement("span");a.className="range-output-wrapper",a.style.display="flex",a.style.justifyContent="space-between",a.style.alignItems="center";let n=document.createElement("span");n.textContent=i.textContent,a.appendChild(n);let c=document.createElement("output");c.id=o,c.setAttribute("for",s),c.style.color="var(--surface-text-secondary, var(--color-text-secondary))",c.style.fontSize="0.875rem",c.textContent=r.value,a.appendChild(c),i.textContent="",i.appendChild(a);let l=()=>{c.textContent=r.value};r.addEventListener("input",l)}}else{let i=r.closest(".range-container");i||(i=document.createElement("div"),i.className="range-container",r.parentNode?.insertBefore(i,r),i.appendChild(r)),i.style.position="relative";let a=document.createElement("output");a.id=o,a.setAttribute("for",s),a.className="range-bubble",a.setAttribute("aria-live","polite"),i.appendChild(a);let n=()=>{let d=parseFloat(r.min)||0,p=parseFloat(r.max)||100,h=parseFloat(r.value),m=(h-d)/(p-d);a.style.left=`calc(${m*100}% )`,a.textContent=String(h)},c=()=>a.classList.add("visible"),l=()=>a.classList.remove("visible");r.addEventListener("input",n),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerleave",l),r.addEventListener("focus",c),r.addEventListener("blur",l),n()}r.dataset.enhancedRange="1"}function Qr(r){let e=r.closest("label");if(!e||e.querySelector(".required-asterisk"))return;let t=document.createElement("span");t.classList.add("required-asterisk"),t.textContent="*",t.style.marginLeft="4px",e.querySelector("span").appendChild(t);let s=r.closest("form");if(s&&!s.querySelector(".required-legend")){let o=document.createElement("div");o.classList.add("required-legend","pill","pill-outline"),o.style.fontSize="0.9em",o.style.marginBottom="8px",o.textContent="* Required fields",s.insertBefore(o,s.querySelector(".form-actions")||s.lastElementChild)}}function Yr(r){if(r.dataset.enhancedOpenGroup)return;r.dataset.enhancedOpenGroup="true",r.classList.add("flex","flex-wrap","buttons");let e=document.createElement("input");e.type="text",e.placeholder="Add item...",e.classList.add("input-text","input-sm"),e.style.width="auto";let t=r.querySelector('input[type="radio"], input[type="checkbox"]');r.appendChild(e),e.addEventListener("keydown",s=>{if(s.key==="Enter"||s.key==="Tab"){let o=e.value.trim();if(o){s.preventDefault();let i=t.type==="radio"?"radio":"checkbox",a=`open-group-${Math.random().toString(36).substring(2,11)}`,n=document.createElement("label"),c=document.createElement("span");c.setAttribute("data-label",""),c.textContent=o;let l=document.createElement("input");l.type=i,l.name=t.name||r.getAttribute("data-name")||"open-group",l.value=o,l.id=a,n.appendChild(c),n.appendChild(l),r.insertBefore(n,e),e.value=""}}else if(s.key==="Backspace"&&e.value===""){s.preventDefault();let o=r.querySelectorAll("label");o.length>0&&o[o.length-1].remove()}})}function Zr(r){if(r.dataset.enhancedBtnWorking)return;r.dataset.enhancedBtnWorking="true";let e=null,t=!1;new MutationObserver(o=>{o.forEach(i=>{if(i.attributeName==="class"){let a=r.classList.contains("btn-working"),n=r.querySelector("pds-icon");if(a)if(n)e||(e=n.getAttribute("icon")),n.setAttribute("icon","circle-notch");else{let c=document.createElement("pds-icon");c.setAttribute("icon","circle-notch"),c.setAttribute("size","sm"),r.insertBefore(c,r.firstChild),t=!0}else i.oldValue?.includes("btn-working")&&n&&(t?(n.remove(),t=!1):e&&(n.setAttribute("icon",e),e=null))}})}).observe(r,{attributes:!0,attributeFilter:["class"],attributeOldValue:!0})}var Xr=new Map([["nav[data-dropdown]",Vr],["label[data-toggle]",Kr],['input[type="range"]',Jr],["form [required]",Qr],["fieldset[role=group][data-open]",Yr],["button, a[class*='btn-']",Zr]]),tr=er.map(r=>({...r,run:Xr.get(r.selector)||(()=>{})}));var or="pds",eo=/^([a-z][a-z0-9+\-.]*:)?\/\//i,rr=/^[a-z]:/i;function he(r=""){return r.endsWith("/")?r:`${r}/`}function to(r="",e=or){let t=r.replace(/\/+$/,"");return new RegExp(`(?:^|/)${e}$`,"i").test(t)?t:`${t}/${e}`}function ro(r){return r.replace(/^\.\/+/,"")}function oo(r){return rr.test(r)?r.replace(rr,"").replace(/^\/+/,""):r}function so(r){return r.startsWith("public/")?r.substring(7):r}function sr(r,e={}){let t=e.segment||or,s=e.defaultRoot||`/assets/${t}/`,o=r?.public&&r.public?.root||r?.static&&r.static?.root||null;if(!o||typeof o!="string")return he(s);let i=o.trim();return i?(i=i.replace(/\\/g,"/"),i=to(i,t),i=he(i),eo.test(i)?i:(i=ro(i),i=oo(i),i.startsWith("/")||(i=so(i),i.startsWith("/")||(i=`/${i}`),i=i.replace(/\/+/g,(a,n)=>n===0?a:"/")),he(i))):he(s)}function ir(r){let e=r.replace(/['"]/g,"").trim();if(["system-ui","-apple-system","sans-serif","serif","monospace","cursive","fantasy","ui-sans-serif","ui-serif","ui-monospace","ui-rounded"].includes(e.toLowerCase()))return!0;let o=document.createElement("canvas").getContext("2d");if(!o)return!1;let i="mmmmmmmmmmlli",a="72px",n="monospace";o.font=`${a} ${n}`;let c=o.measureText(i).width;o.font=`${a} "${e}", ${n}`;let l=o.measureText(i).width;return c!==l}function io(r){return r?r.split(",").map(s=>s.trim())[0].replace(/['"]/g,"").trim():null}async function ao(r,e={}){if(!r)return Promise.resolve();let{weights:t=[400,500,600,700],italic:s=!1}=e,o=io(r);if(!o||ir(o))return Promise.resolve();let i=encodeURIComponent(o);return document.querySelector(`link[href*="fonts.googleapis.com"][href*="${i}"]`)?(console.log(`Font "${o}" is already loading or loaded`),Promise.resolve()):(console.log(`Loading font "${o}" from Google Fonts...`),new Promise((n,c)=>{let l=document.createElement("link");l.rel="stylesheet";let d=s?`ital,wght@0,${t.join(";0,")};1,${t.join(";1,")}`:`wght@${t.join(";")}`;l.href=`https://fonts.googleapis.com/css2?family=${i}:${d}&display=swap`,l.setAttribute("data-font-loader",o),l.onload=()=>{console.log(`Successfully loaded font "${o}"`),n()},l.onerror=()=>{console.warn(`Failed to load font "${o}" from Google Fonts`),c(new Error(`Failed to load font: ${o}`))},document.head.appendChild(l),setTimeout(()=>{ir(o)||console.warn(`Font "${o}" did not load within timeout`),n()},5e3)}))}async function je(r){if(!r)return Promise.resolve();let e=new Set;r.fontFamilyHeadings&&e.add(r.fontFamilyHeadings),r.fontFamilyBody&&e.add(r.fontFamilyBody),r.fontFamilyMono&&e.add(r.fontFamilyMono);let t=Array.from(e).map(s=>ao(s).catch(o=>{console.warn(`Could not load font: ${s}`,o)}));await Promise.all(t)}var pt=class extends EventTarget{},g=new pt;g.Generator=U;g.registry=Re;g.ontology=Kt;g.adoptLayers=Qt;g.adoptPrimitives=Jt;g.createStylesheet=Yt;g.isLiveMode=Zt;g.enums=u;g.ask=Xt;g.common=ct;g.presets=$;g.findComponentForElement=Vt;g.query=async function(r){return await new Ne(g).search(r)};function lr(r){let e=typeof CustomEvent=="function";try{let t=e?new CustomEvent("pds:ready",{detail:r}):new Event("pds:ready");g.dispatchEvent(t)}catch{}if(typeof document<"u")if(e){let t={detail:r,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",t))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",t))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}Object.defineProperty(g,"currentConfig",{value:null,writable:!0,enumerable:!0,configurable:!1});Object.defineProperty(g,"compiled",{get(){return g.registry?.isLive&&g.registry?._designer?g.registry._designer.compiled:null},enumerable:!0,configurable:!1});typeof window<"u"&&(window.PDS=g);typeof document<"u"&&g.addEventListener("pds:ready",r=>{let e=r.detail?.mode;e&&(document.documentElement.classList.add(`pds-${e}`),e==="live"&&document.documentElement.classList.add("pds-ready"))});var dt="pure-ds-theme",X=null,ge=null;function dr(r){try{if(typeof document>"u")return;let e="light";r?r==="system"?e=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e=r:e=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",e)}catch{}}function pr(r){try{if(X&&ge){try{typeof X.removeEventListener=="function"?X.removeEventListener("change",ge):typeof X.removeListener=="function"&&X.removeListener(ge)}catch{}X=null,ge=null}if(r==="system"&&typeof window<"u"&&window.matchMedia){let e=window.matchMedia("(prefers-color-scheme: dark)"),t=s=>{let o=s?.matches===void 0?e.matches:s.matches;try{let i=o?"dark":"light";document.documentElement.setAttribute("data-theme",i),g.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:i,source:"system"}}))}catch{}};X=e,ge=t,typeof e.addEventListener=="function"?e.addEventListener("change",t):typeof e.addListener=="function"&&e.addListener(t)}}catch{}}Object.defineProperty(g,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(dt)||null}catch{return null}},set(r){try{if(typeof window>"u")return;r==null?localStorage.removeItem(dt):localStorage.setItem(dt,r),dr(r),pr(r),g.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"api"}}))}catch{}}});g.defaultEnhancers=tr;function He(r={},e={}){let t=Number(e.minContrast||4.5),s=n=>{let c=String(n||"").replace("#",""),l=c.length===3?c.split("").map(p=>p+p).join(""):c,d=parseInt(l||"0",16);return{r:d>>16&255,g:d>>8&255,b:d&255}},o=n=>{let{r:c,g:l,b:d}=s(n),p=[c/255,l/255,d/255].map(h=>h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4));return .2126*p[0]+.7152*p[1]+.0722*p[2]},i=(n,c)=>{if(!n||!c)return 0;let l=o(n),d=o(c),p=Math.max(l,d),h=Math.min(l,d);return(p+.05)/(h+.05)},a=[];try{let c=new g.Generator({design:structuredClone(r)}).tokens.colors,l={surfaceBg:c.surface?.base,surfaceText:c.gray?.[900]||"#000000",primaryFill:c.interactive?.light?.fill||c.primary?.[600],primaryText:c.interactive?.light?.text||c.primary?.[600]},d=i(l.primaryFill,"#ffffff");d<t&&a.push({path:"/colors/primary",message:`Primary button contrast too low in light theme (${d.toFixed(2)} < ${t}). Choose a darker primary.`,ratio:d,min:t,context:"light/btn-primary"});let p=i(l.surfaceBg,l.surfaceText);p<t&&a.push({path:"/colors/background",message:`Base text contrast on surface (light) is too low (${p.toFixed(2)} < ${t}). Adjust background or secondary (gray).`,ratio:p,min:t,context:"light/surface-text"});let h=i(l.primaryText,l.surfaceBg);h<t&&a.push({path:"/colors/primary",message:`Primary text on surface is too low for outline/link styles (light) (${h.toFixed(2)} < ${t}). Choose a darker primary or lighter surface.`,ratio:h,min:t,context:"light/outline"});let m=c.dark;if(m){let b={surfaceBg:m.surface?.base||c.surface?.inverse,primaryFill:c.interactive?.dark?.fill||m.primary?.[600],primaryText:c.interactive?.dark?.text||m.primary?.[600]},f=i(b.primaryFill,"#ffffff");f<t&&a.push({path:"/colors/darkMode/primary",message:`Primary button contrast too low in dark theme (${f.toFixed(2)} < ${t}). Override darkMode.primary or pick a brighter hue.`,ratio:f,min:t,context:"dark/btn-primary"});let y=i(b.primaryText,b.surfaceBg);y<t&&a.push({path:"/colors/darkMode/primary",message:`Primary text on surface is too low for outline/link styles (dark) (${y.toFixed(2)} < ${t}). Override darkMode.primary/background.`,ratio:y,min:t,context:"dark/outline"})}}catch(n){a.push({path:"/",message:`Validation failed: ${String(n?.message||n)}`,ratio:0,min:0})}return{ok:a.length===0,issues:a}}g.validateDesign=He;function co(r=[],e={}){let t=[],s=Array.isArray(r)?r:r&&typeof r=="object"?Object.values(r):[];for(let o of s){let i,a=null;if(typeof o=="string"){let l=String(o).toLowerCase(),d=$?.[l]||Object.values($||{}).find(p=>me(p.name)===l||String(p.name||"").toLowerCase()===l);if(!d){t.push({name:o,ok:!1,issues:[{path:"/",message:`Preset not found: ${o}`,ratio:0,min:0}]});continue}i=d.name||l,a=structuredClone(d)}else if(o&&typeof o=="object")if(i=o.name||o.preset||void 0,"preset"in o||"design"in o){let l=String(o.preset||"default").toLowerCase(),d=$?.[l]||Object.values($||{}).find(h=>me(h.name)===l||String(h.name||"").toLowerCase()===l);if(!d){t.push({name:i,ok:!1,issues:[{path:"/",message:`Preset not found: ${o.preset}`,ratio:0,min:0}]});continue}let p=structuredClone(d);o.design&&typeof o.design=="object"&&(p=ut(p,structuredClone(o.design))),a=p}else a=o;if(!a){t.push({name:i,ok:!1,issues:[{path:"/",message:"Invalid design entry",ratio:0,min:0}]});continue}let{ok:n,issues:c}=He(a,e);t.push({name:i,ok:n,issues:c})}return{ok:t.every(o=>o.ok),results:t}}g.validateDesigns=co;function ur({manageTheme:r,themeStorageKey:e}){let t="light",s=null;if(r&&typeof window<"u"){try{s=localStorage.getItem(e)||null}catch{s=null}try{dr(s),pr(s)}catch{}s?s==="system"?t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t=s:t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:t,storedTheme:s}}function ut(r={},e={}){if(!e||typeof e!="object")return r;let t=Array.isArray(r)?[...r]:{...r};for(let[s,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?t[s]=ut(t[s]&&typeof t[s]=="object"?t[s]:{},o):t[s]=o;return t}function me(r=""){return String(r).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function be(r){if(r==null)return r;if(typeof r=="function")return;if(typeof r!="object")return r;if(Array.isArray(r))return r.map(t=>be(t)).filter(t=>t!==void 0);let e={};for(let t in r)if(r.hasOwnProperty(t)){let s=r[t];if(typeof s!="function"){let o=be(s);o!==void 0&&(e[t]=o)}}return e}var lo=/^[a-z][a-z0-9+\-.]*:\/\//i,fe=(()=>{try{return import.meta.url}catch{return}})();function Ue(r,e={}){if(!r||lo.test(r))return r;let{preferModule:t=!0}=e,s=()=>{if(!fe)return null;try{return new URL(r,fe).href}catch{return null}},o=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(r,window.location.origin).href}catch{return null}};return(t?s()||o():o()||s())||r}var We=r=>typeof r=="string"&&r.length&&!r.endsWith("/")?`${r}/`:r,cr=(()=>{if(fe)try{let r=new URL(fe);if(/\/public\/assets\/js\//.test(r.pathname))return new URL("../pds/",fe).href}catch{return}})();function hr(r){let e=!!(r?.public?.root||r?.static?.root),t=sr(r);return!e&&cr&&(t=cr),We(Ue(t))}function gr(r={},e={}){let t=typeof r=="object"&&("colors"in r||"typography"in r||"spatialRhythm"in r||"shape"in r||"behavior"in r||"layout"in r||"advanced"in r||"a11y"in r||"components"in r||"icons"in r),s=r&&r.enhancers;s&&!Array.isArray(s)&&(s=Object.values(s));let o=s??e.enhancers??[],i=r&&r.preset,a=r&&r.design,n="preset"in(r||{})||"design"in(r||{})||"enhancers"in(r||{}),c,l=null;if(n){let d=String(i||"default").toLowerCase(),p=$?.[d]||Object.values($||{}).find(L=>me(L.name)===d||String(L.name||"").toLowerCase()===d);if(!p)throw new Error(`PDS preset not found: "${i||"default"}"`);l={id:p.id||me(p.name),name:p.name||p.id||String(d)};let h=structuredClone(p);if(a&&typeof a=="object"){let L=be(a);h=ut(h,structuredClone(L))}let{mode:m,autoDefine:b,applyGlobalStyles:f,manageTheme:y,themeStorageKey:T,preloadStyles:N,criticalLayers:R,preset:C,design:A,enhancers:_,log:F,...Ge}=r;c={...Ge,design:h,preset:l.name,log:F||Ie}}else if(t){let{log:d,...p}=r;c={design:structuredClone(p),log:d||Ie}}else{let d=$?.default||Object.values($||{}).find(p=>me(p.name)==="default");if(!d)throw new Error("PDS default preset not available");l={id:d.id||"default",name:d.name||"Default"},c={design:structuredClone(d),preset:l.name,log:Ie}}return{generatorConfig:c,enhancers:o,presetInfo:l}}async function mr(r){let{autoDefineBaseURL:e="/auto-define/",autoDefinePreload:t=[],autoDefineMapper:s=null,enhancers:o=[],autoDefineOverrides:i=null,autoDefinePreferModule:a=!0}=r,n=(()=>{let l=new Map;return(g.defaultEnhancers||[]).forEach(d=>l.set(d.selector,d)),(o||[]).forEach(d=>l.set(d.selector,d)),Array.from(l.values())})(),c=null;if(typeof window<"u"&&typeof document<"u"){let l=null;try{let f=await Promise.resolve().then(()=>(nr(),ar));l=f?.AutoDefiner||f?.default?.AutoDefiner||f?.default||null}catch(f){console.warn("AutoDefiner not available:",f?.message||f)}let d=f=>{switch(f){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${f}.js`}},{mapper:p,...h}=i&&typeof i=="object"?i:{},b={baseURL:e&&We(Ue(e,{preferModule:a})),predefine:t,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:n,onError:(f,y)=>{typeof f=="string"&&f.startsWith("pds-")?console.warn(`\u26A0\uFE0F PDS component <${f}> not found. Assets may not be installed.`):console.error(`\u274C Auto-define error for <${f}>:`,y)},...h,mapper:f=>{if(customElements.get(f))return null;if(typeof s=="function")try{let y=s(f);return y===void 0?d(f):y}catch(y){return console.warn("Custom autoDefine.mapper error; falling back to default:",y?.message||y),d(f)}return d(f)}};l&&(c=new l(b),t.length>0&&typeof l.define=="function"&&await l.define(...t,{baseURL:e,mapper:b.mapper,onError:b.onError}))}return{autoDefiner:c}}async function po(r){if(!r||typeof r!="object")throw new Error("PDS.start({ mode: 'live', ... }) requires a valid configuration object");if(typeof document<"u"&&document.adoptedStyleSheets){let n=`
3382
3382
  html { opacity: 0; }
3383
3383
  html.pds-ready { opacity: 1; transition: opacity 0.3s ease-in; }
3384
- `;try{if(!document.adoptedStyleSheets.some(l=>l._pdsFouc)){let l=new CSSStyleSheet;l.replaceSync(n),l._pdsFouc=!0,document.adoptedStyleSheets=[l,...document.adoptedStyleSheets]}}catch(c){if(console.warn("Constructable stylesheets not supported, using <style> tag fallback:",c),!document.head.querySelector("style[data-pds-fouc]")){let d=document.createElement("style");d.setAttribute("data-pds-fouc",""),d.textContent=n,document.head.insertBefore(d,document.head.firstChild)}}}let e=r.applyGlobalStyles??!0,t=r.manageTheme??!0,s=r.themeStorageKey??"pure-ds-theme",o=r.preloadStyles??!1,i=r.criticalLayers??["tokens","primitives"],a=r&&r.autoDefine||null;try{let{resolvedTheme:n,storedTheme:c}=ur({manageTheme:t,themeStorageKey:s}),l=gr(r,{}),d=l.enhancers,{log:p,...h}=l.generatorConfig,m=structuredClone(h);m.log=p,t&&(m.theme=n);let b=new g.Generator(m);if(m.design?.typography)try{await Oe(m.design.typography)}catch(C){m?.log?.("warn","Failed to load some fonts from Google Fonts:",C)}if(o&&typeof window<"u"&&document.head)try{let C=i.map(A=>{try{return b.css?.[A]||""}catch(_){return m?.log?.("warn",`Failed to generate critical CSS for layer "${A}":`,_),""}}).filter(A=>A.trim()).join(`
3385
- `);if(C){let A=document.head.querySelector("style[data-pds-critical]");A&&A.remove();let _=document.createElement("style");_.setAttribute("data-pds-critical",""),_.textContent=C;let F=document.head.querySelector('meta[charset], meta[name="viewport"]');F?F.parentNode.insertBefore(_,F.nextSibling):document.head.insertBefore(_,document.head.firstChild)}}catch(C){m?.log?.("warn","Failed to preload critical styles:",C)}g.registry.setDesigner(b,{presetName:l.presetInfo?.name}),e&&(await g.Generator.applyStyles(b),typeof window<"u"&&setTimeout(()=>{let C=document.head.querySelector("style[data-pds-critical]");C&&C.remove();let A=document.head.querySelector("style[data-pds-preload]");A&&A.remove();let _=document.getElementById("pds-runtime-stylesheet");_&&_.remove()},100));let f=hr(r),y;a&&a.baseURL?y=Ue(He(a.baseURL,{preferModule:!1})):y=`${f}components/`;let T=null;try{T=(await mr({autoDefineBaseURL:y,autoDefinePreload:a&&Array.isArray(a.predefine)&&a.predefine||[],autoDefineMapper:a&&typeof a.mapper=="function"&&a.mapper||null,enhancers:d,autoDefineOverrides:a||null,autoDefinePreferModule:!(a&&a.baseURL)})).autoDefiner}catch(C){m?.log?.("error","\u274C Failed to initialize AutoDefiner/Enhancers:",C)}let N=b?.options||m,R=be(r);return g.currentConfig=Object.freeze({mode:"live",...structuredClone(R),design:structuredClone(l.generatorConfig.design),preset:l.generatorConfig.preset,theme:n}),lr({mode:"live",generator:b,config:N,theme:n,autoDefiner:T}),{generator:b,config:N,theme:n,autoDefiner:T}}catch(n){throw g.dispatchEvent(new CustomEvent("pds:error",{detail:{error:n}})),n}}async function uo(r){let e=r&&r.mode||"live",{mode:t,...s}=r||{};return e==="static"?ho(s):po(s)}g.start=uo;async function ho(r){if(!r||typeof r!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let e=r.applyGlobalStyles??!0,t=r.manageTheme??!0,s=r.themeStorageKey??"pure-ds-theme",o=r.staticPaths??{},i=hr(r),a=r&&r.autoDefine||null,n;a&&a.baseURL?n=Ue(He(a.baseURL,{preferModule:!1})):n=`${i}components/`;let c=a&&Array.isArray(a.predefine)&&a.predefine||[],l=a&&typeof a.mapper=="function"&&a.mapper||null;try{let{resolvedTheme:d}=ur({manageTheme:t,themeStorageKey:s}),p=gr(r,{}),h=p.enhancers;if(o={...{tokens:`${i}styles/pds-tokens.css.js`,primitives:`${i}styles/pds-primitives.css.js`,components:`${i}styles/pds-components.css.js`,utilities:`${i}styles/pds-utilities.css.js`,styles:`${i}styles/pds-styles.css.js`},...o},g.registry.setStaticMode(o),e&&typeof document<"u")try{let y=await g.registry.getStylesheet("styles");if(y){y._pds=!0;let T=(document.adoptedStyleSheets||[]).filter(N=>N._pds!==!0);document.adoptedStyleSheets=[...T,y]}}catch(y){console.warn("Failed to apply static styles:",y)}let b=null;try{b=(await mr({autoDefineBaseURL:n,autoDefinePreload:c,autoDefineMapper:l,enhancers:h,autoDefineOverrides:a||null,autoDefinePreferModule:!(a&&a.baseURL)})).autoDefiner}catch(y){console.error("\u274C Failed to initialize AutoDefiner/Enhancers (static):",y)}let f=be(r);return g.currentConfig=Object.freeze({mode:"static",...structuredClone(f),design:structuredClone(p.generatorConfig.design),preset:p.generatorConfig.preset,theme:d}),lr({mode:"static",config:p.generatorConfig,theme:d,autoDefiner:b}),{config:p.generatorConfig,theme:d,autoDefiner:b}}catch(d){throw g.dispatchEvent(new CustomEvent("pds:error",{detail:{error:d}})),d}}async function go(r,e={}){let{storageKey:t="pure-ds-theme",persist:s=!0}=e;if(!["light","dark","system"].includes(r))throw new Error(`Invalid theme "${r}". Must be "light", "dark", or "system".`);if(typeof window>"u")return r==="system"?"light":r;let o=r;if(r==="system"&&(o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",o),s&&localStorage.setItem(t,r),g.registry.isLive&&g.registry.hasDesigner)try{let i=g.registry._designer;if(i&&i.configure){let a={...i.config,theme:o};i.configure(a),await g.Generator.applyStyles(i)}}catch(i){currentDesigner?.options?.log?.("warn","Failed to update styles for new theme:",i)}return g.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:o,requested:r,source:"programmatic"}})),o}g.setTheme=go;function mo(r,e={}){if(typeof window>"u"||!document.head||!r)return;let{theme:t,layers:s=["tokens"]}=e;try{let o=t||"light";(t==="system"||!t)&&(o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",o);let i=r.design?{...r,theme:o}:{design:r,theme:o},a=new g.Generator(i),n=s.map(c=>{try{return a.css?.[c]||""}catch{return""}}).filter(c=>c.trim()).join(`
3386
- `);if(n){let c=document.head.querySelector("style[data-pds-preload]");c&&c.remove();let l=document.createElement("style");l.setAttribute("data-pds-preload",""),l.textContent=n,document.head.insertBefore(l,document.head.firstChild)}}catch(o){console.warn("PDS preload failed:",o)}}g.preloadCritical=mo;function fr(r){return new DOMParser().parseFromString(r,"text/html").body.childNodes}function br(r,e=100){let t;return function(...o){let i=()=>{clearTimeout(t),r(...o)};clearTimeout(t),t=setTimeout(i,e)}}function We(r){setTimeout(r,0)}function yr(r){try{if(typeof r!="string"||r.indexOf(`
3387
- `)!==-1||r.indexOf(" ")!==-1||r.startsWith("#/"))return!1;let e=new URL(r,window.location.origin);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function vr(r,e,t){let s=window.screen.width/2-e/2,o=window.screen.height/2-t/2;return window.open(r,"",`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=${e}, height=${t}, top=${o}, left=${s}`)}var ut={result:"ac-suggestion",item:"ac-itm"},ie=class r extends EventTarget{constructor(e,t,s){super(),this.settings={emptyResultsText:"",...s},this.container=e,this.input=t,this.input.setAttribute("autocomplete","off"),this.categories=s.categories||{},this.caches=new Map,We(this.attach.bind(this))}static connect(e,t){let s=e.target;if(!s._autoComplete){if(!t?.categories)throw Error("Missing autocomplete settings");s._autoComplete=new r(s.parentNode,s,t),e.type==="focus"&&setTimeout(()=>{s._autoComplete.focusHandler(e)},100)}return s._autoComplete}on(e,t){return this.input.addEventListener(e,t),this}attach(){this.resultsDiv=document.createElement("div"),this.resultsDiv.title="",this.resultsDiv.classList.add(ut.result),this.container.offsetWidth>100&&(this.resultsDiv.style.width=this.container.offsetWidth),this.resultsDiv.addEventListener("mousedown",this.resultClick.bind(this)),this.container.classList.add("ac-container"),this.input.classList.add("ac-input");let e=getComputedStyle(this.input);this.container.style.setProperty("--ac-bg-default",e.backgroundColor),this.container.style.setProperty("--ac-color-default",e.color);let t=getComputedStyle(this.input).accentColor;t!=="auto"&&this.container.style.setProperty("--ac-accent-color",t),(this.container?.shadowRoot??this.container).appendChild(this.resultsDiv),this.controller().clear("attach"),this.on("input",br(this.inputHandler.bind(this),this.settings.throttleInputMs??300)).on("focus",this.focusHandler.bind(this)).on("focusout",this.blurHandler.bind(this)).on("keyup",this.keyUpHandler.bind(this)).on("keydown",this.keyDownHandler.bind(this))}controller(){let e=this.internalController();return typeof this.settings.controller=="function"&&(e=this.settings.controller(this)??e),e}internalController(){return{show:this.show.bind(this),hide:this.hide.bind(this),clear:this.clear.bind(this),empty:()=>{}}}moveResult(e){this.controller().show();let t=this.acItems.length;this.rowIndex=this.rowIndex+e,this.rowIndex<=0?this.rowIndex=0:this.rowIndex>t-1&&(this.rowIndex=0);for(let o of this.acItems)o.classList.remove("selected");let s=this.getSelectedDiv();s?(s.classList.add("selected"),s.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})):this.focusHandler({target:this.input})}getSelectedDiv(){return this.resultsDiv.querySelector(`div:nth-child(${this.rowIndex+1})`)}selectResult(e){if(e=e||this.getSelectedDiv(),e){let t=parseInt(e.getAttribute("data-index"));this.resultClicked=!0;let s=this.results[t],o=this.categories[s.category]??{};o.action=o.action??this.setText.bind(this),o.newTab&&(this.tabWindow=vr("about:blank"));let i={...s,search:this.input.value};e.classList.add("ac-active"),setTimeout(()=>{this.controller().hide("result-selected"),i.action?i.action(i):(o.action(i),o.newTab&&(i.url?this.tabWindow.location.href=i.url:this.tabWindow.close()));var a=new Event("change",{bubbles:!0});this.input.dispatchEvent(a),this.controller().clear("result-selected");let n=new Event("result-selected");n.detail=i,this.input.dispatchEvent(n)},0)}}setText(e){this.container.autoCompleteInput||(this.container.value=e.text),this.controller().hide("settext")}resultClick(e){this.selectResult(e.target.closest(`.${ut.item}`))}blurHandler(){setTimeout(()=>{this.resultClicked||this.controller().clear("blurred"),this.resultClicked=!1},100)}clear(){this.settings.debug||this.resultsDiv&&(this.resultsDiv.innerHTML="",this.controller().hide("clear"),this.cacheTmr&&clearTimeout(this.cacheTmr),this.cacheTmr=setTimeout(()=>{this.caches.clear()},60*1e3*5))}show(){if(!this.resultsDiv.classList.contains("ac-active")){let e=this.getViewBounds();this.resultsDiv.style.position="absolute",e.rect.width>100&&(this.resultsDiv.style.width=`${e.rect.width}px`),this.settings.direction=this.settings.direction??e.suggestedDirection,this.resultsDiv.setAttribute("data-direction",this.settings.direction),this.settings.direction==="up"?(this.resultsDiv.style.top="unset",this.resultsDiv.style.bottom=`${e.rect.height+20}px`,this.rowIndex=this.acItems.length):(this.resultsDiv.style.bottom="unset",this.resultsDiv.style.top=`${e.rect.height}px`,this.rowIndex=-1),this.resultsDiv.style.maxWidth="unset",this.resultsDiv.classList.toggle("ac-active",!0)}}getViewBounds(){let e=this.input.getBoundingClientRect();return{rect:e,suggestedDirection:e.top+e.height+500>window.innerHeight?"up":"down"}}hide(){this.resultsDiv.classList.toggle("ac-active",!1)}empty(){this.resultsDiv.innerHTML=`<div class="ac-empty">${this.settings.emptyResultsText}</div>`,this.controller().show()}inputHandler(e){this.cacheTmr&&clearTimeout(this.cacheTmr);let t={search:e.target.value,categories:this.categories};this.container.classList.add("search-running"),this.getItems(t,e).then(s=>{this.controller().clear("new-results"),this.resultsHandler(s,t),this.container.classList.remove("search-running")})}keyDownHandler(e){switch(e.key){case"Enter":e.stopPropagation(),e.preventDefault();break;case"ArrowDown":We(this.moveResult(1));break;case"ArrowUp":We(this.moveResult(-1));break}}keyUpHandler(e){switch(e.key){case"Escape":this.controller().hide("escape");break;case"Enter":this.getSelectedDiv()&&(this.container.preventEnter=!0,e.stopPropagation(),e.preventDefault(),this.selectResult(),setTimeout(()=>{this.container.preventEnter=!1},10));break;default:break}}focusHandler(e){this.controller().clear("focus");let t=e.target.value;this.suggest(t,e)}suggest(e,t){this.input.focus();let s={suggest:!0,search:e||"",categories:this.categories};this.getItems(s,t).then(o=>{this.input.dispatchEvent(new CustomEvent("show-results",{detail:{results:o}})),this.resultsHandler(o,s)})}sort(e,t){return e.sort((s,o)=>{let i=t.categories[s.category],a=t.categories[o.category],n=typeof i.sortIndex=="function"?i.sortIndex(t):i.sortIndex??0;return(typeof a.sortIndex=="function"?a.sortIndex(t):a.sortIndex??0)>n?1:-1})}resultsHandler(e,t){this.results=e,this.rowIndex=-1;let s=0,o=(i,a)=>`
3388
- <div title="${a.tooltip||""}" data-index="${s}" class="${`${ut.item} cat-${a.category} ${a.class??""}`.trim()}">
3384
+ `;try{if(!document.adoptedStyleSheets.some(l=>l._pdsFouc)){let l=new CSSStyleSheet;l.replaceSync(n),l._pdsFouc=!0,document.adoptedStyleSheets=[l,...document.adoptedStyleSheets]}}catch(c){if(console.warn("Constructable stylesheets not supported, using <style> tag fallback:",c),!document.head.querySelector("style[data-pds-fouc]")){let d=document.createElement("style");d.setAttribute("data-pds-fouc",""),d.textContent=n,document.head.insertBefore(d,document.head.firstChild)}}}let e=r.applyGlobalStyles??!0,t=r.manageTheme??!0,s=r.themeStorageKey??"pure-ds-theme",o=r.preloadStyles??!1,i=r.criticalLayers??["tokens","primitives"],a=r&&r.autoDefine||null;try{let{resolvedTheme:n,storedTheme:c}=ur({manageTheme:t,themeStorageKey:s}),l=gr(r,{}),d=l.enhancers,{log:p,...h}=l.generatorConfig,m=structuredClone(h);m.log=p,t&&(m.theme=n);let b=new g.Generator(m);if(m.design?.typography)try{await je(m.design.typography)}catch(C){m?.log?.("warn","Failed to load some fonts from Google Fonts:",C)}if(o&&typeof window<"u"&&document.head)try{let C=i.map(A=>{try{return b.css?.[A]||""}catch(_){return m?.log?.("warn",`Failed to generate critical CSS for layer "${A}":`,_),""}}).filter(A=>A.trim()).join(`
3385
+ `);if(C){let A=document.head.querySelector("style[data-pds-critical]");A&&A.remove();let _=document.createElement("style");_.setAttribute("data-pds-critical",""),_.textContent=C;let F=document.head.querySelector('meta[charset], meta[name="viewport"]');F?F.parentNode.insertBefore(_,F.nextSibling):document.head.insertBefore(_,document.head.firstChild)}}catch(C){m?.log?.("warn","Failed to preload critical styles:",C)}g.registry.setDesigner(b,{presetName:l.presetInfo?.name}),e&&(await g.Generator.applyStyles(b),typeof window<"u"&&setTimeout(()=>{let C=document.head.querySelector("style[data-pds-critical]");C&&C.remove();let A=document.head.querySelector("style[data-pds-preload]");A&&A.remove();let _=document.getElementById("pds-runtime-stylesheet");_&&_.remove()},100));let f=hr(r),y;a&&a.baseURL?y=We(Ue(a.baseURL,{preferModule:!1})):y=`${f}components/`;let T=null;try{T=(await mr({autoDefineBaseURL:y,autoDefinePreload:a&&Array.isArray(a.predefine)&&a.predefine||[],autoDefineMapper:a&&typeof a.mapper=="function"&&a.mapper||null,enhancers:d,autoDefineOverrides:a||null,autoDefinePreferModule:!(a&&a.baseURL)})).autoDefiner}catch(C){m?.log?.("error","\u274C Failed to initialize AutoDefiner/Enhancers:",C)}let N=b?.options||m,R=be(r);return g.currentConfig=Object.freeze({mode:"live",...structuredClone(R),design:structuredClone(l.generatorConfig.design),preset:l.generatorConfig.preset,theme:n}),lr({mode:"live",generator:b,config:N,theme:n,autoDefiner:T}),{generator:b,config:N,theme:n,autoDefiner:T}}catch(n){throw g.dispatchEvent(new CustomEvent("pds:error",{detail:{error:n}})),n}}async function uo(r){let e=r&&r.mode||"live",{mode:t,...s}=r||{};return e==="static"?ho(s):po(s)}g.start=uo;async function ho(r){if(!r||typeof r!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let e=r.applyGlobalStyles??!0,t=r.manageTheme??!0,s=r.themeStorageKey??"pure-ds-theme",o=r.staticPaths??{},i=hr(r),a=r&&r.autoDefine||null,n;a&&a.baseURL?n=We(Ue(a.baseURL,{preferModule:!1})):n=`${i}components/`;let c=a&&Array.isArray(a.predefine)&&a.predefine||[],l=a&&typeof a.mapper=="function"&&a.mapper||null;try{let{resolvedTheme:d}=ur({manageTheme:t,themeStorageKey:s}),p=gr(r,{}),h=p.enhancers;if(o={...{tokens:`${i}styles/pds-tokens.css.js`,primitives:`${i}styles/pds-primitives.css.js`,components:`${i}styles/pds-components.css.js`,utilities:`${i}styles/pds-utilities.css.js`,styles:`${i}styles/pds-styles.css.js`},...o},g.registry.setStaticMode(o),e&&typeof document<"u")try{let y=await g.registry.getStylesheet("styles");if(y){y._pds=!0;let T=(document.adoptedStyleSheets||[]).filter(N=>N._pds!==!0);document.adoptedStyleSheets=[...T,y]}}catch(y){console.warn("Failed to apply static styles:",y)}let b=null;try{b=(await mr({autoDefineBaseURL:n,autoDefinePreload:c,autoDefineMapper:l,enhancers:h,autoDefineOverrides:a||null,autoDefinePreferModule:!(a&&a.baseURL)})).autoDefiner}catch(y){console.error("\u274C Failed to initialize AutoDefiner/Enhancers (static):",y)}let f=be(r);return g.currentConfig=Object.freeze({mode:"static",...structuredClone(f),design:structuredClone(p.generatorConfig.design),preset:p.generatorConfig.preset,theme:d}),lr({mode:"static",config:p.generatorConfig,theme:d,autoDefiner:b}),{config:p.generatorConfig,theme:d,autoDefiner:b}}catch(d){throw g.dispatchEvent(new CustomEvent("pds:error",{detail:{error:d}})),d}}async function go(r,e={}){let{storageKey:t="pure-ds-theme",persist:s=!0}=e;if(!["light","dark","system"].includes(r))throw new Error(`Invalid theme "${r}". Must be "light", "dark", or "system".`);if(typeof window>"u")return r==="system"?"light":r;let o=r;if(r==="system"&&(o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",o),s&&localStorage.setItem(t,r),g.registry.isLive&&g.registry.hasDesigner)try{let i=g.registry._designer;if(i&&i.configure){let a={...i.config,theme:o};i.configure(a),await g.Generator.applyStyles(i)}}catch(i){currentDesigner?.options?.log?.("warn","Failed to update styles for new theme:",i)}return g.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:o,requested:r,source:"programmatic"}})),o}g.setTheme=go;function mo(r,e={}){if(typeof window>"u"||!document.head||!r)return;let{theme:t,layers:s=["tokens"]}=e;try{let o=t||"light";(t==="system"||!t)&&(o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",o);let i=r.design?{...r,theme:o}:{design:r,theme:o},a=new g.Generator(i),n=s.map(c=>{try{return a.css?.[c]||""}catch{return""}}).filter(c=>c.trim()).join(`
3386
+ `);if(n){let c=document.head.querySelector("style[data-pds-preload]");c&&c.remove();let l=document.createElement("style");l.setAttribute("data-pds-preload",""),l.textContent=n,document.head.insertBefore(l,document.head.firstChild)}}catch(o){console.warn("PDS preload failed:",o)}}g.preloadCritical=mo;function fr(r){return new DOMParser().parseFromString(r,"text/html").body.childNodes}function br(r,e=100){let t;return function(...o){let i=()=>{clearTimeout(t),r(...o)};clearTimeout(t),t=setTimeout(i,e)}}function qe(r){setTimeout(r,0)}function yr(r){try{if(typeof r!="string"||r.indexOf(`
3387
+ `)!==-1||r.indexOf(" ")!==-1||r.startsWith("#/"))return!1;let e=new URL(r,window.location.origin);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function vr(r,e,t){let s=window.screen.width/2-e/2,o=window.screen.height/2-t/2;return window.open(r,"",`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=${e}, height=${t}, top=${o}, left=${s}`)}var ht={result:"ac-suggestion",item:"ac-itm"},ie=class r extends EventTarget{constructor(e,t,s){super(),this.settings={emptyResultsText:"",...s},this.container=e,this.input=t,this.input.setAttribute("autocomplete","off"),this.categories=s.categories||{},this.caches=new Map,qe(this.attach.bind(this))}static connect(e,t){let s=e.target;if(!s._autoComplete){if(!t?.categories)throw Error("Missing autocomplete settings");s._autoComplete=new r(s.parentNode,s,t),e.type==="focus"&&setTimeout(()=>{s._autoComplete.focusHandler(e)},100)}return s._autoComplete}on(e,t){return this.input.addEventListener(e,t),this}attach(){this.resultsDiv=document.createElement("div"),this.resultsDiv.title="",this.resultsDiv.classList.add(ht.result),this.container.offsetWidth>100&&(this.resultsDiv.style.width=this.container.offsetWidth),this.resultsDiv.addEventListener("mousedown",this.resultClick.bind(this)),this.container.classList.add("ac-container"),this.input.classList.add("ac-input");let e=getComputedStyle(this.input);this.container.style.setProperty("--ac-bg-default",e.backgroundColor),this.container.style.setProperty("--ac-color-default",e.color);let t=getComputedStyle(this.input).accentColor;t!=="auto"&&this.container.style.setProperty("--ac-accent-color",t),(this.container?.shadowRoot??this.container).appendChild(this.resultsDiv),this.controller().clear("attach"),this.on("input",br(this.inputHandler.bind(this),this.settings.throttleInputMs??300)).on("focus",this.focusHandler.bind(this)).on("focusout",this.blurHandler.bind(this)).on("keyup",this.keyUpHandler.bind(this)).on("keydown",this.keyDownHandler.bind(this))}controller(){let e=this.internalController();return typeof this.settings.controller=="function"&&(e=this.settings.controller(this)??e),e}internalController(){return{show:this.show.bind(this),hide:this.hide.bind(this),clear:this.clear.bind(this),empty:()=>{}}}moveResult(e){this.controller().show();let t=this.acItems.length;this.rowIndex=this.rowIndex+e,this.rowIndex<=0?this.rowIndex=0:this.rowIndex>t-1&&(this.rowIndex=0);for(let o of this.acItems)o.classList.remove("selected");let s=this.getSelectedDiv();s?(s.classList.add("selected"),s.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})):this.focusHandler({target:this.input})}getSelectedDiv(){return this.resultsDiv.querySelector(`div:nth-child(${this.rowIndex+1})`)}selectResult(e){if(e=e||this.getSelectedDiv(),e){let t=parseInt(e.getAttribute("data-index"));this.resultClicked=!0;let s=this.results[t],o=this.categories[s.category]??{};o.action=o.action??this.setText.bind(this),o.newTab&&(this.tabWindow=vr("about:blank"));let i={...s,search:this.input.value};e.classList.add("ac-active"),setTimeout(()=>{this.controller().hide("result-selected"),i.action?i.action(i):(o.action(i),o.newTab&&(i.url?this.tabWindow.location.href=i.url:this.tabWindow.close()));var a=new Event("change",{bubbles:!0});this.input.dispatchEvent(a),this.controller().clear("result-selected");let n=new Event("result-selected");n.detail=i,this.input.dispatchEvent(n)},0)}}setText(e){this.container.autoCompleteInput||(this.container.value=e.text),this.controller().hide("settext")}resultClick(e){this.selectResult(e.target.closest(`.${ht.item}`))}blurHandler(){setTimeout(()=>{this.resultClicked||this.controller().clear("blurred"),this.resultClicked=!1},100)}clear(){this.settings.debug||this.resultsDiv&&(this.resultsDiv.innerHTML="",this.controller().hide("clear"),this.cacheTmr&&clearTimeout(this.cacheTmr),this.cacheTmr=setTimeout(()=>{this.caches.clear()},60*1e3*5))}show(){if(!this.resultsDiv.classList.contains("ac-active")){let e=this.getViewBounds();this.resultsDiv.style.position="absolute",e.rect.width>100&&(this.resultsDiv.style.width=`${e.rect.width}px`),this.settings.direction=this.settings.direction??e.suggestedDirection,this.resultsDiv.setAttribute("data-direction",this.settings.direction),this.settings.direction==="up"?(this.resultsDiv.style.top="unset",this.resultsDiv.style.bottom=`${e.rect.height+20}px`,this.rowIndex=this.acItems.length):(this.resultsDiv.style.bottom="unset",this.resultsDiv.style.top=`${e.rect.height}px`,this.rowIndex=-1),this.resultsDiv.style.maxWidth="unset",this.resultsDiv.classList.toggle("ac-active",!0)}}getViewBounds(){let e=this.input.getBoundingClientRect();return{rect:e,suggestedDirection:e.top+e.height+500>window.innerHeight?"up":"down"}}hide(){this.resultsDiv.classList.toggle("ac-active",!1)}empty(){this.resultsDiv.innerHTML=`<div class="ac-empty">${this.settings.emptyResultsText}</div>`,this.controller().show()}inputHandler(e){this.cacheTmr&&clearTimeout(this.cacheTmr);let t={search:e.target.value,categories:this.categories};this.container.classList.add("search-running"),this.getItems(t,e).then(s=>{this.controller().clear("new-results"),this.resultsHandler(s,t),this.container.classList.remove("search-running")})}keyDownHandler(e){switch(e.key){case"Enter":e.stopPropagation(),e.preventDefault();break;case"ArrowDown":qe(this.moveResult(1));break;case"ArrowUp":qe(this.moveResult(-1));break}}keyUpHandler(e){switch(e.key){case"Escape":this.controller().hide("escape");break;case"Enter":this.getSelectedDiv()&&(this.container.preventEnter=!0,e.stopPropagation(),e.preventDefault(),this.selectResult(),setTimeout(()=>{this.container.preventEnter=!1},10));break;default:break}}focusHandler(e){this.controller().clear("focus");let t=e.target.value;this.suggest(t,e)}suggest(e,t){this.input.focus();let s={suggest:!0,search:e||"",categories:this.categories};this.getItems(s,t).then(o=>{this.input.dispatchEvent(new CustomEvent("show-results",{detail:{results:o}})),this.resultsHandler(o,s)})}sort(e,t){return e.sort((s,o)=>{let i=t.categories[s.category],a=t.categories[o.category],n=typeof i.sortIndex=="function"?i.sortIndex(t):i.sortIndex??0;return(typeof a.sortIndex=="function"?a.sortIndex(t):a.sortIndex??0)>n?1:-1})}resultsHandler(e,t){this.results=e,this.rowIndex=-1;let s=0,o=(i,a)=>`
3388
+ <div title="${a.tooltip||""}" data-index="${s}" class="${`${ht.item} cat-${a.category} ${a.class??""}`.trim()}">
3389
3389
  ${this.handleImageOrIcon(a)}
3390
3390
  <span class="text">${this.formatResultItem(a,t,i)}</span>
3391
3391
  ${this.settings.hideCategory?"":`<span class="category">${a.category||""}</span>`}
3392
- </div>`;e.forEach(i=>{let a=t.categories[i.category]||{};i.element?this.resultsDiv.appendChild(i.element):(i=typeof i=="string"?{text:i}:i,this.resultsDiv.appendChild(fr(o(a,i))[0])),s++}),e.length?(this.acItems=this.resultsDiv.querySelectorAll(".ac-itm"),this.controller().show()):t.search.length&&this.controller().empty()}handleImageOrIcon(e){return e.image?`<img src="${e.image}"/>`:typeof this.settings.iconHandler=="function"?this.settings.iconHandler(e):`<svg-icon icon="${e.icon}"></svg-icon>`}formatResultItem(e,t,s){let o=typeof e=="string"?{text:e}:e,i=o.text;return t.search&&(i=i.replace("%search%",t.search),o.description=o.description?.replace("%search%",t.search)),i=this.highlight(i,t.search),o.description&&(i=`<div>${i}</div><small>${o.description}</small>`),s.format&&(i=s.format({item:o,result:i,options:t})),i}highlight(e,t){var s=new RegExp("("+t+")","gi");return e.replace(s,'<span class="txt-hl">$1</span>')}async getItems(e,t){this.aborter&&this.aborter.abort();let s=this.caches.get(e.search);if(s)return s;let o=this.settings.map,i=c=>(typeof c=="string"&&(c={text:c}),c),a=c=>o?c.map(l=>({text:l[o]})):c.map(l=>i(l)),n=c=>(this.settings.max&&this.settings.max>0&&(c.length=this.settings.max),c);return this.aborter=new AbortController,this.aborterSignal=this.aborter.signal,new Promise(c=>{let l=d=>{d=this.sort(d,e),this.settings.cache!==!1&&this.caches.set(e.search,d),c(d)};if(yr(this.items)){if(this.settings.minlength>0&&(!e.search||e.search.length<this.settings.minlength)){l([]);return}let d=this.formatSearch(this.items,e);fetch(d).then(p=>{if(p.status===200){p.json().then(h=>{h=a(h),l(n(h.filter(m=>this.isMatch(e,m))))});return}throw Error(`HTTP error ${p.status} - ${d}`)})}else if(Array.isArray(this.items)){let d=!0;this.items=this.items.map(p=>typeof p=="string"?{text:p}:(d=!1,p)),d&&this.container.classList.add("simple"),l(n(a(this.items)))}else if(typeof this.items=="function")e.control=this.container,Promise.resolve(this.items(e,t)).then(p=>{p=p.map(h=>i(h)),p=a(p),l(p)});else return l(Promise.resolve(this.items.apply(this,e)))})}async items(e){let t=[];e.results=[],e.signal=this.aborterSignal;for(var s in e.categories){let o=e.categories[s];if(o.trigger=o.trigger??(()=>!0),e.results=t,o.trigger(e)){let i=[];try{i=await o.getItems(e)}catch(a){console.warn(`Error loading items for omniBox category '${s}'.`,a)}t=t.concat(i.map(a=>(a.category=s,a)))}}return t}formatSearch(e,t){return e.indexOf("%search%")?e.replace("%search%",t.search||""):e+"?"+this.createQueryParam(t)}createQueryParam(e){let t=e.suggest?"&suggest=true":"";return`q=${e.text}${t}`}isMatch(e,t){return t.text?.indexOf("%search%")>=0?!0:e.search?t.text?.toLowerCase().indexOf(e.search.toLowerCase())>=0:e.suggest}static textFilter(e,t){return function(s){if(!e.search)return!0;if(s.hidden)return!1;let i=(t?s[t]:s).match(new RegExp(e.search,"gi"));if(i)return i;if(s.config?.tags)return s.config.tags.some(a=>a.match(new RegExp(e.search,"gi")))}}};function wr(r){function e(o,i,a){let n=o[0];if(n==="colors")return i==="scheme"?"string":"color";if(n==="spacing"||n==="radius"||n==="borderWidths")return"dimension";if(n==="typography"){let c=o[1];return c==="fontFamily"?"fontFamily":c==="fontSize"?"fontSize":c==="fontWeight"?"fontWeight":c==="lineHeight"?"lineHeight":"string"}if(n==="shadows")return"shadow";if(n==="layout")return"dimension";if(n==="transitions")return"duration";if(n==="zIndex")return"number";if(n==="icons")return i==="defaultSize"||o.includes("sizes")?"dimension":"string";if(typeof a=="number")return"number";if(typeof a=="string"){if(/^\d+(\.\d+)?ms$/.test(a))return"duration";if(/^\d+(\.\d+)?(px|rem|em|vh|vw|%)$/.test(a))return"dimension";if(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(a)||/^(rgb|rgba|hsl|hsla|oklab|lab)\(/.test(a))return"color"}}function t(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function s(o,i=[]){if(o==null)return o;if(Array.isArray(o))return o.map((l,d)=>s(l,i.concat(String(d))));if(t(o)){if(Object.prototype.hasOwnProperty.call(o,"value")&&(Object.prototype.hasOwnProperty.call(o,"type")||Object.keys(o).length===1))return o;let l={};for(let[d,p]of Object.entries(o))l[d]=s(p,i.concat(d));return l}let a=i[i.length-1]??"",n=e(i,a,o),c=o;if(n==="number"&&typeof c=="string"){let l=Number(c);Number.isNaN(l)||(c=l)}return n?{value:c,type:n}:{value:c}}return s(r,[])}var xr="pure-ds-config";async function W(r,e={}){let t=document.querySelector("#global-toaster");return t||(t=document.createElement("pds-toaster"),t.id="global-toaster",document.body.appendChild(t),await customElements.whenDefined("pds-toaster")),t.toast(r,e)}customElements.define("pds-config-form",class extends P{#e;#r=0;#i=null;#o=null;#n=500;static properties={config:{type:Object,state:!0},schema:{type:Object,state:!0},mode:{type:String},inspectorMode:{type:Boolean,state:!0},formValues:{type:Object,state:!0},validationIssues:{type:Array,state:!0},formKey:{type:Number,state:!0},showInspector:{type:Boolean,attribute:"show-inspector"},showPresetSelector:{type:Boolean,attribute:"show-preset-selector"},showThemeSelector:{type:Boolean,attribute:"show-theme-selector"}};createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.formKey=0,this._validationToastId=null,this.mode="simple",this.inspectorMode=!1,this.config=this.loadConfig(),this._inspectorDeactivateHandler=()=>{this.inspectorMode&&(this.inspectorMode=!1,this.dispatchInspectorModeChange())},g.addEventListener("pds:inspector:deactivate",this._inspectorDeactivateHandler);try{g._applyResolvedTheme(g.theme),g._setupSystemListenerIfNeeded(g.theme)}catch{}this.updateForm(),this.applyDefaultHostVariables(),this._initialValidationScheduled=!1,this._loadingToastShown=!1}disconnectedCallback(){super.disconnectedCallback(),this._inspectorDeactivateHandler&&(g.removeEventListener("pds:inspector:deactivate",this._inspectorDeactivateHandler),this._inspectorDeactivateHandler=null)}applyDefaultHostVariables(){try{let r=structuredClone($.default),e=new U({design:r}),t=e.generateSpacingTokens(r.spatialRhythm||{});Object.entries(t).forEach(([a,n])=>{try{this.style.setProperty(`--spacing-${a}`,n)}catch{}});let s=r.spatialRhythm&&r.spatialRhythm.baseUnit||16;this.style.setProperty("--base-unit",`${s}px`);let o=e.generateTypographyTokens(r.typography||{});o.fontSize&&Object.entries(o.fontSize).forEach(([a,n])=>{this.style.setProperty(`--font-size-${a}`,n)});let i=r.typography&&r.typography.baseFontSize||16;this.style.setProperty("--base-font-size",`${i}px`),o.fontFamily&&Object.entries(o.fontFamily).forEach(([a,n])=>{this.style.setProperty(`--font-family-${a}`,n)}),o.lineHeight&&Object.entries(o.lineHeight).forEach(([a,n])=>{this.style.setProperty(`--font-lineHeight-${a}`,n)}),console.debug("pds-config-form: applied default host CSS variables")}catch(r){console.warn("pds-config-form: failed to apply default host variables",r)}}updateForm(){this.schema=null,fetch(`/assets/data/auto-design-${this.mode}.json`).then(r=>r.json()).then(r=>{this.schema=r,this.formValues=this.filterConfigForSchema(this.config),this.formKey=(this.formKey||0)+1}).catch(r=>{console.warn("Failed to load schema:",r)})}_isEqual(r,e){if(r===e)return!0;if(typeof r!=typeof e)return!1;if(r&&e&&typeof r=="object"){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let o=0;o<r.length;o++)if(!this._isEqual(r[o],e[o]))return!1;return!0}let t=Object.keys(r),s=Object.keys(e);t.length,s.length;for(let o of new Set([...t,...s]))if(!this._isEqual(r[o],e[o]))return!1;return!0}return!1}_deepDiff(r,e){if(!this._isEqual(r,e)){if(r&&e&&typeof r=="object"&&typeof e=="object"&&!Array.isArray(r)&&!Array.isArray(e)){let t={},s=new Set([...Object.keys(e)]);for(let o of s){let i=this._deepDiff(r[o],e[o]);i!==void 0&&(t[o]=i)}return Object.keys(t).length?t:void 0}return this._isEqual(r,e)?void 0:e}}_resolvePresetBase(r){let e=String(r||"default").toLowerCase(),t=$?.[e]||$?.default;return JSON.parse(JSON.stringify(t||$.default))}loadConfig(){let r=localStorage.getItem(xr);if(r)try{let e=JSON.parse(r);if(e&&("preset"in e||"design"in e)){let s=e.preset||"default",o=this._resolvePresetBase(s),i=Z(o,e.design||{});return this._stored={preset:s,design:e.design||{}},this._legacy=!1,i}let t=Z(config.design,e);return this._stored=null,this._legacy=!0,t}catch(e){console.warn("Failed to parse stored config, using defaults",e)}return this._stored={preset:"default",design:{}},this._legacy=!1,JSON.parse(JSON.stringify(this._resolvePresetBase("default")))}saveConfig(){try{let r=this._stored&&this._stored.preset||"default",e=this._resolvePresetBase(r),t=this._deepDiff(e,this.config)||{},s={preset:r,design:t};localStorage.setItem(xr,JSON.stringify(s)),this._stored=s,this._legacy=!1}catch(r){console.warn("Failed to save config: ",r)}}updated(r){if(r.has("schema")){this.formValues=this.filterConfigForSchema(this.config);let e=this._initialValidationScheduled?50:150;this._initialValidationScheduled=!0,setTimeout(()=>{try{this.applyStyles(!0)}catch(t){console.warn("Delayed applyStyles failed:",t)}},e)}}async applyStyles(r=!1){let e=structuredClone($.default);if(r&&this.config){let o=this._stored&&this._stored.preset||"default",i=this._resolvePresetBase(o);e=Z(i,this.config)}if(e.typography)try{await Oe(e.typography)}catch(o){console.warn("Failed to load some fonts from Google Fonts:",o)}try{let o=je(e);if(!o.ok){if(this.validationIssues=o.issues,!this._validationToastId){let i=o.issues.slice(0,3).map(a=>`\u2022 ${a.message}`).join(`
3392
+ </div>`;e.forEach(i=>{let a=t.categories[i.category]||{};i.element?this.resultsDiv.appendChild(i.element):(i=typeof i=="string"?{text:i}:i,this.resultsDiv.appendChild(fr(o(a,i))[0])),s++}),e.length?(this.acItems=this.resultsDiv.querySelectorAll(".ac-itm"),this.controller().show()):t.search.length&&this.controller().empty()}handleImageOrIcon(e){return e.image?`<img src="${e.image}"/>`:typeof this.settings.iconHandler=="function"?this.settings.iconHandler(e):`<svg-icon icon="${e.icon}"></svg-icon>`}formatResultItem(e,t,s){let o=typeof e=="string"?{text:e}:e,i=o.text;return t.search&&(i=i.replace("%search%",t.search),o.description=o.description?.replace("%search%",t.search)),i=this.highlight(i,t.search),o.description&&(i=`<div>${i}</div><small>${o.description}</small>`),s.format&&(i=s.format({item:o,result:i,options:t})),i}highlight(e,t){var s=new RegExp("("+t+")","gi");return e.replace(s,'<span class="txt-hl">$1</span>')}async getItems(e,t){this.aborter&&this.aborter.abort();let s=this.caches.get(e.search);if(s)return s;let o=this.settings.map,i=c=>(typeof c=="string"&&(c={text:c}),c),a=c=>o?c.map(l=>({text:l[o]})):c.map(l=>i(l)),n=c=>(this.settings.max&&this.settings.max>0&&(c.length=this.settings.max),c);return this.aborter=new AbortController,this.aborterSignal=this.aborter.signal,new Promise(c=>{let l=d=>{d=this.sort(d,e),this.settings.cache!==!1&&this.caches.set(e.search,d),c(d)};if(yr(this.items)){if(this.settings.minlength>0&&(!e.search||e.search.length<this.settings.minlength)){l([]);return}let d=this.formatSearch(this.items,e);fetch(d).then(p=>{if(p.status===200){p.json().then(h=>{h=a(h),l(n(h.filter(m=>this.isMatch(e,m))))});return}throw Error(`HTTP error ${p.status} - ${d}`)})}else if(Array.isArray(this.items)){let d=!0;this.items=this.items.map(p=>typeof p=="string"?{text:p}:(d=!1,p)),d&&this.container.classList.add("simple"),l(n(a(this.items)))}else if(typeof this.items=="function")e.control=this.container,Promise.resolve(this.items(e,t)).then(p=>{p=p.map(h=>i(h)),p=a(p),l(p)});else return l(Promise.resolve(this.items.apply(this,e)))})}async items(e){let t=[];e.results=[],e.signal=this.aborterSignal;for(var s in e.categories){let o=e.categories[s];if(o.trigger=o.trigger??(()=>!0),e.results=t,o.trigger(e)){let i=[];try{i=await o.getItems(e)}catch(a){console.warn(`Error loading items for omniBox category '${s}'.`,a)}t=t.concat(i.map(a=>(a.category=s,a)))}}return t}formatSearch(e,t){return e.indexOf("%search%")?e.replace("%search%",t.search||""):e+"?"+this.createQueryParam(t)}createQueryParam(e){let t=e.suggest?"&suggest=true":"";return`q=${e.text}${t}`}isMatch(e,t){return t.text?.indexOf("%search%")>=0?!0:e.search?t.text?.toLowerCase().indexOf(e.search.toLowerCase())>=0:e.suggest}static textFilter(e,t){return function(s){if(!e.search)return!0;if(s.hidden)return!1;let i=(t?s[t]:s).match(new RegExp(e.search,"gi"));if(i)return i;if(s.config?.tags)return s.config.tags.some(a=>a.match(new RegExp(e.search,"gi")))}}};function wr(r){function e(o,i,a){let n=o[0];if(n==="colors")return i==="scheme"?"string":"color";if(n==="spacing"||n==="radius"||n==="borderWidths")return"dimension";if(n==="typography"){let c=o[1];return c==="fontFamily"?"fontFamily":c==="fontSize"?"fontSize":c==="fontWeight"?"fontWeight":c==="lineHeight"?"lineHeight":"string"}if(n==="shadows")return"shadow";if(n==="layout")return"dimension";if(n==="transitions")return"duration";if(n==="zIndex")return"number";if(n==="icons")return i==="defaultSize"||o.includes("sizes")?"dimension":"string";if(typeof a=="number")return"number";if(typeof a=="string"){if(/^\d+(\.\d+)?ms$/.test(a))return"duration";if(/^\d+(\.\d+)?(px|rem|em|vh|vw|%)$/.test(a))return"dimension";if(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(a)||/^(rgb|rgba|hsl|hsla|oklab|lab)\(/.test(a))return"color"}}function t(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function s(o,i=[]){if(o==null)return o;if(Array.isArray(o))return o.map((l,d)=>s(l,i.concat(String(d))));if(t(o)){if(Object.prototype.hasOwnProperty.call(o,"value")&&(Object.prototype.hasOwnProperty.call(o,"type")||Object.keys(o).length===1))return o;let l={};for(let[d,p]of Object.entries(o))l[d]=s(p,i.concat(d));return l}let a=i[i.length-1]??"",n=e(i,a,o),c=o;if(n==="number"&&typeof c=="string"){let l=Number(c);Number.isNaN(l)||(c=l)}return n?{value:c,type:n}:{value:c}}return s(r,[])}var xr="pure-ds-config";async function W(r,e={}){let t=document.querySelector("#global-toaster");return t||(t=document.createElement("pds-toaster"),t.id="global-toaster",document.body.appendChild(t),await customElements.whenDefined("pds-toaster")),t.toast(r,e)}customElements.define("pds-config-form",class extends P{#e;#r=0;#i=null;#o=null;#n=500;static properties={config:{type:Object,state:!0},schema:{type:Object,state:!0},mode:{type:String},inspectorMode:{type:Boolean,state:!0},formValues:{type:Object,state:!0},validationIssues:{type:Array,state:!0},formKey:{type:Number,state:!0},showInspector:{type:Boolean,attribute:"show-inspector"},showPresetSelector:{type:Boolean,attribute:"show-preset-selector"},showThemeSelector:{type:Boolean,attribute:"show-theme-selector"}};createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.formKey=0,this._validationToastId=null,this.mode="simple",this.inspectorMode=!1,this.config=this.loadConfig(),this._inspectorDeactivateHandler=()=>{this.inspectorMode&&(this.inspectorMode=!1,this.dispatchInspectorModeChange())},g.addEventListener("pds:inspector:deactivate",this._inspectorDeactivateHandler);try{g._applyResolvedTheme(g.theme),g._setupSystemListenerIfNeeded(g.theme)}catch{}this.updateForm(),this.applyDefaultHostVariables(),this._initialValidationScheduled=!1,this._loadingToastShown=!1}disconnectedCallback(){super.disconnectedCallback(),this._inspectorDeactivateHandler&&(g.removeEventListener("pds:inspector:deactivate",this._inspectorDeactivateHandler),this._inspectorDeactivateHandler=null)}applyDefaultHostVariables(){try{let r=structuredClone($.default),e=new U({design:r}),t=e.generateSpacingTokens(r.spatialRhythm||{});Object.entries(t).forEach(([a,n])=>{try{this.style.setProperty(`--spacing-${a}`,n)}catch{}});let s=r.spatialRhythm&&r.spatialRhythm.baseUnit||16;this.style.setProperty("--base-unit",`${s}px`);let o=e.generateTypographyTokens(r.typography||{});o.fontSize&&Object.entries(o.fontSize).forEach(([a,n])=>{this.style.setProperty(`--font-size-${a}`,n)});let i=r.typography&&r.typography.baseFontSize||16;this.style.setProperty("--base-font-size",`${i}px`),o.fontFamily&&Object.entries(o.fontFamily).forEach(([a,n])=>{this.style.setProperty(`--font-family-${a}`,n)}),o.lineHeight&&Object.entries(o.lineHeight).forEach(([a,n])=>{this.style.setProperty(`--font-lineHeight-${a}`,n)}),console.debug("pds-config-form: applied default host CSS variables")}catch(r){console.warn("pds-config-form: failed to apply default host variables",r)}}updateForm(){this.schema=null,fetch(`/assets/data/auto-design-${this.mode}.json`).then(r=>r.json()).then(r=>{this.schema=r,this.formValues=this.filterConfigForSchema(this.config),this.formKey=(this.formKey||0)+1}).catch(r=>{console.warn("Failed to load schema:",r)})}_isEqual(r,e){if(r===e)return!0;if(typeof r!=typeof e)return!1;if(r&&e&&typeof r=="object"){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let o=0;o<r.length;o++)if(!this._isEqual(r[o],e[o]))return!1;return!0}let t=Object.keys(r),s=Object.keys(e);t.length,s.length;for(let o of new Set([...t,...s]))if(!this._isEqual(r[o],e[o]))return!1;return!0}return!1}_deepDiff(r,e){if(!this._isEqual(r,e)){if(r&&e&&typeof r=="object"&&typeof e=="object"&&!Array.isArray(r)&&!Array.isArray(e)){let t={},s=new Set([...Object.keys(e)]);for(let o of s){let i=this._deepDiff(r[o],e[o]);i!==void 0&&(t[o]=i)}return Object.keys(t).length?t:void 0}return this._isEqual(r,e)?void 0:e}}_resolvePresetBase(r){let e=String(r||"default").toLowerCase(),t=$?.[e]||$?.default;return JSON.parse(JSON.stringify(t||$.default))}loadConfig(){let r=localStorage.getItem(xr);if(r)try{let e=JSON.parse(r);if(e&&("preset"in e||"design"in e)){let s=e.preset||"default",o=this._resolvePresetBase(s),i=Z(o,e.design||{});return this._stored={preset:s,design:e.design||{}},this._legacy=!1,i}let t=Z(config.design,e);return this._stored=null,this._legacy=!0,t}catch(e){console.warn("Failed to parse stored config, using defaults",e)}return this._stored={preset:"default",design:{}},this._legacy=!1,JSON.parse(JSON.stringify(this._resolvePresetBase("default")))}saveConfig(){try{let r=this._stored&&this._stored.preset||"default",e=this._resolvePresetBase(r),t=this._deepDiff(e,this.config)||{},s={preset:r,design:t};localStorage.setItem(xr,JSON.stringify(s)),this._stored=s,this._legacy=!1}catch(r){console.warn("Failed to save config: ",r)}}updated(r){if(r.has("schema")){this.formValues=this.filterConfigForSchema(this.config);let e=this._initialValidationScheduled?50:150;this._initialValidationScheduled=!0,setTimeout(()=>{try{this.applyStyles(!0)}catch(t){console.warn("Delayed applyStyles failed:",t)}},e)}}async applyStyles(r=!1){let e=structuredClone($.default);if(r&&this.config){let o=this._stored&&this._stored.preset||"default",i=this._resolvePresetBase(o);e=Z(i,this.config)}if(e.typography)try{await je(e.typography)}catch(o){console.warn("Failed to load some fonts from Google Fonts:",o)}try{let o=He(e);if(!o.ok){if(this.validationIssues=o.issues,!this._validationToastId){let i=o.issues.slice(0,3).map(a=>`\u2022 ${a.message}`).join(`
3393
3393
  `);this._validationToastId=W(`Design has accessibility issues. Fix before applying.
3394
3394
  ${i}`,{type:"error",persistent:!0})}return}this.validationIssues=[],this._validationToastId&&(document.querySelector("#global-toaster")?.dismissToast(this._validationToastId),this._validationToastId=null)}catch(o){console.warn("Validation failed unexpectedly:",o)}let t=g.theme||null,s={design:structuredClone(e)};t&&(s.theme=t),this.generator=new U(s),U.applyStyles(this.generator);try{g._applyResolvedTheme(g.theme),g._setupSystemListenerIfNeeded(g.theme)}catch{}this.scheduleDesignUpdatedEmit({config:e,designer:this.generator})}scheduleDesignUpdatedEmit(r){let e=Date.now(),t=()=>{this.#r=Date.now(),this.#i&&(clearTimeout(this.#i),this.#i=null),g.dispatchEvent(new CustomEvent("pds:design:updated",{detail:r}))};if(e-this.#r>=this.#n){t();return}if(!this.#i){let s=this.#n-(e-this.#r);this.#i=setTimeout(()=>{this.#i=null,t()},s)}}toggleInspectorMode(){this.inspectorMode=!this.inspectorMode,this.dispatchInspectorModeChange(),W(this.inspectorMode?"Code Inspector active - click any element in the showcase to view its code":"Code Inspector deactivated",{type:"info",duration:3e3})}dispatchInspectorModeChange(){g.dispatchEvent(new CustomEvent("pds:inspector:mode:changed",{detail:{active:this.inspectorMode}}))}flattenConfig(r,e=""){let t={};for(let[s,o]of Object.entries(r)){let i=e?`${e}/${s}`:`/${s}`;o&&typeof o=="object"&&!Array.isArray(o)?Object.assign(t,this.flattenConfig(o,i)):t[i]=o}return t}getSchemaProperties(r,e=""){let t=new Set;if(!r||!r.properties)return t;for(let[s,o]of Object.entries(r.properties)){let i=e?`${e}/${s}`:`/${s}`;t.add(i),o.type==="object"&&o.properties&&this.getSchemaProperties(o,i).forEach(n=>t.add(n))}return t}filterConfigForSchema(r){if(!r)return{};if(!this.schema)return this.flattenConfig(r);let e=this.getSchemaProperties(this.schema),t=this.flattenConfig(r),s={};for(let[o,i]of Object.entries(t))e.has(o)&&i!==null&&i!==void 0&&(s[o]=i);return s}handleFormChange=r=>{let e,t=null;if(r.type==="pw:value-change"&&r.detail&&(t=r.detail.name),r.detail&&r.detail.json)e=r.detail.json;else{let n=r.currentTarget?.tagName?.toUpperCase()==="PDS-JSONFORM"?r.currentTarget:this.querySelector("pds-jsonform");if(n)e=n.getValuesFlat?.()||n.values||{};else{console.warn("No form element found in form change event",r);return}}console.log("Form values received:",e);let s={},o=n=>n.replace(/~1/g,"/").replace(/~0/g,"~");for(let[n,c]of Object.entries(e))if(n)if(n.startsWith("/")){let d=n.replace(/^\//,"").split("/").map(o),p=s;for(let h=0;h<d.length-1;h++){let m=d[h];(!p[m]||typeof p[m]!="object")&&(p[m]={}),p=p[m]}p[d[d.length-1]]=c}else if(n.includes(".")){let l=n.split("."),d=s;for(let p=0;p<l.length-1;p++)(!d[l[p]]||typeof d[l[p]]!="object")&&(d[l[p]]={}),d=d[l[p]];d[l[l.length-1]]=c}else s[n]=c;console.log("Nested values:",s);let i=Z(structuredClone(this.config),s),a=g.validateDesign(i);if(!a.ok){if(this.validationIssues=a.issues,!this._validationToastId){let n=a.issues.slice(0,3).map(c=>`\u2022 ${c.message}`).join(`
3395
3395
  `);this._validationToastId=W(`Design has accessibility issues. Fix before saving.
@@ -5579,7 +5579,7 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
5579
5579
  <pds-config-form slot="left" show-inspector show-preset-selector show-theme-selector></pds-config-form>
5580
5580
  <pds-demo slot="right"></pds-demo>
5581
5581
  </pds-splitpanel>
5582
- `}});await g.start(Ie);document.body.innerHTML=`
5582
+ `}});await g.start(Be);document.body.innerHTML=`
5583
5583
  <header>
5584
5584
  <pds-toaster id="global-toaster"></pds-toaster>
5585
5585
  </header>