@govtechsg/sgds-web-component 3.21.2-rc.0 → 3.21.2-rc.1

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.
Files changed (32) hide show
  1. package/components/Button/index.umd.min.js +5 -3
  2. package/components/Button/index.umd.min.js.map +1 -1
  3. package/components/Button/sgds-button.d.ts +4 -0
  4. package/components/Button/sgds-button.js +8 -0
  5. package/components/Button/sgds-button.js.map +1 -1
  6. package/components/Datepicker/index.umd.min.js +14 -12
  7. package/components/Datepicker/index.umd.min.js.map +1 -1
  8. package/components/FileUpload/index.umd.min.js +4 -2
  9. package/components/FileUpload/index.umd.min.js.map +1 -1
  10. package/components/Pagination/index.umd.min.js +4 -2
  11. package/components/Pagination/index.umd.min.js.map +1 -1
  12. package/components/index.umd.min.js +4 -2
  13. package/components/index.umd.min.js.map +1 -1
  14. package/css/fouc.css +1 -1
  15. package/custom-elements.json +643 -607
  16. package/index.umd.min.js +4 -2
  17. package/index.umd.min.js.map +1 -1
  18. package/package.json +1 -1
  19. package/react/components/Button/sgds-button.cjs.js +8 -0
  20. package/react/components/Button/sgds-button.cjs.js.map +1 -1
  21. package/react/components/Button/sgds-button.js +8 -0
  22. package/react/components/Button/sgds-button.js.map +1 -1
  23. package/react/index.cjs.js +6 -6
  24. package/react/index.d.ts +1 -1
  25. package/react/index.js +1 -1
  26. package/react/utils/formSubmitController.cjs.js +5 -0
  27. package/react/utils/formSubmitController.cjs.js.map +1 -1
  28. package/react/utils/formSubmitController.js +5 -0
  29. package/react/utils/formSubmitController.js.map +1 -1
  30. package/types/react.d.ts +20 -16
  31. package/utils/formSubmitController.js +5 -0
  32. package/utils/formSubmitController.js.map +1 -1
@@ -26,7 +26,7 @@ let C;(m.reactiveElementVersions??=[]).push("2.1.2"),m.reactiveElementVersions.l
26
26
  * Copyright 2017 Google LLC
27
27
  * SPDX-License-Identifier: BSD-3-Clause
28
28
  */
29
- const z=globalThis,V=t=>{z.emitLitDebugLogEvents&&z.dispatchEvent(new CustomEvent("lit-debug",{detail:t}))};let O,M=0;z.litIssuedWarnings??=new Set,O=(t,e)=>{e+=t?` See https://lit.dev/msg/${t} for more information.`:"",z.litIssuedWarnings.has(e)||z.litIssuedWarnings.has(t)||(console.warn(e),z.litIssuedWarnings.add(e))},queueMicrotask(()=>{O("dev-mode","Lit is in dev mode. Not recommended for production!")});const U=z.ShadyDOM?.inUse&&!0===z.ShadyDOM?.noPatch?z.ShadyDOM.wrap:t=>t,I=z.trustedTypes,L=I?I.createPolicy("lit-html",{createHTML:t=>t}):void 0,A=t=>t,R=(t,e,s)=>A,W=t=>{if(ct!==R)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");ct=t},D=()=>{ct=R},j=(t,e,s)=>ct(t,e,s),H="$lit$",B=`lit$${Math.random().toFixed(9).slice(2)}$`,q="?"+B,F=`<${q}>`,Z=document,J=()=>Z.createComment(""),K=t=>null===t||"object"!=typeof t&&"function"!=typeof t,X=Array.isArray,Y="[ \t\n\f\r]",G=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Q=/-->/g,tt=/>/g,et=new RegExp(`>|${Y}(?:([^\\s"'>=/]+)(${Y}*=${Y}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),st=/'/g,it=/"/g,rt=/^(?:script|style|textarea|title)$/i,nt=(ot=1,(t,...e)=>(t.some(t=>void 0===t)&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),e.some(t=>t?._$litStatic$)&&O("","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$:ot,strings:t,values:e}));var ot;const at=Symbol.for("lit-noChange"),lt=Symbol.for("lit-nothing"),dt=new WeakMap,ht=Z.createTreeWalker(Z,129);let ct=R;function pt(t,e){if(!X(t)||!t.hasOwnProperty("raw")){let t="invalid template strings array";throw t="\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(t)}return void 0!==L?L.createHTML(e):e}class ut{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0;const o=t.length-1,a=this.parts,[l,d]=((t,e)=>{const s=t.length-1,i=[];let r,n=2===e?"<svg>":3===e?"<math>":"",o=G;for(let e=0;e<s;e++){const s=t[e];let a,l,d=-1,h=0;for(;h<s.length&&(o.lastIndex=h,l=o.exec(s),null!==l);)if(h=o.lastIndex,o===G){if("!--"===l[1])o=Q;else if(void 0!==l[1])o=tt;else if(void 0!==l[2])rt.test(l[2])&&(r=new RegExp(`</${l[2]}`,"g")),o=et;else if(void 0!==l[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===et?">"===l[0]?(o=r??G,d=-1):void 0===l[1]?d=-2:(d=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?et:'"'===l[3]?it:st):o===it||o===st?o=et:o===Q||o===tt?o=G:(o=et,r=void 0);console.assert(-1===d||o===et||o===st||o===it,"unexpected parse state B");const c=o===et&&t[e+1].startsWith("/>")?" ":"";n+=o===G?s+F:d>=0?(i.push(a),s.slice(0,d)+H+s.slice(d)+B+c):s+B+(-2===d?e:c)}return[pt(t,n+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]})(t,e);if(this.el=ut.createElement(l,s),ht.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=ht.nextNode())&&a.length<o;){if(1===i.nodeType){{const t=i.localName;if(/^(?:textarea|template)$/i.test(t)&&i.innerHTML.includes(B)){const e=`Expressions are not supported inside \`${t}\` elements. See https://lit.dev/msg/expression-in-${t} for more information.`;if("template"===t)throw new Error(e);O("",e)}}if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(H)){const e=d[n++],s=i.getAttribute(t).split(B),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:o[2],strings:s,ctor:"."===o[1]?bt:"?"===o[1]?yt:"@"===o[1]?_t:vt}),i.removeAttribute(t)}else t.startsWith(B)&&(a.push({type:6,index:r}),i.removeAttribute(t));if(rt.test(i.tagName)){const t=i.textContent.split(B),e=t.length-1;if(e>0){i.textContent=I?I.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],J()),ht.nextNode(),a.push({type:2,index:++r});i.append(t[e],J())}}}else if(8===i.nodeType){if(i.data===q)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=i.data.indexOf(B,t+1));)a.push({type:7,index:r}),t+=B.length-1}}r++}if(d.length!==n)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`'+t.join("${...}")+"`");V&&V({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:t})}static createElement(t,e){const s=Z.createElement("template");return s.innerHTML=t,s}}function gt(t,e,s=t,i){if(e===at)return e;let r=void 0!==i?s.__directives?.[i]:s.__directive;const n=K(e)?void 0:e._$litDirective$;return r?.constructor!==n&&(r?._$notifyDirectiveConnectionChanged?.(!1),void 0===n?r=void 0:(r=new n(t),r._$initialize(t,s,i)),void 0!==i?(s.__directives??=[])[i]=r:s.__directive=r),void 0!==r&&(e=gt(t,r._$resolve(t,e.values),r,i)),e}class mt{constructor(t,e){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=t,this._$parent=e}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(t){const{el:{content:e},parts:s}=this._$template,i=(t?.creationScope??Z).importNode(e,!0);ht.currentNode=i;let r=ht.nextNode(),n=0,o=0,a=s[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new ft(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new wt(r,this,t)),this._$parts.push(e),a=s[++o]}n!==a?.index&&(r=ht.nextNode(),n++)}return ht.currentNode=Z,i}_update(t){let e=0;for(const s of this._$parts)void 0!==s&&(V&&V({kind:"set part",part:s,value:t[e],valueIndex:e,values:t,templateInstance:this}),void 0!==s.strings?(s._$setValue(t,s,e),e+=s.strings.length-2):s._$setValue(t[e])),e++}}class ft{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(t,e,s,i){this.type=2,this._$committedValue=lt,this._$disconnectableChildren=void 0,this._$startNode=t,this._$endNode=e,this._$parent=s,this.options=i,this.__isConnected=i?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let t=U(this._$startNode).parentNode;const e=this._$parent;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(t,e=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(t=gt(this,t,e),K(t))t===lt||null==t||""===t?(this._$committedValue!==lt&&(V&&V({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=lt):t!==this._$committedValue&&t!==at&&this._commitText(t);else if(void 0!==t._$litType$)this._commitTemplateResult(t);else if(void 0!==t.nodeType){if(this.options?.host===t)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",t,"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(t)}else(t=>X(t)||"function"==typeof t?.[Symbol.iterator])(t)?this._commitIterable(t):this._commitText(t)}_insert(t){return U(U(this._$startNode).parentNode).insertBefore(t,this._$endNode)}_commitNode(t){if(this._$committedValue!==t){if(this._$clear(),ct!==R){const t=this._$startNode.parentNode?.nodeName;if("STYLE"===t||"SCRIPT"===t){let e="Forbidden";throw e="STYLE"===t?"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(e)}}V&&V({kind:"commit node",start:this._$startNode,parent:this._$parent,value:t,options:this.options}),this._$committedValue=this._insert(t)}}_commitText(t){if(this._$committedValue!==lt&&K(this._$committedValue)){const e=U(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=j(e,"data","property")),t=this._textSanitizer(t),V&&V({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}else{const e=Z.createTextNode("");this._commitNode(e),void 0===this._textSanitizer&&(this._textSanitizer=j(e,"data","property")),t=this._textSanitizer(t),V&&V({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}this._$committedValue=t}_commitTemplateResult(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$getTemplate(t):(void 0===s.el&&(s.el=ut.createElement(pt(s.h,s.h[0]),this.options)),s);if(this._$committedValue?._$template===i)V&&V({kind:"template updating",template:i,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:e}),this._$committedValue._update(e);else{const t=new mt(i,this),s=t._clone(this.options);V&&V({kind:"template instantiated",template:i,instance:t,parts:t._$parts,options:this.options,fragment:s,values:e}),t._update(e),V&&V({kind:"template instantiated and updated",template:i,instance:t,parts:t._$parts,options:this.options,fragment:s,values:e}),this._commitNode(s),this._$committedValue=t}}_$getTemplate(t){let e=dt.get(t.strings);return void 0===e&&dt.set(t.strings,e=new ut(t)),e}_commitIterable(t){X(this._$committedValue)||(this._$committedValue=[],this._$clear());const e=this._$committedValue;let s,i=0;for(const r of t)i===e.length?e.push(s=new ft(this._insert(J()),this._insert(J()),this,this.options)):s=e[i],s._$setValue(r),i++;i<e.length&&(this._$clear(s&&U(s._$endNode).nextSibling,i),e.length=i)}_$clear(t=U(this._$startNode).nextSibling,e){for(this._$notifyConnectionChanged?.(!1,!0,e);t!==this._$endNode;){const e=U(t).nextSibling;U(t).remove(),t=e}}setConnected(t){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=t,this._$notifyConnectionChanged?.(t)}}class vt{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(t,e,s,i,r){this.type=1,this._$committedValue=lt,this._$disconnectableChildren=void 0,this.element=t,this.name=e,this._$parent=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$committedValue=new Array(s.length-1).fill(new String),this.strings=s):this._$committedValue=lt,this._sanitizer=void 0}_$setValue(t,e=this,s,i){const r=this.strings;let n=!1;if(void 0===r)t=gt(this,t,e,0),n=!K(t)||t!==this._$committedValue&&t!==at,n&&(this._$committedValue=t);else{const i=t;let o,a;for(t=r[0],o=0;o<r.length-1;o++)a=gt(this,i[s+o],e,o),a===at&&(a=this._$committedValue[o]),n||=!K(a)||a!==this._$committedValue[o],a===lt?t=lt:t!==lt&&(t+=(a??"")+r[o+1]),this._$committedValue[o]=a}n&&!i&&this._commitValue(t)}_commitValue(t){t===lt?U(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=ct(this.element,this.name,"attribute")),t=this._sanitizer(t??""),V&&V({kind:"commit attribute",element:this.element,name:this.name,value:t,options:this.options}),U(this.element).setAttribute(this.name,t??""))}}class bt extends vt{constructor(){super(...arguments),this.type=3}_commitValue(t){void 0===this._sanitizer&&(this._sanitizer=ct(this.element,this.name,"property")),t=this._sanitizer(t),V&&V({kind:"commit property",element:this.element,name:this.name,value:t,options:this.options}),this.element[this.name]=t===lt?void 0:t}}class yt extends vt{constructor(){super(...arguments),this.type=4}_commitValue(t){V&&V({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!t||t===lt),options:this.options}),U(this.element).toggleAttribute(this.name,!!t&&t!==lt)}}class _t extends vt{constructor(t,e,s,i,r){if(super(t,e,s,i,r),this.type=5,void 0!==this.strings)throw new Error(`A \`<${t.localName}>\` has a \`@${e}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(t,e=this){if((t=gt(this,t,e,0)??lt)===at)return;const s=this._$committedValue,i=t===lt&&s!==lt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==lt&&(s===lt||i);V&&V({kind:"commit event listener",element:this.element,name:this.name,value:t,options:this.options,removeListener:i,addListener:r,oldListener:s}),i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$committedValue=t}handleEvent(t){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,t):this._$committedValue.handleEvent(t)}}class wt{constructor(t,e,s){this.element=t,this.type=6,this._$disconnectableChildren=void 0,this._$parent=e,this.options=s}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t){V&&V({kind:"commit to element binding",element:this.element,value:t,options:this.options}),gt(this,t)}}const $t=z.litHtmlPolyfillSupportDevMode;$t?.(ut,ft),(z.litHtmlVersions??=[]).push("3.3.2"),z.litHtmlVersions.length>1&&queueMicrotask(()=>{O("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});const St=(t,e,s)=>{if(null==e)throw new TypeError(`The container to render into may not be ${e}`);const i=M++,r=s?.renderBefore??e;let n=r._$litPart$;if(V&&V({kind:"begin render",id:i,value:t,container:e,options:s,part:n}),void 0===n){const t=s?.renderBefore??null;r._$litPart$=n=new ft(e.insertBefore(J(),t),t,void 0,s??{})}return n._$setValue(t),V&&V({kind:"end render",id:i,value:t,container:e,options:s,part:n}),n};St.setSanitizer=W,St.createSanitizer=j,St._testOnlyClearSanitizerFactoryDoNotCallOrElse=D;
29
+ const z=globalThis,V=t=>{z.emitLitDebugLogEvents&&z.dispatchEvent(new CustomEvent("lit-debug",{detail:t}))};let O,M=0;z.litIssuedWarnings??=new Set,O=(t,e)=>{e+=t?` See https://lit.dev/msg/${t} for more information.`:"",z.litIssuedWarnings.has(e)||z.litIssuedWarnings.has(t)||(console.warn(e),z.litIssuedWarnings.add(e))},queueMicrotask(()=>{O("dev-mode","Lit is in dev mode. Not recommended for production!")});const U=z.ShadyDOM?.inUse&&!0===z.ShadyDOM?.noPatch?z.ShadyDOM.wrap:t=>t,I=z.trustedTypes,A=I?I.createPolicy("lit-html",{createHTML:t=>t}):void 0,L=t=>t,R=(t,e,s)=>L,W=t=>{if(ct!==R)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");ct=t},D=()=>{ct=R},j=(t,e,s)=>ct(t,e,s),H="$lit$",B=`lit$${Math.random().toFixed(9).slice(2)}$`,q="?"+B,F=`<${q}>`,Z=document,J=()=>Z.createComment(""),K=t=>null===t||"object"!=typeof t&&"function"!=typeof t,X=Array.isArray,Y="[ \t\n\f\r]",G=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Q=/-->/g,tt=/>/g,et=new RegExp(`>|${Y}(?:([^\\s"'>=/]+)(${Y}*=${Y}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),st=/'/g,it=/"/g,rt=/^(?:script|style|textarea|title)$/i,nt=(ot=1,(t,...e)=>(t.some(t=>void 0===t)&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),e.some(t=>t?._$litStatic$)&&O("","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$:ot,strings:t,values:e}));var ot;const at=Symbol.for("lit-noChange"),lt=Symbol.for("lit-nothing"),dt=new WeakMap,ht=Z.createTreeWalker(Z,129);let ct=R;function pt(t,e){if(!X(t)||!t.hasOwnProperty("raw")){let t="invalid template strings array";throw t="\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(t)}return void 0!==A?A.createHTML(e):e}class ut{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0;const o=t.length-1,a=this.parts,[l,d]=((t,e)=>{const s=t.length-1,i=[];let r,n=2===e?"<svg>":3===e?"<math>":"",o=G;for(let e=0;e<s;e++){const s=t[e];let a,l,d=-1,h=0;for(;h<s.length&&(o.lastIndex=h,l=o.exec(s),null!==l);)if(h=o.lastIndex,o===G){if("!--"===l[1])o=Q;else if(void 0!==l[1])o=tt;else if(void 0!==l[2])rt.test(l[2])&&(r=new RegExp(`</${l[2]}`,"g")),o=et;else if(void 0!==l[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===et?">"===l[0]?(o=r??G,d=-1):void 0===l[1]?d=-2:(d=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?et:'"'===l[3]?it:st):o===it||o===st?o=et:o===Q||o===tt?o=G:(o=et,r=void 0);console.assert(-1===d||o===et||o===st||o===it,"unexpected parse state B");const c=o===et&&t[e+1].startsWith("/>")?" ":"";n+=o===G?s+F:d>=0?(i.push(a),s.slice(0,d)+H+s.slice(d)+B+c):s+B+(-2===d?e:c)}return[pt(t,n+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]})(t,e);if(this.el=ut.createElement(l,s),ht.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=ht.nextNode())&&a.length<o;){if(1===i.nodeType){{const t=i.localName;if(/^(?:textarea|template)$/i.test(t)&&i.innerHTML.includes(B)){const e=`Expressions are not supported inside \`${t}\` elements. See https://lit.dev/msg/expression-in-${t} for more information.`;if("template"===t)throw new Error(e);O("",e)}}if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(H)){const e=d[n++],s=i.getAttribute(t).split(B),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:o[2],strings:s,ctor:"."===o[1]?bt:"?"===o[1]?yt:"@"===o[1]?_t:vt}),i.removeAttribute(t)}else t.startsWith(B)&&(a.push({type:6,index:r}),i.removeAttribute(t));if(rt.test(i.tagName)){const t=i.textContent.split(B),e=t.length-1;if(e>0){i.textContent=I?I.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],J()),ht.nextNode(),a.push({type:2,index:++r});i.append(t[e],J())}}}else if(8===i.nodeType){if(i.data===q)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=i.data.indexOf(B,t+1));)a.push({type:7,index:r}),t+=B.length-1}}r++}if(d.length!==n)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`'+t.join("${...}")+"`");V&&V({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:t})}static createElement(t,e){const s=Z.createElement("template");return s.innerHTML=t,s}}function gt(t,e,s=t,i){if(e===at)return e;let r=void 0!==i?s.__directives?.[i]:s.__directive;const n=K(e)?void 0:e._$litDirective$;return r?.constructor!==n&&(r?._$notifyDirectiveConnectionChanged?.(!1),void 0===n?r=void 0:(r=new n(t),r._$initialize(t,s,i)),void 0!==i?(s.__directives??=[])[i]=r:s.__directive=r),void 0!==r&&(e=gt(t,r._$resolve(t,e.values),r,i)),e}class mt{constructor(t,e){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=t,this._$parent=e}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(t){const{el:{content:e},parts:s}=this._$template,i=(t?.creationScope??Z).importNode(e,!0);ht.currentNode=i;let r=ht.nextNode(),n=0,o=0,a=s[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new ft(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new wt(r,this,t)),this._$parts.push(e),a=s[++o]}n!==a?.index&&(r=ht.nextNode(),n++)}return ht.currentNode=Z,i}_update(t){let e=0;for(const s of this._$parts)void 0!==s&&(V&&V({kind:"set part",part:s,value:t[e],valueIndex:e,values:t,templateInstance:this}),void 0!==s.strings?(s._$setValue(t,s,e),e+=s.strings.length-2):s._$setValue(t[e])),e++}}class ft{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(t,e,s,i){this.type=2,this._$committedValue=lt,this._$disconnectableChildren=void 0,this._$startNode=t,this._$endNode=e,this._$parent=s,this.options=i,this.__isConnected=i?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let t=U(this._$startNode).parentNode;const e=this._$parent;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(t,e=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(t=gt(this,t,e),K(t))t===lt||null==t||""===t?(this._$committedValue!==lt&&(V&&V({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=lt):t!==this._$committedValue&&t!==at&&this._commitText(t);else if(void 0!==t._$litType$)this._commitTemplateResult(t);else if(void 0!==t.nodeType){if(this.options?.host===t)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",t,"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(t)}else(t=>X(t)||"function"==typeof t?.[Symbol.iterator])(t)?this._commitIterable(t):this._commitText(t)}_insert(t){return U(U(this._$startNode).parentNode).insertBefore(t,this._$endNode)}_commitNode(t){if(this._$committedValue!==t){if(this._$clear(),ct!==R){const t=this._$startNode.parentNode?.nodeName;if("STYLE"===t||"SCRIPT"===t){let e="Forbidden";throw e="STYLE"===t?"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(e)}}V&&V({kind:"commit node",start:this._$startNode,parent:this._$parent,value:t,options:this.options}),this._$committedValue=this._insert(t)}}_commitText(t){if(this._$committedValue!==lt&&K(this._$committedValue)){const e=U(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=j(e,"data","property")),t=this._textSanitizer(t),V&&V({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}else{const e=Z.createTextNode("");this._commitNode(e),void 0===this._textSanitizer&&(this._textSanitizer=j(e,"data","property")),t=this._textSanitizer(t),V&&V({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}this._$committedValue=t}_commitTemplateResult(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$getTemplate(t):(void 0===s.el&&(s.el=ut.createElement(pt(s.h,s.h[0]),this.options)),s);if(this._$committedValue?._$template===i)V&&V({kind:"template updating",template:i,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:e}),this._$committedValue._update(e);else{const t=new mt(i,this),s=t._clone(this.options);V&&V({kind:"template instantiated",template:i,instance:t,parts:t._$parts,options:this.options,fragment:s,values:e}),t._update(e),V&&V({kind:"template instantiated and updated",template:i,instance:t,parts:t._$parts,options:this.options,fragment:s,values:e}),this._commitNode(s),this._$committedValue=t}}_$getTemplate(t){let e=dt.get(t.strings);return void 0===e&&dt.set(t.strings,e=new ut(t)),e}_commitIterable(t){X(this._$committedValue)||(this._$committedValue=[],this._$clear());const e=this._$committedValue;let s,i=0;for(const r of t)i===e.length?e.push(s=new ft(this._insert(J()),this._insert(J()),this,this.options)):s=e[i],s._$setValue(r),i++;i<e.length&&(this._$clear(s&&U(s._$endNode).nextSibling,i),e.length=i)}_$clear(t=U(this._$startNode).nextSibling,e){for(this._$notifyConnectionChanged?.(!1,!0,e);t!==this._$endNode;){const e=U(t).nextSibling;U(t).remove(),t=e}}setConnected(t){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=t,this._$notifyConnectionChanged?.(t)}}class vt{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(t,e,s,i,r){this.type=1,this._$committedValue=lt,this._$disconnectableChildren=void 0,this.element=t,this.name=e,this._$parent=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$committedValue=new Array(s.length-1).fill(new String),this.strings=s):this._$committedValue=lt,this._sanitizer=void 0}_$setValue(t,e=this,s,i){const r=this.strings;let n=!1;if(void 0===r)t=gt(this,t,e,0),n=!K(t)||t!==this._$committedValue&&t!==at,n&&(this._$committedValue=t);else{const i=t;let o,a;for(t=r[0],o=0;o<r.length-1;o++)a=gt(this,i[s+o],e,o),a===at&&(a=this._$committedValue[o]),n||=!K(a)||a!==this._$committedValue[o],a===lt?t=lt:t!==lt&&(t+=(a??"")+r[o+1]),this._$committedValue[o]=a}n&&!i&&this._commitValue(t)}_commitValue(t){t===lt?U(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=ct(this.element,this.name,"attribute")),t=this._sanitizer(t??""),V&&V({kind:"commit attribute",element:this.element,name:this.name,value:t,options:this.options}),U(this.element).setAttribute(this.name,t??""))}}class bt extends vt{constructor(){super(...arguments),this.type=3}_commitValue(t){void 0===this._sanitizer&&(this._sanitizer=ct(this.element,this.name,"property")),t=this._sanitizer(t),V&&V({kind:"commit property",element:this.element,name:this.name,value:t,options:this.options}),this.element[this.name]=t===lt?void 0:t}}class yt extends vt{constructor(){super(...arguments),this.type=4}_commitValue(t){V&&V({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!t||t===lt),options:this.options}),U(this.element).toggleAttribute(this.name,!!t&&t!==lt)}}class _t extends vt{constructor(t,e,s,i,r){if(super(t,e,s,i,r),this.type=5,void 0!==this.strings)throw new Error(`A \`<${t.localName}>\` has a \`@${e}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(t,e=this){if((t=gt(this,t,e,0)??lt)===at)return;const s=this._$committedValue,i=t===lt&&s!==lt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==lt&&(s===lt||i);V&&V({kind:"commit event listener",element:this.element,name:this.name,value:t,options:this.options,removeListener:i,addListener:r,oldListener:s}),i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$committedValue=t}handleEvent(t){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,t):this._$committedValue.handleEvent(t)}}class wt{constructor(t,e,s){this.element=t,this.type=6,this._$disconnectableChildren=void 0,this._$parent=e,this.options=s}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t){V&&V({kind:"commit to element binding",element:this.element,value:t,options:this.options}),gt(this,t)}}const $t=z.litHtmlPolyfillSupportDevMode;$t?.(ut,ft),(z.litHtmlVersions??=[]).push("3.3.2"),z.litHtmlVersions.length>1&&queueMicrotask(()=>{O("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});const St=(t,e,s)=>{if(null==e)throw new TypeError(`The container to render into may not be ${e}`);const i=M++,r=s?.renderBefore??e;let n=r._$litPart$;if(V&&V({kind:"begin render",id:i,value:t,container:e,options:s,part:n}),void 0===n){const t=s?.renderBefore??null;r._$litPart$=n=new ft(e.insertBefore(J(),t),t,void 0,s??{})}return n._$setValue(t),V&&V({kind:"end render",id:i,value:t,container:e,options:s,part:n}),n};St.setSanitizer=W,St.createSanitizer=j,St._testOnlyClearSanitizerFactoryDoNotCallOrElse=D;
30
30
  /**
31
31
  * @license
32
32
  * Copyright 2017 Google LLC
@@ -53,11 +53,13 @@ const xt=1;class Ct{constructor(t){}get _$isConnected(){return this._$parent._$i
53
53
  * Copyright 2017 Google LLC
54
54
  * SPDX-License-Identifier: BSD-3-Clause
55
55
  */
56
- const Ut=globalThis;let It;Ut.litIssuedWarnings??=new Set,It=(t,e)=>{e+=` See https://lit.dev/msg/${t} for more information.`,Ut.litIssuedWarnings.has(e)||Ut.litIssuedWarnings.has(t)||(console.warn(e),Ut.litIssuedWarnings.add(e))};class Lt extends x{constructor(){super(...arguments),this.renderOptions={host:this},this.__childPart=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.__childPart=St(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.__childPart?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.__childPart?.setConnected(!1)}render(){return at}}var At;Lt._$litElement$=!0,Lt[(At="finalized",At)]=!0,Ut.litElementHydrateSupport?.({LitElement:Lt});const Rt=Ut.litElementPolyfillSupportDevMode;Rt?.({LitElement:Lt}),(Ut.litElementVersions??=[]).push("4.2.2"),Ut.litElementVersions.length>1&&queueMicrotask(()=>{It("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});var Wt=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 Dt extends Lt{emit(t,e){const s=new CustomEvent(t,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(s),s}static define(t,e=this,s={}){if(customElements.get(t));else try{customElements.define(t,e,s)}catch(i){customElements.define(t,class extends e{},s)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([t,e])=>{this.constructor.define(t,e)})}firstUpdated(t){var e;super.firstUpdated(t),this.ssr&&(null===(e=this.shadowRoot)||void 0===e||e.querySelectorAll("slot").forEach(t=>{t.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}Dt.styles=[Wt],Dt.dependencies={},t([E({type:Boolean,reflect:!0})],Dt.prototype,"ssr",void 0);var jt,Ht,Bt=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 qt extends Dt{constructor(){super(...arguments),this.variant="primary",this.tone="brand",this.size="md",this.active=!1,this.disabled=!1,this.target="_self"}focus(t){this.button.focus(t)}click(){this.button.click()}blur(){this.button.blur()}_handleBlur(){this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleClick(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation()}_handleKeydown(t){if("Enter"===t.key&&this.loading)return t.preventDefault(),void t.stopPropagation()}_assignSpinnerSize(t){return"xs"===t||"sm"===t?"xs":"md"===t||"lg"===t?"sm":void 0}_assignSpinnerTone(t,e){return"fixed-light"===t&&"primary"===e?"fixed-dark":"neutral"===t&&"primary"===e?"inverse":"fixed-light"===t||"primary"===e?"fixed-light":"neutral"!==t||"outline"!==e&&"ghost"!==e?"brand":"neutral"}}qt.styles=[...Dt.styles,Bt],t([(jt=".btn",(t,e,s)=>{const i=t=>{const s=t.renderRoot?.querySelector(jt)??null;if(null===s&&Ht&&!t.hasUpdated){const t="object"==typeof e?e.name:e;N("",`@query'd field ${JSON.stringify(String(t))} with the 'cache' flag set for selector '${jt}' 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 s};if(Ht){const{get:r,set:n}="object"==typeof e?t:s??(()=>{const t=Symbol(`${String(e)} (@query() cache)`);return{get(){return this[t]},set(e){this[t]=e}}})();return T(t,e,{get(){let t=r.call(this);return void 0===t&&(t=i(this),(null!==t||this.hasUpdated)&&n.call(this,t)),t}})}return T(t,e,{get(){return i(this)}})})],qt.prototype,"button",void 0),t([E({reflect:!0})],qt.prototype,"variant",void 0),t([E({reflect:!0})],qt.prototype,"tone",void 0),t([E({reflect:!0})],qt.prototype,"size",void 0),t([E({type:Boolean,reflect:!0})],qt.prototype,"active",void 0),t([E({type:Boolean,reflect:!0})],qt.prototype,"disabled",void 0),t([E({type:String,reflect:!0})],qt.prototype,"href",void 0),t([E({type:String,reflect:!0})],qt.prototype,"target",void 0),t([E({type:String,reflect:!0})],qt.prototype,"download",void 0),t([E({type:String})],qt.prototype,"ariaLabel",void 0),t([E({type:Boolean})],qt.prototype,"loading",void 0);class Ft{constructor(t,...e){this.slotNames=[],(this.host=t).addController(this),this.slotNames=e,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some(t=>{var e;if(t.nodeType===t.TEXT_NODE&&""!==(null===(e=t.textContent)||void 0===e?void 0:e.trim()))return!0;if(t.nodeType===t.ELEMENT_NODE){const e=t;if("sl-visually-hidden"===e.tagName.toLowerCase())return!1;if(!e.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(t){return null!==this.host.querySelector(`:scope > [slot="${t}"]`)}test(t){return"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){var t;null===(t=this.host.shadowRoot)||void 0===t||t.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){var t;null===(t=this.host.shadowRoot)||void 0===t||t.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(t){const e=t.target;(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name))&&this.host.requestUpdate()}}class Zt{constructor(t,e){(this.host=t).addController(this),this.options=Object.assign({form:t=>t.closest("form")},e)}hostConnected(){this.form=this.options.form(this.host)}hostDisconnected(){this.form&&(this.form=void 0)}doAction(t,e){if(this.form){const s=document.createElement("button");s.type=t,s.style.position="absolute",s.style.width="0",s.style.height="0",s.style.clipPath="inset(50%)",s.style.overflow="hidden",s.style.whiteSpace="nowrap",e&&["formaction","formmethod","formnovalidate","formtarget"].forEach(t=>{e.hasAttribute(t)&&s.setAttribute(t,e.getAttribute(t))}),this.form.append(s),s.click(),s.remove()}}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}}var Jt,Kt,Xt=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}`,Yt=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 Gt extends qt{constructor(){super(...arguments),this.formSubmitController=new Zt(this,{form:t=>{if(t.hasAttribute("form")){const e=t.getRootNode(),s=t.getAttribute("form");return e.getElementById(s)}return t.closest("form")}}),this.type="button",this.fullWidth=!1,this.hasLeftIconSlot=!1,this.hasRightIconSlot=!1,this.hasSlotController=new Ft(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(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation();this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}render(){const t=this.href,e=t?zt`a`:zt`button`,s=!this.hasLeftIconSlot&&!this.hasRightIconSlot;return Ot`
56
+ const Ut=globalThis;let It;Ut.litIssuedWarnings??=new Set,It=(t,e)=>{e+=` See https://lit.dev/msg/${t} for more information.`,Ut.litIssuedWarnings.has(e)||Ut.litIssuedWarnings.has(t)||(console.warn(e),Ut.litIssuedWarnings.add(e))};class At extends x{constructor(){super(...arguments),this.renderOptions={host:this},this.__childPart=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.__childPart=St(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.__childPart?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.__childPart?.setConnected(!1)}render(){return at}}var Lt;At._$litElement$=!0,At[(Lt="finalized",Lt)]=!0,Ut.litElementHydrateSupport?.({LitElement:At});const Rt=Ut.litElementPolyfillSupportDevMode;Rt?.({LitElement:At}),(Ut.litElementVersions??=[]).push("4.2.2"),Ut.litElementVersions.length>1&&queueMicrotask(()=>{It("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});var Wt=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 Dt extends At{emit(t,e){const s=new CustomEvent(t,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(s),s}static define(t,e=this,s={}){if(customElements.get(t));else try{customElements.define(t,e,s)}catch(i){customElements.define(t,class extends e{},s)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([t,e])=>{this.constructor.define(t,e)})}firstUpdated(t){var e;super.firstUpdated(t),this.ssr&&(null===(e=this.shadowRoot)||void 0===e||e.querySelectorAll("slot").forEach(t=>{t.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}Dt.styles=[Wt],Dt.dependencies={},t([E({type:Boolean,reflect:!0})],Dt.prototype,"ssr",void 0);var jt,Ht,Bt=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 qt extends Dt{constructor(){super(...arguments),this.variant="primary",this.tone="brand",this.size="md",this.active=!1,this.disabled=!1,this.target="_self"}focus(t){this.button.focus(t)}click(){this.button.click()}blur(){this.button.blur()}_handleBlur(){this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleClick(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation()}_handleKeydown(t){if("Enter"===t.key&&this.loading)return t.preventDefault(),void t.stopPropagation()}_assignSpinnerSize(t){return"xs"===t||"sm"===t?"xs":"md"===t||"lg"===t?"sm":void 0}_assignSpinnerTone(t,e){return"fixed-light"===t&&"primary"===e?"fixed-dark":"neutral"===t&&"primary"===e?"inverse":"fixed-light"===t||"primary"===e?"fixed-light":"neutral"!==t||"outline"!==e&&"ghost"!==e?"brand":"neutral"}}qt.styles=[...Dt.styles,Bt],t([(jt=".btn",(t,e,s)=>{const i=t=>{const s=t.renderRoot?.querySelector(jt)??null;if(null===s&&Ht&&!t.hasUpdated){const t="object"==typeof e?e.name:e;N("",`@query'd field ${JSON.stringify(String(t))} with the 'cache' flag set for selector '${jt}' 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 s};if(Ht){const{get:r,set:n}="object"==typeof e?t:s??(()=>{const t=Symbol(`${String(e)} (@query() cache)`);return{get(){return this[t]},set(e){this[t]=e}}})();return T(t,e,{get(){let t=r.call(this);return void 0===t&&(t=i(this),(null!==t||this.hasUpdated)&&n.call(this,t)),t}})}return T(t,e,{get(){return i(this)}})})],qt.prototype,"button",void 0),t([E({reflect:!0})],qt.prototype,"variant",void 0),t([E({reflect:!0})],qt.prototype,"tone",void 0),t([E({reflect:!0})],qt.prototype,"size",void 0),t([E({type:Boolean,reflect:!0})],qt.prototype,"active",void 0),t([E({type:Boolean,reflect:!0})],qt.prototype,"disabled",void 0),t([E({type:String,reflect:!0})],qt.prototype,"href",void 0),t([E({type:String,reflect:!0})],qt.prototype,"target",void 0),t([E({type:String,reflect:!0})],qt.prototype,"download",void 0),t([E({type:String})],qt.prototype,"ariaLabel",void 0),t([E({type:Boolean})],qt.prototype,"loading",void 0);class Ft{constructor(t,...e){this.slotNames=[],(this.host=t).addController(this),this.slotNames=e,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some(t=>{var e;if(t.nodeType===t.TEXT_NODE&&""!==(null===(e=t.textContent)||void 0===e?void 0:e.trim()))return!0;if(t.nodeType===t.ELEMENT_NODE){const e=t;if("sl-visually-hidden"===e.tagName.toLowerCase())return!1;if(!e.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(t){return null!==this.host.querySelector(`:scope > [slot="${t}"]`)}test(t){return"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){var t;null===(t=this.host.shadowRoot)||void 0===t||t.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){var t;null===(t=this.host.shadowRoot)||void 0===t||t.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(t){const e=t.target;(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name))&&this.host.requestUpdate()}}class Zt{constructor(t,e){(this.host=t).addController(this),this.options=Object.assign({form:t=>t.closest("form")},e)}hostConnected(){this.form=this.options.form(this.host)}hostDisconnected(){this.form&&(this.form=void 0)}doAction(t,e){if(this.form){const s=document.createElement("button");s.type=t,s.style.position="absolute",s.style.width="0",s.style.height="0",s.style.clipPath="inset(50%)",s.style.overflow="hidden",s.style.whiteSpace="nowrap",e&&(["formaction","formmethod","formnovalidate","formtarget"].forEach(t=>{e.hasAttribute(t)&&s.setAttribute(t,e.getAttribute(t))}),"submit"===t&&e.hasAttribute("name")&&(s.name=e.getAttribute("name"),s.value=e.getAttribute("value")||"")),this.form.append(s),s.click(),s.remove()}}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}}var Jt,Kt,Xt=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}`,Yt=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 Gt extends qt{constructor(){super(...arguments),this.formSubmitController=new Zt(this,{form:t=>{if(t.hasAttribute("form")){const e=t.getRootNode(),s=t.getAttribute("form");return e.getElementById(s)}return t.closest("form")}}),this.type="button",this.fullWidth=!1,this.hasLeftIconSlot=!1,this.hasRightIconSlot=!1,this.hasSlotController=new Ft(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(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation();this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}render(){const t=this.href,e=t?zt`a`:zt`button`,s=!this.hasLeftIconSlot&&!this.hasRightIconSlot;return Ot`
57
57
  <${e}
58
58
  class="btn ${Pt({disabled:this.disabled,active:this.active,"has-left-icon":this.hasLeftIconSlot,"has-right-icon":this.hasRightIconSlot,"no-icon":s,loading:this.loading})}"
59
59
  ?disabled=${Et(t?void 0:this.disabled)}
60
60
  type=${Et(t?void 0:this.type)}
61
+ name=${Et(t?void 0:this.name)}
62
+ value=${Et(t?void 0:this.value)}
61
63
  href=${Et(t?this.href:void 0)}
62
64
  target=${Et(t?this.target:void 0)}
63
65
  download=${Et(t?this.download:void 0)}
@@ -79,5 +81,5 @@ const Ut=globalThis;let It;Ut.litIssuedWarnings??=new Set,It=(t,e)=>{e+=` See ht
79
81
  <slot name="rightIcon"></slot>`}
80
82
 
81
83
  </${e}>
82
- `}}Gt.styles=[...qt.styles,Xt,Yt],t([E({type:String,reflect:!0})],Gt.prototype,"type",void 0),t([E({type:String,reflect:!0})],Gt.prototype,"form",void 0),t([E({type:String,reflect:!0,attribute:"formaction"})],Gt.prototype,"formAction",void 0),t([E({type:String,reflect:!0,attribute:"formmethod"})],Gt.prototype,"formMethod",void 0),t([E({attribute:"formnovalidate",type:Boolean,reflect:!0})],Gt.prototype,"formNoValidate",void 0),t([E({type:String,reflect:!0,attribute:"formtarget"})],Gt.prototype,"formTarget",void 0),t([E({type:Boolean,reflect:!0})],Gt.prototype,"fullWidth",void 0),t([E({type:Boolean})],Gt.prototype,"hasLeftIconSlot",void 0),t([E({type:Boolean})],Gt.prototype,"hasRightIconSlot",void 0),Jt="sgds-button",Kt=Gt,customElements.get(Jt)||customElements.define(Jt,Kt)});
84
+ `}}Gt.styles=[...qt.styles,Xt,Yt],t([E({type:String,reflect:!0})],Gt.prototype,"name",void 0),t([E({type:String,reflect:!0})],Gt.prototype,"value",void 0),t([E({type:String,reflect:!0})],Gt.prototype,"type",void 0),t([E({type:String,reflect:!0})],Gt.prototype,"form",void 0),t([E({type:String,reflect:!0,attribute:"formaction"})],Gt.prototype,"formAction",void 0),t([E({type:String,reflect:!0,attribute:"formmethod"})],Gt.prototype,"formMethod",void 0),t([E({attribute:"formnovalidate",type:Boolean,reflect:!0})],Gt.prototype,"formNoValidate",void 0),t([E({type:String,reflect:!0,attribute:"formtarget"})],Gt.prototype,"formTarget",void 0),t([E({type:Boolean,reflect:!0})],Gt.prototype,"fullWidth",void 0),t([E({type:Boolean})],Gt.prototype,"hasLeftIconSlot",void 0),t([E({type:Boolean})],Gt.prototype,"hasRightIconSlot",void 0),Jt="sgds-button",Kt=Gt,customElements.get(Jt)||customElements.define(Jt,Kt)});
83
85
  //# sourceMappingURL=index.umd.min.js.map