@improv-wifi/serial-sdk 0.0.0-stage → 3.0.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/LICENSE +201 -0
- package/README.md +114 -2
- package/dist/const.d.ts +56 -0
- package/dist/const.js +37 -0
- package/dist/provision.d.ts +2 -0
- package/dist/provision.js +26 -0
- package/dist/serial-launch-button.d.ts +7 -0
- package/dist/serial-launch-button.js +79 -0
- package/dist/serial-provision-dialog.d.ts +53 -0
- package/dist/serial-provision-dialog.js +691 -0
- package/dist/serial.d.ts +143 -0
- package/dist/serial.js +626 -0
- package/dist/util/fire-event.d.ts +5 -0
- package/dist/util/fire-event.js +12 -0
- package/dist/util/hex-formatter.d.ts +1 -0
- package/dist/util/hex-formatter.js +2 -0
- package/dist/util/to-hex.d.ts +1 -0
- package/dist/util/to-hex.js +9 -0
- package/dist/web/serial-launch-button.js +1 -0
- package/dist/web/serial-provision-dialog-DR-raZEr.js +803 -0
- package/package.json +41 -4
|
@@ -0,0 +1,803 @@
|
|
|
1
|
+
import{f as e}from"./serial-launch-button.js";function t(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s}"function"==typeof SuppressedError&&SuppressedError;const o=globalThis,i=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let s=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const o=void 0!==t&&1===t.length;o&&(e=n.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&n.set(t,e))}return e}toString(){return this.cssText}};const a=(e,...t)=>{const o=1===e.length?e[0]:t.reduce((t,o,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[i+1],e[0]);return new s(o,e,r)},l=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const o of e.cssRules)t+=o.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,r))(t)})(e):e,{is:d,defineProperty:c,getOwnPropertyDescriptor:h,getOwnPropertyNames:p,getOwnPropertySymbols:u,getPrototypeOf:v}=Object,m=globalThis,f=m.trustedTypes,g=f?f.emptyScript:"",b=m.reactiveElementPolyfillSupport,y=(e,t)=>e,x={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let o=e;switch(t){case Boolean:o=null!==e;break;case Number:o=null===e?null:Number(e);break;case Object:case Array:try{o=JSON.parse(e)}catch(e){o=null}}return o}},_=(e,t)=>!d(e,t),w={attribute:!0,type:String,converter:x,reflect:!1,useDefault:!1,hasChanged:_};Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;let C=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=w){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const o=Symbol(),i=this.getPropertyDescriptor(e,o,t);void 0!==i&&c(this.prototype,e,i)}}static getPropertyDescriptor(e,t,o){const{get:i,set:r}=h(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){const n=i?.call(this);r?.call(this,t),this.requestUpdate(e,n,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??w}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const e=v(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const e=this.properties,t=[...p(e),...u(e)];for(const o of t)this.createProperty(o,e[o])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,o]of t)this.elementProperties.set(e,o)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const o=this._$Eu(e,t);void 0!==o&&this._$Eh.set(o,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const o=new Set(e.flat(1/0).reverse());for(const e of o)t.unshift(l(e))}else void 0!==e&&t.push(l(e));return t}static _$Eu(e,t){const o=t.attribute;return!1===o?void 0:"string"==typeof o?o:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(i)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const i of t){const t=document.createElement("style"),r=o.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=i.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$ET(e,t){const o=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,o);if(void 0!==i&&!0===o.reflect){const r=(void 0!==o.converter?.toAttribute?o.converter:x).toAttribute(t,o.type);this._$Em=e,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,t){const o=this.constructor,i=o._$Eh.get(e);if(void 0!==i&&this._$Em!==i){const e=o.getPropertyOptions(i),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:x;this._$Em=i;const n=r.fromAttribute(t,e.type);this[i]=n??this._$Ej?.get(i)??n,this._$Em=null}}requestUpdate(e,t,o,i=!1,r){if(void 0!==e){const n=this.constructor;if(!1===i&&(r=this[e]),o??=n.getPropertyOptions(e),!((o.hasChanged??_)(r,t)||o.useDefault&&o.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(n._$Eu(e,o))))return;this.C(e,t,o)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:o,reflect:i,wrapped:r},n){o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,n??t??this[e]),!0!==r||void 0!==n)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,o]of e){const{wrapped:e}=o,i=this[t];!0!==e||this._$AL.has(t)||void 0===i||this.C(t,void 0,o,i)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[y("elementProperties")]=new Map,C[y("finalized")]=new Map,b?.({ReactiveElement:C}),(m.reactiveElementVersions??=[]).push("2.1.2");const $=globalThis,E=e=>e,S=$.trustedTypes,T=S?S.createPolicy("lit-html",{createHTML:e=>e}):void 0,A="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,I="?"+k,R=`<${I}>`,P=document,O=()=>P.createComment(""),z=e=>null===e||"object"!=typeof e&&"function"!=typeof e,q=Array.isArray,L="[ \t\n\f\r]",D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,N=/-->/g,F=/>/g,U=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,M=/"/g,V=/^(?:script|style|textarea|title)$/i,H=e=>(t,...o)=>({_$litType$:e,strings:t,values:o}),W=H(1),j=H(2),Z=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),G=new WeakMap,Y=P.createTreeWalker(P,129);function X(e,t){if(!q(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==T?T.createHTML(t):t}const J=(e,t)=>{const o=e.length-1,i=[];let r,n=2===t?"<svg>":3===t?"<math>":"",s=D;for(let t=0;t<o;t++){const o=e[t];let a,l,d=-1,c=0;for(;c<o.length&&(s.lastIndex=c,l=s.exec(o),null!==l);)c=s.lastIndex,s===D?"!--"===l[1]?s=N:void 0!==l[1]?s=F:void 0!==l[2]?(V.test(l[2])&&(r=RegExp("</"+l[2],"g")),s=U):void 0!==l[3]&&(s=U):s===U?">"===l[0]?(s=r??D,d=-1):void 0===l[1]?d=-2:(d=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?U:'"'===l[3]?M:B):s===M||s===B?s=U:s===N||s===F?s=D:(s=U,r=void 0);const h=s===U&&e[t+1].startsWith("/>")?" ":"";n+=s===D?o+R:d>=0?(i.push(a),o.slice(0,d)+A+o.slice(d)+k+h):o+k+(-2===d?t:h)}return[X(e,n+(e[o]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]};class Q{constructor({strings:e,_$litType$:t},o){let i;this.parts=[];let r=0,n=0;const s=e.length-1,a=this.parts,[l,d]=J(e,t);if(this.el=Q.createElement(l,o),Y.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=Y.nextNode())&&a.length<s;){if(1===i.nodeType){if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(A)){const t=d[n++],o=i.getAttribute(e).split(k),s=/([.?@])?(.*)/.exec(t);a.push({type:1,index:r,name:s[2],strings:o,ctor:"."===s[1]?re:"?"===s[1]?ne:"@"===s[1]?se:ie}),i.removeAttribute(e)}else e.startsWith(k)&&(a.push({type:6,index:r}),i.removeAttribute(e));if(V.test(i.tagName)){const e=i.textContent.split(k),t=e.length-1;if(t>0){i.textContent=S?S.emptyScript:"";for(let o=0;o<t;o++)i.append(e[o],O()),Y.nextNode(),a.push({type:2,index:++r});i.append(e[t],O())}}}else if(8===i.nodeType)if(i.data===I)a.push({type:2,index:r});else{let e=-1;for(;-1!==(e=i.data.indexOf(k,e+1));)a.push({type:7,index:r}),e+=k.length-1}r++}}static createElement(e,t){const o=P.createElement("template");return o.innerHTML=e,o}}function ee(e,t,o=e,i){if(t===Z)return t;let r=void 0!==i?o._$Co?.[i]:o._$Cl;const n=z(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),void 0===n?r=void 0:(r=new n(e),r._$AT(e,o,i)),void 0!==i?(o._$Co??=[])[i]=r:o._$Cl=r),void 0!==r&&(t=ee(e,r._$AS(e,t.values),r,i)),t}class te{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:o}=this._$AD,i=(e?.creationScope??P).importNode(t,!0);Y.currentNode=i;let r=Y.nextNode(),n=0,s=0,a=o[0];for(;void 0!==a;){if(n===a.index){let t;2===a.type?t=new oe(r,r.nextSibling,this,e):1===a.type?t=new a.ctor(r,a.name,a.strings,this,e):6===a.type&&(t=new ae(r,this,e)),this._$AV.push(t),a=o[++s]}n!==a?.index&&(r=Y.nextNode(),n++)}return Y.currentNode=P,i}p(e){let t=0;for(const o of this._$AV)void 0!==o&&(void 0!==o.strings?(o._$AI(e,o,t),t+=o.strings.length-2):o._$AI(e[t])),t++}}class oe{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,o,i){this.type=2,this._$AH=K,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=o,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=ee(this,e,t),z(e)?e===K||null==e||""===e?(this._$AH!==K&&this._$AR(),this._$AH=K):e!==this._$AH&&e!==Z&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>q(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==K&&z(this._$AH)?this._$AA.nextSibling.data=e:this.T(P.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:o}=e,i="number"==typeof o?this._$AC(e):(void 0===o.el&&(o.el=Q.createElement(X(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===i)this._$AH.p(t);else{const e=new te(i,this),o=e.u(this.options);e.p(t),this.T(o),this._$AH=e}}_$AC(e){let t=G.get(e.strings);return void 0===t&&G.set(e.strings,t=new Q(e)),t}k(e){q(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let o,i=0;for(const r of e)i===t.length?t.push(o=new oe(this.O(O()),this.O(O()),this,this.options)):o=t[i],o._$AI(r),i++;i<t.length&&(this._$AR(o&&o._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=E(e).nextSibling;E(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class ie{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,o,i,r){this.type=1,this._$AH=K,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,o.length>2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=K}_$AI(e,t=this,o,i){const r=this.strings;let n=!1;if(void 0===r)e=ee(this,e,t,0),n=!z(e)||e!==this._$AH&&e!==Z,n&&(this._$AH=e);else{const i=e;let s,a;for(e=r[0],s=0;s<r.length-1;s++)a=ee(this,i[o+s],t,s),a===Z&&(a=this._$AH[s]),n||=!z(a)||a!==this._$AH[s],a===K?e=K:e!==K&&(e+=(a??"")+r[s+1]),this._$AH[s]=a}n&&!i&&this.j(e)}j(e){e===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class re extends ie{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===K?void 0:e}}class ne extends ie{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==K)}}class se extends ie{constructor(e,t,o,i,r){super(e,t,o,i,r),this.type=5}_$AI(e,t=this){if((e=ee(this,e,t,0)??K)===Z)return;const o=this._$AH,i=e===K&&o!==K||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,r=e!==K&&(o===K||i);i&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ae{constructor(e,t,o){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(e){ee(this,e)}}const le=$.litHtmlPolyfillSupport;le?.(Q,oe),($.litHtmlVersions??=[]).push("3.3.2");const de=(e,t,o)=>{const i=o?.renderBefore??t;let r=i._$litPart$;if(void 0===r){const e=o?.renderBefore??null;i._$litPart$=r=new oe(t.insertBefore(O(),e),e,void 0,o??{})}return r._$AI(e),r},ce=globalThis;let he=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=de(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Z}};he._$litElement$=!0,he.finalized=!0,ce.litElementHydrateSupport?.({LitElement:he});const pe=ce.litElementPolyfillSupport;pe?.({LitElement:he}),(ce.litElementVersions??=[]).push("4.2.2");const ue=e=>(t,o)=>{void 0!==o?o.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},ve={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:_},me=(e=ve,t,o)=>{const{kind:i,metadata:r}=o;let n=globalThis.litPropertyMetadata.get(r);if(void 0===n&&globalThis.litPropertyMetadata.set(r,n=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),n.set(o.name,e),"accessor"===i){const{name:i}=o;return{set(o){const r=t.get.call(this);t.set.call(this,o),this.requestUpdate(i,r,e,!0,o)},init(t){return void 0!==t&&this.C(i,void 0,e,t),t}}}if("setter"===i){const{name:i}=o;return function(o){const r=this[i];t.call(this,o),this.requestUpdate(i,r,e,!0,o)}}throw Error("Unsupported decorator location: "+i)};function fe(e){return(t,o)=>"object"==typeof o?me(e,t,o):((e,t,o)=>{const i=t.hasOwnProperty(o);return t.constructor.createProperty(o,e),i?Object.getOwnPropertyDescriptor(t,o):void 0})(e,t,o)}function ge(e){return fe({...e,state:!0,attribute:!1})}const be=(e,t,o)=>(o.configurable=!0,o.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,o),o);function ye(e,t){return(t,o,i)=>be(t,o,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}let xe;function _e(e){return(t,o)=>{const{slot:i,selector:r}=e??{},n="slot"+(i?`[name=${i}]`:":not([name])");return be(t,o,{get(){const t=this.renderRoot?.querySelector(n),o=t?.assignedElements(e)??[];return void 0===r?o:o.filter(e=>e.matches(r))}})}}class we extends he{constructor(){super(...arguments),this.inset=!1,this.insetStart=!1,this.insetEnd=!1}}t([fe({type:Boolean,reflect:!0})],we.prototype,"inset",void 0),t([fe({type:Boolean,reflect:!0,attribute:"inset-start"})],we.prototype,"insetStart",void 0),t([fe({type:Boolean,reflect:!0,attribute:"inset-end"})],we.prototype,"insetEnd",void 0);const Ce=a`:host{box-sizing:border-box;color:var(--md-divider-color, var(--md-sys-color-outline-variant, #cac4d0));display:flex;height:var(--md-divider-thickness, 1px);width:100%}:host([inset]),:host([inset-start]){padding-inline-start:16px}:host([inset]),:host([inset-end]){padding-inline-end:16px}:host::before{background:currentColor;content:"";height:100%;width:100%}@media(forced-colors: active){:host::before{background:CanvasText}}
|
|
2
|
+
`;Ce.styleSheet;let $e=class extends we{};$e.styles=[Ce],$e=t([ue("md-divider")],$e);const Ee=1,Se=3,Te=4,Ae=e=>(...t)=>({_$litDirective$:e,values:t});let ke=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,o){this._$Ct=e,this._$AM=t,this._$Ci=o}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};const Ie=Ae(class extends ke{constructor(e){if(super(e),e.type!==Ee||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e)));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const o=e.element.classList;for(const e of this.st)e in t||(o.remove(e),this.st.delete(e));for(const e in t){const i=!!t[e];i===this.st.has(e)||this.nt?.has(e)||(i?(o.add(e),this.st.add(e)):(o.remove(e),this.st.delete(e)))}return Z}}),Re=["role","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"],Pe=Re.map(ze);function Oe(e){return Pe.includes(e)}function ze(e){return e.replace("aria","aria-").replace(/Elements?/g,"").toLowerCase()}const qe=Symbol("privateIgnoreAttributeChangesFor");function Le(e){var t;class o extends e{constructor(){super(...arguments),this[t]=new Set}attributeChangedCallback(e,t,o){if(!Oe(e))return void super.attributeChangedCallback(e,t,o);if(this[qe].has(e))return;this[qe].add(e),this.removeAttribute(e),this[qe].delete(e);const i=Ne(e);null===o?delete this.dataset[i]:this.dataset[i]=o,this.requestUpdate(Ne(e),t)}getAttribute(e){return Oe(e)?super.getAttribute(De(e)):super.getAttribute(e)}removeAttribute(e){super.removeAttribute(e),Oe(e)&&(super.removeAttribute(De(e)),this.requestUpdate())}}return t=qe,function(e){for(const t of Re){const o=ze(t),i=De(o),r=Ne(o);e.createProperty(t,{attribute:o,noAccessor:!0}),e.createProperty(Symbol(i),{attribute:i,noAccessor:!0}),Object.defineProperty(e.prototype,t,{configurable:!0,enumerable:!0,get(){return this.dataset[r]??null},set(e){const o=this.dataset[r]??null;e!==o&&(null===e?delete this.dataset[r]:this.dataset[r]=e,this.requestUpdate(t,o))}})}}(o),o}function De(e){return`data-${e}`}function Ne(e){return e.replace(/-\w/,e=>e[1].toUpperCase())}function Fe(e,t){!t.bubbles||e.shadowRoot&&!t.composed||t.stopPropagation();const o=Reflect.construct(t.constructor,[t.type,t]),i=e.dispatchEvent(o);return i||t.preventDefault(),i}const Ue="cubic-bezier(0.2, 0, 0, 1)",Be="cubic-bezier(.3,0,0,1)",Me="cubic-bezier(.3,0,.8,.15)";const Ve={dialog:[[[{transform:"translateY(-50px)"},{transform:"translateY(0)"}],{duration:500,easing:Be}]],scrim:[[[{opacity:0},{opacity:.32}],{duration:500,easing:"linear"}]],container:[[[{opacity:0},{opacity:1}],{duration:50,easing:"linear",pseudoElement:"::before"}],[[{height:"35%"},{height:"100%"}],{duration:500,easing:Be,pseudoElement:"::before"}]],headline:[[[{opacity:0},{opacity:0,offset:.2},{opacity:1}],{duration:250,easing:"linear",fill:"forwards"}]],content:[[[{opacity:0},{opacity:0,offset:.2},{opacity:1}],{duration:250,easing:"linear",fill:"forwards"}]],actions:[[[{opacity:0},{opacity:0,offset:.5},{opacity:1}],{duration:300,easing:"linear",fill:"forwards"}]]},He={dialog:[[[{transform:"translateY(0)"},{transform:"translateY(-50px)"}],{duration:150,easing:Me}]],scrim:[[[{opacity:.32},{opacity:0}],{duration:150,easing:"linear"}]],container:[[[{height:"100%"},{height:"35%"}],{duration:150,easing:Me,pseudoElement:"::before"}],[[{opacity:"1"},{opacity:"0"}],{delay:100,duration:50,easing:"linear",pseudoElement:"::before"}]],headline:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]],content:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]],actions:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]]},We=Le(he);class je extends We{get open(){return this.isOpen}set open(e){e!==this.isOpen&&(this.isOpen=e,e?(this.setAttribute("open",""),this.show()):(this.removeAttribute("open"),this.close()))}constructor(){super(),this.quick=!1,this.returnValue="",this.noFocusTrap=!1,this.getOpenAnimation=()=>Ve,this.getCloseAnimation=()=>He,this.isOpen=!1,this.isOpening=!1,this.isConnectedPromise=this.getIsConnectedPromise(),this.isAtScrollTop=!1,this.isAtScrollBottom=!1,this.nextClickIsFromContent=!1,this.hasHeadline=!1,this.hasActions=!1,this.hasIcon=!1,this.escapePressedWithoutCancel=!1,this.treewalker=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT),this.addEventListener("submit",this.handleSubmit)}async show(){this.isOpening=!0,await this.isConnectedPromise,await this.updateComplete;const e=this.dialog;if(e.open||!this.isOpening)return void(this.isOpening=!1);if(!this.dispatchEvent(new Event("open",{cancelable:!0})))return this.open=!1,void(this.isOpening=!1);e.showModal(),this.open=!0,this.scroller&&(this.scroller.scrollTop=0),this.querySelector("[autofocus]")?.focus(),await this.animateDialog(this.getOpenAnimation()),this.dispatchEvent(new Event("opened")),this.isOpening=!1}async close(e=this.returnValue){if(this.isOpening=!1,!this.isConnected)return void(this.open=!1);await this.updateComplete;const t=this.dialog;if(!t.open||this.isOpening)return void(this.open=!1);const o=this.returnValue;this.returnValue=e;this.dispatchEvent(new Event("close",{cancelable:!0}))?(await this.animateDialog(this.getCloseAnimation()),t.close(e),this.open=!1,this.dispatchEvent(new Event("closed"))):this.returnValue=o}connectedCallback(){super.connectedCallback(),this.isConnectedPromiseResolve()}disconnectedCallback(){super.disconnectedCallback(),this.isConnectedPromise=this.getIsConnectedPromise()}render(){const e=this.open&&!(this.isAtScrollTop&&this.isAtScrollBottom),t={"has-headline":this.hasHeadline,"has-actions":this.hasActions,"has-icon":this.hasIcon,scrollable:e,"show-top-divider":e&&!this.isAtScrollTop,"show-bottom-divider":e&&!this.isAtScrollBottom},o=this.open&&!this.noFocusTrap,i=W`
|
|
3
|
+
<div
|
|
4
|
+
class="focus-trap"
|
|
5
|
+
tabindex="0"
|
|
6
|
+
aria-hidden="true"
|
|
7
|
+
@focus=${this.handleFocusTrapFocus}></div>
|
|
8
|
+
`,{ariaLabel:r}=this;return W`
|
|
9
|
+
<div class="scrim"></div>
|
|
10
|
+
<dialog
|
|
11
|
+
class=${Ie(t)}
|
|
12
|
+
aria-label=${r||K}
|
|
13
|
+
aria-labelledby=${this.hasHeadline?"headline":K}
|
|
14
|
+
role=${"alert"===this.type?"alertdialog":K}
|
|
15
|
+
@cancel=${this.handleCancel}
|
|
16
|
+
@click=${this.handleDialogClick}
|
|
17
|
+
@close=${this.handleClose}
|
|
18
|
+
@keydown=${this.handleKeydown}
|
|
19
|
+
.returnValue=${this.returnValue||K}>
|
|
20
|
+
${o?i:K}
|
|
21
|
+
<div class="container" @click=${this.handleContentClick}>
|
|
22
|
+
<div class="headline">
|
|
23
|
+
<div class="icon" aria-hidden="true">
|
|
24
|
+
<slot name="icon" @slotchange=${this.handleIconChange}></slot>
|
|
25
|
+
</div>
|
|
26
|
+
<h2 id="headline" aria-hidden=${!this.hasHeadline||K}>
|
|
27
|
+
<slot
|
|
28
|
+
name="headline"
|
|
29
|
+
@slotchange=${this.handleHeadlineChange}></slot>
|
|
30
|
+
</h2>
|
|
31
|
+
<md-divider></md-divider>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="scroller">
|
|
34
|
+
<div class="content">
|
|
35
|
+
<div class="top anchor"></div>
|
|
36
|
+
<slot name="content"></slot>
|
|
37
|
+
<div class="bottom anchor"></div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="actions">
|
|
41
|
+
<md-divider></md-divider>
|
|
42
|
+
<slot name="actions" @slotchange=${this.handleActionsChange}></slot>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
${o?i:K}
|
|
46
|
+
</dialog>
|
|
47
|
+
`}firstUpdated(){this.intersectionObserver=new IntersectionObserver(e=>{for(const t of e)this.handleAnchorIntersection(t)},{root:this.scroller}),this.intersectionObserver.observe(this.topAnchor),this.intersectionObserver.observe(this.bottomAnchor)}handleDialogClick(){if(this.nextClickIsFromContent)return void(this.nextClickIsFromContent=!1);!this.dispatchEvent(new Event("cancel",{cancelable:!0}))||this.close()}handleContentClick(){this.nextClickIsFromContent=!0}handleSubmit(e){const t=e.target,{submitter:o}=e;"dialog"===t.getAttribute("method")&&o&&this.close(o.getAttribute("value")??this.returnValue)}handleCancel(e){if(e.target!==this.dialog)return;this.escapePressedWithoutCancel=!1;const t=!Fe(this,e);e.preventDefault(),t||this.close()}handleClose(){this.escapePressedWithoutCancel&&(this.escapePressedWithoutCancel=!1,this.dialog?.dispatchEvent(new Event("cancel",{cancelable:!0})))}handleKeydown(e){"Escape"===e.key&&(this.escapePressedWithoutCancel=!0,setTimeout(()=>{this.escapePressedWithoutCancel=!1}))}async animateDialog(e){if(this.cancelAnimations?.abort(),this.cancelAnimations=new AbortController,this.quick)return;const{dialog:t,scrim:o,container:i,headline:r,content:n,actions:s}=this;if(!(t&&o&&i&&r&&n&&s))return;const{container:a,dialog:l,scrim:d,headline:c,content:h,actions:p}=e,u=[[t,l??[]],[o,d??[]],[i,a??[]],[r,c??[]],[n,h??[]],[s,p??[]]],v=[];for(const[e,t]of u)for(const o of t){const t=e.animate(...o);this.cancelAnimations.signal.addEventListener("abort",()=>{t.cancel()}),v.push(t)}await Promise.all(v.map(e=>e.finished.catch(()=>{})))}handleHeadlineChange(e){const t=e.target;this.hasHeadline=t.assignedElements().length>0}handleActionsChange(e){const t=e.target;this.hasActions=t.assignedElements().length>0}handleIconChange(e){const t=e.target;this.hasIcon=t.assignedElements().length>0}handleAnchorIntersection(e){const{target:t,isIntersecting:o}=e;t===this.topAnchor&&(this.isAtScrollTop=o),t===this.bottomAnchor&&(this.isAtScrollBottom=o)}getIsConnectedPromise(){return new Promise(e=>{this.isConnectedPromiseResolve=e})}handleFocusTrapFocus(e){const[t,o]=this.getFirstAndLastFocusableChildren();if(!t||!o)return void this.dialog?.focus();const i=e.target===this.firstFocusTrap,r=!i,n=e.relatedTarget===t,s=e.relatedTarget===o,a=!n&&!s;if(r&&s||i&&a)return void t.focus();(i&&n||r&&a)&&o.focus()}getFirstAndLastFocusableChildren(){if(!this.treewalker)return[null,null];let e=null,t=null;for(this.treewalker.currentNode=this.treewalker.root;this.treewalker.nextNode();){const o=this.treewalker.currentNode;Ze(o)&&(e||(e=o),t=o)}return[e,t]}}function Ze(e){const t=":not(:disabled,[disabled])";if(e.matches(":is(button,input,select,textarea,object,:is(a,area)[href],[tabindex],[contenteditable=true])"+t+':not([tabindex^="-"])'))return!0;return!!e.localName.includes("-")&&(!!e.matches(t)&&(e.shadowRoot?.delegatesFocus??!1))}t([fe({type:Boolean})],je.prototype,"open",null),t([fe({type:Boolean})],je.prototype,"quick",void 0),t([fe({attribute:!1})],je.prototype,"returnValue",void 0),t([fe()],je.prototype,"type",void 0),t([fe({type:Boolean,attribute:"no-focus-trap"})],je.prototype,"noFocusTrap",void 0),t([ye("dialog")],je.prototype,"dialog",void 0),t([ye(".scrim")],je.prototype,"scrim",void 0),t([ye(".container")],je.prototype,"container",void 0),t([ye(".headline")],je.prototype,"headline",void 0),t([ye(".content")],je.prototype,"content",void 0),t([ye(".actions")],je.prototype,"actions",void 0),t([ge()],je.prototype,"isAtScrollTop",void 0),t([ge()],je.prototype,"isAtScrollBottom",void 0),t([ye(".scroller")],je.prototype,"scroller",void 0),t([ye(".top.anchor")],je.prototype,"topAnchor",void 0),t([ye(".bottom.anchor")],je.prototype,"bottomAnchor",void 0),t([ye(".focus-trap")],je.prototype,"firstFocusTrap",void 0),t([ge()],je.prototype,"hasHeadline",void 0),t([ge()],je.prototype,"hasActions",void 0),t([ge()],je.prototype,"hasIcon",void 0);const Ke=a`:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:"";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));flex:1;font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}}
|
|
48
|
+
`;Ke.styleSheet;let Ge=class extends je{};Ge.styles=[Ke],Ge=t([ue("md-dialog")],Ge);const Ye=a`:host{--_container-color: var(--md-filled-tonal-icon-button-container-color, var(--md-sys-color-secondary-container, #e8def8));--_container-height: var(--md-filled-tonal-icon-button-container-height, 40px);--_container-width: var(--md-filled-tonal-icon-button-container-width, 40px);--_disabled-container-color: var(--md-filled-tonal-icon-button-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-opacity: var(--md-filled-tonal-icon-button-disabled-container-opacity, 0.12);--_disabled-icon-color: var(--md-filled-tonal-icon-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-filled-tonal-icon-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-filled-tonal-icon-button-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-icon-color: var(--md-filled-tonal-icon-button-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-color: var(--md-filled-tonal-icon-button-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-opacity: var(--md-filled-tonal-icon-button-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-filled-tonal-icon-button-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_icon-size: var(--md-filled-tonal-icon-button-icon-size, 24px);--_pressed-icon-color: var(--md-filled-tonal-icon-button-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-color: var(--md-filled-tonal-icon-button-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-opacity: var(--md-filled-tonal-icon-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-filled-tonal-icon-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_toggle-selected-focus-icon-color: var(--md-filled-tonal-icon-button-toggle-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-hover-icon-color: var(--md-filled-tonal-icon-button-toggle-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-hover-state-layer-color: var(--md-filled-tonal-icon-button-toggle-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-icon-color: var(--md-filled-tonal-icon-button-toggle-selected-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-pressed-icon-color: var(--md-filled-tonal-icon-button-toggle-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-pressed-state-layer-color: var(--md-filled-tonal-icon-button-toggle-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_unselected-container-color: var(--md-filled-tonal-icon-button-unselected-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_toggle-focus-icon-color: var(--md-filled-tonal-icon-button-toggle-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-hover-icon-color: var(--md-filled-tonal-icon-button-toggle-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-hover-state-layer-color: var(--md-filled-tonal-icon-button-toggle-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-icon-color: var(--md-filled-tonal-icon-button-toggle-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-pressed-icon-color: var(--md-filled-tonal-icon-button-toggle-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-pressed-state-layer-color: var(--md-filled-tonal-icon-button-toggle-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_container-shape-start-start: var(--md-filled-tonal-icon-button-container-shape-start-start, var(--md-filled-tonal-icon-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-filled-tonal-icon-button-container-shape-start-end, var(--md-filled-tonal-icon-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-filled-tonal-icon-button-container-shape-end-end, var(--md-filled-tonal-icon-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-filled-tonal-icon-button-container-shape-end-start, var(--md-filled-tonal-icon-button-container-shape, var(--md-sys-shape-corner-full, 9999px)))}.icon-button{color:var(--_icon-color)}.icon-button:hover{color:var(--_hover-icon-color)}.icon-button:focus{color:var(--_focus-icon-color)}.icon-button:active{color:var(--_pressed-icon-color)}.icon-button:is(:disabled,[aria-disabled=true]){color:var(--_disabled-icon-color)}.icon-button{--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}.icon-button::before{background-color:var(--_container-color);border-radius:inherit;content:"";inset:0;position:absolute;z-index:-1}.icon-button:is(:disabled,[aria-disabled=true])::before{background-color:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.icon-button:is(:disabled,[aria-disabled=true]) .icon{opacity:var(--_disabled-icon-opacity)}.toggle-filled-tonal:not(:disabled,[aria-disabled=true]){color:var(--_toggle-icon-color)}.toggle-filled-tonal:not(:disabled,[aria-disabled=true]):hover{color:var(--_toggle-hover-icon-color)}.toggle-filled-tonal:not(:disabled,[aria-disabled=true]):focus{color:var(--_toggle-focus-icon-color)}.toggle-filled-tonal:not(:disabled,[aria-disabled=true]):active{color:var(--_toggle-pressed-icon-color)}.toggle-filled-tonal{--md-ripple-hover-color: var(--_toggle-hover-state-layer-color);--md-ripple-pressed-color: var(--_toggle-pressed-state-layer-color)}.toggle-filled-tonal:not(:disabled,[aria-disabled=true])::before{background-color:var(--_unselected-container-color)}.selected:not(:disabled,[aria-disabled=true]){color:var(--_toggle-selected-icon-color)}.selected:not(:disabled,[aria-disabled=true]):hover{color:var(--_toggle-selected-hover-icon-color)}.selected:not(:disabled,[aria-disabled=true]):focus{color:var(--_toggle-selected-focus-icon-color)}.selected:not(:disabled,[aria-disabled=true]):active{color:var(--_toggle-selected-pressed-icon-color)}.selected{--md-ripple-hover-color: var(--_toggle-selected-hover-state-layer-color);--md-ripple-pressed-color: var(--_toggle-selected-pressed-state-layer-color)}.selected:not(:disabled,[aria-disabled=true])::before{background-color:var(--_selected-container-color)}
|
|
49
|
+
`;Ye.styleSheet;const Xe=Symbol("attachableController");let Je;Je=new MutationObserver(e=>{for(const t of e)t.target[Xe]?.hostConnected()});class Qe{get htmlFor(){return this.host.getAttribute("for")}set htmlFor(e){null===e?this.host.removeAttribute("for"):this.host.setAttribute("for",e)}get control(){return this.host.hasAttribute("for")?this.htmlFor&&this.host.isConnected?this.host.getRootNode().querySelector(`#${this.htmlFor}`):null:this.currentControl||this.host.parentElement}set control(e){e?this.attach(e):this.detach()}constructor(e,t){this.host=e,this.onControlChange=t,this.currentControl=null,e.addController(this),e[Xe]=this,Je?.observe(e,{attributeFilter:["for"]})}attach(e){e!==this.currentControl&&(this.setCurrentControl(e),this.host.removeAttribute("for"))}detach(){this.setCurrentControl(null),this.host.setAttribute("for","")}hostConnected(){this.setCurrentControl(this.control)}hostDisconnected(){this.setCurrentControl(null)}setCurrentControl(e){this.onControlChange(this.currentControl,e),this.currentControl=e}}const et=["focusin","focusout","pointerdown"];class tt extends he{constructor(){super(...arguments),this.visible=!1,this.inward=!1,this.attachableController=new Qe(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(e){this.attachableController.htmlFor=e}get control(){return this.attachableController.control}set control(e){this.attachableController.control=e}attach(e){this.attachableController.attach(e)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}handleEvent(e){if(!e[ot]){switch(e.type){default:return;case"focusin":this.visible=this.control?.matches(":focus-visible")??!1;break;case"focusout":case"pointerdown":this.visible=!1}e[ot]=!0}}onControlChange(e,t){for(const o of et)e?.removeEventListener(o,this),t?.addEventListener(o,this)}update(e){e.has("visible")&&this.dispatchEvent(new Event("visibility-changed")),super.update(e)}}t([fe({type:Boolean,reflect:!0})],tt.prototype,"visible",void 0),t([fe({type:Boolean,reflect:!0})],tt.prototype,"inward",void 0);const ot=Symbol("handledByFocusRing"),it=a`:host{animation-delay:0s,calc(var(--md-focus-ring-duration, 600ms)*.25);animation-duration:calc(var(--md-focus-ring-duration, 600ms)*.25),calc(var(--md-focus-ring-duration, 600ms)*.75);animation-timing-function:cubic-bezier(0.2, 0, 0, 1);box-sizing:border-box;color:var(--md-focus-ring-color, var(--md-sys-color-secondary, #625b71));display:none;pointer-events:none;position:absolute}:host([visible]){display:flex}:host(:not([inward])){animation-name:outward-grow,outward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));inset:calc(-1*var(--md-focus-ring-outward-offset, 2px));outline:var(--md-focus-ring-width, 3px) solid currentColor}:host([inward]){animation-name:inward-grow,inward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border:var(--md-focus-ring-width, 3px) solid currentColor;inset:var(--md-focus-ring-inward-offset, 0px)}@keyframes outward-grow{from{outline-width:0}to{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes outward-shrink{from{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-grow{from{border-width:0}to{border-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-shrink{from{border-width:var(--md-focus-ring-active-width, 8px)}}@media(prefers-reduced-motion){:host{animation:none}}
|
|
50
|
+
`;it.styleSheet;let rt=class extends tt{};rt.styles=[it],rt=t([ue("md-focus-ring")],rt);var nt;!function(e){e[e.INACTIVE=0]="INACTIVE",e[e.TOUCH_DELAY=1]="TOUCH_DELAY",e[e.HOLDING=2]="HOLDING",e[e.WAITING_FOR_CLICK=3]="WAITING_FOR_CLICK"}(nt||(nt={}));const st=["click","contextmenu","pointercancel","pointerdown","pointerenter","pointerleave","pointerup"],at=window.matchMedia("(forced-colors: active)");class lt extends he{constructor(){super(...arguments),this.disabled=!1,this.hovered=!1,this.pressed=!1,this.rippleSize="",this.rippleScale="",this.initialSize=0,this.state=nt.INACTIVE,this.attachableController=new Qe(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(e){this.attachableController.htmlFor=e}get control(){return this.attachableController.control}set control(e){this.attachableController.control=e}attach(e){this.attachableController.attach(e)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){const e={hovered:this.hovered,pressed:this.pressed};return W`<div class="surface ${Ie(e)}"></div>`}update(e){e.has("disabled")&&this.disabled&&(this.hovered=!1,this.pressed=!1),super.update(e)}handlePointerenter(e){this.shouldReactToEvent(e)&&(this.hovered=!0)}handlePointerleave(e){this.shouldReactToEvent(e)&&(this.hovered=!1,this.state!==nt.INACTIVE&&this.endPressAnimation())}handlePointerup(e){if(this.shouldReactToEvent(e)){if(this.state!==nt.HOLDING)return this.state===nt.TOUCH_DELAY?(this.state=nt.WAITING_FOR_CLICK,void this.startPressAnimation(this.rippleStartEvent)):void 0;this.state=nt.WAITING_FOR_CLICK}}async handlePointerdown(e){if(this.shouldReactToEvent(e)){if(this.rippleStartEvent=e,!this.isTouch(e))return this.state=nt.WAITING_FOR_CLICK,void this.startPressAnimation(e);this.state=nt.TOUCH_DELAY,await new Promise(e=>{setTimeout(e,150)}),this.state===nt.TOUCH_DELAY&&(this.state=nt.HOLDING,this.startPressAnimation(e))}}handleClick(){this.disabled||(this.state!==nt.WAITING_FOR_CLICK?this.state===nt.INACTIVE&&(this.startPressAnimation(),this.endPressAnimation()):this.endPressAnimation())}handlePointercancel(e){this.shouldReactToEvent(e)&&this.endPressAnimation()}handleContextmenu(){this.disabled||this.endPressAnimation()}determineRippleSize(){const{height:e,width:t}=this.getBoundingClientRect(),o=Math.max(e,t),i=Math.max(.35*o,75),r=this.currentCSSZoom??1,n=Math.floor(.2*o/r),s=Math.sqrt(t**2+e**2)+10;this.initialSize=n;const a=(s+i)/n;this.rippleScale=""+a/r,this.rippleSize=`${n}px`}getNormalizedPointerEventCoords(e){const{scrollX:t,scrollY:o}=window,{left:i,top:r}=this.getBoundingClientRect(),n=t+i,s=o+r,{pageX:a,pageY:l}=e,d=this.currentCSSZoom??1;return{x:(a-n)/d,y:(l-s)/d}}getTranslationCoordinates(e){const{height:t,width:o}=this.getBoundingClientRect(),i=this.currentCSSZoom??1,r={x:(o/i-this.initialSize)/2,y:(t/i-this.initialSize)/2};let n;return n=e instanceof PointerEvent?this.getNormalizedPointerEventCoords(e):{x:o/i/2,y:t/i/2},n={x:n.x-this.initialSize/2,y:n.y-this.initialSize/2},{startPoint:n,endPoint:r}}startPressAnimation(e){if(!this.mdRoot)return;this.pressed=!0,this.growAnimation?.cancel(),this.determineRippleSize();const{startPoint:t,endPoint:o}=this.getTranslationCoordinates(e),i=`${t.x}px, ${t.y}px`,r=`${o.x}px, ${o.y}px`;this.growAnimation=this.mdRoot.animate({top:[0,0],left:[0,0],height:[this.rippleSize,this.rippleSize],width:[this.rippleSize,this.rippleSize],transform:[`translate(${i}) scale(1)`,`translate(${r}) scale(${this.rippleScale})`]},{pseudoElement:"::after",duration:450,easing:Ue,fill:"forwards"})}async endPressAnimation(){this.rippleStartEvent=void 0,this.state=nt.INACTIVE;const e=this.growAnimation;let t=1/0;"number"==typeof e?.currentTime?t=e.currentTime:e?.currentTime&&(t=e.currentTime.to("ms").value),t>=225?this.pressed=!1:(await new Promise(e=>{setTimeout(e,225-t)}),this.growAnimation===e&&(this.pressed=!1))}shouldReactToEvent(e){if(this.disabled||!e.isPrimary)return!1;if(this.rippleStartEvent&&this.rippleStartEvent.pointerId!==e.pointerId)return!1;if("pointerenter"===e.type||"pointerleave"===e.type)return!this.isTouch(e);const t=1===e.buttons;return this.isTouch(e)||t}isTouch({pointerType:e}){return"touch"===e}async handleEvent(e){if(!at?.matches)switch(e.type){case"click":this.handleClick();break;case"contextmenu":this.handleContextmenu();break;case"pointercancel":this.handlePointercancel(e);break;case"pointerdown":await this.handlePointerdown(e);break;case"pointerenter":this.handlePointerenter(e);break;case"pointerleave":this.handlePointerleave(e);break;case"pointerup":this.handlePointerup(e)}}onControlChange(e,t){for(const o of st)e?.removeEventListener(o,this),t?.addEventListener(o,this)}}t([fe({type:Boolean,reflect:!0})],lt.prototype,"disabled",void 0),t([ge()],lt.prototype,"hovered",void 0),t([ge()],lt.prototype,"pressed",void 0),t([ye(".surface")],lt.prototype,"mdRoot",void 0);const dt=a`:host{display:flex;margin:auto;pointer-events:none}:host([disabled]){display:none}@media(forced-colors: active){:host{display:none}}:host,.surface{border-radius:inherit;position:absolute;inset:0;overflow:hidden}.surface{-webkit-tap-highlight-color:rgba(0,0,0,0)}.surface::before,.surface::after{content:"";opacity:0;position:absolute}.surface::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));inset:0;transition:opacity 15ms linear,background-color 15ms linear}.surface::after{background:radial-gradient(closest-side, var(--md-ripple-pressed-color, var(--md-sys-color-on-surface, #1d1b20)) max(100% - 70px, 65%), transparent 100%);transform-origin:center center;transition:opacity 375ms linear}.hovered::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-ripple-hover-opacity, 0.08)}.pressed::after{opacity:var(--md-ripple-pressed-opacity, 0.12);transition-duration:105ms}
|
|
51
|
+
`;dt.styleSheet;let ct=class extends lt{};ct.styles=[dt],ct=t([ue("md-ripple")],ct);const ht=Symbol.for(""),pt=e=>{if(e?.r===ht)return e?._$litStatic$},ut=(e,...t)=>({_$litStatic$:t.reduce((t,o,i)=>t+(e=>{if(void 0!==e._$litStatic$)return e._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(o)+e[i+1],e[0]),r:ht}),vt=new Map,mt=(e=>(t,...o)=>{const i=o.length;let r,n;const s=[],a=[];let l,d=0,c=!1;for(;d<i;){for(l=t[d];d<i&&void 0!==(n=o[d],r=pt(n));)l+=r+t[++d],c=!0;d!==i&&a.push(n),s.push(l),d++}if(d===i&&s.push(t[i]),c){const e=s.join("$$lit$$");void 0===(t=vt.get(e))&&(s.raw=s,vt.set(e,t=s)),o=a}return e(t,...o)})(W);function ft(e,t=!0){return t&&"rtl"===getComputedStyle(e).getPropertyValue("direction").trim()}const gt=Symbol("dispatchHooks");function bt(e,t){const o=e[gt];if(!o)throw new Error(`'${e.type}' event needs setupDispatchHooks().`);o.addEventListener("after",t,{once:!0})}const yt=new WeakMap;function xt(e,...t){let o=yt.get(e);o||(o=new Set,yt.set(e,o));for(const i of t)o.has(i)||(e.addEventListener(i,e=>{const t=new EventTarget;e[gt]=t;const o=new AbortController,r=()=>{o.abort(),t.dispatchEvent(new Event("after"))},n=e=>function(){e.call(this),r()};e.stopPropagation=n(e.stopPropagation),e.stopImmediatePropagation=n(e.stopImmediatePropagation);const s=e.composedPath();let a;a=e.composed&&e.bubbles?s[s.length-1]:e.bubbles?s[0].getRootNode():s[0],a.addEventListener(i,()=>{r()},{once:!0,signal:o.signal})},{capture:!0}),o.add(i))}const _t=Symbol("internals"),wt=Symbol("privateInternals");function Ct(e){return class extends e{get[_t](){return this[wt]||(this[wt]=this.attachInternals()),this[wt]}}}const $t=Symbol("getFormValue"),Et=Symbol("getFormState");function St(e){class o extends e{get form(){return this[_t].form}get labels(){return this[_t].labels}get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",Boolean(e))}attributeChangedCallback(e,t,o){if("name"===e||"disabled"===e){const o="disabled"===e?null!==t:t;return void this.requestUpdate(e,o)}super.attributeChangedCallback(e,t,o)}requestUpdate(e,t,o){super.requestUpdate(e,t,o),this[_t].setFormValue(this[$t](),this[Et]())}[$t](){return this.getAttribute("value")}[Et](){return this[$t]()}formDisabledCallback(e){this.disabled=e}}return o.formAssociated=!0,t([fe({noAccessor:!0})],o.prototype,"name",null),t([fe({type:Boolean,noAccessor:!0})],o.prototype,"disabled",null),o}function Tt(e){class o extends e{get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}constructor(...e){super(...e),this.type="submit",this.value="",xt(this,"click"),this.addEventListener("click",async e=>{const t="reset"===this.type,o="submit"===this.type,i=this[_t],{form:r}=i;r&&(o||t)&&bt(e,()=>{e.defaultPrevented||(t?r.reset():(r.addEventListener("submit",e=>{Object.defineProperty(e,"submitter",{configurable:!0,enumerable:!0,get:()=>this})},{capture:!0,once:!0}),i.setFormValue(this.value),r.requestSubmit()))})})}}return t([fe()],o.prototype,"type",void 0),t([fe({reflect:!0})],o.prototype,"value",void 0),o}const At=Le(Tt(St(Ct(he))));class kt extends At{constructor(){super(),this.softDisabled=!1,this.flipIconInRtl=!1,this.href="",this.download="",this.target="",this.ariaLabelSelected="",this.toggle=!1,this.selected=!1,this.flipIcon=ft(this,this.flipIconInRtl),xt(this,"click"),this.addEventListener("click",e=>{if(this.softDisabled||this.disabled&&this.href)return e.stopImmediatePropagation(),void e.preventDefault();const t=this.selected;bt(e,()=>{!this.toggle||this.disabled||e.defaultPrevented||(this.selected=!t,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))})})}willUpdate(){this.href&&(this.disabled=!1,this.softDisabled=!1)}render(){const e=this.href?ut`div`:ut`button`,{ariaLabel:t,ariaHasPopup:o,ariaExpanded:i}=this,r=t&&this.ariaLabelSelected,n=this.toggle?this.selected:K;let s=K;return this.href||(s=r&&this.selected?this.ariaLabelSelected:t),mt`<${e}
|
|
52
|
+
class="icon-button ${Ie(this.getRenderClasses())}"
|
|
53
|
+
id="button"
|
|
54
|
+
aria-label="${s||K}"
|
|
55
|
+
aria-haspopup="${!this.href&&o||K}"
|
|
56
|
+
aria-expanded="${!this.href&&i||K}"
|
|
57
|
+
aria-pressed="${n}"
|
|
58
|
+
aria-disabled=${!this.href&&this.softDisabled||K}
|
|
59
|
+
?disabled="${!this.href&&this.disabled}">
|
|
60
|
+
${this.renderFocusRing()}
|
|
61
|
+
${this.renderRipple()}
|
|
62
|
+
${this.selected?K:this.renderIcon()}
|
|
63
|
+
${this.selected?this.renderSelectedIcon():K}
|
|
64
|
+
${this.href?this.renderLink():this.renderTouchTarget()}
|
|
65
|
+
</${e}>`}renderLink(){const{ariaLabel:e}=this;return W`
|
|
66
|
+
<a
|
|
67
|
+
class="link"
|
|
68
|
+
id="link"
|
|
69
|
+
href="${this.href}"
|
|
70
|
+
download="${this.download||K}"
|
|
71
|
+
target="${this.target||K}"
|
|
72
|
+
aria-label="${e||K}">
|
|
73
|
+
${this.renderTouchTarget()}
|
|
74
|
+
</a>
|
|
75
|
+
`}getRenderClasses(){return{"flip-icon":this.flipIcon,selected:this.toggle&&this.selected}}renderIcon(){return W`<span class="icon"><slot></slot></span>`}renderSelectedIcon(){return W`<span class="icon icon--selected"
|
|
76
|
+
><slot name="selected"><slot></slot></slot
|
|
77
|
+
></span>`}renderTouchTarget(){return W`<span class="touch"></span>`}renderFocusRing(){return W`<md-focus-ring
|
|
78
|
+
part="focus-ring"
|
|
79
|
+
for=${this.href?"link":"button"}></md-focus-ring>`}renderRipple(){const e=!this.href&&(this.disabled||this.softDisabled);return W`<md-ripple
|
|
80
|
+
for=${this.href?"link":K}
|
|
81
|
+
?disabled="${e}"></md-ripple>`}connectedCallback(){this.flipIcon=ft(this,this.flipIconInRtl),super.connectedCallback()}}kt.shadowRootOptions={mode:"open",delegatesFocus:!0},t([fe({type:Boolean,attribute:"soft-disabled",reflect:!0})],kt.prototype,"softDisabled",void 0),t([fe({type:Boolean,attribute:"flip-icon-in-rtl"})],kt.prototype,"flipIconInRtl",void 0),t([fe()],kt.prototype,"href",void 0),t([fe()],kt.prototype,"download",void 0),t([fe()],kt.prototype,"target",void 0),t([fe({attribute:"aria-label-selected"})],kt.prototype,"ariaLabelSelected",void 0),t([fe({type:Boolean})],kt.prototype,"toggle",void 0),t([fe({type:Boolean,reflect:!0})],kt.prototype,"selected",void 0),t([ge()],kt.prototype,"flipIcon",void 0);const It=a`:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);height:var(--_container-height);width:var(--_container-width);justify-content:center}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) max(0px,(48px - var(--_container-width))/2)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host(:is([disabled],[soft-disabled])){pointer-events:none}.icon-button{place-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:flex;place-content:center;outline:none;padding:0;position:relative;text-decoration:none;user-select:none;z-index:0;flex:1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.icon ::slotted(*){font-size:var(--_icon-size);height:var(--_icon-size);width:var(--_icon-size);font-weight:inherit}md-ripple{z-index:-1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.flip-icon .icon{transform:scaleX(-1)}.icon{display:inline-flex}.link{display:grid;height:100%;outline:none;place-items:center;position:absolute;width:100%}.touch{position:absolute;height:max(48px,100%);width:max(48px,100%)}:host([touch-target=none]) .touch{display:none}@media(forced-colors: active){:host(:is([disabled],[soft-disabled])){--_disabled-icon-color: GrayText;--_disabled-icon-opacity: 1}}
|
|
82
|
+
`;It.styleSheet;let Rt=class extends kt{getRenderClasses(){return{...super.getRenderClasses(),"filled-tonal":!0,"toggle-filled-tonal":this.toggle}}};Rt.styles=[It,Ye],Rt=t([ue("md-filled-tonal-icon-button")],Rt);const Pt=a`:host{--_disabled-icon-color: var(--md-icon-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-icon-button-disabled-icon-opacity, 0.38);--_icon-size: var(--md-icon-button-icon-size, 24px);--_selected-focus-icon-color: var(--md-icon-button-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-icon-color: var(--md-icon-button-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-color: var(--md-icon-button-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-icon-button-selected-hover-state-layer-opacity, 0.08);--_selected-icon-color: var(--md-icon-button-selected-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-icon-color: var(--md-icon-button-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-color: var(--md-icon-button-selected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-opacity: var(--md-icon-button-selected-pressed-state-layer-opacity, 0.12);--_state-layer-height: var(--md-icon-button-state-layer-height, 40px);--_state-layer-shape: var(--md-icon-button-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));--_state-layer-width: var(--md-icon-button-state-layer-width, 40px);--_focus-icon-color: var(--md-icon-button-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-icon-color: var(--md-icon-button-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-icon-button-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-opacity: var(--md-icon-button-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-icon-button-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-icon-color: var(--md-icon-button-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-color: var(--md-icon-button-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-opacity: var(--md-icon-button-pressed-state-layer-opacity, 0.12);--_container-shape-start-start: 0;--_container-shape-start-end: 0;--_container-shape-end-end: 0;--_container-shape-end-start: 0;--_container-height: 0;--_container-width: 0;height:var(--_state-layer-height);width:var(--_state-layer-width)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_state-layer-height))/2) max(0px,(48px - var(--_state-layer-width))/2)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_state-layer-shape);--md-focus-ring-shape-start-end: var(--_state-layer-shape);--md-focus-ring-shape-end-end: var(--_state-layer-shape);--md-focus-ring-shape-end-start: var(--_state-layer-shape)}.standard{background-color:rgba(0,0,0,0);color:var(--_icon-color);--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}.standard:hover{color:var(--_hover-icon-color)}.standard:focus{color:var(--_focus-icon-color)}.standard:active{color:var(--_pressed-icon-color)}.standard:is(:disabled,[aria-disabled=true]){color:var(--_disabled-icon-color)}md-ripple{border-radius:var(--_state-layer-shape)}.standard:is(:disabled,[aria-disabled=true]){opacity:var(--_disabled-icon-opacity)}.selected:not(:disabled,[aria-disabled=true]){color:var(--_selected-icon-color)}.selected:not(:disabled,[aria-disabled=true]):hover{color:var(--_selected-hover-icon-color)}.selected:not(:disabled,[aria-disabled=true]):focus{color:var(--_selected-focus-icon-color)}.selected:not(:disabled,[aria-disabled=true]):active{color:var(--_selected-pressed-icon-color)}.selected{--md-ripple-hover-color: var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity: var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-color: var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_selected-pressed-state-layer-opacity)}
|
|
83
|
+
`;Pt.styleSheet;let Ot=class extends kt{getRenderClasses(){return{...super.getRenderClasses(),standard:!0}}};Ot.styles=[It,Pt],Ot=t([ue("md-icon-button")],Ot);class zt extends he{constructor(){super(...arguments),this.disabled=!1,this.error=!1,this.focused=!1,this.label="",this.noAsterisk=!1,this.populated=!1,this.required=!1,this.resizable=!1,this.supportingText="",this.errorText="",this.count=-1,this.max=-1,this.hasStart=!1,this.hasEnd=!1,this.isAnimating=!1,this.refreshErrorAlert=!1,this.disableTransitions=!1}get counterText(){const e=this.count??-1,t=this.max??-1;return e<0||t<=0?"":`${e} / ${t}`}get supportingOrErrorText(){return this.error&&this.errorText?this.errorText:this.supportingText}reannounceError(){this.refreshErrorAlert=!0}update(e){e.has("disabled")&&void 0!==e.get("disabled")&&(this.disableTransitions=!0),this.disabled&&this.focused&&(e.set("focused",!0),this.focused=!1),this.animateLabelIfNeeded({wasFocused:e.get("focused"),wasPopulated:e.get("populated")}),super.update(e)}render(){const e=this.renderLabel(!0),t=this.renderLabel(!1),o=this.renderOutline?.(e),i={disabled:this.disabled,"disable-transitions":this.disableTransitions,error:this.error&&!this.disabled,focused:this.focused,"with-start":this.hasStart,"with-end":this.hasEnd,populated:this.populated,resizable:this.resizable,required:this.required,"no-label":!this.label};return W`
|
|
84
|
+
<div class="field ${Ie(i)}">
|
|
85
|
+
<div class="container-overflow">
|
|
86
|
+
${this.renderBackground?.()}
|
|
87
|
+
<slot name="container"></slot>
|
|
88
|
+
${this.renderStateLayer?.()} ${this.renderIndicator?.()} ${o}
|
|
89
|
+
<div class="container">
|
|
90
|
+
<div class="start">
|
|
91
|
+
<slot name="start"></slot>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="middle">
|
|
94
|
+
<div class="label-wrapper">
|
|
95
|
+
${t} ${o?K:e}
|
|
96
|
+
</div>
|
|
97
|
+
<div class="content">
|
|
98
|
+
<slot></slot>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
<div class="end">
|
|
102
|
+
<slot name="end"></slot>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
${this.renderSupportingText()}
|
|
107
|
+
</div>
|
|
108
|
+
`}updated(e){(e.has("supportingText")||e.has("errorText")||e.has("count")||e.has("max"))&&this.updateSlottedAriaDescribedBy(),this.refreshErrorAlert&&requestAnimationFrame(()=>{this.refreshErrorAlert=!1}),this.disableTransitions&&requestAnimationFrame(()=>{this.disableTransitions=!1})}renderSupportingText(){const{supportingOrErrorText:e,counterText:t}=this;if(!e&&!t)return K;const o=W`<span>${e}</span>`,i=t?W`<span class="counter">${t}</span>`:K,r=this.error&&this.errorText&&!this.refreshErrorAlert;return W`
|
|
109
|
+
<div class="supporting-text" role=${r?"alert":K}>${o}${i}</div>
|
|
110
|
+
<slot
|
|
111
|
+
name="aria-describedby"
|
|
112
|
+
@slotchange=${this.updateSlottedAriaDescribedBy}></slot>
|
|
113
|
+
`}updateSlottedAriaDescribedBy(){for(const e of this.slottedAriaDescribedBy)de(W`${this.supportingOrErrorText} ${this.counterText}`,e),e.setAttribute("hidden","")}renderLabel(e){if(!this.label)return K;let t;t=e?this.focused||this.populated||this.isAnimating:!this.focused&&!this.populated&&!this.isAnimating;const o={hidden:!t,floating:e,resting:!e},i=`${this.label}${this.required&&!this.noAsterisk?"*":""}`;return W`
|
|
114
|
+
<span class="label ${Ie(o)}" aria-hidden=${!t}
|
|
115
|
+
>${i}</span
|
|
116
|
+
>
|
|
117
|
+
`}animateLabelIfNeeded({wasFocused:e,wasPopulated:t}){if(!this.label)return;e??=this.focused,t??=this.populated;if((e||t)===(this.focused||this.populated))return;const o=this.getLabelKeyframes();o.length&&(this.isAnimating=!0,this.labelAnimation?.cancel(),this.labelAnimation=this.floatingLabelEl?.animate(o,{duration:150,easing:Ue}),this.labelAnimation?.addEventListener("finish",()=>{this.isAnimating=!1}))}getLabelKeyframes(){const{floatingLabelEl:e,restingLabelEl:t}=this;if(!e||!t)return[];const{x:o,y:i,height:r}=e.getBoundingClientRect(),{x:n,y:s,height:a}=t.getBoundingClientRect(),l=e.scrollWidth,d=t.scrollWidth;if(0===l||0===d)return[];const c=d/l,h=`translateX(${n-o}px) translateY(${s-i+Math.round((a-r*c)/2)}px) scale(${c})`,p="translateX(0) translateY(0) scale(1)",u=t.clientWidth,v=d>u?u/c+"px":"";return this.focused||this.populated?[{transform:h,width:v},{transform:p,width:v}]:[{transform:p,width:v},{transform:h,width:v}]}getSurfacePositionClientRect(){return this.containerEl.getBoundingClientRect()}}t([fe({type:Boolean})],zt.prototype,"disabled",void 0),t([fe({type:Boolean})],zt.prototype,"error",void 0),t([fe({type:Boolean})],zt.prototype,"focused",void 0),t([fe()],zt.prototype,"label",void 0),t([fe({type:Boolean,attribute:"no-asterisk"})],zt.prototype,"noAsterisk",void 0),t([fe({type:Boolean})],zt.prototype,"populated",void 0),t([fe({type:Boolean})],zt.prototype,"required",void 0),t([fe({type:Boolean})],zt.prototype,"resizable",void 0),t([fe({attribute:"supporting-text"})],zt.prototype,"supportingText",void 0),t([fe({attribute:"error-text"})],zt.prototype,"errorText",void 0),t([fe({type:Number})],zt.prototype,"count",void 0),t([fe({type:Number})],zt.prototype,"max",void 0),t([fe({type:Boolean,attribute:"has-start"})],zt.prototype,"hasStart",void 0),t([fe({type:Boolean,attribute:"has-end"})],zt.prototype,"hasEnd",void 0),t([_e({slot:"aria-describedby"})],zt.prototype,"slottedAriaDescribedBy",void 0),t([ge()],zt.prototype,"isAnimating",void 0),t([ge()],zt.prototype,"refreshErrorAlert",void 0),t([ge()],zt.prototype,"disableTransitions",void 0),t([ye(".label.floating")],zt.prototype,"floatingLabelEl",void 0),t([ye(".label.resting")],zt.prototype,"restingLabelEl",void 0),t([ye(".container")],zt.prototype,"containerEl",void 0);class qt extends zt{renderOutline(e){return W`
|
|
118
|
+
<div class="outline">
|
|
119
|
+
<div class="outline-start"></div>
|
|
120
|
+
<div class="outline-notch">
|
|
121
|
+
<div class="outline-panel-inactive"></div>
|
|
122
|
+
<div class="outline-panel-active"></div>
|
|
123
|
+
<div class="outline-label">${e}</div>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="outline-end"></div>
|
|
126
|
+
</div>
|
|
127
|
+
`}}const Lt=a`@layer styles{:host{--_bottom-space: var(--md-outlined-field-bottom-space, 16px);--_content-color: var(--md-outlined-field-content-color, var(--md-sys-color-on-surface, #1d1b20));--_content-font: var(--md-outlined-field-content-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_content-line-height: var(--md-outlined-field-content-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_content-size: var(--md-outlined-field-content-size, var(--md-sys-typescale-body-large-size, 1rem));--_content-space: var(--md-outlined-field-content-space, 16px);--_content-weight: var(--md-outlined-field-content-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_disabled-content-color: var(--md-outlined-field-disabled-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-content-opacity: var(--md-outlined-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-outlined-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-content-opacity: var(--md-outlined-field-disabled-leading-content-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-field-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-field-disabled-outline-opacity, 0.12);--_disabled-outline-width: var(--md-outlined-field-disabled-outline-width, 1px);--_disabled-supporting-text-color: var(--md-outlined-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-outlined-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-outlined-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-content-opacity: var(--md-outlined-field-disabled-trailing-content-opacity, 0.38);--_error-content-color: var(--md-outlined-field-error-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-content-color: var(--md-outlined-field-error-focus-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-label-text-color: var(--md-outlined-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-outlined-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-outline-color: var(--md-outlined-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_error-focus-supporting-text-color: var(--md-outlined-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-outlined-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-content-color: var(--md-outlined-field-error-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-outlined-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-outlined-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-outline-color: var(--md-outlined-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-supporting-text-color: var(--md-outlined-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-outlined-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-outlined-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-outlined-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-outline-color: var(--md-outlined-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_error-supporting-text-color: var(--md-outlined-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-outlined-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-content-color: var(--md-outlined-field-focus-content-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-outlined-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-outlined-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-outline-color: var(--md-outlined-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-width: var(--md-outlined-field-focus-outline-width, 3px);--_focus-supporting-text-color: var(--md-outlined-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-outlined-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-content-color: var(--md-outlined-field-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-outlined-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-leading-content-color: var(--md-outlined-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-outline-color: var(--md-outlined-field-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-outline-width: var(--md-outlined-field-hover-outline-width, 1px);--_hover-supporting-text-color: var(--md-outlined-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-outlined-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-outlined-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-outlined-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-outlined-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_label-text-padding-bottom: var(--md-outlined-field-label-text-padding-bottom, 8px);--_label-text-populated-line-height: var(--md-outlined-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_label-text-populated-size: var(--md-outlined-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_label-text-size: var(--md-outlined-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_label-text-weight: var(--md-outlined-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_leading-content-color: var(--md-outlined-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-space: var(--md-outlined-field-leading-space, 16px);--_outline-color: var(--md-outlined-field-outline-color, var(--md-sys-color-outline, #79747e));--_outline-label-padding: var(--md-outlined-field-outline-label-padding, 4px);--_outline-width: var(--md-outlined-field-outline-width, 1px);--_supporting-text-color: var(--md-outlined-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-outlined-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_supporting-text-leading-space: var(--md-outlined-field-supporting-text-leading-space, 16px);--_supporting-text-line-height: var(--md-outlined-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_supporting-text-size: var(--md-outlined-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_supporting-text-top-space: var(--md-outlined-field-supporting-text-top-space, 4px);--_supporting-text-trailing-space: var(--md-outlined-field-supporting-text-trailing-space, 16px);--_supporting-text-weight: var(--md-outlined-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_top-space: var(--md-outlined-field-top-space, 16px);--_trailing-content-color: var(--md-outlined-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-space: var(--md-outlined-field-trailing-space, 16px);--_with-leading-content-leading-space: var(--md-outlined-field-with-leading-content-leading-space, 12px);--_with-trailing-content-trailing-space: var(--md-outlined-field-with-trailing-content-trailing-space, 12px);--_container-shape-start-start: var(--md-outlined-field-container-shape-start-start, var(--md-outlined-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-start-end: var(--md-outlined-field-container-shape-start-end, var(--md-outlined-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-end-end: var(--md-outlined-field-container-shape-end-end, var(--md-outlined-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-end-start: var(--md-outlined-field-container-shape-end-start, var(--md-outlined-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)))}.outline{border-color:var(--_outline-color);border-radius:inherit;display:flex;pointer-events:none;height:100%;position:absolute;width:100%;z-index:1}.outline-start::before,.outline-start::after,.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after,.outline-end::before,.outline-end::after{border:inherit;content:"";inset:0;position:absolute}.outline-start,.outline-end{border:inherit;border-radius:inherit;box-sizing:border-box;position:relative}.outline-start::before,.outline-start::after,.outline-end::before,.outline-end::after{border-bottom-style:solid;border-top-style:solid}.outline-start::after,.outline-end::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .outline-start::after,.focused .outline-end::after{opacity:1}.outline-start::before,.outline-start::after{border-inline-start-style:solid;border-inline-end-style:none;border-start-start-radius:inherit;border-start-end-radius:0;border-end-start-radius:inherit;border-end-end-radius:0;margin-inline-end:var(--_outline-label-padding)}.outline-end{flex-grow:1;margin-inline-start:calc(-1*var(--_outline-label-padding))}.outline-end::before,.outline-end::after{border-inline-start-style:none;border-inline-end-style:solid;border-start-start-radius:0;border-start-end-radius:inherit;border-end-start-radius:0;border-end-end-radius:inherit}.outline-notch{align-items:flex-start;border:inherit;display:flex;margin-inline-start:calc(-1*var(--_outline-label-padding));margin-inline-end:var(--_outline-label-padding);max-width:calc(100% - var(--_leading-space) - var(--_trailing-space));padding:0 var(--_outline-label-padding);position:relative}.no-label .outline-notch{display:none}.outline-panel-inactive,.outline-panel-active{border:inherit;border-bottom-style:solid;inset:0;position:absolute}.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after{border-top-style:solid;border-bottom:none;bottom:auto;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.2, 0, 0, 1)}.outline-panel-inactive::before,.outline-panel-active::before{right:50%;transform-origin:top left}.outline-panel-inactive::after,.outline-panel-active::after{left:50%;transform-origin:top right}.populated .outline-panel-inactive::before,.populated .outline-panel-inactive::after,.populated .outline-panel-active::before,.populated .outline-panel-active::after,.focused .outline-panel-inactive::before,.focused .outline-panel-inactive::after,.focused .outline-panel-active::before,.focused .outline-panel-active::after{transform:scaleX(0)}.outline-panel-active{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .outline-panel-active{opacity:1}.outline-label{display:flex;max-width:100%;transform:translateY(calc(-100% + var(--_label-text-padding-bottom)))}.outline-start,.field:not(.with-start) .content ::slotted(*){padding-inline-start:max(var(--_leading-space),max(var(--_container-shape-start-start),var(--_container-shape-end-start)) + var(--_outline-label-padding))}.field:not(.with-start) .label-wrapper{margin-inline-start:max(var(--_leading-space),max(var(--_container-shape-start-start),var(--_container-shape-end-start)) + var(--_outline-label-padding))}.field:not(.with-end) .content ::slotted(*){padding-inline-end:max(var(--_trailing-space),max(var(--_container-shape-start-end),var(--_container-shape-end-end)))}.field:not(.with-end) .label-wrapper{margin-inline-end:max(var(--_trailing-space),max(var(--_container-shape-start-end),var(--_container-shape-end-end)))}.outline-start::before,.outline-end::before,.outline-panel-inactive,.outline-panel-inactive::before,.outline-panel-inactive::after{border-width:var(--_outline-width)}:hover .outline{border-color:var(--_hover-outline-color);color:var(--_hover-outline-color)}:hover .outline-start::before,:hover .outline-end::before,:hover .outline-panel-inactive,:hover .outline-panel-inactive::before,:hover .outline-panel-inactive::after{border-width:var(--_hover-outline-width)}.focused .outline{border-color:var(--_focus-outline-color);color:var(--_focus-outline-color)}.outline-start::after,.outline-end::after,.outline-panel-active,.outline-panel-active::before,.outline-panel-active::after{border-width:var(--_focus-outline-width)}.disabled .outline{border-color:var(--_disabled-outline-color);color:var(--_disabled-outline-color)}.disabled .outline-start,.disabled .outline-end,.disabled .outline-panel-inactive{opacity:var(--_disabled-outline-opacity)}.disabled .outline-start::before,.disabled .outline-end::before,.disabled .outline-panel-inactive,.disabled .outline-panel-inactive::before,.disabled .outline-panel-inactive::after{border-width:var(--_disabled-outline-width)}.error .outline{border-color:var(--_error-outline-color);color:var(--_error-outline-color)}.error:hover .outline{border-color:var(--_error-hover-outline-color);color:var(--_error-hover-outline-color)}.error.focused .outline{border-color:var(--_error-focus-outline-color);color:var(--_error-focus-outline-color)}.resizable .container{bottom:var(--_focus-outline-width);inset-inline-end:var(--_focus-outline-width);clip-path:inset(var(--_focus-outline-width) 0 0 var(--_focus-outline-width))}.resizable .container>*{top:var(--_focus-outline-width);inset-inline-start:var(--_focus-outline-width)}.resizable .container:dir(rtl){clip-path:inset(var(--_focus-outline-width) var(--_focus-outline-width) 0 0)}}@layer hcm{@media(forced-colors: active){.disabled .outline{border-color:GrayText;color:GrayText}.disabled :is(.outline-start,.outline-end,.outline-panel-inactive){opacity:1}}}
|
|
128
|
+
`;Lt.styleSheet;const Dt=a`:host{display:inline-flex;resize:both}.field{display:flex;flex:1;flex-direction:column;writing-mode:horizontal-tb;max-width:100%}.container-overflow{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:flex;height:100%;position:relative}.container{align-items:center;border-radius:inherit;display:flex;flex:1;max-height:100%;min-height:100%;min-width:min-content;position:relative}.field,.container-overflow{resize:inherit}.resizable:not(.disabled) .container{resize:inherit;overflow:hidden}.disabled{pointer-events:none}slot[name=container]{border-radius:inherit}slot[name=container]::slotted(*){border-radius:inherit;inset:0;pointer-events:none;position:absolute}@layer styles{.start,.middle,.end{display:flex;box-sizing:border-box;height:100%;position:relative}.start{color:var(--_leading-content-color)}.end{color:var(--_trailing-content-color)}.start,.end{align-items:center;justify-content:center}.with-start .start{margin-inline:var(--_with-leading-content-leading-space) var(--_content-space)}.with-end .end{margin-inline:var(--_content-space) var(--_with-trailing-content-trailing-space)}.middle{align-items:stretch;align-self:baseline;flex:1}.content{color:var(--_content-color);display:flex;flex:1;opacity:0;transition:opacity 83ms cubic-bezier(0.2, 0, 0, 1)}.no-label .content,.focused .content,.populated .content{opacity:1;transition-delay:67ms}:is(.disabled,.disable-transitions) .content{transition:none}.content ::slotted(*){all:unset;color:currentColor;font-family:var(--_content-font);font-size:var(--_content-size);line-height:var(--_content-line-height);font-weight:var(--_content-weight);width:100%;overflow-wrap:revert;white-space:revert}.content ::slotted(:not(textarea)){padding-top:var(--_top-space);padding-bottom:var(--_bottom-space)}.content ::slotted(textarea){margin-top:var(--_top-space);margin-bottom:var(--_bottom-space)}:hover .content{color:var(--_hover-content-color)}:hover .start{color:var(--_hover-leading-content-color)}:hover .end{color:var(--_hover-trailing-content-color)}.focused .content{color:var(--_focus-content-color)}.focused .start{color:var(--_focus-leading-content-color)}.focused .end{color:var(--_focus-trailing-content-color)}.disabled .content{color:var(--_disabled-content-color)}.disabled.no-label .content,.disabled.focused .content,.disabled.populated .content{opacity:var(--_disabled-content-opacity)}.disabled .start{color:var(--_disabled-leading-content-color);opacity:var(--_disabled-leading-content-opacity)}.disabled .end{color:var(--_disabled-trailing-content-color);opacity:var(--_disabled-trailing-content-opacity)}.error .content{color:var(--_error-content-color)}.error .start{color:var(--_error-leading-content-color)}.error .end{color:var(--_error-trailing-content-color)}.error:hover .content{color:var(--_error-hover-content-color)}.error:hover .start{color:var(--_error-hover-leading-content-color)}.error:hover .end{color:var(--_error-hover-trailing-content-color)}.error.focused .content{color:var(--_error-focus-content-color)}.error.focused .start{color:var(--_error-focus-leading-content-color)}.error.focused .end{color:var(--_error-focus-trailing-content-color)}}@layer hcm{@media(forced-colors: active){.disabled :is(.start,.content,.end){color:GrayText;opacity:1}}}@layer styles{.label{box-sizing:border-box;color:var(--_label-text-color);overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap;z-index:1;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);width:min-content}.label-wrapper{inset:0;pointer-events:none;position:absolute}.label.resting{position:absolute;top:var(--_top-space)}.label.floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height);transform-origin:top left}.label.hidden{opacity:0}.no-label .label{display:none}.label-wrapper{inset:0;position:absolute;text-align:initial}:hover .label{color:var(--_hover-label-text-color)}.focused .label{color:var(--_focus-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color)}.disabled .label:not(.hidden){opacity:var(--_disabled-label-text-opacity)}.error .label{color:var(--_error-label-text-color)}.error:hover .label{color:var(--_error-hover-label-text-color)}.error.focused .label{color:var(--_error-focus-label-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .label:not(.hidden){color:GrayText;opacity:1}}}@layer styles{.supporting-text{color:var(--_supporting-text-color);display:flex;font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);gap:16px;justify-content:space-between;padding-inline-start:var(--_supporting-text-leading-space);padding-inline-end:var(--_supporting-text-trailing-space);padding-top:var(--_supporting-text-top-space)}.supporting-text :nth-child(2){flex-shrink:0}:hover .supporting-text{color:var(--_hover-supporting-text-color)}.focus .supporting-text{color:var(--_focus-supporting-text-color)}.disabled .supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.error .supporting-text{color:var(--_error-supporting-text-color)}.error:hover .supporting-text{color:var(--_error-hover-supporting-text-color)}.error.focus .supporting-text{color:var(--_error-focus-supporting-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .supporting-text{color:GrayText;opacity:1}}}
|
|
129
|
+
`;Dt.styleSheet;let Nt=class extends qt{};Nt.styles=[Dt,Lt],Nt=t([ue("md-outlined-field")],Nt);const Ft=a`:host{--_caret-color: var(--md-outlined-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_disabled-input-text-color: var(--md-outlined-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-input-text-opacity: var(--md-outlined-text-field-disabled-input-text-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-text-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-outlined-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-outlined-text-field-disabled-leading-icon-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-text-field-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-text-field-disabled-outline-opacity, 0.12);--_disabled-outline-width: var(--md-outlined-text-field-disabled-outline-width, 1px);--_disabled-supporting-text-color: var(--md-outlined-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-outlined-text-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-outlined-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-outlined-text-field-disabled-trailing-icon-opacity, 0.38);--_error-focus-caret-color: var(--md-outlined-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_error-focus-input-text-color: var(--md-outlined-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-label-text-color: var(--md-outlined-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-outlined-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-outline-color: var(--md-outlined-text-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_error-focus-supporting-text-color: var(--md-outlined-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-outlined-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-input-text-color: var(--md-outlined-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-outlined-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-outlined-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-outline-color: var(--md-outlined-text-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-supporting-text-color: var(--md-outlined-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-outlined-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-input-text-color: var(--md-outlined-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-label-text-color: var(--md-outlined-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-outlined-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-outline-color: var(--md-outlined-text-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_error-supporting-text-color: var(--md-outlined-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-outlined-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-input-text-color: var(--md-outlined-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-outlined-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-outlined-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-outline-color: var(--md-outlined-text-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-width: var(--md-outlined-text-field-focus-outline-width, 3px);--_focus-supporting-text-color: var(--md-outlined-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-outlined-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-input-text-color: var(--md-outlined-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-outlined-text-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-leading-icon-color: var(--md-outlined-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-outline-color: var(--md-outlined-text-field-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-outline-width: var(--md-outlined-text-field-hover-outline-width, 1px);--_hover-supporting-text-color: var(--md-outlined-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-outlined-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-color: var(--md-outlined-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_input-text-font: var(--md-outlined-text-field-input-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_input-text-line-height: var(--md-outlined-text-field-input-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_input-text-placeholder-color: var(--md-outlined-text-field-input-text-placeholder-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-prefix-color: var(--md-outlined-text-field-input-text-prefix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-size: var(--md-outlined-text-field-input-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_input-text-suffix-color: var(--md-outlined-text-field-input-text-suffix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-weight: var(--md-outlined-text-field-input-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_label-text-color: var(--md-outlined-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-outlined-text-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-outlined-text-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_label-text-populated-line-height: var(--md-outlined-text-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_label-text-populated-size: var(--md-outlined-text-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_label-text-size: var(--md-outlined-text-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_label-text-weight: var(--md-outlined-text-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_leading-icon-color: var(--md-outlined-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-outlined-text-field-leading-icon-size, 24px);--_outline-color: var(--md-outlined-text-field-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-text-field-outline-width, 1px);--_supporting-text-color: var(--md-outlined-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-outlined-text-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_supporting-text-line-height: var(--md-outlined-text-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_supporting-text-size: var(--md-outlined-text-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_supporting-text-weight: var(--md-outlined-text-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_trailing-icon-color: var(--md-outlined-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-outlined-text-field-trailing-icon-size, 24px);--_container-shape-start-start: var(--md-outlined-text-field-container-shape-start-start, var(--md-outlined-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-start-end: var(--md-outlined-text-field-container-shape-start-end, var(--md-outlined-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-end-end: var(--md-outlined-text-field-container-shape-end-end, var(--md-outlined-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-end-start: var(--md-outlined-text-field-container-shape-end-start, var(--md-outlined-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_icon-input-space: var(--md-outlined-text-field-icon-input-space, 16px);--_leading-space: var(--md-outlined-text-field-leading-space, 16px);--_trailing-space: var(--md-outlined-text-field-trailing-space, 16px);--_top-space: var(--md-outlined-text-field-top-space, 16px);--_bottom-space: var(--md-outlined-text-field-bottom-space, 16px);--_input-text-prefix-trailing-space: var(--md-outlined-text-field-input-text-prefix-trailing-space, 2px);--_input-text-suffix-leading-space: var(--md-outlined-text-field-input-text-suffix-leading-space, 2px);--_focus-caret-color: var(--md-outlined-text-field-focus-caret-color, var(--md-sys-color-primary, #6750a4));--_with-leading-icon-leading-space: var(--md-outlined-text-field-with-leading-icon-leading-space, 12px);--_with-trailing-icon-trailing-space: var(--md-outlined-text-field-with-trailing-icon-trailing-space, 12px);--md-outlined-field-bottom-space: var(--_bottom-space);--md-outlined-field-container-shape-end-end: var(--_container-shape-end-end);--md-outlined-field-container-shape-end-start: var(--_container-shape-end-start);--md-outlined-field-container-shape-start-end: var(--_container-shape-start-end);--md-outlined-field-container-shape-start-start: var(--_container-shape-start-start);--md-outlined-field-content-color: var(--_input-text-color);--md-outlined-field-content-font: var(--_input-text-font);--md-outlined-field-content-line-height: var(--_input-text-line-height);--md-outlined-field-content-size: var(--_input-text-size);--md-outlined-field-content-space: var(--_icon-input-space);--md-outlined-field-content-weight: var(--_input-text-weight);--md-outlined-field-disabled-content-color: var(--_disabled-input-text-color);--md-outlined-field-disabled-content-opacity: var(--_disabled-input-text-opacity);--md-outlined-field-disabled-label-text-color: var(--_disabled-label-text-color);--md-outlined-field-disabled-label-text-opacity: var(--_disabled-label-text-opacity);--md-outlined-field-disabled-leading-content-color: var(--_disabled-leading-icon-color);--md-outlined-field-disabled-leading-content-opacity: var(--_disabled-leading-icon-opacity);--md-outlined-field-disabled-outline-color: var(--_disabled-outline-color);--md-outlined-field-disabled-outline-opacity: var(--_disabled-outline-opacity);--md-outlined-field-disabled-outline-width: var(--_disabled-outline-width);--md-outlined-field-disabled-supporting-text-color: var(--_disabled-supporting-text-color);--md-outlined-field-disabled-supporting-text-opacity: var(--_disabled-supporting-text-opacity);--md-outlined-field-disabled-trailing-content-color: var(--_disabled-trailing-icon-color);--md-outlined-field-disabled-trailing-content-opacity: var(--_disabled-trailing-icon-opacity);--md-outlined-field-error-content-color: var(--_error-input-text-color);--md-outlined-field-error-focus-content-color: var(--_error-focus-input-text-color);--md-outlined-field-error-focus-label-text-color: var(--_error-focus-label-text-color);--md-outlined-field-error-focus-leading-content-color: var(--_error-focus-leading-icon-color);--md-outlined-field-error-focus-outline-color: var(--_error-focus-outline-color);--md-outlined-field-error-focus-supporting-text-color: var(--_error-focus-supporting-text-color);--md-outlined-field-error-focus-trailing-content-color: var(--_error-focus-trailing-icon-color);--md-outlined-field-error-hover-content-color: var(--_error-hover-input-text-color);--md-outlined-field-error-hover-label-text-color: var(--_error-hover-label-text-color);--md-outlined-field-error-hover-leading-content-color: var(--_error-hover-leading-icon-color);--md-outlined-field-error-hover-outline-color: var(--_error-hover-outline-color);--md-outlined-field-error-hover-supporting-text-color: var(--_error-hover-supporting-text-color);--md-outlined-field-error-hover-trailing-content-color: var(--_error-hover-trailing-icon-color);--md-outlined-field-error-label-text-color: var(--_error-label-text-color);--md-outlined-field-error-leading-content-color: var(--_error-leading-icon-color);--md-outlined-field-error-outline-color: var(--_error-outline-color);--md-outlined-field-error-supporting-text-color: var(--_error-supporting-text-color);--md-outlined-field-error-trailing-content-color: var(--_error-trailing-icon-color);--md-outlined-field-focus-content-color: var(--_focus-input-text-color);--md-outlined-field-focus-label-text-color: var(--_focus-label-text-color);--md-outlined-field-focus-leading-content-color: var(--_focus-leading-icon-color);--md-outlined-field-focus-outline-color: var(--_focus-outline-color);--md-outlined-field-focus-outline-width: var(--_focus-outline-width);--md-outlined-field-focus-supporting-text-color: var(--_focus-supporting-text-color);--md-outlined-field-focus-trailing-content-color: var(--_focus-trailing-icon-color);--md-outlined-field-hover-content-color: var(--_hover-input-text-color);--md-outlined-field-hover-label-text-color: var(--_hover-label-text-color);--md-outlined-field-hover-leading-content-color: var(--_hover-leading-icon-color);--md-outlined-field-hover-outline-color: var(--_hover-outline-color);--md-outlined-field-hover-outline-width: var(--_hover-outline-width);--md-outlined-field-hover-supporting-text-color: var(--_hover-supporting-text-color);--md-outlined-field-hover-trailing-content-color: var(--_hover-trailing-icon-color);--md-outlined-field-label-text-color: var(--_label-text-color);--md-outlined-field-label-text-font: var(--_label-text-font);--md-outlined-field-label-text-line-height: var(--_label-text-line-height);--md-outlined-field-label-text-populated-line-height: var(--_label-text-populated-line-height);--md-outlined-field-label-text-populated-size: var(--_label-text-populated-size);--md-outlined-field-label-text-size: var(--_label-text-size);--md-outlined-field-label-text-weight: var(--_label-text-weight);--md-outlined-field-leading-content-color: var(--_leading-icon-color);--md-outlined-field-leading-space: var(--_leading-space);--md-outlined-field-outline-color: var(--_outline-color);--md-outlined-field-outline-width: var(--_outline-width);--md-outlined-field-supporting-text-color: var(--_supporting-text-color);--md-outlined-field-supporting-text-font: var(--_supporting-text-font);--md-outlined-field-supporting-text-line-height: var(--_supporting-text-line-height);--md-outlined-field-supporting-text-size: var(--_supporting-text-size);--md-outlined-field-supporting-text-weight: var(--_supporting-text-weight);--md-outlined-field-top-space: var(--_top-space);--md-outlined-field-trailing-content-color: var(--_trailing-icon-color);--md-outlined-field-trailing-space: var(--_trailing-space);--md-outlined-field-with-leading-content-leading-space: var(--_with-leading-icon-leading-space);--md-outlined-field-with-trailing-content-trailing-space: var(--_with-trailing-icon-trailing-space)}
|
|
130
|
+
`;Ft.styleSheet;const Ut={},Bt=Ae(class extends ke{constructor(e){if(super(e),e.type!==Se&&e.type!==Ee&&e.type!==Te)throw Error("The `live` directive is not allowed on child or event bindings");if(!(e=>void 0===e.strings)(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===Z||t===K)return t;const o=e.element,i=e.name;if(e.type===Se){if(t===o[i])return Z}else if(e.type===Te){if(!!t===o.hasAttribute(i))return Z}else if(e.type===Ee&&o.getAttribute(i)===t+"")return Z;return((e,t=Ut)=>{e._$AH=t})(e),t}}),Mt="important",Vt=" !"+Mt,Ht=Ae(class extends ke{constructor(e){if(super(e),e.type!==Ee||"style"!==e.name||e.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(e){return Object.keys(e).reduce((t,o)=>{const i=e[o];return null==i?t:t+`${o=o.includes("-")?o:o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(e,[t]){const{style:o}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?o.removeProperty(e):o[e]=null);for(const e in t){const i=t[e];if(null!=i){this.ft.add(e);const t="string"==typeof i&&i.endsWith(Vt);e.includes("-")||t?o.setProperty(e,t?i.slice(0,-11):i,t?Mt:""):o[e]=i}}return Z}}),Wt={fromAttribute:e=>e??"",toAttribute:e=>e||null},jt=Symbol("createValidator"),Zt=Symbol("getValidityAnchor"),Kt=Symbol("privateValidator"),Gt=Symbol("privateSyncValidity"),Yt=Symbol("privateCustomValidationMessage");function Xt(e){var t;class o extends e{constructor(){super(...arguments),this[t]=""}get validity(){return this[Gt](),this[_t].validity}get validationMessage(){return this[Gt](),this[_t].validationMessage}get willValidate(){return this[Gt](),this[_t].willValidate}checkValidity(){return this[Gt](),this[_t].checkValidity()}reportValidity(){return this[Gt](),this[_t].reportValidity()}setCustomValidity(e){this[Yt]=e,this[Gt]()}requestUpdate(e,t,o){super.requestUpdate(e,t,o),this[Gt]()}firstUpdated(e){super.firstUpdated(e),this[Gt]()}[(t=Yt,Gt)](){this[Kt]||(this[Kt]=this[jt]());const{validity:e,validationMessage:t}=this[Kt].getValidity(),o=!!this[Yt],i=this[Yt]||t;this[_t].setValidity({...e,customError:o},i,this[Zt]()??void 0)}[jt](){throw new Error("Implement [createValidator]")}[Zt](){throw new Error("Implement [getValidityAnchor]")}}return o}const Jt=Symbol("onReportValidity"),Qt=Symbol("privateCleanupFormListeners"),eo=Symbol("privateDoNotReportInvalid"),to=Symbol("privateIsSelfReportingValidity"),oo=Symbol("privateCallOnReportValidity");function io(e){var t,o,i;class r extends e{constructor(...e){super(...e),this[t]=new AbortController,this[o]=!1,this[i]=!1,this.addEventListener("invalid",e=>{!this[eo]&&e.isTrusted&&this.addEventListener("invalid",()=>{this[oo](e)},{once:!0})},{capture:!0})}checkValidity(){this[eo]=!0;const e=super.checkValidity();return this[eo]=!1,e}reportValidity(){this[to]=!0;const e=super.reportValidity();return e&&this[oo](null),this[to]=!1,e}[(t=Qt,o=eo,i=to,oo)](e){const t=e?.defaultPrevented;if(t)return;this[Jt](e);!t&&e?.defaultPrevented&&(this[to]||function(e,t){if(!e)return!0;let o;for(const t of e.elements)if(t.matches(":invalid")){o=t;break}return o===t}(this[_t].form,this))&&this.focus()}[Jt](e){throw new Error("Implement [onReportValidity]")}formAssociatedCallback(e){super.formAssociatedCallback&&super.formAssociatedCallback(e),this[Qt].abort(),e&&(this[Qt]=new AbortController,function(e,t,o,i){const r=function(e){if(!ro.has(e)){const t=new EventTarget;ro.set(e,t);for(const o of["reportValidity","requestSubmit"]){const i=e[o];e[o]=function(){t.dispatchEvent(new Event("before"));const e=Reflect.apply(i,this,arguments);return t.dispatchEvent(new Event("after")),e}}}return ro.get(e)}(t);let n,s=!1,a=!1;r.addEventListener("before",()=>{a=!0,n=new AbortController,s=!1,e.addEventListener("invalid",()=>{s=!0},{signal:n.signal})},{signal:i}),r.addEventListener("after",()=>{a=!1,n?.abort(),s||o()},{signal:i}),t.addEventListener("submit",()=>{a||o()},{signal:i})}(this,e,()=>{this[oo](null)},this[Qt].signal))}}return r}const ro=new WeakMap;class no{constructor(e){this.getCurrentState=e,this.currentValidity={validity:{},validationMessage:""}}getValidity(){const e=this.getCurrentState();if(!(!this.prevState||!this.equals(this.prevState,e)))return this.currentValidity;const{validity:t,validationMessage:o}=this.computeValidity(e);return this.prevState=this.copy(e),this.currentValidity={validationMessage:o,validity:{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing}},this.currentValidity}}class so extends no{computeValidity({state:e,renderedControl:t}){let o=t;ao(e)&&!o?(o=this.inputControl||document.createElement("input"),this.inputControl=o):o||(o=this.textAreaControl||document.createElement("textarea"),this.textAreaControl=o);const i=ao(e)?o:null;if(i&&(i.type=e.type),o.value!==e.value&&(o.value=e.value),o.required=e.required,i){const t=e;t.pattern?i.pattern=t.pattern:i.removeAttribute("pattern"),t.min?i.min=t.min:i.removeAttribute("min"),t.max?i.max=t.max:i.removeAttribute("max"),t.step?i.step=t.step:i.removeAttribute("step")}return(e.minLength??-1)>-1?o.setAttribute("minlength",String(e.minLength)):o.removeAttribute("minlength"),(e.maxLength??-1)>-1?o.setAttribute("maxlength",String(e.maxLength)):o.removeAttribute("maxlength"),{validity:o.validity,validationMessage:o.validationMessage}}equals({state:e},{state:t}){const o=e.type===t.type&&e.value===t.value&&e.required===t.required&&e.minLength===t.minLength&&e.maxLength===t.maxLength;return ao(e)&&ao(t)?o&&e.pattern===t.pattern&&e.min===t.min&&e.max===t.max&&e.step===t.step:o}copy({state:e}){return{state:ao(e)?this.copyInput(e):this.copyTextArea(e),renderedControl:null}}copyInput(e){const{type:t,pattern:o,min:i,max:r,step:n}=e;return{...this.copySharedState(e),type:t,pattern:o,min:i,max:r,step:n}}copyTextArea(e){return{...this.copySharedState(e),type:e.type}}copySharedState({value:e,required:t,minLength:o,maxLength:i}){return{value:e,required:t,minLength:o,maxLength:i}}}function ao(e){return"textarea"!==e.type}const lo=Le(io(Xt(St(Ct(he)))));class co extends lo{constructor(){super(...arguments),this.error=!1,this.errorText="",this.label="",this.noAsterisk=!1,this.required=!1,this.value="",this.prefixText="",this.suffixText="",this.hasLeadingIcon=!1,this.hasTrailingIcon=!1,this.supportingText="",this.textDirection="",this.rows=2,this.cols=20,this.inputMode="",this.max="",this.maxLength=-1,this.min="",this.minLength=-1,this.noSpinner=!1,this.pattern="",this.placeholder="",this.readOnly=!1,this.multiple=!1,this.step="",this.type="text",this.autocomplete="",this.dirty=!1,this.focused=!1,this.nativeError=!1,this.nativeErrorText=""}get selectionDirection(){return this.getInputOrTextarea().selectionDirection}set selectionDirection(e){this.getInputOrTextarea().selectionDirection=e}get selectionEnd(){return this.getInputOrTextarea().selectionEnd}set selectionEnd(e){this.getInputOrTextarea().selectionEnd=e}get selectionStart(){return this.getInputOrTextarea().selectionStart}set selectionStart(e){this.getInputOrTextarea().selectionStart=e}get valueAsNumber(){const e=this.getInput();return e?e.valueAsNumber:NaN}set valueAsNumber(e){const t=this.getInput();t&&(t.valueAsNumber=e,this.value=t.value)}get valueAsDate(){const e=this.getInput();return e?e.valueAsDate:null}set valueAsDate(e){const t=this.getInput();t&&(t.valueAsDate=e,this.value=t.value)}get hasError(){return this.error||this.nativeError}select(){this.getInputOrTextarea().select()}setRangeText(...e){this.getInputOrTextarea().setRangeText(...e),this.value=this.getInputOrTextarea().value}setSelectionRange(e,t,o){this.getInputOrTextarea().setSelectionRange(e,t,o)}showPicker(){const e=this.getInput();e&&e.showPicker()}stepDown(e){const t=this.getInput();t&&(t.stepDown(e),this.value=t.value)}stepUp(e){const t=this.getInput();t&&(t.stepUp(e),this.value=t.value)}reset(){this.dirty=!1,this.value=this.getAttribute("value")??"",this.nativeError=!1,this.nativeErrorText=""}attributeChangedCallback(e,t,o){"value"===e&&this.dirty||super.attributeChangedCallback(e,t,o)}render(){const e={disabled:this.disabled,error:!this.disabled&&this.hasError,textarea:"textarea"===this.type,"no-spinner":this.noSpinner};return W`
|
|
131
|
+
<span class="text-field ${Ie(e)}">
|
|
132
|
+
${this.renderField()}
|
|
133
|
+
</span>
|
|
134
|
+
`}updated(e){const t=this.getInputOrTextarea().value;this.value!==t&&(this.value=t)}renderField(){return mt`<${this.fieldTag}
|
|
135
|
+
class="field"
|
|
136
|
+
count=${this.value.length}
|
|
137
|
+
?disabled=${this.disabled}
|
|
138
|
+
?error=${this.hasError}
|
|
139
|
+
error-text=${this.getErrorText()}
|
|
140
|
+
?focused=${this.focused}
|
|
141
|
+
?has-end=${this.hasTrailingIcon}
|
|
142
|
+
?has-start=${this.hasLeadingIcon}
|
|
143
|
+
label=${this.label}
|
|
144
|
+
?no-asterisk=${this.noAsterisk}
|
|
145
|
+
max=${this.maxLength}
|
|
146
|
+
?populated=${!!this.value}
|
|
147
|
+
?required=${this.required}
|
|
148
|
+
?resizable=${"textarea"===this.type}
|
|
149
|
+
supporting-text=${this.supportingText}
|
|
150
|
+
>
|
|
151
|
+
${this.renderLeadingIcon()}
|
|
152
|
+
${this.renderInputOrTextarea()}
|
|
153
|
+
${this.renderTrailingIcon()}
|
|
154
|
+
<div id="description" slot="aria-describedby"></div>
|
|
155
|
+
<slot name="container" slot="container"></slot>
|
|
156
|
+
</${this.fieldTag}>`}renderLeadingIcon(){return W`
|
|
157
|
+
<span class="icon leading" slot="start">
|
|
158
|
+
<slot name="leading-icon" @slotchange=${this.handleIconChange}></slot>
|
|
159
|
+
</span>
|
|
160
|
+
`}renderTrailingIcon(){return W`
|
|
161
|
+
<span class="icon trailing" slot="end">
|
|
162
|
+
<slot name="trailing-icon" @slotchange=${this.handleIconChange}></slot>
|
|
163
|
+
</span>
|
|
164
|
+
`}renderInputOrTextarea(){const e={direction:this.textDirection},t=this.ariaLabel||this.label||K,o=this.autocomplete,i=(this.maxLength??-1)>-1,r=(this.minLength??-1)>-1;if("textarea"===this.type)return W`
|
|
165
|
+
<textarea
|
|
166
|
+
class="input"
|
|
167
|
+
style=${Ht(e)}
|
|
168
|
+
aria-describedby="description"
|
|
169
|
+
aria-invalid=${this.hasError}
|
|
170
|
+
aria-label=${t}
|
|
171
|
+
autocomplete=${o||K}
|
|
172
|
+
name=${this.name||K}
|
|
173
|
+
?disabled=${this.disabled}
|
|
174
|
+
maxlength=${i?this.maxLength:K}
|
|
175
|
+
minlength=${r?this.minLength:K}
|
|
176
|
+
placeholder=${this.placeholder||K}
|
|
177
|
+
?readonly=${this.readOnly}
|
|
178
|
+
?required=${this.required}
|
|
179
|
+
rows=${this.rows}
|
|
180
|
+
cols=${this.cols}
|
|
181
|
+
.value=${Bt(this.value)}
|
|
182
|
+
@change=${this.redispatchEvent}
|
|
183
|
+
@focus=${this.handleFocusChange}
|
|
184
|
+
@blur=${this.handleFocusChange}
|
|
185
|
+
@input=${this.handleInput}
|
|
186
|
+
@select=${this.redispatchEvent}></textarea>
|
|
187
|
+
`;const n=this.renderPrefix(),s=this.renderSuffix(),a=this.inputMode;return W`
|
|
188
|
+
<div class="input-wrapper">
|
|
189
|
+
${n}
|
|
190
|
+
<input
|
|
191
|
+
class="input"
|
|
192
|
+
style=${Ht(e)}
|
|
193
|
+
aria-describedby="description"
|
|
194
|
+
aria-invalid=${this.hasError}
|
|
195
|
+
aria-label=${t}
|
|
196
|
+
autocomplete=${o||K}
|
|
197
|
+
name=${this.name||K}
|
|
198
|
+
?disabled=${this.disabled}
|
|
199
|
+
inputmode=${a||K}
|
|
200
|
+
max=${this.max||K}
|
|
201
|
+
maxlength=${i?this.maxLength:K}
|
|
202
|
+
min=${this.min||K}
|
|
203
|
+
minlength=${r?this.minLength:K}
|
|
204
|
+
pattern=${this.pattern||K}
|
|
205
|
+
placeholder=${this.placeholder||K}
|
|
206
|
+
?readonly=${this.readOnly}
|
|
207
|
+
?required=${this.required}
|
|
208
|
+
?multiple=${this.multiple}
|
|
209
|
+
step=${this.step||K}
|
|
210
|
+
type=${this.type}
|
|
211
|
+
.value=${Bt(this.value)}
|
|
212
|
+
@change=${this.redispatchEvent}
|
|
213
|
+
@focus=${this.handleFocusChange}
|
|
214
|
+
@blur=${this.handleFocusChange}
|
|
215
|
+
@input=${this.handleInput}
|
|
216
|
+
@select=${this.redispatchEvent} />
|
|
217
|
+
${s}
|
|
218
|
+
</div>
|
|
219
|
+
`}renderPrefix(){return this.renderAffix(this.prefixText,!1)}renderSuffix(){return this.renderAffix(this.suffixText,!0)}renderAffix(e,t){if(!e)return K;return W`<span class="${Ie({suffix:t,prefix:!t})}">${e}</span>`}getErrorText(){return this.error?this.errorText:this.nativeErrorText}handleFocusChange(){this.focused=this.inputOrTextarea?.matches(":focus")??!1}handleInput(e){this.dirty=!0,this.value=e.target.value}redispatchEvent(e){Fe(this,e)}getInputOrTextarea(){return this.inputOrTextarea||(this.connectedCallback(),this.scheduleUpdate()),this.isUpdatePending&&this.scheduleUpdate(),this.inputOrTextarea}getInput(){return"textarea"===this.type?null:this.getInputOrTextarea()}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0,this.hasTrailingIcon=this.trailingIcons.length>0}[$t](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(e){this.value=e}focus(){this.getInputOrTextarea().focus()}[jt](){return new so(()=>({state:this,renderedControl:this.inputOrTextarea}))}[Zt](){return this.inputOrTextarea}[Jt](e){e?.preventDefault();const t=this.getErrorText();this.nativeError=!!e,this.nativeErrorText=this.validationMessage,t===this.getErrorText()&&this.field?.reannounceError()}}co.shadowRootOptions={...he.shadowRootOptions,delegatesFocus:!0},t([fe({type:Boolean,reflect:!0})],co.prototype,"error",void 0),t([fe({attribute:"error-text"})],co.prototype,"errorText",void 0),t([fe()],co.prototype,"label",void 0),t([fe({type:Boolean,attribute:"no-asterisk"})],co.prototype,"noAsterisk",void 0),t([fe({type:Boolean,reflect:!0})],co.prototype,"required",void 0),t([fe()],co.prototype,"value",void 0),t([fe({attribute:"prefix-text"})],co.prototype,"prefixText",void 0),t([fe({attribute:"suffix-text"})],co.prototype,"suffixText",void 0),t([fe({type:Boolean,attribute:"has-leading-icon"})],co.prototype,"hasLeadingIcon",void 0),t([fe({type:Boolean,attribute:"has-trailing-icon"})],co.prototype,"hasTrailingIcon",void 0),t([fe({attribute:"supporting-text"})],co.prototype,"supportingText",void 0),t([fe({attribute:"text-direction"})],co.prototype,"textDirection",void 0),t([fe({type:Number})],co.prototype,"rows",void 0),t([fe({type:Number})],co.prototype,"cols",void 0),t([fe({reflect:!0})],co.prototype,"inputMode",void 0),t([fe()],co.prototype,"max",void 0),t([fe({type:Number})],co.prototype,"maxLength",void 0),t([fe()],co.prototype,"min",void 0),t([fe({type:Number})],co.prototype,"minLength",void 0),t([fe({type:Boolean,attribute:"no-spinner"})],co.prototype,"noSpinner",void 0),t([fe()],co.prototype,"pattern",void 0),t([fe({reflect:!0,converter:Wt})],co.prototype,"placeholder",void 0),t([fe({type:Boolean,reflect:!0})],co.prototype,"readOnly",void 0),t([fe({type:Boolean,reflect:!0})],co.prototype,"multiple",void 0),t([fe()],co.prototype,"step",void 0),t([fe({reflect:!0})],co.prototype,"type",void 0),t([fe({reflect:!0})],co.prototype,"autocomplete",void 0),t([ge()],co.prototype,"dirty",void 0),t([ge()],co.prototype,"focused",void 0),t([ge()],co.prototype,"nativeError",void 0),t([ge()],co.prototype,"nativeErrorText",void 0),t([ye(".input")],co.prototype,"inputOrTextarea",void 0),t([ye(".field")],co.prototype,"field",void 0),t([_e({slot:"leading-icon"})],co.prototype,"leadingIcons",void 0),t([_e({slot:"trailing-icon"})],co.prototype,"trailingIcons",void 0);class ho extends co{constructor(){super(...arguments),this.fieldTag=ut`md-outlined-field`}}const po=a`:host{display:inline-flex;outline:none;resize:both;text-align:start;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}slot[name=container]{border-radius:inherit}.icon{color:currentColor;display:flex;align-items:center;justify-content:center;fill:currentColor;position:relative}.icon ::slotted(*){display:flex;position:absolute}[has-start] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[has-end] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}.no-spinner .input::-webkit-inner-spin-button,.no-spinner .input::-webkit-outer-spin-button{display:none}.no-spinner .input[type=number]{-moz-appearance:textfield}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}
|
|
220
|
+
`;po.styleSheet;let uo=class extends ho{constructor(){super(...arguments),this.fieldTag=ut`md-outlined-field`}};function vo(e){return e.currentTarget===e.target&&(e.composedPath()[0]===e.target&&(!e.target.disabled&&!function(e){const t=mo;t&&(e.preventDefault(),e.stopImmediatePropagation());return async function(){mo=!0,await null,mo=!1}(),t}(e)))}uo.styles=[po,Ft],uo=t([ue("md-outlined-text-field")],uo);let mo=!1;const fo=Le(Tt(St(Ct(he))));class go extends fo{constructor(){super(),this.softDisabled=!1,this.href="",this.download="",this.target="",this.trailingIcon=!1,this.hasIcon=!1,this.addEventListener("click",this.handleClick.bind(this))}focus(){this.buttonElement?.focus()}blur(){this.buttonElement?.blur()}render(){const e=this.disabled||this.softDisabled,t=this.href?this.renderLink():this.renderButton(),o=this.href?"link":"button";return W`
|
|
221
|
+
${this.renderElevationOrOutline?.()}
|
|
222
|
+
<div class="background"></div>
|
|
223
|
+
<md-focus-ring part="focus-ring" for=${o}></md-focus-ring>
|
|
224
|
+
<md-ripple
|
|
225
|
+
part="ripple"
|
|
226
|
+
for=${o}
|
|
227
|
+
?disabled="${e}"></md-ripple>
|
|
228
|
+
${t}
|
|
229
|
+
`}renderButton(){const{ariaLabel:e,ariaHasPopup:t,ariaExpanded:o}=this;return W`<button
|
|
230
|
+
id="button"
|
|
231
|
+
class="button"
|
|
232
|
+
?disabled=${this.disabled}
|
|
233
|
+
aria-disabled=${this.softDisabled||K}
|
|
234
|
+
aria-label="${e||K}"
|
|
235
|
+
aria-haspopup="${t||K}"
|
|
236
|
+
aria-expanded="${o||K}">
|
|
237
|
+
${this.renderContent()}
|
|
238
|
+
</button>`}renderLink(){const{ariaLabel:e,ariaHasPopup:t,ariaExpanded:o}=this;return W`<a
|
|
239
|
+
id="link"
|
|
240
|
+
class="button"
|
|
241
|
+
aria-label="${e||K}"
|
|
242
|
+
aria-haspopup="${t||K}"
|
|
243
|
+
aria-expanded="${o||K}"
|
|
244
|
+
aria-disabled=${this.disabled||this.softDisabled||K}
|
|
245
|
+
tabindex="${this.disabled&&!this.softDisabled?-1:K}"
|
|
246
|
+
href=${this.href}
|
|
247
|
+
download=${this.download||K}
|
|
248
|
+
target=${this.target||K}
|
|
249
|
+
>${this.renderContent()}
|
|
250
|
+
</a>`}renderContent(){const e=W`<slot
|
|
251
|
+
name="icon"
|
|
252
|
+
@slotchange="${this.handleSlotChange}"></slot>`;return W`
|
|
253
|
+
<span class="touch"></span>
|
|
254
|
+
${this.trailingIcon?K:e}
|
|
255
|
+
<span class="label"><slot></slot></span>
|
|
256
|
+
${this.trailingIcon?e:K}
|
|
257
|
+
`}handleClick(e){if(this.softDisabled||this.disabled&&this.href)return e.stopImmediatePropagation(),void e.preventDefault();vo(e)&&this.buttonElement&&(this.focus(),function(e){const t=new MouseEvent("click",{bubbles:!0});e.dispatchEvent(t)}(this.buttonElement))}handleSlotChange(){this.hasIcon=this.assignedIcons.length>0}}go.shadowRootOptions={mode:"open",delegatesFocus:!0},t([fe({type:Boolean,attribute:"soft-disabled",reflect:!0})],go.prototype,"softDisabled",void 0),t([fe()],go.prototype,"href",void 0),t([fe()],go.prototype,"download",void 0),t([fe()],go.prototype,"target",void 0),t([fe({type:Boolean,attribute:"trailing-icon",reflect:!0})],go.prototype,"trailingIcon",void 0),t([fe({type:Boolean,attribute:"has-icon",reflect:!0})],go.prototype,"hasIcon",void 0),t([ye(".button")],go.prototype,"buttonElement",void 0),t([_e({slot:"icon",flatten:!0})],go.prototype,"assignedIcons",void 0);class bo extends go{renderElevationOrOutline(){return W`<div class="outline"></div>`}}const yo=a`:host{--_container-height: var(--md-outlined-button-container-height, 40px);--_disabled-label-text-color: var(--md-outlined-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-button-disabled-label-text-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-button-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-button-disabled-outline-opacity, 0.12);--_focus-label-text-color: var(--md-outlined-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-label-text-color: var(--md-outlined-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-outlined-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-outlined-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-outlined-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-outlined-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-outlined-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-outlined-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-outlined-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_outline-color: var(--md-outlined-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-button-outline-width, 1px);--_pressed-label-text-color: var(--md-outlined-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-outline-color: var(--md-outlined-button-pressed-outline-color, var(--md-sys-color-outline, #79747e));--_pressed-state-layer-color: var(--md-outlined-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-outlined-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-outlined-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-outlined-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-outlined-button-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-icon-color: var(--md-outlined-button-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-color: var(--md-outlined-button-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-outlined-button-icon-size, 18px);--_pressed-icon-color: var(--md-outlined-button-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_container-shape-start-start: var(--md-outlined-button-container-shape-start-start, var(--md-outlined-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-outlined-button-container-shape-start-end, var(--md-outlined-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-outlined-button-container-shape-end-end, var(--md-outlined-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-outlined-button-container-shape-end-start, var(--md-outlined-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_leading-space: var(--md-outlined-button-leading-space, 24px);--_trailing-space: var(--md-outlined-button-trailing-space, 24px);--_with-leading-icon-leading-space: var(--md-outlined-button-with-leading-icon-leading-space, 16px);--_with-leading-icon-trailing-space: var(--md-outlined-button-with-leading-icon-trailing-space, 24px);--_with-trailing-icon-leading-space: var(--md-outlined-button-with-trailing-icon-leading-space, 24px);--_with-trailing-icon-trailing-space: var(--md-outlined-button-with-trailing-icon-trailing-space, 16px);--_container-color: none;--_disabled-container-color: none;--_disabled-container-opacity: 0}.outline{inset:0;border-style:solid;position:absolute;box-sizing:border-box;border-color:var(--_outline-color);border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}:host(:active) .outline{border-color:var(--_pressed-outline-color)}:host(:is([disabled],[soft-disabled])) .outline{border-color:var(--_disabled-outline-color);opacity:var(--_disabled-outline-opacity)}@media(forced-colors: active){:host(:is([disabled],[soft-disabled])) .background{border-color:GrayText}:host(:is([disabled],[soft-disabled])) .outline{opacity:1}}.outline,md-ripple{border-width:var(--_outline-width)}md-ripple{inline-size:calc(100% - 2*var(--_outline-width));block-size:calc(100% - 2*var(--_outline-width));border-style:solid;border-color:rgba(0,0,0,0)}
|
|
258
|
+
`;yo.styleSheet;const xo=a`:host{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end);box-sizing:border-box;cursor:pointer;display:inline-flex;gap:8px;min-height:var(--_container-height);outline:none;padding-block:calc((var(--_container-height) - max(var(--_label-text-line-height),var(--_icon-size)))/2);padding-inline-start:var(--_leading-space);padding-inline-end:var(--_trailing-space);place-content:center;place-items:center;position:relative;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);text-overflow:ellipsis;text-wrap:nowrap;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);vertical-align:top;--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host(:is([disabled],[soft-disabled])){cursor:default;pointer-events:none}.button{border-radius:inherit;cursor:inherit;display:inline-flex;align-items:center;justify-content:center;border:none;outline:none;-webkit-appearance:none;vertical-align:middle;background:rgba(0,0,0,0);text-decoration:none;min-width:calc(64px - var(--_leading-space) - var(--_trailing-space));width:100%;z-index:0;height:100%;font:inherit;color:var(--_label-text-color);padding:0;gap:inherit;text-transform:inherit}.button::-moz-focus-inner{padding:0;border:0}:host(:hover) .button{color:var(--_hover-label-text-color)}:host(:focus-within) .button{color:var(--_focus-label-text-color)}:host(:active) .button{color:var(--_pressed-label-text-color)}.background{background:var(--_container-color);border-radius:inherit;inset:0;position:absolute}.label{overflow:hidden}:is(.button,.label,.label slot),.label ::slotted(*){text-overflow:inherit}:host(:is([disabled],[soft-disabled])) .label{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}:host(:is([disabled],[soft-disabled])) .background{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}@media(forced-colors: active){.background{border:1px solid CanvasText}:host(:is([disabled],[soft-disabled])){--_disabled-icon-color: GrayText;--_disabled-icon-opacity: 1;--_disabled-container-opacity: 1;--_disabled-label-text-color: GrayText;--_disabled-label-text-opacity: 1}}:host([has-icon]:not([trailing-icon])){padding-inline-start:var(--_with-leading-icon-leading-space);padding-inline-end:var(--_with-leading-icon-trailing-space)}:host([has-icon][trailing-icon]){padding-inline-start:var(--_with-trailing-icon-leading-space);padding-inline-end:var(--_with-trailing-icon-trailing-space)}::slotted([slot=icon]){display:inline-flex;position:relative;writing-mode:horizontal-tb;fill:currentColor;flex-shrink:0;color:var(--_icon-color);font-size:var(--_icon-size);inline-size:var(--_icon-size);block-size:var(--_icon-size)}:host(:hover) ::slotted([slot=icon]){color:var(--_hover-icon-color)}:host(:focus-within) ::slotted([slot=icon]){color:var(--_focus-icon-color)}:host(:active) ::slotted([slot=icon]){color:var(--_pressed-icon-color)}:host(:is([disabled],[soft-disabled])) ::slotted([slot=icon]){color:var(--_disabled-icon-color);opacity:var(--_disabled-icon-opacity)}.touch{position:absolute;top:50%;height:max(48px,100%);left:0;right:0;transform:translateY(-50%)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) 0}:host([touch-target=none]) .touch{display:none}
|
|
259
|
+
`;xo.styleSheet;let _o=class extends bo{};_o.styles=[xo,yo],_o=t([ue("md-outlined-button")],_o);class wo extends he{connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){return W`<span class="shadow"></span>`}}const Co=a`:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-property:inherit;transition-timing-function:inherit}:host{display:flex;pointer-events:none;transition-property:box-shadow,opacity}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity;--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000))}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);opacity:.15}
|
|
260
|
+
`;Co.styleSheet;let $o=class extends wo{};$o.styles=[Co],$o=t([ue("md-elevation")],$o);class Eo extends go{renderElevationOrOutline(){return W`<md-elevation part="elevation"></md-elevation>`}}const So=a`:host{--_container-color: var(--md-filled-button-container-color, var(--md-sys-color-primary, #6750a4));--_container-elevation: var(--md-filled-button-container-elevation, 0);--_container-height: var(--md-filled-button-container-height, 40px);--_container-shadow-color: var(--md-filled-button-container-shadow-color, var(--md-sys-color-shadow, #000));--_disabled-container-color: var(--md-filled-button-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-elevation: var(--md-filled-button-disabled-container-elevation, 0);--_disabled-container-opacity: var(--md-filled-button-disabled-container-opacity, 0.12);--_disabled-label-text-color: var(--md-filled-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-button-disabled-label-text-opacity, 0.38);--_focus-container-elevation: var(--md-filled-button-focus-container-elevation, 0);--_focus-label-text-color: var(--md-filled-button-focus-label-text-color, var(--md-sys-color-on-primary, #fff));--_hover-container-elevation: var(--md-filled-button-hover-container-elevation, 1);--_hover-label-text-color: var(--md-filled-button-hover-label-text-color, var(--md-sys-color-on-primary, #fff));--_hover-state-layer-color: var(--md-filled-button-hover-state-layer-color, var(--md-sys-color-on-primary, #fff));--_hover-state-layer-opacity: var(--md-filled-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-filled-button-label-text-color, var(--md-sys-color-on-primary, #fff));--_label-text-font: var(--md-filled-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-filled-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-filled-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-filled-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-container-elevation: var(--md-filled-button-pressed-container-elevation, 0);--_pressed-label-text-color: var(--md-filled-button-pressed-label-text-color, var(--md-sys-color-on-primary, #fff));--_pressed-state-layer-color: var(--md-filled-button-pressed-state-layer-color, var(--md-sys-color-on-primary, #fff));--_pressed-state-layer-opacity: var(--md-filled-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-filled-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-filled-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-filled-button-focus-icon-color, var(--md-sys-color-on-primary, #fff));--_hover-icon-color: var(--md-filled-button-hover-icon-color, var(--md-sys-color-on-primary, #fff));--_icon-color: var(--md-filled-button-icon-color, var(--md-sys-color-on-primary, #fff));--_icon-size: var(--md-filled-button-icon-size, 18px);--_pressed-icon-color: var(--md-filled-button-pressed-icon-color, var(--md-sys-color-on-primary, #fff));--_container-shape-start-start: var(--md-filled-button-container-shape-start-start, var(--md-filled-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-filled-button-container-shape-start-end, var(--md-filled-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-filled-button-container-shape-end-end, var(--md-filled-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-filled-button-container-shape-end-start, var(--md-filled-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_leading-space: var(--md-filled-button-leading-space, 24px);--_trailing-space: var(--md-filled-button-trailing-space, 24px);--_with-leading-icon-leading-space: var(--md-filled-button-with-leading-icon-leading-space, 16px);--_with-leading-icon-trailing-space: var(--md-filled-button-with-leading-icon-trailing-space, 24px);--_with-trailing-icon-leading-space: var(--md-filled-button-with-trailing-icon-leading-space, 24px);--_with-trailing-icon-trailing-space: var(--md-filled-button-with-trailing-icon-trailing-space, 16px)}
|
|
261
|
+
`;So.styleSheet;const To=a`md-elevation{transition-duration:280ms}:host(:is([disabled],[soft-disabled])) md-elevation{transition:none}md-elevation{--md-elevation-level: var(--_container-elevation);--md-elevation-shadow-color: var(--_container-shadow-color)}:host(:focus-within) md-elevation{--md-elevation-level: var(--_focus-container-elevation)}:host(:hover) md-elevation{--md-elevation-level: var(--_hover-container-elevation)}:host(:active) md-elevation{--md-elevation-level: var(--_pressed-container-elevation)}:host(:is([disabled],[soft-disabled])) md-elevation{--md-elevation-level: var(--_disabled-container-elevation)}
|
|
262
|
+
`;To.styleSheet;let Ao=class extends Eo{};Ao.styles=[xo,To,So],Ao=t([ue("md-filled-button")],Ao);const ko=Le(he);class Io extends ko{constructor(){super(...arguments),this.value=0,this.max=1,this.indeterminate=!1,this.fourColor=!1}render(){const{ariaLabel:e}=this;return W`
|
|
263
|
+
<div
|
|
264
|
+
class="progress ${Ie(this.getRenderClasses())}"
|
|
265
|
+
role="progressbar"
|
|
266
|
+
aria-label="${e||K}"
|
|
267
|
+
aria-valuemin="0"
|
|
268
|
+
aria-valuemax=${this.max}
|
|
269
|
+
aria-valuenow=${this.indeterminate?K:this.value}
|
|
270
|
+
>${this.renderIndicator()}</div
|
|
271
|
+
>
|
|
272
|
+
`}getRenderClasses(){return{indeterminate:this.indeterminate,"four-color":this.fourColor}}}t([fe({type:Number})],Io.prototype,"value",void 0),t([fe({type:Number})],Io.prototype,"max",void 0),t([fe({type:Boolean})],Io.prototype,"indeterminate",void 0),t([fe({type:Boolean,attribute:"four-color"})],Io.prototype,"fourColor",void 0);class Ro extends Io{renderIndicator(){return this.indeterminate?this.renderIndeterminateContainer():this.renderDeterminateContainer()}renderDeterminateContainer(){const e=100*(1-this.value/this.max);return W`
|
|
273
|
+
<svg viewBox="0 0 4800 4800">
|
|
274
|
+
<circle class="track" pathLength="100"></circle>
|
|
275
|
+
<circle
|
|
276
|
+
class="active-track"
|
|
277
|
+
pathLength="100"
|
|
278
|
+
stroke-dashoffset=${e}></circle>
|
|
279
|
+
</svg>
|
|
280
|
+
`}renderIndeterminateContainer(){return W` <div class="spinner">
|
|
281
|
+
<div class="left">
|
|
282
|
+
<div class="circle"></div>
|
|
283
|
+
</div>
|
|
284
|
+
<div class="right">
|
|
285
|
+
<div class="circle"></div>
|
|
286
|
+
</div>
|
|
287
|
+
</div>`}}const Po=a`:host{--_active-indicator-color: var(--md-circular-progress-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-width: var(--md-circular-progress-active-indicator-width, 10);--_four-color-active-indicator-four-color: var(--md-circular-progress-four-color-active-indicator-four-color, var(--md-sys-color-tertiary-container, #ffd8e4));--_four-color-active-indicator-one-color: var(--md-circular-progress-four-color-active-indicator-one-color, var(--md-sys-color-primary, #6750a4));--_four-color-active-indicator-three-color: var(--md-circular-progress-four-color-active-indicator-three-color, var(--md-sys-color-tertiary, #7d5260));--_four-color-active-indicator-two-color: var(--md-circular-progress-four-color-active-indicator-two-color, var(--md-sys-color-primary-container, #eaddff));--_size: var(--md-circular-progress-size, 48px);display:inline-flex;vertical-align:middle;width:var(--_size);height:var(--_size);position:relative;align-items:center;justify-content:center;contain:strict;content-visibility:auto}.progress{flex:1;align-self:stretch;margin:4px}.progress,.spinner,.left,.right,.circle,svg,.track,.active-track{position:absolute;inset:0}svg{transform:rotate(-90deg)}circle{cx:50%;cy:50%;r:calc(50%*(1 - var(--_active-indicator-width)/100));stroke-width:calc(var(--_active-indicator-width)*1%);stroke-dasharray:100;fill:rgba(0,0,0,0)}.active-track{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1);stroke:var(--_active-indicator-color)}.track{stroke:rgba(0,0,0,0)}.progress.indeterminate{animation:linear infinite linear-rotate;animation-duration:1568.2352941176ms}.spinner{animation:infinite both rotate-arc;animation-duration:5332ms;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.left{overflow:hidden;inset:0 50% 0 0}.right{overflow:hidden;inset:0 0 0 50%}.circle{box-sizing:border-box;border-radius:50%;border:solid calc(var(--_active-indicator-width)/100*(var(--_size) - 8px));border-color:var(--_active-indicator-color) var(--_active-indicator-color) rgba(0,0,0,0) rgba(0,0,0,0);animation:expand-arc;animation-iteration-count:infinite;animation-fill-mode:both;animation-duration:1333ms,5332ms;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.four-color .circle{animation-name:expand-arc,four-color}.left .circle{rotate:135deg;inset:0 -100% 0 0}.right .circle{rotate:100deg;inset:0 0 0 -100%;animation-delay:-666.5ms,0ms}@media(forced-colors: active){.active-track{stroke:CanvasText}.circle{border-color:CanvasText CanvasText Canvas Canvas}}@keyframes expand-arc{0%{transform:rotate(265deg)}50%{transform:rotate(130deg)}100%{transform:rotate(265deg)}}@keyframes rotate-arc{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes linear-rotate{to{transform:rotate(360deg)}}@keyframes four-color{0%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}15%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}25%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}40%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}50%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}65%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}75%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}90%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}100%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}}
|
|
288
|
+
`;Po.styleSheet;let Oo=class extends Ro{};function zo(e,t=Bo){const o=Do(e,t);return o&&(o.tabIndex=0,o.focus()),o}function qo(e,t=Bo){const o=No(e,t);return o&&(o.tabIndex=0,o.focus()),o}function Lo(e,t=Bo){for(let o=0;o<e.length;o++){const i=e[o];if(0===i.tabIndex&&t(i))return{item:i,index:o}}return null}function Do(e,t=Bo){for(const o of e)if(t(o))return o;return null}function No(e,t=Bo){for(let o=e.length-1;o>=0;o--){const i=e[o];if(t(i))return i}return null}function Fo(e,t,o=Bo,i=!0){if(t){const r=function(e,t,o=Bo,i=!0){for(let r=1;r<e.length;r++){const n=(r+t)%e.length;if(n<t&&!i)return null;const s=e[n];if(o(s))return s}return e[t]?e[t]:null}(e,t.index,o,i);return r&&(r.tabIndex=0,r.focus()),r}return zo(e,o)}function Uo(e,t,o=Bo,i=!0){if(t){const r=function(e,t,o=Bo,i=!0){for(let r=1;r<e.length;r++){const n=(t-r+e.length)%e.length;if(n>t&&!i)return null;const s=e[n];if(o(s))return s}return e[t]?e[t]:null}(e,t.index,o,i);return r&&(r.tabIndex=0,r.focus()),r}return qo(e,o)}function Bo(e){return!e.disabled}Oo.styles=[Po],Oo=t([ue("md-circular-progress")],Oo);const Mo={ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",Home:"Home",End:"End"};class Vo{constructor(e){this.handleKeydown=e=>{const t=e.key;if(e.defaultPrevented||!this.isNavigableKey(t))return;const o=this.items;if(!o.length)return;const i=Lo(o,this.isActivatable);e.preventDefault();const r=this.isRtl();let n=null;switch(t){case Mo.ArrowDown:case r?Mo.ArrowLeft:Mo.ArrowRight:n=Fo(o,i,this.isActivatable,this.wrapNavigation());break;case Mo.ArrowUp:case r?Mo.ArrowRight:Mo.ArrowLeft:n=Uo(o,i,this.isActivatable,this.wrapNavigation());break;case Mo.Home:n=zo(o,this.isActivatable);break;case Mo.End:n=qo(o,this.isActivatable)}n&&i&&i.item!==n&&(i.item.tabIndex=-1)},this.onDeactivateItems=()=>{const e=this.items;for(const t of e)this.deactivateItem(t)},this.onRequestActivation=e=>{this.onDeactivateItems();const t=e.target;this.activateItem(t),t.focus()},this.onSlotchange=()=>{const e=this.items;let t=!1;for(const o of e){!(!o.disabled&&o.tabIndex>-1)||t?o.tabIndex=-1:(t=!0,o.tabIndex=0)}if(t)return;const o=Do(e,this.isActivatable);o&&(o.tabIndex=0)};const{isItem:t,getPossibleItems:o,isRtl:i,deactivateItem:r,activateItem:n,isNavigableKey:s,isActivatable:a,wrapNavigation:l}=e;this.isItem=t,this.getPossibleItems=o,this.isRtl=i,this.deactivateItem=r,this.activateItem=n,this.isNavigableKey=s,this.isActivatable=a,this.wrapNavigation=l??(()=>!0)}get items(){const e=this.getPossibleItems(),t=[];for(const o of e){if(this.isItem(o)){t.push(o);continue}const e=o.item;e&&this.isItem(e)&&t.push(e)}return t}activateNextItem(){const e=this.items,t=Lo(e,this.isActivatable);return t&&(t.item.tabIndex=-1),Fo(e,t,this.isActivatable,this.wrapNavigation())}activatePreviousItem(){const e=this.items,t=Lo(e,this.isActivatable);return t&&(t.item.tabIndex=-1),Uo(e,t,this.isActivatable,this.wrapNavigation())}}const Ho=function(e,t){return new CustomEvent("close-menu",{bubbles:!0,composed:!0,detail:{initiator:e,reason:t,itemPath:[e]}})},Wo={SPACE:"Space",ENTER:"Enter"},jo="click-selection",Zo="keydown",Ko={ESCAPE:"Escape",SPACE:Wo.SPACE,ENTER:Wo.ENTER};function Go(e){return Object.values(Ko).some(t=>t===e)}function Yo(e,t){const o=new Event("md-contains",{bubbles:!0,composed:!0});let i=[];const r=e=>{i=e.composedPath()};t.addEventListener("md-contains",r),e.dispatchEvent(o),t.removeEventListener("md-contains",r);return i.length>0}const Xo="none",Jo="list-root",Qo="first-item",ei="last-item",ti="end-start",oi="start-start";class ii{constructor(e,t){this.host=e,this.getProperties=t,this.surfaceStylesInternal={display:"none"},this.lastValues={isOpen:!1},this.host.addController(this)}get surfaceStyles(){return this.surfaceStylesInternal}async position(){const{surfaceEl:e,anchorEl:t,anchorCorner:o,surfaceCorner:i,positioning:r,xOffset:n,yOffset:s,disableBlockFlip:a,disableInlineFlip:l,repositionStrategy:d}=this.getProperties(),c=o.toLowerCase().trim(),h=i.toLowerCase().trim();if(!e||!t)return;const p=window.innerWidth,u=window.innerHeight,v=document.createElement("div");v.style.opacity="0",v.style.position="fixed",v.style.display="block",v.style.inset="0",document.body.appendChild(v);const m=v.getBoundingClientRect();v.remove();const f=window.innerHeight-m.bottom,g=window.innerWidth-m.right;this.surfaceStylesInternal={display:"block",opacity:"0"},this.host.requestUpdate(),await this.host.updateComplete,e.popover&&e.isConnected&&e.showPopover();const b=e.getSurfacePositionClientRect?e.getSurfacePositionClientRect():e.getBoundingClientRect(),y=t.getSurfacePositionClientRect?t.getSurfacePositionClientRect():t.getBoundingClientRect(),[x,_]=h.split("-"),[w,C]=c.split("-"),$="ltr"===getComputedStyle(e).direction;let{blockInset:E,blockOutOfBoundsCorrection:S,surfaceBlockProperty:T}=this.calculateBlock({surfaceRect:b,anchorRect:y,anchorBlock:w,surfaceBlock:x,yOffset:s,positioning:r,windowInnerHeight:u,blockScrollbarHeight:f});if(S&&!a){const e="start"===x?"end":"start",t="start"===w?"end":"start",o=this.calculateBlock({surfaceRect:b,anchorRect:y,anchorBlock:t,surfaceBlock:e,yOffset:s,positioning:r,windowInnerHeight:u,blockScrollbarHeight:f});S>o.blockOutOfBoundsCorrection&&(E=o.blockInset,S=o.blockOutOfBoundsCorrection,T=o.surfaceBlockProperty)}let{inlineInset:A,inlineOutOfBoundsCorrection:k,surfaceInlineProperty:I}=this.calculateInline({surfaceRect:b,anchorRect:y,anchorInline:C,surfaceInline:_,xOffset:n,positioning:r,isLTR:$,windowInnerWidth:p,inlineScrollbarWidth:g});if(k&&!l){const e="start"===_?"end":"start",t="start"===C?"end":"start",o=this.calculateInline({surfaceRect:b,anchorRect:y,anchorInline:t,surfaceInline:e,xOffset:n,positioning:r,isLTR:$,windowInnerWidth:p,inlineScrollbarWidth:g});Math.abs(k)>Math.abs(o.inlineOutOfBoundsCorrection)&&(A=o.inlineInset,k=o.inlineOutOfBoundsCorrection,I=o.surfaceInlineProperty)}"move"===d&&(E-=S,A-=k),this.surfaceStylesInternal={display:"block",opacity:"1",[T]:`${E}px`,[I]:`${A}px`},"resize"===d&&(S&&(this.surfaceStylesInternal.height=b.height-S+"px"),k&&(this.surfaceStylesInternal.width=b.width-k+"px")),this.host.requestUpdate()}calculateBlock(e){const{surfaceRect:t,anchorRect:o,anchorBlock:i,surfaceBlock:r,yOffset:n,positioning:s,windowInnerHeight:a,blockScrollbarHeight:l}=e,d="fixed"===s||"document"===s?1:0,c="document"===s?1:0,h="start"===r?1:0,p="end"===r?1:0,u=(i!==r?1:0)*o.height+n,v=h*o.top+p*(a-o.bottom-l);return{blockInset:d*v+c*(h*window.scrollY-p*window.scrollY)+u,blockOutOfBoundsCorrection:Math.abs(Math.min(0,a-v-u-t.height)),surfaceBlockProperty:"start"===r?"inset-block-start":"inset-block-end"}}calculateInline(e){const{isLTR:t,surfaceInline:o,anchorInline:i,anchorRect:r,surfaceRect:n,xOffset:s,positioning:a,windowInnerWidth:l,inlineScrollbarWidth:d}=e,c="fixed"===a||"document"===a?1:0,h="document"===a?1:0,p=t?1:0,u=t?0:1,v="start"===o?1:0,m="end"===o?1:0,f=(i!==o?1:0)*r.width+s,g=p*(v*r.left+m*(l-r.right-d))+u*(v*(l-r.right-d)+m*r.left);let b="start"===o?"inset-inline-start":"inset-inline-end";return"document"!==a&&"fixed"!==a||(b="start"===o&&t||"end"===o&&!t?"left":"right"),{inlineInset:c*g+f+h*(p*(v*window.scrollX-m*window.scrollX)+u*(m*window.scrollX-v*window.scrollX)),inlineOutOfBoundsCorrection:Math.abs(Math.min(0,l-g-f-n.width)),surfaceInlineProperty:b}}hostUpdate(){this.onUpdate()}hostUpdated(){this.onUpdate()}async onUpdate(){const e=this.getProperties();let t=!1;for(const[o,i]of Object.entries(e))if(t=t||i!==this.lastValues[o],t)break;const o=this.lastValues.isOpen!==e.isOpen,i=!!e.anchorEl,r=!!e.surfaceEl;t&&i&&r&&(this.lastValues.isOpen=e.isOpen,e.isOpen?(this.lastValues=e,await this.position(),e.onOpen()):o&&(await e.beforeClose(),this.close(),e.onClose()))}close(){this.surfaceStylesInternal={display:"none"},this.host.requestUpdate();const e=this.getProperties().surfaceEl;e?.popover&&e?.isConnected&&e.hidePopover()}}const ri=0,ni=1,si=2;class ai{constructor(e){this.getProperties=e,this.typeaheadRecords=[],this.typaheadBuffer="",this.cancelTypeaheadTimeout=0,this.isTypingAhead=!1,this.lastActiveRecord=null,this.onKeydown=e=>{this.isTypingAhead?this.typeahead(e):this.beginTypeahead(e)},this.endTypeahead=()=>{this.isTypingAhead=!1,this.typaheadBuffer="",this.typeaheadRecords=[]}}get items(){return this.getProperties().getItems()}get active(){return this.getProperties().active}beginTypeahead(e){this.active&&("Space"===e.code||"Enter"===e.code||e.code.startsWith("Arrow")||"Escape"===e.code||(this.isTypingAhead=!0,this.typeaheadRecords=this.items.map((e,t)=>[t,e,e.typeaheadText.trim().toLowerCase()]),this.lastActiveRecord=this.typeaheadRecords.find(e=>0===e[ni].tabIndex)??null,this.lastActiveRecord&&(this.lastActiveRecord[ni].tabIndex=-1),this.typeahead(e)))}typeahead(e){if(e.defaultPrevented)return;if(clearTimeout(this.cancelTypeaheadTimeout),"Enter"===e.code||e.code.startsWith("Arrow")||"Escape"===e.code)return this.endTypeahead(),void(this.lastActiveRecord&&(this.lastActiveRecord[ni].tabIndex=-1));"Space"===e.code&&e.preventDefault(),this.cancelTypeaheadTimeout=setTimeout(this.endTypeahead,this.getProperties().typeaheadBufferTime),this.typaheadBuffer+=e.key.toLowerCase();const t=this.lastActiveRecord?this.lastActiveRecord[ri]:-1,o=this.typeaheadRecords.length,i=e=>(e[ri]+o-t)%o,r=this.typeaheadRecords.filter(e=>!e[ni].disabled&&e[si].startsWith(this.typaheadBuffer)).sort((e,t)=>i(e)-i(t));if(0===r.length)return clearTimeout(this.cancelTypeaheadTimeout),this.lastActiveRecord&&(this.lastActiveRecord[ni].tabIndex=-1),void this.endTypeahead();const n=1===this.typaheadBuffer.length;let s;s=this.lastActiveRecord===r[0]&&n?r[1]??r[0]:r[0],this.lastActiveRecord&&(this.lastActiveRecord[ni].tabIndex=-1),this.lastActiveRecord=s,s[ni].tabIndex=0,s[ni].focus()}}const li=new Set([Mo.ArrowDown,Mo.ArrowUp,Mo.Home,Mo.End]),di=new Set([Mo.ArrowLeft,Mo.ArrowRight,...li]);class ci extends he{get openDirection(){return"start"===this.menuCorner.split("-")[0]?"DOWN":"UP"}get anchorElement(){return this.anchor?this.getRootNode().querySelector(`#${this.anchor}`):this.currentAnchorElement}set anchorElement(e){this.currentAnchorElement=e,this.requestUpdate("anchorElement")}constructor(){super(),this.anchor="",this.positioning="absolute",this.quick=!1,this.hasOverflow=!1,this.open=!1,this.xOffset=0,this.yOffset=0,this.noHorizontalFlip=!1,this.noVerticalFlip=!1,this.typeaheadDelay=200,this.anchorCorner=ti,this.menuCorner=oi,this.stayOpenOnOutsideClick=!1,this.stayOpenOnFocusout=!1,this.skipRestoreFocus=!1,this.defaultFocus=Qo,this.noNavigationWrap=!1,this.typeaheadActive=!0,this.isSubmenu=!1,this.pointerPath=[],this.isRepositioning=!1,this.openCloseAnimationSignal=function(){let e=null;return{start:()=>(e?.abort(),e=new AbortController,e.signal),finish(){e=null}}}(),this.listController=new Vo({isItem:e=>e.hasAttribute("md-menu-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>"rtl"===getComputedStyle(this).direction,deactivateItem:e=>{e.selected=!1,e.tabIndex=-1},activateItem:e=>{e.selected=!0,e.tabIndex=0},isNavigableKey:e=>{if(!this.isSubmenu)return di.has(e);return e===("rtl"===getComputedStyle(this).direction?Mo.ArrowLeft:Mo.ArrowRight)||li.has(e)},wrapNavigation:()=>!this.noNavigationWrap}),this.lastFocusedElement=null,this.typeaheadController=new ai(()=>({getItems:()=>this.items,typeaheadBufferTime:this.typeaheadDelay,active:this.typeaheadActive})),this.currentAnchorElement=null,this.internals=this.attachInternals(),this.menuPositionController=new ii(this,()=>({anchorCorner:this.anchorCorner,surfaceCorner:this.menuCorner,surfaceEl:this.surfaceEl,anchorEl:this.anchorElement,positioning:"popover"===this.positioning?"document":this.positioning,isOpen:this.open,xOffset:this.xOffset,yOffset:this.yOffset,disableBlockFlip:this.noVerticalFlip,disableInlineFlip:this.noHorizontalFlip,onOpen:this.onOpened,beforeClose:this.beforeClose,onClose:this.onClosed,repositionStrategy:this.hasOverflow&&"popover"!==this.positioning?"move":"resize"})),this.onWindowResize=()=>{this.isRepositioning||"document"!==this.positioning&&"fixed"!==this.positioning&&"popover"!==this.positioning||(this.isRepositioning=!0,this.reposition(),this.isRepositioning=!1)},this.handleFocusout=async e=>{const t=this.anchorElement;if(this.stayOpenOnFocusout||!this.open||this.pointerPath.includes(t))return;if(e.relatedTarget){if(Yo(e.relatedTarget,this)||0!==this.pointerPath.length&&Yo(e.relatedTarget,t))return}else if(this.pointerPath.includes(this))return;const o=this.skipRestoreFocus;this.skipRestoreFocus=!0,this.close(),await this.updateComplete,this.skipRestoreFocus=o},this.onOpened=async()=>{this.lastFocusedElement=function(e=document){let t=e.activeElement;for(;t&&t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}();const e=this.items,t=Lo(e);t&&this.defaultFocus!==Xo&&(t.item.tabIndex=-1);let o=!this.quick;switch(this.quick?this.dispatchEvent(new Event("opening")):o=!!await this.animateOpen(),this.defaultFocus){case Qo:const t=Do(e);t&&(t.tabIndex=0,t.focus(),await t.updateComplete);break;case ei:const o=No(e);o&&(o.tabIndex=0,o.focus(),await o.updateComplete);break;case Jo:this.focus()}o||this.dispatchEvent(new Event("opened"))},this.beforeClose=async()=>{this.open=!1,this.skipRestoreFocus||this.lastFocusedElement?.focus?.(),this.quick||await this.animateClose()},this.onClosed=()=>{this.quick&&(this.dispatchEvent(new Event("closing")),this.dispatchEvent(new Event("closed")))},this.onWindowPointerdown=e=>{this.pointerPath=e.composedPath()},this.onDocumentClick=e=>{if(!this.open)return;const t=e.composedPath();this.stayOpenOnOutsideClick||t.includes(this)||t.includes(this.anchorElement)||(this.open=!1)},this.internals.role="menu",this.addEventListener("keydown",this.handleKeydown),this.addEventListener("keydown",this.captureKeydown,{capture:!0}),this.addEventListener("focusout",this.handleFocusout)}get items(){return this.listController.items}willUpdate(e){e.has("open")&&(this.open?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true"))}update(e){e.has("open")&&(this.open?this.setUpGlobalEventListeners():this.cleanUpGlobalEventListeners()),e.has("positioning")&&"popover"===this.positioning&&!this.showPopover&&(this.positioning="fixed"),super.update(e)}connectedCallback(){super.connectedCallback(),this.open&&this.setUpGlobalEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.cleanUpGlobalEventListeners()}getBoundingClientRect(){return this.surfaceEl?this.surfaceEl.getBoundingClientRect():super.getBoundingClientRect()}getClientRects(){return this.surfaceEl?this.surfaceEl.getClientRects():super.getClientRects()}render(){return this.renderSurface()}renderSurface(){return W`
|
|
289
|
+
<div
|
|
290
|
+
class="menu ${Ie(this.getSurfaceClasses())}"
|
|
291
|
+
style=${Ht(this.menuPositionController.surfaceStyles)}
|
|
292
|
+
popover=${"popover"===this.positioning?"manual":K}>
|
|
293
|
+
${this.renderElevation()}
|
|
294
|
+
<div class="items">
|
|
295
|
+
<div class="item-padding"> ${this.renderMenuItems()} </div>
|
|
296
|
+
</div>
|
|
297
|
+
</div>
|
|
298
|
+
`}renderMenuItems(){return W`<slot
|
|
299
|
+
@close-menu=${this.onCloseMenu}
|
|
300
|
+
@deactivate-items=${this.onDeactivateItems}
|
|
301
|
+
@request-activation=${this.onRequestActivation}
|
|
302
|
+
@deactivate-typeahead=${this.handleDeactivateTypeahead}
|
|
303
|
+
@activate-typeahead=${this.handleActivateTypeahead}
|
|
304
|
+
@stay-open-on-focusout=${this.handleStayOpenOnFocusout}
|
|
305
|
+
@close-on-focusout=${this.handleCloseOnFocusout}
|
|
306
|
+
@slotchange=${this.listController.onSlotchange}></slot>`}renderElevation(){return W`<md-elevation part="elevation"></md-elevation>`}getSurfaceClasses(){return{open:this.open,fixed:"fixed"===this.positioning,"has-overflow":this.hasOverflow}}captureKeydown(e){e.target===this&&!e.defaultPrevented&&Go(e.code)&&(e.preventDefault(),this.close()),this.typeaheadController.onKeydown(e)}async animateOpen(){const e=this.surfaceEl,t=this.slotEl;if(!e||!t)return!0;const o=this.openDirection;this.dispatchEvent(new Event("opening")),e.classList.toggle("animating",!0);const i=this.openCloseAnimationSignal.start(),r=e.offsetHeight,n="UP"===o,s=this.items,a=250/s.length,l=e.animate([{height:"0px"},{height:`${r}px`}],{duration:500,easing:Be}),d=t.animate([{transform:n?`translateY(-${r}px)`:""},{transform:""}],{duration:500,easing:Be}),c=e.animate([{opacity:0},{opacity:1}],50),h=[];for(let e=0;e<s.length;e++){const t=s[n?s.length-1-e:e],o=t.animate([{opacity:0},{opacity:1}],{duration:250,delay:a*e});t.classList.toggle("md-menu-hidden",!0),o.addEventListener("finish",()=>{t.classList.toggle("md-menu-hidden",!1)}),h.push([t,o])}let p=e=>{};const u=new Promise(e=>{p=e});return i.addEventListener("abort",()=>{l.cancel(),d.cancel(),c.cancel(),h.forEach(([e,t])=>{e.classList.toggle("md-menu-hidden",!1),t.cancel()}),p(!0)}),l.addEventListener("finish",()=>{e.classList.toggle("animating",!1),this.openCloseAnimationSignal.finish(),p(!1)}),await u}animateClose(){let e;const t=new Promise(t=>{e=t}),o=this.surfaceEl,i=this.slotEl;if(!o||!i)return e(!1),t;const r="UP"===this.openDirection;this.dispatchEvent(new Event("closing")),o.classList.toggle("animating",!0);const n=this.openCloseAnimationSignal.start(),s=o.offsetHeight,a=this.items,l=150,d=50/a.length,c=o.animate([{height:`${s}px`},{height:.35*s+"px"}],{duration:l,easing:Me}),h=i.animate([{transform:""},{transform:r?`translateY(-${.65*s}px)`:""}],{duration:l,easing:Me}),p=o.animate([{opacity:1},{opacity:0}],{duration:50,delay:100}),u=[];for(let e=0;e<a.length;e++){const t=a[r?e:a.length-1-e],o=t.animate([{opacity:1},{opacity:0}],{duration:50,delay:50+d*e});o.addEventListener("finish",()=>{t.classList.toggle("md-menu-hidden",!0)}),u.push([t,o])}return n.addEventListener("abort",()=>{c.cancel(),h.cancel(),p.cancel(),u.forEach(([e,t])=>{t.cancel(),e.classList.toggle("md-menu-hidden",!1)}),e(!1)}),c.addEventListener("finish",()=>{o.classList.toggle("animating",!1),u.forEach(([e])=>{e.classList.toggle("md-menu-hidden",!1)}),this.openCloseAnimationSignal.finish(),this.dispatchEvent(new Event("closed")),e(!0)}),t}handleKeydown(e){this.pointerPath=[],this.listController.handleKeydown(e)}setUpGlobalEventListeners(){document.addEventListener("click",this.onDocumentClick,{capture:!0}),window.addEventListener("pointerdown",this.onWindowPointerdown),document.addEventListener("resize",this.onWindowResize,{passive:!0}),window.addEventListener("resize",this.onWindowResize,{passive:!0})}cleanUpGlobalEventListeners(){document.removeEventListener("click",this.onDocumentClick,{capture:!0}),window.removeEventListener("pointerdown",this.onWindowPointerdown),document.removeEventListener("resize",this.onWindowResize),window.removeEventListener("resize",this.onWindowResize)}onCloseMenu(){this.close()}onDeactivateItems(e){e.stopPropagation(),this.listController.onDeactivateItems()}onRequestActivation(e){e.stopPropagation(),this.listController.onRequestActivation(e)}handleDeactivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!1}handleActivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!0}handleStayOpenOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!0}handleCloseOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!1}close(){this.open=!1;this.slotItems.forEach(e=>{e.close?.()})}show(){this.open=!0}activateNextItem(){return this.listController.activateNextItem()??null}activatePreviousItem(){return this.listController.activatePreviousItem()??null}reposition(){this.open&&this.menuPositionController.position()}}t([ye(".menu")],ci.prototype,"surfaceEl",void 0),t([ye("slot")],ci.prototype,"slotEl",void 0),t([fe()],ci.prototype,"anchor",void 0),t([fe()],ci.prototype,"positioning",void 0),t([fe({type:Boolean})],ci.prototype,"quick",void 0),t([fe({type:Boolean,attribute:"has-overflow"})],ci.prototype,"hasOverflow",void 0),t([fe({type:Boolean,reflect:!0})],ci.prototype,"open",void 0),t([fe({type:Number,attribute:"x-offset"})],ci.prototype,"xOffset",void 0),t([fe({type:Number,attribute:"y-offset"})],ci.prototype,"yOffset",void 0),t([fe({type:Boolean,attribute:"no-horizontal-flip"})],ci.prototype,"noHorizontalFlip",void 0),t([fe({type:Boolean,attribute:"no-vertical-flip"})],ci.prototype,"noVerticalFlip",void 0),t([fe({type:Number,attribute:"typeahead-delay"})],ci.prototype,"typeaheadDelay",void 0),t([fe({attribute:"anchor-corner"})],ci.prototype,"anchorCorner",void 0),t([fe({attribute:"menu-corner"})],ci.prototype,"menuCorner",void 0),t([fe({type:Boolean,attribute:"stay-open-on-outside-click"})],ci.prototype,"stayOpenOnOutsideClick",void 0),t([fe({type:Boolean,attribute:"stay-open-on-focusout"})],ci.prototype,"stayOpenOnFocusout",void 0),t([fe({type:Boolean,attribute:"skip-restore-focus"})],ci.prototype,"skipRestoreFocus",void 0),t([fe({attribute:"default-focus"})],ci.prototype,"defaultFocus",void 0),t([fe({type:Boolean,attribute:"no-navigation-wrap"})],ci.prototype,"noNavigationWrap",void 0),t([_e({flatten:!0})],ci.prototype,"slotItems",void 0),t([ge()],ci.prototype,"typeaheadActive",void 0);const hi=a`:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px))}.menu{border-radius:var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px));display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit;scrollbar-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit;scrollbar-width:inherit}.item-padding{padding-block:var(--md-menu-top-space, 8px) var(--md-menu-bottom-space, 8px)}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}
|
|
307
|
+
`;hi.styleSheet;let pi=class extends ci{};pi.styles=[hi],pi=t([ue("md-menu")],pi);class ui extends no{computeValidity(e){return this.selectControl||(this.selectControl=document.createElement("select")),de(W`<option value=${e.value}></option>`,this.selectControl),this.selectControl.value=e.value,this.selectControl.required=e.required,{validity:this.selectControl.validity,validationMessage:this.selectControl.validationMessage}}equals(e,t){return e.value===t.value&&e.required===t.required}copy({value:e,required:t}){return{value:e,required:t}}}var vi;const mi=Symbol("value"),fi=Le(io(Xt(St(Ct(he)))));class gi extends fi{get value(){return this[mi]}set value(e){this.lastUserSetValue=e,this.select(e)}get options(){return this.menu?.items??[]}get selectedIndex(){const[e,t]=(this.getSelectedOptions()??[])[0]??[];return t??-1}set selectedIndex(e){this.lastUserSetSelectedIndex=e,this.selectIndex(e)}get selectedOptions(){return(this.getSelectedOptions()??[]).map(([e])=>e)}get hasError(){return this.error||this.nativeError}constructor(){super(),this.quick=!1,this.required=!1,this.errorText="",this.label="",this.noAsterisk=!1,this.supportingText="",this.error=!1,this.menuPositioning="popover",this.clampMenuWidth=!1,this.typeaheadDelay=200,this.hasLeadingIcon=!1,this.displayText="",this.menuAlign="start",this[vi]="",this.lastUserSetValue=null,this.lastUserSetSelectedIndex=null,this.lastSelectedOption=null,this.lastSelectedOptionRecords=[],this.nativeError=!1,this.nativeErrorText="",this.focused=!1,this.open=!1,this.defaultFocus=Xo,this.prevOpen=this.open,this.selectWidth=0,this.addEventListener("focus",this.handleFocus.bind(this)),this.addEventListener("blur",this.handleBlur.bind(this))}select(e){const t=this.options.find(t=>t.value===e);t&&this.selectItem(t)}selectIndex(e){const t=this.options[e];t&&this.selectItem(t)}reset(){for(const e of this.options)e.selected=e.hasAttribute("selected");this.updateValueAndDisplayText(),this.nativeError=!1,this.nativeErrorText=""}showPicker(){this.open=!0}[(vi=mi,Jt)](e){e?.preventDefault();const t=this.getErrorText();this.nativeError=!!e,this.nativeErrorText=this.validationMessage,t===this.getErrorText()&&this.field?.reannounceError()}update(e){if(this.hasUpdated||this.initUserSelection(),this.prevOpen!==this.open&&this.open){const e=this.getBoundingClientRect();this.selectWidth=e.width}this.prevOpen=this.open,super.update(e)}render(){return W`
|
|
308
|
+
<span
|
|
309
|
+
class="select ${Ie(this.getRenderClasses())}"
|
|
310
|
+
@focusout=${this.handleFocusout}>
|
|
311
|
+
${this.renderField()} ${this.renderMenu()}
|
|
312
|
+
</span>
|
|
313
|
+
`}async firstUpdated(e){await(this.menu?.updateComplete),this.lastSelectedOptionRecords.length||this.initUserSelection(),this.lastSelectedOptionRecords.length||this.options.length||setTimeout(()=>{this.updateValueAndDisplayText()}),super.firstUpdated(e)}getRenderClasses(){return{disabled:this.disabled,error:this.error,open:this.open}}renderField(){const e=this.ariaLabel||this.label;return mt`
|
|
314
|
+
<${this.fieldTag}
|
|
315
|
+
aria-haspopup="listbox"
|
|
316
|
+
role="combobox"
|
|
317
|
+
part="field"
|
|
318
|
+
id="field"
|
|
319
|
+
tabindex=${this.disabled?"-1":"0"}
|
|
320
|
+
aria-label=${e||K}
|
|
321
|
+
aria-describedby="description"
|
|
322
|
+
aria-expanded=${this.open?"true":"false"}
|
|
323
|
+
aria-controls="listbox"
|
|
324
|
+
class="field"
|
|
325
|
+
label=${this.label}
|
|
326
|
+
?no-asterisk=${this.noAsterisk}
|
|
327
|
+
.focused=${this.focused||this.open}
|
|
328
|
+
.populated=${!!this.displayText}
|
|
329
|
+
.disabled=${this.disabled}
|
|
330
|
+
.required=${this.required}
|
|
331
|
+
.error=${this.hasError}
|
|
332
|
+
?has-start=${this.hasLeadingIcon}
|
|
333
|
+
has-end
|
|
334
|
+
supporting-text=${this.supportingText}
|
|
335
|
+
error-text=${this.getErrorText()}
|
|
336
|
+
@keydown=${this.handleKeydown}
|
|
337
|
+
@click=${this.handleClick}>
|
|
338
|
+
${this.renderFieldContent()}
|
|
339
|
+
<div id="description" slot="aria-describedby"></div>
|
|
340
|
+
</${this.fieldTag}>`}renderFieldContent(){return[this.renderLeadingIcon(),this.renderLabel(),this.renderTrailingIcon()]}renderLeadingIcon(){return W`
|
|
341
|
+
<span class="icon leading" slot="start">
|
|
342
|
+
<slot name="leading-icon" @slotchange=${this.handleIconChange}></slot>
|
|
343
|
+
</span>
|
|
344
|
+
`}renderTrailingIcon(){return W`
|
|
345
|
+
<span class="icon trailing" slot="end">
|
|
346
|
+
<slot name="trailing-icon" @slotchange=${this.handleIconChange}>
|
|
347
|
+
<svg height="5" viewBox="7 10 10 5" focusable="false">
|
|
348
|
+
<polygon
|
|
349
|
+
class="down"
|
|
350
|
+
stroke="none"
|
|
351
|
+
fill-rule="evenodd"
|
|
352
|
+
points="7 10 12 15 17 10"></polygon>
|
|
353
|
+
<polygon
|
|
354
|
+
class="up"
|
|
355
|
+
stroke="none"
|
|
356
|
+
fill-rule="evenodd"
|
|
357
|
+
points="7 15 12 10 17 15"></polygon>
|
|
358
|
+
</svg>
|
|
359
|
+
</slot>
|
|
360
|
+
</span>
|
|
361
|
+
`}renderLabel(){return W`<div id="label">${this.displayText||W` `}</div>`}renderMenu(){const e=this.label||this.ariaLabel;return W`<div class="menu-wrapper">
|
|
362
|
+
<md-menu
|
|
363
|
+
id="listbox"
|
|
364
|
+
.defaultFocus=${this.defaultFocus}
|
|
365
|
+
role="listbox"
|
|
366
|
+
tabindex="-1"
|
|
367
|
+
aria-label=${e||K}
|
|
368
|
+
stay-open-on-focusout
|
|
369
|
+
part="menu"
|
|
370
|
+
exportparts="focus-ring: menu-focus-ring"
|
|
371
|
+
anchor="field"
|
|
372
|
+
style=${Ht({"--__menu-min-width":`${this.selectWidth}px`,"--__menu-max-width":this.clampMenuWidth?`${this.selectWidth}px`:void 0})}
|
|
373
|
+
no-navigation-wrap
|
|
374
|
+
.open=${this.open}
|
|
375
|
+
.quick=${this.quick}
|
|
376
|
+
.positioning=${this.menuPositioning}
|
|
377
|
+
.typeaheadDelay=${this.typeaheadDelay}
|
|
378
|
+
.anchorCorner=${"start"===this.menuAlign?"end-start":"end-end"}
|
|
379
|
+
.menuCorner=${"start"===this.menuAlign?"start-start":"start-end"}
|
|
380
|
+
@opening=${this.handleOpening}
|
|
381
|
+
@opened=${this.redispatchEvent}
|
|
382
|
+
@closing=${this.redispatchEvent}
|
|
383
|
+
@closed=${this.handleClosed}
|
|
384
|
+
@close-menu=${this.handleCloseMenu}
|
|
385
|
+
@request-selection=${this.handleRequestSelection}
|
|
386
|
+
@request-deselection=${this.handleRequestDeselection}>
|
|
387
|
+
${this.renderMenuContent()}
|
|
388
|
+
</md-menu>
|
|
389
|
+
</div>`}renderMenuContent(){return W`<slot></slot>`}handleKeydown(e){if(this.open||this.disabled||!this.menu)return;const t=this.menu.typeaheadController,o="Space"===e.code||"ArrowDown"===e.code||"ArrowUp"===e.code||"End"===e.code||"Home"===e.code||"Enter"===e.code;if(!t.isTypingAhead&&o){switch(e.preventDefault(),this.open=!0,e.code){case"Space":case"ArrowDown":case"Enter":this.defaultFocus=Xo;break;case"End":this.defaultFocus=ei;break;case"ArrowUp":case"Home":this.defaultFocus=Qo}return}if(1===e.key.length){t.onKeydown(e),e.preventDefault();const{lastActiveRecord:o}=t;if(!o)return;this.labelEl?.setAttribute?.("aria-live","polite");this.selectItem(o[ni])&&this.dispatchInteractionEvents()}}handleClick(){this.open=!this.open}handleFocus(){this.focused=!0}handleBlur(){this.focused=!1}handleFocusout(e){e.relatedTarget&&Yo(e.relatedTarget,this)||(this.open=!1)}getSelectedOptions(){if(!this.menu)return this.lastSelectedOptionRecords=[],null;const e=this.menu.items;return this.lastSelectedOptionRecords=function(e){const t=[];for(let o=0;o<e.length;o++){const i=e[o];i.selected&&t.push([i,o])}return t}(e),this.lastSelectedOptionRecords}async getUpdateComplete(){return await(this.menu?.updateComplete),super.getUpdateComplete()}updateValueAndDisplayText(){const e=this.getSelectedOptions()??[];let t=!1;if(e.length){const[o]=e[0];t=this.lastSelectedOption!==o,this.lastSelectedOption=o,this[mi]=o.value,this.displayText=o.displayText}else t=null!==this.lastSelectedOption,this.lastSelectedOption=null,this[mi]="",this.displayText="";return t}async handleOpening(e){if(this.labelEl?.removeAttribute?.("aria-live"),this.redispatchEvent(e),this.defaultFocus!==Xo)return;const t=this.menu.items,o=Lo(t)?.item;let[i]=this.lastSelectedOptionRecords[0]??[null];o&&o!==i&&(o.tabIndex=-1),i=i??t[0],i&&(i.tabIndex=0,i.focus())}redispatchEvent(e){Fe(this,e)}handleClosed(e){this.open=!1,this.redispatchEvent(e)}handleCloseMenu(e){const t=e.detail.reason,o=e.detail.itemPath[0];this.open=!1;let i=!1;var r;"click-selection"===t.kind||"keydown"===t.kind&&(r=t.key,Object.values(Wo).some(e=>e===r))?i=this.selectItem(o):(o.tabIndex=-1,o.blur()),i&&this.dispatchInteractionEvents()}selectItem(e){return(this.getSelectedOptions()??[]).forEach(([t])=>{e!==t&&(t.selected=!1,t.tabIndex=-1)}),e.selected=!0,e.tabIndex=0,this.updateValueAndDisplayText()}handleRequestSelection(e){const t=e.target;this.lastSelectedOptionRecords.some(([e])=>e===t)||this.selectItem(t)}handleRequestDeselection(e){const t=e.target;this.lastSelectedOptionRecords.some(([e])=>e===t)&&this.updateValueAndDisplayText()}initUserSelection(){this.lastUserSetValue&&!this.lastSelectedOptionRecords.length?this.select(this.lastUserSetValue):null===this.lastUserSetSelectedIndex||this.lastSelectedOptionRecords.length?this.updateValueAndDisplayText():this.selectIndex(this.lastUserSetSelectedIndex)}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0}dispatchInteractionEvents(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0}))}getErrorText(){return this.error?this.errorText:this.nativeErrorText}[$t](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(e){this.value=e}click(){this.field?.click()}[jt](){return new ui(()=>this)}[Zt](){return this.field}}gi.shadowRootOptions={...he.shadowRootOptions,delegatesFocus:!0},t([fe({type:Boolean})],gi.prototype,"quick",void 0),t([fe({type:Boolean})],gi.prototype,"required",void 0),t([fe({type:String,attribute:"error-text"})],gi.prototype,"errorText",void 0),t([fe()],gi.prototype,"label",void 0),t([fe({type:Boolean,attribute:"no-asterisk"})],gi.prototype,"noAsterisk",void 0),t([fe({type:String,attribute:"supporting-text"})],gi.prototype,"supportingText",void 0),t([fe({type:Boolean,reflect:!0})],gi.prototype,"error",void 0),t([fe({attribute:"menu-positioning"})],gi.prototype,"menuPositioning",void 0),t([fe({type:Boolean,attribute:"clamp-menu-width"})],gi.prototype,"clampMenuWidth",void 0),t([fe({type:Number,attribute:"typeahead-delay"})],gi.prototype,"typeaheadDelay",void 0),t([fe({type:Boolean,attribute:"has-leading-icon"})],gi.prototype,"hasLeadingIcon",void 0),t([fe({attribute:"display-text"})],gi.prototype,"displayText",void 0),t([fe({attribute:"menu-align"})],gi.prototype,"menuAlign",void 0),t([fe()],gi.prototype,"value",null),t([fe({type:Number,attribute:"selected-index"})],gi.prototype,"selectedIndex",null),t([ge()],gi.prototype,"nativeError",void 0),t([ge()],gi.prototype,"nativeErrorText",void 0),t([ge()],gi.prototype,"focused",void 0),t([ge()],gi.prototype,"open",void 0),t([ge()],gi.prototype,"defaultFocus",void 0),t([ye(".field")],gi.prototype,"field",void 0),t([ye("md-menu")],gi.prototype,"menu",void 0),t([ye("#label")],gi.prototype,"labelEl",void 0),t([_e({slot:"leading-icon",flatten:!0})],gi.prototype,"leadingIcons",void 0);class bi extends gi{constructor(){super(...arguments),this.fieldTag=ut`md-outlined-field`}}const yi=a`:host{--_text-field-disabled-input-text-color: var(--md-outlined-select-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-input-text-opacity: var(--md-outlined-select-text-field-disabled-input-text-opacity, 0.38);--_text-field-disabled-label-text-color: var(--md-outlined-select-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-label-text-opacity: var(--md-outlined-select-text-field-disabled-label-text-opacity, 0.38);--_text-field-disabled-leading-icon-color: var(--md-outlined-select-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-leading-icon-opacity: var(--md-outlined-select-text-field-disabled-leading-icon-opacity, 0.38);--_text-field-disabled-outline-color: var(--md-outlined-select-text-field-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-outline-opacity: var(--md-outlined-select-text-field-disabled-outline-opacity, 0.12);--_text-field-disabled-outline-width: var(--md-outlined-select-text-field-disabled-outline-width, 1px);--_text-field-disabled-supporting-text-color: var(--md-outlined-select-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-supporting-text-opacity: var(--md-outlined-select-text-field-disabled-supporting-text-opacity, 0.38);--_text-field-disabled-trailing-icon-color: var(--md-outlined-select-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-trailing-icon-opacity: var(--md-outlined-select-text-field-disabled-trailing-icon-opacity, 0.38);--_text-field-error-focus-input-text-color: var(--md-outlined-select-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-focus-label-text-color: var(--md-outlined-select-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-leading-icon-color: var(--md-outlined-select-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-focus-outline-color: var(--md-outlined-select-text-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-supporting-text-color: var(--md-outlined-select-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-trailing-icon-color: var(--md-outlined-select-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-input-text-color: var(--md-outlined-select-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-hover-label-text-color: var(--md-outlined-select-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-leading-icon-color: var(--md-outlined-select-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-hover-outline-color: var(--md-outlined-select-text-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-supporting-text-color: var(--md-outlined-select-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-trailing-icon-color: var(--md-outlined-select-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-input-text-color: var(--md-outlined-select-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-label-text-color: var(--md-outlined-select-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-leading-icon-color: var(--md-outlined-select-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-outline-color: var(--md-outlined-select-text-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_text-field-error-supporting-text-color: var(--md-outlined-select-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-trailing-icon-color: var(--md-outlined-select-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-focus-input-text-color: var(--md-outlined-select-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-focus-label-text-color: var(--md-outlined-select-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-leading-icon-color: var(--md-outlined-select-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-outline-color: var(--md-outlined-select-text-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-outline-width: var(--md-outlined-select-text-field-focus-outline-width, 3px);--_text-field-focus-supporting-text-color: var(--md-outlined-select-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-trailing-icon-color: var(--md-outlined-select-text-field-focus-trailing-icon-color, var(--md-sys-color-primary, #6750a4));--_text-field-hover-input-text-color: var(--md-outlined-select-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-label-text-color: var(--md-outlined-select-text-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-leading-icon-color: var(--md-outlined-select-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-outline-color: var(--md-outlined-select-text-field-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-outline-width: var(--md-outlined-select-text-field-hover-outline-width, 1px);--_text-field-hover-supporting-text-color: var(--md-outlined-select-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-trailing-icon-color: var(--md-outlined-select-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-input-text-color: var(--md-outlined-select-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-input-text-font: var(--md-outlined-select-text-field-input-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-input-text-line-height: var(--md-outlined-select-text-field-input-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_text-field-input-text-size: var(--md-outlined-select-text-field-input-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_text-field-input-text-weight: var(--md-outlined-select-text-field-input-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-label-text-color: var(--md-outlined-select-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-label-text-font: var(--md-outlined-select-text-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-label-text-line-height: var(--md-outlined-select-text-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_text-field-label-text-populated-line-height: var(--md-outlined-select-text-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_text-field-label-text-populated-size: var(--md-outlined-select-text-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_text-field-label-text-size: var(--md-outlined-select-text-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_text-field-label-text-weight: var(--md-outlined-select-text-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-leading-icon-color: var(--md-outlined-select-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-leading-icon-size: var(--md-outlined-select-text-field-leading-icon-size, 24px);--_text-field-outline-color: var(--md-outlined-select-text-field-outline-color, var(--md-sys-color-outline, #79747e));--_text-field-outline-width: var(--md-outlined-select-text-field-outline-width, 1px);--_text-field-supporting-text-color: var(--md-outlined-select-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-supporting-text-font: var(--md-outlined-select-text-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-supporting-text-line-height: var(--md-outlined-select-text-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_text-field-supporting-text-size: var(--md-outlined-select-text-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_text-field-supporting-text-weight: var(--md-outlined-select-text-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-trailing-icon-color: var(--md-outlined-select-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-trailing-icon-size: var(--md-outlined-select-text-field-trailing-icon-size, 24px);--_text-field-container-shape-start-start: var(--md-outlined-select-text-field-container-shape-start-start, var(--md-outlined-select-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_text-field-container-shape-start-end: var(--md-outlined-select-text-field-container-shape-start-end, var(--md-outlined-select-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_text-field-container-shape-end-end: var(--md-outlined-select-text-field-container-shape-end-end, var(--md-outlined-select-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_text-field-container-shape-end-start: var(--md-outlined-select-text-field-container-shape-end-start, var(--md-outlined-select-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--md-outlined-field-container-shape-end-end: var(--_text-field-container-shape-end-end);--md-outlined-field-container-shape-end-start: var(--_text-field-container-shape-end-start);--md-outlined-field-container-shape-start-end: var(--_text-field-container-shape-start-end);--md-outlined-field-container-shape-start-start: var(--_text-field-container-shape-start-start);--md-outlined-field-content-color: var(--_text-field-input-text-color);--md-outlined-field-content-font: var(--_text-field-input-text-font);--md-outlined-field-content-line-height: var(--_text-field-input-text-line-height);--md-outlined-field-content-size: var(--_text-field-input-text-size);--md-outlined-field-content-weight: var(--_text-field-input-text-weight);--md-outlined-field-disabled-content-color: var(--_text-field-disabled-input-text-color);--md-outlined-field-disabled-content-opacity: var(--_text-field-disabled-input-text-opacity);--md-outlined-field-disabled-label-text-color: var(--_text-field-disabled-label-text-color);--md-outlined-field-disabled-label-text-opacity: var(--_text-field-disabled-label-text-opacity);--md-outlined-field-disabled-leading-content-color: var(--_text-field-disabled-leading-icon-color);--md-outlined-field-disabled-leading-content-opacity: var(--_text-field-disabled-leading-icon-opacity);--md-outlined-field-disabled-outline-color: var(--_text-field-disabled-outline-color);--md-outlined-field-disabled-outline-opacity: var(--_text-field-disabled-outline-opacity);--md-outlined-field-disabled-outline-width: var(--_text-field-disabled-outline-width);--md-outlined-field-disabled-supporting-text-color: var(--_text-field-disabled-supporting-text-color);--md-outlined-field-disabled-supporting-text-opacity: var(--_text-field-disabled-supporting-text-opacity);--md-outlined-field-disabled-trailing-content-color: var(--_text-field-disabled-trailing-icon-color);--md-outlined-field-disabled-trailing-content-opacity: var(--_text-field-disabled-trailing-icon-opacity);--md-outlined-field-error-content-color: var(--_text-field-error-input-text-color);--md-outlined-field-error-focus-content-color: var(--_text-field-error-focus-input-text-color);--md-outlined-field-error-focus-label-text-color: var(--_text-field-error-focus-label-text-color);--md-outlined-field-error-focus-leading-content-color: var(--_text-field-error-focus-leading-icon-color);--md-outlined-field-error-focus-outline-color: var(--_text-field-error-focus-outline-color);--md-outlined-field-error-focus-supporting-text-color: var(--_text-field-error-focus-supporting-text-color);--md-outlined-field-error-focus-trailing-content-color: var(--_text-field-error-focus-trailing-icon-color);--md-outlined-field-error-hover-content-color: var(--_text-field-error-hover-input-text-color);--md-outlined-field-error-hover-label-text-color: var(--_text-field-error-hover-label-text-color);--md-outlined-field-error-hover-leading-content-color: var(--_text-field-error-hover-leading-icon-color);--md-outlined-field-error-hover-outline-color: var(--_text-field-error-hover-outline-color);--md-outlined-field-error-hover-supporting-text-color: var(--_text-field-error-hover-supporting-text-color);--md-outlined-field-error-hover-trailing-content-color: var(--_text-field-error-hover-trailing-icon-color);--md-outlined-field-error-label-text-color: var(--_text-field-error-label-text-color);--md-outlined-field-error-leading-content-color: var(--_text-field-error-leading-icon-color);--md-outlined-field-error-outline-color: var(--_text-field-error-outline-color);--md-outlined-field-error-supporting-text-color: var(--_text-field-error-supporting-text-color);--md-outlined-field-error-trailing-content-color: var(--_text-field-error-trailing-icon-color);--md-outlined-field-focus-content-color: var(--_text-field-focus-input-text-color);--md-outlined-field-focus-label-text-color: var(--_text-field-focus-label-text-color);--md-outlined-field-focus-leading-content-color: var(--_text-field-focus-leading-icon-color);--md-outlined-field-focus-outline-color: var(--_text-field-focus-outline-color);--md-outlined-field-focus-outline-width: var(--_text-field-focus-outline-width);--md-outlined-field-focus-supporting-text-color: var(--_text-field-focus-supporting-text-color);--md-outlined-field-focus-trailing-content-color: var(--_text-field-focus-trailing-icon-color);--md-outlined-field-hover-content-color: var(--_text-field-hover-input-text-color);--md-outlined-field-hover-label-text-color: var(--_text-field-hover-label-text-color);--md-outlined-field-hover-leading-content-color: var(--_text-field-hover-leading-icon-color);--md-outlined-field-hover-outline-color: var(--_text-field-hover-outline-color);--md-outlined-field-hover-outline-width: var(--_text-field-hover-outline-width);--md-outlined-field-hover-supporting-text-color: var(--_text-field-hover-supporting-text-color);--md-outlined-field-hover-trailing-content-color: var(--_text-field-hover-trailing-icon-color);--md-outlined-field-label-text-color: var(--_text-field-label-text-color);--md-outlined-field-label-text-font: var(--_text-field-label-text-font);--md-outlined-field-label-text-line-height: var(--_text-field-label-text-line-height);--md-outlined-field-label-text-populated-line-height: var(--_text-field-label-text-populated-line-height);--md-outlined-field-label-text-populated-size: var(--_text-field-label-text-populated-size);--md-outlined-field-label-text-size: var(--_text-field-label-text-size);--md-outlined-field-label-text-weight: var(--_text-field-label-text-weight);--md-outlined-field-leading-content-color: var(--_text-field-leading-icon-color);--md-outlined-field-outline-color: var(--_text-field-outline-color);--md-outlined-field-outline-width: var(--_text-field-outline-width);--md-outlined-field-supporting-text-color: var(--_text-field-supporting-text-color);--md-outlined-field-supporting-text-font: var(--_text-field-supporting-text-font);--md-outlined-field-supporting-text-line-height: var(--_text-field-supporting-text-line-height);--md-outlined-field-supporting-text-size: var(--_text-field-supporting-text-size);--md-outlined-field-supporting-text-weight: var(--_text-field-supporting-text-weight);--md-outlined-field-trailing-content-color: var(--_text-field-trailing-icon-color)}[has-start] .icon.leading{font-size:var(--_text-field-leading-icon-size);height:var(--_text-field-leading-icon-size);width:var(--_text-field-leading-icon-size)}.icon.trailing{font-size:var(--_text-field-trailing-icon-size);height:var(--_text-field-trailing-icon-size);width:var(--_text-field-trailing-icon-size)}
|
|
390
|
+
`;yi.styleSheet;const xi=a`:host{color:unset;min-width:210px;display:flex}.field{cursor:default;outline:none}.select{position:relative;flex-direction:column}.icon.trailing svg,.icon ::slotted(*){fill:currentColor}.icon ::slotted(*){width:inherit;height:inherit;font-size:inherit}.icon slot{display:flex;height:100%;width:100%;align-items:center;justify-content:center}.icon.trailing :is(.up,.down){opacity:0;transition:opacity 75ms linear 75ms}.select:not(.open) .down,.select.open .up{opacity:1}.field,.select,md-menu{min-width:inherit;width:inherit;max-width:inherit;display:flex}md-menu{min-width:var(--__menu-min-width);max-width:var(--__menu-max-width, inherit)}.menu-wrapper{width:0px;height:0px;max-width:inherit}md-menu ::slotted(:not[disabled]){cursor:pointer}.field,.select{width:100%}:host{display:inline-flex}:host([disabled]){pointer-events:none}
|
|
391
|
+
`;xi.styleSheet;let _i=class extends bi{};_i.styles=[xi,yi],_i=t([ue("md-outlined-select")],_i);const wi=a`:host{display:flex;gap:16px;--md-ripple-hover-color: var(--md-menu-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-menu-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-menu-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-menu-item-pressed-state-layer-opacity, 0.12)}:host([disabled]){opacity:var(--md-menu-item-disabled-opacity, 0.3);pointer-events:none}md-focus-ring{z-index:1;--md-focus-ring-shape: 8px}a,button,li{background:none;border:none;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;gap:inherit;max-width:inherit;min-width:inherit;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.list-item:not(.disabled){cursor:pointer}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;color:var(--md-menu-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));font-family:var(--md-menu-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-menu-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-menu-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));min-height:var(--md-menu-item-one-line-container-height, 56px);padding-top:var(--md-menu-item-top-space, 12px);padding-bottom:var(--md-menu-item-bottom-space, 12px);padding-inline-start:var(--md-menu-item-leading-space, 16px);padding-inline-end:var(--md-menu-item-trailing-space, 16px);gap:inherit}md-item[multiline]{min-height:var(--md-menu-item-two-line-container-height, 72px)}[slot=supporting-text]{color:var(--md-menu-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-menu-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-menu-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-menu-item-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)))}[slot=trailing-supporting-text]{color:var(--md-menu-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-menu-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.6875rem));line-height:var(--md-menu-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-menu-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-menu-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}[slot=end]{color:var(--md-menu-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}.list-item{background-color:var(--md-menu-item-container-color, transparent)}.list-item.selected{background-color:var(--md-menu-item-selected-container-color, var(--md-sys-color-secondary-container, #e8def8))}.selected:not(.disabled) ::slotted(*){color:var(--md-menu-item-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b))}@media(forced-colors: active){:host([disabled]),:host([disabled]) slot{color:GrayText;opacity:1}.list-item{position:relative}.list-item.selected::before{content:"";position:absolute;inset:0;box-sizing:border-box;border-radius:inherit;pointer-events:none;border:3px double CanvasText}}
|
|
392
|
+
`;wi.styleSheet;class Ci extends he{constructor(){super(...arguments),this.multiline=!1}render(){return W`
|
|
393
|
+
<slot name="container"></slot>
|
|
394
|
+
<slot class="non-text" name="start"></slot>
|
|
395
|
+
<div class="text">
|
|
396
|
+
<slot name="overline" @slotchange=${this.handleTextSlotChange}></slot>
|
|
397
|
+
<slot
|
|
398
|
+
class="default-slot"
|
|
399
|
+
@slotchange=${this.handleTextSlotChange}></slot>
|
|
400
|
+
<slot name="headline" @slotchange=${this.handleTextSlotChange}></slot>
|
|
401
|
+
<slot
|
|
402
|
+
name="supporting-text"
|
|
403
|
+
@slotchange=${this.handleTextSlotChange}></slot>
|
|
404
|
+
</div>
|
|
405
|
+
<slot class="non-text" name="trailing-supporting-text"></slot>
|
|
406
|
+
<slot class="non-text" name="end"></slot>
|
|
407
|
+
`}handleTextSlotChange(){let e=!1,t=0;for(const o of this.textSlots)if($i(o)&&(t+=1),t>1){e=!0;break}this.multiline=e}}function $i(e){for(const t of e.assignedNodes({flatten:!0})){const e=t.nodeType===Node.ELEMENT_NODE,o=t.nodeType===Node.TEXT_NODE&&t.textContent?.match(/\S/);if(e||o)return!0}return!1}t([fe({type:Boolean,reflect:!0})],Ci.prototype,"multiline",void 0),t([function(e){return(t,o)=>be(t,o,{get(){return(this.renderRoot??(xe??=document.createDocumentFragment())).querySelectorAll(e)}})}(".text slot")],Ci.prototype,"textSlots",void 0);const Ei=a`:host{color:var(--md-sys-color-on-surface, #1d1b20);font-family:var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-large-size, 1rem);font-weight:var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400));line-height:var(--md-sys-typescale-body-large-line-height, 1.5rem);align-items:center;box-sizing:border-box;display:flex;gap:16px;min-height:56px;overflow:hidden;padding:12px 16px;position:relative;text-overflow:ellipsis}:host([multiline]){min-height:72px}[name=overline]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, 0.6875rem);font-weight:var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=supporting-text]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-medium-size, 0.875rem);font-weight:var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400));line-height:var(--md-sys-typescale-body-medium-line-height, 1.25rem)}[name=trailing-supporting-text]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, 0.6875rem);font-weight:var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=container]::slotted(*){inset:0;position:absolute}.default-slot{display:inline}.default-slot,.text ::slotted(*){overflow:hidden;text-overflow:ellipsis}.text{display:flex;flex:1;flex-direction:column;overflow:hidden}
|
|
408
|
+
`;Ei.styleSheet;let Si=class extends Ci{};Si.styles=[Ei],Si=t([ue("md-item")],Si);class Ti{constructor(e,t){this.host=e,this.internalTypeaheadText=null,this.onClick=()=>{this.host.keepOpen||this.host.dispatchEvent(Ho(this.host,{kind:jo}))},this.onKeydown=e=>{if(this.host.href&&"Enter"===e.code){const e=this.getInteractiveElement();e instanceof HTMLAnchorElement&&e.click()}if(e.defaultPrevented)return;const t=e.code;this.host.keepOpen&&"Escape"!==t||Go(t)&&(e.preventDefault(),this.host.dispatchEvent(Ho(this.host,{kind:Zo,key:t})))},this.getHeadlineElements=t.getHeadlineElements,this.getSupportingTextElements=t.getSupportingTextElements,this.getDefaultElements=t.getDefaultElements,this.getInteractiveElement=t.getInteractiveElement,this.host.addController(this)}get typeaheadText(){if(null!==this.internalTypeaheadText)return this.internalTypeaheadText;const e=this.getHeadlineElements(),t=[];return e.forEach(e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())}),0===t.length&&this.getDefaultElements().forEach(e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())}),0===t.length&&this.getSupportingTextElements().forEach(e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())}),t.join(" ")}get tagName(){switch(this.host.type){case"link":return"a";case"button":return"button";default:return"li"}}get role(){return"option"===this.host.type?"option":"menuitem"}hostConnected(){this.host.toggleAttribute("md-menu-item",!0)}hostUpdate(){this.host.href&&(this.host.type="link")}setTypeaheadText(e){this.internalTypeaheadText=e}}class Ai{get role(){return this.menuItemController.role}get typeaheadText(){return this.menuItemController.typeaheadText}setTypeaheadText(e){this.menuItemController.setTypeaheadText(e)}get displayText(){return null!==this.internalDisplayText?this.internalDisplayText:this.menuItemController.typeaheadText}setDisplayText(e){this.internalDisplayText=e}constructor(e,t){this.host=e,this.internalDisplayText=null,this.firstUpdate=!0,this.onClick=()=>{this.menuItemController.onClick()},this.onKeydown=e=>{this.menuItemController.onKeydown(e)},this.lastSelected=this.host.selected,this.menuItemController=new Ti(e,t),e.addController(this)}hostUpdate(){this.lastSelected!==this.host.selected&&(this.host.ariaSelected=this.host.selected?"true":"false")}hostUpdated(){this.lastSelected===this.host.selected||this.firstUpdate||(this.host.selected?this.host.dispatchEvent(new Event("request-selection",{bubbles:!0,composed:!0})):this.host.dispatchEvent(new Event("request-deselection",{bubbles:!0,composed:!0}))),this.lastSelected=this.host.selected,this.firstUpdate=!1}}const ki=Le(he);class Ii extends ki{constructor(){super(...arguments),this.disabled=!1,this.isMenuItem=!0,this.selected=!1,this.value="",this.type="option",this.selectOptionController=new Ai(this,{getHeadlineElements:()=>this.headlineElements,getSupportingTextElements:()=>this.supportingTextElements,getDefaultElements:()=>this.defaultElements,getInteractiveElement:()=>this.listItemRoot})}get typeaheadText(){return this.selectOptionController.typeaheadText}set typeaheadText(e){this.selectOptionController.setTypeaheadText(e)}get displayText(){return this.selectOptionController.displayText}set displayText(e){this.selectOptionController.setDisplayText(e)}render(){return this.renderListItem(W`
|
|
409
|
+
<md-item>
|
|
410
|
+
<div slot="container">
|
|
411
|
+
${this.renderRipple()} ${this.renderFocusRing()}
|
|
412
|
+
</div>
|
|
413
|
+
<slot name="start" slot="start"></slot>
|
|
414
|
+
<slot name="end" slot="end"></slot>
|
|
415
|
+
${this.renderBody()}
|
|
416
|
+
</md-item>
|
|
417
|
+
`)}renderListItem(e){return W`
|
|
418
|
+
<li
|
|
419
|
+
id="item"
|
|
420
|
+
tabindex=${this.disabled?-1:0}
|
|
421
|
+
role=${this.selectOptionController.role}
|
|
422
|
+
aria-label=${this.ariaLabel||K}
|
|
423
|
+
aria-selected=${this.ariaSelected||K}
|
|
424
|
+
aria-checked=${this.ariaChecked||K}
|
|
425
|
+
aria-expanded=${this.ariaExpanded||K}
|
|
426
|
+
aria-haspopup=${this.ariaHasPopup||K}
|
|
427
|
+
class="list-item ${Ie(this.getRenderClasses())}"
|
|
428
|
+
@click=${this.selectOptionController.onClick}
|
|
429
|
+
@keydown=${this.selectOptionController.onKeydown}
|
|
430
|
+
>${e}</li
|
|
431
|
+
>
|
|
432
|
+
`}renderRipple(){return W` <md-ripple
|
|
433
|
+
part="ripple"
|
|
434
|
+
for="item"
|
|
435
|
+
?disabled=${this.disabled}></md-ripple>`}renderFocusRing(){return W` <md-focus-ring
|
|
436
|
+
part="focus-ring"
|
|
437
|
+
for="item"
|
|
438
|
+
inward></md-focus-ring>`}getRenderClasses(){return{disabled:this.disabled,selected:this.selected}}renderBody(){return W`
|
|
439
|
+
<slot></slot>
|
|
440
|
+
<slot name="overline" slot="overline"></slot>
|
|
441
|
+
<slot name="headline" slot="headline"></slot>
|
|
442
|
+
<slot name="supporting-text" slot="supporting-text"></slot>
|
|
443
|
+
<slot
|
|
444
|
+
name="trailing-supporting-text"
|
|
445
|
+
slot="trailing-supporting-text"></slot>
|
|
446
|
+
`}focus(){this.listItemRoot?.focus()}}Ii.shadowRootOptions={...he.shadowRootOptions,delegatesFocus:!0},t([fe({type:Boolean,reflect:!0})],Ii.prototype,"disabled",void 0),t([fe({type:Boolean,attribute:"md-menu-item",reflect:!0})],Ii.prototype,"isMenuItem",void 0),t([fe({type:Boolean})],Ii.prototype,"selected",void 0),t([fe()],Ii.prototype,"value",void 0),t([ye(".list-item")],Ii.prototype,"listItemRoot",void 0),t([_e({slot:"headline"})],Ii.prototype,"headlineElements",void 0),t([_e({slot:"supporting-text"})],Ii.prototype,"supportingTextElements",void 0),t([function(e){return(t,o)=>{const{slot:i}=e??{},r="slot"+(i?`[name=${i}]`:":not([name])");return be(t,o,{get(){const t=this.renderRoot?.querySelector(r);return t?.assignedNodes(e)??[]}})}}({slot:""})],Ii.prototype,"defaultElements",void 0),t([fe({attribute:"typeahead-text"})],Ii.prototype,"typeaheadText",null),t([fe({attribute:"display-text"})],Ii.prototype,"displayText",null);let Ri=class extends Ii{};Ri.styles=[wi],Ri=t([ue("md-select-option")],Ri);const Pi=new Set(Object.values(Mo));class Oi extends he{get items(){return this.listController.items}constructor(){super(),this.listController=new Vo({isItem:e=>e.hasAttribute("md-list-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>"rtl"===getComputedStyle(this).direction,deactivateItem:e=>{e.tabIndex=-1},activateItem:e=>{e.tabIndex=0},isNavigableKey:e=>Pi.has(e),isActivatable:e=>!e.disabled&&"text"!==e.type}),this.internals=this.attachInternals(),this.internals.role="list",this.addEventListener("keydown",this.listController.handleKeydown)}render(){return W`
|
|
447
|
+
<slot
|
|
448
|
+
@deactivate-items=${this.listController.onDeactivateItems}
|
|
449
|
+
@request-activation=${this.listController.onRequestActivation}
|
|
450
|
+
@slotchange=${this.listController.onSlotchange}>
|
|
451
|
+
</slot>
|
|
452
|
+
`}activateNextItem(){return this.listController.activateNextItem()}activatePreviousItem(){return this.listController.activatePreviousItem()}}t([_e({flatten:!0})],Oi.prototype,"slotItems",void 0);const zi=a`:host{background:var(--md-list-container-color, var(--md-sys-color-surface, #fef7ff));color:unset;display:flex;flex-direction:column;outline:none;padding:8px 0;position:relative}
|
|
453
|
+
`;zi.styleSheet;let qi=class extends Oi{};qi.styles=[zi],qi=t([ue("md-list")],qi);const Li=Le(he);class Di extends Li{constructor(){super(...arguments),this.disabled=!1,this.type="text",this.isListItem=!0,this.href="",this.target=""}get isDisabled(){return this.disabled&&"link"!==this.type}willUpdate(e){this.href&&(this.type="link"),super.willUpdate(e)}render(){return this.renderListItem(W`
|
|
454
|
+
<md-item>
|
|
455
|
+
<div slot="container">
|
|
456
|
+
${this.renderRipple()} ${this.renderFocusRing()}
|
|
457
|
+
</div>
|
|
458
|
+
<slot name="start" slot="start"></slot>
|
|
459
|
+
<slot name="end" slot="end"></slot>
|
|
460
|
+
${this.renderBody()}
|
|
461
|
+
</md-item>
|
|
462
|
+
`)}renderListItem(e){const t="link"===this.type;let o;switch(this.type){case"link":o=ut`a`;break;case"button":o=ut`button`;break;default:o=ut`li`}const i="text"!==this.type,r=t&&this.target?this.target:K;return mt`
|
|
463
|
+
<${o}
|
|
464
|
+
id="item"
|
|
465
|
+
tabindex="${this.isDisabled||!i?-1:0}"
|
|
466
|
+
?disabled=${this.isDisabled}
|
|
467
|
+
role="listitem"
|
|
468
|
+
aria-selected=${this.ariaSelected||K}
|
|
469
|
+
aria-checked=${this.ariaChecked||K}
|
|
470
|
+
aria-expanded=${this.ariaExpanded||K}
|
|
471
|
+
aria-haspopup=${this.ariaHasPopup||K}
|
|
472
|
+
class="list-item ${Ie(this.getRenderClasses())}"
|
|
473
|
+
href=${this.href||K}
|
|
474
|
+
target=${r}
|
|
475
|
+
@focus=${this.onFocus}
|
|
476
|
+
>${e}</${o}>
|
|
477
|
+
`}renderRipple(){return"text"===this.type?K:W` <md-ripple
|
|
478
|
+
part="ripple"
|
|
479
|
+
for="item"
|
|
480
|
+
?disabled=${this.isDisabled}></md-ripple>`}renderFocusRing(){return"text"===this.type?K:W` <md-focus-ring
|
|
481
|
+
@visibility-changed=${this.onFocusRingVisibilityChanged}
|
|
482
|
+
part="focus-ring"
|
|
483
|
+
for="item"
|
|
484
|
+
inward></md-focus-ring>`}onFocusRingVisibilityChanged(e){}getRenderClasses(){return{disabled:this.isDisabled}}renderBody(){return W`
|
|
485
|
+
<slot></slot>
|
|
486
|
+
<slot name="overline" slot="overline"></slot>
|
|
487
|
+
<slot name="headline" slot="headline"></slot>
|
|
488
|
+
<slot name="supporting-text" slot="supporting-text"></slot>
|
|
489
|
+
<slot
|
|
490
|
+
name="trailing-supporting-text"
|
|
491
|
+
slot="trailing-supporting-text"></slot>
|
|
492
|
+
`}onFocus(){-1===this.tabIndex&&this.dispatchEvent(new Event("request-activation",{bubbles:!0,composed:!0}))}focus(){this.listItemRoot?.focus()}click(){this.listItemRoot?this.listItemRoot.click():super.click()}}Di.shadowRootOptions={...he.shadowRootOptions,delegatesFocus:!0},t([fe({type:Boolean,reflect:!0})],Di.prototype,"disabled",void 0),t([fe({reflect:!0})],Di.prototype,"type",void 0),t([fe({type:Boolean,attribute:"md-list-item",reflect:!0})],Di.prototype,"isListItem",void 0),t([fe()],Di.prototype,"href",void 0),t([fe()],Di.prototype,"target",void 0),t([ye(".list-item")],Di.prototype,"listItemRoot",void 0);const Ni=a`:host{display:flex;gap:16px;-webkit-tap-highlight-color:rgba(0,0,0,0);--md-ripple-hover-color: var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-list-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-list-item-pressed-state-layer-opacity, 0.12)}:host(:is([type=button]:not([disabled]),[type=link])){cursor:pointer}md-focus-ring{z-index:1;--md-focus-ring-shape: 8px}a,button,li{background:none;border:none;cursor:inherit;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;gap:inherit;max-width:inherit;min-width:inherit;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);width:100%}.list-item.interactive{cursor:pointer}.list-item.disabled{opacity:var(--md-list-item-disabled-opacity, 0.3);pointer-events:none}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;height:100%;color:var(--md-list-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));font-family:var(--md-list-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-list-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-list-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));min-height:var(--md-list-item-one-line-container-height, 56px);padding-top:var(--md-list-item-top-space, 12px);padding-bottom:var(--md-list-item-bottom-space, 12px);padding-inline-start:var(--md-list-item-leading-space, 16px);padding-inline-end:var(--md-list-item-trailing-space, 16px);gap:inherit}md-item[multiline]{min-height:var(--md-list-item-two-line-container-height, 72px)}[slot=supporting-text]{color:var(--md-list-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-list-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-list-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-list-item-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)))}[slot=trailing-supporting-text]{color:var(--md-list-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-list-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.6875rem));line-height:var(--md-list-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-list-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}[slot=end]{color:var(--md-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}@media(forced-colors: active){.disabled slot{color:GrayText}.list-item.disabled{color:GrayText;opacity:1}}
|
|
493
|
+
`;Ni.styleSheet;let Fi=class extends Di{};Fi.styles=[Ni],Fi=t([ue("md-list-item")],Fi);const Ui=["I".charCodeAt(0),"M".charCodeAt(0),"P".charCodeAt(0),"R".charCodeAt(0),"O".charCodeAt(0),"V".charCodeAt(0),1];var Bi,Mi;!function(e){e[e.CURRENT_STATE=1]="CURRENT_STATE",e[e.ERROR_STATE=2]="ERROR_STATE",e[e.RPC=3]="RPC",e[e.RPC_RESULT=4]="RPC_RESULT"}(Bi||(Bi={})),function(e){e[e.STOPPED=0]="STOPPED",e[e.READY=2]="READY",e[e.PROVISIONING=3]="PROVISIONING",e[e.PROVISIONED=4]="PROVISIONED"}(Mi||(Mi={}));const Vi={0:"NO_ERROR",1:"INVALID_RPC_PACKET",2:"UNKNOWN_RPC_COMMAND",3:"UNABLE_TO_CONNECT",5:"BAD_HOSTNAME",254:"TIMEOUT",255:"UNKNOWN_ERROR"};class Hi extends Error{constructor(){super("Port is not ready")}}const Wi=e=>"["+e.map(e=>((e,t=2)=>{let o=e.toString(16).toUpperCase();return o.startsWith("-")?"-0x"+o.substring(1).padStart(t,"0"):"0x"+o.padStart(t,"0")})(e)).join(", ")+"]",ji=e=>e.sort((e,t)=>e.name.toLocaleLowerCase().localeCompare(t.name.toLocaleLowerCase())),Zi=(e,t)=>{const o=new Map;for(const t of e)o.set(t.name,t);for(const e of t)o.set(e.name,e);return ji(Array.from(o.values()))},Ki=(e,t)=>e.length!==t.length||e.some((e,o)=>e.name!==t[o].name||e.rssi!==t[o].rssi||e.secured!==t[o].secured);class Gi extends EventTarget{get error(){return this._error}set error(e){this._error=e,this.dispatchEvent(new CustomEvent("error-changed",{detail:this._error}))}get networkState(){return this._networkState}constructor(e,t){if(super(),this.port=e,this.logger=t,this._error=0,this._rpcLock=Promise.resolve(),null===e.readable)throw new Error("Port is not readable");if(null===e.writable)throw new Error("Port is not writable")}async initialize(e=1e3){if(this.logger.log("Initializing Improv Serial"),this._processInput(),void 0===this._reader)throw new Hi;let t;try{await new Promise(async(o,i)=>{setTimeout(()=>i(new Error("Improv Wi-Fi Serial not detected")),e),t=setInterval(()=>this._sendRPC(2,[]),1e3),await this.requestCurrentState(),o(void 0)}),clearInterval(t),await this.requestInfo()}catch(e){throw await this.close(),e}finally{clearInterval(t)}return this.info}async close(){this.stopNetworkStatePolling(),this._reader&&await new Promise(e=>{this._reader.cancel(),this.addEventListener("disconnect",e,{once:!0})})}async requestCurrentState(e){var t;const o=new AbortController;let i;try{await new Promise((t,r)=>{this.addEventListener("state-changed",()=>{var e;2===(null===(e=this._rpcFeedback)||void 0===e?void 0:e.command)&&t()},{signal:o.signal}),i=this._sendRPCWithResponse(2,[],e),i.catch(r)})}catch(e){throw new Error(`Error fetching current state: ${e}`)}finally{o.abort()}this.state===Mi.PROVISIONED?this.nextUrl=(await i)[0]:null===(t=this._rpcFeedback)||void 0===t||t.resolve([])}async requestInfo(e){const t=await this._sendRPCWithResponse(3,[],e);this.info={firmware:t[0],version:t[1],name:t[3],chipFamily:t[2],osName:t.length>4?t[4]:null,osVersion:t.length>5?t[5]:null}}async provision(e,t,o){const i=new TextEncoder,r=i.encode(e),n=i.encode(t),s=[r.length,...r,n.length,...n],a=await this._sendRPCWithResponse(1,s,o);this.nextUrl=a[0]}async scan(e){const t=(await this._sendRPCWithMultipleResponses(4,[],e)).map(([e,t,o])=>({name:e,rssi:parseInt(t),secured:"NO"!==o}));return ji(t)}subscribeSSIDs(e){let t,o,i=!0;const r=(async()=>{for(;i;){let r;try{r=await this.scan(3e4)}catch(o){this.logger.error("Error while scanning for Wi-Fi networks",o),i&&void 0===t&&e(null);break}if(!i)break;const n=void 0===t?r:Zi(t,r);(void 0===t||Ki(t,n))&&(t=n,e(n)),await new Promise(e=>{o=e,setTimeout(e,3e3)})}})();return()=>(i=!1,null==o||o(),r)}async getHostname(e){return(await this._sendRPCWithResponse(5,[],e))[0]}async setHostname(e,t){const o=new TextEncoder;return(await this._sendRPCWithResponse(5,[...o.encode(e)],t))[0]}async getDeviceName(e){return(await this._sendRPCWithResponse(6,[],e))[0]}async setDeviceName(e,t){const o=new TextEncoder,i=await this._sendRPCWithResponse(6,[...o.encode(e)],t);return this.info&&(this.info.name=i[0]),i[0]}requestNetworkState(e){return this._requestNetworkState(e,!1)}startNetworkStatePolling(e=2500,t=500){if(this._stopNetworkStatePolling||null===this.networkState||!this._reader)return;let o,i=!0;this._stopNetworkStatePolling=()=>{i=!1,null==o||o()},(async()=>{for(;i;){try{await this._requestNetworkState(t,!0)}catch(e){if(null===this.networkState)break;this.logger.debug(`Failed to fetch network state: ${e}`)}if(!i)break;await new Promise(t=>{o=t,setTimeout(t,e)})}i&&(this._stopNetworkStatePolling=void 0)})()}stopNetworkStatePolling(){var e;null===(e=this._stopNetworkStatePolling)||void 0===e||e.call(this),this._stopNetworkStatePolling=void 0}async _requestNetworkState(e,t){let o;try{o=await this._sendRPCWithResponse(7,[],e,t)}catch(e){throw e===Vi[2]&&this._setNetworkState(null),e}const i=parseInt(o[0]),r={online:!!(1&i),supportsWifi:!!(2&i),supportsEthernet:!!(4&i),supportsThread:!!(8&i),supportsModem:!!(16&i),urls:o.slice(1)};return this._setNetworkState(r),r}_setNetworkState(e){const t=this._networkState;this._networkState=e,t===e||null!=t&&null!=e&&((e,t)=>e.online===t.online&&e.supportsWifi===t.supportsWifi&&e.supportsEthernet===t.supportsEthernet&&e.supportsThread===t.supportsThread&&e.supportsModem===t.supportsModem&&e.urls.length===t.urls.length&&e.urls.every((e,o)=>e===t.urls[o]))(t,e)||this.dispatchEvent(new CustomEvent("network-state-changed",{detail:e}))}_sendRPC(e,t){this.writePacketToStream(Bi.RPC,[e,t.length,...t])}_enqueueRPC(e,t){const o=()=>this._awaitRPCResultWithTimeout(e(),t).finally(()=>{this._rpcFeedback=void 0}),i=this._rpcLock.then(o,o);return this._rpcLock=i.catch(()=>{}),i}_sendRPCWithResponse(e,t,o=3e4,i=!1){return this._enqueueRPC(()=>new Promise((o,r)=>{this._rpcFeedback={command:e,resolve:o,reject:r,quiet:i},this._sendRPC(e,t)}),o)}_sendRPCWithMultipleResponses(e,t,o=3e4){return this._enqueueRPC(()=>new Promise((o,i)=>{this._rpcFeedback={command:e,resolve:o,reject:i,receivedData:[]},this._sendRPC(e,t)}),o)}async _awaitRPCResultWithTimeout(e,t){if(!t)return await e;const o=setTimeout(()=>this._setError(254),t);try{return await e}finally{clearTimeout(o)}}async _processInput(){this.logger.debug("Starting read loop"),this._reader=this.port.readable.getReader();try{let e,t=[],o=0;for(;;){const{value:i,done:r}=await this._reader.read();if(r)break;if(i&&0!==i.length)for(const r of i){if(!1===e){10===r&&(e=void 0);continue}if(!0===e){t.push(r),t.length===o&&(this._handleIncomingPacket(t),e=void 0,t=[]);continue}if(10===r){t=[];continue}if(t.push(r),9!==t.length)continue;if(e="IMPROV"===String.fromCharCode(...t.slice(0,6)),!e){t=[];continue}o=9+t[8]+1}}}catch(e){this.logger.error("Error while reading serial port",e)}finally{this._reader.releaseLock(),this._reader=void 0}this.logger.debug("Finished read loop"),this.stopNetworkStatePolling(),this.dispatchEvent(new Event("disconnect"))}_handleIncomingPacket(e){const t=e.slice(6),o=t[0],i=t[1],r=t[2],n=t.slice(3,3+r);if(this.logger.debug("PROCESS",{version:o,packetType:i,packetLength:r,data:Wi(n)}),1!==o)return void this.logger.error("Received unsupported version",o);let s=t[3+r],a=0;for(let t=0;t<e.length-1;t++)a+=e[t];if(a&=255,a===s)if(i===Bi.CURRENT_STATE)this.state=n[0],this.state!==Mi.PROVISIONED&&(this.nextUrl=void 0),this.dispatchEvent(new CustomEvent("state-changed",{detail:this.state}));else if(i===Bi.ERROR_STATE)this._setError(n[0]);else if(i===Bi.RPC_RESULT){if(!this._rpcFeedback)return void this.logger.error("Received result while not waiting for one");const e=n[0];if(e!==this._rpcFeedback.command)return void this.logger.error(`Received result for command ${e} but expected ${this._rpcFeedback.command}`);const t=[],o=n[1],i=new TextDecoder("utf-8");let r=2;for(;r<2+o;)t.push(i.decode(new Uint8Array(n.slice(r+1,r+n[r]+1)))),r+=n[r]+1;"receivedData"in this._rpcFeedback?t.length>0?this._rpcFeedback.receivedData.push(t):this._rpcFeedback.resolve(this._rpcFeedback.receivedData):this._rpcFeedback.resolve(t)}else this.logger.error("Unable to handle packet",t);else this.logger.error(`Received invalid checksum ${s}. Expected ${a}`)}async writePacketToStream(e,t){const o=new Uint8Array([...Ui,e,t.length,...t,0,0]);o[o.length-2]=255&o.reduce((e,t)=>e+t,0),o[o.length-1]=10,this.logger.debug("Writing to stream:",Wi(new Array(...o)));const i=this.port.writable.getWriter();await i.write(o);try{i.releaseLock()}catch(e){console.error("Ignoring release lock error",e)}}_setError(e){e>0&&this._rpcFeedback&&(this._rpcFeedback.reject(Vi[e]||`UNKNOWN_ERROR (${e})`),this._rpcFeedback.quiet)||(this.error=e)}}const Yi="⚠️",Xi=j`
|
|
494
|
+
<svg viewBox="0 -960 960 960" width="24px">
|
|
495
|
+
<path
|
|
496
|
+
fill="currentColor"
|
|
497
|
+
d="M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"
|
|
498
|
+
/>
|
|
499
|
+
</svg>
|
|
500
|
+
`,Ji=j`
|
|
501
|
+
<svg viewBox="0 -960 960 960">
|
|
502
|
+
<path
|
|
503
|
+
fill="currentColor"
|
|
504
|
+
d="M480-120q-42 0-71-29t-29-71q0-42 29-71t71-29q42 0 71 29t29 71q0 42-29 71t-71 29ZM254-346l-84-86q59-59 138.5-93.5T480-560q92 0 171.5 35T790-430l-84 84q-44-44-102-69t-124-25q-66 0-124 25t-102 69ZM84-516 0-600q92-94 215-147t265-53q142 0 265 53t215 147l-84 84q-77-77-178.5-120.5T480-680q-116 0-217.5 43.5T84-516Z"
|
|
505
|
+
/>
|
|
506
|
+
</svg>
|
|
507
|
+
`,Qi=j`
|
|
508
|
+
<svg viewBox="0 -960 960 960" width="24px">
|
|
509
|
+
<path
|
|
510
|
+
fill="currentColor"
|
|
511
|
+
d="M480-120 0-600q95-97 219.5-148.5T480-800q137 0 261 51t219 149L480-120ZM174-540q67-48 145-74t161-26q83 0 161 26t145 74l58-58q-79-60-172-91t-192-31q-99 0-192 31t-172 91l58 58Z"
|
|
512
|
+
/>
|
|
513
|
+
</svg>
|
|
514
|
+
`,er=j`
|
|
515
|
+
<svg viewBox="0 -960 960 960" width="24px">
|
|
516
|
+
<path
|
|
517
|
+
fill="currentColor"
|
|
518
|
+
d="M480-120 0-600q96-98 220-149t260-51q137 0 261 51t219 149L480-120ZM232-482q53-38 116-59.5T480-563q69 0 132 21.5T728-482l116-116q-78-59-170.5-90.5T480-720q-101 0-193.5 31.5T116-598l116 116Z"
|
|
519
|
+
/>
|
|
520
|
+
</svg>
|
|
521
|
+
`,tr=j`
|
|
522
|
+
<svg viewBox="0 -960 960 960" width="24px">
|
|
523
|
+
<path
|
|
524
|
+
fill="currentColor"
|
|
525
|
+
d="M480-120 0-600q96-98 220-149t260-51q137 0 261 51t219 149L480-120ZM299-415q38-28 84-43.5t97-15.5q51 0 97 15.5t84 43.5l183-183q-78-59-170.5-90.5T480-720q-101 0-193.5 31.5T116-598l183 183Z"
|
|
526
|
+
/>
|
|
527
|
+
</svg>
|
|
528
|
+
`,or=j`
|
|
529
|
+
<svg viewBox="0 -960 960 960" width="24px">
|
|
530
|
+
<path
|
|
531
|
+
fill="currentColor"
|
|
532
|
+
d="M480-120 0-600q96-98 220-149t260-51q137 0 261 51t219 149L480-120ZM361-353q25-18 55.5-28t63.5-10q33 0 63.5 10t55.5 28l245-245q-78-59-170.5-90.5T480-720q-101 0-193.5 31.5T116-598l245 245Z"
|
|
533
|
+
/>
|
|
534
|
+
</svg>
|
|
535
|
+
`,ir=j`
|
|
536
|
+
<svg viewBox="0 -960 960 960" width="24px">
|
|
537
|
+
<path
|
|
538
|
+
fill="currentColor"
|
|
539
|
+
d="M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm0-80h480v-400H240v400Zm240-120q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM360-640h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80ZM240-160v-400 400Z"
|
|
540
|
+
/>
|
|
541
|
+
</svg>
|
|
542
|
+
`,rr=j`
|
|
543
|
+
<svg viewBox="0 -960 960 960" width="24px">
|
|
544
|
+
<path
|
|
545
|
+
fill="currentColor"
|
|
546
|
+
d="M240-160h480v-400H240v400Zm240-120q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM240-160v-400 400Zm0 80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h280v-80q0-83 58.5-141.5T720-920q83 0 141.5 58.5T920-720h-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80h120q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Z"
|
|
547
|
+
/>
|
|
548
|
+
</svg>
|
|
549
|
+
`,nr=j`
|
|
550
|
+
<svg viewBox="0 -960 960 960">
|
|
551
|
+
<path
|
|
552
|
+
fill="currentColor"
|
|
553
|
+
d="M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"
|
|
554
|
+
/>
|
|
555
|
+
</svg>
|
|
556
|
+
`,sr=j`
|
|
557
|
+
<svg viewBox="0 -960 960 960">
|
|
558
|
+
<path
|
|
559
|
+
fill="currentColor"
|
|
560
|
+
d="m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"
|
|
561
|
+
/>
|
|
562
|
+
</svg>
|
|
563
|
+
`;function ar(e){return e.length?e.reduce((e,t)=>t.rssi>e.rssi?t:e).name:null}let lr=class extends he{constructor(){super(...arguments),this.logger=console,this._state="CONNECTING",this._busy=!1,this._selectedSsid=null,this._showPassword=!1,this._reprovision=!1}render(){var e,t,o,i;if(!this.port)return W``;let r,n,s=W`${null!==(i=null===(t=null===(e=this._client)||void 0===e?void 0:e.info)||void 0===t?void 0:t.name)&&void 0!==i?i:K}`;return"CONNECTING"!==this._state&&this._client?"ERROR"===this._state?(r=this._renderMessage(Yi,`An error occurred. ${this._error}`),n=this._renderCloseAction()):this._client.state===Mi.STOPPED?(r=this._renderMessage(Yi,"The connected device has Wi-Fi turned off, so it can't be configured right now. Enable the device's Wi-Fi, then try again."),n=this._renderCloseAction()):this._showConfigureForm?this._busy?r=this._renderProgress("Provisioning"):(s=W`<md-filled-tonal-icon-button
|
|
564
|
+
>${Ji}</md-filled-tonal-icon-button
|
|
565
|
+
>Configure Wi-Fi`,void 0===this._ssids?r=this._renderProgress("Searching for networks"):(r=this._renderImprovReady(),n=W`${this._renderCloseAction()}
|
|
566
|
+
<md-filled-button @click=${this._provision}
|
|
567
|
+
>Connect</md-filled-button
|
|
568
|
+
> `)):this._client.state===Mi.PROVISIONING?r=this._renderProgress("Provisioning"):this._client.state===Mi.PROVISIONED?(r=W`
|
|
569
|
+
${(null===(o=this._client)||void 0===o?void 0:o.info)?this._renderDeviceInfo():K}
|
|
570
|
+
<div class="center">
|
|
571
|
+
<div class="icon">${"🎉"}</div>
|
|
572
|
+
Provisioned!
|
|
573
|
+
</div>
|
|
574
|
+
`,n=W`${this._renderCloseAction()}
|
|
575
|
+
<md-outlined-button @click=${this._changeWifi}
|
|
576
|
+
>Change Wi-Fi</md-outlined-button
|
|
577
|
+
>
|
|
578
|
+
${void 0===this._client.nextUrl?K:W`<md-filled-button
|
|
579
|
+
href=${this._client.nextUrl}
|
|
580
|
+
form="improv-form"
|
|
581
|
+
>Visit Device</md-filled-button
|
|
582
|
+
>`}`):(r=this._renderMessage(Yi,`Unexpected state: ${this._state} - ${this._client.state}`),n=this._renderCloseAction()):r=this._renderProgress("Connecting"),W`
|
|
583
|
+
<md-dialog open @close=${this._handleClose}>
|
|
584
|
+
<div slot="headline">${s}</div>
|
|
585
|
+
<form slot="content" id="improv-form" method="dialog">${r}</form>
|
|
586
|
+
${n?W`<div slot="actions">${n}</div>`:K}
|
|
587
|
+
</md-dialog>
|
|
588
|
+
`}_renderCloseAction(){return W`<md-outlined-button
|
|
589
|
+
form="improv-form"
|
|
590
|
+
@click=${this._handleClose}
|
|
591
|
+
>Close</md-outlined-button
|
|
592
|
+
>`}_renderProgress(e){return W`
|
|
593
|
+
<div class="center">
|
|
594
|
+
<div>
|
|
595
|
+
<md-circular-progress indeterminate></md-circular-progress>
|
|
596
|
+
</div>
|
|
597
|
+
${e}
|
|
598
|
+
</div>
|
|
599
|
+
`}_renderMessage(e,t){return W`
|
|
600
|
+
<div class="center">
|
|
601
|
+
<div class="icon">${e}</div>
|
|
602
|
+
${t}
|
|
603
|
+
</div>
|
|
604
|
+
`}_renderImprovReady(){var e,t;let o;switch(this._client.error){case 3:o="Unable to connect";break;case 0:break;case 2:null!==this._ssids&&(o="Unknown RPC command");break;case 254:o="Timeout";break;default:o=`Unknown error (${this._client.error})`}const i=null===(e=this._ssids)||void 0===e?void 0:e.find(e=>e.name===this._selectedSsid);return W`
|
|
605
|
+
${(null===(t=this._client)||void 0===t?void 0:t.info)?this._renderDeviceInfo():K}
|
|
606
|
+
<div>
|
|
607
|
+
Enter credentials of the Wi-Fi network that you want your device to
|
|
608
|
+
connect to.
|
|
609
|
+
</div>
|
|
610
|
+
${o?W`<p class="error">${o}</p>`:K}
|
|
611
|
+
${null!==this._ssids?W`
|
|
612
|
+
<md-outlined-select
|
|
613
|
+
name="ssid_select"
|
|
614
|
+
required
|
|
615
|
+
label="Network"
|
|
616
|
+
@change=${e=>{const t=e.target.selectedIndex;this._selectedSsid=t===this._ssids.length?null:this._ssids[t].name}}
|
|
617
|
+
@closed=${e=>e.stopPropagation()}
|
|
618
|
+
>
|
|
619
|
+
${this._ssids.map((e,t)=>{return W`
|
|
620
|
+
<md-select-option
|
|
621
|
+
.selected=${i===e}
|
|
622
|
+
value=${t}
|
|
623
|
+
>
|
|
624
|
+
<span
|
|
625
|
+
slot="start"
|
|
626
|
+
class=${o=e.rssi,o>=-50?"signal-excellent":o>=-60?"signal-good":o>=-70?"signal-fair":"signal-weak"}
|
|
627
|
+
>${function(e){return e>=-50?Qi:e>=-60?er:e>=-70?tr:or}(e.rssi)}</span
|
|
628
|
+
>
|
|
629
|
+
<span slot="headline">${e.name}</span>
|
|
630
|
+
<span slot="end" class="network-details">
|
|
631
|
+
<span class="signal-strength">${e.rssi}dB</span>
|
|
632
|
+
<span
|
|
633
|
+
class="lock-icon ${e.secured?"lock-secured":"lock-unsecured"}"
|
|
634
|
+
>${e.secured?ir:rr}</span
|
|
635
|
+
>
|
|
636
|
+
</span>
|
|
637
|
+
</md-select-option>
|
|
638
|
+
`;var o})}
|
|
639
|
+
<md-select-option .selected=${!i} value="-1">
|
|
640
|
+
Join other…
|
|
641
|
+
</md-select-option>
|
|
642
|
+
</md-outlined-select>
|
|
643
|
+
`:K}
|
|
644
|
+
${null===this._selectedSsid?W`
|
|
645
|
+
<md-outlined-text-field
|
|
646
|
+
required
|
|
647
|
+
label="Network Name"
|
|
648
|
+
name="ssid"
|
|
649
|
+
></md-outlined-text-field>
|
|
650
|
+
`:K}
|
|
651
|
+
${!i||i.secured?W`
|
|
652
|
+
<md-outlined-text-field
|
|
653
|
+
required
|
|
654
|
+
label="Password"
|
|
655
|
+
name="password"
|
|
656
|
+
type=${this._showPassword?"text":"password"}
|
|
657
|
+
@keydown=${e=>{"Enter"===e.key&&this._provision()}}
|
|
658
|
+
>
|
|
659
|
+
<md-icon-button
|
|
660
|
+
slot="trailing-icon"
|
|
661
|
+
@click=${this._togglePasswordVisibility}
|
|
662
|
+
toggle
|
|
663
|
+
.selected=${this._showPassword}
|
|
664
|
+
>
|
|
665
|
+
${this._showPassword?sr:nr}
|
|
666
|
+
</md-icon-button>
|
|
667
|
+
</md-outlined-text-field>
|
|
668
|
+
`:K}
|
|
669
|
+
`}_renderDeviceInfo(){return W`<div class="device-info">
|
|
670
|
+
<div>${Xi}Device Info</div>
|
|
671
|
+
<div>Name<span>${this._client.info.name}</span></div>
|
|
672
|
+
<div>Firmware<span>${this._client.info.firmware}</span></div>
|
|
673
|
+
<div>Version<span>${this._client.info.version}</span></div>
|
|
674
|
+
<div>Chip<span>${this._client.info.chipFamily}</span></div>
|
|
675
|
+
${this._client.info.osName?W`<div>OS<span>${this._client.info.osName}</span></div>`:K}
|
|
676
|
+
${this._client.info.osVersion?W`<div>
|
|
677
|
+
OS Version<span>${this._client.info.osVersion}</span>
|
|
678
|
+
</div>`:K}
|
|
679
|
+
</div>`}_togglePasswordVisibility(e){e.preventDefault(),e.stopPropagation(),this._showPassword=!this._showPassword}get _showConfigureForm(){var e,t;return(null===(e=this._client)||void 0===e?void 0:e.state)===Mi.READY||(null===(t=this._client)||void 0===t?void 0:t.state)===Mi.PROVISIONED&&this._reprovision}_syncScanning(){const e="IMPROV-STATE"===this._state&&!this._busy&&this._showConfigureForm;e!==!!this._unsubSSIDs&&(e?this._unsubSSIDs=this._client.subscribeSSIDs(e=>{null===e?this._selectedSsid=null:null==this._ssids?this._selectedSsid=ar(e):null===this._selectedSsid||e.some(e=>e.name===this._selectedSsid)||(this._selectedSsid=ar(e)),this._ssids=e}):this._stopScanning())}async _stopScanning(){if(!this._unsubSSIDs)return;const e=this._unsubSSIDs;this._unsubSSIDs=void 0,await e()}async _provision(){var e;const t=null===this._selectedSsid?this._inputSSID.value:this._selectedSsid,o=(null===(e=this._inputPassword)||void 0===e?void 0:e.value)||"";this._busy=!0,await this._stopScanning();try{await this._client.provision(t,o,45e3),this._reprovision=!1}catch(e){console.log(e)}finally{this._busy=!1}}_changeWifi(){this._reprovision=!0}updated(e){let t;super.updated(e),e.has("port")&&this.port&&this._connect(),this._syncScanning(),e.has("_ssids")&&void 0===e.get("_ssids")&&null!=this._ssids?t=this._selectSSID:e.has("_selectedSsid")&&null===this._selectedSsid&&(t=this._inputSSID),t&&t.updateComplete.then(()=>t.focus())}async _connect(){let e;try{e=new Gi(this.port,this.logger)}catch(e){return this._state="ERROR",void(this._error=e.message||e||"Unknown error")}e.addEventListener("state-changed",()=>{this._state="IMPROV-STATE",this.requestUpdate()}),e.addEventListener("error-changed",()=>this.requestUpdate());try{await e.initialize(1e4)}catch(e){return this._state="ERROR",void(this._error=this.learnMoreUrl?W`
|
|
680
|
+
Unable to detect Improv service on connected device.
|
|
681
|
+
<a href=${this.learnMoreUrl} target="_blank"
|
|
682
|
+
>Learn how to resolve this</a
|
|
683
|
+
>
|
|
684
|
+
`:e.message)}e.addEventListener("disconnect",()=>{this._state="ERROR",this._error="Disconnected"}),e.nextUrl&&this.requestUpdate(),this._client=e}async _handleClose(){const t={improv:!1,provisioned:!1};this._client&&(t.improv=!0,t.provisioned=this._client.state===Mi.PROVISIONED,await this._client.close(),this._client=void 0),e(this,"closed",t),this.parentNode.removeChild(this)}disconnectedCallback(){super.disconnectedCallback(),this._stopScanning()}};lr.styles=a`
|
|
685
|
+
:host {
|
|
686
|
+
--md-dialog-max-width: 390px;
|
|
687
|
+
--md-dialog-container-max-block-size: none !important;
|
|
688
|
+
--md-sys-color-primary: var(--improv-primary-color, #03a9f4);
|
|
689
|
+
--md-sys-color-on-primary: var(--improv-on-primary-color, #fff);
|
|
690
|
+
--md-ref-typeface-brand: system-ui, sans-serif;
|
|
691
|
+
--md-ref-typeface-plain: system-ui, sans-serif;
|
|
692
|
+
font-family: system-ui, sans-serif;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
md-dialog {
|
|
696
|
+
--md-dialog-container-color: var(--improv-container-color, #fff);
|
|
697
|
+
--md-dialog-container-max-block-size: none !important;
|
|
698
|
+
max-height: 90vh !important;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
md-dialog [slot="content"],
|
|
702
|
+
form[slot="content"] {
|
|
703
|
+
overflow: visible !important;
|
|
704
|
+
max-height: none !important;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
md-outlined-text-field,
|
|
708
|
+
md-outlined-select {
|
|
709
|
+
display: block;
|
|
710
|
+
margin-top: 16px;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.center {
|
|
714
|
+
text-align: center;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
md-circular-progress {
|
|
718
|
+
margin-bottom: 16px;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
a.has-button {
|
|
722
|
+
text-decoration: none;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.icon {
|
|
726
|
+
font-size: 50px;
|
|
727
|
+
line-height: 80px;
|
|
728
|
+
color: black;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.error {
|
|
732
|
+
color: #db4437;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
.device-info {
|
|
736
|
+
margin-bottom: 16px;
|
|
737
|
+
padding: 16px;
|
|
738
|
+
background-color: #d6d6d6;
|
|
739
|
+
border-radius: 8px;
|
|
740
|
+
border: 1px solid #676767;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
.device-info > div:first-child {
|
|
744
|
+
justify-content: flex-start;
|
|
745
|
+
align-items: center;
|
|
746
|
+
gap: 8px;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.device-info > div {
|
|
750
|
+
display: flex;
|
|
751
|
+
color: #5f6368;
|
|
752
|
+
justify-content: space-between;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.device-info > div > span {
|
|
756
|
+
color: #1f1f1f;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
md-select-option[value="-1"] {
|
|
760
|
+
border-top: 1px solid #ccc;
|
|
761
|
+
}
|
|
762
|
+
md-outlined-select[name="ssid_select"] {
|
|
763
|
+
width: 100%;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
.network-details {
|
|
767
|
+
display: flex;
|
|
768
|
+
align-items: center;
|
|
769
|
+
gap: 4px;
|
|
770
|
+
color: #5f6368;
|
|
771
|
+
font-size: 0.85em;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.signal-strength {
|
|
775
|
+
min-width: 45px;
|
|
776
|
+
text-align: right;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
.lock-icon {
|
|
780
|
+
font-size: 18px;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
.lock-secured {
|
|
784
|
+
color: #34a853;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
.lock-unsecured {
|
|
788
|
+
color: #ea4335;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
.signal-excellent,
|
|
792
|
+
.signal-good {
|
|
793
|
+
color: #34a853;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
.signal-fair {
|
|
797
|
+
color: #fbbc04;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
.signal-weak {
|
|
801
|
+
color: #ea4335;
|
|
802
|
+
}
|
|
803
|
+
`,t([fe()],lr.prototype,"port",void 0),t([ge()],lr.prototype,"_state",void 0),t([ge()],lr.prototype,"_client",void 0),t([ge()],lr.prototype,"_busy",void 0),t([ge()],lr.prototype,"_error",void 0),t([ge()],lr.prototype,"_selectedSsid",void 0),t([ge()],lr.prototype,"_ssids",void 0),t([ge()],lr.prototype,"_showPassword",void 0),t([ge()],lr.prototype,"_reprovision",void 0),t([ye("md-outlined-select")],lr.prototype,"_selectSSID",void 0),t([ye("md-outlined-text-field[name=ssid]")],lr.prototype,"_inputSSID",void 0),t([ye("md-outlined-text-field[name=password]")],lr.prototype,"_inputPassword",void 0),lr=t([ue("improv-wifi-serial-provision-dialog")],lr);
|