@commmerce/ui 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cdn.js CHANGED
@@ -1,6 +1,6 @@
1
- var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(n,r,e)=>(Pl(n,r,"read from private field"),e?e.call(n):r.get(n)),p=(n,r,e)=>r.has(n)?Id("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,e),f=(n,r,e,t)=>(Pl(n,r,"write to private field"),t?t.call(n,e):r.set(n,e),e),o=(n,r,e)=>(Pl(n,r,"access private method"),e);var Dn=globalThis,Nn=Dn.ShadowRoot&&(Dn.ShadyCSS===void 0||Dn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bl=Symbol(),Od=new WeakMap,jr=class{constructor(r,e,t){if(this._$cssResult$=!0,t!==Bl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=e}get styleSheet(){let r=this.o,e=this.t;if(Nn&&r===void 0){let t=e!==void 0&&e.length===1;t&&(r=Od.get(e)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),t&&Od.set(e,r))}return r}toString(){return this.cssText}},Rn=n=>new jr(typeof n=="string"?n:n+"",void 0,Bl),b=(n,...r)=>{let e=n.length===1?n[0]:r.reduce((t,i,a)=>t+(c=>{if(c._$cssResult$===!0)return c.cssText;if(typeof c=="number")return c;throw Error("Value passed to 'css' function must be a 'css' function result: "+c+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[a+1],n[0]);return new jr(e,n,Bl)},qd=(n,r)=>{if(Nn)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of r){let t=document.createElement("style"),i=Dn.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,n.appendChild(t)}},jl=Nn?n=>n:n=>n instanceof CSSStyleSheet?(r=>{let e="";for(let t of r.cssRules)e+=t.cssText;return Rn(e)})(n):n;var{is:gu,defineProperty:vu,getOwnPropertyDescriptor:xu,getOwnPropertyNames:yu,getOwnPropertySymbols:wu,getPrototypeOf:$u}=Object,Hn=globalThis,Pd=Hn.trustedTypes,ku=Pd?Pd.emptyScript:"",Eu=Hn.reactiveElementPolyfillSupport,Fr=(n,r)=>n,Fl={toAttribute(n,r){switch(r){case Boolean:n=n?ku:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,r){let e=n;switch(r){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},jd=(n,r)=>!gu(n,r),Bd={attribute:!0,type:String,converter:Fl,reflect:!1,useDefault:!1,hasChanged:jd};Symbol.metadata??=Symbol("metadata"),Hn.litPropertyMetadata??=new WeakMap;var Ye=class extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??=[]).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,e=Bd){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(r)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(r,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(r,t,e);i!==void 0&&vu(this.prototype,r,i)}}static getPropertyDescriptor(r,e,t){let{get:i,set:a}=xu(this.prototype,r)??{get(){return this[e]},set(c){this[e]=c}};return{get:i,set(c){let h=i?.call(this);a?.call(this,c),this.requestUpdate(r,h,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??Bd}static _$Ei(){if(this.hasOwnProperty(Fr("elementProperties")))return;let r=$u(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(Fr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Fr("properties"))){let e=this.properties,t=[...yu(e),...wu(e)];for(let i of t)this.createProperty(i,e[i])}let r=this[Symbol.metadata];if(r!==null){let e=litPropertyMetadata.get(r);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){let e=[];if(Array.isArray(r)){let t=new Set(r.flat(1/0).reverse());for(let i of t)e.unshift(jl(i))}else r!==void 0&&e.push(jl(r));return e}static _$Eu(r,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof r=="string"?r.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(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(r=>r(this))}addController(r){(this._$EO??=new Set).add(r),this.renderRoot!==void 0&&this.isConnected&&r.hostConnected?.()}removeController(r){this._$EO?.delete(r)}_$E_(){let r=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(r.set(t,this[t]),delete this[t]);r.size>0&&(this._$Ep=r)}createRenderRoot(){let r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return qd(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(r=>r.hostConnected?.())}enableUpdating(r){}disconnectedCallback(){this._$EO?.forEach(r=>r.hostDisconnected?.())}attributeChangedCallback(r,e,t){this._$AK(r,t)}_$ET(r,e){let t=this.constructor.elementProperties.get(r),i=this.constructor._$Eu(r,t);if(i!==void 0&&t.reflect===!0){let a=(t.converter?.toAttribute!==void 0?t.converter:Fl).toAttribute(e,t.type);this._$Em=r,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}_$AK(r,e){let t=this.constructor,i=t._$Eh.get(r);if(i!==void 0&&this._$Em!==i){let a=t.getPropertyOptions(i),c=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:Fl;this._$Em=i;let h=c.fromAttribute(e,a.type);this[i]=h??this._$Ej?.get(i)??h,this._$Em=null}}requestUpdate(r,e,t,i=!1,a){if(r!==void 0){let c=this.constructor;if(i===!1&&(a=this[r]),t??=c.getPropertyOptions(r),!((t.hasChanged??jd)(a,e)||t.useDefault&&t.reflect&&a===this._$Ej?.get(r)&&!this.hasAttribute(c._$Eu(r,t))))return;this.C(r,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(r,e,{useDefault:t,reflect:i,wrapped:a},c){t&&!(this._$Ej??=new Map).has(r)&&(this._$Ej.set(r,c??e??this[r]),a!==!0||c!==void 0)||(this._$AL.has(r)||(this.hasUpdated||t||(e=void 0),this._$AL.set(r,e)),i===!0&&this._$Em!==r&&(this._$Eq??=new Set).add(r))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let r=this.scheduleUpdate();return r!=null&&await r,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,a]of this._$Ep)this[i]=a;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,a]of t){let{wrapped:c}=a,h=this[i];c!==!0||this._$AL.has(i)||h===void 0||this.C(i,void 0,a,h)}}let r=!1,e=this._$AL;try{r=this.shouldUpdate(e),r?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw r=!1,this._$EM(),t}r&&this._$AE(e)}willUpdate(r){}_$AE(r){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(r)),this.updated(r)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(r){return!0}update(r){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(r){}firstUpdated(r){}};Ye.elementStyles=[],Ye.shadowRootOptions={mode:"open"},Ye[Fr("elementProperties")]=new Map,Ye[Fr("finalized")]=new Map,Eu?.({ReactiveElement:Ye}),(Hn.reactiveElementVersions??=[]).push("2.1.2");var Ul=globalThis,Fd=n=>n,In=Ul.trustedTypes,Vd=In?In.createPolicy("lit-html",{createHTML:n=>n}):void 0,Kl="$lit$",We=`lit$${Math.random().toFixed(9).slice(2)}$`,Gl="?"+We,Mu=`<${Gl}>`,jt=document,Ur=()=>jt.createComment(""),Kr=n=>n===null||typeof n!="object"&&typeof n!="function",Yl=Array.isArray,Xd=n=>Yl(n)||typeof n?.[Symbol.iterator]=="function",Vl=`[
2
- \f\r]`,Vr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ud=/-->/g,Kd=/>/g,Pt=RegExp(`>|${Vl}(?:([^\\s"'>=/]+)(${Vl}*=${Vl}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Gd=/'/g,Yd=/"/g,Jd=/^(?:script|style|textarea|title)$/i,Wl=n=>(r,...e)=>({_$litType$:n,strings:r,values:e}),l=Wl(1),Yr=Wl(2),um=Wl(3),ae=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Wd=new WeakMap,Bt=jt.createTreeWalker(jt,129);function Zd(n,r){if(!Yl(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vd!==void 0?Vd.createHTML(r):r}var Qd=(n,r)=>{let e=n.length-1,t=[],i,a=r===2?"<svg>":r===3?"<math>":"",c=Vr;for(let h=0;h<e;h++){let u=n[h],m,y,v=-1,E=0;for(;E<u.length&&(c.lastIndex=E,y=c.exec(u),y!==null);)E=c.lastIndex,c===Vr?y[1]==="!--"?c=Ud:y[1]!==void 0?c=Kd:y[2]!==void 0?(Jd.test(y[2])&&(i=RegExp("</"+y[2],"g")),c=Pt):y[3]!==void 0&&(c=Pt):c===Pt?y[0]===">"?(c=i??Vr,v=-1):y[1]===void 0?v=-2:(v=c.lastIndex-y[2].length,m=y[1],c=y[3]===void 0?Pt:y[3]==='"'?Yd:Gd):c===Yd||c===Gd?c=Pt:c===Ud||c===Kd?c=Vr:(c=Pt,i=void 0);let $=c===Pt&&n[h+1].startsWith("/>")?" ":"";a+=c===Vr?u+Mu:v>=0?(t.push(m),u.slice(0,v)+Kl+u.slice(v)+We+$):u+We+(v===-2?h:$)}return[Zd(n,a+(n[e]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),t]},Gr=class n{constructor({strings:r,_$litType$:e},t){let i;this.parts=[];let a=0,c=0,h=r.length-1,u=this.parts,[m,y]=Qd(r,e);if(this.el=n.createElement(m,t),Bt.currentNode=this.el.content,e===2||e===3){let v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(i=Bt.nextNode())!==null&&u.length<h;){if(i.nodeType===1){if(i.hasAttributes())for(let v of i.getAttributeNames())if(v.endsWith(Kl)){let E=y[c++],$=i.getAttribute(v).split(We),T=/([.?@])?(.*)/.exec(E);u.push({type:1,index:a,name:T[2],strings:$,ctor:T[1]==="."?qn:T[1]==="?"?Pn:T[1]==="@"?Bn:Vt}),i.removeAttribute(v)}else v.startsWith(We)&&(u.push({type:6,index:a}),i.removeAttribute(v));if(Jd.test(i.tagName)){let v=i.textContent.split(We),E=v.length-1;if(E>0){i.textContent=In?In.emptyScript:"";for(let $=0;$<E;$++)i.append(v[$],Ur()),Bt.nextNode(),u.push({type:2,index:++a});i.append(v[E],Ur())}}}else if(i.nodeType===8)if(i.data===Gl)u.push({type:2,index:a});else{let v=-1;for(;(v=i.data.indexOf(We,v+1))!==-1;)u.push({type:7,index:a}),v+=We.length-1}a++}}static createElement(r,e){let t=jt.createElement("template");return t.innerHTML=r,t}};function Ft(n,r,e=n,t){if(r===ae)return r;let i=t!==void 0?e._$Co?.[t]:e._$Cl,a=Kr(r)?void 0:r._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(n),i._$AT(n,e,t)),t!==void 0?(e._$Co??=[])[t]=i:e._$Cl=i),i!==void 0&&(r=Ft(n,i._$AS(n,r.values),i,t)),r}var On=class{constructor(r,e){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){let{el:{content:e},parts:t}=this._$AD,i=(r?.creationScope??jt).importNode(e,!0);Bt.currentNode=i;let a=Bt.nextNode(),c=0,h=0,u=t[0];for(;u!==void 0;){if(c===u.index){let m;u.type===2?m=new Ci(a,a.nextSibling,this,r):u.type===1?m=new u.ctor(a,u.name,u.strings,this,r):u.type===6&&(m=new jn(a,this,r)),this._$AV.push(m),u=t[++h]}c!==u?.index&&(a=Bt.nextNode(),c++)}return Bt.currentNode=jt,i}p(r){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(r,t,e),e+=t.strings.length-2):t._$AI(r[e])),e++}},Ci=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(r,e,t,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=r,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let r=this._$AA.parentNode,e=this._$AM;return e!==void 0&&r?.nodeType===11&&(r=e.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,e=this){r=Ft(this,r,e),Kr(r)?r===d||r==null||r===""?(this._$AH!==d&&this._$AR(),this._$AH=d):r!==this._$AH&&r!==ae&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):Xd(r)?this.k(r):this._(r)}O(r){return this._$AA.parentNode.insertBefore(r,this._$AB)}T(r){this._$AH!==r&&(this._$AR(),this._$AH=this.O(r))}_(r){this._$AH!==d&&Kr(this._$AH)?this._$AA.nextSibling.data=r:this.T(jt.createTextNode(r)),this._$AH=r}$(r){let{values:e,_$litType$:t}=r,i=typeof t=="number"?this._$AC(r):(t.el===void 0&&(t.el=Gr.createElement(Zd(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let a=new On(i,this),c=a.u(this.options);a.p(e),this.T(c),this._$AH=a}}_$AC(r){let e=Wd.get(r.strings);return e===void 0&&Wd.set(r.strings,e=new Gr(r)),e}k(r){Yl(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let a of r)i===e.length?e.push(t=new n(this.O(Ur()),this.O(Ur()),this,this.options)):t=e[i],t._$AI(a),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(r=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);r!==this._$AB;){let t=Fd(r).nextSibling;Fd(r).remove(),r=t}}setConnected(r){this._$AM===void 0&&(this._$Cv=r,this._$AP?.(r))}},Vt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,e,t,i,a){this.type=1,this._$AH=d,this._$AN=void 0,this.element=r,this.name=e,this._$AM=i,this.options=a,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=d}_$AI(r,e=this,t,i){let a=this.strings,c=!1;if(a===void 0)r=Ft(this,r,e,0),c=!Kr(r)||r!==this._$AH&&r!==ae,c&&(this._$AH=r);else{let h=r,u,m;for(r=a[0],u=0;u<a.length-1;u++)m=Ft(this,h[t+u],e,u),m===ae&&(m=this._$AH[u]),c||=!Kr(m)||m!==this._$AH[u],m===d?r=d:r!==d&&(r+=(m??"")+a[u+1]),this._$AH[u]=m}c&&!i&&this.j(r)}j(r){r===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,r??"")}},qn=class extends Vt{constructor(){super(...arguments),this.type=3}j(r){this.element[this.name]=r===d?void 0:r}},Pn=class extends Vt{constructor(){super(...arguments),this.type=4}j(r){this.element.toggleAttribute(this.name,!!r&&r!==d)}},Bn=class extends Vt{constructor(r,e,t,i,a){super(r,e,t,i,a),this.type=5}_$AI(r,e=this){if((r=Ft(this,r,e,0)??d)===ae)return;let t=this._$AH,i=r===d&&t!==d||r.capture!==t.capture||r.once!==t.once||r.passive!==t.passive,a=r!==d&&(t===d||i);i&&this.element.removeEventListener(this.name,this,t),a&&this.element.addEventListener(this.name,this,r),this._$AH=r}handleEvent(r){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,r):this._$AH.handleEvent(r)}},jn=class{constructor(r,e,t){this.element=r,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(r){Ft(this,r)}},eh={M:Kl,P:We,A:Gl,C:1,L:Qd,R:On,D:Xd,V:Ft,I:Ci,H:Vt,N:Pn,U:Bn,B:qn,F:jn},Tu=Ul.litHtmlPolyfillSupport;Tu?.(Gr,Ci),(Ul.litHtmlVersions??=[]).push("3.3.3");var th=(n,r,e)=>{let t=e?.renderBefore??r,i=t._$litPart$;if(i===void 0){let a=e?.renderBefore??null;t._$litPart$=i=new Ci(r.insertBefore(Ur(),a),a,void 0,e??{})}return i._$AI(n),i};var Xl=globalThis,_=class extends Ye{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let r=super.createRenderRoot();return this.renderOptions.renderBefore??=r.firstChild,r}update(r){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(r),this._$Do=th(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ae}};_._$litElement$=!0,_.finalized=!0,Xl.litElementHydrateSupport?.({LitElement:_});var _u=Xl.litElementPolyfillSupport;_u?.({LitElement:_});(Xl.litElementVersions??=[]).push("4.2.2");var w=b`
1
+ var Up=o=>{throw TypeError(o)};var wd=(o,n,e)=>n.has(o)||Up("Cannot "+e);var s=(o,n,e)=>(wd(o,n,"read from private field"),e?e.call(o):n.get(o)),u=(o,n,e)=>n.has(o)?Up("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(o):n.set(o,e),g=(o,n,e,t)=>(wd(o,n,"write to private field"),t?t.call(o,e):n.set(o,e),e),a=(o,n,e)=>(wd(o,n,"access private method"),e);var rl=globalThis,al=rl.ShadowRoot&&(rl.ShadyCSS===void 0||rl.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$d=Symbol(),Kp=new WeakMap,ja=class{constructor(n,e,t){if(this._$cssResult$=!0,t!==$d)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=e}get styleSheet(){let n=this.o,e=this.t;if(al&&n===void 0){let t=e!==void 0&&e.length===1;t&&(n=Kp.get(e)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),t&&Kp.set(e,n))}return n}toString(){return this.cssText}},nl=o=>new ja(typeof o=="string"?o:o+"",void 0,$d),x=(o,...n)=>{let e=o.length===1?o[0]:n.reduce((t,i,r)=>t+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new ja(e,o,$d)},Wp=(o,n)=>{if(al)o.adoptedStyleSheets=n.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of n){let t=document.createElement("style"),i=rl.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,o.appendChild(t)}},kd=al?o=>o:o=>o instanceof CSSStyleSheet?(n=>{let e="";for(let t of n.cssRules)e+=t.cssText;return nl(e)})(o):o;var{is:lg,defineProperty:cg,getOwnPropertyDescriptor:dg,getOwnPropertyNames:hg,getOwnPropertySymbols:pg,getPrototypeOf:ug}=Object,ol=globalThis,Yp=ol.trustedTypes,mg=Yp?Yp.emptyScript:"",fg=ol.reactiveElementPolyfillSupport,Va=(o,n)=>o,Ed={toAttribute(o,n){switch(n){case Boolean:o=o?mg:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,n){let e=o;switch(n){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},Xp=(o,n)=>!lg(o,n),Gp={attribute:!0,type:String,converter:Ed,reflect:!1,useDefault:!1,hasChanged:Xp};Symbol.metadata??=Symbol("metadata"),ol.litPropertyMetadata??=new WeakMap;var $t=class extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,e=Gp){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(n)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(n,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(n,t,e);i!==void 0&&cg(this.prototype,n,i)}}static getPropertyDescriptor(n,e,t){let{get:i,set:r}=dg(this.prototype,n)??{get(){return this[e]},set(l){this[e]=l}};return{get:i,set(l){let d=i?.call(this);r?.call(this,l),this.requestUpdate(n,d,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??Gp}static _$Ei(){if(this.hasOwnProperty(Va("elementProperties")))return;let n=ug(this);n.finalize(),n.l!==void 0&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(Va("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Va("properties"))){let e=this.properties,t=[...hg(e),...pg(e)];for(let i of t)this.createProperty(i,e[i])}let n=this[Symbol.metadata];if(n!==null){let e=litPropertyMetadata.get(n);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(n){let e=[];if(Array.isArray(n)){let t=new Set(n.flat(1/0).reverse());for(let i of t)e.unshift(kd(i))}else n!==void 0&&e.push(kd(n));return e}static _$Eu(n,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof n=="string"?n.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(n=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(n=>n(this))}addController(n){(this._$EO??=new Set).add(n),this.renderRoot!==void 0&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){let n=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(n.set(t,this[t]),delete this[t]);n.size>0&&(this._$Ep=n)}createRenderRoot(){let n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Wp(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(n=>n.hostConnected?.())}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach(n=>n.hostDisconnected?.())}attributeChangedCallback(n,e,t){this._$AK(n,t)}_$ET(n,e){let t=this.constructor.elementProperties.get(n),i=this.constructor._$Eu(n,t);if(i!==void 0&&t.reflect===!0){let r=(t.converter?.toAttribute!==void 0?t.converter:Ed).toAttribute(e,t.type);this._$Em=n,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(n,e){let t=this.constructor,i=t._$Eh.get(n);if(i!==void 0&&this._$Em!==i){let r=t.getPropertyOptions(i),l=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:Ed;this._$Em=i;let d=l.fromAttribute(e,r.type);this[i]=d??this._$Ej?.get(i)??d,this._$Em=null}}requestUpdate(n,e,t,i=!1,r){if(n!==void 0){let l=this.constructor;if(i===!1&&(r=this[n]),t??=l.getPropertyOptions(n),!((t.hasChanged??Xp)(r,e)||t.useDefault&&t.reflect&&r===this._$Ej?.get(n)&&!this.hasAttribute(l._$Eu(n,t))))return;this.C(n,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(n,e,{useDefault:t,reflect:i,wrapped:r},l){t&&!(this._$Ej??=new Map).has(n)&&(this._$Ej.set(n,l??e??this[n]),r!==!0||l!==void 0)||(this._$AL.has(n)||(this.hasUpdated||t||(e=void 0),this._$AL.set(n,e)),i===!0&&this._$Em!==n&&(this._$Eq??=new Set).add(n))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let n=this.scheduleUpdate();return n!=null&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,r]of t){let{wrapped:l}=r,d=this[i];l!==!0||this._$AL.has(i)||d===void 0||this.C(i,void 0,r,d)}}let n=!1,e=this._$AL;try{n=this.shouldUpdate(e),n?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw n=!1,this._$EM(),t}n&&this._$AE(e)}willUpdate(n){}_$AE(n){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(n){}firstUpdated(n){}};$t.elementStyles=[],$t.shadowRootOptions={mode:"open"},$t[Va("elementProperties")]=new Map,$t[Va("finalized")]=new Map,fg?.({ReactiveElement:$t}),(ol.reactiveElementVersions??=[]).push("2.1.2");var Td=globalThis,Jp=o=>o,ll=Td.trustedTypes,Zp=ll?ll.createPolicy("lit-html",{createHTML:o=>o}):void 0,Cd="$lit$",kt=`lit$${Math.random().toFixed(9).slice(2)}$`,_d="?"+kt,gg=`<${_d}>`,Ei=document,Ka=()=>Ei.createComment(""),Wa=o=>o===null||typeof o!="object"&&typeof o!="function",Ld=Array.isArray,ru=o=>Ld(o)||typeof o?.[Symbol.iterator]=="function",Md=`[
2
+ \f\r]`,Ua=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Qp=/-->/g,eu=/>/g,$i=RegExp(`>|${Md}(?:([^\\s"'>=/]+)(${Md}*=${Md}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),tu=/'/g,iu=/"/g,au=/^(?:script|style|textarea|title)$/i,Sd=o=>(n,...e)=>({_$litType$:o,strings:n,values:e}),c=Sd(1),Ga=Sd(2),db=Sd(3),ge=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),su=new WeakMap,ki=Ei.createTreeWalker(Ei,129);function nu(o,n){if(!Ld(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Zp!==void 0?Zp.createHTML(n):n}var ou=(o,n)=>{let e=o.length-1,t=[],i,r=n===2?"<svg>":n===3?"<math>":"",l=Ua;for(let d=0;d<e;d++){let p=o[d],m,v,b=-1,$=0;for(;$<p.length&&(l.lastIndex=$,v=l.exec(p),v!==null);)$=l.lastIndex,l===Ua?v[1]==="!--"?l=Qp:v[1]!==void 0?l=eu:v[2]!==void 0?(au.test(v[2])&&(i=RegExp("</"+v[2],"g")),l=$i):v[3]!==void 0&&(l=$i):l===$i?v[0]===">"?(l=i??Ua,b=-1):v[1]===void 0?b=-2:(b=l.lastIndex-v[2].length,m=v[1],l=v[3]===void 0?$i:v[3]==='"'?iu:tu):l===iu||l===tu?l=$i:l===Qp||l===eu?l=Ua:(l=$i,i=void 0);let y=l===$i&&o[d+1].startsWith("/>")?" ":"";r+=l===Ua?p+gg:b>=0?(t.push(m),p.slice(0,b)+Cd+p.slice(b)+kt+y):p+kt+(b===-2?d:y)}return[nu(o,r+(o[e]||"<?>")+(n===2?"</svg>":n===3?"</math>":"")),t]},Ya=class o{constructor({strings:n,_$litType$:e},t){let i;this.parts=[];let r=0,l=0,d=n.length-1,p=this.parts,[m,v]=ou(n,e);if(this.el=o.createElement(m,t),ki.currentNode=this.el.content,e===2||e===3){let b=this.el.content.firstChild;b.replaceWith(...b.childNodes)}for(;(i=ki.nextNode())!==null&&p.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(let b of i.getAttributeNames())if(b.endsWith(Cd)){let $=v[l++],y=i.getAttribute(b).split(kt),M=/([.?@])?(.*)/.exec($);p.push({type:1,index:r,name:M[2],strings:y,ctor:M[1]==="."?dl:M[1]==="?"?hl:M[1]==="@"?pl:Ti}),i.removeAttribute(b)}else b.startsWith(kt)&&(p.push({type:6,index:r}),i.removeAttribute(b));if(au.test(i.tagName)){let b=i.textContent.split(kt),$=b.length-1;if($>0){i.textContent=ll?ll.emptyScript:"";for(let y=0;y<$;y++)i.append(b[y],Ka()),ki.nextNode(),p.push({type:2,index:++r});i.append(b[$],Ka())}}}else if(i.nodeType===8)if(i.data===_d)p.push({type:2,index:r});else{let b=-1;for(;(b=i.data.indexOf(kt,b+1))!==-1;)p.push({type:7,index:r}),b+=kt.length-1}r++}}static createElement(n,e){let t=Ei.createElement("template");return t.innerHTML=n,t}};function Mi(o,n,e=o,t){if(n===ge)return n;let i=t!==void 0?e._$Co?.[t]:e._$Cl,r=Wa(n)?void 0:n._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(o),i._$AT(o,e,t)),t!==void 0?(e._$Co??=[])[t]=i:e._$Cl=i),i!==void 0&&(n=Mi(o,i._$AS(o,n.values),i,t)),n}var cl=class{constructor(n,e){this._$AV=[],this._$AN=void 0,this._$AD=n,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(n){let{el:{content:e},parts:t}=this._$AD,i=(n?.creationScope??Ei).importNode(e,!0);ki.currentNode=i;let r=ki.nextNode(),l=0,d=0,p=t[0];for(;p!==void 0;){if(l===p.index){let m;p.type===2?m=new ms(r,r.nextSibling,this,n):p.type===1?m=new p.ctor(r,p.name,p.strings,this,n):p.type===6&&(m=new ul(r,this,n)),this._$AV.push(m),p=t[++d]}l!==p?.index&&(r=ki.nextNode(),l++)}return ki.currentNode=Ei,i}p(n){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(n,t,e),e+=t.strings.length-2):t._$AI(n[e])),e++}},ms=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(n,e,t,i){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=n,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let n=this._$AA.parentNode,e=this._$AM;return e!==void 0&&n?.nodeType===11&&(n=e.parentNode),n}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(n,e=this){n=Mi(this,n,e),Wa(n)?n===h||n==null||n===""?(this._$AH!==h&&this._$AR(),this._$AH=h):n!==this._$AH&&n!==ge&&this._(n):n._$litType$!==void 0?this.$(n):n.nodeType!==void 0?this.T(n):ru(n)?this.k(n):this._(n)}O(n){return this._$AA.parentNode.insertBefore(n,this._$AB)}T(n){this._$AH!==n&&(this._$AR(),this._$AH=this.O(n))}_(n){this._$AH!==h&&Wa(this._$AH)?this._$AA.nextSibling.data=n:this.T(Ei.createTextNode(n)),this._$AH=n}$(n){let{values:e,_$litType$:t}=n,i=typeof t=="number"?this._$AC(n):(t.el===void 0&&(t.el=Ya.createElement(nu(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let r=new cl(i,this),l=r.u(this.options);r.p(e),this.T(l),this._$AH=r}}_$AC(n){let e=su.get(n.strings);return e===void 0&&su.set(n.strings,e=new Ya(n)),e}k(n){Ld(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let r of n)i===e.length?e.push(t=new o(this.O(Ka()),this.O(Ka()),this,this.options)):t=e[i],t._$AI(r),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(n=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);n!==this._$AB;){let t=Jp(n).nextSibling;Jp(n).remove(),n=t}}setConnected(n){this._$AM===void 0&&(this._$Cv=n,this._$AP?.(n))}},Ti=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,e,t,i,r){this.type=1,this._$AH=h,this._$AN=void 0,this.element=n,this.name=e,this._$AM=i,this.options=r,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=h}_$AI(n,e=this,t,i){let r=this.strings,l=!1;if(r===void 0)n=Mi(this,n,e,0),l=!Wa(n)||n!==this._$AH&&n!==ge,l&&(this._$AH=n);else{let d=n,p,m;for(n=r[0],p=0;p<r.length-1;p++)m=Mi(this,d[t+p],e,p),m===ge&&(m=this._$AH[p]),l||=!Wa(m)||m!==this._$AH[p],m===h?n=h:n!==h&&(n+=(m??"")+r[p+1]),this._$AH[p]=m}l&&!i&&this.j(n)}j(n){n===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}},dl=class extends Ti{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===h?void 0:n}},hl=class extends Ti{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==h)}},pl=class extends Ti{constructor(n,e,t,i,r){super(n,e,t,i,r),this.type=5}_$AI(n,e=this){if((n=Mi(this,n,e,0)??h)===ge)return;let t=this._$AH,i=n===h&&t!==h||n.capture!==t.capture||n.once!==t.once||n.passive!==t.passive,r=n!==h&&(t===h||i);i&&this.element.removeEventListener(this.name,this,t),r&&this.element.addEventListener(this.name,this,n),this._$AH=n}handleEvent(n){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,n):this._$AH.handleEvent(n)}},ul=class{constructor(n,e,t){this.element=n,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(n){Mi(this,n)}},lu={M:Cd,P:kt,A:_d,C:1,L:ou,R:cl,D:ru,V:Mi,I:ms,H:Ti,N:hl,U:pl,B:dl,F:ul},bg=Td.litHtmlPolyfillSupport;bg?.(Ya,ms),(Td.litHtmlVersions??=[]).push("3.3.3");var cu=(o,n,e)=>{let t=e?.renderBefore??n,i=t._$litPart$;if(i===void 0){let r=e?.renderBefore??null;t._$litPart$=i=new ms(n.insertBefore(Ka(),r),r,void 0,e??{})}return i._$AI(o),i};var zd=globalThis,L=class extends $t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let n=super.createRenderRoot();return this.renderOptions.renderBefore??=n.firstChild,n}update(n){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(n),this._$Do=cu(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ge}};L._$litElement$=!0,L.finalized=!0,zd.litElementHydrateSupport?.({LitElement:L});var vg=zd.litElementPolyfillSupport;vg?.({LitElement:L});(zd.litElementVersions??=[]).push("4.2.2");var E=x`
4
4
  :host {
5
5
  font-family: var(--cm-font-sans, 'Poppins', system-ui, sans-serif);
6
6
  color: var(--cm-text-default, #000);
@@ -8,20 +8,20 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
8
8
  }
9
9
  :host([hidden]) { display: none !important; }
10
10
  *, *::before, *::after { box-sizing: inherit; }
11
- `,_m=b`
11
+ `,Eb=x`
12
12
  outline: 2px solid var(--cm-border-strong);
13
13
  outline-offset: 2px;
14
- `,Cu=0,L=n=>`${n}-${++Cu}`;function g(n,r){customElements.get(n)||customElements.define(n,r)}function ne(n,r){let e=n.key;return(e==="ArrowLeft"||e==="ArrowRight")&&getComputedStyle(r).direction==="rtl"?e==="ArrowLeft"?"ArrowRight":"ArrowLeft":e}var zu={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},Fn={common:{...zu}},Wr={},Xr={},Vn;function M(n,r){return Fn[n]={...Fn[n],...r},r}function Lu(){return Object.fromEntries(Object.entries(Fn).map(([n,r])=>[n,{...r}]))}function Un(n,r){for(let[e,t]of Object.entries(r??{}))t&&typeof t=="object"&&(n[e]={...n[e],...t})}function Su(n,r){Un(r?Xr[r.toLowerCase()]??={}:Wr,n),Gn()}function Au(n={}){"locale"in n&&(Vn=n.locale||void 0),n.strings&&Un(Wr,n.strings);for(let[r,e]of Object.entries(n.translations??{}))Un(Xr[r.toLowerCase()]??={},e);Gn()}function Du(){Vn=void 0;for(let n of Object.keys(Wr))delete Wr[n];for(let n of Object.keys(Xr))delete Xr[n];Gn()}function Jr(n){if(Vn)return Vn;let r=n;for(;r;){if(r instanceof Element&&r.hasAttribute("lang")&&r.getAttribute("lang"))return r.getAttribute("lang");r=r.parentNode??(r instanceof ShadowRoot?r.host:null)}if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang}var ih=new Map;function Ql(n,r,e,t){let i=`${n}|${r??""}|${JSON.stringify(e)}`,a=ih.get(i);if(!a){try{a=t(r)}catch{a=t(void 0)}ih.set(i,a)}return a}function ec(n,r={},e){return Ql("n",e,r,t=>new Intl.NumberFormat(t,r)).format(n)}function Z(n,r={},e){return Ql("d",e,r,t=>new Intl.DateTimeFormat(t,r)).format(n)}function Kn(n,r){return Ql("p",r,{},e=>new Intl.PluralRules(e)).select(n)}function sh(n,r={},e){if(n==null)return"";if(typeof n=="function")return String(n(r));let t;if(typeof n=="object"){let i=Number(r.count??0);t=n[Kn(i,e)]??n.other??""}else t=String(n);return t.replace(/\{(\w+)\}/g,(i,a)=>{let c=r[a];return c===void 0?i:typeof c=="number"?ec(c,{},e):String(c)})}function Nu(n,r,e,t){if(t&&t[r]!==void 0)return t[r];let i=[];if(e){let a=e.toLowerCase().split("-");for(let c=a.length;c>0;c--)i.push(a.slice(0,c).join("-"))}for(let a of n==="common"?["common"]:[n,"common"]){for(let h of i){let u=Xr[h]?.[a]?.[r];if(u!==void 0)return u}let c=Wr[a]?.[r]??Fn[a]?.[r];if(c!==void 0)return c}}function rh(n,r,e,t,i){let a=Jr(t);return sh(Nu(n,r,a,i),e,a)}var Zl=new Set,Jl;function Gn(){for(let n of Zl)n.requestUpdate()}function Ru(){Jl||typeof MutationObserver>"u"||typeof document>"u"||(Jl=new MutationObserver(Gn),Jl.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}))}var Hu=n=>n.replace(/^cm-/,"").replace(/-([a-z])/g,(r,e)=>e.toUpperCase()),k=class extends _{static finalize(){let r=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);if(!r(this,"finalized")&&r(this,"properties"))for(let[e,t]of Object.entries(this.properties)){let i=t.string;if(!i||r(this.prototype,e))continue;let a=Symbol(e);Object.defineProperty(this.prototype,e,{get(){return this[a]??this.t(i)},set(c){this[a]=c},configurable:!0,enumerable:!0})}super.finalize()}get stringsNamespace(){return Hu(this.localName)}t(r,e){return rh(this.stringsNamespace,r,e,this,this.strings)}get locale(){return Jr(this)}formatNumber(r,e){return ec(r,e,this.locale)}connectedCallback(){super.connectedCallback(),Zl.add(this),Ru()}disconnectedCallback(){super.disconnectedCallback(),Zl.delete(this)}};k.properties={strings:{type:Object}};var Yn={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M6 15l6-6 6 6","chevron-right":"M9 6l6 6-6 6","chevron-left":"M15 6l-6 6 6 6",close:"M6 6l12 12M18 6L6 18",search:"M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14zM16 16l4 4",filter:"M4 7h16M7 12h10M10 17h4",edit:"M4 20h4L19 9l-4-4L4 16v4zM14 6l4 4",trash:"M5 7h14M10 7V5h4v2M7 7l1 13h8l1-13M10 11v6M14 11v6","arrow-up-right":"M7 17L17 7M9 7h8v8",calendar:"M5 6h14v14H5zM5 10h14M9 4v4M15 4v4",upload:"M12 16V6M8 10l4-4 4 4M5 18h14",plus:"M12 5v14M5 12h14",check:"M5 12.5l4.5 4.5L19 7",bell:"M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15zM10 20h4",help:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6M12 17h.01",rocket:"M14 4c3 0 6 3 6 6l-6 6-6-6c0-3 3-6 6-6zM8 16l-3 3M10 18l-2 3M6 14l-3 2",home:"M4 11l8-7 8 7v9h-5v-6H9v6H4z",box:"M4 8l8-4 8 4v8l-8 4-8-4zM4 8l8 4 8-4M12 12v8",cart:"M5 8h14l-1 12H6zM9 8V6a3 3 0 0 1 6 0v2",more:"M6 12h.01M12 12h.01M18 12h.01",drag:"M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01","eye-off":"M3 3l18 18M10.6 6.1A9 9 0 0 1 21 12a14 14 0 0 1-2.2 2.9M6.6 6.6A14 14 0 0 0 3 12s3 6 9 6a8 8 0 0 0 4-1",external:"M14 5h5v5M19 5l-8 8M18 14v5H5V6h5",users:"M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 21v-1a7 7 0 0 1 14 0v1M17 11a3 3 0 1 0 0-6M22 21v-1a5 5 0 0 0-4-5",chart:"M5 20V10M12 20V4M19 20v-7",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM4 12h2M18 12h2M12 4v2M12 18v2M6.3 6.3l1.4 1.4M16.3 16.3l1.4 1.4M6.3 17.7l1.4-1.4M16.3 7.7l1.4-1.4",store:"M4 9l1-5h14l1 5M4 9h16v11H4zM9 20v-6h6v6",pin:"M15 4l5 5-3 1-4 4 1 4-2 2-4-4-4 4M8 12l4-4 1-3",clock:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM12 7v5l3 2",alert:"M12 4l9 16H3zM12 10v4M12 17h.01","check-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM8 12l3 3 5-6","x-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9 9l6 6M15 9l-6 6",bag:"M6 8h12l1 12H5zM9 8a3 3 0 0 1 6 0",sun:"M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2.5v2M12 19.5v2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M2.5 12h2M19.5 12h2M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4",moon:"M19.5 14.5A8 8 0 0 1 9.5 4.5a8 8 0 1 0 10 10z",menu:"M4 7h16M4 12h16M4 17h16",copy:"M9 9h11v11H9zM5 15H4V4h11v1",code:"M8 8l-4 4 4 4M16 8l4 4-4 4M14 5l-4 14",download:"M12 4v11M7.5 10.5L12 15l4.5-4.5M5 19h14",book:"M5 5a2 2 0 0 1 2-2h12v15H7a2 2 0 0 0-2 2zM5 20a2 2 0 0 0 2 2h12v-4",pos:"M5 4h14v8H5zM3 16h18v4H3zM8 8h4M12 12v4",website:"M3 5h18v14H3zM3 9h18M9 13h6M9 16h4",apps:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z",megaphone:"M4 10v4h3l8 5V5l-8 5zM18.5 9a4 4 0 0 1 0 6M7 14l1 5h3l-1-4",staff:"M5 4h14v17H5zM9 4V2h6v2M12 13a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM8 18a4 4 0 0 1 8 0",repeat:"M17 3l3 3-3 3M4 11V9a3 3 0 0 1 3-3h13M7 21l-3-3 3-3M20 13v2a3 3 0 0 1-3 3H4",wallet:"M4 6h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4zM4 6V5a1 1 0 0 1 1-1h11v2M15 13h2",user:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0",star:"M12 3l2.8 5.7 6.2.9-4.5 4.4 1 6.2-5.5-2.9-5.5 2.9 1-6.2L3 9.6l6.2-.9z",percent:"M19 5L5 19M7 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM17 19a2 2 0 1 0 0-4 2 2 0 0 0 0 4z","arrow-left":"M19 12H5M11 6l-6 6 6 6",send:"M21 3L10 14M21 3l-7 18-4-7-7-4z",link:"M10 14a4 4 0 0 0 6 0l3-3a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6 0l-3 3a4 4 0 0 0 6 6l1-1",share:"M18 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 22a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM8.6 13.5l6.8 4M15.4 6.5l-6.8 4",globe:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18",gift:"M4 11h16v9H4zM3 7h18v4H3zM12 7v13M12 7c-2 0-4-1-4-3s3-1 4 3c1-4 4-5 4-3s-2 3-4 3",mail:"M3 6h18v12H3zM3 6l9 7 9-7",chat:"M4 5h16v11h-9l-4 4v-4H4zM8 9.5h8M8 12.5h5",tag:"M4 4h7l9 9-7 7-9-9zM8.5 10a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z",building:"M3 21h18M5 21V4h9v17M14 10h5v11M8 8h3M8 12h3M8 16h3",map:"M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2zM9 4v14M15 6v14",note:"M6 3h8l4 4v14H6zM14 3v4h4M9 12h6M9 15h6M9 18h4",eye:"M3 12s3-6 9-6 9 6 9 6-3 6-9 6-9-6-9-6zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",inbox:"M3 13l3-8h12l3 8v6H3zM3 13h5l1 3h6l1-3h5",handshake:"M3 7v8M21 7v8M3 9l5-3h4l-3 3.5a1.5 1.5 0 0 0 2.2 2L13 9.5l5 5M21 9l-4-3h-5M3 15h2l5 4a1.4 1.4 0 0 0 2-2M10 15l3.5 3a1.4 1.4 0 0 0 2-2l-1.5-1.5","log-out":"M10 4H5v16h5M14 8l4 4-4 4M18 12H9",refresh:"M20 12a8 8 0 0 0-14.9-4M4 12a8 8 0 0 0 14.9 4M5 3.5V8h4.5M19 20.5V16h-4.5",tasks:"M5 5h14v14H5zM8.5 12l2.5 2.5 4.5-5",phone:"M5 4h3.5l1.5 4.5-2 1.5a11 11 0 0 0 6 6l1.5-2 4.5 1.5V19a1.5 1.5 0 0 1-1.5 1.5A15.5 15.5 0 0 1 3.5 5.5 1.5 1.5 0 0 1 5 4z",camera:"M3 8.5A1.5 1.5 0 0 1 4.5 7h3L9 4.5h6L16.5 7h3A1.5 1.5 0 0 1 21 8.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5zM12 16.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z",image:"M4 5h16v14H4zM4 16l4.5-4.5 4 4 2.5-2.5 5 5M15.5 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z","id-card":"M3 6h18v12H3zM8.5 11.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5zM5.5 16a3 3 0 0 1 6 0M14 9.5h4M14 12.5h4M14 15.5h2.5",navigation:"M20 4l-6.5 16-2.5-7-7-2.5z","wifi-off":"M8.9 16.9a4 4 0 0 1 3.3-1.4M5.9 14.4a8 8 0 0 1 3-2.3M15.6 12.4a8 8 0 0 1 2.5 2M2.8 11.8a12 12 0 0 1 3-2.6M10.8 7.6a12 12 0 0 1 10.4 4.2M12 19.5h.01M3 3l18 18"},ah=["more","drag"],Sm=Object.keys(Yn);var nh=["chevron-left","chevron-right","arrow-left","arrow-up-right","send","log-out"],zi=class extends _{constructor(){super(...arguments);this.name="more";this.size=18;this.label="";this.mirror="auto"}render(){let e=Yn[this.name]??Yn.more,t=ah.includes(this.name)?3:1.6;return Yr`<svg width=${this.size} height=${this.size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
14
+ `,xg=0,D=o=>`${o}-${++xg}`;function w(o,n){customElements.get(o)||customElements.define(o,n)}function re(o,n){let e=o.key;return(e==="ArrowLeft"||e==="ArrowRight")&&getComputedStyle(n).direction==="rtl"?e==="ArrowLeft"?"ArrowRight":"ArrowLeft":e}var yg={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},ml={common:{...yg}},Xa={},Ja={},fl;function C(o,n){return ml[o]={...ml[o],...n},n}function wg(){return Object.fromEntries(Object.entries(ml).map(([o,n])=>[o,{...n}]))}function gl(o,n){for(let[e,t]of Object.entries(n??{}))t&&typeof t=="object"&&(o[e]={...o[e],...t})}function $g(o,n){gl(n?Ja[n.toLowerCase()]??={}:Xa,o),vl()}function kg(o={}){"locale"in o&&(fl=o.locale||void 0),o.strings&&gl(Xa,o.strings);for(let[n,e]of Object.entries(o.translations??{}))gl(Ja[n.toLowerCase()]??={},e);vl()}function Eg(){fl=void 0;for(let o of Object.keys(Xa))delete Xa[o];for(let o of Object.keys(Ja))delete Ja[o];vl()}function Za(o){if(fl)return fl;let n=o;for(;n;){if(n instanceof Element&&n.hasAttribute("lang")&&n.getAttribute("lang"))return n.getAttribute("lang");n=n.parentNode??(n instanceof ShadowRoot?n.host:null)}if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang}var du=new Map;function Nd(o,n,e,t){let i=`${o}|${n??""}|${JSON.stringify(e)}`,r=du.get(i);if(!r){try{r=t(n)}catch{r=t(void 0)}du.set(i,r)}return r}function Rd(o,n={},e){return Nd("n",e,n,t=>new Intl.NumberFormat(t,n)).format(o)}function ee(o,n={},e){return Nd("d",e,n,t=>new Intl.DateTimeFormat(t,n)).format(o)}function bl(o,n){return Nd("p",n,{},e=>new Intl.PluralRules(e)).select(o)}function hu(o,n={},e){if(o==null)return"";if(typeof o=="function")return String(o(n));let t;if(typeof o=="object"){let i=Number(n.count??0);t=o[bl(i,e)]??o.other??""}else t=String(o);return t.replace(/\{(\w+)\}/g,(i,r)=>{let l=n[r];return l===void 0?i:typeof l=="number"?Rd(l,{},e):String(l)})}function Mg(o,n,e,t){if(t&&t[n]!==void 0)return t[n];let i=[];if(e){let r=e.toLowerCase().split("-");for(let l=r.length;l>0;l--)i.push(r.slice(0,l).join("-"))}for(let r of o==="common"?["common"]:[o,"common"]){for(let d of i){let p=Ja[d]?.[r]?.[n];if(p!==void 0)return p}let l=Xa[r]?.[n]??ml[r]?.[n];if(l!==void 0)return l}}function pu(o,n,e,t,i){let r=Za(t);return hu(Mg(o,n,r,i),e,r)}var Ad=new Set,Dd;function vl(){for(let o of Ad)o.requestUpdate()}function Tg(){Dd||typeof MutationObserver>"u"||typeof document>"u"||(Dd=new MutationObserver(vl),Dd.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}))}var Cg=o=>o.replace(/^cm-/,"").replace(/-([a-z])/g,(n,e)=>e.toUpperCase()),T=class extends L{static finalize(){let n=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);if(!n(this,"finalized")&&n(this,"properties"))for(let[e,t]of Object.entries(this.properties)){let i=t.string;if(!i||n(this.prototype,e))continue;let r=Symbol(e);Object.defineProperty(this.prototype,e,{get(){return this[r]??this.t(i)},set(l){this[r]=l},configurable:!0,enumerable:!0})}super.finalize()}get stringsNamespace(){return Cg(this.localName)}t(n,e){return pu(this.stringsNamespace,n,e,this,this.strings)}get locale(){return Za(this)}formatNumber(n,e){return Rd(n,e,this.locale)}connectedCallback(){super.connectedCallback(),Ad.add(this),Tg()}disconnectedCallback(){super.disconnectedCallback(),Ad.delete(this)}};T.properties={strings:{type:Object}};var xl={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M6 15l6-6 6 6","chevron-right":"M9 6l6 6-6 6","chevron-left":"M15 6l-6 6 6 6",close:"M6 6l12 12M18 6L6 18",search:"M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14zM16 16l4 4",filter:"M4 7h16M7 12h10M10 17h4",edit:"M4 20h4L19 9l-4-4L4 16v4zM14 6l4 4",trash:"M5 7h14M10 7V5h4v2M7 7l1 13h8l1-13M10 11v6M14 11v6","arrow-up-right":"M7 17L17 7M9 7h8v8",calendar:"M5 6h14v14H5zM5 10h14M9 4v4M15 4v4",upload:"M12 16V6M8 10l4-4 4 4M5 18h14",plus:"M12 5v14M5 12h14",check:"M5 12.5l4.5 4.5L19 7",bell:"M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15zM10 20h4",help:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6M12 17h.01",rocket:"M14 4c3 0 6 3 6 6l-6 6-6-6c0-3 3-6 6-6zM8 16l-3 3M10 18l-2 3M6 14l-3 2",home:"M4 11l8-7 8 7v9h-5v-6H9v6H4z",box:"M4 8l8-4 8 4v8l-8 4-8-4zM4 8l8 4 8-4M12 12v8",cart:"M5 8h14l-1 12H6zM9 8V6a3 3 0 0 1 6 0v2",more:"M6 12h.01M12 12h.01M18 12h.01",drag:"M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01","eye-off":"M3 3l18 18M10.6 6.1A9 9 0 0 1 21 12a14 14 0 0 1-2.2 2.9M6.6 6.6A14 14 0 0 0 3 12s3 6 9 6a8 8 0 0 0 4-1",external:"M14 5h5v5M19 5l-8 8M18 14v5H5V6h5",users:"M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 21v-1a7 7 0 0 1 14 0v1M17 11a3 3 0 1 0 0-6M22 21v-1a5 5 0 0 0-4-5",chart:"M5 20V10M12 20V4M19 20v-7",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM4 12h2M18 12h2M12 4v2M12 18v2M6.3 6.3l1.4 1.4M16.3 16.3l1.4 1.4M6.3 17.7l1.4-1.4M16.3 7.7l1.4-1.4",store:"M4 9l1-5h14l1 5M4 9h16v11H4zM9 20v-6h6v6",pin:"M15 4l5 5-3 1-4 4 1 4-2 2-4-4-4 4M8 12l4-4 1-3",clock:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM12 7v5l3 2",alert:"M12 4l9 16H3zM12 10v4M12 17h.01","check-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM8 12l3 3 5-6","x-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9 9l6 6M15 9l-6 6",bag:"M6 8h12l1 12H5zM9 8a3 3 0 0 1 6 0",sun:"M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2.5v2M12 19.5v2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M2.5 12h2M19.5 12h2M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4",moon:"M19.5 14.5A8 8 0 0 1 9.5 4.5a8 8 0 1 0 10 10z",menu:"M4 7h16M4 12h16M4 17h16",copy:"M9 9h11v11H9zM5 15H4V4h11v1",code:"M8 8l-4 4 4 4M16 8l4 4-4 4M14 5l-4 14",download:"M12 4v11M7.5 10.5L12 15l4.5-4.5M5 19h14",book:"M5 5a2 2 0 0 1 2-2h12v15H7a2 2 0 0 0-2 2zM5 20a2 2 0 0 0 2 2h12v-4",pos:"M5 4h14v8H5zM3 16h18v4H3zM8 8h4M12 12v4",website:"M3 5h18v14H3zM3 9h18M9 13h6M9 16h4",apps:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z",megaphone:"M4 10v4h3l8 5V5l-8 5zM18.5 9a4 4 0 0 1 0 6M7 14l1 5h3l-1-4",staff:"M5 4h14v17H5zM9 4V2h6v2M12 13a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM8 18a4 4 0 0 1 8 0",repeat:"M17 3l3 3-3 3M4 11V9a3 3 0 0 1 3-3h13M7 21l-3-3 3-3M20 13v2a3 3 0 0 1-3 3H4",wallet:"M4 6h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4zM4 6V5a1 1 0 0 1 1-1h11v2M15 13h2",user:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0",star:"M12 3l2.8 5.7 6.2.9-4.5 4.4 1 6.2-5.5-2.9-5.5 2.9 1-6.2L3 9.6l6.2-.9z",percent:"M19 5L5 19M7 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM17 19a2 2 0 1 0 0-4 2 2 0 0 0 0 4z","arrow-left":"M19 12H5M11 6l-6 6 6 6",send:"M21 3L10 14M21 3l-7 18-4-7-7-4z",link:"M10 14a4 4 0 0 0 6 0l3-3a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6 0l-3 3a4 4 0 0 0 6 6l1-1",share:"M18 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 22a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM8.6 13.5l6.8 4M15.4 6.5l-6.8 4",globe:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18",gift:"M4 11h16v9H4zM3 7h18v4H3zM12 7v13M12 7c-2 0-4-1-4-3s3-1 4 3c1-4 4-5 4-3s-2 3-4 3",mail:"M3 6h18v12H3zM3 6l9 7 9-7",chat:"M4 5h16v11h-9l-4 4v-4H4zM8 9.5h8M8 12.5h5",tag:"M4 4h7l9 9-7 7-9-9zM8.5 10a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z",building:"M3 21h18M5 21V4h9v17M14 10h5v11M8 8h3M8 12h3M8 16h3",map:"M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2zM9 4v14M15 6v14",note:"M6 3h8l4 4v14H6zM14 3v4h4M9 12h6M9 15h6M9 18h4",eye:"M3 12s3-6 9-6 9 6 9 6-3 6-9 6-9-6-9-6zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",inbox:"M3 13l3-8h12l3 8v6H3zM3 13h5l1 3h6l1-3h5",handshake:"M3 7v8M21 7v8M3 9l5-3h4l-3 3.5a1.5 1.5 0 0 0 2.2 2L13 9.5l5 5M21 9l-4-3h-5M3 15h2l5 4a1.4 1.4 0 0 0 2-2M10 15l3.5 3a1.4 1.4 0 0 0 2-2l-1.5-1.5","log-out":"M10 4H5v16h5M14 8l4 4-4 4M18 12H9",refresh:"M20 12a8 8 0 0 0-14.9-4M4 12a8 8 0 0 0 14.9 4M5 3.5V8h4.5M19 20.5V16h-4.5",tasks:"M5 5h14v14H5zM8.5 12l2.5 2.5 4.5-5",phone:"M5 4h3.5l1.5 4.5-2 1.5a11 11 0 0 0 6 6l1.5-2 4.5 1.5V19a1.5 1.5 0 0 1-1.5 1.5A15.5 15.5 0 0 1 3.5 5.5 1.5 1.5 0 0 1 5 4z",camera:"M3 8.5A1.5 1.5 0 0 1 4.5 7h3L9 4.5h6L16.5 7h3A1.5 1.5 0 0 1 21 8.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5zM12 16.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z",image:"M4 5h16v14H4zM4 16l4.5-4.5 4 4 2.5-2.5 5 5M15.5 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z","id-card":"M3 6h18v12H3zM8.5 11.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5zM5.5 16a3 3 0 0 1 6 0M14 9.5h4M14 12.5h4M14 15.5h2.5",navigation:"M20 4l-6.5 16-2.5-7-7-2.5z","wifi-off":"M8.9 16.9a4 4 0 0 1 3.3-1.4M5.9 14.4a8 8 0 0 1 3-2.3M15.6 12.4a8 8 0 0 1 2.5 2M2.8 11.8a12 12 0 0 1 3-2.6M10.8 7.6a12 12 0 0 1 10.4 4.2M12 19.5h.01M3 3l18 18"},uu=["more","drag"],_b=Object.keys(xl);var mu=["chevron-left","chevron-right","arrow-left","arrow-up-right","send","log-out"],fs=class extends L{constructor(){super(...arguments);this.name="more";this.size=18;this.label="";this.mirror="auto"}render(){let e=xl[this.name]??xl.more,t=uu.includes(this.name)?3:1.6;return Ga`<svg width=${this.size} height=${this.size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
15
15
  stroke-width=${t} stroke-linecap="round" stroke-linejoin="round"
16
- role=${this.label?"img":d} aria-label=${this.label||d} aria-hidden=${this.label?d:"true"}
17
- part="svg" class=${(this.mirror==="auto"?nh.includes(this.name):this.mirror==="always")?"flip":""}><path d=${e}></path></svg>`}};zi.properties={name:{reflect:!0},size:{type:Number},label:{},mirror:{}},zi.styles=b`
16
+ role=${this.label?"img":h} aria-label=${this.label||h} aria-hidden=${this.label?h:"true"}
17
+ part="svg" class=${(this.mirror==="auto"?mu.includes(this.name):this.mirror==="always")?"flip":""}><path d=${e}></path></svg>`}};fs.properties={name:{reflect:!0},size:{type:Number},label:{},mirror:{}},fs.styles=x`
18
18
  :host { display: inline-flex; flex: none; color: inherit; line-height: 0; }
19
19
  svg { display: block; }
20
20
  :host(:dir(rtl)) svg.flip { transform: scaleX(-1); }
21
- `;g("cm-icon",zi);var oh=99,Pm=M("button",{labelWithCount:"{label}, {count} unread",count:"{count} unread",countOverflow:"{max}+"}),Wn,Xn,Zr,Ut=class extends k{constructor(){super();this.variant="secondary";this.size="medium";this.type="button";this.disabled=!1;this.loading=!1;this.iconOnly=!1;this.icon="";this.label="";this.count=0;p(this,Wn,this.attachInternals());p(this,Xn,e=>{if(this.disabled||this.loading){e.preventDefault(),e.stopImmediatePropagation();return}let t=s(this,Wn).form;!t||this.href||(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())});p(this,Zr,!1);this.addEventListener("click",s(this,Xn),{capture:!0})}updated(){this.iconOnly&&!this.label&&!this.textContent?.trim()&&!this.querySelector("[label]")&&!s(this,Zr)&&(f(this,Zr,!0),console.warn("cm-button: an icon-only button needs a `label` (its accessible name).",this))}render(){let e=Number.isFinite(this.count)&&this.count>0?Math.floor(this.count):0,t=this.size==="large"?20:16,i=this.loading?l`<span class="spinner" aria-hidden="true"></span>`:l`<slot name="icon">${this.icon?l`<cm-icon name=${this.icon} size=${t}></cm-icon>`:d}</slot>`,a=this.iconOnly?l`<span class="vh"><slot></slot></span>`:l`<slot></slot>`,c=e?l`<span class="count" part="count" aria-hidden="true">${e>oh?this.t("countOverflow",{max:oh}):this.formatNumber(e)}</span>${this.iconOnly?d:l`<span class="vh"> ${this.t("count",{count:e})}</span>`}`:d,h=this.iconOnly&&(this.label||this.textContent?.trim())||"",u=!this.iconOnly||!h?d:e?this.t("labelWithCount",{label:h,count:e}):this.label||d,m=l`${i}${a}${c}`;return this.href&&!this.disabled?l`<a class="btn" part="control" href=${this.href} target=${this.target??d}
22
- rel=${this.target==="_blank"?"noopener noreferrer":d} aria-label=${u}>${m}</a>`:l`<button class="btn" part="control" type="button"
23
- ?disabled=${this.disabled} aria-disabled=${this.loading?"true":d}
24
- aria-busy=${this.loading?"true":d} aria-label=${u}>${m}</button>`}};Wn=new WeakMap,Xn=new WeakMap,Zr=new WeakMap,Ut.formAssociated=!0,Ut.properties={variant:{reflect:!0},size:{reflect:!0},type:{},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},href:{},target:{},iconOnly:{type:Boolean,reflect:!0,attribute:"icon-only"},icon:{},label:{},count:{type:Number},tone:{reflect:!0}},Ut.styles=[w,b`
21
+ `;w("cm-icon",fs);var fu=99,Ib=C("button",{labelWithCount:"{label}, {count} unread",count:"{count} unread",countOverflow:"{max}+"}),yl,wl,Qa,Ci=class extends T{constructor(){super();this.variant="secondary";this.size="medium";this.type="button";this.disabled=!1;this.loading=!1;this.iconOnly=!1;this.icon="";this.label="";this.count=0;u(this,yl,this.attachInternals());u(this,wl,e=>{if(this.disabled||this.loading){e.preventDefault(),e.stopImmediatePropagation();return}let t=s(this,yl).form;!t||this.href||(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())});u(this,Qa,!1);this.addEventListener("click",s(this,wl),{capture:!0})}updated(){this.iconOnly&&!this.label&&!this.textContent?.trim()&&!this.querySelector("[label]")&&!s(this,Qa)&&(g(this,Qa,!0),console.warn("cm-button: an icon-only button needs a `label` (its accessible name).",this))}render(){let e=Number.isFinite(this.count)&&this.count>0?Math.floor(this.count):0,t=this.size==="large"?20:16,i=this.loading?c`<span class="spinner" aria-hidden="true"></span>`:c`<slot name="icon">${this.icon?c`<cm-icon name=${this.icon} size=${t}></cm-icon>`:h}</slot>`,r=this.iconOnly?c`<span class="vh"><slot></slot></span>`:c`<slot></slot>`,l=e?c`<span class="count" part="count" aria-hidden="true">${e>fu?this.t("countOverflow",{max:fu}):this.formatNumber(e)}</span>${this.iconOnly?h:c`<span class="vh"> ${this.t("count",{count:e})}</span>`}`:h,d=this.iconOnly&&(this.label||this.textContent?.trim())||"",p=!this.iconOnly||!d?h:e?this.t("labelWithCount",{label:d,count:e}):this.label||h,m=c`${i}${r}${l}`;return this.href&&!this.disabled?c`<a class="btn" part="control" href=${this.href} target=${this.target??h}
22
+ rel=${this.target==="_blank"?"noopener noreferrer":h} aria-label=${p}>${m}</a>`:c`<button class="btn" part="control" type="button"
23
+ ?disabled=${this.disabled} aria-disabled=${this.loading?"true":h}
24
+ aria-busy=${this.loading?"true":h} aria-label=${p}>${m}</button>`}};yl=new WeakMap,wl=new WeakMap,Qa=new WeakMap,Ci.formAssociated=!0,Ci.properties={variant:{reflect:!0},size:{reflect:!0},type:{},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},href:{},target:{},iconOnly:{type:Boolean,reflect:!0,attribute:"icon-only"},icon:{},label:{},count:{type:Number},tone:{reflect:!0}},Ci.styles=[E,x`
25
25
  :host { display: inline-flex; vertical-align: middle; }
26
26
  .btn {
27
27
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
@@ -92,22 +92,22 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
92
92
  position: absolute; inset-block-start: -7px; inset-inline-end: -7px;
93
93
  box-shadow: 0 0 0 2px var(--cm-bg-surface); pointer-events: none;
94
94
  }
95
- `];g("cm-button",Ut);var Re={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Li=n=>(...r)=>({_$litDirective$:n,values:r}),ut=class{constructor(r){}get _$AU(){return this._$AM._$AU}_$AT(r,e,t){this._$Ct=r,this._$AM=e,this._$Ci=t}_$AS(r,e){return this.update(r,e)}update(r,e){return this.render(...e)}};var{I:Iu}=eh,lh=n=>n;var dh=n=>n.strings===void 0,ch=()=>document.createComment(""),Si=(n,r,e)=>{let t=n._$AA.parentNode,i=r===void 0?n._$AB:r._$AA;if(e===void 0){let a=t.insertBefore(ch(),i),c=t.insertBefore(ch(),i);e=new Iu(a,c,n,n.options)}else{let a=e._$AB.nextSibling,c=e._$AM,h=c!==n;if(h){let u;e._$AQ?.(n),e._$AM=n,e._$AP!==void 0&&(u=n._$AU)!==c._$AU&&e._$AP(u)}if(a!==i||h){let u=e._$AA;for(;u!==a;){let m=lh(u).nextSibling;lh(t).insertBefore(u,i),u=m}}}return e},mt=(n,r,e=n)=>(n._$AI(r,e),n),Ou={},Jn=(n,r=Ou)=>n._$AH=r,hh=n=>n._$AH,Zn=n=>{n._$AR(),n._$AA.remove()};var se=Li(class extends ut{constructor(n){if(super(n),n.type!==Re.PROPERTY&&n.type!==Re.ATTRIBUTE&&n.type!==Re.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!dh(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[r]){if(r===ae||r===d)return r;let e=n.element,t=n.name;if(n.type===Re.PROPERTY){if(r===e[t])return ae}else if(n.type===Re.BOOLEAN_ATTRIBUTE){if(!!r===e.hasAttribute(t))return ae}else if(n.type===Re.ATTRIBUTE&&e.getAttribute(t)===r+"")return ae;return Jn(n),r}});var rf=M("textField",{required:"Please fill in this field.",rangeUnderflow:"Enter {min} or later.",rangeOverflow:"Enter {max} or earlier.",numberUnderflow:"Enter {min} or more.",numberOverflow:"Enter {max} or less.",stepMismatch:"Enter a valid value. The two nearest are {lower} and {upper}.",badTime:"Enter a complete time.",badDateTime:"Enter a complete date and time."}),oe,Xe,ea,K,Qr,Qn,ph,tc,uh,ic,ft=class extends k{constructor(){super(...arguments);p(this,K);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.type="text";this.multiline=!1;this.rows=4;this.required=!1;this.disabled=!1;this.readonly=!1;this.size="default";p(this,oe,this.attachInternals());p(this,Xe,L("cm-tf"));p(this,ea,"")}connectedCallback(){super.connectedCallback(),f(this,ea,this.value)}get form(){return s(this,oe).form}get validity(){return s(this,oe).validity}get validationMessage(){return s(this,oe).validationMessage}checkValidity(){return o(this,K,Qr).call(this),s(this,oe).checkValidity()}reportValidity(){return o(this,K,Qr).call(this),s(this,oe).reportValidity()}formResetCallback(){this.value=s(this,ea),this.error=""}formDisabledCallback(e){this.disabled=e}updated(){s(this,oe).setFormValue(this.value),o(this,K,Qr).call(this)}render(){let e=[this.error&&`${s(this,Xe)}-err`,this.helpText&&`${s(this,Xe)}-help`].filter(Boolean).join(" ")||d,t={id:s(this,Xe),invalid:this.error?"true":d},i=this.multiline?l`<textarea class="input" part="input" id=${t.id} rows=${this.rows}
96
- .value=${se(this.value)} placeholder=${this.placeholder||d}
95
+ `];w("cm-button",Ci);var st={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},gs=o=>(...n)=>({_$litDirective$:o,values:n}),jt=class{constructor(n){}get _$AU(){return this._$AM._$AU}_$AT(n,e,t){this._$Ct=n,this._$AM=e,this._$Ci=t}_$AS(n,e){return this.update(n,e)}update(n,e){return this.render(...e)}};var{I:_g}=lu,gu=o=>o;var vu=o=>o.strings===void 0,bu=()=>document.createComment(""),bs=(o,n,e)=>{let t=o._$AA.parentNode,i=n===void 0?o._$AB:n._$AA;if(e===void 0){let r=t.insertBefore(bu(),i),l=t.insertBefore(bu(),i);e=new _g(r,l,o,o.options)}else{let r=e._$AB.nextSibling,l=e._$AM,d=l!==o;if(d){let p;e._$AQ?.(o),e._$AM=o,e._$AP!==void 0&&(p=o._$AU)!==l._$AU&&e._$AP(p)}if(r!==i||d){let p=e._$AA;for(;p!==r;){let m=gu(p).nextSibling;gu(t).insertBefore(p,i),p=m}}}return e},Vt=(o,n,e=o)=>(o._$AI(n,e),o),Lg={},$l=(o,n=Lg)=>o._$AH=n,xu=o=>o._$AH,kl=o=>{o._$AR(),o._$AA.remove()};var le=gs(class extends jt{constructor(o){if(super(o),o.type!==st.PROPERTY&&o.type!==st.ATTRIBUTE&&o.type!==st.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!vu(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[n]){if(n===ge||n===h)return n;let e=o.element,t=o.name;if(o.type===st.PROPERTY){if(n===e[t])return ge}else if(o.type===st.BOOLEAN_ATTRIBUTE){if(!!n===e.hasAttribute(t))return ge}else if(o.type===st.ATTRIBUTE&&e.getAttribute(t)===n+"")return ge;return $l(o),n}});var ev=C("textField",{required:"Please fill in this field.",rangeUnderflow:"Enter {min} or later.",rangeOverflow:"Enter {max} or earlier.",numberUnderflow:"Enter {min} or more.",numberOverflow:"Enter {max} or less.",stepMismatch:"Enter a valid value. The two nearest are {lower} and {upper}.",badTime:"Enter a complete time.",badDateTime:"Enter a complete date and time."}),be,Et,tn,ie,en,El,yu,Hd,wu,Id,Ut=class extends T{constructor(){super(...arguments);u(this,ie);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.type="text";this.multiline=!1;this.rows=4;this.required=!1;this.disabled=!1;this.readonly=!1;this.size="default";u(this,be,this.attachInternals());u(this,Et,D("cm-tf"));u(this,tn,"")}connectedCallback(){super.connectedCallback(),g(this,tn,this.value)}get form(){return s(this,be).form}get validity(){return s(this,be).validity}get validationMessage(){return s(this,be).validationMessage}checkValidity(){return a(this,ie,en).call(this),s(this,be).checkValidity()}reportValidity(){return a(this,ie,en).call(this),s(this,be).reportValidity()}formResetCallback(){this.value=s(this,tn),this.error=""}formDisabledCallback(e){this.disabled=e}updated(){s(this,be).setFormValue(this.value),a(this,ie,en).call(this)}render(){let e=[this.error&&`${s(this,Et)}-err`,this.helpText&&`${s(this,Et)}-help`].filter(Boolean).join(" ")||h,t={id:s(this,Et),invalid:this.error?"true":h},i=this.multiline?c`<textarea class="input" part="input" id=${t.id} rows=${this.rows}
96
+ .value=${le(this.value)} placeholder=${this.placeholder||h}
97
97
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
98
98
  aria-invalid=${t.invalid} aria-describedby=${e}
99
- @input=${o(this,K,tc)} @change=${o(this,K,ic)}></textarea>`:l`<input class="input" part="input" id=${t.id} type=${this.type}
100
- .value=${se(this.value)} placeholder=${this.placeholder||d}
101
- autocomplete=${this.autocomplete??d}
102
- min=${this.min||d} max=${this.max||d} step=${this.step||d}
99
+ @input=${a(this,ie,Hd)} @change=${a(this,ie,Id)}></textarea>`:c`<input class="input" part="input" id=${t.id} type=${this.type}
100
+ .value=${le(this.value)} placeholder=${this.placeholder||h}
101
+ autocomplete=${this.autocomplete??h}
102
+ min=${this.min||h} max=${this.max||h} step=${this.step||h}
103
103
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
104
104
  aria-invalid=${t.invalid} aria-describedby=${e}
105
- @input=${o(this,K,tc)} @change=${o(this,K,ic)} @blur=${o(this,K,uh)} />`;return l`<div class="field">
106
- ${this.label?l`<label for=${s(this,Xe)} part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}${this.hint?l`<span class="hint">[${this.hint}]</span>`:d}</label>`:d}
105
+ @input=${a(this,ie,Hd)} @change=${a(this,ie,Id)} @blur=${a(this,ie,wu)} />`;return c`<div class="field">
106
+ ${this.label?c`<label for=${s(this,Et)} part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}${this.hint?c`<span class="hint">[${this.hint}]</span>`:h}</label>`:h}
107
107
  ${i}
108
- ${this.error?l`<p class="error" id="${s(this,Xe)}-err" role="alert">${this.error}</p>`:d}
109
- ${this.helpText?l`<p class="help" id="${s(this,Xe)}-help">${this.helpText}</p>`:d}
110
- </div>`}};oe=new WeakMap,Xe=new WeakMap,ea=new WeakMap,K=new WeakSet,Qr=function(){let e=this.renderRoot.querySelector(".input"),t=e instanceof HTMLInputElement?e.validity:null,i=this.type==="time"||this.type==="datetime-local";this.error?s(this,oe).setValidity({customError:!0},this.error,e??void 0):i&&t?.badInput?s(this,oe).setValidity({badInput:!0},this.t(this.type==="time"?"badTime":"badDateTime"),e??void 0):this.required&&!this.value?s(this,oe).setValidity({valueMissing:!0},this.t("required"),e??void 0):!this.multiline&&t?.rangeUnderflow?s(this,oe).setValidity({rangeUnderflow:!0},this.t(this.type==="number"?"numberUnderflow":"rangeUnderflow",{min:o(this,K,Qn).call(this,this.min??"")}),e??void 0):!this.multiline&&t?.rangeOverflow?s(this,oe).setValidity({rangeOverflow:!0},this.t(this.type==="number"?"numberOverflow":"rangeOverflow",{max:o(this,K,Qn).call(this,this.max??"")}),e??void 0):!this.multiline&&this.step&&t?.stepMismatch?s(this,oe).setValidity({stepMismatch:!0},this.t("stepMismatch",o(this,K,ph).call(this,e)),e??void 0):s(this,oe).setValidity({})},Qn=function(e){let t=this.locale;if(this.type==="number"&&e!==""&&Number.isFinite(Number(e)))return this.formatNumber(Number(e));if(this.type==="time"){let c=/^(\d{2}):(\d{2})/.exec(e);return c?Z(new Date(2e3,0,1,+c[1],+c[2]),{hour:"numeric",minute:"2-digit"},t):e}let i=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}))?/.exec(e);if(!i)return e;let a=new Date(+i[1],+i[2]-1,+i[3],+(i[4]??0),+(i[5]??0));return this.type==="datetime-local"?Z(a,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"},t):Z(a,{day:"numeric",month:"short",year:"numeric"},t)},ph=function(e){let t=this.type==="date"?864e5:this.type==="time"||this.type==="datetime-local"?1e3:1,i=Number(this.step)*t||(this.type==="date"?864e5:this.type==="number"?1:6e4),a=e.valueAsNumber,c=document.createElement("input");c.type=this.type,c.value=this.min??"";let h=Number.isFinite(c.valueAsNumber)?c.valueAsNumber:0,u=h+Math.floor((a-h)/i)*i,m=y=>{if(this.type==="number")return this.formatNumber(Number(y.toPrecision(12)));let E=new Date(y).toISOString();return o(this,K,Qn).call(this,this.type==="time"?E.slice(11,16):this.type==="date"?E.slice(0,10):E.slice(0,16))};return{lower:m(u),upper:m(u+i)}},tc=function(e){this.value=e.target.value},uh=function(){o(this,K,Qr).call(this)},ic=function(){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},ft.formAssociated=!0,ft.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},ft.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},type:{},multiline:{type:Boolean},rows:{type:Number},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},autocomplete:{},size:{reflect:!0},min:{},max:{},step:{}},ft.styles=[w,b`
108
+ ${this.error?c`<p class="error" id="${s(this,Et)}-err" role="alert">${this.error}</p>`:h}
109
+ ${this.helpText?c`<p class="help" id="${s(this,Et)}-help">${this.helpText}</p>`:h}
110
+ </div>`}};be=new WeakMap,Et=new WeakMap,tn=new WeakMap,ie=new WeakSet,en=function(){let e=this.renderRoot.querySelector(".input"),t=e instanceof HTMLInputElement?e.validity:null,i=this.type==="time"||this.type==="datetime-local";this.error?s(this,be).setValidity({customError:!0},this.error,e??void 0):i&&t?.badInput?s(this,be).setValidity({badInput:!0},this.t(this.type==="time"?"badTime":"badDateTime"),e??void 0):this.required&&!this.value?s(this,be).setValidity({valueMissing:!0},this.t("required"),e??void 0):!this.multiline&&t?.rangeUnderflow?s(this,be).setValidity({rangeUnderflow:!0},this.t(this.type==="number"?"numberUnderflow":"rangeUnderflow",{min:a(this,ie,El).call(this,this.min??"")}),e??void 0):!this.multiline&&t?.rangeOverflow?s(this,be).setValidity({rangeOverflow:!0},this.t(this.type==="number"?"numberOverflow":"rangeOverflow",{max:a(this,ie,El).call(this,this.max??"")}),e??void 0):!this.multiline&&this.step&&t?.stepMismatch?s(this,be).setValidity({stepMismatch:!0},this.t("stepMismatch",a(this,ie,yu).call(this,e)),e??void 0):s(this,be).setValidity({})},El=function(e){let t=this.locale;if(this.type==="number"&&e!==""&&Number.isFinite(Number(e)))return this.formatNumber(Number(e));if(this.type==="time"){let l=/^(\d{2}):(\d{2})/.exec(e);return l?ee(new Date(2e3,0,1,+l[1],+l[2]),{hour:"numeric",minute:"2-digit"},t):e}let i=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}))?/.exec(e);if(!i)return e;let r=new Date(+i[1],+i[2]-1,+i[3],+(i[4]??0),+(i[5]??0));return this.type==="datetime-local"?ee(r,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"},t):ee(r,{day:"numeric",month:"short",year:"numeric"},t)},yu=function(e){let t=this.type==="date"?864e5:this.type==="time"||this.type==="datetime-local"?1e3:1,i=Number(this.step)*t||(this.type==="date"?864e5:this.type==="number"?1:6e4),r=e.valueAsNumber,l=document.createElement("input");l.type=this.type,l.value=this.min??"";let d=Number.isFinite(l.valueAsNumber)?l.valueAsNumber:0,p=d+Math.floor((r-d)/i)*i,m=v=>{if(this.type==="number")return this.formatNumber(Number(v.toPrecision(12)));let $=new Date(v).toISOString();return a(this,ie,El).call(this,this.type==="time"?$.slice(11,16):this.type==="date"?$.slice(0,10):$.slice(0,16))};return{lower:m(p),upper:m(p+i)}},Hd=function(e){this.value=e.target.value},wu=function(){a(this,ie,en).call(this)},Id=function(){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Ut.formAssociated=!0,Ut.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Ut.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},type:{},multiline:{type:Boolean},rows:{type:Number},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},autocomplete:{},size:{reflect:!0},min:{},max:{},step:{}},Ut.styles=[E,x`
111
111
  :host { display: block; }
112
112
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
113
113
  label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -130,13 +130,13 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
130
130
  :host([size='small']) .field { gap: 6px; }
131
131
  :host([size='small']) label { font-size: 12px; }
132
132
  :host([size='small']) .input { font-size: 14px; }
133
- `];g("cm-text-field",ft);var df=M("checkbox",{required:"Please tick this box."}),gt,Kt,ta,eo,mh,bt=class extends k{constructor(){super(...arguments);p(this,eo);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.indeterminate=!1;this.disabled=!1;this.required=!1;p(this,gt,this.attachInternals());p(this,Kt,L("cm-cb"));p(this,ta,!1)}connectedCallback(){super.connectedCallback(),f(this,ta,this.checked)}get form(){return s(this,gt).form}checkValidity(){return s(this,gt).checkValidity()}formResetCallback(){this.checked=s(this,ta)}formDisabledCallback(e){this.disabled=e}updated(){s(this,gt).setFormValue(this.checked?this.value:null),this.required&&!this.checked?s(this,gt).setValidity({valueMissing:!0},this.t("required")):s(this,gt).setValidity({})}render(){let e=this.indeterminate?l`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6h8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>`:l`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6.2 4.8 9 10 3" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return l`<label for=${s(this,Kt)}>
134
- <input type="checkbox" id=${s(this,Kt)} .checked=${this.checked} .indeterminate=${this.indeterminate}
133
+ `];w("cm-text-field",Ut);var nv=C("checkbox",{required:"Please tick this box."}),Wt,_i,sn,Ml,$u,Kt=class extends T{constructor(){super(...arguments);u(this,Ml);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.indeterminate=!1;this.disabled=!1;this.required=!1;u(this,Wt,this.attachInternals());u(this,_i,D("cm-cb"));u(this,sn,!1)}connectedCallback(){super.connectedCallback(),g(this,sn,this.checked)}get form(){return s(this,Wt).form}checkValidity(){return s(this,Wt).checkValidity()}formResetCallback(){this.checked=s(this,sn)}formDisabledCallback(e){this.disabled=e}updated(){s(this,Wt).setFormValue(this.checked?this.value:null),this.required&&!this.checked?s(this,Wt).setValidity({valueMissing:!0},this.t("required")):s(this,Wt).setValidity({})}render(){let e=this.indeterminate?c`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6h8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>`:c`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6.2 4.8 9 10 3" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return c`<label for=${s(this,_i)}>
134
+ <input type="checkbox" id=${s(this,_i)} .checked=${this.checked} .indeterminate=${this.indeterminate}
135
135
  ?disabled=${this.disabled} ?required=${this.required}
136
- aria-describedby=${this.description?`${s(this,Kt)}-d`:d} @change=${o(this,eo,mh)} />
136
+ aria-describedby=${this.description?`${s(this,_i)}-d`:h} @change=${a(this,Ml,$u)} />
137
137
  <span class="box" part="box">${e}</span>
138
- ${this.label||this.description?l`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?l`<span class="desc" id="${s(this,Kt)}-d">${this.description}</span>`:d}</span>`:l`<slot></slot>`}
139
- </label>`}};gt=new WeakMap,Kt=new WeakMap,ta=new WeakMap,eo=new WeakSet,mh=function(e){let t=e.target;this.checked=t.checked,this.indeterminate=!1,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},bt.formAssociated=!0,bt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},bt.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean},disabled:{type:Boolean,reflect:!0},required:{type:Boolean}},bt.styles=[w,b`
138
+ ${this.label||this.description?c`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?c`<span class="desc" id="${s(this,_i)}-d">${this.description}</span>`:h}</span>`:c`<slot></slot>`}
139
+ </label>`}};Wt=new WeakMap,_i=new WeakMap,sn=new WeakMap,Ml=new WeakSet,$u=function(e){let t=e.target;this.checked=t.checked,this.indeterminate=!1,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Kt.formAssociated=!0,Kt.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Kt.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean},disabled:{type:Boolean,reflect:!0},required:{type:Boolean}},Kt.styles=[E,x`
140
140
  :host { display: inline-flex; }
141
141
  label { position: relative; display: inline-flex; align-items: flex-start; gap: var(--cm-space-10); cursor: pointer; }
142
142
  input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; cursor: inherit; }
@@ -153,12 +153,12 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
153
153
  :host([disabled]) label { cursor: not-allowed; }
154
154
  :host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
155
155
  :host([disabled]) .label { color: var(--cm-text-secondary); }
156
- `];g("cm-checkbox",bt);var ia,Yt=class extends _{constructor(){super(...arguments);this.label="";this.description="";this.value="";this.checked=!1;this.disabled=!1;this.groupDisabled=!1;this._tabbable=!1;p(this,ia,L("cm-radio"))}render(){let e=this.description?`${s(this,ia)}-d`:null;return l`<div class="radio" part="radio" role="radio" id=${s(this,ia)}
157
- aria-checked=${this.checked?"true":"false"} aria-disabled=${this.disabled||this.groupDisabled?"true":d}
158
- aria-describedby=${e??d} tabindex=${this._tabbable&&!this.disabled&&!this.groupDisabled?"0":"-1"}>
156
+ `];w("cm-checkbox",Kt);var rn,Si=class extends L{constructor(){super(...arguments);this.label="";this.description="";this.value="";this.checked=!1;this.disabled=!1;this.groupDisabled=!1;this._tabbable=!1;u(this,rn,D("cm-radio"))}render(){let e=this.description?`${s(this,rn)}-d`:null;return c`<div class="radio" part="radio" role="radio" id=${s(this,rn)}
157
+ aria-checked=${this.checked?"true":"false"} aria-disabled=${this.disabled||this.groupDisabled?"true":h}
158
+ aria-describedby=${e??h} tabindex=${this._tabbable&&!this.disabled&&!this.groupDisabled?"0":"-1"}>
159
159
  <span class="dot" part="dot"></span>
160
- <span class="text"><span class="label">${this.label}<slot></slot></span>${e?l`<span class="desc" id=${e}>${this.description}</span>`:d}</span>
161
- </div>`}};ia=new WeakMap,Yt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},Yt.properties={label:{},description:{},value:{reflect:!0},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},groupDisabled:{type:Boolean,reflect:!0,attribute:"group-disabled"},_tabbable:{state:!0}},Yt.styles=[w,b`
160
+ <span class="text"><span class="label">${this.label}<slot></slot></span>${e?c`<span class="desc" id=${e}>${this.description}</span>`:h}</span>
161
+ </div>`}};rn=new WeakMap,Si.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Si.properties={label:{},description:{},value:{reflect:!0},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},groupDisabled:{type:Boolean,reflect:!0,attribute:"group-disabled"},_tabbable:{state:!0}},Si.styles=[E,x`
162
162
  :host { display: inline-flex; }
163
163
  .radio { display: inline-flex; align-items: flex-start; gap: var(--cm-space-10); cursor: pointer; outline: none; }
164
164
  .dot {
@@ -178,16 +178,16 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
178
178
  :host([disabled]) .dot, :host([group-disabled]) .dot { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
179
179
  :host([disabled][checked]) .dot, :host([group-disabled][checked]) .dot { background: var(--cm-border-default); }
180
180
  :host([disabled]) .label, :host([group-disabled]) .label { color: var(--cm-text-secondary); }
181
- `];g("cm-radio",Yt);var bf=M("radioGroup",{required:"Please select one of these options."}),ze,Je,sa,ra,aa,Ai,U,sc,io,Gt,rc,Di,ac,so,ro,to,Wt=class extends k{constructor(){super();p(this,U);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.orientation="vertical";this.required=!1;this.disabled=!1;p(this,ze,this.attachInternals());p(this,Je,L("cm-rg"));p(this,sa,"");p(this,ra,!0);p(this,aa,!1);p(this,Ai,!1);p(this,io,()=>{o(this,U,sc).call(this),s(this,Di).call(this)});p(this,Di,()=>{let e=o(this,U,Gt).call(this),t=!1;for(let a of e)a.checked=!!this.value&&a.value===this.value&&!t,a.checked&&(t=!0),a.groupDisabled=this.disabled;let i=e.find(a=>a.checked&&!a.disabled)??o(this,U,rc).call(this)[0];for(let a of e)a._tabbable=a===i&&!this.disabled});p(this,so,e=>{let t=e.target.closest?.("cm-radio");!t||t.disabled||this.disabled||!this.contains(t)||o(this,U,ac).call(this,t,!0)});p(this,ro,e=>{let t=e.target.closest?.("cm-radio");if(!t||this.disabled)return;let i=o(this,U,rc).call(this),a=i.indexOf(t),c=ne(e,this),h;if(e.key==="ArrowDown"||c==="ArrowRight")h=i[(a+1)%i.length];else if(e.key==="ArrowUp"||c==="ArrowLeft")h=i[(a-1+i.length)%i.length];else if(e.key===" ")h=t.disabled?void 0:t;else return;e.preventDefault(),h&&o(this,U,ac).call(this,h,!0)});this.addEventListener("keydown",s(this,ro)),this.addEventListener("click",s(this,so))}connectedCallback(){super.connectedCallback(),o(this,U,sc).call(this)}get form(){return s(this,ze).form}get validity(){return s(this,ze).validity}get validationMessage(){return s(this,ze).validationMessage}checkValidity(){return s(this,ze).checkValidity()}reportValidity(){return s(this,ze).reportValidity()}formResetCallback(){this.value=s(this,sa)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){(o(this,U,Gt).call(this).find(t=>t._tabbable)??o(this,U,Gt).call(this)[0])?.focus(e)}updated(e){e.has("value")&&s(this,aa)&&!s(this,Ai)&&f(this,ra,!1),f(this,aa,!0),s(this,Di).call(this),s(this,ze).setFormValue(this.value||null,this.value);let t=o(this,U,Gt).call(this)[0];this.error?s(this,ze).setValidity({customError:!0},this.error,t):this.required&&!this.value?s(this,ze).setValidity({valueMissing:!0},this.t("required"),t):s(this,ze).setValidity({})}render(){let e=[this.error&&`${s(this,Je)}-err`,this.helpText&&`${s(this,Je)}-help`].filter(Boolean).join(" ");return l`<div class="group" role="radiogroup" part="group"
182
- aria-labelledby=${o(this,U,to).call(this)?`${s(this,Je)}-l`:d} aria-label=${o(this,U,to).call(this)?d:this.getAttribute("aria-label")??d}
183
- aria-describedby=${e||d}
184
- aria-required=${this.required?"true":d} aria-invalid=${this.error?"true":d}
185
- aria-disabled=${this.disabled?"true":d}>
186
- <span class="label" id="${s(this,Je)}-l" part="label" ?hidden=${!o(this,U,to).call(this)}>${this.label}<slot name="label"></slot>${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</span>
187
- ${this.helpText?l`<p class="help" id="${s(this,Je)}-help">${this.helpText}</p>`:d}
188
- ${this.error?l`<p class="error" id="${s(this,Je)}-err" role="alert">${this.error}</p>`:d}
189
- <div class="options" part="options"><slot @slotchange=${s(this,io)}></slot></div>
190
- </div>`}};ze=new WeakMap,Je=new WeakMap,sa=new WeakMap,ra=new WeakMap,aa=new WeakMap,Ai=new WeakMap,U=new WeakSet,sc=function(){s(this,ra)&&(this.value||(f(this,Ai,!0),this.value=o(this,U,Gt).call(this).find(e=>e.hasAttribute("checked"))?.getAttribute("value")??"",this.updateComplete.then(()=>f(this,Ai,!1))),f(this,sa,this.value))},io=new WeakMap,Gt=function(){return[...this.querySelectorAll("cm-radio")]},rc=function(){return o(this,U,Gt).call(this).filter(e=>!e.disabled&&!this.disabled)},Di=new WeakMap,ac=function(e,t){t&&e.focus(),e.value!==this.value&&(this.value=e.value,s(this,Di).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},so=new WeakMap,ro=new WeakMap,to=function(){return!!this.label||!!this.querySelector("[slot=label]")},Wt.formAssociated=!0,Wt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{reflect:!0},orientation:{reflect:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},Wt.styles=[w,b`
181
+ `];w("cm-radio",Si);var pv=C("radioGroup",{required:"Please select one of these options."}),Ve,Mt,an,nn,on,vs,te,Pd,Cl,Li,Od,xs,qd,_l,Ll,Tl,zi=class extends T{constructor(){super();u(this,te);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.orientation="vertical";this.required=!1;this.disabled=!1;u(this,Ve,this.attachInternals());u(this,Mt,D("cm-rg"));u(this,an,"");u(this,nn,!0);u(this,on,!1);u(this,vs,!1);u(this,Cl,()=>{a(this,te,Pd).call(this),s(this,xs).call(this)});u(this,xs,()=>{let e=a(this,te,Li).call(this),t=!1;for(let r of e)r.checked=!!this.value&&r.value===this.value&&!t,r.checked&&(t=!0),r.groupDisabled=this.disabled;let i=e.find(r=>r.checked&&!r.disabled)??a(this,te,Od).call(this)[0];for(let r of e)r._tabbable=r===i&&!this.disabled});u(this,_l,e=>{let t=e.target.closest?.("cm-radio");!t||t.disabled||this.disabled||!this.contains(t)||a(this,te,qd).call(this,t,!0)});u(this,Ll,e=>{let t=e.target.closest?.("cm-radio");if(!t||this.disabled)return;let i=a(this,te,Od).call(this),r=i.indexOf(t),l=re(e,this),d;if(e.key==="ArrowDown"||l==="ArrowRight")d=i[(r+1)%i.length];else if(e.key==="ArrowUp"||l==="ArrowLeft")d=i[(r-1+i.length)%i.length];else if(e.key===" ")d=t.disabled?void 0:t;else return;e.preventDefault(),d&&a(this,te,qd).call(this,d,!0)});this.addEventListener("keydown",s(this,Ll)),this.addEventListener("click",s(this,_l))}connectedCallback(){super.connectedCallback(),a(this,te,Pd).call(this)}get form(){return s(this,Ve).form}get validity(){return s(this,Ve).validity}get validationMessage(){return s(this,Ve).validationMessage}checkValidity(){return s(this,Ve).checkValidity()}reportValidity(){return s(this,Ve).reportValidity()}formResetCallback(){this.value=s(this,an)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){(a(this,te,Li).call(this).find(t=>t._tabbable)??a(this,te,Li).call(this)[0])?.focus(e)}updated(e){e.has("value")&&s(this,on)&&!s(this,vs)&&g(this,nn,!1),g(this,on,!0),s(this,xs).call(this),s(this,Ve).setFormValue(this.value||null,this.value);let t=a(this,te,Li).call(this)[0];this.error?s(this,Ve).setValidity({customError:!0},this.error,t):this.required&&!this.value?s(this,Ve).setValidity({valueMissing:!0},this.t("required"),t):s(this,Ve).setValidity({})}render(){let e=[this.error&&`${s(this,Mt)}-err`,this.helpText&&`${s(this,Mt)}-help`].filter(Boolean).join(" ");return c`<div class="group" role="radiogroup" part="group"
182
+ aria-labelledby=${a(this,te,Tl).call(this)?`${s(this,Mt)}-l`:h} aria-label=${a(this,te,Tl).call(this)?h:this.getAttribute("aria-label")??h}
183
+ aria-describedby=${e||h}
184
+ aria-required=${this.required?"true":h} aria-invalid=${this.error?"true":h}
185
+ aria-disabled=${this.disabled?"true":h}>
186
+ <span class="label" id="${s(this,Mt)}-l" part="label" ?hidden=${!a(this,te,Tl).call(this)}>${this.label}<slot name="label"></slot>${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>
187
+ ${this.helpText?c`<p class="help" id="${s(this,Mt)}-help">${this.helpText}</p>`:h}
188
+ ${this.error?c`<p class="error" id="${s(this,Mt)}-err" role="alert">${this.error}</p>`:h}
189
+ <div class="options" part="options"><slot @slotchange=${s(this,Cl)}></slot></div>
190
+ </div>`}};Ve=new WeakMap,Mt=new WeakMap,an=new WeakMap,nn=new WeakMap,on=new WeakMap,vs=new WeakMap,te=new WeakSet,Pd=function(){s(this,nn)&&(this.value||(g(this,vs,!0),this.value=a(this,te,Li).call(this).find(e=>e.hasAttribute("checked"))?.getAttribute("value")??"",this.updateComplete.then(()=>g(this,vs,!1))),g(this,an,this.value))},Cl=new WeakMap,Li=function(){return[...this.querySelectorAll("cm-radio")]},Od=function(){return a(this,te,Li).call(this).filter(e=>!e.disabled&&!this.disabled)},xs=new WeakMap,qd=function(e,t){t&&e.focus(),e.value!==this.value&&(this.value=e.value,s(this,xs).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},_l=new WeakMap,Ll=new WeakMap,Tl=function(){return!!this.label||!!this.querySelector("[slot=label]")},zi.formAssociated=!0,zi.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{reflect:!0},orientation:{reflect:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},zi.styles=[E,x`
191
191
  :host { display: block; }
192
192
  .group { display: flex; flex-direction: column; gap: var(--cm-space-10); }
193
193
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -196,13 +196,13 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
196
196
  .error { color: var(--cm-text-critical); }
197
197
  .options { display: flex; flex-direction: column; align-items: flex-start; gap: var(--cm-space-20); padding-top: var(--cm-space-10); }
198
198
  :host([orientation='horizontal']) .options { flex-direction: row; flex-wrap: wrap; column-gap: var(--cm-space-30); }
199
- `];g("cm-radio-group",Wt);var Ni,Xt,na,ao,fh,vt=class extends _{constructor(){super(...arguments);p(this,ao);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.disabled=!1;p(this,Ni,this.attachInternals());p(this,Xt,L("cm-tg"));p(this,na,!1)}connectedCallback(){super.connectedCallback(),f(this,na,this.checked)}get form(){return s(this,Ni).form}checkValidity(){return s(this,Ni).checkValidity()}formResetCallback(){this.checked=s(this,na)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.checked=e!=null}updated(){s(this,Ni).setFormValue(this.checked?this.value:null)}render(){let e=this.label||this.description||this.textContent?.trim();return l`<label for=${s(this,Xt)}>
200
- <input type="checkbox" role="switch" id=${s(this,Xt)} .checked=${this.checked} ?disabled=${this.disabled}
201
- aria-label=${e?d:this.getAttribute("aria-label")??d}
202
- aria-describedby=${this.description?`${s(this,Xt)}-d`:d} @change=${o(this,ao,fh)} />
199
+ `];w("cm-radio-group",zi);var ys,Di,ln,Sl,ku,Yt=class extends L{constructor(){super(...arguments);u(this,Sl);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.disabled=!1;u(this,ys,this.attachInternals());u(this,Di,D("cm-tg"));u(this,ln,!1)}connectedCallback(){super.connectedCallback(),g(this,ln,this.checked)}get form(){return s(this,ys).form}checkValidity(){return s(this,ys).checkValidity()}formResetCallback(){this.checked=s(this,ln)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.checked=e!=null}updated(){s(this,ys).setFormValue(this.checked?this.value:null)}render(){let e=this.label||this.description||this.textContent?.trim();return c`<label for=${s(this,Di)}>
200
+ <input type="checkbox" role="switch" id=${s(this,Di)} .checked=${this.checked} ?disabled=${this.disabled}
201
+ aria-label=${e?h:this.getAttribute("aria-label")??h}
202
+ aria-describedby=${this.description?`${s(this,Di)}-d`:h} @change=${a(this,Sl,ku)} />
203
203
  <span class="track" part="track"><span class="thumb" part="thumb"></span></span>
204
- ${e?l`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?l`<span class="desc" id="${s(this,Xt)}-d">${this.description}</span>`:d}</span>`:d}
205
- </label>`}};Ni=new WeakMap,Xt=new WeakMap,na=new WeakMap,ao=new WeakSet,fh=function(e){this.checked=e.target.checked,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},vt.formAssociated=!0,vt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},vt.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},vt.styles=[w,b`
204
+ ${e?c`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?c`<span class="desc" id="${s(this,Di)}-d">${this.description}</span>`:h}</span>`:h}
205
+ </label>`}};ys=new WeakMap,Di=new WeakMap,ln=new WeakMap,Sl=new WeakSet,ku=function(e){this.checked=e.target.checked,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Yt.formAssociated=!0,Yt.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Yt.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},Yt.styles=[E,x`
206
206
  :host { display: inline-flex; }
207
207
  label { position: relative; display: inline-flex; align-items: flex-start; gap: var(--cm-space-10); cursor: pointer; }
208
208
  input { position: absolute; opacity: 0; width: 38px; height: 20px; margin: 0; cursor: inherit; }
@@ -227,7 +227,7 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
227
227
  :host([disabled]) .track { opacity: .5; }
228
228
  :host([disabled]) .label { color: var(--cm-text-secondary); }
229
229
  @media (prefers-reduced-motion: reduce) { .track, .thumb { transition: none; } }
230
- `];g("cm-toggle",vt);var no=b`
230
+ `];w("cm-toggle",Yt);var zl=x`
231
231
  .pop {
232
232
  position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-10)); inset-inline: 0;
233
233
  background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-default);
@@ -239,7 +239,7 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
239
239
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
240
240
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
241
241
  }
242
- `;function oo(n,r,e){let t=i=>{r()&&!i.composedPath().includes(n)&&e()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)}var Ri=b`
242
+ `;function Dl(o,n,e){let t=i=>{n()&&!i.composedPath().includes(o)&&e()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)}var ws=x`
243
243
  [role='group'] + [role='group'] { margin-block-start: 6px; padding-block-start: 6px; border-top: var(--cm-border-1) solid var(--cm-border-default); }
244
244
  [role='option'] + [role='group'], [role='group'] + [role='option'] { margin-block-start: 6px; padding-block-start: 6px; border-top: var(--cm-border-1) solid var(--cm-border-default); }
245
245
  .gh {
@@ -248,33 +248,33 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
248
248
  }
249
249
  .gh .count { font-weight: 400; color: var(--cm-text-tertiary); }
250
250
  .gopts { list-style: none; margin: 0; padding: 0; }
251
- `;function Hi(n){if(!n.some(t=>t.group))return n;let r=[],e=new Map;for(let t of n)if(t.group){let i=e.get(t.group);if(i)i.push(t);else{let a=[t];e.set(t.group,a),r.push({key:t.group,items:a})}}else{let i=r[r.length-1];i&&!i.key?i.items.push(t):r.push({key:"",items:[t]})}return r.flatMap(t=>t.items)}function lo(n){let r=[];return n.forEach((e,t)=>{let i=e.group||"",a=r[r.length-1];a&&a.group===i?a.rows.push({row:e,index:t}):r.push({group:i,rows:[{row:e,index:t}]})}),r}var zf=M("select",{required:"Please select an item in the list.",grouped:"{group}: {label}"}),Le,Q,Oi,He,qi,la,A,nc,oc,oa,Ii,Jt,xt,co,ho,ca,po,bh,uo,yt=class extends k{constructor(){super(...arguments);p(this,A);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.options=[];this.required=!1;this.disabled=!1;this.open=!1;this.showGroup=!1;this._active=-1;this._slotted=[];p(this,Le,this.attachInternals());p(this,Q,L("cm-sel"));p(this,Oi,"");p(this,He,"");p(this,qi,0);p(this,la,new MutationObserver(()=>o(this,A,nc).call(this)));p(this,ho,e=>{if(this.disabled)return;let t=e.key;if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t)){e.preventDefault(),o(this,A,oa).call(this);return}if(t==="Home"||t==="End"){e.preventDefault(),o(this,A,oa).call(this),o(this,A,xt).call(this,t==="Home"?"first":"last");return}if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=o(this,A,co).call(this,t);o(this,A,oa).call(this,i>=0?i:void 0)}return}switch(t){case"ArrowDown":e.preventDefault(),e.altKey?o(this,A,Jt).call(this,this._active):o(this,A,xt).call(this,1);break;case"ArrowUp":e.preventDefault(),e.altKey?o(this,A,Jt).call(this,this._active):o(this,A,xt).call(this,-1);break;case"Home":e.preventDefault(),o(this,A,xt).call(this,"first");break;case"End":e.preventDefault(),o(this,A,xt).call(this,"last");break;case"PageDown":e.preventDefault(),o(this,A,xt).call(this,10);break;case"PageUp":e.preventDefault(),o(this,A,xt).call(this,-10);break;case"Enter":e.preventDefault(),o(this,A,Jt).call(this,this._active);break;case"Escape":e.preventDefault(),e.stopPropagation(),o(this,A,Ii).call(this);break;case"Tab":o(this,A,Jt).call(this,this._active);break;case" ":if(e.preventDefault(),s(this,He)&&Date.now()-s(this,qi)<500){let i=o(this,A,co).call(this," ");i>=0&&(this._active=i)}else o(this,A,Jt).call(this,this._active);break;default:if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=o(this,A,co).call(this,t);i>=0&&(this._active=i)}}});p(this,ca,e=>{this.open&&!e.composedPath().includes(this)&&o(this,A,Ii).call(this)});p(this,po,()=>{this.disabled||(this.open?o(this,A,Ii).call(this):o(this,A,oa).call(this))});p(this,uo,()=>this.renderRoot.querySelector(".box")?.focus())}connectedCallback(){super.connectedCallback(),o(this,A,nc).call(this),s(this,la).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),document.addEventListener("pointerdown",s(this,ca),!0)}disconnectedCallback(){super.disconnectedCallback(),s(this,la).disconnect(),document.removeEventListener("pointerdown",s(this,ca),!0)}get form(){return s(this,Le).form}get validity(){return s(this,Le).validity}get validationMessage(){return s(this,Le).validationMessage}checkValidity(){return s(this,Le).checkValidity()}reportValidity(){return s(this,Le).reportValidity()}formResetCallback(){this.value=s(this,Oi),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e}get items(){return this.options.length?Hi(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):Hi(this._slotted)}firstUpdated(){s(this,Oi)||f(this,Oi,this.value)}updated(e){s(this,Le).setFormValue(this.value||null,this.value);let t=this.renderRoot.querySelector(".box")??void 0;this.error?s(this,Le).setValidity({customError:!0},this.error,t):this.required&&!this.value?s(this,Le).setValidity({valueMissing:!0},this.t("required"),t):s(this,Le).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this.renderRoot.querySelector(`#${s(this,Q)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=this.items,t=e.find(h=>h.value===this.value),i=[this.error&&`${s(this,Q)}-err`,this.helpText&&`${s(this,Q)}-help`].filter(Boolean).join(" "),a=this.getAttribute("aria-label"),c=(h,u)=>l`<li role="option" id="${s(this,Q)}-o${u}" class=${u===this._active?"active":""}
252
- aria-selected=${h.value===this.value?"true":"false"} aria-disabled=${h.disabled?"true":d}
253
- @pointerenter=${()=>!h.disabled&&(this._active=u)} @click=${()=>o(this,A,Jt).call(this,u)}>${h.label}</li>`;return l`<div class="field">
254
- ${this.label?l`<span class="label" id="${s(this,Q)}-l" part="label" @click=${s(this,uo)}>${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</span>`:d}
251
+ `;function $s(o){if(!o.some(t=>t.group))return o;let n=[],e=new Map;for(let t of o)if(t.group){let i=e.get(t.group);if(i)i.push(t);else{let r=[t];e.set(t.group,r),n.push({key:t.group,items:r})}}else{let i=n[n.length-1];i&&!i.key?i.items.push(t):n.push({key:"",items:[t]})}return n.flatMap(t=>t.items)}function Al(o){let n=[];return o.forEach((e,t)=>{let i=e.group||"",r=n[n.length-1];r&&r.group===i?r.rows.push({row:e,index:t}):n.push({group:i,rows:[{row:e,index:t}]})}),n}var Mv=C("select",{required:"Please select an item in the list.",grouped:"{group}: {label}"}),Ue,de,Es,rt,Ms,dn,P,Bd,Fd,cn,ks,Ai,Gt,Nl,Rl,hn,Hl,Eu,Il,Xt=class extends T{constructor(){super(...arguments);u(this,P);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.options=[];this.required=!1;this.disabled=!1;this.open=!1;this.showGroup=!1;this._active=-1;this._slotted=[];u(this,Ue,this.attachInternals());u(this,de,D("cm-sel"));u(this,Es,"");u(this,rt,"");u(this,Ms,0);u(this,dn,new MutationObserver(()=>a(this,P,Bd).call(this)));u(this,Rl,e=>{if(this.disabled)return;let t=e.key;if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t)){e.preventDefault(),a(this,P,cn).call(this);return}if(t==="Home"||t==="End"){e.preventDefault(),a(this,P,cn).call(this),a(this,P,Gt).call(this,t==="Home"?"first":"last");return}if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=a(this,P,Nl).call(this,t);a(this,P,cn).call(this,i>=0?i:void 0)}return}switch(t){case"ArrowDown":e.preventDefault(),e.altKey?a(this,P,Ai).call(this,this._active):a(this,P,Gt).call(this,1);break;case"ArrowUp":e.preventDefault(),e.altKey?a(this,P,Ai).call(this,this._active):a(this,P,Gt).call(this,-1);break;case"Home":e.preventDefault(),a(this,P,Gt).call(this,"first");break;case"End":e.preventDefault(),a(this,P,Gt).call(this,"last");break;case"PageDown":e.preventDefault(),a(this,P,Gt).call(this,10);break;case"PageUp":e.preventDefault(),a(this,P,Gt).call(this,-10);break;case"Enter":e.preventDefault(),a(this,P,Ai).call(this,this._active);break;case"Escape":e.preventDefault(),e.stopPropagation(),a(this,P,ks).call(this);break;case"Tab":a(this,P,Ai).call(this,this._active);break;case" ":if(e.preventDefault(),s(this,rt)&&Date.now()-s(this,Ms)<500){let i=a(this,P,Nl).call(this," ");i>=0&&(this._active=i)}else a(this,P,Ai).call(this,this._active);break;default:if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=a(this,P,Nl).call(this,t);i>=0&&(this._active=i)}}});u(this,hn,e=>{this.open&&!e.composedPath().includes(this)&&a(this,P,ks).call(this)});u(this,Hl,()=>{this.disabled||(this.open?a(this,P,ks).call(this):a(this,P,cn).call(this))});u(this,Il,()=>this.renderRoot.querySelector(".box")?.focus())}connectedCallback(){super.connectedCallback(),a(this,P,Bd).call(this),s(this,dn).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),document.addEventListener("pointerdown",s(this,hn),!0)}disconnectedCallback(){super.disconnectedCallback(),s(this,dn).disconnect(),document.removeEventListener("pointerdown",s(this,hn),!0)}get form(){return s(this,Ue).form}get validity(){return s(this,Ue).validity}get validationMessage(){return s(this,Ue).validationMessage}checkValidity(){return s(this,Ue).checkValidity()}reportValidity(){return s(this,Ue).reportValidity()}formResetCallback(){this.value=s(this,Es),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e}get items(){return this.options.length?$s(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):$s(this._slotted)}firstUpdated(){s(this,Es)||g(this,Es,this.value)}updated(e){s(this,Ue).setFormValue(this.value||null,this.value);let t=this.renderRoot.querySelector(".box")??void 0;this.error?s(this,Ue).setValidity({customError:!0},this.error,t):this.required&&!this.value?s(this,Ue).setValidity({valueMissing:!0},this.t("required"),t):s(this,Ue).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this.renderRoot.querySelector(`#${s(this,de)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=this.items,t=e.find(d=>d.value===this.value),i=[this.error&&`${s(this,de)}-err`,this.helpText&&`${s(this,de)}-help`].filter(Boolean).join(" "),r=this.getAttribute("aria-label"),l=(d,p)=>c`<li role="option" id="${s(this,de)}-o${p}" class=${p===this._active?"active":""}
252
+ aria-selected=${d.value===this.value?"true":"false"} aria-disabled=${d.disabled?"true":h}
253
+ @pointerenter=${()=>!d.disabled&&(this._active=p)} @click=${()=>a(this,P,Ai).call(this,p)}>${d.label}</li>`;return c`<div class="field">
254
+ ${this.label?c`<span class="label" id="${s(this,de)}-l" part="label" @click=${s(this,Il)}>${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
255
255
  <div class="wrap">
256
256
  <div class="box" part="box" role="combobox" tabindex=${this.disabled?"-1":"0"}
257
- aria-labelledby=${this.label?`${s(this,Q)}-l`:d}
258
- aria-label=${!this.label&&a?a:d}
259
- aria-haspopup="listbox" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,Q)}-list"
260
- aria-activedescendant=${this.open&&this._active>=0?`${s(this,Q)}-o${this._active}`:d}
261
- aria-required=${this.required?"true":d} aria-invalid=${this.error?"true":d}
262
- aria-disabled=${this.disabled?"true":d} aria-describedby=${i||d}
263
- @click=${s(this,po)} @keydown=${s(this,ho)} @blur=${()=>o(this,A,Ii).call(this)}>
264
- <span class="text ${t?"":"placeholder"}" id="${s(this,Q)}-v">${t?o(this,A,bh).call(this,t):this.placeholder}</span>
257
+ aria-labelledby=${this.label?`${s(this,de)}-l`:h}
258
+ aria-label=${!this.label&&r?r:h}
259
+ aria-haspopup="listbox" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,de)}-list"
260
+ aria-activedescendant=${this.open&&this._active>=0?`${s(this,de)}-o${this._active}`:h}
261
+ aria-required=${this.required?"true":h} aria-invalid=${this.error?"true":h}
262
+ aria-disabled=${this.disabled?"true":h} aria-describedby=${i||h}
263
+ @click=${s(this,Hl)} @keydown=${s(this,Rl)} @blur=${()=>a(this,P,ks).call(this)}>
264
+ <span class="text ${t?"":"placeholder"}" id="${s(this,de)}-v">${t?a(this,P,Eu).call(this,t):this.placeholder}</span>
265
265
  <cm-icon class="chev" name="chevron-down" size="16"></cm-icon>
266
266
  </div>
267
- <ul role="listbox" id="${s(this,Q)}-list" part="listbox" tabindex="-1" aria-labelledby=${this.label?`${s(this,Q)}-l`:d}
268
- aria-label=${!this.label&&a?a:d} ?hidden=${!this.open}
269
- @pointerdown=${h=>h.preventDefault()}>
270
- ${lo(e).map((h,u)=>h.group?l`<li role="group" aria-labelledby="${s(this,Q)}-g${u}"><div role="presentation" class="gh" id="${s(this,Q)}-g${u}">${h.group}</div>
271
- <ul role="none" class="gopts">${h.rows.map(({row:m,index:y})=>c(m,y))}</ul></li>`:h.rows.map(({row:m,index:y})=>c(m,y)))}
267
+ <ul role="listbox" id="${s(this,de)}-list" part="listbox" tabindex="-1" aria-labelledby=${this.label?`${s(this,de)}-l`:h}
268
+ aria-label=${!this.label&&r?r:h} ?hidden=${!this.open}
269
+ @pointerdown=${d=>d.preventDefault()}>
270
+ ${Al(e).map((d,p)=>d.group?c`<li role="group" aria-labelledby="${s(this,de)}-g${p}"><div role="presentation" class="gh" id="${s(this,de)}-g${p}">${d.group}</div>
271
+ <ul role="none" class="gopts">${d.rows.map(({row:m,index:v})=>l(m,v))}</ul></li>`:d.rows.map(({row:m,index:v})=>l(m,v)))}
272
272
  </ul>
273
273
  </div>
274
- ${this.error?l`<p class="error" id="${s(this,Q)}-err" role="alert">${this.error}</p>`:d}
275
- ${this.helpText?l`<p class="help" id="${s(this,Q)}-help">${this.helpText}</p>`:d}
274
+ ${this.error?c`<p class="error" id="${s(this,de)}-err" role="alert">${this.error}</p>`:h}
275
+ ${this.helpText?c`<p class="help" id="${s(this,de)}-help">${this.helpText}</p>`:h}
276
276
  <slot></slot>
277
- </div>`}};Le=new WeakMap,Q=new WeakMap,Oi=new WeakMap,He=new WeakMap,qi=new WeakMap,la=new WeakMap,A=new WeakSet,nc=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i=t.parentElement?.localName==="optgroup"?t.parentElement:null,a={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled||!!i?.disabled};return i?.label&&(a.group=i.label),a}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",f(this,Oi,this.value))},oc=function(){return this.items.flatMap((e,t)=>e.disabled?[]:[t])},oa=function(e){if(this.disabled)return;let t=this.items.findIndex(i=>i.value===this.value);this.open=!0,this._active=e??(t>=0?t:o(this,A,oc).call(this)[0]??-1)},Ii=function(){this.open=!1},Jt=function(e){let t=this.items[e];!t||t.disabled||(o(this,A,Ii).call(this),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},xt=function(e){let t=o(this,A,oc).call(this);if(!t.length)return;if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let i=t.indexOf(this._active);this._active=i<0?t[0]:t[Math.min(t.length-1,Math.max(0,i+e))]},co=function(e){let t=Date.now();f(this,He,t-s(this,qi)>500?e:s(this,He)+e),f(this,qi,t);let i=this.items,a=this._active<0?0:this._active,c=s(this,He).split("").every(m=>m===s(this,He)[0]),h=c?s(this,He)[0]:s(this,He),u=c||s(this,He).length===1?a+1:a;for(let m=0;m<i.length;m++){let y=(u+m)%i.length;if(!i[y].disabled&&i[y].label.toLowerCase().startsWith(h.toLowerCase()))return y}return-1},ho=new WeakMap,ca=new WeakMap,po=new WeakMap,bh=function(e){return this.showGroup&&e.group?this.t("grouped",{group:e.group,label:e.label}):e.label},uo=new WeakMap,yt.formAssociated=!0,yt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},yt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},showGroup:{type:Boolean,attribute:"show-group"},_active:{state:!0},_slotted:{state:!0}},yt.styles=[w,Ri,b`
277
+ </div>`}};Ue=new WeakMap,de=new WeakMap,Es=new WeakMap,rt=new WeakMap,Ms=new WeakMap,dn=new WeakMap,P=new WeakSet,Bd=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i=t.parentElement?.localName==="optgroup"?t.parentElement:null,r={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled||!!i?.disabled};return i?.label&&(r.group=i.label),r}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",g(this,Es,this.value))},Fd=function(){return this.items.flatMap((e,t)=>e.disabled?[]:[t])},cn=function(e){if(this.disabled)return;let t=this.items.findIndex(i=>i.value===this.value);this.open=!0,this._active=e??(t>=0?t:a(this,P,Fd).call(this)[0]??-1)},ks=function(){this.open=!1},Ai=function(e){let t=this.items[e];!t||t.disabled||(a(this,P,ks).call(this),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},Gt=function(e){let t=a(this,P,Fd).call(this);if(!t.length)return;if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let i=t.indexOf(this._active);this._active=i<0?t[0]:t[Math.min(t.length-1,Math.max(0,i+e))]},Nl=function(e){let t=Date.now();g(this,rt,t-s(this,Ms)>500?e:s(this,rt)+e),g(this,Ms,t);let i=this.items,r=this._active<0?0:this._active,l=s(this,rt).split("").every(m=>m===s(this,rt)[0]),d=l?s(this,rt)[0]:s(this,rt),p=l||s(this,rt).length===1?r+1:r;for(let m=0;m<i.length;m++){let v=(p+m)%i.length;if(!i[v].disabled&&i[v].label.toLowerCase().startsWith(d.toLowerCase()))return v}return-1},Rl=new WeakMap,hn=new WeakMap,Hl=new WeakMap,Eu=function(e){return this.showGroup&&e.group?this.t("grouped",{group:e.group,label:e.label}):e.label},Il=new WeakMap,Xt.formAssociated=!0,Xt.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Xt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},showGroup:{type:Boolean,attribute:"show-group"},_active:{state:!0},_slotted:{state:!0}},Xt.styles=[E,ws,x`
278
278
  :host { display: block; position: relative; }
279
279
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
280
280
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); cursor: default; }
@@ -312,16 +312,16 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
312
312
  slot { display: none; }
313
313
  @media (max-width: 640px) { [role='option'] { font-size: 14px; min-height: 30px; padding-inline: var(--cm-space-15); } }
314
314
  @media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
315
- `];g("cm-select",yt);var Hf=M("search",{label:"Search",placeholder:"Search",filter:"Filter",filterApplied:"{label} ({count} applied)",clear:"Clear search"}),Bi,mo,da,de,Pi,gh,vh,lc,wt=class extends k{constructor(){super(...arguments);p(this,de);this.name="";this.value="";this.filter=!1;this.filterCount=0;this.size="default";this.disabled=!1;p(this,Bi,this.attachInternals());p(this,mo,L("cm-search"));p(this,da,"")}connectedCallback(){super.connectedCallback(),f(this,da,this.value)}get form(){return s(this,Bi).form}checkValidity(){return s(this,Bi).checkValidity()}formResetCallback(){this.value=s(this,da)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}updated(){s(this,Bi).setFormValue(this.value)}render(){let e=this.size==="large";return l`<div class="box" part="box">
315
+ `];w("cm-select",Xt);var Dv=C("search",{label:"Search",placeholder:"Search",filter:"Filter",filterApplied:"{label} ({count} applied)",clear:"Clear search"}),Cs,Pl,pn,we,Ts,Mu,Tu,jd,Jt=class extends T{constructor(){super(...arguments);u(this,we);this.name="";this.value="";this.filter=!1;this.filterCount=0;this.size="default";this.disabled=!1;u(this,Cs,this.attachInternals());u(this,Pl,D("cm-search"));u(this,pn,"")}connectedCallback(){super.connectedCallback(),g(this,pn,this.value)}get form(){return s(this,Cs).form}checkValidity(){return s(this,Cs).checkValidity()}formResetCallback(){this.value=s(this,pn)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}updated(){s(this,Cs).setFormValue(this.value)}render(){let e=this.size==="large";return c`<div class="box" part="box">
316
316
  <cm-icon class="icon" name="search" size=${e?16:14}></cm-icon>
317
- <input id=${s(this,mo)} part="input" type="search" enterkeyhint="search" autocomplete="off"
318
- aria-label=${this.label} .value=${se(this.value)} placeholder=${this.placeholder||d} ?disabled=${this.disabled}
319
- @input=${o(this,de,gh)} @change=${()=>o(this,de,Pi).call(this,"change")} @keydown=${o(this,de,vh)} />
320
- ${this.value&&!this.disabled?l`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${o(this,de,lc)}><cm-icon name="close" size="14"></cm-icon></button>`:d}
321
- ${this.filter?l`<button type="button" class="filter" part="filter" ?disabled=${this.disabled}
317
+ <input id=${s(this,Pl)} part="input" type="search" enterkeyhint="search" autocomplete="off"
318
+ aria-label=${this.label} .value=${le(this.value)} placeholder=${this.placeholder||h} ?disabled=${this.disabled}
319
+ @input=${a(this,we,Mu)} @change=${()=>a(this,we,Ts).call(this,"change")} @keydown=${a(this,we,Tu)} />
320
+ ${this.value&&!this.disabled?c`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${a(this,we,jd)}><cm-icon name="close" size="14"></cm-icon></button>`:h}
321
+ ${this.filter?c`<button type="button" class="filter" part="filter" ?disabled=${this.disabled}
322
322
  aria-label=${this.filterCount>0?this.t("filterApplied",{label:this.filterLabel,count:this.filterCount}):this.filterLabel}
323
- @click=${()=>o(this,de,Pi).call(this,"cm-filter")}><cm-icon name="filter" size="18"></cm-icon>${this.filterCount>0?l`<span class="count" aria-hidden="true">${this.filterCount}</span>`:d}</button>`:d}
324
- </div>`}};Bi=new WeakMap,mo=new WeakMap,da=new WeakMap,de=new WeakSet,Pi=function(e,t){this.dispatchEvent(t===void 0?new Event(e,{bubbles:!0,composed:!0}):new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},gh=function(e){this.value=e.target.value},vh=function(e){e.key==="Enter"?o(this,de,Pi).call(this,"cm-search",{value:this.value}):e.key==="Escape"&&this.value&&(e.preventDefault(),o(this,de,lc).call(this))},lc=function(){this.value="",this.renderRoot.querySelector("input")?.focus(),o(this,de,Pi).call(this,"input"),o(this,de,Pi).call(this,"change")},wt.formAssociated=!0,wt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},wt.properties={label:{string:"label"},name:{reflect:!0},value:{},placeholder:{string:"placeholder"},filter:{type:Boolean},filterLabel:{attribute:"filter-label",string:"filter"},filterCount:{type:Number,attribute:"filter-count"},size:{reflect:!0},disabled:{type:Boolean,reflect:!0}},wt.styles=[w,b`
323
+ @click=${()=>a(this,we,Ts).call(this,"cm-filter")}><cm-icon name="filter" size="18"></cm-icon>${this.filterCount>0?c`<span class="count" aria-hidden="true">${this.filterCount}</span>`:h}</button>`:h}
324
+ </div>`}};Cs=new WeakMap,Pl=new WeakMap,pn=new WeakMap,we=new WeakSet,Ts=function(e,t){this.dispatchEvent(t===void 0?new Event(e,{bubbles:!0,composed:!0}):new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},Mu=function(e){this.value=e.target.value},Tu=function(e){e.key==="Enter"?a(this,we,Ts).call(this,"cm-search",{value:this.value}):e.key==="Escape"&&this.value&&(e.preventDefault(),a(this,we,jd).call(this))},jd=function(){this.value="",this.renderRoot.querySelector("input")?.focus(),a(this,we,Ts).call(this,"input"),a(this,we,Ts).call(this,"change")},Jt.formAssociated=!0,Jt.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Jt.properties={label:{string:"label"},name:{reflect:!0},value:{},placeholder:{string:"placeholder"},filter:{type:Boolean},filterLabel:{attribute:"filter-label",string:"filter"},filterCount:{type:Number,attribute:"filter-count"},size:{reflect:!0},disabled:{type:Boolean,reflect:!0}},Jt.styles=[E,x`
325
325
  :host { display: block; }
326
326
  .box {
327
327
  display: flex; align-items: center; gap: var(--cm-space-10); height: 42px; padding: 0 var(--cm-space-10);
@@ -351,7 +351,7 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
351
351
  :host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
352
352
  :host([disabled]) input { color: var(--cm-text-secondary); cursor: not-allowed; }
353
353
  :host([disabled]) button { cursor: not-allowed; }
354
- `];g("cm-search",wt);var Ff=M("tag",{remove:"Remove {label}"}),fo,xh,ji=class extends k{constructor(){super(...arguments);p(this,fo);this.removable=!1;this.removeLabel="";this.disabled=!1}render(){let e=this.removeLabel||this.t("remove",{label:this.textContent?.trim()??""}).trim();return l`<span class="tag" part="tag"><span class="text"><slot @slotchange=${()=>this.requestUpdate()}></slot></span>${this.removable?l`<button type="button" part="remove" aria-label=${e} ?disabled=${this.disabled} @click=${o(this,fo,xh)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:d}</span>`}};fo=new WeakSet,xh=function(){this.disabled||this.dispatchEvent(new CustomEvent("cm-remove",{bubbles:!0,composed:!0}))},ji.properties={removable:{type:Boolean,reflect:!0},removeLabel:{attribute:"remove-label"},disabled:{type:Boolean,reflect:!0}},ji.styles=[w,b`
354
+ `];w("cm-search",Jt);var Ov=C("tag",{remove:"Remove {label}"}),Ol,Cu,_s=class extends T{constructor(){super(...arguments);u(this,Ol);this.removable=!1;this.removeLabel="";this.disabled=!1}render(){let e=this.removeLabel||this.t("remove",{label:this.textContent?.trim()??""}).trim();return c`<span class="tag" part="tag"><span class="text"><slot @slotchange=${()=>this.requestUpdate()}></slot></span>${this.removable?c`<button type="button" part="remove" aria-label=${e} ?disabled=${this.disabled} @click=${a(this,Ol,Cu)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:h}</span>`}};Ol=new WeakSet,Cu=function(){this.disabled||this.dispatchEvent(new CustomEvent("cm-remove",{bubbles:!0,composed:!0}))},_s.properties={removable:{type:Boolean,reflect:!0},removeLabel:{attribute:"remove-label"},disabled:{type:Boolean,reflect:!0}},_s.styles=[E,x`
355
355
  :host { display: inline-flex; vertical-align: middle; max-width: 100%; }
356
356
  .tag {
357
357
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 26px; padding: 0 var(--cm-space-10);
@@ -369,13 +369,13 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
369
369
  :host([disabled]) .tag { color: var(--cm-text-secondary); border-color: var(--cm-border-default); }
370
370
  :host([disabled]) button { cursor: not-allowed; color: var(--cm-text-secondary); }
371
371
  @media (max-width: 640px) { .tag { height: 22px; } button { width: 18px; height: 18px; } }
372
- `];g("cm-tag",ji);var Fi=class extends k{constructor(){super(...arguments);this.size="large"}render(){let e=this.size==="small"?2.5:3;return l`<span class="spinner" part="spinner" role="status">
372
+ `];w("cm-tag",_s);var Ls=class extends T{constructor(){super(...arguments);this.size="large"}render(){let e=this.size==="small"?2.5:3;return c`<span class="spinner" part="spinner" role="status">
373
373
  <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
374
374
  <circle class="track" cx="12" cy="12" r="10" fill="none" stroke-width=${e}></circle>
375
375
  <path class="arc" d="M12 2a10 10 0 0 1 10 10" fill="none" stroke-width=${e} stroke-linecap="round"></path>
376
376
  </svg>
377
377
  <span class="vh">${this.accessibleLabel||this.t("loading")}</span>
378
- </span>`}};Fi.properties={size:{reflect:!0},accessibleLabel:{attribute:"accessible-label",string:"loading"}},Fi.styles=[w,b`
378
+ </span>`}};Ls.properties={size:{reflect:!0},accessibleLabel:{attribute:"accessible-label",string:"loading"}},Ls.styles=[E,x`
379
379
  :host { display: inline-flex; vertical-align: middle; color: var(--cm-border-strong); }
380
380
  .spinner { display: inline-flex; }
381
381
  svg { inline-size: 44px; block-size: 44px; animation: spin 0.8s linear infinite; }
@@ -388,43 +388,43 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
388
388
  }
389
389
  @keyframes spin { to { transform: rotate(360deg); } }
390
390
  @media (prefers-reduced-motion: reduce) { svg { animation-duration: 2.4s; } }
391
- `];g("cm-spinner",Fi);var ib=M("combobox",{noResults:"No results",results:{one:"{count} result",other:"{count} results"},add:"Add \u201C{value}\u201D",remove:"Remove {label}",required:"Please select an item in the list.",requiredMultiple:"Choose at least one item.",grouped:"{group}: {label}"}),be,ee,fa,Ki,ba,ga,va,C,cc,yh,ha,bo,pa,Vi,Ui,$t,wh,ua,dc,hc,ma,go,vo,xo,$h,kt=class extends k{constructor(){super(...arguments);p(this,C);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.values=[];this.placeholder="";this.options=[];this.multiple=!1;this.allowCustom=!1;this.filter="contains";this.loading=!1;this.required=!1;this.disabled=!1;this.open=!1;this.showGroup=!1;this._query="";this._active=-1;this._slotted=[];this._typing=!1;p(this,be,this.attachInternals());p(this,ee,L("cm-cb"));p(this,fa,null);p(this,Ki,new Map);p(this,ba,new Map);p(this,ga,new MutationObserver(()=>o(this,C,cc).call(this)));p(this,va);p(this,go,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,o(this,C,Ui).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});p(this,vo,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?o(this,C,ua).call(this,1):(o(this,C,Ui).call(this),e.altKey||o(this,C,ua).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?o(this,C,ua).call(this,-1):(o(this,C,Ui).call(this),o(this,C,ua).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),o(this,C,dc).call(this,this._active)):s(this,C,bo)&&(e.preventDefault(),o(this,C,hc).call(this,s(this,C,bo)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),o(this,C,$t).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",o(this,C,Vi).call(this)));break;case"Backspace":this.multiple&&!this._query&&this.values.length&&(e.preventDefault(),this.removeValue(this.values[this.values.length-1]));break;case"Tab":o(this,C,$t).call(this);break;default:}});p(this,xo,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(o(this,C,$t).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?o(this,C,ha).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),o(this,C,cc).call(this),s(this,ga).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),f(this,va,oo(this,()=>this.open,()=>o(this,C,$t).call(this)))}disconnectedCallback(){var e;super.disconnectedCallback(),s(this,ga).disconnect(),(e=s(this,va))==null||e.call(this)}get form(){return s(this,be).form}get validity(){return s(this,be).validity}get validationMessage(){return s(this,be).validationMessage}checkValidity(){return s(this,be).checkValidity()}reportValidity(){return s(this,be).reportValidity()}formResetCallback(){let e=s(this,fa)??{value:"",values:[]};this.value=e.value,this.values=[...e.values],this._query="",this._typing=!1,this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){typeof e=="string"&&(this.multiple?this.values=e?e.split(`
392
- `):[]:this.value=e)}get items(){return this.options?.length?Hi(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):Hi(this._slotted)}get filteredItems(){let e=this._typing?this._query.trim().toLowerCase():"";return!e||this.filter==="none"?this.items:this.items.filter(t=>{let i=t.label.toLowerCase();return this.filter==="starts-with"?i.startsWith(e):i.includes(e)})}firstUpdated(){f(this,fa,{value:this.value,values:[...this.values]})}willUpdate(e){for(let t of this.items)s(this,Ki).set(t.value,t.label),t.group&&s(this,ba).set(t.value,t.group);if((e.has("value")||e.has("options")||e.has("_slotted")||e.has("showGroup"))&&!this.multiple&&!this._typing&&(this._query=this.value?o(this,C,ha).call(this,this.value):""),e.has("_query")||e.has("options")||e.has("_slotted")||e.has("loading")){let t=o(this,C,pa).call(this);this._active>=t.length&&(this._active=-1)}}updated(e){let t=this.renderRoot.querySelector("input")??void 0;if(this.multiple)if(this.name&&this.values.length){let a=new FormData;for(let c of this.values)a.append(this.name,c);s(this,be).setFormValue(a,this.values.join(`
393
- `))}else s(this,be).setFormValue(null);else s(this,be).setFormValue(this.value||null,this.value);let i=this.multiple?!this.values.length:!this.value;this.error?s(this,be).setValidity({customError:!0},this.error,t):this.required&&i?s(this,be).setValidity({valueMissing:!0},this.t(this.multiple?"requiredMultiple":"required"),t):s(this,be).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${s(this,ee)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}removeValue(e){this.values.includes(e)&&(this.values=this.values.filter(t=>t!==e),o(this,C,Vi).call(this))}render(){let e=o(this,C,pa).call(this),t=[this.error&&`${s(this,ee)}-err`,this.helpText&&`${s(this,ee)}-help`].filter(Boolean).join(" "),i=this.getAttribute("aria-label"),a=u=>this.multiple?this.values.includes(u):u===this.value,c=(u,m)=>l`<li role="option" id="${s(this,ee)}-o${m}" class=${m===this._active?"active":""}
394
- aria-selected=${u.create?"false":a(u.value)?"true":"false"} aria-disabled=${u.disabled?"true":d}
395
- @pointerenter=${()=>!u.disabled&&(this._active=m)} @click=${()=>o(this,C,dc).call(this,m)}>
396
- ${u.create?l`<cm-icon name="plus" size="16"></cm-icon><span class="create">${this.t("add",{value:u.label})}</span>`:l`${this.multiple?l`<cm-icon class="check" name="check" size="16"></cm-icon>`:d}<span>${o(this,C,$h).call(this,u.label)}</span>`}</li>`,h=this.loading?this.loadingText||this.t("loading"):this.open?e.length?this.t("results",{count:e.length}):this.emptyText||this.t("noResults"):"";return l`<div class="field">
397
- ${this.label?l`<label class="label" id="${s(this,ee)}-l" for="${s(this,ee)}-in" part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</label>`:d}
391
+ `];w("cm-spinner",Ls);var Zv=C("combobox",{noResults:"No results",results:{one:"{count} result",other:"{count} results"},add:"Add \u201C{value}\u201D",remove:"Remove {label}",required:"Please select an item in the list.",requiredMultiple:"Choose at least one item.",grouped:"{group}: {label}"}),Le,he,bn,Ds,vn,xn,yn,S,Vd,_u,un,ql,mn,Ss,zs,Zt,Lu,fn,Ud,Kd,gn,Bl,Fl,jl,Su,Qt=class extends T{constructor(){super(...arguments);u(this,S);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.values=[];this.placeholder="";this.options=[];this.multiple=!1;this.allowCustom=!1;this.filter="contains";this.loading=!1;this.required=!1;this.disabled=!1;this.open=!1;this.showGroup=!1;this._query="";this._active=-1;this._slotted=[];this._typing=!1;u(this,Le,this.attachInternals());u(this,he,D("cm-cb"));u(this,bn,null);u(this,Ds,new Map);u(this,vn,new Map);u(this,xn,new MutationObserver(()=>a(this,S,Vd).call(this)));u(this,yn);u(this,Bl,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,a(this,S,zs).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});u(this,Fl,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?a(this,S,fn).call(this,1):(a(this,S,zs).call(this),e.altKey||a(this,S,fn).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?a(this,S,fn).call(this,-1):(a(this,S,zs).call(this),a(this,S,fn).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),a(this,S,Ud).call(this,this._active)):s(this,S,ql)&&(e.preventDefault(),a(this,S,Kd).call(this,s(this,S,ql)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),a(this,S,Zt).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",a(this,S,Ss).call(this)));break;case"Backspace":this.multiple&&!this._query&&this.values.length&&(e.preventDefault(),this.removeValue(this.values[this.values.length-1]));break;case"Tab":a(this,S,Zt).call(this);break;default:}});u(this,jl,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(a(this,S,Zt).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?a(this,S,un).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),a(this,S,Vd).call(this),s(this,xn).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),g(this,yn,Dl(this,()=>this.open,()=>a(this,S,Zt).call(this)))}disconnectedCallback(){var e;super.disconnectedCallback(),s(this,xn).disconnect(),(e=s(this,yn))==null||e.call(this)}get form(){return s(this,Le).form}get validity(){return s(this,Le).validity}get validationMessage(){return s(this,Le).validationMessage}checkValidity(){return s(this,Le).checkValidity()}reportValidity(){return s(this,Le).reportValidity()}formResetCallback(){let e=s(this,bn)??{value:"",values:[]};this.value=e.value,this.values=[...e.values],this._query="",this._typing=!1,this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){typeof e=="string"&&(this.multiple?this.values=e?e.split(`
392
+ `):[]:this.value=e)}get items(){return this.options?.length?$s(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):$s(this._slotted)}get filteredItems(){let e=this._typing?this._query.trim().toLowerCase():"";return!e||this.filter==="none"?this.items:this.items.filter(t=>{let i=t.label.toLowerCase();return this.filter==="starts-with"?i.startsWith(e):i.includes(e)})}firstUpdated(){g(this,bn,{value:this.value,values:[...this.values]})}willUpdate(e){for(let t of this.items)s(this,Ds).set(t.value,t.label),t.group&&s(this,vn).set(t.value,t.group);if((e.has("value")||e.has("options")||e.has("_slotted")||e.has("showGroup"))&&!this.multiple&&!this._typing&&(this._query=this.value?a(this,S,un).call(this,this.value):""),e.has("_query")||e.has("options")||e.has("_slotted")||e.has("loading")){let t=a(this,S,mn).call(this);this._active>=t.length&&(this._active=-1)}}updated(e){let t=this.renderRoot.querySelector("input")??void 0;if(this.multiple)if(this.name&&this.values.length){let r=new FormData;for(let l of this.values)r.append(this.name,l);s(this,Le).setFormValue(r,this.values.join(`
393
+ `))}else s(this,Le).setFormValue(null);else s(this,Le).setFormValue(this.value||null,this.value);let i=this.multiple?!this.values.length:!this.value;this.error?s(this,Le).setValidity({customError:!0},this.error,t):this.required&&i?s(this,Le).setValidity({valueMissing:!0},this.t(this.multiple?"requiredMultiple":"required"),t):s(this,Le).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${s(this,he)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}removeValue(e){this.values.includes(e)&&(this.values=this.values.filter(t=>t!==e),a(this,S,Ss).call(this))}render(){let e=a(this,S,mn).call(this),t=[this.error&&`${s(this,he)}-err`,this.helpText&&`${s(this,he)}-help`].filter(Boolean).join(" "),i=this.getAttribute("aria-label"),r=p=>this.multiple?this.values.includes(p):p===this.value,l=(p,m)=>c`<li role="option" id="${s(this,he)}-o${m}" class=${m===this._active?"active":""}
394
+ aria-selected=${p.create?"false":r(p.value)?"true":"false"} aria-disabled=${p.disabled?"true":h}
395
+ @pointerenter=${()=>!p.disabled&&(this._active=m)} @click=${()=>a(this,S,Ud).call(this,m)}>
396
+ ${p.create?c`<cm-icon name="plus" size="16"></cm-icon><span class="create">${this.t("add",{value:p.label})}</span>`:c`${this.multiple?c`<cm-icon class="check" name="check" size="16"></cm-icon>`:h}<span>${a(this,S,Su).call(this,p.label)}</span>`}</li>`,d=this.loading?this.loadingText||this.t("loading"):this.open?e.length?this.t("results",{count:e.length}):this.emptyText||this.t("noResults"):"";return c`<div class="field">
397
+ ${this.label?c`<label class="label" id="${s(this,he)}-l" for="${s(this,he)}-in" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</label>`:h}
398
398
  <div class="wrap">
399
- <div class="box" part="box" @click=${u=>{u.target.closest("cm-tag")||o(this,C,ma).call(this)}}>
400
- ${this.multiple?this.values.map(u=>l`<cm-tag removable ?disabled=${this.disabled} remove-label=${this.t("remove",{label:o(this,C,ha).call(this,u)})}
401
- @cm-remove=${()=>{this.removeValue(u),o(this,C,ma).call(this)}}>${o(this,C,ha).call(this,u)}</cm-tag>`):d}
402
- <input id="${s(this,ee)}-in" part="input" type="text" role="combobox" autocomplete="off" spellcheck="false"
403
- .value=${se(this._query)} placeholder=${this.multiple&&this.values.length?d:this.placeholder||d}
404
- aria-label=${!this.label&&i?i:d}
405
- aria-autocomplete="list" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,ee)}-list"
406
- aria-activedescendant=${this.open&&this._active>=0?`${s(this,ee)}-o${this._active}`:d}
407
- aria-invalid=${this.error?"true":d} aria-describedby=${t||d}
408
- aria-required=${this.required?"true":d} ?disabled=${this.disabled}
409
- @input=${s(this,go)} @keydown=${s(this,vo)} @blur=${s(this,xo)}
410
- @click=${()=>{this.open||o(this,C,Ui).call(this)}} @change=${u=>u.stopPropagation()} />
411
- <cm-icon class="chev" name="chevron-down" size="16" @click=${()=>{this.open?o(this,C,$t).call(this):(o(this,C,Ui).call(this),o(this,C,ma).call(this))}}></cm-icon>
399
+ <div class="box" part="box" @click=${p=>{p.target.closest("cm-tag")||a(this,S,gn).call(this)}}>
400
+ ${this.multiple?this.values.map(p=>c`<cm-tag removable ?disabled=${this.disabled} remove-label=${this.t("remove",{label:a(this,S,un).call(this,p)})}
401
+ @cm-remove=${()=>{this.removeValue(p),a(this,S,gn).call(this)}}>${a(this,S,un).call(this,p)}</cm-tag>`):h}
402
+ <input id="${s(this,he)}-in" part="input" type="text" role="combobox" autocomplete="off" spellcheck="false"
403
+ .value=${le(this._query)} placeholder=${this.multiple&&this.values.length?h:this.placeholder||h}
404
+ aria-label=${!this.label&&i?i:h}
405
+ aria-autocomplete="list" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,he)}-list"
406
+ aria-activedescendant=${this.open&&this._active>=0?`${s(this,he)}-o${this._active}`:h}
407
+ aria-invalid=${this.error?"true":h} aria-describedby=${t||h}
408
+ aria-required=${this.required?"true":h} ?disabled=${this.disabled}
409
+ @input=${s(this,Bl)} @keydown=${s(this,Fl)} @blur=${s(this,jl)}
410
+ @click=${()=>{this.open||a(this,S,zs).call(this)}} @change=${p=>p.stopPropagation()} />
411
+ <cm-icon class="chev" name="chevron-down" size="16" @click=${()=>{this.open?a(this,S,Zt).call(this):(a(this,S,zs).call(this),a(this,S,gn).call(this))}}></cm-icon>
412
412
  </div>
413
- <div class="pop" part="popover" ?hidden=${!this.open} @pointerdown=${u=>u.preventDefault()}>
414
- <ul role="listbox" id="${s(this,ee)}-list" part="listbox" ?hidden=${!e.length}
415
- aria-labelledby=${this.label?`${s(this,ee)}-l`:d} aria-label=${!this.label&&i?i:d}
416
- aria-multiselectable=${this.multiple?"true":d}>
417
- ${lo(e).map((u,m)=>u.group?l`<li role="group" aria-labelledby="${s(this,ee)}-g${m}"><div role="presentation" class="gh" id="${s(this,ee)}-g${m}">${u.group}</div>
418
- <ul role="none" class="gopts">${u.rows.map(({row:y,index:v})=>c(y,v))}</ul></li>`:u.rows.map(({row:y,index:v})=>c(y,v)))}
413
+ <div class="pop" part="popover" ?hidden=${!this.open} @pointerdown=${p=>p.preventDefault()}>
414
+ <ul role="listbox" id="${s(this,he)}-list" part="listbox" ?hidden=${!e.length}
415
+ aria-labelledby=${this.label?`${s(this,he)}-l`:h} aria-label=${!this.label&&i?i:h}
416
+ aria-multiselectable=${this.multiple?"true":h}>
417
+ ${Al(e).map((p,m)=>p.group?c`<li role="group" aria-labelledby="${s(this,he)}-g${m}"><div role="presentation" class="gh" id="${s(this,he)}-g${m}">${p.group}</div>
418
+ <ul role="none" class="gopts">${p.rows.map(({row:v,index:b})=>l(v,b))}</ul></li>`:p.rows.map(({row:v,index:b})=>l(v,b)))}
419
419
  </ul>
420
- ${this.loading?l`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText||this.t("loading")}</span></p>`:e.length?d:l`<p class="message">${this.emptyText||this.t("noResults")}</p>`}
420
+ ${this.loading?c`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText||this.t("loading")}</span></p>`:e.length?h:c`<p class="message">${this.emptyText||this.t("noResults")}</p>`}
421
421
  </div>
422
422
  </div>
423
- <span class="vh" role="status" aria-live="polite">${h}</span>
424
- ${this.error?l`<p class="error" id="${s(this,ee)}-err" role="alert">${this.error}</p>`:d}
425
- ${this.helpText?l`<p class="help" id="${s(this,ee)}-help">${this.helpText}</p>`:d}
423
+ <span class="vh" role="status" aria-live="polite">${d}</span>
424
+ ${this.error?c`<p class="error" id="${s(this,he)}-err" role="alert">${this.error}</p>`:h}
425
+ ${this.helpText?c`<p class="help" id="${s(this,he)}-help">${this.helpText}</p>`:h}
426
426
  <slot></slot>
427
- </div>`}};be=new WeakMap,ee=new WeakMap,fa=new WeakMap,Ki=new WeakMap,ba=new WeakMap,ga=new WeakMap,va=new WeakMap,C=new WeakSet,cc=function(){let e=[...this.querySelectorAll("option")];if(this._slotted=e.map(t=>{let i=t.parentElement?.localName==="optgroup"?t.parentElement:null,a={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled||!!i?.disabled};return i?.label&&(a.group=i.label),a}),!this.hasUpdated){let t=e.filter(i=>i.hasAttribute("selected")).map(i=>i.value);this.multiple&&!this.values.length&&t.length&&(this.values=t),!this.multiple&&!this.value&&t.length&&(this.value=t[0])}},yh=function(e){return this.items.find(t=>t.value===e)?.label??s(this,Ki).get(e)??e},ha=function(e){let t=o(this,C,yh).call(this,e);if(!this.showGroup)return t;let i=this.items.find(a=>a.value===e)?.group??s(this,ba).get(e);return i?this.t("grouped",{group:i,label:t}):t},bo=function(){if(!this.allowCustom||!this._typing)return"";let e=this._query.trim();if(!e)return"";let t=e.toLowerCase();return this.items.some(i=>i.label.toLowerCase()===t||i.value.toLowerCase()===t)||(this.multiple?this.values.some(i=>i.toLowerCase()===t):this.value.toLowerCase()===t)?"":e},pa=function(){let e=this.loading?[]:[...this.filteredItems],t=s(this,C,bo);return t&&!this.loading&&e.push({value:t,label:t,create:!0}),e},Vi=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Ui=function(){this.disabled||(this.open=!0)},$t=function(){this.open=!1,this._active=-1},wh=function(e=o(this,C,pa).call(this)){return e.flatMap((t,i)=>t.disabled?[]:[i])},ua=function(e){let t=o(this,C,wh).call(this);if(!t.length){this._active=-1;return}if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let i=t.indexOf(this._active);if(i<0){this._active=e>0?t[0]:t[t.length-1];return}this._active=t[(i+e+t.length)%t.length]},dc=function(e){let t=o(this,C,pa).call(this)[e];if(!(!t||t.disabled)){if(t.create){o(this,C,hc).call(this,t.value);return}if(this.multiple){this.values=this.values.includes(t.value)?this.values.filter(i=>i!==t.value):[...this.values,t.value],this._query="",this._typing=!1,this._active=-1,o(this,C,Vi).call(this),o(this,C,ma).call(this);return}o(this,C,$t).call(this),this._typing=!1,this._query=this.showGroup&&t.group?this.t("grouped",{group:t.group,label:t.label}):t.label,t.value!==this.value&&(this.value=t.value,o(this,C,Vi).call(this))}},hc=function(e){this.dispatchEvent(new CustomEvent("cm-create",{detail:{value:e},bubbles:!0,composed:!0,cancelable:!0}))&&(s(this,Ki).set(e,e),this.multiple?(this.values=[...this.values,e],this._query="",this._typing=!1,this._active=-1):(o(this,C,$t).call(this),this.value=e,this._typing=!1,this._query=e),o(this,C,Vi).call(this))},ma=function(){this.renderRoot.querySelector("input")?.focus()},go=new WeakMap,vo=new WeakMap,xo=new WeakMap,$h=function(e){let t=this._typing?this._query.trim():"";if(!t||this.filter==="none")return e;let i=e.toLowerCase().indexOf(t.toLowerCase());return i<0||this.filter==="starts-with"&&i!==0?e:l`${e.slice(0,i)}<mark>${e.slice(i,i+t.length)}</mark>${e.slice(i+t.length)}`},kt.formAssociated=!0,kt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},kt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},values:{type:Array},placeholder:{},options:{type:Array},multiple:{type:Boolean,reflect:!0},allowCustom:{type:Boolean,attribute:"allow-custom"},filter:{},loading:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},showGroup:{type:Boolean,attribute:"show-group"},_query:{state:!0},_active:{state:!0},_slotted:{state:!0},_typing:{state:!0}},kt.styles=[w,no,Ri,b`
427
+ </div>`}};Le=new WeakMap,he=new WeakMap,bn=new WeakMap,Ds=new WeakMap,vn=new WeakMap,xn=new WeakMap,yn=new WeakMap,S=new WeakSet,Vd=function(){let e=[...this.querySelectorAll("option")];if(this._slotted=e.map(t=>{let i=t.parentElement?.localName==="optgroup"?t.parentElement:null,r={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled||!!i?.disabled};return i?.label&&(r.group=i.label),r}),!this.hasUpdated){let t=e.filter(i=>i.hasAttribute("selected")).map(i=>i.value);this.multiple&&!this.values.length&&t.length&&(this.values=t),!this.multiple&&!this.value&&t.length&&(this.value=t[0])}},_u=function(e){return this.items.find(t=>t.value===e)?.label??s(this,Ds).get(e)??e},un=function(e){let t=a(this,S,_u).call(this,e);if(!this.showGroup)return t;let i=this.items.find(r=>r.value===e)?.group??s(this,vn).get(e);return i?this.t("grouped",{group:i,label:t}):t},ql=function(){if(!this.allowCustom||!this._typing)return"";let e=this._query.trim();if(!e)return"";let t=e.toLowerCase();return this.items.some(i=>i.label.toLowerCase()===t||i.value.toLowerCase()===t)||(this.multiple?this.values.some(i=>i.toLowerCase()===t):this.value.toLowerCase()===t)?"":e},mn=function(){let e=this.loading?[]:[...this.filteredItems],t=s(this,S,ql);return t&&!this.loading&&e.push({value:t,label:t,create:!0}),e},Ss=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},zs=function(){this.disabled||(this.open=!0)},Zt=function(){this.open=!1,this._active=-1},Lu=function(e=a(this,S,mn).call(this)){return e.flatMap((t,i)=>t.disabled?[]:[i])},fn=function(e){let t=a(this,S,Lu).call(this);if(!t.length){this._active=-1;return}if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let i=t.indexOf(this._active);if(i<0){this._active=e>0?t[0]:t[t.length-1];return}this._active=t[(i+e+t.length)%t.length]},Ud=function(e){let t=a(this,S,mn).call(this)[e];if(!(!t||t.disabled)){if(t.create){a(this,S,Kd).call(this,t.value);return}if(this.multiple){this.values=this.values.includes(t.value)?this.values.filter(i=>i!==t.value):[...this.values,t.value],this._query="",this._typing=!1,this._active=-1,a(this,S,Ss).call(this),a(this,S,gn).call(this);return}a(this,S,Zt).call(this),this._typing=!1,this._query=this.showGroup&&t.group?this.t("grouped",{group:t.group,label:t.label}):t.label,t.value!==this.value&&(this.value=t.value,a(this,S,Ss).call(this))}},Kd=function(e){this.dispatchEvent(new CustomEvent("cm-create",{detail:{value:e},bubbles:!0,composed:!0,cancelable:!0}))&&(s(this,Ds).set(e,e),this.multiple?(this.values=[...this.values,e],this._query="",this._typing=!1,this._active=-1):(a(this,S,Zt).call(this),this.value=e,this._typing=!1,this._query=e),a(this,S,Ss).call(this))},gn=function(){this.renderRoot.querySelector("input")?.focus()},Bl=new WeakMap,Fl=new WeakMap,jl=new WeakMap,Su=function(e){let t=this._typing?this._query.trim():"";if(!t||this.filter==="none")return e;let i=e.toLowerCase().indexOf(t.toLowerCase());return i<0||this.filter==="starts-with"&&i!==0?e:c`${e.slice(0,i)}<mark>${e.slice(i,i+t.length)}</mark>${e.slice(i+t.length)}`},Qt.formAssociated=!0,Qt.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Qt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},values:{type:Array},placeholder:{},options:{type:Array},multiple:{type:Boolean,reflect:!0},allowCustom:{type:Boolean,attribute:"allow-custom"},filter:{},loading:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},showGroup:{type:Boolean,attribute:"show-group"},_query:{state:!0},_active:{state:!0},_slotted:{state:!0},_typing:{state:!0}},Qt.styles=[E,zl,ws,x`
428
428
  :host { display: block; position: relative; }
429
429
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
430
430
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -466,32 +466,32 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
466
466
  slot { display: none; }
467
467
  @media (max-width: 640px) { [role='option'] { font-size: 14px; min-height: 30px; padding-inline: var(--cm-space-15); } }
468
468
  @media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
469
- `];g("cm-combobox",kt);var db=M("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),Se,xa,B,yo,wo,Gi,pc,$o,kh,ko,ya,uc,Eh,Zt=class extends k{constructor(){super(...arguments);p(this,B);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;p(this,Se,L("cm-gs"));p(this,xa);p(this,$o,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),o(this,B,pc).call(this)});p(this,ko,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),o(this,B,kh).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":s(this,B,wo)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${s(this,Se)}-o${this._active}`)?.click());break;case"Escape":s(this,B,wo)?(e.preventDefault(),e.stopPropagation(),o(this,B,Gi).call(this)):this.value&&(e.preventDefault(),o(this,B,uc).call(this,!1));break;case"Tab":o(this,B,Gi).call(this);break;default:}});p(this,ya,e=>{if(!this.shortcut||e.key!==this.shortcut||e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented)return;let t=e.composedPath()[0];t&&(t.isContentEditable||/^(input|textarea|select)$/i.test(t.localName??""))||this.getClientRects().length&&(e.preventDefault(),this.focus())})}connectedCallback(){super.connectedCallback(),f(this,xa,oo(this,()=>this.open,()=>o(this,B,Gi).call(this))),document.addEventListener("keydown",s(this,ya))}disconnectedCallback(){var e;super.disconnectedCallback(),(e=s(this,xa))==null||e.call(this),document.removeEventListener("keydown",s(this,ya))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=o(this,B,yo).call(this).length&&(this._active=-1)}updated(e){(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${s(this,Se)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=o(this,B,yo).call(this),t=s(this,B,wo),i=e.filter(m=>m.item).length,a=this.loading&&t?this.loadingText:t?e.length?this.t("results",{count:i}):this.emptyText:"",c=-1,h=(this.results??[]).filter(m=>m?.items?.length),u=(m,y,v="")=>{c++;let E=c;return l`<a role="option" id="${s(this,Se)}-o${E}" class="${v}${E===this._active?" active":""}" href=${m.href} tabindex="-1"
470
- aria-selected=${E===this._active?"true":"false"} @pointerenter=${()=>this._active=E}
471
- @click=${$=>o(this,B,Eh).call(this,$,m)}>${y}</a>`};return l`<div class="wrap">
469
+ `];w("cm-combobox",Qt);var nx=C("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),Ke,wn,Y,Vl,Ul,As,Wd,Kl,zu,Wl,$n,Yd,Du,Ni=class extends T{constructor(){super(...arguments);u(this,Y);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;u(this,Ke,D("cm-gs"));u(this,wn);u(this,Kl,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),a(this,Y,Wd).call(this)});u(this,Wl,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),a(this,Y,zu).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":s(this,Y,Ul)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${s(this,Ke)}-o${this._active}`)?.click());break;case"Escape":s(this,Y,Ul)?(e.preventDefault(),e.stopPropagation(),a(this,Y,As).call(this)):this.value&&(e.preventDefault(),a(this,Y,Yd).call(this,!1));break;case"Tab":a(this,Y,As).call(this);break;default:}});u(this,$n,e=>{if(!this.shortcut||e.key!==this.shortcut||e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented)return;let t=e.composedPath()[0];t&&(t.isContentEditable||/^(input|textarea|select)$/i.test(t.localName??""))||this.getClientRects().length&&(e.preventDefault(),this.focus())})}connectedCallback(){super.connectedCallback(),g(this,wn,Dl(this,()=>this.open,()=>a(this,Y,As).call(this))),document.addEventListener("keydown",s(this,$n))}disconnectedCallback(){var e;super.disconnectedCallback(),(e=s(this,wn))==null||e.call(this),document.removeEventListener("keydown",s(this,$n))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=a(this,Y,Vl).call(this).length&&(this._active=-1)}updated(e){(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${s(this,Ke)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=a(this,Y,Vl).call(this),t=s(this,Y,Ul),i=e.filter(m=>m.item).length,r=this.loading&&t?this.loadingText:t?e.length?this.t("results",{count:i}):this.emptyText:"",l=-1,d=(this.results??[]).filter(m=>m?.items?.length),p=(m,v,b="")=>{l++;let $=l;return c`<a role="option" id="${s(this,Ke)}-o${$}" class="${b}${$===this._active?" active":""}" href=${m.href} tabindex="-1"
470
+ aria-selected=${$===this._active?"true":"false"} @pointerenter=${()=>this._active=$}
471
+ @click=${y=>a(this,Y,Du).call(this,y,m)}>${v}</a>`};return c`<div class="wrap">
472
472
  <div class="box" part="box" @click=${m=>{m.target===m.currentTarget&&this.focus()}}>
473
473
  <cm-icon class="icon" name="search" size="14"></cm-icon>
474
- <input id="${s(this,Se)}-in" part="input" type="search" role="combobox" enterkeyhint="search" autocomplete="off" spellcheck="false"
475
- aria-label=${this.label} placeholder=${this.placeholder||d} .value=${se(this.value)}
476
- aria-autocomplete="list" aria-expanded=${t?"true":"false"} aria-controls="${s(this,Se)}-list"
477
- aria-activedescendant=${t&&this._active>=0?`${s(this,Se)}-o${this._active}`:d}
478
- aria-keyshortcuts=${this.shortcut||d}
479
- @input=${s(this,$o)} @keydown=${s(this,ko)}
474
+ <input id="${s(this,Ke)}-in" part="input" type="search" role="combobox" enterkeyhint="search" autocomplete="off" spellcheck="false"
475
+ aria-label=${this.label} placeholder=${this.placeholder||h} .value=${le(this.value)}
476
+ aria-autocomplete="list" aria-expanded=${t?"true":"false"} aria-controls="${s(this,Ke)}-list"
477
+ aria-activedescendant=${t&&this._active>=0?`${s(this,Ke)}-o${this._active}`:h}
478
+ aria-keyshortcuts=${this.shortcut||h}
479
+ @input=${s(this,Kl)} @keydown=${s(this,Wl)}
480
480
  @focus=${()=>{this.value.trim()&&(this.open=!0)}} @click=${()=>{this.value.trim()&&(this.open=!0)}} />
481
- ${this.value?l`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${()=>o(this,B,uc).call(this)}><cm-icon name="close" size="14"></cm-icon></button>`:this.shortcut?l`<kbd aria-hidden="true">${this.shortcut}</kbd>`:d}
481
+ ${this.value?c`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${()=>a(this,Y,Yd).call(this)}><cm-icon name="close" size="14"></cm-icon></button>`:this.shortcut?c`<kbd aria-hidden="true">${this.shortcut}</kbd>`:h}
482
482
  </div>
483
483
  <div class="pop" part="popover" ?hidden=${!t} @pointerdown=${m=>m.preventDefault()}>
484
- <div role="listbox" id="${s(this,Se)}-list" part="listbox" aria-label=${this.label} ?hidden=${!e.length}>
485
- ${h.map((m,y)=>{let v=m.total??m.items.length;return l`<div role="group" aria-labelledby="${s(this,Se)}-g${y}">
486
- <div role="presentation" class="gh" id="${s(this,Se)}-g${y}"><span>${m.label}</span><span class="count" aria-hidden="true">${this.formatNumber(v)}</span><span class="vh">, ${this.t("results",{count:v})}</span></div>
487
- ${m.items.map(E=>u({group:m,item:E,href:E.href},l`${E.icon?l`<cm-icon name=${E.icon} size="16"></cm-icon>`:d}<span class="text"><span class="title">${E.title}</span>${E.description?l`<span class="vh">, </span><span class="desc">${E.description}</span>`:d}</span>`))}
488
- ${m.href?u({group:m,href:m.href},l`<span class="text">${m.seeAllLabel||this.seeAllLabel}</span>`,"all"):d}
484
+ <div role="listbox" id="${s(this,Ke)}-list" part="listbox" aria-label=${this.label} ?hidden=${!e.length}>
485
+ ${d.map((m,v)=>{let b=m.total??m.items.length;return c`<div role="group" aria-labelledby="${s(this,Ke)}-g${v}">
486
+ <div role="presentation" class="gh" id="${s(this,Ke)}-g${v}"><span>${m.label}</span><span class="count" aria-hidden="true">${this.formatNumber(b)}</span><span class="vh">, ${this.t("results",{count:b})}</span></div>
487
+ ${m.items.map($=>p({group:m,item:$,href:$.href},c`${$.icon?c`<cm-icon name=${$.icon} size="16"></cm-icon>`:h}<span class="text"><span class="title">${$.title}</span>${$.description?c`<span class="vh">, </span><span class="desc">${$.description}</span>`:h}</span>`))}
488
+ ${m.href?p({group:m,href:m.href},c`<span class="text">${m.seeAllLabel||this.seeAllLabel}</span>`,"all"):h}
489
489
  </div>`})}
490
490
  </div>
491
- ${this.loading?l`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText}</span></p>`:e.length?d:l`<p class="message" aria-hidden="true">${this.emptyText}</p>`}
491
+ ${this.loading?c`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText}</span></p>`:e.length?h:c`<p class="message" aria-hidden="true">${this.emptyText}</p>`}
492
492
  </div>
493
- <span class="vh" role="status" aria-live="polite">${a}</span>
494
- </div>`}};Se=new WeakMap,xa=new WeakMap,B=new WeakSet,yo=function(){return this.loading?[]:(this.results??[]).filter(e=>e?.items?.length).flatMap(e=>[...e.items.map(t=>({group:e,item:t,href:t.href})),...e.href?[{group:e,href:e.href}]:[]])},wo=function(){return this.open&&!!this.value.trim()},Gi=function(){this.open=!1,this._active=-1},pc=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},$o=new WeakMap,kh=function(e){let t=o(this,B,yo).call(this).length;if(!t){this._active=-1;return}this._active<0?this._active=e>0?0:t-1:this._active=(this._active+e+t)%t},ko=new WeakMap,ya=new WeakMap,uc=function(e=!0){this.value="",o(this,B,Gi).call(this),e&&this.renderRoot.querySelector("input")?.focus(),o(this,B,pc).call(this)},Eh=function(e,t){this.dispatchEvent(new CustomEvent("cm-select",{detail:{href:t.href,item:t.item,group:t.group},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault(),o(this,B,Gi).call(this)},Zt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},Zt.properties={label:{string:"label"},placeholder:{string:"placeholder"},value:{},results:{type:Array},loading:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},seeAllLabel:{attribute:"see-all-label",string:"seeAll"},shortcut:{},_active:{state:!0}},Zt.styles=[w,no,Ri,b`
493
+ <span class="vh" role="status" aria-live="polite">${r}</span>
494
+ </div>`}};Ke=new WeakMap,wn=new WeakMap,Y=new WeakSet,Vl=function(){return this.loading?[]:(this.results??[]).filter(e=>e?.items?.length).flatMap(e=>[...e.items.map(t=>({group:e,item:t,href:t.href})),...e.href?[{group:e,href:e.href}]:[]])},Ul=function(){return this.open&&!!this.value.trim()},As=function(){this.open=!1,this._active=-1},Wd=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},Kl=new WeakMap,zu=function(e){let t=a(this,Y,Vl).call(this).length;if(!t){this._active=-1;return}this._active<0?this._active=e>0?0:t-1:this._active=(this._active+e+t)%t},Wl=new WeakMap,$n=new WeakMap,Yd=function(e=!0){this.value="",a(this,Y,As).call(this),e&&this.renderRoot.querySelector("input")?.focus(),a(this,Y,Wd).call(this)},Du=function(e,t){this.dispatchEvent(new CustomEvent("cm-select",{detail:{href:t.href,item:t.item,group:t.group},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault(),a(this,Y,As).call(this)},Ni.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Ni.properties={label:{string:"label"},placeholder:{string:"placeholder"},value:{},results:{type:Array},loading:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},seeAllLabel:{attribute:"see-all-label",string:"seeAll"},shortcut:{},_active:{state:!0}},Ni.styles=[E,zl,ws,x`
495
495
  :host { display: block; position: relative; }
496
496
  .wrap { position: relative; }
497
497
  .box {
@@ -537,20 +537,20 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
537
537
  .title, .desc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
538
538
  .desc { font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); }
539
539
  .all { font-size: 13px; text-decoration: underline; }
540
- `];g("cm-global-search",Zt);var qu=/^(\d{4})-(\d{2})-(\d{2})$/;function R(n){let r=qu.exec(n??"");if(!r)return null;let e=new Date(+r[1],+r[2]-1,+r[3]);return e.getFullYear()===+r[1]&&e.getMonth()===+r[2]-1&&e.getDate()===+r[3]?e:null}var Be=(n,r=2)=>String(n).padStart(r,"0"),he=n=>`${Be(n.getFullYear(),4)}-${Be(n.getMonth()+1)}-${Be(n.getDate())}`,Pu=()=>he(new Date),ge=(n,r)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+r);function je(n,r){let e=new Date(n.getFullYear(),n.getMonth()+r,1),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return new Date(e.getFullYear(),e.getMonth(),Math.min(n.getDate(),t))}var Qt=n=>new Date(n.getFullYear(),n.getMonth(),1),Eo=n=>new Date(n.getFullYear(),n.getMonth()+1,0);var Bu=/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d(?:\.\d{1,3})?)?$/;function ei(n){let r=Bu.exec(n??"");return r?+r[1]*60+ +r[2]:null}var wa=n=>{let r=(Math.round(n)%1440+1440)%1440;return`${Be(Math.floor(r/60))}:${Be(r%60)}`};function ti(n){let[r="",e=""]=(n??"").split("T"),t=ei(e);return{date:R(r)?r:"",time:t===null?"":wa(t)}}function $a(n,r=!1){let{date:e,time:t}=ti(n),i=R(e);if(!i)return null;let a=t?ei(t):r?1439:0;return new Date(i.getFullYear(),i.getMonth(),i.getDate(),Math.floor(a/60),a%60)}var _h=()=>{let n=new Date;return`${he(n)}T${Be(n.getHours())}:${Be(n.getMinutes())}`},Mh=new Map;function Ch(n,r){let e=r==="h12"||r==="h23"?r:void 0,t=`${n}|${e??""}`,i=Mh.get(t);if(i)return i;let a={hour:"numeric",minute:"2-digit",numberingSystem:"latn",...e?{hourCycle:e}:{}},c=new Intl.DateTimeFormat(n,a),h=c.resolvedOptions().hourCycle,u=T=>new Date(2e3,0,1,T,30),m=T=>(new Intl.DateTimeFormat(n,{hour:"numeric",hourCycle:"h12"}).formatToParts(u(T)).find(D=>D.type==="dayPeriod")?.value??"").toLowerCase().replace(/[^\p{L}]/gu,""),y=(T,D)=>[...new Set([T,...D].filter(Boolean))],v=T=>T.replace(/[\u202f\u00a0]/g," "),E=v(c.formatToParts(u(9)).map(T=>T.type==="hour"?"{h}":T.type==="minute"?"{m}":T.value).join("")),$={format:T=>v(c.format(new Date(2e3,0,1,Math.floor(T/60),T%60))),dateTime:T=>Z(T,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",...e?{hourCycle:e}:{}},n),pattern:E,hour12:h==="h12"||h==="h11",am:y(m(9),["am","a"]),pm:y(m(15),["pm","p"])};return Mh.set(t,$),$}var zh=(n,r)=>n.pattern.replace(/\{([hm])\}/g,(e,t)=>r[t]);function mc(n,r){let e=n.trim().toLowerCase().normalize("NFKC");if(!e)return null;let t=e.replace(/[^\p{L}]/gu,""),i=!!t&&r.pm.includes(t),a=!!t&&r.am.includes(t);if(t&&!i&&!a)return null;let c=e.match(/\d+/g)??[],h,u;if(c.length===1){let m=c[0];if(m.length<=2)h=+m,u=0;else if(m.length<=4)h=+m.slice(0,-2),u=+m.slice(-2);else return null}else if(c.length===2||c.length===3){if(c[0].length>2||c[1].length!==2)return null;h=+c[0],u=+c[1]}else return null;if(u>59)return null;if(a||i){if(h<1||h>12)return null;h=h%12+(i?12:0)}else if(h>23)return null;return wa(h*60+u)}var Yi={fromAttribute:n=>n?n.split(/[\s,]+/).filter(Boolean):[],toAttribute:n=>Array.isArray(n)?n.join(" "):n},ka=n=>Array.isArray(n)?n:typeof n=="string"?Yi.fromAttribute(n):[];function Mo(n,r){let e=[r,Jr(n)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function To(n){try{let r=new Intl.Locale(n),e=r.getWeekInfo?.()??r.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 0}var Th=new Map;function _o(n){let r=Th.get(n);if(r)return r;let e=$=>new Intl.DateTimeFormat(n,$),t=e({day:"2-digit",month:"2-digit",year:"numeric",numberingSystem:"latn"}),i=e({weekday:"short"}),a=e({weekday:"long"}),c=new Date(2024,0,7),h=t.formatToParts(new Date(2026,10,15)),u=h.filter($=>$.type==="day"||$.type==="month"||$.type==="year").map($=>$.type),m=h.map($=>$.type==="day"?"{d}":$.type==="month"?"{m}":$.type==="year"?"{y}":$.value).join(""),y=($,T)=>Array.from({length:12},(D,P)=>new Intl.DateTimeFormat($,{month:T}).format(new Date(2024,P,1)).toLowerCase().replace(/\./g,"")),v=Array.from({length:12},($,T)=>[...new Set([y(n,"long")[T],y(n,"short")[T],y("en","long")[T],y("en","short")[T]])]),E={short:$=>t.format($),long:$=>Z($,{weekday:"long",day:"numeric",month:"long",year:"numeric"},n),medium:$=>Z($,{day:"numeric",month:"short",year:"numeric"},n),monthYear:$=>Z($,{month:"long",year:"numeric"},n),day:$=>Z($,{day:"numeric"},n),weekdaysShort:Array.from({length:7},($,T)=>i.format(ge(c,T))),weekdaysLong:Array.from({length:7},($,T)=>a.format(ge(c,T))),pattern:u.length===3?m:"{y}-{m}-{d}",order:u.length===3?u:["year","month","day"],months:v};return Th.set(n,E),E}var Co=(n,r)=>n.pattern.replace(/\{([dmy])\}/g,(e,t)=>r[t]);function zo(n,r){let e=n.trim().toLowerCase();if(!e)return null;let t=e.split(/[^\p{L}\p{N}]+/u).filter(Boolean);if(t.length!==3)return null;let i,a,c,h=t.findIndex(m=>/\p{L}/u.test(m));if(h>=0){let m=t[h];a=r.months.findIndex($=>$.some(T=>T===m||m.length>=3&&T.startsWith(m)))+1;let y=t.filter(($,T)=>T!==h);if(!a||y.some($=>!/^\d+$/.test($)))return null;let v=y.findIndex($=>$.length===4),E=v>=0?v:1;i=+y[E],c=+y[1-E],y[E].length<=2&&(i+=2e3)}else{if(t.some(v=>!/^\d+$/.test(v)))return null;let m=t[0].length===4?["year","month","day"]:r.order,y=v=>t[m.indexOf(v)];if(i=+y("year"),a=+y("month"),c=+y("day"),y("year").length<=2)i+=2e3;else if(y("year").length!==4)return null}let u=`${Be(i,4)}-${Be(a)}-${Be(c)}`;return R(u)?u:null}function Lo(n,r,e,t){let i=(e.getDay()-t+7)%7;switch(n){case"ArrowRight":return ge(e,1);case"ArrowLeft":return ge(e,-1);case"ArrowDown":return ge(e,7);case"ArrowUp":return ge(e,-7);case"Home":return ge(e,-i);case"End":return ge(e,6-i);case"PageDown":return je(e,r.shiftKey?12:1);case"PageUp":return je(e,r.shiftKey?-12:-1);default:return null}}var Et=(n,r,e)=>r&&n<r?r:e&&n>e?e:n;function So(n){let{fmt:r,firstDay:e,month:t,focus:i,min:a,max:c}=n,h=Qt(t),u=(h.getDay()-e+7)%7,m=Eo(t).getDate(),y=[],v=Array(u).fill(null);for(let P=1;P<=m;P++)v.push(new Date(t.getFullYear(),t.getMonth(),P)),v.length===7&&(y.push(v),v=[]);v.length&&y.push([...v,...Array(7-v.length).fill(null)]);let E=Array.from({length:7},(P,j)=>(j+e)%7),$=Pu(),T=!!a&&Eo(je(h,-1))<a,D=!!c&&je(h,1)>c;return l`<div class="cal-head">
541
- <button type="button" class="cal-nav" part="calendar-nav" aria-label=${n.previousLabel} ?disabled=${T} @click=${()=>n.onMonth(-1)}><cm-icon name="chevron-left" size="18"></cm-icon></button>
542
- <h2 id="${n.id}-month" class="cal-title" aria-live="polite">${r.monthYear(t)}</h2>
543
- <button type="button" class="cal-nav" part="calendar-nav" aria-label=${n.nextLabel} ?disabled=${D} @click=${()=>n.onMonth(1)}><cm-icon name="chevron-right" size="18"></cm-icon></button>
540
+ `];w("cm-global-search",Ni);var Sg=/^(\d{4})-(\d{2})-(\d{2})$/;function N(o){let n=Sg.exec(o??"");if(!n)return null;let e=new Date(+n[1],+n[2]-1,+n[3]);return e.getFullYear()===+n[1]&&e.getMonth()===+n[2]-1&&e.getDate()===+n[3]?e:null}var ht=(o,n=2)=>String(o).padStart(n,"0"),H=o=>`${ht(o.getFullYear(),4)}-${ht(o.getMonth()+1)}-${ht(o.getDate())}`,Gd=()=>H(new Date),U=(o,n)=>new Date(o.getFullYear(),o.getMonth(),o.getDate()+n);function We(o,n){let e=new Date(o.getFullYear(),o.getMonth()+n,1),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return new Date(e.getFullYear(),e.getMonth(),Math.min(o.getDate(),t))}var Tt=o=>new Date(o.getFullYear(),o.getMonth(),1),Ns=o=>new Date(o.getFullYear(),o.getMonth()+1,0);var zg=/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d(?:\.\d{1,3})?)?$/;function Ri(o){let n=zg.exec(o??"");return n?+n[1]*60+ +n[2]:null}var kn=o=>{let n=(Math.round(o)%1440+1440)%1440;return`${ht(Math.floor(n/60))}:${ht(n%60)}`};function Ye(o){let[n="",e=""]=(o??"").split("T"),t=Ri(e);return{date:N(n)?n:"",time:t===null?"":kn(t)}}function pt(o,n=!1){let{date:e,time:t}=Ye(o),i=N(e);if(!i)return null;let r=t?Ri(t):n?1439:0;return new Date(i.getFullYear(),i.getMonth(),i.getDate(),Math.floor(r/60),r%60)}var Ru=()=>{let o=new Date;return`${H(o)}T${ht(o.getHours())}:${ht(o.getMinutes())}`},Au=new Map;function Yl(o,n){let e=n==="h12"||n==="h23"?n:void 0,t=`${o}|${e??""}`,i=Au.get(t);if(i)return i;let r={hour:"numeric",minute:"2-digit",numberingSystem:"latn",...e?{hourCycle:e}:{}},l=new Intl.DateTimeFormat(o,r),d=l.resolvedOptions().hourCycle,p=M=>new Date(2e3,0,1,M,30),m=M=>(new Intl.DateTimeFormat(o,{hour:"numeric",hourCycle:"h12"}).formatToParts(p(M)).find(A=>A.type==="dayPeriod")?.value??"").toLowerCase().replace(/[^\p{L}]/gu,""),v=(M,A)=>[...new Set([M,...A].filter(Boolean))],b=M=>M.replace(/[\u202f\u00a0]/g," "),$=b(l.formatToParts(p(9)).map(M=>M.type==="hour"?"{h}":M.type==="minute"?"{m}":M.value).join("")),y={format:M=>b(l.format(new Date(2e3,0,1,Math.floor(M/60),M%60))),dateTime:M=>ee(M,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",...e?{hourCycle:e}:{}},o),pattern:$,hour12:d==="h12"||d==="h11",am:v(m(9),["am","a"]),pm:v(m(15),["pm","p"])};return Au.set(t,y),y}var Hu=(o,n)=>o.pattern.replace(/\{([hm])\}/g,(e,t)=>n[t]);function Xd(o,n){let e=o.trim().toLowerCase().normalize("NFKC");if(!e)return null;let t=e.replace(/[^\p{L}]/gu,""),i=!!t&&n.pm.includes(t),r=!!t&&n.am.includes(t);if(t&&!i&&!r)return null;let l=e.match(/\d+/g)??[],d,p;if(l.length===1){let m=l[0];if(m.length<=2)d=+m,p=0;else if(m.length<=4)d=+m.slice(0,-2),p=+m.slice(-2);else return null}else if(l.length===2||l.length===3){if(l[0].length>2||l[1].length!==2)return null;d=+l[0],p=+l[1]}else return null;if(p>59)return null;if(r||i){if(d<1||d>12)return null;d=d%12+(i?12:0)}else if(d>23)return null;return kn(d*60+p)}var Rs={fromAttribute:o=>o?o.split(/[\s,]+/).filter(Boolean):[],toAttribute:o=>Array.isArray(o)?o.join(" "):o},En=o=>Array.isArray(o)?o:typeof o=="string"?Rs.fromAttribute(o):[];function Hs(o,n){let e=[n,Za(o)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function Is(o){try{let n=new Intl.Locale(o),e=n.getWeekInfo?.()??n.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 0}var Nu=new Map;function Ps(o){let n=Nu.get(o);if(n)return n;let e=y=>new Intl.DateTimeFormat(o,y),t=e({day:"2-digit",month:"2-digit",year:"numeric",numberingSystem:"latn"}),i=e({weekday:"short"}),r=e({weekday:"long"}),l=new Date(2024,0,7),d=t.formatToParts(new Date(2026,10,15)),p=d.filter(y=>y.type==="day"||y.type==="month"||y.type==="year").map(y=>y.type),m=d.map(y=>y.type==="day"?"{d}":y.type==="month"?"{m}":y.type==="year"?"{y}":y.value).join(""),v=(y,M)=>Array.from({length:12},(A,I)=>new Intl.DateTimeFormat(y,{month:M}).format(new Date(2024,I,1)).toLowerCase().replace(/\./g,"")),b=Array.from({length:12},(y,M)=>[...new Set([v(o,"long")[M],v(o,"short")[M],v("en","long")[M],v("en","short")[M]])]),$={short:y=>t.format(y),long:y=>ee(y,{weekday:"long",day:"numeric",month:"long",year:"numeric"},o),medium:y=>ee(y,{day:"numeric",month:"short",year:"numeric"},o),monthYear:y=>ee(y,{month:"long",year:"numeric"},o),day:y=>ee(y,{day:"numeric"},o),weekdaysShort:Array.from({length:7},(y,M)=>i.format(U(l,M))),weekdaysLong:Array.from({length:7},(y,M)=>r.format(U(l,M))),pattern:p.length===3?m:"{y}-{m}-{d}",order:p.length===3?p:["year","month","day"],months:b};return Nu.set(o,$),$}var Gl=(o,n)=>o.pattern.replace(/\{([dmy])\}/g,(e,t)=>n[t]);function Xl(o,n){let e=o.trim().toLowerCase();if(!e)return null;let t=e.split(/[^\p{L}\p{N}]+/u).filter(Boolean);if(t.length!==3)return null;let i,r,l,d=t.findIndex(m=>/\p{L}/u.test(m));if(d>=0){let m=t[d];r=n.months.findIndex(y=>y.some(M=>M===m||m.length>=3&&M.startsWith(m)))+1;let v=t.filter((y,M)=>M!==d);if(!r||v.some(y=>!/^\d+$/.test(y)))return null;let b=v.findIndex(y=>y.length===4),$=b>=0?b:1;i=+v[$],l=+v[1-$],v[$].length<=2&&(i+=2e3)}else{if(t.some(b=>!/^\d+$/.test(b)))return null;let m=t[0].length===4?["year","month","day"]:n.order,v=b=>t[m.indexOf(b)];if(i=+v("year"),r=+v("month"),l=+v("day"),v("year").length<=2)i+=2e3;else if(v("year").length!==4)return null}let p=`${ht(i,4)}-${ht(r)}-${ht(l)}`;return N(p)?p:null}function Jl(o,n,e,t){let i=(e.getDay()-t+7)%7;switch(o){case"ArrowRight":return U(e,1);case"ArrowLeft":return U(e,-1);case"ArrowDown":return U(e,7);case"ArrowUp":return U(e,-7);case"Home":return U(e,-i);case"End":return U(e,6-i);case"PageDown":return We(e,n.shiftKey?12:1);case"PageUp":return We(e,n.shiftKey?-12:-1);default:return null}}var ei=(o,n,e)=>n&&o<n?n:e&&o>e?e:o;function Zl(o){let{fmt:n,firstDay:e,month:t,focus:i,min:r,max:l}=o,d=Tt(t),p=(d.getDay()-e+7)%7,m=Ns(t).getDate(),v=[],b=Array(p).fill(null);for(let I=1;I<=m;I++)b.push(new Date(t.getFullYear(),t.getMonth(),I)),b.length===7&&(v.push(b),b=[]);b.length&&v.push([...b,...Array(7-b.length).fill(null)]);let $=Array.from({length:7},(I,B)=>(B+e)%7),y=Gd(),M=!!r&&Ns(We(d,-1))<r,A=!!l&&We(d,1)>l;return c`<div class="cal-head">
541
+ <button type="button" class="cal-nav" part="calendar-nav" aria-label=${o.previousLabel} ?disabled=${M} @click=${()=>o.onMonth(-1)}><cm-icon name="chevron-left" size="18"></cm-icon></button>
542
+ <h2 id="${o.id}-month" class="cal-title" aria-live="polite">${n.monthYear(t)}</h2>
543
+ <button type="button" class="cal-nav" part="calendar-nav" aria-label=${o.nextLabel} ?disabled=${A} @click=${()=>o.onMonth(1)}><cm-icon name="chevron-right" size="18"></cm-icon></button>
544
544
  </div>
545
- <table role="grid" class="cal-grid" part="calendar" aria-labelledby="${n.id}-month" @keydown=${n.onKey}>
546
- <thead><tr>${E.map(P=>l`<th scope="col" abbr=${r.weekdaysLong[P]}><span aria-hidden="true">${r.weekdaysShort[P]}</span><span class="vh">${r.weekdaysLong[P]}</span></th>`)}</tr></thead>
547
- <tbody>${y.map(P=>l`<tr>${P.map(j=>{if(!j)return l`<td class="empty"></td>`;let Ti=he(j),_i=n.isDisabled(j)||!!a&&j<a||!!c&&j>c,Rd=n.mark(j),Hd=n.note?.(j);return l`<td class="day ${Rd} ${Ti===$?"today":""}" data-date=${Ti}
548
- tabindex=${Ti===he(i)?"0":"-1"}
549
- aria-selected=${Rd?"true":"false"} aria-disabled=${_i?"true":d}
550
- aria-current=${Ti===$?"date":d}
551
- aria-label="${r.long(j)}${Hd?`, ${Hd}`:""}"
552
- @click=${()=>!_i&&n.onPick(j)} @pointerenter=${()=>n.onHover?.(j)}><span aria-hidden="true">${r.day(j)}</span></td>`})}</tr>`)}</tbody>
553
- </table>`}var Ao=b`
545
+ <table role="grid" class="cal-grid" part="calendar" aria-labelledby="${o.id}-month" @keydown=${o.onKey}>
546
+ <thead><tr>${$.map(I=>c`<th scope="col" abbr=${n.weekdaysLong[I]}><span aria-hidden="true">${n.weekdaysShort[I]}</span><span class="vh">${n.weekdaysLong[I]}</span></th>`)}</tr></thead>
547
+ <tbody>${v.map(I=>c`<tr>${I.map(B=>{if(!B)return c`<td class="empty"></td>`;let V=H(B),Q=o.isDisabled(B)||!!r&&B<r||!!l&&B>l,yt=o.mark(B),F=o.note?.(B);return c`<td class="day ${yt} ${V===y?"today":""}" data-date=${V}
548
+ tabindex=${V===H(i)?"0":"-1"}
549
+ aria-selected=${yt?"true":"false"} aria-disabled=${Q?"true":h}
550
+ aria-current=${V===y?"date":h}
551
+ aria-label="${n.long(B)}${F?`, ${F}`:""}"
552
+ @click=${()=>!Q&&o.onPick(B)} @pointerenter=${()=>o.onHover?.(B)}><span aria-hidden="true">${n.day(B)}</span></td>`})}</tr>`)}</tbody>
553
+ </table>`}var Ql=x`
554
554
  .pop {
555
555
  position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-10)); inset-inline-start: 0;
556
556
  width: max-content; max-width: calc(100vw - 32px); padding: var(--cm-space-15);
@@ -582,7 +582,7 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
582
582
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
583
583
  }
584
584
  @media (max-width: 640px) { .day, .empty { height: 36px; } }
585
- `;function Do(n,r){if(n.key!=="Tab")return;let e=[...r.querySelectorAll('button:not([disabled]), [role=grid] td[tabindex="0"]')];if(!e.length)return;let t=r.getRootNode(),i=e.indexOf(t.activeElement);n.preventDefault(),e[(i+(n.shiftKey?-1:1)+e.length)%e.length].focus()}var No=b`
585
+ `;function ec(o,n){if(o.key!=="Tab")return;let e=[...n.querySelectorAll('button:not([disabled]), [role=grid] td[tabindex="0"]')];if(!e.length)return;let t=n.getRootNode(),i=e.indexOf(t.activeElement);o.preventDefault(),e[(i+(o.shiftKey?-1:1)+e.length)%e.length].focus()}var tc=x`
586
586
  :host { display: block; position: relative; }
587
587
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
588
588
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -617,69 +617,69 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
617
617
  .wrap.timed { display: flex; flex-wrap: wrap; gap: var(--cm-space-10); }
618
618
  .wrap.timed .box { width: auto; min-inline-size: 0; flex: 2 1 10.5rem; }
619
619
  .wrap.timed .box.time { flex: 1 1 7.5rem; padding-inline: var(--cm-space-10); }
620
- `;var wb=M("datePicker",{choose:"Choose date",chooseFor:"Choose date for {label}",change:"Change date, {date}",changeFor:"Change date for {label}, {date}",dialog:"Choose date",previousMonth:"Previous month",nextMonth:"Next month",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badInput:"Enter a date like {pattern}.",required:"Enter or choose a date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"This date isn't available. Choose another date.",time:"Time",timeFor:"Time for {label}",patternHour:"hh",patternMinute:"mm",badTime:"Enter a time like {pattern}.",timeMissing:"Enter a time.",stepMismatch:{one:"Choose a time on the minute.",other:"Choose a time in steps of {count} minutes."}}),Zi,J,Ae,Qi,tt,Ct,ve,ke,es,ts,x,Ea,Mt,is,Ro,ii,Wi,Ze,Tt,Qe,et,Ho,fc,bc,Xi,si,gc,vc,Lh,Io,Sh,xc,Ji,Ma,Ta,yc,Ah,Oo,wc,$c,qo,Po,Bo,jo,Fo,_a,_t=class extends k{constructor(){super(...arguments);p(this,x);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.min="";this.max="";this.placeholder="";p(this,Zi,"");this.disabledDates=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this.time=!1;this.step=1;this.hourCycle="";this._text="";this._focus=new Date;p(this,J,this.attachInternals());p(this,Ae,L("cm-dp"));p(this,Qi,null);p(this,tt,!1);p(this,Ct,!1);p(this,ve,"");p(this,ke,"");p(this,es,!1);p(this,ts,"");p(this,is,!1);p(this,Oo,e=>{e.key==="Enter"?o(this,x,yc).call(this):(e.key==="ArrowUp"||e.key==="ArrowDown")&&!e.altKey&&(e.preventDefault(),o(this,x,Ah).call(this,e.key==="ArrowUp"?1:-1))});p(this,qo,()=>{this.disabled||(this.open?this.open=!1:(o(this,x,Ta).call(this),this.show()))});p(this,Po,e=>{e.key==="Enter"?o(this,x,Ta).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),o(this,x,Ta).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});p(this,Bo,e=>{let t=Lo(ne(e,this),e,this._focus,s(this,x,fc));if(t){e.preventDefault(),this._focus=Et(t,s(this,x,Qe),s(this,x,et)),f(this,Ct,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),o(this,x,wc).call(this,this._focus))});p(this,jo,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,o(this,x,$c).call(this);return}Do(e,e.currentTarget)});p(this,Fo,e=>{this._focus=Et(je(this._focus,e),s(this,x,Qe),s(this,x,et))});p(this,_a,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return s(this,Zi)}set locale(e){let t=s(this,Zi);f(this,Zi,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),s(this,Qi)===null&&f(this,Qi,this.value),document.addEventListener("pointerdown",s(this,_a),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",s(this,_a),!0)}get form(){return s(this,J).form}get validity(){return s(this,J).validity}get validationMessage(){return s(this,J).validationMessage}get valueAsDate(){return this.time?this.value?$a(this.value):null:R(this.value)}checkValidity(){return o(this,x,Io).call(this),s(this,J).checkValidity()}reportValidity(){return o(this,x,Io).call(this),s(this,J).reportValidity()}formResetCallback(){this.value=s(this,Qi)??"",this.time&&(o(this,x,vc).call(this,this.value),f(this,x,o(this,x,si).call(this,s(this,ke)),Mt)),this._text=o(this,x,Xi).call(this,s(this,x,Ze)),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(o(this,x,Lh).call(this),this.open=!0)}close(){this.open=!1}isUnavailable(e){let t=R(e);if(!t)return!0;let i=s(this,x,Qe),a=s(this,x,et);return i&&t<i||a&&t>a?!0:ka(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){this.time&&(e.has("value")||e.has("time"))&&!s(this,is)?(o(this,x,vc).call(this,this.value),s(this,es)||f(this,x,o(this,x,si).call(this,s(this,ke)),Mt)):this.time&&(e.has("locale")||e.has("hourCycle"))&&s(this,ke)&&f(this,x,o(this,x,si).call(this,s(this,ke)),Mt),(e.has("value")||e.has("time"))&&!s(this,tt)?this._text=o(this,x,Xi).call(this,s(this,x,Ze)):e.has("locale")&&R(s(this,x,Ze))&&(this._text=o(this,x,Xi).call(this,s(this,x,Ze))),f(this,tt,!1),f(this,es,!1),f(this,is,!1)}updated(e){s(this,J).setFormValue(this.value||null,this.time?this.value:this._text),o(this,x,Io).call(this),this.open&&s(this,Ct)&&(f(this,Ct,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),e.has("open")&&e.get("open")===!0&&!this.open&&f(this,Ct,!1)}render(){let e=s(this,x,ii),t=R(s(this,x,Ze)),i=[this.error&&`${s(this,Ae)}-err`,this.helpText&&`${s(this,Ae)}-help`].filter(Boolean).join(" "),a=this.getAttribute("aria-label"),c=this.label||a||"",h=Qt(this._focus);return l`<div class="field">
621
- ${this.label?l`<label class="label" for="${s(this,Ae)}-in" part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</label>`:d}
620
+ `;var bx=C("datePicker",{choose:"Choose date",chooseFor:"Choose date for {label}",change:"Change date, {date}",changeFor:"Change date for {label}, {date}",dialog:"Choose date",previousMonth:"Previous month",nextMonth:"Next month",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badInput:"Enter a date like {pattern}.",required:"Enter or choose a date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"This date isn't available. Choose another date.",time:"Time",timeFor:"Time for {label}",patternHour:"hh",patternMinute:"mm",badTime:"Enter a time like {pattern}.",timeMissing:"Enter a time.",stepMismatch:{one:"Choose a time on the minute.",other:"Choose a time in steps of {count} minutes."}}),Fs,ce,Ge,js,St,ri,Se,He,Vs,Us,k,Mn,ti,Ks,ic,Hi,Os,Ct,ii,_t,Lt,sc,Jd,Zd,qs,Ii,Qd,eh,Iu,rc,Pu,th,Bs,Tn,Cn,ih,Ou,ac,sh,rh,nc,oc,lc,cc,dc,_n,si=class extends T{constructor(){super(...arguments);u(this,k);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.min="";this.max="";this.placeholder="";u(this,Fs,"");this.disabledDates=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this.time=!1;this.step=1;this.hourCycle="";this._text="";this._focus=new Date;u(this,ce,this.attachInternals());u(this,Ge,D("cm-dp"));u(this,js,null);u(this,St,!1);u(this,ri,!1);u(this,Se,"");u(this,He,"");u(this,Vs,!1);u(this,Us,"");u(this,Ks,!1);u(this,ac,e=>{e.key==="Enter"?a(this,k,ih).call(this):(e.key==="ArrowUp"||e.key==="ArrowDown")&&!e.altKey&&(e.preventDefault(),a(this,k,Ou).call(this,e.key==="ArrowUp"?1:-1))});u(this,nc,()=>{this.disabled||(this.open?this.open=!1:(a(this,k,Cn).call(this),this.show()))});u(this,oc,e=>{e.key==="Enter"?a(this,k,Cn).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),a(this,k,Cn).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});u(this,lc,e=>{let t=Jl(re(e,this),e,this._focus,s(this,k,Jd));if(t){e.preventDefault(),this._focus=ei(t,s(this,k,_t),s(this,k,Lt)),g(this,ri,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),a(this,k,sh).call(this,this._focus))});u(this,cc,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,a(this,k,rh).call(this);return}ec(e,e.currentTarget)});u(this,dc,e=>{this._focus=ei(We(this._focus,e),s(this,k,_t),s(this,k,Lt))});u(this,_n,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return s(this,Fs)}set locale(e){let t=s(this,Fs);g(this,Fs,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),s(this,js)===null&&g(this,js,this.value),document.addEventListener("pointerdown",s(this,_n),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",s(this,_n),!0)}get form(){return s(this,ce).form}get validity(){return s(this,ce).validity}get validationMessage(){return s(this,ce).validationMessage}get valueAsDate(){return this.time?this.value?pt(this.value):null:N(this.value)}checkValidity(){return a(this,k,rc).call(this),s(this,ce).checkValidity()}reportValidity(){return a(this,k,rc).call(this),s(this,ce).reportValidity()}formResetCallback(){this.value=s(this,js)??"",this.time&&(a(this,k,eh).call(this,this.value),g(this,k,a(this,k,Ii).call(this,s(this,He)),ti)),this._text=a(this,k,qs).call(this,s(this,k,Ct)),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(a(this,k,Iu).call(this),this.open=!0)}close(){this.open=!1}isUnavailable(e){let t=N(e);if(!t)return!0;let i=s(this,k,_t),r=s(this,k,Lt);return i&&t<i||r&&t>r?!0:En(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){this.time&&(e.has("value")||e.has("time"))&&!s(this,Ks)?(a(this,k,eh).call(this,this.value),s(this,Vs)||g(this,k,a(this,k,Ii).call(this,s(this,He)),ti)):this.time&&(e.has("locale")||e.has("hourCycle"))&&s(this,He)&&g(this,k,a(this,k,Ii).call(this,s(this,He)),ti),(e.has("value")||e.has("time"))&&!s(this,St)?this._text=a(this,k,qs).call(this,s(this,k,Ct)):e.has("locale")&&N(s(this,k,Ct))&&(this._text=a(this,k,qs).call(this,s(this,k,Ct))),g(this,St,!1),g(this,Vs,!1),g(this,Ks,!1)}updated(e){s(this,ce).setFormValue(this.value||null,this.time?this.value:this._text),a(this,k,rc).call(this),this.open&&s(this,ri)&&(g(this,ri,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),e.has("open")&&e.get("open")===!0&&!this.open&&g(this,ri,!1)}render(){let e=s(this,k,Hi),t=N(s(this,k,Ct)),i=[this.error&&`${s(this,Ge)}-err`,this.helpText&&`${s(this,Ge)}-help`].filter(Boolean).join(" "),r=this.getAttribute("aria-label"),l=this.label||r||"",d=Tt(this._focus);return c`<div class="field">
621
+ ${this.label?c`<label class="label" for="${s(this,Ge)}-in" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</label>`:h}
622
622
  <div class="wrap ${this.time?"timed":""}">
623
623
  <div class="box" part="box">
624
- <input id="${s(this,Ae)}-in" part="input" type="text" autocomplete="off" spellcheck="false"
625
- .value=${se(this._text)} placeholder=${this.placeholder||s(this,x,bc)}
626
- aria-label=${!this.label&&a?a:d}
624
+ <input id="${s(this,Ge)}-in" part="input" type="text" autocomplete="off" spellcheck="false"
625
+ .value=${le(this._text)} placeholder=${this.placeholder||s(this,k,Zd)}
626
+ aria-label=${!this.label&&r?r:h}
627
627
  ?required=${this.required} ?disabled=${this.disabled}
628
- aria-invalid=${this.error?"true":d} aria-describedby=${i||d}
629
- @input=${u=>{u.stopPropagation(),this._text=u.target.value}}
630
- @change=${()=>o(this,x,Ta).call(this)} @keydown=${s(this,Po)} />
628
+ aria-invalid=${this.error?"true":h} aria-describedby=${i||h}
629
+ @input=${p=>{p.stopPropagation(),this._text=p.target.value}}
630
+ @change=${()=>a(this,k,Cn).call(this)} @keydown=${s(this,oc)} />
631
631
  <button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
632
- aria-label=${t?this.t(c?"changeFor":"change",{label:c,date:e.long(t)}):this.t(c?"chooseFor":"choose",{label:c})}
633
- aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,Ae)}-pop"
634
- @click=${s(this,qo)}><cm-icon name="calendar" size="18"></cm-icon></button>
632
+ aria-label=${t?this.t(l?"changeFor":"change",{label:l,date:e.long(t)}):this.t(l?"chooseFor":"choose",{label:l})}
633
+ aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,Ge)}-pop"
634
+ @click=${s(this,nc)}><cm-icon name="calendar" size="18"></cm-icon></button>
635
635
  </div>
636
- ${this.time?l`<div class="box time" part="time-box">
636
+ ${this.time?c`<div class="box time" part="time-box">
637
637
  <input class="time-in" part="time-input" type="text" autocomplete="off" spellcheck="false"
638
- .value=${se(s(this,x,Ea))} placeholder=${s(this,x,gc)}
639
- aria-label=${this.t(c?"timeFor":"time",{label:c})}
638
+ .value=${le(s(this,k,Mn))} placeholder=${s(this,k,Qd)}
639
+ aria-label=${this.t(l?"timeFor":"time",{label:l})}
640
640
  ?required=${this.required} ?disabled=${this.disabled}
641
- aria-invalid=${this.error?"true":d} aria-describedby=${i||d}
642
- @input=${u=>{u.stopPropagation(),f(this,x,u.target.value,Mt)}}
643
- @change=${()=>o(this,x,yc).call(this)} @keydown=${s(this,Oo)} />
644
- </div>`:d}
645
- <div class="pop" id="${s(this,Ae)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
646
- ?hidden=${!this.open} @keydown=${s(this,jo)}>
647
- ${this.open?l`<div class="cal">${So({id:s(this,Ae),fmt:e,firstDay:s(this,x,fc),month:h,focus:this._focus,min:s(this,x,Qe),max:s(this,x,et),isDisabled:u=>this.isUnavailable(he(u)),mark:u=>t&&he(u)===s(this,x,Ze)?"selected":"",onPick:u=>o(this,x,wc).call(this,u),onKey:s(this,Bo),onMonth:s(this,Fo),previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth")})}</div>`:d}
641
+ aria-invalid=${this.error?"true":h} aria-describedby=${i||h}
642
+ @input=${p=>{p.stopPropagation(),g(this,k,p.target.value,ti)}}
643
+ @change=${()=>a(this,k,ih).call(this)} @keydown=${s(this,ac)} />
644
+ </div>`:h}
645
+ <div class="pop" id="${s(this,Ge)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
646
+ ?hidden=${!this.open} @keydown=${s(this,cc)}>
647
+ ${this.open?c`<div class="cal">${Zl({id:s(this,Ge),fmt:e,firstDay:s(this,k,Jd),month:d,focus:this._focus,min:s(this,k,_t),max:s(this,k,Lt),isDisabled:p=>this.isUnavailable(H(p)),mark:p=>t&&H(p)===s(this,k,Ct)?"selected":"",onPick:p=>a(this,k,sh).call(this,p),onKey:s(this,lc),onMonth:s(this,dc),previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth")})}</div>`:h}
648
648
  </div>
649
649
  </div>
650
- ${this.error?l`<p class="error" id="${s(this,Ae)}-err" role="alert">${this.error}</p>`:d}
651
- ${this.helpText?l`<p class="help" id="${s(this,Ae)}-help">${this.helpText}</p>`:d}
652
- </div>`}};Zi=new WeakMap,J=new WeakMap,Ae=new WeakMap,Qi=new WeakMap,tt=new WeakMap,Ct=new WeakMap,ve=new WeakMap,ke=new WeakMap,es=new WeakMap,ts=new WeakMap,x=new WeakSet,Ea=function(){return s(this,ts)},Mt=function(e){e!==s(this,ts)&&(f(this,ts,e),this.requestUpdate())},is=new WeakMap,Ro=function(){return Mo(this,this.locale)},ii=function(){return _o(s(this,x,Ro))},Wi=function(){return Ch(s(this,x,Ro),this.hourCycle)},Ze=function(){return this.time?s(this,ve):this.value},Tt=function(e){return this.time&&e.trim().toLowerCase()==="now"?_h():e},Qe=function(){return R(ti(o(this,x,Tt).call(this,this.min)).date||this.min)},et=function(){return R(ti(o(this,x,Tt).call(this,this.max)).date||this.max)},Ho=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=1440?e:1},fc=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?To(s(this,x,Ro)):(Math.trunc(e)%7+7)%7},bc=function(){return Co(s(this,x,ii),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},Xi=function(e){let t=R(e);return t?s(this,x,ii).short(t):e},si=function(e){let t=ei(e);return t===null?"":s(this,x,Wi).format(t)},gc=function(){return zh(s(this,x,Wi),{h:this.t("patternHour"),m:this.t("patternMinute")})},vc=function(e){let{date:t,time:i}=ti(e);f(this,ve,t),f(this,ke,t?i:"")},Lh=function(){let e=new Date,t=R(s(this,x,Ze))??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=Et(t,s(this,x,Qe),s(this,x,et)),f(this,Ct,!0)},Io=function(){let e=this.renderRoot.querySelector("input")??void 0,t=R(s(this,x,Ze)),i=s(this,x,ii);this.error?s(this,J).setValidity({customError:!0},this.error,e):this._text.trim()&&!t?s(this,J).setValidity({badInput:!0},this.t("badInput",{pattern:s(this,x,bc)}),e):this.time?o(this,x,Sh).call(this,t,e):this.required&&!t?s(this,J).setValidity({valueMissing:!0},this.t("required"),e):t&&s(this,x,Qe)&&t<s(this,x,Qe)?s(this,J).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:i.medium(s(this,x,Qe))}),e):t&&s(this,x,et)&&t>s(this,x,et)?s(this,J).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:i.medium(s(this,x,et))}),e):t&&this.isUnavailable(this.value)?s(this,J).setValidity({customError:!0},this.t("unavailable"),e):s(this,J).setValidity({})},Sh=function(e,t){let i=this.renderRoot.querySelector("input.time-in")??t,a=(v,E,$,T=t)=>s(this,J).setValidity(v,this.t(E,$),T),c=ei(s(this,ke));if(s(this,x,Ea).trim()&&c===null)return a({badInput:!0},"badTime",{pattern:s(this,x,gc)},i);if(!e&&c===null)return this.required?a({valueMissing:!0},"required"):s(this,J).setValidity({});if(!e)return a({badInput:!0},"required");if(c===null)return a({badInput:!0},"timeMissing",void 0,i);let h=$a(`${s(this,ve)}T${s(this,ke)}`),u=$a(o(this,x,Tt).call(this,this.min)),m=$a(o(this,x,Tt).call(this,this.max),!0),y=(v,E)=>ti(v).time?s(this,x,Wi).dateTime(E):s(this,x,ii).medium(E);if(u&&h<u)return a({rangeUnderflow:!0},"rangeUnderflow",{date:y(o(this,x,Tt).call(this,this.min),u)},i);if(m&&h>m)return a({rangeOverflow:!0},"rangeOverflow",{date:y(o(this,x,Tt).call(this,this.max),m)},i);if(c%s(this,x,Ho))return a({stepMismatch:!0},"stepMismatch",{count:s(this,x,Ho)},i);if(this.isUnavailable(s(this,ve)))return a({customError:!0},"unavailable");s(this,J).setValidity({})},xc=function(e){e!==this.value&&(this.value=e,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Ji=function(e,t){f(this,ve,e),f(this,ke,t);let i=e&&t?`${e}T${t}`:"";f(this,is,!0),this.requestUpdate(),o(this,x,xc).call(this,i)},Ma=function(e){this.time?o(this,x,Ji).call(this,e,s(this,ke)):o(this,x,xc).call(this,e)},Ta=function(){let e=this._text.trim();if(!e){o(this,x,Ma).call(this,"");return}let t=zo(e,s(this,x,ii));t?(o(this,x,Ma).call(this,t),this._text=o(this,x,Xi).call(this,t)):(f(this,tt,!0),o(this,x,Ma).call(this,""))},yc=function(){let e=s(this,x,Ea).trim(),t=e?mc(e,s(this,x,Wi)):"";if(f(this,tt,!0),t===null){f(this,es,!0),o(this,x,Ji).call(this,s(this,ve),"");return}o(this,x,Ji).call(this,s(this,ve),t),f(this,x,o(this,x,si).call(this,t),Mt)},Ah=function(e){let t=s(this,x,Ho),i=mc(s(this,x,Ea),s(this,x,Wi));if(!i){let u=ti(o(this,x,Tt).call(this,this.min)),m=new Date;if(i=u.time&&(!s(this,ve)||s(this,ve)===u.date)?u.time:wa(m.getHours()*60+m.getMinutes()),ei(i)%t===0){f(this,tt,!0),o(this,x,Ji).call(this,s(this,ve),i),f(this,x,o(this,x,si).call(this,i),Mt);return}e=1}let a=ei(i),c=e>0?(Math.floor(a/t)+1)*t:(Math.ceil(a/t)-1)*t,h=wa(c>=1440?0:c<0?Math.floor(1439/t)*t:c);f(this,tt,!0),o(this,x,Ji).call(this,s(this,ve),h),f(this,x,o(this,x,si).call(this,h),Mt)},Oo=new WeakMap,wc=function(e){let t=he(e);this.isUnavailable(t)||(this.open=!1,o(this,x,Ma).call(this,t),this._text=o(this,x,Xi).call(this,t),this.time&&!s(this,ke)?this.updateComplete.then(()=>this.renderRoot.querySelector("input.time-in")?.focus()):o(this,x,$c).call(this))},$c=function(){this.renderRoot.querySelector(".trigger")?.focus()},qo=new WeakMap,Po=new WeakMap,Bo=new WeakMap,jo=new WeakMap,Fo=new WeakMap,_a=new WeakMap,_t.formAssociated=!0,_t.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},_t.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},min:{},max:{},placeholder:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:Yi},isDateDisabled:{attribute:!1},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},time:{type:Boolean,reflect:!0},step:{type:Number},hourCycle:{attribute:"hour-cycle"},_text:{state:!0},_focus:{state:!0}},_t.styles=[w,No,Ao,b`.pop { min-width: 0; }`];g("cm-date-picker",_t);var zb=M("dateRangePicker",{choose:"Choose dates",chooseFor:"Choose dates for {label}",change:"Change dates, {start} to {end}",changeFor:"Change dates for {label}, {start} to {end}",dialog:"Choose dates",previousMonth:"Previous month",nextMonth:"Next month",start:"Start date",end:"End date",presets:"Preset ranges",chooseStart:"Choose the start date.",chooseEnd:"Start date {date}. Choose the end date.",startNote:"start date",endNote:"end date",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badStart:"Enter a start date like {pattern}.",badEnd:"Enter an end date like {pattern}.",required:"Enter or choose a start and end date.",endBeforeStart:"The end date is before the start date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"A chosen date isn't available. Choose another date.",today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",thisMonth:"This month",lastMonth:"Last month"}),ju={today:["Today",n=>[n,n]],yesterday:["Yesterday",n=>[ge(n,-1),ge(n,-1)]],"last-7-days":["Last 7 days",n=>[ge(n,-6),n]],"last-30-days":["Last 30 days",n=>[ge(n,-29),n]],"last-90-days":["Last 90 days",n=>[ge(n,-89),n]],"this-month":["This month",n=>[Qt(n),n]],"last-month":["Last month",n=>[Qt(je(n,-1)),Eo(je(n,-1))]]},Fu=n=>n.replace(/-([a-z0-9])/g,(r,e)=>e.toUpperCase());function Dh(n,r=new Date,e){if(typeof n=="object"&&n)return n;let t=ju[n];if(!t)return null;let i=new Date(r.getFullYear(),r.getMonth(),r.getDate()),[a,c]=t[1](i);return{label:e?.(Fu(n))||t[0],start:he(a),end:he(c)}}var as,te,Ee,ns,os,Lt,S,kc,ss,Ec,st,Vo,it,Nh,Uo,rs,Mc,Rh,Ko,Go,Yo,Wo,Xo,Ca,Tc,zt=class extends k{constructor(){super(...arguments);p(this,S);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";p(this,as,"");this.disabledDates=[];this.presets=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._startText="";this._endText="";this._focus=new Date;this._draftStart="";this._draftEnd="";this._hover=null;p(this,te,this.attachInternals());p(this,Ee,L("cm-drp"));p(this,ns,null);p(this,os,!1);p(this,Lt,!1);p(this,st,"start");p(this,Go,()=>{this.disabled||(this.open?this.open=!1:(o(this,S,rs).call(this,"start"),o(this,S,rs).call(this,"end"),this.show()))});p(this,Yo,e=>t=>{t.key==="Enter"?o(this,S,rs).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),o(this,S,rs).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});p(this,Wo,e=>{let t=Lo(ne(e,this),e,this._focus,s(this,S,Ec));if(t){e.preventDefault(),this._focus=Et(t,R(this.min),R(this.max)),f(this,Lt,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),o(this,S,Mc).call(this,this._focus))});p(this,Xo,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,o(this,S,Ko).call(this);return}Do(e,e.currentTarget)});p(this,Ca,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return s(this,as)}set locale(e){let t=s(this,as);f(this,as,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),s(this,ns)||f(this,ns,[this.start,this.end]),document.addEventListener("pointerdown",s(this,Ca),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",s(this,Ca),!0)}get form(){return s(this,te).form}get validity(){return s(this,te).validity}get validationMessage(){return s(this,te).validationMessage}checkValidity(){return s(this,te).checkValidity()}reportValidity(){return s(this,te).reportValidity()}formResetCallback(){[this.start,this.end]=s(this,ns)??["",""],this._startText=o(this,S,it).call(this,this.start),this._endText=o(this,S,it).call(this,this.end),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){[this.start="",this.end=""]=(e??"").split("/")}show(){if(this.disabled)return;this._draftStart=R(this.start)?this.start:"",this._draftEnd=R(this.end)?this.end:"",this._hover=null;let e=new Date;this._focus=Et(R(this.start)??new Date(e.getFullYear(),e.getMonth(),e.getDate()),R(this.min),R(this.max)),f(this,st,"start"),f(this,Lt,!0),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=R(e);if(!t)return!0;let i=R(this.min),a=R(this.max);return i&&t<i||a&&t>a?!0:ka(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){s(this,os)||(e.has("start")&&(this._startText=o(this,S,it).call(this,this.start)),e.has("end")&&(this._endText=o(this,S,it).call(this,this.end))),f(this,os,!1),e.has("locale")&&(R(this.start)&&(this._startText=o(this,S,it).call(this,this.start)),R(this.end)&&(this._endText=o(this,S,it).call(this,this.end)))}updated(){let e=R(this.start),t=R(this.end),i=new FormData;(this.name||this.startName)&&e&&i.append(this.startName||`${this.name}-start`,this.start),(this.name||this.endName)&&t&&i.append(this.endName||`${this.name}-end`,this.end),s(this,te).setFormValue(e||t?i:null,`${this.start}/${this.end}`);let a=this.renderRoot.querySelectorAll("input"),[c,h]=[a[0]??void 0,a[1]??void 0],u=s(this,S,ss),m=R(this.min),y=R(this.max);this.error?s(this,te).setValidity({customError:!0},this.error,c):this._startText.trim()&&!e?s(this,te).setValidity({badInput:!0},this.t("badStart",{pattern:s(this,S,Vo)}),c):this._endText.trim()&&!t?s(this,te).setValidity({badInput:!0},this.t("badEnd",{pattern:s(this,S,Vo)}),h):this.required&&(!e||!t)?s(this,te).setValidity({valueMissing:!0},this.t("required"),e?h:c):e&&t&&t<e?s(this,te).setValidity({badInput:!0},this.t("endBeforeStart"),h):e&&m&&e<m||t&&m&&t<m?s(this,te).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:u.medium(m)}),c):e&&y&&e>y||t&&y&&t>y?s(this,te).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:u.medium(y)}),h):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?s(this,te).setValidity({customError:!0},this.t("unavailable"),c):s(this,te).setValidity({}),this.open&&s(this,Lt)&&(f(this,Lt,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus())}render(){let e=s(this,S,ss),t=R(this.start),i=R(this.end),a=[this.error&&`${s(this,Ee)}-err`,this.helpText&&`${s(this,Ee)}-help`].filter(Boolean).join(" "),c=this.getAttribute("aria-label"),h=this.label||c||"",u=ka(this.presets).map(v=>Dh(v,new Date,E=>this.t(E))).filter(v=>!!v),m=s(this,st)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(R(this._draftStart))}):this.t("chooseStart"),y=v=>{let E=v==="start"?this._startText:this._endText;return l`<input id="${s(this,Ee)}-${v}" type="text" autocomplete="off" spellcheck="false"
653
- .value=${se(E)} placeholder=${s(this,S,Vo)}
654
- aria-label=${v==="start"?this.startLabel||this.t("start"):this.endLabel||this.t("end")}
650
+ ${this.error?c`<p class="error" id="${s(this,Ge)}-err" role="alert">${this.error}</p>`:h}
651
+ ${this.helpText?c`<p class="help" id="${s(this,Ge)}-help">${this.helpText}</p>`:h}
652
+ </div>`}};Fs=new WeakMap,ce=new WeakMap,Ge=new WeakMap,js=new WeakMap,St=new WeakMap,ri=new WeakMap,Se=new WeakMap,He=new WeakMap,Vs=new WeakMap,Us=new WeakMap,k=new WeakSet,Mn=function(){return s(this,Us)},ti=function(e){e!==s(this,Us)&&(g(this,Us,e),this.requestUpdate())},Ks=new WeakMap,ic=function(){return Hs(this,this.locale)},Hi=function(){return Ps(s(this,k,ic))},Os=function(){return Yl(s(this,k,ic),this.hourCycle)},Ct=function(){return this.time?s(this,Se):this.value},ii=function(e){return this.time&&e.trim().toLowerCase()==="now"?Ru():e},_t=function(){return N(Ye(a(this,k,ii).call(this,this.min)).date||this.min)},Lt=function(){return N(Ye(a(this,k,ii).call(this,this.max)).date||this.max)},sc=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=1440?e:1},Jd=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Is(s(this,k,ic)):(Math.trunc(e)%7+7)%7},Zd=function(){return Gl(s(this,k,Hi),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},qs=function(e){let t=N(e);return t?s(this,k,Hi).short(t):e},Ii=function(e){let t=Ri(e);return t===null?"":s(this,k,Os).format(t)},Qd=function(){return Hu(s(this,k,Os),{h:this.t("patternHour"),m:this.t("patternMinute")})},eh=function(e){let{date:t,time:i}=Ye(e);g(this,Se,t),g(this,He,t?i:"")},Iu=function(){let e=new Date,t=N(s(this,k,Ct))??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=ei(t,s(this,k,_t),s(this,k,Lt)),g(this,ri,!0)},rc=function(){let e=this.renderRoot.querySelector("input")??void 0,t=N(s(this,k,Ct)),i=s(this,k,Hi);this.error?s(this,ce).setValidity({customError:!0},this.error,e):this._text.trim()&&!t?s(this,ce).setValidity({badInput:!0},this.t("badInput",{pattern:s(this,k,Zd)}),e):this.time?a(this,k,Pu).call(this,t,e):this.required&&!t?s(this,ce).setValidity({valueMissing:!0},this.t("required"),e):t&&s(this,k,_t)&&t<s(this,k,_t)?s(this,ce).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:i.medium(s(this,k,_t))}),e):t&&s(this,k,Lt)&&t>s(this,k,Lt)?s(this,ce).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:i.medium(s(this,k,Lt))}),e):t&&this.isUnavailable(this.value)?s(this,ce).setValidity({customError:!0},this.t("unavailable"),e):s(this,ce).setValidity({})},Pu=function(e,t){let i=this.renderRoot.querySelector("input.time-in")??t,r=(b,$,y,M=t)=>s(this,ce).setValidity(b,this.t($,y),M),l=Ri(s(this,He));if(s(this,k,Mn).trim()&&l===null)return r({badInput:!0},"badTime",{pattern:s(this,k,Qd)},i);if(!e&&l===null)return this.required?r({valueMissing:!0},"required"):s(this,ce).setValidity({});if(!e)return r({badInput:!0},"required");if(l===null)return r({badInput:!0},"timeMissing",void 0,i);let d=pt(`${s(this,Se)}T${s(this,He)}`),p=pt(a(this,k,ii).call(this,this.min)),m=pt(a(this,k,ii).call(this,this.max),!0),v=(b,$)=>Ye(b).time?s(this,k,Os).dateTime($):s(this,k,Hi).medium($);if(p&&d<p)return r({rangeUnderflow:!0},"rangeUnderflow",{date:v(a(this,k,ii).call(this,this.min),p)},i);if(m&&d>m)return r({rangeOverflow:!0},"rangeOverflow",{date:v(a(this,k,ii).call(this,this.max),m)},i);if(l%s(this,k,sc))return r({stepMismatch:!0},"stepMismatch",{count:s(this,k,sc)},i);if(this.isUnavailable(s(this,Se)))return r({customError:!0},"unavailable");s(this,ce).setValidity({})},th=function(e){e!==this.value&&(this.value=e,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Bs=function(e,t){g(this,Se,e),g(this,He,t);let i=e&&t?`${e}T${t}`:"";g(this,Ks,!0),this.requestUpdate(),a(this,k,th).call(this,i)},Tn=function(e){this.time?a(this,k,Bs).call(this,e,s(this,He)):a(this,k,th).call(this,e)},Cn=function(){let e=this._text.trim();if(!e){a(this,k,Tn).call(this,"");return}let t=Xl(e,s(this,k,Hi));t?(a(this,k,Tn).call(this,t),this._text=a(this,k,qs).call(this,t)):(g(this,St,!0),a(this,k,Tn).call(this,""))},ih=function(){let e=s(this,k,Mn).trim(),t=e?Xd(e,s(this,k,Os)):"";if(g(this,St,!0),t===null){g(this,Vs,!0),a(this,k,Bs).call(this,s(this,Se),"");return}a(this,k,Bs).call(this,s(this,Se),t),g(this,k,a(this,k,Ii).call(this,t),ti)},Ou=function(e){let t=s(this,k,sc),i=Xd(s(this,k,Mn),s(this,k,Os));if(!i){let p=Ye(a(this,k,ii).call(this,this.min)),m=new Date;if(i=p.time&&(!s(this,Se)||s(this,Se)===p.date)?p.time:kn(m.getHours()*60+m.getMinutes()),Ri(i)%t===0){g(this,St,!0),a(this,k,Bs).call(this,s(this,Se),i),g(this,k,a(this,k,Ii).call(this,i),ti);return}e=1}let r=Ri(i),l=e>0?(Math.floor(r/t)+1)*t:(Math.ceil(r/t)-1)*t,d=kn(l>=1440?0:l<0?Math.floor(1439/t)*t:l);g(this,St,!0),a(this,k,Bs).call(this,s(this,Se),d),g(this,k,a(this,k,Ii).call(this,d),ti)},ac=new WeakMap,sh=function(e){let t=H(e);this.isUnavailable(t)||(this.open=!1,a(this,k,Tn).call(this,t),this._text=a(this,k,qs).call(this,t),this.time&&!s(this,He)?this.updateComplete.then(()=>this.renderRoot.querySelector("input.time-in")?.focus()):a(this,k,rh).call(this))},rh=function(){this.renderRoot.querySelector(".trigger")?.focus()},nc=new WeakMap,oc=new WeakMap,lc=new WeakMap,cc=new WeakMap,dc=new WeakMap,_n=new WeakMap,si.formAssociated=!0,si.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},si.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},min:{},max:{},placeholder:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:Rs},isDateDisabled:{attribute:!1},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},time:{type:Boolean,reflect:!0},step:{type:Number},hourCycle:{attribute:"hour-cycle"},_text:{state:!0},_focus:{state:!0}},si.styles=[E,tc,Ql,x`.pop { min-width: 0; }`];w("cm-date-picker",si);var Mx=C("dateRangePicker",{choose:"Choose dates",chooseFor:"Choose dates for {label}",change:"Change dates, {start} to {end}",changeFor:"Change dates for {label}, {start} to {end}",dialog:"Choose dates",previousMonth:"Previous month",nextMonth:"Next month",start:"Start date",end:"End date",presets:"Preset ranges",chooseStart:"Choose the start date.",chooseEnd:"Start date {date}. Choose the end date.",startNote:"start date",endNote:"end date",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badStart:"Enter a start date like {pattern}.",badEnd:"Enter an end date like {pattern}.",required:"Enter or choose a start and end date.",endBeforeStart:"The end date is before the start date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"A chosen date isn't available. Choose another date.",today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",thisMonth:"This month",lastMonth:"Last month"}),Dg={today:["Today",o=>[o,o]],yesterday:["Yesterday",o=>[U(o,-1),U(o,-1)]],"last-7-days":["Last 7 days",o=>[U(o,-6),o]],"last-30-days":["Last 30 days",o=>[U(o,-29),o]],"last-90-days":["Last 90 days",o=>[U(o,-89),o]],"this-month":["This month",o=>[Tt(o),o]],"last-month":["Last month",o=>[Tt(We(o,-1)),Ns(We(o,-1))]]},Ag=o=>o.replace(/-([a-z0-9])/g,(n,e)=>e.toUpperCase());function qu(o,n=new Date,e){if(typeof o=="object"&&o)return o;let t=Dg[o];if(!t)return null;let i=new Date(n.getFullYear(),n.getMonth(),n.getDate()),[r,l]=t[1](i);return{label:e?.(Ag(o))||t[0],start:H(r),end:H(l)}}var Gs,pe,Ie,Xs,Js,ni,R,ah,Ws,nh,Dt,hc,zt,Bu,pc,Ys,oh,Fu,uc,mc,fc,gc,bc,Ln,lh,ai=class extends T{constructor(){super(...arguments);u(this,R);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";u(this,Gs,"");this.disabledDates=[];this.presets=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._startText="";this._endText="";this._focus=new Date;this._draftStart="";this._draftEnd="";this._hover=null;u(this,pe,this.attachInternals());u(this,Ie,D("cm-drp"));u(this,Xs,null);u(this,Js,!1);u(this,ni,!1);u(this,Dt,"start");u(this,mc,()=>{this.disabled||(this.open?this.open=!1:(a(this,R,Ys).call(this,"start"),a(this,R,Ys).call(this,"end"),this.show()))});u(this,fc,e=>t=>{t.key==="Enter"?a(this,R,Ys).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),a(this,R,Ys).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});u(this,gc,e=>{let t=Jl(re(e,this),e,this._focus,s(this,R,nh));if(t){e.preventDefault(),this._focus=ei(t,N(this.min),N(this.max)),g(this,ni,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),a(this,R,oh).call(this,this._focus))});u(this,bc,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,a(this,R,uc).call(this);return}ec(e,e.currentTarget)});u(this,Ln,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return s(this,Gs)}set locale(e){let t=s(this,Gs);g(this,Gs,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),s(this,Xs)||g(this,Xs,[this.start,this.end]),document.addEventListener("pointerdown",s(this,Ln),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",s(this,Ln),!0)}get form(){return s(this,pe).form}get validity(){return s(this,pe).validity}get validationMessage(){return s(this,pe).validationMessage}checkValidity(){return s(this,pe).checkValidity()}reportValidity(){return s(this,pe).reportValidity()}formResetCallback(){[this.start,this.end]=s(this,Xs)??["",""],this._startText=a(this,R,zt).call(this,this.start),this._endText=a(this,R,zt).call(this,this.end),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){[this.start="",this.end=""]=(e??"").split("/")}show(){if(this.disabled)return;this._draftStart=N(this.start)?this.start:"",this._draftEnd=N(this.end)?this.end:"",this._hover=null;let e=new Date;this._focus=ei(N(this.start)??new Date(e.getFullYear(),e.getMonth(),e.getDate()),N(this.min),N(this.max)),g(this,Dt,"start"),g(this,ni,!0),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=N(e);if(!t)return!0;let i=N(this.min),r=N(this.max);return i&&t<i||r&&t>r?!0:En(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){s(this,Js)||(e.has("start")&&(this._startText=a(this,R,zt).call(this,this.start)),e.has("end")&&(this._endText=a(this,R,zt).call(this,this.end))),g(this,Js,!1),e.has("locale")&&(N(this.start)&&(this._startText=a(this,R,zt).call(this,this.start)),N(this.end)&&(this._endText=a(this,R,zt).call(this,this.end)))}updated(){let e=N(this.start),t=N(this.end),i=new FormData;(this.name||this.startName)&&e&&i.append(this.startName||`${this.name}-start`,this.start),(this.name||this.endName)&&t&&i.append(this.endName||`${this.name}-end`,this.end),s(this,pe).setFormValue(e||t?i:null,`${this.start}/${this.end}`);let r=this.renderRoot.querySelectorAll("input"),[l,d]=[r[0]??void 0,r[1]??void 0],p=s(this,R,Ws),m=N(this.min),v=N(this.max);this.error?s(this,pe).setValidity({customError:!0},this.error,l):this._startText.trim()&&!e?s(this,pe).setValidity({badInput:!0},this.t("badStart",{pattern:s(this,R,hc)}),l):this._endText.trim()&&!t?s(this,pe).setValidity({badInput:!0},this.t("badEnd",{pattern:s(this,R,hc)}),d):this.required&&(!e||!t)?s(this,pe).setValidity({valueMissing:!0},this.t("required"),e?d:l):e&&t&&t<e?s(this,pe).setValidity({badInput:!0},this.t("endBeforeStart"),d):e&&m&&e<m||t&&m&&t<m?s(this,pe).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:p.medium(m)}),l):e&&v&&e>v||t&&v&&t>v?s(this,pe).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:p.medium(v)}),d):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?s(this,pe).setValidity({customError:!0},this.t("unavailable"),l):s(this,pe).setValidity({}),this.open&&s(this,ni)&&(g(this,ni,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus())}render(){let e=s(this,R,Ws),t=N(this.start),i=N(this.end),r=[this.error&&`${s(this,Ie)}-err`,this.helpText&&`${s(this,Ie)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label"),d=this.label||l||"",p=En(this.presets).map(b=>qu(b,new Date,$=>this.t($))).filter(b=>!!b),m=s(this,Dt)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(N(this._draftStart))}):this.t("chooseStart"),v=b=>{let $=b==="start"?this._startText:this._endText;return c`<input id="${s(this,Ie)}-${b}" type="text" autocomplete="off" spellcheck="false"
653
+ .value=${le($)} placeholder=${s(this,R,hc)}
654
+ aria-label=${b==="start"?this.startLabel||this.t("start"):this.endLabel||this.t("end")}
655
655
  ?required=${this.required} ?disabled=${this.disabled}
656
- aria-invalid=${this.error?"true":d} aria-describedby=${a||d}
657
- @input=${$=>{$.stopPropagation();let T=$.target.value;v==="start"?this._startText=T:this._endText=T}}
658
- @change=${()=>o(this,S,rs).call(this,v)} @keydown=${s(this,Yo).call(this,v)} />`};return l`<div class="field" role="group" aria-labelledby=${this.label?`${s(this,Ee)}-l`:d} aria-label=${!this.label&&c?c:d}>
659
- ${this.label?l`<span class="label" id="${s(this,Ee)}-l" part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</span>`:d}
656
+ aria-invalid=${this.error?"true":h} aria-describedby=${r||h}
657
+ @input=${y=>{y.stopPropagation();let M=y.target.value;b==="start"?this._startText=M:this._endText=M}}
658
+ @change=${()=>a(this,R,Ys).call(this,b)} @keydown=${s(this,fc).call(this,b)} />`};return c`<div class="field" role="group" aria-labelledby=${this.label?`${s(this,Ie)}-l`:h} aria-label=${!this.label&&l?l:h}>
659
+ ${this.label?c`<span class="label" id="${s(this,Ie)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
660
660
  <div class="wrap">
661
661
  <div class="box" part="box">
662
- ${y("start")}<span class="sep" aria-hidden="true">–</span>${y("end")}
662
+ ${v("start")}<span class="sep" aria-hidden="true">–</span>${v("end")}
663
663
  <button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
664
- aria-label=${t&&i?this.t(h?"changeFor":"change",{label:h,start:e.long(t),end:e.long(i)}):this.t(h?"chooseFor":"choose",{label:h})}
665
- aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,Ee)}-pop"
666
- @click=${s(this,Go)}><cm-icon name="calendar" size="18"></cm-icon></button>
664
+ aria-label=${t&&i?this.t(d?"changeFor":"change",{label:d,start:e.long(t),end:e.long(i)}):this.t(d?"chooseFor":"choose",{label:d})}
665
+ aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,Ie)}-pop"
666
+ @click=${s(this,mc)}><cm-icon name="calendar" size="18"></cm-icon></button>
667
667
  </div>
668
- <div class="pop" id="${s(this,Ee)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
669
- ?hidden=${!this.open} @keydown=${s(this,Xo)}>
670
- ${this.open?l`<div class="body">
671
- ${u.length?l`<ul class="presets" part="presets" aria-label=${this.t("presets")}>${u.map(v=>l`<li>
672
- <button type="button" class="preset" aria-pressed=${v.start===this.start&&v.end===this.end?"true":"false"}
673
- @click=${()=>o(this,S,Rh).call(this,v)}>${v.label}</button></li>`)}</ul>`:d}
674
- <div class="cal">${So({id:s(this,Ee),fmt:e,firstDay:s(this,S,Ec),month:Qt(this._focus),focus:this._focus,min:R(this.min),max:R(this.max),isDisabled:v=>this.isUnavailable(he(v)),mark:v=>o(this,S,Tc).call(this,v),note:v=>{let E=o(this,S,Tc).call(this,v);return E==="start"?this.t("startNote"):E==="end"?this.t("endNote"):""},onPick:v=>o(this,S,Mc).call(this,v),onKey:s(this,Wo),onMonth:v=>{this._focus=Et(je(this._focus,v),R(this.min),R(this.max))},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:v=>{s(this,st)==="end"&&(this._hover=v)}})}
668
+ <div class="pop" id="${s(this,Ie)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
669
+ ?hidden=${!this.open} @keydown=${s(this,bc)}>
670
+ ${this.open?c`<div class="body">
671
+ ${p.length?c`<ul class="presets" part="presets" aria-label=${this.t("presets")}>${p.map(b=>c`<li>
672
+ <button type="button" class="preset" aria-pressed=${b.start===this.start&&b.end===this.end?"true":"false"}
673
+ @click=${()=>a(this,R,Fu).call(this,b)}>${b.label}</button></li>`)}</ul>`:h}
674
+ <div class="cal">${Zl({id:s(this,Ie),fmt:e,firstDay:s(this,R,nh),month:Tt(this._focus),focus:this._focus,min:N(this.min),max:N(this.max),isDisabled:b=>this.isUnavailable(H(b)),mark:b=>a(this,R,lh).call(this,b),note:b=>{let $=a(this,R,lh).call(this,b);return $==="start"?this.t("startNote"):$==="end"?this.t("endNote"):""},onPick:b=>a(this,R,oh).call(this,b),onKey:s(this,gc),onMonth:b=>{this._focus=ei(We(this._focus,b),N(this.min),N(this.max))},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:b=>{s(this,Dt)==="end"&&(this._hover=b)}})}
675
675
  <p class="status" aria-live="polite">${m}</p>
676
676
  </div>
677
- </div>`:d}
677
+ </div>`:h}
678
678
  </div>
679
679
  </div>
680
- ${this.error?l`<p class="error" id="${s(this,Ee)}-err" role="alert">${this.error}</p>`:d}
681
- ${this.helpText?l`<p class="help" id="${s(this,Ee)}-help">${this.helpText}</p>`:d}
682
- </div>`}};as=new WeakMap,te=new WeakMap,Ee=new WeakMap,ns=new WeakMap,os=new WeakMap,Lt=new WeakMap,S=new WeakSet,kc=function(){return Mo(this,this.locale)},ss=function(){return _o(s(this,S,kc))},Ec=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?To(s(this,S,kc)):(Math.trunc(e)%7+7)%7},st=new WeakMap,Vo=function(){return Co(s(this,S,ss),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},it=function(e){let t=R(e);return t?s(this,S,ss).short(t):e},Nh=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Uo=function(e,t){e===this.start&&t===this.end||(this.start=e,this.end=t,o(this,S,Nh).call(this))},rs=function(e){let t=(e==="start"?this._startText:this._endText).trim(),i=t?zo(t,s(this,S,ss)):"";t&&!i&&f(this,os,!0);let a=e==="start"?[i??"",this.end]:[this.start,i??""];o(this,S,Uo).call(this,...a),i&&(e==="start"?this._startText=o(this,S,it).call(this,i):this._endText=o(this,S,it).call(this,i))},Mc=function(e){let t=he(e);if(!this.isUnavailable(t)){if(s(this,st)==="start"||!this._draftStart||t<this._draftStart){this._draftStart=t,this._draftEnd="",f(this,st,"end"),this._focus=e,f(this,Lt,!0);return}this._draftEnd=t,this.open=!1,o(this,S,Uo).call(this,this._draftStart,t),o(this,S,Ko).call(this)}},Rh=function(e){this.open=!1,o(this,S,Uo).call(this,e.start,e.end),o(this,S,Ko).call(this)},Ko=function(){this.renderRoot.querySelector(".trigger")?.focus()},Go=new WeakMap,Yo=new WeakMap,Wo=new WeakMap,Xo=new WeakMap,Ca=new WeakMap,Tc=function(e){let t=he(e),i=this._draftStart,a=this._draftEnd||(s(this,st)==="end"&&i?he(this._hover??this._focus):"");return t===i?"start":t===a&&a>i?"end":i&&a&&t>i&&t<a?"in-range":""},zt.formAssociated=!0,zt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},zt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},startName:{attribute:"start-name"},endName:{attribute:"end-name"},start:{},end:{},min:{},max:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:Yi},isDateDisabled:{attribute:!1},presets:{converter:Yi},startLabel:{attribute:"start-label",string:"start"},endLabel:{attribute:"end-label",string:"end"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_startText:{state:!0},_endText:{state:!0},_focus:{state:!0},_draftStart:{state:!0},_draftEnd:{state:!0},_hover:{state:!0}},zt.styles=[w,No,Ao,b`
680
+ ${this.error?c`<p class="error" id="${s(this,Ie)}-err" role="alert">${this.error}</p>`:h}
681
+ ${this.helpText?c`<p class="help" id="${s(this,Ie)}-help">${this.helpText}</p>`:h}
682
+ </div>`}};Gs=new WeakMap,pe=new WeakMap,Ie=new WeakMap,Xs=new WeakMap,Js=new WeakMap,ni=new WeakMap,R=new WeakSet,ah=function(){return Hs(this,this.locale)},Ws=function(){return Ps(s(this,R,ah))},nh=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Is(s(this,R,ah)):(Math.trunc(e)%7+7)%7},Dt=new WeakMap,hc=function(){return Gl(s(this,R,Ws),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},zt=function(e){let t=N(e);return t?s(this,R,Ws).short(t):e},Bu=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},pc=function(e,t){e===this.start&&t===this.end||(this.start=e,this.end=t,a(this,R,Bu).call(this))},Ys=function(e){let t=(e==="start"?this._startText:this._endText).trim(),i=t?Xl(t,s(this,R,Ws)):"";t&&!i&&g(this,Js,!0);let r=e==="start"?[i??"",this.end]:[this.start,i??""];a(this,R,pc).call(this,...r),i&&(e==="start"?this._startText=a(this,R,zt).call(this,i):this._endText=a(this,R,zt).call(this,i))},oh=function(e){let t=H(e);if(!this.isUnavailable(t)){if(s(this,Dt)==="start"||!this._draftStart||t<this._draftStart){this._draftStart=t,this._draftEnd="",g(this,Dt,"end"),this._focus=e,g(this,ni,!0);return}this._draftEnd=t,this.open=!1,a(this,R,pc).call(this,this._draftStart,t),a(this,R,uc).call(this)}},Fu=function(e){this.open=!1,a(this,R,pc).call(this,e.start,e.end),a(this,R,uc).call(this)},uc=function(){this.renderRoot.querySelector(".trigger")?.focus()},mc=new WeakMap,fc=new WeakMap,gc=new WeakMap,bc=new WeakMap,Ln=new WeakMap,lh=function(e){let t=H(e),i=this._draftStart,r=this._draftEnd||(s(this,Dt)==="end"&&i?H(this._hover??this._focus):"");return t===i?"start":t===r&&r>i?"end":i&&r&&t>i&&t<r?"in-range":""},ai.formAssociated=!0,ai.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},ai.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},startName:{attribute:"start-name"},endName:{attribute:"end-name"},start:{},end:{},min:{},max:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:Rs},isDateDisabled:{attribute:!1},presets:{converter:Rs},startLabel:{attribute:"start-label",string:"start"},endLabel:{attribute:"end-label",string:"end"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_startText:{state:!0},_endText:{state:!0},_focus:{state:!0},_draftStart:{state:!0},_draftEnd:{state:!0},_hover:{state:!0}},ai.styles=[E,tc,Ql,x`
683
683
  .sep { flex: none; color: var(--cm-text-tertiary); }
684
684
  input { flex: 0 1 6.6em; }
685
685
  :host([size='small']) input { flex-basis: 6.6em; }
@@ -699,49 +699,49 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
699
699
  .presets li { flex: 0 0 auto; }
700
700
  .preset { width: auto; border: var(--cm-border-1) solid var(--cm-border-default); border-radius: var(--cm-radius-full); min-height: 32px; }
701
701
  }
702
- `];g("cm-date-range-picker",zt);var Rb=M("fileUpload",{prompt:"Click here to upload",addMore:"Add more",files:"Chosen files",remove:"Remove {name}",kilobytes:"{size} KB",megabytes:"{size} MB",required:"Please choose a file.",wrongType:"{name} is not an allowed file type",tooLarge:"{name} is larger than {size}",tooMany:"You can add up to {max} files",takePhoto:"Take a photo",retake:"Retake",removePhoto:"Remove",retakeName:"Retake {name}",removeName:"Remove {name}",photo:"photo"});function Vu(n,r){if(!r.trim())return!0;let e=n.name.toLowerCase(),t=n.type.toLowerCase();return r.split(",").map(i=>i.trim().toLowerCase()).filter(Boolean).some(i=>i.startsWith(".")?e.endsWith(i):i.endsWith("/*")?t.startsWith(i.slice(0,-1)):t===i)}var De,Y,rt,H,za,_c,Jo,Zo,Cc,zc,ri,Lc,Hh,Ih,St=class extends k{constructor(){super(...arguments);p(this,H);this.label="";this.hint="";this.name="";this.accept="";this.multiple=!1;this.maxSize=0;this.maxFiles=0;this.required=!1;this.disabled=!1;this.error="";this.files=[];this._rejected="";p(this,De,this.attachInternals());p(this,Y,L("cm-fu"));p(this,rt,new Map)}get form(){return s(this,De).form}get validity(){return s(this,De).validity}get validationMessage(){return s(this,De).validationMessage}checkValidity(){return s(this,De).checkValidity()}reportValidity(){return s(this,De).reportValidity()}formResetCallback(){this.files=[],this._rejected=""}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback();for(let e of s(this,rt).values())URL.revokeObjectURL(e);s(this,rt).clear()}updated(e){if(e.has("files"))for(let[c,h]of s(this,rt))this.files.includes(c)||(URL.revokeObjectURL(h),s(this,rt).delete(c));let t=new FormData;for(let c of this.files)t.append(this.name||"file",c);s(this,De).setFormValue(this.files.length?t:null);let i=(s(this,H,za)&&this.files.length?this.renderRoot.querySelector(".retake"):this.renderRoot.querySelector("input"))??void 0,a=this.error||this._rejected;a?s(this,De).setValidity({customError:!0},a,i):this.required&&!this.files.length?s(this,De).setValidity({valueMissing:!0},this.t("required"),i):s(this,De).setValidity({})}addFiles(e){let t=[...e],i=[],a=[],c=[];for(let u of t)Vu(u,s(this,H,_c))?this.maxSize&&u.size>this.maxSize?(a.push(u),c.push(this.t("tooLarge",{name:u.name,size:o(this,H,Zo).call(this,this.maxSize)}))):i.push(u):(a.push(u),c.push(this.t("wrongType",{name:u.name})));let h=s(this,H,Jo)?[...this.files,...i]:i.slice(-1);!s(this,H,Jo)&&!i.length&&(h=this.files),s(this,H,Jo)&&this.maxFiles&&h.length>this.maxFiles&&(a.push(...h.slice(this.maxFiles)),c.push(this.t("tooMany",{max:this.maxFiles})),h=h.slice(0,this.maxFiles)),this._rejected=c.join(". "),a.length&&this.dispatchEvent(new CustomEvent("cm-reject",{bubbles:!0,composed:!0,detail:{files:a}})),h!==this.files&&(h.length!==this.files.length||h.some((u,m)=>u!==this.files[m]))&&(this.files=h,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}removeFile(e){this.files.includes(e)&&(this.files=this.files.filter(t=>t!==e),this._rejected="",this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.renderRoot.querySelector("input")?.focus()))}render(){if(s(this,H,za))return o(this,H,Ih).call(this);let e=this.error||this._rejected,t=!this.files.length||this.multiple,i=this.files.length>0;return l`
703
- ${this.label||this.hint?l`<div class="head">
704
- ${this.label?l`<span class="label" id="${s(this,Y)}-l" part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</span>`:d}
705
- ${this.hint?l`<span class="hint" id="${s(this,Y)}-hint">${this.hint}</span>`:d}
706
- </div>`:d}
707
- ${i?l`<ul class="grid" part="files" role="list" style="list-style:none;margin:0;padding:0" aria-label=${this.t("files")}>
708
- ${this.files.map(a=>l`<li class="file">
709
- ${a.type.startsWith("image/")?l`<img src=${o(this,H,Cc).call(this,a)} alt=${a.name} />`:l`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${a.name}</span><span class="size">${o(this,H,Zo).call(this,a.size)}</span></div>`}
710
- ${this.disabled?d:l`<button type="button" class="remove" aria-label=${this.t("remove",{name:a.name})} @click=${()=>this.removeFile(a)}><cm-icon name="close" size="12"></cm-icon></button>`}
702
+ `];w("cm-date-range-picker",ai);var zx=C("fileUpload",{prompt:"Click here to upload",addMore:"Add more",files:"Chosen files",remove:"Remove {name}",kilobytes:"{size} KB",megabytes:"{size} MB",required:"Please choose a file.",wrongType:"{name} is not an allowed file type",tooLarge:"{name} is larger than {size}",tooMany:"You can add up to {max} files",takePhoto:"Take a photo",retake:"Retake",removePhoto:"Remove",retakeName:"Retake {name}",removeName:"Remove {name}",photo:"photo"});function Ng(o,n){if(!n.trim())return!0;let e=o.name.toLowerCase(),t=o.type.toLowerCase();return n.split(",").map(i=>i.trim().toLowerCase()).filter(Boolean).some(i=>i.startsWith(".")?e.endsWith(i):i.endsWith("/*")?t.startsWith(i.slice(0,-1)):t===i)}var Xe,ae,At,q,Sn,ch,vc,xc,dh,hh,Pi,ph,ju,Vu,oi=class extends T{constructor(){super(...arguments);u(this,q);this.label="";this.hint="";this.name="";this.accept="";this.multiple=!1;this.maxSize=0;this.maxFiles=0;this.required=!1;this.disabled=!1;this.error="";this.files=[];this._rejected="";u(this,Xe,this.attachInternals());u(this,ae,D("cm-fu"));u(this,At,new Map)}get form(){return s(this,Xe).form}get validity(){return s(this,Xe).validity}get validationMessage(){return s(this,Xe).validationMessage}checkValidity(){return s(this,Xe).checkValidity()}reportValidity(){return s(this,Xe).reportValidity()}formResetCallback(){this.files=[],this._rejected=""}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback();for(let e of s(this,At).values())URL.revokeObjectURL(e);s(this,At).clear()}updated(e){if(e.has("files"))for(let[l,d]of s(this,At))this.files.includes(l)||(URL.revokeObjectURL(d),s(this,At).delete(l));let t=new FormData;for(let l of this.files)t.append(this.name||"file",l);s(this,Xe).setFormValue(this.files.length?t:null);let i=(s(this,q,Sn)&&this.files.length?this.renderRoot.querySelector(".retake"):this.renderRoot.querySelector("input"))??void 0,r=this.error||this._rejected;r?s(this,Xe).setValidity({customError:!0},r,i):this.required&&!this.files.length?s(this,Xe).setValidity({valueMissing:!0},this.t("required"),i):s(this,Xe).setValidity({})}addFiles(e){let t=[...e],i=[],r=[],l=[];for(let p of t)Ng(p,s(this,q,ch))?this.maxSize&&p.size>this.maxSize?(r.push(p),l.push(this.t("tooLarge",{name:p.name,size:a(this,q,xc).call(this,this.maxSize)}))):i.push(p):(r.push(p),l.push(this.t("wrongType",{name:p.name})));let d=s(this,q,vc)?[...this.files,...i]:i.slice(-1);!s(this,q,vc)&&!i.length&&(d=this.files),s(this,q,vc)&&this.maxFiles&&d.length>this.maxFiles&&(r.push(...d.slice(this.maxFiles)),l.push(this.t("tooMany",{max:this.maxFiles})),d=d.slice(0,this.maxFiles)),this._rejected=l.join(". "),r.length&&this.dispatchEvent(new CustomEvent("cm-reject",{bubbles:!0,composed:!0,detail:{files:r}})),d!==this.files&&(d.length!==this.files.length||d.some((p,m)=>p!==this.files[m]))&&(this.files=d,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}removeFile(e){this.files.includes(e)&&(this.files=this.files.filter(t=>t!==e),this._rejected="",this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.renderRoot.querySelector("input")?.focus()))}render(){if(s(this,q,Sn))return a(this,q,Vu).call(this);let e=this.error||this._rejected,t=!this.files.length||this.multiple,i=this.files.length>0;return c`
703
+ ${this.label||this.hint?c`<div class="head">
704
+ ${this.label?c`<span class="label" id="${s(this,ae)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
705
+ ${this.hint?c`<span class="hint" id="${s(this,ae)}-hint">${this.hint}</span>`:h}
706
+ </div>`:h}
707
+ ${i?c`<ul class="grid" part="files" role="list" style="list-style:none;margin:0;padding:0" aria-label=${this.t("files")}>
708
+ ${this.files.map(r=>c`<li class="file">
709
+ ${r.type.startsWith("image/")?c`<img src=${a(this,q,dh).call(this,r)} alt=${r.name} />`:c`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${r.name}</span><span class="size">${a(this,q,xc).call(this,r.size)}</span></div>`}
710
+ ${this.disabled?h:c`<button type="button" class="remove" aria-label=${this.t("remove",{name:r.name})} @click=${()=>this.removeFile(r)}><cm-icon name="close" size="12"></cm-icon></button>`}
711
711
  </li>`)}
712
- ${t?l`<li>${o(this,H,Lc).call(this,!0)}</li>`:d}
713
- </ul>`:o(this,H,Lc).call(this,!1)}
714
- ${e?l`<p class="msg" id="${s(this,Y)}-msg" role="alert">${e}</p>`:d}
715
- `}};De=new WeakMap,Y=new WeakMap,rt=new WeakMap,H=new WeakSet,za=function(){return this.variant==="photo"},_c=function(){return this.accept||(s(this,H,za)?"image/*":"")},Jo=function(){return this.multiple&&!s(this,H,za)},Zo=function(e){return e>=1024*1024?this.t("megabytes",{size:this.formatNumber(+(e/1024/1024).toFixed(1),{useGrouping:!1})}):this.t("kilobytes",{size:this.formatNumber(Math.max(1,Math.round(e/1024)),{useGrouping:!1})})},Cc=function(e){let t=s(this,rt).get(e);return t||(t=URL.createObjectURL(e),s(this,rt).set(e,t)),t},zc=function(e){e.stopPropagation();let t=e.target;this.addFiles(t.files??[]),t.value=""},ri=function(e){this.toggleAttribute("data-over",e)},Lc=function(e){let t=[this.hint&&`${s(this,Y)}-hint`,(this.error||this._rejected)&&`${s(this,Y)}-msg`].filter(Boolean).join(" ");return l`<label class="zone ${e?"tile":""}" part="zone"
716
- @dragenter=${()=>o(this,H,ri).call(this,!0)} @dragleave=${()=>o(this,H,ri).call(this,!1)} @drop=${()=>o(this,H,ri).call(this,!1)}>
717
- <input type="file" id=${s(this,Y)} accept=${this.accept||d} capture=${this.capture||d} ?multiple=${this.multiple} ?disabled=${this.disabled}
712
+ ${t?c`<li>${a(this,q,ph).call(this,!0)}</li>`:h}
713
+ </ul>`:a(this,q,ph).call(this,!1)}
714
+ ${e?c`<p class="msg" id="${s(this,ae)}-msg" role="alert">${e}</p>`:h}
715
+ `}};Xe=new WeakMap,ae=new WeakMap,At=new WeakMap,q=new WeakSet,Sn=function(){return this.variant==="photo"},ch=function(){return this.accept||(s(this,q,Sn)?"image/*":"")},vc=function(){return this.multiple&&!s(this,q,Sn)},xc=function(e){return e>=1024*1024?this.t("megabytes",{size:this.formatNumber(+(e/1024/1024).toFixed(1),{useGrouping:!1})}):this.t("kilobytes",{size:this.formatNumber(Math.max(1,Math.round(e/1024)),{useGrouping:!1})})},dh=function(e){let t=s(this,At).get(e);return t||(t=URL.createObjectURL(e),s(this,At).set(e,t)),t},hh=function(e){e.stopPropagation();let t=e.target;this.addFiles(t.files??[]),t.value=""},Pi=function(e){this.toggleAttribute("data-over",e)},ph=function(e){let t=[this.hint&&`${s(this,ae)}-hint`,(this.error||this._rejected)&&`${s(this,ae)}-msg`].filter(Boolean).join(" ");return c`<label class="zone ${e?"tile":""}" part="zone"
716
+ @dragenter=${()=>a(this,q,Pi).call(this,!0)} @dragleave=${()=>a(this,q,Pi).call(this,!1)} @drop=${()=>a(this,q,Pi).call(this,!1)}>
717
+ <input type="file" id=${s(this,ae)} accept=${this.accept||h} capture=${this.capture||h} ?multiple=${this.multiple} ?disabled=${this.disabled}
718
718
  ?required=${this.required&&!this.files.length}
719
- aria-labelledby=${[this.label&&`${s(this,Y)}-l`,`${s(this,Y)}-p`].filter(Boolean).join(" ")}
720
- aria-describedby=${t||d} aria-invalid=${this.error||this._rejected?"true":d}
721
- @change=${o(this,H,zc)} @cancel=${i=>i.stopPropagation()} />
719
+ aria-labelledby=${[this.label&&`${s(this,ae)}-l`,`${s(this,ae)}-p`].filter(Boolean).join(" ")}
720
+ aria-describedby=${t||h} aria-invalid=${this.error||this._rejected?"true":h}
721
+ @change=${a(this,q,hh)} @cancel=${i=>i.stopPropagation()} />
722
722
  <cm-icon name=${e?"plus":"upload"} size=${e?24:38}></cm-icon>
723
- <span id="${s(this,Y)}-p">${e?this.t("addMore"):this.prompt}</span>
724
- </label>`},Hh=function(){this.renderRoot.querySelector("input[type=file]")?.click()},Ih=function(){let e=this.error||this._rejected,t=this.files[0],i=this.label||this.t("photo"),a=[this.hint&&`${s(this,Y)}-hint`,e&&`${s(this,Y)}-msg`].filter(Boolean).join(" "),c=u=>l`<input type="file" id=${s(this,Y)} accept=${s(this,H,_c)} capture=${this.capture||d}
725
- ?disabled=${this.disabled} ?required=${this.required&&!t} tabindex=${u?"-1":d} aria-hidden=${u?"true":d}
726
- ?hidden=${u} aria-labelledby=${u?d:`${s(this,Y)}-p`} aria-describedby=${!u&&a||d} aria-invalid=${e?"true":d}
727
- @change=${o(this,H,zc)} @cancel=${m=>m.stopPropagation()} />`,h=this.hint?l`<span class="hint" id="${s(this,Y)}-hint">${this.hint}</span>`:d;return l`
728
- ${t?l`<div class="shot" part="photo">
729
- ${t.type.startsWith("image/")?l`<img src=${o(this,H,Cc).call(this,t)} alt=${i} />`:l`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${t.name}</span><span class="size">${o(this,H,Zo).call(this,t.size)}</span></div>`}
723
+ <span id="${s(this,ae)}-p">${e?this.t("addMore"):this.prompt}</span>
724
+ </label>`},ju=function(){this.renderRoot.querySelector("input[type=file]")?.click()},Vu=function(){let e=this.error||this._rejected,t=this.files[0],i=this.label||this.t("photo"),r=[this.hint&&`${s(this,ae)}-hint`,e&&`${s(this,ae)}-msg`].filter(Boolean).join(" "),l=p=>c`<input type="file" id=${s(this,ae)} accept=${s(this,q,ch)} capture=${this.capture||h}
725
+ ?disabled=${this.disabled} ?required=${this.required&&!t} tabindex=${p?"-1":h} aria-hidden=${p?"true":h}
726
+ ?hidden=${p} aria-labelledby=${p?h:`${s(this,ae)}-p`} aria-describedby=${!p&&r||h} aria-invalid=${e?"true":h}
727
+ @change=${a(this,q,hh)} @cancel=${m=>m.stopPropagation()} />`,d=this.hint?c`<span class="hint" id="${s(this,ae)}-hint">${this.hint}</span>`:h;return c`
728
+ ${t?c`<div class="shot" part="photo">
729
+ ${t.type.startsWith("image/")?c`<img src=${a(this,q,dh).call(this,t)} alt=${i} />`:c`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${t.name}</span><span class="size">${a(this,q,xc).call(this,t.size)}</span></div>`}
730
730
  </div>
731
731
  <p class="caption" aria-hidden="true">${this.label}</p>
732
- ${c(!0)}
733
- ${this.disabled?d:l`<div class="actions" part="actions">
734
- <button type="button" class="action retake" aria-label=${this.t("retakeName",{name:i})} aria-describedby=${e?`${s(this,Y)}-msg`:d} @click=${o(this,H,Hh)}><cm-icon name="camera" size="16"></cm-icon>${this.t("retake")}</button>
732
+ ${l(!0)}
733
+ ${this.disabled?h:c`<div class="actions" part="actions">
734
+ <button type="button" class="action retake" aria-label=${this.t("retakeName",{name:i})} aria-describedby=${e?`${s(this,ae)}-msg`:h} @click=${a(this,q,ju)}><cm-icon name="camera" size="16"></cm-icon>${this.t("retake")}</button>
735
735
  <button type="button" class="action" aria-label=${this.t("removeName",{name:i})} @click=${()=>this.removeFile(t)}><cm-icon name="trash" size="16"></cm-icon>${this.t("removePhoto")}</button>
736
- </div>`}`:l`<label class="zone photo ${e?"invalid":""}" part="zone photo"
737
- @dragenter=${()=>o(this,H,ri).call(this,!0)} @dragleave=${()=>o(this,H,ri).call(this,!1)} @drop=${()=>o(this,H,ri).call(this,!1)}>
738
- ${c(!1)}
736
+ </div>`}`:c`<label class="zone photo ${e?"invalid":""}" part="zone photo"
737
+ @dragenter=${()=>a(this,q,Pi).call(this,!0)} @dragleave=${()=>a(this,q,Pi).call(this,!1)} @drop=${()=>a(this,q,Pi).call(this,!1)}>
738
+ ${l(!1)}
739
739
  <cm-icon name="camera" size="32"></cm-icon>
740
- <span class="photo-label" id="${s(this,Y)}-p" part="label">${this.label||this.t("takePhoto")}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</span>
741
- ${h}
740
+ <span class="photo-label" id="${s(this,ae)}-p" part="label">${this.label||this.t("takePhoto")}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>
741
+ ${d}
742
742
  </label>`}
743
- ${e?l`<p class="msg" id="${s(this,Y)}-msg" role="alert">${e}</p>`:d}
744
- `},St.formAssociated=!0,St.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},St.properties={label:{},hint:{},prompt:{string:"prompt"},name:{reflect:!0},accept:{},multiple:{type:Boolean},maxSize:{type:Number,attribute:"max-size"},maxFiles:{type:Number,attribute:"max-files"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},error:{reflect:!0},files:{attribute:!1},variant:{reflect:!0},capture:{reflect:!0},_rejected:{state:!0}},St.styles=[w,b`
743
+ ${e?c`<p class="msg" id="${s(this,ae)}-msg" role="alert">${e}</p>`:h}
744
+ `},oi.formAssociated=!0,oi.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},oi.properties={label:{},hint:{},prompt:{string:"prompt"},name:{reflect:!0},accept:{},multiple:{type:Boolean},maxSize:{type:Number,attribute:"max-size"},maxFiles:{type:Number,attribute:"max-files"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},error:{reflect:!0},files:{attribute:!1},variant:{reflect:!0},capture:{reflect:!0},_rejected:{state:!0}},oi.styles=[E,x`
745
745
  :host { display: block; }
746
746
  .head { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: var(--cm-space-10); margin-bottom: var(--cm-space-20); }
747
747
  .label { font-size: var(--cm-type-heading-sm-size); font-weight: 600; }
@@ -798,33 +798,33 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
798
798
  .zone:not(.tile):not(.photo) { min-height: 100px; font-size: 14px; }
799
799
  .label { font-size: var(--cm-type-heading-sm-resp-size); }
800
800
  }
801
- `];g("cm-file-upload",St);var jb=M("colorField",{swatch:"{name}, {hex}",hex:"Hex code",hexNamed:"{label}, hex code",placeholder:"#RRGGBB",picker:"Choose a custom colour",pickerNamed:"Choose a custom colour for {label}",required:"Please choose a colour.",invalid:"Enter a colour as #RRGGBB, for example #2e6faf.",black:"Black",grey:"Grey",lightGrey:"Light grey",red:"Red",darkOrange:"Dark orange",orange:"Orange",yellow:"Yellow",lightGreen:"Light green",green:"Green",lightBlue:"Light blue",blue:"Blue",indigo:"Indigo"}),Uu=[{value:"#000000",key:"black"},{value:"#707070",key:"grey"},{value:"#c9c9c9",key:"lightGrey"},{value:"#de0000",key:"red"},{value:"#ad5500",key:"darkOrange"},{value:"#f1a953",key:"orange"},{value:"#ffc107",key:"yellow"},{value:"#81bb47",key:"lightGreen"},{value:"#3c7c00",key:"green"},{value:"#5394d9",key:"lightBlue"},{value:"#2e6faf",key:"blue"},{value:"#446beb",key:"indigo"}];function at(n){let r=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(n.trim());return r?`#${(r[1].length===3?[...r[1]].map(t=>t+t).join(""):r[1]).toLowerCase()}`:null}var Ku=n=>{let r=parseInt(n.slice(1),16);return[r>>16&255,r>>8&255,r&255].map(e=>e/255).map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4).reduce((e,t,i)=>e+t*[.2126,.7152,.0722][i],0)};function Gu(n){let r=Ku(n);return(r+.05)/.05>=1.05/(r+.05)?"#000000":"#ffffff"}var Me,Fe,La,ls,O,ai,Sc,Oh,qh,Ac,Ph,Bh,jh,Fh,At=class extends k{constructor(){super(...arguments);p(this,O);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.picker=!1;this.required=!1;this.disabled=!1;this._invalid=!1;p(this,Me,this.attachInternals());p(this,Fe,L("cm-cf"));p(this,La,"");p(this,ls)}connectedCallback(){super.connectedCallback(),f(this,La,at(this.value)??this.value)}get form(){return s(this,Me).form}get validity(){return s(this,Me).validity}get validationMessage(){return s(this,Me).validationMessage}checkValidity(){return s(this,Me).checkValidity()}reportValidity(){return s(this,Me).reportValidity()}formResetCallback(){this.value=s(this,La),this._draft=void 0,this._invalid=!1}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}get items(){return this.swatches?this.swatches.flatMap(e=>{let t=typeof e=="string"?{value:e}:e,i=at(t?.value??"");return i?[{value:i,name:t.name}]:[]}):Uu.map(e=>({value:e.value,name:this.t(e.key)}))}willUpdate(e){if(e.has("value")){let t=at(this.value??"");t&&t!==this.value&&(this.value=t),this.hasUpdated&&this.value!==s(this,ls)&&(this._draft=void 0,this._invalid=!1),f(this,ls,void 0)}}updated(){let e=!this.value||at(this.value)!==null;s(this,Me).setFormValue(this.value&&e?this.value:null,this.value);let t=this.renderRoot.querySelector(".input")??void 0;this.error?s(this,Me).setValidity({customError:!0},this.error,t):this._invalid||!e?s(this,Me).setValidity({patternMismatch:!0},this.t("invalid"),t):this.required&&!this.value?s(this,Me).setValidity({valueMissing:!0},this.t("required"),t):s(this,Me).setValidity({})}render(){let e=this.items,t=at(this.value??""),i=e.findIndex(m=>m.value===t),a=this.error||(this._invalid||this.value&&!t?this.t("invalid"):""),c=[a&&`${s(this,Fe)}-err`,this.helpText&&`${s(this,Fe)}-help`].filter(Boolean).join(" ")||d,h=this.getAttribute("aria-label"),u=this.label||h||"";return l`<div class="field">
802
- ${this.label?l`<span class="label" id="${s(this,Fe)}-l" part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}${this.hint?l`<span class="hint">[${this.hint}]</span>`:d}</span>`:d}
803
- ${e.length?l`<div class="swatches" part="swatches" role="radiogroup"
804
- aria-labelledby=${this.label?`${s(this,Fe)}-l`:d} aria-label=${!this.label&&h?h:d}
805
- aria-required=${this.required?"true":d} aria-describedby=${c}>
806
- ${e.map((m,y)=>{let v=m.name?this.t("swatch",{name:m.name,hex:m.value}):m.value;return l`<button type="button" class="swatch" part="swatch" role="radio" aria-checked=${y===i?"true":"false"}
807
- aria-label=${v} title=${m.name||m.value} tabindex=${y===(i>=0?i:0)?"0":"-1"} ?disabled=${this.disabled}
808
- style="background-color:${m.value};color:${Gu(m.value)}"
809
- @click=${()=>o(this,O,Sc).call(this,y)} @keydown=${E=>o(this,O,Oh).call(this,E,y)}><cm-icon name="check" size="18"></cm-icon></button>`})}
810
- </div>`:d}
801
+ `];w("cm-file-upload",oi);var Px=C("colorField",{swatch:"{name}, {hex}",hex:"Hex code",hexNamed:"{label}, hex code",placeholder:"#RRGGBB",picker:"Choose a custom colour",pickerNamed:"Choose a custom colour for {label}",required:"Please choose a colour.",invalid:"Enter a colour as #RRGGBB, for example #2e6faf.",black:"Black",grey:"Grey",lightGrey:"Light grey",red:"Red",darkOrange:"Dark orange",orange:"Orange",yellow:"Yellow",lightGreen:"Light green",green:"Green",lightBlue:"Light blue",blue:"Blue",indigo:"Indigo"}),Rg=[{value:"#000000",key:"black"},{value:"#707070",key:"grey"},{value:"#c9c9c9",key:"lightGrey"},{value:"#de0000",key:"red"},{value:"#ad5500",key:"darkOrange"},{value:"#f1a953",key:"orange"},{value:"#ffc107",key:"yellow"},{value:"#81bb47",key:"lightGreen"},{value:"#3c7c00",key:"green"},{value:"#5394d9",key:"lightBlue"},{value:"#2e6faf",key:"blue"},{value:"#446beb",key:"indigo"}];function Nt(o){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());return n?`#${(n[1].length===3?[...n[1]].map(t=>t+t).join(""):n[1]).toLowerCase()}`:null}var Hg=o=>{let n=parseInt(o.slice(1),16);return[n>>16&255,n>>8&255,n&255].map(e=>e/255).map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4).reduce((e,t,i)=>e+t*[.2126,.7152,.0722][i],0)};function Ig(o){let n=Hg(o);return(n+.05)/.05>=1.05/(n+.05)?"#000000":"#ffffff"}var Pe,ut,zn,Zs,K,Oi,uh,Uu,Ku,mh,Wu,Yu,Gu,Xu,li=class extends T{constructor(){super(...arguments);u(this,K);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.picker=!1;this.required=!1;this.disabled=!1;this._invalid=!1;u(this,Pe,this.attachInternals());u(this,ut,D("cm-cf"));u(this,zn,"");u(this,Zs)}connectedCallback(){super.connectedCallback(),g(this,zn,Nt(this.value)??this.value)}get form(){return s(this,Pe).form}get validity(){return s(this,Pe).validity}get validationMessage(){return s(this,Pe).validationMessage}checkValidity(){return s(this,Pe).checkValidity()}reportValidity(){return s(this,Pe).reportValidity()}formResetCallback(){this.value=s(this,zn),this._draft=void 0,this._invalid=!1}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}get items(){return this.swatches?this.swatches.flatMap(e=>{let t=typeof e=="string"?{value:e}:e,i=Nt(t?.value??"");return i?[{value:i,name:t.name}]:[]}):Rg.map(e=>({value:e.value,name:this.t(e.key)}))}willUpdate(e){if(e.has("value")){let t=Nt(this.value??"");t&&t!==this.value&&(this.value=t),this.hasUpdated&&this.value!==s(this,Zs)&&(this._draft=void 0,this._invalid=!1),g(this,Zs,void 0)}}updated(){let e=!this.value||Nt(this.value)!==null;s(this,Pe).setFormValue(this.value&&e?this.value:null,this.value);let t=this.renderRoot.querySelector(".input")??void 0;this.error?s(this,Pe).setValidity({customError:!0},this.error,t):this._invalid||!e?s(this,Pe).setValidity({patternMismatch:!0},this.t("invalid"),t):this.required&&!this.value?s(this,Pe).setValidity({valueMissing:!0},this.t("required"),t):s(this,Pe).setValidity({})}render(){let e=this.items,t=Nt(this.value??""),i=e.findIndex(m=>m.value===t),r=this.error||(this._invalid||this.value&&!t?this.t("invalid"):""),l=[r&&`${s(this,ut)}-err`,this.helpText&&`${s(this,ut)}-help`].filter(Boolean).join(" ")||h,d=this.getAttribute("aria-label"),p=this.label||d||"";return c`<div class="field">
802
+ ${this.label?c`<span class="label" id="${s(this,ut)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}${this.hint?c`<span class="hint">[${this.hint}]</span>`:h}</span>`:h}
803
+ ${e.length?c`<div class="swatches" part="swatches" role="radiogroup"
804
+ aria-labelledby=${this.label?`${s(this,ut)}-l`:h} aria-label=${!this.label&&d?d:h}
805
+ aria-required=${this.required?"true":h} aria-describedby=${l}>
806
+ ${e.map((m,v)=>{let b=m.name?this.t("swatch",{name:m.name,hex:m.value}):m.value;return c`<button type="button" class="swatch" part="swatch" role="radio" aria-checked=${v===i?"true":"false"}
807
+ aria-label=${b} title=${m.name||m.value} tabindex=${v===(i>=0?i:0)?"0":"-1"} ?disabled=${this.disabled}
808
+ style="background-color:${m.value};color:${Ig(m.value)}"
809
+ @click=${()=>a(this,K,uh).call(this,v)} @keydown=${$=>a(this,K,Uu).call(this,$,v)}><cm-icon name="check" size="18"></cm-icon></button>`})}
810
+ </div>`:h}
811
811
  <div class="row">
812
- ${this.picker?l`<label class="pick" part="picker" style=${t?`background-color:${t}`:d}>
813
- <input type="color" .value=${se(t??"#000000")} ?disabled=${this.disabled}
814
- aria-label=${u?this.t("pickerNamed",{label:u}):this.t("picker")}
815
- @input=${o(this,O,jh)} @change=${o(this,O,Fh)} />
812
+ ${this.picker?c`<label class="pick" part="picker" style=${t?`background-color:${t}`:h}>
813
+ <input type="color" .value=${le(t??"#000000")} ?disabled=${this.disabled}
814
+ aria-label=${p?this.t("pickerNamed",{label:p}):this.t("picker")}
815
+ @input=${a(this,K,Gu)} @change=${a(this,K,Xu)} />
816
816
  <cm-icon name="edit" size="12" aria-hidden="true"></cm-icon>
817
- </label>`:l`<span class="preview" part="preview" aria-hidden="true" style=${t?`background-color:${t}`:d}></span>`}
818
- <input class="input" part="input" id=${s(this,Fe)} type="text" inputmode="text" autocomplete="off" spellcheck="false"
819
- maxlength="7" .value=${se(this._draft??this.value??"")} placeholder=${this.t("placeholder")}
820
- aria-label=${u?this.t("hexNamed",{label:u}):this.t("hex")}
817
+ </label>`:c`<span class="preview" part="preview" aria-hidden="true" style=${t?`background-color:${t}`:h}></span>`}
818
+ <input class="input" part="input" id=${s(this,ut)} type="text" inputmode="text" autocomplete="off" spellcheck="false"
819
+ maxlength="7" .value=${le(this._draft??this.value??"")} placeholder=${this.t("placeholder")}
820
+ aria-label=${p?this.t("hexNamed",{label:p}):this.t("hex")}
821
821
  ?required=${this.required} ?disabled=${this.disabled}
822
- aria-invalid=${a?"true":d} aria-describedby=${c}
823
- @input=${o(this,O,qh)} @change=${o(this,O,Ph)} @keydown=${o(this,O,Bh)} />
822
+ aria-invalid=${r?"true":h} aria-describedby=${l}
823
+ @input=${a(this,K,Ku)} @change=${a(this,K,Wu)} @keydown=${a(this,K,Yu)} />
824
824
  </div>
825
- ${a?l`<p class="error" id="${s(this,Fe)}-err" role="alert">${a}</p>`:d}
826
- ${this.helpText?l`<p class="help" id="${s(this,Fe)}-help">${this.helpText}</p>`:d}
827
- </div>`}};Me=new WeakMap,Fe=new WeakMap,La=new WeakMap,ls=new WeakMap,O=new WeakSet,ai=function(...e){for(let t of e)this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))},Sc=function(e){let t=this.items[e];!t||this.disabled||(this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".swatch")[e]?.focus()),this._draft=void 0,this._invalid=!1,t.value!==this.value&&(this.value=t.value,o(this,O,ai).call(this,"input","change")))},Oh=function(e,t){let i=this.items.length,a=ne(e,this),c;if(a==="ArrowRight"||e.key==="ArrowDown")c=(t+1)%i;else if(a==="ArrowLeft"||e.key==="ArrowUp")c=(t-1+i)%i;else if(e.key==="Home")c=0;else if(e.key==="End")c=i-1;else if(e.key===" "||e.key==="Enter")c=t;else return;e.preventDefault(),o(this,O,Sc).call(this,c)},qh=function(e){e.stopPropagation();let t=e.target.value;this._draft=t;let i=/^#?[0-9a-f]{6}$/i.test(t.trim())?at(t):null;i&&i!==this.value&&(f(this,ls,i),this.value=i,o(this,O,ai).call(this,"input")),this._invalid&&(i||!t.trim())&&(this._invalid=!1)},Ac=function(){if(this._draft===void 0)return;let e=this._draft.trim(),t=e?at(e):"";if(t===null){this._invalid=!0;return}let i=this.value;this.value=t,this._draft=void 0,this._invalid=!1,t!==i&&o(this,O,ai).call(this,"input"),o(this,O,ai).call(this,"change")},Ph=function(e){e.stopPropagation(),o(this,O,Ac).call(this)},Bh=function(e){e.key==="Enter"&&o(this,O,Ac).call(this)},jh=function(e){e.stopPropagation();let t=at(e.target.value);!t||t===this.value||(this.value=t,this._draft=void 0,this._invalid=!1,o(this,O,ai).call(this,"input"))},Fh=function(e){e.stopPropagation(),o(this,O,ai).call(this,"change")},At.formAssociated=!0,At.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},At.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},swatches:{type:Array},picker:{type:Boolean},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_draft:{state:!0},_invalid:{state:!0}},At.styles=[w,b`
825
+ ${r?c`<p class="error" id="${s(this,ut)}-err" role="alert">${r}</p>`:h}
826
+ ${this.helpText?c`<p class="help" id="${s(this,ut)}-help">${this.helpText}</p>`:h}
827
+ </div>`}};Pe=new WeakMap,ut=new WeakMap,zn=new WeakMap,Zs=new WeakMap,K=new WeakSet,Oi=function(...e){for(let t of e)this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))},uh=function(e){let t=this.items[e];!t||this.disabled||(this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".swatch")[e]?.focus()),this._draft=void 0,this._invalid=!1,t.value!==this.value&&(this.value=t.value,a(this,K,Oi).call(this,"input","change")))},Uu=function(e,t){let i=this.items.length,r=re(e,this),l;if(r==="ArrowRight"||e.key==="ArrowDown")l=(t+1)%i;else if(r==="ArrowLeft"||e.key==="ArrowUp")l=(t-1+i)%i;else if(e.key==="Home")l=0;else if(e.key==="End")l=i-1;else if(e.key===" "||e.key==="Enter")l=t;else return;e.preventDefault(),a(this,K,uh).call(this,l)},Ku=function(e){e.stopPropagation();let t=e.target.value;this._draft=t;let i=/^#?[0-9a-f]{6}$/i.test(t.trim())?Nt(t):null;i&&i!==this.value&&(g(this,Zs,i),this.value=i,a(this,K,Oi).call(this,"input")),this._invalid&&(i||!t.trim())&&(this._invalid=!1)},mh=function(){if(this._draft===void 0)return;let e=this._draft.trim(),t=e?Nt(e):"";if(t===null){this._invalid=!0;return}let i=this.value;this.value=t,this._draft=void 0,this._invalid=!1,t!==i&&a(this,K,Oi).call(this,"input"),a(this,K,Oi).call(this,"change")},Wu=function(e){e.stopPropagation(),a(this,K,mh).call(this)},Yu=function(e){e.key==="Enter"&&a(this,K,mh).call(this)},Gu=function(e){e.stopPropagation();let t=Nt(e.target.value);!t||t===this.value||(this.value=t,this._draft=void 0,this._invalid=!1,a(this,K,Oi).call(this,"input"))},Xu=function(e){e.stopPropagation(),a(this,K,Oi).call(this,"change")},li.formAssociated=!0,li.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},li.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},swatches:{type:Array},picker:{type:Boolean},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_draft:{state:!0},_invalid:{state:!0}},li.styles=[E,x`
828
828
  :host { display: block; }
829
829
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
830
830
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -867,17 +867,121 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
867
867
  :host([disabled]) .preview { opacity: 0.4; }
868
868
  .help { margin: 0; font-size: 12px; color: var(--cm-text-tertiary); }
869
869
  .error { margin: 0; font-size: 12px; color: var(--cm-text-critical); }
870
- `];g("cm-color-field",At);var Wb=M("optionGroup",{required:"Please select one of these options."}),Ie,Sa,cs,Aa,Ve,Dc,Nc,Vh,ni=class extends k{constructor(){super(...arguments);p(this,Ve);this.label="";this.name="";this.value="";this.options=[];this.required=!1;this.disabled=!1;this._slotted=[];p(this,Ie,this.attachInternals());p(this,Sa,L("cm-og"));p(this,cs,"");p(this,Aa,new MutationObserver(()=>o(this,Ve,Dc).call(this)))}connectedCallback(){super.connectedCallback(),o(this,Ve,Dc).call(this),s(this,Aa).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected","tone"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,Aa).disconnect()}get form(){return s(this,Ie).form}get validity(){return s(this,Ie).validity}get validationMessage(){return s(this,Ie).validationMessage}checkValidity(){return s(this,Ie).checkValidity()}reportValidity(){return s(this,Ie).reportValidity()}formResetCallback(){this.value=s(this,cs)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}get items(){return this.options.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}firstUpdated(){s(this,cs)||f(this,cs,this.value)}updated(){s(this,Ie).setFormValue(this.value||null,this.value);let e=this.renderRoot.querySelector("button")??void 0;this.required&&!this.value?s(this,Ie).setValidity({valueMissing:!0},this.t("required"),e):s(this,Ie).setValidity({})}render(){let e=this.items,t=e.findIndex(c=>c.value===this.value&&!c.disabled),i=t>=0?t:e.findIndex(c=>!c.disabled),a=this.getAttribute("aria-label");return l`
871
- ${this.label?l`<span class="label" id="${s(this,Sa)}-l" part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</span>`:d}
870
+ `];w("cm-color-field",li);var Ux=C("signatureField",{modes:"How to sign",draw:"Draw",type:"Type",pad:"Signature drawing area",padSigned:"Signature drawing area, signed",instructions:"Draw your signature with a mouse, finger or pen. To sign with the keyboard, choose Type.",signHere:"Sign here",typeLabel:"Type your full name",typePlaceholder:"Type your full name",undo:"Undo",undoLabel:"Undo last stroke",clear:"Clear",clearLabel:"Clear signature",cleared:"Signature cleared",undone:"Last stroke removed",required:"Please sign here."}),fh=3,yc=.7,Pg=.0055,wc="#000000",Ju=8,Dn=2,Og=400,qg=(o,n)=>({x:(o.x+n.x)/2,y:(o.y+n.y)/2,p:(o.p+n.p)/2}),Je,An,Qs,Nn,Ze,Qe,et,di,hi,$e,Rn,pi,er,_,gh,$c,bh,Rt,kc,vh,xh,Zu,yh,Ec,wh,Mc,Qu,$h,em,qi,Tc,kh,Eh,tm,Mh,im,Th,sm,rm,ci=class extends T{constructor(){super(...arguments);u(this,_);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.mode="draw";this.typedName="";this.required=!1;this.disabled=!1;this._announce="";u(this,Je,this.attachInternals());u(this,An,D("cm-sig"));u(this,Qs,"");u(this,Nn,"");u(this,Ze,[]);u(this,Qe);u(this,et);u(this,di,"");u(this,hi,0);u(this,$e);u(this,Rn,"");u(this,pi);u(this,er,0)}connectedCallback(){super.connectedCallback(),this.hasUpdated?a(this,_,gh).call(this):(g(this,Qs,this.value),g(this,Nn,this.typedName))}disconnectedCallback(){super.disconnectedCallback(),s(this,pi)?.disconnect(),g(this,pi,void 0),cancelAnimationFrame(s(this,hi)),g(this,hi,0),s(this,$e)&&(clearTimeout(s(this,$e)),g(this,$e,void 0))}get form(){return s(this,Je).form}get validity(){return s(this,Je).validity}get validationMessage(){return s(this,Je).validationMessage}checkValidity(){return s(this,Je).checkValidity()}reportValidity(){return s(this,Je).reportValidity()}formResetCallback(){g(this,Ze,[]),g(this,Qe,void 0),g(this,et,void 0),s(this,$e)&&(clearTimeout(s(this,$e)),g(this,$e,void 0)),this.typedName=s(this,Nn),s(this,Qs)?(g(this,di,""),this.value=s(this,Qs)):this.updateComplete.then(()=>a(this,_,qi).call(this,!1)),a(this,_,Rt).call(this)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}get empty(){return this.mode==="type"?!this.typedName.trim():!s(this,Ze).length&&!s(this,et)}toDataURL(){return a(this,_,kh).call(this)?.toDataURL("image/png")??""}toBlob(){let e=a(this,_,kh).call(this);return e?new Promise(t=>e.toBlob(t,"image/png")):Promise.resolve(null)}clear(){this.mode==="type"?this.typedName="":(g(this,Ze,[]),g(this,Qe,void 0),g(this,et,void 0),a(this,_,Rt).call(this)),a(this,_,qi).call(this,!0)}undo(){this.mode==="draw"&&(s(this,Ze).length?s(this,Ze).pop():g(this,et,void 0),g(this,Qe,void 0),a(this,_,Rt).call(this),a(this,_,qi).call(this,!0))}willUpdate(e){if(e.has("value")&&(this.value??"")!==s(this,di)){let t=this.value??"";if(g(this,di,t),g(this,Ze,[]),g(this,Qe,void 0),!t)g(this,et,void 0),this.hasUpdated&&(this.typedName="");else{let i=new Image;i.onload=()=>{s(this,et)===i&&a(this,_,Rt).call(this)},i.src=t,g(this,et,i),this.mode="draw"}a(this,_,Rt).call(this)}else if(this.hasUpdated&&(e.has("mode")||e.has("typedName")&&this.mode==="type")){let t=this.empty?"":this.toDataURL();g(this,di,t),this.value=t}}firstUpdated(){a(this,_,gh).call(this),this.typedName&&!this.value&&this.updateComplete.then(()=>a(this,_,qi).call(this,!1)),a(this,_,Mc).call(this)}updated(e){e.has("mode")&&this.mode==="type"&&a(this,_,Mc).call(this),s(this,Je).setFormValue(this.value||null,this.value);let t=(this.mode==="type"?this.renderRoot.querySelector(".typed"):this.renderRoot.querySelector('.tab[aria-selected="true"]'))??void 0;this.error?s(this,Je).setValidity({customError:!0},this.error,t):this.required&&this.empty?s(this,Je).setValidity({valueMissing:!0},this.t("required"),t):s(this,Je).setValidity({})}render(){let e=s(this,An),t=this.getAttribute("aria-label"),i=this.error,r=[i&&`${e}-err`,this.helpText&&`${e}-help`].filter(Boolean).join(" "),l=this.empty,d=!s(this,Ze).length&&!s(this,et),p=m=>c`<button type="button" role="tab" class="tab" id="${e}-tab-${m}"
871
+ aria-selected=${this.mode===m?"true":"false"} aria-controls="${e}-panel-${m}"
872
+ tabindex=${this.mode===m?"0":"-1"} ?disabled=${this.disabled}
873
+ @click=${()=>a(this,_,Eh).call(this,m,!0)} @keydown=${a(this,_,tm)}>${this.t(m)}</button>`;return c`<div class="field">
874
+ ${this.label?c`<span class="label" id="${e}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}${this.hint?c`<span class="hint">[${this.hint}]</span>`:h}</span>`:h}
875
+ <div class="bar">
876
+ <div class="tabs" role="tablist" part="tabs"
877
+ aria-labelledby=${this.label?`${e}-l`:h}
878
+ aria-label=${this.label?h:t||this.t("modes")}>${p("draw")}${p("type")}</div>
879
+ <div class="actions">
880
+ ${this.mode==="draw"?c`<button type="button" class="act" part="undo" aria-label=${this.t("undoLabel")} ?disabled=${this.disabled||d} @click=${a(this,_,sm)}>${this.t("undo")}</button>`:h}
881
+ <button type="button" class="act" part="clear" aria-label=${this.t("clearLabel")} ?disabled=${this.disabled||l} @click=${a(this,_,rm)}>${this.t("clear")}</button>
882
+ </div>
883
+ </div>
884
+ <div class="panel panel-draw" role="tabpanel" id="${e}-panel-draw" aria-labelledby="${e}-tab-draw"
885
+ tabindex=${this.disabled?"-1":"0"} ?hidden=${this.mode!=="draw"}>
886
+ <div class="pad" part="pad">
887
+ <span class="line" aria-hidden="true"></span>
888
+ ${d?c`<span class="here" aria-hidden="true">${this.t("signHere")}</span>`:h}
889
+ <canvas part="canvas" role="img" aria-label=${d?this.t("pad"):this.t("padSigned")}
890
+ aria-describedby=${[`${e}-instr`,r].filter(Boolean).join(" ")}
891
+ @pointerdown=${a(this,_,Zu)} @pointermove=${a(this,_,yh)} @pointerup=${a(this,_,Ec)} @pointercancel=${a(this,_,Ec)}
892
+ @lostpointercapture=${a(this,_,Ec)} @transitionend=${()=>a(this,_,kc).call(this)}></canvas>
893
+ </div>
894
+ <span class="vh" id="${e}-instr">${this.t("instructions")}</span>
895
+ </div>
896
+ <div class="panel panel-type" role="tabpanel" id="${e}-panel-type" aria-labelledby="${e}-tab-type" ?hidden=${this.mode!=="type"}>
897
+ <div class="pad" part="pad">
898
+ <span class="line" aria-hidden="true"></span>
899
+ <input class="typed" part="input" type="text" autocomplete="name" spellcheck="false" maxlength="80"
900
+ .value=${le(this.typedName??"")} placeholder=${this.t("typePlaceholder")}
901
+ aria-label=${this.label?`${this.label}: ${this.t("typeLabel")}`:this.t("typeLabel")}
902
+ aria-required=${this.required?"true":h} aria-invalid=${i?"true":h}
903
+ aria-describedby=${r||h} ?disabled=${this.disabled}
904
+ @input=${a(this,_,Qu)} @change=${a(this,_,em)} />
905
+ </div>
906
+ </div>
907
+ ${i?c`<p class="error" id="${e}-err" role="alert">${i}</p>`:h}
908
+ ${this.helpText?c`<p class="help" id="${e}-help">${this.helpText}</p>`:h}
909
+ <div class="vh" role="status" aria-live="polite">${this._announce}</div>
910
+ </div>`}};Je=new WeakMap,An=new WeakMap,Qs=new WeakMap,Nn=new WeakMap,Ze=new WeakMap,Qe=new WeakMap,et=new WeakMap,di=new WeakMap,hi=new WeakMap,$e=new WeakMap,Rn=new WeakMap,pi=new WeakMap,er=new WeakMap,_=new WeakSet,gh=function(){let e=this.renderRoot.querySelector(".panel-draw .pad");!e||s(this,pi)||(g(this,pi,new ResizeObserver(()=>a(this,_,bh).call(this))),s(this,pi).observe(e))},$c=function(){return this.renderRoot.querySelector("canvas")},bh=function(){let e=s(this,_,$c);if(!e)return;let t=e.clientWidth,i=e.clientHeight;if(!t||!i)return;g(this,er,t);let r=window.devicePixelRatio||1,l=Math.round(t*r),d=Math.round(i*r);(e.width!==l||e.height!==d)&&(e.width=l,e.height=d),a(this,_,kc).call(this)},Rt=function(){s(this,hi)||g(this,hi,requestAnimationFrame(()=>{g(this,hi,0),a(this,_,kc).call(this)}))},kc=function(){let e=s(this,_,$c);if(!e||!e.width)return;let t=e.getContext("2d"),i=e.clientWidth||s(this,er);if(!i)return;let r=e.width/i;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),t.setTransform(r,0,0,r,0,0);let l=getComputedStyle(e).color||wc;a(this,_,vh).call(this,t,i,l,!0)},vh=function(e,t,i,r){let l=t/fh,d=s(this,et);if(d?.complete&&d.naturalWidth){let p=Math.min(t*.9/d.naturalWidth,l*.9/d.naturalHeight),m=d.naturalWidth*p,v=d.naturalHeight*p,b=(t-m)/2,$=(l-v)/2;if(r&&!jg(i,wc)){let y=document.createElement("canvas");y.width=Math.max(1,Math.round(m*2)),y.height=Math.max(1,Math.round(v*2));let M=y.getContext("2d");M.drawImage(d,0,0,y.width,y.height),M.globalCompositeOperation="source-in",M.fillStyle=i,M.fillRect(0,0,y.width,y.height),e.drawImage(y,b,$,m,v)}else e.drawImage(d,b,$,m,v)}e.strokeStyle=i,e.fillStyle=i,e.lineCap="round",e.lineJoin="round";for(let p of s(this,Ze))Bg(e,p,t)},xh=function(e,t){let i=e.pointerType==="pen"&&e.pressure>0?e.pressure:.5;return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.width,p:i}},Zu=function(e){if(this.disabled||s(this,Qe)||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.currentTarget;e.preventDefault();try{t.setPointerCapture(e.pointerId)}catch{}let i=[a(this,_,xh).call(this,e,t.getBoundingClientRect())];g(this,Qe,{id:e.pointerId,stroke:i}),s(this,Ze).push(i),a(this,_,Rt).call(this)},yh=function(e){let t=s(this,Qe);if(!t||e.pointerId!==t.id)return;e.preventDefault();let i=e.currentTarget.getBoundingClientRect(),r=typeof e.getCoalescedEvents=="function"?e.getCoalescedEvents():[];for(let l of r.length?r:[e]){let d=a(this,_,xh).call(this,l,i),p=t.stroke[t.stroke.length-1];Math.hypot(d.x-p.x,d.y-p.y)*i.width<1.5||t.stroke.push(d)}a(this,_,Rt).call(this)},Ec=function(e){let t=s(this,Qe);if(!(!t||e.pointerId!==t.id)){e.type==="pointerup"&&a(this,_,yh).call(this,e),g(this,Qe,void 0);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}a(this,_,Rt).call(this),a(this,_,qi).call(this,!0)}},wh=function(){let e=this.renderRoot.querySelector(".typed");return e&&getComputedStyle(e).fontFamily||"cursive"},Mc=function(){let e=document.fonts;if(!e||!this.isConnected)return;let t=`400 40px ${s(this,_,wh)}`,i=!0;try{i=e.check(t,this.typedName||"Signature")}catch{}i||e.load(t,this.typedName||"Signature").then(()=>{this.mode==="type"&&this.typedName.trim()&&a(this,_,qi).call(this,!1)},()=>{})},Qu=function(e){e.stopPropagation(),s(this,$e)?clearTimeout(s(this,$e)):g(this,Rn,this.value),this.typedName=e.target.value,g(this,$e,setTimeout(()=>a(this,_,$h).call(this),Og)),a(this,_,Mc).call(this)},$h=function(){s(this,$e)&&(clearTimeout(s(this,$e)),g(this,$e,void 0),this.value!==s(this,Rn)&&a(this,_,Tc).call(this))},em=function(e){e.stopPropagation(),this.updateComplete.then(()=>a(this,_,$h).call(this))},qi=function(e){let t=this.empty?"":this.toDataURL(),i=t!==this.value;i&&(g(this,di,t),this.value=t),this.requestUpdate(),e&&i&&a(this,_,Tc).call(this)},Tc=function(){let e={value:this.value,empty:this.empty,mode:this.mode};this.dispatchEvent(new CustomEvent("cm-change",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},kh=function(){if(this.empty)return;let e=Math.max(s(this,_,$c)?.clientWidth||s(this,er)||600,300),t=e/fh,i=document.createElement("canvas");i.width=Math.round(e*Dn),i.height=Math.round(t*Dn);let r=i.getContext("2d",{willReadFrequently:!0});if(r.scale(Dn,Dn),this.mode==="type"){let l=Math.min(t*.45,64),d=s(this,_,wh);r.font=`400 ${l}px ${d}`;let p=this.typedName.trim(),m=e-2*Ju,v=r.measureText(p).width;v>m&&(l*=m/v,r.font=`400 ${l}px ${d}`),r.direction=getComputedStyle(this).direction==="rtl"?"rtl":"ltr",r.textAlign="center",r.textBaseline="alphabetic",r.fillStyle=wc,r.fillText(p,e/2,t*yc)}else a(this,_,vh).call(this,r,e,wc,!1);return Fg(i,Ju*Dn)},Eh=function(e,t){if(this.disabled||(t&&this.updateComplete.then(()=>this.renderRoot.querySelector(`#${s(this,An)}-tab-${e}`)?.focus()),e===this.mode))return;let i=this.value;this.mode=e,this.updateComplete.then(()=>{e==="draw"&&a(this,_,bh).call(this),this.value!==i&&a(this,_,Tc).call(this)})},tm=function(e){let t=re(e,this),i;if(t==="ArrowRight"||t==="ArrowLeft")i=this.mode==="draw"?"type":"draw";else if(e.key==="Home")i="draw";else if(e.key==="End")i="type";else return;e.preventDefault(),a(this,_,Eh).call(this,i,!0)},Mh=function(e){a(this,_,im).call(this,this.t(e))},im=function(e){this._announce="",this.updateComplete.then(()=>{this._announce=e})},Th=function(e){this.updateComplete.then(()=>{let t=this.shadowRoot?.activeElement;if(!e||t&&!t.disabled)return;(this.mode==="type"?this.renderRoot.querySelector(".typed"):this.renderRoot.querySelector('.tab[aria-selected="true"]'))?.focus()})},sm=function(){if(this.disabled||this.mode!=="draw"||this.empty)return;let e=this.matches(":focus-within");this.undo(),a(this,_,Mh).call(this,"undone"),a(this,_,Th).call(this,e)},rm=function(){if(this.disabled||this.empty)return;let e=this.matches(":focus-within");this.clear(),a(this,_,Mh).call(this,"cleared"),a(this,_,Th).call(this,e)},ci.formAssociated=!0,ci.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},ci.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},mode:{reflect:!0},typedName:{attribute:"typed-name"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_announce:{state:!0}},ci.styles=[E,x`
911
+ :host { display: block; }
912
+ .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
913
+ .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
914
+ .req { color: var(--cm-text-critical); margin-inline-start: 2px; }
915
+ .hint { margin-inline-start: var(--cm-space-10); font-size: 12px; color: var(--cm-text-tertiary); text-transform: lowercase; }
916
+ .bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cm-space-10); }
917
+ .tabs { display: flex; gap: var(--cm-space-20); }
918
+ .tab {
919
+ position: relative; min-height: 32px; padding: 0 2px; font: inherit; font-size: 14px; font-weight: 500;
920
+ color: var(--cm-text-tertiary); background: none; border: 0; cursor: pointer;
921
+ }
922
+ .tab::after { content: ''; position: absolute; inset-inline: 0; bottom: 2px; height: 2px; border-radius: 1px; background: transparent; }
923
+ .tab:hover:not(:disabled), .tab[aria-selected='true'] { color: var(--cm-text-default); }
924
+ .tab[aria-selected='true']::after { background: var(--cm-border-strong); }
925
+ .tab:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; border-radius: var(--cm-radius-xs); }
926
+ .tab:disabled { color: var(--cm-text-secondary); cursor: not-allowed; }
927
+ .actions { display: flex; gap: var(--cm-space-10); margin-inline-start: auto; }
928
+ /* Secondary medium Button. */
929
+ .act {
930
+ display: inline-flex; align-items: center; height: 32px; padding: 0 var(--cm-space-15);
931
+ font: inherit; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer;
932
+ background: var(--cm-bg-hover); color: var(--cm-text-default);
933
+ border: var(--cm-border-1) solid var(--cm-border-strong); border-radius: var(--cm-radius-sm);
934
+ }
935
+ .act:hover:not(:disabled) { background: var(--cm-bg-surface); }
936
+ .act:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
937
+ .act:disabled { background: var(--cm-action-disabled); border-color: var(--cm-action-disabled); color: var(--cm-action-disabled-text); cursor: not-allowed; }
938
+ .panel:focus { outline: none; }
939
+ .pad {
940
+ position: relative; width: 100%; aspect-ratio: ${fh} / 1; overflow: hidden; container-type: inline-size;
941
+ background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-input); border-radius: var(--cm-radius-sm);
942
+ }
943
+ .panel:focus-visible .pad, .pad:focus-within { border-color: var(--cm-border-strong); box-shadow: 0 0 0 1px var(--cm-border-strong); }
944
+ :host([error]:not([error=''])) .pad { border-color: var(--cm-border-critical); }
945
+ canvas {
946
+ position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair;
947
+ /* The ink: read in script. The transition makes a theme change fire transitionend, which repaints the ink. */
948
+ color: var(--cm-text-default); transition: color 1ms;
949
+ }
950
+ .line {
951
+ position: absolute; inset-inline: var(--cm-space-15); top: ${yc*100}%; height: 0;
952
+ border-top: var(--cm-border-1) dashed var(--cm-border-input); pointer-events: none;
953
+ }
954
+ .here {
955
+ position: absolute; inset-inline-start: var(--cm-space-15); bottom: calc(${(1-yc)*100}% + 4px);
956
+ font-size: 12px; color: var(--cm-text-tertiary); pointer-events: none; user-select: none;
957
+ }
958
+ .typed {
959
+ position: absolute; inset-inline: var(--cm-space-15); bottom: calc(${(1-yc)*100}% - 0.18em);
960
+ width: calc(100% - 2 * var(--cm-space-15)); padding: 0; margin: 0;
961
+ font-family: var(--cm-signature-font, 'Dancing Script', 'Segoe Script', 'Bradley Hand', 'Snell Roundhand', 'Brush Script MT', cursive);
962
+ font-size: clamp(24px, 9cqi, 48px); font-weight: 400; line-height: 1.25; text-align: center;
963
+ color: var(--cm-text-default); background: transparent; border: 0; outline: none;
964
+ }
965
+ .typed::placeholder {
966
+ font-family: var(--cm-font-sans, 'Poppins', system-ui, sans-serif); font-size: 14px; color: var(--cm-text-tertiary);
967
+ }
968
+ :host([disabled]) .pad { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
969
+ :host([disabled]) canvas, :host([disabled]) .typed { cursor: not-allowed; }
970
+ :host([disabled]) .typed { color: var(--cm-text-secondary); }
971
+ .help { margin: 0; font-size: 12px; color: var(--cm-text-tertiary); }
972
+ .error { margin: 0; font-size: 12px; color: var(--cm-text-critical); }
973
+ .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
974
+ `];function Bg(o,n,e){let t=d=>e*Pg*(.35+d*1.3);if(n.length===1){o.beginPath(),o.arc(n[0].x*e,n[0].y*e,t(n[0].p)/2,0,Math.PI*2),o.fill();return}let i=d=>[d.x*e,d.y*e],r=n[0];for(let d=1;d<n.length-1;d++){let p=qg(n[d],n[d+1]);o.beginPath(),o.moveTo(...i(r)),o.quadraticCurveTo(...i(n[d]),...i(p)),o.lineWidth=t(n[d].p),o.stroke(),r=p}let l=n[n.length-1];o.beginPath(),o.moveTo(...i(r)),o.lineTo(...i(l)),o.lineWidth=t(l.p),o.stroke()}function Fg(o,n){let{width:e,height:t}=o,i=o.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,e,t).data,r=t,l=e,d=-1,p=-1;for(let v=0;v<t;v++){let b=v*e*4;for(let $=0;$<e;$++)i[b+$*4+3]>8&&($<l&&(l=$),$>d&&(d=$),v<r&&(r=v),p=v)}if(d<0)return;let m=document.createElement("canvas");return m.width=d-l+1+2*n,m.height=p-r+1+2*n,m.getContext("2d").drawImage(o,l,r,d-l+1,p-r+1,n,n,d-l+1,p-r+1),m}function jg(o,n){let e=t=>{let i=/^#([0-9a-f]{6})$/i.exec(t.trim());if(i){let r=parseInt(i[1],16);return`${r>>16&255},${r>>8&255},${r&255}`}return(/\d+\s*,\s*\d+\s*,\s*\d+/.exec(t)?.[0]??t).replace(/\s/g,"")};return e(o)===e(n)}w("cm-signature-field",ci);var Zx=C("optionGroup",{required:"Please select one of these options."}),at,Hn,tr,In,mt,Ch,_h,am,Bi=class extends T{constructor(){super(...arguments);u(this,mt);this.label="";this.name="";this.value="";this.options=[];this.required=!1;this.disabled=!1;this._slotted=[];u(this,at,this.attachInternals());u(this,Hn,D("cm-og"));u(this,tr,"");u(this,In,new MutationObserver(()=>a(this,mt,Ch).call(this)))}connectedCallback(){super.connectedCallback(),a(this,mt,Ch).call(this),s(this,In).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected","tone"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,In).disconnect()}get form(){return s(this,at).form}get validity(){return s(this,at).validity}get validationMessage(){return s(this,at).validationMessage}checkValidity(){return s(this,at).checkValidity()}reportValidity(){return s(this,at).reportValidity()}formResetCallback(){this.value=s(this,tr)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}get items(){return this.options.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}firstUpdated(){s(this,tr)||g(this,tr,this.value)}updated(){s(this,at).setFormValue(this.value||null,this.value);let e=this.renderRoot.querySelector("button")??void 0;this.required&&!this.value?s(this,at).setValidity({valueMissing:!0},this.t("required"),e):s(this,at).setValidity({})}render(){let e=this.items,t=e.findIndex(l=>l.value===this.value&&!l.disabled),i=t>=0?t:e.findIndex(l=>!l.disabled),r=this.getAttribute("aria-label");return c`
975
+ ${this.label?c`<span class="label" id="${s(this,Hn)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
872
976
  <div class="options" part="options" role="radiogroup"
873
- aria-labelledby=${this.label?`${s(this,Sa)}-l`:d} aria-label=${!this.label&&a?a:d}
874
- aria-required=${this.required?"true":d}>
875
- ${e.map((c,h)=>l`<button type="button" role="radio" part="option" class=${c.tone==="critical"||c.tone==="success"?`tone-${c.tone}`:d} aria-checked=${c.value===this.value?"true":"false"}
876
- tabindex=${h===i?"0":"-1"} ?disabled=${this.disabled||!!c.disabled}
877
- @click=${()=>o(this,Ve,Nc).call(this,h)} @keydown=${u=>o(this,Ve,Vh).call(this,u,h)}>${c.label}</button>`)}
977
+ aria-labelledby=${this.label?`${s(this,Hn)}-l`:h} aria-label=${!this.label&&r?r:h}
978
+ aria-required=${this.required?"true":h}>
979
+ ${e.map((l,d)=>c`<button type="button" role="radio" part="option" class=${l.tone==="critical"||l.tone==="success"?`tone-${l.tone}`:h} aria-checked=${l.value===this.value?"true":"false"}
980
+ tabindex=${d===i?"0":"-1"} ?disabled=${this.disabled||!!l.disabled}
981
+ @click=${()=>a(this,mt,_h).call(this,d)} @keydown=${p=>a(this,mt,am).call(this,p,d)}>${l.label}</button>`)}
878
982
  </div>
879
983
  <slot></slot>
880
- `}};Ie=new WeakMap,Sa=new WeakMap,cs=new WeakMap,Aa=new WeakMap,Ve=new WeakSet,Dc=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled},a=t.getAttribute("tone");return(a==="critical"||a==="success")&&(i.tone=a),i}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",f(this,cs,this.value))},Nc=function(e){let t=this.items[e];!t||t.disabled||this.disabled||(this.updateComplete.then(()=>this.renderRoot.querySelectorAll("button")[e]?.focus()),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},Vh=function(e,t){let i=ne(e,this),a=this.items.flatMap((u,m)=>u.disabled?[]:[m]),c=a.indexOf(t),h;if(i==="ArrowRight"||e.key==="ArrowDown")h=a[(c+1)%a.length];else if(i==="ArrowLeft"||e.key==="ArrowUp")h=a[(c-1+a.length)%a.length];else if(e.key==="Home")h=a[0];else if(e.key==="End")h=a[a.length-1];else return;e.preventDefault(),h!==void 0&&o(this,Ve,Nc).call(this,h)},ni.formAssociated=!0,ni.properties={label:{},name:{reflect:!0},value:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_slotted:{state:!0}},ni.styles=[w,b`
984
+ `}};at=new WeakMap,Hn=new WeakMap,tr=new WeakMap,In=new WeakMap,mt=new WeakSet,Ch=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled},r=t.getAttribute("tone");return(r==="critical"||r==="success")&&(i.tone=r),i}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",g(this,tr,this.value))},_h=function(e){let t=this.items[e];!t||t.disabled||this.disabled||(this.updateComplete.then(()=>this.renderRoot.querySelectorAll("button")[e]?.focus()),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},am=function(e,t){let i=re(e,this),r=this.items.flatMap((p,m)=>p.disabled?[]:[m]),l=r.indexOf(t),d;if(i==="ArrowRight"||e.key==="ArrowDown")d=r[(l+1)%r.length];else if(i==="ArrowLeft"||e.key==="ArrowUp")d=r[(l-1+r.length)%r.length];else if(e.key==="Home")d=r[0];else if(e.key==="End")d=r[r.length-1];else return;e.preventDefault(),d!==void 0&&a(this,mt,_h).call(this,d)},Bi.formAssociated=!0,Bi.properties={label:{},name:{reflect:!0},value:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_slotted:{state:!0}},Bi.styles=[E,x`
881
985
  :host { display: block; }
882
986
  .label { display: block; margin-bottom: var(--cm-space-20); font-size: var(--cm-type-heading-sm-size); font-weight: 600; }
883
987
  .req { color: var(--cm-text-critical); margin-inline-start: 2px; }
@@ -910,25 +1014,25 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
910
1014
  .options { gap: var(--cm-space-10); }
911
1015
  button { height: 42px; padding: 0 var(--cm-space-15); font-size: 14px; }
912
1016
  }
913
- `];g("cm-option-group",ni);var ig=M("pageHeader",{back:"Back to {label}",breadcrumbs:"Breadcrumb",records:"Records",previous:"Previous",next:"Next"}),Da,Rc,ds=class extends k{constructor(){super(...arguments);p(this,Da);this.heading="";this.breadcrumbs=[];this.pagination=!1;this.hasPrevious=!1;this.hasNext=!1}render(){let e=Array.isArray(this.breadcrumbs)?this.breadcrumbs:[],t=[...e].reverse().find(i=>i.href);return l`<header part="header">
1017
+ `];w("cm-option-group",Bi);var ay=C("pageHeader",{back:"Back to {label}",breadcrumbs:"Breadcrumb",records:"Records",previous:"Previous",next:"Next"}),Pn,Lh,ir=class extends T{constructor(){super(...arguments);u(this,Pn);this.heading="";this.breadcrumbs=[];this.pagination=!1;this.hasPrevious=!1;this.hasNext=!1}render(){let e=Array.isArray(this.breadcrumbs)?this.breadcrumbs:[],t=[...e].reverse().find(i=>i.href);return c`<header part="header">
914
1018
  <div class="lead">
915
- ${t?l`<a class="back" part="back" href=${t.href} aria-label=${this.t("back",{label:t.label})}><cm-icon name="chevron-left" size="20"></cm-icon></a>`:d}
1019
+ ${t?c`<a class="back" part="back" href=${t.href} aria-label=${this.t("back",{label:t.label})}><cm-icon name="chevron-left" size="20"></cm-icon></a>`:h}
916
1020
  <div class="titles">
917
- ${e.length?l`<nav aria-label=${this.t("breadcrumbs")} part="breadcrumbs"><ol>
918
- ${e.map(i=>l`<li>${i.href?l`<a href=${i.href}>${i.label}</a>`:i.label}</li>`)}
1021
+ ${e.length?c`<nav aria-label=${this.t("breadcrumbs")} part="breadcrumbs"><ol>
1022
+ ${e.map(i=>c`<li>${i.href?c`<a href=${i.href}>${i.label}</a>`:i.label}</li>`)}
919
1023
  <li><span aria-current="page">${this.heading}</span></li>
920
- </ol></nav>`:d}
1024
+ </ol></nav>`:h}
921
1025
  <h1 part="title"><span class="text">${this.heading}</span><slot name="title-adornment"></slot></h1>
922
1026
  </div>
923
1027
  </div>
924
1028
  <div class="actions">
925
- ${this.pagination?l`<div class="arrows" role="group" aria-label=${this.t("records")}>
926
- <button class="arrow" type="button" aria-label=${this.t("previous")} ?disabled=${!this.hasPrevious} @click=${()=>o(this,Da,Rc).call(this,"cm-previous")}><cm-icon name="chevron-left" size="16"></cm-icon></button>
927
- <button class="arrow" type="button" aria-label=${this.t("next")} ?disabled=${!this.hasNext} @click=${()=>o(this,Da,Rc).call(this,"cm-next")}><cm-icon name="chevron-right" size="16"></cm-icon></button>
928
- </div>`:d}
1029
+ ${this.pagination?c`<div class="arrows" role="group" aria-label=${this.t("records")}>
1030
+ <button class="arrow" type="button" aria-label=${this.t("previous")} ?disabled=${!this.hasPrevious} @click=${()=>a(this,Pn,Lh).call(this,"cm-previous")}><cm-icon name="chevron-left" size="16"></cm-icon></button>
1031
+ <button class="arrow" type="button" aria-label=${this.t("next")} ?disabled=${!this.hasNext} @click=${()=>a(this,Pn,Lh).call(this,"cm-next")}><cm-icon name="chevron-right" size="16"></cm-icon></button>
1032
+ </div>`:h}
929
1033
  <slot name="actions"></slot>
930
1034
  </div>
931
- </header>`}};Da=new WeakSet,Rc=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},ds.properties={heading:{},breadcrumbs:{type:Array},pagination:{type:Boolean,reflect:!0},hasPrevious:{type:Boolean,attribute:"has-previous"},hasNext:{type:Boolean,attribute:"has-next"}},ds.styles=[w,b`
1035
+ </header>`}};Pn=new WeakSet,Lh=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},ir.properties={heading:{},breadcrumbs:{type:Array},pagination:{type:Boolean,reflect:!0},hasPrevious:{type:Boolean,attribute:"has-previous"},hasNext:{type:Boolean,attribute:"has-next"}},ir.styles=[E,x`
932
1036
  :host { display: block; }
933
1037
  header {
934
1038
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cm-space-20);
@@ -970,17 +1074,17 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
970
1074
  h1 { font-size: 18px; font-weight: 600; }
971
1075
  .actions { gap: var(--cm-space-10); }
972
1076
  }
973
- `];g("cm-page-header",ds);var cg=M("actionBar",{label:"Actions"}),hs=class extends k{constructor(){super(...arguments);this.eyebrow="";this.heading="";this.tone="default";this.sticky=!1;this.label=""}render(){let e=this.tone==="critical";return l`<div class="bar" part="bar" role="region" aria-label=${this.label||this.heading||this.eyebrow||this.t("label")}>
1077
+ `];w("cm-page-header",ir);var py=C("actionBar",{label:"Actions"}),sr=class extends T{constructor(){super(...arguments);this.eyebrow="";this.heading="";this.tone="default";this.sticky=!1;this.label=""}render(){let e=this.tone==="critical";return c`<div class="bar" part="bar" role="region" aria-label=${this.label||this.heading||this.eyebrow||this.t("label")}>
974
1078
  <div class="lead">
975
- ${e?l`<span class="icon" aria-hidden="true"><cm-icon name="alert" size="20"></cm-icon></span>`:d}
1079
+ ${e?c`<span class="icon" aria-hidden="true"><cm-icon name="alert" size="20"></cm-icon></span>`:h}
976
1080
  <div class="text">
977
1081
  <div class="eyebrow" ?hidden=${!this.eyebrow}>${this.eyebrow}<slot name="adornment"></slot></div>
978
- ${this.heading?l`<p class="heading" part="heading" role=${e?"alert":d}>${this.heading}</p>`:d}
1082
+ ${this.heading?c`<p class="heading" part="heading" role=${e?"alert":h}>${this.heading}</p>`:h}
979
1083
  <slot></slot>
980
1084
  </div>
981
1085
  </div>
982
1086
  <div class="actions"><slot name="actions"></slot></div>
983
- </div>`}};hs.properties={eyebrow:{},heading:{},tone:{reflect:!0},sticky:{type:Boolean,reflect:!0},label:{}},hs.styles=[w,b`
1087
+ </div>`}};sr.properties={eyebrow:{},heading:{},tone:{reflect:!0},sticky:{type:Boolean,reflect:!0},label:{}},sr.styles=[E,x`
984
1088
  :host { display: block; }
985
1089
  :host([sticky]) { position: sticky; bottom: 0; z-index: 10; }
986
1090
  .bar {
@@ -1011,13 +1115,13 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1011
1115
  .icon { width: 30px; height: 30px; }
1012
1116
  .actions { gap: var(--cm-space-10); }
1013
1117
  }
1014
- `];g("cm-action-bar",hs);var fg=M("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),Ue,oi,Na,pe,Hc,Ic,Oc,Uh,Kh,ps=class extends k{constructor(){super(...arguments);p(this,pe);this.open=!1;this.loading=!1;this.saveDisabled=!1;this.form="";p(this,Ue,null);p(this,oi,()=>{this.open=!0});p(this,Na,()=>{this.open=!1})}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>o(this,pe,Hc).call(this))}disconnectedCallback(){super.disconnectedCallback(),o(this,pe,Ic).call(this)}updated(e){e.has("form")&&this.isConnected&&o(this,pe,Hc).call(this)}render(){return l`<div class="bar" part="bar" role="region" aria-label=${this.message}>
1118
+ `];w("cm-action-bar",sr);var vy=C("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),ft,Fi,On,ke,Sh,zh,Dh,nm,om,rr=class extends T{constructor(){super(...arguments);u(this,ke);this.open=!1;this.loading=!1;this.saveDisabled=!1;this.form="";u(this,ft,null);u(this,Fi,()=>{this.open=!0});u(this,On,()=>{this.open=!1})}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>a(this,ke,Sh).call(this))}disconnectedCallback(){super.disconnectedCallback(),a(this,ke,zh).call(this)}updated(e){e.has("form")&&this.isConnected&&a(this,ke,Sh).call(this)}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.message}>
1015
1119
  <p class="message" part="message" role="status">${this.open?this.message:""}</p>
1016
1120
  <div class="actions">
1017
- <cm-button size="large" ?disabled=${this.loading} @click=${o(this,pe,Kh)}>${this.discardLabel}</cm-button>
1018
- <cm-button size="large" variant="primary" ?loading=${this.loading} ?disabled=${this.saveDisabled} @click=${o(this,pe,Uh)}>${this.saveLabel}</cm-button>
1121
+ <cm-button size="large" ?disabled=${this.loading} @click=${a(this,ke,om)}>${this.discardLabel}</cm-button>
1122
+ <cm-button size="large" variant="primary" ?loading=${this.loading} ?disabled=${this.saveDisabled} @click=${a(this,ke,nm)}>${this.saveLabel}</cm-button>
1019
1123
  </div>
1020
- </div>`}};Ue=new WeakMap,oi=new WeakMap,Na=new WeakMap,pe=new WeakSet,Hc=function(){o(this,pe,Ic).call(this);let e=this.form?this.getRootNode().getElementById?.(this.form):null;e instanceof HTMLFormElement&&(f(this,Ue,e),e.addEventListener("input",s(this,oi)),e.addEventListener("change",s(this,oi)),e.addEventListener("reset",s(this,Na)))},Ic=function(){let e=s(this,Ue);e&&(e.removeEventListener("input",s(this,oi)),e.removeEventListener("change",s(this,oi)),e.removeEventListener("reset",s(this,Na)),f(this,Ue,null))},Oc=function(e){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,cancelable:!0}))},Uh=function(){this.loading||this.saveDisabled||o(this,pe,Oc).call(this,"cm-save")&&s(this,Ue)&&s(this,Ue).requestSubmit()},Kh=function(){this.loading||o(this,pe,Oc).call(this,"cm-discard")&&s(this,Ue)&&(s(this,Ue).reset(),this.open=!1)},ps.properties={open:{type:Boolean,reflect:!0},message:{string:"message"},saveLabel:{attribute:"save-label",string:"save"},discardLabel:{attribute:"discard-label",string:"discard"},loading:{type:Boolean,reflect:!0},saveDisabled:{type:Boolean,attribute:"save-disabled"},form:{}},ps.styles=[w,b`
1124
+ </div>`}};ft=new WeakMap,Fi=new WeakMap,On=new WeakMap,ke=new WeakSet,Sh=function(){a(this,ke,zh).call(this);let e=this.form?this.getRootNode().getElementById?.(this.form):null;e instanceof HTMLFormElement&&(g(this,ft,e),e.addEventListener("input",s(this,Fi)),e.addEventListener("change",s(this,Fi)),e.addEventListener("reset",s(this,On)))},zh=function(){let e=s(this,ft);e&&(e.removeEventListener("input",s(this,Fi)),e.removeEventListener("change",s(this,Fi)),e.removeEventListener("reset",s(this,On)),g(this,ft,null))},Dh=function(e){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,cancelable:!0}))},nm=function(){this.loading||this.saveDisabled||a(this,ke,Dh).call(this,"cm-save")&&s(this,ft)&&s(this,ft).requestSubmit()},om=function(){this.loading||a(this,ke,Dh).call(this,"cm-discard")&&s(this,ft)&&(s(this,ft).reset(),this.open=!1)},rr.properties={open:{type:Boolean,reflect:!0},message:{string:"message"},saveLabel:{attribute:"save-label",string:"save"},discardLabel:{attribute:"discard-label",string:"discard"},loading:{type:Boolean,reflect:!0},saveDisabled:{type:Boolean,attribute:"save-disabled"},form:{}},rr.styles=[E,x`
1021
1125
  :host { display: block; position: sticky; bottom: 0; z-index: 20; }
1022
1126
  :host(:not([open])) { display: none; }
1023
1127
  .bar {
@@ -1033,14 +1137,14 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1033
1137
  .message { font-size: 14px; font-weight: 500; }
1034
1138
  .actions { gap: var(--cm-space-10); }
1035
1139
  }
1036
- `];g("cm-save-bar",ps);var us=class extends _{constructor(){super(...arguments);this.heading="";this.action="";this.actionLabel="";this.headingLevel=2;this._list=!0}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return l`<section part="panel" aria-label=${this.heading||d}>
1037
- ${this.heading||this.action?l`<header>
1140
+ `];w("cm-save-bar",rr);var ar=class extends L{constructor(){super(...arguments);this.heading="";this.action="";this.actionLabel="";this.headingLevel=2;this._list=!0}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return c`<section part="panel" aria-label=${this.heading||h}>
1141
+ ${this.heading||this.action?c`<header>
1038
1142
  <div class="title" role="heading" aria-level=${e} part="title">${this.heading}</div>
1039
- ${this.action?l`<button class="action" type="button" part="action" aria-label=${this.actionLabel||d}
1040
- @click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:d}
1041
- </header>`:d}
1042
- <div class="items" role=${this._list?"list":d}><slot @slotchange=${t=>{this._list=t.target.assignedElements().every(i=>i.localName==="cm-info-item")}}></slot></div>
1043
- </section>`}};us.properties={heading:{},action:{},actionLabel:{attribute:"action-label"},headingLevel:{type:Number,attribute:"heading-level"},_list:{state:!0}},us.styles=[w,b`
1143
+ ${this.action?c`<button class="action" type="button" part="action" aria-label=${this.actionLabel||h}
1144
+ @click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:h}
1145
+ </header>`:h}
1146
+ <div class="items" role=${this._list?"list":h}><slot @slotchange=${t=>{this._list=t.target.assignedElements().every(i=>i.localName==="cm-info-item")}}></slot></div>
1147
+ </section>`}};ar.properties={heading:{},action:{},actionLabel:{attribute:"action-label"},headingLevel:{type:Number,attribute:"heading-level"},_list:{state:!0}},ar.styles=[E,x`
1044
1148
  :host { display: block; }
1045
1149
  section {
1046
1150
  background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-card);
@@ -1056,7 +1160,7 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1056
1160
  .action:hover { text-decoration: underline; }
1057
1161
  .action:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1058
1162
  .items { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cm-space-15) var(--cm-space-20); }
1059
- `];g("cm-info-panel",us);var ms=class extends _{constructor(){super(...arguments);this.label="";this.half=!1}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}render(){return l`<div class="label" part="label">${this.label}</div><div class="value" part="value"><slot></slot></div>`}};ms.properties={label:{},half:{type:Boolean,reflect:!0}},ms.styles=[w,b`
1163
+ `];w("cm-info-panel",ar);var nr=class extends L{constructor(){super(...arguments);this.label="";this.half=!1}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}render(){return c`<div class="label" part="label">${this.label}</div><div class="value" part="value"><slot></slot></div>`}};nr.properties={label:{},half:{type:Boolean,reflect:!0}},nr.styles=[E,x`
1060
1164
  :host { display: block; grid-column: 1 / -1; min-width: 0; }
1061
1165
  :host([half]) { grid-column: auto; }
1062
1166
  .label { font-size: 16px; }
@@ -1064,16 +1168,16 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1064
1168
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-10);
1065
1169
  margin-top: 6px; font-size: 16px; font-weight: 500; overflow-wrap: anywhere;
1066
1170
  }
1067
- `];g("cm-info-item",ms);var li,fs=class extends _{constructor(){super(...arguments);this.heading="";this.open=!1;this.disabled=!1;this.headingLevel=3;p(this,li,L("cm-accordion"))}toggle(){this.disabled||(this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{bubbles:!0,composed:!0,detail:{open:this.open}})))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||3));return l`<div class="wrap" part="accordion">
1171
+ `];w("cm-info-item",nr);var ji,or=class extends L{constructor(){super(...arguments);this.heading="";this.open=!1;this.disabled=!1;this.headingLevel=3;u(this,ji,D("cm-accordion"))}toggle(){this.disabled||(this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{bubbles:!0,composed:!0,detail:{open:this.open}})))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||3));return c`<div class="wrap" part="accordion">
1068
1172
  <div class="h" role="heading" aria-level=${e}>
1069
- <button type="button" part="toggle" id="${s(this,li)}-btn" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,li)}-body"
1173
+ <button type="button" part="toggle" id="${s(this,ji)}-btn" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,ji)}-body"
1070
1174
  ?disabled=${this.disabled} @click=${this.toggle}>
1071
1175
  <span>${this.heading}</span>
1072
1176
  <span class="chev" aria-hidden="true"><cm-icon name="chevron-down" size="16"></cm-icon></span>
1073
1177
  </button>
1074
1178
  </div>
1075
- <div class="body" part="body" id="${s(this,li)}-body" role="region" aria-labelledby="${s(this,li)}-btn" ?hidden=${!this.open}><slot></slot></div>
1076
- </div>`}};li=new WeakMap,fs.properties={heading:{},open:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},fs.styles=[w,b`
1179
+ <div class="body" part="body" id="${s(this,ji)}-body" role="region" aria-labelledby="${s(this,ji)}-btn" ?hidden=${!this.open}><slot></slot></div>
1180
+ </div>`}};ji=new WeakMap,or.properties={heading:{},open:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},or.styles=[E,x`
1077
1181
  :host { display: block; }
1078
1182
  .wrap { border: var(--cm-border-1) solid var(--cm-border-default); border-radius: var(--cm-radius-md); background: var(--cm-bg-surface); }
1079
1183
  .h { margin: 0; font: inherit; }
@@ -1095,24 +1199,24 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1095
1199
  .body { padding: var(--cm-space-15) var(--cm-space-20); border-top: var(--cm-border-1) solid var(--cm-border-default); font-size: 14px; }
1096
1200
  .body[hidden] { display: none; }
1097
1201
  @media (max-width: 640px) { button { min-height: 50px; font-size: 14px; } .chev { width: 28px; height: 28px; } }
1098
- `];g("cm-accordion",fs);var xe,ci,qc,Gh,bs=class extends _{constructor(){super(...arguments);p(this,xe);this.heading="";this.image="";this.icon="box";this.headingLevel=2;this.size="large";this.action="";this.actionHref="";this.hasText=!1;this.hasActions=!1;this.hasImage=!1}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));if(this.size==="inline")return o(this,xe,Gh).call(this,e);let t=this.image?l`<img src=${this.image} alt="" part="image">`:this.icon?l`<cm-icon name=${this.icon} size="96"></cm-icon>`:d;return l`<div class="wrap" part="empty-state">
1099
- <div class="circle" part="circle" aria-hidden=${this.hasImage?d:"true"}>
1100
- <slot name="image" @slotchange=${i=>o(this,xe,ci).call(this,i,"hasImage")}>${t}</slot>
1202
+ `];w("cm-accordion",or);var ze,Vi,Ah,lm,lr=class extends L{constructor(){super(...arguments);u(this,ze);this.heading="";this.image="";this.icon="box";this.headingLevel=2;this.size="large";this.action="";this.actionHref="";this.hasText=!1;this.hasActions=!1;this.hasImage=!1}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));if(this.size==="inline")return a(this,ze,lm).call(this,e);let t=this.image?c`<img src=${this.image} alt="" part="image">`:this.icon?c`<cm-icon name=${this.icon} size="96"></cm-icon>`:h;return c`<div class="wrap" part="empty-state">
1203
+ <div class="circle" part="circle" aria-hidden=${this.hasImage?h:"true"}>
1204
+ <slot name="image" @slotchange=${i=>a(this,ze,Vi).call(this,i,"hasImage")}>${t}</slot>
1101
1205
  </div>
1102
1206
  <div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1103
- <div class="text" ?hidden=${!this.hasText}><slot @slotchange=${i=>o(this,xe,ci).call(this,i,"hasText")}></slot></div>
1104
- <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>o(this,xe,ci).call(this,i,"hasActions")}></slot></div>${this.action?l`<div class="actions">${o(this,xe,qc).call(this)}</div>`:d}
1105
- </div>`}};xe=new WeakSet,ci=function(e,t){let i=e.target;this[t]=i.assignedNodes({flatten:!0}).some(a=>a.nodeType===1||a.textContent.trim()),this.requestUpdate()},qc=function(){return this.action?this.actionHref?l`<a class="text-action" part="action" href=${this.actionHref}>${this.action}</a>`:l`<button class="text-action" type="button" part="action"
1106
- @click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:d},Gh=function(e){let t=this.image?l`<img src=${this.image} alt="" part="image">`:this.icon?l`<cm-icon name=${this.icon} size="20"></cm-icon>`:d;return l`<div class="wrap inline" part="empty-state">
1107
- <span class="icon" part="circle" aria-hidden=${this.hasImage?d:"true"} ?hidden=${!this.hasImage&&!this.image&&!this.icon}>
1108
- <slot name="image" @slotchange=${i=>o(this,xe,ci).call(this,i,"hasImage")}>${t}</slot>
1207
+ <div class="text" ?hidden=${!this.hasText}><slot @slotchange=${i=>a(this,ze,Vi).call(this,i,"hasText")}></slot></div>
1208
+ <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>a(this,ze,Vi).call(this,i,"hasActions")}></slot></div>${this.action?c`<div class="actions">${a(this,ze,Ah).call(this)}</div>`:h}
1209
+ </div>`}};ze=new WeakSet,Vi=function(e,t){let i=e.target;this[t]=i.assignedNodes({flatten:!0}).some(r=>r.nodeType===1||r.textContent.trim()),this.requestUpdate()},Ah=function(){return this.action?this.actionHref?c`<a class="text-action" part="action" href=${this.actionHref}>${this.action}</a>`:c`<button class="text-action" type="button" part="action"
1210
+ @click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:h},lm=function(e){let t=this.image?c`<img src=${this.image} alt="" part="image">`:this.icon?c`<cm-icon name=${this.icon} size="20"></cm-icon>`:h;return c`<div class="wrap inline" part="empty-state">
1211
+ <span class="icon" part="circle" aria-hidden=${this.hasImage?h:"true"} ?hidden=${!this.hasImage&&!this.image&&!this.icon}>
1212
+ <slot name="image" @slotchange=${i=>a(this,ze,Vi).call(this,i,"hasImage")}>${t}</slot>
1109
1213
  </span>
1110
1214
  <div class="line">
1111
1215
  <div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1112
- <span class="text" ?hidden=${!this.hasText}> <slot @slotchange=${i=>o(this,xe,ci).call(this,i,"hasText")}></slot></span>${o(this,xe,qc).call(this)}
1113
- <span class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>o(this,xe,ci).call(this,i,"hasActions")}></slot></span>
1216
+ <span class="text" ?hidden=${!this.hasText}> <slot @slotchange=${i=>a(this,ze,Vi).call(this,i,"hasText")}></slot></span>${a(this,ze,Ah).call(this)}
1217
+ <span class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>a(this,ze,Vi).call(this,i,"hasActions")}></slot></span>
1114
1218
  </div>
1115
- </div>`},bs.properties={heading:{},image:{},icon:{},headingLevel:{type:Number,attribute:"heading-level"},size:{reflect:!0},action:{},actionHref:{attribute:"action-href"}},bs.styles=[w,b`
1219
+ </div>`},lr.properties={heading:{},image:{},icon:{},headingLevel:{type:Number,attribute:"heading-level"},size:{reflect:!0},action:{},actionHref:{attribute:"action-href"}},lr.styles=[E,x`
1116
1220
  :host { display: block; }
1117
1221
  .wrap {
1118
1222
  display: flex; flex-direction: column; align-items: center; text-align: center;
@@ -1154,7 +1258,7 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1154
1258
  .title { margin-top: 30px; font-size: 14px; }
1155
1259
  .actions { gap: var(--cm-space-10); }
1156
1260
  }
1157
- `];g("cm-empty-state",bs);var Yh={small:34,medium:40,large:50,xlarge:186},gs=class extends _{constructor(){super(...arguments);this.variant="text";this.lines=1;this.size="large"}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){if(this.variant==="thumbnail"){let t=Yh[this.size]??Yh.large;return l`<span class="bone" part="bone" style="width:${t}px;height:${t}px"></span>`}if(this.variant==="block")return l`<span class="bone block" part="bone"></span>`;let e=Math.max(1,Math.floor(this.lines||1));return l`${Array.from({length:e},(t,i)=>l`<span class="bone line ${e>1&&i===e-1?"short":""}" part="bone"></span>`)}`}};gs.properties={variant:{reflect:!0},lines:{type:Number},size:{reflect:!0}},gs.styles=[w,b`
1261
+ `];w("cm-empty-state",lr);var cm={small:34,medium:40,large:50,xlarge:186},cr=class extends L{constructor(){super(...arguments);this.variant="text";this.lines=1;this.size="large"}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){if(this.variant==="thumbnail"){let t=cm[this.size]??cm.large;return c`<span class="bone" part="bone" style="width:${t}px;height:${t}px"></span>`}if(this.variant==="block")return c`<span class="bone block" part="bone"></span>`;let e=Math.max(1,Math.floor(this.lines||1));return c`${Array.from({length:e},(t,i)=>c`<span class="bone line ${e>1&&i===e-1?"short":""}" part="bone"></span>`)}`}};cr.properties={variant:{reflect:!0},lines:{type:Number},size:{reflect:!0}},cr.styles=[E,x`
1158
1262
  :host { display: block; --cm-skeleton-height: 120px; }
1159
1263
  :host([variant='thumbnail']) { display: inline-block; vertical-align: middle; }
1160
1264
  .bone {
@@ -1169,17 +1273,17 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1169
1273
  .bone { animation: none; background: var(--cm-thumb-bg); }
1170
1274
  }
1171
1275
  @media (forced-colors: active) { .bone { border: 1px solid CanvasText; } }
1172
- `];g("cm-skeleton",gs);var Yu=[472,90,90,251],Wu=[94,266,134,191,138],vs=class extends k{constructor(){super(...arguments);this.layout="two-column";this.navigation=!1}render(){let e=t=>t.map(i=>l`<span class="bone" style="height:${i}px"></span>`);return l`<div class="wrap" part="skeleton-display" aria-busy="true">
1276
+ `];w("cm-skeleton",cr);var Vg=[472,90,90,251],Ug=[94,266,134,191,138],dr=class extends T{constructor(){super(...arguments);this.layout="two-column";this.navigation=!1}render(){let e=t=>t.map(i=>c`<span class="bone" style="height:${i}px"></span>`);return c`<div class="wrap" part="skeleton-display" aria-busy="true">
1173
1277
  <span class="sr" role="status">${this.label}</span>
1174
1278
  <div class="page" aria-hidden="true">
1175
- ${this.navigation?l`<span class="bone nav"></span>`:d}
1279
+ ${this.navigation?c`<span class="bone nav"></span>`:h}
1176
1280
  <span class="bone head"></span>
1177
1281
  <div class="body">
1178
- <div class="col main">${e(this.layout==="one-column"?[472,251]:Yu)}</div>
1179
- <div class="col side">${e(Wu)}</div>
1282
+ <div class="col main">${e(this.layout==="one-column"?[472,251]:Vg)}</div>
1283
+ <div class="col side">${e(Ug)}</div>
1180
1284
  </div>
1181
1285
  </div>
1182
- </div>`}};vs.properties={layout:{reflect:!0},navigation:{type:Boolean,reflect:!0},label:{string:"loading"}},vs.styles=[w,b`
1286
+ </div>`}};dr.properties={layout:{reflect:!0},navigation:{type:Boolean,reflect:!0},label:{string:"loading"}},dr.styles=[E,x`
1183
1287
  :host { display: block; }
1184
1288
  .page { display: grid; grid-template-columns: 1fr; gap: var(--cm-space-10); }
1185
1289
  :host([navigation]) .page { grid-template-columns: 250px minmax(0, 1fr); }
@@ -1203,11 +1307,11 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1203
1307
  .body { grid-template-columns: minmax(0, 1fr); }
1204
1308
  .head { height: 60px; }
1205
1309
  }
1206
- `];g("cm-skeleton-display",vs);var Bg=M("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),Qo,Wh,xs=class extends k{constructor(){super(...arguments);p(this,Qo);this.author="";this.datetime="";this.time=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-comment-box"&&this.setAttribute("role","listitem")}render(){let e=o(this,Qo,Wh).call(this);return l`<article part="comment">
1207
- ${e?l`<time class="meta" part="time" datetime=${this.datetime||d}>${e}</time>`:d}
1310
+ `];w("cm-skeleton-display",dr);var Vy=C("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),Cc,dm,hr=class extends T{constructor(){super(...arguments);u(this,Cc);this.author="";this.datetime="";this.time=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-comment-box"&&this.setAttribute("role","listitem")}render(){let e=a(this,Cc,dm).call(this);return c`<article part="comment">
1311
+ ${e?c`<time class="meta" part="time" datetime=${this.datetime||h}>${e}</time>`:h}
1208
1312
  <div class="body" part="body"><slot></slot></div>
1209
- ${this.author?l`<div class="meta" part="author">– ${this.author}</div>`:d}
1210
- </article>`}};Qo=new WeakSet,Wh=function(){if(this.time)return this.time;if(!this.datetime)return"";let e=new Date(this.datetime);return Number.isNaN(e.getTime())?this.datetime:Z(e,{dateStyle:"medium",timeStyle:"short"},this.locale)},xs.properties={author:{},datetime:{},time:{}},xs.styles=[w,b`
1313
+ ${this.author?c`<div class="meta" part="author">– ${this.author}</div>`:h}
1314
+ </article>`}};Cc=new WeakSet,dm=function(){if(this.time)return this.time;if(!this.datetime)return"";let e=new Date(this.datetime);return Number.isNaN(e.getTime())?this.datetime:ee(e,{dateStyle:"medium",timeStyle:"short"},this.locale)},hr.properties={author:{},datetime:{},time:{}},hr.styles=[E,x`
1211
1315
  :host { display: block; }
1212
1316
  article {
1213
1317
  display: flex; flex-direction: column; gap: 6px; padding: var(--cm-space-10);
@@ -1215,16 +1319,16 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1215
1319
  }
1216
1320
  .meta { font-size: 12px; color: var(--cm-text-tertiary); }
1217
1321
  .body { font-size: 14px; line-height: 16px; overflow-wrap: anywhere; }
1218
- `];g("cm-comment",xs);var Ra,el,Xh,ys=class extends k{constructor(){super(...arguments);p(this,el);this.placeholder="";this.value="";this.disabled=!1;this.headingLevel=2;p(this,Ra,L("cm-comment-box"));this.hasComments=!1}submit(){let e=this.renderRoot.querySelector("textarea"),t=(e?.value??this.value).trim();if(this.disabled)return;if(!t){e?.focus();return}let i=new CustomEvent("cm-submit",{bubbles:!0,composed:!0,cancelable:!0,detail:{value:t}});this.dispatchEvent(i)&&(this.value="",e&&(e.value=""))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return l`<section part="comment-box" aria-labelledby="${s(this,Ra)}-h">
1219
- <div class="title" id="${s(this,Ra)}-h" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1220
- <textarea part="input" aria-label=${this.label} placeholder=${this.placeholder||d} .value=${this.value}
1322
+ `];w("cm-comment",hr);var qn,_c,hm,pr=class extends T{constructor(){super(...arguments);u(this,_c);this.placeholder="";this.value="";this.disabled=!1;this.headingLevel=2;u(this,qn,D("cm-comment-box"));this.hasComments=!1}submit(){let e=this.renderRoot.querySelector("textarea"),t=(e?.value??this.value).trim();if(this.disabled)return;if(!t){e?.focus();return}let i=new CustomEvent("cm-submit",{bubbles:!0,composed:!0,cancelable:!0,detail:{value:t}});this.dispatchEvent(i)&&(this.value="",e&&(e.value=""))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return c`<section part="comment-box" aria-labelledby="${s(this,qn)}-h">
1323
+ <div class="title" id="${s(this,qn)}-h" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1324
+ <textarea part="input" aria-label=${this.label} placeholder=${this.placeholder||h} .value=${this.value}
1221
1325
  ?disabled=${this.disabled} @input=${t=>{this.value=t.target.value}}
1222
- @keydown=${o(this,el,Xh)}></textarea>
1326
+ @keydown=${a(this,_c,hm)}></textarea>
1223
1327
  <div class="actions"><cm-button variant="primary" size="large" ?disabled=${this.disabled} @click=${()=>this.submit()}>${this.action}</cm-button></div>
1224
1328
  <div class="list" role="list" ?hidden=${!this.hasComments}>
1225
1329
  <slot @slotchange=${t=>{this.hasComments=t.target.assignedElements().length>0,this.requestUpdate()}}></slot>
1226
1330
  </div>
1227
- </section>`}};Ra=new WeakMap,el=new WeakSet,Xh=function(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.submit())},ys.properties={heading:{string:"heading"},label:{string:"label"},placeholder:{},action:{string:"action"},value:{},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},ys.styles=[w,b`
1331
+ </section>`}};qn=new WeakMap,_c=new WeakSet,hm=function(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.submit())},pr.properties={heading:{string:"heading"},label:{string:"label"},placeholder:{},action:{string:"action"},value:{},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},pr.styles=[E,x`
1228
1332
  :host { display: block; }
1229
1333
  section { display: flex; flex-direction: column; gap: var(--cm-space-20); }
1230
1334
  .title { margin: 0; font-size: 20px; font-weight: 600; }
@@ -1245,8 +1349,8 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1245
1349
  textarea { min-height: 100px; }
1246
1350
  .actions { justify-content: flex-end; }
1247
1351
  }
1248
- `];g("cm-comment-box",ys);var tl='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [part="control"]',ie,$s,Dt,Nt,Ke,ks,Es,Te,Pc,il,sl,rl,al,Ms,Jh,di,Bc,jc,nt,ws=class extends _{constructor(){super(...arguments);p(this,Te);this.content="";this.placement="top";this.delay=300;this.open=!1;this.visualOnly=!1;this._side="top";p(this,ie);p(this,$s);p(this,Dt,[]);p(this,Nt);p(this,Ke);p(this,ks,!1);p(this,Es,!1);p(this,il,()=>{f(this,ks,!0),clearTimeout(s(this,Ke)),this.open||f(this,Ke,setTimeout(()=>this.show(),this.delay))});p(this,sl,()=>{f(this,ks,!1),clearTimeout(s(this,Ke)),s(this,Es)||f(this,Ke,setTimeout(()=>this.hide(),100))});p(this,rl,()=>{f(this,Es,!0),this.show()});p(this,al,e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(f(this,Es,!1),s(this,ks)||this.hide())});p(this,Ms,e=>{e.key==="Escape"&&this.open&&this.hide()});p(this,di,()=>{let t=this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0];if(o(this,Te,jc).call(this),!t||!this.content||this.visualOnly)return;let i=t.updateComplete;t.localName.includes("-")&&i&&!t.shadowRoot?.querySelector(tl)&&i.then(()=>{t.shadowRoot?.querySelector(tl)&&s(this,di).call(this)}),s(this,ie)||(f(this,ie,document.createElement("span")),s(this,ie).id=L("cm-tooltip"),s(this,ie).hidden=!0,s(this,ie).slot="description"),s(this,ie).textContent=this.content,s(this,ie).isConnected||this.append(s(this,ie));let a=o(this,Te,Jh).call(this,t);if(f(this,$s,a),a.getRootNode()===s(this,ie).getRootNode()){let c=(a.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);c.includes(s(this,ie).id)||a.setAttribute("aria-describedby",[...c,s(this,ie).id].join(" "))}else"ariaDescribedByElements"in a?(o(this,Te,Bc).call(this,a),f(this,Nt,new MutationObserver(()=>{a.getAttribute("aria-describedby")!==""&&o(this,Te,Bc).call(this,a)})),s(this,Nt).observe(a,{attributes:!0,attributeFilter:["aria-describedby"]})):t.setAttribute("aria-describedby",s(this,ie).id)});p(this,nt,()=>{let e=this.renderRoot.querySelector(".tip");if(!e||!this.open)return;let a=(this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0]??this).getBoundingClientRect(),c=e.getBoundingClientRect(),h=8,u=8,m=innerWidth,y=innerHeight,v=getComputedStyle(this).direction==="rtl",E=_i=>_i==="start"?v?"right":"left":_i==="end"?v?"left":"right":_i,$={top:a.top-h-c.height>=u,bottom:a.bottom+h+c.height<=y-u,left:a.left-h-c.width>=u,right:a.right+h+c.width<=m-u},T={top:"bottom",bottom:"top",left:"right",right:"left"},D=E(this.placement);!$[D]&&$[T[D]]&&(D=T[D]);let P,j;D==="top"||D==="bottom"?(P=a.left+a.width/2-c.width/2,j=D==="top"?a.top-h-c.height:a.bottom+h):(j=a.top+a.height/2-c.height/2,P=D==="left"?a.left-h-c.width:a.right+h),P=Math.min(Math.max(u,P),m-u-c.width),j=Math.min(Math.max(u,j),y-u-c.height),e.style.transform=`translate(${Math.round(P)}px, ${Math.round(j)}px)`;let Ti={top:"top",bottom:"bottom",left:v?"end":"start",right:v?"start":"end"};this._side=Ti[D]})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",s(this,il)),this.addEventListener("pointerleave",s(this,sl)),this.addEventListener("focusin",s(this,rl)),this.addEventListener("focusout",s(this,al)),this.addEventListener("keydown",s(this,Ms)),this.hasUpdated&&s(this,di).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.hide(),o(this,Te,jc).call(this),o(this,Te,Pc).call(this),clearTimeout(s(this,Ke))}show(){clearTimeout(s(this,Ke)),!(this.open||!this.content)&&(this.open=!0,document.addEventListener("keydown",s(this,Ms),!0),addEventListener("scroll",s(this,nt),!0),addEventListener("resize",s(this,nt)),this.updateComplete.then(s(this,nt)),this.dispatchEvent(new CustomEvent("cm-show",{bubbles:!0,composed:!0})))}hide(){clearTimeout(s(this,Ke)),this.open&&(this.open=!1,o(this,Te,Pc).call(this),this.dispatchEvent(new CustomEvent("cm-hide",{bubbles:!0,composed:!0})))}updated(e){(e.has("content")||e.has("visualOnly"))&&(s(this,di).call(this),this.content?this.open&&s(this,nt).call(this):this.hide())}render(){return l`<slot @slotchange=${s(this,di)}></slot><div class="tip" part="tooltip" role="tooltip" aria-hidden="true"
1249
- data-side=${this._side}>${this.content}</div>`}};ie=new WeakMap,$s=new WeakMap,Dt=new WeakMap,Nt=new WeakMap,Ke=new WeakMap,ks=new WeakMap,Es=new WeakMap,Te=new WeakSet,Pc=function(){document.removeEventListener("keydown",s(this,Ms),!0),removeEventListener("scroll",s(this,nt),!0),removeEventListener("resize",s(this,nt))},il=new WeakMap,sl=new WeakMap,rl=new WeakMap,al=new WeakMap,Ms=new WeakMap,Jh=function(e){return e.matches(tl)&&!e.shadowRoot?e:e.shadowRoot?.querySelector(tl)??e},di=new WeakMap,Bc=function(e){f(this,Dt,(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean));let t=e.getRootNode(),i=s(this,Dt).map(a=>t.getElementById(a)).filter(a=>!!a);e.ariaDescribedByElements=[...i,s(this,ie)]},jc=function(){let e=s(this,$s);if(!(!e||!s(this,ie))){if(s(this,Nt))s(this,Nt).disconnect(),f(this,Nt,void 0),s(this,Dt).length?e.setAttribute("aria-describedby",s(this,Dt).join(" ")):e.removeAttribute("aria-describedby"),f(this,Dt,[]);else{let t=(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(i=>i&&i!==s(this,ie).id);t.length?e.setAttribute("aria-describedby",t.join(" ")):e.removeAttribute("aria-describedby")}f(this,$s,void 0)}},nt=new WeakMap,ws.properties={content:{},placement:{reflect:!0},delay:{type:Number},open:{type:Boolean,reflect:!0},visualOnly:{type:Boolean,attribute:"visual-only"},_side:{state:!0}},ws.styles=[w,b`
1352
+ `];w("cm-comment-box",pr);var Lc='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [part="control"]',ue,mr,ui,mi,gt,fr,gr,Oe,Nh,Sc,zc,Dc,Ac,br,pm,Ui,Rh,Hh,Ht,ur=class extends L{constructor(){super(...arguments);u(this,Oe);this.content="";this.placement="top";this.delay=300;this.open=!1;this.visualOnly=!1;this._side="top";u(this,ue);u(this,mr);u(this,ui,[]);u(this,mi);u(this,gt);u(this,fr,!1);u(this,gr,!1);u(this,Sc,()=>{g(this,fr,!0),clearTimeout(s(this,gt)),this.open||g(this,gt,setTimeout(()=>this.show(),this.delay))});u(this,zc,()=>{g(this,fr,!1),clearTimeout(s(this,gt)),s(this,gr)||g(this,gt,setTimeout(()=>this.hide(),100))});u(this,Dc,()=>{g(this,gr,!0),this.show()});u(this,Ac,e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(g(this,gr,!1),s(this,fr)||this.hide())});u(this,br,e=>{e.key==="Escape"&&this.open&&this.hide()});u(this,Ui,()=>{let t=this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0];if(a(this,Oe,Hh).call(this),!t||!this.content||this.visualOnly)return;let i=t.updateComplete;t.localName.includes("-")&&i&&!t.shadowRoot?.querySelector(Lc)&&i.then(()=>{t.shadowRoot?.querySelector(Lc)&&s(this,Ui).call(this)}),s(this,ue)||(g(this,ue,document.createElement("span")),s(this,ue).id=D("cm-tooltip"),s(this,ue).hidden=!0,s(this,ue).slot="description"),s(this,ue).textContent=this.content,s(this,ue).isConnected||this.append(s(this,ue));let r=a(this,Oe,pm).call(this,t);if(g(this,mr,r),r.getRootNode()===s(this,ue).getRootNode()){let l=(r.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);l.includes(s(this,ue).id)||r.setAttribute("aria-describedby",[...l,s(this,ue).id].join(" "))}else"ariaDescribedByElements"in r?(a(this,Oe,Rh).call(this,r),g(this,mi,new MutationObserver(()=>{r.getAttribute("aria-describedby")!==""&&a(this,Oe,Rh).call(this,r)})),s(this,mi).observe(r,{attributes:!0,attributeFilter:["aria-describedby"]})):t.setAttribute("aria-describedby",s(this,ue).id)});u(this,Ht,()=>{let e=this.renderRoot.querySelector(".tip");if(!e||!this.open)return;let r=(this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0]??this).getBoundingClientRect(),l=e.getBoundingClientRect(),d=8,p=8,m=innerWidth,v=innerHeight,b=getComputedStyle(this).direction==="rtl",$=Q=>Q==="start"?b?"right":"left":Q==="end"?b?"left":"right":Q,y={top:r.top-d-l.height>=p,bottom:r.bottom+d+l.height<=v-p,left:r.left-d-l.width>=p,right:r.right+d+l.width<=m-p},M={top:"bottom",bottom:"top",left:"right",right:"left"},A=$(this.placement);!y[A]&&y[M[A]]&&(A=M[A]);let I,B;A==="top"||A==="bottom"?(I=r.left+r.width/2-l.width/2,B=A==="top"?r.top-d-l.height:r.bottom+d):(B=r.top+r.height/2-l.height/2,I=A==="left"?r.left-d-l.width:r.right+d),I=Math.min(Math.max(p,I),m-p-l.width),B=Math.min(Math.max(p,B),v-p-l.height),e.style.transform=`translate(${Math.round(I)}px, ${Math.round(B)}px)`;let V={top:"top",bottom:"bottom",left:b?"end":"start",right:b?"start":"end"};this._side=V[A]})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",s(this,Sc)),this.addEventListener("pointerleave",s(this,zc)),this.addEventListener("focusin",s(this,Dc)),this.addEventListener("focusout",s(this,Ac)),this.addEventListener("keydown",s(this,br)),this.hasUpdated&&s(this,Ui).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.hide(),a(this,Oe,Hh).call(this),a(this,Oe,Nh).call(this),clearTimeout(s(this,gt))}show(){clearTimeout(s(this,gt)),!(this.open||!this.content)&&(this.open=!0,document.addEventListener("keydown",s(this,br),!0),addEventListener("scroll",s(this,Ht),!0),addEventListener("resize",s(this,Ht)),this.updateComplete.then(s(this,Ht)),this.dispatchEvent(new CustomEvent("cm-show",{bubbles:!0,composed:!0})))}hide(){clearTimeout(s(this,gt)),this.open&&(this.open=!1,a(this,Oe,Nh).call(this),this.dispatchEvent(new CustomEvent("cm-hide",{bubbles:!0,composed:!0})))}updated(e){(e.has("content")||e.has("visualOnly"))&&(s(this,Ui).call(this),this.content?this.open&&s(this,Ht).call(this):this.hide())}render(){return c`<slot @slotchange=${s(this,Ui)}></slot><div class="tip" part="tooltip" role="tooltip" aria-hidden="true"
1353
+ data-side=${this._side}>${this.content}</div>`}};ue=new WeakMap,mr=new WeakMap,ui=new WeakMap,mi=new WeakMap,gt=new WeakMap,fr=new WeakMap,gr=new WeakMap,Oe=new WeakSet,Nh=function(){document.removeEventListener("keydown",s(this,br),!0),removeEventListener("scroll",s(this,Ht),!0),removeEventListener("resize",s(this,Ht))},Sc=new WeakMap,zc=new WeakMap,Dc=new WeakMap,Ac=new WeakMap,br=new WeakMap,pm=function(e){return e.matches(Lc)&&!e.shadowRoot?e:e.shadowRoot?.querySelector(Lc)??e},Ui=new WeakMap,Rh=function(e){g(this,ui,(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean));let t=e.getRootNode(),i=s(this,ui).map(r=>t.getElementById(r)).filter(r=>!!r);e.ariaDescribedByElements=[...i,s(this,ue)]},Hh=function(){let e=s(this,mr);if(!(!e||!s(this,ue))){if(s(this,mi))s(this,mi).disconnect(),g(this,mi,void 0),s(this,ui).length?e.setAttribute("aria-describedby",s(this,ui).join(" ")):e.removeAttribute("aria-describedby"),g(this,ui,[]);else{let t=(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(i=>i&&i!==s(this,ue).id);t.length?e.setAttribute("aria-describedby",t.join(" ")):e.removeAttribute("aria-describedby")}g(this,mr,void 0)}},Ht=new WeakMap,ur.properties={content:{},placement:{reflect:!0},delay:{type:Number},open:{type:Boolean,reflect:!0},visualOnly:{type:Boolean,attribute:"visual-only"},_side:{state:!0}},ur.styles=[E,x`
1250
1354
  :host { display: inline-block; position: relative; }
1251
1355
  .tip {
1252
1356
  position: fixed; top: 0; left: 0; z-index: 1100; box-sizing: border-box;
@@ -1260,22 +1364,22 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1260
1364
  :host([open]) .tip { opacity: 1; visibility: visible; }
1261
1365
  @media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
1262
1366
  @media (forced-colors: active) { .tip { border: 1px solid CanvasText; } }
1263
- `];g("cm-tooltip",ws);var Jg=M("timelineItem",{justNow:"Just now",minutesAgo:{one:"{count} minute ago",other:"{count} minutes ago"},hoursAgo:{one:"{count} hour ago",other:"{count} hours ago"},daysAgo:{one:"{count} day ago",other:"{count} days ago"},inMinutes:{one:"In {count} minute",other:"In {count} minutes"},inHours:{one:"In {count} hour",other:"In {count} hours"},inDays:{one:"In {count} day",other:"In {count} days"},showAll:"Show all",showLess:"Show less"}),Zg=M("timeline",{label:"Activity",showMore:"Show more",loading:"Loading activity"}),Xu=7,Ha=new Set,Ia;function Zh(n,r){r?Ha.add(n):Ha.delete(n),Ha.size&&!Ia&&(Ia=setInterval(()=>Ha.forEach(e=>e.requestUpdate()),6e4)),!Ha.size&&Ia&&(clearInterval(Ia),Ia=void 0)}var Oa,pi,Oe,Fc,nl,Qh,Ts=class extends k{constructor(){super(...arguments);p(this,Oe);this.icon="";this.tone="neutral";this.heading="";this.datetime="";this.time="";this.meta="";this.lines=3;this.expanded=!1;this._overflow=!1;this._body=!1;this._meta=!1;this._actions=!1;p(this,Oa,L("cm-tl"));p(this,pi)}connectedCallback(){super.connectedCallback(),Zh(this,!0)}disconnectedCallback(){super.disconnectedCallback(),Zh(this,!1),s(this,pi)?.disconnect(),f(this,pi,void 0)}firstUpdated(){let e=this.renderRoot.querySelector(".body");e&&typeof ResizeObserver<"u"&&(f(this,pi,new ResizeObserver(()=>o(this,Oe,Fc).call(this))),s(this,pi).observe(e))}updated(e){(e.has("lines")||e.has("_body")||e.has("expanded"))&&o(this,Oe,Fc).call(this)}get date(){if(!this.datetime)return;let e=new Date(this.datetime);return Number.isNaN(e.getTime())?void 0:e}get relativeTime(){if(this.time)return this.time;let e=this.date;if(!e)return this.datetime;let t=Date.now()-e.getTime(),i=t<0,a=Math.floor(Math.abs(t)/6e4);if(a<1)return this.t("justNow");if(a<60)return this.t(i?"inMinutes":"minutesAgo",{count:a});let c=Math.floor(a/60);if(c<24)return this.t(i?"inHours":"hoursAgo",{count:c});let h=Math.floor(c/24);return h<Xu?this.t(i?"inDays":"daysAgo",{count:h}):Z(e,{dateStyle:"medium"},this.locale)}get fullTime(){let e=this.date;return e?Z(e,{dateStyle:"full",timeStyle:"short"},this.locale):""}render(){let e=this.relativeTime,t=this.fullTime,i=this.tone&&this.tone!=="neutral"?this.tone:"",a=this.lines>0&&!this.expanded,c=e?t?l`<cm-tooltip class="when" content=${t} visual-only placement="top"><time part="time" tabindex="0" datetime=${this.datetime}>${e}<span class="sr">, ${t}</span></time></cm-tooltip>`:l`<time class="when" part="time" datetime=${this.datetime||d}>${e}</time>`:d;return l`<div class="item">
1264
- <span class="icon ${i}" part="icon" aria-hidden="true">${this.icon?l`<cm-icon name=${this.icon} size="16"></cm-icon>`:l`<span class="dot"></span>`}</span>
1367
+ `];w("cm-tooltip",ur);var e0=C("timelineItem",{justNow:"Just now",minutesAgo:{one:"{count} minute ago",other:"{count} minutes ago"},hoursAgo:{one:"{count} hour ago",other:"{count} hours ago"},daysAgo:{one:"{count} day ago",other:"{count} days ago"},inMinutes:{one:"In {count} minute",other:"In {count} minutes"},inHours:{one:"In {count} hour",other:"In {count} hours"},inDays:{one:"In {count} day",other:"In {count} days"},showAll:"Show all",showLess:"Show less"}),t0=C("timeline",{label:"Activity",showMore:"Show more",loading:"Loading activity"}),Kg=7,Bn=new Set,Fn;function um(o,n){n?Bn.add(o):Bn.delete(o),Bn.size&&!Fn&&(Fn=setInterval(()=>Bn.forEach(e=>e.requestUpdate()),6e4)),!Bn.size&&Fn&&(clearInterval(Fn),Fn=void 0)}var jn,Wi,nt,Ih,Nc,mm,vr=class extends T{constructor(){super(...arguments);u(this,nt);this.icon="";this.tone="neutral";this.heading="";this.datetime="";this.time="";this.meta="";this.lines=3;this.expanded=!1;this._overflow=!1;this._body=!1;this._meta=!1;this._actions=!1;u(this,jn,D("cm-tl"));u(this,Wi)}connectedCallback(){super.connectedCallback(),um(this,!0)}disconnectedCallback(){super.disconnectedCallback(),um(this,!1),s(this,Wi)?.disconnect(),g(this,Wi,void 0)}firstUpdated(){let e=this.renderRoot.querySelector(".body");e&&typeof ResizeObserver<"u"&&(g(this,Wi,new ResizeObserver(()=>a(this,nt,Ih).call(this))),s(this,Wi).observe(e))}updated(e){(e.has("lines")||e.has("_body")||e.has("expanded"))&&a(this,nt,Ih).call(this)}get date(){if(!this.datetime)return;let e=new Date(this.datetime);return Number.isNaN(e.getTime())?void 0:e}get relativeTime(){if(this.time)return this.time;let e=this.date;if(!e)return this.datetime;let t=Date.now()-e.getTime(),i=t<0,r=Math.floor(Math.abs(t)/6e4);if(r<1)return this.t("justNow");if(r<60)return this.t(i?"inMinutes":"minutesAgo",{count:r});let l=Math.floor(r/60);if(l<24)return this.t(i?"inHours":"hoursAgo",{count:l});let d=Math.floor(l/24);return d<Kg?this.t(i?"inDays":"daysAgo",{count:d}):ee(e,{dateStyle:"medium"},this.locale)}get fullTime(){let e=this.date;return e?ee(e,{dateStyle:"full",timeStyle:"short"},this.locale):""}render(){let e=this.relativeTime,t=this.fullTime,i=this.tone&&this.tone!=="neutral"?this.tone:"",r=this.lines>0&&!this.expanded,l=e?t?c`<cm-tooltip class="when" content=${t} visual-only placement="top"><time part="time" tabindex="0" datetime=${this.datetime}>${e}<span class="sr">, ${t}</span></time></cm-tooltip>`:c`<time class="when" part="time" datetime=${this.datetime||h}>${e}</time>`:h;return c`<div class="item">
1368
+ <span class="icon ${i}" part="icon" aria-hidden="true">${this.icon?c`<cm-icon name=${this.icon} size="16"></cm-icon>`:c`<span class="dot"></span>`}</span>
1265
1369
  <div class="main">
1266
1370
  <div class="head">
1267
1371
  <span class="title" part="title"><slot name="heading">${this.heading}</slot></span>
1268
1372
  <slot name="badge"></slot>
1269
- ${c}
1373
+ ${l}
1270
1374
  </div>
1271
- <div class="meta" part="meta" ?hidden=${!this.meta&&!this._meta}><slot name="meta" @slotchange=${h=>o(this,Oe,nl).call(this,h,"_meta")}>${this.meta}</slot></div>
1272
- <div class="body ${a?"clamp":""}" id="${s(this,Oa)}-body" part="body" ?hidden=${!this._body}
1273
- style="--_lines: ${Math.max(1,this.lines||1)}"><slot @slotchange=${h=>o(this,Oe,nl).call(this,h,"_body")}></slot></div>
1274
- ${this._body&&this._overflow?l`<button type="button" class="toggle" part="toggle" aria-expanded=${this.expanded?"true":"false"}
1275
- aria-controls="${s(this,Oa)}-body" @click=${o(this,Oe,Qh)}>${this.expanded?this.t("showLess"):this.t("showAll")}</button>`:d}
1276
- <div class="actions" part="actions" ?hidden=${!this._actions}><slot name="actions" @slotchange=${h=>o(this,Oe,nl).call(this,h,"_actions")}></slot></div>
1375
+ <div class="meta" part="meta" ?hidden=${!this.meta&&!this._meta}><slot name="meta" @slotchange=${d=>a(this,nt,Nc).call(this,d,"_meta")}>${this.meta}</slot></div>
1376
+ <div class="body ${r?"clamp":""}" id="${s(this,jn)}-body" part="body" ?hidden=${!this._body}
1377
+ style="--_lines: ${Math.max(1,this.lines||1)}"><slot @slotchange=${d=>a(this,nt,Nc).call(this,d,"_body")}></slot></div>
1378
+ ${this._body&&this._overflow?c`<button type="button" class="toggle" part="toggle" aria-expanded=${this.expanded?"true":"false"}
1379
+ aria-controls="${s(this,jn)}-body" @click=${a(this,nt,mm)}>${this.expanded?this.t("showLess"):this.t("showAll")}</button>`:h}
1380
+ <div class="actions" part="actions" ?hidden=${!this._actions}><slot name="actions" @slotchange=${d=>a(this,nt,Nc).call(this,d,"_actions")}></slot></div>
1277
1381
  </div>
1278
- </div>`}};Oa=new WeakMap,pi=new WeakMap,Oe=new WeakSet,Fc=function(){let e=this.renderRoot.querySelector(".body");if(!e||!this._body||!(this.lines>0)){this._overflow=!1;return}let t=parseFloat(getComputedStyle(e).lineHeight)||20;this._overflow=e.scrollHeight>this.lines*t+1},nl=function(e,t){let i=e.target.assignedNodes({flatten:!0});this[t]=i.some(a=>a.nodeType===Node.ELEMENT_NODE||(a.textContent??"").trim())},Qh=function(){this.expanded=!this.expanded},Ts.properties={icon:{reflect:!0},tone:{reflect:!0},heading:{},datetime:{reflect:!0},time:{},meta:{},lines:{type:Number},expanded:{type:Boolean,reflect:!0},_overflow:{state:!0},_body:{state:!0},_meta:{state:!0},_actions:{state:!0}},Ts.styles=[w,b`
1382
+ </div>`}};jn=new WeakMap,Wi=new WeakMap,nt=new WeakSet,Ih=function(){let e=this.renderRoot.querySelector(".body");if(!e||!this._body||!(this.lines>0)){this._overflow=!1;return}let t=parseFloat(getComputedStyle(e).lineHeight)||20;this._overflow=e.scrollHeight>this.lines*t+1},Nc=function(e,t){let i=e.target.assignedNodes({flatten:!0});this[t]=i.some(r=>r.nodeType===Node.ELEMENT_NODE||(r.textContent??"").trim())},mm=function(){this.expanded=!this.expanded},vr.properties={icon:{reflect:!0},tone:{reflect:!0},heading:{},datetime:{reflect:!0},time:{},meta:{},lines:{type:Number},expanded:{type:Boolean,reflect:!0},_overflow:{state:!0},_body:{state:!0},_meta:{state:!0},_actions:{state:!0}},vr.styles=[E,x`
1279
1383
  :host { display: block; min-width: 0; font-size: 14px; line-height: 20px; }
1280
1384
  .item { display: flex; gap: var(--cm-space-15); align-items: flex-start; }
1281
1385
  .icon {
@@ -1311,16 +1415,16 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1311
1415
  [hidden] { display: none !important; }
1312
1416
  .sr { position: absolute; inset-block-start: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
1313
1417
  ::slotted([slot='badge']) { flex: none; }
1314
- `];g("cm-timeline-item",Ts);var qa,_s,ui,Vc,ep,hi=class extends k{constructor(){super(...arguments);p(this,ui);this.hasMore=!1;this.loading=!1;this._items=[];this._empty=[];p(this,qa,new MutationObserver(()=>o(this,ui,Vc).call(this)));p(this,_s,!1)}connectedCallback(){super.connectedCallback(),o(this,ui,Vc).call(this),s(this,qa).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,qa).disconnect()}get items(){return[...this.children].filter(e=>e.localName==="cm-timeline-item"&&!e.hasAttribute("slot"))}willUpdate(){f(this,_s,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach((i,a)=>{this._items[a]&&i.assign(this._items[a])});let t=this.renderRoot.querySelector("slot.empty");t&&t.assign(...this._empty),s(this,_s)&&!this.renderRoot.querySelector(".more cm-button")&&(f(this,_s,!1),this.renderRoot.querySelector("ol")?.focus())}render(){let e=this._items,t=this.loading,i=t&&!e.length?l`<div class="loading" aria-hidden="true">${[0,1,2].map(()=>l`<div class="sk">
1315
- <cm-skeleton class="ic" variant="block"></cm-skeleton><cm-skeleton class="tx" lines="2"></cm-skeleton></div>`)}</div>`:d;return l`
1316
- ${e.length?l`<ol part="list" aria-label=${this.label} aria-busy=${t?"true":"false"} tabindex="-1">
1317
- ${e.map(()=>l`<li><slot></slot></li>`)}
1318
- </ol>`:d}
1418
+ `];w("cm-timeline-item",vr);var Vn,xr,Yi,Ph,fm,Ki=class extends T{constructor(){super(...arguments);u(this,Yi);this.hasMore=!1;this.loading=!1;this._items=[];this._empty=[];u(this,Vn,new MutationObserver(()=>a(this,Yi,Ph).call(this)));u(this,xr,!1)}connectedCallback(){super.connectedCallback(),a(this,Yi,Ph).call(this),s(this,Vn).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,Vn).disconnect()}get items(){return[...this.children].filter(e=>e.localName==="cm-timeline-item"&&!e.hasAttribute("slot"))}willUpdate(){g(this,xr,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach((i,r)=>{this._items[r]&&i.assign(this._items[r])});let t=this.renderRoot.querySelector("slot.empty");t&&t.assign(...this._empty),s(this,xr)&&!this.renderRoot.querySelector(".more cm-button")&&(g(this,xr,!1),this.renderRoot.querySelector("ol")?.focus())}render(){let e=this._items,t=this.loading,i=t&&!e.length?c`<div class="loading" aria-hidden="true">${[0,1,2].map(()=>c`<div class="sk">
1419
+ <cm-skeleton class="ic" variant="block"></cm-skeleton><cm-skeleton class="tx" lines="2"></cm-skeleton></div>`)}</div>`:h;return c`
1420
+ ${e.length?c`<ol part="list" aria-label=${this.label} aria-busy=${t?"true":"false"} tabindex="-1">
1421
+ ${e.map(()=>c`<li><slot></slot></li>`)}
1422
+ </ol>`:h}
1319
1423
  ${i}
1320
- ${!e.length&&!t?l`<slot class="empty"></slot>`:d}
1321
- ${this.hasMore&&e.length?l`<div class="more"><cm-button part="more" size="medium" ?loading=${t} @click=${o(this,ui,ep)}>${this.moreLabel}</cm-button></div>`:d}
1424
+ ${!e.length&&!t?c`<slot class="empty"></slot>`:h}
1425
+ ${this.hasMore&&e.length?c`<div class="more"><cm-button part="more" size="medium" ?loading=${t} @click=${a(this,Yi,fm)}>${this.moreLabel}</cm-button></div>`:h}
1322
1426
  <span class="sr" role="status">${t?this.t("loading"):""}</span>
1323
- `}};qa=new WeakMap,_s=new WeakMap,ui=new WeakSet,Vc=function(){this._items=this.items,this._empty=[...this.children].filter(e=>e.getAttribute("slot")==="empty")},ep=function(){this.loading||this.dispatchEvent(new CustomEvent("cm-load-more",{bubbles:!0,composed:!0}))},hi.shadowRootOptions={..._.shadowRootOptions,slotAssignment:"manual"},hi.properties={label:{string:"label"},hasMore:{type:Boolean,attribute:"has-more",reflect:!0},loading:{type:Boolean,reflect:!0},moreLabel:{attribute:"more-label",string:"showMore"},_items:{state:!0},_empty:{state:!0}},hi.styles=[w,b`
1427
+ `}};Vn=new WeakMap,xr=new WeakMap,Yi=new WeakSet,Ph=function(){this._items=this.items,this._empty=[...this.children].filter(e=>e.getAttribute("slot")==="empty")},fm=function(){this.loading||this.dispatchEvent(new CustomEvent("cm-load-more",{bubbles:!0,composed:!0}))},Ki.shadowRootOptions={...L.shadowRootOptions,slotAssignment:"manual"},Ki.properties={label:{string:"label"},hasMore:{type:Boolean,attribute:"has-more",reflect:!0},loading:{type:Boolean,reflect:!0},moreLabel:{attribute:"more-label",string:"showMore"},_items:{state:!0},_empty:{state:!0}},Ki.styles=[E,x`
1324
1428
  :host { display: block; }
1325
1429
  ol { margin: 0; padding: 0; list-style: none; }
1326
1430
  ol:focus { outline: none; }
@@ -1342,14 +1446,14 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1342
1446
  @media (max-width: 640px) {
1343
1447
  .more { padding-inline-start: 0; }
1344
1448
  }
1345
- `];g("cm-timeline",hi);var av=M("smartTip",{newTab:"(opens in a new tab)"}),nv=M("smartTips",{heading:"Smart tips",tourAction:"Start"}),Cs=class extends k{constructor(){super(...arguments);this.heading="";this.href="";this.target=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-smart-tips"&&this.setAttribute("role","listitem")}render(){let e=this.target==="_blank";return l`<a part="tip" href=${this.href||d} target=${this.target||d} rel=${e?"noopener noreferrer":d}>
1449
+ `];w("cm-timeline",Ki);var l0=C("smartTip",{newTab:"(opens in a new tab)"}),c0=C("smartTips",{heading:"Smart tips",tourAction:"Start"}),yr=class extends T{constructor(){super(...arguments);this.heading="";this.href="";this.target=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-smart-tips"&&this.setAttribute("role","listitem")}render(){let e=this.target==="_blank";return c`<a part="tip" href=${this.href||h} target=${this.target||h} rel=${e?"noopener noreferrer":h}>
1346
1450
  <span class="text">
1347
1451
  <span class="title" part="heading">${this.heading}</span>
1348
1452
  <span class="desc" part="description"><slot></slot></span>
1349
- ${e?l`<span style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)">${this.t("newTab")}</span>`:d}
1453
+ ${e?c`<span style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)">${this.t("newTab")}</span>`:h}
1350
1454
  </span>
1351
1455
  <span class="go" aria-hidden="true"><cm-icon name="arrow-up-right" size="16"></cm-icon></span>
1352
- </a>`}};Cs.properties={heading:{},href:{},target:{}},Cs.styles=[w,b`
1456
+ </a>`}};yr.properties={heading:{},href:{},target:{}},yr.styles=[E,x`
1353
1457
  :host { display: block; }
1354
1458
  a {
1355
1459
  display: flex; align-items: flex-start; gap: var(--cm-space-10); padding: var(--cm-space-20) var(--cm-space-10);
@@ -1366,17 +1470,17 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1366
1470
  }
1367
1471
  a:hover .go, a:focus-visible .go { background: var(--cm-action-primary); color: var(--cm-action-primary-text); }
1368
1472
  a:hover .title { text-decoration: underline; }
1369
- `];g("cm-smart-tip",Cs);var zs=class extends k{constructor(){super(...arguments);this.tourHeading="";this.headingLevel=2}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return l`<div class="card" part="smart-tips">
1370
- ${this.tourHeading?l`<div class="tour" part="tour">
1473
+ `];w("cm-smart-tip",yr);var wr=class extends T{constructor(){super(...arguments);this.tourHeading="";this.headingLevel=2}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return c`<div class="card" part="smart-tips">
1474
+ ${this.tourHeading?c`<div class="tour" part="tour">
1371
1475
  <span class="tour-icon" aria-hidden="true"><cm-icon name="rocket" size="18"></cm-icon></span>
1372
1476
  <span class="tour-text">${this.tourHeading}</span>
1373
1477
  <cm-button size="medium" @click=${()=>this.dispatchEvent(new CustomEvent("cm-tour",{bubbles:!0,composed:!0}))}>${this.tourAction}</cm-button>
1374
- </div>`:d}
1478
+ </div>`:h}
1375
1479
  <section class="panel" part="panel" aria-label=${this.heading}>
1376
1480
  <div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1377
1481
  <div class="list" role="list"><slot></slot></div>
1378
1482
  </section>
1379
- </div>`}};zs.properties={heading:{string:"heading"},tourHeading:{attribute:"tour-heading"},tourAction:{attribute:"tour-action",string:"tourAction"},headingLevel:{type:Number,attribute:"heading-level"}},zs.styles=[w,b`
1483
+ </div>`}};wr.properties={heading:{string:"heading"},tourHeading:{attribute:"tour-heading"},tourAction:{attribute:"tour-action",string:"tourAction"},headingLevel:{type:Number,attribute:"heading-level"}},wr.styles=[E,x`
1380
1484
  :host { display: block; }
1381
1485
  .card { display: flex; flex-direction: column; gap: var(--cm-space-10); }
1382
1486
  .tour {
@@ -1394,24 +1498,24 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1394
1498
  letter-spacing: var(--cm-tracking-caps); text-transform: uppercase;
1395
1499
  }
1396
1500
  .list { display: flex; flex-direction: column; gap: var(--cm-space-10); }
1397
- `];g("cm-smart-tips",zs);var pv=M("pagination",{label:"Pagination",rows:"Number of rows",summary:"Showing {from}\u2013{to} of {total} {resource}",page:"Page",of:"of {count}",previous:"Previous page",next:"Next page"}),ot,Ss,tp,ip,Ls=class extends k{constructor(){super(...arguments);p(this,Ss);this.page=1;this.total=0;this.pageSize=20;this.pageSizes=[10,20,50,100];this.resourceName="";this._draft=null;p(this,ot,L("cm-pg"))}get pageCount(){return Math.max(1,Math.ceil((this.total||0)/Math.max(1,this.pageSize)))}goTo(e){let t=Math.min(this.pageCount,Math.max(1,Math.round(e)||1));if(this._draft=null,t===this.page){this.requestUpdate();return}this.page=t,this.dispatchEvent(new CustomEvent("cm-page-change",{detail:{page:t},bubbles:!0,composed:!0}))}render(){let e=this.pageCount,t=Math.min(e,Math.max(1,this.page)),i=this.total?(t-1)*this.pageSize+1:0,a=Math.min(this.total,t*this.pageSize),c=this.pageSizes??[];return l`
1501
+ `];w("cm-smart-tips",wr);var f0=C("pagination",{label:"Pagination",rows:"Number of rows",summary:"Showing {from}\u2013{to} of {total} {resource}",page:"Page",of:"of {count}",previous:"Previous page",next:"Next page"}),It,kr,gm,bm,$r=class extends T{constructor(){super(...arguments);u(this,kr);this.page=1;this.total=0;this.pageSize=20;this.pageSizes=[10,20,50,100];this.resourceName="";this._draft=null;u(this,It,D("cm-pg"))}get pageCount(){return Math.max(1,Math.ceil((this.total||0)/Math.max(1,this.pageSize)))}goTo(e){let t=Math.min(this.pageCount,Math.max(1,Math.round(e)||1));if(this._draft=null,t===this.page){this.requestUpdate();return}this.page=t,this.dispatchEvent(new CustomEvent("cm-page-change",{detail:{page:t},bubbles:!0,composed:!0}))}render(){let e=this.pageCount,t=Math.min(e,Math.max(1,this.page)),i=this.total?(t-1)*this.pageSize+1:0,r=Math.min(this.total,t*this.pageSize),l=this.pageSizes??[];return c`
1398
1502
  <nav part="bar" aria-label=${this.label}>
1399
- ${c.length?l`<div class="rows" part="rows">
1400
- <label for="${s(this,ot)}-s">${this.t("rows")}</label>
1401
- <span class="field"><select id="${s(this,ot)}-s" @change=${o(this,Ss,tp)}>
1402
- ${(c.includes(this.pageSize)?c:[...c,this.pageSize].sort((h,u)=>h-u)).map(h=>l`<option value=${h} ?selected=${h===this.pageSize}>${h}</option>`)}
1503
+ ${l.length?c`<div class="rows" part="rows">
1504
+ <label for="${s(this,It)}-s">${this.t("rows")}</label>
1505
+ <span class="field"><select id="${s(this,It)}-s" @change=${a(this,kr,gm)}>
1506
+ ${(l.includes(this.pageSize)?l:[...l,this.pageSize].sort((d,p)=>d-p)).map(d=>c`<option value=${d} ?selected=${d===this.pageSize}>${d}</option>`)}
1403
1507
  </select><cm-icon name="chevron-down" size="12"></cm-icon></span>
1404
- </div>`:d}
1405
- <div class="summary" part="summary" role="status">${this.total?this.t("summary",{from:i,to:a,total:this.total,resource:this.resourceName}).replace(/\s+/g," ").trim():d}</div>
1508
+ </div>`:h}
1509
+ <div class="summary" part="summary" role="status">${this.total?this.t("summary",{from:i,to:r,total:this.total,resource:this.resourceName}).replace(/\s+/g," ").trim():h}</div>
1406
1510
  <div class="pages" part="pages">
1407
1511
  <span class="counter">
1408
- <label for="${s(this,ot)}-p">${this.t("page")}</label>
1409
- <input id="${s(this,ot)}-p" type="number" inputmode="numeric" min="1" max=${e}
1410
- .value=${this._draft??String(t)} aria-describedby="${s(this,ot)}-of"
1411
- @input=${h=>this._draft=h.target.value}
1412
- @keydown=${o(this,Ss,ip)}
1413
- @change=${h=>this.goTo(Number(h.target.value))} />
1414
- <span id="${s(this,ot)}-of">${this.t("of",{count:e})}</span>
1512
+ <label for="${s(this,It)}-p">${this.t("page")}</label>
1513
+ <input id="${s(this,It)}-p" type="number" inputmode="numeric" min="1" max=${e}
1514
+ .value=${this._draft??String(t)} aria-describedby="${s(this,It)}-of"
1515
+ @input=${d=>this._draft=d.target.value}
1516
+ @keydown=${a(this,kr,bm)}
1517
+ @change=${d=>this.goTo(Number(d.target.value))} />
1518
+ <span id="${s(this,It)}-of">${this.t("of",{count:e})}</span>
1415
1519
  </span>
1416
1520
  <span class="arrows">
1417
1521
  <button class="prev" type="button" part="previous" aria-label=${this.t("previous")} ?disabled=${t<=1}
@@ -1421,7 +1525,7 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1421
1525
  </span>
1422
1526
  </div>
1423
1527
  </nav>
1424
- `}};ot=new WeakMap,Ss=new WeakSet,tp=function(e){let t=Number(e.target.value);t!==this.pageSize&&(this.pageSize=t,this.page=1,this.dispatchEvent(new CustomEvent("cm-page-size-change",{detail:{pageSize:t},bubbles:!0,composed:!0})))},ip=function(e){e.key==="Enter"?(e.preventDefault(),this.goTo(Number(e.target.value))):e.key==="Escape"&&(this._draft=null,e.target.value=String(this.page))},Ls.properties={page:{type:Number,reflect:!0},total:{type:Number},pageSize:{type:Number,attribute:"page-size"},pageSizes:{type:Array,attribute:"page-sizes"},label:{string:"label"},resourceName:{attribute:"resource-name"},_draft:{state:!0}},Ls.styles=[w,b`
1528
+ `}};It=new WeakMap,kr=new WeakSet,gm=function(e){let t=Number(e.target.value);t!==this.pageSize&&(this.pageSize=t,this.page=1,this.dispatchEvent(new CustomEvent("cm-page-size-change",{detail:{pageSize:t},bubbles:!0,composed:!0})))},bm=function(e){e.key==="Enter"?(e.preventDefault(),this.goTo(Number(e.target.value))):e.key==="Escape"&&(this._draft=null,e.target.value=String(this.page))},$r.properties={page:{type:Number,reflect:!0},total:{type:Number},pageSize:{type:Number,attribute:"page-size"},pageSizes:{type:Array,attribute:"page-sizes"},label:{string:"label"},resourceName:{attribute:"resource-name"},_draft:{state:!0}},$r.styles=[E,x`
1425
1529
  :host { display: block; }
1426
1530
  nav {
1427
1531
  display: flex; align-items: center; gap: var(--cm-space-20); min-height: 60px; padding: 0 var(--cm-space-20);
@@ -1455,14 +1559,14 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1455
1559
  .arrows { display: contents; }
1456
1560
  .prev { order: -1; }
1457
1561
  }
1458
- `];g("cm-pagination",Ls);var xv=M("statusTabs",{label:"Status"}),Pa,Ne,Uc,sp,Kc,rp,As=class extends k{constructor(){super(...arguments);p(this,Ne);this.value="";this.tabs=[];this.controls="";this.size="large";this._slotted=[];p(this,Pa,new MutationObserver(()=>o(this,Ne,Uc).call(this)))}connectedCallback(){super.connectedCallback(),o(this,Ne,Uc).call(this),s(this,Pa).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,Pa).disconnect()}get items(){return this.tabs.length?this.tabs.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}updated(){if(!("ariaControlsElements"in Element.prototype))return;let e=this.getRootNode(),t=this.controls?e.getElementById?.(this.controls):null;for(let i of this.renderRoot.querySelectorAll("button"))i.ariaControlsElements=t?[t]:null}render(){let e=this.items,t=o(this,Ne,sp).call(this,e);return l`
1562
+ `];w("cm-pagination",$r);var $0=C("statusTabs",{label:"Status"}),Un,tt,Oh,vm,qh,xm,Er=class extends T{constructor(){super(...arguments);u(this,tt);this.value="";this.tabs=[];this.controls="";this.size="large";this._slotted=[];u(this,Un,new MutationObserver(()=>a(this,tt,Oh).call(this)))}connectedCallback(){super.connectedCallback(),a(this,tt,Oh).call(this),s(this,Un).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,Un).disconnect()}get items(){return this.tabs.length?this.tabs.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}updated(){if(!("ariaControlsElements"in Element.prototype))return;let e=this.getRootNode(),t=this.controls?e.getElementById?.(this.controls):null;for(let i of this.renderRoot.querySelectorAll("button"))i.ariaControlsElements=t?[t]:null}render(){let e=this.items,t=a(this,tt,vm).call(this,e);return c`
1459
1563
  <div class="tabs" part="tabs" role="tablist" aria-label=${this.getAttribute("aria-label")||this.t("label")}>
1460
- ${e.map((i,a)=>l`<button type="button" role="tab" part="tab" aria-selected=${a===t?"true":"false"}
1461
- tabindex=${a===t?"0":"-1"} ?disabled=${!!i.disabled}
1462
- @click=${()=>o(this,Ne,Kc).call(this,a)} @keydown=${c=>o(this,Ne,rp).call(this,c,a)}>${i.label}${i.count!==void 0&&!Number.isNaN(i.count)?l` <span class="count">(</span> ${this.formatNumber(i.count)} <span class="count">)</span>`:d}</button>`)}
1564
+ ${e.map((i,r)=>c`<button type="button" role="tab" part="tab" aria-selected=${r===t?"true":"false"}
1565
+ tabindex=${r===t?"0":"-1"} ?disabled=${!!i.disabled}
1566
+ @click=${()=>a(this,tt,qh).call(this,r)} @keydown=${l=>a(this,tt,xm).call(this,l,r)}>${i.label}${i.count!==void 0&&!Number.isNaN(i.count)?c` <span class="count">(</span> ${this.formatNumber(i.count)} <span class="count">)</span>`:h}</button>`)}
1463
1567
  </div>
1464
1568
  <slot></slot>
1465
- `}};Pa=new WeakMap,Ne=new WeakSet,Uc=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i=t.getAttribute("count");return{value:t.value,label:t.label||t.textContent.trim(),count:i===null||i===""?void 0:Number(i),disabled:t.disabled}}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"")},sp=function(e){let t=e.findIndex(i=>i.value===this.value&&!i.disabled);return t>=0?t:e.findIndex(i=>!i.disabled)},Kc=function(e){let t=this.items[e];!t||t.disabled||(this.updateComplete.then(()=>{let i=this.renderRoot.querySelectorAll("button")[e];i?.focus(),i?.scrollIntoView?.({block:"nearest",inline:"nearest"})}),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},rp=function(e,t){let i=ne(e,this),a=this.items.flatMap((u,m)=>u.disabled?[]:[m]),c=a.indexOf(t),h;if(i==="ArrowRight")h=a[(c+1)%a.length];else if(i==="ArrowLeft")h=a[(c-1+a.length)%a.length];else if(e.key==="Home")h=a[0];else if(e.key==="End")h=a[a.length-1];else return;e.preventDefault(),h!==void 0&&o(this,Ne,Kc).call(this,h)},As.properties={value:{reflect:!0},tabs:{type:Array},controls:{},size:{reflect:!0},_slotted:{state:!0}},As.styles=[w,b`
1569
+ `}};Un=new WeakMap,tt=new WeakSet,Oh=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i=t.getAttribute("count");return{value:t.value,label:t.label||t.textContent.trim(),count:i===null||i===""?void 0:Number(i),disabled:t.disabled}}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"")},vm=function(e){let t=e.findIndex(i=>i.value===this.value&&!i.disabled);return t>=0?t:e.findIndex(i=>!i.disabled)},qh=function(e){let t=this.items[e];!t||t.disabled||(this.updateComplete.then(()=>{let i=this.renderRoot.querySelectorAll("button")[e];i?.focus(),i?.scrollIntoView?.({block:"nearest",inline:"nearest"})}),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},xm=function(e,t){let i=re(e,this),r=this.items.flatMap((p,m)=>p.disabled?[]:[m]),l=r.indexOf(t),d;if(i==="ArrowRight")d=r[(l+1)%r.length];else if(i==="ArrowLeft")d=r[(l-1+r.length)%r.length];else if(e.key==="Home")d=r[0];else if(e.key==="End")d=r[r.length-1];else return;e.preventDefault(),d!==void 0&&a(this,tt,qh).call(this,d)},Er.properties={value:{reflect:!0},tabs:{type:Array},controls:{},size:{reflect:!0},_slotted:{state:!0}},Er.styles=[E,x`
1466
1570
  :host { display: block; }
1467
1571
  .tabs {
1468
1572
  display: flex; gap: 28px; overflow-x: auto; scrollbar-width: thin; padding: 2px 2px 0;
@@ -1486,20 +1590,20 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1486
1590
  @media (max-width: 640px) {
1487
1591
  .tabs { gap: 18px; font-size: 14px; }
1488
1592
  }
1489
- `];g("cm-status-tabs",As);var Tv=M("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),ol,Ba,lt,Gc,ap,np,Ds=class extends k{constructor(){super(...arguments);p(this,lt);this.columns=[];this.sort="";this.direction="ascending";this.selectable=!1;this.checked=!1;this.indeterminate=!1;this._slotted=[];this._inTable=!1;p(this,ol,L("cm-th"));p(this,Ba,new MutationObserver(()=>o(this,lt,Gc).call(this)))}connectedCallback(){super.connectedCallback(),this._inTable=!!this.parentElement?.closest('table, [role="table"], [role="grid"], [role="treegrid"]'),o(this,lt,Gc).call(this),s(this,Ba).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,Ba).disconnect()}get items(){return this.columns.length?this.columns.map(e=>typeof e=="string"?{key:e,label:e}:{...e,key:e.key??e.label}):this._slotted}render(){let e=this._inTable,t=this.items;return l`
1490
- <div class="bar ${this.selectable?"sel":""}" part="bar" role=${e?"row":d}
1593
+ `];w("cm-status-tabs",Er);var L0=C("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),Rc,Kn,Pt,Bh,ym,wm,Mr=class extends T{constructor(){super(...arguments);u(this,Pt);this.columns=[];this.sort="";this.direction="ascending";this.selectable=!1;this.checked=!1;this.indeterminate=!1;this._slotted=[];this._inTable=!1;u(this,Rc,D("cm-th"));u(this,Kn,new MutationObserver(()=>a(this,Pt,Bh).call(this)))}connectedCallback(){super.connectedCallback(),this._inTable=!!this.parentElement?.closest('table, [role="table"], [role="grid"], [role="treegrid"]'),a(this,Pt,Bh).call(this),s(this,Kn).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,Kn).disconnect()}get items(){return this.columns.length?this.columns.map(e=>typeof e=="string"?{key:e,label:e}:{...e,key:e.key??e.label}):this._slotted}render(){let e=this._inTable,t=this.items;return c`
1594
+ <div class="bar ${this.selectable?"sel":""}" part="bar" role=${e?"row":h}
1491
1595
  style="--_cols: repeat(${Math.max(1,t.length)}, minmax(0, 1fr))">
1492
- ${this.selectable?l`<span class="cell" role=${e?"columnheader":d}><span class="check">
1493
- <input id="${s(this,ol)}-all" type="checkbox" aria-label=${this.t("selectAll")} .checked=${this.checked} .indeterminate=${this.indeterminate}
1494
- @change=${o(this,lt,np)} />
1495
- <span class="box" aria-hidden="true">${this.indeterminate?l`<span class="dash"></span>`:this.checked?l`<cm-icon name="check" size="14"></cm-icon>`:d}</span>
1496
- </span></span>`:d}
1497
- ${t.map(i=>{let a=this.sort===i.key,c=a?this.direction==="descending"?"descending":"ascending":"none",h=i.hidden?l`<span class="sr">${i.label}</span>`:i.label;return l`<span class="cell" part="cell" data-align=${i.align??"start"} role=${e?"columnheader":d}
1498
- aria-sort=${e&&i.sortable?c:d}>${i.sortable?l`<button type="button" class=${a?"on":""} @click=${()=>o(this,lt,ap).call(this,i)}>${h}${e?d:l`<span class="sr">${a?this.t("sorted",{direction:this.t(c)}):this.t("sortable")}</span>`}<cm-icon
1499
- name=${a&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:h}</span>`})}
1596
+ ${this.selectable?c`<span class="cell" role=${e?"columnheader":h}><span class="check">
1597
+ <input id="${s(this,Rc)}-all" type="checkbox" aria-label=${this.t("selectAll")} .checked=${this.checked} .indeterminate=${this.indeterminate}
1598
+ @change=${a(this,Pt,wm)} />
1599
+ <span class="box" aria-hidden="true">${this.indeterminate?c`<span class="dash"></span>`:this.checked?c`<cm-icon name="check" size="14"></cm-icon>`:h}</span>
1600
+ </span></span>`:h}
1601
+ ${t.map(i=>{let r=this.sort===i.key,l=r?this.direction==="descending"?"descending":"ascending":"none",d=i.hidden?c`<span class="sr">${i.label}</span>`:i.label;return c`<span class="cell" part="cell" data-align=${i.align??"start"} role=${e?"columnheader":h}
1602
+ aria-sort=${e&&i.sortable?l:h}>${i.sortable?c`<button type="button" class=${r?"on":""} @click=${()=>a(this,Pt,ym).call(this,i)}>${d}${e?h:c`<span class="sr">${r?this.t("sorted",{direction:this.t(l)}):this.t("sortable")}</span>`}<cm-icon
1603
+ name=${r&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:d}</span>`})}
1500
1604
  </div>
1501
1605
  <slot></slot>
1502
- `}};ol=new WeakMap,Ba=new WeakMap,lt=new WeakSet,Gc=function(){this._slotted=[...this.querySelectorAll("option")].map(e=>{let t=e.label||e.textContent.trim();return{key:e.getAttribute("value")??t,label:t,sortable:e.hasAttribute("sortable"),hidden:e.hasAttribute("hidden"),align:e.getAttribute("align")??"start"}})},ap=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending";this.dispatchEvent(new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0}))},np=function(e){let t=e.target.checked;this.checked=t,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("cm-select-all",{detail:{checked:t},bubbles:!0,composed:!0}))},Ds.properties={columns:{type:Array},sort:{reflect:!0},direction:{reflect:!0},selectable:{type:Boolean,reflect:!0},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean,reflect:!0},resourceRows:{attribute:"resource-rows",reflect:!0},_slotted:{state:!0},_inTable:{state:!0}},Ds.styles=[w,b`
1606
+ `}};Rc=new WeakMap,Kn=new WeakMap,Pt=new WeakSet,Bh=function(){this._slotted=[...this.querySelectorAll("option")].map(e=>{let t=e.label||e.textContent.trim();return{key:e.getAttribute("value")??t,label:t,sortable:e.hasAttribute("sortable"),hidden:e.hasAttribute("hidden"),align:e.getAttribute("align")??"start"}})},ym=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending";this.dispatchEvent(new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0}))},wm=function(e){let t=e.target.checked;this.checked=t,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("cm-select-all",{detail:{checked:t},bubbles:!0,composed:!0}))},Mr.properties={columns:{type:Array},sort:{reflect:!0},direction:{reflect:!0},selectable:{type:Boolean,reflect:!0},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean,reflect:!0},resourceRows:{attribute:"resource-rows",reflect:!0},_slotted:{state:!0},_inTable:{state:!0}},Mr.styles=[E,x`
1503
1607
  :host { display: block; }
1504
1608
  slot { display: none; } /* <option> children are column data, not content */
1505
1609
  .bar {
@@ -1545,7 +1649,7 @@ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(
1545
1649
  :host([resource-rows='selectable']) .bar:not(.sel) { padding-inline-start: calc(var(--cm-space-10) + 18px + var(--cm-space-10)); }
1546
1650
  :host([resource-rows]) .bar.sel { grid-template-columns: calc(18px + var(--cm-space-10) - var(--cm-space-20)) var(--cm-table-columns, var(--_cols)); }
1547
1651
  }
1548
- `];g("cm-table-header",Ds);var Dv=M("dataTable",{empty:"No data",sorted:"Sorted by {column}, {direction}"}),op=!1,Ju=`
1652
+ `];w("cm-table-header",Mr);var H0=C("dataTable",{empty:"No data",sorted:"Sorted by {column}, {direction}"}),$m=!1,Wg=`
1549
1653
  cm-data-table > table { width: 100%; border-collapse: separate; border-spacing: 0; font: inherit; font-size: 14px; line-height: 1.5; color: var(--cm-text-default); }
1550
1654
  cm-data-table > table caption { text-align: start; font-weight: 500; font-size: 16px; padding-block-end: var(--cm-space-10); }
1551
1655
  cm-data-table > table th { font-size: 12px; font-weight: 400; text-align: start; padding: 7px var(--cm-space-20); background: var(--cm-bg-hover); border-block: var(--cm-border-1) solid var(--cm-border-subtle); white-space: nowrap; }
@@ -1561,22 +1665,22 @@ cm-data-table > table th > button.cm-sort:hover cm-icon, cm-data-table > table t
1561
1665
  cm-data-table > table th > button.cm-sort:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1562
1666
  @media (forced-colors: active) { cm-data-table > table th > button.cm-sort cm-icon { opacity: 1; } }
1563
1667
  cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-data-table > table [data-type='money'] { text-align: end; font-variant-numeric: tabular-nums; }
1564
- `;function Zu(){if(op||typeof document>"u")return;op=!0;let n=new CSSStyleSheet;n.replaceSync(Ju),document.adoptedStyleSheets=[...document.adoptedStyleSheets,n]}var Qu=n=>(n.align??(n.type==="numeric"||n.type==="money"?"end":"start"))==="end";function lp(n){if(typeof n=="number")return n;let r=String(n??"").trim(),e=/^\(.*\)$/.test(r)||/^-|^[^\d]*-\s*\d/.test(r),t=r.match(/\d[\d,]*(?:\.\d+)?/);if(!t)return NaN;let i=Number(t[0].replace(/,/g,""));return e?-i:i}var cp=n=>n instanceof Date?n.getTime():typeof n=="number"?n:Date.parse(String(n??"")),dp=new Map;function em(n){let r=dp.get(n??"");if(!r){try{r=new Intl.Collator(n,{numeric:!0,sensitivity:"base"})}catch{r=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"})}dp.set(n??"",r)}return r}function hp(n,r,e,t){let i=a=>a==null||a==="";return i(n)||i(r)?i(n)===i(r)?0:i(n)?1:-1:e==="numeric"||e==="money"?(lp(n)||0)-(lp(r)||0):e==="date"?(cp(n)||0)-(cp(r)||0):em(t).compare(String(n),String(r))}var Hs,ja,q,Yc,Wc,pp,Xc,up,mp,ll,Ns,Rs=class extends k{constructor(){super(...arguments);p(this,q);this.columns=[];this.rows=[];this.totals=null;this.caption="";this.captionHidden=!1;this.sort="";this.direction="ascending";this.sortMode="auto";this.stickyHeader=!1;this.stickyFirstColumn=!1;this.loading=!1;this.loadingRows=5;this._light=!1;this._announce="";p(this,Hs,!1);p(this,ja,new MutationObserver(()=>o(this,q,Yc).call(this)))}connectedCallback(){super.connectedCallback(),o(this,q,Yc).call(this),s(this,ja).observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,ja).disconnect()}get sortedRows(){let e=[...this.rows??[]],t=this.columns.find(a=>a.key===this.sort);if(!t||this.sortMode==="manual")return e;let i=this.direction==="descending"?-1:1;return e.map((a,c)=>[a,c]).sort(([a,c],[h,u])=>{let m=a[t.key],y=h[t.key],v=m==null||m==="",E=y==null||y==="";return v||E?v===E?c-u:v?1:-1:i*hp(m,y,t.type,this.locale)||c-u}).map(([a])=>a)}updated(e){if(s(this,Hs)&&(e.has("sort")||e.has("direction"))&&this.sort){f(this,Hs,!1);let t=this.columns.find(i=>i.key===this.sort);t&&o(this,q,Wc).call(this,t.label,this.direction)}}render(){let e=l`<span class="sr" role="status">${this._announce}</span>`;if(this._light)return l`<div class="scroll" part="scroll"><slot></slot></div>${e}`;let t=this.columns??[],i=this.sortedRows,a=Math.max(1,t.length),c=!this.loading&&i.length===0;return l`
1565
- <div class="scroll" part="scroll" tabindex=${this.stickyHeader||this.stickyFirstColumn?"0":d}
1566
- role=${this.stickyHeader||this.stickyFirstColumn?"region":d}
1567
- aria-label=${(this.stickyHeader||this.stickyFirstColumn)&&this.caption?this.caption:d}>
1668
+ `;function Yg(){if($m||typeof document>"u")return;$m=!0;let o=new CSSStyleSheet;o.replaceSync(Wg),document.adoptedStyleSheets=[...document.adoptedStyleSheets,o]}var Gg=o=>(o.align??(o.type==="numeric"||o.type==="money"?"end":"start"))==="end";function km(o){if(typeof o=="number")return o;let n=String(o??"").trim(),e=/^\(.*\)$/.test(n)||/^-|^[^\d]*-\s*\d/.test(n),t=n.match(/\d[\d,]*(?:\.\d+)?/);if(!t)return NaN;let i=Number(t[0].replace(/,/g,""));return e?-i:i}var Em=o=>o instanceof Date?o.getTime():typeof o=="number"?o:Date.parse(String(o??"")),Mm=new Map;function Xg(o){let n=Mm.get(o??"");if(!n){try{n=new Intl.Collator(o,{numeric:!0,sensitivity:"base"})}catch{n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"})}Mm.set(o??"",n)}return n}function Tm(o,n,e,t){let i=r=>r==null||r==="";return i(o)||i(n)?i(o)===i(n)?0:i(o)?1:-1:e==="numeric"||e==="money"?(km(o)||0)-(km(n)||0):e==="date"?(Em(o)||0)-(Em(n)||0):Xg(t).compare(String(o),String(n))}var _r,Wn,W,Fh,jh,Cm,Vh,_m,Lm,Hc,Tr,Cr=class extends T{constructor(){super(...arguments);u(this,W);this.columns=[];this.rows=[];this.totals=null;this.caption="";this.captionHidden=!1;this.sort="";this.direction="ascending";this.sortMode="auto";this.stickyHeader=!1;this.stickyFirstColumn=!1;this.loading=!1;this.loadingRows=5;this._light=!1;this._announce="";u(this,_r,!1);u(this,Wn,new MutationObserver(()=>a(this,W,Fh).call(this)))}connectedCallback(){super.connectedCallback(),a(this,W,Fh).call(this),s(this,Wn).observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,Wn).disconnect()}get sortedRows(){let e=[...this.rows??[]],t=this.columns.find(r=>r.key===this.sort);if(!t||this.sortMode==="manual")return e;let i=this.direction==="descending"?-1:1;return e.map((r,l)=>[r,l]).sort(([r,l],[d,p])=>{let m=r[t.key],v=d[t.key],b=m==null||m==="",$=v==null||v==="";return b||$?b===$?l-p:b?1:-1:i*Tm(m,v,t.type,this.locale)||l-p}).map(([r])=>r)}updated(e){if(s(this,_r)&&(e.has("sort")||e.has("direction"))&&this.sort){g(this,_r,!1);let t=this.columns.find(i=>i.key===this.sort);t&&a(this,W,jh).call(this,t.label,this.direction)}}render(){let e=c`<span class="sr" role="status">${this._announce}</span>`;if(this._light)return c`<div class="scroll" part="scroll"><slot></slot></div>${e}`;let t=this.columns??[],i=this.sortedRows,r=Math.max(1,t.length),l=!this.loading&&i.length===0;return c`
1669
+ <div class="scroll" part="scroll" tabindex=${this.stickyHeader||this.stickyFirstColumn?"0":h}
1670
+ role=${this.stickyHeader||this.stickyFirstColumn?"region":h}
1671
+ aria-label=${(this.stickyHeader||this.stickyFirstColumn)&&this.caption?this.caption:h}>
1568
1672
  <table part="table" aria-busy=${this.loading?"true":"false"}>
1569
- ${this.caption?l`<caption part="caption">${this.caption}</caption>`:d}
1570
- <thead><tr>${t.map(h=>{let u=this.sort===h.key,m=u?this.direction:"none",y=h.hidden?l`<span class="sr">${h.label}</span>`:h.label;return l`<th scope="col" class=${o(this,q,Ns).call(this,h)} aria-sort=${h.sortable?m:d}>${h.sortable?l`<button type="button" class=${u?"on":""} @click=${()=>o(this,q,mp).call(this,h)}>${y}<cm-icon
1571
- name=${u&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:y}</th>`})}</tr></thead>
1673
+ ${this.caption?c`<caption part="caption">${this.caption}</caption>`:h}
1674
+ <thead><tr>${t.map(d=>{let p=this.sort===d.key,m=p?this.direction:"none",v=d.hidden?c`<span class="sr">${d.label}</span>`:d.label;return c`<th scope="col" class=${a(this,W,Tr).call(this,d)} aria-sort=${d.sortable?m:h}>${d.sortable?c`<button type="button" class=${p?"on":""} @click=${()=>a(this,W,Lm).call(this,d)}>${v}<cm-icon
1675
+ name=${p&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:v}</th>`})}</tr></thead>
1572
1676
  <tbody>
1573
- ${this.loading?Array.from({length:Math.max(1,this.loadingRows)},()=>l`<tr>${t.map(h=>l`<td class=${o(this,q,Ns).call(this,h)}><cm-skeleton></cm-skeleton></td>`)}</tr>`):i.map(h=>l`<tr part="row">${t.map((u,m)=>m===0?l`<th scope="row" class=${o(this,q,Ns).call(this,u)} part="cell">${o(this,q,ll).call(this,h[u.key])}</th>`:l`<td class=${o(this,q,Ns).call(this,u)} part="cell">${o(this,q,ll).call(this,h[u.key])}</td>`)}</tr>`)}
1574
- ${c?l`<tr class="empty"><td colspan=${a}><slot name="empty">${this.t("empty")}</slot></td></tr>`:d}
1677
+ ${this.loading?Array.from({length:Math.max(1,this.loadingRows)},()=>c`<tr>${t.map(d=>c`<td class=${a(this,W,Tr).call(this,d)}><cm-skeleton></cm-skeleton></td>`)}</tr>`):i.map(d=>c`<tr part="row">${t.map((p,m)=>m===0?c`<th scope="row" class=${a(this,W,Tr).call(this,p)} part="cell">${a(this,W,Hc).call(this,d[p.key])}</th>`:c`<td class=${a(this,W,Tr).call(this,p)} part="cell">${a(this,W,Hc).call(this,d[p.key])}</td>`)}</tr>`)}
1678
+ ${l?c`<tr class="empty"><td colspan=${r}><slot name="empty">${this.t("empty")}</slot></td></tr>`:h}
1575
1679
  </tbody>
1576
- ${this.totals&&!this.loading&&!c?l`<tfoot><tr part="totals">${t.map(h=>l`<td class=${o(this,q,Ns).call(this,h)}>${o(this,q,ll).call(this,this.totals[h.key])}</td>`)}</tr></tfoot>`:d}
1680
+ ${this.totals&&!this.loading&&!l?c`<tfoot><tr part="totals">${t.map(d=>c`<td class=${a(this,W,Tr).call(this,d)}>${a(this,W,Hc).call(this,this.totals[d.key])}</td>`)}</tr></tfoot>`:h}
1577
1681
  </table>
1578
1682
  </div>${e}
1579
- `}};Hs=new WeakMap,ja=new WeakMap,q=new WeakSet,Yc=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(Zu(),o(this,q,pp).call(this))},Wc=function(e,t){this._announce=this.t("sorted",{column:e,direction:this.t(t)})},pp=function(){let e=this.querySelector(":scope > table"),t=e?.tHead?.rows[0]?.cells;t&&[...t].forEach((i,a)=>{if(!i.dataset.sort||i.querySelector(":scope > button.cm-sort"))return;i.dataset.type=i.dataset.sort;let c=document.createElement("button");c.type="button",c.className="cm-sort",c.append(...i.childNodes);let h=document.createElement("cm-icon");h.setAttribute("size","12"),c.append(h),i.append(c),i.hasAttribute("aria-sort")||i.setAttribute("aria-sort","none"),o(this,q,Xc).call(this,i),c.addEventListener("click",()=>o(this,q,up).call(this,e,i,a))})},Xc=function(e){e.querySelector(":scope > button.cm-sort > cm-icon")?.setAttribute("name",e.getAttribute("aria-sort")==="descending"?"chevron-down":"chevron-up")},up=function(e,t,i){let a=(t.querySelector(":scope > button.cm-sort")?.textContent??"").trim(),c=t.dataset.key||a,h=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending",u=new CustomEvent("cm-sort",{detail:{key:c,direction:h},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(u)||this.sortMode==="manual")return;let m=t.dataset.sort,y=h==="descending"?-1:1;for(let v of e.tBodies){let E=T=>{let D=T.cells[i];return D?(D.dataset.value??D.textContent??"").trim():""},$=[...v.rows].map((T,D)=>[T,E(T),D]).sort(([,T,D],[,P,j])=>T===""||P===""?T===P?D-j:T===""?1:-1:y*hp(T,P,m,this.locale)||D-j);v.append(...$.map(([T])=>T))}for(let v of e.tHead.rows[0].cells)v.dataset.sort&&(v.setAttribute("aria-sort",v===t?h:"none"),o(this,q,Xc).call(this,v));o(this,q,Wc).call(this,a,h)},mp=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending",i=new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0,cancelable:!0}),a=this.dispatchEvent(i);f(this,Hs,a),a&&this.sortMode!=="manual"&&(this.sort=e.key,this.direction=t)},ll=function(e){return e==null?"":e instanceof Date?Z(e,{},this.locale):String(e)},Ns=function(e){return`${Qu(e)?"end":""} ${e.type==="numeric"||e.type==="money"?"num":""}`},Rs.properties={columns:{type:Array},rows:{type:Array},totals:{type:Object},caption:{},captionHidden:{type:Boolean,attribute:"caption-hidden",reflect:!0},sort:{reflect:!0},direction:{reflect:!0},sortMode:{attribute:"sort-mode",reflect:!0},stickyHeader:{type:Boolean,attribute:"sticky-header",reflect:!0},stickyFirstColumn:{type:Boolean,attribute:"sticky-first-column",reflect:!0},loading:{type:Boolean,reflect:!0},loadingRows:{type:Number,attribute:"loading-rows"},_light:{state:!0},_announce:{state:!0}},Rs.styles=[w,b`
1683
+ `}};_r=new WeakMap,Wn=new WeakMap,W=new WeakSet,Fh=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(Yg(),a(this,W,Cm).call(this))},jh=function(e,t){this._announce=this.t("sorted",{column:e,direction:this.t(t)})},Cm=function(){let e=this.querySelector(":scope > table"),t=e?.tHead?.rows[0]?.cells;t&&[...t].forEach((i,r)=>{if(!i.dataset.sort||i.querySelector(":scope > button.cm-sort"))return;i.dataset.type=i.dataset.sort;let l=document.createElement("button");l.type="button",l.className="cm-sort",l.append(...i.childNodes);let d=document.createElement("cm-icon");d.setAttribute("size","12"),l.append(d),i.append(l),i.hasAttribute("aria-sort")||i.setAttribute("aria-sort","none"),a(this,W,Vh).call(this,i),l.addEventListener("click",()=>a(this,W,_m).call(this,e,i,r))})},Vh=function(e){e.querySelector(":scope > button.cm-sort > cm-icon")?.setAttribute("name",e.getAttribute("aria-sort")==="descending"?"chevron-down":"chevron-up")},_m=function(e,t,i){let r=(t.querySelector(":scope > button.cm-sort")?.textContent??"").trim(),l=t.dataset.key||r,d=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending",p=new CustomEvent("cm-sort",{detail:{key:l,direction:d},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(p)||this.sortMode==="manual")return;let m=t.dataset.sort,v=d==="descending"?-1:1;for(let b of e.tBodies){let $=M=>{let A=M.cells[i];return A?(A.dataset.value??A.textContent??"").trim():""},y=[...b.rows].map((M,A)=>[M,$(M),A]).sort(([,M,A],[,I,B])=>M===""||I===""?M===I?A-B:M===""?1:-1:v*Tm(M,I,m,this.locale)||A-B);b.append(...y.map(([M])=>M))}for(let b of e.tHead.rows[0].cells)b.dataset.sort&&(b.setAttribute("aria-sort",b===t?d:"none"),a(this,W,Vh).call(this,b));a(this,W,jh).call(this,r,d)},Lm=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending",i=new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0,cancelable:!0}),r=this.dispatchEvent(i);g(this,_r,r),r&&this.sortMode!=="manual"&&(this.sort=e.key,this.direction=t)},Hc=function(e){return e==null?"":e instanceof Date?ee(e,{},this.locale):String(e)},Tr=function(e){return`${Gg(e)?"end":""} ${e.type==="numeric"||e.type==="money"?"num":""}`},Cr.properties={columns:{type:Array},rows:{type:Array},totals:{type:Object},caption:{},captionHidden:{type:Boolean,attribute:"caption-hidden",reflect:!0},sort:{reflect:!0},direction:{reflect:!0},sortMode:{attribute:"sort-mode",reflect:!0},stickyHeader:{type:Boolean,attribute:"sticky-header",reflect:!0},stickyFirstColumn:{type:Boolean,attribute:"sticky-first-column",reflect:!0},loading:{type:Boolean,reflect:!0},loadingRows:{type:Number,attribute:"loading-rows"},_light:{state:!0},_announce:{state:!0}},Cr.styles=[E,x`
1580
1684
  :host { display: block; font-size: 14px; line-height: 1.5; }
1581
1685
  .scroll { overflow: auto; max-block-size: var(--cm-data-table-max-height, none); }
1582
1686
  .scroll:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
@@ -1613,18 +1717,18 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1613
1717
  .empty td { padding: var(--cm-space-20); border-block-end: 0; }
1614
1718
  .light { display: contents; }
1615
1719
  @media (forced-colors: active) { button cm-icon { opacity: 1; } }
1616
- `];g("cm-data-table",Rs);var Is=class extends _{constructor(){super(...arguments);this.value="";this.icon="";this.href="";this.disabled=!1;this.critical=!1}render(){return null}toItem(){let e=(this.textContent??"").trim();return{label:e,value:this.value||e,icon:this.icon||void 0,href:this.href||void 0,disabled:this.disabled||void 0,critical:this.critical||void 0}}};Is.properties={value:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},disabled:{type:Boolean,reflect:!0},critical:{type:Boolean,reflect:!0}},Is.styles=b`:host { display: none; }`;g("cm-menu-item",Is);function Fa(n){let r=[];for(let e of Array.from(n.children))if(e.localName==="cm-menu-item"){let t=(e.textContent??"").trim(),i=a=>e.getAttribute(a)||void 0;r.push({label:t,value:i("value")??t,icon:i("icon"),href:i("href"),disabled:e.hasAttribute("disabled")||void 0,critical:e.hasAttribute("critical")||void 0})}else e.localName==="hr"&&r.push({divider:!0});return r}function cl(n,r){let e=new MutationObserver(r);return e.observe(n,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),e}var Vv=M("actionMenu",{label:"Actions"}),Va,Ps,mi,Ua,I,dl,Ka,Jc,hl,pl,ul,Ga,Ya,Os,ml,fp,bp,qs=class extends k{constructor(){super(...arguments);p(this,I);this.items=[];this.open=!1;this.triggerLabel="";this.iconOnly=!1;this.icon="more";this.align="start";this.heading="";this.subheading="";this._slotted=[];this._active=-1;this._custom=!1;p(this,Va);p(this,Ps,L("cm-menu"));p(this,mi,"");p(this,Ua,0);p(this,Ka,e=>{this.open&&!e.composedPath().includes(this)&&o(this,I,pl).call(this,!1)});p(this,Ga,e=>{e.key==="ArrowDown"?(e.preventDefault(),this.show("first")):e.key==="ArrowUp"?(e.preventDefault(),this.show("last")):e.key==="Escape"&&this.open&&(e.preventDefault(),e.stopPropagation(),this.hide(!0))});p(this,Ya,()=>{this.open?this.hide():this.show()});p(this,ml,e=>{let t=o(this,I,hl).call(this),i=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),o(this,I,Os).call(this,t[(i+1)%t.length]);break;case"ArrowUp":e.preventDefault(),o(this,I,Os).call(this,t[(i-1+t.length)%t.length]);break;case"Home":e.preventDefault(),o(this,I,Os).call(this,t[0]);break;case"End":e.preventDefault(),o(this,I,Os).call(this,t[t.length-1]);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.hide(!0);break;case"Tab":this.hide();break;default:if(e.key.length===1&&/\S/.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let a=Date.now();f(this,mi,(a-s(this,Ua)<600?s(this,mi):"")+e.key.toLowerCase()),f(this,Ua,a);let c=this.menuItems,h=s(this,mi).length>1?i:i+1,m=[...t.slice(Math.max(h,0)),...t.slice(0,Math.max(h,0))].find(y=>(c[y].label??"").toLowerCase().startsWith(s(this,mi)));m!==void 0&&o(this,I,Os).call(this,m)}}})}connectedCallback(){super.connectedCallback(),o(this,I,dl).call(this),f(this,Va,cl(this,()=>o(this,I,dl).call(this))),document.addEventListener("pointerdown",s(this,Ka),!0)}disconnectedCallback(){super.disconnectedCallback(),s(this,Va)?.disconnect(),document.removeEventListener("pointerdown",s(this,Ka),!0)}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=o(this,I,hl).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,o(this,I,pl).call(this,!0),this.updateComplete.then(()=>o(this,I,ul).call(this))}hide(e=!1){o(this,I,pl).call(this,!1),e&&o(this,I,Jc).call(this)?.focus()}updated(e){if(this._custom){let t=o(this,I,Jc).call(this);if(t){let i=(a,c)=>{t.getAttribute(a)!==c&&t.setAttribute(a,c)};i("aria-haspopup","menu"),i("aria-expanded",String(this.open)),i("aria-controls",`${s(this,Ps)}-m`)}}if(e.has("open")&&this.open&&this._active<0){let t=o(this,I,hl).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>o(this,I,ul).call(this))}}render(){let e=this.menuItems,t=this.triggerLabel||this.label,i=this._custom?l`<slot name="trigger" @click=${s(this,Ya)} @keydown=${s(this,Ga)} @slotchange=${()=>o(this,I,dl).call(this)}></slot>`:l`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
1617
- aria-expanded=${String(this.open)} aria-controls="${s(this,Ps)}-m" aria-label=${this.iconOnly?t:d}
1618
- @click=${s(this,Ya)} @keydown=${s(this,Ga)}>${this.iconOnly?l`<cm-icon name=${this.icon} size="18"></cm-icon>`:l`<span>${t}</span><cm-icon name="chevron-down" size="14"></cm-icon>`}</button>`;return l`${i}
1720
+ `];w("cm-data-table",Cr);var Lr=class extends L{constructor(){super(...arguments);this.value="";this.icon="";this.href="";this.disabled=!1;this.critical=!1}render(){return null}toItem(){let e=(this.textContent??"").trim();return{label:e,value:this.value||e,icon:this.icon||void 0,href:this.href||void 0,disabled:this.disabled||void 0,critical:this.critical||void 0}}};Lr.properties={value:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},disabled:{type:Boolean,reflect:!0},critical:{type:Boolean,reflect:!0}},Lr.styles=x`:host { display: none; }`;w("cm-menu-item",Lr);function Yn(o){let n=[];for(let e of Array.from(o.children))if(e.localName==="cm-menu-item"){let t=(e.textContent??"").trim(),i=r=>e.getAttribute(r)||void 0;n.push({label:t,value:i("value")??t,icon:i("icon"),href:i("href"),disabled:e.hasAttribute("disabled")||void 0,critical:e.hasAttribute("critical")||void 0})}else e.localName==="hr"&&n.push({divider:!0});return n}function Ic(o,n){let e=new MutationObserver(n);return e.observe(o,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),e}var W0=C("actionMenu",{label:"Actions"}),Gn,Dr,Gi,Xn,j,Pc,Jn,Uh,Oc,qc,Bc,Zn,Qn,Sr,Fc,Sm,zm,zr=class extends T{constructor(){super(...arguments);u(this,j);this.items=[];this.open=!1;this.triggerLabel="";this.iconOnly=!1;this.icon="more";this.align="start";this.heading="";this.subheading="";this._slotted=[];this._active=-1;this._custom=!1;u(this,Gn);u(this,Dr,D("cm-menu"));u(this,Gi,"");u(this,Xn,0);u(this,Jn,e=>{this.open&&!e.composedPath().includes(this)&&a(this,j,qc).call(this,!1)});u(this,Zn,e=>{e.key==="ArrowDown"?(e.preventDefault(),this.show("first")):e.key==="ArrowUp"?(e.preventDefault(),this.show("last")):e.key==="Escape"&&this.open&&(e.preventDefault(),e.stopPropagation(),this.hide(!0))});u(this,Qn,()=>{this.open?this.hide():this.show()});u(this,Fc,e=>{let t=a(this,j,Oc).call(this),i=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),a(this,j,Sr).call(this,t[(i+1)%t.length]);break;case"ArrowUp":e.preventDefault(),a(this,j,Sr).call(this,t[(i-1+t.length)%t.length]);break;case"Home":e.preventDefault(),a(this,j,Sr).call(this,t[0]);break;case"End":e.preventDefault(),a(this,j,Sr).call(this,t[t.length-1]);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.hide(!0);break;case"Tab":this.hide();break;default:if(e.key.length===1&&/\S/.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let r=Date.now();g(this,Gi,(r-s(this,Xn)<600?s(this,Gi):"")+e.key.toLowerCase()),g(this,Xn,r);let l=this.menuItems,d=s(this,Gi).length>1?i:i+1,m=[...t.slice(Math.max(d,0)),...t.slice(0,Math.max(d,0))].find(v=>(l[v].label??"").toLowerCase().startsWith(s(this,Gi)));m!==void 0&&a(this,j,Sr).call(this,m)}}})}connectedCallback(){super.connectedCallback(),a(this,j,Pc).call(this),g(this,Gn,Ic(this,()=>a(this,j,Pc).call(this))),document.addEventListener("pointerdown",s(this,Jn),!0)}disconnectedCallback(){super.disconnectedCallback(),s(this,Gn)?.disconnect(),document.removeEventListener("pointerdown",s(this,Jn),!0)}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=a(this,j,Oc).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,a(this,j,qc).call(this,!0),this.updateComplete.then(()=>a(this,j,Bc).call(this))}hide(e=!1){a(this,j,qc).call(this,!1),e&&a(this,j,Uh).call(this)?.focus()}updated(e){if(this._custom){let t=a(this,j,Uh).call(this);if(t){let i=(r,l)=>{t.getAttribute(r)!==l&&t.setAttribute(r,l)};i("aria-haspopup","menu"),i("aria-expanded",String(this.open)),i("aria-controls",`${s(this,Dr)}-m`)}}if(e.has("open")&&this.open&&this._active<0){let t=a(this,j,Oc).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>a(this,j,Bc).call(this))}}render(){let e=this.menuItems,t=this.triggerLabel||this.label,i=this._custom?c`<slot name="trigger" @click=${s(this,Qn)} @keydown=${s(this,Zn)} @slotchange=${()=>a(this,j,Pc).call(this)}></slot>`:c`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
1721
+ aria-expanded=${String(this.open)} aria-controls="${s(this,Dr)}-m" aria-label=${this.iconOnly?t:h}
1722
+ @click=${s(this,Qn)} @keydown=${s(this,Zn)}>${this.iconOnly?c`<cm-icon name=${this.icon} size="18"></cm-icon>`:c`<span>${t}</span><cm-icon name="chevron-down" size="14"></cm-icon>`}</button>`;return c`${i}
1619
1723
  <div class="pop" part="menu" ?hidden=${!this.open}>
1620
- ${this.heading?l`<div class="head" part="heading"><strong>${this.heading}</strong>${this.subheading?l`<span>${this.subheading}</span>`:d}</div>`:d}
1621
- <div role="menu" id="${s(this,Ps)}-m" aria-label=${this.heading||this.label} @keydown=${s(this,ml)}>
1622
- ${e.map((a,c)=>o(this,I,bp).call(this,a,c))}
1724
+ ${this.heading?c`<div class="head" part="heading"><strong>${this.heading}</strong>${this.subheading?c`<span>${this.subheading}</span>`:h}</div>`:h}
1725
+ <div role="menu" id="${s(this,Dr)}-m" aria-label=${this.heading||this.label} @keydown=${s(this,Fc)}>
1726
+ ${e.map((r,l)=>a(this,j,zm).call(this,r,l))}
1623
1727
  </div>
1624
1728
  </div>
1625
- <slot hidden></slot>`}};Va=new WeakMap,Ps=new WeakMap,mi=new WeakMap,Ua=new WeakMap,I=new WeakSet,dl=function(){this._slotted=Fa(this),this._custom=!!this.querySelector(':scope > [slot="trigger"]')},Ka=new WeakMap,Jc=function(){return this._custom?this.querySelector(':scope > [slot="trigger"]'):this.renderRoot.querySelector(".trigger")},hl=function(){return this.menuItems.map((e,t)=>!e.divider&&!e.disabled?t:-1).filter(e=>e>=0)},pl=function(e){this.open!==e&&(this.open=e,e||(this._active=-1),this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:e},bubbles:!0,composed:!0})))},ul=function(){this.renderRoot.querySelector(`[data-i="${this._active}"]`)?.focus()},Ga=new WeakMap,Ya=new WeakMap,Os=function(e){this._active=e,this.updateComplete.then(()=>o(this,I,ul).call(this))},ml=new WeakMap,fp=function(e,t){if(t.disabled){e.preventDefault();return}let i=this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}));i||e.preventDefault(),this.hide(!t.href||!i)},bp=function(e,t){if(e.divider)return l`<div role="separator"></div>`;let i=`item${e.critical?" critical":""}${t===this._active?" active":""}`,a=l`${e.icon?l`<cm-icon name=${e.icon} size="16"></cm-icon>`:d}<span>${e.label}</span>`,c={over:()=>{e.disabled||(this._active=t)},click:h=>o(this,I,fp).call(this,h,e)};return e.href&&!e.disabled?l`<a class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t} href=${e.href}
1626
- @pointerenter=${c.over} @click=${c.click}>${a}</a>`:l`<button type="button" class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t}
1627
- aria-disabled=${e.disabled?"true":d} @pointerenter=${c.over} @click=${c.click}>${a}</button>`},qs.properties={items:{type:Array},open:{type:Boolean,reflect:!0},label:{string:"label"},triggerLabel:{attribute:"trigger-label"},iconOnly:{type:Boolean,attribute:"icon-only"},icon:{},align:{reflect:!0},heading:{},subheading:{},_slotted:{state:!0},_active:{state:!0},_custom:{state:!0}},qs.styles=[w,b`
1729
+ <slot hidden></slot>`}};Gn=new WeakMap,Dr=new WeakMap,Gi=new WeakMap,Xn=new WeakMap,j=new WeakSet,Pc=function(){this._slotted=Yn(this),this._custom=!!this.querySelector(':scope > [slot="trigger"]')},Jn=new WeakMap,Uh=function(){return this._custom?this.querySelector(':scope > [slot="trigger"]'):this.renderRoot.querySelector(".trigger")},Oc=function(){return this.menuItems.map((e,t)=>!e.divider&&!e.disabled?t:-1).filter(e=>e>=0)},qc=function(e){this.open!==e&&(this.open=e,e||(this._active=-1),this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:e},bubbles:!0,composed:!0})))},Bc=function(){this.renderRoot.querySelector(`[data-i="${this._active}"]`)?.focus()},Zn=new WeakMap,Qn=new WeakMap,Sr=function(e){this._active=e,this.updateComplete.then(()=>a(this,j,Bc).call(this))},Fc=new WeakMap,Sm=function(e,t){if(t.disabled){e.preventDefault();return}let i=this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}));i||e.preventDefault(),this.hide(!t.href||!i)},zm=function(e,t){if(e.divider)return c`<div role="separator"></div>`;let i=`item${e.critical?" critical":""}${t===this._active?" active":""}`,r=c`${e.icon?c`<cm-icon name=${e.icon} size="16"></cm-icon>`:h}<span>${e.label}</span>`,l={over:()=>{e.disabled||(this._active=t)},click:d=>a(this,j,Sm).call(this,d,e)};return e.href&&!e.disabled?c`<a class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t} href=${e.href}
1730
+ @pointerenter=${l.over} @click=${l.click}>${r}</a>`:c`<button type="button" class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t}
1731
+ aria-disabled=${e.disabled?"true":h} @pointerenter=${l.over} @click=${l.click}>${r}</button>`},zr.properties={items:{type:Array},open:{type:Boolean,reflect:!0},label:{string:"label"},triggerLabel:{attribute:"trigger-label"},iconOnly:{type:Boolean,attribute:"icon-only"},icon:{},align:{reflect:!0},heading:{},subheading:{},_slotted:{state:!0},_active:{state:!0},_custom:{state:!0}},zr.styles=[E,x`
1628
1732
  :host { display: inline-block; position: relative; vertical-align: middle; }
1629
1733
  .trigger {
1630
1734
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 500;
@@ -1657,7 +1761,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1657
1761
  }
1658
1762
  .item.active:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 1px; }
1659
1763
  [role='separator'] { height: 0; margin: 4px 0; border-top: var(--cm-border-1) solid var(--cm-border-default); }
1660
- `];g("cm-action-menu",qs);var Jv=M("resourceItem",{select:"Select {name}"}),Zv=M("resourceList",{resourceName:"item",resourceNamePlural:"items",select:"Select",selectPageHidden:"all {count} {resource} on this page",selectionOptions:"Selection options",selectPage:"Select all {count} on this page",selectAll:"Select all {count} {resource}",selectNone:"Select none",selected:"{count} {resource} selected.",allSelected:"All {count} {resource} selected.",clearSelection:"Clear selection",loading:"Loading {resource}"}),gp=b`
1764
+ `];w("cm-action-menu",zr);var ew=C("resourceItem",{select:"Select {name}"}),tw=C("resourceList",{resourceName:"item",resourceNamePlural:"items",select:"Select",selectPageHidden:"all {count} {resource} on this page",selectionOptions:"Selection options",selectPage:"Select all {count} on this page",selectAll:"Select all {count} {resource}",selectNone:"Select none",selected:"{count} {resource} selected.",allSelected:"All {count} {resource} selected.",clearSelection:"Clear selection",loading:"Loading {resource}"}),Dm=x`
1661
1765
  .check { position: relative; display: inline-flex; flex: none; width: 20px; height: 20px; }
1662
1766
  .check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
1663
1767
  .check input:disabled { cursor: not-allowed; }
@@ -1669,17 +1773,17 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1669
1773
  .dash { width: 50%; height: 2px; background: currentColor; }
1670
1774
  .check input:focus-visible + .box { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1671
1775
  .check input:disabled + .box { border-color: var(--cm-border-default); background: var(--cm-bg-input-filled); }
1672
- `,bl,gl,vp,js=class extends k{constructor(){super();p(this,gl);this.value="";this.selected=!1;this.disabled=!1;this.href="";this.label="";this.selectable=!1;this.columns=!1;p(this,bl,this.attachInternals());s(this,bl).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get name(){return this.label||this.textContent.replace(/\s+/g," ").trim()}toggle(e){if(this.disabled)return;let t=e??!this.selected;t!==this.selected&&(this.selected=t,this.dispatchEvent(new CustomEvent("cm-resource-select",{detail:{value:this.value,selected:t},bubbles:!0,composed:!0})))}render(){return l`
1673
- ${this.href&&!this.disabled?l`<a href=${this.href} part="link"><span class="sr">${this.name}</span></a>`:d}
1674
- <div class="row" part="row" @click=${o(this,gl,vp)}>
1675
- ${this.selectable?l`<span class="check" part="checkbox"><input type="checkbox" aria-label=${this.t("select",{name:this.name})} .checked=${this.selected}
1776
+ `,Vc,Uc,Am,Nr=class extends T{constructor(){super();u(this,Uc);this.value="";this.selected=!1;this.disabled=!1;this.href="";this.label="";this.selectable=!1;this.columns=!1;u(this,Vc,this.attachInternals());s(this,Vc).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get name(){return this.label||this.textContent.replace(/\s+/g," ").trim()}toggle(e){if(this.disabled)return;let t=e??!this.selected;t!==this.selected&&(this.selected=t,this.dispatchEvent(new CustomEvent("cm-resource-select",{detail:{value:this.value,selected:t},bubbles:!0,composed:!0})))}render(){return c`
1777
+ ${this.href&&!this.disabled?c`<a href=${this.href} part="link"><span class="sr">${this.name}</span></a>`:h}
1778
+ <div class="row" part="row" @click=${a(this,Uc,Am)}>
1779
+ ${this.selectable?c`<span class="check" part="checkbox"><input type="checkbox" aria-label=${this.t("select",{name:this.name})} .checked=${this.selected}
1676
1780
  ?disabled=${this.disabled} @change=${e=>this.toggle(e.target.checked)} />
1677
- <span class="box" aria-hidden="true">${this.selected?l`<cm-icon name="check" size="14"></cm-icon>`:d}</span></span>`:d}
1781
+ <span class="box" aria-hidden="true">${this.selected?c`<cm-icon name="check" size="14"></cm-icon>`:h}</span></span>`:h}
1678
1782
  <span class="media"><slot name="media"></slot></span>
1679
1783
  <div class="content" part="content"><slot></slot></div>
1680
1784
  <div class="actions" part="actions"><slot name="actions"></slot></div>
1681
1785
  </div>
1682
- `}};bl=new WeakMap,gl=new WeakSet,vp=function(e){!this.selectable||this.href||this.disabled||e.composedPath().some(i=>i instanceof HTMLElement&&i!==this&&i.matches('a, button, input, select, textarea, label, [role="button"], cm-button'))||getSelection()?.toString()||this.toggle()},js.properties={value:{reflect:!0},selected:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},href:{},label:{},selectable:{type:Boolean,reflect:!0},columns:{type:Boolean,reflect:!0}},js.styles=[w,gp,b`
1786
+ `}};Vc=new WeakMap,Uc=new WeakSet,Am=function(e){!this.selectable||this.href||this.disabled||e.composedPath().some(i=>i instanceof HTMLElement&&i!==this&&i.matches('a, button, input, select, textarea, label, [role="button"], cm-button'))||getSelection()?.toString()||this.toggle()},Nr.properties={value:{reflect:!0},selected:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},href:{},label:{},selectable:{type:Boolean,reflect:!0},columns:{type:Boolean,reflect:!0}},Nr.styles=[E,Dm,x`
1683
1787
  :host { display: block; position: relative; border-bottom: var(--cm-border-1) solid var(--cm-border-default); }
1684
1788
  :host(:last-child) { border-bottom: 0; }
1685
1789
  .row {
@@ -1710,29 +1814,29 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1710
1814
  ::slotted([slot='media']) { width: 34px; height: 34px; }
1711
1815
  ::slotted(cm-thumbnail[slot='media']) { --cm-thumbnail-size: 34px; }
1712
1816
  }
1713
- `];g("cm-resource-item",js);var Wa,Xa,re,xp,Zc,vl,Bs,fl,xl,Fs=class extends k{constructor(){super();p(this,re);this.selectable=!1;this.total=0;this.resourceNamePlural="";this.loading=!1;this.allSelected=!1;this.hideSelectMenu=!1;this.label="";this._count=0;this._rows=0;p(this,Wa,L("cm-rl"));p(this,Xa,new Set);p(this,vl,e=>{let t=e.target;t.parentElement.classList.toggle("has",t.assignedElements().length>0),o(this,re,Zc).call(this,t)});p(this,xl,e=>{e.stopPropagation();let t=e.detail.value;t==="page"?this.selectPage(!0):t==="all"?this.selectAll():t==="none"&&this.clearSelection()});this.addEventListener("cm-resource-select",e=>{e.target!==this&&(this.allSelected=!1,o(this,re,Bs).call(this),o(this,re,fl).call(this))})}get items(){return[...this.querySelectorAll(":scope > cm-resource-item")]}get selected(){return this.items.filter(e=>e.selected).map(e=>e.value)}selectPage(e=!0){this.items.forEach(t=>{t.disabled||(t.selected=e)}),e||(this.allSelected=!1),o(this,re,Bs).call(this),o(this,re,fl).call(this)}selectAll(){this.items.forEach(e=>{e.disabled||(e.selected=!0)}),this.allSelected=!0,o(this,re,Bs).call(this),o(this,re,fl).call(this)}clearSelection(){this.selectPage(!1)}updated(e){e.has("selectable")&&(o(this,re,Bs).call(this),o(this,re,Zc).call(this))}render(){let e=this._count,t=this._rows,i=this.items.filter(y=>!y.disabled).length,a=i>0&&e>=i,c=o(this,re,xp).call(this),h=y=>Kn(y,this.locale)==="one"?this.resourceName:c,u=this.total>t,m=d;return this.allSelected?m=l`${this.t("allSelected",{count:Math.max(this.total,e),resource:c})} <button type="button" @click=${()=>this.clearSelection()}>${this.t("clearSelection")}</button>`:e&&(m=l`${this.t("selected",{count:e,resource:h(e)})}${a&&u?l` <button type="button" @click=${()=>this.selectAll()}>${this.t("selectAll",{count:this.total,resource:c})}</button>`:d}`),l`
1714
- ${this.selectable?l`<div class="toolbar" part="toolbar">
1817
+ `];w("cm-resource-item",Nr);var eo,to,me,Nm,Kh,Kc,Ar,jc,Wc,Rr=class extends T{constructor(){super();u(this,me);this.selectable=!1;this.total=0;this.resourceNamePlural="";this.loading=!1;this.allSelected=!1;this.hideSelectMenu=!1;this.label="";this._count=0;this._rows=0;u(this,eo,D("cm-rl"));u(this,to,new Set);u(this,Kc,e=>{let t=e.target;t.parentElement.classList.toggle("has",t.assignedElements().length>0),a(this,me,Kh).call(this,t)});u(this,Wc,e=>{e.stopPropagation();let t=e.detail.value;t==="page"?this.selectPage(!0):t==="all"?this.selectAll():t==="none"&&this.clearSelection()});this.addEventListener("cm-resource-select",e=>{e.target!==this&&(this.allSelected=!1,a(this,me,Ar).call(this),a(this,me,jc).call(this))})}get items(){return[...this.querySelectorAll(":scope > cm-resource-item")]}get selected(){return this.items.filter(e=>e.selected).map(e=>e.value)}selectPage(e=!0){this.items.forEach(t=>{t.disabled||(t.selected=e)}),e||(this.allSelected=!1),a(this,me,Ar).call(this),a(this,me,jc).call(this)}selectAll(){this.items.forEach(e=>{e.disabled||(e.selected=!0)}),this.allSelected=!0,a(this,me,Ar).call(this),a(this,me,jc).call(this)}clearSelection(){this.selectPage(!1)}updated(e){e.has("selectable")&&(a(this,me,Ar).call(this),a(this,me,Kh).call(this))}render(){let e=this._count,t=this._rows,i=this.items.filter(v=>!v.disabled).length,r=i>0&&e>=i,l=a(this,me,Nm).call(this),d=v=>bl(v,this.locale)==="one"?this.resourceName:l,p=this.total>t,m=h;return this.allSelected?m=c`${this.t("allSelected",{count:Math.max(this.total,e),resource:l})} <button type="button" @click=${()=>this.clearSelection()}>${this.t("clearSelection")}</button>`:e&&(m=c`${this.t("selected",{count:e,resource:d(e)})}${r&&p?c` <button type="button" @click=${()=>this.selectAll()}>${this.t("selectAll",{count:this.total,resource:l})}</button>`:h}`),c`
1818
+ ${this.selectable?c`<div class="toolbar" part="toolbar">
1715
1819
  <span class="select" part="select">
1716
- <span class="check"><input id="${s(this,Wa)}-all" type="checkbox" .checked=${a} .indeterminate=${e>0&&!a}
1717
- ?disabled=${!i} @change=${y=>this.selectPage(y.target.checked)} />
1718
- <span class="box" aria-hidden="true">${e>0&&!a?l`<span class="dash"></span>`:a?l`<cm-icon name="check" size="12"></cm-icon>`:d}</span></span>
1719
- <label for="${s(this,Wa)}-all">${this.t("select")}<span class="sr"> ${this.t("selectPageHidden",{count:t,resource:h(t)})}</span></label>
1720
- ${this.hideSelectMenu?d:l`<cm-action-menu icon-only icon="chevron-down" part="select-menu" label=${this.t("selectionOptions")}
1721
- .items=${[{label:this.t("selectPage",{count:i}),value:"page",disabled:!i},...u?[{label:this.t("selectAll",{count:this.total,resource:c}),value:"all"}]:[],{label:this.t("selectNone"),value:"none",disabled:!e&&!this.allSelected}]} @cm-select=${s(this,xl)}></cm-action-menu>`}
1820
+ <span class="check"><input id="${s(this,eo)}-all" type="checkbox" .checked=${r} .indeterminate=${e>0&&!r}
1821
+ ?disabled=${!i} @change=${v=>this.selectPage(v.target.checked)} />
1822
+ <span class="box" aria-hidden="true">${e>0&&!r?c`<span class="dash"></span>`:r?c`<cm-icon name="check" size="12"></cm-icon>`:h}</span></span>
1823
+ <label for="${s(this,eo)}-all">${this.t("select")}<span class="sr"> ${this.t("selectPageHidden",{count:t,resource:d(t)})}</span></label>
1824
+ ${this.hideSelectMenu?h:c`<cm-action-menu icon-only icon="chevron-down" part="select-menu" label=${this.t("selectionOptions")}
1825
+ .items=${[{label:this.t("selectPage",{count:i}),value:"page",disabled:!i},...p?[{label:this.t("selectAll",{count:this.total,resource:l}),value:"all"}]:[],{label:this.t("selectNone"),value:"none",disabled:!e&&!this.allSelected}]} @cm-select=${s(this,Wc)}></cm-action-menu>`}
1722
1826
  </span>
1723
1827
  <span class="bulk" ?hidden=${!e}><slot name="bulk-actions"></slot></span>
1724
1828
  <span class="status" part="status" role="status">${m}</span>
1725
1829
  <span class="actions"><slot name="actions"></slot></span>
1726
- </div>`:d}
1727
- <div class="header"><slot name="header" @slotchange=${s(this,vl)}></slot></div>
1830
+ </div>`:h}
1831
+ <div class="header"><slot name="header" @slotchange=${s(this,Kc)}></slot></div>
1728
1832
  <div class="body">
1729
- <div class="list" part="list" role="list" aria-label=${this.label||c.replace(/^./,y=>y.toUpperCase())} aria-busy=${this.loading?"true":"false"}>
1730
- <slot @slotchange=${()=>o(this,re,Bs).call(this)}></slot>
1833
+ <div class="list" part="list" role="list" aria-label=${this.label||l.replace(/^./,v=>v.toUpperCase())} aria-busy=${this.loading?"true":"false"}>
1834
+ <slot @slotchange=${()=>a(this,me,Ar).call(this)}></slot>
1731
1835
  </div>
1732
- ${this.loading?l`<span class="spinner" part="spinner" role="progressbar" aria-label=${this.t("loading",{resource:c})}></span>`:d}
1836
+ ${this.loading?c`<span class="spinner" part="spinner" role="progressbar" aria-label=${this.t("loading",{resource:l})}></span>`:h}
1733
1837
  </div>
1734
1838
  <div class="empty ${t||this.loading?"":"show"}"><slot name="empty"></slot></div>
1735
- `}};Wa=new WeakMap,Xa=new WeakMap,re=new WeakSet,xp=function(){if(this.resourceNamePlural)return this.resourceNamePlural;let e=this.resourceName;return e!==this.t("resourceName")?`${e}s`:this.t("resourceNamePlural")},Zc=function(e=this.renderRoot?.querySelector('slot[name="header"]')){if(!e)return;let t=new Set;for(let i of e.assignedElements())i.localName==="cm-table-header"&&t.add(i),i.querySelectorAll("cm-table-header").forEach(a=>t.add(a));for(let i of s(this,Xa))t.has(i)||i.removeAttribute("resource-rows");for(let i of t)i.setAttribute("resource-rows",this.selectable?"selectable":"plain");f(this,Xa,t)},vl=new WeakMap,Bs=function(){let e=this.items;e.forEach(t=>t.selectable=this.selectable),this._rows=e.length,this._count=e.filter(t=>t.selected).length},fl=function(){this.dispatchEvent(new CustomEvent("cm-selection-change",{detail:{selected:this.selected,all:this.allSelected},bubbles:!0,composed:!0}))},xl=new WeakMap,Fs.properties={selectable:{type:Boolean,reflect:!0},total:{type:Number},resourceName:{attribute:"resource-name",string:"resourceName"},resourceNamePlural:{attribute:"resource-name-plural"},loading:{type:Boolean,reflect:!0},allSelected:{type:Boolean,attribute:"all-selected",reflect:!0},hideSelectMenu:{type:Boolean,attribute:"hide-select-menu"},label:{},_count:{state:!0},_rows:{state:!0}},Fs.styles=[w,gp,b`
1839
+ `}};eo=new WeakMap,to=new WeakMap,me=new WeakSet,Nm=function(){if(this.resourceNamePlural)return this.resourceNamePlural;let e=this.resourceName;return e!==this.t("resourceName")?`${e}s`:this.t("resourceNamePlural")},Kh=function(e=this.renderRoot?.querySelector('slot[name="header"]')){if(!e)return;let t=new Set;for(let i of e.assignedElements())i.localName==="cm-table-header"&&t.add(i),i.querySelectorAll("cm-table-header").forEach(r=>t.add(r));for(let i of s(this,to))t.has(i)||i.removeAttribute("resource-rows");for(let i of t)i.setAttribute("resource-rows",this.selectable?"selectable":"plain");g(this,to,t)},Kc=new WeakMap,Ar=function(){let e=this.items;e.forEach(t=>t.selectable=this.selectable),this._rows=e.length,this._count=e.filter(t=>t.selected).length},jc=function(){this.dispatchEvent(new CustomEvent("cm-selection-change",{detail:{selected:this.selected,all:this.allSelected},bubbles:!0,composed:!0}))},Wc=new WeakMap,Rr.properties={selectable:{type:Boolean,reflect:!0},total:{type:Number},resourceName:{attribute:"resource-name",string:"resourceName"},resourceNamePlural:{attribute:"resource-name-plural"},loading:{type:Boolean,reflect:!0},allSelected:{type:Boolean,attribute:"all-selected",reflect:!0},hideSelectMenu:{type:Boolean,attribute:"hide-select-menu"},label:{},_count:{state:!0},_rows:{state:!0}},Rr.styles=[E,Dm,x`
1736
1840
  :host { display: block; position: relative; background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); }
1737
1841
  .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-20); padding: var(--cm-space-20) var(--cm-space-20) 0; }
1738
1842
  .select {
@@ -1770,20 +1874,20 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1770
1874
  .list { padding: 0 var(--cm-space-10); }
1771
1875
  .spinner { width: 30px; height: 30px; margin: -15px; border-width: 3px; }
1772
1876
  }
1773
- `];g("cm-resource-list",Fs);var ax=M("nestedItem",{reorder:"Reorder {label}",hint:"Press up or down arrow to move.",hintGroup:"Press up or down arrow to move. At either end of the list, the arrow moves it into the list before or after.",moved:"{label} moved to position {position} of {total}.",movedTo:"{label} moved to {list}, position {position} of {total}."}),nx=M("nestedList",{show:"Show {heading}",hide:"Hide {heading}"}),wl,V,Qc,ed,yp,wp,Rt,$p,kp,Ep,td,Mp,qe=class qe extends k{constructor(){super();p(this,V);this.label="";this.value="";this.sortable=!1;this._hasChildren=!1;p(this,wl,this.attachInternals());p(this,Rt,!1);s(this,wl).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get list(){let e=this.parentElement;return e?.localName==="cm-nested-list"?e:null}moveToList(e,t){let i=this.list;if(!i||!e)return!1;if(e===i)return t===void 0?!1:this.moveTo(t);if(!i.group||e.group!==i.group)return!1;let a=e.items,c=Math.max(0,Math.min(a.length,t??a.length)),h={item:this,from:i.items.indexOf(this),to:c,fromList:i,toList:e};return this.dispatchEvent(new CustomEvent("cm-move",{detail:h,bubbles:!0,composed:!0,cancelable:!0}))?(e.insertBefore(this,a[c]??null),e.announce(this.t("movedTo",{label:this.label,list:e.heading,position:c+1,total:a.length+1})),!0):!1}get siblings(){return[...this.parentElement.children].filter(e=>e.localName==="cm-nested-item")}moveTo(e){let t=this.siblings,i=t.indexOf(this);if(e=Math.max(0,Math.min(t.length-1,e)),e===i)return!1;let a=new CustomEvent("cm-reorder",{detail:{item:this,from:i,to:e},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(a))return!1;let c=t[e];return c.parentElement.insertBefore(this,e>i?c.nextSibling:c),this.closest("cm-nested-list")?.announce(this.t("moved",{label:this.label,position:e+1,total:t.length})),!0}render(){return l`
1774
- <div class="row" part="row" @dragover=${o(this,V,Ep)} @dragleave=${o(this,V,td)} @drop=${o(this,V,Mp)}>
1775
- ${this.sortable?l`<button class="handle" type="button" part="handle" draggable="true" aria-label=${this.t("reorder",{label:this.label})}
1877
+ `];w("cm-resource-list",Rr);var lw=C("nestedItem",{reorder:"Reorder {label}",hint:"Press up or down arrow to move.",hintGroup:"Press up or down arrow to move. At either end of the list, the arrow moves it into the list before or after.",moved:"{label} moved to position {position} of {total}.",movedTo:"{label} moved to {list}, position {position} of {total}."}),cw=C("nestedList",{show:"Show {heading}",hide:"Hide {heading}"}),Gc,Z,Wh,Yh,Rm,Hm,fi,Im,Pm,Om,Gh,qm,ot=class ot extends T{constructor(){super();u(this,Z);this.label="";this.value="";this.sortable=!1;this._hasChildren=!1;u(this,Gc,this.attachInternals());u(this,fi,!1);s(this,Gc).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get list(){let e=this.parentElement;return e?.localName==="cm-nested-list"?e:null}moveToList(e,t){let i=this.list;if(!i||!e)return!1;if(e===i)return t===void 0?!1:this.moveTo(t);if(!i.group||e.group!==i.group)return!1;let r=e.items,l=Math.max(0,Math.min(r.length,t??r.length)),d={item:this,from:i.items.indexOf(this),to:l,fromList:i,toList:e};return this.dispatchEvent(new CustomEvent("cm-move",{detail:d,bubbles:!0,composed:!0,cancelable:!0}))?(e.insertBefore(this,r[l]??null),e.announce(this.t("movedTo",{label:this.label,list:e.heading,position:l+1,total:r.length+1})),!0):!1}get siblings(){return[...this.parentElement.children].filter(e=>e.localName==="cm-nested-item")}moveTo(e){let t=this.siblings,i=t.indexOf(this);if(e=Math.max(0,Math.min(t.length-1,e)),e===i)return!1;let r=new CustomEvent("cm-reorder",{detail:{item:this,from:i,to:e},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(r))return!1;let l=t[e];return l.parentElement.insertBefore(this,e>i?l.nextSibling:l),this.closest("cm-nested-list")?.announce(this.t("moved",{label:this.label,position:e+1,total:t.length})),!0}render(){return c`
1878
+ <div class="row" part="row" @dragover=${a(this,Z,Om)} @dragleave=${a(this,Z,Gh)} @drop=${a(this,Z,qm)}>
1879
+ ${this.sortable?c`<button class="handle" type="button" part="handle" draggable="true" aria-label=${this.t("reorder",{label:this.label})}
1776
1880
  aria-describedby="hint"
1777
- @keydown=${o(this,V,yp)} @dragstart=${o(this,V,wp)} @pointerdown=${o(this,V,$p)}
1778
- @dragend=${()=>{this.classList.remove("dragging"),qe.dragged=null,Ja(this,null)}}><cm-icon name="drag" size="18"></cm-icon></button>`:d}
1779
- ${this.sortable?l`<span class="sr" id="hint">${this.t(this.list?.group?"hintGroup":"hint")}</span>`:d}
1881
+ @keydown=${a(this,Z,Rm)} @dragstart=${a(this,Z,Hm)} @pointerdown=${a(this,Z,Im)}
1882
+ @dragend=${()=>{this.classList.remove("dragging"),ot.dragged=null,io(this,null)}}><cm-icon name="drag" size="18"></cm-icon></button>`:h}
1883
+ ${this.sortable?c`<span class="sr" id="hint">${this.t(this.list?.group?"hintGroup":"hint")}</span>`:h}
1780
1884
  <span class="label" part="label">${this.label}</span>
1781
1885
  <span class="actions" part="actions"><slot name="actions"></slot></span>
1782
1886
  </div>
1783
1887
  <div class="children ${this._hasChildren?"has":""}" role="list" aria-label=${this.label}>
1784
1888
  <slot @slotchange=${e=>{let t=e.target.assignedElements().filter(i=>i.localName==="cm-nested-item");t.forEach(i=>i.sortable=this.sortable),this._hasChildren=t.length>0}}></slot>
1785
1889
  </div>
1786
- `}updated(e){e.has("sortable")&&[...this.children].forEach(t=>{t.localName==="cm-nested-item"&&(t.sortable=this.sortable)})}};wl=new WeakMap,V=new WeakSet,Qc=function(){let e=this.list;return e?.group?[...e.getRootNode().querySelectorAll("cm-nested-list")].filter(i=>i===e||i.group===e.group&&i.sortable&&(!i.collapsible||i.open)):[]},ed=function(){let e=()=>this.renderRoot.querySelector(".handle")?.focus();e(),requestAnimationFrame(e)},yp=function(e){let t=this.siblings.indexOf(this),i=e.key==="ArrowUp",a=e.key==="ArrowDown";if(i&&t===0||a&&t===this.siblings.length-1){let h=s(this,V,Qc),u=h[h.indexOf(this.list)+(i?-1:1)];if(u){e.preventDefault(),this.moveToList(u,i?u.items.length:0)&&o(this,V,ed).call(this);return}}let c;if(e.key==="ArrowUp")c=t-1;else if(e.key==="ArrowDown")c=t+1;else if(e.key==="Home")c=0;else if(e.key==="End")c=this.siblings.length-1;else return;e.preventDefault(),this.moveTo(c)&&o(this,V,ed).call(this)},wp=function(e){if(e.stopPropagation(),s(this,Rt)){e.preventDefault();return}qe.dragged=this,this.classList.add("dragging"),e.dataTransfer?.setData("text/plain",this.label),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")},Rt=new WeakMap,$p=function(e){if(e.pointerType==="mouse"||!e.isPrimary)return;let t=e.clientY,i=null,a=h=>{if(h.pointerId===e.pointerId){if(!s(this,Rt)){if(Math.abs(h.clientY-t)<6)return;f(this,Rt,!0),qe.dragged=this,this.classList.add("dragging")}h.preventDefault(),i=o(this,V,kp).call(this,h.clientX,h.clientY),Ja(this,i)}},c=h=>{if(h.pointerId!==e.pointerId)return;document.removeEventListener("pointermove",a,!0),document.removeEventListener("pointerup",c,!0),document.removeEventListener("pointercancel",c,!0);let u=s(this,Rt);f(this,Rt,!1),qe.dragged=null,this.classList.remove("dragging"),Ja(this,null),!(!u||h.type==="pointercancel"||!i)&&(i.list?this.moveToList(i.list,i.index):this.moveTo(i.index))};document.addEventListener("pointermove",a,!0),document.addEventListener("pointerup",c,!0),document.addEventListener("pointercancel",c,!0)},kp=function(e,t){for(let i of s(this,V,Qc)){if(i===this.list)continue;let a=i.getBoundingClientRect();if(e>=a.left&&e<=a.right&&t>=a.top&&t<=a.bottom)return{list:i,index:yl(i.items,this,t)}}return{index:yl(this.siblings,this,t)}},Ep=function(e){let t=qe.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.renderRoot.querySelector(".row").getBoundingClientRect(),a=e.clientY>i.top+i.height/2;this.classList.toggle("drop-after",a),this.classList.toggle("drop-before",!a)},td=function(){this.classList.remove("drop-before","drop-after")},Mp=function(e){let t=qe.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.classList.contains("drop-after");o(this,V,td).call(this);let a=this.siblings,c=a.indexOf(t),h=a.indexOf(this)+(i?1:0);h>c&&(h-=1),t.moveTo(h)},qe.properties={label:{},value:{reflect:!0},sortable:{type:Boolean,reflect:!0},_hasChildren:{state:!0}},qe.styles=[w,b`
1890
+ `}updated(e){e.has("sortable")&&[...this.children].forEach(t=>{t.localName==="cm-nested-item"&&(t.sortable=this.sortable)})}};Gc=new WeakMap,Z=new WeakSet,Wh=function(){let e=this.list;return e?.group?[...e.getRootNode().querySelectorAll("cm-nested-list")].filter(i=>i===e||i.group===e.group&&i.sortable&&(!i.collapsible||i.open)):[]},Yh=function(){let e=()=>this.renderRoot.querySelector(".handle")?.focus();e(),requestAnimationFrame(e)},Rm=function(e){let t=this.siblings.indexOf(this),i=e.key==="ArrowUp",r=e.key==="ArrowDown";if(i&&t===0||r&&t===this.siblings.length-1){let d=s(this,Z,Wh),p=d[d.indexOf(this.list)+(i?-1:1)];if(p){e.preventDefault(),this.moveToList(p,i?p.items.length:0)&&a(this,Z,Yh).call(this);return}}let l;if(e.key==="ArrowUp")l=t-1;else if(e.key==="ArrowDown")l=t+1;else if(e.key==="Home")l=0;else if(e.key==="End")l=this.siblings.length-1;else return;e.preventDefault(),this.moveTo(l)&&a(this,Z,Yh).call(this)},Hm=function(e){if(e.stopPropagation(),s(this,fi)){e.preventDefault();return}ot.dragged=this,this.classList.add("dragging"),e.dataTransfer?.setData("text/plain",this.label),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")},fi=new WeakMap,Im=function(e){if(e.pointerType==="mouse"||!e.isPrimary)return;let t=e.clientY,i=null,r=d=>{if(d.pointerId===e.pointerId){if(!s(this,fi)){if(Math.abs(d.clientY-t)<6)return;g(this,fi,!0),ot.dragged=this,this.classList.add("dragging")}d.preventDefault(),i=a(this,Z,Pm).call(this,d.clientX,d.clientY),io(this,i)}},l=d=>{if(d.pointerId!==e.pointerId)return;document.removeEventListener("pointermove",r,!0),document.removeEventListener("pointerup",l,!0),document.removeEventListener("pointercancel",l,!0);let p=s(this,fi);g(this,fi,!1),ot.dragged=null,this.classList.remove("dragging"),io(this,null),!(!p||d.type==="pointercancel"||!i)&&(i.list?this.moveToList(i.list,i.index):this.moveTo(i.index))};document.addEventListener("pointermove",r,!0),document.addEventListener("pointerup",l,!0),document.addEventListener("pointercancel",l,!0)},Pm=function(e,t){for(let i of s(this,Z,Wh)){if(i===this.list)continue;let r=i.getBoundingClientRect();if(e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom)return{list:i,index:Yc(i.items,this,t)}}return{index:Yc(this.siblings,this,t)}},Om=function(e){let t=ot.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.renderRoot.querySelector(".row").getBoundingClientRect(),r=e.clientY>i.top+i.height/2;this.classList.toggle("drop-after",r),this.classList.toggle("drop-before",!r)},Gh=function(){this.classList.remove("drop-before","drop-after")},qm=function(e){let t=ot.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.classList.contains("drop-after");a(this,Z,Gh).call(this);let r=this.siblings,l=r.indexOf(t),d=r.indexOf(this)+(i?1:0);d>l&&(d-=1),t.moveTo(d)},ot.properties={label:{},value:{reflect:!0},sortable:{type:Boolean,reflect:!0},_hasChildren:{state:!0}},ot.styles=[E,x`
1787
1891
  :host { display: block; }
1788
1892
  .row {
1789
1893
  display: flex; align-items: center; gap: var(--cm-space-15); min-height: 60px; padding: 0 var(--cm-space-20);
@@ -1810,20 +1914,20 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1810
1914
  .actions { gap: var(--cm-space-10); }
1811
1915
  .children { margin-inline-start: var(--cm-space-20); }
1812
1916
  }
1813
- `],qe.dragged=null;var Us=qe;g("cm-nested-item",Us);function yl(n,r,e){return n.filter(t=>{if(t===r)return!1;let i=t.getBoundingClientRect();return i.top+i.height/2<e}).length}function Ja(n,r){if((n.list??n).getRootNode().querySelectorAll("cm-nested-item.drop-before, cm-nested-item.drop-after, cm-nested-list.drop-target").forEach(i=>i.classList.remove("drop-before","drop-after","drop-target")),!r)return;let t=(r.list?r.list.items:n.siblings).filter(i=>i!==n);t.length?r.index<t.length?t[r.index].classList.add("drop-before"):t[t.length-1].classList.add("drop-after"):r.list?.classList.add("drop-target")}var fi,ye,Tp,id,sd,_p,Cp,Vs=class extends k{constructor(){super(...arguments);p(this,ye);this.heading="";this.headingLevel=2;this.sortable=!1;this.collapsible=!1;this.open=!0;this.group="";this._msg="";this._empty=!1;p(this,fi,L("cm-nl"))}get items(){return[...this.children].filter(e=>e.localName==="cm-nested-item")}announce(e){this._msg="",requestAnimationFrame(()=>this._msg=e)}willUpdate(){this.hasUpdated||(this._empty=!this.items.length)}updated(e){(e.has("sortable")||e.has("group"))&&o(this,ye,id).call(this)}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2)),t=!this.collapsible||this.open;return l`
1917
+ `],ot.dragged=null;var Ir=ot;w("cm-nested-item",Ir);function Yc(o,n,e){return o.filter(t=>{if(t===n)return!1;let i=t.getBoundingClientRect();return i.top+i.height/2<e}).length}function io(o,n){if((o.list??o).getRootNode().querySelectorAll("cm-nested-item.drop-before, cm-nested-item.drop-after, cm-nested-list.drop-target").forEach(i=>i.classList.remove("drop-before","drop-after","drop-target")),!n)return;let t=(n.list?n.list.items:o.siblings).filter(i=>i!==o);t.length?n.index<t.length?t[n.index].classList.add("drop-before"):t[t.length-1].classList.add("drop-after"):n.list?.classList.add("drop-target")}var Xi,De,Bm,Xh,Jh,Fm,jm,Hr=class extends T{constructor(){super(...arguments);u(this,De);this.heading="";this.headingLevel=2;this.sortable=!1;this.collapsible=!1;this.open=!0;this.group="";this._msg="";this._empty=!1;u(this,Xi,D("cm-nl"))}get items(){return[...this.children].filter(e=>e.localName==="cm-nested-item")}announce(e){this._msg="",requestAnimationFrame(()=>this._msg=e)}willUpdate(){this.hasUpdated||(this._empty=!this.items.length)}updated(e){(e.has("sortable")||e.has("group"))&&a(this,De,Xh).call(this)}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2)),t=!this.collapsible||this.open;return c`
1814
1918
  <div class="bar" part="bar">
1815
- <div class="title" part="heading" role="heading" aria-level=${e} id="${s(this,fi)}-h">${this.heading}</div>
1919
+ <div class="title" part="heading" role="heading" aria-level=${e} id="${s(this,Xi)}-h">${this.heading}</div>
1816
1920
  <span class="actions"><slot name="actions"></slot></span>
1817
- ${this.collapsible?l`<button class="toggle" type="button" part="toggle" aria-expanded=${t?"true":"false"} aria-controls="${s(this,fi)}-rows"
1818
- aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${o(this,ye,Tp)}>
1819
- <cm-icon name=${t?"chevron-up":"chevron-down"} size="14"></cm-icon></button>`:d}
1921
+ ${this.collapsible?c`<button class="toggle" type="button" part="toggle" aria-expanded=${t?"true":"false"} aria-controls="${s(this,Xi)}-rows"
1922
+ aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${a(this,De,Bm)}>
1923
+ <cm-icon name=${t?"chevron-up":"chevron-down"} size="14"></cm-icon></button>`:h}
1820
1924
  </div>
1821
- <div class="rows ${this.group&&this._empty?"empty":""}" id="${s(this,fi)}-rows" role="list" aria-labelledby="${s(this,fi)}-h" ?hidden=${!t}
1822
- @dragover=${o(this,ye,_p)} @drop=${o(this,ye,Cp)}>
1823
- <slot @slotchange=${()=>{o(this,ye,id).call(this),this._empty=!this.items.length}}></slot>
1925
+ <div class="rows ${this.group&&this._empty?"empty":""}" id="${s(this,Xi)}-rows" role="list" aria-labelledby="${s(this,Xi)}-h" ?hidden=${!t}
1926
+ @dragover=${a(this,De,Fm)} @drop=${a(this,De,jm)}>
1927
+ <slot @slotchange=${()=>{a(this,De,Xh).call(this),this._empty=!this.items.length}}></slot>
1824
1928
  </div>
1825
1929
  <span class="sr" role="status">${this._msg}</span>
1826
- `}};fi=new WeakMap,ye=new WeakSet,Tp=function(){this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:this.open},bubbles:!0,composed:!0}))},id=function(){this.items.forEach(t=>{t.sortable=this.sortable,t.requestUpdate()})},sd=function(e){let t=e?.list;return!!e&&!!t&&t!==this&&!!this.group&&t.group===this.group&&this.sortable&&(!this.collapsible||this.open)},_p=function(e){let t=Us.dragged;o(this,ye,sd).call(this,t)&&(e.preventDefault(),Ja(t,{list:this,index:yl(this.items,t,e.clientY)}))},Cp=function(e){let t=Us.dragged;if(!o(this,ye,sd).call(this,t))return;e.preventDefault();let i=yl(this.items,t,e.clientY);Ja(t,null),t.moveToList(this,i)},Vs.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"},sortable:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},group:{reflect:!0},_msg:{state:!0},_empty:{state:!0}},Vs.styles=[w,b`
1930
+ `}};Xi=new WeakMap,De=new WeakSet,Bm=function(){this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:this.open},bubbles:!0,composed:!0}))},Xh=function(){this.items.forEach(t=>{t.sortable=this.sortable,t.requestUpdate()})},Jh=function(e){let t=e?.list;return!!e&&!!t&&t!==this&&!!this.group&&t.group===this.group&&this.sortable&&(!this.collapsible||this.open)},Fm=function(e){let t=Ir.dragged;a(this,De,Jh).call(this,t)&&(e.preventDefault(),io(t,{list:this,index:Yc(this.items,t,e.clientY)}))},jm=function(e){let t=Ir.dragged;if(!a(this,De,Jh).call(this,t))return;e.preventDefault();let i=Yc(this.items,t,e.clientY);io(t,null),t.moveToList(this,i)},Hr.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"},sortable:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},group:{reflect:!0},_msg:{state:!0},_empty:{state:!0}},Hr.styles=[E,x`
1827
1931
  :host { display: block; }
1828
1932
  .bar {
1829
1933
  display: flex; align-items: center; gap: var(--cm-space-15); min-height: 90px; padding: 0 var(--cm-space-20);
@@ -1848,21 +1952,21 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1848
1952
  .rows { margin-inline-start: var(--cm-space-10); }
1849
1953
  .toggle { width: 30px; height: 30px; }
1850
1954
  }
1851
- `];g("cm-nested-list",Vs);var zp=(n,r,e)=>{let t=new Map;for(let i=r;i<=e;i++)t.set(n[i],i);return t},Lp=Li(class extends ut{constructor(n){if(super(n),n.type!==Re.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,r,e){let t;e===void 0?e=r:r!==void 0&&(t=r);let i=[],a=[],c=0;for(let h of n)i[c]=t?t(h,c):c,a[c]=e(h,c),c++;return{values:a,keys:i}}render(n,r,e){return this.dt(n,r,e).values}update(n,[r,e,t]){let i=hh(n),{values:a,keys:c}=this.dt(r,e,t);if(!Array.isArray(i))return this.ut=c,a;let h=this.ut??=[],u=[],m,y,v=0,E=i.length-1,$=0,T=a.length-1;for(;v<=E&&$<=T;)if(i[v]===null)v++;else if(i[E]===null)E--;else if(h[v]===c[$])u[$]=mt(i[v],a[$]),v++,$++;else if(h[E]===c[T])u[T]=mt(i[E],a[T]),E--,T--;else if(h[v]===c[T])u[T]=mt(i[v],a[T]),Si(n,u[T+1],i[v]),v++,T--;else if(h[E]===c[$])u[$]=mt(i[E],a[$]),Si(n,i[v],i[E]),E--,$++;else if(m===void 0&&(m=zp(c,$,T),y=zp(h,v,E)),m.has(h[v]))if(m.has(h[E])){let D=y.get(c[$]),P=D!==void 0?i[D]:null;if(P===null){let j=Si(n,i[v]);mt(j,a[$]),u[$]=j}else u[$]=mt(P,a[$]),Si(n,i[v],P),i[D]=null;$++}else Zn(i[E]),E--;else Zn(i[v]),v++;for(;$<=T;){let D=Si(n,u[T+1]);mt(D,a[$]),u[$++]=D}for(;v<=E;){let D=i[v++];D!==null&&Zn(D)}return this.ut=c,Jn(n,u),ae}});function Sp(n,r,e){let t=c=>e.slotCount(c),i=c=>Math.max(0,t(c)-1),a=c=>{for(let h=r.group+c;h>=0&&h<e.groupCount();h+=c)if(t(h)>0)return{group:h,index:Math.min(r.index,i(h))};return{...r}};switch(n){case"ArrowRight":return a(1);case"ArrowLeft":return a(-1);case"ArrowDown":return{group:r.group,index:Math.min(r.index+1,i(r.group))};case"ArrowUp":return{group:r.group,index:Math.max(r.index-1,0)};case"Home":return{group:r.group,index:0};case"End":return{group:r.group,index:i(r.group)};default:return null}}var G,_e,Ce,Za=class{constructor(r){p(this,G);p(this,_e,null);p(this,Ce,null);f(this,G,r)}get active(){return s(this,_e)!==null}get from(){return s(this,_e)&&{...s(this,_e)}}get target(){return s(this,Ce)&&{...s(this,Ce)}}groupCount(){return s(this,G).groupCount()}slotCount(r){return r>=0&&r<s(this,G).groupCount()?s(this,G).slotCount(r):0}pickUp(r){this.active&&this.cancel(),f(this,_e,{...r}),f(this,Ce,{...r}),s(this,G).onTarget?.(this.target),s(this,G).announce(s(this,G).messages.pickedUp(this.target))}moveTo(r){if(!s(this,Ce))return;let e=Math.max(0,Math.min(r.group,s(this,G).groupCount()-1)),t=this.slotCount(e);t<=0||(f(this,Ce,{group:e,index:Math.max(0,Math.min(r.index,t-1))}),s(this,G).onTarget?.(this.target),s(this,G).announce(s(this,G).messages.over(this.target)))}drop(){if(!s(this,_e)||!s(this,Ce))return;let r=s(this,_e),e=s(this,Ce);f(this,_e,f(this,Ce,null)),s(this,G).onTarget?.(null),s(this,G).onDrop(r,e)}cancel(r=!1){if(!s(this,_e))return;let e=s(this,_e),t=r?"":s(this,G).messages.cancelled(e);f(this,_e,f(this,Ce,null)),s(this,G).onTarget?.(null),s(this,G).onCancel?.(e),t&&s(this,G).announce(t)}handleKey(r,e=r.key){if(!this.active||r.altKey||r.ctrlKey||r.metaKey)return!1;if(e===" "||e==="Enter")return this.drop(),!0;if(e==="Escape")return this.cancel(),!0;if(e==="Tab")return this.cancel(),!1;let t=(s(this,G).navigate??Sp)(e,s(this,Ce),this);return t?(this.moveTo(t),!0):!1}};G=new WeakMap,_e=new WeakMap,Ce=new WeakMap;var en,bi,Qa=class{constructor(r=document,e="assertive"){p(this,en);p(this,bi);let t=r.createElement("div");t.setAttribute("aria-live",e),t.setAttribute("aria-atomic","true"),t.className="cm-announcer",Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",margin:"-1px",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:"0"}),this.element=t}get text(){return s(this,bi)??this.element.textContent??""}announce(r){clearTimeout(s(this,en)),this.element.textContent===r?(this.element.textContent="",f(this,bi,r),f(this,en,setTimeout(()=>{this.element.textContent=r,f(this,bi,void 0)},50))):(f(this,bi,void 0),this.element.textContent=r)}};en=new WeakMap,bi=new WeakMap;var kx=M("boardCard",{roleDescription:"movable card",instructions:"Press Space to pick up. Then use the arrow keys to choose a column and a position, Space or Enter to drop, and Escape to cancel.",openHint:"Press Enter to open.",saving:"Saving"}),Ex=M("boardColumn",{count:{one:"{count} card",other:"{count} cards"},loadMore:"Load more",loading:"Loading {column}",empty:"No cards"}),Mx=M("board",{label:"Board",pickedUp:"Picked up {card}. Column {column}, position {position} of {count}.",over:"Column {column}, position {position} of {count}.",moved:"Moved {card} to {column}, position {position} of {count}.",sameSpot:"{card} dropped where it started.",cancelled:"Move cancelled. {card} is back in {column}.",refused:"{card} can't be moved to {column}.",reverted:"Couldn't move {card}. It is back in {column}."});var tm="input, select, textarea, [contenteditable], cm-action-menu, cm-select, cm-text-field, [data-no-drag]",tn,Ml,Ap,gi=class extends k{constructor(){super(...arguments);p(this,Ml);this.value="";this.label="";this.heading="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1;this._badges=!1;this._slottedTitle="";p(this,tn,L("cm-bc"))}get name(){let e=i=>(i??"").replace(/\s+/g," ").trim();if(this.label)return this.label;if(this.heading)return this.heading;let t=this.querySelector(':scope > [slot="heading"]');return t?e(t.textContent):e(this.textContent).slice(0,80)}get key(){return this.value||this.name}get opener(){if(this.href)return this.renderRoot?.querySelector(".title a")??null;let e=this.querySelector(':scope > [slot="heading"]');return e?e.matches("a[href], button, cm-button")?e:e.querySelector("a[href], button, cm-button"):null}focusHandle(e){let t=this.renderRoot?.querySelector(".handle");t?t.focus(e):this.focus(e)}open(){let e=this.opener;return e?(e.click(),!0):!1}render(){let e=!!(this.href||this.querySelector(':scope > [slot="heading"] a[href], :scope > [slot="heading"] button, :scope > a[slot="heading"][href], :scope > button[slot="heading"]')),t=this.pending;return l`<div class="card" part="card">
1852
- ${this.locked?d:l`<div class="handle" part="handle" tabindex="0" role="button" aria-roledescription=${this.t("roleDescription")}
1853
- aria-label=${t?`${this.name}, ${this.t("saving")}`:this.name} aria-describedby="${s(this,tn)}-help"></div>`}
1955
+ `];w("cm-nested-list",Hr);var Vm=(o,n,e)=>{let t=new Map;for(let i=n;i<=e;i++)t.set(o[i],i);return t},Um=gs(class extends jt{constructor(o){if(super(o),o.type!==st.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,n,e){let t;e===void 0?e=n:n!==void 0&&(t=n);let i=[],r=[],l=0;for(let d of o)i[l]=t?t(d,l):l,r[l]=e(d,l),l++;return{values:r,keys:i}}render(o,n,e){return this.dt(o,n,e).values}update(o,[n,e,t]){let i=xu(o),{values:r,keys:l}=this.dt(n,e,t);if(!Array.isArray(i))return this.ut=l,r;let d=this.ut??=[],p=[],m,v,b=0,$=i.length-1,y=0,M=r.length-1;for(;b<=$&&y<=M;)if(i[b]===null)b++;else if(i[$]===null)$--;else if(d[b]===l[y])p[y]=Vt(i[b],r[y]),b++,y++;else if(d[$]===l[M])p[M]=Vt(i[$],r[M]),$--,M--;else if(d[b]===l[M])p[M]=Vt(i[b],r[M]),bs(o,p[M+1],i[b]),b++,M--;else if(d[$]===l[y])p[y]=Vt(i[$],r[y]),bs(o,i[b],i[$]),$--,y++;else if(m===void 0&&(m=Vm(l,y,M),v=Vm(d,b,$)),m.has(d[b]))if(m.has(d[$])){let A=v.get(l[y]),I=A!==void 0?i[A]:null;if(I===null){let B=bs(o,i[b]);Vt(B,r[y]),p[y]=B}else p[y]=Vt(I,r[y]),bs(o,i[b],I),i[A]=null;y++}else kl(i[$]),$--;else kl(i[b]),b++;for(;y<=M;){let A=bs(o,p[M+1]);Vt(A,r[y]),p[y++]=A}for(;b<=$;){let A=i[b++];A!==null&&kl(A)}return this.ut=l,$l(o,p),ge}});function Km(o,n,e){let t=l=>e.slotCount(l),i=l=>Math.max(0,t(l)-1),r=l=>{for(let d=n.group+l;d>=0&&d<e.groupCount();d+=l)if(t(d)>0)return{group:d,index:Math.min(n.index,i(d))};return{...n}};switch(o){case"ArrowRight":return r(1);case"ArrowLeft":return r(-1);case"ArrowDown":return{group:n.group,index:Math.min(n.index+1,i(n.group))};case"ArrowUp":return{group:n.group,index:Math.max(n.index-1,0)};case"Home":return{group:n.group,index:0};case"End":return{group:n.group,index:i(n.group)};default:return null}}var se,qe,Be,Zi=class{constructor(n){u(this,se);u(this,qe,null);u(this,Be,null);g(this,se,n)}get active(){return s(this,qe)!==null}get from(){return s(this,qe)&&{...s(this,qe)}}get target(){return s(this,Be)&&{...s(this,Be)}}groupCount(){return s(this,se).groupCount()}slotCount(n){return n>=0&&n<s(this,se).groupCount()?s(this,se).slotCount(n):0}pickUp(n){this.active&&this.cancel(),g(this,qe,{...n}),g(this,Be,{...n}),s(this,se).onTarget?.(this.target),s(this,se).announce(s(this,se).messages.pickedUp(this.target))}moveTo(n){if(!s(this,Be))return;let e=Math.max(0,Math.min(n.group,s(this,se).groupCount()-1)),t=this.slotCount(e);t<=0||(g(this,Be,{group:e,index:Math.max(0,Math.min(n.index,t-1))}),s(this,se).onTarget?.(this.target),s(this,se).announce(s(this,se).messages.over(this.target)))}drop(){if(!s(this,qe)||!s(this,Be))return;let n=s(this,qe),e=s(this,Be);g(this,qe,g(this,Be,null)),s(this,se).onTarget?.(null),s(this,se).onDrop(n,e)}cancel(n=!1){if(!s(this,qe))return;let e=s(this,qe),t=n?"":s(this,se).messages.cancelled(e);g(this,qe,g(this,Be,null)),s(this,se).onTarget?.(null),s(this,se).onCancel?.(e),t&&s(this,se).announce(t)}handleKey(n,e=n.key){if(!this.active||n.altKey||n.ctrlKey||n.metaKey)return!1;if(e===" "||e==="Enter")return this.drop(),!0;if(e==="Escape")return this.cancel(),!0;if(e==="Tab")return this.cancel(),!1;let t=(s(this,se).navigate??Km)(e,s(this,Be),this);return t?(this.moveTo(t),!0):!1}};se=new WeakMap,qe=new WeakMap,Be=new WeakMap;var so,Ji,Qi=class{constructor(n=document,e="assertive"){u(this,so);u(this,Ji);let t=n.createElement("div");t.setAttribute("aria-live",e),t.setAttribute("aria-atomic","true"),t.className="cm-announcer",Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",margin:"-1px",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:"0"}),this.element=t}get text(){return s(this,Ji)??this.element.textContent??""}announce(n){clearTimeout(s(this,so)),this.element.textContent===n?(this.element.textContent="",g(this,Ji,n),g(this,so,setTimeout(()=>{this.element.textContent=n,g(this,Ji,void 0)},50))):(g(this,Ji,void 0),this.element.textContent=n)}};so=new WeakMap,Ji=new WeakMap;var Tw=C("boardCard",{roleDescription:"movable card",instructions:"Press Space to pick up. Then use the arrow keys to choose a column and a position, Space or Enter to drop, and Escape to cancel.",openHint:"Press Enter to open.",saving:"Saving"}),Cw=C("boardColumn",{count:{one:"{count} card",other:"{count} cards"},loadMore:"Load more",loading:"Loading {column}",empty:"No cards"}),_w=C("board",{label:"Board",pickedUp:"Picked up {card}. Column {column}, position {position} of {count}.",over:"Column {column}, position {position} of {count}.",moved:"Moved {card} to {column}, position {position} of {count}.",sameSpot:"{card} dropped where it started.",cancelled:"Move cancelled. {card} is back in {column}.",refused:"{card} can't be moved to {column}.",reverted:"Couldn't move {card}. It is back in {column}."});var Jg="input, select, textarea, [contenteditable], cm-action-menu, cm-select, cm-text-field, [data-no-drag]",ro,Qc,Wm,es=class extends T{constructor(){super(...arguments);u(this,Qc);this.value="";this.label="";this.heading="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1;this._badges=!1;this._slottedTitle="";u(this,ro,D("cm-bc"))}get name(){let e=i=>(i??"").replace(/\s+/g," ").trim();if(this.label)return this.label;if(this.heading)return this.heading;let t=this.querySelector(':scope > [slot="heading"]');return t?e(t.textContent):e(this.textContent).slice(0,80)}get key(){return this.value||this.name}get opener(){if(this.href)return this.renderRoot?.querySelector(".title a")??null;let e=this.querySelector(':scope > [slot="heading"]');return e?e.matches("a[href], button, cm-button")?e:e.querySelector("a[href], button, cm-button"):null}focusHandle(e){let t=this.renderRoot?.querySelector(".handle");t?t.focus(e):this.focus(e)}open(){let e=this.opener;return e?(e.click(),!0):!1}render(){let e=!!(this.href||this.querySelector(':scope > [slot="heading"] a[href], :scope > [slot="heading"] button, :scope > a[slot="heading"][href], :scope > button[slot="heading"]')),t=this.pending;return c`<div class="card" part="card">
1956
+ ${this.locked?h:c`<div class="handle" part="handle" tabindex="0" role="button" aria-roledescription=${this.t("roleDescription")}
1957
+ aria-label=${t?`${this.name}, ${this.t("saving")}`:this.name} aria-describedby="${s(this,ro)}-help"></div>`}
1854
1958
  <div class="content">
1855
1959
  <div class="head">
1856
- <div class="title" part="title"><slot name="heading" @slotchange=${()=>this.requestUpdate()}>${this.href?l`<a href=${this.href} tabindex="-1">${this.heading}</a>`:this.heading}</slot></div>
1960
+ <div class="title" part="title"><slot name="heading" @slotchange=${()=>this.requestUpdate()}>${this.href?c`<a href=${this.href} tabindex="-1">${this.heading}</a>`:this.heading}</slot></div>
1857
1961
  <slot name="avatar"></slot>
1858
1962
  <slot name="actions"></slot>
1859
1963
  </div>
1860
1964
  <div class="lines"><slot></slot></div>
1861
- <div class="badges" ?hidden=${!this._badges}><slot name="badges" @slotchange=${i=>o(this,Ml,Ap).call(this,i,"_badges")}></slot></div>
1965
+ <div class="badges" ?hidden=${!this._badges}><slot name="badges" @slotchange=${i=>a(this,Qc,Wm).call(this,i,"_badges")}></slot></div>
1862
1966
  </div>
1863
- ${t?l`<cm-spinner class="spin" size="small" accessible-label=${this.t("saving")} aria-hidden="true"></cm-spinner>`:d}
1864
- <span id="${s(this,tn)}-help" hidden>${e?`${this.t("openHint")} `:""}${this.t("instructions")}</span>
1865
- </div>`}};tn=new WeakMap,Ml=new WeakSet,Ap=function(e,t){this[t]=e.target.assignedElements({flatten:!0}).length>0},gi.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},gi.properties={value:{reflect:!0},label:{},heading:{},href:{},locked:{type:Boolean,reflect:!0},pending:{type:Boolean,reflect:!0},moving:{type:Boolean,reflect:!0},_badges:{state:!0},_slottedTitle:{state:!0}},gi.styles=[w,b`
1967
+ ${t?c`<cm-spinner class="spin" size="small" accessible-label=${this.t("saving")} aria-hidden="true"></cm-spinner>`:h}
1968
+ <span id="${s(this,ro)}-help" hidden>${e?`${this.t("openHint")} `:""}${this.t("instructions")}</span>
1969
+ </div>`}};ro=new WeakMap,Qc=new WeakSet,Wm=function(e,t){this[t]=e.target.assignedElements({flatten:!0}).length>0},es.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},es.properties={value:{reflect:!0},label:{},heading:{},href:{},locked:{type:Boolean,reflect:!0},pending:{type:Boolean,reflect:!0},moving:{type:Boolean,reflect:!0},_badges:{state:!0},_slottedTitle:{state:!0}},es.styles=[E,x`
1866
1970
  :host { display: block; position: relative; -webkit-touch-callout: none; font-size: 14px; line-height: 20px; }
1867
1971
  .card {
1868
1972
  position: relative; display: block; padding: var(--cm-space-12) var(--cm-space-15); background: var(--cm-bg-surface);
@@ -1887,22 +1991,22 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1887
1991
  :host([moving]) .content { opacity: 0.5; }
1888
1992
  :host([ghost]) .card { cursor: grabbing; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); border-color: var(--cm-border-default); }
1889
1993
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
1890
- `];g("cm-board-card",gi);var Ys,sn,Ws,Xs,It,$l,Dp,vi=class extends k{constructor(){super(...arguments);p(this,It);this.value="";this.heading="";this.hasMore=!1;this.loading=!1;this.headingLevel=3;p(this,Ys,!1);this._cards=[];this._drop=null;p(this,sn,new MutationObserver(()=>o(this,It,$l).call(this)));p(this,Ws,L("cm-col"));p(this,Xs,!1)}get collapsed(){return s(this,Ys)}connectedCallback(){super.connectedCallback(),o(this,It,$l).call(this),s(this,sn).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,sn).disconnect()}get cards(){return[...this.children].filter(e=>e.localName==="cm-board-card"&&!e.hasAttribute("slot"))}get key(){return this.value||this.heading}get count(){return typeof this.total=="number"&&!Number.isNaN(this.total)?this.total:this._cards.length}get scrollElement(){return this.renderRoot?.querySelector(".scroll")??null}_sync(){return o(this,It,$l).call(this),this.updateComplete}willUpdate(){let e=this.closest("cm-board");f(this,Ys,!!e?.hideEmpty&&!this._cards.length&&!this.loading&&!(this.count>0)),this.toggleAttribute("collapsed",s(this,Ys)),f(this,Xs,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach(i=>{let a=this._cards[Number(i.dataset.i)];a?i.assign(a):i.assign()});let t=i=>[...this.children].filter(a=>a.getAttribute("slot")===i);this.renderRoot.querySelector("slot.actions")?.assign(...t("actions")),this.renderRoot.querySelector("slot.empty")?.assign(...t("empty")),s(this,Xs)&&!this.renderRoot.querySelector(".more cm-button")&&(f(this,Xs,!1),this.renderRoot.querySelector("ul")?.focus())}render(){let e=this._cards,t=this._drop,i=this.count,a=t?e.filter($=>$!==t.card):e,c=t?e.indexOf(t.card):-1,h=!!t&&!this.collapsed&&!(c>=0&&t.index===c),u=[];e.forEach(($,T)=>{h&&$!==t.card&&a.indexOf($)===t.index&&u.push({key:"drop"}),u.push({key:$,card:$,i:T})}),h&&t.index>=a.length&&u.push({key:"drop"});let m=this.hasMore||i>e.length,y=this.loading,v=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),E=this.t("count",{count:i});return l`<section aria-labelledby="${s(this,Ws)}-h" class=${t&&this.collapsed?"over":""}>
1994
+ `];w("cm-board-card",es);var qr,ao,Br,Fr,bi,Xc,Ym,ts=class extends T{constructor(){super(...arguments);u(this,bi);this.value="";this.heading="";this.hasMore=!1;this.loading=!1;this.headingLevel=3;u(this,qr,!1);this._cards=[];this._drop=null;u(this,ao,new MutationObserver(()=>a(this,bi,Xc).call(this)));u(this,Br,D("cm-col"));u(this,Fr,!1)}get collapsed(){return s(this,qr)}connectedCallback(){super.connectedCallback(),a(this,bi,Xc).call(this),s(this,ao).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,ao).disconnect()}get cards(){return[...this.children].filter(e=>e.localName==="cm-board-card"&&!e.hasAttribute("slot"))}get key(){return this.value||this.heading}get count(){return typeof this.total=="number"&&!Number.isNaN(this.total)?this.total:this._cards.length}get scrollElement(){return this.renderRoot?.querySelector(".scroll")??null}_sync(){return a(this,bi,Xc).call(this),this.updateComplete}willUpdate(){let e=this.closest("cm-board");g(this,qr,!!e?.hideEmpty&&!this._cards.length&&!this.loading&&!(this.count>0)),this.toggleAttribute("collapsed",s(this,qr)),g(this,Fr,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach(i=>{let r=this._cards[Number(i.dataset.i)];r?i.assign(r):i.assign()});let t=i=>[...this.children].filter(r=>r.getAttribute("slot")===i);this.renderRoot.querySelector("slot.actions")?.assign(...t("actions")),this.renderRoot.querySelector("slot.empty")?.assign(...t("empty")),s(this,Fr)&&!this.renderRoot.querySelector(".more cm-button")&&(g(this,Fr,!1),this.renderRoot.querySelector("ul")?.focus())}render(){let e=this._cards,t=this._drop,i=this.count,r=t?e.filter(y=>y!==t.card):e,l=t?e.indexOf(t.card):-1,d=!!t&&!this.collapsed&&!(l>=0&&t.index===l),p=[];e.forEach((y,M)=>{d&&y!==t.card&&r.indexOf(y)===t.index&&p.push({key:"drop"}),p.push({key:y,card:y,i:M})}),d&&t.index>=r.length&&p.push({key:"drop"});let m=this.hasMore||i>e.length,v=this.loading,b=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),$=this.t("count",{count:i});return c`<section aria-labelledby="${s(this,Br)}-h" class=${t&&this.collapsed?"over":""}>
1891
1995
  <header part="header">
1892
- <div class="title" id="${s(this,Ws)}-h" role="heading" aria-level=${v}>${this.heading}<span class="sr">, ${E}</span></div>
1996
+ <div class="title" id="${s(this,Br)}-h" role="heading" aria-level=${b}>${this.heading}<span class="sr">, ${$}</span></div>
1893
1997
  <span class="count" part="count" aria-hidden="true">${this.formatNumber(i)}</span>
1894
1998
  <span class="actions"><slot class="actions"></slot></span>
1895
1999
  </header>
1896
2000
  <div class="scroll">
1897
- <ul part="list" role="list" aria-labelledby="${s(this,Ws)}-h" aria-busy=${y?"true":"false"} tabindex="-1" ?hidden=${this.collapsed}>
1898
- ${Lp(u,$=>$.key,$=>$.card?l`<li><slot data-i=${$.i}></slot></li>`:l`<li class="drop" aria-hidden="true"><div style="min-height:${Math.max(40,t.height)}px">${t.card.name}</div></li>`)}
2001
+ <ul part="list" role="list" aria-labelledby="${s(this,Br)}-h" aria-busy=${v?"true":"false"} tabindex="-1" ?hidden=${this.collapsed}>
2002
+ ${Um(p,y=>y.key,y=>y.card?c`<li><slot data-i=${y.i}></slot></li>`:c`<li class="drop" aria-hidden="true"><div style="min-height:${Math.max(40,t.height)}px">${t.card.name}</div></li>`)}
1899
2003
  </ul>
1900
- ${y&&!e.length&&!this.collapsed?l`<div class="loading" aria-hidden="true"><cm-skeleton variant="block"></cm-skeleton><cm-skeleton variant="block"></cm-skeleton></div>`:d}
1901
- <div class="empty" ?hidden=${e.length>0||y||m||this.collapsed||h}><slot class="empty">${this.t("empty")}</slot></div>
1902
- ${m&&!this.collapsed?l`<div class="more"><cm-button part="more" size="medium" ?loading=${y} @click=${o(this,It,Dp)}>${this.t("loadMore")}</cm-button></div>`:d}
2004
+ ${v&&!e.length&&!this.collapsed?c`<div class="loading" aria-hidden="true"><cm-skeleton variant="block"></cm-skeleton><cm-skeleton variant="block"></cm-skeleton></div>`:h}
2005
+ <div class="empty" ?hidden=${e.length>0||v||m||this.collapsed||d}><slot class="empty">${this.t("empty")}</slot></div>
2006
+ ${m&&!this.collapsed?c`<div class="more"><cm-button part="more" size="medium" ?loading=${v} @click=${a(this,bi,Ym)}>${this.t("loadMore")}</cm-button></div>`:h}
1903
2007
  </div>
1904
- <span class="sr" role="status">${y?this.t("loading",{column:this.heading}):""}</span>
1905
- </section>`}};Ys=new WeakMap,sn=new WeakMap,Ws=new WeakMap,Xs=new WeakMap,It=new WeakSet,$l=function(){this._cards=this.cards},Dp=function(){this.loading||this.dispatchEvent(new CustomEvent("cm-load-more",{detail:{column:this,value:this.key},bubbles:!0,composed:!0}))},vi.shadowRootOptions={..._.shadowRootOptions,slotAssignment:"manual"},vi.properties={value:{reflect:!0},heading:{},total:{type:Number},hasMore:{type:Boolean,attribute:"has-more",reflect:!0},loading:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},_cards:{state:!0},_drop:{state:!0}},vi.styles=[w,b`
2008
+ <span class="sr" role="status">${v?this.t("loading",{column:this.heading}):""}</span>
2009
+ </section>`}};qr=new WeakMap,ao=new WeakMap,Br=new WeakMap,Fr=new WeakMap,bi=new WeakSet,Xc=function(){this._cards=this.cards},Ym=function(){this.loading||this.dispatchEvent(new CustomEvent("cm-load-more",{detail:{column:this,value:this.key},bubbles:!0,composed:!0}))},ts.shadowRootOptions={...L.shadowRootOptions,slotAssignment:"manual"},ts.properties={value:{reflect:!0},heading:{},total:{type:Number},hasMore:{type:Boolean,attribute:"has-more",reflect:!0},loading:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},_cards:{state:!0},_drop:{state:!0}},ts.styles=[E,x`
1906
2010
  :host {
1907
2011
  display: flex; flex-direction: column; flex: none; min-height: 0; max-height: 100%;
1908
2012
  inline-size: var(--cm-board-column-width, 272px);
@@ -1939,9 +2043,9 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1939
2043
  :host([collapsed]) .scroll { padding: 0; overflow: hidden; }
1940
2044
  :host([collapsed]) .actions { display: none; }
1941
2045
  :host([collapsed]) section.over { outline: 2px dashed var(--cm-border-strong); outline-offset: -2px; }
1942
- `];g("cm-board-column",vi);var ue,le,W,xi,F,z,rd,Ks,Np,ad,Rp,Hp,Ip,Op,rn,qp,an,nd,od,ld,kl,Pp,nn,on,ln,cn,dn,hn,pn,cd,dd,El,Bp,Ht,Gs=class extends k{constructor(){super();p(this,z);this.hideEmpty=!1;this.controlled=!1;this.dragging=!1;p(this,ue,new Qa);p(this,le);p(this,W,null);p(this,xi,new WeakMap);p(this,F,null);p(this,rn,e=>{if(s(this,F)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=ne(e,this);if(s(this,le).active){s(this,le).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}let i=o(this,z,Op).call(this,e.composedPath());if(!(!i||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===" ")e.preventDefault(),this.pickUp(i);else if(e.key==="Enter")i.open()&&e.preventDefault();else if(t.startsWith("Arrow")){let a=o(this,z,qp).call(this,i,t);a&&(e.preventDefault(),a.focusHandle())}}});p(this,an,e=>{if(!s(this,le).active||!s(this,W))return;let t=e.relatedTarget;t&&(t===s(this,W).card||s(this,W).card.contains(t))||!t&&document.hasFocus()===!1||queueMicrotask(()=>{s(this,le).active&&s(this,W)&&!s(this,W).card.matches(":focus-within")&&s(this,le).cancel()})});p(this,nn,e=>{e.composedPath().some(t=>t.localName==="cm-board-card")&&e.preventDefault()});p(this,on,e=>{if(s(this,F)||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath(),i=t.find(h=>h.localName==="cm-board-card");if(!i||i.locked||i.pending||t.some(h=>h instanceof Element&&h!==i&&h.matches?.(tm)))return;let a=o(this,z,Ks).call(this,i);if(!a)return;s(this,le).active&&s(this,le).cancel();let c=i.getBoundingClientRect();f(this,F,{card:i,pointerId:e.pointerId,type:e.pointerType,x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY,started:!1,dx:e.clientX-c.left,dy:e.clientY-c.top,width:c.width,height:c.height,from:a.column,fromIndex:a.index}),e.pointerType!=="mouse"&&(s(this,F).timer=setTimeout(()=>{s(this,F)&&!s(this,F).started&&o(this,z,cd).call(this)},300)),window.addEventListener("pointermove",s(this,dn),!0),window.addEventListener("pointerup",s(this,hn),!0),window.addEventListener("pointercancel",s(this,pn),!0),window.addEventListener("touchmove",s(this,ln),{capture:!0,passive:!1}),window.addEventListener("contextmenu",s(this,cn),!0)});p(this,ln,e=>{s(this,F)?.started&&e.cancelable&&e.preventDefault()});p(this,cn,e=>{s(this,F)&&e.preventDefault()});p(this,dn,e=>{let t=s(this,F);if(!(!t||e.pointerId!==t.pointerId)){if(t.x=e.clientX,t.y=e.clientY,!t.started){let i=Math.hypot(t.x-t.x0,t.y-t.y0);(t.type==="mouse"?i>4:i>8)&&(t.type==="mouse"?o(this,z,cd).call(this):o(this,z,Ht).call(this,!1));return}e.preventDefault(),o(this,z,dd).call(this),o(this,z,El).call(this)}});p(this,hn,e=>{let t=s(this,F);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){o(this,z,Ht).call(this,!1);return}let i=a=>{a.stopPropagation(),a.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),o(this,z,Ht).call(this,!0)});p(this,pn,e=>{s(this,F)&&e.pointerId===s(this,F).pointerId&&o(this,z,Ht).call(this,!1)});f(this,le,new Za({groupCount:()=>this.columns.length,slotCount:e=>{let t=this.columns[e];return!t||!s(this,W)?0:t.cards.filter(i=>i!==s(this,W).card).length+1},onTarget:e=>o(this,z,Rp).call(this,e),onDrop:(e,t)=>o(this,z,Ip).call(this,e,t),onCancel:()=>o(this,z,ad).call(this),messages:{pickedUp:e=>o(this,z,rd).call(this,"pickedUp",e),over:e=>o(this,z,rd).call(this,"over",e),cancelled:e=>this.t("cancelled",{card:s(this,W)?.card.name??"",column:this.columns[e.group]?.heading??""})},announce:e=>s(this,ue).announce(e)}))}get columns(){return[...this.children].filter(e=>e.localName==="cm-board-column")}column(e){return this.columns.find(t=>t.key===e)}card(e){for(let t of this.columns){let i=t.cards.find(a=>a.key===e);if(i)return i}}get heldCard(){return s(this,W)?.card??null}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",s(this,rn)),this.addEventListener("focusout",s(this,an)),this.addEventListener("pointerdown",s(this,on)),this.addEventListener("dragstart",s(this,nn))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",s(this,rn)),this.removeEventListener("focusout",s(this,an)),this.removeEventListener("pointerdown",s(this,on)),this.removeEventListener("dragstart",s(this,nn)),s(this,le).cancel(!0),o(this,z,Ht).call(this,!1)}firstUpdated(){this.renderRoot.appendChild(s(this,ue).element)}updated(e){e.has("hideEmpty")&&this.columns.forEach(t=>t.requestUpdate())}get announcement(){return s(this,ue).text}announce(e){s(this,ue).announce(e)}pickUp(e){let t=typeof e=="string"?this.card(e):e;if(!t||t.locked||t.pending)return!1;let i=o(this,z,Ks).call(this,t);return i?(o(this,z,Ht).call(this,!1),s(this,le).cancel(!0),f(this,W,{card:t,column:i.column,index:i.index}),t.moving=!0,o(this,z,Np).call(this,t),s(this,le).pickUp({group:i.group,index:i.index}),!0):!1}cancelMove(){let e=s(this,F);e?.started&&(o(this,z,Ht).call(this,!1),s(this,ue).announce(this.t("cancelled",{card:e.card.name,column:e.from.heading}))),s(this,le).cancel()}moveCard(e,t,i){let a=typeof e=="string"?this.card(e):e,c=typeof t=="string"?this.column(t):t;if(!a||!c)return!1;let h=o(this,z,Ks).call(this,a);if(!h)return!1;let u=c.cards.filter(y=>y!==a).length,m=Math.max(0,Math.min(i??u,u));return o(this,z,kl).call(this,a,h.column,h.index,c,m,"api")}revert(e){let t=typeof e=="string"?this.card(e):e;if(!t)return!1;t.pending=!1;let i=s(this,xi).get(t);if(this.controlled||!i||(s(this,xi).delete(t),!i.from.isConnected||!this.contains(i.from)))return!1;let a=t.matches(":focus-within");return o(this,z,od).call(this,t,i.from,i.fromIndex),i.totals&&o(this,z,ld).call(this,i.to,i.from),o(this,z,nd).call(this,i.to,i.from,a?t:null),s(this,ue).announce(this.t("reverted",{card:t.name,column:i.from.heading})),!0}render(){return l`<div class="board" role="group" aria-label=${this.label}>
2046
+ `];w("cm-board-column",ts);var Ee,ve,ne,is,J,z,Zh,Pr,Gm,Qh,Xm,Jm,Zm,Qm,no,ef,oo,ep,tp,ip,Jc,tf,lo,co,ho,po,uo,mo,fo,sp,rp,Zc,sf,gi,Or=class extends T{constructor(){super();u(this,z);this.hideEmpty=!1;this.controlled=!1;this.dragging=!1;u(this,Ee,new Qi);u(this,ve);u(this,ne,null);u(this,is,new WeakMap);u(this,J,null);u(this,no,e=>{if(s(this,J)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=re(e,this);if(s(this,ve).active){s(this,ve).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}let i=a(this,z,Qm).call(this,e.composedPath());if(!(!i||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===" ")e.preventDefault(),this.pickUp(i);else if(e.key==="Enter")i.open()&&e.preventDefault();else if(t.startsWith("Arrow")){let r=a(this,z,ef).call(this,i,t);r&&(e.preventDefault(),r.focusHandle())}}});u(this,oo,e=>{if(!s(this,ve).active||!s(this,ne))return;let t=e.relatedTarget;t&&(t===s(this,ne).card||s(this,ne).card.contains(t))||!t&&document.hasFocus()===!1||queueMicrotask(()=>{s(this,ve).active&&s(this,ne)&&!s(this,ne).card.matches(":focus-within")&&s(this,ve).cancel()})});u(this,lo,e=>{e.composedPath().some(t=>t.localName==="cm-board-card")&&e.preventDefault()});u(this,co,e=>{if(s(this,J)||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath(),i=t.find(d=>d.localName==="cm-board-card");if(!i||i.locked||i.pending||t.some(d=>d instanceof Element&&d!==i&&d.matches?.(Jg)))return;let r=a(this,z,Pr).call(this,i);if(!r)return;s(this,ve).active&&s(this,ve).cancel();let l=i.getBoundingClientRect();g(this,J,{card:i,pointerId:e.pointerId,type:e.pointerType,x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY,started:!1,dx:e.clientX-l.left,dy:e.clientY-l.top,width:l.width,height:l.height,from:r.column,fromIndex:r.index}),e.pointerType!=="mouse"&&(s(this,J).timer=setTimeout(()=>{s(this,J)&&!s(this,J).started&&a(this,z,sp).call(this)},300)),window.addEventListener("pointermove",s(this,uo),!0),window.addEventListener("pointerup",s(this,mo),!0),window.addEventListener("pointercancel",s(this,fo),!0),window.addEventListener("touchmove",s(this,ho),{capture:!0,passive:!1}),window.addEventListener("contextmenu",s(this,po),!0)});u(this,ho,e=>{s(this,J)?.started&&e.cancelable&&e.preventDefault()});u(this,po,e=>{s(this,J)&&e.preventDefault()});u(this,uo,e=>{let t=s(this,J);if(!(!t||e.pointerId!==t.pointerId)){if(t.x=e.clientX,t.y=e.clientY,!t.started){let i=Math.hypot(t.x-t.x0,t.y-t.y0);(t.type==="mouse"?i>4:i>8)&&(t.type==="mouse"?a(this,z,sp).call(this):a(this,z,gi).call(this,!1));return}e.preventDefault(),a(this,z,rp).call(this),a(this,z,Zc).call(this)}});u(this,mo,e=>{let t=s(this,J);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){a(this,z,gi).call(this,!1);return}let i=r=>{r.stopPropagation(),r.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),a(this,z,gi).call(this,!0)});u(this,fo,e=>{s(this,J)&&e.pointerId===s(this,J).pointerId&&a(this,z,gi).call(this,!1)});g(this,ve,new Zi({groupCount:()=>this.columns.length,slotCount:e=>{let t=this.columns[e];return!t||!s(this,ne)?0:t.cards.filter(i=>i!==s(this,ne).card).length+1},onTarget:e=>a(this,z,Xm).call(this,e),onDrop:(e,t)=>a(this,z,Zm).call(this,e,t),onCancel:()=>a(this,z,Qh).call(this),messages:{pickedUp:e=>a(this,z,Zh).call(this,"pickedUp",e),over:e=>a(this,z,Zh).call(this,"over",e),cancelled:e=>this.t("cancelled",{card:s(this,ne)?.card.name??"",column:this.columns[e.group]?.heading??""})},announce:e=>s(this,Ee).announce(e)}))}get columns(){return[...this.children].filter(e=>e.localName==="cm-board-column")}column(e){return this.columns.find(t=>t.key===e)}card(e){for(let t of this.columns){let i=t.cards.find(r=>r.key===e);if(i)return i}}get heldCard(){return s(this,ne)?.card??null}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",s(this,no)),this.addEventListener("focusout",s(this,oo)),this.addEventListener("pointerdown",s(this,co)),this.addEventListener("dragstart",s(this,lo))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",s(this,no)),this.removeEventListener("focusout",s(this,oo)),this.removeEventListener("pointerdown",s(this,co)),this.removeEventListener("dragstart",s(this,lo)),s(this,ve).cancel(!0),a(this,z,gi).call(this,!1)}firstUpdated(){this.renderRoot.appendChild(s(this,Ee).element)}updated(e){e.has("hideEmpty")&&this.columns.forEach(t=>t.requestUpdate())}get announcement(){return s(this,Ee).text}announce(e){s(this,Ee).announce(e)}pickUp(e){let t=typeof e=="string"?this.card(e):e;if(!t||t.locked||t.pending)return!1;let i=a(this,z,Pr).call(this,t);return i?(a(this,z,gi).call(this,!1),s(this,ve).cancel(!0),g(this,ne,{card:t,column:i.column,index:i.index}),t.moving=!0,a(this,z,Gm).call(this,t),s(this,ve).pickUp({group:i.group,index:i.index}),!0):!1}cancelMove(){let e=s(this,J);e?.started&&(a(this,z,gi).call(this,!1),s(this,Ee).announce(this.t("cancelled",{card:e.card.name,column:e.from.heading}))),s(this,ve).cancel()}moveCard(e,t,i){let r=typeof e=="string"?this.card(e):e,l=typeof t=="string"?this.column(t):t;if(!r||!l)return!1;let d=a(this,z,Pr).call(this,r);if(!d)return!1;let p=l.cards.filter(v=>v!==r).length,m=Math.max(0,Math.min(i??p,p));return a(this,z,Jc).call(this,r,d.column,d.index,l,m,"api")}revert(e){let t=typeof e=="string"?this.card(e):e;if(!t)return!1;t.pending=!1;let i=s(this,is).get(t);if(this.controlled||!i||(s(this,is).delete(t),!i.from.isConnected||!this.contains(i.from)))return!1;let r=t.matches(":focus-within");return a(this,z,tp).call(this,t,i.from,i.fromIndex),i.totals&&a(this,z,ip).call(this,i.to,i.from),a(this,z,ep).call(this,i.to,i.from,r?t:null),s(this,Ee).announce(this.t("reverted",{card:t.name,column:i.from.heading})),!0}render(){return c`<div class="board" role="group" aria-label=${this.label}>
1943
2047
  <div class="columns" part="columns"><slot @slotchange=${()=>this.requestUpdate()}></slot></div>
1944
- </div>`}};ue=new WeakMap,le=new WeakMap,W=new WeakMap,xi=new WeakMap,F=new WeakMap,z=new WeakSet,rd=function(e,t){let i=this.columns[t.group];return this.t(e,{card:s(this,W)?.card.name??"",column:i?.heading??"",position:t.index+1,count:s(this,le).slotCount(t.group)})},Ks=function(e){let t=this.columns,i=t.findIndex(a=>a.contains(e)&&e.parentElement===a);return i<0?null:{column:t[i],group:i,index:t[i].cards.indexOf(e)}},Np=function(e){let t=()=>!!e.shadowRoot?.activeElement?.classList.contains("handle");e.focusHandle({preventScroll:!0}),requestAnimationFrame(()=>{s(this,W)?.card===e&&!t()&&e.focusHandle({preventScroll:!0})})},ad=function(){s(this,W)&&(s(this,W).card.moving=!1),f(this,W,null)},Rp=function(e){let t=s(this,W);if(this.columns.forEach((i,a)=>{i._drop=t&&e&&a===e.group?{card:t.card,index:e.index,height:t.card.getBoundingClientRect().height}:null}),e){let i=this.columns[e.group];i?.updateComplete.then(()=>{let a=i.renderRoot.querySelector("li.drop")??(t&&t.column===i?t.card:i);o(this,z,Hp).call(this,i,a)})}},Hp=function(e,t){let i=this.renderRoot.querySelector(".columns");if(i){let c=i.getBoundingClientRect(),h=e.getBoundingClientRect();h.left<c.left?i.scrollLeft-=c.left-h.left+8:h.right>c.right&&(i.scrollLeft+=h.right-c.right+8)}let a=e.scrollElement;if(a){let c=a.getBoundingClientRect(),h=t.getBoundingClientRect();h.top<c.top?a.scrollTop-=c.top-h.top+8:h.bottom>c.bottom&&(a.scrollTop+=h.bottom-c.bottom+8)}},Ip=function(e,t){let i=s(this,W);if(o(this,z,ad).call(this),!i)return;let a=this.columns[t.group];o(this,z,kl).call(this,i.card,i.column,e.index,a,t.index,"keyboard")},Op=function(e){let t=e[0];if(!(t instanceof HTMLElement)||!t.classList?.contains("handle"))return null;let i=e.find(a=>a.localName==="cm-board-card");return i&&o(this,z,Ks).call(this,i)?i:null},rn=new WeakMap,qp=function(e,t){let i=o(this,z,Ks).call(this,e);if(!i)return null;let a=i.column.cards;if(t==="ArrowDown")return a[i.index+1]??null;if(t==="ArrowUp")return a[i.index-1]??null;let c=t==="ArrowRight"?1:-1,h=this.columns;for(let u=i.group+c;u>=0&&u<h.length;u+=c){let m=h[u].cards;if(m.length)return m[Math.min(i.index,m.length-1)]}return null},an=new WeakMap,nd=function(e,t,i){e._sync(),t._sync().then(()=>{i?.isConnected&&i.focusHandle({preventScroll:!0})})},od=function(e,t,i){let a=t.cards.filter(h=>h!==e),c=a[i];c?c.before(e):a.length?a[a.length-1].after(e):t.append(e)},ld=function(e,t){e!==t&&(typeof e.total=="number"&&(e.total=Math.max(0,e.total-1)),typeof t.total=="number"&&(t.total=t.total+1))},kl=function(e,t,i,a,c,h){let u=e.name;if(t===a&&i===c)return h!=="api"&&s(this,ue).announce(this.t("sameSpot",{card:u})),h==="keyboard"&&e.focusHandle({preventScroll:!0}),!1;let m=[],y={value:e.key,card:e,from:t.key,to:a.key,fromColumn:t,toColumn:a,fromIndex:i,toIndex:c,source:h,waitUntil:$=>{m.push(Promise.resolve($))}};if(!this.dispatchEvent(new CustomEvent("cm-move",{detail:y,bubbles:!0,composed:!0,cancelable:!0})))return s(this,ue).announce(this.t("refused",{card:u,column:a.heading})),h==="keyboard"&&e.focusHandle({preventScroll:!0}),!1;let E=a.cards.filter($=>$!==e).length+1;if(this.controlled)h==="keyboard"&&o(this,z,Pp).call(this,e.key,a);else{let $=h==="keyboard"||e.matches(":focus-within");o(this,z,od).call(this,e,a,c);let T=t!==a;T&&o(this,z,ld).call(this,t,a),s(this,xi).set(e,{card:e,from:t,fromIndex:i,to:a,toIndex:c,totals:T}),o(this,z,nd).call(this,t,a,$?e:null)}return s(this,ue).announce(this.t("moved",{card:u,column:a.heading,position:c+1,count:E})),m.length&&(e.pending=!0,Promise.all(m).then(()=>{e.pending=!1,this.controlled||s(this,xi).delete(e)},()=>{e.pending=!1,this.controlled?s(this,ue).announce(this.t("reverted",{card:u,column:t.heading})):this.revert(e)})),!0},Pp=function(e,t){let i=()=>t.isConnected?t.cards.find(h=>h.key===e):void 0,a=()=>{let h=i(),u=!document.activeElement||document.activeElement===document.body||!document.activeElement.isConnected;return!h||!(u||this.contains(document.activeElement))?!1:(t._sync().then(()=>h.updateComplete).then(()=>{h.isConnected&&h.focusHandle({preventScroll:!0})}),!0)},c=new MutationObserver(()=>{a()&&c.disconnect()});c.observe(this,{childList:!0,subtree:!0}),setTimeout(()=>c.disconnect(),1e3)},nn=new WeakMap,on=new WeakMap,ln=new WeakMap,cn=new WeakMap,dn=new WeakMap,hn=new WeakMap,pn=new WeakMap,cd=function(){let e=s(this,F);e.started=!0,clearTimeout(e.timer),getSelection()?.removeAllRanges();let t=e.card.cloneNode(!0);t.removeAttribute("id"),t.removeAttribute("moving"),t.setAttribute("ghost",""),t.setAttribute("aria-hidden","true"),t.setAttribute("inert",""),Object.assign(t.style,{position:"fixed",zIndex:"2147483000",left:"0",top:"0",width:`${e.width}px`,margin:"0",pointerEvents:"none",willChange:"transform"}),(this.ownerDocument.body??this.ownerDocument.documentElement).appendChild(t),e.ghost=t,e.card.moving=!0,this.dragging=!0,e.to=e.from,e.toIndex=e.fromIndex,s(this,ue).announce(this.t("pickedUp",{card:e.card.name,column:e.from.heading,position:e.fromIndex+1,count:e.from.cards.length})),o(this,z,dd).call(this),o(this,z,El).call(this);let i=()=>{s(this,F)?.started&&(o(this,z,Bp).call(this),s(this,F).raf=requestAnimationFrame(i))};e.raf=requestAnimationFrame(i)},dd=function(){let e=s(this,F);e?.ghost&&(e.ghost.style.transform=`translate(${e.x-e.dx}px, ${e.y-e.dy}px)`)},El=function(){let e=s(this,F);if(!e)return;let t=this.columns;if(!t.length)return;let i=t[0],a=1/0;for(let m of t){let y=m.getBoundingClientRect(),v=e.x<y.left?y.left-e.x:e.x>y.right?e.x-y.right:0;v<a&&(i=m,a=v)}let c=i.cards.filter(m=>m!==e.card),h=c.length;if(i.collapsed)h=0;else for(let m=0;m<c.length;m++){let y=c[m].getBoundingClientRect();if(e.y<y.top+y.height/2){h=m;break}}if(i===e.to&&h===e.toIndex)return;let u=i!==e.to;e.to=i,e.toIndex=h,t.forEach(m=>{m._drop=m===i?{card:e.card,index:h,height:e.height}:null}),u&&s(this,ue).announce(this.t("over",{column:i.heading,position:h+1,count:c.length+1}))},Bp=function(){let e=s(this,F);if(!e)return;let t=48,i=16,a=E=>E<t?Math.ceil((t-Math.max(E,0))/t*i):0,c=!1,h=this.renderRoot.querySelector(".columns");if(h){let E=h.getBoundingClientRect(),$=a(e.x-E.left),T=a(E.right-e.x),D=h.scrollLeft;$?h.scrollLeft-=$:T&&(h.scrollLeft+=T),c||=h.scrollLeft!==D}let u=e.to?.scrollElement;if(u&&u.scrollHeight>u.clientHeight){let E=u.getBoundingClientRect();if(e.x>=E.left&&e.x<=E.right){let $=a(e.y-E.top),T=a(E.bottom-e.y),D=u.scrollTop;$?u.scrollTop-=$:T&&(u.scrollTop+=T),c||=u.scrollTop!==D}}let m=window.innerHeight,y=a(e.y),v=a(m-e.y);if(y||v){let E=window.scrollY;window.scrollBy(0,y?-y:v),c||=window.scrollY!==E}c&&o(this,z,El).call(this)},Ht=function(e){let t=s(this,F);t&&(f(this,F,null),clearTimeout(t.timer),t.raf&&cancelAnimationFrame(t.raf),window.removeEventListener("pointermove",s(this,dn),!0),window.removeEventListener("pointerup",s(this,hn),!0),window.removeEventListener("pointercancel",s(this,pn),!0),window.removeEventListener("touchmove",s(this,ln),!0),window.removeEventListener("contextmenu",s(this,cn),!0),t.ghost?.remove(),t.started&&(t.card.moving=!1,this.dragging=!1,this.columns.forEach(i=>{i._drop=null}),e&&t.to&&t.toIndex!==void 0&&o(this,z,kl).call(this,t.card,t.from,t.fromIndex,t.to,t.toIndex,"pointer")))},Gs.properties={label:{string:"label"},hideEmpty:{type:Boolean,attribute:"hide-empty",reflect:!0},controlled:{type:Boolean,reflect:!0},dragging:{type:Boolean,reflect:!0}},Gs.styles=[w,b`
2048
+ </div>`}};Ee=new WeakMap,ve=new WeakMap,ne=new WeakMap,is=new WeakMap,J=new WeakMap,z=new WeakSet,Zh=function(e,t){let i=this.columns[t.group];return this.t(e,{card:s(this,ne)?.card.name??"",column:i?.heading??"",position:t.index+1,count:s(this,ve).slotCount(t.group)})},Pr=function(e){let t=this.columns,i=t.findIndex(r=>r.contains(e)&&e.parentElement===r);return i<0?null:{column:t[i],group:i,index:t[i].cards.indexOf(e)}},Gm=function(e){let t=()=>!!e.shadowRoot?.activeElement?.classList.contains("handle");e.focusHandle({preventScroll:!0}),requestAnimationFrame(()=>{s(this,ne)?.card===e&&!t()&&e.focusHandle({preventScroll:!0})})},Qh=function(){s(this,ne)&&(s(this,ne).card.moving=!1),g(this,ne,null)},Xm=function(e){let t=s(this,ne);if(this.columns.forEach((i,r)=>{i._drop=t&&e&&r===e.group?{card:t.card,index:e.index,height:t.card.getBoundingClientRect().height}:null}),e){let i=this.columns[e.group];i?.updateComplete.then(()=>{let r=i.renderRoot.querySelector("li.drop")??(t&&t.column===i?t.card:i);a(this,z,Jm).call(this,i,r)})}},Jm=function(e,t){let i=this.renderRoot.querySelector(".columns");if(i){let l=i.getBoundingClientRect(),d=e.getBoundingClientRect();d.left<l.left?i.scrollLeft-=l.left-d.left+8:d.right>l.right&&(i.scrollLeft+=d.right-l.right+8)}let r=e.scrollElement;if(r){let l=r.getBoundingClientRect(),d=t.getBoundingClientRect();d.top<l.top?r.scrollTop-=l.top-d.top+8:d.bottom>l.bottom&&(r.scrollTop+=d.bottom-l.bottom+8)}},Zm=function(e,t){let i=s(this,ne);if(a(this,z,Qh).call(this),!i)return;let r=this.columns[t.group];a(this,z,Jc).call(this,i.card,i.column,e.index,r,t.index,"keyboard")},Qm=function(e){let t=e[0];if(!(t instanceof HTMLElement)||!t.classList?.contains("handle"))return null;let i=e.find(r=>r.localName==="cm-board-card");return i&&a(this,z,Pr).call(this,i)?i:null},no=new WeakMap,ef=function(e,t){let i=a(this,z,Pr).call(this,e);if(!i)return null;let r=i.column.cards;if(t==="ArrowDown")return r[i.index+1]??null;if(t==="ArrowUp")return r[i.index-1]??null;let l=t==="ArrowRight"?1:-1,d=this.columns;for(let p=i.group+l;p>=0&&p<d.length;p+=l){let m=d[p].cards;if(m.length)return m[Math.min(i.index,m.length-1)]}return null},oo=new WeakMap,ep=function(e,t,i){e._sync(),t._sync().then(()=>{i?.isConnected&&i.focusHandle({preventScroll:!0})})},tp=function(e,t,i){let r=t.cards.filter(d=>d!==e),l=r[i];l?l.before(e):r.length?r[r.length-1].after(e):t.append(e)},ip=function(e,t){e!==t&&(typeof e.total=="number"&&(e.total=Math.max(0,e.total-1)),typeof t.total=="number"&&(t.total=t.total+1))},Jc=function(e,t,i,r,l,d){let p=e.name;if(t===r&&i===l)return d!=="api"&&s(this,Ee).announce(this.t("sameSpot",{card:p})),d==="keyboard"&&e.focusHandle({preventScroll:!0}),!1;let m=[],v={value:e.key,card:e,from:t.key,to:r.key,fromColumn:t,toColumn:r,fromIndex:i,toIndex:l,source:d,waitUntil:y=>{m.push(Promise.resolve(y))}};if(!this.dispatchEvent(new CustomEvent("cm-move",{detail:v,bubbles:!0,composed:!0,cancelable:!0})))return s(this,Ee).announce(this.t("refused",{card:p,column:r.heading})),d==="keyboard"&&e.focusHandle({preventScroll:!0}),!1;let $=r.cards.filter(y=>y!==e).length+1;if(this.controlled)d==="keyboard"&&a(this,z,tf).call(this,e.key,r);else{let y=d==="keyboard"||e.matches(":focus-within");a(this,z,tp).call(this,e,r,l);let M=t!==r;M&&a(this,z,ip).call(this,t,r),s(this,is).set(e,{card:e,from:t,fromIndex:i,to:r,toIndex:l,totals:M}),a(this,z,ep).call(this,t,r,y?e:null)}return s(this,Ee).announce(this.t("moved",{card:p,column:r.heading,position:l+1,count:$})),m.length&&(e.pending=!0,Promise.all(m).then(()=>{e.pending=!1,this.controlled||s(this,is).delete(e)},()=>{e.pending=!1,this.controlled?s(this,Ee).announce(this.t("reverted",{card:p,column:t.heading})):this.revert(e)})),!0},tf=function(e,t){let i=()=>t.isConnected?t.cards.find(d=>d.key===e):void 0,r=()=>{let d=i(),p=!document.activeElement||document.activeElement===document.body||!document.activeElement.isConnected;return!d||!(p||this.contains(document.activeElement))?!1:(t._sync().then(()=>d.updateComplete).then(()=>{d.isConnected&&d.focusHandle({preventScroll:!0})}),!0)},l=new MutationObserver(()=>{r()&&l.disconnect()});l.observe(this,{childList:!0,subtree:!0}),setTimeout(()=>l.disconnect(),1e3)},lo=new WeakMap,co=new WeakMap,ho=new WeakMap,po=new WeakMap,uo=new WeakMap,mo=new WeakMap,fo=new WeakMap,sp=function(){let e=s(this,J);e.started=!0,clearTimeout(e.timer),getSelection()?.removeAllRanges();let t=e.card.cloneNode(!0);t.removeAttribute("id"),t.removeAttribute("moving"),t.setAttribute("ghost",""),t.setAttribute("aria-hidden","true"),t.setAttribute("inert",""),Object.assign(t.style,{position:"fixed",zIndex:"2147483000",left:"0",top:"0",width:`${e.width}px`,margin:"0",pointerEvents:"none",willChange:"transform"}),(this.ownerDocument.body??this.ownerDocument.documentElement).appendChild(t),e.ghost=t,e.card.moving=!0,this.dragging=!0,e.to=e.from,e.toIndex=e.fromIndex,s(this,Ee).announce(this.t("pickedUp",{card:e.card.name,column:e.from.heading,position:e.fromIndex+1,count:e.from.cards.length})),a(this,z,rp).call(this),a(this,z,Zc).call(this);let i=()=>{s(this,J)?.started&&(a(this,z,sf).call(this),s(this,J).raf=requestAnimationFrame(i))};e.raf=requestAnimationFrame(i)},rp=function(){let e=s(this,J);e?.ghost&&(e.ghost.style.transform=`translate(${e.x-e.dx}px, ${e.y-e.dy}px)`)},Zc=function(){let e=s(this,J);if(!e)return;let t=this.columns;if(!t.length)return;let i=t[0],r=1/0;for(let m of t){let v=m.getBoundingClientRect(),b=e.x<v.left?v.left-e.x:e.x>v.right?e.x-v.right:0;b<r&&(i=m,r=b)}let l=i.cards.filter(m=>m!==e.card),d=l.length;if(i.collapsed)d=0;else for(let m=0;m<l.length;m++){let v=l[m].getBoundingClientRect();if(e.y<v.top+v.height/2){d=m;break}}if(i===e.to&&d===e.toIndex)return;let p=i!==e.to;e.to=i,e.toIndex=d,t.forEach(m=>{m._drop=m===i?{card:e.card,index:d,height:e.height}:null}),p&&s(this,Ee).announce(this.t("over",{column:i.heading,position:d+1,count:l.length+1}))},sf=function(){let e=s(this,J);if(!e)return;let t=48,i=16,r=$=>$<t?Math.ceil((t-Math.max($,0))/t*i):0,l=!1,d=this.renderRoot.querySelector(".columns");if(d){let $=d.getBoundingClientRect(),y=r(e.x-$.left),M=r($.right-e.x),A=d.scrollLeft;y?d.scrollLeft-=y:M&&(d.scrollLeft+=M),l||=d.scrollLeft!==A}let p=e.to?.scrollElement;if(p&&p.scrollHeight>p.clientHeight){let $=p.getBoundingClientRect();if(e.x>=$.left&&e.x<=$.right){let y=r(e.y-$.top),M=r($.bottom-e.y),A=p.scrollTop;y?p.scrollTop-=y:M&&(p.scrollTop+=M),l||=p.scrollTop!==A}}let m=window.innerHeight,v=r(e.y),b=r(m-e.y);if(v||b){let $=window.scrollY;window.scrollBy(0,v?-v:b),l||=window.scrollY!==$}l&&a(this,z,Zc).call(this)},gi=function(e){let t=s(this,J);t&&(g(this,J,null),clearTimeout(t.timer),t.raf&&cancelAnimationFrame(t.raf),window.removeEventListener("pointermove",s(this,uo),!0),window.removeEventListener("pointerup",s(this,mo),!0),window.removeEventListener("pointercancel",s(this,fo),!0),window.removeEventListener("touchmove",s(this,ho),!0),window.removeEventListener("contextmenu",s(this,po),!0),t.ghost?.remove(),t.started&&(t.card.moving=!1,this.dragging=!1,this.columns.forEach(i=>{i._drop=null}),e&&t.to&&t.toIndex!==void 0&&a(this,z,Jc).call(this,t.card,t.from,t.fromIndex,t.to,t.toIndex,"pointer")))},Or.properties={label:{string:"label"},hideEmpty:{type:Boolean,attribute:"hide-empty",reflect:!0},controlled:{type:Boolean,reflect:!0},dragging:{type:Boolean,reflect:!0}},Or.styles=[E,x`
1945
2049
  :host { position: relative; display: block; container-type: inline-size; container-name: cm-board; min-width: 0; }
1946
2050
  .board { height: 100%; }
1947
2051
  .columns {
@@ -1955,11 +2059,254 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1955
2059
  ::slotted(cm-board-column) { inline-size: calc(100% - 40px); scroll-snap-align: start; }
1956
2060
  ::slotted(cm-board-column[collapsed]) { inline-size: 48px; }
1957
2061
  }
1958
- `];g("cm-board",Gs);var Sx=M("reportTile",{pinned:", pinned"}),yi=class extends k{constructor(){super(...arguments);this.label="";this.icon="chart";this.href="";this.pinned=!1}render(){let e=l`
2062
+ `];w("cm-board",Or);var Hw=C("calendar",{label:"Calendar",previousMonth:"Previous month",nextMonth:"Next month",previousWeek:"Previous week",nextWeek:"Next week",previousDays:"Previous {count} days",nextDays:"Next {count} days",previousDay:"Previous day",nextDay:"Next day",today:"Today",views:"View",month:"Month",week:"Week",day:"Day",allDay:"All day",time:"Time",add:"Add",addOn:"Add on {date}",addAllDay:"Add an all-day event on {date}",addAt:"Add at {time}, {date}",more:"+{count} more",moreLabel:"{count} more on {date}",dayEvents:{one:"{date}, {count} event",other:"{date}, {count} events"},noEvents:"No events",loading:"Loading events",timeRange:"{start} to {end}",timed:"{date}, {time}",allDayOn:"{date}, all day",allDayRange:"{start} to {end}, all day",eventName:"{title}, {when}",eventNameKind:"{title}, {when}, {kind}",roleDescription:"movable event",openHint:"Press Enter to open.",instructions:"Press Space to pick up, then the arrow keys to choose a day or time, Space or Enter to drop and Escape to cancel.",gridHelp:"Use the arrow keys to move between days, times and events, and Page Up and Page Down for the previous or next period.",saving:"Saving",pickedUp:"Picked up {event}. {place}.",over:"{place}.",moved:"Moved {event} to {place}.",sameSpot:"{event} dropped where it started.",cancelled:"Move cancelled. {event} is back on {place}.",refused:"{event} can't be moved to {place}.",reverted:"Couldn't move {event}. It is back on {place}."}),Ur=class extends L{constructor(){super(...arguments);this.value="";this.heading="";this.label="";this.start="";this.end="";this.allDay=!1;this.kind="";this.tone="neutral";this.icon="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1}get name(){return this.label||this.heading||(this.textContent??"").replace(/\s+/g," ").trim()}get key(){return this.value||this.name}updated(){let e=this.parentElement;e?.localName==="cm-calendar"&&e.requestUpdate()}render(){return h}};Ur.properties={value:{reflect:!0},heading:{},label:{},start:{},end:{},allDay:{type:Boolean,attribute:"all-day",reflect:!0},kind:{},tone:{reflect:!0},icon:{},href:{},locked:{type:Boolean,reflect:!0},pending:{type:Boolean,reflect:!0},moving:{type:Boolean,reflect:!0}},Ur.styles=x`:host { display: none !important; }`;w("cm-calendar-event",Ur);var nd=o=>String(o).padStart(2,"0"),rf=o=>`${H(o)}T${nd(o.getHours())}:${nd(o.getMinutes())}`,ed=(o,n)=>Math.round((Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())-Date.UTC(o.getFullYear(),o.getMonth(),o.getDate()))/864e5),af=["month","week","day"],Zg=600,nf=new Map,of=(o,n)=>{let e=`${o}|${JSON.stringify(n)}`,t=nf.get(e);return t||(t=new Intl.DateTimeFormat(o,n),nf.set(e,t)),t},ap=o=>o.replace(/[  ]/g," ").trim(),Wr,Me,Te,fe,G,X,rs,vt,je,Eo,as,Yr,Gr,Xr,Jr,Mo,f,xe,vi,go,td,bt,np,bo,lt,op,lf,ct,jr,cf,df,Fe,vo,xo,id,hf,pf,uf,ss,lp,yo,mf,wo,ff,gf,bf,vf,To,Co,xf,yf,_o,$o,wf,cp,dp,hp,$f,kf,pp,up,mp,Lo,fp,Ef,So,zo,Do,Ao,No,Ro,gp,sd,Mf,xi,ko,Tf,bp,Cf,rd,vp,Vr,ad,_f,Lf,Sf,zf,Df,Kr=class extends T{constructor(){super();u(this,f);this.view="month";this.date="";this.today="";this.step=15;u(this,Wr,"");this.hourCycle="";this.dayStart=8;this.maxEvents=3;this.headingLevel=2;this.loading=!1;this.readonly=!1;this.controlled=!1;this.dragging=!1;this._narrow=!1;this._more="";this._target=null;u(this,Me,D("cm-cal"));u(this,Te,new Qi);u(this,fe);u(this,G,null);u(this,X,null);u(this,rs,new WeakMap);u(this,vt,"");u(this,je,null);u(this,Eo,"");u(this,as,!0);u(this,Yr,0);u(this,Gr,!1);u(this,Xr);u(this,Jr,0);u(this,Mo,new MutationObserver(()=>this.requestUpdate()));u(this,To,e=>{let t=e.composedPath()[0];if(t instanceof HTMLElement&&t.classList.contains("item")&&t.dataset.k){g(this,vt,t.dataset.k);for(let i of a(this,f,wo).call(this))i.tabIndex=i===t?0:-1}});u(this,Co,e=>{let t=e.relatedTarget;if(this._more&&!s(this,G)){let i=this.renderRoot.querySelector(".pop"),r=e.composedPath()[0];i&&i.contains(r)&&!(t&&i.contains(t))&&queueMicrotask(()=>{i.contains(this.renderRoot.activeElement)||(this._more="")})}!s(this,fe).active||!s(this,G)||!t&&document.hasFocus()===!1||this.updateComplete.then(()=>setTimeout(()=>{if(!s(this,fe).active||!s(this,G))return;this.renderRoot.activeElement?.dataset.ev!==s(this,G).ev.key&&s(this,fe).cancel()}))});u(this,_o,e=>{if(s(this,X)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=re(e,this);if(s(this,fe).active){s(this,fe).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}if(e.altKey||e.ctrlKey||e.metaKey)return;let i=e.composedPath()[0];if(!(i instanceof HTMLElement)||i.getRootNode()!==this.renderRoot)return;let r=i.closest(".pop");if(r&&e.key==="Escape"){e.preventDefault(),a(this,f,rd).call(this,!0);return}if(i.dataset.ev&&e.key===" "){e.preventDefault(),g(this,Yr,performance.now()+400),this.pickUp(i.dataset.ev,i.dataset.day);return}if(r&&(t==="ArrowDown"||t==="ArrowUp")){let d=[...r.querySelectorAll(".chip")],p=d[d.indexOf(i)+(t==="ArrowDown"?1:-1)];p&&(e.preventDefault(),p.focus());return}if(!i.classList.contains("item"))return;if(e.key==="PageUp"||e.key==="PageDown"){e.preventDefault(),a(this,f,yf).call(this,i,e.key==="PageUp"?-1:1);return}let l=a(this,f,xf).call(this,i,t);l?(e.preventDefault(),a(this,f,vf).call(this,l)):(t.startsWith("Arrow")||t==="Home"||t==="End")&&e.preventDefault()});u(this,Lo,e=>{e.composedPath().some(t=>t.dataset?.ev)&&e.preventDefault()});u(this,So,e=>{if(s(this,X)||this.readonly||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath().find(p=>p.dataset?.ev);if(!t)return;let i=this.event(t.dataset.ev),r=i&&a(this,f,jr).call(this,i);if(!r||i.locked||i.pending)return;let l=a(this,f,dp).call(this,r,t.dataset.day??r.days[0]);if(!l)return;s(this,fe).active&&s(this,fe).cancel();let d=0;if(l.mode==="time"){let p=a(this,f,fp).call(this,e.clientX,e.clientY);p&&t.classList.contains("time")&&(d=Math.max(0,Math.min(r.dur,p.min-r.min)))}g(this,X,{...l,pointerId:e.pointerId,type:e.pointerType,x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY,started:!1,grab:d,to:{...l.from}}),e.pointerType!=="mouse"&&(s(this,X).timer=setTimeout(()=>{s(this,X)&&!s(this,X).started&&a(this,f,gp).call(this)},300)),window.addEventListener("pointermove",s(this,Ao),!0),window.addEventListener("pointerup",s(this,No),!0),window.addEventListener("pointercancel",s(this,Ro),!0),window.addEventListener("touchmove",s(this,zo),{capture:!0,passive:!1}),window.addEventListener("contextmenu",s(this,Do),!0)});u(this,zo,e=>{s(this,X)?.started&&e.cancelable&&e.preventDefault()});u(this,Do,e=>{s(this,X)&&e.preventDefault()});u(this,Ao,e=>{let t=s(this,X);if(!(!t||e.pointerId!==t.pointerId)){if(t.x=e.clientX,t.y=e.clientY,!t.started){let i=Math.hypot(t.x-t.x0,t.y-t.y0);(t.type==="mouse"?i>4:i>8)&&(t.type==="mouse"?a(this,f,gp).call(this):a(this,f,xi).call(this,!1));return}e.preventDefault(),a(this,f,sd).call(this)}});u(this,No,e=>{let t=s(this,X);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){a(this,f,xi).call(this,!1);return}let i=r=>{r.stopPropagation(),r.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),a(this,f,xi).call(this,!0)});u(this,Ro,e=>{s(this,X)&&e.pointerId===s(this,X).pointerId&&a(this,f,xi).call(this,!1)});g(this,fe,new Zi({groupCount:()=>a(this,f,ct).call(this).length,slotCount:()=>s(this,G)?s(this,G).mode==="day"?1:a(this,f,$o).call(this,s(this,G).ev.dur):0,navigate:(e,t)=>a(this,f,wf).call(this,e,t),onTarget:e=>a(this,f,$f).call(this,e),onDrop:(e,t)=>a(this,f,kf).call(this,e,t),onCancel:()=>a(this,f,hp).call(this),messages:{pickedUp:e=>this.t("pickedUp",{event:s(this,G)?.ev.name??"",place:a(this,f,ss).call(this,s(this,G),e)}),over:e=>this.t("over",{place:a(this,f,ss).call(this,s(this,G),e)}),cancelled:e=>this.t("cancelled",{event:s(this,G)?.ev.name??"",place:a(this,f,ss).call(this,s(this,G),e)})},announce:e=>s(this,Te).announce(e)}))}get locale(){return s(this,Wr)}set locale(e){let t=s(this,Wr);g(this,Wr,e??""),this.requestUpdate("locale",t)}get events(){return[...this.children].filter(e=>e.localName==="cm-calendar-event")}event(e){return this.events.find(t=>t.key===e)}get range(){let e=a(this,f,ct).call(this);return{view:s(this,f,xe),start:H(e[0]),end:H(e[e.length-1])}}get heldEvent(){return s(this,G)?.ev.el??null}get announcement(){return s(this,Te).text}announce(e){s(this,Te).announce(e)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",s(this,_o)),this.addEventListener("focusin",s(this,To)),this.addEventListener("focusout",s(this,Co)),this.addEventListener("pointerdown",s(this,So)),this.addEventListener("dragstart",s(this,Lo)),s(this,Mo).observe(this,{childList:!0}),typeof ResizeObserver<"u"&&(g(this,Xr,new ResizeObserver(()=>{cancelAnimationFrame(s(this,Jr)),g(this,Jr,requestAnimationFrame(()=>a(this,f,lp).call(this)))})),s(this,Xr).observe(this)),a(this,f,lp).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",s(this,_o)),this.removeEventListener("focusin",s(this,To)),this.removeEventListener("focusout",s(this,Co)),this.removeEventListener("pointerdown",s(this,So)),this.removeEventListener("dragstart",s(this,Lo)),s(this,Mo).disconnect(),s(this,Xr)?.disconnect(),cancelAnimationFrame(s(this,Jr)),s(this,fe).cancel(!0),a(this,f,xi).call(this,!1)}willUpdate(e){e.has("view")&&(g(this,as,!0),e.get("view")!==void 0&&(this._more="",s(this,fe).cancel(!0))),(e.has("date")||e.has("_narrow"))&&(this._more=this._more&&this.range.start<=this._more&&this._more<=this.range.end?this._more:"")}firstUpdated(){this.renderRoot.appendChild(s(this,Te).element)}updated(){if(a(this,f,bf).call(this),s(this,je)){let r=a(this,f,ff).call(this,s(this,je).key);r?(g(this,je,null),r.focus({preventScroll:!1})):Date.now()>s(this,je).until&&g(this,je,null)}s(this,Gr)&&(g(this,Gr,!1),(this.renderRoot.querySelector(".pop .chip")??this.renderRoot.querySelector(".pop button"))?.focus());let e=this.renderRoot.querySelector(".tg");if(e&&s(this,as)){let r=e.querySelector(".tcell"),l=Math.max(0,Math.min(23,Math.trunc(Number(this.dayStart))||0));r&&(e.scrollTop=r.offsetHeight*l),g(this,as,!1)}e||g(this,as,!0),s(this,G)&&this._target&&this.renderRoot.querySelector(".ph")?.scrollIntoView?.({block:"nearest",inline:"nearest"});let t=this.range,i=`${t.view}|${t.start}|${t.end}`;i!==s(this,Eo)&&(g(this,Eo,i),this.dispatchEvent(new CustomEvent("cm-range-change",{detail:t,bubbles:!0,composed:!0})))}previous(){this.date=H(a(this,f,yo).call(this,s(this,f,lt),-1))}next(){this.date=H(a(this,f,yo).call(this,s(this,f,lt),1))}goToToday(){this.date=s(this,f,bo)}pickUp(e,t){let i=typeof e=="string"?this.event(e):e;if(!i||i.locked||i.pending||this.readonly)return!1;let r=a(this,f,jr).call(this,i);if(!r)return!1;let l=a(this,f,ct).call(this).map(H),d=t&&r.days.includes(t)&&l.includes(t)?t:r.days.find(v=>l.includes(v));if(!d)return!1;let p=a(this,f,dp).call(this,r,d);if(!p)return!1;a(this,f,xi).call(this,!1),s(this,fe).cancel(!0),this._more="",g(this,G,p),i.moving=!0;let m=`ev:${r.key}:${d}`;return g(this,vt,m),g(this,je,{key:m,until:Date.now()+1e3}),this.requestUpdate(),s(this,fe).pickUp(p.from),!0}cancelMove(){let e=s(this,X);e?.started&&(a(this,f,xi).call(this,!1),s(this,Te).announce(this.t("cancelled",{event:e.ev.name,place:a(this,f,ss).call(this,e,e.from)}))),s(this,fe).cancel()}moveEvent(e,t,i){let r=typeof e=="string"?this.event(e):e,l=r&&a(this,f,jr).call(this,r);if(!l)return!1;let d=l.allDay?N(Ye(t).date||t):pt(t);if(!d)return!1;let p=i?l.allDay?N(Ye(i).date||i):pt(i):null;return(!p||p<d)&&(p=l.allDay?U(d,ed(l.start,l.end)):new Date(d.getTime()+l.dur*6e4)),a(this,f,mp).call(this,l,d,p,"api",!1,H(d))}revert(e){let t=typeof e=="string"?this.event(e):e;if(!t)return!1;t.pending=!1;let i=s(this,rs).get(t);if(this.controlled||!i)return!1;s(this,rs).delete(t);let r=this.renderRoot.activeElement?.dataset.ev===t.key;t.start=i.start,t.end=i.end;let l=a(this,f,jr).call(this,t);return l&&r&&g(this,je,{key:`ev:${l.key}:${l.days[0]}`,until:Date.now()+1e3}),s(this,Te).announce(this.t("reverted",{event:t.name,place:l?a(this,f,id).call(this,l):i.start})),!0}render(){let e=a(this,f,ct).call(this),t=a(this,f,df).call(this,a(this,f,cf).call(this));return c`<div class="cal ${this._narrow?"narrow":""}" role="group" aria-label=${this.label}>
2063
+ ${a(this,f,_f).call(this,e)}
2064
+ ${s(this,f,xe)==="month"?a(this,f,Sf).call(this,e,t):a(this,f,Df).call(this,e,t)}
2065
+ <span class="vh" role="status">${this.loading?this.t("loading"):""}</span>
2066
+ <span id="${s(this,Me)}-gh" hidden>${this.t("gridHelp")}</span>
2067
+ <span id="${s(this,Me)}-mv" hidden>${this.t("openHint")} ${this.t("instructions")}</span>
2068
+ <span id="${s(this,Me)}-op" hidden>${this.t("openHint")}</span>
2069
+ </div>`}};Wr=new WeakMap,Me=new WeakMap,Te=new WeakMap,fe=new WeakMap,G=new WeakMap,X=new WeakMap,rs=new WeakMap,vt=new WeakMap,je=new WeakMap,Eo=new WeakMap,as=new WeakMap,Yr=new WeakMap,Gr=new WeakMap,Xr=new WeakMap,Jr=new WeakMap,Mo=new WeakMap,f=new WeakSet,xe=function(){return af.includes(this.view)?this.view:"month"},vi=function(){return Hs(this,this.locale)},go=function(){return Ps(s(this,f,vi))},td=function(){return Yl(s(this,f,vi),this.hourCycle)},bt=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=240?e:15},np=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Is(s(this,f,vi)):(Math.trunc(e)%7+7)%7},bo=function(){return N(this.today)?this.today:Gd()},lt=function(){return N(this.date)??N(s(this,f,bo))},op=function(){return s(this,f,xe)==="month"&&this._narrow},lf=function(){return s(this,f,xe)!=="month"},ct=function(){let e=s(this,f,lt),t=s(this,f,np);if(s(this,f,xe)==="day")return[e];if(s(this,f,xe)==="week"){if(this._narrow)return[e,U(e,1),U(e,2)];let d=U(e,-((e.getDay()-t+7)%7));return Array.from({length:7},(p,m)=>U(d,m))}let i=Tt(e),r=U(i,-((i.getDay()-t+7)%7)),l=Math.ceil((ed(r,Ns(e))+1)/7)*7;return Array.from({length:l},(d,p)=>U(r,p))},jr=function(e){let t=e.name,i=!!N(e.start),r=e.allDay||i;if(r){let m=N(Ye(e.start).date||e.start);if(!m)return null;let v=N(Ye(e.end).date||e.end)??m;v<m&&(v=m);let b=Math.min(ed(m,v),366);return{el:e,key:e.key,name:t,allDay:r,start:m,end:v,min:0,dur:1440,days:Array.from({length:b+1},($,y)=>H(U(m,y)))}}let l=pt(e.start);if(!l)return null;let d=pt(e.end);(!d||d<=l)&&(d=new Date(l.getTime()+30*6e4));let p=Math.max(1,Math.round((d.getTime()-l.getTime())/6e4));return{el:e,key:e.key,name:t,allDay:r,start:l,end:d,min:l.getHours()*60+l.getMinutes(),dur:p,days:[H(l)]}},cf=function(){return this.events.map(e=>a(this,f,jr).call(this,e)).filter(e=>!!e)},df=function(e){let t=new Map;for(let i of e)for(let r of i.days)(t.get(r)??t.set(r,[]).get(r)).push(i);for(let i of t.values())i.sort((r,l)=>(r.allDay===l.allDay?0:r.allDay?-1:1)||r.start.getTime()-l.start.getTime()||r.name.localeCompare(l.name));return t},Fe=function(e){return ee(e,{weekday:"long",day:"numeric",month:"long"},s(this,f,vi))},vo=function(e){return s(this,f,td).format((e%1440+1440)%1440)},xo=function(e,t){let i=this.hourCycle==="h12"||this.hourCycle==="h23"?{hourCycle:this.hourCycle}:{},r=of(s(this,f,vi),{hour:"numeric",minute:"2-digit",...i});try{if(H(e)===H(t)&&r.formatRangeToParts){let p=r.formatRangeToParts(e,t),m=p.findIndex(b=>b.source==="endRange"),v=-1;if(p.forEach((b,$)=>{b.source==="startRange"&&(v=$)}),v>=0&&m>v){let b=$=>ap($.map(y=>y.value).join(""));return this.t("timeRange",{start:b(p.slice(0,v+1)),end:b(p.slice(m))})}}}catch{}let l=H(e)===H(t),d=p=>l?a(this,f,vo).call(this,p.getHours()*60+p.getMinutes()):s(this,f,td).dateTime(p);return this.t("timeRange",{start:d(e),end:d(t)})},id=function(e){return e.allDay?H(e.start)===H(e.end)?this.t("allDayOn",{date:a(this,f,Fe).call(this,e.start)}):this.t("allDayRange",{start:a(this,f,Fe).call(this,e.start),end:a(this,f,Fe).call(this,e.end)}):H(e.start)!==H(e.end)&&!(e.end.getHours()===0&&e.end.getMinutes()===0&&ed(e.start,e.end)===1)?a(this,f,xo).call(this,e.start,e.end):this.t("timed",{date:a(this,f,Fe).call(this,e.start),time:a(this,f,xo).call(this,e.start,e.end)})},hf=function(e){let t={title:e.name,when:a(this,f,id).call(this,e),kind:e.el.kind};return this.t(e.el.kind?"eventNameKind":"eventName",t)},pf=function(e){let t=s(this,f,vi);if(s(this,f,xe)==="month")return s(this,f,go).monthYear(s(this,f,lt));if(e.length===1)return ee(e[0],{weekday:"long",day:"numeric",month:"long",year:"numeric"},t);let i=of(t,{day:"numeric",month:"short",year:"numeric"});try{if(i.formatRange)return ap(i.formatRange(e[0],e[e.length-1]))}catch{}return`${i.format(e[0])} \u2013 ${i.format(e[e.length-1])}`},uf=function(e){return s(this,f,td).hour12?ap(ee(new Date(2e3,0,1,e),{hour:"numeric",hourCycle:"h12"},s(this,f,vi))):a(this,f,vo).call(this,e*60)},ss=function(e,t){let{start:i,end:r}=a(this,f,cp).call(this,e,t);return e.mode==="time"?this.t("timed",{date:a(this,f,Fe).call(this,i),time:a(this,f,xo).call(this,i,r)}):a(this,f,Fe).call(this,U(N(e.origin),t.group-e.from.group))},lp=function(){let e=this.getBoundingClientRect().width;if(!e)return;let t=e<Zg;t!==this._narrow&&(this._narrow=t)},yo=function(e,t){return s(this,f,xe)==="month"?We(e,t):s(this,f,xe)==="week"?U(e,t*(this._narrow?3:7)):U(e,t)},mf=function(e){this.view!==e&&(this.view=e)},wo=function(){return[...this.renderRoot.querySelectorAll(".item")]},ff=function(e){let t=[...this.renderRoot.querySelectorAll("[data-k]")],i=t.find(r=>r.dataset.k===e&&r.classList.contains("item"))??t.find(r=>r.dataset.k===e);if(i)return i;if(e.startsWith("ev:")&&!this.controlled){let r=e.slice(e.lastIndexOf(":")+1);return t.find(l=>l.dataset.k===`more:${r}`)??null}return null},gf=function(){let e=H(s(this,f,lt));if(s(this,f,op))return`day:${e}`;if(s(this,f,xe)==="month")return this.readonly?`cell:${e}`:`add:${e}`;let t=Math.max(0,Math.min(23,Math.trunc(Number(this.dayStart))||0));return`slot:${e}:${t}`},bf=function(){let e=a(this,f,wo).call(this);if(!e.length)return;let t=e.find(i=>i.dataset.k===s(this,vt))??e.find(i=>i.dataset.k===a(this,f,gf).call(this))??e.find(i=>i.dataset.day===H(s(this,f,lt)))??e[0];for(let i of e)i.tabIndex=i===t?0:-1},vf=function(e){g(this,vt,e.dataset.k??"");for(let t of a(this,f,wo).call(this))t.tabIndex=t===e?0:-1;e.focus()},To=new WeakMap,Co=new WeakMap,xf=function(e,t){let i=new Map;for(let y of a(this,f,wo).call(this)){let M=Number(y.dataset.i);(i.get(M)??i.set(M,[]).get(M)).push(y)}let r=Number(e.dataset.i),l=i.get(r)??[e],d=Math.max(0,l.indexOf(e)),p=a(this,f,ct).call(this).length,m=s(this,f,xe)==="month",v=e.dataset.row,b=(y,M)=>{let A=y>=0&&y<p?i.get(y):void 0;return(A?.length?M(A):void 0)??null},$=y=>m?y[Math.min(d,y.length-1)]:y.find(M=>M.dataset.row===v)??y[0];switch(t){case"ArrowRight":return b(r+1,$);case"ArrowLeft":return b(r-1,$);case"ArrowDown":return l[d+1]??(m?b(r+7,y=>y[0]):null);case"ArrowUp":return d>0?l[d-1]:m?b(r-7,y=>y[y.length-1]):null;case"Home":return m?b(r-r%7,y=>y[0]):b(0,$);case"End":return m?b(Math.min(p-1,r-r%7+6),y=>y[0]):b(p-1,$);default:return null}},yf=function(e,t){let i=e.dataset.day??H(s(this,f,lt)),r=a(this,f,yo).call(this,N(i)??s(this,f,lt),t),l=H(r),d=(e.dataset.k??"").split(":")[0],p;s(this,f,op)?p=`day:${l}`:s(this,f,xe)==="month"?p=this.readonly?`cell:${l}`:`add:${l}`:d==="adadd"||e.dataset.row==="a"?p=`adadd:${l}`:p=`slot:${l}:${e.dataset.row??this.dayStart}`,this.date=H(a(this,f,yo).call(this,s(this,f,lt),t)),g(this,vt,p),g(this,je,{key:p,until:Date.now()+1e3})},_o=new WeakMap,$o=function(e){return Math.floor((1440-Math.min(e,1440))/s(this,f,bt))+1},wf=function(e,t){let i=s(this,G);if(!i)return null;let r=a(this,f,ct).call(this).length,l=v=>Math.max(0,Math.min(r-1,v));if(i.mode==="day"){let v=s(this,f,xe)==="month";switch(e){case"ArrowRight":return{group:l(t.group+1),index:0};case"ArrowLeft":return{group:l(t.group-1),index:0};case"ArrowDown":return v?{group:t.group+7<r?t.group+7:t.group,index:0}:{...t};case"ArrowUp":return v?{group:t.group-7>=0?t.group-7:t.group,index:0}:{...t};case"Home":return{group:v?t.group-t.group%7:0,index:0};case"End":return{group:v?l(t.group-t.group%7+6):r-1,index:0};default:return null}}let d=a(this,f,$o).call(this,i.ev.dur)-1,p=Math.max(1,Math.round(60/s(this,f,bt))),m=v=>Math.max(0,Math.min(d,v));switch(e){case"ArrowRight":return{group:l(t.group+1),index:t.index};case"ArrowLeft":return{group:l(t.group-1),index:t.index};case"ArrowDown":return{group:t.group,index:m(t.index+1)};case"ArrowUp":return{group:t.group,index:m(t.index-1)};case"PageDown":return{group:t.group,index:m(t.index+p)};case"PageUp":return{group:t.group,index:m(t.index-p)};case"Home":return{group:t.group,index:0};case"End":return{group:t.group,index:d};default:return null}},cp=function(e,t){let{ev:i}=e;if(e.mode==="time"){let d=a(this,f,ct).call(this)[t.group]??N(e.origin),p=new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,t.index*s(this,f,bt));return{start:p,end:new Date(p.getTime()+i.dur*6e4)}}let r=t.group-e.from.group,l=d=>new Date(d.getFullYear(),d.getMonth(),d.getDate()+r,d.getHours(),d.getMinutes());return{start:l(i.start),end:l(i.end)}},dp=function(e,t){let r=a(this,f,ct).call(this).map(H).indexOf(t);if(r<0)return null;let l=s(this,f,lf)&&!e.allDay?"time":"day",d=l==="time"?Math.min(Math.floor(e.min/s(this,f,bt)),a(this,f,$o).call(this,e.dur)-1):0;return{ev:e,origin:t,mode:l,from:{group:r,index:d}}},hp=function(){s(this,G)&&(s(this,G).ev.el.moving=!1),g(this,G,null),this._target=null},$f=function(e){let t=s(this,G);if(!t||!e){this._target=null;return}let i=H(a(this,f,ct).call(this)[e.group]??N(t.origin)),r=e.group===t.from.group&&e.index===t.from.index;this._target=r?null:{iso:i,min:t.mode==="time"?e.index*s(this,f,bt):void 0}},kf=function(e,t){let i=s(this,G);a(this,f,hp).call(this),i&&(g(this,Yr,performance.now()+400),a(this,f,pp).call(this,i,e,t,"keyboard"))},pp=function(e,t,i,r){let l=t.group===i.group&&t.index===i.index,{start:d,end:p}=a(this,f,cp).call(this,e,i),m=H(U(N(e.origin),i.group-t.group));a(this,f,mp).call(this,e.ev,d,p,r,l,e.mode==="time"?H(d):m)},up=function(e,t,i){return e?{start:H(t),end:H(i)}:{start:rf(t),end:rf(i)}},mp=function(e,t,i,r,l,d){let p=e.el,m=e.name,v=a(this,f,up).call(this,e.allDay,e.start,e.end),b=a(this,f,up).call(this,e.allDay,t,i),$=V=>{r==="keyboard"&&g(this,je,{key:V,until:Date.now()+1e3})};if(l||v.start===b.start&&v.end===b.end)return r!=="api"&&s(this,Te).announce(this.t("sameSpot",{event:m})),this.requestUpdate(),!1;let y={...e,start:t,end:i},M=e.allDay?a(this,f,Fe).call(this,t):this.t("timed",{date:a(this,f,Fe).call(this,t),time:a(this,f,xo).call(this,t,i)}),A=[],I={value:e.key,event:p,from:v,to:b,allDay:e.allDay,source:r,waitUntil:V=>{A.push(Promise.resolve(V))}};return this.dispatchEvent(new CustomEvent("cm-move",{detail:I,bubbles:!0,composed:!0,cancelable:!0}))?(this.controlled||(s(this,rs).set(p,v),p.start=b.start,p.end=b.end),$(`ev:${e.key}:${d}`),this.requestUpdate(),s(this,Te).announce(this.t("moved",{event:m,place:y.allDay?a(this,f,Fe).call(this,t):M})),A.length&&(p.pending=!0,Promise.all(A).then(()=>{p.pending=!1,this.controlled||s(this,rs).delete(p)},()=>{p.pending=!1,this.controlled?s(this,Te).announce(this.t("reverted",{event:m,place:a(this,f,id).call(this,e)})):this.revert(p)})),!0):(s(this,Te).announce(this.t("refused",{event:m,place:M})),this.requestUpdate(),!1)},Lo=new WeakMap,fp=function(e,t){let i=[...this.renderRoot.querySelectorAll('.tcell[data-row="0"]')];if(!i.length)return null;let r=0,l=1/0;i.forEach((p,m)=>{let v=p.getBoundingClientRect(),b=e<v.left?v.left-e:e>v.right?e-v.right:0;b<l&&(l=b,r=Number(p.dataset.i??m))});let d=i[0].getBoundingClientRect();return{group:r,min:(t-d.top)/d.height*60}},Ef=function(e,t){let i=[...this.renderRoot.querySelectorAll("[data-drop]")];if(!i.length)return null;let r=null,l=1/0;for(let d of i){let p=d.getBoundingClientRect(),m=e<p.left?p.left-e:e>p.right?e-p.right:0,v=t<p.top?p.top-t:t>p.bottom?t-p.bottom:0,b=Math.hypot(m,v);b<l&&(l=b,r=d)}return r?Number(r.dataset.i):null},So=new WeakMap,zo=new WeakMap,Do=new WeakMap,Ao=new WeakMap,No=new WeakMap,Ro=new WeakMap,gp=function(){let e=s(this,X);e.started=!0,clearTimeout(e.timer),getSelection()?.removeAllRanges(),this._more="",e.ev.el.moving=!0,this.dragging=!0,s(this,Te).announce(this.t("pickedUp",{event:e.ev.name,place:a(this,f,ss).call(this,e,e.from)})),a(this,f,sd).call(this);let t=()=>{s(this,X)?.started&&(a(this,f,Mf).call(this),s(this,X).raf=requestAnimationFrame(t))};e.raf=requestAnimationFrame(t)},sd=function(){let e=s(this,X);if(!e)return;let t=null;if(e.mode==="time"){let l=a(this,f,fp).call(this,e.x,e.y);if(l){let d=a(this,f,$o).call(this,e.ev.dur)-1;t={group:l.group,index:Math.max(0,Math.min(d,Math.round((l.min-e.grab)/s(this,f,bt))))}}}else{let l=a(this,f,Ef).call(this,e.x,e.y);l!==null&&(t={group:l,index:0})}if(!t||t.group===e.to.group&&t.index===e.to.index&&this._target)return;let i=t.group!==e.to.group;e.to=t;let r=t.group===e.from.group&&t.index===e.from.index;this._target=r?null:{iso:H(a(this,f,ct).call(this)[t.group]),min:e.mode==="time"?t.index*s(this,f,bt):void 0},i&&s(this,Te).announce(this.t("over",{place:a(this,f,ss).call(this,e,t)}))},Mf=function(){let e=s(this,X),t=this.renderRoot.querySelector(".tg");if(!e||!t||e.mode!=="time")return;let i=40,r=14,l=$=>$<i?Math.ceil((i-Math.max($,0))/i*r):0,d=t.getBoundingClientRect();if(e.x<d.left||e.x>d.right)return;let p=t.querySelector(".tg-top")?.getBoundingClientRect().bottom??d.top,m=l(e.y-p),v=l(d.bottom-e.y),b=t.scrollTop;m?t.scrollTop-=m:v&&(t.scrollTop+=v),t.scrollTop!==b&&a(this,f,sd).call(this)},xi=function(e){let t=s(this,X);t&&(g(this,X,null),clearTimeout(t.timer),t.raf&&cancelAnimationFrame(t.raf),window.removeEventListener("pointermove",s(this,Ao),!0),window.removeEventListener("pointerup",s(this,No),!0),window.removeEventListener("pointercancel",s(this,Ro),!0),window.removeEventListener("touchmove",s(this,zo),!0),window.removeEventListener("contextmenu",s(this,Do),!0),t.started&&(t.ev.el.moving=!1,this.dragging=!1,this._target=null,e&&a(this,f,pp).call(this,t,t.from,t.to,"pointer")))},ko=function(e,t){this.readonly||this.dispatchEvent(new CustomEvent("cm-add",{detail:{start:e,allDay:t,view:s(this,f,xe)},bubbles:!0,composed:!0}))},Tf=function(e,t,i){let r=i*60;if(e.detail>0){let p=e.currentTarget.getBoundingClientRect(),m=Math.floor((e.clientY-p.top)/p.height*60/s(this,f,bt))*s(this,f,bt);r+=Math.max(0,Math.min(59,m))}let l=Math.floor(r/60),d=r%60;a(this,f,ko).call(this,`${t}T${nd(l)}:${nd(d)}`,!1)},bp=function(e,t){if(performance.now()<s(this,Yr)||s(this,fe).active){e.preventDefault();return}this.dispatchEvent(new CustomEvent("cm-open",{detail:{value:t.key,event:t.el},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault()},Cf=function(e){this._more=e,g(this,Gr,!0)},rd=function(e){let t=this._more;this._more="",e&&t&&(g(this,vt,`more:${t}`),g(this,je,{key:`more:${t}`,until:Date.now()+1e3}))},vp=function(){return s(this,G)?.ev??(s(this,X)?.started?s(this,X).ev:null)},Vr=function(e,t,i,r,l,d={}){let p=e.el,m=p.pending,v=a(this,f,hf).call(this,e),b=!this.readonly&&!p.locked&&!m,$=["attention","information","success","critical"].includes(p.tone)?p.tone:"neutral",y=`chip ${r} tone-${$}${l?" item":""}${p.moving?" moving":""}${m?" pending":""}${p.locked?" locked":""}`,M=p.icon?c`<cm-icon name=${p.icon} size="14"></cm-icon>`:h,A=e.allDay?h:c`<span class="tm">${a(this,f,vo).call(this,e.min)}</span>`,I=p.kind&&(r!=="month"||!p.icon)?c`<span class="k">${p.kind}</span>`:h,B=m?c`<span class="spin" aria-hidden="true"></span>`:h,V=r==="time"?c`<span class="lead">${M}${A}${B}</span><span class="h">${e.name}</span>${I}`:c`${M}${A}<span class="h">${e.name}</span>${I}${B}`,Q=m?`${v}, ${this.t("saving")}`:v,yt=b?`${s(this,Me)}-mv`:`${s(this,Me)}-op`,F=`ev:${e.key}:${t}`,Re=b?this.t("roleDescription"):h;return p.href?c`<a class=${y} href=${p.href} style=${d.style??h} data-k=${F} data-ev=${e.key} data-day=${t} data-i=${i}
2070
+ data-row=${d.row??h} aria-label=${Q} aria-describedby=${yt} aria-roledescription=${Re}
2071
+ @click=${it=>a(this,f,bp).call(this,it,e)}>${V}</a>`:c`<button type="button" class=${y} style=${d.style??h} data-k=${F} data-ev=${e.key} data-day=${t} data-i=${i}
2072
+ data-row=${d.row??h} aria-label=${Q} aria-describedby=${yt} aria-roledescription=${Re}
2073
+ @click=${it=>a(this,f,bp).call(this,it,e)}>${V}</button>`},ad=function(e,t="",i){return c`<div class="ph ${t}" style=${i??h} aria-hidden="true">${e.name}</div>`},_f=function(e){let t=s(this,f,xe),i=t==="week"&&this._narrow,r=t==="month"?this.t("previousMonth"):i?this.t("previousDays",{count:3}):t==="week"?this.t("previousWeek"):this.t("previousDay"),l=t==="month"?this.t("nextMonth"):i?this.t("nextDays",{count:3}):t==="week"?this.t("nextWeek"):this.t("nextDay"),d=Math.min(6,Math.max(1,Math.round(Number(this.headingLevel))||2));return c`<div class="head" part="header">
2074
+ <div class="nav">
2075
+ <button type="button" class="hb icon prev" aria-label=${r} @click=${()=>this.previous()}><cm-icon name="chevron-left" size="18"></cm-icon></button>
2076
+ <button type="button" class="hb today" @click=${()=>this.goToToday()}>${this.t("today")}</button>
2077
+ <button type="button" class="hb icon next" aria-label=${l} @click=${()=>this.next()}><cm-icon name="chevron-right" size="18"></cm-icon></button>
2078
+ </div>
2079
+ <div class="title" part="title" id="${s(this,Me)}-t" role="heading" aria-level=${d} aria-live="polite">${a(this,f,pf).call(this,e)}${this.loading?c`<cm-spinner size="small" aria-hidden="true"></cm-spinner>`:h}</div>
2080
+ <div class="views" role="group" aria-label=${this.t("views")}>
2081
+ ${af.map(p=>c`<button type="button" class="hb" data-view=${p} aria-pressed=${p===t?"true":"false"} @click=${()=>a(this,f,mf).call(this,p)}>${this.t(p)}</button>`)}
2082
+ </div>
2083
+ </div>`},Lf=function(e){let t=s(this,f,go),i=Array.from({length:7},(r,l)=>(l+s(this,f,np))%7);return c`<thead><tr>${i.map(r=>c`<th scope="col" abbr=${t.weekdaysLong[r]}><span aria-hidden="true">${e?t.weekdaysShort[r].slice(0,2):t.weekdaysShort[r]}</span><span class="vh">${t.weekdaysLong[r]}</span></th>`)}</tr></thead>`},Sf=function(e,t){let i=s(this,f,lt),r=s(this,f,bo),l=Math.max(1,Math.trunc(Number(this.maxEvents))||3),d=a(this,f,vp).call(this),p=this._target,m=Array.from({length:e.length/7},(V,Q)=>e.slice(Q*7,Q*7+7)),v=this._narrow,b=(V,Q,yt)=>{let F=H(V),Re=t.get(F)??[],it=a(this,f,Fe).call(this,V),jp=`${V.getMonth()!==i.getMonth()?"other":""} ${F===r?"today":""} ${p?.iso===F?"over":""}`,Vp=c`<span class="num" aria-hidden="true">${s(this,f,go).day(V)}</span>`;if(v){let wt=Re.slice(0,3).map(us=>["attention","information","success","critical"].includes(us.el.tone)?us.el.tone:"neutral");return c`<td class=${jp} data-drop data-i=${Q} aria-selected=${F===H(i)?"true":"false"} aria-current=${F===r?"date":h}>
2084
+ <button type="button" class="dayb item" data-k="day:${F}" data-i=${Q} data-day=${F} aria-label=${this.t("dayEvents",{date:it,count:Re.length})}
2085
+ @click=${()=>{this.date=F,g(this,vt,`day:${F}`)}}>${Vp}<span class="dots">${wt.map(us=>c`<span class="dot tone-${us}"></span>`)}</span></button>
2086
+ </td>`}let ps=Re,il=0;if(Re.length>l){ps=Re.slice(0,l-1);let wt=d&&Re.find(us=>us.key===d.key);wt&&!ps.includes(wt)&&(ps=[...Re.slice(0,l-2),wt]),il=Re.length-ps.length}let sl=this.readonly;return c`<td class="${jp}${sl?" item":""}" data-drop data-i=${Q} data-day=${F} data-k=${sl?`cell:${F}`:h}
2087
+ aria-label=${sl?this.t("dayEvents",{date:it,count:Re.length}):h} aria-current=${F===r?"date":h}>
2088
+ <div class="dh">${Vp}<span class="vh">${it}</span>
2089
+ ${sl?h:c`<button type="button" class="add item" data-k="add:${F}" data-i=${Q} data-day=${F} aria-label=${this.t("addOn",{date:it})}
2090
+ @click=${()=>a(this,f,ko).call(this,F,!0)}><cm-icon name="plus" size="16"></cm-icon></button>`}
2091
+ </div>
2092
+ ${ps.length||p?.iso===F&&d?c`<ul class="evs">
2093
+ ${ps.map(wt=>c`<li>${a(this,f,Vr).call(this,wt,F,Q,"month",!0)}</li>`)}
2094
+ ${p?.iso===F&&d?c`<li aria-hidden="true">${a(this,f,ad).call(this,d)}</li>`:h}
2095
+ </ul>`:h}
2096
+ ${il?c`<button type="button" class="more item" data-k="more:${F}" data-i=${Q} data-day=${F} aria-haspopup="dialog"
2097
+ aria-expanded=${this._more===F?"true":"false"} aria-label=${this.t("moreLabel",{count:il,date:it})}
2098
+ @click=${()=>this._more===F?a(this,f,rd).call(this,!1):a(this,f,Cf).call(this,F)}>${this.t("more",{count:il})}</button>`:h}
2099
+ ${this._more===F?c`<div class="pop ${yt>=4?"end":""}" role="dialog" aria-label=${it}>
2100
+ <div class="pop-h"><span>${it}</span><button type="button" class="xb" aria-label=${this.t("close")} @click=${()=>a(this,f,rd).call(this,!0)}><cm-icon name="close" size="16"></cm-icon></button></div>
2101
+ <ul>${Re.map(wt=>c`<li>${a(this,f,Vr).call(this,wt,F,Q,"list",!1)}</li>`)}</ul>
2102
+ </div>`:h}
2103
+ </td>`},$=c`<table class="month ${v?"compact":""}" part="grid" role="grid" aria-labelledby="${s(this,Me)}-t" aria-describedby="${s(this,Me)}-gh"
2104
+ aria-busy=${this.loading?"true":"false"}>
2105
+ ${a(this,f,Lf).call(this,v)}
2106
+ <tbody>${m.map((V,Q)=>c`<tr>${V.map((yt,F)=>b(yt,Q*7+F,F))}</tr>`)}</tbody>
2107
+ </table>`;if(!v)return $;let y=H(i),M=t.get(y)??[],A=e.findIndex(V=>H(V)===y),I=a(this,f,Fe).call(this,i),B=Math.min(6,Math.max(1,Math.round(Number(this.headingLevel))||2)+1);return c`${$}
2108
+ <section class="agenda" part="agenda" aria-labelledby="${s(this,Me)}-ag">
2109
+ <div class="ag-h">
2110
+ <div class="ag-t" id="${s(this,Me)}-ag" role="heading" aria-level=${B}>${I}</div>
2111
+ ${this.readonly?h:c`<button type="button" class="hb ag-add" aria-label=${this.t("addOn",{date:I})} @click=${()=>a(this,f,ko).call(this,y,!0)}>
2112
+ <cm-icon name="plus" size="16"></cm-icon>${this.t("add")}</button>`}
2113
+ </div>
2114
+ ${M.length?c`<ul class="ag-list">${M.map(V=>c`<li>${a(this,f,Vr).call(this,V,y,A,"list",!1)}</li>`)}</ul>`:c`<p class="empty">${this.t("noEvents")}</p>`}
2115
+ </section>`},zf=function(e){let t=new Map,i=e.filter(m=>!m.allDay).sort((m,v)=>m.min-v.min||v.dur-m.dur),r=[],l=[],d=-1,p=()=>{for(let m of r)t.get(m).lanes=l.length;r=[],l=[]};for(let m of i){let v=Math.min(1440,m.min+Math.max(m.dur,20));m.min>=d&&(p(),d=-1);let b=l.findIndex($=>$<=m.min);b<0?(b=l.length,l.push(v)):l[b]=v,t.set(m,{lane:b,lanes:1}),r.push(m),d=Math.max(d,v)}return p(),t},Df=function(e,t){let i=s(this,f,bo),r=s(this,f,go),l=a(this,f,vp).call(this),d=this._target,p=this.readonly,m=e.map(b=>{let $=H(b),y=t.get($)??[];return{d:b,iso:$,text:a(this,f,Fe).call(this,b),allDay:y.filter(M=>M.allDay),timed:y.filter(M=>!M.allDay),lanes:a(this,f,zf).call(this,y)}}),v=Array.from({length:24},(b,$)=>$);return c`<div class="tg" part="grid" role="grid" aria-labelledby="${s(this,Me)}-t" aria-describedby="${s(this,Me)}-gh" aria-busy=${this.loading?"true":"false"}
2116
+ style="--cols:${e.length}">
2117
+ <div class="tg-top" role="rowgroup">
2118
+ <div class="row" role="row">
2119
+ <div class="axis" role="columnheader"><span class="vh">${this.t("time")}</span></div>
2120
+ ${m.map(b=>c`<div class="colh ${b.iso===i?"today":""}" role="columnheader" aria-current=${b.iso===i?"date":h}>
2121
+ <span class="wd" aria-hidden="true">${r.weekdaysShort[b.d.getDay()]}</span><span class="dn" aria-hidden="true">${r.day(b.d)}</span><span class="vh">${b.text}</span>
2122
+ </div>`)}
2123
+ </div>
2124
+ <div class="row adrow" role="row">
2125
+ <div class="axis" role="rowheader">${this.t("allDay")}</div>
2126
+ ${m.map((b,$)=>c`<div class="adcell ${d?.iso===b.iso&&l?.allDay?"over":""}" role="gridcell" data-drop data-i=${$}>
2127
+ ${p?h:c`<button type="button" class="add item" data-k="adadd:${b.iso}" data-i=${$} data-day=${b.iso} data-row="a"
2128
+ aria-label=${this.t("addAllDay",{date:b.text})} @click=${()=>a(this,f,ko).call(this,b.iso,!0)}><cm-icon name="plus" size="16"></cm-icon></button>`}
2129
+ ${b.allDay.map(y=>a(this,f,Vr).call(this,y,b.iso,$,"allday",!0,{row:"a"}))}
2130
+ ${d?.iso===b.iso&&l?.allDay?a(this,f,ad).call(this,l):h}
2131
+ </div>`)}
2132
+ </div>
2133
+ </div>
2134
+ <div class="tg-body" role="rowgroup">
2135
+ ${v.map(b=>c`<div class="row hr" role="row">
2136
+ <div class="axis" role="rowheader"><span>${a(this,f,uf).call(this,b)}</span></div>
2137
+ ${m.map(($,y)=>{let M=$.timed.filter(I=>Math.floor(I.min/60)===b),A=l&&!l.allDay&&d?.iso===$.iso&&d.min!==void 0&&Math.floor(d.min/60)===b;return c`<div class="tcell" role="gridcell" data-i=${y} data-row=${b} data-day=${$.iso}>
2138
+ ${p?h:c`<button type="button" class="slot item" data-k="slot:${$.iso}:${b}" data-i=${y} data-row=${b} data-day=${$.iso}
2139
+ aria-label=${this.t("addAt",{time:a(this,f,vo).call(this,b*60),date:$.text})} @click=${I=>a(this,f,Tf).call(this,I,$.iso,b)}></button>`}
2140
+ ${M.map(I=>{let B=$.lanes.get(I)??{lane:0,lanes:1},V=Math.min(I.dur,1440-I.min)/60;return a(this,f,Vr).call(this,I,$.iso,y,"time",!0,{row:String(b),style:`--top:${(I.min-b*60)/60};--len:${V};--lane:${B.lane};--lanes:${B.lanes}`})})}
2141
+ ${A?a(this,f,ad).call(this,l,"time",`--top:${(d.min-b*60)/60};--len:${Math.min(l.dur,1440-d.min)/60}`):h}
2142
+ </div>`})}
2143
+ </div>`)}
2144
+ </div>
2145
+ </div>`},Kr.properties={view:{reflect:!0},date:{reflect:!0},today:{},label:{string:"label"},step:{type:Number},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},hourCycle:{attribute:"hour-cycle"},dayStart:{type:Number,attribute:"day-start"},maxEvents:{type:Number,attribute:"max-events"},headingLevel:{type:Number,attribute:"heading-level"},loading:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},controlled:{type:Boolean,reflect:!0},dragging:{type:Boolean,reflect:!0},_narrow:{state:!0},_more:{state:!0},_target:{state:!0}},Kr.styles=[E,x`
2146
+ :host { display: block; position: relative; min-width: 0; font-size: 14px; line-height: 20px; }
2147
+ :host([dragging]) { cursor: grabbing; user-select: none; -webkit-user-select: none; }
2148
+ .cal { display: flex; flex-direction: column; gap: var(--cm-space-15); min-width: 0; }
2149
+ button { font: inherit; color: inherit; margin: 0; }
2150
+ [hidden] { display: none !important; }
2151
+ .vh {
2152
+ position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
2153
+ clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
2154
+ }
2155
+ :focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
2156
+
2157
+ /* Header */
2158
+ .head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-10) var(--cm-space-15); }
2159
+ .nav { display: flex; align-items: center; gap: 4px; }
2160
+ .title { flex: 1 1 10rem; min-width: 0; margin: 0; font-size: 18px; line-height: 28px; font-weight: 500; display: flex; align-items: center; gap: var(--cm-space-10); }
2161
+ .hb {
2162
+ display: inline-flex; align-items: center; justify-content: center; height: 36px; min-width: 36px; padding: 0 var(--cm-space-12);
2163
+ background: var(--cm-bg-surface); color: var(--cm-text-default); border: var(--cm-border-1) solid var(--cm-border-input);
2164
+ border-radius: var(--cm-radius-sm); cursor: pointer; white-space: nowrap;
2165
+ }
2166
+ .hb.icon { padding: 0; color: var(--cm-icon-selected); }
2167
+ .hb:hover { background: var(--cm-bg-hover); }
2168
+ .views { display: inline-flex; }
2169
+ .views .hb { border-radius: 0; }
2170
+ .views .hb:first-child { border-start-start-radius: var(--cm-radius-sm); border-end-start-radius: var(--cm-radius-sm); }
2171
+ .views .hb:last-child { border-start-end-radius: var(--cm-radius-sm); border-end-end-radius: var(--cm-radius-sm); }
2172
+ .views .hb + .hb { margin-inline-start: -1px; }
2173
+ .views .hb[aria-pressed='true'] { background: var(--cm-action-primary); color: var(--cm-action-primary-text); border-color: var(--cm-action-primary); position: relative; }
2174
+
2175
+ /* Chips */
2176
+ .chip {
2177
+ position: relative; display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; min-height: 24px; padding: 2px 6px;
2178
+ border: 0; border-inline-start: 3px solid var(--bar); border-radius: var(--cm-radius-xs);
2179
+ background: linear-gradient(var(--fill), var(--fill)), var(--cm-bg-surface); color: var(--cm-text-default);
2180
+ font-size: 12px; line-height: 16px; text-align: start; text-decoration: none; white-space: nowrap; overflow: hidden;
2181
+ cursor: grab; touch-action: manipulation; -webkit-touch-callout: none;
2182
+ }
2183
+ :host([readonly]) .chip, .chip.locked { cursor: pointer; }
2184
+ .chip:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 1px; z-index: 2; }
2185
+ .chip > * { flex: none; }
2186
+ .chip .h { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
2187
+ .chip .k { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
2188
+ .chip .tm { font-variant-numeric: tabular-nums; }
2189
+ .tone-neutral { --fill: var(--cm-bg-tag); --bar: var(--cm-text-tertiary); }
2190
+ .tone-attention { --fill: var(--cm-bg-attention); --bar: var(--cm-text-attention); }
2191
+ .tone-information { --fill: var(--cm-bg-information-soft); --bar: var(--cm-text-information); }
2192
+ .tone-success { --fill: var(--cm-bg-success-soft); --bar: var(--cm-text-success); }
2193
+ .tone-critical { --fill: var(--cm-bg-critical); --bar: var(--cm-text-critical); }
2194
+ .chip.moving { outline: 2px dashed var(--cm-border-strong); outline-offset: -2px; background: var(--cm-bg-page); }
2195
+ .chip.pending { background: var(--cm-bg-page); cursor: progress; }
2196
+ .spin {
2197
+ flex: none; width: 10px; height: 10px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%;
2198
+ animation: cm-cal-spin 0.8s linear infinite;
2199
+ }
2200
+ @keyframes cm-cal-spin { to { transform: rotate(360deg); } }
2201
+ @media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }
2202
+ .ph {
2203
+ display: flex; align-items: center; min-height: 24px; padding: 2px 6px; border: 2px dashed var(--cm-border-strong);
2204
+ border-radius: var(--cm-radius-xs); background: var(--cm-bg-surface); color: var(--cm-text-tertiary);
2205
+ font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
2206
+ }
2207
+
2208
+ /* Month */
2209
+ /* Separate borders: collapsed ones spill half a pixel outside the table (sideways scroll at 320px in WebKit). */
2210
+ .month { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-card); }
2211
+ .month th { padding: 6px 6px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--cm-text-tertiary); text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
2212
+ .month td {
2213
+ position: relative; vertical-align: top; height: var(--cm-calendar-day-height, 112px); padding: 4px;
2214
+ border: 0; border-block-start: var(--cm-border-1) solid var(--cm-border-card); border-inline-start: var(--cm-border-1) solid var(--cm-border-card);
2215
+ background: var(--cm-bg-surface);
2216
+ }
2217
+ .month td:first-child { border-inline-start: 0; }
2218
+ .month td.other { background: var(--cm-bg-page); }
2219
+ .month td.over { box-shadow: inset 0 0 0 2px var(--cm-border-strong); }
2220
+ .dh { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 28px; }
2221
+ .num {
2222
+ display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: var(--cm-radius-full);
2223
+ font-size: 12px; line-height: 16px; font-weight: 500;
2224
+ }
2225
+ .other .num { color: var(--cm-text-tertiary); }
2226
+ .today .num, .colh.today .dn { background: var(--cm-action-primary); color: var(--cm-action-primary-text); }
2227
+ .add, .xb {
2228
+ display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--cm-radius-sm);
2229
+ background: none; color: var(--cm-icon-selected); cursor: pointer;
2230
+ }
2231
+ .add:hover, .xb:hover { background: var(--cm-bg-hover); }
2232
+ @media (hover: hover) {
2233
+ .month td:not(:hover) .add:not(:focus-visible), .adcell:not(:hover) .add:not(:focus-visible) { opacity: 0; }
2234
+ }
2235
+ .evs { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
2236
+ .evs li { display: block; min-width: 0; }
2237
+ .more {
2238
+ display: block; width: 100%; min-height: 24px; margin-block-start: 2px; padding: 2px 6px; border: 0; border-radius: var(--cm-radius-xs);
2239
+ background: none; color: var(--cm-text-default); font-size: 12px; line-height: 16px; font-weight: 500; text-align: start; cursor: pointer;
2240
+ }
2241
+ .more:hover { background: var(--cm-bg-hover); text-decoration: underline; }
2242
+ .pop {
2243
+ position: absolute; z-index: 5; inset-block-start: 0; inset-inline-start: 0; width: max(100%, 15rem); max-width: 80vw;
2244
+ padding: var(--cm-space-10); background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-default);
2245
+ border-radius: var(--cm-radius-md); box-shadow: var(--cm-shadow-100);
2246
+ }
2247
+ .pop.end { inset-inline-start: auto; inset-inline-end: 0; }
2248
+ .pop-h { display: flex; align-items: center; justify-content: space-between; gap: var(--cm-space-10); margin-block-end: 6px; font-size: 14px; font-weight: 500; }
2249
+ .pop ul, .ag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
2250
+ .chip.list { min-height: 40px; padding: 4px 10px; flex-wrap: wrap; column-gap: 6px; row-gap: 0; white-space: normal; font-size: 14px; line-height: 20px; }
2251
+ .chip.list .h { flex: 1 1 8rem; overflow-wrap: anywhere; }
2252
+ .chip.list .k { font-size: 12px; }
2253
+
2254
+ /* Narrow month: a compact grid and the day's list */
2255
+ .month.compact td { height: auto; padding: 2px; }
2256
+ .month.compact th { padding: 4px 2px; text-align: center; }
2257
+ .dayb {
2258
+ display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; min-height: 44px; padding: 4px 0;
2259
+ border: 0; border-radius: var(--cm-radius-sm); background: none; cursor: pointer;
2260
+ }
2261
+ .dayb:hover { background: var(--cm-bg-hover); }
2262
+ td[aria-selected='true'] .num { box-shadow: 0 0 0 2px var(--cm-border-strong); }
2263
+ .dots { display: flex; gap: 2px; height: 6px; }
2264
+ .dot { width: 6px; height: 6px; border-radius: var(--cm-radius-full); background: var(--bar); }
2265
+ .agenda { display: flex; flex-direction: column; gap: var(--cm-space-10); }
2266
+ .ag-h { display: flex; align-items: center; justify-content: space-between; gap: var(--cm-space-10); }
2267
+ .ag-t { margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; }
2268
+ .empty { margin: 0; padding: var(--cm-space-15) 0; color: var(--cm-text-tertiary); font-size: 14px; }
2269
+
2270
+ /* Week and day */
2271
+ .tg {
2272
+ --h: var(--cm-calendar-hour-height, 48px); --axis: 56px;
2273
+ position: relative; max-block-size: var(--cm-calendar-time-height, 600px); overflow-y: auto; overscroll-behavior: contain;
2274
+ border: var(--cm-border-1) solid var(--cm-border-card); border-radius: var(--cm-radius-md); background: var(--cm-bg-surface);
2275
+ scroll-padding-block-start: 104px;
2276
+ }
2277
+ .narrow .tg { --axis: 44px; }
2278
+ .row { display: grid; grid-template-columns: var(--axis) repeat(var(--cols), minmax(0, 1fr)); }
2279
+ .tg-top { position: sticky; inset-block-start: 0; z-index: 4; background: var(--cm-bg-surface); border-block-end: var(--cm-border-1) solid var(--cm-border-card); }
2280
+ .colh { padding: 6px 2px; text-align: center; font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); border-inline-start: var(--cm-border-1) solid var(--cm-border-card); min-width: 0; overflow: hidden; }
2281
+ .colh .dn { display: inline-grid; place-items: center; min-width: 28px; height: 28px; margin-block-start: 2px; padding: 0 4px; border-radius: var(--cm-radius-full); font-size: 16px; line-height: 24px; font-weight: 500; color: var(--cm-text-default); }
2282
+ .colh .wd { display: block; }
2283
+ .axis { padding-inline-end: 6px; font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); text-align: end; }
2284
+ .adrow .axis { align-self: center; padding-block: 4px; overflow-wrap: anywhere; }
2285
+ .adcell { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 4px; min-height: 36px; border-inline-start: var(--cm-border-1) solid var(--cm-border-card); }
2286
+ .adcell.over { box-shadow: inset 0 0 0 2px var(--cm-border-strong); }
2287
+ .adcell .add { align-self: flex-end; width: 24px; height: 24px; }
2288
+ .hr .axis span { position: relative; inset-block-start: -8px; }
2289
+ .hr:first-child .axis span { inset-block-start: 0; }
2290
+ .tcell { position: relative; block-size: var(--h); min-width: 0; border-inline-start: var(--cm-border-1) solid var(--cm-border-card); border-block-start: var(--cm-border-1) solid var(--cm-border-card); }
2291
+ .hr:first-child .tcell { border-block-start: 0; }
2292
+ .slot { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; color: var(--cm-icon-selected); font-size: 18px; line-height: 1; }
2293
+ .slot:hover { background: var(--cm-bg-hover); }
2294
+ .slot:hover::after, .slot:focus-visible::after { content: '+'; }
2295
+ .slot:focus-visible { outline-offset: -2px; }
2296
+ .chip.time {
2297
+ position: absolute; z-index: 1; flex-direction: column; align-items: stretch; gap: 0; padding: 2px 4px;
2298
+ inset-inline-start: calc(var(--lane) * 100% / var(--lanes)); width: calc(100% / var(--lanes) - 2px);
2299
+ inset-block-start: calc(var(--top) * var(--h)); height: calc(var(--len) * var(--h) - 1px); min-height: 24px;
2300
+ box-shadow: 0 0 0 1px var(--cm-bg-surface);
2301
+ }
2302
+ .chip.time > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
2303
+ .chip.time .lead { display: flex; align-items: center; gap: 4px; min-width: 0; }
2304
+ .ph.time { position: absolute; z-index: 3; inset-inline: 0 2px; inset-block-start: calc(var(--top) * var(--h)); height: calc(var(--len) * var(--h)); align-items: flex-start; }
2305
+ `];w("cm-calendar",Kr);var Fw=C("reportTile",{pinned:", pinned"}),ns=class extends T{constructor(){super(...arguments);this.label="";this.icon="chart";this.href="";this.pinned=!1}render(){let e=c`
1959
2306
  <span class="icon" aria-hidden="true"><slot name="icon"><cm-icon name=${this.icon} size="58"></cm-icon></slot></span>
1960
2307
  <span class="label">${this.label}</span>
1961
- ${this.pinned?l`<span class="pin" part="pin"><cm-icon name="pin" size="18"></cm-icon><span class="sr">${this.t("pinned")}</span></span>`:d}
1962
- `;return this.href?l`<a class="tile" part="tile" href=${this.href}>${e}</a>`:l`<button class="tile" part="tile" type="button">${e}</button>`}};yi.properties={label:{},icon:{},href:{},pinned:{type:Boolean,reflect:!0}},yi.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},yi.styles=[w,b`
2308
+ ${this.pinned?c`<span class="pin" part="pin"><cm-icon name="pin" size="18"></cm-icon><span class="sr">${this.t("pinned")}</span></span>`:h}
2309
+ `;return this.href?c`<a class="tile" part="tile" href=${this.href}>${e}</a>`:c`<button class="tile" part="tile" type="button">${e}</button>`}};ns.properties={label:{},icon:{},href:{},pinned:{type:Boolean,reflect:!0}},ns.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},ns.styles=[E,x`
1963
2310
  :host { display: block; }
1964
2311
  .tile {
1965
2312
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--cm-space-20);
@@ -1979,10 +2326,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1979
2326
  ::slotted([slot='icon']) { width: 38px; height: 38px; }
1980
2327
  .pin { top: 8px; inset-inline-end: 8px; }
1981
2328
  }
1982
- `];g("cm-report-tile",yi);var Js=class extends _{constructor(){super(...arguments);this.heading="";this.headingLevel=2}firstUpdated(){for(let e of this.querySelectorAll(":scope > cm-report-tile"))e.hasAttribute("role")||e.setAttribute("role","listitem")}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2));return l`
1983
- ${this.heading?l`<div class="title" part="heading" role="heading" aria-level=${e} id="h">${this.heading}</div>`:d}
1984
- <div class="grid" part="grid" role="list" aria-labelledby=${this.heading?"h":d}><slot @slotchange=${()=>this.firstUpdated()}></slot></div>
1985
- `}};Js.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"}},Js.styles=[w,b`
2329
+ `];w("cm-report-tile",ns);var Zr=class extends L{constructor(){super(...arguments);this.heading="";this.headingLevel=2}firstUpdated(){for(let e of this.querySelectorAll(":scope > cm-report-tile"))e.hasAttribute("role")||e.setAttribute("role","listitem")}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2));return c`
2330
+ ${this.heading?c`<div class="title" part="heading" role="heading" aria-level=${e} id="h">${this.heading}</div>`:h}
2331
+ <div class="grid" part="grid" role="list" aria-labelledby=${this.heading?"h":h}><slot @slotchange=${()=>this.firstUpdated()}></slot></div>
2332
+ `}};Zr.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"}},Zr.styles=[E,x`
1986
2333
  :host { display: block; padding: var(--cm-space-20); background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); }
1987
2334
  .title { margin: 0 0 var(--cm-space-20); font-size: 16px; font-weight: 500; }
1988
2335
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: var(--cm-space-15); }
@@ -1992,16 +2339,16 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1992
2339
  .title { margin-bottom: var(--cm-space-10); font-size: 14px; }
1993
2340
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cm-space-10); }
1994
2341
  }
1995
- `];g("cm-report-tiles",Js);var Hx=M("metric",{up:"Up {change}",down:"Down {change}",flat:"No change {change}",good:"{trend}, good",bad:"{trend}, bad",loadingValue:"Loading {label}"}),jp=/^\s*-?\d+(\.\d+)?\s*$/,Zs=class extends k{constructor(){super(...arguments);this.label="";this.value="";this.hint="";this.change="";this.trendSentiment="auto";this.href="";this.loading=!1;this._hasHint=!1;this.onHintSlot=e=>{this._hasHint=e.target.assignedNodes({flatten:!1}).some(t=>t.nodeType===1||t.textContent?.trim())}}connectedCallback(){super.connectedCallback(),this._hasHint=!!this.querySelector(':scope > [slot="hint"]')}figure(){let e=this.value;if(e===""||e===null||e===void 0)return"";let t=typeof e=="number"?e:jp.test(String(e))?Number(e):NaN;return Number.isNaN(t)?String(e):this.formatNumber(t)}sentiment(){let e=this.trendSentiment;return e==="positive"||e==="negative"||e==="neutral"?e:this.trend==="up"?"positive":this.trend==="down"?"negative":"neutral"}renderChange(){let e=this.trend&&["up","down","flat"].includes(this.trend)?this.trend:void 0;if(!this.change&&!e)return d;if(!e)return l`<span class="change neutral" part="change">${this.change}</span>`;let t=this.sentiment(),i=this.t(e,{change:this.change}).trim(),a=t==="positive"?this.t("good",{trend:i}):t==="negative"?this.t("bad",{trend:i}):i;return l`<span class="change ${e} ${t}" part="change">
1996
- <cm-icon name=${e==="flat"?"arrow-left":"arrow-up-right"} size="16"></cm-icon><span aria-hidden="true">${this.change}</span><span class="sr">${a}</span>
1997
- </span>`}render(){let e=this._hasHint||!!this.hint,t=this.loading?l`<cm-skeleton variant="block"></cm-skeleton>`:this.figure(),i=this.renderChange(),a=i!==d||e,c=l`
2342
+ `];w("cm-report-tiles",Zr);var Ww=C("metric",{up:"Up {change}",down:"Down {change}",flat:"No change {change}",good:"{trend}, good",bad:"{trend}, bad",loadingValue:"Loading {label}"}),Af=/^\s*-?\d+(\.\d+)?\s*$/,Qr=class extends T{constructor(){super(...arguments);this.label="";this.value="";this.hint="";this.change="";this.trendSentiment="auto";this.href="";this.loading=!1;this._hasHint=!1;this.onHintSlot=e=>{this._hasHint=e.target.assignedNodes({flatten:!1}).some(t=>t.nodeType===1||t.textContent?.trim())}}connectedCallback(){super.connectedCallback(),this._hasHint=!!this.querySelector(':scope > [slot="hint"]')}figure(){let e=this.value;if(e===""||e===null||e===void 0)return"";let t=typeof e=="number"?e:Af.test(String(e))?Number(e):NaN;return Number.isNaN(t)?String(e):this.formatNumber(t)}sentiment(){let e=this.trendSentiment;return e==="positive"||e==="negative"||e==="neutral"?e:this.trend==="up"?"positive":this.trend==="down"?"negative":"neutral"}renderChange(){let e=this.trend&&["up","down","flat"].includes(this.trend)?this.trend:void 0;if(!this.change&&!e)return h;if(!e)return c`<span class="change neutral" part="change">${this.change}</span>`;let t=this.sentiment(),i=this.t(e,{change:this.change}).trim(),r=t==="positive"?this.t("good",{trend:i}):t==="negative"?this.t("bad",{trend:i}):i;return c`<span class="change ${e} ${t}" part="change">
2343
+ <cm-icon name=${e==="flat"?"arrow-left":"arrow-up-right"} size="16"></cm-icon><span aria-hidden="true">${this.change}</span><span class="sr">${r}</span>
2344
+ </span>`}render(){let e=this._hasHint||!!this.hint,t=this.loading?c`<cm-skeleton variant="block"></cm-skeleton>`:this.figure(),i=this.renderChange(),r=i!==h||e,l=c`
1998
2345
  <span class="label" id="label" part="label">${this.label}</span>
1999
2346
  <span class="value" id="value" part="value">${t}</span>
2000
- <span class="foot ${a?"on":""}" id="foot" part="footer">
2347
+ <span class="foot ${r?"on":""}" id="foot" part="footer">
2001
2348
  ${i}
2002
2349
  <span class="hint ${e?"on":""}" part="hint"><slot name="hint" @slotchange=${this.onHintSlot}>${this.hint}</slot></span>
2003
2350
  </span>
2004
- `,h=l`<span class="sr" role="status">${this.loading?this.t("loadingValue",{label:this.label}):""}</span>`,u=this.loading?"true":d;return this.href?l`<a class="tile" part="tile" href=${this.href} aria-labelledby="label value" aria-describedby=${a?"foot":d} aria-busy=${u}>${c}</a>${h}`:l`<div class="tile" part="tile" aria-busy=${u}>${c}</div>${h}`}};Zs.properties={label:{},value:{converter:{fromAttribute:e=>e!==null&&jp.test(e)?Number(e):e??"",toAttribute:e=>e==null?e:String(e)}},hint:{},change:{},trend:{reflect:!0},trendSentiment:{attribute:"trend-sentiment",reflect:!0},href:{},loading:{type:Boolean,reflect:!0},_hasHint:{state:!0}},Zs.styles=[w,b`
2351
+ `,d=c`<span class="sr" role="status">${this.loading?this.t("loadingValue",{label:this.label}):""}</span>`,p=this.loading?"true":h;return this.href?c`<a class="tile" part="tile" href=${this.href} aria-labelledby="label value" aria-describedby=${r?"foot":h} aria-busy=${p}>${l}</a>${d}`:c`<div class="tile" part="tile" aria-busy=${p}>${l}</div>${d}`}};Qr.properties={label:{},value:{converter:{fromAttribute:e=>e!==null&&Af.test(e)?Number(e):e??"",toAttribute:e=>e==null?e:String(e)}},hint:{},change:{},trend:{reflect:!0},trendSentiment:{attribute:"trend-sentiment",reflect:!0},href:{},loading:{type:Boolean,reflect:!0},_hasHint:{state:!0}},Qr.styles=[E,x`
2005
2352
  :host { display: block; align-self: stretch; min-inline-size: 0; }
2006
2353
  .tile {
2007
2354
  display: flex; flex-direction: column; gap: 4px; block-size: 100%; min-inline-size: 0;
@@ -2037,29 +2384,29 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2037
2384
  .value { font-size: var(--cm-type-heading-lg-resp-size); }
2038
2385
  }
2039
2386
  @media (forced-colors: active) { .change { color: CanvasText; } }
2040
- `];g("cm-metric",Zs);var Qs=class extends _{constructor(){super(...arguments);this.label="";this.icon="";this.href="";this.value="";this.current=!1;this.badge="";this.expanded=!1;this.primary=!1}render(){return null}toItem(){return Fp(this)}};Qs.properties={label:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},value:{reflect:!0},current:{type:Boolean,reflect:!0},badge:{reflect:!0},expanded:{type:Boolean,reflect:!0},primary:{type:Boolean,reflect:!0}},Qs.styles=b`:host { display: none !important; }`;g("cm-nav-item",Qs);function Fp(n){let r=i=>n.getAttribute(i),e={label:r("label")||""};r("icon")&&(e.icon=r("icon")),r("href")&&(e.href=r("href")),r("value")&&(e.value=r("value")),n.hasAttribute("current")&&(e.current=!0),r("badge")&&(e.badge=r("badge")),n.hasAttribute("expanded")&&(e.expanded=!0),n.hasAttribute("primary")&&(e.primary=!0);let t=ct(n);return t.length&&(e.items=t),e}var ct=n=>[...n.children].filter(r=>r.localName==="cm-nav-item").map(Fp),hd=n=>n.value||n.href||n.label,Tl=n=>!!n.current||!!n.items?.some(Tl),Ot=(n,r)=>{let e=new MutationObserver(r);return e.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},qt=(n,r)=>n.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:r,value:hd(r),href:r.href??""}}));var Kx=M("sideNavigation",{label:"Main",collapse:"Collapse menu",expand:"Expand menu"}),un,mn,zl,N,pd,_l,ud,Vp,Up,md,fd,Kp,bd,gd,Cl,vd,Gp,er=class extends k{constructor(){super(...arguments);p(this,N);this.items=[];this.collapsed=!1;this.collapsible=!1;this._slotted=[];this._open=new Set;p(this,un,new Set);p(this,mn);p(this,zl,L("cm-sidenav"))}connectedCallback(){super.connectedCallback(),o(this,N,pd).call(this),f(this,mn,Ot(this,()=>o(this,N,pd).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,mn)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}willUpdate(){this.navItems.forEach((e,t)=>{let i=o(this,N,_l).call(this,e,t);s(this,un).has(i)||!e.items?.length||(s(this,un).add(i),(e.expanded||Tl(e))&&this._open.add(i))})}toggle(e,t){let i=this.navItems[e];if(!i?.items?.length)return;let a=o(this,N,_l).call(this,i,e),c=t??!this._open.has(a);if(c===this._open.has(a))return;let h=new Set(this._open);c?h.add(a):h.delete(a),this._open=h,this.dispatchEvent(new CustomEvent("cm-expand",{bubbles:!0,composed:!0,detail:{item:i,expanded:c}}))}render(){let e=this.collapsed;return l`
2041
- <nav part="nav" aria-label=${this.label||this.t("label")} @keydown=${o(this,N,Up)}>
2387
+ `];w("cm-metric",Qr);var ea=class extends L{constructor(){super(...arguments);this.label="";this.icon="";this.href="";this.value="";this.current=!1;this.badge="";this.expanded=!1;this.primary=!1}render(){return null}toItem(){return Nf(this)}};ea.properties={label:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},value:{reflect:!0},current:{type:Boolean,reflect:!0},badge:{reflect:!0},expanded:{type:Boolean,reflect:!0},primary:{type:Boolean,reflect:!0}},ea.styles=x`:host { display: none !important; }`;w("cm-nav-item",ea);function Nf(o){let n=i=>o.getAttribute(i),e={label:n("label")||""};n("icon")&&(e.icon=n("icon")),n("href")&&(e.href=n("href")),n("value")&&(e.value=n("value")),o.hasAttribute("current")&&(e.current=!0),n("badge")&&(e.badge=n("badge")),o.hasAttribute("expanded")&&(e.expanded=!0),o.hasAttribute("primary")&&(e.primary=!0);let t=Ot(o);return t.length&&(e.items=t),e}var Ot=o=>[...o.children].filter(n=>n.localName==="cm-nav-item").map(Nf),xp=o=>o.value||o.href||o.label,od=o=>!!o.current||!!o.items?.some(od),yi=(o,n)=>{let e=new MutationObserver(n);return e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},wi=(o,n)=>o.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:n,value:xp(n),href:n.href??""}}));var s1=C("sideNavigation",{label:"Main",collapse:"Collapse menu",expand:"Expand menu"}),Ho,Io,dd,O,yp,ld,wp,Rf,Hf,$p,kp,If,Ep,Mp,cd,Tp,Pf,ta=class extends T{constructor(){super(...arguments);u(this,O);this.items=[];this.collapsed=!1;this.collapsible=!1;this._slotted=[];this._open=new Set;u(this,Ho,new Set);u(this,Io);u(this,dd,D("cm-sidenav"))}connectedCallback(){super.connectedCallback(),a(this,O,yp).call(this),g(this,Io,yi(this,()=>a(this,O,yp).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,Io)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}willUpdate(){this.navItems.forEach((e,t)=>{let i=a(this,O,ld).call(this,e,t);s(this,Ho).has(i)||!e.items?.length||(s(this,Ho).add(i),(e.expanded||od(e))&&this._open.add(i))})}toggle(e,t){let i=this.navItems[e];if(!i?.items?.length)return;let r=a(this,O,ld).call(this,i,e),l=t??!this._open.has(r);if(l===this._open.has(r))return;let d=new Set(this._open);l?d.add(r):d.delete(r),this._open=d,this.dispatchEvent(new CustomEvent("cm-expand",{bubbles:!0,composed:!0,detail:{item:i,expanded:l}}))}render(){let e=this.collapsed;return c`
2388
+ <nav part="nav" aria-label=${this.label||this.t("label")} @keydown=${a(this,O,Hf)}>
2042
2389
  <slot name="header"></slot>
2043
2390
  <ul part="list">
2044
- ${this.navItems.map((t,i)=>{if(!t.items?.length)return l`<li>${o(this,N,vd).call(this,t,"",{index:i})}</li>`;let a=!e&&this._open.has(o(this,N,_l).call(this,t,i)),c=`${s(this,zl)}-${i}`;return l`<li>
2045
- ${o(this,N,Cl).call(this,t,l`<button type="button" class="item parent ${Tl(t)?"has-current":""}" part="item" data-index=${i}
2046
- aria-expanded=${a?"true":"false"} aria-controls=${c} @click=${()=>e?o(this,N,Kp).call(this,i):this.toggle(i)}>
2047
- ${o(this,N,bd).call(this,t)}${o(this,N,gd).call(this,t)}
2048
- ${e?d:l`<cm-icon class="chev" name="chevron-down" size="18"></cm-icon>`}
2391
+ ${this.navItems.map((t,i)=>{if(!t.items?.length)return c`<li>${a(this,O,Tp).call(this,t,"",{index:i})}</li>`;let r=!e&&this._open.has(a(this,O,ld).call(this,t,i)),l=`${s(this,dd)}-${i}`;return c`<li>
2392
+ ${a(this,O,cd).call(this,t,c`<button type="button" class="item parent ${od(t)?"has-current":""}" part="item" data-index=${i}
2393
+ aria-expanded=${r?"true":"false"} aria-controls=${l} @click=${()=>e?a(this,O,If).call(this,i):this.toggle(i)}>
2394
+ ${a(this,O,Ep).call(this,t)}${a(this,O,Mp).call(this,t)}
2395
+ ${e?h:c`<cm-icon class="chev" name="chevron-down" size="18"></cm-icon>`}
2049
2396
  </button>`)}
2050
- <ul class="sub" id=${c} ?hidden=${!a} aria-label=${t.label}>
2051
- ${o(this,N,md).call(this,t.items).map(([h,u])=>l`<li>${o(this,N,vd).call(this,{...h,icon:void 0},u?"deep":"",{parent:i})}</li>`)}
2397
+ <ul class="sub" id=${l} ?hidden=${!r} aria-label=${t.label}>
2398
+ ${a(this,O,$p).call(this,t.items).map(([d,p])=>c`<li>${a(this,O,Tp).call(this,{...d,icon:void 0},p?"deep":"",{parent:i})}</li>`)}
2052
2399
  </ul>
2053
2400
  </li>`})}
2054
2401
  </ul>
2055
- ${o(this,N,Gp).call(this)}
2402
+ ${a(this,O,Pf).call(this)}
2056
2403
  <slot name="footer"></slot>
2057
2404
  <slot hidden></slot>
2058
2405
  </nav>
2059
- `}};un=new WeakMap,mn=new WeakMap,zl=new WeakMap,N=new WeakSet,pd=function(){this._slotted=ct(this)},_l=function(e,t){return`${t}:${hd(e)}`},ud=function(e,t){qt(this,t)||e.preventDefault()},Vp=function(){return[...this.renderRoot.querySelectorAll(".item")].filter(e=>!e.closest("[hidden]"))},Up=function(e){let t=e.composedPath()[0]?.closest?.(".item");if(!t)return;let i=o(this,N,Vp).call(this),a=i.indexOf(t),c=Number(t.dataset.index),h=ne(e,this),u;if(e.key==="ArrowDown")u=i[(a+1)%i.length];else if(e.key==="ArrowUp")u=i[(a-1+i.length)%i.length];else if(e.key==="Home")u=i[0];else if(e.key==="End")u=i[i.length-1];else{if(this.collapsed&&(h==="ArrowRight"||h==="ArrowLeft"))return;if(h==="ArrowRight"&&t.classList.contains("parent")){this.toggle(c,!0),e.preventDefault();return}else if(h==="ArrowLeft"){if(t.classList.contains("parent")?this.toggle(c,!1):t.dataset.parent&&(u=this.renderRoot.querySelector(`.parent[data-index="${t.dataset.parent}"]`)??void 0),!u){e.preventDefault();return}}else return}e.preventDefault(),u?.focus()},md=function(e,t=0){return e.flatMap(i=>[[i,t],...o(this,N,md).call(this,i.items??[],t+1)])},fd=function(e){if(e===this.collapsed)return!0;let t=this.dispatchEvent(new CustomEvent("cm-collapse",{bubbles:!0,composed:!0,cancelable:!0,detail:{collapsed:e}}));return t&&(this.collapsed=e),t},Kp=function(e){let t=this.navItems[e];o(this,N,fd).call(this,!1)&&(this.toggle(e,!0),this.updateComplete.then(()=>this.renderRoot.querySelector(`.parent[data-index="${e}"]`)?.focus()))},bd=function(e){return e.icon?l`<cm-icon name=${e.icon} size="20"></cm-icon>`:this.collapsed?l`<span class="initial" aria-hidden="true">${[...e.label.trim()][0]??""}</span>`:d},gd=function(e){if(!this.collapsed)return l`<span class="label">${e.label}</span>${e.badge?l`<span class="badge">${e.badge}</span>`:d}`;let t=e.badge&&/^\d{1,2}\+?$/.test(e.badge.trim());return l`<span class="sr">${e.label}${e.badge?` (${e.badge})`:""}</span>${e.badge?l`<span class="dot ${t?"count":""}" aria-hidden="true">${t?e.badge:d}</span>`:d}`},Cl=function(e,t){return this.collapsed?l`<cm-tooltip content=${e.label} placement="end" visual-only>${t}</cm-tooltip>`:t},vd=function(e,t,i={}){let a=l`${o(this,N,bd).call(this,e)}${o(this,N,gd).call(this,e)}`;return o(this,N,Cl).call(this,e,e.href?l`<a class="item ${t}" part="item" href=${e.href} aria-current=${e.current?"page":d}
2060
- data-index=${i.index??d} data-parent=${i.parent??d} @click=${c=>o(this,N,ud).call(this,c,e)}>${a}</a>`:l`<button type="button" class="item ${t}" part="item" aria-current=${e.current?"page":d}
2061
- data-index=${i.index??d} data-parent=${i.parent??d} @click=${c=>o(this,N,ud).call(this,c,e)}>${a}</button>`)},Gp=function(){if(!this.collapsible)return d;let e=this.t(this.collapsed?"expand":"collapse"),t=l`<cm-icon name=${this.collapsed?"chevron-right":"chevron-left"} size="20"></cm-icon>${this.collapsed?l`<span class="sr">${e}</span>`:l`<span class="label">${e}</span>`}`;return l`<div class="toggle-row">${o(this,N,Cl).call(this,{label:e},l`<button type="button" class="item toggle" part="collapse-button"
2062
- @click=${()=>o(this,N,fd).call(this,!this.collapsed)}>${t}</button>`)}</div>`},er.properties={items:{type:Array},label:{string:"label"},collapsed:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},_slotted:{state:!0},_open:{state:!0}},er.styles=[w,b`
2406
+ `}};Ho=new WeakMap,Io=new WeakMap,dd=new WeakMap,O=new WeakSet,yp=function(){this._slotted=Ot(this)},ld=function(e,t){return`${t}:${xp(e)}`},wp=function(e,t){wi(this,t)||e.preventDefault()},Rf=function(){return[...this.renderRoot.querySelectorAll(".item")].filter(e=>!e.closest("[hidden]"))},Hf=function(e){let t=e.composedPath()[0]?.closest?.(".item");if(!t)return;let i=a(this,O,Rf).call(this),r=i.indexOf(t),l=Number(t.dataset.index),d=re(e,this),p;if(e.key==="ArrowDown")p=i[(r+1)%i.length];else if(e.key==="ArrowUp")p=i[(r-1+i.length)%i.length];else if(e.key==="Home")p=i[0];else if(e.key==="End")p=i[i.length-1];else{if(this.collapsed&&(d==="ArrowRight"||d==="ArrowLeft"))return;if(d==="ArrowRight"&&t.classList.contains("parent")){this.toggle(l,!0),e.preventDefault();return}else if(d==="ArrowLeft"){if(t.classList.contains("parent")?this.toggle(l,!1):t.dataset.parent&&(p=this.renderRoot.querySelector(`.parent[data-index="${t.dataset.parent}"]`)??void 0),!p){e.preventDefault();return}}else return}e.preventDefault(),p?.focus()},$p=function(e,t=0){return e.flatMap(i=>[[i,t],...a(this,O,$p).call(this,i.items??[],t+1)])},kp=function(e){if(e===this.collapsed)return!0;let t=this.dispatchEvent(new CustomEvent("cm-collapse",{bubbles:!0,composed:!0,cancelable:!0,detail:{collapsed:e}}));return t&&(this.collapsed=e),t},If=function(e){let t=this.navItems[e];a(this,O,kp).call(this,!1)&&(this.toggle(e,!0),this.updateComplete.then(()=>this.renderRoot.querySelector(`.parent[data-index="${e}"]`)?.focus()))},Ep=function(e){return e.icon?c`<cm-icon name=${e.icon} size="20"></cm-icon>`:this.collapsed?c`<span class="initial" aria-hidden="true">${[...e.label.trim()][0]??""}</span>`:h},Mp=function(e){if(!this.collapsed)return c`<span class="label">${e.label}</span>${e.badge?c`<span class="badge">${e.badge}</span>`:h}`;let t=e.badge&&/^\d{1,2}\+?$/.test(e.badge.trim());return c`<span class="sr">${e.label}${e.badge?` (${e.badge})`:""}</span>${e.badge?c`<span class="dot ${t?"count":""}" aria-hidden="true">${t?e.badge:h}</span>`:h}`},cd=function(e,t){return this.collapsed?c`<cm-tooltip content=${e.label} placement="end" visual-only>${t}</cm-tooltip>`:t},Tp=function(e,t,i={}){let r=c`${a(this,O,Ep).call(this,e)}${a(this,O,Mp).call(this,e)}`;return a(this,O,cd).call(this,e,e.href?c`<a class="item ${t}" part="item" href=${e.href} aria-current=${e.current?"page":h}
2407
+ data-index=${i.index??h} data-parent=${i.parent??h} @click=${l=>a(this,O,wp).call(this,l,e)}>${r}</a>`:c`<button type="button" class="item ${t}" part="item" aria-current=${e.current?"page":h}
2408
+ data-index=${i.index??h} data-parent=${i.parent??h} @click=${l=>a(this,O,wp).call(this,l,e)}>${r}</button>`)},Pf=function(){if(!this.collapsible)return h;let e=this.t(this.collapsed?"expand":"collapse"),t=c`<cm-icon name=${this.collapsed?"chevron-right":"chevron-left"} size="20"></cm-icon>${this.collapsed?c`<span class="sr">${e}</span>`:c`<span class="label">${e}</span>`}`;return c`<div class="toggle-row">${a(this,O,cd).call(this,{label:e},c`<button type="button" class="item toggle" part="collapse-button"
2409
+ @click=${()=>a(this,O,kp).call(this,!this.collapsed)}>${t}</button>`)}</div>`},ta.properties={items:{type:Array},label:{string:"label"},collapsed:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},_slotted:{state:!0},_open:{state:!0}},ta.styles=[E,x`
2063
2410
  :host { display: block; width: var(--cm-side-navigation-width, 250px); }
2064
2411
  nav {
2065
2412
  background: var(--cm-bg-dashboard); color: var(--cm-text-on-dark-secondary); border-radius: 16px;
@@ -2099,15 +2446,15 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2099
2446
  background: var(--cm-nav-badge); box-shadow: 0 0 0 2px var(--cm-bg-dashboard);
2100
2447
  }
2101
2448
  .dot.count { inset-block-start: 3px; height: 16px; padding: 0 4px; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; color: var(--cm-text-on-dark); }
2102
- `];g("cm-side-navigation",er);var xd=0,Yp="";function wd(){xd++===0&&(Yp=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden")}function fn(){xd>0&&--xd===0&&(document.documentElement.style.overflow=Yp)}function $d(){let n=document.activeElement;for(;n?.shadowRoot?.activeElement;)n=n.shadowRoot.activeElement;return n}var tr,dt,ir,bn,yd,Ll,Sl,Al,Dl,Nl,X=class extends k{constructor(){super(...arguments);p(this,bn);this.open=!1;this.label="";this.uid=L("cm-ovl");p(this,tr,null);p(this,dt,!1);p(this,ir,!1);p(this,Ll,e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.requestClose("escape"))});p(this,Sl,e=>{e.preventDefault(),this.requestClose("escape")});p(this,Al,()=>{this.open&&!this.dialog?.open&&(this.open=!1,o(this,bn,yd).call(this))});p(this,Dl,e=>{f(this,ir,e.target===e.currentTarget)});p(this,Nl,e=>{if(e.target===e.currentTarget&&s(this,ir)){let t=e.currentTarget.getBoundingClientRect();(!(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom)||this.backdropFillsDialog)&&this.requestClose("backdrop")}f(this,ir,!1)});this.backdropFillsDialog=!1}show(){this.open=!0}close(){this.open=!1}requestClose(e="method"){let t=this.dispatchEvent(new CustomEvent("cm-close",{detail:{reason:e},bubbles:!0,composed:!0,cancelable:!0}));return t&&(this.open=!1),t}get dialog(){return this.renderRoot?.querySelector("dialog")}updated(e){if(super.updated(e),!e.has("open"))return;let t=this.dialog;if(t)if(this.open&&!t.open){if(f(this,tr,$d()),!this.isConnected)return;t.showModal(),s(this,dt)||(wd(),f(this,dt,!0)),this.focusFirst(),this.dispatchEvent(new CustomEvent("cm-open",{bubbles:!0,composed:!0}))}else!this.open&&t.open&&(t.close(),o(this,bn,yd).call(this))}focusFirst(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}this.renderRoot.querySelector(".panel")?.focus()}disconnectedCallback(){super.disconnectedCallback(),s(this,dt)&&(fn(),f(this,dt,!1))}renderHeader(e=d){return l`<header class="head" part="header">
2449
+ `];w("cm-side-navigation",ta);var Cp=0,Of="";function Lp(){Cp++===0&&(Of=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden")}function Po(){Cp>0&&--Cp===0&&(document.documentElement.style.overflow=Of)}function Sp(){let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o}var ia,qt,sa,Oo,_p,hd,pd,ud,md,fd,oe=class extends T{constructor(){super(...arguments);u(this,Oo);this.open=!1;this.label="";this.uid=D("cm-ovl");u(this,ia,null);u(this,qt,!1);u(this,sa,!1);u(this,hd,e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.requestClose("escape"))});u(this,pd,e=>{e.preventDefault(),this.requestClose("escape")});u(this,ud,()=>{this.open&&!this.dialog?.open&&(this.open=!1,a(this,Oo,_p).call(this))});u(this,md,e=>{g(this,sa,e.target===e.currentTarget)});u(this,fd,e=>{if(e.target===e.currentTarget&&s(this,sa)){let t=e.currentTarget.getBoundingClientRect();(!(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom)||this.backdropFillsDialog)&&this.requestClose("backdrop")}g(this,sa,!1)});this.backdropFillsDialog=!1}show(){this.open=!0}close(){this.open=!1}requestClose(e="method"){let t=this.dispatchEvent(new CustomEvent("cm-close",{detail:{reason:e},bubbles:!0,composed:!0,cancelable:!0}));return t&&(this.open=!1),t}get dialog(){return this.renderRoot?.querySelector("dialog")}updated(e){if(super.updated(e),!e.has("open"))return;let t=this.dialog;if(t)if(this.open&&!t.open){if(g(this,ia,Sp()),!this.isConnected)return;t.showModal(),s(this,qt)||(Lp(),g(this,qt,!0)),this.focusFirst(),this.dispatchEvent(new CustomEvent("cm-open",{bubbles:!0,composed:!0}))}else!this.open&&t.open&&(t.close(),a(this,Oo,_p).call(this))}focusFirst(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}this.renderRoot.querySelector(".panel")?.focus()}disconnectedCallback(){super.disconnectedCallback(),s(this,qt)&&(Po(),g(this,qt,!1))}renderHeader(e=h){return c`<header class="head" part="header">
2103
2450
  <h2 id="${this.uid}-h">${this.heading}</h2>${e}
2104
2451
  <button type="button" class="x" part="close" aria-label=${this.closeLabel||this.t("close")} @click=${()=>this.requestClose("close-button")}>
2105
2452
  <cm-icon name="close" size="18"></cm-icon></button>
2106
- </header>`}renderDialog(e,t=""){return l`<dialog part="dialog" class=${t}
2107
- aria-labelledby=${this.heading?`${this.uid}-h`:d}
2108
- aria-label=${!this.heading&&this.label?this.label:d}
2109
- @keydown=${s(this,Ll)} @cancel=${s(this,Sl)} @close=${s(this,Al)}
2110
- @pointerdown=${s(this,Dl)} @click=${s(this,Nl)}>${e}</dialog>`}};tr=new WeakMap,dt=new WeakMap,ir=new WeakMap,bn=new WeakSet,yd=function(){s(this,dt)&&(fn(),f(this,dt,!1));let e=s(this,tr);f(this,tr,null),e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("cm-closed",{bubbles:!0,composed:!0}))},Ll=new WeakMap,Sl=new WeakMap,Al=new WeakMap,Dl=new WeakMap,Nl=new WeakMap,X.properties={open:{type:Boolean,reflect:!0},heading:{string:"heading"},label:{},closeLabel:{attribute:"close-label",string:"close"}},X.overlayStyles=[w,b`
2453
+ </header>`}renderDialog(e,t=""){return c`<dialog part="dialog" class=${t}
2454
+ aria-labelledby=${this.heading?`${this.uid}-h`:h}
2455
+ aria-label=${!this.heading&&this.label?this.label:h}
2456
+ @keydown=${s(this,hd)} @cancel=${s(this,pd)} @close=${s(this,ud)}
2457
+ @pointerdown=${s(this,md)} @click=${s(this,fd)}>${e}</dialog>`}};ia=new WeakMap,qt=new WeakMap,sa=new WeakMap,Oo=new WeakSet,_p=function(){s(this,qt)&&(Po(),g(this,qt,!1));let e=s(this,ia);g(this,ia,null),e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("cm-closed",{bubbles:!0,composed:!0}))},hd=new WeakMap,pd=new WeakMap,ud=new WeakMap,md=new WeakMap,fd=new WeakMap,oe.properties={open:{type:Boolean,reflect:!0},heading:{string:"heading"},label:{},closeLabel:{attribute:"close-label",string:"close"}},oe.overlayStyles=[E,x`
2111
2458
  :host { display: contents; }
2112
2459
  dialog {
2113
2460
  padding: 0; border: 0; margin: 0; max-width: none; max-height: none; background: transparent; color: inherit;
@@ -2138,7 +2485,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2138
2485
  dialog[open] .panel { animation: cm-ovl-in 160ms ease-out; }
2139
2486
  }
2140
2487
  @keyframes cm-ovl-in { from { opacity: 0; } to { opacity: 1; } }
2141
- `];function Wp(n){let r=n.trim().split(/[\s._@-]+/).filter(Boolean);if(!r.length)return"";let e=[...r[0]][0]??"",t=r.length>1&&!/[.@]/.test(n)?[...r[r.length-1]][0]??"":"";return(e+t).toLocaleUpperCase()}var sr=class extends _{constructor(){super(...arguments);this.name="";this.src="";this.size="medium";this.shape="round";this.decorative=!1;this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){let e=Wp(this.name),t=this.decorative||!this.name?d:this.name,i=this.decorative||!this.name?"true":d,a,c="avatar";return this.src&&!this._failed?a=l`<img src=${this.src} alt="" @error=${()=>{this._failed=!0}}>`:e?a=l`<span aria-hidden="true">${e}</span>`:(c+=" icon",a=l`<cm-icon name=${this.shape==="square"?"store":"user"} size="18"></cm-icon>`),l`<span class=${c} part="avatar" role=${t===d?d:"img"} aria-label=${t} aria-hidden=${i}>${a}</span>`}};sr.properties={name:{},src:{},size:{reflect:!0},shape:{reflect:!0},decorative:{type:Boolean,reflect:!0},_failed:{state:!0}},sr.styles=[w,b`
2488
+ `];function qf(o){let n=o.trim().split(/[\s._@-]+/).filter(Boolean);if(!n.length)return"";let e=[...n[0]][0]??"",t=n.length>1&&!/[.@]/.test(o)?[...n[n.length-1]][0]??"":"";return(e+t).toLocaleUpperCase()}var ra=class extends L{constructor(){super(...arguments);this.name="";this.src="";this.size="medium";this.shape="round";this.decorative=!1;this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){let e=qf(this.name),t=this.decorative||!this.name?h:this.name,i=this.decorative||!this.name?"true":h,r,l="avatar";return this.src&&!this._failed?r=c`<img src=${this.src} alt="" @error=${()=>{this._failed=!0}}>`:e?r=c`<span aria-hidden="true">${e}</span>`:(l+=" icon",r=c`<cm-icon name=${this.shape==="square"?"store":"user"} size="18"></cm-icon>`),c`<span class=${l} part="avatar" role=${t===h?h:"img"} aria-label=${t} aria-hidden=${i}>${r}</span>`}};ra.properties={name:{},src:{},size:{reflect:!0},shape:{reflect:!0},decorative:{type:Boolean,reflect:!0},_failed:{state:!0}},ra.styles=[E,x`
2142
2489
  :host { --_size: var(--cm-avatar-size, 36px); display: inline-flex; vertical-align: middle; flex: none; }
2143
2490
  :host([size='small']) { --_size: var(--cm-avatar-size, 24px); }
2144
2491
  :host([size='large']) { --_size: var(--cm-avatar-size, 48px); }
@@ -2151,34 +2498,34 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2151
2498
  .icon { background: var(--cm-bg-input-filled); color: var(--cm-icon-selected); }
2152
2499
  img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
2153
2500
  @media (forced-colors: active) { .avatar { border: 1px solid CanvasText; } }
2154
- `];g("cm-avatar",sr);var oy=M("headerBar",{label:"Admin",store:"Store: {store}. Switch store",balance:"Wallet balance {balance}",account:"Account: {name}",search:"Search"}),nr,ht,or,ce,gn,kd,rr,ar=class extends k{constructor(){super();p(this,ce);this.store="";this.balance="";this.userName="";this.avatarSrc="";this._narrow=!1;this._hasSearch=!1;this._searchOpen=!1;p(this,nr);p(this,ht,!1);p(this,or,null);this.addEventListener("cm-select",e=>{let t=o(this,ce,gn).call(this);this._searchOpen&&t&&e.composedPath().includes(t)&&this.closeSearch()})}get searchOpen(){return this._searchOpen}openSearch(){if(!this._narrow){o(this,ce,gn).call(this)?.focus();return}this._searchOpen||(f(this,or,$d()),this._searchOpen=!0)}closeSearch(){this._searchOpen&&(this._searchOpen=!1)}connectedCallback(){super.connectedCallback(),f(this,nr,new ResizeObserver(([e])=>{let t=e.contentRect.width<=900;t!==this._narrow&&(this._narrow=t,t||this.closeSearch())})),s(this,nr).observe(this)}disconnectedCallback(){super.disconnectedCallback(),s(this,nr)?.disconnect(),s(this,ht)&&(fn(),f(this,ht,!1))}updated(e){if(!e.has("_searchOpen"))return;let t=this.renderRoot.querySelector("dialog.layer");if(this._searchOpen&&t&&!t.open)t.showModal(),s(this,ht)||(wd(),f(this,ht,!0)),o(this,ce,gn).call(this)?.focus(),o(this,ce,rr).call(this,"cm-search-toggle",{open:!0});else if(!this._searchOpen&&e.get("_searchOpen")){t?.open&&t.close(),s(this,ht)&&(fn(),f(this,ht,!1));let i=s(this,or)??this.renderRoot.querySelector(".search-btn");f(this,or,null),i?.isConnected&&i.focus(),o(this,ce,rr).call(this,"cm-search-toggle",{open:!1})}}render(){return l`
2155
- <header part="bar" role="banner" aria-label=${this.label||d}>
2501
+ `];w("cm-avatar",ra);var v1=C("headerBar",{label:"Admin",store:"Store: {store}. Switch store",balance:"Wallet balance {balance}",account:"Account: {name}",search:"Search"}),oa,Bt,la,ye,qo,zp,aa,na=class extends T{constructor(){super();u(this,ye);this.store="";this.balance="";this.userName="";this.avatarSrc="";this._narrow=!1;this._hasSearch=!1;this._searchOpen=!1;u(this,oa);u(this,Bt,!1);u(this,la,null);this.addEventListener("cm-select",e=>{let t=a(this,ye,qo).call(this);this._searchOpen&&t&&e.composedPath().includes(t)&&this.closeSearch()})}get searchOpen(){return this._searchOpen}openSearch(){if(!this._narrow){a(this,ye,qo).call(this)?.focus();return}this._searchOpen||(g(this,la,Sp()),this._searchOpen=!0)}closeSearch(){this._searchOpen&&(this._searchOpen=!1)}connectedCallback(){super.connectedCallback(),g(this,oa,new ResizeObserver(([e])=>{let t=e.contentRect.width<=900;t!==this._narrow&&(this._narrow=t,t||this.closeSearch())})),s(this,oa).observe(this)}disconnectedCallback(){super.disconnectedCallback(),s(this,oa)?.disconnect(),s(this,Bt)&&(Po(),g(this,Bt,!1))}updated(e){if(!e.has("_searchOpen"))return;let t=this.renderRoot.querySelector("dialog.layer");if(this._searchOpen&&t&&!t.open)t.showModal(),s(this,Bt)||(Lp(),g(this,Bt,!0)),a(this,ye,qo).call(this)?.focus(),a(this,ye,aa).call(this,"cm-search-toggle",{open:!0});else if(!this._searchOpen&&e.get("_searchOpen")){t?.open&&t.close(),s(this,Bt)&&(Po(),g(this,Bt,!1));let i=s(this,la)??this.renderRoot.querySelector(".search-btn");g(this,la,null),i?.isConnected&&i.focus(),a(this,ye,aa).call(this,"cm-search-toggle",{open:!1})}}render(){return c`
2502
+ <header part="bar" role="banner" aria-label=${this.label||h}>
2156
2503
  <div class="logo"><slot name="logo"></slot></div>
2157
- ${this.store?l`<button type="button" class="store" part="store" aria-haspopup="true" aria-label=${this.t("store",{store:this.store})}
2158
- @click=${()=>o(this,ce,rr).call(this,"cm-store-switch")}><span>${this.store}</span><cm-icon name="chevron-down" size="20"></cm-icon></button>`:d}
2159
- ${this._narrow?d:l`<div class="search${this._hasSearch?" has":""}" part="search"><slot name="search" @slotchange=${o(this,ce,kd)}></slot></div>`}
2504
+ ${this.store?c`<button type="button" class="store" part="store" aria-haspopup="true" aria-label=${this.t("store",{store:this.store})}
2505
+ @click=${()=>a(this,ye,aa).call(this,"cm-store-switch")}><span>${this.store}</span><cm-icon name="chevron-down" size="20"></cm-icon></button>`:h}
2506
+ ${this._narrow?h:c`<div class="search${this._hasSearch?" has":""}" part="search"><slot name="search" @slotchange=${a(this,ye,zp)}></slot></div>`}
2160
2507
  <span class="grow"></span>
2161
2508
  <div class="end">
2162
- ${this._narrow&&this._hasSearch?l`<button type="button" class="search-btn" part="search-button" aria-label=${this.searchLabel}
2163
- aria-haspopup="dialog" aria-expanded=${this._searchOpen?"true":"false"} @click=${()=>this.openSearch()}><cm-icon name="search" size="20"></cm-icon></button>`:d}
2509
+ ${this._narrow&&this._hasSearch?c`<button type="button" class="search-btn" part="search-button" aria-label=${this.searchLabel}
2510
+ aria-haspopup="dialog" aria-expanded=${this._searchOpen?"true":"false"} @click=${()=>this.openSearch()}><cm-icon name="search" size="20"></cm-icon></button>`:h}
2164
2511
  <div class="actions"><slot name="actions"></slot></div>
2165
- ${this.balance?l`<button type="button" class="pill" part="balance" aria-label=${this.t("balance",{balance:this.balance})}
2166
- @click=${()=>o(this,ce,rr).call(this,"cm-wallet")}>${this.balance}</button>`:d}
2167
- ${this.userName?l`<button type="button" class="user" part="user" aria-haspopup="true" aria-label=${this.t("account",{name:this.userName})}
2168
- @click=${()=>o(this,ce,rr).call(this,"cm-account")}><span class="name">${this.userName}</span>
2169
- <cm-avatar class="avatar" name=${this.userName} src=${this.avatarSrc} decorative></cm-avatar></button>`:d}
2512
+ ${this.balance?c`<button type="button" class="pill" part="balance" aria-label=${this.t("balance",{balance:this.balance})}
2513
+ @click=${()=>a(this,ye,aa).call(this,"cm-wallet")}>${this.balance}</button>`:h}
2514
+ ${this.userName?c`<button type="button" class="user" part="user" aria-haspopup="true" aria-label=${this.t("account",{name:this.userName})}
2515
+ @click=${()=>a(this,ye,aa).call(this,"cm-account")}><span class="name">${this.userName}</span>
2516
+ <cm-avatar class="avatar" name=${this.userName} src=${this.avatarSrc} decorative></cm-avatar></button>`:h}
2170
2517
  <slot name="end"></slot>
2171
2518
  </div>
2172
2519
  </header>
2173
- ${this._narrow?l`<dialog class="layer" part="search-layer" aria-label=${this.searchLabel}
2520
+ ${this._narrow?c`<dialog class="layer" part="search-layer" aria-label=${this.searchLabel}
2174
2521
  @keydown=${e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),this.closeSearch())}}
2175
2522
  @cancel=${e=>{e.preventDefault(),this.closeSearch()}} @close=${()=>this.closeSearch()}>
2176
2523
  <div class="layer-bar">
2177
- <div class="layer-search"><slot name="search" @slotchange=${o(this,ce,kd)}></slot></div>
2524
+ <div class="layer-search"><slot name="search" @slotchange=${a(this,ye,zp)}></slot></div>
2178
2525
  <button type="button" class="layer-close" aria-label=${this.t("close")} @click=${()=>this.closeSearch()}><cm-icon name="close" size="20"></cm-icon></button>
2179
2526
  </div>
2180
- </dialog>`:d}
2181
- `}};nr=new WeakMap,ht=new WeakMap,or=new WeakMap,ce=new WeakSet,gn=function(){return this.querySelector(':scope > [slot="search"]')},kd=function(){this._hasSearch=!!o(this,ce,gn).call(this)},rr=function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},ar.properties={store:{},balance:{},userName:{attribute:"user-name"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},searchLabel:{attribute:"search-label",string:"search"},_narrow:{state:!0},_hasSearch:{state:!0},_searchOpen:{state:!0}},ar.styles=[w,b`
2527
+ </dialog>`:h}
2528
+ `}};oa=new WeakMap,Bt=new WeakMap,la=new WeakMap,ye=new WeakSet,qo=function(){return this.querySelector(':scope > [slot="search"]')},zp=function(){this._hasSearch=!!a(this,ye,qo).call(this)},aa=function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},na.properties={store:{},balance:{},userName:{attribute:"user-name"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},searchLabel:{attribute:"search-label",string:"search"},_narrow:{state:!0},_hasSearch:{state:!0},_searchOpen:{state:!0}},na.styles=[E,x`
2182
2529
  :host { display: block; background: var(--cm-bg-surface); container-type: inline-size; }
2183
2530
  header {
2184
2531
  display: flex; align-items: center; gap: var(--cm-space-20); min-height: 70px; padding-block: 10px; padding-inline: 27px var(--cm-space-20);
@@ -2248,10 +2595,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2248
2595
  /* The controls on the right keep their 44px touch areas, so they need no gap between them; the logo gives way first. */
2249
2596
  .end { gap: 0; }
2250
2597
  }
2251
- `];g("cm-header-bar",ar);var fy=M("bottomNavigation",{label:"Main"}),vn,wi,Ed,Xp,lr=class extends k{constructor(){super(...arguments);p(this,wi);this.items=[];this.fixed=!1;this._slotted=[];p(this,vn)}connectedCallback(){super.connectedCallback(),o(this,wi,Ed).call(this),f(this,vn,Ot(this,()=>o(this,wi,Ed).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,vn)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return l`<nav part="nav" aria-label=${this.label||this.t("label")}>
2252
- <ul>${this.navItems.slice(0,5).map(e=>l`<li>${o(this,wi,Xp).call(this,e)}</li>`)}</ul>
2598
+ `];w("cm-header-bar",na);var T1=C("bottomNavigation",{label:"Main"}),Bo,os,Dp,Bf,ca=class extends T{constructor(){super(...arguments);u(this,os);this.items=[];this.fixed=!1;this._slotted=[];u(this,Bo)}connectedCallback(){super.connectedCallback(),a(this,os,Dp).call(this),g(this,Bo,yi(this,()=>a(this,os,Dp).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,Bo)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
2599
+ <ul>${this.navItems.slice(0,5).map(e=>c`<li>${a(this,os,Bf).call(this,e)}</li>`)}</ul>
2253
2600
  <slot hidden></slot>
2254
- </nav>`}};vn=new WeakMap,wi=new WeakSet,Ed=function(){this._slotted=ct(this)},Xp=function(e){let t=`item ${e.primary?"primary":""}`,i=l`<span class="icon">${e.icon?l`<cm-icon name=${e.icon} size=${e.primary?16:24}></cm-icon>`:d}</span><span class="label">${e.label}</span>`,a=c=>{qt(this,e)||c.preventDefault()};return e.href?l`<a class=${t} part="item" href=${e.href} aria-current=${e.current?"page":d} @click=${a}>${i}</a>`:l`<button type="button" class=${t} part="item" aria-current=${e.current?"page":d} @click=${a}>${i}</button>`},lr.properties={items:{type:Array},label:{string:"label"},fixed:{type:Boolean,reflect:!0},_slotted:{state:!0}},lr.styles=[w,b`
2601
+ </nav>`}};Bo=new WeakMap,os=new WeakSet,Dp=function(){this._slotted=Ot(this)},Bf=function(e){let t=`item ${e.primary?"primary":""}`,i=c`<span class="icon">${e.icon?c`<cm-icon name=${e.icon} size=${e.primary?16:24}></cm-icon>`:h}</span><span class="label">${e.label}</span>`,r=l=>{wi(this,e)||l.preventDefault()};return e.href?c`<a class=${t} part="item" href=${e.href} aria-current=${e.current?"page":h} @click=${r}>${i}</a>`:c`<button type="button" class=${t} part="item" aria-current=${e.current?"page":h} @click=${r}>${i}</button>`},ca.properties={items:{type:Array},label:{string:"label"},fixed:{type:Boolean,reflect:!0},_slotted:{state:!0}},ca.styles=[E,x`
2255
2602
  :host { display: block; }
2256
2603
  :host([fixed]) { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; }
2257
2604
  nav {
@@ -2271,31 +2618,31 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2271
2618
  .icon { display: grid; place-items: center; width: 26px; height: 26px; }
2272
2619
  .primary .icon { color: var(--cm-action-primary-text); background: var(--cm-action-primary); border-radius: var(--cm-radius-xs); }
2273
2620
  .label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
2274
- `];g("cm-bottom-navigation",lr);var ky=M("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),xn,$i,me,Md,Jp,Td,_d,Zp,cr=class extends k{constructor(){super(...arguments);p(this,me);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;p(this,xn);p(this,$i,L("cm-mmenu"))}connectedCallback(){super.connectedCallback(),o(this,me,Md).call(this),f(this,xn,Ot(this,()=>o(this,me,Md).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,xn)?.disconnect()}get sections(){return this.items.length?this.items:this._slotted}back(){if(!this._page)return;let[e,t]=this._page;this._page=null,this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-row="${e}-${t}"]`)?.focus())}render(){let e=this.sections,t=this._page?e[this._page[0]]?.items?.[this._page[1]]:void 0;return t?l`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${s(this,$i)}-sub"
2621
+ `];w("cm-bottom-navigation",ca);var N1=C("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),Fo,ls,Ce,Ap,Ff,Np,Rp,jf,da=class extends T{constructor(){super(...arguments);u(this,Ce);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;u(this,Fo);u(this,ls,D("cm-mmenu"))}connectedCallback(){super.connectedCallback(),a(this,Ce,Ap).call(this),g(this,Fo,yi(this,()=>a(this,Ce,Ap).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,Fo)?.disconnect()}get sections(){return this.items.length?this.items:this._slotted}back(){if(!this._page)return;let[e,t]=this._page;this._page=null,this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-row="${e}-${t}"]`)?.focus())}render(){let e=this.sections,t=this._page?e[this._page[0]]?.items?.[this._page[1]]:void 0;return t?c`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${s(this,ls)}-sub"
2275
2622
  @keydown=${i=>{i.key==="Escape"&&(i.preventDefault(),this.back())}}>
2276
2623
  <button type="button" class="back" part="back" @click=${()=>this.back()}><cm-icon name="arrow-left" size="18"></cm-icon>${t.label}</button>
2277
- <ul class="card" aria-label=${t.label}>${t.items.map(i=>l`<li>${o(this,me,_d).call(this,i,0,0,!0)}</li>`)}</ul>
2624
+ <ul class="card" aria-label=${t.label}>${t.items.map(i=>c`<li>${a(this,Ce,Rp).call(this,i,0,0,!0)}</li>`)}</ul>
2278
2625
  <slot hidden></slot>
2279
- </nav>`:l`<nav part="nav" aria-label=${this.label||this.t("label")}>
2280
- ${o(this,me,Zp).call(this)}
2281
- ${e.map((i,a)=>{let c=`${s(this,$i)}-s${a}`;return l`<section aria-labelledby=${i.label?c:d}>
2282
- ${i.label?l`<h2 class="heading" id=${c}>${i.label}</h2>`:d}
2283
- <ul class="card">${(i.items??[]).map((h,u)=>l`<li>${o(this,me,_d).call(this,h,a,u)}</li>`)}</ul>
2626
+ </nav>`:c`<nav part="nav" aria-label=${this.label||this.t("label")}>
2627
+ ${a(this,Ce,jf).call(this)}
2628
+ ${e.map((i,r)=>{let l=`${s(this,ls)}-s${r}`;return c`<section aria-labelledby=${i.label?l:h}>
2629
+ ${i.label?c`<h2 class="heading" id=${l}>${i.label}</h2>`:h}
2630
+ <ul class="card">${(i.items??[]).map((d,p)=>c`<li>${a(this,Ce,Rp).call(this,d,r,p)}</li>`)}</ul>
2284
2631
  </section>`})}
2285
2632
  <slot hidden></slot>
2286
- </nav>`}};xn=new WeakMap,$i=new WeakMap,me=new WeakSet,Md=function(){this._slotted=ct(this)},Jp=function(e,t){this._page=[e,t],this.updateComplete.then(()=>this.renderRoot.querySelector(".back")?.focus())},Td=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},_d=function(e,t,i,a=!1){let c=y=>{qt(this,e)||y.preventDefault()};if(e.primary&&!a)return l`<button type="button" class="row action" part="row" @click=${c}>${e.label}</button>`;let h=e.icon&&!a?l`<cm-icon class="icon" name=${e.icon} size="24"></cm-icon>`:d,u=e.badge?l`<span class="badge">${e.badge}</span>`:d;if(e.items?.length&&!a)return l`<button type="button" class="row" part="row" data-row="${t}-${i}"
2287
- @click=${()=>o(this,me,Jp).call(this,t,i)}>${h}<span class="label">${e.label}</span>${u}<cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button>`;let m=l`${h}<span class="label">${e.label}</span>${u}${e.href&&!a?l`<cm-icon class="chev" name="chevron-right" size="16"></cm-icon>`:d}`;return e.href?l`<a class="row" part="row" href=${e.href} aria-current=${e.current?"page":d} @click=${c}>${m}</a>`:l`<button type="button" class="row" part="row" aria-current=${e.current?"page":d} @click=${c}>${m}</button>`},Zp=function(){if(!this.store&&!this.userName)return d;let e=this.userName.trim().charAt(0).toUpperCase();return l`<section aria-labelledby="${s(this,$i)}-profile">
2288
- <h2 class="heading" id="${s(this,$i)}-profile">${this.t("profile")}</h2>
2633
+ </nav>`}};Fo=new WeakMap,ls=new WeakMap,Ce=new WeakSet,Ap=function(){this._slotted=Ot(this)},Ff=function(e,t){this._page=[e,t],this.updateComplete.then(()=>this.renderRoot.querySelector(".back")?.focus())},Np=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},Rp=function(e,t,i,r=!1){let l=v=>{wi(this,e)||v.preventDefault()};if(e.primary&&!r)return c`<button type="button" class="row action" part="row" @click=${l}>${e.label}</button>`;let d=e.icon&&!r?c`<cm-icon class="icon" name=${e.icon} size="24"></cm-icon>`:h,p=e.badge?c`<span class="badge">${e.badge}</span>`:h;if(e.items?.length&&!r)return c`<button type="button" class="row" part="row" data-row="${t}-${i}"
2634
+ @click=${()=>a(this,Ce,Ff).call(this,t,i)}>${d}<span class="label">${e.label}</span>${p}<cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button>`;let m=c`${d}<span class="label">${e.label}</span>${p}${e.href&&!r?c`<cm-icon class="chev" name="chevron-right" size="16"></cm-icon>`:h}`;return e.href?c`<a class="row" part="row" href=${e.href} aria-current=${e.current?"page":h} @click=${l}>${m}</a>`:c`<button type="button" class="row" part="row" aria-current=${e.current?"page":h} @click=${l}>${m}</button>`},jf=function(){if(!this.store&&!this.userName)return h;let e=this.userName.trim().charAt(0).toUpperCase();return c`<section aria-labelledby="${s(this,ls)}-profile">
2635
+ <h2 class="heading" id="${s(this,ls)}-profile">${this.t("profile")}</h2>
2289
2636
  <ul class="card">
2290
- ${this.store?l`<li><button type="button" class="row" part="row" @click=${()=>o(this,me,Td).call(this,"cm-store-switch")}>
2637
+ ${this.store?c`<li><button type="button" class="row" part="row" @click=${()=>a(this,Ce,Np).call(this,"cm-store-switch")}>
2291
2638
  <span class="stack"><span class="eyebrow">${this.t("store")}</span><span>${this.store}</span></span>
2292
- <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:d}
2293
- ${this.userName?l`<li><button type="button" class="row" part="row" @click=${()=>o(this,me,Td).call(this,"cm-account")}>
2294
- <span class="avatar">${this.avatarSrc?l`<img src=${this.avatarSrc} alt="">`:l`<span aria-hidden="true">${e}</span>`}</span>
2295
- <span class="stack"><span>${this.userName}</span>${this.userEmail?l`<span class="email">${this.userEmail}</span>`:d}</span>
2296
- <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:d}
2639
+ <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:h}
2640
+ ${this.userName?c`<li><button type="button" class="row" part="row" @click=${()=>a(this,Ce,Np).call(this,"cm-account")}>
2641
+ <span class="avatar">${this.avatarSrc?c`<img src=${this.avatarSrc} alt="">`:c`<span aria-hidden="true">${e}</span>`}</span>
2642
+ <span class="stack"><span>${this.userName}</span>${this.userEmail?c`<span class="email">${this.userEmail}</span>`:h}</span>
2643
+ <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:h}
2297
2644
  </ul>
2298
- </section>`},cr.properties={items:{type:Array},store:{},userName:{attribute:"user-name"},userEmail:{attribute:"user-email"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},_slotted:{state:!0},_page:{state:!0}},cr.styles=[w,b`
2645
+ </section>`},da.properties={items:{type:Array},store:{},userName:{attribute:"user-name"},userEmail:{attribute:"user-email"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},_slotted:{state:!0},_page:{state:!0}},da.styles=[E,x`
2299
2646
  :host { display: block; background: var(--cm-bg-page); }
2300
2647
  nav { padding: var(--cm-space-20); display: flex; flex-direction: column; gap: var(--cm-space-20); }
2301
2648
  .heading {
@@ -2332,11 +2679,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2332
2679
  }
2333
2680
  .back:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
2334
2681
  .sub .row { font-size: 16px; min-height: 48px; }
2335
- `];g("cm-mobile-menu",cr);var Ly=M("flashOfferBar",{label:"Offer",dismiss:"Dismiss offer"}),Rl,Qp,dr=class extends k{constructor(){super(...arguments);p(this,Rl);this.icon="send";this.dismissible=!1}render(){return l`<div class="bar" part="bar" role="region" aria-label=${this.label||this.t("label")}>
2336
- <span class="icon" aria-hidden="true"><slot name="icon">${this.icon?l`<cm-icon name=${this.icon} size="20"></cm-icon>`:d}</slot></span>
2682
+ `];w("cm-mobile-menu",da);var B1=C("flashOfferBar",{label:"Offer",dismiss:"Dismiss offer"}),gd,Vf,ha=class extends T{constructor(){super(...arguments);u(this,gd);this.icon="send";this.dismissible=!1}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.label||this.t("label")}>
2683
+ <span class="icon" aria-hidden="true"><slot name="icon">${this.icon?c`<cm-icon name=${this.icon} size="20"></cm-icon>`:h}</slot></span>
2337
2684
  <span class="text"><slot></slot></span>
2338
- ${this.dismissible?l`<button type="button" class="close" part="close" aria-label=${this.t("dismiss")} @click=${o(this,Rl,Qp)}><cm-icon name="close" size="18"></cm-icon></button>`:d}
2339
- </div>`}};Rl=new WeakSet,Qp=function(){this.dispatchEvent(new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0}))&&(this.hidden=!0)},dr.properties={icon:{},dismissible:{type:Boolean,reflect:!0},label:{string:"label"}},dr.styles=[w,b`
2685
+ ${this.dismissible?c`<button type="button" class="close" part="close" aria-label=${this.t("dismiss")} @click=${a(this,gd,Vf)}><cm-icon name="close" size="18"></cm-icon></button>`:h}
2686
+ </div>`}};gd=new WeakSet,Vf=function(){this.dispatchEvent(new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0}))&&(this.hidden=!0)},ha.properties={icon:{},dismissible:{type:Boolean,reflect:!0},label:{string:"label"}},ha.styles=[E,x`
2340
2687
  :host { display: block; }
2341
2688
  .bar {
2342
2689
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px;
@@ -2358,11 +2705,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2358
2705
  @media (max-width: 640px) {
2359
2706
  .bar { font-size: 14px; min-height: 44px; justify-content: flex-start; text-align: start; }
2360
2707
  }
2361
- `];g("cm-flash-offer-bar",dr);var Oy=M("linkTabs",{label:"Sections"}),yn,wn,Cd,hr=class extends k{constructor(){super(...arguments);p(this,wn);this.items=[];this._slotted=[];p(this,yn)}connectedCallback(){super.connectedCallback(),o(this,wn,Cd).call(this),f(this,yn,Ot(this,()=>o(this,wn,Cd).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,yn)?.disconnect()}get tabs(){return this.items.length?this.items:this._slotted}render(){return l`<nav part="nav" aria-label=${this.label||this.t("label")}>
2362
- <ul part="tabs">${this.tabs.map(e=>l`<li><a part="tab" href=${e.href||"#"} aria-current=${e.current?"page":d}
2363
- @click=${t=>{qt(this,e)||t.preventDefault()}}>${e.label}${e.badge?l`<span class="badge">(${e.badge})</span>`:d}</a></li>`)}</ul>
2708
+ `];w("cm-flash-offer-bar",ha);var G1=C("linkTabs",{label:"Sections"}),jo,Vo,Hp,pa=class extends T{constructor(){super(...arguments);u(this,Vo);this.items=[];this._slotted=[];u(this,jo)}connectedCallback(){super.connectedCallback(),a(this,Vo,Hp).call(this),g(this,jo,yi(this,()=>a(this,Vo,Hp).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,jo)?.disconnect()}get tabs(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
2709
+ <ul part="tabs">${this.tabs.map(e=>c`<li><a part="tab" href=${e.href||"#"} aria-current=${e.current?"page":h}
2710
+ @click=${t=>{wi(this,e)||t.preventDefault()}}>${e.label}${e.badge?c`<span class="badge">(${e.badge})</span>`:h}</a></li>`)}</ul>
2364
2711
  <slot hidden></slot>
2365
- </nav>`}};yn=new WeakMap,wn=new WeakSet,Cd=function(){this._slotted=ct(this)},hr.properties={items:{type:Array},label:{string:"label"},_slotted:{state:!0}},hr.styles=[w,b`
2712
+ </nav>`}};jo=new WeakMap,Vo=new WeakSet,Hp=function(){this._slotted=Ot(this)},pa.properties={items:{type:Array},label:{string:"label"},_slotted:{state:!0}},pa.styles=[E,x`
2366
2713
  :host { display: block; }
2367
2714
  ul {
2368
2715
  display: flex; gap: 28px; margin: 0; padding: 2px 2px 0; list-style: none; overflow-x: auto; scrollbar-width: thin;
@@ -2380,19 +2727,19 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2380
2727
  a:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; border-radius: var(--cm-radius-xs); }
2381
2728
  .badge { font-size: 12px; color: var(--cm-text-tertiary); }
2382
2729
  @media (max-width: 640px) { ul { gap: 18px; } a { font-size: 14px; } }
2383
- `];g("cm-link-tabs",hr);var Uy=M("appCard",{developer:"By {developer}",rating:"Rated {rating} out of 5",reviews:{one:"{count} Review",other:"{count} Reviews"},offer:"Offer: ",details:"View Details",detailsLabel:"View details of {name}"}),pr=class extends k{constructor(){super(...arguments);this.name="";this.developer="";this.reviewsHref="";this.pricing="";this.offer="";this.href="";this.headingLevel=3}render(){let e=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),t=typeof this.rating=="number"&&!Number.isNaN(this.rating),i=typeof this.reviews=="number"?this.t("reviews",{count:this.reviews}):"",a=t?this.formatNumber(this.rating,{minimumFractionDigits:1,maximumFractionDigits:1}):"";return l`<article part="card" aria-labelledby="name">
2730
+ `];w("cm-link-tabs",pa);var i$=C("appCard",{developer:"By {developer}",rating:"Rated {rating} out of 5",reviews:{one:"{count} Review",other:"{count} Reviews"},offer:"Offer: ",details:"View Details",detailsLabel:"View details of {name}"}),ua=class extends T{constructor(){super(...arguments);this.name="";this.developer="";this.reviewsHref="";this.pricing="";this.offer="";this.href="";this.headingLevel=3}render(){let e=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),t=typeof this.rating=="number"&&!Number.isNaN(this.rating),i=typeof this.reviews=="number"?this.t("reviews",{count:this.reviews}):"",r=t?this.formatNumber(this.rating,{minimumFractionDigits:1,maximumFractionDigits:1}):"";return c`<article part="card" aria-labelledby="name">
2384
2731
  <div class="logo" part="logo"><slot name="logo"></slot></div>
2385
2732
  <div class="status"><slot name="status"></slot></div>
2386
2733
  <div class="name" id="name" role="heading" aria-level=${e}>${this.name}</div>
2387
- ${this.developer?l`<p class="by">${this.t("developer",{developer:this.developer})}</p>`:d}
2388
- ${t?l`<p class="rating"><cm-icon class="star" name="star" size="12"></cm-icon>
2389
- <span aria-hidden="true">${a}</span><span class="sr">${this.t("rating",{rating:a})}</span>
2390
- ${i?this.reviewsHref?l`<a href=${this.reviewsHref}>${i}</a>`:l`<span>${i}</span>`:d}</p>`:d}
2391
- ${this.pricing?l`<p class="pricing">${this.pricing}</p>`:d}
2392
- ${this.offer?l`<p class="offer"><cm-icon name="percent" size="12"></cm-icon><span><span class="sr">${this.t("offer")}</span>${this.offer}</span></p>`:d}
2393
- <div class="actions"><slot name="actions"></slot>${this.href?l`<a class="details" part="details" href=${this.href}
2394
- aria-label=${this.t("detailsLabel",{name:this.name})}>${this.t("details")}</a>`:d}</div>
2395
- </article>`}};pr.properties={name:{},developer:{},rating:{type:Number},reviews:{type:Number},reviewsHref:{attribute:"reviews-href"},pricing:{},offer:{},href:{},headingLevel:{type:Number,attribute:"heading-level"}},pr.styles=[w,b`
2734
+ ${this.developer?c`<p class="by">${this.t("developer",{developer:this.developer})}</p>`:h}
2735
+ ${t?c`<p class="rating"><cm-icon class="star" name="star" size="12"></cm-icon>
2736
+ <span aria-hidden="true">${r}</span><span class="sr">${this.t("rating",{rating:r})}</span>
2737
+ ${i?this.reviewsHref?c`<a href=${this.reviewsHref}>${i}</a>`:c`<span>${i}</span>`:h}</p>`:h}
2738
+ ${this.pricing?c`<p class="pricing">${this.pricing}</p>`:h}
2739
+ ${this.offer?c`<p class="offer"><cm-icon name="percent" size="12"></cm-icon><span><span class="sr">${this.t("offer")}</span>${this.offer}</span></p>`:h}
2740
+ <div class="actions"><slot name="actions"></slot>${this.href?c`<a class="details" part="details" href=${this.href}
2741
+ aria-label=${this.t("detailsLabel",{name:this.name})}>${this.t("details")}</a>`:h}</div>
2742
+ </article>`}};ua.properties={name:{},developer:{},rating:{type:Number},reviews:{type:Number},reviewsHref:{attribute:"reviews-href"},pricing:{},offer:{},href:{},headingLevel:{type:Number,attribute:"heading-level"}},ua.styles=[E,x`
2396
2743
  :host { display: block; container-type: inline-size; }
2397
2744
  article {
2398
2745
  position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; padding: var(--cm-space-20);
@@ -2428,20 +2775,20 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2428
2775
  .actions { gap: var(--cm-space-10); }
2429
2776
  .details { margin-inline-start: auto; }
2430
2777
  }
2431
- `];g("cm-app-card",pr);var Hl,eu,ur=class extends X{constructor(){super(...arguments);p(this,Hl);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}render(){return this.renderDialog(l`<div class="panel" part="panel" tabindex="-1">
2778
+ `];w("cm-app-card",ua);var bd,Uf,ma=class extends oe{constructor(){super(...arguments);u(this,bd);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}render(){return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
2432
2779
  ${this.renderHeader()}
2433
2780
  <div class="body" part="body"><slot></slot></div>
2434
- <footer class="foot" part="footer" ?hidden=${!this._hasFooter}><slot name="footer" @slotchange=${o(this,Hl,eu)}></slot></footer>
2435
- </div>`)}};Hl=new WeakSet,eu=function(e){this._hasFooter=e.target.assignedElements().length>0},ur.properties={...X.properties,size:{reflect:!0},_hasFooter:{state:!0}},ur.styles=[...X.overlayStyles,b`
2781
+ <footer class="foot" part="footer" ?hidden=${!this._hasFooter}><slot name="footer" @slotchange=${a(this,bd,Uf)}></slot></footer>
2782
+ </div>`)}};bd=new WeakSet,Uf=function(e){this._hasFooter=e.target.assignedElements().length>0},ma.properties={...oe.properties,size:{reflect:!0},_hasFooter:{state:!0}},ma.styles=[...oe.overlayStyles,x`
2436
2783
  dialog { position: fixed; inset: 0; margin: auto; width: min(var(--cm-modal-width, 620px), calc(100vw - 32px)); }
2437
2784
  :host([size='small']) dialog { --cm-modal-width: 400px; }
2438
2785
  :host([size='large']) dialog { --cm-modal-width: 900px; }
2439
2786
  .panel { max-height: calc(100dvh - 64px); border-radius: var(--cm-radius-sm); box-shadow: var(--cm-shadow-100); }
2440
- `];g("cm-modal",ur);var Il,tu,Ge=class extends X{constructor(){super(...arguments);p(this,Il);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}renderBody(){return l`<slot></slot>`}renderFooter(){return l`<slot name="footer" @slotchange=${o(this,Il,tu)}></slot>`}get showFooter(){return this._hasFooter}render(){return this.renderDialog(l`<div class="panel" part="panel" tabindex="-1">
2787
+ `];w("cm-modal",ma);var vd,Kf,xt=class extends oe{constructor(){super(...arguments);u(this,vd);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}renderBody(){return c`<slot></slot>`}renderFooter(){return c`<slot name="footer" @slotchange=${a(this,vd,Kf)}></slot>`}get showFooter(){return this._hasFooter}render(){return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
2441
2788
  ${this.renderHeader()}
2442
2789
  <div class="body" part="body">${this.renderBody()}</div>
2443
2790
  <footer class="foot" part="footer" ?hidden=${!this.showFooter}>${this.renderFooter()}</footer>
2444
- </div>`)}};Il=new WeakSet,tu=function(e){this._hasFooter=e.target.assignedElements().length>0},Ge.properties={...X.properties,size:{reflect:!0},_hasFooter:{state:!0}},Ge.styles=[...X.overlayStyles,b`
2791
+ </div>`)}};vd=new WeakSet,Kf=function(e){this._hasFooter=e.target.assignedElements().length>0},xt.properties={...oe.properties,size:{reflect:!0},_hasFooter:{state:!0}},xt.styles=[...oe.overlayStyles,x`
2445
2792
  dialog {
2446
2793
  position: fixed; inset-block: 0; inset-inline: auto 0; height: 100dvh; width: min(var(--cm-side-panel-width, 450px), 100vw);
2447
2794
  }
@@ -2458,25 +2805,25 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2458
2805
  dialog { inset: 16px; width: auto; height: auto; }
2459
2806
  .panel { border-radius: var(--cm-radius-sm); }
2460
2807
  }
2461
- `];g("cm-side-panel",Ge);var o0=M("filterPanel",{heading:"Search and Filter",searchLabel:"Search",searchPlaceholder:"Search anything",apply:"Search",reset:"Reset"}),fr,Ol,mr=class extends Ge{constructor(){super(...arguments);this.search=!1;this.query="";p(this,fr,()=>{this.dispatchEvent(new CustomEvent("cm-filter-apply",{detail:{values:this.values,query:this.query},bubbles:!0,composed:!0,cancelable:!0}))&&this.requestClose("action")});p(this,Ol,()=>{this.reset(),this.dispatchEvent(new CustomEvent("cm-filter-reset",{bubbles:!0,composed:!0}))})}get form(){return this.querySelector("form")}get values(){let e={},t=(a,c)=>{if(c==="")return;let h=e[a];e[a]=h===void 0?c:Array.isArray(h)?[...h,c]:[h,c]},i=this.form;if(i){for(let[a,c]of new FormData(i))typeof c=="string"&&t(a,c);return e}return this.querySelectorAll("[name]").forEach(a=>{let c=a.getAttribute("name");"checked"in a&&(a.type==="checkbox"||a.type==="radio"||a.localName.match(/^cm-(checkbox|radio|toggle)$/))?a.checked&&t(c,a.value||"on"):typeof a.value=="string"&&t(c,a.value)}),e}reset(){let e=this.form;e?e.reset():this.querySelectorAll("[name]").forEach(t=>t.formResetCallback?.()),this.query=""}renderBody(){return l`${this.search?l`<cm-search class="search" part="search" .value=${this.query} label=${this.searchLabel}
2808
+ `];w("cm-side-panel",xt);var v$=C("filterPanel",{heading:"Search and Filter",searchLabel:"Search",searchPlaceholder:"Search anything",apply:"Search",reset:"Reset"}),ga,xd,fa=class extends xt{constructor(){super(...arguments);this.search=!1;this.query="";u(this,ga,()=>{this.dispatchEvent(new CustomEvent("cm-filter-apply",{detail:{values:this.values,query:this.query},bubbles:!0,composed:!0,cancelable:!0}))&&this.requestClose("action")});u(this,xd,()=>{this.reset(),this.dispatchEvent(new CustomEvent("cm-filter-reset",{bubbles:!0,composed:!0}))})}get form(){return this.querySelector("form")}get values(){let e={},t=(r,l)=>{if(l==="")return;let d=e[r];e[r]=d===void 0?l:Array.isArray(d)?[...d,l]:[d,l]},i=this.form;if(i){for(let[r,l]of new FormData(i))typeof l=="string"&&t(r,l);return e}return this.querySelectorAll("[name]").forEach(r=>{let l=r.getAttribute("name");"checked"in r&&(r.type==="checkbox"||r.type==="radio"||r.localName.match(/^cm-(checkbox|radio|toggle)$/))?r.checked&&t(l,r.value||"on"):typeof r.value=="string"&&t(l,r.value)}),e}reset(){let e=this.form;e?e.reset():this.querySelectorAll("[name]").forEach(t=>t.formResetCallback?.()),this.query=""}renderBody(){return c`${this.search?c`<cm-search class="search" part="search" .value=${this.query} label=${this.searchLabel}
2462
2809
  placeholder=${this.searchPlaceholder}
2463
2810
  @input=${e=>{this.query=e.target.value}}
2464
- @cm-search=${e=>{e.stopPropagation(),s(this,fr).call(this)}}></cm-search>`:d}
2465
- <slot @submit=${e=>{e.preventDefault(),s(this,fr).call(this)}}></slot>`}renderFooter(){return l`<cm-button part="reset" @click=${s(this,Ol)}>${this.resetLabel}</cm-button>
2466
- <cm-button part="apply" variant="primary" @click=${s(this,fr)}>${this.applyLabel}</cm-button>`}get showFooter(){return!0}};fr=new WeakMap,Ol=new WeakMap,mr.properties={...Ge.properties,search:{type:Boolean},query:{},heading:{string:"heading"},searchLabel:{attribute:"search-label",string:"searchLabel"},searchPlaceholder:{attribute:"search-placeholder",string:"searchPlaceholder"},applyLabel:{attribute:"apply-label",string:"apply"},resetLabel:{attribute:"reset-label",string:"reset"}},mr.styles=[...Ge.styles,b`
2811
+ @cm-search=${e=>{e.stopPropagation(),s(this,ga).call(this)}}></cm-search>`:h}
2812
+ <slot @submit=${e=>{e.preventDefault(),s(this,ga).call(this)}}></slot>`}renderFooter(){return c`<cm-button part="reset" @click=${s(this,xd)}>${this.resetLabel}</cm-button>
2813
+ <cm-button part="apply" variant="primary" @click=${s(this,ga)}>${this.applyLabel}</cm-button>`}get showFooter(){return!0}};ga=new WeakMap,xd=new WeakMap,fa.properties={...xt.properties,search:{type:Boolean},query:{},heading:{string:"heading"},searchLabel:{attribute:"search-label",string:"searchLabel"},searchPlaceholder:{attribute:"search-placeholder",string:"searchPlaceholder"},applyLabel:{attribute:"apply-label",string:"apply"},resetLabel:{attribute:"reset-label",string:"reset"}},fa.styles=[...xt.styles,x`
2467
2814
  .search { display: block; margin-bottom: var(--cm-space-20); }
2468
2815
  .foot { justify-content: center; }
2469
2816
  ::slotted(form) { display: grid; gap: var(--cm-space-15); }
2470
- `];g("cm-filter-panel",mr);var $n,ki,zd,iu,br=class extends X{constructor(){super(...arguments);p(this,ki);this.heading="";this.items=[];this._slotted=[];p(this,$n)}get sheetItems(){return this.items.length?this.items:this._slotted}connectedCallback(){super.connectedCallback(),this._slotted=Fa(this),f(this,$n,cl(this,()=>{this._slotted=Fa(this)}))}disconnectedCallback(){super.disconnectedCallback(),s(this,$n)?.disconnect()}render(){let e=this.sheetItems.filter(i=>!i.divider),t=e.some(i=>i.icon);return this.renderDialog(l`<div class="panel" part="panel" tabindex="-1">
2817
+ `];w("cm-filter-panel",fa);var Uo,cs,Ip,Wf,ba=class extends oe{constructor(){super(...arguments);u(this,cs);this.heading="";this.items=[];this._slotted=[];u(this,Uo)}get sheetItems(){return this.items.length?this.items:this._slotted}connectedCallback(){super.connectedCallback(),this._slotted=Yn(this),g(this,Uo,Ic(this,()=>{this._slotted=Yn(this)}))}disconnectedCallback(){super.disconnectedCallback(),s(this,Uo)?.disconnect()}render(){let e=this.sheetItems.filter(i=>!i.divider),t=e.some(i=>i.icon);return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
2471
2818
  <button type="button" class="x" part="close" aria-label=${this.closeLabel||this.t("close")} @click=${()=>this.requestClose("close-button")}>
2472
2819
  <cm-icon name="close" size="16"></cm-icon></button>
2473
- ${this.heading?l`<h2 class="vh" id="${this.uid}-h">${this.heading}</h2>`:d}
2820
+ ${this.heading?c`<h2 class="vh" id="${this.uid}-h">${this.heading}</h2>`:h}
2474
2821
  <div class="content">
2475
- ${e.length?l`<ul class=${t?"icons":""} part="list">${e.map(i=>l`<li>${o(this,ki,iu).call(this,i)}</li>`)}</ul>`:d}
2822
+ ${e.length?c`<ul class=${t?"icons":""} part="list">${e.map(i=>c`<li>${a(this,cs,Wf).call(this,i)}</li>`)}</ul>`:h}
2476
2823
  <slot ?hidden=${this._slotted.length>0}></slot>
2477
2824
  </div>
2478
- </div>`)}};$n=new WeakMap,ki=new WeakSet,zd=function(e,t){if(t.disabled){e.preventDefault();return}if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},iu=function(e){let t=`row${e.critical?" critical":""}`,i=l`${e.icon?l`<cm-icon class="lead" name=${e.icon} size="18"></cm-icon>`:d}<span class="label">${e.label}</span>${e.icon?l`<cm-icon name="chevron-right" size="16"></cm-icon>`:d}`;return e.href&&!e.disabled?l`<a class=${t} part="row" href=${e.href} @click=${a=>o(this,ki,zd).call(this,a,e)}>${i}</a>`:l`<button type="button" class=${t} part="row" aria-disabled=${e.disabled?"true":d}
2479
- @click=${a=>o(this,ki,zd).call(this,a,e)}>${i}</button>`},br.properties={...X.properties,items:{type:Array},_slotted:{state:!0}},br.styles=[...X.overlayStyles,b`
2825
+ </div>`)}};Uo=new WeakMap,cs=new WeakSet,Ip=function(e,t){if(t.disabled){e.preventDefault();return}if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},Wf=function(e){let t=`row${e.critical?" critical":""}`,i=c`${e.icon?c`<cm-icon class="lead" name=${e.icon} size="18"></cm-icon>`:h}<span class="label">${e.label}</span>${e.icon?c`<cm-icon name="chevron-right" size="16"></cm-icon>`:h}`;return e.href&&!e.disabled?c`<a class=${t} part="row" href=${e.href} @click=${r=>a(this,cs,Ip).call(this,r,e)}>${i}</a>`:c`<button type="button" class=${t} part="row" aria-disabled=${e.disabled?"true":h}
2826
+ @click=${r=>a(this,cs,Ip).call(this,r,e)}>${i}</button>`},ba.properties={...oe.properties,items:{type:Array},_slotted:{state:!0}},ba.styles=[...oe.overlayStyles,x`
2480
2827
  dialog {
2481
2828
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(600px, 100vw); padding-top: 22px;
2482
2829
  }
@@ -2510,17 +2857,17 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2510
2857
  }
2511
2858
  @keyframes cm-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
2512
2859
  .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
2513
- `];g("cm-bottom-sheet",br);var y0=M("notificationPanel",{heading:"Notifications",more:"See more notifications",empty:"No notifications yet.",unread:"Unread: ",markAllRead:"Mark all read"}),im={information:"bag",attention:"alert",success:"check-circle",critical:"x-circle"},gr=class extends _{constructor(){super(...arguments);this.time="";this.tone="information";this.href="";this.unread=!1;this.value="";this.description="";this.icon=""}render(){return null}};gr.properties={time:{reflect:!0},tone:{reflect:!0},href:{reflect:!0},unread:{type:Boolean,reflect:!0},value:{reflect:!0},description:{reflect:!0},icon:{reflect:!0}},gr.styles=b`:host { display: none; }`;g("cm-notification-item",gr);var xr,we,Ld,Sd,su,ru,au,vr=class extends X{constructor(){super(...arguments);p(this,we);this.items=[];this.moreHref="";this.markAllRead=!1;this.loading=!1;this._slotted=[];this._footer=!1;p(this,xr)}connectedCallback(){super.connectedCallback(),o(this,we,Ld).call(this),f(this,xr,new MutationObserver(()=>o(this,we,Ld).call(this))),s(this,xr).observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,xr)?.disconnect()}get notifications(){return this.items.length?this.items:this._slotted}render(){let e=this.notifications,t=this.markAllRead&&!this.loading&&e.some(a=>a.unread)?l`<button type="button" class="mark" part="mark-all-read" @click=${o(this,we,ru)}>${this.markAllLabel}</button>`:d,i=this.loading?l`<ul class="loading" part="list" aria-hidden="true">${[0,1,2].map(()=>l`<li>
2514
- <cm-skeleton class="sk-ic" variant="block" style="--cm-skeleton-height:22px"></cm-skeleton><cm-skeleton class="sk-text"></cm-skeleton></li>`)}</ul>`:e.length?l`<ul class="list" part="list">${e.map(a=>l`<li>${o(this,we,su).call(this,a)}</li>`)}</ul>`:l`<p class="empty">${this.emptyText}</p>`;return this.renderDialog(l`<div class="panel" part="panel" tabindex="-1">
2860
+ `];w("cm-bottom-sheet",ba);var z$=C("notificationPanel",{heading:"Notifications",more:"See more notifications",empty:"No notifications yet.",unread:"Unread: ",markAllRead:"Mark all read"}),Qg={information:"bag",attention:"alert",success:"check-circle",critical:"x-circle"},va=class extends L{constructor(){super(...arguments);this.time="";this.tone="information";this.href="";this.unread=!1;this.value="";this.description="";this.icon=""}render(){return null}};va.properties={time:{reflect:!0},tone:{reflect:!0},href:{reflect:!0},unread:{type:Boolean,reflect:!0},value:{reflect:!0},description:{reflect:!0},icon:{reflect:!0}},va.styles=x`:host { display: none; }`;w("cm-notification-item",va);var ya,Ae,Pp,Op,Yf,Gf,Xf,xa=class extends oe{constructor(){super(...arguments);u(this,Ae);this.items=[];this.moreHref="";this.markAllRead=!1;this.loading=!1;this._slotted=[];this._footer=!1;u(this,ya)}connectedCallback(){super.connectedCallback(),a(this,Ae,Pp).call(this),g(this,ya,new MutationObserver(()=>a(this,Ae,Pp).call(this))),s(this,ya).observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,ya)?.disconnect()}get notifications(){return this.items.length?this.items:this._slotted}render(){let e=this.notifications,t=this.markAllRead&&!this.loading&&e.some(r=>r.unread)?c`<button type="button" class="mark" part="mark-all-read" @click=${a(this,Ae,Gf)}>${this.markAllLabel}</button>`:h,i=this.loading?c`<ul class="loading" part="list" aria-hidden="true">${[0,1,2].map(()=>c`<li>
2861
+ <cm-skeleton class="sk-ic" variant="block" style="--cm-skeleton-height:22px"></cm-skeleton><cm-skeleton class="sk-text"></cm-skeleton></li>`)}</ul>`:e.length?c`<ul class="list" part="list">${e.map(r=>c`<li>${a(this,Ae,Yf).call(this,r)}</li>`)}</ul>`:c`<p class="empty">${this.emptyText}</p>`;return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
2515
2862
  ${this.renderHeader(t)}
2516
2863
  ${i}
2517
2864
  <span class="vh" role="status">${this.loading?this.t("loading"):""}</span>
2518
- ${this.moreHref?l`<a class="more" part="more" href=${this.moreHref}>${this.moreLabel}</a>`:d}
2519
- <div class="footer" part="footer" ?hidden=${!this._footer}><slot name="footer" @slotchange=${o(this,we,au)}></slot></div>
2865
+ ${this.moreHref?c`<a class="more" part="more" href=${this.moreHref}>${this.moreLabel}</a>`:h}
2866
+ <div class="footer" part="footer" ?hidden=${!this._footer}><slot name="footer" @slotchange=${a(this,Ae,Xf)}></slot></div>
2520
2867
  <slot hidden></slot>
2521
- </div>`)}};xr=new WeakMap,we=new WeakSet,Ld=function(){this._slotted=Array.from(this.querySelectorAll(":scope > cm-notification-item")).map(e=>{let t=i=>e.getAttribute(i)||void 0;return{label:(e.textContent??"").trim(),time:t("time"),tone:t("tone")??"information",href:t("href"),unread:e.hasAttribute("unread")||void 0,value:t("value"),description:t("description"),icon:t("icon")}})},Sd=function(e,t){if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.href??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},su=function(e){let t=e.tone??"information",i=e.description?l`<span class="title">${e.label}</span><span class="vh">, </span><span class="desc">${e.description}</span>`:e.label,a=l`<span class="ic ${t}" aria-hidden="true"><cm-icon name=${e.icon||im[t]||"bell"} size="14"></cm-icon></span>
2522
- <span class="label">${e.unread?l`<span class="vh">${this.t("unread")}</span>`:d}${i}</span>
2523
- ${e.time?l`<time>${e.time}</time>`:d}`,c=`row${e.unread?" unread":""}`;return e.href?l`<a class=${c} part="row" href=${e.href} @click=${h=>o(this,we,Sd).call(this,h,e)}>${a}</a>`:l`<button type="button" class=${c} part="row" @click=${h=>o(this,we,Sd).call(this,h,e)}>${a}</button>`},ru=async function(e){let t=e.currentTarget;this.dispatchEvent(new CustomEvent("cm-mark-all-read",{bubbles:!0,composed:!0})),await new Promise(i=>setTimeout(i)),await this.updateComplete,!t.isConnected&&this.open&&this.renderRoot.querySelector(".panel")?.focus()},au=function(e){this._footer=e.target.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.ELEMENT_NODE||(t.textContent??"").trim())},vr.properties={...X.properties,items:{type:Array},moreHref:{attribute:"more-href"},heading:{string:"heading"},moreLabel:{attribute:"more-label",string:"more"},emptyText:{attribute:"empty-text",string:"empty"},markAllRead:{type:Boolean,attribute:"mark-all-read"},markAllLabel:{attribute:"mark-all-label",string:"markAllRead"},loading:{type:Boolean,reflect:!0},_slotted:{state:!0},_footer:{state:!0}},vr.styles=[...X.overlayStyles,b`
2868
+ </div>`)}};ya=new WeakMap,Ae=new WeakSet,Pp=function(){this._slotted=Array.from(this.querySelectorAll(":scope > cm-notification-item")).map(e=>{let t=i=>e.getAttribute(i)||void 0;return{label:(e.textContent??"").trim(),time:t("time"),tone:t("tone")??"information",href:t("href"),unread:e.hasAttribute("unread")||void 0,value:t("value"),description:t("description"),icon:t("icon")}})},Op=function(e,t){if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.href??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},Yf=function(e){let t=e.tone??"information",i=e.description?c`<span class="title">${e.label}</span><span class="vh">, </span><span class="desc">${e.description}</span>`:e.label,r=c`<span class="ic ${t}" aria-hidden="true"><cm-icon name=${e.icon||Qg[t]||"bell"} size="14"></cm-icon></span>
2869
+ <span class="label">${e.unread?c`<span class="vh">${this.t("unread")}</span>`:h}${i}</span>
2870
+ ${e.time?c`<time>${e.time}</time>`:h}`,l=`row${e.unread?" unread":""}`;return e.href?c`<a class=${l} part="row" href=${e.href} @click=${d=>a(this,Ae,Op).call(this,d,e)}>${r}</a>`:c`<button type="button" class=${l} part="row" @click=${d=>a(this,Ae,Op).call(this,d,e)}>${r}</button>`},Gf=async function(e){let t=e.currentTarget;this.dispatchEvent(new CustomEvent("cm-mark-all-read",{bubbles:!0,composed:!0})),await new Promise(i=>setTimeout(i)),await this.updateComplete,!t.isConnected&&this.open&&this.renderRoot.querySelector(".panel")?.focus()},Xf=function(e){this._footer=e.target.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.ELEMENT_NODE||(t.textContent??"").trim())},xa.properties={...oe.properties,items:{type:Array},moreHref:{attribute:"more-href"},heading:{string:"heading"},moreLabel:{attribute:"more-label",string:"more"},emptyText:{attribute:"empty-text",string:"empty"},markAllRead:{type:Boolean,attribute:"mark-all-read"},markAllLabel:{attribute:"mark-all-label",string:"markAllRead"},loading:{type:Boolean,reflect:!0},_slotted:{state:!0},_footer:{state:!0}},xa.styles=[...oe.overlayStyles,x`
2524
2871
  dialog {
2525
2872
  position: fixed; inset-block: var(--cm-notification-panel-top, 64px) auto; inset-inline: auto var(--cm-notification-panel-end, 20px);
2526
2873
  width: min(380px, calc(100vw - 32px));
@@ -2569,14 +2916,14 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2569
2916
  @media (max-width: 599px) {
2570
2917
  dialog { inset: var(--cm-notification-panel-top, 56px) 8px auto 8px; width: auto; }
2571
2918
  }
2572
- `];g("cm-notification-panel",vr);var _0=M("toastRegion",{label:"Notifications"}),sm=2e3,nu=1e4,ou=150,kn,Pe,pt,En,kr,Er,fe,lu,yr,Ad,Mn,Tn,_n,Cn,cu,wr=class extends k{constructor(){super(...arguments);p(this,fe);this.message="";this.tone="default";this.actionLabel="";this.open=!0;this._inRegion=!1;this._primed=!1;p(this,kn);p(this,Pe);p(this,pt,0);p(this,En,0);p(this,kr,!1);p(this,Er,!1);p(this,Mn,()=>{f(this,kr,!0),o(this,fe,Ad).call(this)});p(this,Tn,()=>{f(this,kr,!1),o(this,fe,yr).call(this)});p(this,_n,()=>{f(this,Er,!0),o(this,fe,Ad).call(this)});p(this,Cn,e=>{e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||e.relatedTarget instanceof Node&&this.shadowRoot?.contains(e.relatedTarget)||(f(this,Er,!1),o(this,fe,yr).call(this))})}get effectiveDuration(){let e=this.duration??(this.actionLabel?nu:5e3);return Math.min(nu,Math.max(sm,Number(e)||5e3))}connectedCallback(){super.connectedCallback(),this._inRegion=!!this.parentElement?.closest("cm-toast-region"),!this._inRegion&&!this._primed&&f(this,kn,setTimeout(()=>{this._primed=!0},ou)),this.addEventListener("pointerenter",s(this,Mn)),this.addEventListener("pointerleave",s(this,Tn)),this.addEventListener("focusin",s(this,_n)),this.addEventListener("focusout",s(this,Cn))}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(s(this,Pe)),clearTimeout(s(this,kn)),this.removeEventListener("pointerenter",s(this,Mn)),this.removeEventListener("pointerleave",s(this,Tn)),this.removeEventListener("focusin",s(this,_n)),this.removeEventListener("focusout",s(this,Cn))}updated(e){(e.has("open")||e.has("duration")||e.has("actionLabel")||e.has("_primed")||e.has("_inRegion"))&&(clearTimeout(s(this,Pe)),this.open&&(this._inRegion||this._primed)&&(f(this,pt,this.effectiveDuration),o(this,fe,yr).call(this)))}show(){this.open?(f(this,pt,this.effectiveDuration),o(this,fe,yr).call(this)):this.open=!0}dismiss(e="close"){let t=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e}});return this.dispatchEvent(t)?(clearTimeout(s(this,Pe)),this.open=!1,!0):(e==="timeout"&&(f(this,pt,this.effectiveDuration),o(this,fe,yr).call(this)),!1)}render(){let e=l`<div class="toast" part="toast">
2573
- ${this.tone==="critical"?l`<cm-icon class="icon" name="alert" size="20"></cm-icon>`:d}
2919
+ `];w("cm-notification-panel",xa);var P$=C("toastRegion",{label:"Notifications"}),eb=2e3,Jf=1e4,Zf=150,Ko,dt,Ft,Wo,Ea,Ma,_e,Qf,wa,qp,Yo,Go,Xo,Jo,eg,$a=class extends T{constructor(){super(...arguments);u(this,_e);this.message="";this.tone="default";this.actionLabel="";this.open=!0;this._inRegion=!1;this._primed=!1;u(this,Ko);u(this,dt);u(this,Ft,0);u(this,Wo,0);u(this,Ea,!1);u(this,Ma,!1);u(this,Yo,()=>{g(this,Ea,!0),a(this,_e,qp).call(this)});u(this,Go,()=>{g(this,Ea,!1),a(this,_e,wa).call(this)});u(this,Xo,()=>{g(this,Ma,!0),a(this,_e,qp).call(this)});u(this,Jo,e=>{e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||e.relatedTarget instanceof Node&&this.shadowRoot?.contains(e.relatedTarget)||(g(this,Ma,!1),a(this,_e,wa).call(this))})}get effectiveDuration(){let e=this.duration??(this.actionLabel?Jf:5e3);return Math.min(Jf,Math.max(eb,Number(e)||5e3))}connectedCallback(){super.connectedCallback(),this._inRegion=!!this.parentElement?.closest("cm-toast-region"),!this._inRegion&&!this._primed&&g(this,Ko,setTimeout(()=>{this._primed=!0},Zf)),this.addEventListener("pointerenter",s(this,Yo)),this.addEventListener("pointerleave",s(this,Go)),this.addEventListener("focusin",s(this,Xo)),this.addEventListener("focusout",s(this,Jo))}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(s(this,dt)),clearTimeout(s(this,Ko)),this.removeEventListener("pointerenter",s(this,Yo)),this.removeEventListener("pointerleave",s(this,Go)),this.removeEventListener("focusin",s(this,Xo)),this.removeEventListener("focusout",s(this,Jo))}updated(e){(e.has("open")||e.has("duration")||e.has("actionLabel")||e.has("_primed")||e.has("_inRegion"))&&(clearTimeout(s(this,dt)),this.open&&(this._inRegion||this._primed)&&(g(this,Ft,this.effectiveDuration),a(this,_e,wa).call(this)))}show(){this.open?(g(this,Ft,this.effectiveDuration),a(this,_e,wa).call(this)):this.open=!0}dismiss(e="close"){let t=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e}});return this.dispatchEvent(t)?(clearTimeout(s(this,dt)),this.open=!1,!0):(e==="timeout"&&(g(this,Ft,this.effectiveDuration),a(this,_e,wa).call(this)),!1)}render(){let e=c`<div class="toast" part="toast">
2920
+ ${this.tone==="critical"?c`<cm-icon class="icon" name="alert" size="20"></cm-icon>`:h}
2574
2921
  <div class="message" part="message">${this.message}<slot></slot></div>
2575
- ${this.actionLabel?l`<button class="action" part="action" @click=${o(this,fe,cu)}>${this.actionLabel}</button>`:d}
2922
+ ${this.actionLabel?c`<button class="action" part="action" @click=${a(this,_e,eg)}>${this.actionLabel}</button>`:h}
2576
2923
  <button class="close" part="close" aria-label=${this.t("dismiss")} @click=${()=>this.dismiss("close")}>
2577
2924
  <svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="m4 4 8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>
2578
2925
  </button>
2579
- </div>`;return this._inRegion?e:l`<div role="status" aria-live="polite" aria-atomic="false">${this.open&&this._primed?e:d}</div>`}};kn=new WeakMap,Pe=new WeakMap,pt=new WeakMap,En=new WeakMap,kr=new WeakMap,Er=new WeakMap,fe=new WeakSet,lu=function(){return s(this,kr)||s(this,Er)},yr=function(){clearTimeout(s(this,Pe)),!(!this.open||s(this,fe,lu))&&(f(this,En,Date.now()),f(this,Pe,setTimeout(()=>this.dismiss("timeout"),s(this,pt))))},Ad=function(){s(this,Pe)!==void 0&&(clearTimeout(s(this,Pe)),f(this,Pe,void 0),f(this,pt,Math.max(1e3,s(this,pt)-(Date.now()-s(this,En)))))},Mn=new WeakMap,Tn=new WeakMap,_n=new WeakMap,Cn=new WeakMap,cu=function(){let e=new CustomEvent("cm-action",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&this.dismiss("action")},wr.properties={message:{},tone:{reflect:!0},duration:{type:Number},actionLabel:{attribute:"action-label"},open:{type:Boolean,reflect:!0},_inRegion:{state:!0},_primed:{state:!0}},wr.styles=[w,b`
2926
+ </div>`;return this._inRegion?e:c`<div role="status" aria-live="polite" aria-atomic="false">${this.open&&this._primed?e:h}</div>`}};Ko=new WeakMap,dt=new WeakMap,Ft=new WeakMap,Wo=new WeakMap,Ea=new WeakMap,Ma=new WeakMap,_e=new WeakSet,Qf=function(){return s(this,Ea)||s(this,Ma)},wa=function(){clearTimeout(s(this,dt)),!(!this.open||s(this,_e,Qf))&&(g(this,Wo,Date.now()),g(this,dt,setTimeout(()=>this.dismiss("timeout"),s(this,Ft))))},qp=function(){s(this,dt)!==void 0&&(clearTimeout(s(this,dt)),g(this,dt,void 0),g(this,Ft,Math.max(1e3,s(this,Ft)-(Date.now()-s(this,Wo)))))},Yo=new WeakMap,Go=new WeakMap,Xo=new WeakMap,Jo=new WeakMap,eg=function(){let e=new CustomEvent("cm-action",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&this.dismiss("action")},$a.properties={message:{},tone:{reflect:!0},duration:{type:Number},actionLabel:{attribute:"action-label"},open:{type:Boolean,reflect:!0},_inRegion:{state:!0},_primed:{state:!0}},$a.styles=[E,x`
2580
2927
  :host { display: block; pointer-events: auto; }
2581
2928
  :host(:not([open])) { display: none; }
2582
2929
  .toast {
@@ -2601,23 +2948,23 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2601
2948
  :host([tone='critical']) button:hover { background: var(--cm-bg-hover); }
2602
2949
  button:focus-visible { outline: 2px solid var(--cm-text-on-dark); outline-offset: 1px; }
2603
2950
  :host([tone='critical']) button:focus-visible { outline-color: var(--cm-border-strong); }
2604
- `];g("cm-toast",wr);var zn,Ln,$r=class extends k{constructor(){super(...arguments);this.max=3;p(this,zn,!1);p(this,Ln,e=>{let t=e.target;queueMicrotask(()=>{t.localName==="cm-toast"&&!t.open&&t.remove()})})}connectedCallback(){super.connectedCallback(),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","false"),this.hasAttribute("aria-label")||(this.setAttribute("aria-label",this.t("label")),f(this,zn,!0)),this.addEventListener("cm-dismiss",s(this,Ln))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-dismiss",s(this,Ln))}updated(){s(this,zn)&&this.setAttribute("aria-label",this.t("label"))}add(e){this.append(e);let t=[...this.querySelectorAll(":scope > cm-toast")];return t.slice(0,Math.max(0,t.length-Math.max(1,this.max))).forEach(i=>i.remove()),e}render(){return l`<slot></slot>`}};zn=new WeakMap,Ln=new WeakMap,$r.properties={max:{type:Number}},$r.styles=[w,b`
2951
+ `];w("cm-toast",$a);var Zo,Qo,ka=class extends T{constructor(){super(...arguments);this.max=3;u(this,Zo,!1);u(this,Qo,e=>{let t=e.target;queueMicrotask(()=>{t.localName==="cm-toast"&&!t.open&&t.remove()})})}connectedCallback(){super.connectedCallback(),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","false"),this.hasAttribute("aria-label")||(this.setAttribute("aria-label",this.t("label")),g(this,Zo,!0)),this.addEventListener("cm-dismiss",s(this,Qo))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-dismiss",s(this,Qo))}updated(){s(this,Zo)&&this.setAttribute("aria-label",this.t("label"))}add(e){this.append(e);let t=[...this.querySelectorAll(":scope > cm-toast")];return t.slice(0,Math.max(0,t.length-Math.max(1,this.max))).forEach(i=>i.remove()),e}render(){return c`<slot></slot>`}};Zo=new WeakMap,Qo=new WeakMap,ka.properties={max:{type:Number}},ka.styles=[E,x`
2605
2952
  :host {
2606
2953
  position: fixed; inset-block-end: var(--cm-space-20); inset-inline: 0; z-index: 1000;
2607
2954
  display: flex; flex-direction: column; align-items: center; gap: var(--cm-space-10);
2608
2955
  padding-inline: var(--cm-space-15); pointer-events: none;
2609
2956
  }
2610
- `];g("cm-toast-region",$r);function rm(n,r={}){let e=r.root??document.body,t=e.querySelector(":scope > cm-toast-region"),i=!t;t||(t=document.createElement("cm-toast-region"),e.append(t));let a=document.createElement("cm-toast");if(a.message=String(n),r.tone&&(a.tone=r.tone),r.duration!==void 0&&(a.duration=r.duration),r.action){a.actionLabel=r.action.label;let c=r.action.onAction;a.addEventListener("cm-action",()=>c())}if(i){let c=t;return setTimeout(()=>c.add(a),ou),a}return t.add(a)}var N0=M("progressBar",{inProgress:"In progress"}),ql,Mr=class extends k{constructor(){super(...arguments);this.value=null;this.label="";this.labelHidden=!1;this.showValue=!1;this.size="medium";p(this,ql,L("cm-progress"))}get clampedValue(){let e=this.value;return e==null||Number.isNaN(Number(e))?null:Math.min(100,Math.max(0,Number(e)))}render(){let e=this.clampedValue,t=`${s(this,ql)}-label`;return l`
2957
+ `];w("cm-toast-region",ka);function tb(o,n={}){let e=n.root??document.body,t=e.querySelector(":scope > cm-toast-region"),i=!t;t||(t=document.createElement("cm-toast-region"),e.append(t));let r=document.createElement("cm-toast");if(r.message=String(o),n.tone&&(r.tone=n.tone),n.duration!==void 0&&(r.duration=n.duration),n.action){r.actionLabel=n.action.label;let l=n.action.onAction;r.addEventListener("cm-action",()=>l())}if(i){let l=t;return setTimeout(()=>l.add(r),Zf),r}return t.add(r)}var U$=C("progressBar",{inProgress:"In progress"}),yd,Ta=class extends T{constructor(){super(...arguments);this.value=null;this.label="";this.labelHidden=!1;this.showValue=!1;this.size="medium";u(this,yd,D("cm-progress"))}get clampedValue(){let e=this.value;return e==null||Number.isNaN(Number(e))?null:Math.min(100,Math.max(0,Number(e)))}render(){let e=this.clampedValue,t=`${s(this,yd)}-label`;return c`
2611
2958
  <div class="head ${this.labelHidden?"vh":""}">
2612
2959
  <span id=${t} part="label">${this.label}</span>
2613
- ${this.showValue&&e!==null?l`<span class="value" aria-hidden="true">${this.formatNumber(Math.round(e)/100,{style:"percent"})}</span>`:d}
2960
+ ${this.showValue&&e!==null?c`<span class="value" aria-hidden="true">${this.formatNumber(Math.round(e)/100,{style:"percent"})}</span>`:h}
2614
2961
  </div>
2615
2962
  <div class="track ${e===null?"indeterminate":""}" part="track" role="progressbar"
2616
2963
  aria-labelledby=${t} aria-valuemin="0" aria-valuemax="100"
2617
- aria-valuenow=${e===null?d:Math.round(e)}
2964
+ aria-valuenow=${e===null?h:Math.round(e)}
2618
2965
  aria-valuetext=${e===null?this.t("inProgress"):this.formatNumber(Math.round(e)/100,{style:"percent"})}>
2619
2966
  <div class="fill" part="fill" style=${e===null?"":`inline-size:${e}%`}></div>
2620
- </div>`}};ql=new WeakMap,Mr.properties={value:{type:Number},label:{},labelHidden:{type:Boolean,attribute:"label-hidden"},showValue:{type:Boolean,attribute:"show-value"},size:{reflect:!0}},Mr.styles=[w,b`
2967
+ </div>`}};yd=new WeakMap,Ta.properties={value:{type:Number},label:{},labelHidden:{type:Boolean,attribute:"label-hidden"},showValue:{type:Boolean,attribute:"show-value"},size:{reflect:!0}},Ta.styles=[E,x`
2621
2968
  :host { display: block; }
2622
2969
  .head { display: flex; justify-content: space-between; gap: var(--cm-space-10); margin-block-end: 6px; font-size: 14px; line-height: 20px; }
2623
2970
  .value { color: var(--cm-text-tertiary); font-variant-numeric: tabular-nums; }
@@ -2634,7 +2981,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2634
2981
  .fill { transition: none; }
2635
2982
  .indeterminate .fill { animation-duration: 4s; }
2636
2983
  }
2637
- `];g("cm-progress-bar",Mr);var Tr=class extends _{constructor(){super(...arguments);this.tone="neutral"}render(){return l`<span part="badge"><slot></slot></span>`}};Tr.properties={tone:{reflect:!0}},Tr.styles=[w,b`
2984
+ `];w("cm-progress-bar",Ta);var Ca=class extends L{constructor(){super(...arguments);this.tone="neutral"}render(){return c`<span part="badge"><slot></slot></span>`}};Ca.properties={tone:{reflect:!0}},Ca.styles=[E,x`
2638
2985
  :host { display: inline-flex; vertical-align: middle; }
2639
2986
  span {
2640
2987
  display: inline-flex; align-items: center; height: 28px; padding: 0 var(--cm-space-10);
@@ -2646,11 +2993,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2646
2993
  :host([tone='success']) span { background: linear-gradient(var(--cm-bg-success-soft), var(--cm-bg-success-soft)), var(--cm-bg-surface); color: var(--cm-text-success); }
2647
2994
  :host([tone='critical']) span { background: linear-gradient(var(--cm-bg-critical), var(--cm-bg-critical)), var(--cm-bg-surface); color: var(--cm-text-critical); }
2648
2995
  :host([tone='attention']) span { background: linear-gradient(var(--cm-bg-attention), var(--cm-bg-attention)), var(--cm-bg-surface); color: var(--cm-text-attention); }
2649
- `];g("cm-badge",Tr);var Cr,zr,Lr,du,hu,_r=class extends _{constructor(){super(...arguments);p(this,Lr);this.heading="";this.description="";this.flush=!1;this.headingLevel=2;p(this,Cr,!1);p(this,zr,!1)}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2)),t=this.heading?l`<div role="heading" aria-level=${e} class="title" part="title"><span class="text">${this.heading}</span><span class="adornment" ?hidden=${!s(this,Cr)}><slot name="title-adornment" @slotchange=${o(this,Lr,du)}></slot></span></div>`:d;return l`<section part="card" aria-label=${this.heading||d}>
2650
- ${this.heading||this.description?l`<header><div class="main">${this.heading?l`<span class="strut" aria-hidden="true">${this.heading}</span>`:d}${t}${this.description?l`<p class="desc">${this.description}</p>`:d}</div>
2651
- <div class="actions"><slot name="actions"></slot></div></header>`:l`<div class="bare" ?hidden=${!s(this,zr)}><div class="actions"><slot name="actions" @slotchange=${o(this,Lr,hu)}></slot></div></div>`}
2996
+ `];w("cm-badge",Ca);var La,Sa,za,tg,ig,_a=class extends L{constructor(){super(...arguments);u(this,za);this.heading="";this.description="";this.flush=!1;this.headingLevel=2;u(this,La,!1);u(this,Sa,!1)}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2)),t=this.heading?c`<div role="heading" aria-level=${e} class="title" part="title"><span class="text">${this.heading}</span><span class="adornment" ?hidden=${!s(this,La)}><slot name="title-adornment" @slotchange=${a(this,za,tg)}></slot></span></div>`:h;return c`<section part="card" aria-label=${this.heading||h}>
2997
+ ${this.heading||this.description?c`<header><div class="main">${this.heading?c`<span class="strut" aria-hidden="true">${this.heading}</span>`:h}${t}${this.description?c`<p class="desc">${this.description}</p>`:h}</div>
2998
+ <div class="actions"><slot name="actions"></slot></div></header>`:c`<div class="bare" ?hidden=${!s(this,Sa)}><div class="actions"><slot name="actions" @slotchange=${a(this,za,ig)}></slot></div></div>`}
2652
2999
  <slot></slot>
2653
- </section>`}};Cr=new WeakMap,zr=new WeakMap,Lr=new WeakSet,du=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==s(this,Cr)&&(f(this,Cr,t),this.requestUpdate())},hu=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==s(this,zr)&&(f(this,zr,t),this.requestUpdate())},_r.properties={heading:{},description:{},flush:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},_r.styles=[w,b`
3000
+ </section>`}};La=new WeakMap,Sa=new WeakMap,za=new WeakSet,tg=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==s(this,La)&&(g(this,La,t),this.requestUpdate())},ig=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==s(this,Sa)&&(g(this,Sa,t),this.requestUpdate())},_a.properties={heading:{},description:{},flush:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},_a.styles=[E,x`
2654
3001
  :host { display: block; }
2655
3002
  section {
2656
3003
  background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-card);
@@ -2680,8 +3027,8 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2680
3027
  .bare { display: flex; justify-content: flex-end; margin-bottom: var(--cm-space-20); }
2681
3028
  .bare[hidden] { display: none; }
2682
3029
  :host([flush]) .bare { padding: var(--cm-space-20) var(--cm-space-20) 0; }
2683
- `];g("cm-card",_r);var am=["0","10","12","15","20","22","30"];function Sr(n,r){return Rn(am.map(e=>`:host([${n}='${e}']) { ${r}: ${e==="0"?"0px":`var(--cm-space-${e})`}; }`).join(`
2684
- `))}var Ar=class extends _{constructor(){super(...arguments);this.direction="block";this.gap="20";this.wrap=!1}render(){return l`<slot></slot>`}};Ar.properties={direction:{reflect:!0},gap:{reflect:!0},align:{reflect:!0},justify:{reflect:!0},wrap:{type:Boolean,reflect:!0}},Ar.styles=[w,b`
3030
+ `];w("cm-card",_a);var ib=["0","10","12","15","20","22","30"];function Da(o,n){return nl(ib.map(e=>`:host([${o}='${e}']) { ${n}: ${e==="0"?"0px":`var(--cm-space-${e})`}; }`).join(`
3031
+ `))}var Aa=class extends L{constructor(){super(...arguments);this.direction="block";this.gap="20";this.wrap=!1}render(){return c`<slot></slot>`}};Aa.properties={direction:{reflect:!0},gap:{reflect:!0},align:{reflect:!0},justify:{reflect:!0},wrap:{type:Boolean,reflect:!0}},Aa.styles=[E,x`
2685
3032
  :host { display: flex; flex-direction: column; gap: var(--cm-space-20); min-inline-size: 0; }
2686
3033
  :host([direction='inline']) { flex-direction: row; align-items: center; }
2687
3034
  :host([wrap]) { flex-wrap: wrap; }
@@ -2694,13 +3041,13 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2694
3041
  :host([justify='center']) { justify-content: center; }
2695
3042
  :host([justify='end']) { justify-content: flex-end; }
2696
3043
  :host([justify='space-between']) { justify-content: space-between; }
2697
- `,Sr("gap","gap")];g("cm-stack",Ar);var pu="important",nm=" !"+pu,uu=Li(class extends ut{constructor(n){if(super(n),n.type!==Re.ATTRIBUTE||n.name!=="style"||n.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((r,e)=>{let t=n[e];return t==null?r:r+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${t};`},"")}update(n,[r]){let{style:e}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);for(let t of this.ft)r[t]==null&&(this.ft.delete(t),t.includes("-")?e.removeProperty(t):e[t]=null);for(let t in r){let i=r[t];if(i!=null){this.ft.add(t);let a=typeof i=="string"&&i.endsWith(nm);t.includes("-")||a?e.setProperty(t,a?i.slice(0,-11):i,a?pu:""):e[t]=i}}return ae}});var Dr=class extends _{constructor(){super(...arguments);this.columns=2;this.gap="20"}render(){let e=Math.max(1,Math.floor(Number(this.columns)||1)),t=this.minColumnWidth?.trim(),i=t?`repeat(auto-fit, minmax(min(100%, ${t}), 1fr))`:`repeat(${e}, minmax(0, 1fr))`;return l`<div class="grid ${t?"fit":"fixed"}" part="grid" style=${uu({gridTemplateColumns:i})}><slot></slot></div>`}};Dr.properties={columns:{type:Number,reflect:!0},minColumnWidth:{attribute:"min-column-width",reflect:!0},gap:{reflect:!0}},Dr.styles=[w,b`
3044
+ `,Da("gap","gap")];w("cm-stack",Aa);var sg="important",sb=" !"+sg,rg=gs(class extends jt{constructor(o){if(super(o),o.type!==st.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((n,e)=>{let t=o[e];return t==null?n:n+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${t};`},"")}update(o,[n]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(let t of this.ft)n[t]==null&&(this.ft.delete(t),t.includes("-")?e.removeProperty(t):e[t]=null);for(let t in n){let i=n[t];if(i!=null){this.ft.add(t);let r=typeof i=="string"&&i.endsWith(sb);t.includes("-")||r?e.setProperty(t,r?i.slice(0,-11):i,r?sg:""):e[t]=i}}return ge}});var Na=class extends L{constructor(){super(...arguments);this.columns=2;this.gap="20"}render(){let e=Math.max(1,Math.floor(Number(this.columns)||1)),t=this.minColumnWidth?.trim(),i=t?`repeat(auto-fit, minmax(min(100%, ${t}), 1fr))`:`repeat(${e}, minmax(0, 1fr))`;return c`<div class="grid ${t?"fit":"fixed"}" part="grid" style=${rg({gridTemplateColumns:i})}><slot></slot></div>`}};Na.properties={columns:{type:Number,reflect:!0},minColumnWidth:{attribute:"min-column-width",reflect:!0},gap:{reflect:!0}},Na.styles=[E,x`
2698
3045
  :host { display: block; container: cm-grid / inline-size; --_gap: var(--cm-space-20); }
2699
3046
  .grid { display: grid; gap: var(--_gap); align-items: start; }
2700
3047
  @container cm-grid (max-width: 640px) {
2701
3048
  .grid.fixed { grid-template-columns: minmax(0, 1fr) !important; }
2702
3049
  }
2703
- `,Sr("gap","--_gap")];g("cm-grid",Dr);var Nr=class extends _{constructor(){super(...arguments);this.gap="20"}render(){return l`<div class="layout" part="layout"><slot></slot></div>`}};Nr.properties={gap:{reflect:!0}},Nr.styles=[w,b`
3050
+ `,Da("gap","--_gap")];w("cm-grid",Na);var Ra=class extends L{constructor(){super(...arguments);this.gap="20"}render(){return c`<div class="layout" part="layout"><slot></slot></div>`}};Ra.properties={gap:{reflect:!0}},Ra.styles=[E,x`
2704
3051
  :host { display: block; container: cm-layout / inline-size; --_gap: var(--cm-space-20); }
2705
3052
  .layout { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--_gap); align-items: start; }
2706
3053
  @container cm-layout (max-width: 767px) {
@@ -2714,9 +3061,9 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2714
3061
  ::slotted([variant='one-third']) { grid-column: span 2; }
2715
3062
  ::slotted([variant='two-thirds']) { grid-column: span 4; }
2716
3063
  }
2717
- `,Sr("gap","--_gap")];var Rr=class extends _{constructor(){super(...arguments);this.variant="full"}render(){return l`<slot></slot>`}};Rr.properties={variant:{reflect:!0}},Rr.styles=[w,b`
3064
+ `,Da("gap","--_gap")];var Ha=class extends L{constructor(){super(...arguments);this.variant="full"}render(){return c`<slot></slot>`}};Ha.properties={variant:{reflect:!0}},Ha.styles=[E,x`
2718
3065
  :host { display: flex; flex-direction: column; gap: var(--cm-space-20); min-inline-size: 0; }
2719
- `];g("cm-layout",Nr);g("cm-layout-section",Rr);var Dd=1024,om=()=>{let n=document.activeElement;for(;n?.shadowRoot?.activeElement;)n=n.shadowRoot.activeElement;return n},Mi,Ir,$e,Nd,Ei,mu,Sn,An,Hr=class extends _{constructor(){super(...arguments);p(this,$e);this.menuOpen=!1;this.menuItem="";this._wide=!1;p(this,Mi);p(this,Ir,null);p(this,Sn,e=>{if(!this.menuItem)return;let t=o(this,$e,mu).call(this,e),i=e.detail?.value;t==="bottom-navigation"&&i===this.menuItem?o(this,$e,Ei).call(this,!this.menuOpen):(t==="mobile-menu"||t==="bottom-navigation")&&o(this,$e,Ei).call(this,!1,!1)});p(this,An,e=>{e.key!=="Escape"||e.defaultPrevented||!this.menuItem||!this.menuOpen||this._wide||(e.preventDefault(),o(this,$e,Ei).call(this,!1))})}connectedCallback(){super.connectedCallback(),this.addEventListener("cm-navigate",s(this,Sn)),this.addEventListener("keydown",s(this,An));let e=this.getBoundingClientRect().width;e>0&&(this._wide=e>=Dd)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-navigate",s(this,Sn)),this.removeEventListener("keydown",s(this,An)),s(this,Mi)?.disconnect(),f(this,Mi,void 0)}get wide(){return this._wide}firstUpdated(){let e=0;f(this,Mi,new ResizeObserver(()=>{o(this,$e,Nd).call(this);let t=this.renderRoot.querySelector(".probe").getBoundingClientRect().width;t>0&&t>=Dd!==this._wide&&(cancelAnimationFrame(e),e=requestAnimationFrame(()=>{this._wide=t>=Dd}))})),this.renderRoot.querySelectorAll(".probe, .header, .bottom").forEach(t=>s(this,Mi).observe(t))}updated(e){e.has("_wide")&&o(this,$e,Nd).call(this)}openMenu(){o(this,$e,Ei).call(this,!0)}closeMenu(){o(this,$e,Ei).call(this,!1)}toggleMenu(){o(this,$e,Ei).call(this,!this.menuOpen)}render(){let e=this._wide,t=this.menuOpen&&!e&&!!this.querySelector(':scope > [slot="mobile-menu"]');return l`<div class="frame ${e?"wide":""}" part="frame">
3066
+ `];w("cm-layout",Ra);w("cm-layout-section",Ha);var Bp=1024,rb=()=>{let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o},hs,Pa,Ne,Fp,ds,ag,el,tl,Ia=class extends L{constructor(){super(...arguments);u(this,Ne);this.menuOpen=!1;this.menuItem="";this._wide=!1;u(this,hs);u(this,Pa,null);u(this,el,e=>{if(!this.menuItem)return;let t=a(this,Ne,ag).call(this,e),i=e.detail?.value;t==="bottom-navigation"&&i===this.menuItem?a(this,Ne,ds).call(this,!this.menuOpen):(t==="mobile-menu"||t==="bottom-navigation")&&a(this,Ne,ds).call(this,!1,!1)});u(this,tl,e=>{e.key!=="Escape"||e.defaultPrevented||!this.menuItem||!this.menuOpen||this._wide||(e.preventDefault(),a(this,Ne,ds).call(this,!1))})}connectedCallback(){super.connectedCallback(),this.addEventListener("cm-navigate",s(this,el)),this.addEventListener("keydown",s(this,tl));let e=this.getBoundingClientRect().width;e>0&&(this._wide=e>=Bp)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-navigate",s(this,el)),this.removeEventListener("keydown",s(this,tl)),s(this,hs)?.disconnect(),g(this,hs,void 0)}get wide(){return this._wide}firstUpdated(){let e=0;g(this,hs,new ResizeObserver(()=>{a(this,Ne,Fp).call(this);let t=this.renderRoot.querySelector(".probe").getBoundingClientRect().width;t>0&&t>=Bp!==this._wide&&(cancelAnimationFrame(e),e=requestAnimationFrame(()=>{this._wide=t>=Bp}))})),this.renderRoot.querySelectorAll(".probe, .header, .bottom").forEach(t=>s(this,hs).observe(t))}updated(e){e.has("_wide")&&a(this,Ne,Fp).call(this)}openMenu(){a(this,Ne,ds).call(this,!0)}closeMenu(){a(this,Ne,ds).call(this,!1)}toggleMenu(){a(this,Ne,ds).call(this,!this.menuOpen)}render(){let e=this._wide,t=this.menuOpen&&!e&&!!this.querySelector(':scope > [slot="mobile-menu"]');return c`<div class="frame ${e?"wide":""}" part="frame">
2720
3067
  <div class="probe"></div>
2721
3068
  <div class="header" part="header" ?inert=${t}><slot name="header"></slot></div>
2722
3069
  <div class="body">
@@ -2725,7 +3072,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2725
3072
  </div>
2726
3073
  <div class="menu" part="mobile-menu" ?hidden=${!t}><slot name="mobile-menu" @slotchange=${()=>this.requestUpdate()}></slot></div>
2727
3074
  <div class="bottom" part="bottom-navigation" ?hidden=${e}><slot name="bottom-navigation"></slot></div>
2728
- </div>`}};Mi=new WeakMap,Ir=new WeakMap,$e=new WeakSet,Nd=function(){let e=this.renderRoot.querySelector(".frame");if(!e)return;let t=i=>Math.round(this.renderRoot.querySelector(i)?.getBoundingClientRect().height??0);e.style.setProperty("--_header",`${t(".header")}px`),e.style.setProperty("--_bottom",`${this._wide?0:t(".bottom")}px`)},Ei=function(e,t=!0){e!==this.menuOpen&&(e&&f(this,Ir,om()),this.menuOpen=e,this.dispatchEvent(new CustomEvent("cm-menu-toggle",{bubbles:!0,composed:!0,detail:{open:e}})),this.updateComplete.then(()=>{if(e){let i=this.querySelector(':scope > [slot="mobile-menu"]');(i?.shadowRoot??i)?.querySelector("a[href], button")?.focus()}else t&&(s(this,Ir)?.focus(),f(this,Ir,null))}))},mu=function(e){return e.composedPath().find(i=>i.parentElement===this)?.getAttribute("slot")??""},Sn=new WeakMap,An=new WeakMap,Hr.properties={menuOpen:{type:Boolean,attribute:"menu-open",reflect:!0},menuItem:{attribute:"menu-item"},_wide:{state:!0}},Hr.styles=[w,b`
3075
+ </div>`}};hs=new WeakMap,Pa=new WeakMap,Ne=new WeakSet,Fp=function(){let e=this.renderRoot.querySelector(".frame");if(!e)return;let t=i=>Math.round(this.renderRoot.querySelector(i)?.getBoundingClientRect().height??0);e.style.setProperty("--_header",`${t(".header")}px`),e.style.setProperty("--_bottom",`${this._wide?0:t(".bottom")}px`)},ds=function(e,t=!0){e!==this.menuOpen&&(e&&g(this,Pa,rb()),this.menuOpen=e,this.dispatchEvent(new CustomEvent("cm-menu-toggle",{bubbles:!0,composed:!0,detail:{open:e}})),this.updateComplete.then(()=>{if(e){let i=this.querySelector(':scope > [slot="mobile-menu"]');(i?.shadowRoot??i)?.querySelector("a[href], button")?.focus()}else t&&(s(this,Pa)?.focus(),g(this,Pa,null))}))},ag=function(e){return e.composedPath().find(i=>i.parentElement===this)?.getAttribute("slot")??""},el=new WeakMap,tl=new WeakMap,Ia.properties={menuOpen:{type:Boolean,attribute:"menu-open",reflect:!0},menuItem:{attribute:"menu-item"},_wide:{state:!0}},Ia.styles=[E,x`
2729
3076
  :host { display: block; min-block-size: var(--cm-app-frame-height, 100dvh); background: var(--cm-bg-page); --_header: 0px; --_bottom: 0px; }
2730
3077
  .header { position: sticky; inset-block-start: 0; z-index: 30; padding-block-start: env(safe-area-inset-top, 0px); background: var(--cm-bg-surface); }
2731
3078
  .body { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
@@ -2736,7 +3083,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2736
3083
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
2737
3084
  padding: var(--cm-space-20); padding-inline-end: 0;
2738
3085
  }
2739
- main { display: block; min-inline-size: 0; padding-block-end: var(--_bottom); }
3086
+ main { display: block; min-inline-size: 0; padding-block-end: calc(var(--_bottom) + var(--cm-app-frame-bottom-offset, 0px)); }
2740
3087
  main:focus { outline: none; }
2741
3088
  .bottom { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 40; }
2742
3089
  ::slotted([slot='bottom-navigation']) { position: static; }
@@ -2746,7 +3093,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2746
3093
  }
2747
3094
  .probe { block-size: 0; }
2748
3095
  [hidden] { display: none !important; }
2749
- `];g("cm-app-frame",Hr);var Or=class extends _{constructor(){super(...arguments);this.fullWidth=!1;this.narrow=!1}render(){return l`<slot name="header"></slot><div class="content" part="content"><slot></slot></div><slot name="footer"></slot>`}};Or.properties={fullWidth:{type:Boolean,attribute:"full-width",reflect:!0},narrow:{type:Boolean,reflect:!0}},Or.styles=[w,b`
3096
+ `];w("cm-app-frame",Ia);var Oa=class extends L{constructor(){super(...arguments);this.fullWidth=!1;this.narrow=!1}render(){return c`<slot name="header"></slot><div class="content" part="content"><slot></slot></div><slot name="footer"></slot>`}};Oa.properties={fullWidth:{type:Boolean,attribute:"full-width",reflect:!0},narrow:{type:Boolean,reflect:!0}},Oa.styles=[E,x`
2750
3097
  :host { display: block; container: cm-page / inline-size; background: var(--cm-bg-page); min-block-size: 100%; }
2751
3098
  .content {
2752
3099
  box-sizing: content-box; max-inline-size: 1600px; margin-inline: auto;
@@ -2755,16 +3102,16 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2755
3102
  :host([narrow]) .content { max-inline-size: 800px; }
2756
3103
  :host([full-width]) .content { max-inline-size: none; }
2757
3104
  @container cm-page (max-width: 640px) { .content { padding: var(--cm-space-10); } }
2758
- `];g("cm-page",Or);var Pr,fu,bu,qr=class extends k{constructor(){super(...arguments);p(this,Pr);this.tone="attention";this.heading="";this.dismissible=!1;this.hasActions=!1}render(){let e=this.tone==="critical"?"alert":"status",t=this.tone==="success"?Yr`<path d="m5 10.5 3 3 7-7" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>`:Yr`<circle cx="10" cy="10" r="7.5" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M10 6v5M10 13.6v.2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>`;return l`<div class="banner" part="banner" role=${e}>
3105
+ `];w("cm-page",Oa);var Ba,ng,og,qa=class extends T{constructor(){super(...arguments);u(this,Ba);this.tone="attention";this.heading="";this.dismissible=!1;this.hasActions=!1}render(){let e=this.tone==="critical"?"alert":"status",t=this.tone==="success"?Ga`<path d="m5 10.5 3 3 7-7" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>`:Ga`<circle cx="10" cy="10" r="7.5" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M10 6v5M10 13.6v.2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>`;return c`<div class="banner" part="banner" role=${e}>
2759
3106
  <svg class="icon" width="20" height="20" viewBox="0 0 20 20" aria-hidden="true">${t}</svg>
2760
3107
  <div class="body">
2761
- ${this.heading?l`<p class="title">${this.heading}</p>`:d}
3108
+ ${this.heading?c`<p class="title">${this.heading}</p>`:h}
2762
3109
  <div><slot></slot></div>
2763
- <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${o(this,Pr,fu)}></slot></div>
3110
+ <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${a(this,Ba,ng)}></slot></div>
2764
3111
  </div>
2765
- ${this.dismissible?l`<button class="close" aria-label=${this.t("dismiss")} @click=${o(this,Pr,bu)}>
2766
- <svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="m4 4 8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg></button>`:d}
2767
- </div>`}};Pr=new WeakSet,fu=function(e){this.hasActions=e.target.assignedElements().length>0,this.requestUpdate()},bu=function(){let e=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&(this.hidden=!0)},qr.properties={tone:{reflect:!0},heading:{},dismissible:{type:Boolean}},qr.styles=[w,b`
3112
+ ${this.dismissible?c`<button class="close" aria-label=${this.t("dismiss")} @click=${a(this,Ba,og)}>
3113
+ <svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="m4 4 8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg></button>`:h}
3114
+ </div>`}};Ba=new WeakSet,ng=function(e){this.hasActions=e.target.assignedElements().length>0,this.requestUpdate()},og=function(){let e=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&(this.hidden=!0)},qa.properties={tone:{reflect:!0},heading:{},dismissible:{type:Boolean}},qa.styles=[E,x`
2768
3115
  :host { display: block; }
2769
3116
  .banner {
2770
3117
  display: flex; gap: var(--cm-space-15); align-items: flex-start;
@@ -2787,10 +3134,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2787
3134
  border-radius: var(--cm-radius-sm); color: inherit; cursor: pointer;
2788
3135
  }
2789
3136
  .close:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
2790
- `];g("cm-banner",qr);var C1=M("thumbnail",{noImage:"{alt} (no image)"}),Br=class extends k{constructor(){super(...arguments);this.src="";this.alt="";this.size="medium";this.loading="eager";this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){if(this.src&&!this._failed)return l`<span class="box" part="thumbnail"><img src=${this.src} alt=${this.alt} loading=${this.loading}
2791
- @error=${()=>{this._failed=!0}}></span>`;let e=this.size==="small"?18:this.size==="large"?32:24;return l`<span class="box" part="thumbnail" role=${this.alt?"img":d}
2792
- aria-label=${this.alt?this.t("noImage",{alt:this.alt}):d} aria-hidden=${this.alt?d:"true"}>
2793
- <cm-icon name="box" size=${e}></cm-icon></span>`}};Br.properties={src:{},alt:{},size:{reflect:!0},loading:{},_failed:{state:!0}},Br.styles=[w,b`
3137
+ `];w("cm-banner",qa);var Ok=C("thumbnail",{noImage:"{alt} (no image)"}),Fa=class extends T{constructor(){super(...arguments);this.src="";this.alt="";this.size="medium";this.loading="eager";this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){if(this.src&&!this._failed)return c`<span class="box" part="thumbnail"><img src=${this.src} alt=${this.alt} loading=${this.loading}
3138
+ @error=${()=>{this._failed=!0}}></span>`;let e=this.size==="small"?18:this.size==="large"?32:24;return c`<span class="box" part="thumbnail" role=${this.alt?"img":h}
3139
+ aria-label=${this.alt?this.t("noImage",{alt:this.alt}):h} aria-hidden=${this.alt?h:"true"}>
3140
+ <cm-icon name="box" size=${e}></cm-icon></span>`}};Fa.properties={src:{},alt:{},size:{reflect:!0},loading:{},_failed:{state:!0}},Fa.styles=[E,x`
2794
3141
  :host { --_size: var(--cm-thumbnail-size, 60px); display: inline-flex; vertical-align: middle; flex: none; }
2795
3142
  :host([size='small']) { --_size: var(--cm-thumbnail-size, 40px); }
2796
3143
  :host([size='large']) { --_size: var(--cm-thumbnail-size, 80px); }
@@ -2800,7 +3147,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2800
3147
  background: var(--cm-thumb-bg); color: var(--cm-icon-selected);
2801
3148
  }
2802
3149
  img { inline-size: 100%; block-size: 100%; object-fit: contain; display: block; }
2803
- `];g("cm-thumbnail",Br);export{Qa as Announcer,fs as CmAccordion,hs as CmActionBar,qs as CmActionMenu,pr as CmAppCard,Hr as CmAppFrame,sr as CmAvatar,Tr as CmBadge,qr as CmBanner,Gs as CmBoard,gi as CmBoardCard,vi as CmBoardColumn,lr as CmBottomNavigation,br as CmBottomSheet,Ut as CmButton,_r as CmCard,bt as CmCheckbox,At as CmColorField,kt as CmCombobox,xs as CmComment,ys as CmCommentBox,Rs as CmDataTable,_t as CmDatePicker,zt as CmDateRangePicker,bs as CmEmptyState,St as CmFileUpload,mr as CmFilterPanel,dr as CmFlashOfferBar,Zt as CmGlobalSearch,Dr as CmGrid,ar as CmHeaderBar,zi as CmIcon,ms as CmInfoItem,us as CmInfoPanel,Nr as CmLayout,Rr as CmLayoutSection,hr as CmLinkTabs,k as CmLocalizedElement,Is as CmMenuItem,Zs as CmMetric,cr as CmMobileMenu,ur as CmModal,Qs as CmNavItem,Us as CmNestedItem,Vs as CmNestedList,gr as CmNotificationItem,vr as CmNotificationPanel,ni as CmOptionGroup,Or as CmPage,ds as CmPageHeader,Ls as CmPagination,Mr as CmProgressBar,Yt as CmRadio,Wt as CmRadioGroup,yi as CmReportTile,Js as CmReportTiles,js as CmResourceItem,Fs as CmResourceList,ps as CmSaveBar,wt as CmSearch,yt as CmSelect,er as CmSideNavigation,Ge as CmSidePanel,gs as CmSkeleton,vs as CmSkeletonDisplay,Cs as CmSmartTip,zs as CmSmartTips,Fi as CmSpinner,Ar as CmStack,As as CmStatusTabs,Ds as CmTableHeader,ji as CmTag,ft as CmTextField,Br as CmThumbnail,hi as CmTimeline,Ts as CmTimelineItem,wr as CmToast,$r as CmToastRegion,vt as CmToggle,ws as CmTooltip,Za as MoveModel,Au as configure,M as defineStrings,nh as directionalIcons,Z as formatDate,sh as formatMessage,ec as formatNumber,Lu as getDefaultStrings,Wp as initials,Sp as listNavigation,Jr as localeFor,at as normalizeHex,Kn as pluralCategory,Du as resetStrings,Dh as resolvePreset,Su as setStrings,rm as showToast,rh as translate};
3150
+ `];w("cm-thumbnail",Fa);export{Qi as Announcer,or as CmAccordion,sr as CmActionBar,zr as CmActionMenu,ua as CmAppCard,Ia as CmAppFrame,ra as CmAvatar,Ca as CmBadge,qa as CmBanner,Or as CmBoard,es as CmBoardCard,ts as CmBoardColumn,ca as CmBottomNavigation,ba as CmBottomSheet,Ci as CmButton,Kr as CmCalendar,Ur as CmCalendarEvent,_a as CmCard,Kt as CmCheckbox,li as CmColorField,Qt as CmCombobox,hr as CmComment,pr as CmCommentBox,Cr as CmDataTable,si as CmDatePicker,ai as CmDateRangePicker,lr as CmEmptyState,oi as CmFileUpload,fa as CmFilterPanel,ha as CmFlashOfferBar,Ni as CmGlobalSearch,Na as CmGrid,na as CmHeaderBar,fs as CmIcon,nr as CmInfoItem,ar as CmInfoPanel,Ra as CmLayout,Ha as CmLayoutSection,pa as CmLinkTabs,T as CmLocalizedElement,Lr as CmMenuItem,Qr as CmMetric,da as CmMobileMenu,ma as CmModal,ea as CmNavItem,Ir as CmNestedItem,Hr as CmNestedList,va as CmNotificationItem,xa as CmNotificationPanel,Bi as CmOptionGroup,Oa as CmPage,ir as CmPageHeader,$r as CmPagination,Ta as CmProgressBar,Si as CmRadio,zi as CmRadioGroup,ns as CmReportTile,Zr as CmReportTiles,Nr as CmResourceItem,Rr as CmResourceList,rr as CmSaveBar,Jt as CmSearch,Xt as CmSelect,ta as CmSideNavigation,xt as CmSidePanel,ci as CmSignatureField,cr as CmSkeleton,dr as CmSkeletonDisplay,yr as CmSmartTip,wr as CmSmartTips,Ls as CmSpinner,Aa as CmStack,Er as CmStatusTabs,Mr as CmTableHeader,_s as CmTag,Ut as CmTextField,Fa as CmThumbnail,Ki as CmTimeline,vr as CmTimelineItem,$a as CmToast,ka as CmToastRegion,Yt as CmToggle,ur as CmTooltip,Zi as MoveModel,kg as configure,C as defineStrings,mu as directionalIcons,ee as formatDate,hu as formatMessage,Rd as formatNumber,wg as getDefaultStrings,qf as initials,Km as listNavigation,Za as localeFor,Nt as normalizeHex,bl as pluralCategory,Eg as resetStrings,qu as resolvePreset,$g as setStrings,tb as showToast,pu as translate};
2804
3151
  /*! Bundled license information:
2805
3152
 
2806
3153
  @lit/reactive-element/css-tag.js: