diff --git a/Dockerfile b/Dockerfile
index e4a6b323773930e448112d59910fab3cb9a78d66..cf82104f3d11b8a6390f292de6397bee620cba39 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,9 +1,10 @@
-# syntax=docker/dockerfile:1
-FROM python:3
-RUN ls /usr/src/
-RUN cd /usr/src/
-RUN ls
+FROM python:3.9
+
+WORKDIR /app
+
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
-CMD [ "python", "./api.py" ]
\ No newline at end of file
+COPY ./ /app
+
+CMD [ "python", "api.py" ]
\ No newline at end of file
diff --git a/api.py b/api.py
new file mode 100644
index 0000000000000000000000000000000000000000..97e391989dde98b9a193f85e93a91a0bd44dc3a0
--- /dev/null
+++ b/api.py
@@ -0,0 +1,81 @@
+from pymongo import MongoClient
+from pymongo.server_api import ServerApi
+from flask import Flask, request, session, render_template
+import jsonpickle
+
+app = Flask(__name__)
+
+URI = "mongodb+srv://Client:PY@database.s3xgmax.mongodb.net/?retryWrites=true&w=majority"
+
+# Create a new client and connect to the server
+client = MongoClient(URI, server_api=ServerApi("1"))
+
+
+def get(sad):
+ db = client["Auth"]
+ mycol = db["Data"]
+ myquery = {"email": sad}
+ mydoc = mycol.find(myquery)
+
+ sentdata = "lolno"
+ for x in mydoc:
+ sentdata = x
+ lastdata = str(sentdata) # Key to check for in the BSON document
+ key_to_check = 'password'
+ print(lastdata)
+ # Check if the key exists in the BSON document
+ if key_to_check in sentdata:
+ print(
+ f"key exists with the value '{sentdata[key_to_check]}'.")
+ return jsonpickle.encode(lastdata)
+ return "0"
+
+
+# Send a ping to confirm a successful connection
+try:
+ client.admin.command("ping")
+ print("Pinged your deployment. You successfully connected to MongoDB!")
+
+ @app.route("/")
+ def webindex():
+ return render_template("index.html")
+
+ @app.route('/session', methods=['GET', 'POST'])
+ def websession():
+ if request.method == 'POST':
+ # Set session
+ session['username'] = 'trust'
+ session.permanent = True # Long-term validity, one month
+ return "done"
+ else:
+ return "
"
+
+ @app.route('/add', methods=['GET', 'POST'])
+ def webadd():
+ if request.method == 'POST':
+ db = client["Auth"]
+ mycol = db["Data"]
+ mydict = {"email": request.values['email'],
+ "password": request.values['password']}
+ mycol.insert_one(mydict)
+ return "done"
+ return ""
+
+ @app.route('/get', methods=['GET', 'POST'])
+ def webget():
+ if request.method == 'POST':
+ return get(request.values['email'])
+ return ""
+
+ if __name__ == "__main__":
+ app.run(debug=True)
+
+except Exception as e:
+ print(e)
diff --git a/pyvenv.cfg b/pyvenv.cfg
new file mode 100644
index 0000000000000000000000000000000000000000..5ca024bdb810dc88a72a7eff38b48396d80dcc3c
--- /dev/null
+++ b/pyvenv.cfg
@@ -0,0 +1,5 @@
+home = /usr/local/bin
+include-system-site-packages = false
+version = 3.12.0
+executable = /usr/local/bin/python3.12
+command = /usr/local/bin/python -m venv /workspace/env
diff --git a/static/.codesandbox/Dockerfile b/static/.codesandbox/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d4e8dce9bd4337c9b560c3297eb320b1c2413058
--- /dev/null
+++ b/static/.codesandbox/Dockerfile
@@ -0,0 +1 @@
+FROM node:20-bullseye
diff --git a/static/.codesandbox/icon.png b/static/.codesandbox/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..a600a657ce1767146fdefbd1d7534feb31f007b1
Binary files /dev/null and b/static/.codesandbox/icon.png differ
diff --git a/static/.codesandbox/tasks.json b/static/.codesandbox/tasks.json
new file mode 100644
index 0000000000000000000000000000000000000000..078756b349dc2ae10876b27e8e1382b311227ffe
--- /dev/null
+++ b/static/.codesandbox/tasks.json
@@ -0,0 +1,29 @@
+{
+ // These tasks will run in order when initializing your CodeSandbox project.
+ "setupTasks": [
+ {
+ "name": "Install Dependencies",
+ "command": "yarn install"
+ }
+ ],
+
+ // These tasks can be run from CodeSandbox. Running one will open a log in the app.
+ "tasks": {
+ "start": {
+ "name": "start",
+ "command": "rm bundle.js | npx rollup -p @rollup/plugin-node-resolve index.js -o bundle.js | npx http-server",
+ "runAtStart": true,
+ "preview": {
+ "port": 8081
+ }
+ },
+ "build": {
+ "name": "build",
+ "command": "rm bundle.js | npx rollup -p @rollup/plugin-node-resolve index.js -o bundle.js | npx http-server",
+ "runAtStart": false,
+ "preview": {
+ "port": 8080
+ }
+ }
+ }
+}
diff --git a/static/.codesandbox/template.json b/static/.codesandbox/template.json
new file mode 100644
index 0000000000000000000000000000000000000000..0c6ec3f151d1b37629feb8fc7fed60d2c213ea0d
--- /dev/null
+++ b/static/.codesandbox/template.json
@@ -0,0 +1,10 @@
+{
+ "title": "Node.js",
+ "description": "The official Node.js template by the CodeSandbox team",
+ "iconUrl": "https://github.com/codesandbox/sandbox-templates/blob/main/node/.codesandbox/icon.png?raw=true",
+ "tags": [
+ "node",
+ "javascript"
+ ],
+ "published": true
+}
\ No newline at end of file
diff --git a/static/.gitignore b/static/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..b512c09d476623ff4bf8d0d63c29b784925dbdf8
--- /dev/null
+++ b/static/.gitignore
@@ -0,0 +1 @@
+node_modules
\ No newline at end of file
diff --git a/static/ProductSans-Black.woff2 b/static/ProductSans-Black.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..40e1fd6a54137a6783f9e14bcb17d759f797f75a
Binary files /dev/null and b/static/ProductSans-Black.woff2 differ
diff --git a/static/ProductSans-Bold.woff2 b/static/ProductSans-Bold.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..1a651b132db49bd9a37bd40d36e382be029818a6
Binary files /dev/null and b/static/ProductSans-Bold.woff2 differ
diff --git a/static/ProductSans-Light.woff2 b/static/ProductSans-Light.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..eeb744f2b84be07c9e6b058bb22791ed47bccdec
Binary files /dev/null and b/static/ProductSans-Light.woff2 differ
diff --git a/static/ProductSans-Medium.woff2 b/static/ProductSans-Medium.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..217dc7386e1bed05fbb9eacca513c69f14e5a5c5
Binary files /dev/null and b/static/ProductSans-Medium.woff2 differ
diff --git a/static/ProductSans-Regular.woff2 b/static/ProductSans-Regular.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..46ca661f5197a43ce85616a5ca3a6313fbd7e893
Binary files /dev/null and b/static/ProductSans-Regular.woff2 differ
diff --git a/static/ProductSans-Thin.woff2 b/static/ProductSans-Thin.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..7f336f3789535cf34bb15a65fae93af61ab7ce90
Binary files /dev/null and b/static/ProductSans-Thin.woff2 differ
diff --git a/static/README.md b/static/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..540b0499e81deac70d5a55187dcb3663d245a642
--- /dev/null
+++ b/static/README.md
@@ -0,0 +1,10 @@
+# Node.js template
+
+This is a Node.js project.
+
+Add your [configuration](https://codesandbox.io/docs/projects/learn/setting-up/tasks) to optimize it for [CodeSandbox](https://codesandbox.io/p/dashboard).
+
+## Resources
+
+- [CodeSandbox — Docs](https://codesandbox.io/docs/learn)
+- [CodeSandbox — Discord](https://discord.gg/Ggarp3pX5H)
diff --git a/static/bundle.js b/static/bundle.js
new file mode 100644
index 0000000000000000000000000000000000000000..ed5eb742f500adb9046181b859202ebe9889fa22
--- /dev/null
+++ b/static/bundle.js
@@ -0,0 +1,4683 @@
+/******************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */
+/* global Reflect, Promise, SuppressedError, Symbol */
+
+
+function __decorate(decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+}
+
+typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
+ var e = new Error(message);
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
+};
+
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+const e$8=e=>n=>"function"==typeof n?((e,n)=>(customElements.define(e,n),n))(e,n):((e,n)=>{const{kind:t,elements:s}=n;return {kind:t,elements:s,finisher(n){customElements.define(e,n);}}})(e,n);
+
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+const i$6=(i,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(n){n.createProperty(e.key,i);}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this));},finisher(n){n.createProperty(e.key,i);}},e$7=(i,e,n)=>{e.constructor.createProperty(n,i);};function n$7(n){return (t,o)=>void 0!==o?e$7(n,t,o):i$6(n,t)}
+
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */function t$3(t){return n$7({...t,state:!0})}
+
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+const o$6=({finisher:e,descriptor:t})=>(o,n)=>{var r;if(void 0===n){const n=null!==(r=o.originalKey)&&void 0!==r?r:o.key,i=null!=t?{kind:"method",placement:"prototype",key:n,descriptor:t(o.key)}:{...o,key:n};return null!=e&&(i.finisher=function(t){e(t,n);}),i}{const r=o.constructor;void 0!==t&&Object.defineProperty(o,n,t(n)),null==e||e(r,n);}};
+
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */function i$5(i,n){return o$6({descriptor:o=>{const t={get(){var o,n;return null!==(n=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(i))&&void 0!==n?n:null},enumerable:!0,configurable:!0};if(n){const n="symbol"==typeof o?Symbol():"__"+o;t.get=function(){var o,t;return void 0===this[n]&&(this[n]=null!==(t=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(i))&&void 0!==t?t:null),this[n]};}return t}})}
+
+/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */var n$6;const e$6=null!=(null===(n$6=window.HTMLSlotElement)||void 0===n$6?void 0:n$6.prototype.assignedElements)?(o,n)=>o.assignedElements(n):(o,n)=>o.assignedNodes(n).filter((o=>o.nodeType===Node.ELEMENT_NODE));function l$5(n){const{slot:l,selector:t}=null!=n?n:{};return o$6({descriptor:o=>({get(){var o;const r="slot"+(l?`[name=${l}]`:":not([name])"),i=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(r),s=null!=i?e$6(i,n):[];return t?s.filter((o=>o.matches(t))):s},enumerable:!0,configurable:!0})})}
+
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+const t$2=window,e$5=t$2.ShadowRoot&&(void 0===t$2.ShadyCSS||t$2.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$5=Symbol(),n$5=new WeakMap;let o$5 = class o{constructor(t,e,n){if(this._$cssResult$=!0,n!==s$5)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$5&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=n$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n$5.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new o$5("string"==typeof t?t:t+"",void 0,s$5),i$4=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new o$5(n,t,s$5)},S$1=(s,n)=>{e$5?s.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((e=>{const n=document.createElement("style"),o=t$2.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=e.cssText,s.appendChild(n);}));},c$1=e$5?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
+
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */var s$4;const e$4=window,r$1=e$4.trustedTypes,h$1=r$1?r$1.emptyScript:"",o$4=e$4.reactiveElementPolyfillSupport,n$4={toAttribute(t,i){switch(i){case Boolean:t=t?h$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t);}catch(t){s=null;}}return s}},a$3=(t,i)=>i!==t&&(i==i||t==t),l$4={attribute:!0,type:String,converter:n$4,reflect:!1,hasChanged:a$3},d$1="finalized";let u$1 = class u extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu();}static addInitializer(t){var i;this.finalize(),(null!==(i=this.h)&&void 0!==i?i:this.h=[]).push(t);}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Ep(s,i);void 0!==e&&(this._$Ev.set(e,s),t.push(e));})),t}static createProperty(t,i=l$4){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e);}}static getPropertyDescriptor(t,i,s){return {get(){return this[i]},set(e){const r=this[t];this[i]=e,this.requestUpdate(t,r,s);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||l$4}static finalize(){if(this.hasOwnProperty(d$1))return !1;this[d$1]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s]);}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(i){const s=[];if(Array.isArray(i)){const e=new Set(i.flat(1/0).reverse());for(const i of e)s.unshift(c$1(i));}else void 0!==i&&s.push(c$1(i));return s}static _$Ep(t,i){const s=i.attribute;return !1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)));}addController(t){var i,s;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t));}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1);}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i]);}));}createRenderRoot(){var t;const s=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return S$1(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}));}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}));}attributeChangedCallback(t,i,s){this._$AK(t,s);}_$EO(t,i,s=l$4){var e;const r=this.constructor._$Ep(t,s);if(void 0!==r&&!0===s.reflect){const h=(void 0!==(null===(e=s.converter)||void 0===e?void 0:e.toAttribute)?s.converter:n$4).toAttribute(i,s.type);this._$El=t,null==h?this.removeAttribute(r):this.setAttribute(r,h),this._$El=null;}}_$AK(t,i){var s;const e=this.constructor,r=e._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=e.getPropertyOptions(r),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:n$4;this._$El=r,this[r]=h.fromAttribute(i,t.type),this._$El=null;}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||a$3)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$E_=this._$Ej());}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$Ek();}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(s);}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return !0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek();}updated(t){}firstUpdated(t){}};u$1[d$1]=!0,u$1.elementProperties=new Map,u$1.elementStyles=[],u$1.shadowRootOptions={mode:"open"},null==o$4||o$4({ReactiveElement:u$1}),(null!==(s$4=e$4.reactiveElementVersions)&&void 0!==s$4?s$4:e$4.reactiveElementVersions=[]).push("1.6.3");
+
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+var t$1;const i$3=window,s$3=i$3.trustedTypes,e$3=s$3?s$3.createPolicy("lit-html",{createHTML:t=>t}):void 0,o$3="$lit$",n$3=`lit$${(Math.random()+"").slice(9)}$`,l$3="?"+n$3,h=`<${l$3}>`,r=document,u=()=>r.createComment(""),d=t=>null===t||"object"!=typeof t&&"function"!=typeof t,c=Array.isArray,v=t=>c(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),a$2="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m=/>/g,p=RegExp(`>|${a$2}(?:([^\\s"'>=/]+)(${a$2}*=${a$2}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,$=/"/g,y=/^(?:script|style|textarea|title)$/i,w=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=w(1),T=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),E=new WeakMap,C=r.createTreeWalker(r,129,null,!1);function P(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==e$3?e$3.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,e=[];let l,r=2===i?"":"")),e]};class N{constructor({strings:t,_$litType$:i},e){let h;this.parts=[];let r=0,d=0;const c=t.length-1,v=this.parts,[a,f]=V(t,i);if(this.el=N.createElement(a,e),C.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes);}for(;null!==(h=C.nextNode())&&v.length0){h.textContent=s$3?s$3.emptyScript:"";for(let s=0;s2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A;}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=S(this,t,i,0),n=!d(t)||t!==this._$AH&&t!==T,n&&(this._$AH=t);else {const e=t;let l,h;for(t=o[0],l=0;l{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new R(i.insertBefore(u(),t),t,void 0,null!=s?s:{});}return l._$AI(t),l};
+
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */var l$2,o$2;let s$2 = class s extends u$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=D(i,this.renderRoot,this.renderOptions);}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0);}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1);}render(){return T}};s$2.finalized=!0,s$2._$litElement$=!0,null===(l$2=globalThis.litElementHydrateSupport)||void 0===l$2||l$2.call(globalThis,{LitElement:s$2});const n$2=globalThis.litElementPolyfillSupport;null==n$2||n$2({LitElement:s$2});(null!==(o$2=globalThis.litElementVersions)&&void 0!==o$2?o$2:globalThis.litElementVersions=[]).push("3.3.3");
+
+/**
+ * @license
+ * Copyright 2022 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * A component for elevation.
+ */
+class Elevation extends s$2 {
+ connectedCallback() {
+ super.connectedCallback();
+ // Needed for VoiceOver, which will create a "group" if the element is a
+ // sibling to other content.
+ this.setAttribute('aria-hidden', 'true');
+ }
+ render() {
+ return x ``;
+ }
+}
+
+/**
+ * @license
+ * Copyright 2022 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+const styles$o = i$4 `:host{--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000));display:flex;pointer-events:none}:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-property:inherit;transition-timing-function:inherit}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity}.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}/*# sourceMappingURL=elevation-styles.css.map */
+`;
+
+/**
+ * @license
+ * Copyright 2022 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * The `` custom element with default styles.
+ *
+ * Elevation is the relative distance between two surfaces along the z-axis.
+ */
+let MdElevation = class MdElevation extends Elevation {
+};
+MdElevation.styles = [styles$o];
+MdElevation = __decorate([
+ e$8('md-elevation')
+], MdElevation);
+
+/**
+ * @license
+ * Copyright 2023 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * A key to retrieve an `Attachable` element's `AttachableController` from a
+ * global `MutationObserver`.
+ */
+const ATTACHABLE_CONTROLLER = Symbol('attachableController');
+let FOR_ATTRIBUTE_OBSERVER;
+{
+ /**
+ * A global `MutationObserver` that reacts to `for` attribute changes on
+ * `Attachable` elements. If the `for` attribute changes, the controller will
+ * re-attach to the new referenced element.
+ */
+ FOR_ATTRIBUTE_OBSERVER = new MutationObserver(records => {
+ for (const record of records) {
+ // When a control's `for` attribute changes, inform its
+ // `AttachableController` to update to a new control.
+ record.target[ATTACHABLE_CONTROLLER]
+ ?.hostConnected();
+ }
+ });
+}
+/**
+ * A controller that provides an implementation for `Attachable` elements.
+ *
+ * @example
+ * ```ts
+ * class MyElement extends LitElement implements Attachable {
+ * get control() { return this.attachableController.control; }
+ *
+ * private readonly attachableController = new AttachableController(
+ * this,
+ * (previousControl, newControl) => {
+ * previousControl?.removeEventListener('click', this.handleClick);
+ * newControl?.addEventListener('click', this.handleClick);
+ * }
+ * );
+ *
+ * // Implement remaining `Attachable` properties/methods that call the
+ * // controller's properties/methods.
+ * }
+ * ```
+ */
+class AttachableController {
+ get htmlFor() {
+ return this.host.getAttribute('for');
+ }
+ set htmlFor(htmlFor) {
+ if (htmlFor === null) {
+ this.host.removeAttribute('for');
+ }
+ else {
+ this.host.setAttribute('for', htmlFor);
+ }
+ }
+ get control() {
+ if (this.host.hasAttribute('for')) {
+ if (!this.htmlFor || !this.host.isConnected) {
+ return null;
+ }
+ return this.host.getRootNode()
+ .querySelector(`#${this.htmlFor}`);
+ }
+ return this.currentControl || this.host.parentElement;
+ }
+ set control(control) {
+ if (control) {
+ this.attach(control);
+ }
+ else {
+ this.detach();
+ }
+ }
+ /**
+ * Creates a new controller for an `Attachable` element.
+ *
+ * @param host The `Attachable` element.
+ * @param onControlChange A callback with two parameters for the previous and
+ * next control. An `Attachable` element may perform setup or teardown
+ * logic whenever the control changes.
+ */
+ constructor(host, onControlChange) {
+ this.host = host;
+ this.onControlChange = onControlChange;
+ this.currentControl = null;
+ host.addController(this);
+ host[ATTACHABLE_CONTROLLER] = this;
+ FOR_ATTRIBUTE_OBSERVER?.observe(host, { attributeFilter: ['for'] });
+ }
+ attach(control) {
+ if (control === this.currentControl) {
+ return;
+ }
+ this.setCurrentControl(control);
+ // When imperatively attaching, remove the `for` attribute so
+ // that the attached control is used instead of a referenced one.
+ this.host.removeAttribute('for');
+ }
+ detach() {
+ this.setCurrentControl(null);
+ // When imperatively detaching, add an empty `for=""` attribute. This will
+ // ensure the control is `null` rather than the `parentElement`.
+ this.host.setAttribute('for', '');
+ }
+ /** @private */
+ hostConnected() {
+ this.setCurrentControl(this.control);
+ }
+ /** @private */
+ hostDisconnected() {
+ this.setCurrentControl(null);
+ }
+ setCurrentControl(control) {
+ this.onControlChange(this.currentControl, control);
+ this.currentControl = control;
+ }
+}
+
+/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * Events that the focus ring listens to.
+ *
+ * @fires visibility-changed Fired whenever `visible` changes.
+ */
+const EVENTS$1 = ['focusin', 'focusout', 'pointerdown'];
+/**
+ * A focus ring component.
+ */
+class FocusRing extends s$2 {
+ constructor() {
+ super(...arguments);
+ /**
+ * Makes the focus ring visible.
+ */
+ this.visible = false;
+ /**
+ * Makes the focus ring animate inwards instead of outwards.
+ */
+ this.inward = false;
+ this.attachableController = new AttachableController(this, this.onControlChange.bind(this));
+ }
+ get htmlFor() {
+ return this.attachableController.htmlFor;
+ }
+ set htmlFor(htmlFor) {
+ this.attachableController.htmlFor = htmlFor;
+ }
+ get control() {
+ return this.attachableController.control;
+ }
+ set control(control) {
+ this.attachableController.control = control;
+ }
+ attach(control) {
+ this.attachableController.attach(control);
+ }
+ detach() {
+ this.attachableController.detach();
+ }
+ connectedCallback() {
+ super.connectedCallback();
+ // Needed for VoiceOver, which will create a "group" if the element is a
+ // sibling to other content.
+ this.setAttribute('aria-hidden', 'true');
+ }
+ /** @private */
+ handleEvent(event) {
+ if (event[HANDLED_BY_FOCUS_RING]) {
+ // This ensures the focus ring does not activate when multiple focus rings
+ // are used within a single component.
+ return;
+ }
+ switch (event.type) {
+ default:
+ return;
+ case 'focusin':
+ this.visible = this.control?.matches(':focus-visible') ?? false;
+ break;
+ case 'focusout':
+ case 'pointerdown':
+ this.visible = false;
+ break;
+ }
+ event[HANDLED_BY_FOCUS_RING] = true;
+ }
+ onControlChange(prev, next) {
+ for (const event of EVENTS$1) {
+ prev?.removeEventListener(event, this);
+ next?.addEventListener(event, this);
+ }
+ }
+ update(changed) {
+ if (changed.has('visible')) {
+ // This logic can be removed once the `:has` selector has been introduced
+ // to Firefox. This is necessary to allow correct submenu styles.
+ this.dispatchEvent(new Event('visibility-changed'));
+ }
+ super.update(changed);
+ }
+}
+__decorate([
+ n$7({ type: Boolean, reflect: true })
+], FocusRing.prototype, "visible", void 0);
+__decorate([
+ n$7({ type: Boolean, reflect: true })
+], FocusRing.prototype, "inward", void 0);
+const HANDLED_BY_FOCUS_RING = Symbol('handledByFocusRing');
+
+/**
+ * @license
+ * Copyright 2022 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+const styles$n = i$4 `: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, 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, 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, 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, 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, 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, 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, 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, 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}}/*# sourceMappingURL=focus-ring-styles.css.map */
+`;
+
+/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * TODO(b/267336424): add docs
+ *
+ * @final
+ * @suppress {visibility}
+ */
+let MdFocusRing = class MdFocusRing extends FocusRing {
+};
+MdFocusRing.styles = [styles$n];
+MdFocusRing = __decorate([
+ e$8('md-focus-ring')
+], MdFocusRing);
+
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e$2=t=>(...e)=>({_$litDirective$:t,values:e});let i$2 = class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
+
+/**
+ * @license
+ * Copyright 2018 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */const o$1=e$2(class extends i$2{constructor(t$1){var i;if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||(null===(i=t$1.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(i,[s]){var r,o;if(void 0===this.it){this.it=new Set,void 0!==i.strings&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in s)s[t]&&!(null===(r=this.nt)||void 0===r?void 0:r.has(t))&&this.it.add(t);return this.render(s)}const e=i.element.classList;this.it.forEach((t=>{t in s||(e.remove(t),this.it.delete(t));}));for(const t in s){const i=!!s[t];i===this.it.has(t)||(null===(o=this.nt)||void 0===o?void 0:o.has(t))||(i?(e.add(t),this.it.add(t)):(e.remove(t),this.it.delete(t)));}return T}});
+
+/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * Easing functions to use for web animations.
+ *
+ * **NOTE:** `EASING.EMPHASIZED` is approximated with unknown accuracy.
+ *
+ * TODO(b/241113345): replace with tokens
+ */
+const EASING = {
+ STANDARD: 'cubic-bezier(0.2, 0, 0, 1)',
+ STANDARD_ACCELERATE: 'cubic-bezier(.3,0,1,1)',
+ STANDARD_DECELERATE: 'cubic-bezier(0,0,0,1)',
+ EMPHASIZED: 'cubic-bezier(.3,0,0,1)',
+ EMPHASIZED_ACCELERATE: 'cubic-bezier(.3,0,.8,.15)',
+ EMPHASIZED_DECELERATE: 'cubic-bezier(.05,.7,.1,1)',
+};
+
+/**
+ * @license
+ * Copyright 2022 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+const PRESS_GROW_MS = 450;
+const MINIMUM_PRESS_MS = 225;
+const INITIAL_ORIGIN_SCALE = 0.2;
+const PADDING = 10;
+const SOFT_EDGE_MINIMUM_SIZE = 75;
+const SOFT_EDGE_CONTAINER_RATIO = 0.35;
+const PRESS_PSEUDO = '::after';
+const ANIMATION_FILL = 'forwards';
+/**
+ * Interaction states for the ripple.
+ *
+ * On Touch:
+ * - `INACTIVE -> TOUCH_DELAY -> WAITING_FOR_CLICK -> INACTIVE`
+ * - `INACTIVE -> TOUCH_DELAY -> HOLDING -> WAITING_FOR_CLICK -> INACTIVE`
+ *
+ * On Mouse or Pen:
+ * - `INACTIVE -> WAITING_FOR_CLICK -> INACTIVE`
+ */
+var State;
+(function (State) {
+ /**
+ * Initial state of the control, no touch in progress.
+ *
+ * Transitions:
+ * - on touch down: transition to `TOUCH_DELAY`.
+ * - on mouse down: transition to `WAITING_FOR_CLICK`.
+ */
+ State[State["INACTIVE"] = 0] = "INACTIVE";
+ /**
+ * Touch down has been received, waiting to determine if it's a swipe or
+ * scroll.
+ *
+ * Transitions:
+ * - on touch up: begin press; transition to `WAITING_FOR_CLICK`.
+ * - on cancel: transition to `INACTIVE`.
+ * - after `TOUCH_DELAY_MS`: begin press; transition to `HOLDING`.
+ */
+ State[State["TOUCH_DELAY"] = 1] = "TOUCH_DELAY";
+ /**
+ * A touch has been deemed to be a press
+ *
+ * Transitions:
+ * - on up: transition to `WAITING_FOR_CLICK`.
+ */
+ State[State["HOLDING"] = 2] = "HOLDING";
+ /**
+ * The user touch has finished, transition into rest state.
+ *
+ * Transitions:
+ * - on click end press; transition to `INACTIVE`.
+ */
+ State[State["WAITING_FOR_CLICK"] = 3] = "WAITING_FOR_CLICK";
+})(State || (State = {}));
+/**
+ * Events that the ripple listens to.
+ */
+const EVENTS = [
+ 'click', 'contextmenu', 'pointercancel', 'pointerdown', 'pointerenter',
+ 'pointerleave', 'pointerup'
+];
+/**
+ * Delay reacting to touch so that we do not show the ripple for a swipe or
+ * scroll interaction.
+ */
+const TOUCH_DELAY_MS = 150;
+/**
+ * A ripple component.
+ */
+class Ripple extends s$2 {
+ constructor() {
+ super(...arguments);
+ /**
+ * Disables the ripple.
+ */
+ this.disabled = false;
+ this.hovered = false;
+ this.pressed = false;
+ this.rippleSize = '';
+ this.rippleScale = '';
+ this.initialSize = 0;
+ this.state = State.INACTIVE;
+ this.checkBoundsAfterContextMenu = false;
+ this.attachableController = new AttachableController(this, this.onControlChange.bind(this));
+ }
+ get htmlFor() {
+ return this.attachableController.htmlFor;
+ }
+ set htmlFor(htmlFor) {
+ this.attachableController.htmlFor = htmlFor;
+ }
+ get control() {
+ return this.attachableController.control;
+ }
+ set control(control) {
+ this.attachableController.control = control;
+ }
+ attach(control) {
+ this.attachableController.attach(control);
+ }
+ detach() {
+ this.attachableController.detach();
+ }
+ connectedCallback() {
+ super.connectedCallback();
+ // Needed for VoiceOver, which will create a "group" if the element is a
+ // sibling to other content.
+ this.setAttribute('aria-hidden', 'true');
+ }
+ render() {
+ const classes = {
+ 'hovered': this.hovered,
+ 'pressed': this.pressed,
+ };
+ return x ``;
+ }
+ update(changedProps) {
+ if (changedProps.has('disabled') && this.disabled) {
+ this.hovered = false;
+ this.pressed = false;
+ }
+ super.update(changedProps);
+ }
+ /**
+ * TODO(b/269799771): make private
+ * @private only public for slider
+ */
+ handlePointerenter(event) {
+ if (!this.shouldReactToEvent(event)) {
+ return;
+ }
+ this.hovered = true;
+ }
+ /**
+ * TODO(b/269799771): make private
+ * @private only public for slider
+ */
+ handlePointerleave(event) {
+ if (!this.shouldReactToEvent(event)) {
+ return;
+ }
+ this.hovered = false;
+ // release a held mouse or pen press that moves outside the element
+ if (this.state !== State.INACTIVE) {
+ this.endPressAnimation();
+ }
+ }
+ handlePointerup(event) {
+ if (!this.shouldReactToEvent(event)) {
+ return;
+ }
+ if (this.state === State.HOLDING) {
+ this.state = State.WAITING_FOR_CLICK;
+ return;
+ }
+ if (this.state === State.TOUCH_DELAY) {
+ this.state = State.WAITING_FOR_CLICK;
+ this.startPressAnimation(this.rippleStartEvent);
+ return;
+ }
+ }
+ async handlePointerdown(event) {
+ if (!this.shouldReactToEvent(event)) {
+ return;
+ }
+ this.rippleStartEvent = event;
+ if (!this.isTouch(event)) {
+ this.state = State.WAITING_FOR_CLICK;
+ this.startPressAnimation(event);
+ return;
+ }
+ // after a longpress contextmenu event, an extra `pointerdown` can be
+ // dispatched to the pressed element. Check that the down is within
+ // bounds of the element in this case.
+ if (this.checkBoundsAfterContextMenu && !this.inBounds(event)) {
+ return;
+ }
+ this.checkBoundsAfterContextMenu = false;
+ // Wait for a hold after touch delay
+ this.state = State.TOUCH_DELAY;
+ await new Promise(resolve => {
+ setTimeout(resolve, TOUCH_DELAY_MS);
+ });
+ if (this.state !== State.TOUCH_DELAY) {
+ return;
+ }
+ this.state = State.HOLDING;
+ this.startPressAnimation(event);
+ }
+ handleClick() {
+ // Click is a MouseEvent in Firefox and Safari, so we cannot use
+ // `shouldReactToEvent`
+ if (this.disabled) {
+ return;
+ }
+ if (this.state === State.WAITING_FOR_CLICK) {
+ this.endPressAnimation();
+ return;
+ }
+ if (this.state === State.INACTIVE) {
+ // keyboard synthesized click event
+ this.startPressAnimation();
+ this.endPressAnimation();
+ }
+ }
+ handlePointercancel(event) {
+ if (!this.shouldReactToEvent(event)) {
+ return;
+ }
+ this.endPressAnimation();
+ }
+ handleContextmenu() {
+ if (this.disabled) {
+ return;
+ }
+ this.checkBoundsAfterContextMenu = true;
+ this.endPressAnimation();
+ }
+ determineRippleSize() {
+ const { height, width } = this.getBoundingClientRect();
+ const maxDim = Math.max(height, width);
+ const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDim, SOFT_EDGE_MINIMUM_SIZE);
+ const initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE);
+ const hypotenuse = Math.sqrt(width ** 2 + height ** 2);
+ const maxRadius = hypotenuse + PADDING;
+ this.initialSize = initialSize;
+ this.rippleScale = `${(maxRadius + softEdgeSize) / initialSize}`;
+ this.rippleSize = `${initialSize}px`;
+ }
+ getNormalizedPointerEventCoords(pointerEvent) {
+ const { scrollX, scrollY } = window;
+ const { left, top } = this.getBoundingClientRect();
+ const documentX = scrollX + left;
+ const documentY = scrollY + top;
+ const { pageX, pageY } = pointerEvent;
+ return { x: pageX - documentX, y: pageY - documentY };
+ }
+ getTranslationCoordinates(positionEvent) {
+ const { height, width } = this.getBoundingClientRect();
+ // end in the center
+ const endPoint = {
+ x: (width - this.initialSize) / 2,
+ y: (height - this.initialSize) / 2,
+ };
+ let startPoint;
+ if (positionEvent instanceof PointerEvent) {
+ startPoint = this.getNormalizedPointerEventCoords(positionEvent);
+ }
+ else {
+ startPoint = {
+ x: width / 2,
+ y: height / 2,
+ };
+ }
+ // center around start point
+ startPoint = {
+ x: startPoint.x - (this.initialSize / 2),
+ y: startPoint.y - (this.initialSize / 2),
+ };
+ return { startPoint, endPoint };
+ }
+ startPressAnimation(positionEvent) {
+ if (!this.mdRoot) {
+ return;
+ }
+ this.pressed = true;
+ this.growAnimation?.cancel();
+ this.determineRippleSize();
+ const { startPoint, endPoint } = this.getTranslationCoordinates(positionEvent);
+ const translateStart = `${startPoint.x}px, ${startPoint.y}px`;
+ const translateEnd = `${endPoint.x}px, ${endPoint.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(${translateStart}) scale(1)`,
+ `translate(${translateEnd}) scale(${this.rippleScale})`
+ ],
+ }, {
+ pseudoElement: PRESS_PSEUDO,
+ duration: PRESS_GROW_MS,
+ easing: EASING.STANDARD,
+ fill: ANIMATION_FILL
+ });
+ }
+ async endPressAnimation() {
+ this.state = State.INACTIVE;
+ const animation = this.growAnimation;
+ const pressAnimationPlayState = animation?.currentTime ?? Infinity;
+ // TODO: go/ts51upgrade - Auto-added to unblock TS5.1 migration.
+ // TS2365: Operator '>=' cannot be applied to types 'CSSNumberish' and
+ // 'number'.
+ // @ts-ignore
+ if (pressAnimationPlayState >= MINIMUM_PRESS_MS) {
+ this.pressed = false;
+ return;
+ }
+ await new Promise(resolve => {
+ // TODO: go/ts51upgrade - Auto-added to unblock TS5.1 migration.
+ // TS2363: The right-hand side of an arithmetic operation must be of
+ // type 'any', 'number', 'bigint' or an enum type.
+ // @ts-ignore
+ setTimeout(resolve, MINIMUM_PRESS_MS - pressAnimationPlayState);
+ });
+ if (this.growAnimation !== animation) {
+ // A new press animation was started. The old animation was canceled and
+ // should not finish the pressed state.
+ return;
+ }
+ this.pressed = false;
+ }
+ /**
+ * Returns `true` if
+ * - the ripple element is enabled
+ * - the pointer is primary for the input type
+ * - the pointer is the pointer that started the interaction, or will start
+ * the interaction
+ * - the pointer is a touch, or the pointer state has the primary button
+ * held, or the pointer is hovering
+ */
+ shouldReactToEvent(event) {
+ if (this.disabled || !event.isPrimary) {
+ return false;
+ }
+ if (this.rippleStartEvent &&
+ this.rippleStartEvent.pointerId !== event.pointerId) {
+ return false;
+ }
+ if (event.type === 'pointerenter' || event.type === 'pointerleave') {
+ return !this.isTouch(event);
+ }
+ const isPrimaryButton = event.buttons === 1;
+ return this.isTouch(event) || isPrimaryButton;
+ }
+ /**
+ * Check if the event is within the bounds of the element.
+ *
+ * This is only needed for the "stuck" contextmenu longpress on Chrome.
+ */
+ inBounds({ x, y }) {
+ const { top, left, bottom, right } = this.getBoundingClientRect();
+ return x >= left && x <= right && y >= top && y <= bottom;
+ }
+ isTouch({ pointerType }) {
+ return pointerType === 'touch';
+ }
+ /** @private */
+ async handleEvent(event) {
+ switch (event.type) {
+ case 'click':
+ this.handleClick();
+ break;
+ case 'contextmenu':
+ this.handleContextmenu();
+ break;
+ case 'pointercancel':
+ this.handlePointercancel(event);
+ break;
+ case 'pointerdown':
+ await this.handlePointerdown(event);
+ break;
+ case 'pointerenter':
+ this.handlePointerenter(event);
+ break;
+ case 'pointerleave':
+ this.handlePointerleave(event);
+ break;
+ case 'pointerup':
+ this.handlePointerup(event);
+ break;
+ }
+ }
+ onControlChange(prev, next) {
+ for (const event of EVENTS) {
+ prev?.removeEventListener(event, this);
+ next?.addEventListener(event, this);
+ }
+ }
+}
+__decorate([
+ n$7({ type: Boolean, reflect: true })
+], Ripple.prototype, "disabled", void 0);
+__decorate([
+ t$3()
+], Ripple.prototype, "hovered", void 0);
+__decorate([
+ t$3()
+], Ripple.prototype, "pressed", void 0);
+__decorate([
+ i$5('.surface')
+], Ripple.prototype, "mdRoot", void 0);
+
+/**
+ * @license
+ * Copyright 2022 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+const styles$m = i$4 `:host{--_hover-color: var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-opacity: var(--md-ripple-hover-opacity, 0.08);--_pressed-color: var(--md-ripple-pressed-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-opacity: var(--md-ripple-pressed-opacity, 0.12);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(--_hover-color);inset:0;transition:opacity 15ms linear,background-color 15ms linear}.surface::after{background:radial-gradient(closest-side, var(--_pressed-color) max(100% - 70px, 65%), transparent 100%);transform-origin:center center;transition:opacity 375ms linear}.hovered::before{background-color:var(--_hover-color);opacity:var(--_hover-opacity)}.pressed::after{opacity:var(--_pressed-opacity);transition-duration:105ms}/*# sourceMappingURL=ripple-styles.css.map */
+`;
+
+/**
+ * @license
+ * Copyright 2022 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * @summary Ripples, also known as state layers, are visual indicators used to
+ * communicate the status of a component or interactive element.
+ *
+ * @description A state layer is a semi-transparent covering on an element that
+ * indicates its state. State layers provide a systematic approach to
+ * visualizing states by using opacity. A layer can be applied to an entire
+ * element or in a circular shape and only one state layer can be applied at a
+ * given time.
+ *
+ * @final
+ * @suppress {visibility}
+ */
+let MdRipple = class MdRipple extends Ripple {
+};
+MdRipple.styles = [styles$m];
+MdRipple = __decorate([
+ e$8('md-ripple')
+], MdRipple);
+
+/**
+ * @license
+ * Copyright 2020 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */const e$1=Symbol.for(""),l$1=t=>{if((null==t?void 0:t.r)===e$1)return null==t?void 0:t._$litStatic$},i$1=(t,...r)=>({_$litStatic$:r.reduce(((r,e,l)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[l+1]),t[0]),r:e$1}),s$1=new Map,a$1=t=>(r,...e)=>{const o=e.length;let i,a;const n=[],u=[];let c,$=0,f=!1;for(;$ {
+ host.addController({
+ hostConnected() {
+ if (host.hasAttribute('tabindex')) {
+ return;
+ }
+ host.tabIndex = 0;
+ }
+ });
+ });
+ }
+ if ('role' in Element.prototype) {
+ return;
+ }
+ // Polyfill reflective aria properties for Firefox
+ for (const ariaProperty of ARIA_PROPERTIES) {
+ ctor.createProperty(ariaProperty, {
+ attribute: ariaPropertyToAttribute(ariaProperty),
+ reflect: true,
+ });
+ }
+ ctor.createProperty('role', { reflect: true });
+}
+/**
+ * Polyfills an element and its `ElementInternals` to support `ARIAMixin`
+ * properties on internals. This is needed for Firefox.
+ *
+ * `setupHostAria()` must be called for the element class.
+ *
+ * @example
+ * class XButton extends LitElement {
+ * static {
+ * setupHostAria(XButton);
+ * }
+ *
+ * private internals =
+ * polyfillElementInternalsAria(this, this.attachInternals());
+ *
+ * constructor() {
+ * super();
+ * this.internals.role = 'button';
+ * }
+ * }
+ */
+function polyfillElementInternalsAria(host, internals) {
+ if (checkIfElementInternalsSupportsAria(internals)) {
+ return internals;
+ }
+ if (!('role' in host)) {
+ throw new Error('Missing setupHostAria()');
+ }
+ let firstConnectedCallbacks = [];
+ let hasBeenConnected = false;
+ // Add support for Firefox, which has not yet implement ElementInternals aria
+ for (const ariaProperty of ARIA_PROPERTIES) {
+ let internalAriaValue = null;
+ Object.defineProperty(internals, ariaProperty, {
+ enumerable: true,
+ configurable: true,
+ get() {
+ return internalAriaValue;
+ },
+ set(value) {
+ const setValue = () => {
+ internalAriaValue = value;
+ if (!hasBeenConnected) {
+ firstConnectedCallbacks.push({ property: ariaProperty, callback: setValue });
+ return;
+ }
+ // Dynamic lookup rather than hardcoding all properties.
+ // tslint:disable-next-line:no-dict-access-on-struct-type
+ host[ariaProperty] = value;
+ };
+ setValue();
+ },
+ });
+ }
+ let internalRoleValue = null;
+ Object.defineProperty(internals, 'role', {
+ enumerable: true,
+ configurable: true,
+ get() {
+ return internalRoleValue;
+ },
+ set(value) {
+ const setRole = () => {
+ internalRoleValue = value;
+ if (!hasBeenConnected) {
+ firstConnectedCallbacks.push({
+ property: 'role',
+ callback: setRole,
+ });
+ return;
+ }
+ if (value === null) {
+ host.removeAttribute('role');
+ }
+ else {
+ host.setAttribute('role', value);
+ }
+ };
+ setRole();
+ },
+ });
+ host.addController({
+ hostConnected() {
+ if (hasBeenConnected) {
+ return;
+ }
+ hasBeenConnected = true;
+ const propertiesSetByUser = new Set();
+ // See which properties were set by the user on host before we apply
+ // internals values as attributes to host. Needs to be done in another
+ // for loop because the callbacks set these attributes on host.
+ for (const { property } of firstConnectedCallbacks) {
+ const wasSetByUser = host.getAttribute(ariaPropertyToAttribute(property)) !== null ||
+ // Dynamic lookup rather than hardcoding all properties.
+ // tslint:disable-next-line:no-dict-access-on-struct-type
+ host[property] !== undefined;
+ if (wasSetByUser) {
+ propertiesSetByUser.add(property);
+ }
+ }
+ for (const { property, callback } of firstConnectedCallbacks) {
+ // If the user has set the attribute or property, do not override the
+ // user's value
+ if (propertiesSetByUser.has(property)) {
+ continue;
+ }
+ callback();
+ }
+ // Remove strong callback references
+ firstConnectedCallbacks = [];
+ }
+ });
+ return internals;
+}
+// Separate function so that typescript doesn't complain about internals being
+// "never".
+function checkIfElementInternalsSupportsAria(internals) {
+ return 'role' in internals;
+}
+
+/**
+ * @license
+ * Copyright 2023 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * Sets up a `ReactiveElement` constructor to enable updates when delegating
+ * aria attributes. Elements may bind `this.aria*` properties to `aria-*`
+ * attributes in their render functions.
+ *
+ * This function will:
+ * - Call `requestUpdate()` when an aria attribute changes.
+ * - Add `role="presentation"` to the host.
+ *
+ * NOTE: The following features are not currently supported:
+ * - Delegating IDREF attributes (ex: `aria-labelledby`, `aria-controls`)
+ * - Delegating the `role` attribute
+ *
+ * @example
+ * class XButton extends LitElement {
+ * static {
+ * requestUpdateOnAriaChange(XButton);
+ * }
+ *
+ * protected override render() {
+ * return html`
+ *
+ * `;
+ * }
+ * }
+ *
+ * @param ctor The `ReactiveElement` constructor to patch.
+ */
+function requestUpdateOnAriaChange(ctor) {
+ for (const ariaProperty of ARIA_PROPERTIES) {
+ ctor.createProperty(ariaProperty, {
+ attribute: ariaPropertyToAttribute(ariaProperty),
+ reflect: true,
+ });
+ }
+ ctor.addInitializer(element => {
+ const controller = {
+ hostConnected() {
+ element.setAttribute('role', 'presentation');
+ }
+ };
+ element.addController(controller);
+ });
+}
+
+/**
+ * @license
+ * Copyright 2023 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * A unique symbol used for protected access to an instance's
+ * `ElementInternals`.
+ *
+ * @example
+ * ```ts
+ * class MyElement extends LitElement {
+ * static formAssociated = true;
+ *
+ * [internals] = this.attachInternals();
+ * }
+ *
+ * function getForm(element: MyElement) {
+ * return element[internals].form;
+ * }
+ * ```
+ */
+const internals = Symbol('internals');
+
+/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * Re-dispatches an event from the provided element.
+ *
+ * This function is useful for forwarding non-composed events, such as `change`
+ * events.
+ *
+ * @example
+ * class MyInput extends LitElement {
+ * render() {
+ * return html``;
+ * }
+ *
+ * protected redispatchEvent(event: Event) {
+ * redispatchEvent(this, event);
+ * }
+ * }
+ *
+ * @param element The element to dispatch the event from.
+ * @param event The event to re-dispatch.
+ * @return Whether or not the event was dispatched (if cancelable).
+ */
+function redispatchEvent(element, event) {
+ // For bubbling events in SSR light DOM (or composed), stop their propagation
+ // and dispatch the copy.
+ if (event.bubbles && (!element.shadowRoot || event.composed)) {
+ event.stopPropagation();
+ }
+ const copy = Reflect.construct(event.constructor, [event.type, event]);
+ const dispatched = element.dispatchEvent(copy);
+ if (!dispatched) {
+ event.preventDefault();
+ }
+ return dispatched;
+}
+/**
+ * Dispatches a click event to the given element that triggers a native action,
+ * but is not composed and therefore is not seen outside the element.
+ *
+ * This is useful for responding to an external click event on the host element
+ * that should trigger an internal action like a button click.
+ *
+ * Note, a helper is provided because setting this up correctly is a bit tricky.
+ * In particular, calling `click` on an element creates a composed event, which
+ * is not desirable, and a manually dispatched event must specifically be a
+ * `MouseEvent` to trigger a native action.
+ *
+ * @example
+ * hostClickListener = (event: MouseEvent) {
+ * if (isActivationClick(event)) {
+ * this.dispatchActivationClick(this.buttonElement);
+ * }
+ * }
+ *
+ */
+function dispatchActivationClick(element) {
+ const event = new MouseEvent('click', { bubbles: true });
+ element.dispatchEvent(event);
+ return event;
+}
+/**
+ * Returns true if the click event should trigger an activation behavior. The
+ * behavior is defined by the element and is whatever it should do when
+ * clicked.
+ *
+ * Typically when an element needs to handle a click, the click is generated
+ * from within the element and an event listener within the element implements
+ * the needed behavior; however, it's possible to fire a click directly
+ * at the element that the element should handle. This method helps
+ * distinguish these "external" clicks.
+ *
+ * An "external" click can be triggered in a number of ways: via a click
+ * on an associated label for a form associated element, calling
+ * `element.click()`, or calling
+ * `element.dispatchEvent(new MouseEvent('click', ...))`.
+ *
+ * Also works around Firefox issue
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=1804576 by squelching
+ * events for a microtask after called.
+ *
+ * @example
+ * hostClickListener = (event: MouseEvent) {
+ * if (isActivationClick(event)) {
+ * this.dispatchActivationClick(this.buttonElement);
+ * }
+ * }
+ *
+ */
+function isActivationClick(event) {
+ // Event must start at the event target.
+ if (event.currentTarget !== event.target) {
+ return false;
+ }
+ // Event must not be retargeted from shadowRoot.
+ if (event.composedPath()[0] !== event.target) {
+ return false;
+ }
+ // Target must not be disabled; this should only occur for a synthetically
+ // dispatched click.
+ if (event.target.disabled) {
+ return false;
+ }
+ // This is an activation if the event should not be squelched.
+ return !squelchEvent(event);
+}
+// TODO(https://bugzilla.mozilla.org/show_bug.cgi?id=1804576)
+// Remove when Firefox bug is addressed.
+function squelchEvent(event) {
+ const squelched = isSquelchingEvents;
+ if (squelched) {
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ }
+ squelchEventsForMicrotask();
+ return squelched;
+}
+// Ignore events for one microtask only.
+let isSquelchingEvents = false;
+async function squelchEventsForMicrotask() {
+ isSquelchingEvents = true;
+ // Need to pause for just one microtask.
+ // tslint:disable-next-line
+ await null;
+ isSquelchingEvents = false;
+}
+
+/**
+ * @license
+ * Copyright 2023 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * Sets up an element's constructor to enable form submission. The element
+ * instance should be form associated and have a `type` property.
+ *
+ * A click listener is added to each element instance. If the click is not
+ * default prevented, it will submit the element's form, if any.
+ *
+ * @example
+ * ```ts
+ * class MyElement extends LitElement {
+ * static {
+ * setupFormSubmitter(MyElement);
+ * }
+ *
+ * static formAssociated = true;
+ *
+ * type: FormSubmitterType = 'submit';
+ *
+ * [internals] = this.attachInternals();
+ * }
+ * ```
+ *
+ * @param ctor The form submitter element's constructor.
+ */
+function setupFormSubmitter(ctor) {
+ ctor.addInitializer(instance => {
+ const submitter = instance;
+ submitter.addEventListener('click', async (event) => {
+ const { type, [internals]: elementInternals } = submitter;
+ const { form } = elementInternals;
+ if (!form || type === 'button') {
+ return;
+ }
+ // Wait a microtask for event bubbling to complete.
+ await new Promise(resolve => {
+ resolve();
+ });
+ if (event.defaultPrevented) {
+ return;
+ }
+ if (type === 'reset') {
+ form.reset();
+ return;
+ }
+ // form.requestSubmit(submitter) does not work with form associated custom
+ // elements. This patches the dispatched submit event to add the correct
+ // `submitter`.
+ // See https://github.com/WICG/webcomponents/issues/814
+ form.addEventListener('submit', submitEvent => {
+ Object.defineProperty(submitEvent, 'submitter', {
+ configurable: true,
+ enumerable: true,
+ get: () => submitter,
+ });
+ }, { capture: true, once: true });
+ elementInternals.setFormValue(submitter.value);
+ form.requestSubmit();
+ });
+ });
+}
+
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+var _a$2;
+/**
+ * A button component.
+ */
+class Button extends s$2 {
+ get name() {
+ return this.getAttribute('name') ?? '';
+ }
+ set name(name) {
+ this.setAttribute('name', name);
+ }
+ /**
+ * The associated form element with which this element's value will submit.
+ */
+ get form() {
+ return this[internals].form;
+ }
+ constructor() {
+ super();
+ /**
+ * Whether or not the button is disabled.
+ */
+ this.disabled = false;
+ /**
+ * The URL that the link button points to.
+ */
+ this.href = '';
+ /**
+ * Where to display the linked `href` URL for a link button. Common options
+ * include `_blank` to open in a new tab.
+ */
+ this.target = '';
+ /**
+ * Whether to render the icon at the inline end of the label rather than the
+ * inline start.
+ *
+ * _Note:_ Link buttons cannot have trailing icons.
+ */
+ this.trailingIcon = false;
+ /**
+ * Whether to display the icon or not.
+ */
+ this.hasIcon = false;
+ this.type = 'submit';
+ this.value = '';
+ /** @private */
+ this[_a$2] = this /* needed for closure */.attachInternals();
+ this.handleActivationClick = (event) => {
+ if (!isActivationClick((event)) || !this.buttonElement) {
+ return;
+ }
+ this.focus();
+ dispatchActivationClick(this.buttonElement);
+ };
+ {
+ this.addEventListener('click', this.handleActivationClick);
+ }
+ }
+ focus() {
+ this.buttonElement?.focus();
+ }
+ blur() {
+ this.buttonElement?.blur();
+ }
+ render() {
+ // Link buttons may not be disabled
+ const isDisabled = this.disabled && !this.href;
+ const button = this.href ? i$1 `a` : i$1 `button`;
+ // Needed for closure conformance
+ const { ariaLabel, ariaHasPopup, ariaExpanded } = this;
+ return n$1 `
+ <${button}
+ class="button ${o$1(this.getRenderClasses())}"
+ ?disabled=${isDisabled}
+ aria-label="${ariaLabel || A}"
+ aria-haspopup="${ariaHasPopup || A}"
+ aria-expanded="${ariaExpanded || A}"
+ href=${this.href || A}
+ target=${this.target || A}
+ >${this.renderContent()}${button}>`;
+ }
+ getRenderClasses() {
+ return {
+ 'button--icon-leading': !this.trailingIcon && this.hasIcon,
+ 'button--icon-trailing': this.trailingIcon && this.hasIcon,
+ };
+ }
+ renderContent() {
+ // Link buttons may not be disabled
+ const isDisabled = this.disabled && !this.href;
+ const icon = x ``;
+ return x `
+ ${this.renderElevation?.()}
+ ${this.renderOutline?.()}
+
+
+
+ ${this.trailingIcon ? A : icon}
+
+ ${this.trailingIcon ? icon : A}
+ `;
+ }
+ handleSlotChange() {
+ this.hasIcon = this.assignedIcons.length > 0;
+ }
+}
+_a$2 = internals;
+(() => {
+ requestUpdateOnAriaChange(Button);
+ setupFormSubmitter(Button);
+})();
+/** @nocollapse */
+Button.formAssociated = true;
+/** @nocollapse */
+Button.shadowRootOptions = { mode: 'open', delegatesFocus: true };
+__decorate([
+ n$7({ type: Boolean, reflect: true })
+], Button.prototype, "disabled", void 0);
+__decorate([
+ n$7()
+], Button.prototype, "href", void 0);
+__decorate([
+ n$7()
+], Button.prototype, "target", void 0);
+__decorate([
+ n$7({ type: Boolean, attribute: 'trailing-icon' })
+], Button.prototype, "trailingIcon", void 0);
+__decorate([
+ n$7({ type: Boolean, attribute: 'has-icon' })
+], Button.prototype, "hasIcon", void 0);
+__decorate([
+ n$7()
+], Button.prototype, "type", void 0);
+__decorate([
+ n$7()
+], Button.prototype, "value", void 0);
+__decorate([
+ i$5('.button')
+], Button.prototype, "buttonElement", void 0);
+__decorate([
+ l$5({ slot: 'icon', flatten: true })
+], Button.prototype, "assignedIcons", void 0);
+
+/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * A filled button component.
+ */
+class FilledButton extends Button {
+ renderElevation() {
+ return x ``;
+ }
+}
+
+/**
+ * @license
+ * Copyright 2022 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+const styles$l = i$4 `: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));--_container-shape: var(--md-filled-button-container-shape, 9999px);--_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));--_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);--_container-shape-start-start: var( --md-filled-button-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-filled-button-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-filled-button-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-filled-button-container-shape-end-start, var(--_container-shape) )}/*# sourceMappingURL=filled-styles.css.map */
+`;
+
+/**
+ * @license
+ * Copyright 2022 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+const styles$k = i$4 `md-elevation{transition-duration:280ms}.button:disabled md-elevation{transition:none}.button{--md-elevation-level: var(--_container-elevation);--md-elevation-shadow-color: var(--_container-shadow-color)}.button:focus{--md-elevation-level: var(--_focus-container-elevation)}.button:hover{--md-elevation-level: var(--_hover-container-elevation)}.button:active{--md-elevation-level: var(--_pressed-container-elevation)}.button:disabled{--md-elevation-level: var(--_disabled-container-elevation)}/*# sourceMappingURL=shared-elevation-styles.css.map */
+`;
+
+/**
+ * @license
+ * Copyright 2022 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+const styles$j = i$4 `:host{display:inline-flex;height:var(--_container-height);outline:none;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);-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)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) 0}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([disabled]){cursor:default;pointer-events:none}.button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-inline-size:64px;border:none;outline:none;user-select:none;-webkit-appearance:none;vertical-align:middle;background:rgba(0,0,0,0);text-decoration:none;inline-size:100%;position:relative;z-index:0;height:100%;font:inherit;color:var(--_label-text-color);padding-inline-start:var(--_leading-space);padding-inline-end:var(--_trailing-space);gap:8px}.button::before{background-color:var(--_container-color);border-radius:inherit;content:"";inset:0;position:absolute}.button::-moz-focus-inner{padding:0;border:0}.button:hover{color:var(--_hover-label-text-color);cursor:pointer}.button:focus{color:var(--_focus-label-text-color)}.button:active{color:var(--_pressed-label-text-color);outline:none}.button:disabled .button__label{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.button:disabled::before{background-color:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}@media(forced-colors: active){.button::before{content:"";box-sizing:border-box;border:1px solid CanvasText;border-radius:inherit;inset:0;pointer-events:none;position:absolute}.button:disabled{--_disabled-icon-opacity: 1;--_disabled-container-opacity: 1;--_disabled-label-text-opacity: 1}}.button,.button__ripple{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)}.button::after,.button::before,md-elevation,.button__ripple{z-index:-1}.button--icon-leading{padding-inline-start:var(--_with-leading-icon-leading-space);padding-inline-end:var(--_with-leading-icon-trailing-space)}.button--icon-trailing{padding-inline-start:var(--_with-trailing-icon-leading-space);padding-inline-end:var(--_with-trailing-icon-trailing-space)}.link-button-wrapper{inline-size:100%}.button ::slotted([slot=icon]){display:inline-flex;position:relative;writing-mode:horizontal-tb;fill:currentColor;color:var(--_icon-color);font-size:var(--_icon-size);inline-size:var(--_icon-size);block-size:var(--_icon-size)}.button:hover ::slotted([slot=icon]){color:var(--_hover-icon-color)}.button:focus ::slotted([slot=icon]){color:var(--_focus-icon-color)}.button:active ::slotted([slot=icon]){color:var(--_pressed-icon-color)}.button:disabled ::slotted([slot=icon]){color:var(--_disabled-icon-color);opacity:var(--_disabled-icon-opacity)}.touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}:host([touch-target=none]) .touch{display:none}/*# sourceMappingURL=shared-styles.css.map */
+`;
+
+/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * @summary Buttons help people take action, such as sending an email, sharing a
+ * document, or liking a comment.
+ *
+ * @description
+ * __Emphasis:__ High emphasis – For the primary, most important, or most common
+ * action on a screen
+ *
+ * __Rationale:__ The filled button’s contrasting surface color makes it the
+ * most prominent button after the FAB. It’s used for final or unblocking
+ * actions in a flow.
+ *
+ * __Example usages:__
+ * - Save
+ * - Confirm
+ * - Done
+ *
+ * @final
+ * @suppress {visibility}
+ */
+let MdFilledButton = class MdFilledButton extends FilledButton {
+};
+MdFilledButton.styles = [styles$j, styles$k, styles$l];
+MdFilledButton = __decorate([
+ e$8('md-filled-button')
+], MdFilledButton);
+
+/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * An outlined button component.
+ */
+class OutlinedButton extends Button {
+ renderOutline() {
+ return x ``;
+ }
+}
+
+/**
+ * @license
+ * Copyright 2022 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+const styles$i = i$4 `:host{--_container-height: var(--md-outlined-button-container-height, 40px);--_container-shape: var(--md-outlined-button-container-shape, 9999px);--_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));--_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;--_container-shape-start-start: var( --md-outlined-button-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-outlined-button-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-outlined-button-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-outlined-button-container-shape-end-start, var(--_container-shape) )}.button__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)}.button:active .button__outline{border-color:var(--_pressed-outline-color)}.button:disabled .button__outline{border-color:var(--_disabled-outline-color);opacity:var(--_disabled-outline-opacity)}@media(forced-colors: active){.button:disabled .button__outline{opacity:1}}.button__outline,.button__ripple{border-width:var(--_outline-width)}.button__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)}/*# sourceMappingURL=outlined-styles.css.map */
+`;
+
+/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * @summary Buttons help people take action, such as sending an email, sharing a
+ * document, or liking a comment.
+ *
+ * @description
+ * __Emphasis:__ Medium emphasis – For important actions that don’t distract
+ * from other onscreen elements.
+ *
+ * __Rationale:__ Use an outlined button for actions that need attention but
+ * aren’t the primary action, such as “See all” or “Add to cart.” This is also
+ * the button to use for giving someone the opportunity to change their mind or
+ * escape a flow.
+ *
+ * __Example usages:__
+ * - Reply
+ * - View all
+ * - Add to cart
+ * - Take out of trash
+ *
+ * @final
+ * @suppress {visibility}
+ */
+let MdOutlinedButton = class MdOutlinedButton extends OutlinedButton {
+};
+MdOutlinedButton.styles = [styles$j, styles$i];
+MdOutlinedButton = __decorate([
+ e$8('md-outlined-button')
+], MdOutlinedButton);
+
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+/**
+ * A checkbox component.
+ */
+class Checkbox extends s$2 {
+ /**
+ * The HTML name to use in form submission.
+ */
+ get name() {
+ return this.getAttribute('name') ?? '';
+ }
+ set name(name) {
+ this.setAttribute('name', name);
+ }
+ /**
+ * The associated form element with which this element's value will submit.
+ */
+ get form() {
+ return this.internals.form;
+ }
+ /**
+ * The labels this element is associated with.
+ */
+ get labels() {
+ return this.internals.labels;
+ }
+ /**
+ * Returns a ValidityState object that represents the validity states of the
+ * checkbox.
+ *
+ * Note that checkboxes will only set `valueMissing` if `required` and not
+ * checked.
+ *
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation
+ */
+ get validity() {
+ this.syncValidity();
+ return this.internals.validity;
+ }
+ /**
+ * Returns the native validation error message.
+ *
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation#constraint_validation_process
+ */
+ get validationMessage() {
+ this.syncValidity();
+ return this.internals.validationMessage;
+ }
+ /**
+ * Returns whether an element will successfully validate based on forms
+ * validation rules and constraints.
+ *
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation#constraint_validation_process
+ */
+ get willValidate() {
+ this.syncValidity();
+ return this.internals.willValidate;
+ }
+ constructor() {
+ super();
+ /**
+ * Whether or not the checkbox is selected.
+ */
+ this.checked = false;
+ /**
+ * Whether or not the checkbox is disabled.
+ */
+ this.disabled = false;
+ /**
+ * Whether or not the checkbox is indeterminate.
+ *
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes
+ */
+ this.indeterminate = false;
+ /**
+ * When true, require the checkbox to be selected when participating in
+ * form submission.
+ *
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation
+ */
+ this.required = false;
+ /**
+ * The value of the checkbox that is submitted with a form when selected.
+ *
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#value
+ */
+ this.value = 'on';
+ this.prevChecked = false;
+ this.prevDisabled = false;
+ this.prevIndeterminate = false;
+ // Needed for Safari, see https://bugs.webkit.org/show_bug.cgi?id=261432
+ // Replace with this.internals.validity.customError when resolved.
+ this.hasCustomValidityError = false;
+ this.internals = this /* needed for closure */.attachInternals();
+ {
+ this.addEventListener('click', (event) => {
+ if (!isActivationClick(event)) {
+ return;
+ }
+ this.focus();
+ dispatchActivationClick(this.input);
+ });
+ }
+ }
+ /**
+ * Checks the checkbox's native validation and returns whether or not the
+ * element is valid.
+ *
+ * If invalid, this method will dispatch the `invalid` event.
+ *
+ * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity
+ *
+ * @return true if the checkbox is valid, or false if not.
+ */
+ checkValidity() {
+ this.syncValidity();
+ return this.internals.checkValidity();
+ }
+ /**
+ * Checks the checkbox's native validation and returns whether or not the
+ * element is valid.
+ *
+ * If invalid, this method will dispatch the `invalid` event.
+ *
+ * The `validationMessage` is reported to the user by the browser. Use
+ * `setCustomValidity()` to customize the `validationMessage`.
+ *
+ * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/reportValidity
+ *
+ * @return true if the checkbox is valid, or false if not.
+ */
+ reportValidity() {
+ this.syncValidity();
+ return this.internals.reportValidity();
+ }
+ /**
+ * Sets the checkbox's native validation error message. This is used to
+ * customize `validationMessage`.
+ *
+ * When the error is not an empty string, the checkbox is considered invalid
+ * and `validity.customError` will be true.
+ *
+ * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setCustomValidity
+ *
+ * @param error The error message to display.
+ */
+ setCustomValidity(error) {
+ this.hasCustomValidityError = !!error;
+ this.internals.setValidity({ customError: !!error }, error, this.getInput());
+ }
+ update(changed) {
+ if (changed.has('checked') || changed.has('disabled') ||
+ changed.has('indeterminate')) {
+ this.prevChecked = changed.get('checked') ?? this.checked;
+ this.prevDisabled = changed.get('disabled') ?? this.disabled;
+ this.prevIndeterminate =
+ changed.get('indeterminate') ?? this.indeterminate;
+ }
+ const shouldAddFormValue = this.checked && !this.indeterminate;
+ const state = String(this.checked);
+ this.internals.setFormValue(shouldAddFormValue ? this.value : null, state);
+ super.update(changed);
+ }
+ render() {
+ const prevNone = !this.prevChecked && !this.prevIndeterminate;
+ const prevChecked = this.prevChecked && !this.prevIndeterminate;
+ const prevIndeterminate = this.prevIndeterminate;
+ const isChecked = this.checked && !this.indeterminate;
+ const isIndeterminate = this.indeterminate;
+ const containerClasses = o$1({
+ 'disabled': this.disabled,
+ 'selected': isChecked || isIndeterminate,
+ 'unselected': !isChecked && !isIndeterminate,
+ 'checked': isChecked,
+ 'indeterminate': isIndeterminate,
+ 'prev-unselected': prevNone,
+ 'prev-checked': prevChecked,
+ 'prev-indeterminate': prevIndeterminate,
+ 'prev-disabled': this.prevDisabled,
+ });
+ // Needed for closure conformance
+ const { ariaLabel, ariaInvalid } = this;
+ // Note: needs to be rendered before the