@govtechsg/sgds-web-component 3.19.0-rc.0 → 3.19.0-rc.3
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.js +1 -1
- package/base/option.js +1 -1
- package/components/Accordion/accordion-item.js +1 -1
- package/components/Accordion/index.umd.min.js +1 -1
- package/components/Alert/index.umd.min.js +8 -8
- package/components/Alert/index.umd.min.js.map +1 -1
- package/components/Badge/index.umd.min.js +9 -9
- package/components/Badge/index.umd.min.js.map +1 -1
- package/components/Breadcrumb/index.umd.min.js +2 -2
- package/components/Card/index.umd.min.js +1 -1
- package/components/Checkbox/checkbox-group.js +1 -1
- package/components/Checkbox/checkbox.js +1 -1
- package/components/Checkbox/index.umd.min.js +2238 -32
- package/components/Checkbox/index.umd.min.js.map +1 -1
- package/components/Checkbox/sgds-checkbox-group.d.ts +5 -0
- package/components/Checkbox/sgds-checkbox-group.js +6 -6
- package/components/Checkbox/sgds-checkbox-group.js.map +1 -1
- package/components/Checkbox/sgds-checkbox.d.ts +5 -0
- package/components/Checkbox/sgds-checkbox.js +6 -6
- package/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/components/CloseButton/close-button.js +1 -1
- package/components/CloseButton/index.umd.min.js +6 -6
- package/components/CloseButton/index.umd.min.js.map +1 -1
- package/components/CloseButton/sgds-close-button.js +1 -1
- package/components/CloseButton/sgds-close-button.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +7 -12
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/Datepicker/datepicker-calendar2.js +1 -1
- package/components/Datepicker/index.umd.min.js +2 -2
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Drawer/index.umd.min.js +8 -8
- package/components/Drawer/index.umd.min.js.map +1 -1
- package/components/Dropdown/dropdown-item.js +1 -1
- package/components/Dropdown/index.umd.min.js +1 -1
- package/components/FileUpload/index.umd.min.js +8 -8
- package/components/FileUpload/index.umd.min.js.map +1 -1
- package/components/Footer/index.umd.min.js +1 -1
- package/components/IconCard/index.umd.min.js +1 -1
- package/components/ImageCard/index.umd.min.js +1 -1
- package/components/Input/index.umd.min.js +1 -1
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Link/index.umd.min.js +1 -1
- package/components/Link/link.js +1 -1
- package/components/Mainnav/index.umd.min.js +3 -3
- package/components/Mainnav/mainnav-dropdown.js +1 -1
- package/components/Mainnav/mainnav-item.js +1 -1
- package/components/Modal/index.umd.min.js +9 -9
- package/components/Modal/index.umd.min.js.map +1 -1
- package/components/OverflowMenu/index.umd.min.js +1 -1
- package/components/Pagination/index.umd.min.js +1 -1
- package/components/Pagination/pagination.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 +2 -2
- package/components/Radio/index.umd.min.js.map +1 -1
- package/components/Radio/radio-group.js +1 -1
- package/components/Select/index.umd.min.js +2 -2
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Sidenav/index.umd.min.js +2 -2
- package/components/Sidenav/sidenav-item.js +1 -1
- package/components/Sidenav/sidenav-link.js +1 -1
- package/components/Stepper/index.umd.min.js +26 -26
- package/components/Stepper/index.umd.min.js.map +1 -1
- package/components/Stepper/sgds-stepper.d.ts +10 -0
- package/components/Stepper/sgds-stepper.js +46 -24
- package/components/Stepper/sgds-stepper.js.map +1 -1
- package/components/Stepper/step.js +1 -1
- package/components/Subnav/index.umd.min.js +1 -1
- package/components/Subnav/subnav-item.js +1 -1
- package/components/Switch/index.umd.min.js +1 -1
- package/components/Switch/switch.js +1 -1
- package/components/SystemBanner/index.umd.min.js +2 -2
- package/components/SystemBanner/index.umd.min.js.map +1 -1
- package/components/Tab/index.umd.min.js +1 -1
- package/components/Tab/tab.js +1 -1
- package/components/Table/index.umd.min.js +1 -1
- package/components/Table/index.umd.min.js.map +1 -1
- package/components/Table/table.js +1 -1
- package/components/Textarea/index.umd.min.js +10 -10
- package/components/Textarea/index.umd.min.js.map +1 -1
- package/components/Textarea/textarea.js +1 -1
- package/components/ThumbnailCard/index.umd.min.js +1 -1
- package/components/Toast/index.umd.min.js +5 -5
- package/components/Toast/index.umd.min.js.map +1 -1
- package/components/index.umd.min.js +97 -107
- package/components/index.umd.min.js.map +1 -1
- package/css/fouc.css +1 -1
- package/custom-elements.json +636 -629
- package/index.umd.min.js +43 -53
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/accordion/index.d.ts +3 -1
- package/react/accordion-item/index.d.ts +3 -1
- package/react/alert/index.d.ts +3 -1
- package/react/alert-link/index.d.ts +3 -1
- package/react/badge/index.d.ts +3 -1
- package/react/base/card.cjs.js +1 -1
- package/react/base/card.js +1 -1
- package/react/base/option.cjs.js +1 -1
- package/react/base/option.js +1 -1
- package/react/breadcrumb/index.d.ts +3 -1
- package/react/breadcrumb-item/index.d.ts +3 -1
- package/react/button/index.d.ts +3 -1
- package/react/card/index.d.ts +3 -1
- package/react/checkbox/index.d.ts +3 -1
- package/react/checkbox-group/index.d.ts +3 -1
- package/react/close-button/index.d.ts +3 -1
- package/react/combo-box/index.d.ts +3 -1
- package/react/combo-box-option/index.d.ts +3 -1
- package/react/components/Accordion/accordion-item.cjs.js +1 -1
- package/react/components/Accordion/accordion-item.js +1 -1
- package/react/components/Checkbox/checkbox-group.cjs.js +1 -1
- package/react/components/Checkbox/checkbox-group.js +1 -1
- package/react/components/Checkbox/checkbox.cjs.js +1 -1
- package/react/components/Checkbox/checkbox.js +1 -1
- package/react/components/Checkbox/sgds-checkbox-group.cjs.js +6 -6
- package/react/components/Checkbox/sgds-checkbox-group.cjs.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox-group.js +6 -6
- package/react/components/Checkbox/sgds-checkbox-group.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox.cjs.js +6 -6
- package/react/components/Checkbox/sgds-checkbox.cjs.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox.js +6 -6
- package/react/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/react/components/CloseButton/close-button.cjs.js +1 -1
- package/react/components/CloseButton/close-button.js +1 -1
- package/react/components/CloseButton/sgds-close-button.cjs.js +1 -1
- package/react/components/CloseButton/sgds-close-button.cjs.js.map +1 -1
- package/react/components/CloseButton/sgds-close-button.js +1 -1
- package/react/components/CloseButton/sgds-close-button.js.map +1 -1
- package/react/components/Datepicker/datepicker-calendar.cjs2.js +1 -1
- package/react/components/Datepicker/datepicker-calendar2.js +1 -1
- package/react/components/Dropdown/dropdown-item.cjs.js +1 -1
- package/react/components/Dropdown/dropdown-item.js +1 -1
- package/react/components/Link/link.cjs.js +1 -1
- package/react/components/Link/link.js +1 -1
- package/react/components/Mainnav/mainnav-dropdown.cjs.js +1 -1
- package/react/components/Mainnav/mainnav-dropdown.js +1 -1
- package/react/components/Mainnav/mainnav-item.cjs.js +1 -1
- package/react/components/Mainnav/mainnav-item.js +1 -1
- package/react/components/Pagination/pagination.cjs.js +1 -1
- package/react/components/Pagination/pagination.js +1 -1
- package/react/components/Radio/radio-group.cjs.js +1 -1
- package/react/components/Radio/radio-group.js +1 -1
- package/react/components/Sidenav/sidenav-item.cjs.js +1 -1
- package/react/components/Sidenav/sidenav-item.js +1 -1
- package/react/components/Sidenav/sidenav-link.cjs.js +1 -1
- package/react/components/Sidenav/sidenav-link.js +1 -1
- package/react/components/Stepper/sgds-stepper.cjs.js +45 -23
- package/react/components/Stepper/sgds-stepper.cjs.js.map +1 -1
- package/react/components/Stepper/sgds-stepper.js +46 -24
- package/react/components/Stepper/sgds-stepper.js.map +1 -1
- package/react/components/Stepper/step.cjs.js +1 -1
- package/react/components/Stepper/step.js +1 -1
- package/react/components/Subnav/subnav-item.cjs.js +1 -1
- package/react/components/Subnav/subnav-item.js +1 -1
- package/react/components/Switch/switch.cjs.js +1 -1
- package/react/components/Switch/switch.js +1 -1
- package/react/components/Tab/tab.cjs.js +1 -1
- package/react/components/Tab/tab.js +1 -1
- package/react/components/Table/table.cjs.js +1 -1
- package/react/components/Table/table.js +1 -1
- package/react/components/Textarea/textarea.cjs.js +1 -1
- package/react/components/Textarea/textarea.js +1 -1
- package/react/datepicker/index.d.ts +3 -1
- package/react/description-list/index.d.ts +3 -1
- package/react/description-list-group/index.d.ts +3 -1
- package/react/divider/index.d.ts +3 -1
- package/react/drawer/index.d.ts +3 -1
- package/react/dropdown/index.d.ts +3 -1
- package/react/dropdown-item/index.d.ts +3 -1
- package/react/file-upload/index.d.ts +3 -1
- package/react/footer/index.d.ts +3 -1
- package/react/footer-item/index.d.ts +3 -1
- package/react/icon/index.d.ts +3 -1
- package/react/icon-button/index.d.ts +3 -1
- package/react/icon-card/index.d.ts +3 -1
- package/react/icon-list/index.d.ts +3 -1
- package/react/image-card/index.d.ts +3 -1
- package/react/index.cjs.js +4 -4
- package/react/index.d.ts +1 -1
- package/react/index.js +1 -1
- package/react/input/index.d.ts +3 -1
- package/react/link/index.d.ts +3 -1
- package/react/mainnav/index.d.ts +3 -1
- package/react/mainnav-dropdown/index.d.ts +3 -1
- package/react/mainnav-item/index.d.ts +3 -1
- package/react/masthead/index.d.ts +3 -1
- package/react/modal/index.d.ts +3 -1
- package/react/overflow-menu/index.d.ts +3 -1
- package/react/pagination/index.d.ts +3 -1
- package/react/progress-bar/index.d.ts +3 -1
- package/react/quantity-toggle/index.d.ts +3 -1
- package/react/radio/index.d.ts +3 -1
- package/react/radio-group/index.d.ts +3 -1
- package/react/select/index.d.ts +3 -1
- package/react/select-option/index.d.ts +3 -1
- package/react/sidebar/index.d.ts +3 -1
- package/react/sidebar-group/index.d.ts +3 -1
- package/react/sidebar-item/index.d.ts +3 -1
- package/react/sidebar-section/index.d.ts +3 -1
- package/react/sidenav/index.d.ts +3 -1
- package/react/sidenav-item/index.d.ts +3 -1
- package/react/sidenav-link/index.d.ts +3 -1
- package/react/skeleton/index.d.ts +3 -1
- package/react/spinner/index.d.ts +3 -1
- package/react/step/index.d.ts +3 -1
- package/react/stepper/index.d.ts +3 -1
- package/react/styles/form-check.cjs.js +1 -1
- package/react/styles/form-check.js +1 -1
- package/react/styles/form-hint.cjs.js +1 -1
- package/react/styles/form-hint.js +1 -1
- 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/react/subnav/index.d.ts +3 -1
- package/react/subnav-item/index.d.ts +3 -1
- package/react/switch/index.d.ts +3 -1
- package/react/system-banner/index.d.ts +3 -1
- package/react/system-banner-item/index.d.ts +3 -1
- package/react/tab/index.d.ts +3 -1
- package/react/tab-group/index.d.ts +3 -1
- package/react/tab-panel/index.d.ts +3 -1
- package/react/table/index.d.ts +3 -1
- package/react/table-cell/index.d.ts +3 -1
- package/react/table-head/index.d.ts +3 -1
- package/react/table-of-contents/index.d.ts +3 -1
- package/react/table-row/index.d.ts +3 -1
- package/react/textarea/index.d.ts +3 -1
- package/react/thumbnail-card/index.d.ts +3 -1
- package/react/toast/index.d.ts +3 -1
- package/react/toast-container/index.d.ts +3 -1
- package/react/tooltip/index.d.ts +3 -1
- package/styles/form-check.js +1 -1
- package/styles/form-hint.js +1 -1
- package/styles/form-label.js +1 -1
- package/styles/form-text-control.js +1 -1
- package/types/react.d.ts +101 -101
|
@@ -10,7 +10,7 @@ const e=globalThis,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
|
|
10
10
|
* Copyright 2017 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
12
|
*/
|
|
13
|
-
const k=globalThis,C=t=>{k.emitLitDebugLogEvents&&k.dispatchEvent(new CustomEvent("lit-debug",{detail:t}))};let E,P=0;k.litIssuedWarnings??=new Set,E=(t,e)=>{e+=t?` See https://lit.dev/msg/${t} for more information.`:"",k.litIssuedWarnings.has(e)||k.litIssuedWarnings.has(t)||(console.warn(e),k.litIssuedWarnings.add(e))},queueMicrotask(()=>{E("dev-mode","Lit is in dev mode. Not recommended for production!")});const T=k.ShadyDOM?.inUse&&!0===k.ShadyDOM?.noPatch?k.ShadyDOM.wrap:t=>t,R=k.trustedTypes,O=R?R.createPolicy("lit-html",{createHTML:t=>t}):void 0,L=t=>t,V=(t,e,i)=>L,N=t=>{if(ot!==V)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");ot=t},A=()=>{ot=V},z=(t,e,i)=>ot(t,e,i),U="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,D="?"+M,W=`<${D}>`,B=document,I=()=>B.createComment(""),F=t=>null===t||"object"!=typeof t&&"function"!=typeof t,H=Array.isArray,j="[ \t\n\f\r]",q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Z=/-->/g,J=/>/g,X=new RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Y=/'/g,G=/"/g,K=/^(?:script|style|textarea|title)$/i,Q=(tt=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$)&&E("","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$:tt,strings:t,values:e}));var tt;const et=Symbol.for("lit-noChange"),it=Symbol.for("lit-nothing"),st=new WeakMap,nt=B.createTreeWalker(B,129);let ot=V;function rt(t,e){if(!H(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!==O?O.createHTML(e):e}class at{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,o=0;const r=t.length-1,a=this.parts,[l,d]=((t,e)=>{const i=t.length-1,s=[];let n,o=2===e?"<svg>":3===e?"<math>":"",r=q;for(let e=0;e<i;e++){const i=t[e];let a,l,d=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)if(c=r.lastIndex,r===q){if("!--"===l[1])r=Z;else if(void 0!==l[1])r=J;else if(void 0!==l[2])K.test(l[2])&&(n=new RegExp(`</${l[2]}`,"g")),r=X;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 r===X?">"===l[0]?(r=n??q,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?X:'"'===l[3]?G:Y):r===G||r===Y?r=X:r===Z||r===J?r=q:(r=X,n=void 0);console.assert(-1===d||r===X||r===Y||r===G,"unexpected parse state B");const h=r===X&&t[e+1].startsWith("/>")?" ":"";o+=r===q?i+W:d>=0?(s.push(a),i.slice(0,d)+U+i.slice(d)+M+h):i+M+(-2===d?e:h)}return[rt(t,o+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]})(t,e);if(this.el=at.createElement(l,i),nt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=nt.nextNode())&&a.length<r;){if(1===s.nodeType){{const t=s.localName;if(/^(?:textarea|template)$/i.test(t)&&s.innerHTML.includes(M)){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);E("",e)}}if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(U)){const e=d[o++],i=s.getAttribute(t).split(M),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:r[2],strings:i,ctor:"."===r[1]?ut:"?"===r[1]?pt:"@"===r[1]?ft:ht}),s.removeAttribute(t)}else t.startsWith(M)&&(a.push({type:6,index:n}),s.removeAttribute(t));if(K.test(s.tagName)){const t=s.textContent.split(M),e=t.length-1;if(e>0){s.textContent=R?R.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],I()),nt.nextNode(),a.push({type:2,index:++n});s.append(t[e],I())}}}else if(8===s.nodeType){if(s.data===D)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=s.data.indexOf(M,t+1));)a.push({type:7,index:n}),t+=M.length-1}}n++}if(d.length!==o)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("${...}")+"`");C&&C({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:t})}static createElement(t,e){const i=B.createElement("template");return i.innerHTML=t,i}}function lt(t,e,i=t,s){if(e===et)return e;let n=void 0!==s?i.__directives?.[s]:i.__directive;const o=F(e)?void 0:e._$litDirective$;return n?.constructor!==o&&(n?._$notifyDirectiveConnectionChanged?.(!1),void 0===o?n=void 0:(n=new o(t),n._$initialize(t,i,s)),void 0!==s?(i.__directives??=[])[s]=n:i.__directive=n),void 0!==n&&(e=lt(t,n._$resolve(t,e.values),n,s)),e}class dt{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:i}=this._$template,s=(t?.creationScope??B).importNode(e,!0);nt.currentNode=s;let n=nt.nextNode(),o=0,r=0,a=i[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new ct(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new mt(n,this,t)),this._$parts.push(e),a=i[++r]}o!==a?.index&&(n=nt.nextNode(),o++)}return nt.currentNode=B,s}_update(t){let e=0;for(const i of this._$parts)void 0!==i&&(C&&C({kind:"set part",part:i,value:t[e],valueIndex:e,values:t,templateInstance:this}),void 0!==i.strings?(i._$setValue(t,i,e),e+=i.strings.length-2):i._$setValue(t[e])),e++}}class ct{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(t,e,i,s){this.type=2,this._$committedValue=it,this._$disconnectableChildren=void 0,this._$startNode=t,this._$endNode=e,this._$parent=i,this.options=s,this.__isConnected=s?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let t=T(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=lt(this,t,e),F(t))t===it||null==t||""===t?(this._$committedValue!==it&&(C&&C({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=it):t!==this._$committedValue&&t!==et&&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=>H(t)||"function"==typeof t?.[Symbol.iterator])(t)?this._commitIterable(t):this._commitText(t)}_insert(t){return T(T(this._$startNode).parentNode).insertBefore(t,this._$endNode)}_commitNode(t){if(this._$committedValue!==t){if(this._$clear(),ot!==V){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)}}C&&C({kind:"commit node",start:this._$startNode,parent:this._$parent,value:t,options:this.options}),this._$committedValue=this._insert(t)}}_commitText(t){if(this._$committedValue!==it&&F(this._$committedValue)){const e=T(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=z(e,"data","property")),t=this._textSanitizer(t),C&&C({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}else{const e=B.createTextNode("");this._commitNode(e),void 0===this._textSanitizer&&(this._textSanitizer=z(e,"data","property")),t=this._textSanitizer(t),C&&C({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}this._$committedValue=t}_commitTemplateResult(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$getTemplate(t):(void 0===i.el&&(i.el=at.createElement(rt(i.h,i.h[0]),this.options)),i);if(this._$committedValue?._$template===s)C&&C({kind:"template updating",template:s,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:e}),this._$committedValue._update(e);else{const t=new dt(s,this),i=t._clone(this.options);C&&C({kind:"template instantiated",template:s,instance:t,parts:t._$parts,options:this.options,fragment:i,values:e}),t._update(e),C&&C({kind:"template instantiated and updated",template:s,instance:t,parts:t._$parts,options:this.options,fragment:i,values:e}),this._commitNode(i),this._$committedValue=t}}_$getTemplate(t){let e=st.get(t.strings);return void 0===e&&st.set(t.strings,e=new at(t)),e}_commitIterable(t){H(this._$committedValue)||(this._$committedValue=[],this._$clear());const e=this._$committedValue;let i,s=0;for(const n of t)s===e.length?e.push(i=new ct(this._insert(I()),this._insert(I()),this,this.options)):i=e[s],i._$setValue(n),s++;s<e.length&&(this._$clear(i&&T(i._$endNode).nextSibling,s),e.length=s)}_$clear(t=T(this._$startNode).nextSibling,e){for(this._$notifyConnectionChanged?.(!1,!0,e);t!==this._$endNode;){const e=T(t).nextSibling;T(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 ht{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(t,e,i,s,n){this.type=1,this._$committedValue=it,this._$disconnectableChildren=void 0,this.element=t,this.name=e,this._$parent=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$committedValue=new Array(i.length-1).fill(new String),this.strings=i):this._$committedValue=it,this._sanitizer=void 0}_$setValue(t,e=this,i,s){const n=this.strings;let o=!1;if(void 0===n)t=lt(this,t,e,0),o=!F(t)||t!==this._$committedValue&&t!==et,o&&(this._$committedValue=t);else{const s=t;let r,a;for(t=n[0],r=0;r<n.length-1;r++)a=lt(this,s[i+r],e,r),a===et&&(a=this._$committedValue[r]),o||=!F(a)||a!==this._$committedValue[r],a===it?t=it:t!==it&&(t+=(a??"")+n[r+1]),this._$committedValue[r]=a}o&&!s&&this._commitValue(t)}_commitValue(t){t===it?T(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=ot(this.element,this.name,"attribute")),t=this._sanitizer(t??""),C&&C({kind:"commit attribute",element:this.element,name:this.name,value:t,options:this.options}),T(this.element).setAttribute(this.name,t??""))}}class ut extends ht{constructor(){super(...arguments),this.type=3}_commitValue(t){void 0===this._sanitizer&&(this._sanitizer=ot(this.element,this.name,"property")),t=this._sanitizer(t),C&&C({kind:"commit property",element:this.element,name:this.name,value:t,options:this.options}),this.element[this.name]=t===it?void 0:t}}class pt extends ht{constructor(){super(...arguments),this.type=4}_commitValue(t){C&&C({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!t||t===it),options:this.options}),T(this.element).toggleAttribute(this.name,!!t&&t!==it)}}class ft extends ht{constructor(t,e,i,s,n){if(super(t,e,i,s,n),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=lt(this,t,e,0)??it)===et)return;const i=this._$committedValue,s=t===it&&i!==it||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==it&&(i===it||s);C&&C({kind:"commit event listener",element:this.element,name:this.name,value:t,options:this.options,removeListener:s,addListener:n,oldListener:i}),s&&this.element.removeEventListener(this.name,this,i),n&&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 mt{constructor(t,e,i){this.element=t,this.type=6,this._$disconnectableChildren=void 0,this._$parent=e,this.options=i}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t){C&&C({kind:"commit to element binding",element:this.element,value:t,options:this.options}),lt(this,t)}}const gt=k.litHtmlPolyfillSupportDevMode;gt?.(at,ct),(k.litHtmlVersions??=[]).push("3.3.2"),k.litHtmlVersions.length>1&&queueMicrotask(()=>{E("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});const vt=(t,e,i)=>{if(null==e)throw new TypeError(`The container to render into may not be ${e}`);const s=P++,n=i?.renderBefore??e;let o=n._$litPart$;if(C&&C({kind:"begin render",id:s,value:t,container:e,options:i,part:o}),void 0===o){const t=i?.renderBefore??null;n._$litPart$=o=new ct(e.insertBefore(I(),t),t,void 0,i??{})}return o._$setValue(t),C&&C({kind:"end render",id:s,value:t,container:e,options:i,part:o}),o};vt.setSanitizer=N,vt.createSanitizer=z,vt._testOnlyClearSanitizerFactoryDoNotCallOrElse=A;
|
|
13
|
+
const k=globalThis,C=t=>{k.emitLitDebugLogEvents&&k.dispatchEvent(new CustomEvent("lit-debug",{detail:t}))};let E,P=0;k.litIssuedWarnings??=new Set,E=(t,e)=>{e+=t?` See https://lit.dev/msg/${t} for more information.`:"",k.litIssuedWarnings.has(e)||k.litIssuedWarnings.has(t)||(console.warn(e),k.litIssuedWarnings.add(e))},queueMicrotask(()=>{E("dev-mode","Lit is in dev mode. Not recommended for production!")});const T=k.ShadyDOM?.inUse&&!0===k.ShadyDOM?.noPatch?k.ShadyDOM.wrap:t=>t,R=k.trustedTypes,O=R?R.createPolicy("lit-html",{createHTML:t=>t}):void 0,L=t=>t,V=(t,e,i)=>L,N=t=>{if(ot!==V)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");ot=t},A=()=>{ot=V},U=(t,e,i)=>ot(t,e,i),z="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,D="?"+M,W=`<${D}>`,B=document,I=()=>B.createComment(""),F=t=>null===t||"object"!=typeof t&&"function"!=typeof t,H=Array.isArray,j="[ \t\n\f\r]",q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Z=/-->/g,J=/>/g,X=new RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Y=/'/g,G=/"/g,K=/^(?:script|style|textarea|title)$/i,Q=(tt=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$)&&E("","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$:tt,strings:t,values:e}));var tt;const et=Symbol.for("lit-noChange"),it=Symbol.for("lit-nothing"),st=new WeakMap,nt=B.createTreeWalker(B,129);let ot=V;function rt(t,e){if(!H(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!==O?O.createHTML(e):e}class at{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,o=0;const r=t.length-1,a=this.parts,[l,d]=((t,e)=>{const i=t.length-1,s=[];let n,o=2===e?"<svg>":3===e?"<math>":"",r=q;for(let e=0;e<i;e++){const i=t[e];let a,l,d=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)if(c=r.lastIndex,r===q){if("!--"===l[1])r=Z;else if(void 0!==l[1])r=J;else if(void 0!==l[2])K.test(l[2])&&(n=new RegExp(`</${l[2]}`,"g")),r=X;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 r===X?">"===l[0]?(r=n??q,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?X:'"'===l[3]?G:Y):r===G||r===Y?r=X:r===Z||r===J?r=q:(r=X,n=void 0);console.assert(-1===d||r===X||r===Y||r===G,"unexpected parse state B");const h=r===X&&t[e+1].startsWith("/>")?" ":"";o+=r===q?i+W:d>=0?(s.push(a),i.slice(0,d)+z+i.slice(d)+M+h):i+M+(-2===d?e:h)}return[rt(t,o+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]})(t,e);if(this.el=at.createElement(l,i),nt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=nt.nextNode())&&a.length<r;){if(1===s.nodeType){{const t=s.localName;if(/^(?:textarea|template)$/i.test(t)&&s.innerHTML.includes(M)){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);E("",e)}}if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(z)){const e=d[o++],i=s.getAttribute(t).split(M),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:r[2],strings:i,ctor:"."===r[1]?ut:"?"===r[1]?pt:"@"===r[1]?ft:ht}),s.removeAttribute(t)}else t.startsWith(M)&&(a.push({type:6,index:n}),s.removeAttribute(t));if(K.test(s.tagName)){const t=s.textContent.split(M),e=t.length-1;if(e>0){s.textContent=R?R.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],I()),nt.nextNode(),a.push({type:2,index:++n});s.append(t[e],I())}}}else if(8===s.nodeType){if(s.data===D)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=s.data.indexOf(M,t+1));)a.push({type:7,index:n}),t+=M.length-1}}n++}if(d.length!==o)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("${...}")+"`");C&&C({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:t})}static createElement(t,e){const i=B.createElement("template");return i.innerHTML=t,i}}function lt(t,e,i=t,s){if(e===et)return e;let n=void 0!==s?i.__directives?.[s]:i.__directive;const o=F(e)?void 0:e._$litDirective$;return n?.constructor!==o&&(n?._$notifyDirectiveConnectionChanged?.(!1),void 0===o?n=void 0:(n=new o(t),n._$initialize(t,i,s)),void 0!==s?(i.__directives??=[])[s]=n:i.__directive=n),void 0!==n&&(e=lt(t,n._$resolve(t,e.values),n,s)),e}class dt{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:i}=this._$template,s=(t?.creationScope??B).importNode(e,!0);nt.currentNode=s;let n=nt.nextNode(),o=0,r=0,a=i[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new ct(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new mt(n,this,t)),this._$parts.push(e),a=i[++r]}o!==a?.index&&(n=nt.nextNode(),o++)}return nt.currentNode=B,s}_update(t){let e=0;for(const i of this._$parts)void 0!==i&&(C&&C({kind:"set part",part:i,value:t[e],valueIndex:e,values:t,templateInstance:this}),void 0!==i.strings?(i._$setValue(t,i,e),e+=i.strings.length-2):i._$setValue(t[e])),e++}}class ct{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(t,e,i,s){this.type=2,this._$committedValue=it,this._$disconnectableChildren=void 0,this._$startNode=t,this._$endNode=e,this._$parent=i,this.options=s,this.__isConnected=s?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let t=T(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=lt(this,t,e),F(t))t===it||null==t||""===t?(this._$committedValue!==it&&(C&&C({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=it):t!==this._$committedValue&&t!==et&&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=>H(t)||"function"==typeof t?.[Symbol.iterator])(t)?this._commitIterable(t):this._commitText(t)}_insert(t){return T(T(this._$startNode).parentNode).insertBefore(t,this._$endNode)}_commitNode(t){if(this._$committedValue!==t){if(this._$clear(),ot!==V){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)}}C&&C({kind:"commit node",start:this._$startNode,parent:this._$parent,value:t,options:this.options}),this._$committedValue=this._insert(t)}}_commitText(t){if(this._$committedValue!==it&&F(this._$committedValue)){const e=T(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=U(e,"data","property")),t=this._textSanitizer(t),C&&C({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}else{const e=B.createTextNode("");this._commitNode(e),void 0===this._textSanitizer&&(this._textSanitizer=U(e,"data","property")),t=this._textSanitizer(t),C&&C({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}this._$committedValue=t}_commitTemplateResult(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$getTemplate(t):(void 0===i.el&&(i.el=at.createElement(rt(i.h,i.h[0]),this.options)),i);if(this._$committedValue?._$template===s)C&&C({kind:"template updating",template:s,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:e}),this._$committedValue._update(e);else{const t=new dt(s,this),i=t._clone(this.options);C&&C({kind:"template instantiated",template:s,instance:t,parts:t._$parts,options:this.options,fragment:i,values:e}),t._update(e),C&&C({kind:"template instantiated and updated",template:s,instance:t,parts:t._$parts,options:this.options,fragment:i,values:e}),this._commitNode(i),this._$committedValue=t}}_$getTemplate(t){let e=st.get(t.strings);return void 0===e&&st.set(t.strings,e=new at(t)),e}_commitIterable(t){H(this._$committedValue)||(this._$committedValue=[],this._$clear());const e=this._$committedValue;let i,s=0;for(const n of t)s===e.length?e.push(i=new ct(this._insert(I()),this._insert(I()),this,this.options)):i=e[s],i._$setValue(n),s++;s<e.length&&(this._$clear(i&&T(i._$endNode).nextSibling,s),e.length=s)}_$clear(t=T(this._$startNode).nextSibling,e){for(this._$notifyConnectionChanged?.(!1,!0,e);t!==this._$endNode;){const e=T(t).nextSibling;T(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 ht{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(t,e,i,s,n){this.type=1,this._$committedValue=it,this._$disconnectableChildren=void 0,this.element=t,this.name=e,this._$parent=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$committedValue=new Array(i.length-1).fill(new String),this.strings=i):this._$committedValue=it,this._sanitizer=void 0}_$setValue(t,e=this,i,s){const n=this.strings;let o=!1;if(void 0===n)t=lt(this,t,e,0),o=!F(t)||t!==this._$committedValue&&t!==et,o&&(this._$committedValue=t);else{const s=t;let r,a;for(t=n[0],r=0;r<n.length-1;r++)a=lt(this,s[i+r],e,r),a===et&&(a=this._$committedValue[r]),o||=!F(a)||a!==this._$committedValue[r],a===it?t=it:t!==it&&(t+=(a??"")+n[r+1]),this._$committedValue[r]=a}o&&!s&&this._commitValue(t)}_commitValue(t){t===it?T(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=ot(this.element,this.name,"attribute")),t=this._sanitizer(t??""),C&&C({kind:"commit attribute",element:this.element,name:this.name,value:t,options:this.options}),T(this.element).setAttribute(this.name,t??""))}}class ut extends ht{constructor(){super(...arguments),this.type=3}_commitValue(t){void 0===this._sanitizer&&(this._sanitizer=ot(this.element,this.name,"property")),t=this._sanitizer(t),C&&C({kind:"commit property",element:this.element,name:this.name,value:t,options:this.options}),this.element[this.name]=t===it?void 0:t}}class pt extends ht{constructor(){super(...arguments),this.type=4}_commitValue(t){C&&C({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!t||t===it),options:this.options}),T(this.element).toggleAttribute(this.name,!!t&&t!==it)}}class ft extends ht{constructor(t,e,i,s,n){if(super(t,e,i,s,n),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=lt(this,t,e,0)??it)===et)return;const i=this._$committedValue,s=t===it&&i!==it||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==it&&(i===it||s);C&&C({kind:"commit event listener",element:this.element,name:this.name,value:t,options:this.options,removeListener:s,addListener:n,oldListener:i}),s&&this.element.removeEventListener(this.name,this,i),n&&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 mt{constructor(t,e,i){this.element=t,this.type=6,this._$disconnectableChildren=void 0,this._$parent=e,this.options=i}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t){C&&C({kind:"commit to element binding",element:this.element,value:t,options:this.options}),lt(this,t)}}const gt=k.litHtmlPolyfillSupportDevMode;gt?.(at,ct),(k.litHtmlVersions??=[]).push("3.3.2"),k.litHtmlVersions.length>1&&queueMicrotask(()=>{E("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});const vt=(t,e,i)=>{if(null==e)throw new TypeError(`The container to render into may not be ${e}`);const s=P++,n=i?.renderBefore??e;let o=n._$litPart$;if(C&&C({kind:"begin render",id:s,value:t,container:e,options:i,part:o}),void 0===o){const t=i?.renderBefore??null;n._$litPart$=o=new ct(e.insertBefore(I(),t),t,void 0,i??{})}return o._$setValue(t),C&&C({kind:"end render",id:s,value:t,container:e,options:i,part:o}),o};vt.setSanitizer=N,vt.createSanitizer=U,vt._testOnlyClearSanitizerFactoryDoNotCallOrElse=A;
|
|
14
14
|
/**
|
|
15
15
|
* @license
|
|
16
16
|
* Copyright 2017 Google LLC
|
|
@@ -43,32 +43,32 @@ const Pt=1,Tt=2,Rt=t=>(...e)=>({_$litDirective$:t,values:e});class Ot{constructo
|
|
|
43
43
|
* @license
|
|
44
44
|
* Copyright 2018 Google LLC
|
|
45
45
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
46
|
-
*/const Lt=Rt(class extends Ot{constructor(t){if(super(t),t.type!==Pt||"class"!==t.name||t.strings?.length>2)throw new Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this._previousClasses){this._previousClasses=new Set,void 0!==t.strings&&(this._staticClasses=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!this._staticClasses?.has(t)&&this._previousClasses.add(t);return this.render(e)}const i=t.element.classList;for(const t of this._previousClasses)t in e||(i.remove(t),this._previousClasses.delete(t));for(const t in e){const s=!!e[t];s===this._previousClasses.has(t)||this._staticClasses?.has(t)||(s?(i.add(t),this._previousClasses.add(t)):(i.remove(t),this._previousClasses.delete(t)))}return et}});function Vt(t,e){const i=Object.assign({waitUntilFirstUpdate:!1},e);return(e,s)=>{const{update:n}=e;if(t in e){const o=t;e.update=function(t){if(t.has(o)){const e=t.get(o),n=this[o];e!==n&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[s](e,n))}n.call(this,t)}}}}var Nt=r`:host{cursor:default;display:inline-flex;max-width:100%}:host([variant=accent]) .badge{background-color:var(--sgds-accent-surface-default)}:host([variant=success]) .badge{background-color:var(--sgds-success-surface-default)}:host([variant=danger]) .badge{background-color:var(--sgds-danger-surface-default)}:host([variant=warning]) .badge{background-color:var(--sgds-warning-surface-default);color:var(--sgds-color-fixed-dark)}:host([variant=cyan]) .badge{background-color:var(--sgds-cyan-surface-default)}:host([variant=purple]) .badge{background-color:var(--sgds-purple-surface-default)}:host([variant=neutral]) .badge{background-color:var(--sgds-neutral-surface-default)}:host([variant=white]) .badge{background-color:var(--sgds-surface-fixed-light);color:var(--sgds-color-fixed-dark)}:host([variant=accent][outlined]) .badge{background-color:var(--sgds-accent-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-accent-border-color-muted);color:var(--sgds-accent-color-fixed-dark)}:host([variant=success][outlined]) .badge{background-color:var(--sgds-success-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-success-border-color-muted);color:var(--sgds-success-color-fixed-dark)}:host([variant=danger][outlined]) .badge{background-color:var(--sgds-danger-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-danger-border-color-muted);color:var(--sgds-danger-color-fixed-dark)}:host([variant=warning][outlined]) .badge{background-color:var(--sgds-warning-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-warning-border-color-muted);color:var(--sgds-warning-color-fixed-dark)}:host([variant=cyan][outlined]) .badge{background-color:var(--sgds-cyan-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-cyan-border-color-muted);color:var(--sgds-cyan-color-fixed-dark)}:host([variant=purple][outlined]) .badge{background-color:var(--sgds-purple-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-purple-border-color-muted);color:var(--sgds-purple-color-fixed-dark)}:host([variant=neutral][outlined]) .badge{background-color:var(--sgds-neutral-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-neutral-border-color-muted);color:var(--sgds-color-fixed-dark)}:host([variant=white][outlined]) .badge{background-color:var(--sgds-surface-fixed-light);border:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);color:var(--sgds-color-fixed-dark)}sgds-tooltip{display:block;max-width:100%}.badge{align-items:center;background-color:var(--sgds-primary-surface-default);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-border-radius-sm);color:var(--sgds-color-fixed-light);display:inline-flex;font-size:var(--sgds-font-size-label-xs);height:var(--sgds-dimension-24,24px);justify-content:center;line-height:var(--sgds-line-height-3-xs);max-width:var(--sgds-dimension-192);min-width:var(--sgds-dimension-24);padding:var(--sgds-padding-none) var(--sgds-padding-xs)}.badge.outlined{background-color:var(--sgds-primary-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-primary-border-color-muted);color:var(--sgds-primary-color-fixed-dark)}.badge.full-width{max-width:100%}.badge-label{padding:var(--sgds-padding-none) var(--sgds-padding-3-xs)}.badge-dismissible{padding-right:0}.badge-dimissible sgds-close-button{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm)}.badge.truncated .badge-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}slot::slotted(*){color:inherit!important;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;margin:inherit!important}`,At=r`: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
|
|
46
|
+
*/const Lt=Rt(class extends Ot{constructor(t){if(super(t),t.type!==Pt||"class"!==t.name||t.strings?.length>2)throw new Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this._previousClasses){this._previousClasses=new Set,void 0!==t.strings&&(this._staticClasses=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!this._staticClasses?.has(t)&&this._previousClasses.add(t);return this.render(e)}const i=t.element.classList;for(const t of this._previousClasses)t in e||(i.remove(t),this._previousClasses.delete(t));for(const t in e){const s=!!e[t];s===this._previousClasses.has(t)||this._staticClasses?.has(t)||(s?(i.add(t),this._previousClasses.add(t)):(i.remove(t),this._previousClasses.delete(t)))}return et}});function Vt(t,e){const i=Object.assign({waitUntilFirstUpdate:!1},e);return(e,s)=>{const{update:n}=e;if(t in e){const o=t;e.update=function(t){if(t.has(o)){const e=t.get(o),n=this[o];e!==n&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[s](e,n))}n.call(this,t)}}}}var Nt=r`:host{cursor:default;display:inline-flex;max-width:100%}:host([variant=accent]) .badge{background-color:var(--sgds-accent-surface-default)}:host([variant=success]) .badge{background-color:var(--sgds-success-surface-default)}:host([variant=danger]) .badge{background-color:var(--sgds-danger-surface-default)}:host([variant=warning]) .badge{background-color:var(--sgds-warning-surface-default);color:var(--sgds-color-fixed-dark)}:host([variant=cyan]) .badge{background-color:var(--sgds-cyan-surface-default)}:host([variant=purple]) .badge{background-color:var(--sgds-purple-surface-default)}:host([variant=neutral]) .badge{background-color:var(--sgds-neutral-surface-default)}:host([variant=white]) .badge{background-color:var(--sgds-surface-fixed-light);color:var(--sgds-color-fixed-dark)}:host([variant=accent][outlined]) .badge{background-color:var(--sgds-accent-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-accent-border-color-muted);color:var(--sgds-accent-color-fixed-dark)}:host([variant=success][outlined]) .badge{background-color:var(--sgds-success-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-success-border-color-muted);color:var(--sgds-success-color-fixed-dark)}:host([variant=danger][outlined]) .badge{background-color:var(--sgds-danger-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-danger-border-color-muted);color:var(--sgds-danger-color-fixed-dark)}:host([variant=warning][outlined]) .badge{background-color:var(--sgds-warning-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-warning-border-color-muted);color:var(--sgds-warning-color-fixed-dark)}:host([variant=cyan][outlined]) .badge{background-color:var(--sgds-cyan-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-cyan-border-color-muted);color:var(--sgds-cyan-color-fixed-dark)}:host([variant=purple][outlined]) .badge{background-color:var(--sgds-purple-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-purple-border-color-muted);color:var(--sgds-purple-color-fixed-dark)}:host([variant=neutral][outlined]) .badge{background-color:var(--sgds-neutral-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-neutral-border-color-muted);color:var(--sgds-color-fixed-dark)}:host([variant=white][outlined]) .badge{background-color:var(--sgds-surface-fixed-light);border:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);color:var(--sgds-color-fixed-dark)}sgds-tooltip{display:block;max-width:100%}.badge{align-items:center;background-color:var(--sgds-primary-surface-default);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-border-radius-sm);color:var(--sgds-color-fixed-light);display:inline-flex;font-size:var(--sgds-font-size-label-xs);height:var(--sgds-dimension-24,24px);justify-content:center;line-height:var(--sgds-line-height-3-xs);max-width:var(--sgds-dimension-192);min-width:var(--sgds-dimension-24);padding:var(--sgds-padding-none) var(--sgds-padding-xs)}.badge.outlined{background-color:var(--sgds-primary-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-primary-border-color-muted);color:var(--sgds-primary-color-fixed-dark)}.badge.full-width{max-width:100%}.badge-label{padding:var(--sgds-padding-none) var(--sgds-padding-3-xs)}.badge-dismissible{padding-right:0}.badge-dimissible sgds-close-button{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm)}.badge.truncated .badge-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}slot::slotted(*){color:inherit!important;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;margin:inherit!important}`,At=r`: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 Ut extends _t{emit(t,e){const i=new CustomEvent(t,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(i),i}static define(t,e=this,i={}){if(customElements.get(t));else try{customElements.define(t,e,i)}catch(s){customElements.define(t,class extends e{},i)}}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}))}))}}Ut.styles=[At],Ut.dependencies={},t([Ct({type:Boolean,reflect:!0})],Ut.prototype,"ssr",void 0),
|
|
47
47
|
/**
|
|
48
48
|
* @license
|
|
49
49
|
* Copyright 2020 Google LLC
|
|
50
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
51
|
*/
|
|
52
|
-
window.ShadyDOM?.inUse&&!0===window.ShadyDOM?.noPatch&&window.ShadyDOM.wrap;const
|
|
52
|
+
window.ShadyDOM?.inUse&&!0===window.ShadyDOM?.noPatch&&window.ShadyDOM.wrap;const zt=(t,e)=>{const i=t._$disconnectableChildren;if(void 0===i)return!1;for(const t of i)t._$notifyDirectiveConnectionChanged?.(e,!1),zt(t,e);return!0},Mt=t=>{let e,i;do{if(void 0===(e=t._$parent))break;i=e._$disconnectableChildren,i.delete(t),t=e}while(0===i?.size)},Dt=t=>{for(let e;e=t._$parent;t=e){let i=e._$disconnectableChildren;if(void 0===i)e._$disconnectableChildren=i=new Set;else if(i.has(t))break;i.add(t),It(e)}};
|
|
53
53
|
/**
|
|
54
54
|
* @license
|
|
55
55
|
* Copyright 2017 Google LLC
|
|
56
56
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
57
|
-
*/function Wt(t){void 0!==this._$disconnectableChildren?(Mt(this),this._$parent=t,Dt(this)):this._$parent=t}function Bt(t,e=!1,i=0){const s=this._$committedValue,n=this._$disconnectableChildren;if(void 0!==n&&0!==n.size)if(e)if(Array.isArray(s))for(let t=i;t<s.length;t++)
|
|
57
|
+
*/function Wt(t){void 0!==this._$disconnectableChildren?(Mt(this),this._$parent=t,Dt(this)):this._$parent=t}function Bt(t,e=!1,i=0){const s=this._$committedValue,n=this._$disconnectableChildren;if(void 0!==n&&0!==n.size)if(e)if(Array.isArray(s))for(let t=i;t<s.length;t++)zt(s[t],!1),Mt(s[t]);else null!=s&&(zt(s,!1),Mt(s));else zt(this,t)}const It=t=>{t.type==Tt&&(t._$notifyConnectionChanged??=Bt,t._$reparentDisconnectables??=Wt)};class Ft extends Ot{constructor(){super(...arguments),this._$disconnectableChildren=void 0}_$initialize(t,e,i){super._$initialize(t,e,i),Dt(this),this.isConnected=t._$isConnected}_$notifyDirectiveConnectionChanged(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(zt(this,t),Mt(this))}setValue(t){if(void 0===this.__part.strings)this.__part._$setValue(t,this);else{if(void 0===this.__attributeIndex)throw new Error("Expected this.__attributeIndex to be a number");const e=[...this.__part._$committedValue];e[this.__attributeIndex]=t,this.__part._$setValue(e,this,0)}}disconnected(){}reconnected(){}}
|
|
58
58
|
/**
|
|
59
59
|
* @license
|
|
60
60
|
* Copyright 2020 Google LLC
|
|
61
61
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
-
*/const Ht=()=>new jt;class jt{}const qt=new WeakMap;const Zt=Rt(class extends Ft{render(t){return it}update(t,[e]){const i=e!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=e,this._context=t.options?.host,this._updateRefValue(this._element=t.element)),it}_updateRefValue(t){if(this.isConnected||(t=void 0),"function"==typeof this._ref){const e=this._context??globalThis;let i=qt.get(e);void 0===i&&(i=new WeakMap,qt.set(e,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,t),void 0!==t&&this._ref.call(this._context,t)}else this._ref.value=t}get _lastElementForRef(){return"function"==typeof this._ref?qt.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Jt=["top","right","bottom","left"],Xt=Math.min,Yt=Math.max,Gt=Math.round,Kt=Math.floor,Qt=t=>({x:t,y:t}),te={left:"right",right:"left",bottom:"top",top:"bottom"},ee={start:"end",end:"start"};function ie(t,e,i){return Yt(t,Xt(e,i))}function se(t,e){return"function"==typeof t?t(e):t}function ne(t){return t.split("-")[0]}function oe(t){return t.split("-")[1]}function re(t){return"x"===t?"y":"x"}function ae(t){return"y"===t?"height":"width"}const le=new Set(["top","bottom"]);function de(t){return le.has(ne(t))?"y":"x"}function ce(t){return re(de(t))}function he(t,e,i){void 0===i&&(i=!1);const s=oe(t),n=ce(t),o=ae(n);let r="x"===n?s===(i?"end":"start")?"right":"left":"start"===s?"bottom":"top";return e.reference[o]>e.floating[o]&&(r=be(r)),[r,be(r)]}function ue(t){return t.replace(/start|end/g,t=>ee[t])}const pe=["left","right"],fe=["right","left"],me=["top","bottom"],ge=["bottom","top"];function ve(t,e,i,s){const n=oe(t);let o=function(t,e,i){switch(t){case"top":case"bottom":return i?e?fe:pe:e?pe:fe;case"left":case"right":return e?me:ge;default:return[]}}(ne(t),"start"===i,s);return n&&(o=o.map(t=>t+"-"+n),e&&(o=o.concat(o.map(ue)))),o}function be(t){return t.replace(/left|right|bottom|top/g,t=>te[t])}function ye(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function _e(t){const{x:e,y:i,width:s,height:n}=t;return{width:s,height:n,top:i,left:e,right:e+s,bottom:i+n,x:e,y:i}}function we(t,e,i){let{reference:s,floating:n}=t;const o=de(e),r=ce(e),a=ae(r),l=ne(e),d="y"===o,c=s.x+s.width/2-n.width/2,h=s.y+s.height/2-n.height/2,u=s[a]/2-n[a]/2;let p;switch(l){case"top":p={x:c,y:s.y-n.height};break;case"bottom":p={x:c,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:h};break;case"left":p={x:s.x-n.width,y:h};break;default:p={x:s.x,y:s.y}}switch(oe(e)){case"start":p[r]-=u*(i&&d?-1:1);break;case"end":p[r]+=u*(i&&d?-1:1)}return p}async function xe(t,e){var i;void 0===e&&(e={});const{x:s,y:n,platform:o,rects:r,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:u=!1,padding:p=0}=se(e,t),f=ye(p),m=a[u?"floating"===h?"reference":"floating":h],g=_e(await o.getClippingRect({element:null==(i=await(null==o.isElement?void 0:o.isElement(m)))||i?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),v="floating"===h?{x:s,y:n,width:r.floating.width,height:r.floating.height}:r.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),y=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},_=_e(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-_.top+f.top)/y.y,bottom:(_.bottom-g.bottom+f.bottom)/y.y,left:(g.left-_.left+f.left)/y.x,right:(_.right-g.right+f.right)/y.x}}function $e(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Se(t){return Jt.some(e=>t[e]>=0)}const ke=new Set(["left","top"]);function Ce(){return"undefined"!=typeof window}function Ee(t){return Re(t)?(t.nodeName||"").toLowerCase():"#document"}function Pe(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Te(t){var e;return null==(e=(Re(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Re(t){return!!Ce()&&(t instanceof Node||t instanceof Pe(t).Node)}function Oe(t){return!!Ce()&&(t instanceof Element||t instanceof Pe(t).Element)}function Le(t){return!!Ce()&&(t instanceof HTMLElement||t instanceof Pe(t).HTMLElement)}function Ve(t){return!(!Ce()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Pe(t).ShadowRoot)}const Ne=new Set(["inline","contents"]);function Ae(t){const{overflow:e,overflowX:i,overflowY:s,display:n}=Ze(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+i)&&!Ne.has(n)}const ze=new Set(["table","td","th"]);function Ue(t){return ze.has(Ee(t))}const Me=[":popover-open",":modal"];function De(t){return Me.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const We=["transform","translate","scale","rotate","perspective"],Be=["transform","translate","scale","rotate","perspective","filter"],Ie=["paint","layout","strict","content"];function Fe(t){const e=He(),i=Oe(t)?Ze(t):t;return We.some(t=>!!i[t]&&"none"!==i[t])||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||Be.some(t=>(i.willChange||"").includes(t))||Ie.some(t=>(i.contain||"").includes(t))}function He(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const je=new Set(["html","body","#document"]);function qe(t){return je.has(Ee(t))}function Ze(t){return Pe(t).getComputedStyle(t)}function Je(t){return Oe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xe(t){if("html"===Ee(t))return t;const e=t.assignedSlot||t.parentNode||Ve(t)&&t.host||Te(t);return Ve(e)?e.host:e}function Ye(t){const e=Xe(t);return qe(e)?t.ownerDocument?t.ownerDocument.body:t.body:Le(e)&&Ae(e)?e:Ye(e)}function Ge(t,e,i){var s;void 0===e&&(e=[]),void 0===i&&(i=!0);const n=Ye(t),o=n===(null==(s=t.ownerDocument)?void 0:s.body),r=Pe(n);if(o){const t=Ke(r);return e.concat(r,r.visualViewport||[],Ae(n)?n:[],t&&i?Ge(t):[])}return e.concat(n,Ge(n,[],i))}function Ke(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qe(t){const e=Ze(t);let i=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const n=Le(t),o=n?t.offsetWidth:i,r=n?t.offsetHeight:s,a=Gt(i)!==o||Gt(s)!==r;return a&&(i=o,s=r),{width:i,height:s,$:a}}function ti(t){return Oe(t)?t:t.contextElement}function ei(t){const e=ti(t);if(!Le(e))return Qt(1);const i=e.getBoundingClientRect(),{width:s,height:n,$:o}=Qe(e);let r=(o?Gt(i.width):i.width)/s,a=(o?Gt(i.height):i.height)/n;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const ii=Qt(0);function si(t){const e=Pe(t);return He()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ii}function ni(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1);const n=t.getBoundingClientRect(),o=ti(t);let r=Qt(1);e&&(s?Oe(s)&&(r=ei(s)):r=ei(t));const a=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Pe(t))&&e}(o,i,s)?si(o):Qt(0);let l=(n.left+a.x)/r.x,d=(n.top+a.y)/r.y,c=n.width/r.x,h=n.height/r.y;if(o){const t=Pe(o),e=s&&Oe(s)?Pe(s):s;let i=t,n=Ke(i);for(;n&&s&&e!==i;){const t=ei(n),e=n.getBoundingClientRect(),s=Ze(n),o=e.left+(n.clientLeft+parseFloat(s.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(s.paddingTop))*t.y;l*=t.x,d*=t.y,c*=t.x,h*=t.y,l+=o,d+=r,i=Pe(n),n=Ke(i)}}return _e({width:c,height:h,x:l,y:d})}function oi(t,e){const i=Je(t).scrollLeft;return e?e.left+i:ni(Te(t)).left+i}function ri(t,e){const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-oi(t,i),y:i.top+e.scrollTop}}const ai=new Set(["absolute","fixed"]);function li(t,e,i){let s;if("viewport"===e)s=function(t,e){const i=Pe(t),s=Te(t),n=i.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(n){o=n.width,r=n.height;const t=He();(!t||t&&"fixed"===e)&&(a=n.offsetLeft,l=n.offsetTop)}const d=oi(s);if(d<=0){const t=s.ownerDocument,e=t.body,i=getComputedStyle(e),n="CSS1Compat"===t.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,r=Math.abs(s.clientWidth-e.clientWidth-n);r<=25&&(o-=r)}else d<=25&&(o+=d);return{width:o,height:r,x:a,y:l}}(t,i);else if("document"===e)s=function(t){const e=Te(t),i=Je(t),s=t.ownerDocument.body,n=Yt(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),o=Yt(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let r=-i.scrollLeft+oi(t);const a=-i.scrollTop;return"rtl"===Ze(s).direction&&(r+=Yt(e.clientWidth,s.clientWidth)-n),{width:n,height:o,x:r,y:a}}(Te(t));else if(Oe(e))s=function(t,e){const i=ni(t,!0,"fixed"===e),s=i.top+t.clientTop,n=i.left+t.clientLeft,o=Le(t)?ei(t):Qt(1);return{width:t.clientWidth*o.x,height:t.clientHeight*o.y,x:n*o.x,y:s*o.y}}(e,i);else{const i=si(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return _e(s)}function di(t,e){const i=Xe(t);return!(i===e||!Oe(i)||qe(i))&&("fixed"===Ze(i).position||di(i,e))}function ci(t,e,i){const s=Le(e),n=Te(e),o="fixed"===i,r=ni(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Qt(0);function d(){l.x=oi(n)}if(s||!s&&!o)if(("body"!==Ee(e)||Ae(n))&&(a=Je(e)),s){const t=ni(e,!0,o,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else n&&d();o&&!s&&n&&d();const c=!n||s||o?Qt(0):ri(n,a);return{x:r.left+a.scrollLeft-l.x-c.x,y:r.top+a.scrollTop-l.y-c.y,width:r.width,height:r.height}}function hi(t){return"static"===Ze(t).position}function ui(t,e){if(!Le(t)||"fixed"===Ze(t).position)return null;if(e)return e(t);let i=t.offsetParent;return Te(t)===i&&(i=i.ownerDocument.body),i}function pi(t,e){const i=Pe(t);if(De(t))return i;if(!Le(t)){let e=Xe(t);for(;e&&!qe(e);){if(Oe(e)&&!hi(e))return e;e=Xe(e)}return i}let s=ui(t,e);for(;s&&Ue(s)&&hi(s);)s=ui(s,e);return s&&qe(s)&&hi(s)&&!Fe(s)?i:s||function(t){let e=Xe(t);for(;Le(e)&&!qe(e);){if(Fe(e))return e;if(De(e))return null;e=Xe(e)}return null}(t)||i}const fi={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:s,strategy:n}=t;const o="fixed"===n,r=Te(s),a=!!e&&De(e.floating);if(s===r||a&&o)return i;let l={scrollLeft:0,scrollTop:0},d=Qt(1);const c=Qt(0),h=Le(s);if((h||!h&&!o)&&(("body"!==Ee(s)||Ae(r))&&(l=Je(s)),Le(s))){const t=ni(s);d=ei(s),c.x=t.x+s.clientLeft,c.y=t.y+s.clientTop}const u=!r||h||o?Qt(0):ri(r,l);return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-l.scrollLeft*d.x+c.x+u.x,y:i.y*d.y-l.scrollTop*d.y+c.y+u.y}},getDocumentElement:Te,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:s,strategy:n}=t;const o=[..."clippingAncestors"===i?De(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let s=Ge(t,[],!1).filter(t=>Oe(t)&&"body"!==Ee(t)),n=null;const o="fixed"===Ze(t).position;let r=o?Xe(t):t;for(;Oe(r)&&!qe(r);){const e=Ze(r),i=Fe(r);i||"fixed"!==e.position||(n=null),(o?!i&&!n:!i&&"static"===e.position&&n&&ai.has(n.position)||Ae(r)&&!i&&di(t,r))?s=s.filter(t=>t!==r):n=e,r=Xe(r)}return e.set(t,s),s}(e,this._c):[].concat(i),s],r=o[0],a=o.reduce((t,i)=>{const s=li(e,i,n);return t.top=Yt(s.top,t.top),t.right=Xt(s.right,t.right),t.bottom=Xt(s.bottom,t.bottom),t.left=Yt(s.left,t.left),t},li(e,r,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:pi,getElementRects:async function(t){const e=this.getOffsetParent||pi,i=this.getDimensions,s=await i(t.floating);return{reference:ci(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=Qe(t);return{width:e,height:i}},getScale:ei,isElement:Oe,isRTL:function(t){return"rtl"===Ze(t).direction}};function mi(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function gi(t,e,i,s){void 0===s&&(s={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=s,d=ti(t),c=n||o?[...d?Ge(d):[],...Ge(e)]:[];c.forEach(t=>{n&&t.addEventListener("scroll",i,{passive:!0}),o&&t.addEventListener("resize",i)});const h=d&&a?function(t,e){let i,s=null;const n=Te(t);function o(){var t;clearTimeout(i),null==(t=s)||t.disconnect(),s=null}return function r(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const d=t.getBoundingClientRect(),{left:c,top:h,width:u,height:p}=d;if(a||e(),!u||!p)return;const f={rootMargin:-Kt(h)+"px "+-Kt(n.clientWidth-(c+u))+"px "+-Kt(n.clientHeight-(h+p))+"px "+-Kt(c)+"px",threshold:Yt(0,Xt(1,l))||1};let m=!0;function g(e){const s=e[0].intersectionRatio;if(s!==l){if(!m)return r();s?r(!1,s):i=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==s||mi(d,t.getBoundingClientRect())||r(),m=!1}try{s=new IntersectionObserver(g,{...f,root:n.ownerDocument})}catch(t){s=new IntersectionObserver(g,f)}s.observe(t)}(!0),o}(d,i):null;let u,p=-1,f=null;r&&(f=new ResizeObserver(t=>{let[s]=t;s&&s.target===d&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=f)||t.observe(e)})),i()}),d&&!l&&f.observe(d),f.observe(e));let m=l?ni(t):null;return l&&function e(){const s=ni(t);m&&!mi(m,s)&&i();m=s,u=requestAnimationFrame(e)}(),i(),()=>{var t;c.forEach(t=>{n&&t.removeEventListener("scroll",i),o&&t.removeEventListener("resize",i)}),null==h||h(),null==(t=f)||t.disconnect(),f=null,l&&cancelAnimationFrame(u)}}const vi=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,s;const{x:n,y:o,placement:r,middlewareData:a}=e,l=await async function(t,e){const{placement:i,platform:s,elements:n}=t,o=await(null==s.isRTL?void 0:s.isRTL(n.floating)),r=ne(i),a=oe(i),l="y"===de(i),d=ke.has(r)?-1:1,c=o&&l?-1:1,h=se(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*c,y:u*d}:{x:u*d,y:p*c}}(e,t);return r===(null==(i=a.offset)?void 0:i.placement)&&null!=(s=a.arrow)&&s.alignmentOffset?{}:{x:n+l.x,y:o+l.y,data:{...l,placement:r}}}}},bi=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:s,placement:n}=e,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=se(t,e),d={x:i,y:s},c=await xe(e,l),h=de(ne(n)),u=re(h);let p=d[u],f=d[h];if(o){const t="y"===u?"bottom":"right";p=ie(p+c["y"===u?"top":"left"],p,p-c[t])}if(r){const t="y"===h?"bottom":"right";f=ie(f+c["y"===h?"top":"left"],f,f-c[t])}const m=a.fn({...e,[u]:p,[h]:f});return{...m,data:{x:m.x-i,y:m.y-s,enabled:{[u]:o,[h]:r}}}}}},yi=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,s;const{placement:n,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=se(t,e);if(null!=(i=o.arrow)&&i.alignmentOffset)return{};const v=ne(n),b=de(a),y=ne(a)===a,_=await(null==l.isRTL?void 0:l.isRTL(d.floating)),w=u||(y||!m?[be(a)]:function(t){const e=be(t);return[ue(t),e,ue(e)]}(a)),x="none"!==f;!u&&x&&w.push(...ve(a,m,f,_));const $=[a,...w],S=await xe(e,g),k=[];let C=(null==(s=o.flip)?void 0:s.overflows)||[];if(c&&k.push(S[v]),h){const t=he(n,r,_);k.push(S[t[0]],S[t[1]])}if(C=[...C,{placement:n,overflows:k}],!k.every(t=>t<=0)){var E,P;const t=((null==(E=o.flip)?void 0:E.index)||0)+1,e=$[t];if(e){if(!("alignment"===h&&b!==de(e))||C.every(t=>de(t.placement)!==b||t.overflows[0]>0))return{data:{index:t,overflows:C},reset:{placement:e}}}let i=null==(P=C.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:P.placement;if(!i)switch(p){case"bestFit":{var T;const t=null==(T=C.filter(t=>{if(x){const e=de(t.placement);return e===b||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:T[0];t&&(i=t);break}case"initialPlacement":i=a}if(n!==i)return{reset:{placement:i}}}return{}}}},_i=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:i}=e,{strategy:s="referenceHidden",...n}=se(t,e);switch(s){case"referenceHidden":{const t=$e(await xe(e,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:Se(t)}}}case"escaped":{const t=$e(await xe(e,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:Se(t)}}}default:return{}}}}},wi=(t,e,i)=>{const s=new Map,n={platform:fi,...i},o={...n.platform,_c:s};return(async(t,e,i)=>{const{placement:s="bottom",strategy:n="absolute",middleware:o=[],platform:r}=i,a=o.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(e));let d=await r.getElementRects({reference:t,floating:e,strategy:n}),{x:c,y:h}=we(d,s,l),u=s,p={},f=0;for(let i=0;i<a.length;i++){const{name:o,fn:m}=a[i],{x:g,y:v,data:b,reset:y}=await m({x:c,y:h,initialPlacement:s,placement:u,strategy:n,middlewareData:p,rects:d,platform:r,elements:{reference:t,floating:e}});c=null!=g?g:c,h=null!=v?v:h,p={...p,[o]:{...p[o],...b}},y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(d=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:n}):y.rects),({x:c,y:h}=we(d,u,l))),i=-1)}return{x:c,y:h,placement:u,strategy:n,middlewareData:p}})(t,e,{...n,platform:o})};var xi,$i=r`:host{display:contents}.tooltip-placeholder{display:inline-block;max-width:100%}.tooltip{word-wrap:break-word;background-color:var(--sgds-surface-fixed-dark);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 2px 0 rgba(0,0,0,.12),0 8px 16px 0 rgba(0,0,0,.14);color:var(--sgds-color-fixed-light);display:block;font-size:var(--sgds-font-size-14);line-break:auto;max-width:var(--sgds-dimension-320);padding:var(--sgds-padding-xs) var(--sgds-padding-sm);text-align:left;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;z-index:var(--sgds-z-index-overlay)}div{max-width:fit-content}`;class Si extends zt{constructor(){super(...arguments),this._myTooltip=Ht(),this._tooltipBubble=Ht(),this.content="",this.placement="top",this.trigger="hover focus",this.open=!1,this._handleClickOutOfElement=t=>{this.open&&(t.composedPath().includes(this)||this.hide())}}connectedCallback(){super.connectedCallback(),this.trigger.includes("click")&&document.addEventListener("click",this._handleClickOutOfElement)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(t){super.firstUpdated(t),this._tooltipTargetElements.forEach(t=>{t.setAttribute("data-sgds-tooltip",this.content),this.trigger.includes("hover")&&(t.addEventListener("mouseenter",()=>this.show()),t.addEventListener("mouseleave",()=>this.hide())),this.trigger.includes("focus")&&(t.addEventListener("focus",()=>this.show()),t.addEventListener("blur",()=>this.hide())),"click"===this.trigger&&t.addEventListener("click",()=>this.toggle())})}_handleSlotChange(){this._tooltipTargetElements.forEach(t=>t.setAttribute("data-sgds-tooltip",this.content))}async updateFloatingPosition(){if(!this._myTooltip.value||!this._tooltipBubble.value)return;const{x:t,y:e,placement:i,strategy:s,middlewareData:n}=await wi(this._tooltipTargetElements[0],this._tooltipBubble.value,{strategy:"fixed",placement:this.placement,middleware:[vi(8),yi(),bi(),_i()]});this._tooltipBubble.value.setAttribute("data-placement",i),Object.assign(this._tooltipBubble.value.style,{position:s,left:`${t}px`,top:`${e}px`});const{referenceHidden:o,escaped:r}=n.hide||{};this._tooltipBubble.value.style.visibility=o||r?"hidden":"visible"}async show(){this.open||(this.open=!0,this.emit("sgds-show"),await this.updateComplete,await this.updateFloatingPosition(),this._myTooltip.value&&this._tooltipBubble.value&&(this._cleanupAutoUpdate=gi(this._tooltipTargetElements[0],this._tooltipBubble.value,()=>this.updateFloatingPosition())),this.emit("sgds-after-show"))}hide(){this.open&&(this.emit("sgds-hide"),this.open=!1,this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0),setTimeout(()=>this.emit("sgds-after-hide"),0))}toggle(){this.open?this.hide():this.show()}render(){return Q`
|
|
62
|
+
*/const Ht=()=>new jt;class jt{}const qt=new WeakMap;const Zt=Rt(class extends Ft{render(t){return it}update(t,[e]){const i=e!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=e,this._context=t.options?.host,this._updateRefValue(this._element=t.element)),it}_updateRefValue(t){if(this.isConnected||(t=void 0),"function"==typeof this._ref){const e=this._context??globalThis;let i=qt.get(e);void 0===i&&(i=new WeakMap,qt.set(e,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,t),void 0!==t&&this._ref.call(this._context,t)}else this._ref.value=t}get _lastElementForRef(){return"function"==typeof this._ref?qt.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Jt=["top","right","bottom","left"],Xt=Math.min,Yt=Math.max,Gt=Math.round,Kt=Math.floor,Qt=t=>({x:t,y:t}),te={left:"right",right:"left",bottom:"top",top:"bottom"},ee={start:"end",end:"start"};function ie(t,e,i){return Yt(t,Xt(e,i))}function se(t,e){return"function"==typeof t?t(e):t}function ne(t){return t.split("-")[0]}function oe(t){return t.split("-")[1]}function re(t){return"x"===t?"y":"x"}function ae(t){return"y"===t?"height":"width"}const le=new Set(["top","bottom"]);function de(t){return le.has(ne(t))?"y":"x"}function ce(t){return re(de(t))}function he(t,e,i){void 0===i&&(i=!1);const s=oe(t),n=ce(t),o=ae(n);let r="x"===n?s===(i?"end":"start")?"right":"left":"start"===s?"bottom":"top";return e.reference[o]>e.floating[o]&&(r=be(r)),[r,be(r)]}function ue(t){return t.replace(/start|end/g,t=>ee[t])}const pe=["left","right"],fe=["right","left"],me=["top","bottom"],ge=["bottom","top"];function ve(t,e,i,s){const n=oe(t);let o=function(t,e,i){switch(t){case"top":case"bottom":return i?e?fe:pe:e?pe:fe;case"left":case"right":return e?me:ge;default:return[]}}(ne(t),"start"===i,s);return n&&(o=o.map(t=>t+"-"+n),e&&(o=o.concat(o.map(ue)))),o}function be(t){return t.replace(/left|right|bottom|top/g,t=>te[t])}function ye(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function _e(t){const{x:e,y:i,width:s,height:n}=t;return{width:s,height:n,top:i,left:e,right:e+s,bottom:i+n,x:e,y:i}}function we(t,e,i){let{reference:s,floating:n}=t;const o=de(e),r=ce(e),a=ae(r),l=ne(e),d="y"===o,c=s.x+s.width/2-n.width/2,h=s.y+s.height/2-n.height/2,u=s[a]/2-n[a]/2;let p;switch(l){case"top":p={x:c,y:s.y-n.height};break;case"bottom":p={x:c,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:h};break;case"left":p={x:s.x-n.width,y:h};break;default:p={x:s.x,y:s.y}}switch(oe(e)){case"start":p[r]-=u*(i&&d?-1:1);break;case"end":p[r]+=u*(i&&d?-1:1)}return p}async function xe(t,e){var i;void 0===e&&(e={});const{x:s,y:n,platform:o,rects:r,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:u=!1,padding:p=0}=se(e,t),f=ye(p),m=a[u?"floating"===h?"reference":"floating":h],g=_e(await o.getClippingRect({element:null==(i=await(null==o.isElement?void 0:o.isElement(m)))||i?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),v="floating"===h?{x:s,y:n,width:r.floating.width,height:r.floating.height}:r.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),y=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},_=_e(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-_.top+f.top)/y.y,bottom:(_.bottom-g.bottom+f.bottom)/y.y,left:(g.left-_.left+f.left)/y.x,right:(_.right-g.right+f.right)/y.x}}function $e(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Se(t){return Jt.some(e=>t[e]>=0)}const ke=new Set(["left","top"]);function Ce(){return"undefined"!=typeof window}function Ee(t){return Re(t)?(t.nodeName||"").toLowerCase():"#document"}function Pe(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Te(t){var e;return null==(e=(Re(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Re(t){return!!Ce()&&(t instanceof Node||t instanceof Pe(t).Node)}function Oe(t){return!!Ce()&&(t instanceof Element||t instanceof Pe(t).Element)}function Le(t){return!!Ce()&&(t instanceof HTMLElement||t instanceof Pe(t).HTMLElement)}function Ve(t){return!(!Ce()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Pe(t).ShadowRoot)}const Ne=new Set(["inline","contents"]);function Ae(t){const{overflow:e,overflowX:i,overflowY:s,display:n}=Ze(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+i)&&!Ne.has(n)}const Ue=new Set(["table","td","th"]);function ze(t){return Ue.has(Ee(t))}const Me=[":popover-open",":modal"];function De(t){return Me.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const We=["transform","translate","scale","rotate","perspective"],Be=["transform","translate","scale","rotate","perspective","filter"],Ie=["paint","layout","strict","content"];function Fe(t){const e=He(),i=Oe(t)?Ze(t):t;return We.some(t=>!!i[t]&&"none"!==i[t])||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||Be.some(t=>(i.willChange||"").includes(t))||Ie.some(t=>(i.contain||"").includes(t))}function He(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const je=new Set(["html","body","#document"]);function qe(t){return je.has(Ee(t))}function Ze(t){return Pe(t).getComputedStyle(t)}function Je(t){return Oe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xe(t){if("html"===Ee(t))return t;const e=t.assignedSlot||t.parentNode||Ve(t)&&t.host||Te(t);return Ve(e)?e.host:e}function Ye(t){const e=Xe(t);return qe(e)?t.ownerDocument?t.ownerDocument.body:t.body:Le(e)&&Ae(e)?e:Ye(e)}function Ge(t,e,i){var s;void 0===e&&(e=[]),void 0===i&&(i=!0);const n=Ye(t),o=n===(null==(s=t.ownerDocument)?void 0:s.body),r=Pe(n);if(o){const t=Ke(r);return e.concat(r,r.visualViewport||[],Ae(n)?n:[],t&&i?Ge(t):[])}return e.concat(n,Ge(n,[],i))}function Ke(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qe(t){const e=Ze(t);let i=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const n=Le(t),o=n?t.offsetWidth:i,r=n?t.offsetHeight:s,a=Gt(i)!==o||Gt(s)!==r;return a&&(i=o,s=r),{width:i,height:s,$:a}}function ti(t){return Oe(t)?t:t.contextElement}function ei(t){const e=ti(t);if(!Le(e))return Qt(1);const i=e.getBoundingClientRect(),{width:s,height:n,$:o}=Qe(e);let r=(o?Gt(i.width):i.width)/s,a=(o?Gt(i.height):i.height)/n;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const ii=Qt(0);function si(t){const e=Pe(t);return He()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ii}function ni(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1);const n=t.getBoundingClientRect(),o=ti(t);let r=Qt(1);e&&(s?Oe(s)&&(r=ei(s)):r=ei(t));const a=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Pe(t))&&e}(o,i,s)?si(o):Qt(0);let l=(n.left+a.x)/r.x,d=(n.top+a.y)/r.y,c=n.width/r.x,h=n.height/r.y;if(o){const t=Pe(o),e=s&&Oe(s)?Pe(s):s;let i=t,n=Ke(i);for(;n&&s&&e!==i;){const t=ei(n),e=n.getBoundingClientRect(),s=Ze(n),o=e.left+(n.clientLeft+parseFloat(s.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(s.paddingTop))*t.y;l*=t.x,d*=t.y,c*=t.x,h*=t.y,l+=o,d+=r,i=Pe(n),n=Ke(i)}}return _e({width:c,height:h,x:l,y:d})}function oi(t,e){const i=Je(t).scrollLeft;return e?e.left+i:ni(Te(t)).left+i}function ri(t,e){const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-oi(t,i),y:i.top+e.scrollTop}}const ai=new Set(["absolute","fixed"]);function li(t,e,i){let s;if("viewport"===e)s=function(t,e){const i=Pe(t),s=Te(t),n=i.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(n){o=n.width,r=n.height;const t=He();(!t||t&&"fixed"===e)&&(a=n.offsetLeft,l=n.offsetTop)}const d=oi(s);if(d<=0){const t=s.ownerDocument,e=t.body,i=getComputedStyle(e),n="CSS1Compat"===t.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,r=Math.abs(s.clientWidth-e.clientWidth-n);r<=25&&(o-=r)}else d<=25&&(o+=d);return{width:o,height:r,x:a,y:l}}(t,i);else if("document"===e)s=function(t){const e=Te(t),i=Je(t),s=t.ownerDocument.body,n=Yt(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),o=Yt(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let r=-i.scrollLeft+oi(t);const a=-i.scrollTop;return"rtl"===Ze(s).direction&&(r+=Yt(e.clientWidth,s.clientWidth)-n),{width:n,height:o,x:r,y:a}}(Te(t));else if(Oe(e))s=function(t,e){const i=ni(t,!0,"fixed"===e),s=i.top+t.clientTop,n=i.left+t.clientLeft,o=Le(t)?ei(t):Qt(1);return{width:t.clientWidth*o.x,height:t.clientHeight*o.y,x:n*o.x,y:s*o.y}}(e,i);else{const i=si(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return _e(s)}function di(t,e){const i=Xe(t);return!(i===e||!Oe(i)||qe(i))&&("fixed"===Ze(i).position||di(i,e))}function ci(t,e,i){const s=Le(e),n=Te(e),o="fixed"===i,r=ni(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Qt(0);function d(){l.x=oi(n)}if(s||!s&&!o)if(("body"!==Ee(e)||Ae(n))&&(a=Je(e)),s){const t=ni(e,!0,o,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else n&&d();o&&!s&&n&&d();const c=!n||s||o?Qt(0):ri(n,a);return{x:r.left+a.scrollLeft-l.x-c.x,y:r.top+a.scrollTop-l.y-c.y,width:r.width,height:r.height}}function hi(t){return"static"===Ze(t).position}function ui(t,e){if(!Le(t)||"fixed"===Ze(t).position)return null;if(e)return e(t);let i=t.offsetParent;return Te(t)===i&&(i=i.ownerDocument.body),i}function pi(t,e){const i=Pe(t);if(De(t))return i;if(!Le(t)){let e=Xe(t);for(;e&&!qe(e);){if(Oe(e)&&!hi(e))return e;e=Xe(e)}return i}let s=ui(t,e);for(;s&&ze(s)&&hi(s);)s=ui(s,e);return s&&qe(s)&&hi(s)&&!Fe(s)?i:s||function(t){let e=Xe(t);for(;Le(e)&&!qe(e);){if(Fe(e))return e;if(De(e))return null;e=Xe(e)}return null}(t)||i}const fi={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:s,strategy:n}=t;const o="fixed"===n,r=Te(s),a=!!e&&De(e.floating);if(s===r||a&&o)return i;let l={scrollLeft:0,scrollTop:0},d=Qt(1);const c=Qt(0),h=Le(s);if((h||!h&&!o)&&(("body"!==Ee(s)||Ae(r))&&(l=Je(s)),Le(s))){const t=ni(s);d=ei(s),c.x=t.x+s.clientLeft,c.y=t.y+s.clientTop}const u=!r||h||o?Qt(0):ri(r,l);return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-l.scrollLeft*d.x+c.x+u.x,y:i.y*d.y-l.scrollTop*d.y+c.y+u.y}},getDocumentElement:Te,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:s,strategy:n}=t;const o=[..."clippingAncestors"===i?De(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let s=Ge(t,[],!1).filter(t=>Oe(t)&&"body"!==Ee(t)),n=null;const o="fixed"===Ze(t).position;let r=o?Xe(t):t;for(;Oe(r)&&!qe(r);){const e=Ze(r),i=Fe(r);i||"fixed"!==e.position||(n=null),(o?!i&&!n:!i&&"static"===e.position&&n&&ai.has(n.position)||Ae(r)&&!i&&di(t,r))?s=s.filter(t=>t!==r):n=e,r=Xe(r)}return e.set(t,s),s}(e,this._c):[].concat(i),s],r=o[0],a=o.reduce((t,i)=>{const s=li(e,i,n);return t.top=Yt(s.top,t.top),t.right=Xt(s.right,t.right),t.bottom=Xt(s.bottom,t.bottom),t.left=Yt(s.left,t.left),t},li(e,r,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:pi,getElementRects:async function(t){const e=this.getOffsetParent||pi,i=this.getDimensions,s=await i(t.floating);return{reference:ci(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=Qe(t);return{width:e,height:i}},getScale:ei,isElement:Oe,isRTL:function(t){return"rtl"===Ze(t).direction}};function mi(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function gi(t,e,i,s){void 0===s&&(s={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=s,d=ti(t),c=n||o?[...d?Ge(d):[],...Ge(e)]:[];c.forEach(t=>{n&&t.addEventListener("scroll",i,{passive:!0}),o&&t.addEventListener("resize",i)});const h=d&&a?function(t,e){let i,s=null;const n=Te(t);function o(){var t;clearTimeout(i),null==(t=s)||t.disconnect(),s=null}return function r(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const d=t.getBoundingClientRect(),{left:c,top:h,width:u,height:p}=d;if(a||e(),!u||!p)return;const f={rootMargin:-Kt(h)+"px "+-Kt(n.clientWidth-(c+u))+"px "+-Kt(n.clientHeight-(h+p))+"px "+-Kt(c)+"px",threshold:Yt(0,Xt(1,l))||1};let m=!0;function g(e){const s=e[0].intersectionRatio;if(s!==l){if(!m)return r();s?r(!1,s):i=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==s||mi(d,t.getBoundingClientRect())||r(),m=!1}try{s=new IntersectionObserver(g,{...f,root:n.ownerDocument})}catch(t){s=new IntersectionObserver(g,f)}s.observe(t)}(!0),o}(d,i):null;let u,p=-1,f=null;r&&(f=new ResizeObserver(t=>{let[s]=t;s&&s.target===d&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=f)||t.observe(e)})),i()}),d&&!l&&f.observe(d),f.observe(e));let m=l?ni(t):null;return l&&function e(){const s=ni(t);m&&!mi(m,s)&&i();m=s,u=requestAnimationFrame(e)}(),i(),()=>{var t;c.forEach(t=>{n&&t.removeEventListener("scroll",i),o&&t.removeEventListener("resize",i)}),null==h||h(),null==(t=f)||t.disconnect(),f=null,l&&cancelAnimationFrame(u)}}const vi=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,s;const{x:n,y:o,placement:r,middlewareData:a}=e,l=await async function(t,e){const{placement:i,platform:s,elements:n}=t,o=await(null==s.isRTL?void 0:s.isRTL(n.floating)),r=ne(i),a=oe(i),l="y"===de(i),d=ke.has(r)?-1:1,c=o&&l?-1:1,h=se(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*c,y:u*d}:{x:u*d,y:p*c}}(e,t);return r===(null==(i=a.offset)?void 0:i.placement)&&null!=(s=a.arrow)&&s.alignmentOffset?{}:{x:n+l.x,y:o+l.y,data:{...l,placement:r}}}}},bi=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:s,placement:n}=e,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=se(t,e),d={x:i,y:s},c=await xe(e,l),h=de(ne(n)),u=re(h);let p=d[u],f=d[h];if(o){const t="y"===u?"bottom":"right";p=ie(p+c["y"===u?"top":"left"],p,p-c[t])}if(r){const t="y"===h?"bottom":"right";f=ie(f+c["y"===h?"top":"left"],f,f-c[t])}const m=a.fn({...e,[u]:p,[h]:f});return{...m,data:{x:m.x-i,y:m.y-s,enabled:{[u]:o,[h]:r}}}}}},yi=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,s;const{placement:n,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=se(t,e);if(null!=(i=o.arrow)&&i.alignmentOffset)return{};const v=ne(n),b=de(a),y=ne(a)===a,_=await(null==l.isRTL?void 0:l.isRTL(d.floating)),w=u||(y||!m?[be(a)]:function(t){const e=be(t);return[ue(t),e,ue(e)]}(a)),x="none"!==f;!u&&x&&w.push(...ve(a,m,f,_));const $=[a,...w],S=await xe(e,g),k=[];let C=(null==(s=o.flip)?void 0:s.overflows)||[];if(c&&k.push(S[v]),h){const t=he(n,r,_);k.push(S[t[0]],S[t[1]])}if(C=[...C,{placement:n,overflows:k}],!k.every(t=>t<=0)){var E,P;const t=((null==(E=o.flip)?void 0:E.index)||0)+1,e=$[t];if(e){if(!("alignment"===h&&b!==de(e))||C.every(t=>de(t.placement)!==b||t.overflows[0]>0))return{data:{index:t,overflows:C},reset:{placement:e}}}let i=null==(P=C.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:P.placement;if(!i)switch(p){case"bestFit":{var T;const t=null==(T=C.filter(t=>{if(x){const e=de(t.placement);return e===b||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:T[0];t&&(i=t);break}case"initialPlacement":i=a}if(n!==i)return{reset:{placement:i}}}return{}}}},_i=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:i}=e,{strategy:s="referenceHidden",...n}=se(t,e);switch(s){case"referenceHidden":{const t=$e(await xe(e,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:Se(t)}}}case"escaped":{const t=$e(await xe(e,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:Se(t)}}}default:return{}}}}},wi=(t,e,i)=>{const s=new Map,n={platform:fi,...i},o={...n.platform,_c:s};return(async(t,e,i)=>{const{placement:s="bottom",strategy:n="absolute",middleware:o=[],platform:r}=i,a=o.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(e));let d=await r.getElementRects({reference:t,floating:e,strategy:n}),{x:c,y:h}=we(d,s,l),u=s,p={},f=0;for(let i=0;i<a.length;i++){const{name:o,fn:m}=a[i],{x:g,y:v,data:b,reset:y}=await m({x:c,y:h,initialPlacement:s,placement:u,strategy:n,middlewareData:p,rects:d,platform:r,elements:{reference:t,floating:e}});c=null!=g?g:c,h=null!=v?v:h,p={...p,[o]:{...p[o],...b}},y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(d=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:n}):y.rects),({x:c,y:h}=we(d,u,l))),i=-1)}return{x:c,y:h,placement:u,strategy:n,middlewareData:p}})(t,e,{...n,platform:o})};var xi,$i=r`:host{display:contents}.tooltip-placeholder{display:inline-block;max-width:100%}.tooltip{word-wrap:break-word;background-color:var(--sgds-surface-fixed-dark);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 2px 0 rgba(0,0,0,.12),0 8px 16px 0 rgba(0,0,0,.14);color:var(--sgds-color-fixed-light);display:block;font-size:var(--sgds-font-size-14);line-break:auto;max-width:var(--sgds-dimension-320);padding:var(--sgds-padding-xs) var(--sgds-padding-sm);text-align:left;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;z-index:var(--sgds-z-index-overlay)}div{max-width:fit-content}`;class Si extends Ut{constructor(){super(...arguments),this._myTooltip=Ht(),this._tooltipBubble=Ht(),this.content="",this.placement="top",this.trigger="hover focus",this.open=!1,this._handleClickOutOfElement=t=>{this.open&&(t.composedPath().includes(this)||this.hide())}}connectedCallback(){super.connectedCallback(),this.trigger.includes("click")&&document.addEventListener("click",this._handleClickOutOfElement)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(t){super.firstUpdated(t),this._tooltipTargetElements.forEach(t=>{t.setAttribute("data-sgds-tooltip",this.content),this.trigger.includes("hover")&&(t.addEventListener("mouseenter",()=>this.show()),t.addEventListener("mouseleave",()=>this.hide())),this.trigger.includes("focus")&&(t.addEventListener("focus",()=>this.show()),t.addEventListener("blur",()=>this.hide())),"click"===this.trigger&&t.addEventListener("click",()=>this.toggle())})}_handleSlotChange(){this._tooltipTargetElements.forEach(t=>t.setAttribute("data-sgds-tooltip",this.content))}async updateFloatingPosition(){if(!this._myTooltip.value||!this._tooltipBubble.value)return;const{x:t,y:e,placement:i,strategy:s,middlewareData:n}=await wi(this._tooltipTargetElements[0],this._tooltipBubble.value,{strategy:"fixed",placement:this.placement,middleware:[vi(8),yi(),bi(),_i()]});this._tooltipBubble.value.setAttribute("data-placement",i),Object.assign(this._tooltipBubble.value.style,{position:s,left:`${t}px`,top:`${e}px`});const{referenceHidden:o,escaped:r}=n.hide||{};this._tooltipBubble.value.style.visibility=o||r?"hidden":"visible"}async show(){this.open||(this.open=!0,this.emit("sgds-show"),await this.updateComplete,await this.updateFloatingPosition(),this._myTooltip.value&&this._tooltipBubble.value&&(this._cleanupAutoUpdate=gi(this._tooltipTargetElements[0],this._tooltipBubble.value,()=>this.updateFloatingPosition())),this.emit("sgds-after-show"))}hide(){this.open&&(this.emit("sgds-hide"),this.open=!1,this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0),setTimeout(()=>this.emit("sgds-after-hide"),0))}toggle(){this.open?this.hide():this.show()}render(){return Q`
|
|
63
63
|
<div ${Zt(this._myTooltip)} class="tooltip-placeholder">
|
|
64
64
|
<slot @slotchange=${()=>this._handleSlotChange()}></slot>
|
|
65
65
|
${this.open?Q`<div ${Zt(this._tooltipBubble)} class="tooltip" role="tooltip">${this.content}</div>`:null}
|
|
66
66
|
</div>
|
|
67
|
-
`}}Si.styles=[...
|
|
67
|
+
`}}Si.styles=[...Ut.styles,$i],t([Ct({type:String})],Si.prototype,"content",void 0),t([Ct({type:String})],Si.prototype,"placement",void 0),t([Ct({type:String})],Si.prototype,"trigger",void 0),t([Et()],Si.prototype,"open",void 0),t([(t,e)=>{const{slot:i,selector:s}=xi??{},n="slot"+(i?`[name=${i}]`:":not([name])");return((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(t,e,{get(){const t=this.renderRoot?.querySelector(n),e=t?.assignedElements(xi)??[];return void 0===s?e:e.filter(t=>t.matches(s))}})}],Si.prototype,"_tooltipTargetElements",void 0);var ki,Ci,Ei=r`: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)}`;function Pi(t){return!!function(t){return!!customElements.get(t)}(t)||(console.error(`Custom element of name : ${t} is not registered. Remember to import the component file for custom element registration`),!1)}class Ti extends Ut{constructor(){super(...arguments),this.size="md",this.tone="default",this._clickHandler=()=>{}}_handleClick(){this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}firstUpdated(t){super.firstUpdated(t),Pi("sgds-icon")}render(){return Q`
|
|
68
68
|
<button class="btn-close" aria-label="Close button" @click=${this._handleClick}>
|
|
69
|
-
<sgds-icon name="cross" size
|
|
69
|
+
<sgds-icon name="cross" size="sm"></sgds-icon>
|
|
70
70
|
</button>
|
|
71
|
-
`}}Ti.styles=[...
|
|
71
|
+
`}}Ti.styles=[...Ut.styles,Ei],t([Ct({type:String,reflect:!0})],Ti.prototype,"size",void 0),t([Ct({type:String,reflect:!0})],Ti.prototype,"tone",void 0);class Ri extends Ut{constructor(){super(...arguments),this.show=!1,this.variant="primary",this.outlined=!1,this.dismissible=!1,this.fullWidth=!1,this.truncated=!1,this.text=""}close(){this.show=!1}_handleShowChange(){if(this.show){if(this.emit("sgds-show",{cancelable:!0}).defaultPrevented)return void(this.show=!1);this.emit("sgds-after-show")}else{if(this.emit("sgds-hide",{cancelable:!0}).defaultPrevented)return void(this.show=!0);this.emit("sgds-after-hide")}}_handleTruncation(){const t=this.shadowRoot.querySelector(".badge"),e=this.shadowRoot.querySelector(".badge-label");if(t&&e){const i=e.getBoundingClientRect().height,s=t.getBoundingClientRect().height;this.truncated=i>s}}_handleLabelSlotChange(t){this.text=function(t){if(!t)return"";const e=t.assignedNodes({flatten:!0});let i="";return[...e].forEach(t=>{t.nodeType===Node.TEXT_NODE&&(i+=t.textContent.trim())}),i}(t.target)}_renderBadge(){const t=this.outlined||"warning"===this.variant||"white"===this.variant;return Q`<div
|
|
72
72
|
class="
|
|
73
73
|
${Lt({"badge-dismissible":this.dismissible,badge:!0,outlined:this.outlined,truncated:this.truncated,"full-width":this.fullWidth})}"
|
|
74
74
|
aria-hidden=${this.show?"false":"true"}
|
|
@@ -87,5 +87,5 @@ window.ShadyDOM?.inUse&&!0===window.ShadyDOM?.noPatch&&window.ShadyDOM.wrap;cons
|
|
|
87
87
|
></sgds-close-button>`:it}
|
|
88
88
|
</div>`}render(){return this.dismissible&&this.show||!this.dismissible?this.truncated?Q`<sgds-tooltip content=${this.text} @sgds-hide=${t=>t.stopPropagation()}
|
|
89
89
|
>${this._renderBadge()}</sgds-tooltip
|
|
90
|
-
>`:this._renderBadge():it}}Ri.styles=[...
|
|
90
|
+
>`:this._renderBadge():it}}Ri.styles=[...Ut.styles,Nt],Ri.dependencies={"sgds-close-button":Ti,"sgds-tooltip":Si},t([Ct({type:Boolean,reflect:!0})],Ri.prototype,"show",void 0),t([Ct({reflect:!0})],Ri.prototype,"variant",void 0),t([Ct({type:Boolean,reflect:!0})],Ri.prototype,"outlined",void 0),t([Ct({type:Boolean,reflect:!0})],Ri.prototype,"dismissible",void 0),t([Ct({type:Boolean,reflect:!0})],Ri.prototype,"fullWidth",void 0),t([Et()],Ri.prototype,"truncated",void 0),t([Et()],Ri.prototype,"text",void 0),t([Vt("show")],Ri.prototype,"_handleShowChange",null),t([Vt("text")],Ri.prototype,"_handleTruncation",null),ki="sgds-badge",Ci=Ri,customElements.get(ki)||customElements.define(ki,Ci)});
|
|
91
91
|
//# sourceMappingURL=index.umd.min.js.map
|