@govtechsg/sgds-web-component 3.23.0-rc.2 → 3.23.0-rc.4
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/base/card-element.js +1 -1
- package/base/card-element.js.map +1 -1
- package/components/Card/index.umd.min.js +1 -1
- package/components/Card/index.umd.min.js.map +1 -1
- package/components/Checkbox/checkbox-group.js +1 -1
- package/components/Checkbox/index.umd.min.js +2 -2
- package/components/Checkbox/index.umd.min.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +3 -3
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/ComboBox/sgds-combo-box-option.js +1 -1
- package/components/ComboBox/sgds-combo-box-option.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +1 -1
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/FileUpload/index.umd.min.js +7 -7
- package/components/FileUpload/index.umd.min.js.map +1 -1
- package/components/IconCard/index.umd.min.js +1 -1
- package/components/IconCard/index.umd.min.js.map +1 -1
- package/components/ImageCard/index.umd.min.js +1 -1
- package/components/ImageCard/index.umd.min.js.map +1 -1
- package/components/Input/index.umd.min.js +2 -2
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Input/input.js +1 -1
- package/components/QuantityToggle/index.umd.min.js +2 -2
- package/components/QuantityToggle/index.umd.min.js.map +1 -1
- package/components/Radio/index.umd.min.js +1 -1
- package/components/Radio/index.umd.min.js.map +1 -1
- package/components/Select/index.umd.min.js +2 -2
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Select/sgds-select-option.js +1 -1
- package/components/Select/sgds-select-option.js.map +1 -1
- package/components/Switch/index.umd.min.js +1 -1
- package/components/Switch/index.umd.min.js.map +1 -1
- package/components/Textarea/index.umd.min.js +1 -1
- package/components/Textarea/index.umd.min.js.map +1 -1
- package/components/ThumbnailCard/index.umd.min.js +1 -1
- package/components/ThumbnailCard/index.umd.min.js.map +1 -1
- package/components/index.umd.min.js +7 -7
- package/components/index.umd.min.js.map +1 -1
- package/css/fouc.css +2 -2
- package/custom-elements.json +534 -534
- package/index.umd.min.js +7 -7
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/base/card-element.cjs.js +1 -1
- package/react/base/card-element.cjs.js.map +1 -1
- package/react/base/card-element.js +1 -1
- package/react/base/card-element.js.map +1 -1
- package/react/components/Checkbox/checkbox-group.cjs.js +1 -1
- package/react/components/Checkbox/checkbox-group.js +1 -1
- package/react/components/ComboBox/sgds-combo-box-option.cjs.js +1 -1
- package/react/components/ComboBox/sgds-combo-box-option.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box-option.js +1 -1
- package/react/components/ComboBox/sgds-combo-box-option.js.map +1 -1
- package/react/components/Input/input.cjs.js +1 -1
- package/react/components/Input/input.js +1 -1
- package/react/components/Select/sgds-select-option.cjs.js +1 -1
- package/react/components/Select/sgds-select-option.cjs.js.map +1 -1
- package/react/components/Select/sgds-select-option.js +1 -1
- package/react/components/Select/sgds-select-option.js.map +1 -1
- package/react/index.cjs.js +8 -8
- package/react/index.d.ts +2 -2
- package/react/index.js +2 -2
- package/react/styles/form-label.cjs.js +1 -1
- package/react/styles/form-label.js +1 -1
- package/react/styles/form-text-control.cjs.js +1 -1
- package/react/styles/form-text-control.js +1 -1
- package/styles/form-label.js +1 -1
- package/styles/form-text-control.js +1 -1
- package/types/react.d.ts +18 -18
|
@@ -4,25 +4,25 @@
|
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
const t=globalThis,l=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),a=new WeakMap;class s{constructor(e,t,l){if(this._$cssResult$=!0,l!==i)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this._strings=t}get styleSheet(){let e=this._styleSheet;const t=this._strings;if(l&&void 0===e){const l=void 0!==t&&1===t.length;l&&(e=a.get(t)),void 0===e&&((this._styleSheet=e=new CSSStyleSheet).replaceSync(this.cssText),l&&a.set(t,e))}return e}toString(){return this.cssText}}const o=(e,...t)=>{const l=1===e.length?e[0]:t.reduce((t,l,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw new 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.`)})(l)+e[i+1],e[0]);return new s(l,e,i)},r=e=>{let t="";for(const l of e.cssRules)t+=l.cssText;return new s("string"==typeof(l=t)?l:String(l),void 0,i);var l},n=l?e=>e:e=>e instanceof CSSStyleSheet?r(e):e,{is:c,defineProperty:d,getOwnPropertyDescriptor:h,getOwnPropertyNames:v,getOwnPropertySymbols:g,getPrototypeOf:p}=Object,u=globalThis;let f;const w=u.trustedTypes,m=w?w.emptyScript:"",x=u.reactiveElementPolyfillSupportDevMode;u.litIssuedWarnings??=new Set,f=(e,t)=>{t+=` See https://lit.dev/msg/${e} for more information.`,u.litIssuedWarnings.has(t)||u.litIssuedWarnings.has(e)||(console.warn(t),u.litIssuedWarnings.add(t))},queueMicrotask(()=>{f("dev-mode","Lit is in dev mode. Not recommended for production!"),u.ShadyDOM?.inUse&&void 0===x&&f("polyfill-support-missing","Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded.")});const Z=(e,t)=>e,b={toAttribute(e,t){switch(t){case Boolean:e=e?m:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let l=e;switch(t){case Boolean:l=null!==e;break;case Number:l=null===e?null:Number(e);break;case Object:case Array:try{l=JSON.parse(e)}catch(e){l=null}}return l}},C=(e,t)=>!c(e,t),_={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:C};Symbol.metadata??=Symbol("metadata"),u.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(e){this.__prepare(),(this._initializers??=[]).push(e)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap&&[...this.__attributeToPropertyMap.keys()]}static createProperty(e,t=_){if(t.state&&(t.attribute=!1),this.__prepare(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const l=Symbol.for(`${String(e)} (@property() cache)`),i=this.getPropertyDescriptor(e,l,t);void 0!==i&&d(this.prototype,e,i)}}static getPropertyDescriptor(e,t,l){const{get:i,set:a}=h(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};if(null==i){if("value"in(h(this.prototype,e)??{}))throw new Error(`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it's actually declared as a value on the prototype. Usually this is due to using @property or @state on a method.`);f("reactive-property-without-getter",`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit.`)}return{get:i,set(t){const s=i?.call(this);a?.call(this,t),this.requestUpdate(e,s,l)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static __prepare(){if(this.hasOwnProperty(Z("elementProperties")))return;const e=p(this);e.finalize(),void 0!==e._initializers&&(this._initializers=[...e._initializers]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Z("finalized")))return;if(this.finalized=!0,this.__prepare(),this.hasOwnProperty(Z("properties"))){const e=this.properties,t=[...v(e),...g(e)];for(const l of t)this.createProperty(l,e[l])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,l]of t)this.elementProperties.set(e,l)}this.__attributeToPropertyMap=new Map;for(const[e,t]of this.elementProperties){const l=this.__attributeNameForProperty(e,t);void 0!==l&&this.__attributeToPropertyMap.set(l,e)}this.elementStyles=this.finalizeStyles(this.styles),this.hasOwnProperty("createProperty")&&f("no-override-create-property","Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators"),this.hasOwnProperty("getPropertyDescriptor")&&f("no-override-get-property-descriptor","Overriding ReactiveElement.getPropertyDescriptor() is deprecated. The override will not be called with standard decorators")}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const l=new Set(e.flat(1/0).reverse());for(const e of l)t.unshift(n(e))}else void 0!==e&&t.push(n(e));return t}static __attributeNameForProperty(e,t){const l=t.attribute;return!1===l?void 0:"string"==typeof l?l:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this.__instanceProperties=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.__reflectingProperty=null,this.__initialize()}__initialize(){this.__updatePromise=new Promise(e=>this.enableUpdating=e),this._$changedProperties=new Map,this.__saveInstanceProperties(),this.requestUpdate(),this.constructor._initializers?.forEach(e=>e(this))}addController(e){(this.__controllers??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this.__controllers?.delete(e)}__saveInstanceProperties(){const e=new Map,t=this.constructor.elementProperties;for(const l of t.keys())this.hasOwnProperty(l)&&(e.set(l,this[l]),delete this[l]);e.size>0&&(this.__instanceProperties=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,i)=>{if(l)e.adoptedStyleSheets=i.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const l of i){const i=document.createElement("style"),a=t.litNonce;void 0!==a&&i.setAttribute("nonce",a),i.textContent=l.cssText,e.appendChild(i)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this.__controllers?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this.__controllers?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,l){this._$attributeToProperty(e,l)}__propertyToAttribute(e,t){const l=this.constructor.elementProperties.get(e),i=this.constructor.__attributeNameForProperty(e,l);if(void 0!==i&&!0===l.reflect){const a=(void 0!==l.converter?.toAttribute?l.converter:b).toAttribute(t,l.type);this.constructor.enabledWarnings.includes("migration")&&void 0===a&&f("undefined-attribute-value",`The attribute value for the ${e} property is undefined on element ${this.localName}. The attribute will be removed, but in the previous version of \`ReactiveElement\`, the attribute would not have changed.`),this.__reflectingProperty=e,null==a?this.removeAttribute(i):this.setAttribute(i,a),this.__reflectingProperty=null}}_$attributeToProperty(e,t){const l=this.constructor,i=l.__attributeToPropertyMap.get(e);if(void 0!==i&&this.__reflectingProperty!==i){const e=l.getPropertyOptions(i),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:b;this.__reflectingProperty=i;const s=a.fromAttribute(t,e.type);this[i]=s??this.__defaultValues?.get(i)??s,this.__reflectingProperty=null}}requestUpdate(e,t,l,i=!1,a){if(void 0!==e){e instanceof Event&&f("","The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()");const s=this.constructor;!1===i&&(a=this[e]),l??=s.getPropertyOptions(e);if(!((l.hasChanged??C)(a,t)||l.useDefault&&l.reflect&&a===this.__defaultValues?.get(e)&&!this.hasAttribute(s.__attributeNameForProperty(e,l))))return;this._$changeProperty(e,t,l)}!1===this.isUpdatePending&&(this.__updatePromise=this.__enqueueUpdate())}_$changeProperty(e,t,{useDefault:l,reflect:i,wrapped:a},s){l&&!(this.__defaultValues??=new Map).has(e)&&(this.__defaultValues.set(e,s??t??this[e]),!0!==a||void 0!==s)||(this._$changedProperties.has(e)||(this.hasUpdated||l||(t=void 0),this._$changedProperties.set(e,t)),!0===i&&this.__reflectingProperty!==e&&(this.__reflectingProperties??=new Set).add(e))}async __enqueueUpdate(){this.isUpdatePending=!0;try{await this.__updatePromise}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){const e=this.performUpdate();return this.constructor.enabledWarnings.includes("async-perform-update")&&"function"==typeof e?.then&&f("async-perform-update",`Element ${this.localName} returned a Promise from performUpdate(). This behavior is deprecated and will be removed in a future version of ReactiveElement.`),e}performUpdate(){if(!this.isUpdatePending)return;var e;if(e={kind:"update"},u.emitLitDebugLogEvents&&u.dispatchEvent(new CustomEvent("lit-debug",{detail:e})),!this.hasUpdated){this.renderRoot??=this.createRenderRoot();{const e=[...this.constructor.elementProperties.keys()].filter(e=>this.hasOwnProperty(e)&&e in p(this));if(e.length)throw new Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${e.join(", ")}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`)}if(this.__instanceProperties){for(const[e,t]of this.__instanceProperties)this[e]=t;this.__instanceProperties=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,l]of e){const{wrapped:e}=l,i=this[t];!0!==e||this._$changedProperties.has(t)||void 0===i||this._$changeProperty(t,void 0,l,i)}}let t=!1;const l=this._$changedProperties;try{t=this.shouldUpdate(l),t?(this.willUpdate(l),this.__controllers?.forEach(e=>e.hostUpdate?.()),this.update(l)):this.__markUpdated()}catch(e){throw t=!1,this.__markUpdated(),e}t&&this._$didUpdate(l)}willUpdate(e){}_$didUpdate(e){this.__controllers?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e),this.isUpdatePending&&this.constructor.enabledWarnings.includes("change-in-update")&&f("change-in-update",`Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`)}__markUpdated(){this._$changedProperties=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.__updatePromise}shouldUpdate(e){return!0}update(e){this.__reflectingProperties&&=this.__reflectingProperties.forEach(e=>this.__propertyToAttribute(e,this[e])),this.__markUpdated()}updated(e){}firstUpdated(e){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[Z("elementProperties")]=new Map,y[Z("finalized")]=new Map,x?.({ReactiveElement:y});{y.enabledWarnings=["change-in-update","async-perform-update"];const e=function(e){e.hasOwnProperty(Z("enabledWarnings"))||(e.enabledWarnings=e.enabledWarnings.slice())};y.enableWarning=function(t){e(this),this.enabledWarnings.includes(t)||this.enabledWarnings.push(t)},y.disableWarning=function(t){e(this);const l=this.enabledWarnings.indexOf(t);l>=0&&this.enabledWarnings.splice(l,1)}}(u.reactiveElementVersions??=[]).push("2.1.2"),u.reactiveElementVersions.length>1&&queueMicrotask(()=>{f("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});
|
|
7
|
+
const t=globalThis,l=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),a=new WeakMap;class s{constructor(e,t,l){if(this._$cssResult$=!0,l!==i)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this._strings=t}get styleSheet(){let e=this._styleSheet;const t=this._strings;if(l&&void 0===e){const l=void 0!==t&&1===t.length;l&&(e=a.get(t)),void 0===e&&((this._styleSheet=e=new CSSStyleSheet).replaceSync(this.cssText),l&&a.set(t,e))}return e}toString(){return this.cssText}}const o=(e,...t)=>{const l=1===e.length?e[0]:t.reduce((t,l,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw new 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.`)})(l)+e[i+1],e[0]);return new s(l,e,i)},r=e=>{let t="";for(const l of e.cssRules)t+=l.cssText;return new s("string"==typeof(l=t)?l:String(l),void 0,i);var l},n=l?e=>e:e=>e instanceof CSSStyleSheet?r(e):e,{is:c,defineProperty:d,getOwnPropertyDescriptor:h,getOwnPropertyNames:v,getOwnPropertySymbols:g,getPrototypeOf:p}=Object,u=globalThis;let f;const w=u.trustedTypes,m=w?w.emptyScript:"",x=u.reactiveElementPolyfillSupportDevMode;u.litIssuedWarnings??=new Set,f=(e,t)=>{t+=` See https://lit.dev/msg/${e} for more information.`,u.litIssuedWarnings.has(t)||u.litIssuedWarnings.has(e)||(console.warn(t),u.litIssuedWarnings.add(t))},queueMicrotask(()=>{f("dev-mode","Lit is in dev mode. Not recommended for production!"),u.ShadyDOM?.inUse&&void 0===x&&f("polyfill-support-missing","Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded.")});const b=(e,t)=>e,Z={toAttribute(e,t){switch(t){case Boolean:e=e?m:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let l=e;switch(t){case Boolean:l=null!==e;break;case Number:l=null===e?null:Number(e);break;case Object:case Array:try{l=JSON.parse(e)}catch(e){l=null}}return l}},C=(e,t)=>!c(e,t),_={attribute:!0,type:String,converter:Z,reflect:!1,useDefault:!1,hasChanged:C};Symbol.metadata??=Symbol("metadata"),u.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(e){this.__prepare(),(this._initializers??=[]).push(e)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap&&[...this.__attributeToPropertyMap.keys()]}static createProperty(e,t=_){if(t.state&&(t.attribute=!1),this.__prepare(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const l=Symbol.for(`${String(e)} (@property() cache)`),i=this.getPropertyDescriptor(e,l,t);void 0!==i&&d(this.prototype,e,i)}}static getPropertyDescriptor(e,t,l){const{get:i,set:a}=h(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};if(null==i){if("value"in(h(this.prototype,e)??{}))throw new Error(`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it's actually declared as a value on the prototype. Usually this is due to using @property or @state on a method.`);f("reactive-property-without-getter",`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit.`)}return{get:i,set(t){const s=i?.call(this);a?.call(this,t),this.requestUpdate(e,s,l)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static __prepare(){if(this.hasOwnProperty(b("elementProperties")))return;const e=p(this);e.finalize(),void 0!==e._initializers&&(this._initializers=[...e._initializers]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this.__prepare(),this.hasOwnProperty(b("properties"))){const e=this.properties,t=[...v(e),...g(e)];for(const l of t)this.createProperty(l,e[l])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,l]of t)this.elementProperties.set(e,l)}this.__attributeToPropertyMap=new Map;for(const[e,t]of this.elementProperties){const l=this.__attributeNameForProperty(e,t);void 0!==l&&this.__attributeToPropertyMap.set(l,e)}this.elementStyles=this.finalizeStyles(this.styles),this.hasOwnProperty("createProperty")&&f("no-override-create-property","Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators"),this.hasOwnProperty("getPropertyDescriptor")&&f("no-override-get-property-descriptor","Overriding ReactiveElement.getPropertyDescriptor() is deprecated. The override will not be called with standard decorators")}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const l=new Set(e.flat(1/0).reverse());for(const e of l)t.unshift(n(e))}else void 0!==e&&t.push(n(e));return t}static __attributeNameForProperty(e,t){const l=t.attribute;return!1===l?void 0:"string"==typeof l?l:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this.__instanceProperties=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.__reflectingProperty=null,this.__initialize()}__initialize(){this.__updatePromise=new Promise(e=>this.enableUpdating=e),this._$changedProperties=new Map,this.__saveInstanceProperties(),this.requestUpdate(),this.constructor._initializers?.forEach(e=>e(this))}addController(e){(this.__controllers??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this.__controllers?.delete(e)}__saveInstanceProperties(){const e=new Map,t=this.constructor.elementProperties;for(const l of t.keys())this.hasOwnProperty(l)&&(e.set(l,this[l]),delete this[l]);e.size>0&&(this.__instanceProperties=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,i)=>{if(l)e.adoptedStyleSheets=i.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const l of i){const i=document.createElement("style"),a=t.litNonce;void 0!==a&&i.setAttribute("nonce",a),i.textContent=l.cssText,e.appendChild(i)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this.__controllers?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this.__controllers?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,l){this._$attributeToProperty(e,l)}__propertyToAttribute(e,t){const l=this.constructor.elementProperties.get(e),i=this.constructor.__attributeNameForProperty(e,l);if(void 0!==i&&!0===l.reflect){const a=(void 0!==l.converter?.toAttribute?l.converter:Z).toAttribute(t,l.type);this.constructor.enabledWarnings.includes("migration")&&void 0===a&&f("undefined-attribute-value",`The attribute value for the ${e} property is undefined on element ${this.localName}. The attribute will be removed, but in the previous version of \`ReactiveElement\`, the attribute would not have changed.`),this.__reflectingProperty=e,null==a?this.removeAttribute(i):this.setAttribute(i,a),this.__reflectingProperty=null}}_$attributeToProperty(e,t){const l=this.constructor,i=l.__attributeToPropertyMap.get(e);if(void 0!==i&&this.__reflectingProperty!==i){const e=l.getPropertyOptions(i),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:Z;this.__reflectingProperty=i;const s=a.fromAttribute(t,e.type);this[i]=s??this.__defaultValues?.get(i)??s,this.__reflectingProperty=null}}requestUpdate(e,t,l,i=!1,a){if(void 0!==e){e instanceof Event&&f("","The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()");const s=this.constructor;!1===i&&(a=this[e]),l??=s.getPropertyOptions(e);if(!((l.hasChanged??C)(a,t)||l.useDefault&&l.reflect&&a===this.__defaultValues?.get(e)&&!this.hasAttribute(s.__attributeNameForProperty(e,l))))return;this._$changeProperty(e,t,l)}!1===this.isUpdatePending&&(this.__updatePromise=this.__enqueueUpdate())}_$changeProperty(e,t,{useDefault:l,reflect:i,wrapped:a},s){l&&!(this.__defaultValues??=new Map).has(e)&&(this.__defaultValues.set(e,s??t??this[e]),!0!==a||void 0!==s)||(this._$changedProperties.has(e)||(this.hasUpdated||l||(t=void 0),this._$changedProperties.set(e,t)),!0===i&&this.__reflectingProperty!==e&&(this.__reflectingProperties??=new Set).add(e))}async __enqueueUpdate(){this.isUpdatePending=!0;try{await this.__updatePromise}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){const e=this.performUpdate();return this.constructor.enabledWarnings.includes("async-perform-update")&&"function"==typeof e?.then&&f("async-perform-update",`Element ${this.localName} returned a Promise from performUpdate(). This behavior is deprecated and will be removed in a future version of ReactiveElement.`),e}performUpdate(){if(!this.isUpdatePending)return;var e;if(e={kind:"update"},u.emitLitDebugLogEvents&&u.dispatchEvent(new CustomEvent("lit-debug",{detail:e})),!this.hasUpdated){this.renderRoot??=this.createRenderRoot();{const e=[...this.constructor.elementProperties.keys()].filter(e=>this.hasOwnProperty(e)&&e in p(this));if(e.length)throw new Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${e.join(", ")}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`)}if(this.__instanceProperties){for(const[e,t]of this.__instanceProperties)this[e]=t;this.__instanceProperties=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,l]of e){const{wrapped:e}=l,i=this[t];!0!==e||this._$changedProperties.has(t)||void 0===i||this._$changeProperty(t,void 0,l,i)}}let t=!1;const l=this._$changedProperties;try{t=this.shouldUpdate(l),t?(this.willUpdate(l),this.__controllers?.forEach(e=>e.hostUpdate?.()),this.update(l)):this.__markUpdated()}catch(e){throw t=!1,this.__markUpdated(),e}t&&this._$didUpdate(l)}willUpdate(e){}_$didUpdate(e){this.__controllers?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e),this.isUpdatePending&&this.constructor.enabledWarnings.includes("change-in-update")&&f("change-in-update",`Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`)}__markUpdated(){this._$changedProperties=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.__updatePromise}shouldUpdate(e){return!0}update(e){this.__reflectingProperties&&=this.__reflectingProperties.forEach(e=>this.__propertyToAttribute(e,this[e])),this.__markUpdated()}updated(e){}firstUpdated(e){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[b("elementProperties")]=new Map,y[b("finalized")]=new Map,x?.({ReactiveElement:y});{y.enabledWarnings=["change-in-update","async-perform-update"];const e=function(e){e.hasOwnProperty(b("enabledWarnings"))||(e.enabledWarnings=e.enabledWarnings.slice())};y.enableWarning=function(t){e(this),this.enabledWarnings.includes(t)||this.enabledWarnings.push(t)},y.disableWarning=function(t){e(this);const l=this.enabledWarnings.indexOf(t);l>=0&&this.enabledWarnings.splice(l,1)}}(u.reactiveElementVersions??=[]).push("2.1.2"),u.reactiveElementVersions.length>1&&queueMicrotask(()=>{f("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2017 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
12
|
*/
|
|
13
|
-
const M=globalThis,V=e=>{M.emitLitDebugLogEvents&&M.dispatchEvent(new CustomEvent("lit-debug",{detail:e}))};let H,$=0;M.litIssuedWarnings??=new Set,H=(e,t)=>{t+=e?` See https://lit.dev/msg/${e} for more information.`:"",M.litIssuedWarnings.has(t)||M.litIssuedWarnings.has(e)||(console.warn(t),M.litIssuedWarnings.add(t))},queueMicrotask(()=>{H("dev-mode","Lit is in dev mode. Not recommended for production!")});const S=M.ShadyDOM?.inUse&&!0===M.ShadyDOM?.noPatch?M.ShadyDOM.wrap:e=>e,B=M.trustedTypes,k=B?B.createPolicy("lit-html",{createHTML:e=>e}):void 0,A=e=>e,L=(e,t,l)=>A,E=e=>{if(oe!==L)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");oe=e},P=()=>{oe=L},z=(e,t,l)=>oe(e,t,l),T="$lit$",I=`lit$${Math.random().toFixed(9).slice(2)}$`,N="?"+I,D=`<${N}>`,U=document,R=()=>U.createComment(""),F=e=>null===e||"object"!=typeof e&&"function"!=typeof e,O=Array.isArray,W=e=>O(e)||"function"==typeof e?.[Symbol.iterator],q="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,K=/-->/g,Y=/>/g,G=new RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),J=/'/g,X=/"/g,Q=/^(?:script|style|textarea|title)$/i,ee=(te=1,(e,...t)=>(e.some(e=>void 0===e)&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),t.some(e=>e?._$litStatic$)&&H("","Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\nPlease use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions"),{_$litType$:te,strings:e,values:t}));var te;const le=Symbol.for("lit-noChange"),ie=Symbol.for("lit-nothing"),ae=new WeakMap,se=U.createTreeWalker(U,129);let oe=L;function re(e,t){if(!O(e)||!e.hasOwnProperty("raw")){let e="invalid template strings array";throw e="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(e)}return void 0!==k?k.createHTML(t):t}const ne=(e,t)=>{const l=e.length-1,i=[];let a,s=2===t?"<svg>":3===t?"<math>":"",o=j;for(let t=0;t<l;t++){const l=e[t];let r,n,c=-1,d=0;for(;d<l.length&&(o.lastIndex=d,n=o.exec(l),null!==n);)if(d=o.lastIndex,o===j){if("!--"===n[1])o=K;else if(void 0!==n[1])o=Y;else if(void 0!==n[2])Q.test(n[2])&&(a=new RegExp(`</${n[2]}`,"g")),o=G;else if(void 0!==n[3])throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else o===G?">"===n[0]?(o=a??j,c=-1):void 0===n[1]?c=-2:(c=o.lastIndex-n[2].length,r=n[1],o=void 0===n[3]?G:'"'===n[3]?X:J):o===X||o===J?o=G:o===K||o===Y?o=j:(o=G,a=void 0);console.assert(-1===c||o===G||o===J||o===X,"unexpected parse state B");const h=o===G&&e[t+1].startsWith("/>")?" ":"";s+=o===j?l+D:c>=0?(i.push(r),l.slice(0,c)+T+l.slice(c)+I+h):l+I+(-2===c?t:h)}return[re(e,s+(e[l]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]};class ce{constructor({strings:e,_$litType$:t},l){let i;this.parts=[];let a=0,s=0;const o=e.length-1,r=this.parts,[n,c]=ne(e,t);if(this.el=ce.createElement(n,l),se.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=se.nextNode())&&r.length<o;){if(1===i.nodeType){{const e=i.localName;if(/^(?:textarea|template)$/i.test(e)&&i.innerHTML.includes(I)){const t=`Expressions are not supported inside \`${e}\` elements. See https://lit.dev/msg/expression-in-${e} for more information.`;if("template"===e)throw new Error(t);H("",t)}}if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(T)){const t=c[s++],l=i.getAttribute(e).split(I),o=/([.?@])?(.*)/.exec(t);r.push({type:1,index:a,name:o[2],strings:l,ctor:"."===o[1]?pe:"?"===o[1]?ue:"@"===o[1]?fe:ge}),i.removeAttribute(e)}else e.startsWith(I)&&(r.push({type:6,index:a}),i.removeAttribute(e));if(Q.test(i.tagName)){const e=i.textContent.split(I),t=e.length-1;if(t>0){i.textContent=B?B.emptyScript:"";for(let l=0;l<t;l++)i.append(e[l],R()),se.nextNode(),r.push({type:2,index:++a});i.append(e[t],R())}}}else if(8===i.nodeType){if(i.data===N)r.push({type:2,index:a});else{let e=-1;for(;-1!==(e=i.data.indexOf(I,e+1));)r.push({type:7,index:a}),e+=I.length-1}}a++}if(c.length!==s)throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join("${...}")+"`");V&&V({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){const l=U.createElement("template");return l.innerHTML=e,l}}function de(e,t,l=e,i){if(t===le)return t;let a=void 0!==i?l.__directives?.[i]:l.__directive;const s=F(t)?void 0:t._$litDirective$;return a?.constructor!==s&&(a?._$notifyDirectiveConnectionChanged?.(!1),void 0===s?a=void 0:(a=new s(e),a._$initialize(e,l,i)),void 0!==i?(l.__directives??=[])[i]=a:l.__directive=a),void 0!==a&&(t=de(e,a._$resolve(e,t.values),a,i)),t}class he{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){const{el:{content:t},parts:l}=this._$template,i=(e?.creationScope??U).importNode(t,!0);se.currentNode=i;let a=se.nextNode(),s=0,o=0,r=l[0];for(;void 0!==r;){if(s===r.index){let t;2===r.type?t=new ve(a,a.nextSibling,this,e):1===r.type?t=new r.ctor(a,r.name,r.strings,this,e):6===r.type&&(t=new we(a,this,e)),this._$parts.push(t),r=l[++o]}s!==r?.index&&(a=se.nextNode(),s++)}return se.currentNode=U,i}_update(e){let t=0;for(const l of this._$parts)void 0!==l&&(V&&V({kind:"set part",part:l,value:e[t],valueIndex:t,values:e,templateInstance:this}),void 0!==l.strings?(l._$setValue(e,l,t),t+=l.strings.length-2):l._$setValue(e[t])),t++}}class ve{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,l,i){this.type=2,this._$committedValue=ie,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=l,this.options=i,this.__isConnected=i?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=S(this._$startNode).parentNode;const t=this._$parent;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(null===this.parentNode)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(e=de(this,e,t),F(e))e===ie||null==e||""===e?(this._$committedValue!==ie&&(V&&V({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=ie):e!==this._$committedValue&&e!==le&&this._commitText(e);else if(void 0!==e._$litType$)this._commitTemplateResult(e);else if(void 0!==e.nodeType){if(this.options?.host===e)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",e,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(e)}else W(e)?this._commitIterable(e):this._commitText(e)}_insert(e){return S(S(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),oe!==L){const e=this._$startNode.parentNode?.nodeName;if("STYLE"===e||"SCRIPT"===e){let t="Forbidden";throw t="STYLE"===e?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(t)}}V&&V({kind:"commit node",start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==ie&&F(this._$committedValue)){const t=S(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=z(t,"data","property")),e=this._textSanitizer(e),V&&V({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}else{const t=U.createTextNode("");this._commitNode(t),void 0===this._textSanitizer&&(this._textSanitizer=z(t,"data","property")),e=this._textSanitizer(e),V&&V({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){const{values:t,_$litType$:l}=e,i="number"==typeof l?this._$getTemplate(e):(void 0===l.el&&(l.el=ce.createElement(re(l.h,l.h[0]),this.options)),l);if(this._$committedValue?._$template===i)V&&V({kind:"template updating",template:i,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{const e=new he(i,this),l=e._clone(this.options);V&&V({kind:"template instantiated",template:i,instance:e,parts:e._$parts,options:this.options,fragment:l,values:t}),e._update(t),V&&V({kind:"template instantiated and updated",template:i,instance:e,parts:e._$parts,options:this.options,fragment:l,values:t}),this._commitNode(l),this._$committedValue=e}}_$getTemplate(e){let t=ae.get(e.strings);return void 0===t&&ae.set(e.strings,t=new ce(e)),t}_commitIterable(e){O(this._$committedValue)||(this._$committedValue=[],this._$clear());const t=this._$committedValue;let l,i=0;for(const a of e)i===t.length?t.push(l=new ve(this._insert(R()),this._insert(R()),this,this.options)):l=t[i],l._$setValue(a),i++;i<t.length&&(this._$clear(l&&S(l._$endNode).nextSibling,i),t.length=i)}_$clear(e=S(this._$startNode).nextSibling,t){for(this._$notifyConnectionChanged?.(!1,!0,t);e!==this._$endNode;){const t=S(e).nextSibling;S(e).remove(),e=t}}setConnected(e){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=e,this._$notifyConnectionChanged?.(e)}}class ge{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(e,t,l,i,a){this.type=1,this._$committedValue=ie,this._$disconnectableChildren=void 0,this.element=e,this.name=t,this._$parent=i,this.options=a,l.length>2||""!==l[0]||""!==l[1]?(this._$committedValue=new Array(l.length-1).fill(new String),this.strings=l):this._$committedValue=ie,this._sanitizer=void 0}_$setValue(e,t=this,l,i){const a=this.strings;let s=!1;if(void 0===a)e=de(this,e,t,0),s=!F(e)||e!==this._$committedValue&&e!==le,s&&(this._$committedValue=e);else{const i=e;let o,r;for(e=a[0],o=0;o<a.length-1;o++)r=de(this,i[l+o],t,o),r===le&&(r=this._$committedValue[o]),s||=!F(r)||r!==this._$committedValue[o],r===ie?e=ie:e!==ie&&(e+=(r??"")+a[o+1]),this._$committedValue[o]=r}s&&!i&&this._commitValue(e)}_commitValue(e){e===ie?S(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=oe(this.element,this.name,"attribute")),e=this._sanitizer(e??""),V&&V({kind:"commit attribute",element:this.element,name:this.name,value:e,options:this.options}),S(this.element).setAttribute(this.name,e??""))}}class pe extends ge{constructor(){super(...arguments),this.type=3}_commitValue(e){void 0===this._sanitizer&&(this._sanitizer=oe(this.element,this.name,"property")),e=this._sanitizer(e),V&&V({kind:"commit property",element:this.element,name:this.name,value:e,options:this.options}),this.element[this.name]=e===ie?void 0:e}}class ue extends ge{constructor(){super(...arguments),this.type=4}_commitValue(e){V&&V({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!e||e===ie),options:this.options}),S(this.element).toggleAttribute(this.name,!!e&&e!==ie)}}class fe extends ge{constructor(e,t,l,i,a){if(super(e,t,l,i,a),this.type=5,void 0!==this.strings)throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if((e=de(this,e,t,0)??ie)===le)return;const l=this._$committedValue,i=e===ie&&l!==ie||e.capture!==l.capture||e.once!==l.once||e.passive!==l.passive,a=e!==ie&&(l===ie||i);V&&V({kind:"commit event listener",element:this.element,name:this.name,value:e,options:this.options,removeListener:i,addListener:a,oldListener:l}),i&&this.element.removeEventListener(this.name,this,l),a&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,e):this._$committedValue.handleEvent(e)}}class we{constructor(e,t,l){this.element=e,this.type=6,this._$disconnectableChildren=void 0,this._$parent=t,this.options=l}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){V&&V({kind:"commit to element binding",element:this.element,value:e,options:this.options}),de(this,e)}}const me={_boundAttributeSuffix:T,_marker:I,_markerMatch:N,_HTML_RESULT:1,_getTemplateHtml:ne,_TemplateInstance:he,_isIterable:W,_resolveDirective:de,_ChildPart:ve,_AttributePart:ge,_BooleanAttributePart:ue,_EventPart:fe,_PropertyPart:pe,_ElementPart:we},xe=M.litHtmlPolyfillSupportDevMode;xe?.(ce,ve),(M.litHtmlVersions??=[]).push("3.3.2"),M.litHtmlVersions.length>1&&queueMicrotask(()=>{H("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});const Ze=(e,t,l)=>{if(null==t)throw new TypeError(`The container to render into may not be ${t}`);const i=$++,a=l?.renderBefore??t;let s=a._$litPart$;if(V&&V({kind:"begin render",id:i,value:e,container:t,options:l,part:s}),void 0===s){const e=l?.renderBefore??null;a._$litPart$=s=new ve(t.insertBefore(R(),e),e,void 0,l??{})}return s._$setValue(e),V&&V({kind:"end render",id:i,value:e,container:t,options:l,part:s}),s};Ze.setSanitizer=E,Ze.createSanitizer=z,Ze._testOnlyClearSanitizerFactoryDoNotCallOrElse=P;
|
|
13
|
+
const M=globalThis,V=e=>{M.emitLitDebugLogEvents&&M.dispatchEvent(new CustomEvent("lit-debug",{detail:e}))};let H,$=0;M.litIssuedWarnings??=new Set,H=(e,t)=>{t+=e?` See https://lit.dev/msg/${e} for more information.`:"",M.litIssuedWarnings.has(t)||M.litIssuedWarnings.has(e)||(console.warn(t),M.litIssuedWarnings.add(t))},queueMicrotask(()=>{H("dev-mode","Lit is in dev mode. Not recommended for production!")});const S=M.ShadyDOM?.inUse&&!0===M.ShadyDOM?.noPatch?M.ShadyDOM.wrap:e=>e,B=M.trustedTypes,k=B?B.createPolicy("lit-html",{createHTML:e=>e}):void 0,A=e=>e,L=(e,t,l)=>A,E=e=>{if(oe!==L)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");oe=e},P=()=>{oe=L},z=(e,t,l)=>oe(e,t,l),T="$lit$",I=`lit$${Math.random().toFixed(9).slice(2)}$`,N="?"+I,D=`<${N}>`,U=document,R=()=>U.createComment(""),F=e=>null===e||"object"!=typeof e&&"function"!=typeof e,O=Array.isArray,W=e=>O(e)||"function"==typeof e?.[Symbol.iterator],q="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,K=/-->/g,Y=/>/g,G=new RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),J=/'/g,X=/"/g,Q=/^(?:script|style|textarea|title)$/i,ee=(te=1,(e,...t)=>(e.some(e=>void 0===e)&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),t.some(e=>e?._$litStatic$)&&H("","Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\nPlease use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions"),{_$litType$:te,strings:e,values:t}));var te;const le=Symbol.for("lit-noChange"),ie=Symbol.for("lit-nothing"),ae=new WeakMap,se=U.createTreeWalker(U,129);let oe=L;function re(e,t){if(!O(e)||!e.hasOwnProperty("raw")){let e="invalid template strings array";throw e="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(e)}return void 0!==k?k.createHTML(t):t}const ne=(e,t)=>{const l=e.length-1,i=[];let a,s=2===t?"<svg>":3===t?"<math>":"",o=j;for(let t=0;t<l;t++){const l=e[t];let r,n,c=-1,d=0;for(;d<l.length&&(o.lastIndex=d,n=o.exec(l),null!==n);)if(d=o.lastIndex,o===j){if("!--"===n[1])o=K;else if(void 0!==n[1])o=Y;else if(void 0!==n[2])Q.test(n[2])&&(a=new RegExp(`</${n[2]}`,"g")),o=G;else if(void 0!==n[3])throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else o===G?">"===n[0]?(o=a??j,c=-1):void 0===n[1]?c=-2:(c=o.lastIndex-n[2].length,r=n[1],o=void 0===n[3]?G:'"'===n[3]?X:J):o===X||o===J?o=G:o===K||o===Y?o=j:(o=G,a=void 0);console.assert(-1===c||o===G||o===J||o===X,"unexpected parse state B");const h=o===G&&e[t+1].startsWith("/>")?" ":"";s+=o===j?l+D:c>=0?(i.push(r),l.slice(0,c)+T+l.slice(c)+I+h):l+I+(-2===c?t:h)}return[re(e,s+(e[l]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]};class ce{constructor({strings:e,_$litType$:t},l){let i;this.parts=[];let a=0,s=0;const o=e.length-1,r=this.parts,[n,c]=ne(e,t);if(this.el=ce.createElement(n,l),se.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=se.nextNode())&&r.length<o;){if(1===i.nodeType){{const e=i.localName;if(/^(?:textarea|template)$/i.test(e)&&i.innerHTML.includes(I)){const t=`Expressions are not supported inside \`${e}\` elements. See https://lit.dev/msg/expression-in-${e} for more information.`;if("template"===e)throw new Error(t);H("",t)}}if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(T)){const t=c[s++],l=i.getAttribute(e).split(I),o=/([.?@])?(.*)/.exec(t);r.push({type:1,index:a,name:o[2],strings:l,ctor:"."===o[1]?pe:"?"===o[1]?ue:"@"===o[1]?fe:ge}),i.removeAttribute(e)}else e.startsWith(I)&&(r.push({type:6,index:a}),i.removeAttribute(e));if(Q.test(i.tagName)){const e=i.textContent.split(I),t=e.length-1;if(t>0){i.textContent=B?B.emptyScript:"";for(let l=0;l<t;l++)i.append(e[l],R()),se.nextNode(),r.push({type:2,index:++a});i.append(e[t],R())}}}else if(8===i.nodeType){if(i.data===N)r.push({type:2,index:a});else{let e=-1;for(;-1!==(e=i.data.indexOf(I,e+1));)r.push({type:7,index:a}),e+=I.length-1}}a++}if(c.length!==s)throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join("${...}")+"`");V&&V({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){const l=U.createElement("template");return l.innerHTML=e,l}}function de(e,t,l=e,i){if(t===le)return t;let a=void 0!==i?l.__directives?.[i]:l.__directive;const s=F(t)?void 0:t._$litDirective$;return a?.constructor!==s&&(a?._$notifyDirectiveConnectionChanged?.(!1),void 0===s?a=void 0:(a=new s(e),a._$initialize(e,l,i)),void 0!==i?(l.__directives??=[])[i]=a:l.__directive=a),void 0!==a&&(t=de(e,a._$resolve(e,t.values),a,i)),t}class he{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){const{el:{content:t},parts:l}=this._$template,i=(e?.creationScope??U).importNode(t,!0);se.currentNode=i;let a=se.nextNode(),s=0,o=0,r=l[0];for(;void 0!==r;){if(s===r.index){let t;2===r.type?t=new ve(a,a.nextSibling,this,e):1===r.type?t=new r.ctor(a,r.name,r.strings,this,e):6===r.type&&(t=new we(a,this,e)),this._$parts.push(t),r=l[++o]}s!==r?.index&&(a=se.nextNode(),s++)}return se.currentNode=U,i}_update(e){let t=0;for(const l of this._$parts)void 0!==l&&(V&&V({kind:"set part",part:l,value:e[t],valueIndex:t,values:e,templateInstance:this}),void 0!==l.strings?(l._$setValue(e,l,t),t+=l.strings.length-2):l._$setValue(e[t])),t++}}class ve{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,l,i){this.type=2,this._$committedValue=ie,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=l,this.options=i,this.__isConnected=i?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=S(this._$startNode).parentNode;const t=this._$parent;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(null===this.parentNode)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(e=de(this,e,t),F(e))e===ie||null==e||""===e?(this._$committedValue!==ie&&(V&&V({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=ie):e!==this._$committedValue&&e!==le&&this._commitText(e);else if(void 0!==e._$litType$)this._commitTemplateResult(e);else if(void 0!==e.nodeType){if(this.options?.host===e)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",e,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(e)}else W(e)?this._commitIterable(e):this._commitText(e)}_insert(e){return S(S(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),oe!==L){const e=this._$startNode.parentNode?.nodeName;if("STYLE"===e||"SCRIPT"===e){let t="Forbidden";throw t="STYLE"===e?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(t)}}V&&V({kind:"commit node",start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==ie&&F(this._$committedValue)){const t=S(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=z(t,"data","property")),e=this._textSanitizer(e),V&&V({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}else{const t=U.createTextNode("");this._commitNode(t),void 0===this._textSanitizer&&(this._textSanitizer=z(t,"data","property")),e=this._textSanitizer(e),V&&V({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){const{values:t,_$litType$:l}=e,i="number"==typeof l?this._$getTemplate(e):(void 0===l.el&&(l.el=ce.createElement(re(l.h,l.h[0]),this.options)),l);if(this._$committedValue?._$template===i)V&&V({kind:"template updating",template:i,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{const e=new he(i,this),l=e._clone(this.options);V&&V({kind:"template instantiated",template:i,instance:e,parts:e._$parts,options:this.options,fragment:l,values:t}),e._update(t),V&&V({kind:"template instantiated and updated",template:i,instance:e,parts:e._$parts,options:this.options,fragment:l,values:t}),this._commitNode(l),this._$committedValue=e}}_$getTemplate(e){let t=ae.get(e.strings);return void 0===t&&ae.set(e.strings,t=new ce(e)),t}_commitIterable(e){O(this._$committedValue)||(this._$committedValue=[],this._$clear());const t=this._$committedValue;let l,i=0;for(const a of e)i===t.length?t.push(l=new ve(this._insert(R()),this._insert(R()),this,this.options)):l=t[i],l._$setValue(a),i++;i<t.length&&(this._$clear(l&&S(l._$endNode).nextSibling,i),t.length=i)}_$clear(e=S(this._$startNode).nextSibling,t){for(this._$notifyConnectionChanged?.(!1,!0,t);e!==this._$endNode;){const t=S(e).nextSibling;S(e).remove(),e=t}}setConnected(e){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=e,this._$notifyConnectionChanged?.(e)}}class ge{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(e,t,l,i,a){this.type=1,this._$committedValue=ie,this._$disconnectableChildren=void 0,this.element=e,this.name=t,this._$parent=i,this.options=a,l.length>2||""!==l[0]||""!==l[1]?(this._$committedValue=new Array(l.length-1).fill(new String),this.strings=l):this._$committedValue=ie,this._sanitizer=void 0}_$setValue(e,t=this,l,i){const a=this.strings;let s=!1;if(void 0===a)e=de(this,e,t,0),s=!F(e)||e!==this._$committedValue&&e!==le,s&&(this._$committedValue=e);else{const i=e;let o,r;for(e=a[0],o=0;o<a.length-1;o++)r=de(this,i[l+o],t,o),r===le&&(r=this._$committedValue[o]),s||=!F(r)||r!==this._$committedValue[o],r===ie?e=ie:e!==ie&&(e+=(r??"")+a[o+1]),this._$committedValue[o]=r}s&&!i&&this._commitValue(e)}_commitValue(e){e===ie?S(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=oe(this.element,this.name,"attribute")),e=this._sanitizer(e??""),V&&V({kind:"commit attribute",element:this.element,name:this.name,value:e,options:this.options}),S(this.element).setAttribute(this.name,e??""))}}class pe extends ge{constructor(){super(...arguments),this.type=3}_commitValue(e){void 0===this._sanitizer&&(this._sanitizer=oe(this.element,this.name,"property")),e=this._sanitizer(e),V&&V({kind:"commit property",element:this.element,name:this.name,value:e,options:this.options}),this.element[this.name]=e===ie?void 0:e}}class ue extends ge{constructor(){super(...arguments),this.type=4}_commitValue(e){V&&V({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!e||e===ie),options:this.options}),S(this.element).toggleAttribute(this.name,!!e&&e!==ie)}}class fe extends ge{constructor(e,t,l,i,a){if(super(e,t,l,i,a),this.type=5,void 0!==this.strings)throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if((e=de(this,e,t,0)??ie)===le)return;const l=this._$committedValue,i=e===ie&&l!==ie||e.capture!==l.capture||e.once!==l.once||e.passive!==l.passive,a=e!==ie&&(l===ie||i);V&&V({kind:"commit event listener",element:this.element,name:this.name,value:e,options:this.options,removeListener:i,addListener:a,oldListener:l}),i&&this.element.removeEventListener(this.name,this,l),a&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,e):this._$committedValue.handleEvent(e)}}class we{constructor(e,t,l){this.element=e,this.type=6,this._$disconnectableChildren=void 0,this._$parent=t,this.options=l}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){V&&V({kind:"commit to element binding",element:this.element,value:e,options:this.options}),de(this,e)}}const me={_boundAttributeSuffix:T,_marker:I,_markerMatch:N,_HTML_RESULT:1,_getTemplateHtml:ne,_TemplateInstance:he,_isIterable:W,_resolveDirective:de,_ChildPart:ve,_AttributePart:ge,_BooleanAttributePart:ue,_EventPart:fe,_PropertyPart:pe,_ElementPart:we},xe=M.litHtmlPolyfillSupportDevMode;xe?.(ce,ve),(M.litHtmlVersions??=[]).push("3.3.2"),M.litHtmlVersions.length>1&&queueMicrotask(()=>{H("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});const be=(e,t,l)=>{if(null==t)throw new TypeError(`The container to render into may not be ${t}`);const i=$++,a=l?.renderBefore??t;let s=a._$litPart$;if(V&&V({kind:"begin render",id:i,value:e,container:t,options:l,part:s}),void 0===s){const e=l?.renderBefore??null;a._$litPart$=s=new ve(t.insertBefore(R(),e),e,void 0,l??{})}return s._$setValue(e),V&&V({kind:"end render",id:i,value:e,container:t,options:l,part:s}),s};be.setSanitizer=E,be.createSanitizer=z,be._testOnlyClearSanitizerFactoryDoNotCallOrElse=P;
|
|
14
14
|
/**
|
|
15
15
|
* @license
|
|
16
16
|
* Copyright 2017 Google LLC
|
|
17
17
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
18
18
|
*/
|
|
19
|
-
const
|
|
19
|
+
const Ze=globalThis;let Ce;Ze.litIssuedWarnings??=new Set,Ce=(e,t)=>{t+=` See https://lit.dev/msg/${e} for more information.`,Ze.litIssuedWarnings.has(t)||Ze.litIssuedWarnings.has(e)||(console.warn(t),Ze.litIssuedWarnings.add(t))};class _e extends y{constructor(){super(...arguments),this.renderOptions={host:this},this.__childPart=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.__childPart=be(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.__childPart?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.__childPart?.setConnected(!1)}render(){return le}}var ye;_e._$litElement$=!0,_e[(ye="finalized",ye)]=!0,Ze.litElementHydrateSupport?.({LitElement:_e});const Me=Ze.litElementPolyfillSupportDevMode;
|
|
20
20
|
/**
|
|
21
21
|
* @license
|
|
22
22
|
* Copyright 2017 Google LLC
|
|
23
23
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
24
24
|
*/
|
|
25
|
-
let Ve;Me?.({LitElement:_e}),(
|
|
25
|
+
let Ve;Me?.({LitElement:_e}),(Ze.litElementVersions??=[]).push("4.2.2"),Ze.litElementVersions.length>1&&queueMicrotask(()=>{Ce("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")}),globalThis.litIssuedWarnings??=new Set,Ve=(e,t)=>{t+=` See https://lit.dev/msg/${e} for more information.`,globalThis.litIssuedWarnings.has(t)||globalThis.litIssuedWarnings.has(e)||(console.warn(t),globalThis.litIssuedWarnings.add(t))};const He={attribute:!0,type:String,converter:Z,reflect:!1,hasChanged:C},$e=(e=He,t,l)=>{const{kind:i,metadata:a}=l;null==a&&Ve("missing-class-metadata",`The class ${t} is missing decorator metadata. This could mean that you're using a compiler that supports decorators but doesn't support decorator metadata, such as TypeScript 5.1. Please update your compiler.`);let s=globalThis.litPropertyMetadata.get(a);if(void 0===s&&globalThis.litPropertyMetadata.set(a,s=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),s.set(l.name,e),"accessor"===i){const{name:i}=l;return{set(l){const a=t.get.call(this);t.set.call(this,l),this.requestUpdate(i,a,e,!0,l)},init(t){return void 0!==t&&this._$changeProperty(i,void 0,e,t),t}}}if("setter"===i){const{name:i}=l;return function(l){const a=this[i];t.call(this,l),this.requestUpdate(i,a,e,!0,l)}}throw new Error(`Unsupported decorator location: ${i}`)};function Se(e){return(t,l)=>"object"==typeof l?$e(e,t,l):((e,t,l)=>{const i=t.hasOwnProperty(l);return t.constructor.createProperty(l,e),i?Object.getOwnPropertyDescriptor(t,l):void 0})(e,t,l)}
|
|
26
26
|
/**
|
|
27
27
|
* @license
|
|
28
28
|
* Copyright 2017 Google LLC
|
|
@@ -73,7 +73,7 @@ function Le(e){return(t,l)=>ke(t,l,{async get(){return await this.updateComplete
|
|
|
73
73
|
* @license
|
|
74
74
|
* Copyright 2018 Google LLC
|
|
75
75
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
76
|
-
*/var ht,vt=o`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-font-smoothing:antialiased;color:var(--sgds-body-color-default,#1a1a1a);display:block;font-family:var(--sgds-font-family-brand,"Inter",system-ui,sans-serif);font-size:var(--sgds-font-size-body-md,1rem);font-weight:var(--sgds-font-weight-regular,400);line-height:var(--sgds-line-height-xs,24px);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class gt extends _e{emit(e,t){const l=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(l),l}static define(e,t=this,l={}){if(customElements.get(e));else try{customElements.define(e,t,l)}catch(i){customElements.define(e,class extends t{},l)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}gt.styles=[vt],gt.dependencies={},e([Se({type:Boolean,reflect:!0})],gt.prototype,"ssr",void 0);var pt,ut,ft=o`:host{--btn-font-weight:var(--sgds-font-weight-regular);--btn-color:var(--sgds-color-fixed-light);--btn-bg:var(--sgds-primary-surface-default);--btn-hover-bg:var(--sgds-primary-surface-emphasis);--btn-border-radius:var(--sgds-border-radius-md);--btn-opacity:var(--sgds-opacity-100,1)}:host([variant=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=brand]){--btn-bg:var(--sgds-primary-surface-default);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline]){--btn-border-width:var(--sgds-border-width-1)}:host([variant=outline][tone=brand]){--btn-border-color:var(--sgds-primary-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-color:var(--sgds-primary-color-default);--btn-hover-bg:var(--sgds-primary-bg-translucent)}:host([variant=ghost][tone=brand]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-primary-surface-translucent);--btn-color:var(--sgds-primary-color-default)}:host([variant=primary][tone=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline][tone=danger]){--btn-border-color:var(--sgds-danger-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=ghost][tone=danger]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=primary][tone=fixed-light]){--btn-bg:var(--sgds-surface-fixed-light);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 0%,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 100%),var(--sgds-surface-fixed-light,#fff);--btn-color:var(--sgds-color-fixed-dark)}:host([variant=outline][tone=fixed-light]){--btn-border-color:var(--sgds-border-color-fixed-light);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=ghost][tone=fixed-light]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=neutral]){--btn-bg:var(--sgds-surface-inverse);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-surface-inverse);--btn-color:var(--sgds-color-inverse)}:host([variant=outline][tone=neutral]){--btn-border-color:var(--sgds-border-color-emphasis);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost][tone=neutral]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost]) .btn,:host([variant=outline]) .btn,:host([variant=primary]) .btn{color:var(--btn-color)}:host([variant=outline]) .btn{border:var(--btn-border-width) solid var(--btn-border-color)}:host([size=lg]) .btn{font-size:var(--sgds-font-size-label-lg);height:var(--sgds-dimension-56);line-height:var(--sgds-line-height-md);min-width:var(--sgds-dimension-112);padding:var(--sgds-padding-none) var(--sgds-padding-xl)}:host([size=sm]) .btn{font-size:var(--sgds-font-size-label-sm);height:var(--sgds-dimension-40);line-height:var(--sgds-line-height-2-xs);min-width:var(--sgds-dimension-80);padding:var(--sgds-padding-none) var(--sgds-padding-md)}:host([size=xs]) .btn{font-size:var(--sgds-font-size-label-xs);height:var(--sgds-dimension-32);line-height:var(--sgds-line-height-3-xs);min-width:var(--sgds-dimension-64);padding:var(--sgds-padding-none) var(--sgds-padding-sm)}.btn{align-items:center;background-color:var(--btn-bg);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--btn-border-radius);color:var(--sgds-color-fixed-light);cursor:pointer;display:inline-flex;font-size:var(--sgds-font-size-label-md);font-weight:var(--btn-font-weight);gap:var(--sgds-gap-2-xs);height:var(--sgds-dimension-48);justify-content:center;line-height:var(--sgds-line-height-xs);min-width:var(--sgds-dimension-96);opacity:var(--btn-opacity);padding:var(--sgds-padding-none) var(--sgds-padding-lg);text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;user-select:none;vertical-align:middle;white-space:nowrap;width:inherit}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn.active,.btn:hover{background:var(--btn-hover-bg)}.btn:focus,.btn:focus-visible{background:var(--btn-hover-bg);border-color:transparent;outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.btn.disabled,.btn:disabled{color:var(--btn-color);cursor:not-allowed;opacity:var(--sgds-opacity-40)}.btn.loading{cursor:default}.btn slot::slotted(*){color:var(--btn-color)}`;class wt extends gt{constructor(){super(...arguments),this.variant="primary",this.tone="brand",this.size="md",this.active=!1,this.disabled=!1,this.target="_self"}focus(e){this.button.focus(e)}click(){this.button.click()}blur(){this.button.blur()}_handleBlur(){this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleClick(e){if(this.disabled||this.loading)return e.preventDefault(),void e.stopPropagation()}_handleKeydown(e){if("Enter"===e.key&&this.loading)return e.preventDefault(),void e.stopPropagation()}_assignSpinnerSize(e){return"xs"===e||"sm"===e?"xs":"md"===e||"lg"===e?"sm":void 0}_assignSpinnerTone(e,t){return"fixed-light"===e&&"primary"===t?"fixed-dark":"neutral"===e&&"primary"===t?"inverse":"fixed-light"===e||"primary"===t?"fixed-light":"neutral"!==e||"outline"!==t&&"ghost"!==t?"brand":"neutral"}}wt.styles=[...gt.styles,ft],e([(pt=".btn",(e,t,l)=>{const i=e=>{const l=e.renderRoot?.querySelector(pt)??null;if(null===l&&ut&&!e.hasUpdated){const e="object"==typeof t?t.name:t;Ae("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${pt}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return l};if(ut){const{get:a,set:s}="object"==typeof t?e:l??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return ke(e,t,{get(){let e=a.call(this);return void 0===e&&(e=i(this),(null!==e||this.hasUpdated)&&s.call(this,e)),e}})}return ke(e,t,{get(){return i(this)}})})],wt.prototype,"button",void 0),e([Se({reflect:!0})],wt.prototype,"variant",void 0),e([Se({reflect:!0})],wt.prototype,"tone",void 0),e([Se({reflect:!0})],wt.prototype,"size",void 0),e([Se({type:Boolean,reflect:!0})],wt.prototype,"active",void 0),e([Se({type:Boolean,reflect:!0})],wt.prototype,"disabled",void 0),e([Se({type:String,reflect:!0})],wt.prototype,"href",void 0),e([Se({type:String,reflect:!0})],wt.prototype,"target",void 0),e([Se({type:String,reflect:!0})],wt.prototype,"download",void 0),e([Se({type:String})],wt.prototype,"ariaLabel",void 0),e([Se({type:Boolean})],wt.prototype,"loading",void 0);class mt{constructor(e,...t){this.slotNames=[],(this.host=e).addController(this),this.slotNames=t,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some(e=>{var t;if(e.nodeType===e.TEXT_NODE&&""!==(null===(t=e.textContent)||void 0===t?void 0:t.trim()))return!0;if(e.nodeType===e.ELEMENT_NODE){const t=e;if("sl-visually-hidden"===t.tagName.toLowerCase())return!1;if(!t.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(e){return null!==this.host.querySelector(`:scope > [slot="${e}"]`)}test(e){return"[default]"===e?this.hasDefaultSlot():this.hasNamedSlot(e)}hostConnected(){var e;null===(e=this.host.shadowRoot)||void 0===e||e.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){var e;null===(e=this.host.shadowRoot)||void 0===e||e.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(e){const t=e.target;(this.slotNames.includes("[default]")&&!t.name||t.name&&this.slotNames.includes(t.name))&&this.host.requestUpdate()}}class xt{constructor(e,t){(this.host=e).addController(this),this.options=Object.assign({form:e=>e.closest("form")},t)}hostConnected(){this.form=this.options.form(this.host)}hostDisconnected(){this.form&&(this.form=void 0)}doAction(e,t){if(this.form){const l=document.createElement("button");l.type=e,l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.clipPath="inset(50%)",l.style.overflow="hidden",l.style.whiteSpace="nowrap",t&&(["formaction","formmethod","formnovalidate","formtarget"].forEach(e=>{t.hasAttribute(e)&&l.setAttribute(e,t.getAttribute(e))}),"submit"===e&&t.hasAttribute("name")&&(l.name=t.getAttribute("name"),l.value=t.getAttribute("value")||"")),this.form.append(l),l.click(),l.remove()}}reset(e){this.doAction("reset",e)}submit(e){this.doAction("submit",e)}}var Zt=o`::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}`,bt=o`:host{display:inline-block}:host([fullWidth]),:host([fullWidth]) .btn{width:100%}:host([fullWidth]) .btn.has-left-icon{justify-content:flex-start}:host([fullWidth]) .btn.has-right-icon{justify-content:space-between}:host([fullWidth]) .btn.has-left-icon.has-right-icon{justify-content:center}.btn span{padding:0 var(--sgds-padding-2-xs)}.btn.no-icon{gap:var(--sgds-gap-none)}.loading{cursor:default}`;class Ct extends wt{constructor(){super(...arguments),this.formSubmitController=new xt(this,{form:e=>{if(e.hasAttribute("form")){const t=e.getRootNode(),l=e.getAttribute("form");return t.getElementById(l)}return e.closest("form")}}),this.type="button",this.fullWidth=!1,this.hasLeftIconSlot=!1,this.hasRightIconSlot=!1,this.hasSlotController=new mt(this,"leftIcon","rightIcon"),this._clickHandler=()=>{"submit"===this.type&&this.formSubmitController.submit(this),"reset"===this.type&&this.formSubmitController.reset(this)}}updated(){this.hasLeftIconSlot||(this.hasLeftIconSlot=this.hasSlotController.test("leftIcon")),this.hasRightIconSlot||(this.hasRightIconSlot=this.hasSlotController.test("rightIcon"))}_handleClick(e){if(this.disabled||this.loading)return e.preventDefault(),void e.stopPropagation();this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}render(){const e=this.href,t=e?nt`a`:nt`button`,l=!this.hasLeftIconSlot&&!this.hasRightIconSlot;return dt`
|
|
76
|
+
*/var ht,vt=o`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-font-smoothing:antialiased;color:var(--sgds-body-color-default,#1a1a1a);display:block;font-family:var(--sgds-font-family-brand,"Inter",system-ui,sans-serif);font-size:var(--sgds-font-size-body-md,1rem);font-weight:var(--sgds-font-weight-regular,400);line-height:var(--sgds-line-height-xs,24px);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class gt extends _e{emit(e,t){const l=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(l),l}static define(e,t=this,l={}){if(customElements.get(e));else try{customElements.define(e,t,l)}catch(i){customElements.define(e,class extends t{},l)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}gt.styles=[vt],gt.dependencies={},e([Se({type:Boolean,reflect:!0})],gt.prototype,"ssr",void 0);var pt,ut,ft=o`:host{--btn-font-weight:var(--sgds-font-weight-regular);--btn-color:var(--sgds-color-fixed-light);--btn-bg:var(--sgds-primary-surface-default);--btn-hover-bg:var(--sgds-primary-surface-emphasis);--btn-border-radius:var(--sgds-border-radius-md);--btn-opacity:var(--sgds-opacity-100,1)}:host([variant=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=brand]){--btn-bg:var(--sgds-primary-surface-default);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline]){--btn-border-width:var(--sgds-border-width-1)}:host([variant=outline][tone=brand]){--btn-border-color:var(--sgds-primary-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-color:var(--sgds-primary-color-default);--btn-hover-bg:var(--sgds-primary-bg-translucent)}:host([variant=ghost][tone=brand]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-primary-surface-translucent);--btn-color:var(--sgds-primary-color-default)}:host([variant=primary][tone=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline][tone=danger]){--btn-border-color:var(--sgds-danger-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=ghost][tone=danger]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=primary][tone=fixed-light]){--btn-bg:var(--sgds-surface-fixed-light);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 0%,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 100%),var(--sgds-surface-fixed-light,#fff);--btn-color:var(--sgds-color-fixed-dark)}:host([variant=outline][tone=fixed-light]){--btn-border-color:var(--sgds-border-color-fixed-light);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=ghost][tone=fixed-light]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=neutral]){--btn-bg:var(--sgds-surface-inverse);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-surface-inverse);--btn-color:var(--sgds-color-inverse)}:host([variant=outline][tone=neutral]){--btn-border-color:var(--sgds-border-color-emphasis);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost][tone=neutral]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost]) .btn,:host([variant=outline]) .btn,:host([variant=primary]) .btn{color:var(--btn-color)}:host([variant=outline]) .btn{border:var(--btn-border-width) solid var(--btn-border-color)}:host([size=lg]) .btn{font-size:var(--sgds-font-size-label-lg);height:var(--sgds-dimension-56);line-height:var(--sgds-line-height-md);min-width:var(--sgds-dimension-112);padding:var(--sgds-padding-none) var(--sgds-padding-xl)}:host([size=sm]) .btn{font-size:var(--sgds-font-size-label-sm);height:var(--sgds-dimension-40);line-height:var(--sgds-line-height-2-xs);min-width:var(--sgds-dimension-80);padding:var(--sgds-padding-none) var(--sgds-padding-md)}:host([size=xs]) .btn{font-size:var(--sgds-font-size-label-xs);height:var(--sgds-dimension-32);line-height:var(--sgds-line-height-3-xs);min-width:var(--sgds-dimension-64);padding:var(--sgds-padding-none) var(--sgds-padding-sm)}.btn{align-items:center;background-color:var(--btn-bg);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--btn-border-radius);color:var(--sgds-color-fixed-light);cursor:pointer;display:inline-flex;font-size:var(--sgds-font-size-label-md);font-weight:var(--btn-font-weight);gap:var(--sgds-gap-2-xs);height:var(--sgds-dimension-48);justify-content:center;line-height:var(--sgds-line-height-xs);min-width:var(--sgds-dimension-96);opacity:var(--btn-opacity);padding:var(--sgds-padding-none) var(--sgds-padding-lg);text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;user-select:none;vertical-align:middle;white-space:nowrap;width:inherit}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn.active,.btn:hover{background:var(--btn-hover-bg)}.btn:focus,.btn:focus-visible{background:var(--btn-hover-bg);border-color:transparent;outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.btn.disabled,.btn:disabled{color:var(--btn-color);cursor:not-allowed;opacity:var(--sgds-opacity-40)}.btn.loading{cursor:default}.btn slot::slotted(*){color:var(--btn-color)}`;class wt extends gt{constructor(){super(...arguments),this.variant="primary",this.tone="brand",this.size="md",this.active=!1,this.disabled=!1,this.target="_self"}focus(e){this.button.focus(e)}click(){this.button.click()}blur(){this.button.blur()}_handleBlur(){this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleClick(e){if(this.disabled||this.loading)return e.preventDefault(),void e.stopPropagation()}_handleKeydown(e){if("Enter"===e.key&&this.loading)return e.preventDefault(),void e.stopPropagation()}_assignSpinnerSize(e){return"xs"===e||"sm"===e?"xs":"md"===e||"lg"===e?"sm":void 0}_assignSpinnerTone(e,t){return"fixed-light"===e&&"primary"===t?"fixed-dark":"neutral"===e&&"primary"===t?"inverse":"fixed-light"===e||"primary"===t?"fixed-light":"neutral"!==e||"outline"!==t&&"ghost"!==t?"brand":"neutral"}}wt.styles=[...gt.styles,ft],e([(pt=".btn",(e,t,l)=>{const i=e=>{const l=e.renderRoot?.querySelector(pt)??null;if(null===l&&ut&&!e.hasUpdated){const e="object"==typeof t?t.name:t;Ae("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${pt}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return l};if(ut){const{get:a,set:s}="object"==typeof t?e:l??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return ke(e,t,{get(){let e=a.call(this);return void 0===e&&(e=i(this),(null!==e||this.hasUpdated)&&s.call(this,e)),e}})}return ke(e,t,{get(){return i(this)}})})],wt.prototype,"button",void 0),e([Se({reflect:!0})],wt.prototype,"variant",void 0),e([Se({reflect:!0})],wt.prototype,"tone",void 0),e([Se({reflect:!0})],wt.prototype,"size",void 0),e([Se({type:Boolean,reflect:!0})],wt.prototype,"active",void 0),e([Se({type:Boolean,reflect:!0})],wt.prototype,"disabled",void 0),e([Se({type:String,reflect:!0})],wt.prototype,"href",void 0),e([Se({type:String,reflect:!0})],wt.prototype,"target",void 0),e([Se({type:String,reflect:!0})],wt.prototype,"download",void 0),e([Se({type:String})],wt.prototype,"ariaLabel",void 0),e([Se({type:Boolean})],wt.prototype,"loading",void 0);class mt{constructor(e,...t){this.slotNames=[],(this.host=e).addController(this),this.slotNames=t,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some(e=>{var t;if(e.nodeType===e.TEXT_NODE&&""!==(null===(t=e.textContent)||void 0===t?void 0:t.trim()))return!0;if(e.nodeType===e.ELEMENT_NODE){const t=e;if("sl-visually-hidden"===t.tagName.toLowerCase())return!1;if(!t.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(e){return null!==this.host.querySelector(`:scope > [slot="${e}"]`)}test(e){return"[default]"===e?this.hasDefaultSlot():this.hasNamedSlot(e)}hostConnected(){var e;null===(e=this.host.shadowRoot)||void 0===e||e.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){var e;null===(e=this.host.shadowRoot)||void 0===e||e.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(e){const t=e.target;(this.slotNames.includes("[default]")&&!t.name||t.name&&this.slotNames.includes(t.name))&&this.host.requestUpdate()}}class xt{constructor(e,t){(this.host=e).addController(this),this.options=Object.assign({form:e=>e.closest("form")},t)}hostConnected(){this.form=this.options.form(this.host)}hostDisconnected(){this.form&&(this.form=void 0)}doAction(e,t){if(this.form){const l=document.createElement("button");l.type=e,l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.clipPath="inset(50%)",l.style.overflow="hidden",l.style.whiteSpace="nowrap",t&&(["formaction","formmethod","formnovalidate","formtarget"].forEach(e=>{t.hasAttribute(e)&&l.setAttribute(e,t.getAttribute(e))}),"submit"===e&&t.hasAttribute("name")&&(l.name=t.getAttribute("name"),l.value=t.getAttribute("value")||"")),this.form.append(l),l.click(),l.remove()}}reset(e){this.doAction("reset",e)}submit(e){this.doAction("submit",e)}}var bt=o`::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}`,Zt=o`:host{display:inline-block}:host([fullWidth]),:host([fullWidth]) .btn{width:100%}:host([fullWidth]) .btn.has-left-icon{justify-content:flex-start}:host([fullWidth]) .btn.has-right-icon{justify-content:space-between}:host([fullWidth]) .btn.has-left-icon.has-right-icon{justify-content:center}.btn span{padding:0 var(--sgds-padding-2-xs)}.btn.no-icon{gap:var(--sgds-gap-none)}.loading{cursor:default}`;class Ct extends wt{constructor(){super(...arguments),this.formSubmitController=new xt(this,{form:e=>{if(e.hasAttribute("form")){const t=e.getRootNode(),l=e.getAttribute("form");return t.getElementById(l)}return e.closest("form")}}),this.type="button",this.fullWidth=!1,this.hasLeftIconSlot=!1,this.hasRightIconSlot=!1,this.hasSlotController=new mt(this,"leftIcon","rightIcon"),this._clickHandler=()=>{"submit"===this.type&&this.formSubmitController.submit(this),"reset"===this.type&&this.formSubmitController.reset(this)}}updated(){this.hasLeftIconSlot||(this.hasLeftIconSlot=this.hasSlotController.test("leftIcon")),this.hasRightIconSlot||(this.hasRightIconSlot=this.hasSlotController.test("rightIcon"))}_handleClick(e){if(this.disabled||this.loading)return e.preventDefault(),void e.stopPropagation();this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}render(){const e=this.href,t=e?nt`a`:nt`button`,l=!this.hasLeftIconSlot&&!this.hasRightIconSlot;return dt`
|
|
77
77
|
<${t}
|
|
78
78
|
class="btn ${at({disabled:this.disabled,active:this.active,"has-left-icon":this.hasLeftIconSlot,"has-right-icon":this.hasRightIconSlot,"no-icon":l,loading:this.loading})}"
|
|
79
79
|
?disabled=${st(e?void 0:this.disabled)}
|
|
@@ -101,11 +101,11 @@ function Le(e){return(t,l)=>ke(t,l,{async get(){return await this.updateComplete
|
|
|
101
101
|
<slot name="rightIcon"></slot>`}
|
|
102
102
|
|
|
103
103
|
</${t}>
|
|
104
|
-
`}}Ct.styles=[...wt.styles,Zt
|
|
104
|
+
`}}Ct.styles=[...wt.styles,bt,Zt],e([Se({type:String,reflect:!0})],Ct.prototype,"name",void 0),e([Se({type:String,reflect:!0})],Ct.prototype,"value",void 0),e([Se({type:String,reflect:!0})],Ct.prototype,"type",void 0),e([Se({type:String,reflect:!0})],Ct.prototype,"form",void 0),e([Se({type:String,reflect:!0,attribute:"formaction"})],Ct.prototype,"formAction",void 0),e([Se({type:String,reflect:!0,attribute:"formmethod"})],Ct.prototype,"formMethod",void 0),e([Se({attribute:"formnovalidate",type:Boolean,reflect:!0})],Ct.prototype,"formNoValidate",void 0),e([Se({type:String,reflect:!0,attribute:"formtarget"})],Ct.prototype,"formTarget",void 0),e([Se({type:Boolean,reflect:!0})],Ct.prototype,"fullWidth",void 0),e([Se({type:Boolean})],Ct.prototype,"hasLeftIconSlot",void 0),e([Se({type:Boolean})],Ct.prototype,"hasRightIconSlot",void 0);var _t=o`:host{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm);display:inline-flex}:host([size=sm]) .btn-close{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}:host([tone=fixed-light]) .btn-close{color:var(--sgds-color-fixed-light)}:host([tone=fixed-dark]) .btn-close{color:var(--sgds-color-fixed-dark)}.btn-close{align-items:center;background-color:var(--sgds-bg-transparent);border:0;border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-close-btn-border-radius);cursor:pointer;display:flex;height:var(--sgds-dimension-32);justify-content:center;padding:0;position:relative;width:var(--sgds-dimension-32)}.btn-close:focus,.btn-close:focus-visible,.btn-close:hover{background-color:var(--sgds-bg-translucent)}:host([tone=fixed-light]) .btn-close:focus,:host([tone=fixed-light]) .btn-close:focus-visible,:host([tone=fixed-light]) .btn-close:hover{background-color:var(--sgds-bg-translucent-fixed-light)}:host([tone=fixed-dark]) .btn-close:focus,:host([tone=fixed-dark]) .btn-close:focus-visible,:host([tone=fixed-dark]) .btn-close:hover{background-color:var(--sgds-bg-translucent-fixed-dark)}.btn-close:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}:host([disabled]) .btn-close{cursor:not-allowed;opacity:var(--sgds-opacity-40);pointer-events:none}`;function yt(e){return!!function(e){return!!customElements.get(e)}(e)||(console.error(`Custom element of name : ${e} is not registered. Remember to import the component file for custom element registration`),!1)}class Mt extends gt{constructor(){super(...arguments),this.size="md",this.tone="default",this.disabled=!1,this._clickHandler=()=>{}}_handleClick(e){if(this.disabled)return e.preventDefault(),void e.stopPropagation();this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}firstUpdated(e){super.firstUpdated(e),yt("sgds-icon")}render(){return ee`
|
|
105
105
|
<button class="btn-close" aria-label="Close button" ?disabled=${this.disabled} @click=${this._handleClick}>
|
|
106
106
|
<sgds-icon name="cross" size="sm"></sgds-icon>
|
|
107
107
|
</button>
|
|
108
|
-
`}}Mt.styles=[...gt.styles,_t],e([Se({type:String,reflect:!0})],Mt.prototype,"size",void 0),e([Se({type:String,reflect:!0})],Mt.prototype,"tone",void 0),e([Se({type:Boolean,reflect:!0})],Mt.prototype,"disabled",void 0);var Vt=o`.file-upload-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.file-upload-list{display:flex;flex-direction:column;gap:var(--sgds-form-gap-xl);list-style-type:none;margin-top:0}.file-upload-list.has-files{margin-top:var(--sgds-margin-xl)}.filesize{color:var(--sgds-form-color-subtle)}@keyframes fileUploadEnter{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes fileUploadExit{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-8px)}}.file-upload-list-item-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md);max-height:500px;overflow:hidden;transition:max-height var(--sgds-motion-duration-standard) var(--sgds-motion-easing-standard),opacity var(--sgds-motion-duration-standard) var(--sgds-motion-easing-standard)}.file-upload-list-item-container.file-upload-exit{max-height:0;opacity:0}.file-upload-list-item{align-items:center;animation:fileUploadEnter var(--sgds-motion-duration-standard) var(--sgds-motion-easing-enter);background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-muted);border-radius:var(--sgds-form-border-radius-md);display:flex;gap:var(--sgds-form-gap-lg);padding:var(--sgds-form-padding-y) calc(var(--sgds-form-padding-x) + var(--sgds-padding-2-xl)) var(--sgds-form-padding-y) var(--sgds-form-padding-x);position:relative;transition:transform var(--sgds-motion-duration-standard) var(--sgds-motion-easing-standard)}.file-upload-list-item.file-upload-error{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.file-upload-list-item.file-upload-exit{animation:fileUploadExit var(--sgds-motion-duration-standard) var(--sgds-motion-easing-exit)}.file-upload-list-item span:not(:first-of-type){cursor:pointer}.file-upload-item-error{align-items:flex-start;display:flex;gap:var(--sgds-form-gap-lg)}.file-upload-item-error sgds-icon{color:var(--sgds-color-muted);flex-shrink:0;margin-top:2px}.file-upload-item-error-message{color:var(--sgds-form-danger-color-default);font-size:var(--sgds-font-size-12);line-height:var(--sgds-line-height-16)}ul{margin:0;padding:0}input{display:none}sgds-button{cursor:pointer;width:fit-content}sgds-close-button{position:absolute;right:8px;top:8px}sgds-icon.valid{color:var(--sgds-form-success-color-default)}sgds-icon.invalid{color:var(--sgds-color-muted)}.drag-drop-zone{align-items:center;background-color:var(--sgds-surface-raised);border:var(--sgds-border-width-1) dashed var(--sgds-border-color-default);border-radius:var(--sgds-border-radius-md);display:flex;flex-direction:column;gap:var(--sgds-gap-md);justify-content:center;padding:var(--sgds-padding-2-xl)}.drag-drop-text{font-size:var(--sgds-font-size-14);line-height:var(--sgds-line-height-20)}.drag-drop-zone:focus,.drag-drop-zone:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}:host([disabled]) .file-upload-container>:not(sgds-button):not(.invalid-feedback-container){opacity:var(--sgds-opacity-50)}:host([disabled]){cursor:not-allowed;pointer-events:none}:host([disabled]) .drag-drop-zone:focus,:host([disabled]) .drag-drop-zone:focus-visible{outline:none}:host([invalid]:not([disabled])) .drag-drop-zone{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}:host([invalid]:not([disabled])) .drag-drop-zone:focus,:host([invalid]:not([disabled])) .drag-drop-zone:focus-visible{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}:host(:not([disabled]):not([invalid])) .drag-drop-zone:hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}`,Ht=o`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,$t=o`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`,St=o`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-40)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,Bt=o`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`;function kt(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class At extends gt{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=kt("input"),this._labelId=kt("label")}setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}}At.styles=[...gt.styles,Ht,$t,St,Bt],e([Se({reflect:!0})],At.prototype,"label",void 0),e([Se({reflect:!0})],At.prototype,"hintText",void 0),e([Se({reflect:!0})],At.prototype,"name",void 0),e([Se({type:Boolean,reflect:!0})],At.prototype,"disabled",void 0),e([Se({type:Boolean,reflect:!0})],At.prototype,"invalid",void 0);class Lt{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,l){return this._internals.setValidity(e,t,l)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const l in t)t[l]&&(this.validationError=l.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Et=t=>{class l extends t{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Lt(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&(this._isTouched=!1),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,l){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,l)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return l.formAssociated=!0,e([Le("sgds-input")],l.prototype,"sgdsInput",void 0),e([Le("sgds-datepicker-input")],l.prototype,"sgdsDatepickerInput",void 0),l};function Pt(e,t){const l=Object.assign({waitUntilFirstUpdate:!1},t);return(t,i)=>{const{update:a}=t;if(e in t){const s=e;t.update=function(e){if(e.has(s)){const t=e.get(s),a=this[s];t!==a&&(l.waitUntilFirstUpdate&&!this.hasUpdated||this[i](t,a))}a.call(this,e)}}}}var zt=ee`
|
|
108
|
+
`}}Mt.styles=[...gt.styles,_t],e([Se({type:String,reflect:!0})],Mt.prototype,"size",void 0),e([Se({type:String,reflect:!0})],Mt.prototype,"tone",void 0),e([Se({type:Boolean,reflect:!0})],Mt.prototype,"disabled",void 0);var Vt=o`.file-upload-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.file-upload-list{display:flex;flex-direction:column;gap:var(--sgds-form-gap-xl);list-style-type:none;margin-top:0}.file-upload-list.has-files{margin-top:var(--sgds-margin-xl)}.filesize{color:var(--sgds-form-color-subtle)}@keyframes fileUploadEnter{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes fileUploadExit{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-8px)}}.file-upload-list-item-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md);max-height:500px;overflow:hidden;transition:max-height var(--sgds-motion-duration-standard) var(--sgds-motion-easing-standard),opacity var(--sgds-motion-duration-standard) var(--sgds-motion-easing-standard)}.file-upload-list-item-container.file-upload-exit{max-height:0;opacity:0}.file-upload-list-item{align-items:center;animation:fileUploadEnter var(--sgds-motion-duration-standard) var(--sgds-motion-easing-enter);background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-muted);border-radius:var(--sgds-form-border-radius-md);display:flex;gap:var(--sgds-form-gap-lg);padding:var(--sgds-form-padding-y) calc(var(--sgds-form-padding-x) + var(--sgds-padding-2-xl)) var(--sgds-form-padding-y) var(--sgds-form-padding-x);position:relative;transition:transform var(--sgds-motion-duration-standard) var(--sgds-motion-easing-standard)}.file-upload-list-item.file-upload-error{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.file-upload-list-item.file-upload-exit{animation:fileUploadExit var(--sgds-motion-duration-standard) var(--sgds-motion-easing-exit)}.file-upload-list-item span:not(:first-of-type){cursor:pointer}.file-upload-item-error{align-items:flex-start;display:flex;gap:var(--sgds-form-gap-lg)}.file-upload-item-error sgds-icon{color:var(--sgds-color-muted);flex-shrink:0;margin-top:2px}.file-upload-item-error-message{color:var(--sgds-form-danger-color-default);font-size:var(--sgds-font-size-12);line-height:var(--sgds-line-height-16)}ul{margin:0;padding:0}input{display:none}sgds-button{cursor:pointer;width:fit-content}sgds-close-button{position:absolute;right:8px;top:8px}sgds-icon.valid{color:var(--sgds-form-success-color-default)}sgds-icon.invalid{color:var(--sgds-color-muted)}.drag-drop-zone{align-items:center;background-color:var(--sgds-surface-raised);border:var(--sgds-border-width-1) dashed var(--sgds-border-color-default);border-radius:var(--sgds-border-radius-md);display:flex;flex-direction:column;gap:var(--sgds-gap-md);justify-content:center;padding:var(--sgds-padding-2-xl)}.drag-drop-text{font-size:var(--sgds-font-size-14);line-height:var(--sgds-line-height-20)}.drag-drop-zone:focus,.drag-drop-zone:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}:host([disabled]) .file-upload-container>:not(sgds-button):not(.invalid-feedback-container){opacity:var(--sgds-opacity-50)}:host([disabled]){cursor:not-allowed;pointer-events:none}:host([disabled]) .drag-drop-zone:focus,:host([disabled]) .drag-drop-zone:focus-visible{outline:none}:host([invalid]:not([disabled])) .drag-drop-zone{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}:host([invalid]:not([disabled])) .drag-drop-zone:focus,:host([invalid]:not([disabled])) .drag-drop-zone:focus-visible{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}:host(:not([disabled]):not([invalid])) .drag-drop-zone:hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}`,Ht=o`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,$t=o`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`,St=o`.form-label{color:var(--sgds-form-color-default);font-weight:var(--sgds-font-weight-semibold);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-40)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,Bt=o`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`;function kt(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class At extends gt{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=kt("input"),this._labelId=kt("label")}setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}}At.styles=[...gt.styles,Ht,$t,St,Bt],e([Se({reflect:!0})],At.prototype,"label",void 0),e([Se({reflect:!0})],At.prototype,"hintText",void 0),e([Se({reflect:!0})],At.prototype,"name",void 0),e([Se({type:Boolean,reflect:!0})],At.prototype,"disabled",void 0),e([Se({type:Boolean,reflect:!0})],At.prototype,"invalid",void 0);class Lt{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,l){return this._internals.setValidity(e,t,l)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const l in t)t[l]&&(this.validationError=l.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Et=t=>{class l extends t{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Lt(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&(this._isTouched=!1),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,l){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,l)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return l.formAssociated=!0,e([Le("sgds-input")],l.prototype,"sgdsInput",void 0),e([Le("sgds-datepicker-input")],l.prototype,"sgdsDatepickerInput",void 0),l};function Pt(e,t){const l=Object.assign({waitUntilFirstUpdate:!1},t);return(t,i)=>{const{update:a}=t;if(e in t){const s=e;t.update=function(e){if(e.has(s)){const t=e.get(s),a=this[s];t!==a&&(l.waitUntilFirstUpdate&&!this.hasUpdated||this[i](t,a))}a.call(this,e)}}}}var zt=ee`
|
|
109
109
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
|
110
110
|
<path
|
|
111
111
|
fill="currentColor"
|