kanto-ds 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -10
- package/dist/cdn/kanto.min.js +887 -234
- package/dist/chunks/{index-TWJzttLX.js → index-BEWmAE0T.js} +21 -7
- package/dist/chunks/index-BEWmAE0T.js.map +1 -0
- package/dist/chunks/{kt-calendar-CtwOby1R.js → kt-calendar-D72xa8qr.js} +3 -3
- package/dist/chunks/{kt-calendar-CtwOby1R.js.map → kt-calendar-D72xa8qr.js.map} +1 -1
- package/dist/chunks/{kt-element-T0VbIBNp.js → kt-element-COgh6Yr1.js} +2 -2
- package/dist/chunks/{kt-element-T0VbIBNp.js.map → kt-element-COgh6Yr1.js.map} +1 -1
- package/dist/chunks/numbers-QyecMiSJ.js +9 -0
- package/dist/chunks/numbers-QyecMiSJ.js.map +1 -0
- package/dist/chunks/{segmented-field-BBXR4XFL.js → segmented-field-BCjCGF4I.js} +2 -2
- package/dist/chunks/{segmented-field-BBXR4XFL.js.map → segmented-field-BCjCGF4I.js.map} +1 -1
- package/dist/chunks/{typed-date-CPAUNHzr.js → typed-date-Z3vcUJbb.js} +2 -2
- package/dist/chunks/{typed-date-CPAUNHzr.js.map → typed-date-Z3vcUJbb.js.map} +1 -1
- package/dist/components/core/kt-avatar/kt-avatar.js +2 -2
- package/dist/components/core/kt-badge/kt-badge.js +2 -2
- package/dist/components/core/kt-button/kt-button.js +1 -1
- package/dist/components/core/kt-card/kt-card.js +1 -1
- package/dist/components/core/kt-code/kt-code.js +2 -2
- package/dist/components/core/kt-icon/kt-icon.js +1 -1
- package/dist/components/core/kt-kbd/kt-kbd.js +1 -1
- package/dist/components/core/kt-split-button/kt-split-button.js +2 -2
- package/dist/components/data/kt-chart/kt-chart.js +2 -2
- package/dist/components/data/kt-meter/kt-meter.js +1 -1
- package/dist/components/data/kt-pagination/kt-pagination.js +2 -2
- package/dist/components/data/kt-stat/kt-stat.js +1 -1
- package/dist/components/data/kt-table/kt-table.js +2 -2
- package/dist/components/data/kt-timeline/kt-timeline.js +1 -1
- package/dist/components/feedback/kt-alert/kt-alert.js +2 -2
- package/dist/components/feedback/kt-empty-state/kt-empty-state.js +1 -1
- package/dist/components/feedback/kt-progress-bar/kt-progress-bar.js +1 -1
- package/dist/components/feedback/kt-skeleton/kt-skeleton.js +1 -1
- package/dist/components/feedback/kt-toast/kt-toast.js +2 -2
- package/dist/components/feedback/kt-toast-container/kt-toast-container.js +1 -1
- package/dist/components/feedback/kt-tooltip/kt-tooltip.js +1 -1
- package/dist/components/forms/kt-calendar/kt-calendar.js +3 -3
- package/dist/components/forms/kt-checkbox/kt-checkbox.js +2 -2
- package/dist/components/forms/kt-date-input/kt-date-input.js +5 -5
- package/dist/components/forms/kt-date-picker/kt-date-picker.js +4 -4
- package/dist/components/forms/kt-drag-drop/kt-drag-drop.js +2 -2
- package/dist/components/forms/kt-form/kt-form.js +2 -2
- package/dist/components/forms/kt-input/kt-input.js +2 -2
- package/dist/components/forms/kt-input-menu/kt-input-menu.js +2 -2
- package/dist/components/forms/kt-label-input/kt-label-input.js +1 -1
- package/dist/components/forms/kt-multi-select/kt-multi-select.js +2 -2
- package/dist/components/forms/kt-number-input/kt-number-input.d.ts +89 -0
- package/dist/components/forms/kt-number-input/kt-number-input.js +350 -0
- package/dist/components/forms/kt-number-input/kt-number-input.js.map +1 -0
- package/dist/components/forms/kt-radio-group/kt-radio-group.js +2 -2
- package/dist/components/forms/kt-select/kt-select.js +2 -2
- package/dist/components/forms/kt-slider/kt-slider.d.ts +69 -0
- package/dist/components/forms/kt-slider/kt-slider.js +252 -0
- package/dist/components/forms/kt-slider/kt-slider.js.map +1 -0
- package/dist/components/forms/kt-textarea/kt-textarea.js +2 -2
- package/dist/components/forms/kt-time-input/kt-time-input.js +3 -3
- package/dist/components/forms/kt-toggle/kt-toggle.js +1 -1
- package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.js +2 -2
- package/dist/components/navigation/kt-header/kt-header.js +2 -2
- package/dist/components/navigation/kt-page-header/kt-page-header.js +1 -1
- package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js +2 -2
- package/dist/components/navigation/kt-steps/kt-steps.d.ts +65 -0
- package/dist/components/navigation/kt-steps/kt-steps.js +244 -0
- package/dist/components/navigation/kt-steps/kt-steps.js.map +1 -0
- package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js +2 -2
- package/dist/components/navigation/kt-tabs/kt-tabs.js +1 -1
- package/dist/components/navigation/kt-toggle-button/kt-toggle-button.js +1 -1
- package/dist/components/navigation/kt-toggle-button-group/kt-toggle-button-group.js +2 -2
- package/dist/components/overlays/kt-collapsible/kt-collapsible.js +1 -1
- package/dist/components/overlays/kt-command-palette/kt-command-palette.d.ts +87 -0
- package/dist/components/overlays/kt-command-palette/kt-command-palette.js +370 -0
- package/dist/components/overlays/kt-command-palette/kt-command-palette.js.map +1 -0
- package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.js +2 -2
- package/dist/components/overlays/kt-dropdown/kt-dropdown.js +2 -2
- package/dist/components/overlays/kt-modal/kt-modal.js +2 -2
- package/dist/components/overlays/kt-side-panel/kt-side-panel.js +2 -2
- package/dist/custom-elements.json +3279 -1754
- package/dist/docs/kt-command-palette.md +99 -0
- package/dist/docs/kt-number-input.md +77 -0
- package/dist/docs/kt-slider.md +76 -0
- package/dist/docs/kt-steps.md +79 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +105 -97
- package/dist/index.js.map +1 -1
- package/dist/internal/command-search.d.ts +27 -0
- package/dist/internal/numbers.d.ts +2 -0
- package/dist/internal/strings.d.ts +14 -0
- package/dist/react/index.d.ts +31 -0
- package/dist/react/index.js +199 -164
- package/dist/react/index.js.map +1 -1
- package/dist/react/jsx.d.ts +27 -1
- package/dist/strings/index.js +1 -1
- package/dist/tokens/base.css +4 -0
- package/dist/vscode.css-custom-data.json +26 -2
- package/dist/vscode.html-custom-data.json +120 -12
- package/dist/vue/index.d.ts +8 -0
- package/dist/vue/index.js +12 -8
- package/dist/vue/index.js.map +1 -1
- package/dist/web-types.json +347 -39
- package/package.json +20 -3
- package/dist/chunks/index-TWJzttLX.js.map +0 -1
package/dist/cdn/kanto.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Io=/'/g,Uo=/"/g,Vo=/^(?:script|style|textarea|title)$/i,Ma=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),d=Ma(1),A=Ma(2),ad=Ma(3),it=Symbol.for("lit-noChange"),l=Symbol.for("lit-nothing"),Ho=new WeakMap,Fe=Ie.createTreeWalker(Ie,129);function No(o,t){if(!Aa(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return qo!==void 0?qo.createHTML(t):t}var jo=(o,t)=>{let e=o.length-1,a=[],r,s=t===2?"<svg>":t===3?"<math>":"",i=yr;for(let p=0;p<e;p++){let c=o[p],u,f,m=-1,x=0;for(;x<c.length&&(i.lastIndex=x,f=i.exec(c),f!==null);)x=i.lastIndex,i===yr?f[1]==="!--"?i=Ko:f[1]!==void 0?i=Fo:f[2]!==void 0?(Vo.test(f[2])&&(r=RegExp("</"+f[2],"g")),i=Ke):f[3]!==void 0&&(i=Ke):i===Ke?f[0]===">"?(i=r??yr,m=-1):f[1]===void 0?m=-2:(m=i.lastIndex-f[2].length,u=f[1],i=f[3]===void 0?Ke:f[3]==='"'?Uo:Io):i===Uo||i===Io?i=Ke:i===Ko||i===Fo?i=yr:(i=Ke,r=void 0);let $=i===Ke&&o[p+1].startsWith("/>")?" ":"";s+=i===yr?c+pi:m>=0?(a.push(u),c.slice(0,m)+Sa+c.slice(m)+ce+$):c+ce+(m===-2?p:$)}return[No(o,s+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),a]},$r=class o{constructor({strings:t,_$litType$:e},a){let r;this.parts=[];let s=0,i=0,p=t.length-1,c=this.parts,[u,f]=jo(t,e);if(this.el=o.createElement(u,a),Fe.currentNode=this.el.content,e===2||e===3){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(r=Fe.nextNode())!==null&&c.length<p;){if(r.nodeType===1){if(r.hasAttributes())for(let m of r.getAttributeNames())if(m.endsWith(Sa)){let x=f[i++],$=r.getAttribute(m).split(ce),M=/([.?@])?(.*)/.exec(x);c.push({type:1,index:s,name:M[2],strings:$,ctor:M[1]==="."?_r:M[1]==="?"?Vr:M[1]==="@"?Nr:He}),r.removeAttribute(m)}else m.startsWith(ce)&&(c.push({type:6,index:s}),r.removeAttribute(m));if(Vo.test(r.tagName)){let m=r.textContent.split(ce),x=m.length-1;if(x>0){r.textContent=Ur?Ur.emptyScript:"";for(let $=0;$<x;$++)r.append(m[$],kr()),Fe.nextNode(),c.push({type:2,index:++s});r.append(m[x],kr())}}}else if(r.nodeType===8)if(r.data===Pa)c.push({type:2,index:s});else{let m=-1;for(;(m=r.data.indexOf(ce,m+1))!==-1;)c.push({type:7,index:s}),m+=ce.length-1}s++}}static createElement(t,e){let a=Ie.createElement("template");return a.innerHTML=t,a}};function Ue(o,t,e=o,a){if(t===it)return t;let r=a!==void 0?e._$Co?.[a]:e._$Cl,s=wr(t)?void 0:t._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),s===void 0?r=void 0:(r=new s(o),r._$AT(o,e,a)),a!==void 0?(e._$Co??=[])[a]=r:e._$Cl=r),r!==void 0&&(t=Ue(o,r._$AS(o,t.values),r,a)),t}var Hr=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:a}=this._$AD,r=(t?.creationScope??Ie).importNode(e,!0);Fe.currentNode=r;let s=Fe.nextNode(),i=0,p=0,c=a[0];for(;c!==void 0;){if(i===c.index){let u;c.type===2?u=new er(s,s.nextSibling,this,t):c.type===1?u=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(u=new jr(s,this,t)),this._$AV.push(u),c=a[++p]}i!==c?.index&&(s=Fe.nextNode(),i++)}return Fe.currentNode=Ie,r}p(t){let e=0;for(let a of this._$AV)a!==void 0&&(a.strings!==void 0?(a._$AI(t,a,e),e+=a.strings.length-2):a._$AI(t[e])),e++}},er=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,a,r){this.type=2,this._$AH=l,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=a,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Ue(this,t,e),wr(t)?t===l||t==null||t===""?(this._$AH!==l&&this._$AR(),this._$AH=l):t!==this._$AH&&t!==it&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):_o(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==l&&wr(this._$AH)?this._$AA.nextSibling.data=t:this.T(Ie.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:a}=t,r=typeof a=="number"?this._$AC(t):(a.el===void 0&&(a.el=$r.createElement(No(a.h,a.h[0]),this.options)),a);if(this._$AH?._$AD===r)this._$AH.p(e);else{let s=new Hr(r,this),i=s.u(this.options);s.p(e),this.T(i),this._$AH=s}}_$AC(t){let e=Ho.get(t.strings);return e===void 0&&Ho.set(t.strings,e=new $r(t)),e}k(t){Aa(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,a,r=0;for(let s of t)r===e.length?e.push(a=new o(this.O(kr()),this.O(kr()),this,this.options)):a=e[r],a._$AI(s),r++;r<e.length&&(this._$AR(a&&a._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let a=zo(t).nextSibling;zo(t).remove(),t=a}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},He=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,a,r,s){this.type=1,this._$AH=l,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=s,a.length>2||a[0]!==""||a[1]!==""?(this._$AH=Array(a.length-1).fill(new String),this.strings=a):this._$AH=l}_$AI(t,e=this,a,r){let s=this.strings,i=!1;if(s===void 0)t=Ue(this,t,e,0),i=!wr(t)||t!==this._$AH&&t!==it,i&&(this._$AH=t);else{let p=t,c,u;for(t=s[0],c=0;c<s.length-1;c++)u=Ue(this,p[a+c],e,c),u===it&&(u=this._$AH[c]),i||=!wr(u)||u!==this._$AH[c],u===l?t=l:t!==l&&(t+=(u??"")+s[c+1]),this._$AH[c]=u}i&&!r&&this.j(t)}j(t){t===l?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},_r=class extends He{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===l?void 0:t}},Vr=class extends He{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==l)}},Nr=class extends He{constructor(t,e,a,r,s){super(t,e,a,r,s),this.type=5}_$AI(t,e=this){if((t=Ue(this,t,e,0)??l)===it)return;let a=this._$AH,r=t===l&&a!==l||t.capture!==a.capture||t.once!==a.once||t.passive!==a.passive,s=t!==l&&(a===l||r);r&&this.element.removeEventListener(this.name,this,a),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},jr=class{constructor(t,e,a){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=a}get _$AU(){return this._$AM._$AU}_$AI(t){Ue(this,t)}},Go={M:Sa,P:ce,A:Pa,C:1,L:jo,R:Hr,D:_o,V:Ue,I:er,H:He,N:Vr,U:Nr,B:_r,F:jr},ci=Ca.litHtmlPolyfillSupport;ci?.($r,er),(Ca.litHtmlVersions??=[]).push("3.3.3");var Wo=(o,t,e)=>{let a=e?.renderBefore??t,r=a._$litPart$;if(r===void 0){let s=e?.renderBefore??null;a._$litPart$=r=new er(t.insertBefore(kr(),s),s,void 0,e??{})}return r._$AI(o),r};var Da=globalThis,$e=class extends pe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Wo(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return it}};$e._$litElement$=!0,$e.finalized=!0,Da.litElementHydrateSupport?.({LitElement:$e});var ui=Da.litElementPolyfillSupport;ui?.({LitElement:$e});(Da.litElementVersions??=[]).push("4.2.2");var fi={attribute:!0,type:String,converter:br,reflect:!1,hasChanged:Ir},hi=(o=fi,t,e)=>{let{kind:a,metadata:r}=e,s=globalThis.litPropertyMetadata.get(r);if(s===void 0&&globalThis.litPropertyMetadata.set(r,s=new Map),a==="setter"&&((o=Object.create(o)).wrapped=!0),s.set(e.name,o),a==="accessor"){let{name:i}=e;return{set(p){let c=t.get.call(this);t.set.call(this,p),this.requestUpdate(i,c,o,!0,p)},init(p){return p!==void 0&&this.C(i,void 0,o,p),p}}}if(a==="setter"){let{name:i}=e;return function(p){let c=this[i];t.call(this,p),this.requestUpdate(i,c,o,!0,p)}}throw Error("Unsupported decorator location: "+a)};function n(o){return(t,e)=>typeof e=="object"?hi(o,t,e):((a,r,s)=>{let i=r.hasOwnProperty(s);return r.constructor.createProperty(s,a),i?Object.getOwnPropertyDescriptor(r,s):void 0})(o,t,e)}function k(o){return n({...o,state:!0,attribute:!1})}var ue=(o,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(o,t,e),e);function T(o,t){return(e,a,r)=>{let s=i=>i.renderRoot?.querySelector(o)??null;if(t){let{get:i,set:p}=typeof a=="object"?e:r??(()=>{let c=Symbol();return{get(){return this[c]},set(u){this[c]=u}}})();return ue(e,a,{get(){let c=i.call(this);return c===void 0&&(c=s(this),(c!==null||this.hasUpdated)&&p.call(this,c)),c}})}return ue(e,a,{get(){return s(this)}})}}var mi;function Gr(o){return(t,e)=>ue(t,e,{get(){return(this.renderRoot??(mi??=document.createDocumentFragment())).querySelectorAll(o)}})}function rr(o){return(t,e)=>{let{slot:a,selector:r}=o??{},s="slot"+(a?`[name=${a}]`:":not([name])");return ue(t,e,{get(){let i=this.renderRoot?.querySelector(s),p=i?.assignedElements(o)??[];return r===void 0?p:p.filter(c=>c.matches(r))}})}}var _t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ar=o=>(...t)=>({_$litDirective$:o,values:t}),Ce=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,a){this._$Ct=t,this._$AM=e,this._$Ci=a}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var w=ar(class extends Ce{constructor(o){if(super(o),o.type!==_t.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(t=>o[t]).join(" ")+" "}update(o,[t]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(let a in t)t[a]&&!this.nt?.has(a)&&this.st.add(a);return this.render(t)}let e=o.element.classList;for(let a of this.st)a in t||(e.remove(a),this.st.delete(a));for(let a in t){let r=!!t[a];r===this.st.has(a)||this.nt?.has(a)||(r?(e.add(a),this.st.add(a)):(e.remove(a),this.st.delete(a)))}return it}});var La=Object.freeze({clear:"Clear",close:"Close",dismiss:"Dismiss",copy:"Copy",copied:"Copied",copyCode:"Copy code",timeRemaining:"Time remaining",remove:o=>o?`Remove ${o}`:"Remove",noOptions:"No options available",noResults:"No results",noActions:"No actions",noData:"No data to display",loading:"Loading\u2026",select:"Select",openList:"Open list",closeList:"Close list",showPassword:"Show password",hidePassword:"Hide password",searchCountry:"Search country or dial code",noCountry:"No country found",countryCode:o=>`Country code: ${o??"none"}`,selectedCount:o=>`${o} selected`,dragAndDrop:"Drag and drop or",browseFiles:"browse your files",recommendedSize:o=>`Recommended image size: ${o}`,selectedFiles:"Selected files",selectDate:"Select a date",selectPeriod:"Select a period",previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose month",chooseYear:"Choose year",required:"This field is required.",selectOption:"Select an option.",selectFile:"Select a file.",checkRequired:"Check this box to continue.",dateRequired:"Select a date.",dateInvalid:o=>`Enter a date like ${o}.`,dateOutOfRange:"This date is outside the dates you can choose.",openCalendar:"Open calendar",presetToday:"Today",presetLast7Days:"Last 7 days",presetLast30Days:"Last 30 days",presetThisMonth:"This month",presetLastMonth:"Last month",presetThisYear:"This year",segmentDay:"Day",segmentMonth:"Month",segmentYear:"Year",segmentHour:"Hour",segmentMinute:"Minute",segmentSecond:"Second",segmentDayPeriod:"AM or PM",placeholderDay:"dd",placeholderMonth:"mm",placeholderYear:"yyyy",placeholderTime:"--",timeRequired:"Enter a time.",timeOutOfRange:"This time is outside the times you can choose.",phoneTrunkPrefix:o=>`Enter the number without the leading ${o}.`,openMenu:"Open menu",closeMenu:"Close menu",breadcrumb:"Breadcrumb",secondaryNavigation:"Secondary navigation",pagination:"Pagination",previous:"Previous",next:"Next",pageOf:(o,t)=>`Page ${o} / ${t}`,moreActions:"More actions",options:"Options",formSection:"Form section",selectRow:"Select row",selectAll:"Select all",total:"Total",chartSeries:"Series",chartPoint:"Point",chartSlice:"Slice",chartShare:"Share",chartData:"Chart data",chartValue:"Value",confirmHeading:"Are you sure?",confirm:"Confirm",cancel:"Cancel",details:"Details",avatar:"Avatar"}),Ta={...La},Ba=new Set;function g(){return Ta}function Yo(o){Ta={...Ta,...o};for(let t of Ba)t()}function gi(){Yo(La)}function Xo(o){return Ba.add(o),()=>Ba.delete(o)}var Zo="kt-strings",h=class extends $e{static{this.styles=v`
|
|
1
|
+
var jr=globalThis,Gr=jr.ShadowRoot&&(jr.ShadyCSS===void 0||jr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ta=Symbol(),Uo=new WeakMap,Sr=class{constructor(t,e,a){if(this._$cssResult$=!0,a!==Ta)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Gr&&t===void 0){let a=e!==void 0&&e.length===1;a&&(t=Uo.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),a&&Uo.set(e,t))}return t}toString(){return this.cssText}},Ho=o=>new Sr(typeof o=="string"?o:o+"",void 0,Ta),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((a,r,s)=>a+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+o[s+1],o[0]);return new Sr(e,o,Ta)},No=(o,t)=>{if(Gr)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let a=document.createElement("style"),r=jr.litNonce;r!==void 0&&a.setAttribute("nonce",r),a.textContent=e.cssText,o.appendChild(a)}},Ba=Gr?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let a of t.cssRules)e+=a.cssText;return Ho(e)})(o):o;var{is:ui,defineProperty:hi,getOwnPropertyDescriptor:fi,getOwnPropertyNames:mi,getOwnPropertySymbols:gi,getPrototypeOf:xi}=Object,Wr=globalThis,_o=Wr.trustedTypes,vi=_o?_o.emptyScript:"",bi=Wr.reactiveElementPolyfillSupport,Pr=(o,t)=>o,Ar={toAttribute(o,t){switch(t){case Boolean:o=o?vi:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},Yr=(o,t)=>!ui(o,t),Vo={attribute:!0,type:String,converter:Ar,reflect:!1,useDefault:!1,hasChanged:Yr};Symbol.metadata??=Symbol("metadata"),Wr.litPropertyMetadata??=new WeakMap;var xe=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Vo){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let a=Symbol(),r=this.getPropertyDescriptor(t,a,e);r!==void 0&&hi(this.prototype,t,r)}}static getPropertyDescriptor(t,e,a){let{get:r,set:s}=fi(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:r,set(i){let p=r?.call(this);s?.call(this,i),this.requestUpdate(t,p,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Vo}static _$Ei(){if(this.hasOwnProperty(Pr("elementProperties")))return;let t=xi(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Pr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Pr("properties"))){let e=this.properties,a=[...mi(e),...gi(e)];for(let r of a)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[a,r]of e)this.elementProperties.set(a,r)}this._$Eh=new Map;for(let[e,a]of this.elementProperties){let r=this._$Eu(e,a);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let a=new Set(t.flat(1/0).reverse());for(let r of a)e.unshift(Ba(r))}else t!==void 0&&e.push(Ba(t));return e}static _$Eu(t,e){let a=e.attribute;return a===!1?void 0:typeof a=="string"?a:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let a of e.keys())this.hasOwnProperty(a)&&(t.set(a,this[a]),delete this[a]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return No(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,a){this._$AK(t,a)}_$ET(t,e){let a=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,a);if(r!==void 0&&a.reflect===!0){let s=(a.converter?.toAttribute!==void 0?a.converter:Ar).toAttribute(e,a.type);this._$Em=t,s==null?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(t,e){let a=this.constructor,r=a._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let s=a.getPropertyOptions(r),i=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Ar;this._$Em=r;let p=i.fromAttribute(e,s.type);this[r]=p??this._$Ej?.get(r)??p,this._$Em=null}}requestUpdate(t,e,a,r=!1,s){if(t!==void 0){let i=this.constructor;if(r===!1&&(s=this[t]),a??=i.getPropertyOptions(t),!((a.hasChanged??Yr)(s,e)||a.useDefault&&a.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,a))))return;this.C(t,e,a)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:a,reflect:r,wrapped:s},i){a&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),s!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||a||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,s]of this._$Ep)this[r]=s;this._$Ep=void 0}let a=this.constructor.elementProperties;if(a.size>0)for(let[r,s]of a){let{wrapped:i}=s,p=this[r];i!==!0||this._$AL.has(r)||p===void 0||this.C(r,void 0,s,p)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(a=>a.hostUpdate?.()),this.update(e)):this._$EM()}catch(a){throw t=!1,this._$EM(),a}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};xe.elementStyles=[],xe.shadowRootOptions={mode:"open"},xe[Pr("elementProperties")]=new Map,xe[Pr("finalized")]=new Map,bi?.({ReactiveElement:xe}),(Wr.reactiveElementVersions??=[]).push("2.1.2");var Ea=globalThis,jo=o=>o,Xr=Ea.trustedTypes,Go=Xr?Xr.createPolicy("lit-html",{createHTML:o=>o}):void 0,Oa="$lit$",ve=`lit$${Math.random().toFixed(9).slice(2)}$`,Ra="?"+ve,yi=`<${Ra}>`,Xe=document,Dr=()=>Xe.createComment(""),Tr=o=>o===null||typeof o!="object"&&typeof o!="function",za=Array.isArray,Jo=o=>za(o)||typeof o?.[Symbol.iterator]=="function",La=`[
|
|
2
|
+
\f\r]`,Mr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Wo=/-->/g,Yo=/>/g,We=RegExp(`>|${La}(?:([^\\s"'>=/]+)(${La}*=${La}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Xo=/'/g,Zo=/"/g,ts=/^(?:script|style|textarea|title)$/i,qa=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),d=qa(1),A=qa(2),$d=qa(3),nt=Symbol.for("lit-noChange"),l=Symbol.for("lit-nothing"),Qo=new WeakMap,Ye=Xe.createTreeWalker(Xe,129);function es(o,t){if(!za(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Go!==void 0?Go.createHTML(t):t}var rs=(o,t)=>{let e=o.length-1,a=[],r,s=t===2?"<svg>":t===3?"<math>":"",i=Mr;for(let p=0;p<e;p++){let c=o[p],u,f,g=-1,x=0;for(;x<c.length&&(i.lastIndex=x,f=i.exec(c),f!==null);)x=i.lastIndex,i===Mr?f[1]==="!--"?i=Wo:f[1]!==void 0?i=Yo:f[2]!==void 0?(ts.test(f[2])&&(r=RegExp("</"+f[2],"g")),i=We):f[3]!==void 0&&(i=We):i===We?f[0]===">"?(i=r??Mr,g=-1):f[1]===void 0?g=-2:(g=i.lastIndex-f[2].length,u=f[1],i=f[3]===void 0?We:f[3]==='"'?Zo:Xo):i===Zo||i===Xo?i=We:i===Wo||i===Yo?i=Mr:(i=We,r=void 0);let $=i===We&&o[p+1].startsWith("/>")?" ":"";s+=i===Mr?c+yi:g>=0?(a.push(u),c.slice(0,g)+Oa+c.slice(g)+ve+$):c+ve+(g===-2?p:$)}return[es(o,s+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),a]},Br=class o{constructor({strings:t,_$litType$:e},a){let r;this.parts=[];let s=0,i=0,p=t.length-1,c=this.parts,[u,f]=rs(t,e);if(this.el=o.createElement(u,a),Ye.currentNode=this.el.content,e===2||e===3){let g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(r=Ye.nextNode())!==null&&c.length<p;){if(r.nodeType===1){if(r.hasAttributes())for(let g of r.getAttributeNames())if(g.endsWith(Oa)){let x=f[i++],$=r.getAttribute(g).split(ve),M=/([.?@])?(.*)/.exec(x);c.push({type:1,index:s,name:M[2],strings:$,ctor:M[1]==="."?Qr:M[1]==="?"?Jr:M[1]==="@"?ta:Qe}),r.removeAttribute(g)}else g.startsWith(ve)&&(c.push({type:6,index:s}),r.removeAttribute(g));if(ts.test(r.tagName)){let g=r.textContent.split(ve),x=g.length-1;if(x>0){r.textContent=Xr?Xr.emptyScript:"";for(let $=0;$<x;$++)r.append(g[$],Dr()),Ye.nextNode(),c.push({type:2,index:++s});r.append(g[x],Dr())}}}else if(r.nodeType===8)if(r.data===Ra)c.push({type:2,index:s});else{let g=-1;for(;(g=r.data.indexOf(ve,g+1))!==-1;)c.push({type:7,index:s}),g+=ve.length-1}s++}}static createElement(t,e){let a=Xe.createElement("template");return a.innerHTML=t,a}};function Ze(o,t,e=o,a){if(t===nt)return t;let r=a!==void 0?e._$Co?.[a]:e._$Cl,s=Tr(t)?void 0:t._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),s===void 0?r=void 0:(r=new s(o),r._$AT(o,e,a)),a!==void 0?(e._$Co??=[])[a]=r:e._$Cl=r),r!==void 0&&(t=Ze(o,r._$AS(o,t.values),r,a)),t}var Zr=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:a}=this._$AD,r=(t?.creationScope??Xe).importNode(e,!0);Ye.currentNode=r;let s=Ye.nextNode(),i=0,p=0,c=a[0];for(;c!==void 0;){if(i===c.index){let u;c.type===2?u=new cr(s,s.nextSibling,this,t):c.type===1?u=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(u=new ea(s,this,t)),this._$AV.push(u),c=a[++p]}i!==c?.index&&(s=Ye.nextNode(),i++)}return Ye.currentNode=Xe,r}p(t){let e=0;for(let a of this._$AV)a!==void 0&&(a.strings!==void 0?(a._$AI(t,a,e),e+=a.strings.length-2):a._$AI(t[e])),e++}},cr=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,a,r){this.type=2,this._$AH=l,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=a,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Ze(this,t,e),Tr(t)?t===l||t==null||t===""?(this._$AH!==l&&this._$AR(),this._$AH=l):t!==this._$AH&&t!==nt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Jo(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==l&&Tr(this._$AH)?this._$AA.nextSibling.data=t:this.T(Xe.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:a}=t,r=typeof a=="number"?this._$AC(t):(a.el===void 0&&(a.el=Br.createElement(es(a.h,a.h[0]),this.options)),a);if(this._$AH?._$AD===r)this._$AH.p(e);else{let s=new Zr(r,this),i=s.u(this.options);s.p(e),this.T(i),this._$AH=s}}_$AC(t){let e=Qo.get(t.strings);return e===void 0&&Qo.set(t.strings,e=new Br(t)),e}k(t){za(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,a,r=0;for(let s of t)r===e.length?e.push(a=new o(this.O(Dr()),this.O(Dr()),this,this.options)):a=e[r],a._$AI(s),r++;r<e.length&&(this._$AR(a&&a._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let a=jo(t).nextSibling;jo(t).remove(),t=a}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},Qe=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,a,r,s){this.type=1,this._$AH=l,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=s,a.length>2||a[0]!==""||a[1]!==""?(this._$AH=Array(a.length-1).fill(new String),this.strings=a):this._$AH=l}_$AI(t,e=this,a,r){let s=this.strings,i=!1;if(s===void 0)t=Ze(this,t,e,0),i=!Tr(t)||t!==this._$AH&&t!==nt,i&&(this._$AH=t);else{let p=t,c,u;for(t=s[0],c=0;c<s.length-1;c++)u=Ze(this,p[a+c],e,c),u===nt&&(u=this._$AH[c]),i||=!Tr(u)||u!==this._$AH[c],u===l?t=l:t!==l&&(t+=(u??"")+s[c+1]),this._$AH[c]=u}i&&!r&&this.j(t)}j(t){t===l?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Qr=class extends Qe{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===l?void 0:t}},Jr=class extends Qe{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==l)}},ta=class extends Qe{constructor(t,e,a,r,s){super(t,e,a,r,s),this.type=5}_$AI(t,e=this){if((t=Ze(this,t,e,0)??l)===nt)return;let a=this._$AH,r=t===l&&a!==l||t.capture!==a.capture||t.once!==a.once||t.passive!==a.passive,s=t!==l&&(a===l||r);r&&this.element.removeEventListener(this.name,this,a),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ea=class{constructor(t,e,a){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=a}get _$AU(){return this._$AM._$AU}_$AI(t){Ze(this,t)}},as={M:Oa,P:ve,A:Ra,C:1,L:rs,R:Zr,D:Jo,V:Ze,I:cr,H:Qe,N:Jr,U:ta,B:Qr,F:ea},ki=Ea.litHtmlPolyfillSupport;ki?.(Br,cr),(Ea.litHtmlVersions??=[]).push("3.3.3");var os=(o,t,e)=>{let a=e?.renderBefore??t,r=a._$litPart$;if(r===void 0){let s=e?.renderBefore??null;a._$litPart$=r=new cr(t.insertBefore(Dr(),s),s,void 0,e??{})}return r._$AI(o),r};var Ka=globalThis,Be=class extends xe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=os(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return nt}};Be._$litElement$=!0,Be.finalized=!0,Ka.litElementHydrateSupport?.({LitElement:Be});var wi=Ka.litElementPolyfillSupport;wi?.({LitElement:Be});(Ka.litElementVersions??=[]).push("4.2.2");var $i={attribute:!0,type:String,converter:Ar,reflect:!1,hasChanged:Yr},Ci=(o=$i,t,e)=>{let{kind:a,metadata:r}=e,s=globalThis.litPropertyMetadata.get(r);if(s===void 0&&globalThis.litPropertyMetadata.set(r,s=new Map),a==="setter"&&((o=Object.create(o)).wrapped=!0),s.set(e.name,o),a==="accessor"){let{name:i}=e;return{set(p){let c=t.get.call(this);t.set.call(this,p),this.requestUpdate(i,c,o,!0,p)},init(p){return p!==void 0&&this.C(i,void 0,o,p),p}}}if(a==="setter"){let{name:i}=e;return function(p){let c=this[i];t.call(this,p),this.requestUpdate(i,c,o,!0,p)}}throw Error("Unsupported decorator location: "+a)};function n(o){return(t,e)=>typeof e=="object"?Ci(o,t,e):((a,r,s)=>{let i=r.hasOwnProperty(s);return r.constructor.createProperty(s,a),i?Object.getOwnPropertyDescriptor(r,s):void 0})(o,t,e)}function k(o){return n({...o,state:!0,attribute:!1})}var be=(o,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(o,t,e),e);function T(o,t){return(e,a,r)=>{let s=i=>i.renderRoot?.querySelector(o)??null;if(t){let{get:i,set:p}=typeof a=="object"?e:r??(()=>{let c=Symbol();return{get(){return this[c]},set(u){this[c]=u}}})();return be(e,a,{get(){let c=i.call(this);return c===void 0&&(c=s(this),(c!==null||this.hasUpdated)&&p.call(this,c)),c}})}return be(e,a,{get(){return s(this)}})}}var Si;function ra(o){return(t,e)=>be(t,e,{get(){return(this.renderRoot??(Si??=document.createDocumentFragment())).querySelectorAll(o)}})}function ur(o){return(t,e)=>{let{slot:a,selector:r}=o??{},s="slot"+(a?`[name=${a}]`:":not([name])");return be(t,e,{get(){let i=this.renderRoot?.querySelector(s),p=i?.assignedElements(o)??[];return r===void 0?p:p.filter(c=>c.matches(r))}})}}var Gt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},hr=o=>(...t)=>({_$litDirective$:o,values:t}),Le=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,a){this._$Ct=t,this._$AM=e,this._$Ci=a}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var w=hr(class extends Le{constructor(o){if(super(o),o.type!==Gt.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(t=>o[t]).join(" ")+" "}update(o,[t]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(let a in t)t[a]&&!this.nt?.has(a)&&this.st.add(a);return this.render(t)}let e=o.element.classList;for(let a of this.st)a in t||(e.remove(a),this.st.delete(a));for(let a in t){let r=!!t[a];r===this.st.has(a)||this.nt?.has(a)||(r?(e.add(a),this.st.add(a)):(e.remove(a),this.st.delete(a)))}return nt}});var Ua=Object.freeze({clear:"Clear",close:"Close",dismiss:"Dismiss",copy:"Copy",copied:"Copied",copyCode:"Copy code",timeRemaining:"Time remaining",remove:o=>o?`Remove ${o}`:"Remove",noOptions:"No options available",noResults:"No results",noActions:"No actions",noData:"No data to display",loading:"Loading\u2026",select:"Select",openList:"Open list",closeList:"Close list",showPassword:"Show password",hidePassword:"Hide password",searchCountry:"Search country or dial code",noCountry:"No country found",countryCode:o=>`Country code: ${o??"none"}`,selectedCount:o=>`${o} selected`,dragAndDrop:"Drag and drop or",browseFiles:"browse your files",recommendedSize:o=>`Recommended image size: ${o}`,selectedFiles:"Selected files",selectDate:"Select a date",selectPeriod:"Select a period",previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose month",chooseYear:"Choose year",required:"This field is required.",selectOption:"Select an option.",selectFile:"Select a file.",checkRequired:"Check this box to continue.",dateRequired:"Select a date.",dateInvalid:o=>`Enter a date like ${o}.`,dateOutOfRange:"This date is outside the dates you can choose.",openCalendar:"Open calendar",presetToday:"Today",presetLast7Days:"Last 7 days",presetLast30Days:"Last 30 days",presetThisMonth:"This month",presetLastMonth:"Last month",presetThisYear:"This year",segmentDay:"Day",segmentMonth:"Month",segmentYear:"Year",segmentHour:"Hour",segmentMinute:"Minute",segmentSecond:"Second",segmentDayPeriod:"AM or PM",placeholderDay:"dd",placeholderMonth:"mm",placeholderYear:"yyyy",placeholderTime:"--",timeRequired:"Enter a time.",timeOutOfRange:"This time is outside the times you can choose.",commandPalette:"Command palette",commandPlaceholder:"Type a command or search\u2026",commandHintMove:"to move",commandHintRun:"to run",commandHintClose:"to close",sliderMinimum:"minimum",sliderMaximum:"maximum",stepComplete:"Completed",stepCurrent:"Current step",stepUpcoming:"Not started",stepError:"Needs attention",numberRequired:"Enter a number.",decrease:"Decrease",increase:"Increase",phoneTrunkPrefix:o=>`Enter the number without the leading ${o}.`,openMenu:"Open menu",closeMenu:"Close menu",breadcrumb:"Breadcrumb",secondaryNavigation:"Secondary navigation",pagination:"Pagination",previous:"Previous",next:"Next",pageOf:(o,t)=>`Page ${o} / ${t}`,moreActions:"More actions",options:"Options",formSection:"Form section",selectRow:"Select row",selectAll:"Select all",total:"Total",chartSeries:"Series",chartPoint:"Point",chartSlice:"Slice",chartShare:"Share",chartData:"Chart data",chartValue:"Value",confirmHeading:"Are you sure?",confirm:"Confirm",cancel:"Cancel",details:"Details",avatar:"Avatar"}),Ia={...Ua},Fa=new Set;function m(){return Ia}function ss(o){Ia={...Ia,...o};for(let t of Fa)t()}function Pi(){ss(Ua)}function is(o){return Fa.add(o),()=>Fa.delete(o)}var ns="kt-strings",h=class extends Be{static{this.styles=v`
|
|
4
4
|
:host {
|
|
5
5
|
box-sizing: border-box;
|
|
6
6
|
}
|
|
@@ -24,7 +24,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
24
24
|
clip-path: inset(50%);
|
|
25
25
|
white-space: nowrap;
|
|
26
26
|
}
|
|
27
|
-
`}connectedCallback(){super.connectedCallback(),this.unsubscribeStrings=
|
|
27
|
+
`}connectedCallback(){super.connectedCallback(),this.unsubscribeStrings=is(()=>this.requestUpdate(ns,Symbol("previous strings")))}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeStrings?.(),this.unsubscribeStrings=void 0}stringsChanged(t){return t.has(ns)}};function b(o,t){customElements.get(o)||customElements.define(o,t)}var Ha=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]];var Na=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]];var _a=[["path",{d:"M8 2v3"}],["path",{d:"M16 2v3"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}],["path",{d:"M3 9h18"}]];var Va=[["path",{d:"M20 6 9 17l-5-5"}]];var ja=[["path",{d:"m6 9 6 6 6-6"}]];var Ga=[["path",{d:"m15 18-6-6 6-6"}]];var Wa=[["path",{d:"m9 18 6-6-6-6"}]];var Ya=[["path",{d:"m18 15-6-6-6 6"}]];var aa=[["circle",{cx:"12",cy:"12",r:"10"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16"}]];var oa=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m16 9-5.5 5.5L8 12"}]];var Xa=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];var Za=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];var sa=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"19",cy:"12",r:"1"}],["circle",{cx:"5",cy:"12",r:"1"}]];var Qa=[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];var Ja=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];var to=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}],["path",{d:"m2 2 20 20"}]];var eo=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M12 12v6"}],["path",{d:"m15 15-3-3-3 3"}]];var ro=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}]];var ia=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z"}]];var ao=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];var na=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];var oo=[["path",{d:"M4 5h16"}],["path",{d:"M4 12h16"}],["path",{d:"M4 19h16"}]];var so=[["path",{d:"M5 12h14"}]];var io=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];var no=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];var lo=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}],["path",{d:"M8 16H3v5"}]];var po=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];var co=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]];var la=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];var da=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];var uo=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];var ho=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}],["circle",{cx:"12",cy:"7",r:"4"}]];var fo=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];var mo=new Map;function ls(o){return o.replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-zA-Z])(\d)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function ds(o,t){mo.set(ls(o),t)}function ps(o){for(let[t,e]of Object.entries(o))Mi(e)&&ds(t,e)}function go(o){return mo.get(ls(o))}function Ai(){return[...mo.keys()].sort()}function Mi(o){return Array.isArray(o)&&o.every(t=>Array.isArray(t)&&typeof t[0]=="string"&&typeof t[1]=="object"&&t[1]!==null)}var Di={ArrowDown:Ha,ArrowUp:Na,Calendar:_a,Check:Va,ChevronDown:ja,ChevronLeft:Ga,ChevronRight:Wa,ChevronUp:Ya,CircleAlert:aa,CircleCheck:oa,Copy:Xa,Download:Za,Ellipsis:sa,ExternalLink:Qa,Eye:Ja,EyeOff:to,File:ro,FileUp:eo,Filter:ia,Info:ao,LoaderCircle:na,Menu:oo,Minus:so,Pencil:io,Plus:no,RefreshCw:lo,Search:po,Settings:co,Trash2:la,TriangleAlert:da,Upload:uo,User:ho,X:fo};ps(Di);var Ti=Object.defineProperty,pa=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Ti(t,e,r),r},us="http://www.w3.org/2000/svg",cs=new Set;function Bi([o,t]){let e=document.createElementNS(us,o);for(let[a,r]of Object.entries(t))r!==void 0&&e.setAttribute(a,String(r));return e}var Ee=class extends h{constructor(){super(...arguments),this.name="",this.size=24,this.strokeWidth=2,this.label=""}static{this.styles=[h.styles,v`
|
|
28
28
|
:host {
|
|
29
29
|
display: inline-flex;
|
|
30
30
|
align-items: center;
|
|
@@ -37,9 +37,9 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
37
37
|
svg {
|
|
38
38
|
display: block;
|
|
39
39
|
}
|
|
40
|
-
`]}render(){let t=
|
|
40
|
+
`]}render(){let t=go(this.name);return t?d`<svg
|
|
41
41
|
part="svg"
|
|
42
|
-
xmlns=${
|
|
42
|
+
xmlns=${us}
|
|
43
43
|
width=${this.size}
|
|
44
44
|
height=${this.size}
|
|
45
45
|
viewBox="0 0 24 24"
|
|
@@ -52,14 +52,14 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
52
52
|
aria-label=${this.label||l}
|
|
53
53
|
aria-hidden=${this.label?l:"true"}
|
|
54
54
|
>
|
|
55
|
-
${t.map(
|
|
56
|
-
</svg>`:(this.name&&!
|
|
55
|
+
${t.map(Bi)}
|
|
56
|
+
</svg>`:(this.name&&!cs.has(this.name)&&(cs.add(this.name),console.warn(`<kt-icon>: no icon registered as "${this.name}". Register it with registerIcons({ ... }) from "kanto-ds/icons".`)),d`<svg
|
|
57
57
|
part="svg"
|
|
58
58
|
width=${this.size}
|
|
59
59
|
height=${this.size}
|
|
60
60
|
viewBox="0 0 24 24"
|
|
61
61
|
aria-hidden="true"
|
|
62
|
-
></svg>`)}};
|
|
62
|
+
></svg>`)}};pa([n({type:String,reflect:!0})],Ee.prototype,"name");pa([n({type:Number,reflect:!0})],Ee.prototype,"size");pa([n({type:Number,attribute:"stroke-width"})],Ee.prototype,"strokeWidth");pa([n({type:String})],Ee.prototype,"label");b("kt-icon",Ee);var Li=Object.defineProperty,Je=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Li(t,e,r),r},hs=Array.from({length:8},(o,t)=>`var(--chart-series-${t+1})`);function Ei(o){let t=(o.includes("@")?o.split("@")[0]??"":o).split(/[\s._-]+/).filter(Boolean);return t.length===0?"":t.length===1?(t[0]??"").slice(0,2).toUpperCase():`${t[0][0]}${t[t.length-1][0]}`.toUpperCase()}var Wt=class extends h{constructor(){super(...arguments),this.failed=!1,this.name="",this.src="",this.size="medium",this.square=!1,this.color=""}static{this.styles=[h.styles,v`
|
|
63
63
|
:host {
|
|
64
64
|
display: inline-flex;
|
|
65
65
|
--kt-avatar-size: 32px;
|
|
@@ -136,12 +136,12 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
136
136
|
.offline {
|
|
137
137
|
background: var(--color-text-500);
|
|
138
138
|
}
|
|
139
|
-
`]}willUpdate(t){t.has("src")&&(this.failed=!1)}get hue(){if(this.color)return this.color;let t=0;for(let e of this.name)t+=e.charCodeAt(0);return
|
|
139
|
+
`]}willUpdate(t){t.has("src")&&(this.failed=!1)}get hue(){if(this.color)return this.color;let t=0;for(let e of this.name)t+=e.charCodeAt(0);return hs[t%hs.length]}render(){let t=Ei(this.name),e=!!this.src&&!this.failed;return d`<span
|
|
140
140
|
part="base"
|
|
141
141
|
class=${w({avatar:!0,"has-image":e,anonymous:!this.name})}
|
|
142
142
|
style=${e?"":`--kt-avatar-hue:${this.hue}`}
|
|
143
143
|
role="img"
|
|
144
|
-
aria-label=${this.name||
|
|
144
|
+
aria-label=${this.name||m().avatar}
|
|
145
145
|
>
|
|
146
146
|
${e?d`<img
|
|
147
147
|
part="image"
|
|
@@ -150,7 +150,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
150
150
|
@error=${()=>{this.failed=!0}}
|
|
151
151
|
/>`:t||d`<kt-icon name="user" size="16"></kt-icon>`}
|
|
152
152
|
${this.status?d`<span class=${w({status:!0,[this.status]:!0})}></span>`:l}
|
|
153
|
-
</span>`}};
|
|
153
|
+
</span>`}};Je([k()],Wt.prototype,"failed");Je([n({type:String})],Wt.prototype,"name");Je([n({type:String})],Wt.prototype,"src");Je([n({type:String,reflect:!0})],Wt.prototype,"size");Je([n({type:Boolean,reflect:!0})],Wt.prototype,"square");Je([n({type:String,reflect:!0})],Wt.prototype,"status");Je([n({type:String})],Wt.prototype,"color");b("kt-avatar",Wt);var fs="important",Oi=" !"+fs,Tt=hr(class extends Le{constructor(o){if(super(o),o.type!==Gt.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((t,e)=>{let a=o[e];return a==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${a};`},"")}update(o,[t]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let a of this.ft)t[a]==null&&(this.ft.delete(a),a.includes("-")?e.removeProperty(a):e[a]=null);for(let a in t){let r=t[a];if(r!=null){this.ft.add(a);let s=typeof r=="string"&&r.endsWith(Oi);a.includes("-")||s?e.setProperty(a,s?r.slice(0,-11):r,s?fs:""):e[a]=r}}return nt}});function y(o,t,e){let a=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0,cancelable:!0});return o.dispatchEvent(a),a}var ms=0;function j(o){return ms+=1,`${o}-${ms}`}function J(o,t,e,a,r){o?t.addEventListener(e,a,r):t.removeEventListener(e,a,r)}var Ri=Object.defineProperty,oe=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Ri(t,e,r),r},Ct=class extends h{constructor(){super(...arguments),this.variant="tag",this.tone="neutral",this.size="medium",this.label="",this.color="",this.icon="",this.clickable=!1,this.removable=!1,this.error=!1}static{this.styles=[h.styles,v`
|
|
154
154
|
:host {
|
|
155
155
|
display: inline-flex;
|
|
156
156
|
vertical-align: middle;
|
|
@@ -304,7 +304,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
304
304
|
`]}get display(){let t=this.label||(this.textContent??"").trim();if(this.max===void 0)return t;let e=Number(t);return Number.isFinite(e)&&e>this.max?`${this.max}+`:t}activate(){this.clickable&&y(this,"kt-badge-click")}onKeyDown(t){this.clickable&&(t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),this.activate()))}onRemove(t){t.stopPropagation(),y(this,"kt-remove")}render(){let t=this.error?"danger":this.tone;return d`<span
|
|
305
305
|
part="base"
|
|
306
306
|
class=${w({badge:!0,[this.variant]:!0,[t]:t!=="neutral",small:this.size==="small",clickable:this.clickable})}
|
|
307
|
-
style=${
|
|
307
|
+
style=${Tt(this.color?{"--kt-badge-color":this.color}:{})}
|
|
308
308
|
role=${this.clickable?"button":l}
|
|
309
309
|
tabindex=${this.clickable?0:l}
|
|
310
310
|
@click=${this.activate}
|
|
@@ -316,12 +316,12 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
316
316
|
part="remove"
|
|
317
317
|
type="button"
|
|
318
318
|
class="remove"
|
|
319
|
-
aria-label=${
|
|
319
|
+
aria-label=${m().remove(this.display||this.textContent?.trim()||"")}
|
|
320
320
|
@click=${this.onRemove}
|
|
321
321
|
>
|
|
322
322
|
<kt-icon name="x" size="12"></kt-icon>
|
|
323
323
|
</button>`:l}
|
|
324
|
-
</span>`}};
|
|
324
|
+
</span>`}};oe([n({type:String,reflect:!0})],Ct.prototype,"variant");oe([n({type:String,reflect:!0})],Ct.prototype,"tone");oe([n({type:String,reflect:!0})],Ct.prototype,"size");oe([n({type:String})],Ct.prototype,"label");oe([n({type:String})],Ct.prototype,"color");oe([n({type:String})],Ct.prototype,"icon");oe([n({type:Boolean,reflect:!0})],Ct.prototype,"clickable");oe([n({type:Boolean,reflect:!0})],Ct.prototype,"removable");oe([n({type:Number})],Ct.prototype,"max");oe([n({type:Boolean,reflect:!0})],Ct.prototype,"error");b("kt-badge",Ct);var zi=Object.defineProperty,qt=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&zi(t,e,r),r},qi={small:16,medium:20,large:24},lt=class extends h{constructor(){super(...arguments),this.variant="primary",this.size="medium",this.disabled=!1,this.type="button",this.icon="",this.iconPosition="left",this.label="",this.popup=void 0,this.expanded=void 0,this.fullWidth=!1,this.name="",this.value=""}static{this.styles=[h.styles,v`
|
|
325
325
|
:host {
|
|
326
326
|
display: inline-flex;
|
|
327
327
|
vertical-align: middle;
|
|
@@ -487,7 +487,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
487
487
|
outline: var(--outline-width) solid var(--color-primary-base);
|
|
488
488
|
outline-offset: 2px;
|
|
489
489
|
}
|
|
490
|
-
`]}focus(t){this.shadowRoot?.querySelector("button")?.focus(t)}blur(){this.shadowRoot?.querySelector("button")?.blur()}get hasLabelText(){return this.textContent!==null&&this.textContent.trim().length>0}submitEnclosingForm(){let t=this.closest("form");if(!t)return;let e=document.createElement("button");e.type=this.type,e.hidden=!0,this.name&&(e.name=this.name),this.value&&(e.value=this.value),t.append(e),e.click(),e.remove()}onClick(t){if(this.disabled){t.preventDefault(),t.stopPropagation();return}this.type!=="button"&&this.submitEnclosingForm()}render(){let t=!!this.icon&&!this.hasLabelText,e=this.icon?d`<kt-icon part="icon" name=${this.icon} size=${
|
|
490
|
+
`]}focus(t){this.shadowRoot?.querySelector("button")?.focus(t)}blur(){this.shadowRoot?.querySelector("button")?.blur()}get hasLabelText(){return this.textContent!==null&&this.textContent.trim().length>0}submitEnclosingForm(){let t=this.closest("form");if(!t)return;let e=document.createElement("button");e.type=this.type,e.hidden=!0,this.name&&(e.name=this.name),this.value&&(e.value=this.value),t.append(e),e.click(),e.remove()}onClick(t){if(this.disabled){t.preventDefault(),t.stopPropagation();return}this.type!=="button"&&this.submitEnclosingForm()}render(){let t=!!this.icon&&!this.hasLabelText,e=this.icon?d`<kt-icon part="icon" name=${this.icon} size=${qi[this.size]}></kt-icon>`:l;return d`<button
|
|
491
491
|
part="button"
|
|
492
492
|
class=${w({[this.variant]:!0,[this.size]:!0,"icon-only":t})}
|
|
493
493
|
type=${this.type}
|
|
@@ -500,7 +500,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
500
500
|
${this.iconPosition==="left"?e:l}
|
|
501
501
|
<slot></slot>
|
|
502
502
|
${this.iconPosition==="right"?e:l}
|
|
503
|
-
</button>`}};
|
|
503
|
+
</button>`}};qt([n({type:String,reflect:!0})],lt.prototype,"variant");qt([n({type:String,reflect:!0})],lt.prototype,"size");qt([n({type:Boolean,reflect:!0})],lt.prototype,"disabled");qt([n({type:String})],lt.prototype,"type");qt([n({type:String})],lt.prototype,"icon");qt([n({type:String,attribute:"icon-position"})],lt.prototype,"iconPosition");qt([n({type:String})],lt.prototype,"label");qt([n({attribute:!1})],lt.prototype,"popup");qt([n({attribute:!1})],lt.prototype,"expanded");qt([n({type:Boolean,reflect:!0,attribute:"full-width"})],lt.prototype,"fullWidth");qt([n({type:String})],lt.prototype,"name");qt([n({type:String})],lt.prototype,"value");b("kt-button",lt);function ht(o){return o.label??String(o.id)}function ca(o,t){let e=t.trim().toLowerCase();return e?o.filter(a=>ht(a).toLowerCase().includes(e)):o}function ye(o,t,e){if(o.length===0)return-1;for(let a=1;a<=o.length;a+=1){let r=(t+e*a+o.length*a)%o.length;if(!o[r]?.disabled)return r}return-1}function St(o){return o.findIndex(t=>!t.disabled)}function Oe(o){for(let t=o.length-1;t>=0;t-=1)if(!o[t]?.disabled)return t;return-1}var fr=v`
|
|
504
504
|
/* Placed from the field by FloatingController, which also sets its width. */
|
|
505
505
|
.popup {
|
|
506
506
|
display: flex;
|
|
@@ -571,7 +571,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
571
571
|
font: var(--font-normal-small);
|
|
572
572
|
pointer-events: none;
|
|
573
573
|
}
|
|
574
|
-
`;function
|
|
574
|
+
`;function gs(o,t,e,a){return o==="start"?t:o==="end"?t+e-a:t+e/2-a/2}var ua=6,mr=8,xs={top:"bottom",bottom:"top",left:"right",right:"left"},vs=(o,t,e)=>Math.min(Math.max(o,t),e);function ha(o,t,e,a,r="center"){let s=u=>{switch(u){case"top":return o.top-ua-t.height;case"bottom":return o.top+o.height+ua;case"left":return o.left-ua-t.width;case"right":return o.left+o.width+ua}},i=u=>{let f=s(u),g=u==="top"||u==="bottom"?t.height:t.width,x=u==="top"||u==="bottom"?e.height:e.width;return f>=mr&&f+g<=x-mr},p=!i(a)&&i(xs[a])?xs[a]:a;if(p==="top"||p==="bottom"){let u=gs(r,o.left,o.width,t.width);return{x:vs(u,mr,e.width-mr-t.width),y:s(p),placement:p}}let c=gs(r,o.top,o.height,t.height);return{x:s(p),y:vs(c,mr,e.height-mr-t.height),placement:p}}var Pt=v`
|
|
575
575
|
.floating {
|
|
576
576
|
position: fixed;
|
|
577
577
|
inset: 0 auto auto 0;
|
|
@@ -586,7 +586,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
586
586
|
border: var(--border-width) solid var(--border-popover);
|
|
587
587
|
box-shadow: var(--shadow-popover);
|
|
588
588
|
}
|
|
589
|
-
`,
|
|
589
|
+
`,dt=class{constructor(t,e){this.options=e,this.open=!1,this.frame=0,this.follow=()=>{cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>this.place())},t.addController(this)}sync(t){if(t!==this.open){this.open=t;let a=t?"addEventListener":"removeEventListener";window[a]("scroll",this.follow,{capture:!0,passive:!0}),window[a]("resize",this.follow)}let e=this.options.panel();!e||typeof e.showPopover!="function"||(t?(e.matches(":popover-open")||e.showPopover(),this.place(),!this.resizeObserver&&typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(this.follow),this.resizeObserver.observe(e))):(this.unobserve(),e.matches(":popover-open")&&e.hidePopover()))}unobserve(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0}hostDisconnected(){this.sync(!1),this.unobserve(),cancelAnimationFrame(this.frame)}place(){let t=this.options.panel(),e=this.options.anchor()?.getBoundingClientRect();if(!t||!e)return;this.options.matchWidth&&(t.style.width=`${e.width}px`);let{x:a,y:r,placement:s}=ha(e,{width:t.offsetWidth,height:t.offsetHeight},{width:window.innerWidth,height:window.innerHeight},this.options.side?.()??"bottom",this.options.align?.()??"start");t.style.left=`${a}px`,t.style.top=`${r}px`,this.options.onPlace?.(s)}};var Ki=Object.defineProperty,Yt=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Ki(t,e,r),r},ft=class extends h{constructor(){super(...arguments),this.open=!1,this.placement="bottom",this.floating=new dt(this,{panel:()=>this.shadowRoot?.querySelector(".panel"),anchor:()=>this.triggerWrapper,side:()=>this.preferredPlacement,align:()=>this.align,onPlace:t=>{this.placement=t==="top"?"top":"bottom"}}),this.options=[],this.value=null,this.preferredPlacement="bottom",this.align="start",this.disabled=!1,this.emptyText=void 0,this.onDocumentPointerDown=t=>{t.composedPath().includes(this)||this.hide()},this.onDocumentKeyDown=t=>{t.key==="Escape"&&this.hide()},this.syncTrigger=()=>{let t=this.triggerSlot?.assignedElements()[0];if(!t)return;let e=this.panelSlot?.assignedElements()[0]?.getAttribute("role")==="menu",a=this.options.length>0||e?"menu":void 0;if(Ii(t)){t.popup=a,t.expanded=this.open;return}a?t.setAttribute("aria-haspopup",a):t.removeAttribute("aria-haspopup"),t.setAttribute("aria-expanded",String(this.open))}}static{this.styles=[h.styles,Pt,v`
|
|
590
590
|
:host {
|
|
591
591
|
position: relative;
|
|
592
592
|
display: inline-block;
|
|
@@ -681,7 +681,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
681
681
|
font: var(--font-normal-small);
|
|
682
682
|
cursor: default;
|
|
683
683
|
}
|
|
684
|
-
`]}get isOpen(){return this.open}connectedCallback(){super.connectedCallback(),this.listen(this.open)}disconnectedCallback(){super.disconnectedCallback(),this.listen(!1)}listen(t){
|
|
684
|
+
`]}get isOpen(){return this.open}connectedCallback(){super.connectedCallback(),this.listen(this.open)}disconnectedCallback(){super.disconnectedCallback(),this.listen(!1)}listen(t){J(t,document,"pointerdown",this.onDocumentPointerDown),J(t,document,"keydown",this.onDocumentKeyDown)}updated(t){this.syncTrigger(),t.has("open")&&this.listen(this.open),this.floating.sync(this.open)}show(){this.disabled||this.open||(this.open=!0,y(this,"kt-open"))}hide(){this.open&&(this.open=!1,y(this,"kt-close"))}toggle(){this.open?this.hide():this.show()}choose(t){t.disabled||(this.value=t.id,this.hide(),y(this,"kt-select",{value:t.id,option:t}))}render(){return d`<div part="trigger" class="trigger" @click=${this.toggle}>
|
|
685
685
|
<slot name="trigger" @slotchange=${this.syncTrigger}></slot>
|
|
686
686
|
</div>
|
|
687
687
|
|
|
@@ -700,12 +700,12 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
700
700
|
aria-disabled=${t.disabled?"true":l}
|
|
701
701
|
@click=${()=>this.choose(t)}
|
|
702
702
|
>
|
|
703
|
-
${
|
|
703
|
+
${ht(t)}
|
|
704
704
|
</li>`)}
|
|
705
705
|
</ul>`:d`<slot name="panel">
|
|
706
|
-
<div class="empty">${this.emptyText??
|
|
706
|
+
<div class="empty">${this.emptyText??m().noResults}</div>
|
|
707
707
|
</slot>`}
|
|
708
|
-
</div>`}};
|
|
708
|
+
</div>`}};Yt([T(".trigger")],ft.prototype,"triggerWrapper");Yt([T('slot[name="trigger"]')],ft.prototype,"triggerSlot");Yt([T('slot[name="panel"]')],ft.prototype,"panelSlot");Yt([k()],ft.prototype,"open");Yt([k()],ft.prototype,"placement");Yt([n({attribute:!1})],ft.prototype,"options");Yt([n({type:String})],ft.prototype,"value");Yt([n({type:String,attribute:"preferred-placement"})],ft.prototype,"preferredPlacement");Yt([n({type:String,reflect:!0})],ft.prototype,"align");Yt([n({type:Boolean,reflect:!0})],ft.prototype,"disabled");Yt([n({type:String,attribute:"empty-text"})],ft.prototype,"emptyText");function Ii(o){return"popup"in o&&"expanded"in o}b("kt-dropdown",ft);var Fi=Object.defineProperty,Xt=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Fi(t,e,r),r},bs={small:16,medium:20,large:24},mt=class extends h{constructor(){super(...arguments),this.activeIndex=-1,this.items=[],this.variant="primary",this.size="medium",this.disabled=!1,this.icon="",this.menuLabel=void 0,this.preferredPlacement="bottom",this.emptyText=void 0,this.onOpen=()=>{this.moveTo(St(this.items))},this.onClose=()=>{let t=this.shadowRoot?.activeElement;this.activeIndex=-1,t instanceof HTMLElement&&t.classList.contains("item")&&this.caret?.focus()},this.onMenuKeyDown=t=>{let e={ArrowDown:()=>ye(this.items,this.activeIndex,1),ArrowUp:()=>ye(this.items,this.activeIndex,-1),Home:()=>St(this.items),End:()=>Oe(this.items)}[t.key];e&&(t.preventDefault(),this.moveTo(e()))}}static{this.styles=[h.styles,v`
|
|
709
709
|
:host {
|
|
710
710
|
display: inline-flex;
|
|
711
711
|
vertical-align: middle;
|
|
@@ -797,8 +797,8 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
797
797
|
aria-disabled=${t.disabled?"true":l}
|
|
798
798
|
@click=${()=>this.choose(t)}
|
|
799
799
|
>
|
|
800
|
-
${t.icon?d`<kt-icon name=${t.icon} size=${
|
|
801
|
-
${
|
|
800
|
+
${t.icon?d`<kt-icon name=${t.icon} size=${bs[this.size]}></kt-icon>`:l}
|
|
801
|
+
${ht(t)}
|
|
802
802
|
</button>`}render(){return d`<div class="split">
|
|
803
803
|
<!-- The icon is slotted rather than passed as \`icon\`: <kt-button> reads
|
|
804
804
|
its own text content to decide whether it is icon-only, and a <slot>
|
|
@@ -810,7 +810,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
810
810
|
size=${this.size}
|
|
811
811
|
?disabled=${this.disabled}
|
|
812
812
|
>
|
|
813
|
-
${this.icon?d`<kt-icon name=${this.icon} size=${
|
|
813
|
+
${this.icon?d`<kt-icon name=${this.icon} size=${bs[this.size]}></kt-icon>`:l}
|
|
814
814
|
<slot></slot>
|
|
815
815
|
</kt-button>
|
|
816
816
|
|
|
@@ -829,16 +829,16 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
829
829
|
variant=${this.variant}
|
|
830
830
|
size=${this.size}
|
|
831
831
|
icon="chevron-down"
|
|
832
|
-
label=${this.menuLabel??
|
|
832
|
+
label=${this.menuLabel??m().moreActions}
|
|
833
833
|
?disabled=${this.disabled}
|
|
834
834
|
@click=${this.onCaretClick}
|
|
835
835
|
></kt-button>
|
|
836
836
|
|
|
837
837
|
<div slot="panel" part="menu" class="menu" role="menu" @keydown=${this.onMenuKeyDown}>
|
|
838
|
-
${this.items.length>0?this.items.map((t,e)=>this.renderItem(t,e)):d`<div class="empty">${this.emptyText??
|
|
838
|
+
${this.items.length>0?this.items.map((t,e)=>this.renderItem(t,e)):d`<div class="empty">${this.emptyText??m().noActions}</div>`}
|
|
839
839
|
</div>
|
|
840
840
|
</kt-dropdown>
|
|
841
|
-
</div>`}};
|
|
841
|
+
</div>`}};Xt([T("kt-dropdown")],mt.prototype,"dropdown");Xt([T(".caret")],mt.prototype,"caret");Xt([k()],mt.prototype,"activeIndex");Xt([n({attribute:!1})],mt.prototype,"items");Xt([n({type:String,reflect:!0})],mt.prototype,"variant");Xt([n({type:String,reflect:!0})],mt.prototype,"size");Xt([n({type:Boolean,reflect:!0})],mt.prototype,"disabled");Xt([n({type:String})],mt.prototype,"icon");Xt([n({type:String,attribute:"menu-label"})],mt.prototype,"menuLabel");Xt([n({type:String,attribute:"preferred-placement"})],mt.prototype,"preferredPlacement");Xt([n({type:String,attribute:"empty-text"})],mt.prototype,"emptyText");b("kt-split-button",mt);function tr(o){return o?o.assignedElements({flatten:!0}).length>0?!0:o.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.TEXT_NODE&&(t.textContent??"").trim()!==""):!1}var Ui=Object.defineProperty,Re=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Ui(t,e,r),r},Kt=class extends h{constructor(){super(...arguments),this.hasHeader=!1,this.hasFooter=!1,this.clickable=!1,this.selected=!1,this.image="",this.imageAlt="",this.imagePosition="left",this.imageSize="120px"}static{this.styles=[h.styles,v`
|
|
842
842
|
:host {
|
|
843
843
|
display: block;
|
|
844
844
|
}
|
|
@@ -960,7 +960,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
960
960
|
.footer.empty {
|
|
961
961
|
display: none;
|
|
962
962
|
}
|
|
963
|
-
`]}firstUpdated(){this.readSlots()}readSlots(){let t=this.shadowRoot;this.hasHeader=
|
|
963
|
+
`]}firstUpdated(){this.readSlots()}readSlots(){let t=this.shadowRoot;this.hasHeader=tr(t?.querySelector('slot[name="header"]')),this.hasFooter=tr(t?.querySelector('slot[name="footer"]'))}onSlotChange(){this.readSlots()}activate(){this.clickable&&y(this,"kt-card-click")}onKeyDown(t){this.clickable&&(t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),this.activate()))}render(){let t=!!this.image||this.querySelector('[slot="media"]')!==null;return d`<div
|
|
964
964
|
part="base"
|
|
965
965
|
class=${w({card:!0,clickable:this.clickable,selected:this.selected,[`image-${this.imagePosition}`]:t})}
|
|
966
966
|
role=${this.clickable?"button":l}
|
|
@@ -972,7 +972,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
972
972
|
${t?d`<div
|
|
973
973
|
part="media"
|
|
974
974
|
class="media"
|
|
975
|
-
style=${
|
|
975
|
+
style=${Tt({"--media-size":this.imageSize})}
|
|
976
976
|
>
|
|
977
977
|
<slot name="media">
|
|
978
978
|
${this.image?d`<img src=${this.image} alt=${this.imageAlt} />`:l}
|
|
@@ -987,7 +987,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
987
987
|
<slot name="footer" @slotchange=${this.onSlotChange}></slot>
|
|
988
988
|
</div>
|
|
989
989
|
</div>
|
|
990
|
-
</div>`}};
|
|
990
|
+
</div>`}};Re([k()],Kt.prototype,"hasHeader");Re([k()],Kt.prototype,"hasFooter");Re([n({type:Boolean,reflect:!0})],Kt.prototype,"clickable");Re([n({type:Boolean,reflect:!0})],Kt.prototype,"selected");Re([n({type:String})],Kt.prototype,"image");Re([n({type:String,attribute:"image-alt"})],Kt.prototype,"imageAlt");Re([n({type:String,attribute:"image-position"})],Kt.prototype,"imagePosition");Re([n({type:String,attribute:"image-size"})],Kt.prototype,"imageSize");b("kt-card",Kt);var Hi=Object.defineProperty,fa=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Hi(t,e,r),r},Lr=class ys extends h{constructor(){super(...arguments),this.copied=!1,this.language="",this.copy=!1,this.label=""}static{this.styles=[h.styles,v`
|
|
991
991
|
:host {
|
|
992
992
|
display: block;
|
|
993
993
|
}
|
|
@@ -1061,17 +1061,17 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1061
1061
|
.bare pre {
|
|
1062
1062
|
padding-top: 14px;
|
|
1063
1063
|
}
|
|
1064
|
-
`]}static{this.COPIED_MS=1600}disconnectedCallback(){super.disconnectedCallback(),this.copiedTimer!==void 0&&clearTimeout(this.copiedTimer)}get code(){return(this.textContent??"").replace(/^\n+|\n+$/g,"")}async copyToClipboard(){try{await navigator.clipboard.writeText(this.code),this.copied=!0,this.copiedTimer!==void 0&&clearTimeout(this.copiedTimer),this.copiedTimer=setTimeout(()=>{this.copied=!1},
|
|
1064
|
+
`]}static{this.COPIED_MS=1600}disconnectedCallback(){super.disconnectedCallback(),this.copiedTimer!==void 0&&clearTimeout(this.copiedTimer)}get code(){return(this.textContent??"").replace(/^\n+|\n+$/g,"")}async copyToClipboard(){try{await navigator.clipboard.writeText(this.code),this.copied=!0,this.copiedTimer!==void 0&&clearTimeout(this.copiedTimer),this.copiedTimer=setTimeout(()=>{this.copied=!1},ys.COPIED_MS)}catch{}y(this,"kt-copy",{code:this.code})}render(){let t=!!this.language||this.copy;return d`<div part="base" class=${t?"base":"base bare"}>
|
|
1065
1065
|
${t?d`<div part="header" class="header">
|
|
1066
1066
|
<span class="language">${this.language}</span>
|
|
1067
1067
|
${this.copy?d`<button
|
|
1068
1068
|
type="button"
|
|
1069
1069
|
class=${this.copied?"copy copied":"copy"}
|
|
1070
|
-
aria-label=${this.copied?
|
|
1070
|
+
aria-label=${this.copied?m().copied:m().copyCode}
|
|
1071
1071
|
@click=${this.copyToClipboard}
|
|
1072
1072
|
>
|
|
1073
1073
|
<kt-icon name=${this.copied?"check":"copy"} size="14"></kt-icon>
|
|
1074
|
-
${this.copied?
|
|
1074
|
+
${this.copied?m().copied:m().copy}
|
|
1075
1075
|
</button>`:l}
|
|
1076
1076
|
</div>`:l}
|
|
1077
1077
|
|
|
@@ -1080,7 +1080,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1080
1080
|
tabindex="0"
|
|
1081
1081
|
aria-label=${this.label||l}
|
|
1082
1082
|
><code><slot></slot></code></pre>
|
|
1083
|
-
</div>`}};
|
|
1083
|
+
</div>`}};fa([k()],Lr.prototype,"copied");fa([n({type:String})],Lr.prototype,"language");fa([n({type:Boolean})],Lr.prototype,"copy");fa([n({type:String})],Lr.prototype,"label");var ks=Lr;b("kt-code",ks);var Ni=Object.defineProperty,ws=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Ni(t,e,r),r},_i={mod:"\u2318",meta:"\u2318",cmd:"\u2318",ctrl:"\u2303",alt:"\u2325",option:"\u2325",shift:"\u21E7",enter:"\u21B5",escape:"esc",backspace:"\u232B"},Vi={mod:"Ctrl",meta:"Win",cmd:"Ctrl",ctrl:"Ctrl",alt:"Alt",option:"Alt",shift:"Shift",enter:"Enter",escape:"Esc",backspace:"Backspace"},gr=class extends h{constructor(){super(...arguments),this.keys="",this.platform="auto"}static{this.styles=[h.styles,v`
|
|
1084
1084
|
:host {
|
|
1085
1085
|
display: inline-flex;
|
|
1086
1086
|
align-items: center;
|
|
@@ -1102,9 +1102,9 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1102
1102
|
border: var(--border-width) solid var(--border-subtle);
|
|
1103
1103
|
border-radius: calc(5px * var(--radius-scale, 1));
|
|
1104
1104
|
}
|
|
1105
|
-
`]}get isMac(){return this.platform!=="auto"?this.platform==="mac":typeof navigator>"u"?!1:/mac|iphone|ipad/i.test(navigator.platform||navigator.userAgent)}get labels(){let t=this.isMac?
|
|
1105
|
+
`]}get isMac(){return this.platform!=="auto"?this.platform==="mac":typeof navigator>"u"?!1:/mac|iphone|ipad/i.test(navigator.platform||navigator.userAgent)}get labels(){let t=this.isMac?_i:Vi;return this.keys.split(/\s+/).filter(Boolean).map(e=>t[e.toLowerCase()]??e.toUpperCase())}render(){let t=this.labels;return d`<span part="base" style="display:contents">
|
|
1106
1106
|
${t.length>0?t.map(e=>d`<kbd part="key">${e}</kbd>`):d`<kbd part="key"><slot></slot></kbd>`}
|
|
1107
|
-
</span>`}};
|
|
1107
|
+
</span>`}};ws([n({type:String})],gr.prototype,"keys");ws([n({type:String})],gr.prototype,"platform");b("kt-kbd",gr);var{I:lh}=as;var $s=o=>o.strings===void 0;var ji={},Cs=(o,t=ji)=>o._$AH=t;var It=hr(class extends Le{constructor(o){if(super(o),o.type!==Gt.PROPERTY&&o.type!==Gt.ATTRIBUTE&&o.type!==Gt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!$s(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[t]){if(t===nt||t===l)return t;let e=o.element,a=o.name;if(o.type===Gt.PROPERTY){if(t===e[a])return nt}else if(o.type===Gt.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(a))return nt}else if(o.type===Gt.ATTRIBUTE&&e.getAttribute(a)===t+"")return nt;return Cs(o),t}});function q(o){if(typeof o.attachInternals!="function")return null;let t=o.attachInternals();return typeof t.setFormValue!="function"?null:t}function R(o,t,e){e===void 0?o?.setFormValue(t):o?.setFormValue(t,e)}function H(o,t,e,a){!o||typeof o.setValidity!="function"||(Object.values(t).some(Boolean)?o.setValidity(t,e,a):o.setValidity({}))}var Gi=Object.defineProperty,Zt=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Gi(t,e,r),r},gt=class extends h{constructor(){super(...arguments),this.internals=null,this.defaultChecked=!1,this.checked=!1,this.indeterminate=!1,this.disabled=!1,this.formDisabled=!1,this.required=!1,this.size="medium",this.name="",this.value="on",this.label="",this.error=""}static{this.formAssociated=!0}static{this.styles=[h.styles,v`
|
|
1108
1108
|
:host {
|
|
1109
1109
|
display: inline-flex;
|
|
1110
1110
|
vertical-align: middle;
|
|
@@ -1190,12 +1190,12 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1190
1190
|
border-color: var(--color-dark-24);
|
|
1191
1191
|
color: var(--text-disabled);
|
|
1192
1192
|
}
|
|
1193
|
-
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=
|
|
1193
|
+
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=q(this),this.defaultChecked=this.checked}willUpdate(t){if(t.has("checked")||t.has("value")||t.has("required")||t.has("error")||this.stringsChanged(t)){R(this.internals,this.checked?this.value:null);let e=this.required&&!this.checked;H(this.internals,{valueMissing:e,customError:!!this.error},this.error||(e?m().checkRequired:""))}}formResetCallback(){this.checked=this.defaultChecked,this.indeterminate=!1}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){this.checked=t===this.value}focus(t){this.input?.focus(t)}onChange(t){let e=t.target;this.checked=e.checked,this.indeterminate=!1,y(this,"kt-change",{checked:this.checked})}render(){let t=this.indeterminate?"minus":this.checked?"check":"";return d`${this.error?d`<span id="error-message" class="visually-hidden">${this.error}</span>`:l}<label part="base" class=${this.error?"error":""}>
|
|
1194
1194
|
<span class="control">
|
|
1195
1195
|
<input
|
|
1196
1196
|
part="input"
|
|
1197
1197
|
type="checkbox"
|
|
1198
|
-
.checked=${
|
|
1198
|
+
.checked=${It(this.checked)}
|
|
1199
1199
|
.indeterminate=${this.indeterminate}
|
|
1200
1200
|
?disabled=${this.inactive}
|
|
1201
1201
|
?required=${this.required}
|
|
@@ -1209,7 +1209,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1209
1209
|
</span>
|
|
1210
1210
|
</span>
|
|
1211
1211
|
<span class="text"><slot></slot></span>
|
|
1212
|
-
</label>`}};
|
|
1212
|
+
</label>`}};Zt([T("input")],gt.prototype,"input");Zt([n({type:Boolean,reflect:!0})],gt.prototype,"checked");Zt([n({type:Boolean,reflect:!0})],gt.prototype,"indeterminate");Zt([n({type:Boolean,reflect:!0})],gt.prototype,"disabled");Zt([k()],gt.prototype,"formDisabled");Zt([n({type:Boolean,reflect:!0})],gt.prototype,"required");Zt([n({type:String,reflect:!0})],gt.prototype,"size");Zt([n({type:String})],gt.prototype,"name");Zt([n({type:String})],gt.prototype,"value");Zt([n({type:String})],gt.prototype,"label");Zt([n({type:String,reflect:!0})],gt.prototype,"error");b("kt-checkbox",gt);function se(o){return o||document.documentElement.lang||navigator.language||"en"}var Ss=new Map;function Bt(o,t){let e=`${o}|${JSON.stringify(t)}`,a=Ss.get(e);return a||(a=new Intl.DateTimeFormat(o,t),Ss.set(e,a)),a}var Wi=/^(\d{4})-(\d{2})-(\d{2})$/;function Ft(o,t){return new Date(Date.UTC(o,t,0)).getUTCDate()}function rt(o){let t=Wi.exec(o?.trim()??"");if(!t)return null;let[e,a,r]=[Number(t[1]),Number(t[2]),Number(t[3])];return a<1||a>12||r<1||r>Ft(e,a)?null:{year:e,month:a,day:r}}function ke(o){let t=(e,a=2)=>String(e).padStart(a,"0");return`${t(o.year,4)}-${t(o.month)}-${t(o.day)}`}function ma(o){let[t,e]=(o??"").split("/");return{start:rt(t),end:rt(e)}}function Er(o,t){return`${ke(o)}/${ke(t)}`}function N(o,t){return o.year-t.year||o.month-t.month||o.day-t.day}function er(o,t){return o!==null&&t!==null&&N(o,t)===0}function Yi(o,t,e){let[a,r]=N(t,e)<=0?[t,e]:[e,t];return N(o,a)>=0&&N(o,r)<=0}function Xi(o){let t=new Date(o);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate()}}function ne(o,t){return Xi(Date.UTC(o.year,o.month-1,o.day+t))}function ie(o,t){let e=o.year*12+(o.month-1)+t,a=Math.floor(e/12),r=e%12+1;return{year:a,month:r,day:Math.min(o.day,Ft(a,r))}}function Zi(o){let t=new Date(Date.UTC(o.year,o.month-1,o.day)).getUTCDay();return t===0?7:t}function xo(o,t){return ne(o,-((Zi(o)-t+7)%7))}function Qi(o,t,e){let a=xo({year:o,month:t,day:1},e),r=[];for(let s=0;s<6;s+=1){let i=[];for(let p=0;p<7;p+=1)i.push(a),a=ne(a,1);r.push(i)}return r}function xt(){let o=new Date;return{year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()}}function Or(o){return new Date(o.year,o.month-1,o.day,12)}function Ps(o){try{let t=new Intl.Locale(o),e=t.getWeekInfo?.().firstDay??t.weekInfo?.firstDay;return e&&e>=1&&e<=7?e:1}catch{return 1}}var Ji=Object.defineProperty,Qt=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Ji(t,e,r),r},tn=120,en=50,rn=1e3,vt=class extends h{constructor(){super(...arguments),this.liveId=j("kt-calendar-live"),this.focusCell=!1,this.focusYear=!1,this.typed="",this.typedAt=0,this.committing=!1,this.view="day",this.month={...xt(),day:1},this.focused=xt(),this.anchor=null,this.value=null,this.range=!1,this.min="",this.max="",this.locale="",this.months=1,this.label=""}static{this.styles=[h.styles,v`
|
|
1213
1213
|
:host {
|
|
1214
1214
|
display: inline-block;
|
|
1215
1215
|
--day-size: 32px;
|
|
@@ -1456,7 +1456,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1456
1456
|
text-decoration: line-through;
|
|
1457
1457
|
cursor: not-allowed;
|
|
1458
1458
|
}
|
|
1459
|
-
`]}connectedCallback(){super.connectedCallback(),this.jumpTo(this.clamp(this.selection.start??
|
|
1459
|
+
`]}connectedCallback(){super.connectedCallback(),this.jumpTo(this.clamp(this.selection.start??xt()),!1)}willUpdate(t){if(t.has("value")&&!this.committing&&this.hasUpdated){this.anchor=null;let e=this.selection.start;e&&this.jumpTo(this.clamp(e),!1)}this.committing=!1}updated(){this.view==="month"&&this.revealYear(this.focusYear),this.focusYear=!1,this.focusCell&&(this.focusCell=!1,this.shadowRoot?.querySelector('.cell[tabindex="0"]')?.focus())}revealYear(t){let e=this.shadowRoot?.querySelector(".years"),a=e?.querySelector('[aria-selected="true"]');if(!e||!a)return;let r=a.offsetTop-e.offsetTop;t?(e.scrollTop=r-(e.clientHeight-a.offsetHeight)/2,a.focus({preventScroll:!0})):r<e.scrollTop?e.scrollTop=r:r+a.offsetHeight>e.scrollTop+e.clientHeight&&(e.scrollTop=r+a.offsetHeight-e.clientHeight)}focus(){this.focusCell=!0,this.requestUpdate()}get resolvedLocale(){return se(this.locale)}get selection(){return this.range?ma(this.value):{start:rt(this.value),end:rt(this.value)}}get bounds(){return{min:rt(this.min),max:rt(this.max)}}clamp(t){let{min:e,max:a}=this.bounds;return e&&N(t,e)<0?e:a&&N(t,a)>0?a:t}isOutOfBounds(t){let{min:e,max:a}=this.bounds;return e!==null&&N(t,e)<0||a!==null&&N(t,a)>0}isSpanOutOfBounds(t,e){let{min:a,max:r}=this.bounds;return r!==null&&N(t,r)>0||a!==null&&N(e,a)<0}format(t,e){return Bt(this.resolvedLocale,t).format(Or(e))}get monthSpan(){return this.months===2?2:1}jumpTo(t,e=!0){this.focused=t;let a=(t.year-this.month.year)*12+(t.month-this.month.month);a<0?this.month={year:t.year,month:t.month,day:1}:a>=this.monthSpan&&(this.month=ie({year:t.year,month:t.month,day:1},1-this.monthSpan)),this.focusCell=e}page(t){this.month=ie(this.month,t),this.focused=ie(this.focused,t)}setView(t){this.view=t,t==="month"?(this.focused={...this.month,day:this.focused.day},this.focusYear=!0):this.focusCell=!0}get yearRange(){let{min:t,max:e}=this.bounds,a=xt().year;return{first:t?.year??a-tn,last:e?.year??a+en}}chooseDay(t){if(this.isOutOfBounds(t))return;if(this.focused=t,!this.range){this.commit(ke(t));return}if(!this.anchor){this.anchor=t;return}let[e,a]=N(this.anchor,t)<=0?[this.anchor,t]:[t,this.anchor];this.anchor=null,this.commit(Er(e,a))}commit(t){this.committing=!0,this.value=t,y(this,"kt-change",{value:t})}chooseMonth(t){let e=Math.min(this.focused.day,Ft(this.focused.year,t));this.jumpTo(this.clamp({year:this.focused.year,month:t,day:e})),this.setView("day")}chooseYear(t,e=!0){let{first:a,last:r}=this.yearRange,s=Math.min(Math.max(t,a),r),i=Math.min(this.focused.day,Ft(s,this.focused.month));this.focused={year:s,month:this.focused.month,day:i},this.focusYear=e}onYearKeyDown(t){let{year:e}=this.focused,{first:a,last:r}=this.yearRange;if(/^\d$/.test(t.key)){let s=Date.now();this.typed=s-this.typedAt>rn?t.key:this.typed+t.key,this.typedAt=s,this.typed.length===4&&(this.chooseYear(Number(this.typed)),this.typed=""),t.preventDefault();return}switch(t.key){case"ArrowUp":this.chooseYear(e-1);break;case"ArrowDown":this.chooseYear(e+1);break;case"PageUp":this.chooseYear(e-10);break;case"PageDown":this.chooseYear(e+10);break;case"Home":this.chooseYear(a);break;case"End":this.chooseYear(r);break;case"Enter":case" ":this.focusCell=!0,this.requestUpdate();break;case"Escape":t.stopPropagation(),this.setView("day");break;default:return}t.preventDefault()}onDayKeyDown(t){let e=Ps(this.resolvedLocale),a=this.focused,r;switch(t.key){case"ArrowLeft":r=ne(a,-1);break;case"ArrowRight":r=ne(a,1);break;case"ArrowUp":r=ne(a,-7);break;case"ArrowDown":r=ne(a,7);break;case"Home":r=xo(a,e);break;case"End":r=ne(xo(a,e),6);break;case"PageUp":r=ie(a,t.shiftKey?-12:-1);break;case"PageDown":r=ie(a,t.shiftKey?12:1);break;case"Enter":case" ":t.preventDefault(),this.chooseDay(a);return;default:return}t.preventDefault(),this.jumpTo(r)}onPickerKeyDown(t){let e=r=>ie(this.focused,r),a;switch(t.key){case"ArrowLeft":a=e(-1);break;case"ArrowRight":a=e(1);break;case"ArrowUp":a=e(-3);break;case"ArrowDown":a=e(3);break;case"PageUp":a=e(-12);break;case"PageDown":a=e(12);break;case"Enter":case" ":t.preventDefault(),this.chooseMonth(this.focused.month);return;case"Escape":t.preventDefault(),t.stopPropagation(),this.setView("day");return;default:return}t.preventDefault(),this.focused=a,this.focusCell=!0}renderHeader(){let t=m(),e=this.view==="month",a=e?this.focused:this.month,r=d`<div class="navs">
|
|
1460
1460
|
<button type="button" class="nav" aria-label=${t.previousMonth} @click=${()=>this.page(-1)}>
|
|
1461
1461
|
<kt-icon name="chevron-left" size="18"></kt-icon>
|
|
1462
1462
|
</button>
|
|
@@ -1475,16 +1475,16 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1475
1475
|
</button>
|
|
1476
1476
|
${e?l:this.monthSpan===2?d`<div class="second">
|
|
1477
1477
|
<span class="second-title" aria-hidden="true"
|
|
1478
|
-
>${this.format({month:"long",year:"numeric"},
|
|
1478
|
+
>${this.format({month:"long",year:"numeric"},ie(this.month,1))}</span
|
|
1479
1479
|
>
|
|
1480
1480
|
${r}
|
|
1481
1481
|
</div>`:r}
|
|
1482
|
-
</div>`}renderDay(t,e){let a=t.month!==e.month;if(a&&this.monthSpan===2)return d`<td class="blank" role="gridcell"></td>`;let{start:r,end:s}=this.selection,i=this.anchor??r,p=this.anchor?this.focused:s,[c,u]=i&&p&&
|
|
1482
|
+
</div>`}renderDay(t,e){let a=t.month!==e.month;if(a&&this.monthSpan===2)return d`<td class="blank" role="gridcell"></td>`;let{start:r,end:s}=this.selection,i=this.anchor??r,p=this.anchor?this.focused:s,[c,u]=i&&p&&N(i,p)>0?[p,i]:[i,p],f=this.range?er(t,c)||er(t,u):er(t,r),g=this.range&&c!==null&&u!==null&&Yi(t,c,u),x=er(t,xt());return d`<td
|
|
1483
1483
|
part="day"
|
|
1484
1484
|
role="gridcell"
|
|
1485
|
-
class=${w({cell:!0,outside:a,current:x,selected:f,"in-range":
|
|
1486
|
-
data-date=${
|
|
1487
|
-
tabindex=${
|
|
1485
|
+
class=${w({cell:!0,outside:a,current:x,selected:f,"in-range":g,"range-start":g&&er(t,c),"range-end":g&&er(t,u)})}
|
|
1486
|
+
data-date=${ke(t)}
|
|
1487
|
+
tabindex=${er(t,this.focused)?0:-1}
|
|
1488
1488
|
aria-selected=${f?"true":"false"}
|
|
1489
1489
|
aria-disabled=${this.isOutOfBounds(t)?"true":l}
|
|
1490
1490
|
aria-current=${x?"date":l}
|
|
@@ -1493,7 +1493,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1493
1493
|
@pointerenter=${()=>{this.anchor&&(this.focused=t)}}
|
|
1494
1494
|
>
|
|
1495
1495
|
${t.day}
|
|
1496
|
-
</td>`}renderDays(){let t=Array.from({length:this.monthSpan},(e,a)=>this.renderMonth(
|
|
1496
|
+
</td>`}renderDays(){let t=Array.from({length:this.monthSpan},(e,a)=>this.renderMonth(ie(this.month,a)));return this.monthSpan===2?d`<div class="months">${t}</div>`:t[0]}renderMonth(t){let e=Qi(t.year,t.month,Ps(this.resolvedLocale));return d`<table
|
|
1497
1497
|
role="grid"
|
|
1498
1498
|
aria-label=${this.format({month:"long",year:"numeric"},t)}
|
|
1499
1499
|
@keydown=${this.onDayKeyDown}
|
|
@@ -1512,7 +1512,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1512
1512
|
${a.map(r=>this.renderDay(r,t))}
|
|
1513
1513
|
</tr>`)}
|
|
1514
1514
|
</tbody>
|
|
1515
|
-
</table>`}renderPicker(){let t=
|
|
1515
|
+
</table>`}renderPicker(){let t=m(),{year:e}=this.focused,a=xt(),{first:r,last:s}=this.yearRange,i=Array.from({length:s-r+1},(u,f)=>r+f),p=Array.from({length:12},(u,f)=>{let g=f+1,x={year:e,month:g,day:1};return{month:g,label:this.format({month:"short"},x),fullLabel:this.format({month:"long",year:"numeric"},x),selected:g===this.month.month&&e===this.month.year,current:g===a.month&&e===a.year,disabled:this.isSpanOutOfBounds(x,{year:e,month:g,day:Ft(e,g)})}}),c=[0,3,6,9].map(u=>p.slice(u,u+3));return d`<div class="month-year">
|
|
1516
1516
|
<div class="years" role="listbox" aria-label=${t.chooseYear} @keydown=${this.onYearKeyDown}>
|
|
1517
1517
|
${i.map(u=>d`<div
|
|
1518
1518
|
class="year"
|
|
@@ -1544,7 +1544,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1544
1544
|
</tr>`)}
|
|
1545
1545
|
</tbody>
|
|
1546
1546
|
</table>
|
|
1547
|
-
</div>`}render(){let t=
|
|
1547
|
+
</div>`}render(){let t=m(),e=this.view==="day"?this.format({month:"long",year:"numeric"},this.month):String(this.focused.year);return d`<div
|
|
1548
1548
|
part="base"
|
|
1549
1549
|
class=${w({calendar:!0,two:this.monthSpan===2})}
|
|
1550
1550
|
role="group"
|
|
@@ -1553,7 +1553,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1553
1553
|
<span id=${this.liveId} class="visually-hidden" aria-live="polite">${e}</span>
|
|
1554
1554
|
${this.renderHeader()}
|
|
1555
1555
|
<div class="body">${this.view==="day"?this.renderDays():this.renderPicker()}</div>
|
|
1556
|
-
</div>`}};
|
|
1556
|
+
</div>`}};Qt([k()],vt.prototype,"view");Qt([k()],vt.prototype,"month");Qt([k()],vt.prototype,"focused");Qt([k()],vt.prototype,"anchor");Qt([n({type:String,reflect:!0})],vt.prototype,"value");Qt([n({type:Boolean,reflect:!0})],vt.prototype,"range");Qt([n({type:String})],vt.prototype,"min");Qt([n({type:String})],vt.prototype,"max");Qt([n({type:String})],vt.prototype,"locale");Qt([n({type:Number,reflect:!0})],vt.prototype,"months");Qt([n({type:String})],vt.prototype,"label");b("kt-calendar",vt);function an(o,t,e){let a=o.length>=e.length?t:o+t;Number(a)>e.max&&(a=t);let r=a.length>=e.length||Number(a)*10>e.max;return{text:a,advance:r}}function on(o,t,e){let a=Math.abs(t)||1,r=e.min,s=e.min+Math.floor((e.max-e.min)/a)*a;if(o===null)return t>0?r:s;let i=o-e.min;if(t>0){let c=e.min+(Math.floor(i/a)+1)*a;return c>e.max?r:c}let p=i%a===0?o-a:e.min+Math.floor(i/a)*a;return p<e.min?s:p}function vo(o,t){return String(o).padStart(t.length,"0")}var sn=Object.defineProperty,At=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&sn(t,e,r),r},As=o=>"key"in o,nn=new Set(["/",".","-",":",","," "]),Q=class extends h{constructor(){super(...arguments),this.internals=null,this.defaultValue=null,this.committing=!1,this.errorId=j("kt-segmented-error"),this.texts={},this.typedError="",this.focusedKey=null,this.formDisabled=!1,this.value=null,this.name="",this.label="",this.locale="",this.min="",this.max="",this.size="medium",this.disabled=!1,this.required=!1,this.error=""}static{this.formAssociated=!0}static{this.styles=[h.styles,v`
|
|
1557
1557
|
:host {
|
|
1558
1558
|
display: block;
|
|
1559
1559
|
--field-height: var(--button-height);
|
|
@@ -1638,7 +1638,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1638
1638
|
flex: none;
|
|
1639
1639
|
color: var(--color-danger-text);
|
|
1640
1640
|
}
|
|
1641
|
-
`]}renderAfter(){return l}completeOnBlur(t,e){return null}get expanded(){return!1}connectedCallback(){super.connectedCallback(),this.internals??=
|
|
1641
|
+
`]}renderAfter(){return l}completeOnBlur(t,e){return null}get expanded(){return!1}connectedCallback(){super.connectedCallback(),this.internals??=q(this),this.defaultValue=this.value,this.texts=this.fill(this.value)}willUpdate(t){if((t.has("value")||t.has("locale"))&&!this.committing&&(this.texts=this.fill(this.value),this.typedError=""),this.committing=!1,t.has("value")||t.has("required")||t.has("error")||t.has("typedError")||this.stringsChanged(t)){R(this.internals,this.value);let e=this.required&&this.value===null&&!this.typedError;H(this.internals,{valueMissing:e,badInput:!!this.typedError,customError:!!this.error},this.error||this.typedError||(e?this.requiredMessage():""))}}formResetCallback(){this.value=this.defaultValue,this.texts=this.fill(this.value),this.typedError=""}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){this.value=t}focus(t){this.segmentElements()[0]?.focus(t)}get inactive(){return this.disabled||this.formDisabled}get resolvedLocale(){return se(this.locale)}commitValue(t){this.texts=this.fill(t),this.typedError="",this.apply(t)}setText(t,e){this.texts={...this.texts,[t]:e};let{value:a,error:r}=this.read(this.texts);this.typedError=r,this.apply(a)}apply(t){t!==this.value&&(this.committing=!0,this.value=t,y(this,"kt-change",{value:t}))}segmentElements(){return[...this.shadowRoot?.querySelectorAll('[role="spinbutton"]')??[]]}focusSegment(t){this.segmentElements()[t]?.focus()}applyKey(t,e,a){let r=this.texts[e.key]??"";if(/^\d$/.test(t)&&e.spec){let s=an(r,t,e.spec);return this.setText(e.key,s.text),s.advance&&this.focusSegment(a+1),!0}if(e.choices&&/^\p{L}$/u.test(t)){let s=e.choices.findIndex(i=>i.toLowerCase().startsWith(t.toLowerCase()));return s>=0&&(this.setText(e.key,String(s)),this.focusSegment(a+1)),!0}switch(t){case"ArrowUp":case"ArrowDown":{let s=t==="ArrowUp"?1:-1;if(e.spec){let i=r===""?null:Number(r),p=on(i,s*(e.step??1),e.spec);this.setText(e.key,vo(p,e.spec))}else if(e.choices){let i=e.choices.length,p=r===""?s>0?-1:0:Number(r);this.setText(e.key,String((p+s+i)%i))}return!0}case"Home":case"End":if(e.spec){let s=t==="Home"?e.spec.min:e.spec.max;this.setText(e.key,vo(s,e.spec))}return!0;case"ArrowLeft":return this.focusSegment(a-1),!0;case"ArrowRight":return this.focusSegment(a+1),!0;case"Backspace":case"Delete":return r?this.setText(e.key,e.choices?"":r.slice(0,-1)):t==="Backspace"&&this.focusSegment(a-1),!0;default:return nn.has(t)?(r&&this.focusSegment(a+1),!0):t.length===1}}onKeyDown(t,e,a){this.inactive||t.metaKey||t.ctrlKey||t.altKey||this.applyKey(t.key,e,a)&&t.preventDefault()}onBeforeInput(t,e,a){if(t.preventDefault(),!this.inactive){if(t.inputType.startsWith("delete")){this.applyKey("Backspace",e,a);return}for(let r of t.data??"")this.applyKey(r,e,a)}}onFieldClick(t){if(this.inactive||t.target.closest('[role="spinbutton"], button, kt-tooltip'))return;let e=this.items().filter(As),a=e.findIndex(r=>!this.texts[r.key]);this.focusSegment(a>=0?a:e.length-1)}renderSegment(t,e){let a=this.texts[t.key]??"",r=this.focusedKey===t.key,s=t.placeholder,i=l;return a!==""&&(i=Number(a),t.choices?s=t.choices[Number(a)]??"":t.spec&&(s=r?a:vo(Number(a),t.spec))),d`<span
|
|
1642
1642
|
part="segment"
|
|
1643
1643
|
role="spinbutton"
|
|
1644
1644
|
class=${w({segment:!0,empty:a===""})}
|
|
@@ -1671,13 +1671,13 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1671
1671
|
@click=${this.onFieldClick}
|
|
1672
1672
|
>
|
|
1673
1673
|
<div class="segments">
|
|
1674
|
-
${this.items().map(a=>
|
|
1674
|
+
${this.items().map(a=>As(a)?(e+=1,this.renderSegment(a,e)):d`<span class="literal" aria-hidden="true">${a.literal}</span>`)}
|
|
1675
1675
|
</div>
|
|
1676
1676
|
${t?d`<kt-tooltip class="error-icon" text=${t} ?open=${this.focusedKey!==null}>
|
|
1677
1677
|
<kt-icon name="circle-alert" size="18"></kt-icon>
|
|
1678
1678
|
</kt-tooltip>`:l}
|
|
1679
1679
|
${this.renderAfter()}
|
|
1680
|
-
</div>`}};
|
|
1680
|
+
</div>`}};At([k()],Q.prototype,"texts");At([k()],Q.prototype,"typedError");At([k()],Q.prototype,"focusedKey");At([k()],Q.prototype,"formDisabled");At([n({type:String,reflect:!0})],Q.prototype,"value");At([n({type:String})],Q.prototype,"name");At([n({type:String})],Q.prototype,"label");At([n({type:String})],Q.prototype,"locale");At([n({type:String})],Q.prototype,"min");At([n({type:String})],Q.prototype,"max");At([n({type:String,reflect:!0})],Q.prototype,"size");At([n({type:Boolean,reflect:!0})],Q.prototype,"disabled");At([n({type:Boolean,reflect:!0})],Q.prototype,"required");At([n({type:String,reflect:!0})],Q.prototype,"error");function bo(o){return o.normalize("NFD").replace(/\p{Diacritic}/gu,"").replace(/\.$/,"").toLowerCase()}function Ms(o){let t=Bt(o,{day:"2-digit",month:"2-digit",year:"numeric"}).formatToParts(new Date(2026,8,30)).find(e=>e.type==="literal")?.value.trim()||"/";return{order:Ds(o),separator:t}}function Ds(o){let t=Bt(o,{day:"2-digit",month:"2-digit",year:"numeric"}).formatToParts(new Date(2026,8,30)).map(e=>e.type).filter(e=>["day","month","year"].includes(e));return t.length===3?t:["day","month","year"]}function ln(o,t){let e=bo(o);if(e.length<3)return null;let a=new Set;for(let r=1;r<=12;r+=1){let s=new Date(2026,r-1,1),i=bo(Bt(t,{month:"long"}).format(s)),p=bo(Bt(t,{month:"short"}).format(s));(i.startsWith(e)||p===e)&&a.add(r)}return a.size===1?[...a][0]:null}function yo(o,t){if(o.length===4)return Number(o);if(o.length>2)return null;let e=2e3+Number(o);return e>t+20?e-100:e}function ko(o,t,e){return t<1||t>12||e<1||e>Ft(o,t)?null:{year:o,month:t,day:e}}function wo(o,t,e){let a=o.trim();if(!a)return null;let r=/^\d{4}-\d{1,2}-\d{1,2}$/.test(a)?rt(a.replace(/-(\d)(?=-|$)/g,"-0$1")):null;if(r)return{date:r,typedYear:!0};let s=[],i=null;for(let x of a.split(/[\s/.,-]+/).filter(Boolean)){if(/^\d+$/.test(x)){s.push(x);continue}let $=ln(x,t);if($===null||i!==null)return null;i=$}if(i!==null){if(s.length===0||s.length>2)return null;let x=s.findIndex(P=>P.length===4||Number(P)>31),$=s.find((P,L)=>L!==x);if($===void 0||s.length===2&&x<0)return null;let M=x>=0?yo(s[x],e.year):e.year;if(M===null)return null;let S=ko(M,i,Number($));return S&&{date:S,typedYear:x>=0}}if(s.length<2||s.length>3)return null;let p=s[0].length===4?["year","month","day"]:dn(Ds(t),s.length),c=x=>s[p.indexOf(x)],u=c("year"),f=u===void 0?e.year:yo(u,e.year);if(f===null)return null;let g=ko(f,Number(c("month")),Number(c("day")));return g&&{date:g,typedYear:u!==void 0}}function dn(o,t){return t===3?o:o.filter(e=>e!=="year")}function Ts(o,t){return yo(o,t)}function Bs(o,t,e){return wo(o,t,e)?.date??null}function Ls(o,t,e){let a=o.split(/\s*[–—]\s*|\s+-\s+|\s+(?:to|au|bis|à)\s+/i);if(a.length!==2)return null;let r=wo(a[1],t,e);if(!r)return null;let s=wo(a[0],t,{...e,year:r.date.year});if(!s)return null;let i=s.date;if(!s.typedYear&&N(i,r.date)>0){let p=ko(i.year-1,i.month,i.day);p&&(i=p)}return N(i,r.date)<=0?{start:i,end:r.date}:{start:r.date,end:i}}function ga(o,t){return Bt(o,{day:"2-digit",month:"2-digit",year:"numeric"}).format(new Date(t.year,t.month-1,t.day,12))}var pn=Object.defineProperty,xr=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&pn(t,e,r),r},cn="kt-tooltip-description",le=class extends h{constructor(){super(...arguments),this.descriptionId=j("kt-tooltip"),this.visible=!1,this.text="",this.placement="top",this.open=!1,this.disabled=!1,this.show=()=>{!this.disabled&&this.text&&(this.visible=!0)},this.hide=()=>{this.visible=!1},this.onKeyDown=t=>{t.key==="Escape"&&this.visible&&(t.stopPropagation(),this.visible=!1)}}static{this.styles=[h.styles,v`
|
|
1681
1681
|
:host {
|
|
1682
1682
|
position: relative;
|
|
1683
1683
|
display: inline-flex;
|
|
@@ -1740,7 +1740,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1740
1740
|
transition: none;
|
|
1741
1741
|
}
|
|
1742
1742
|
}
|
|
1743
|
-
`]}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.show),this.addEventListener("pointerleave",this.hide),this.addEventListener("focusin",this.show),this.addEventListener("focusout",this.hide),this.addEventListener("keydown",this.onKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("pointerenter",this.show),this.removeEventListener("pointerleave",this.hide),this.removeEventListener("focusin",this.show),this.removeEventListener("focusout",this.hide),this.removeEventListener("keydown",this.onKeyDown),this.description?.remove(),this.visible=!1,this.closeBubble()}willUpdate(t){t.has("text")&&this.syncDescription()}get shown(){return(this.visible||this.open)&&!this.disabled&&!!this.text}updated(t){["visible","open","text","disabled"].some(e=>t.has(e))&&(this.shown?this.openBubble():this.closeBubble())}openBubble(){let t=this.bubble;if(typeof t.showPopover!="function")return;t.matches(":popover-open")||t.showPopover();let e=this.getBoundingClientRect(),{x:a,y:r}=
|
|
1743
|
+
`]}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.show),this.addEventListener("pointerleave",this.hide),this.addEventListener("focusin",this.show),this.addEventListener("focusout",this.hide),this.addEventListener("keydown",this.onKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("pointerenter",this.show),this.removeEventListener("pointerleave",this.hide),this.removeEventListener("focusin",this.show),this.removeEventListener("focusout",this.hide),this.removeEventListener("keydown",this.onKeyDown),this.description?.remove(),this.visible=!1,this.closeBubble()}willUpdate(t){t.has("text")&&this.syncDescription()}get shown(){return(this.visible||this.open)&&!this.disabled&&!!this.text}updated(t){["visible","open","text","disabled"].some(e=>t.has(e))&&(this.shown?this.openBubble():this.closeBubble())}openBubble(){let t=this.bubble;if(typeof t.showPopover!="function")return;t.matches(":popover-open")||t.showPopover();let e=this.getBoundingClientRect(),{x:a,y:r}=ha(e,t.getBoundingClientRect(),{width:window.innerWidth,height:window.innerHeight},this.placement);t.style.left=`${a}px`,t.style.top=`${r}px`,window.addEventListener("scroll",this.hide,{capture:!0,passive:!0}),window.addEventListener("resize",this.hide)}closeBubble(){window.removeEventListener("scroll",this.hide,{capture:!0}),window.removeEventListener("resize",this.hide);let t=this.bubble;typeof t?.hidePopover=="function"&&t.matches(":popover-open")&&t.hidePopover()}syncDescription(){if(!this.text){this.description?.remove(),this.description=void 0;return}this.description||(this.description=document.createElement("span"),this.description.id=this.descriptionId,this.description.slot=cn,this.append(this.description)),this.description.textContent=this.text;for(let t of this.children)t!==this.description&&t.setAttribute("aria-describedby",this.descriptionId)}render(){return d`<slot @slotchange=${this.syncDescription}></slot>
|
|
1744
1744
|
<span
|
|
1745
1745
|
part="bubble"
|
|
1746
1746
|
popover="manual"
|
|
@@ -1748,7 +1748,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1748
1748
|
role="tooltip"
|
|
1749
1749
|
aria-hidden=${this.shown?"false":"true"}
|
|
1750
1750
|
>${this.text}</span
|
|
1751
|
-
>`}};
|
|
1751
|
+
>`}};xr([k()],le.prototype,"visible");xr([T(".bubble")],le.prototype,"bubble");xr([n({type:String})],le.prototype,"text");xr([n({type:String,reflect:!0})],le.prototype,"placement");xr([n({type:Boolean,reflect:!0})],le.prototype,"open");xr([n({type:Boolean,reflect:!0})],le.prototype,"disabled");b("kt-tooltip",le);var un=Object.defineProperty,xa=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&un(t,e,r),r},ze=class extends Q{constructor(){super(...arguments),this.calendar=!1,this.open=!1,this.placement="bottom",this.panelId=j("kt-date-input-panel"),this.floating=new dt(this,{panel:()=>this.shadowRoot?.querySelector(".panel"),anchor:()=>this.shadowRoot?.querySelector(".field"),onPlace:t=>{this.placement=t==="top"?"top":"bottom"}}),this.onDocumentPointerDown=t=>{t.composedPath().includes(this)||this.close(!1)}}static{this.styles=[Q.styles,Pt,v`
|
|
1752
1752
|
:host {
|
|
1753
1753
|
position: relative;
|
|
1754
1754
|
}
|
|
@@ -1811,7 +1811,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1811
1811
|
opacity var(--duration-fast) var(--easing-standard),
|
|
1812
1812
|
transform var(--duration-fast) var(--easing-standard);
|
|
1813
1813
|
}
|
|
1814
|
-
`]}items(){let t=
|
|
1814
|
+
`]}items(){let t=m(),{order:e,separator:a}=Ms(this.resolvedLocale),r=Number(this.texts.month)||0,s=this.texts.year?.length===4?Number(this.texts.year):2e3,i=r>=1&&r<=12?Ft(s,r):31,p={day:{key:"day",label:t.segmentDay,placeholder:t.placeholderDay,spec:{min:1,max:i,length:2}},month:{key:"month",label:t.segmentMonth,placeholder:t.placeholderMonth,spec:{min:1,max:12,length:2}},year:{key:"year",label:t.segmentYear,placeholder:t.placeholderYear,spec:{min:1,max:9999,length:4}}},c=[];return e.forEach((u,f)=>{f>0&&c.push({literal:a}),c.push(p[u])}),c}fill(t){let e=rt(t);return e?{day:String(e.day).padStart(2,"0"),month:String(e.month).padStart(2,"0"),year:String(e.year).padStart(4,"0")}:{day:"",month:"",year:""}}read(t){let{day:e="",month:a="",year:r=""}=t;if(!e||!a||r.length<4)return{value:null,error:""};let s=xt(),i={value:null,error:m().dateInvalid(ga(this.resolvedLocale,s))},p={year:Number(r),month:Number(a),day:Number(e)};if(p.month<1||p.month>12||p.day<1||p.day>Ft(p.year,p.month))return i;let c=rt(this.min),u=rt(this.max);return c&&N(p,c)<0||u&&N(p,u)>0?{value:null,error:m().dateOutOfRange}:{value:ke(p),error:""}}completeOnBlur(t,e){if(t.key!=="year"||e.length===0||e.length>2)return null;let a=Ts(e,xt().year);return a===null?null:String(a).padStart(4,"0")}requiredMessage(){return m().dateRequired}get expanded(){return this.open}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentPointerDown)}updated(t){t.has("open")&&J(this.open,document,"pointerdown",this.onDocumentPointerDown),this.floating.sync(this.open)}async toggleCalendar(){if(this.open){this.close(!0);return}this.inactive||(this.open=!0,await this.updateComplete,this.calendarElement?.focus())}close(t){this.open&&(this.open=!1,t&&this.focus())}onCalendarChange(t){t.stopPropagation(),this.commitValue(t.detail.value),this.close(!0)}onPanelKeyDown(t){t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),this.close(!0))}renderAfter(){if(!this.calendar)return l;let t=m();return d`<button
|
|
1815
1815
|
part="trigger"
|
|
1816
1816
|
type="button"
|
|
1817
1817
|
class="trigger"
|
|
@@ -1842,7 +1842,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
1842
1842
|
label=${this.label}
|
|
1843
1843
|
@kt-change=${this.onCalendarChange}
|
|
1844
1844
|
></kt-calendar>`:l}
|
|
1845
|
-
</div>`}};
|
|
1845
|
+
</div>`}};xa([n({type:Boolean,reflect:!0})],ze.prototype,"calendar");xa([k()],ze.prototype,"open");xa([k()],ze.prototype,"placement");xa([T("kt-calendar")],ze.prototype,"calendarElement");b("kt-date-input",ze);var hn=Object.defineProperty,_=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&hn(t,e,r),r};function fn(){let o=m(),t=xt(),e={...t,day:1},a=ie(e,-1),r=(s,i)=>Er(s,i);return[{label:o.presetToday,value:r(t,t)},{label:o.presetLast7Days,value:r(ne(t,-6),t)},{label:o.presetLast30Days,value:r(ne(t,-29),t)},{label:o.presetThisMonth,value:r(e,t)},{label:o.presetLastMonth,value:r(a,{...a,day:Ft(a.year,a.month)})},{label:o.presetThisYear,value:r({year:t.year,month:1,day:1},t)}]}var U=class $o extends h{constructor(){super(...arguments),this.internals=null,this.defaultValue=null,this.panelId=j("kt-date-picker-panel"),this.open=!1,this.text="",this.editing=!1,this.typedError="",this.focused=!1,this.compact=!1,this.placement="bottom",this.floating=new dt(this,{panel:()=>this.shadowRoot?.querySelector(".panel"),anchor:()=>this.shadowRoot?.querySelector(".field"),onPlace:t=>{this.placement=t==="top"?"top":"bottom"}}),this.value=null,this.range=!1,this.min="",this.max="",this.name="",this.label="",this.placeholder=void 0,this.locale="",this.size="medium",this.disabled=!1,this.formDisabled=!1,this.required=!1,this.clearable=!0,this.presets=void 0,this.error="",this.onDocumentPointerDown=t=>{this.open&&!t.composedPath().includes(this)&&this.close(!1)},this.onFocusOut=t=>{let e=t.relatedTarget;!this.open||!e||this.contains(e)||this.shadowRoot?.contains(e)||t.composedPath().includes(e)||this.calendar?.shadowRoot?.contains(e)||this.close(!1)}}static{this.formAssociated=!0}static{this.styles=[h.styles,Pt,v`
|
|
1846
1846
|
:host {
|
|
1847
1847
|
position: relative;
|
|
1848
1848
|
display: block;
|
|
@@ -2054,11 +2054,11 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2054
2054
|
color: var(--color-primary-text);
|
|
2055
2055
|
font-weight: 600;
|
|
2056
2056
|
}
|
|
2057
|
-
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=
|
|
2057
|
+
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=q(this),this.defaultValue=this.value,J(this.open,document,"pointerdown",this.onDocumentPointerDown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentPointerDown)}updated(t){t.has("open")&&J(this.open,document,"pointerdown",this.onDocumentPointerDown),this.floating.sync(this.open)}willUpdate(t){if(t.has("value")||t.has("range")||t.has("required")||t.has("error")||t.has("typedError")||this.stringsChanged(t)){let e=this.isComplete();R(this.internals,e?this.value:null);let a=this.required&&!e;H(this.internals,{valueMissing:a,badInput:!!this.typedError,customError:!!this.error},this.error||this.typedError||(a?m().dateRequired:""))}}formResetCallback(){this.value=this.defaultValue,this.editing=!1,this.typedError="",this.close(!1)}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){this.value=t}focus(t){this.input?.focus(t)}get resolvedLocale(){return se(this.locale)}get selection(){return this.range?ma(this.value):{start:rt(this.value),end:rt(this.value)}}isComplete(){let{start:t,end:e}=this.selection;return t!==null&&e!==null&&N(t,e)<=0}display(){let{start:t,end:e}=this.selection;if(!t||!e)return null;let a=Bt(this.resolvedLocale,{dateStyle:"medium"});return this.range?a.formatRange(Or(t),Or(e)):a.format(Or(t))}static{this.WIDE_ENOUGH=720}async show(){this.inactive||this.open||(this.compact=window.innerWidth<$o.WIDE_ENOUGH,this.open=!0,await this.updateComplete,this.calendar?.focus())}close(t){this.open&&(this.open=!1,t&&this.focus())}toggle(){this.open?this.close(!0):this.show()}openForTyping(){this.inactive||this.open||(this.compact=window.innerWidth<$o.WIDE_ENOUGH,this.open=!0)}onCalendarChange(t){t.stopPropagation(),this.editing=!1,this.typedError="",this.value=t.detail.value,this.close(!0),y(this,"kt-change",{value:this.value})}apply(t){this.editing=!1,this.typedError="",this.close(!0),t!==this.value&&(this.value=t,y(this,"kt-change",{value:t}))}outOfBounds(t){let{start:e,end:a}=ma(t),r=rt(this.min),s=rt(this.max);return!e||!a?!0:r!==null&&N(e,r)<0||s!==null&&N(a,s)>0}renderPresets(){let t=this.presets??fn();return!this.range||t.length===0?l:d`<div
|
|
2058
2058
|
part="presets"
|
|
2059
2059
|
class="presets"
|
|
2060
2060
|
role="group"
|
|
2061
|
-
aria-label=${
|
|
2061
|
+
aria-label=${m().selectPeriod}
|
|
2062
2062
|
>
|
|
2063
2063
|
${t.map(e=>d`<button
|
|
2064
2064
|
type="button"
|
|
@@ -2068,7 +2068,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2068
2068
|
>
|
|
2069
2069
|
${e.label}
|
|
2070
2070
|
</button>`)}
|
|
2071
|
-
</div>`}clear(){this.editing=!1,this.typedError="",this.value=null,y(this,"kt-change",{value:null}),this.focus()}onInput(t){this.text=t.target.value,this.editing=!0}commitTyped(){if(!this.editing)return;this.editing=!1;let t=this.text.trim();if(!t){this.typedError="",this.value!==null&&(this.value=null,y(this,"kt-change",{value:null}));return}let e=this.resolvedLocale,a=
|
|
2071
|
+
</div>`}clear(){this.editing=!1,this.typedError="",this.value=null,y(this,"kt-change",{value:null}),this.focus()}onInput(t){this.text=t.target.value,this.editing=!0}commitTyped(){if(!this.editing)return;this.editing=!1;let t=this.text.trim();if(!t){this.typedError="",this.value!==null&&(this.value=null,y(this,"kt-change",{value:null}));return}let e=this.resolvedLocale,a=xt(),r=this.range?Ls(t,e,a):(()=>{let c=Bs(t,e,a);return c&&{start:c,end:c}})();if(!r){this.text=t,this.editing=!0,this.typedError=m().dateInvalid(ga(e,a));return}let s=rt(this.min),i=rt(this.max);if(s&&N(r.start,s)<0||i&&N(r.end,i)>0){this.text=t,this.editing=!0,this.typedError=m().dateOutOfRange;return}this.typedError="";let p=this.range?Er(r.start,r.end):ke(r.start);p!==this.value&&(this.value=p,y(this,"kt-change",{value:p}))}onInputKeyDown(t){switch(t.key){case"Enter":t.preventDefault(),this.commitTyped(),this.typedError||this.close(!1);return;case"Escape":if(!this.editing&&!this.open)return;t.preventDefault(),t.stopPropagation(),this.editing=!1,this.typedError="",this.close(!1);return;case"ArrowDown":t.preventDefault(),this.show()}}onPanelKeyDown(t){t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),this.close(!0))}render(){let t=m(),e=this.display(),a=this.placeholder??(this.range?t.selectPeriod:t.selectDate),r=this.error||this.typedError,s=this.clearable&&this.value!==null&&!this.inactive&&!this.editing&&!r;return d`${r?d`<span id="error-message" class="visually-hidden">${r}</span>`:l}
|
|
2072
2072
|
<div
|
|
2073
2073
|
class=${w({open:this.open,error:!!r})}
|
|
2074
2074
|
@focusout=${this.onFocusOut}
|
|
@@ -2090,7 +2090,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2090
2090
|
</button>
|
|
2091
2091
|
<input
|
|
2092
2092
|
part="input"
|
|
2093
|
-
.value=${
|
|
2093
|
+
.value=${It(this.editing?this.text:e??"")}
|
|
2094
2094
|
placeholder=${a}
|
|
2095
2095
|
autocomplete="off"
|
|
2096
2096
|
aria-label=${this.label||a}
|
|
@@ -2140,8 +2140,8 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2140
2140
|
<button
|
|
2141
2141
|
type="button"
|
|
2142
2142
|
class="today"
|
|
2143
|
-
?disabled=${this.outOfBounds(
|
|
2144
|
-
@click=${()=>this.apply(
|
|
2143
|
+
?disabled=${this.outOfBounds(Er(xt(),xt()))}
|
|
2144
|
+
@click=${()=>this.apply(ke(xt()))}
|
|
2145
2145
|
>
|
|
2146
2146
|
${t.presetToday}
|
|
2147
2147
|
</button>
|
|
@@ -2149,7 +2149,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2149
2149
|
</div>
|
|
2150
2150
|
</div>`:l}
|
|
2151
2151
|
</div>
|
|
2152
|
-
</div>`}};_([T("input")],
|
|
2152
|
+
</div>`}};_([T("input")],U.prototype,"input");_([T("kt-calendar")],U.prototype,"calendar");_([k()],U.prototype,"open");_([k()],U.prototype,"text");_([k()],U.prototype,"editing");_([k()],U.prototype,"typedError");_([k()],U.prototype,"focused");_([k()],U.prototype,"compact");_([k()],U.prototype,"placement");_([n({type:String,reflect:!0})],U.prototype,"value");_([n({type:Boolean,reflect:!0})],U.prototype,"range");_([n({type:String})],U.prototype,"min");_([n({type:String})],U.prototype,"max");_([n({type:String})],U.prototype,"name");_([n({type:String})],U.prototype,"label");_([n({type:String})],U.prototype,"placeholder");_([n({type:String})],U.prototype,"locale");_([n({type:String,reflect:!0})],U.prototype,"size");_([n({type:Boolean,reflect:!0})],U.prototype,"disabled");_([k()],U.prototype,"formDisabled");_([n({type:Boolean,reflect:!0})],U.prototype,"required");_([n({type:Boolean})],U.prototype,"clearable");_([n({attribute:!1})],U.prototype,"presets");_([n({type:String,reflect:!0})],U.prototype,"error");var Es=U;b("kt-date-picker",Es);var Os=["B","KB","MB","GB","TB"];function mn(o){if(!Number.isFinite(o)||o<0)return"";let t=o,e=0;for(;t>=1024&&e<Os.length-1;)t/=1024,e+=1;return`${e===0?String(Math.round(t)):t.toFixed(1)} ${Os[e]}`}var gn=Object.defineProperty,Lt=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&gn(t,e,r),r},st=class extends h{constructor(){super(...arguments),this.internals=null,this.dragging=!1,this.files=[],this.heading=void 0,this.linkText=void 0,this.recommendedSize="",this.multiple=!0,this.accept="",this.maxSize=0,this.disabled=!1,this.formDisabled=!1,this.name="",this.required=!1}static{this.formAssociated=!0}static{this.styles=[h.styles,v`
|
|
2153
2153
|
:host {
|
|
2154
2154
|
display: block;
|
|
2155
2155
|
user-select: none;
|
|
@@ -2272,13 +2272,13 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2272
2272
|
color: var(--text-muted);
|
|
2273
2273
|
font: var(--font-normal-small);
|
|
2274
2274
|
}
|
|
2275
|
-
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=
|
|
2275
|
+
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=q(this)}willUpdate(t){(t.has("files")||t.has("name")||t.has("required")||this.stringsChanged(t))&&this.syncFormValue()}syncFormValue(){let t=null;if(this.name&&this.files.length>0){t=new FormData;for(let a of this.files)t.append(this.name,a)}R(this.internals,t);let e=this.required&&this.files.length===0;H(this.internals,{valueMissing:e},e?m().selectFile:"")}formResetCallback(){this.files=[],this.dragging=!1}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){!(t instanceof FormData)||!this.name||(this.files=t.getAll(this.name).filter(e=>e instanceof File))}get selectedFiles(){return this.files}clear(){this.files=[],y(this,"kt-files-change",{files:this.files})}accepts(t){return this.maxSize>0&&t.size>this.maxSize?!1:this.accept?this.accept.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean).some(e=>e.startsWith(".")?t.name.toLowerCase().endsWith(e):e.endsWith("/*")?t.type.startsWith(e.slice(0,-1)):t.type.toLowerCase()===e):!0}addFiles(t){if(!t||t.length===0)return;let e=this.multiple?[...t]:[...t].slice(0,1),a=e.filter(s=>this.accepts(s)),r=e.filter(s=>!this.accepts(s));r.length>0&&y(this,"kt-files-rejected",{files:r,reason:this.maxSize>0&&r.some(s=>s.size>this.maxSize)?"size":"type"}),a.length!==0&&(this.files=this.multiple?[...this.files,...a]:a,y(this,"kt-files-change",{files:this.files}))}removeAt(t){this.files=this.files.filter((e,a)=>a!==t),y(this,"kt-files-change",{files:this.files})}browse(){this.inactive||this.fileInput?.click()}onZoneKeyDown(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),this.browse())}onDragOver(t){this.inactive||(t.preventDefault(),this.dragging=!0)}onDrop(t){this.inactive||(t.preventDefault(),this.dragging=!1,this.addFiles(t.dataTransfer?.files??null))}render(){return d`<div
|
|
2276
2276
|
part="base"
|
|
2277
2277
|
class=${w({zone:!0,dragover:this.dragging})}
|
|
2278
2278
|
role="button"
|
|
2279
2279
|
tabindex=${this.inactive?-1:0}
|
|
2280
2280
|
aria-disabled=${this.inactive?"true":l}
|
|
2281
|
-
aria-label=${`${this.heading??
|
|
2281
|
+
aria-label=${`${this.heading??m().dragAndDrop} ${this.linkText??m().browseFiles}`}
|
|
2282
2282
|
@click=${this.browse}
|
|
2283
2283
|
@keydown=${this.onZoneKeyDown}
|
|
2284
2284
|
@dragover=${this.onDragOver}
|
|
@@ -2297,16 +2297,16 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2297
2297
|
<span class="prompt-icon"><kt-icon name="file-up" size="24"></kt-icon></span>
|
|
2298
2298
|
<div>
|
|
2299
2299
|
<p class="title">
|
|
2300
|
-
${this.heading??
|
|
2300
|
+
${this.heading??m().dragAndDrop} ${this.linkText??m().browseFiles}
|
|
2301
2301
|
</p>
|
|
2302
|
-
${this.recommendedSize?d`<div class="hint">${
|
|
2302
|
+
${this.recommendedSize?d`<div class="hint">${m().recommendedSize(this.recommendedSize)}</div>`:l}
|
|
2303
2303
|
</div>
|
|
2304
2304
|
</div>
|
|
2305
2305
|
|
|
2306
2306
|
${this.files.length>0?d`<ul
|
|
2307
2307
|
part="list"
|
|
2308
2308
|
class="list"
|
|
2309
|
-
aria-label=${
|
|
2309
|
+
aria-label=${m().selectedFiles}
|
|
2310
2310
|
@click=${t=>t.stopPropagation()}
|
|
2311
2311
|
>
|
|
2312
2312
|
${this.files.map((t,e)=>d`<li class="item">
|
|
@@ -2314,7 +2314,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2314
2314
|
<span class="info">
|
|
2315
2315
|
<span class="name" title=${t.name}>${t.name}</span>
|
|
2316
2316
|
<span class="details">
|
|
2317
|
-
<span>${
|
|
2317
|
+
<span>${mn(t.size)}</span>
|
|
2318
2318
|
${t.type?d`<span>•</span><span>${t.type}</span>`:l}
|
|
2319
2319
|
</span>
|
|
2320
2320
|
</span>
|
|
@@ -2322,12 +2322,12 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2322
2322
|
variant="danger"
|
|
2323
2323
|
size="small"
|
|
2324
2324
|
icon="trash-2"
|
|
2325
|
-
label=${
|
|
2325
|
+
label=${m().remove(t.name)}
|
|
2326
2326
|
@click=${()=>this.removeAt(e)}
|
|
2327
2327
|
></kt-button>
|
|
2328
2328
|
</li>`)}
|
|
2329
2329
|
</ul>`:l}
|
|
2330
|
-
</div>`}};
|
|
2330
|
+
</div>`}};Lt([T('input[type="file"]')],st.prototype,"fileInput");Lt([k()],st.prototype,"dragging");Lt([k()],st.prototype,"files");Lt([n({type:String})],st.prototype,"heading");Lt([n({type:String,attribute:"link-text"})],st.prototype,"linkText");Lt([n({type:String,attribute:"recommended-size"})],st.prototype,"recommendedSize");Lt([n({type:Boolean})],st.prototype,"multiple");Lt([n({type:String})],st.prototype,"accept");Lt([n({type:Number,attribute:"max-size"})],st.prototype,"maxSize");Lt([n({type:Boolean,reflect:!0})],st.prototype,"disabled");Lt([k()],st.prototype,"formDisabled");Lt([n({type:String})],st.prototype,"name");Lt([n({type:Boolean,reflect:!0})],st.prototype,"required");b("kt-drag-drop",st);var xn=Object.defineProperty,Rr=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&xn(t,e,r),r},vn={text:"14px",rect:"80px",circle:"40px"},we=class extends h{constructor(){super(...arguments),this.variant="text",this.width="",this.height="",this.count=1,this.animated=!0}static{this.styles=[h.styles,v`
|
|
2331
2331
|
:host {
|
|
2332
2332
|
display: block;
|
|
2333
2333
|
}
|
|
@@ -2374,11 +2374,11 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2374
2374
|
`]}line(t,e){let a=e&&this.count>1&&this.variant==="text";return d`<span
|
|
2375
2375
|
part="line"
|
|
2376
2376
|
class=${w({line:!0,[this.variant]:!0,pulse:this.animated})}
|
|
2377
|
-
style=${
|
|
2377
|
+
style=${Tt({width:a?"60%":this.width||(this.variant==="circle"?"40px":"100%"),height:this.height||vn[this.variant]})}
|
|
2378
2378
|
data-index=${t}
|
|
2379
2379
|
></span>`}render(){return this.count<=1?this.line(0,!1):d`<span class="group">
|
|
2380
2380
|
${Array.from({length:this.count},(t,e)=>this.line(e,e===this.count-1))}
|
|
2381
|
-
</span>`}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}};
|
|
2381
|
+
</span>`}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}};Rr([n({type:String,reflect:!0})],we.prototype,"variant");Rr([n({type:String})],we.prototype,"width");Rr([n({type:String})],we.prototype,"height");Rr([n({type:Number})],we.prototype,"count");Rr([n({type:Boolean})],we.prototype,"animated");b("kt-skeleton",we);var bn=Object.defineProperty,rr=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&bn(t,e,r),r},Jt=class extends h{constructor(){super(...arguments),this.hasFooter=!1,this.heading="",this.description="",this.loading=!1,this.disabled=!1,this.loadingFields=3}static{this.styles=[h.styles,v`
|
|
2382
2382
|
:host {
|
|
2383
2383
|
display: block;
|
|
2384
2384
|
}
|
|
@@ -2460,9 +2460,9 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2460
2460
|
:host([disabled]) fieldset {
|
|
2461
2461
|
opacity: 0.6;
|
|
2462
2462
|
}
|
|
2463
|
-
`]}updated(t){t.has("disabled")&&this.syncDisabled()}firstUpdated(){this.readSlots(),this.syncDisabled()}readSlots(){this.hasFooter=
|
|
2463
|
+
`]}updated(t){t.has("disabled")&&this.syncDisabled()}firstUpdated(){this.readSlots(),this.syncDisabled()}readSlots(){this.hasFooter=tr(this.shadowRoot?.querySelector('slot[name="footer"]'))}onFooterSlotChange(){this.readSlots()}syncDisabled(){for(let t of this.fields??[]){"disabled"in t&&(t.disabled=this.disabled);for(let e of t.querySelectorAll("*"))"disabled"in e&&(e.disabled=this.disabled)}}render(){let t=!!this.heading||!!this.description;return d`<fieldset part="base" ?disabled=${this.disabled}>
|
|
2464
2464
|
<legend class=${this.heading?"":"visually-hidden"}>
|
|
2465
|
-
<slot name="heading">${this.heading||
|
|
2465
|
+
<slot name="heading">${this.heading||m().formSection}</slot>
|
|
2466
2466
|
</legend>
|
|
2467
2467
|
|
|
2468
2468
|
${t&&this.description?d`<div part="header" class="header">
|
|
@@ -2480,7 +2480,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2480
2480
|
<div part="footer" class=${this.hasFooter?"footer":"footer empty"}>
|
|
2481
2481
|
<slot name="footer" @slotchange=${this.onFooterSlotChange}></slot>
|
|
2482
2482
|
</div>
|
|
2483
|
-
</fieldset>`}};
|
|
2483
|
+
</fieldset>`}};rr([ur()],Jt.prototype,"fields");rr([k()],Jt.prototype,"hasFooter");rr([n({type:String})],Jt.prototype,"heading");rr([n({type:String})],Jt.prototype,"description");rr([n({type:Boolean,reflect:!0})],Jt.prototype,"loading");rr([n({type:Boolean,reflect:!0})],Jt.prototype,"disabled");rr([n({type:Number,attribute:"loading-fields"})],Jt.prototype,"loadingFields");b("kt-form",Jt);var yn=[{id:"al",name:"Albania",dialCode:"355",format:"67 212 3456",trunkPrefix:"0"},{id:"dz",name:"Algeria",dialCode:"213",format:"551 23 45 67",trunkPrefix:"0"},{id:"ao",name:"Angola",dialCode:"244",format:"923 123 456"},{id:"ar",name:"Argentina",dialCode:"54",format:"11 2345 6789",trunkPrefix:"0"},{id:"au",name:"Australia",dialCode:"61",format:"412 345 678",trunkPrefix:"0"},{id:"at",name:"Austria",dialCode:"43",format:"664 1234567",trunkPrefix:"0"},{id:"bd",name:"Bangladesh",dialCode:"880",format:"1812 345678",trunkPrefix:"0"},{id:"be",name:"Belgium",dialCode:"32",format:"1 23 45 67 89",trunkPrefix:"0"},{id:"bo",name:"Bolivia",dialCode:"591",format:"7123 4567",trunkPrefix:"0"},{id:"br",name:"Brazil",dialCode:"55",format:"11 91234 5678",trunkPrefix:"0"},{id:"bg",name:"Bulgaria",dialCode:"359",format:"87 123 4567",trunkPrefix:"0"},{id:"cm",name:"Cameroon",dialCode:"237",format:"6 71 23 45 67"},{id:"ca",name:"Canada",dialCode:"1",format:"506-234-5678",trunkPrefix:"1"},{id:"cl",name:"Chile",dialCode:"56",format:"9 1234 5678"},{id:"cn",name:"China",dialCode:"86",format:"131 2345 6789",trunkPrefix:"0"},{id:"co",name:"Colombia",dialCode:"57",format:"321 123 4567",trunkPrefix:"0"},{id:"cr",name:"Costa Rica",dialCode:"506",format:"8312 3456"},{id:"ci",name:"C\xF4te d'Ivoire",dialCode:"225",format:"01 23 45 67 89"},{id:"hr",name:"Croatia",dialCode:"385",format:"91 234 5678",trunkPrefix:"0"},{id:"cy",name:"Cyprus",dialCode:"357",format:"96 123456"},{id:"cz",name:"Czechia",dialCode:"420",format:"601 123 456"},{id:"dk",name:"Denmark",dialCode:"45",format:"32 12 34 56"},{id:"cd",name:"DR Congo",dialCode:"243",format:"991 234 567",trunkPrefix:"0"},{id:"ec",name:"Ecuador",dialCode:"593",format:"99 123 4567",trunkPrefix:"0"},{id:"eg",name:"Egypt",dialCode:"20",format:"100 123 4567",trunkPrefix:"0"},{id:"ee",name:"Estonia",dialCode:"372",format:"5123 4567"},{id:"et",name:"Ethiopia",dialCode:"251",format:"91 123 4567",trunkPrefix:"0"},{id:"fi",name:"Finland",dialCode:"358",format:"41 234 5678",trunkPrefix:"0"},{id:"fr",name:"France",dialCode:"33",format:"1 23 45 67 89",trunkPrefix:"0"},{id:"ge",name:"Georgia",dialCode:"995",format:"555 123 456",trunkPrefix:"0"},{id:"de",name:"Germany",dialCode:"49",format:"1234 567890",trunkPrefix:"0"},{id:"gh",name:"Ghana",dialCode:"233",format:"23 123 4567",trunkPrefix:"0"},{id:"gr",name:"Greece",dialCode:"30",format:"691 234 5678"},{id:"gt",name:"Guatemala",dialCode:"502",format:"5123 4567"},{id:"hk",name:"Hong Kong",dialCode:"852",format:"5123 4567"},{id:"hu",name:"Hungary",dialCode:"36",format:"20 123 4567",trunkPrefix:"06"},{id:"is",name:"Iceland",dialCode:"354",format:"611 1234"},{id:"in",name:"India",dialCode:"91",format:"81234 56789",trunkPrefix:"0"},{id:"id",name:"Indonesia",dialCode:"62",format:"812 3456 7890",trunkPrefix:"0"},{id:"ir",name:"Iran",dialCode:"98",format:"912 345 6789",trunkPrefix:"0"},{id:"iq",name:"Iraq",dialCode:"964",format:"791 234 5678",trunkPrefix:"0"},{id:"ie",name:"Ireland",dialCode:"353",format:"85 123 4567",trunkPrefix:"0"},{id:"il",name:"Israel",dialCode:"972",format:"50 234 5678",trunkPrefix:"0"},{id:"it",name:"Italy",dialCode:"39",format:"312 345 6789"},{id:"jp",name:"Japan",dialCode:"81",format:"90 1234 5678",trunkPrefix:"0"},{id:"jo",name:"Jordan",dialCode:"962",format:"7 9012 3456",trunkPrefix:"0"},{id:"kz",name:"Kazakhstan",dialCode:"7",format:"771 000 9998"},{id:"ke",name:"Kenya",dialCode:"254",format:"712 123456",trunkPrefix:"0"},{id:"lv",name:"Latvia",dialCode:"371",format:"2123 4567"},{id:"lb",name:"Lebanon",dialCode:"961",format:"71 123 456",trunkPrefix:"0"},{id:"lt",name:"Lithuania",dialCode:"370",format:"612 34567",trunkPrefix:"0"},{id:"lu",name:"Luxembourg",dialCode:"352",format:"628 123 456"},{id:"my",name:"Malaysia",dialCode:"60",format:"12 345 6789",trunkPrefix:"0"},{id:"mx",name:"Mexico",dialCode:"52",format:"55 1234 5678"},{id:"ma",name:"Morocco",dialCode:"212",format:"650 123456",trunkPrefix:"0"},{id:"np",name:"Nepal",dialCode:"977",format:"984 1234567",trunkPrefix:"0"},{id:"nl",name:"Netherlands",dialCode:"31",format:"6 12345678",trunkPrefix:"0"},{id:"nz",name:"New Zealand",dialCode:"64",format:"21 123 4567",trunkPrefix:"0"},{id:"ng",name:"Nigeria",dialCode:"234",format:"802 123 4567",trunkPrefix:"0"},{id:"mk",name:"North Macedonia",dialCode:"389",format:"72 345 678",trunkPrefix:"0"},{id:"no",name:"Norway",dialCode:"47",format:"406 12 345"},{id:"pk",name:"Pakistan",dialCode:"92",format:"301 2345678",trunkPrefix:"0"},{id:"pa",name:"Panama",dialCode:"507",format:"6123 4567"},{id:"pe",name:"Peru",dialCode:"51",format:"912 345 678",trunkPrefix:"0"},{id:"ph",name:"Philippines",dialCode:"63",format:"905 123 4567",trunkPrefix:"0"},{id:"pl",name:"Poland",dialCode:"48",format:"512 345 678"},{id:"pt",name:"Portugal",dialCode:"351",format:"912 345 678"},{id:"qa",name:"Qatar",dialCode:"974",format:"3312 3456"},{id:"ro",name:"Romania",dialCode:"40",format:"712 034 567",trunkPrefix:"0"},{id:"ru",name:"Russia",dialCode:"7",format:"912 345 67 89"},{id:"sa",name:"Saudi Arabia",dialCode:"966",format:"51 234 5678",trunkPrefix:"0"},{id:"sn",name:"Senegal",dialCode:"221",format:"70 123 45 67"},{id:"rs",name:"Serbia",dialCode:"381",format:"60 123 4567",trunkPrefix:"0"},{id:"sg",name:"Singapore",dialCode:"65",format:"8123 4567"},{id:"sk",name:"Slovakia",dialCode:"421",format:"912 123 456",trunkPrefix:"0"},{id:"si",name:"Slovenia",dialCode:"386",format:"31 234 567",trunkPrefix:"0"},{id:"za",name:"South Africa",dialCode:"27",format:"71 123 4567",trunkPrefix:"0"},{id:"kr",name:"South Korea",dialCode:"82",format:"10 1234 5678",trunkPrefix:"0"},{id:"es",name:"Spain",dialCode:"34",format:"612 34 56 78"},{id:"lk",name:"Sri Lanka",dialCode:"94",format:"71 234 5678",trunkPrefix:"0"},{id:"se",name:"Sweden",dialCode:"46",format:"70 123 45 67",trunkPrefix:"0"},{id:"ch",name:"Switzerland",dialCode:"41",format:"12 345 67 89",trunkPrefix:"0"},{id:"tw",name:"Taiwan",dialCode:"886",format:"912 345 678",trunkPrefix:"0"},{id:"tz",name:"Tanzania",dialCode:"255",format:"621 234 567",trunkPrefix:"0"},{id:"th",name:"Thailand",dialCode:"66",format:"81 234 5678",trunkPrefix:"0"},{id:"tn",name:"Tunisia",dialCode:"216",format:"20 123 456"},{id:"tr",name:"T\xFCrkiye",dialCode:"90",format:"501 234 56 78",trunkPrefix:"0"},{id:"ug",name:"Uganda",dialCode:"256",format:"712 345678",trunkPrefix:"0"},{id:"ua",name:"Ukraine",dialCode:"380",format:"50 123 4567",trunkPrefix:"0"},{id:"ae",name:"United Arab Emirates",dialCode:"971",format:"50 123 4567",trunkPrefix:"0"},{id:"gb",name:"United Kingdom",dialCode:"44",format:"7123 456789",trunkPrefix:"0"},{id:"us",name:"United States",dialCode:"1",format:"201-555-0123",trunkPrefix:"1"},{id:"uy",name:"Uruguay",dialCode:"598",format:"94 231 234",trunkPrefix:"0"},{id:"ve",name:"Venezuela",dialCode:"58",format:"412 123 4567",trunkPrefix:"0"},{id:"vn",name:"Vietnam",dialCode:"84",format:"91 234 5678",trunkPrefix:"0"}],kn=127462,wn=65;function Rs(o){return/^[a-z]{2}$/i.test(o)?String.fromCodePoint(...[...o.toUpperCase()].map(t=>kn+t.charCodeAt(0)-wn)):""}function $n(o){return o.replace(/\D/g,"")}function Cn(o,t){if(!o)return"";let e=t?(t.format.match(/\d+/g)??[]).map(s=>s.length):[],a=[],r=o;for(let s of e){if(!r)break;a.push(r.slice(0,s)),r=r.slice(s)}if(e.length>0)r&&a.push(r);else for(;r;)a.push(r.slice(0,3)),r=r.slice(3);return a.join(" ")}function Sn(o,t){let e=t?.trunkPrefix;return e&&o.startsWith(e)?e:void 0}function zs(o){return o.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase()}function Pn(o,t){let e=zs(t.trim());if(!e)return o;let a=e.replace(/^\+/,"");return o.filter(r=>zs(r.name).includes(e)||a!==""&&r.dialCode.startsWith(a)||r.id===e)}var An=Object.defineProperty,G=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&An(t,e,r),r},va=18,Mn=/^([a-z]{2}):(\d*)$/,K=class extends h{constructor(){super(...arguments),this.internals=null,this.passwordVisible=!1,this.countryOpen=!1,this.countryQuery="",this.focused=!1,this.errorDismissed=!1,this.floating=new dt(this,{panel:()=>this.shadowRoot?.querySelector(".country-panel"),anchor:()=>this.shadowRoot?.querySelector(".field")}),this.value="",this.name="",this.type="text",this.placeholder="",this.size="medium",this.disabled=!1,this.formDisabled=!1,this.readonly=!1,this.required=!1,this.icon="",this.error="",this.clearable=!0,this.label="",this.autocomplete="",this.countries=yn,this.country="us",this.defaultValue="",this.closeCountryPanel=t=>{t.composedPath().includes(this)||(this.countryOpen=!1)}}static{this.formAssociated=!0}static{this.styles=[h.styles,Pt,v`
|
|
2484
2484
|
:host {
|
|
2485
2485
|
display: block;
|
|
2486
2486
|
}
|
|
@@ -2706,16 +2706,16 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2706
2706
|
color: var(--text-muted);
|
|
2707
2707
|
font: var(--font-normal-small);
|
|
2708
2708
|
}
|
|
2709
|
-
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),
|
|
2709
|
+
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),J(this.countryOpen,document,"pointerdown",this.closeCountryPanel),this.internals??=q(this),this.defaultValue=this.value,R(this.internals,this.formValue,this.formState)}updated(t){t.has("countryOpen")&&J(this.countryOpen,document,"pointerdown",this.closeCountryPanel),this.floating.sync(this.countryOpen)}willUpdate(t){(t.has("value")||t.has("required")||t.has("error")||t.has("country")||t.has("countries")||t.has("type")||this.stringsChanged(t))&&(R(this.internals,this.formValue,this.formState),this.refreshValidity())}refreshValidity(){let t=this.required&&this.value.length===0,e=this.phoneError,a=this.error||e||(t?m().required:"");H(this.internals,{valueMissing:t,patternMismatch:!!e,customError:!!this.error},a)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.closeCountryPanel)}formResetCallback(){this.value=this.defaultValue,this.passwordVisible=!1}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){let e=Mn.exec(t);this.isPhone&&e?(this.country=e[1],this.value=e[2]):this.value=t}focus(t){this.input?.focus(t)}blur(){this.input?.blur()}select(){this.input?.select()}get isPhone(){return this.type==="tel"}get selectedCountry(){return this.countries.find(t=>t.id===this.country)}get formValue(){return!this.isPhone||!this.value?this.value:`+${this.selectedCountry?.dialCode??""}${this.value}`}get formState(){return this.isPhone?`${this.country}:${this.value}`:void 0}get phoneError(){if(!this.isPhone)return"";let t=Sn(this.value,this.selectedCountry);return t?m().phoneTrunkPrefix(t):""}get shownError(){return this.error||this.phoneError}get displayValue(){return this.isPhone?Cn(this.value,this.selectedCountry):this.value}get showClear(){return this.clearable&&this.value.length>0&&!this.readonly&&!this.inactive}get resolvedType(){return this.isPhone?"text":this.type!=="password"?this.type:this.passwordVisible?"text":"password"}onInput(t){let e=t.target.value;this.value=this.isPhone?$n(e):e,y(this,"kt-input",{value:this.value})}toggleCountryPanel(){this.countryOpen=!this.countryOpen,this.countryQuery=""}selectCountry(t){this.country=t.id,this.countryOpen=!1,this.countryQuery="",y(this,"kt-country-change",{country:t.id,dialCode:t.dialCode}),this.focus()}onCountryKeyDown(t){t.key==="Escape"&&this.countryOpen&&(t.stopPropagation(),this.countryOpen=!1,this.shadowRoot?.querySelector(".country")?.focus())}renderCountryPicker(){let t=this.selectedCountry,e=Pn(this.countries,this.countryQuery);return d`<button
|
|
2710
2710
|
type="button"
|
|
2711
2711
|
class="country"
|
|
2712
2712
|
aria-haspopup="listbox"
|
|
2713
2713
|
aria-expanded=${this.countryOpen?"true":"false"}
|
|
2714
|
-
aria-label=${
|
|
2714
|
+
aria-label=${m().countryCode(t?.name)}
|
|
2715
2715
|
?disabled=${this.inactive||this.readonly}
|
|
2716
2716
|
@click=${this.toggleCountryPanel}
|
|
2717
2717
|
>
|
|
2718
|
-
<span aria-hidden="true">${
|
|
2718
|
+
<span aria-hidden="true">${Rs(this.country)}</span>
|
|
2719
2719
|
<span class="dial">+${t?.dialCode??""}</span>
|
|
2720
2720
|
<span class=${w({chevron:!0,open:this.countryOpen})}>
|
|
2721
2721
|
<kt-icon name="chevron-down" size="14"></kt-icon>
|
|
@@ -2728,24 +2728,24 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2728
2728
|
>
|
|
2729
2729
|
<input
|
|
2730
2730
|
class="country-search"
|
|
2731
|
-
placeholder=${
|
|
2731
|
+
placeholder=${m().searchCountry}
|
|
2732
2732
|
.value=${this.countryQuery}
|
|
2733
|
-
aria-label=${
|
|
2733
|
+
aria-label=${m().searchCountry}
|
|
2734
2734
|
@input=${a=>{this.countryQuery=a.target.value}}
|
|
2735
2735
|
/>
|
|
2736
2736
|
<ul class="country-list" role="listbox">
|
|
2737
|
-
${e.length===0?d`<li class="country-empty">${
|
|
2737
|
+
${e.length===0?d`<li class="country-empty">${m().noCountry}</li>`:e.map(a=>d`<li
|
|
2738
2738
|
class="country-item"
|
|
2739
2739
|
role="option"
|
|
2740
2740
|
aria-selected=${a.id===this.country?"true":"false"}
|
|
2741
2741
|
@click=${()=>this.selectCountry(a)}
|
|
2742
2742
|
>
|
|
2743
|
-
<span aria-hidden="true">${
|
|
2743
|
+
<span aria-hidden="true">${Rs(a.id)}</span>
|
|
2744
2744
|
<span class="country-name">${a.name}</span>
|
|
2745
2745
|
<span class="dial">+${a.dialCode}</span>
|
|
2746
2746
|
</li>`)}
|
|
2747
2747
|
</ul>
|
|
2748
|
-
</div>`:l}`}onFocus(){this.focused=!0,this.errorDismissed=!1}onBlur(){this.focused=!1}onControlKeyDown(t){t.key!=="Escape"||!this.errorTooltipOpen||(t.stopPropagation(),this.errorDismissed=!0)}get errorTooltipOpen(){return this.focused&&!this.errorDismissed&&!!this.shownError}onChange(t){t.stopPropagation(),y(this,"kt-change",{value:this.value})}clear(){this.value="",y(this,"kt-clear"),y(this,"kt-input",{value:""}),y(this,"kt-change",{value:""}),this.focus()}togglePassword(){this.passwordVisible=!this.passwordVisible}onFieldPointerDown(t){t.target!==this.input&&(t.target.closest("button")||(t.preventDefault(),this.focus()))}renderPasswordToggle(){let t=this.passwordVisible?
|
|
2748
|
+
</div>`:l}`}onFocus(){this.focused=!0,this.errorDismissed=!1}onBlur(){this.focused=!1}onControlKeyDown(t){t.key!=="Escape"||!this.errorTooltipOpen||(t.stopPropagation(),this.errorDismissed=!0)}get errorTooltipOpen(){return this.focused&&!this.errorDismissed&&!!this.shownError}onChange(t){t.stopPropagation(),y(this,"kt-change",{value:this.value})}clear(){this.value="",y(this,"kt-clear"),y(this,"kt-input",{value:""}),y(this,"kt-change",{value:""}),this.focus()}togglePassword(){this.passwordVisible=!this.passwordVisible}onFieldPointerDown(t){t.target!==this.input&&(t.target.closest("button")||(t.preventDefault(),this.focus()))}renderPasswordToggle(){let t=this.passwordVisible?m().hidePassword:m().showPassword;return d`<kt-tooltip text=${t}>
|
|
2749
2749
|
<button
|
|
2750
2750
|
type="button"
|
|
2751
2751
|
class="icon-button"
|
|
@@ -2753,7 +2753,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2753
2753
|
aria-label=${t}
|
|
2754
2754
|
@click=${this.togglePassword}
|
|
2755
2755
|
>
|
|
2756
|
-
<kt-icon name=${this.passwordVisible?"eye-off":"eye"} size=${
|
|
2756
|
+
<kt-icon name=${this.passwordVisible?"eye-off":"eye"} size=${va}></kt-icon>
|
|
2757
2757
|
</button>
|
|
2758
2758
|
</kt-tooltip>`}render(){let t=this.shownError,e=this.type==="password"||!!this.icon||!!t||this.showClear;return d`<div
|
|
2759
2759
|
part="base"
|
|
@@ -2768,7 +2768,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2768
2768
|
part="control"
|
|
2769
2769
|
type=${this.resolvedType}
|
|
2770
2770
|
name=${this.name||l}
|
|
2771
|
-
.value=${
|
|
2771
|
+
.value=${It(this.displayValue)}
|
|
2772
2772
|
placeholder=${this.placeholder||this.isPhone&&this.selectedCountry?.format||l}
|
|
2773
2773
|
autocomplete=${this.autocomplete||l}
|
|
2774
2774
|
inputmode=${this.isPhone?"tel":l}
|
|
@@ -2789,28 +2789,28 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2789
2789
|
${e?d`<div part="actions" class="actions">
|
|
2790
2790
|
${this.type==="password"?this.renderPasswordToggle():l}
|
|
2791
2791
|
${this.icon?d`<span class="adornment">
|
|
2792
|
-
<kt-icon name=${this.icon} size=${
|
|
2792
|
+
<kt-icon name=${this.icon} size=${va}></kt-icon>
|
|
2793
2793
|
</span>`:l}
|
|
2794
2794
|
${t?d`<kt-tooltip
|
|
2795
2795
|
class="adornment error-icon"
|
|
2796
2796
|
text=${t}
|
|
2797
2797
|
?open=${this.errorTooltipOpen}
|
|
2798
2798
|
>
|
|
2799
|
-
<kt-icon name="circle-alert" size=${
|
|
2799
|
+
<kt-icon name="circle-alert" size=${va}></kt-icon>
|
|
2800
2800
|
</kt-tooltip>`:l}
|
|
2801
|
-
${this.showClear?d`<kt-tooltip text=${
|
|
2801
|
+
${this.showClear?d`<kt-tooltip text=${m().clear}>
|
|
2802
2802
|
<button
|
|
2803
2803
|
type="button"
|
|
2804
2804
|
class="icon-button clear"
|
|
2805
2805
|
tabindex="-1"
|
|
2806
|
-
aria-label=${
|
|
2806
|
+
aria-label=${m().clear}
|
|
2807
2807
|
@click=${this.clear}
|
|
2808
2808
|
>
|
|
2809
|
-
<kt-icon name="x" size=${
|
|
2809
|
+
<kt-icon name="x" size=${va}></kt-icon>
|
|
2810
2810
|
</button>
|
|
2811
2811
|
</kt-tooltip>`:l}
|
|
2812
2812
|
</div>`:l}
|
|
2813
|
-
</div>`}};
|
|
2813
|
+
</div>`}};G([T("input")],K.prototype,"input");G([k()],K.prototype,"passwordVisible");G([k()],K.prototype,"countryOpen");G([k()],K.prototype,"countryQuery");G([k()],K.prototype,"focused");G([k()],K.prototype,"errorDismissed");G([n({type:String})],K.prototype,"value");G([n({type:String})],K.prototype,"name");G([n({type:String})],K.prototype,"type");G([n({type:String})],K.prototype,"placeholder");G([n({type:String,reflect:!0})],K.prototype,"size");G([n({type:Boolean,reflect:!0})],K.prototype,"disabled");G([k()],K.prototype,"formDisabled");G([n({type:Boolean,reflect:!0})],K.prototype,"readonly");G([n({type:Boolean,reflect:!0})],K.prototype,"required");G([n({type:String})],K.prototype,"icon");G([n({type:String,reflect:!0})],K.prototype,"error");G([n({type:Boolean})],K.prototype,"clearable");G([n({type:String})],K.prototype,"label");G([n({type:String})],K.prototype,"autocomplete");G([n({type:Number})],K.prototype,"maxlength");G([n({attribute:!1})],K.prototype,"countries");G([n({type:String})],K.prototype,"country");b("kt-input",K);var Dn=Object.defineProperty,bt=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Dn(t,e,r),r},at=class extends h{constructor(){super(...arguments),this.internals=null,this.defaultValue=null,this.listId=j("kt-input-menu-list"),this.open=!1,this.placement="bottom",this.floating=new dt(this,{panel:()=>this.shadowRoot?.querySelector(".popup"),anchor:()=>this.shadowRoot?.querySelector(".control"),matchWidth:!0,onPlace:t=>{this.placement=t}}),this.query="",this.activeIndex=-1,this.options=[],this.value=null,this.placeholder="",this.name="",this.disabled=!1,this.formDisabled=!1,this.required=!1,this.error="",this.label="",this.emptyText=void 0,this.onDocumentPointerDown=t=>{t.composedPath().includes(this)||this.close()}}static{this.formAssociated=!0}static{this.styles=[h.styles,Pt,fr,v`
|
|
2814
2814
|
:host {
|
|
2815
2815
|
position: relative;
|
|
2816
2816
|
display: block;
|
|
@@ -2909,7 +2909,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2909
2909
|
.open .toggle {
|
|
2910
2910
|
transform: scaleY(-1);
|
|
2911
2911
|
}
|
|
2912
|
-
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=
|
|
2912
|
+
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=q(this),this.defaultValue=this.value,J(this.open,document,"pointerdown",this.onDocumentPointerDown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentPointerDown)}updated(t){t.has("open")&&J(this.open,document,"pointerdown",this.onDocumentPointerDown),this.floating.sync(this.open)}willUpdate(t){if(t.has("value")||t.has("required")||t.has("error")||this.stringsChanged(t)){R(this.internals,this.value===null?null:String(this.value));let e=this.required&&this.value===null;H(this.internals,{valueMissing:e,customError:!!this.error},this.error||(e?m().selectOption:""))}}formResetCallback(){this.value=this.defaultValue,this.close()}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){this.value=t}focus(t){this.input?.focus(t)}get selectedOption(){return this.options.find(t=>t.id===this.value)}get visibleOptions(){return ca(this.options,this.query)}get displayValue(){if(this.open&&this.query)return this.query;let t=this.selectedOption;return t?ht(t):this.query}openList(){this.inactive||this.open||(this.open=!0,this.activeIndex=St(this.visibleOptions))}close(){this.open=!1,this.query="",this.activeIndex=-1}onInput(t){this.query=t.target.value,this.open=!0,this.activeIndex=St(this.visibleOptions),y(this,"kt-filter",{query:this.query})}choose(t){t.disabled||(this.value=t.id,this.close(),y(this,"kt-change",{value:t.id,option:t}))}clear(t){t.stopPropagation(),this.value=null,this.query="",y(this,"kt-change",{value:null,option:null}),this.input?.focus()}onKeyDown(t){let e=this.visibleOptions;switch(t.key){case"ArrowDown":case"ArrowUp":if(t.preventDefault(),!this.open)return this.openList();this.activeIndex=ye(e,this.activeIndex,t.key==="ArrowDown"?1:-1);return;case"Home":if(!this.open)return;t.preventDefault(),this.activeIndex=St(e);return;case"End":if(!this.open)return;t.preventDefault(),this.activeIndex=Oe(e);return;case"Enter":{if(!this.open)return;t.preventDefault();let a=e[this.activeIndex];a&&this.choose(a);return}case"Escape":if(!this.open)return;t.stopPropagation(),this.close();return;case"Tab":this.close()}}optionId(t){return`${this.listId}-option-${t}`}render(){let t=this.visibleOptions,e=this.selectedOption!==void 0&&!this.inactive;return d`<div
|
|
2913
2913
|
class=${w({open:this.open,error:!!this.error})}
|
|
2914
2914
|
@keydown=${this.onKeyDown}
|
|
2915
2915
|
>
|
|
@@ -2924,7 +2924,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2924
2924
|
aria-label=${this.label||l}
|
|
2925
2925
|
aria-invalid=${this.error?"true":l}
|
|
2926
2926
|
placeholder=${this.placeholder||l}
|
|
2927
|
-
.value=${
|
|
2927
|
+
.value=${It(this.displayValue)}
|
|
2928
2928
|
?disabled=${this.inactive}
|
|
2929
2929
|
@focus=${this.openList}
|
|
2930
2930
|
@input=${this.onInput}
|
|
@@ -2933,7 +2933,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2933
2933
|
${e?d`<button
|
|
2934
2934
|
type="button"
|
|
2935
2935
|
class="icon-button clear"
|
|
2936
|
-
aria-label=${
|
|
2936
|
+
aria-label=${m().clear}
|
|
2937
2937
|
tabindex="-1"
|
|
2938
2938
|
@click=${this.clear}
|
|
2939
2939
|
>
|
|
@@ -2943,7 +2943,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2943
2943
|
<button
|
|
2944
2944
|
type="button"
|
|
2945
2945
|
class="icon-button toggle"
|
|
2946
|
-
aria-label=${this.open?
|
|
2946
|
+
aria-label=${this.open?m().closeList:m().openList}
|
|
2947
2947
|
tabindex="-1"
|
|
2948
2948
|
@click=${a=>{a.stopPropagation(),this.open?this.close():this.openList()}}
|
|
2949
2949
|
>
|
|
@@ -2959,7 +2959,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2959
2959
|
role="listbox"
|
|
2960
2960
|
aria-label=${this.label||this.placeholder}
|
|
2961
2961
|
>
|
|
2962
|
-
${t.length===0?d`<li class="empty">${this.emptyText??
|
|
2962
|
+
${t.length===0?d`<li class="empty">${this.emptyText??m().noOptions}</li>`:t.map((a,r)=>d`<li
|
|
2963
2963
|
part="option"
|
|
2964
2964
|
id=${this.optionId(r)}
|
|
2965
2965
|
class=${w({option:!0,selected:a.id===this.value,active:r===this.activeIndex,disabled:!!a.disabled})}
|
|
@@ -2967,10 +2967,10 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
2967
2967
|
aria-selected=${a.id===this.value?"true":"false"}
|
|
2968
2968
|
@click=${()=>this.choose(a)}
|
|
2969
2969
|
>
|
|
2970
|
-
${
|
|
2970
|
+
${ht(a)}
|
|
2971
2971
|
</li>`)}
|
|
2972
2972
|
</ul>
|
|
2973
|
-
</div>`}};
|
|
2973
|
+
</div>`}};bt([T("input")],at.prototype,"input");bt([k()],at.prototype,"open");bt([k()],at.prototype,"placement");bt([k()],at.prototype,"query");bt([k()],at.prototype,"activeIndex");bt([n({attribute:!1})],at.prototype,"options");bt([n({type:String})],at.prototype,"value");bt([n({type:String})],at.prototype,"placeholder");bt([n({type:String})],at.prototype,"name");bt([n({type:Boolean,reflect:!0})],at.prototype,"disabled");bt([k()],at.prototype,"formDisabled");bt([n({type:Boolean,reflect:!0})],at.prototype,"required");bt([n({type:String,reflect:!0})],at.prototype,"error");bt([n({type:String})],at.prototype,"label");bt([n({type:String,attribute:"empty-text"})],at.prototype,"emptyText");b("kt-input-menu",at);var Tn=Object.defineProperty,pt=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Tn(t,e,r),r},qs=48,Bn=40,tt=class extends h{constructor(){super(...arguments),this.internals=null,this.defaultValue=[],this.listId=j("kt-multi-select-list"),this.countId=j("kt-multi-select-count"),this.open=!1,this.placement="bottom",this.floating=new dt(this,{panel:()=>this.shadowRoot?.querySelector(".popup"),anchor:()=>this.shadowRoot?.querySelector(".control"),matchWidth:!0,onPlace:t=>{this.placement=t}}),this.query="",this.activeIndex=-1,this.overflowCount=0,this.options=[],this.value=[],this.placeholder="",this.name="",this.disabled=!1,this.formDisabled=!1,this.required=!1,this.error="",this.label="",this.emptyText=void 0,this.onDocumentPointerDown=t=>{t.composedPath().includes(this)||this.close()}}static{this.formAssociated=!0}static{this.styles=[h.styles,Pt,fr,v`
|
|
2974
2974
|
:host {
|
|
2975
2975
|
position: relative;
|
|
2976
2976
|
display: block;
|
|
@@ -3092,7 +3092,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3092
3092
|
|
|
3093
3093
|
input {
|
|
3094
3094
|
flex: 1;
|
|
3095
|
-
min-width: ${
|
|
3095
|
+
min-width: ${qs}px;
|
|
3096
3096
|
color: var(--text-body);
|
|
3097
3097
|
font: var(--font-input);
|
|
3098
3098
|
background: transparent;
|
|
@@ -3132,12 +3132,12 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3132
3132
|
width: 16px;
|
|
3133
3133
|
color: var(--color-primary-text);
|
|
3134
3134
|
}
|
|
3135
|
-
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=
|
|
3135
|
+
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=q(this),this.defaultValue=this.value,J(this.open,document,"pointerdown",this.onDocumentPointerDown),document.fonts?.ready.then(()=>this.fitChips())}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentPointerDown),this.resizeObserver?.disconnect(),this.resizeObserver=void 0}willUpdate(t){if(t.has("value")||t.has("name")||t.has("required")||t.has("error")||this.stringsChanged(t)){let e=null;if(this.value.length>0){e=new FormData;for(let r of this.value)e.append(this.name,String(r))}R(this.internals,e);let a=this.required&&this.value.length===0;H(this.internals,{valueMissing:a,customError:!!this.error},this.error||(a?m().selectOption:""))}}updated(t){t.has("open")&&J(this.open,document,"pointerdown",this.onDocumentPointerDown),this.floating.sync(this.open),this.observeWidth(),this.fitChips()}formResetCallback(){this.value=this.defaultValue,this.close()}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){let e=t instanceof FormData?t.getAll(this.name).map(String):t?[t]:[];this.value=e.map(a=>this.options.find(r=>String(r.id)===a)?.id??a)}focus(t){this.input?.focus(t)}get selectedOptions(){return this.value.map(t=>this.options.find(e=>e.id===t)??{id:t,label:String(t)})}get visibleOptions(){return ca(this.options,this.query)}isChosen(t){return this.value.includes(t.id)}openList(){this.inactive||this.open||(this.open=!0,this.activeIndex=St(this.visibleOptions))}close(){this.open=!1,this.query="",this.activeIndex=-1}onInput(t){this.query=t.target.value,this.open=!0,this.activeIndex=St(this.visibleOptions),y(this,"kt-filter",{query:this.query})}toggle(t){t.disabled||this.inactive||this.commit(this.isChosen(t)?this.value.filter(e=>e!==t.id):[...this.value,t.id])}removeValue(t){this.inactive||this.commit(this.value.filter(e=>e!==t))}commit(t){this.value=t,y(this,"kt-change",{value:t,options:this.selectedOptions})}onKeyDown(t){let e=this.visibleOptions;switch(t.key){case"ArrowDown":case"ArrowUp":if(t.preventDefault(),!this.open)return this.openList();this.activeIndex=ye(e,this.activeIndex,t.key==="ArrowDown"?1:-1);return;case"Home":if(!this.open)return;t.preventDefault(),this.activeIndex=St(e);return;case"End":if(!this.open)return;t.preventDefault(),this.activeIndex=Oe(e);return;case"Enter":{if(!this.open)return;t.preventDefault();let a=e[this.activeIndex];a&&this.toggle(a);return}case"Backspace":{let a=this.value[this.value.length-1];if(this.input?.value||a===void 0)return;this.removeValue(a);return}case"Escape":if(!this.open)return;t.stopPropagation(),this.close();return;case"Tab":this.close()}}observeWidth(){if(this.resizeObserver||typeof ResizeObserver>"u")return;let t=this.shadowRoot?.querySelector(".control");t&&(this.resizeObserver=new ResizeObserver(()=>this.fitChips()),this.resizeObserver.observe(t))}fitChips(){let t=this.shadowRoot?.querySelector(".control"),e=this.shadowRoot?.querySelector(".chips");if(!t||!e)return;let a=[...e.querySelectorAll(".chip")];for(let x of a)x.hidden=!1;let r=getComputedStyle(t),s=parseFloat(r.columnGap)||0,i=t.querySelector(".toggle")?.getBoundingClientRect().width??0,p=t.clientWidth-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-qs-i-2*s;if(t.clientWidth===0||p<=0)return;let c=e.getBoundingClientRect().left,u=x=>a.filter($=>$.getBoundingClientRect().right-c<=x).length,f=u(p);if(f<a.length){let x=this.shadowRoot?.querySelector(".more")?.getBoundingClientRect().width;f=u(p-(x||Bn)-s)}a.forEach((x,$)=>{x.hidden=$>=f});let g=a.length-f;g!==this.overflowCount&&(this.overflowCount=g)}optionId(t){return`${this.listId}-option-${t}`}render(){let t=this.visibleOptions,e=this.selectedOptions;return d`<div
|
|
3136
3136
|
class=${w({open:this.open,error:!!this.error})}
|
|
3137
3137
|
@keydown=${this.onKeyDown}
|
|
3138
3138
|
>
|
|
3139
3139
|
<span id=${this.countId} class="visually-hidden">
|
|
3140
|
-
${e.length>0?
|
|
3140
|
+
${e.length>0?m().selectedCount(e.length):""}
|
|
3141
3141
|
</span>
|
|
3142
3142
|
|
|
3143
3143
|
<div
|
|
@@ -3147,12 +3147,12 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3147
3147
|
>
|
|
3148
3148
|
<div part="chips" class="chips">
|
|
3149
3149
|
${e.map(a=>d`<span class=${w({chip:!0,removable:!this.inactive})}>
|
|
3150
|
-
${
|
|
3150
|
+
${ht(a)}
|
|
3151
3151
|
${this.inactive?l:d`<button
|
|
3152
3152
|
type="button"
|
|
3153
3153
|
class="remove"
|
|
3154
3154
|
tabindex="-1"
|
|
3155
|
-
aria-label=${
|
|
3155
|
+
aria-label=${m().remove(ht(a))}
|
|
3156
3156
|
@click=${r=>{r.stopPropagation(),this.removeValue(a.id)}}
|
|
3157
3157
|
>
|
|
3158
3158
|
<kt-icon name="x" size="12"></kt-icon>
|
|
@@ -3160,7 +3160,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3160
3160
|
</span>`)}
|
|
3161
3161
|
</div>
|
|
3162
3162
|
${this.overflowCount>0?d`<span class="more"
|
|
3163
|
-
>${this.overflowCount===e.length?
|
|
3163
|
+
>${this.overflowCount===e.length?m().selectedCount(e.length):`+${this.overflowCount}`}</span
|
|
3164
3164
|
>`:l}
|
|
3165
3165
|
|
|
3166
3166
|
<input
|
|
@@ -3174,7 +3174,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3174
3174
|
aria-describedby=${this.countId}
|
|
3175
3175
|
aria-invalid=${this.error?"true":l}
|
|
3176
3176
|
placeholder=${e.length===0&&this.placeholder?this.placeholder:l}
|
|
3177
|
-
.value=${
|
|
3177
|
+
.value=${It(this.query)}
|
|
3178
3178
|
?disabled=${this.inactive}
|
|
3179
3179
|
@focus=${this.openList}
|
|
3180
3180
|
@input=${this.onInput}
|
|
@@ -3183,7 +3183,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3183
3183
|
<button
|
|
3184
3184
|
type="button"
|
|
3185
3185
|
class="toggle"
|
|
3186
|
-
aria-label=${this.open?
|
|
3186
|
+
aria-label=${this.open?m().closeList:m().openList}
|
|
3187
3187
|
tabindex="-1"
|
|
3188
3188
|
@click=${a=>{a.stopPropagation(),this.open?this.close():this.openList()}}
|
|
3189
3189
|
>
|
|
@@ -3201,7 +3201,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3201
3201
|
aria-label=${this.label||this.placeholder}
|
|
3202
3202
|
@pointerdown=${a=>{a.preventDefault()}}
|
|
3203
3203
|
>
|
|
3204
|
-
${t.length===0?d`<li class="empty">${this.emptyText??
|
|
3204
|
+
${t.length===0?d`<li class="empty">${this.emptyText??m().noOptions}</li>`:t.map((a,r)=>{let s=this.isChosen(a);return d`<li
|
|
3205
3205
|
part="option"
|
|
3206
3206
|
id=${this.optionId(r)}
|
|
3207
3207
|
class=${w({option:!0,selected:s,active:r===this.activeIndex,disabled:!!a.disabled})}
|
|
@@ -3213,10 +3213,10 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3213
3213
|
<span class="tick" aria-hidden="true">
|
|
3214
3214
|
${s?d`<kt-icon name="check" size="16"></kt-icon>`:l}
|
|
3215
3215
|
</span>
|
|
3216
|
-
${
|
|
3216
|
+
${ht(a)}
|
|
3217
3217
|
</li>`})}
|
|
3218
3218
|
</ul>
|
|
3219
|
-
</div>`}};
|
|
3219
|
+
</div>`}};pt([T("input")],tt.prototype,"input");pt([k()],tt.prototype,"open");pt([k()],tt.prototype,"placement");pt([k()],tt.prototype,"query");pt([k()],tt.prototype,"activeIndex");pt([k()],tt.prototype,"overflowCount");pt([n({attribute:!1})],tt.prototype,"options");pt([n({attribute:!1})],tt.prototype,"value");pt([n({type:String})],tt.prototype,"placeholder");pt([n({type:String})],tt.prototype,"name");pt([n({type:Boolean,reflect:!0})],tt.prototype,"disabled");pt([k()],tt.prototype,"formDisabled");pt([n({type:Boolean,reflect:!0})],tt.prototype,"required");pt([n({type:String,reflect:!0})],tt.prototype,"error");pt([n({type:String})],tt.prototype,"label");pt([n({type:String,attribute:"empty-text"})],tt.prototype,"emptyText");b("kt-multi-select",tt);var Ln=Object.defineProperty,Co=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Ln(t,e,r),r},ar=class extends h{constructor(){super(...arguments),this.label="",this.required=!1}static{this.styles=[h.styles,v`
|
|
3220
3220
|
:host {
|
|
3221
3221
|
display: flex;
|
|
3222
3222
|
flex-direction: column;
|
|
@@ -3236,7 +3236,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3236
3236
|
`]}get control(){return this.defaultSlot?.assignedElements({flatten:!0}).find(t=>t instanceof HTMLElement)}labelControl(){let t=this.control;t&&("label"in t?t.label=this.label:t.setAttribute("aria-label",this.label))}updated(){this.labelControl()}focusControl(){this.control?.focus()}render(){return d`<label part="label" @click=${this.focusControl}>
|
|
3237
3237
|
${this.label}${this.required?d`<span class="required" aria-hidden="true">*</span>`:""}
|
|
3238
3238
|
</label>
|
|
3239
|
-
<slot @slotchange=${this.labelControl}></slot>`}};
|
|
3239
|
+
<slot @slotchange=${this.labelControl}></slot>`}};Co([T("slot")],ar.prototype,"defaultSlot");Co([n({type:String})],ar.prototype,"label");Co([n({type:Boolean,reflect:!0})],ar.prototype,"required");b("kt-label-input",ar);var En=Object.defineProperty,yt=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&En(t,e,r),r},Ut=class extends h{constructor(){super(...arguments),this.value="",this.disabled=!1,this.checked=!1,this.tabbable=!1,this.invalid=!1,this.groupDisabled=!1}static{this.styles=[h.styles,v`
|
|
3240
3240
|
:host {
|
|
3241
3241
|
display: block;
|
|
3242
3242
|
/* Whole, even pixels: an even circle around an even dot leaves the
|
|
@@ -3324,7 +3324,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3324
3324
|
>
|
|
3325
3325
|
<span part="circle" class="circle"><span class="dot"></span></span>
|
|
3326
3326
|
<span class="text"><slot></slot></span>
|
|
3327
|
-
</div>`}};
|
|
3327
|
+
</div>`}};yt([n({type:String,reflect:!0})],Ut.prototype,"value");yt([n({type:Boolean,reflect:!0})],Ut.prototype,"disabled");yt([n({type:Boolean,reflect:!0})],Ut.prototype,"checked");yt([n({type:Boolean,attribute:!1})],Ut.prototype,"tabbable");yt([n({type:Boolean,reflect:!0})],Ut.prototype,"invalid");yt([n({type:Boolean,reflect:!0,attribute:"group-disabled"})],Ut.prototype,"groupDisabled");var Et=class extends h{constructor(){super(...arguments),this.internals=null,this.defaultValue=null,this.value=null,this.name="",this.label="",this.disabled=!1,this.formDisabled=!1,this.required=!1,this.orientation="vertical",this.error="",this.syncRadios=()=>{let t=this.enabled(),e=t.find(a=>a.value===this.value)??t[0];for(let a of this.radios)a.checked=a.value===this.value,a.tabbable=a===e,a.invalid=!!this.error,a.groupDisabled=this.inactive},this.onClick=t=>{let e=t.composedPath().find(a=>a instanceof Ut);!e||!this.enabled().includes(e)||(this.choose(e),e.focus())},this.onKeyDown=t=>{let e=this.enabled();if(e.length===0)return;let a=t.composedPath().find(i=>i instanceof Ut),r=a?e.indexOf(a):-1,s;if(t.key==="ArrowDown"||t.key==="ArrowRight")s=e[(r+1)%e.length];else if(t.key==="ArrowUp"||t.key==="ArrowLeft")s=e[(r-1+e.length)%e.length];else if(t.key===" "&&a&&r>=0)s=a;else return;t.preventDefault(),s&&(this.choose(s),this.updateComplete.then(()=>s.focus()))}}static{this.formAssociated=!0}static{this.styles=[h.styles,v`
|
|
3328
3328
|
:host {
|
|
3329
3329
|
display: block;
|
|
3330
3330
|
}
|
|
@@ -3340,12 +3340,12 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3340
3340
|
flex-wrap: wrap;
|
|
3341
3341
|
column-gap: var(--gap-card);
|
|
3342
3342
|
}
|
|
3343
|
-
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=
|
|
3343
|
+
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=q(this),this.defaultValue=this.value,this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.onClick),this.removeEventListener("keydown",this.onKeyDown)}willUpdate(t){if(t.has("value")||t.has("required")||t.has("error")||this.stringsChanged(t)){R(this.internals,this.value);let e=this.required&&this.value===null;H(this.internals,{valueMissing:e,customError:!!this.error},this.error||(e?m().selectOption:""))}}updated(){this.syncRadios()}formResetCallback(){this.value=this.defaultValue}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){this.value=t}focus(t){this.radios.find(e=>e.tabbable)?.focus(t)}enabled(){return this.inactive?[]:this.radios.filter(t=>!t.disabled)}choose(t){t.value!==this.value&&(this.value=t.value,y(this,"kt-change",{value:this.value}))}render(){return d`${this.error?d`<span id="error-message" class="visually-hidden">${this.error}</span>`:l}
|
|
3344
3344
|
<div
|
|
3345
3345
|
part="base"
|
|
3346
3346
|
class="group"
|
|
3347
3347
|
role="radiogroup"
|
|
3348
|
-
aria-label=${this.label||
|
|
3348
|
+
aria-label=${this.label||m().options}
|
|
3349
3349
|
aria-orientation=${this.orientation}
|
|
3350
3350
|
aria-required=${this.required?"true":l}
|
|
3351
3351
|
aria-invalid=${this.error?"true":l}
|
|
@@ -3353,7 +3353,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3353
3353
|
aria-describedby=${this.error?"error-message":l}
|
|
3354
3354
|
>
|
|
3355
3355
|
<slot @slotchange=${this.syncRadios}></slot>
|
|
3356
|
-
</div>`}};
|
|
3356
|
+
</div>`}};yt([ur({selector:"kt-radio"})],Et.prototype,"radios");yt([n({type:String,reflect:!0})],Et.prototype,"value");yt([n({type:String})],Et.prototype,"name");yt([n({type:String})],Et.prototype,"label");yt([n({type:Boolean,reflect:!0})],Et.prototype,"disabled");yt([k()],Et.prototype,"formDisabled");yt([n({type:Boolean,reflect:!0})],Et.prototype,"required");yt([n({type:String,reflect:!0})],Et.prototype,"orientation");yt([n({type:String,reflect:!0})],Et.prototype,"error");b("kt-radio",Ut);b("kt-radio-group",Et);var On=Object.defineProperty,kt=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&On(t,e,r),r},ot=class extends h{constructor(){super(...arguments),this.internals=null,this.defaultValue=null,this.listId=j("kt-select-list"),this.open=!1,this.placement="bottom",this.floating=new dt(this,{panel:()=>this.shadowRoot?.querySelector(".popup"),anchor:()=>this.shadowRoot?.querySelector(".trigger"),matchWidth:!0,onPlace:t=>{this.placement=t}}),this.activeIndex=-1,this.options=[],this.value=null,this.placeholder=void 0,this.name="",this.size="medium",this.disabled=!1,this.formDisabled=!1,this.required=!1,this.error="",this.clearable=!0,this.label="",this.emptyText=void 0,this.onDocumentPointerDown=t=>{t.composedPath().includes(this)||(this.open=!1)}}static{this.formAssociated=!0}static{this.styles=[h.styles,Pt,fr,v`
|
|
3357
3357
|
:host {
|
|
3358
3358
|
position: relative;
|
|
3359
3359
|
display: block;
|
|
@@ -3462,7 +3462,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3462
3462
|
.open .chevron {
|
|
3463
3463
|
transform: scaleY(-1);
|
|
3464
3464
|
}
|
|
3465
|
-
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=
|
|
3465
|
+
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=q(this),this.defaultValue=this.value,J(this.open,document,"pointerdown",this.onDocumentPointerDown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentPointerDown)}updated(t){t.has("open")&&J(this.open,document,"pointerdown",this.onDocumentPointerDown),this.floating.sync(this.open)}willUpdate(t){if(t.has("value")||t.has("required")||t.has("error")||this.stringsChanged(t)){R(this.internals,this.value===null?null:String(this.value));let e=this.required&&this.value===null;H(this.internals,{valueMissing:e,customError:!!this.error},this.error||(e?m().selectOption:""))}}formResetCallback(){this.value=this.defaultValue,this.open=!1}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){this.value=t}focus(t){this.shadowRoot?.querySelector(".trigger")?.focus(t)}get selectedOption(){return this.options.find(t=>t.id===this.value)}openList(){if(this.inactive)return;this.open=!0;let t=this.options.findIndex(e=>e.id===this.value);this.activeIndex=t>=0?t:St(this.options)}closeList(){this.open=!1,this.activeIndex=-1}toggleList(){this.open?this.closeList():this.openList()}choose(t){t.disabled||(this.value=t.id,this.closeList(),this.focus(),y(this,"kt-change",{value:t.id,option:t}))}clear(t){t.stopPropagation(),this.value=null,y(this,"kt-change",{value:null,option:null})}onKeyDown(t){switch(t.key){case"ArrowDown":case"ArrowUp":{if(t.preventDefault(),!this.open)return this.openList();this.activeIndex=ye(this.options,this.activeIndex,t.key==="ArrowDown"?1:-1);return}case"Home":if(!this.open)return;t.preventDefault(),this.activeIndex=St(this.options);return;case"End":if(!this.open)return;t.preventDefault(),this.activeIndex=Oe(this.options);return;case"Enter":case" ":{if(t.preventDefault(),!this.open)return this.openList();let e=this.options[this.activeIndex];e&&this.choose(e);return}case"Escape":if(!this.open)return;t.stopPropagation(),this.closeList();return;case"Tab":this.closeList()}}optionId(t){return`${this.listId}-option-${t}`}render(){let t=this.selectedOption,e=this.clearable&&t!==void 0&&!this.inactive;return d`<div
|
|
3466
3466
|
class=${w({open:this.open,error:!!this.error})}
|
|
3467
3467
|
@keydown=${this.onKeyDown}
|
|
3468
3468
|
>
|
|
@@ -3481,14 +3481,14 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3481
3481
|
@click=${this.toggleList}
|
|
3482
3482
|
>
|
|
3483
3483
|
<span class=${w({value:!0,placeholder:!t})}>
|
|
3484
|
-
${t?
|
|
3484
|
+
${t?ht(t):this.placeholder??m().select}
|
|
3485
3485
|
</span>
|
|
3486
3486
|
<span class="icons">
|
|
3487
3487
|
${e?d`<span
|
|
3488
3488
|
class="clear"
|
|
3489
3489
|
role="button"
|
|
3490
3490
|
tabindex="-1"
|
|
3491
|
-
aria-label=${
|
|
3491
|
+
aria-label=${m().clear}
|
|
3492
3492
|
@click=${this.clear}
|
|
3493
3493
|
>
|
|
3494
3494
|
<kt-icon name="x" size="18"></kt-icon>
|
|
@@ -3503,9 +3503,9 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3503
3503
|
popover="manual"
|
|
3504
3504
|
class=${w({popup:!0,floating:!0,open:this.open,top:this.placement==="top"})}
|
|
3505
3505
|
role="listbox"
|
|
3506
|
-
aria-label=${this.label||(this.placeholder??
|
|
3506
|
+
aria-label=${this.label||(this.placeholder??m().select)}
|
|
3507
3507
|
>
|
|
3508
|
-
${this.options.length===0?d`<li class="empty">${this.emptyText??
|
|
3508
|
+
${this.options.length===0?d`<li class="empty">${this.emptyText??m().noOptions}</li>`:this.options.map((a,r)=>d`<li
|
|
3509
3509
|
part="option"
|
|
3510
3510
|
id=${this.optionId(r)}
|
|
3511
3511
|
class=${w({option:!0,selected:a.id===this.value,active:r===this.activeIndex,disabled:!!a.disabled})}
|
|
@@ -3514,10 +3514,10 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3514
3514
|
aria-disabled=${a.disabled?"true":l}
|
|
3515
3515
|
@click=${()=>this.choose(a)}
|
|
3516
3516
|
>
|
|
3517
|
-
${
|
|
3517
|
+
${ht(a)}
|
|
3518
3518
|
</li>`)}
|
|
3519
3519
|
</ul>
|
|
3520
|
-
</div>`}};
|
|
3520
|
+
</div>`}};kt([k()],ot.prototype,"open");kt([k()],ot.prototype,"placement");kt([k()],ot.prototype,"activeIndex");kt([n({attribute:!1})],ot.prototype,"options");kt([n({type:String})],ot.prototype,"value");kt([n({type:String})],ot.prototype,"placeholder");kt([n({type:String})],ot.prototype,"name");kt([n({type:String,reflect:!0})],ot.prototype,"size");kt([n({type:Boolean,reflect:!0})],ot.prototype,"disabled");kt([k()],ot.prototype,"formDisabled");kt([n({type:Boolean,reflect:!0})],ot.prototype,"required");kt([n({type:String,reflect:!0})],ot.prototype,"error");kt([n({type:Boolean})],ot.prototype,"clearable");kt([n({type:String})],ot.prototype,"label");kt([n({type:String,attribute:"empty-text"})],ot.prototype,"emptyText");b("kt-select",ot);var Rn=Object.defineProperty,Ot=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Rn(t,e,r),r},it=class extends h{constructor(){super(...arguments),this.internals=null,this.defaultValue="",this.value="",this.name="",this.placeholder="",this.rows=3,this.disabled=!1,this.formDisabled=!1,this.readonly=!1,this.required=!1,this.error="",this.label="",this.resize="none"}static{this.formAssociated=!0}static{this.styles=[h.styles,v`
|
|
3521
3521
|
:host {
|
|
3522
3522
|
display: block;
|
|
3523
3523
|
}
|
|
@@ -3616,7 +3616,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3616
3616
|
display: flex;
|
|
3617
3617
|
color: var(--color-danger-text);
|
|
3618
3618
|
}
|
|
3619
|
-
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=
|
|
3619
|
+
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=q(this),this.defaultValue=this.value,R(this.internals,this.value)}willUpdate(t){if(t.has("value")||t.has("required")||t.has("error")||this.stringsChanged(t)){R(this.internals,this.value);let e=this.required&&this.value.length===0;H(this.internals,{valueMissing:e,customError:!!this.error},this.error||(e?m().required:""))}}formResetCallback(){this.value=this.defaultValue}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){this.value=t}focus(t){this.control?.focus(t)}blur(){this.control?.blur()}onInput(t){this.value=t.target.value,y(this,"kt-input",{value:this.value})}onChange(t){t.stopPropagation(),y(this,"kt-change",{value:this.value})}render(){let t=this.maxlength!==void 0,e=this.maxlength!==void 0&&this.value.length>=this.maxlength;return d`<div
|
|
3620
3620
|
part="base"
|
|
3621
3621
|
class=${w({field:!0,error:!!this.error,disabled:this.inactive})}
|
|
3622
3622
|
>
|
|
@@ -3630,7 +3630,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3630
3630
|
aria-label=${this.label||l}
|
|
3631
3631
|
aria-invalid=${this.error?"true":l}
|
|
3632
3632
|
aria-describedby=${this.error?"error-message":l}
|
|
3633
|
-
.value=${
|
|
3633
|
+
.value=${It(this.value)}
|
|
3634
3634
|
?disabled=${this.inactive}
|
|
3635
3635
|
?readonly=${this.readonly}
|
|
3636
3636
|
?required=${this.required}
|
|
@@ -3650,7 +3650,280 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3650
3650
|
${this.value.length} / ${this.maxlength}
|
|
3651
3651
|
</span>`:l}
|
|
3652
3652
|
</div>`:l}
|
|
3653
|
-
</div>`}};
|
|
3653
|
+
</div>`}};Ot([T("textarea")],it.prototype,"control");Ot([n({type:String})],it.prototype,"value");Ot([n({type:String})],it.prototype,"name");Ot([n({type:String})],it.prototype,"placeholder");Ot([n({type:Number})],it.prototype,"rows");Ot([n({type:Number})],it.prototype,"maxlength");Ot([n({type:Boolean,reflect:!0})],it.prototype,"disabled");Ot([k()],it.prototype,"formDisabled");Ot([n({type:Boolean,reflect:!0})],it.prototype,"readonly");Ot([n({type:Boolean,reflect:!0})],it.prototype,"required");Ot([n({type:String,reflect:!0})],it.prototype,"error");Ot([n({type:String})],it.prototype,"label");Ot([n({type:String,reflect:!0})],it.prototype,"resize");b("kt-textarea",it);function qe(o){if(!Number.isFinite(o))return 0;let[t="",e]=o.toExponential().split("e"),a=(t.split(".")[1]??"").length;return Math.max(0,a-Number(e))}var zn=Object.defineProperty,te=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&zn(t,e,r),r},wt=class extends h{constructor(){super(...arguments),this.value="",this.min=0,this.max=100,this.step=1,this.range=!1,this.label="",this.name="",this.disabled=!1,this.showValue=!1,this.format=t=>String(t),this.formDisabled=!1,this.internals=null,this.defaultValue=""}static{this.formAssociated=!0}static{this.styles=[h.styles,v`
|
|
3654
|
+
:host {
|
|
3655
|
+
display: block;
|
|
3656
|
+
--kt-slider-thumb: calc(18px * var(--density-scale, 1));
|
|
3657
|
+
--kt-slider-track: 6px;
|
|
3658
|
+
}
|
|
3659
|
+
:host([disabled]) {
|
|
3660
|
+
opacity: 0.5;
|
|
3661
|
+
}
|
|
3662
|
+
|
|
3663
|
+
.head {
|
|
3664
|
+
display: flex;
|
|
3665
|
+
justify-content: space-between;
|
|
3666
|
+
gap: var(--gap-button);
|
|
3667
|
+
margin-bottom: 8px;
|
|
3668
|
+
color: var(--text-body);
|
|
3669
|
+
font: var(--font-normal-regular);
|
|
3670
|
+
}
|
|
3671
|
+
.value {
|
|
3672
|
+
color: var(--text-muted);
|
|
3673
|
+
font-variant-numeric: tabular-nums;
|
|
3674
|
+
}
|
|
3675
|
+
|
|
3676
|
+
.control {
|
|
3677
|
+
position: relative;
|
|
3678
|
+
height: var(--kt-slider-thumb);
|
|
3679
|
+
}
|
|
3680
|
+
.track,
|
|
3681
|
+
.fill {
|
|
3682
|
+
position: absolute;
|
|
3683
|
+
top: 50%;
|
|
3684
|
+
height: var(--kt-slider-track);
|
|
3685
|
+
border-radius: var(--radius-full);
|
|
3686
|
+
transform: translateY(-50%);
|
|
3687
|
+
}
|
|
3688
|
+
.track {
|
|
3689
|
+
right: 0;
|
|
3690
|
+
left: 0;
|
|
3691
|
+
background: var(--color-dark-22);
|
|
3692
|
+
}
|
|
3693
|
+
.fill {
|
|
3694
|
+
background: var(--color-primary-base);
|
|
3695
|
+
}
|
|
3696
|
+
|
|
3697
|
+
/* The native inputs lie over the track, invisible but for their thumbs:
|
|
3698
|
+
two can share it, and each thumb still catches its own pointer. */
|
|
3699
|
+
input {
|
|
3700
|
+
position: absolute;
|
|
3701
|
+
inset: 0;
|
|
3702
|
+
width: 100%;
|
|
3703
|
+
height: 100%;
|
|
3704
|
+
margin: 0;
|
|
3705
|
+
background: none;
|
|
3706
|
+
pointer-events: none;
|
|
3707
|
+
appearance: none;
|
|
3708
|
+
}
|
|
3709
|
+
input:focus {
|
|
3710
|
+
outline: none;
|
|
3711
|
+
}
|
|
3712
|
+
input.front {
|
|
3713
|
+
z-index: 1;
|
|
3714
|
+
}
|
|
3715
|
+
input::-webkit-slider-runnable-track {
|
|
3716
|
+
height: 100%;
|
|
3717
|
+
background: none;
|
|
3718
|
+
}
|
|
3719
|
+
input::-moz-range-track {
|
|
3720
|
+
background: none;
|
|
3721
|
+
}
|
|
3722
|
+
input::-webkit-slider-thumb {
|
|
3723
|
+
width: var(--kt-slider-thumb);
|
|
3724
|
+
height: var(--kt-slider-thumb);
|
|
3725
|
+
background: var(--color-white);
|
|
3726
|
+
border: 2px solid var(--color-primary-base);
|
|
3727
|
+
border-radius: 50%;
|
|
3728
|
+
box-shadow: 0 1px 3px color-mix(in srgb, var(--color-backdrop) 70%, transparent);
|
|
3729
|
+
cursor: grab;
|
|
3730
|
+
pointer-events: auto;
|
|
3731
|
+
appearance: none;
|
|
3732
|
+
transition: box-shadow var(--duration-instant);
|
|
3733
|
+
}
|
|
3734
|
+
input::-moz-range-thumb {
|
|
3735
|
+
box-sizing: border-box;
|
|
3736
|
+
width: var(--kt-slider-thumb);
|
|
3737
|
+
height: var(--kt-slider-thumb);
|
|
3738
|
+
background: var(--color-white);
|
|
3739
|
+
border: 2px solid var(--color-primary-base);
|
|
3740
|
+
border-radius: 50%;
|
|
3741
|
+
box-shadow: 0 1px 3px color-mix(in srgb, var(--color-backdrop) 70%, transparent);
|
|
3742
|
+
cursor: grab;
|
|
3743
|
+
pointer-events: auto;
|
|
3744
|
+
}
|
|
3745
|
+
input:focus-visible::-webkit-slider-thumb {
|
|
3746
|
+
box-shadow:
|
|
3747
|
+
0 0 0 4px var(--color-primary-soft),
|
|
3748
|
+
0 0 0 2px var(--color-primary-base);
|
|
3749
|
+
}
|
|
3750
|
+
input:focus-visible::-moz-range-thumb {
|
|
3751
|
+
box-shadow:
|
|
3752
|
+
0 0 0 4px var(--color-primary-soft),
|
|
3753
|
+
0 0 0 2px var(--color-primary-base);
|
|
3754
|
+
}
|
|
3755
|
+
input:disabled::-webkit-slider-thumb {
|
|
3756
|
+
cursor: not-allowed;
|
|
3757
|
+
}
|
|
3758
|
+
`]}connectedCallback(){super.connectedCallback(),this.internals??=q(this)}firstUpdated(){this.defaultValue=this.value}willUpdate(t){if(t.has("value")||t.has("min")||t.has("max")||t.has("step")||t.has("range")){let e=this.normalised(this.value);e!==this.value&&(this.value=e),R(this.internals,this.value)}}formResetCallback(){this.value=this.defaultValue}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){t!==null&&(this.value=t)}get numbers(){return this.value.split("/").map(Number)}snap(t){if(!Number.isFinite(t))return this.min;let e=this.step>0?this.step:1,a=this.min+Math.round((t-this.min)/e)*e,r=Math.max(qe(e),qe(this.min));return Number(Math.min(this.max,Math.max(this.min,a)).toFixed(r))}normalised(t){let e=t===""?[]:t.split("/").map(Number);if(!this.range)return String(this.snap(e[0]??this.min));let a=this.snap(e[0]??this.min),r=this.snap(e[1]??this.max);return`${Math.min(a,r)}/${Math.max(a,r)}`}onSlide(t,e,a){let r=t.target,s=this.snap(Number(r.value));if(this.range){let[i,p]=this.numbers;e===0?s=Math.min(s,p):s=Math.max(s,i),r.value=String(s),this.value=e===0?`${s}/${p}`:`${i}/${s}`}else this.value=String(s);y(this,a?"kt-change":"kt-input",{value:this.value})}percent(t){return this.max>this.min?(t-this.min)/(this.max-this.min)*100:0}render(){let t=m(),e=this.numbers,[a,r]=this.range?[e[0],e[1]]:[this.min,e[0]],s=this.disabled||this.formDisabled,i=this.range?`${this.format(e[0])} \u2013 ${this.format(e[1])}`:this.format(e[0]),p=f=>f.charAt(0).toUpperCase()+f.slice(1),c=this.range?this.label?[`${this.label}, ${t.sliderMinimum}`,`${this.label}, ${t.sliderMaximum}`]:[p(t.sliderMinimum),p(t.sliderMaximum)]:[this.label],u=this.range&&e[0]===e[1]&&e[0]>this.min;return d`${this.showValue?d`<div class="head">
|
|
3759
|
+
<span>${this.label}</span>
|
|
3760
|
+
<span part="value" class="value">${i}</span>
|
|
3761
|
+
</div>`:l}
|
|
3762
|
+
<div class="control">
|
|
3763
|
+
<div part="track" class="track"></div>
|
|
3764
|
+
<div
|
|
3765
|
+
part="fill"
|
|
3766
|
+
class="fill"
|
|
3767
|
+
style=${`left: ${this.percent(a)}%; right: ${100-this.percent(r)}%`}
|
|
3768
|
+
></div>
|
|
3769
|
+
${e.map((f,g)=>d`<input
|
|
3770
|
+
class=${g===0&&u?"front":""}
|
|
3771
|
+
type="range"
|
|
3772
|
+
min=${this.min}
|
|
3773
|
+
max=${this.max}
|
|
3774
|
+
step=${this.step}
|
|
3775
|
+
.value=${String(f)}
|
|
3776
|
+
?disabled=${s}
|
|
3777
|
+
aria-label=${c[g]||l}
|
|
3778
|
+
aria-valuetext=${this.format(f)}
|
|
3779
|
+
@input=${x=>this.onSlide(x,g,!1)}
|
|
3780
|
+
@change=${x=>this.onSlide(x,g,!0)}
|
|
3781
|
+
/>`)}
|
|
3782
|
+
</div>`}};te([n({type:String,reflect:!0})],wt.prototype,"value");te([n({type:Number})],wt.prototype,"min");te([n({type:Number})],wt.prototype,"max");te([n({type:Number})],wt.prototype,"step");te([n({type:Boolean,reflect:!0})],wt.prototype,"range");te([n({type:String})],wt.prototype,"label");te([n({type:String})],wt.prototype,"name");te([n({type:Boolean,reflect:!0})],wt.prototype,"disabled");te([n({type:Boolean,attribute:"show-value"})],wt.prototype,"showValue");te([n({attribute:!1})],wt.prototype,"format");te([k()],wt.prototype,"formDisabled");b("kt-slider",wt);var qn=Object.defineProperty,ct=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&qn(t,e,r),r};function Kn(o){let t=new Intl.NumberFormat(o).formatToParts(12345.6);return{group:t.find(e=>e.type==="group")?.value??",",decimal:t.find(e=>e.type==="decimal")?.value??"."}}function In(o,t,e=!1){let{group:a,decimal:r}=Kn(t),s=o.replace(/[\u200e\u200f\u061c]/g,"").replace(/[\u2212\u2012\u2013\u2014]/g,"-").replace(/\s/g,"").split(a).join("").replace(r,".").replace(/[%\p{Sc}]/gu,"");if(!/^[+-]?(\d+\.?\d*|\.\d+)$/.test(s))return NaN;let i=Number(s);return e?i/100:i}var et=class extends h{constructor(){super(...arguments),this.value=null,this.min=Number.NEGATIVE_INFINITY,this.max=Number.POSITIVE_INFINITY,this.step=1,this.name="",this.label="",this.locale="",this.placeholder="",this.size="medium",this.disabled=!1,this.required=!1,this.error="",this.formatOptions={},this.focused=!1,this.formDisabled=!1,this.internals=null,this.defaultValue=null,this.errorId=j("kt-number-error")}static{this.formAssociated=!0}static{this.styles=[h.styles,v`
|
|
3783
|
+
:host {
|
|
3784
|
+
display: block;
|
|
3785
|
+
--field-height: var(--button-height);
|
|
3786
|
+
}
|
|
3787
|
+
:host([size='small']) {
|
|
3788
|
+
--field-height: var(--button-height-small);
|
|
3789
|
+
}
|
|
3790
|
+
:host([size='large']) {
|
|
3791
|
+
--field-height: var(--button-height-large);
|
|
3792
|
+
}
|
|
3793
|
+
|
|
3794
|
+
.field {
|
|
3795
|
+
display: flex;
|
|
3796
|
+
align-items: center;
|
|
3797
|
+
height: var(--field-height);
|
|
3798
|
+
background-color: var(--surface-field);
|
|
3799
|
+
border: var(--border-width) solid var(--border-field);
|
|
3800
|
+
border-radius: var(--radius-input);
|
|
3801
|
+
outline: var(--outline-width) solid transparent;
|
|
3802
|
+
transition: outline-color var(--duration-instant);
|
|
3803
|
+
}
|
|
3804
|
+
.field:hover {
|
|
3805
|
+
outline: var(--outline-width) solid var(--color-text-700);
|
|
3806
|
+
}
|
|
3807
|
+
.field:focus-within {
|
|
3808
|
+
outline: var(--outline-width) solid var(--color-primary-base);
|
|
3809
|
+
}
|
|
3810
|
+
.field.error,
|
|
3811
|
+
.field.error:hover,
|
|
3812
|
+
.field.error:focus-within {
|
|
3813
|
+
outline: var(--outline-width) solid var(--color-danger-base);
|
|
3814
|
+
}
|
|
3815
|
+
.field.disabled {
|
|
3816
|
+
background-color: var(--color-dark-14);
|
|
3817
|
+
pointer-events: none;
|
|
3818
|
+
}
|
|
3819
|
+
|
|
3820
|
+
input {
|
|
3821
|
+
flex: 1;
|
|
3822
|
+
min-width: 0;
|
|
3823
|
+
height: 100%;
|
|
3824
|
+
padding: 0 4px;
|
|
3825
|
+
color: var(--text-body);
|
|
3826
|
+
font: var(--font-input);
|
|
3827
|
+
font-variant-numeric: tabular-nums;
|
|
3828
|
+
text-align: center;
|
|
3829
|
+
background: transparent;
|
|
3830
|
+
border: none;
|
|
3831
|
+
outline: none;
|
|
3832
|
+
}
|
|
3833
|
+
.disabled input {
|
|
3834
|
+
color: var(--text-disabled);
|
|
3835
|
+
}
|
|
3836
|
+
|
|
3837
|
+
button {
|
|
3838
|
+
display: inline-grid;
|
|
3839
|
+
flex: none;
|
|
3840
|
+
place-items: center;
|
|
3841
|
+
width: var(--field-height);
|
|
3842
|
+
height: 100%;
|
|
3843
|
+
padding: 0;
|
|
3844
|
+
color: var(--text-muted);
|
|
3845
|
+
background: none;
|
|
3846
|
+
border: none;
|
|
3847
|
+
cursor: pointer;
|
|
3848
|
+
transition:
|
|
3849
|
+
color var(--duration-instant),
|
|
3850
|
+
background-color var(--duration-instant);
|
|
3851
|
+
}
|
|
3852
|
+
button:hover:not(:disabled) {
|
|
3853
|
+
color: var(--text-body);
|
|
3854
|
+
background: var(--surface-hover);
|
|
3855
|
+
}
|
|
3856
|
+
.minus {
|
|
3857
|
+
border-radius: calc(var(--radius-input) - 1px) 0 0 calc(var(--radius-input) - 1px);
|
|
3858
|
+
}
|
|
3859
|
+
.plus {
|
|
3860
|
+
border-radius: 0 calc(var(--radius-input) - 1px) calc(var(--radius-input) - 1px) 0;
|
|
3861
|
+
}
|
|
3862
|
+
button:disabled {
|
|
3863
|
+
color: var(--text-disabled);
|
|
3864
|
+
cursor: not-allowed;
|
|
3865
|
+
}
|
|
3866
|
+
.visually-hidden {
|
|
3867
|
+
position: absolute;
|
|
3868
|
+
width: 1px;
|
|
3869
|
+
height: 1px;
|
|
3870
|
+
overflow: hidden;
|
|
3871
|
+
clip-path: inset(50%);
|
|
3872
|
+
white-space: nowrap;
|
|
3873
|
+
}
|
|
3874
|
+
button:focus-visible {
|
|
3875
|
+
outline: var(--outline-width) solid var(--color-primary-base);
|
|
3876
|
+
outline-offset: -2px;
|
|
3877
|
+
}
|
|
3878
|
+
`]}connectedCallback(){super.connectedCallback(),this.internals??=q(this),this.value=this.value===null?null:this.clamp(this.value),this.defaultValue=this.value}willUpdate(t){if(t.has("value")||t.has("required")||t.has("error")||this.stringsChanged(t)){R(this.internals,this.value===null?null:String(this.value));let e=this.required&&this.value===null;H(this.internals,{valueMissing:e,customError:!!this.error},this.error||(e?m().numberRequired:""))}}formResetCallback(){this.value=this.defaultValue}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){this.value=t===null||t===""?null:Number(t)}focus(t){this.input?.focus(t)}get resolvedLocale(){return se(this.locale)}get inactive(){return this.disabled||this.formDisabled}clamp(t){let e=this.step>0?this.step:1,a=Number.isFinite(this.min)?this.min:0,r=a+Math.round((t-a)/e)*e,s=Math.max(qe(e),qe(a));return Number(Math.min(this.max,Math.max(this.min,r)).toFixed(s))}commit(t){let e=t===null?null:this.clamp(t);this.input&&(this.input.value=this.text(e)),e!==this.value&&(this.value=e,y(this,"kt-change",{value:e}))}text(t){if(t===null)return"";let e=Math.max(qe(this.step),qe(this.min));if(this.focused){let r=this.percent?t*100:t;return new Intl.NumberFormat(this.resolvedLocale,{maximumFractionDigits:20,useGrouping:!1}).format(Number(r.toPrecision(15)))}let a=this.formatOptions.minimumFractionDigits??0;return new Intl.NumberFormat(this.resolvedLocale,{maximumFractionDigits:Math.max(e,3,a),...this.formatOptions}).format(t)}get percent(){return this.formatOptions.style==="percent"}stepBy(t){if(this.inactive)return;let e=this.value??(Number.isFinite(this.min)?this.min:0);this.commit(this.value===null?e:e+t*this.step)}onKeyDown(t){let e={ArrowUp:()=>this.stepBy(1),ArrowDown:()=>this.stepBy(-1),PageUp:()=>this.stepBy(10),PageDown:()=>this.stepBy(-10),Home:()=>Number.isFinite(this.min)&&this.commit(this.min),End:()=>Number.isFinite(this.max)&&this.commit(this.max),Enter:()=>this.readTyped()}[t.key];e&&(t.preventDefault(),e())}readTyped(){let t=this.input.value.trim();if(t===""){this.commit(null);return}let e=In(t,this.resolvedLocale,this.percent);if(Number.isNaN(e)){this.input.value=this.text(this.value);return}this.commit(e)}onFocus(){this.focused=!0,this.input.value=this.text(this.value)}onBlur(){this.readTyped(),this.focused=!1,this.input.value=this.text(this.value)}render(){let t=m(),e=this.inactive,a=this.value!==null&&this.value<=this.min,r=this.value!==null&&this.value>=this.max,s=this.text(this.value);return d`${this.error?d`<span id=${this.errorId} class="visually-hidden">${this.error}</span>`:l}
|
|
3879
|
+
<div
|
|
3880
|
+
part="field"
|
|
3881
|
+
class=${w({field:!0,error:!!this.error,disabled:e})}
|
|
3882
|
+
>
|
|
3883
|
+
<button
|
|
3884
|
+
part="decrease"
|
|
3885
|
+
class="minus"
|
|
3886
|
+
type="button"
|
|
3887
|
+
tabindex="-1"
|
|
3888
|
+
aria-label=${t.decrease}
|
|
3889
|
+
?disabled=${e||a}
|
|
3890
|
+
@click=${()=>this.stepBy(-1)}
|
|
3891
|
+
>
|
|
3892
|
+
<kt-icon name="minus" size="16"></kt-icon>
|
|
3893
|
+
</button>
|
|
3894
|
+
<input
|
|
3895
|
+
part="input"
|
|
3896
|
+
type="text"
|
|
3897
|
+
role="spinbutton"
|
|
3898
|
+
inputmode="decimal"
|
|
3899
|
+
autocomplete="off"
|
|
3900
|
+
.value=${s}
|
|
3901
|
+
placeholder=${this.placeholder||l}
|
|
3902
|
+
aria-label=${this.label||l}
|
|
3903
|
+
aria-valuenow=${this.value??l}
|
|
3904
|
+
aria-valuetext=${this.value===null?l:s}
|
|
3905
|
+
aria-valuemin=${Number.isFinite(this.min)?this.min:l}
|
|
3906
|
+
aria-valuemax=${Number.isFinite(this.max)?this.max:l}
|
|
3907
|
+
aria-invalid=${this.error?"true":l}
|
|
3908
|
+
aria-describedby=${this.error?this.errorId:l}
|
|
3909
|
+
aria-required=${this.required?"true":l}
|
|
3910
|
+
?disabled=${e}
|
|
3911
|
+
@keydown=${this.onKeyDown}
|
|
3912
|
+
@focus=${this.onFocus}
|
|
3913
|
+
@blur=${this.onBlur}
|
|
3914
|
+
/>
|
|
3915
|
+
<button
|
|
3916
|
+
part="increase"
|
|
3917
|
+
class="plus"
|
|
3918
|
+
type="button"
|
|
3919
|
+
tabindex="-1"
|
|
3920
|
+
aria-label=${t.increase}
|
|
3921
|
+
?disabled=${e||r}
|
|
3922
|
+
@click=${()=>this.stepBy(1)}
|
|
3923
|
+
>
|
|
3924
|
+
<kt-icon name="plus" size="16"></kt-icon>
|
|
3925
|
+
</button>
|
|
3926
|
+
</div>`}};ct([n({converter:{fromAttribute:o=>{let t=o===null||o.trim()===""?NaN:Number(o);return Number.isFinite(t)?t:null}}})],et.prototype,"value");ct([n({type:Number})],et.prototype,"min");ct([n({type:Number})],et.prototype,"max");ct([n({type:Number})],et.prototype,"step");ct([n({type:String})],et.prototype,"name");ct([n({type:String})],et.prototype,"label");ct([n({type:String})],et.prototype,"locale");ct([n({type:String})],et.prototype,"placeholder");ct([n({type:String,reflect:!0})],et.prototype,"size");ct([n({type:Boolean,reflect:!0})],et.prototype,"disabled");ct([n({type:Boolean,reflect:!0})],et.prototype,"required");ct([n({type:String,reflect:!0})],et.prototype,"error");ct([n({attribute:!1})],et.prototype,"formatOptions");ct([k()],et.prototype,"focused");ct([k()],et.prototype,"formDisabled");ct([T("input")],et.prototype,"input");b("kt-number-input",et);var Fn=Object.defineProperty,So=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Fn(t,e,r),r};function Un(o,t){let e=Bt(o,{hour:"2-digit",minute:"2-digit",hourCycle:t?"h12":"h23"}),a=e.formatToParts(new Date(2026,0,1,1,5)),r=a.map(p=>p.type),s=a.find(p=>p.type==="literal")?.value.trim()||":",i=p=>e.formatToParts(new Date(2026,0,1,p)).find(c=>c.type==="dayPeriod")?.value??(p<12?"AM":"PM");return{separator:s==="."?".":":",periodFirst:r.indexOf("dayPeriod")>=0&&r.indexOf("dayPeriod")<r.indexOf("hour"),periods:[i(1),i(13)]}}function ba(o){let t=/^(\d{2}):(\d{2})(?::(\d{2}))?$/.exec(o);if(!t)return null;let[e,a,r=0]=t.slice(1).map(s=>Number(s??0));return e>23||a>59||r>59?null:e*3600+a*60+r}var zr=o=>String(o).padStart(2,"0"),or=class extends Q{constructor(){super(...arguments),this.seconds=!1,this.hourCycle="",this.step=1}get twelve(){if(this.hourCycle)return this.hourCycle==="h12";let t=Bt(this.resolvedLocale,{hour:"numeric"}).resolvedOptions().hourCycle;return t==="h11"||t==="h12"}willUpdate(t){(t.has("hourCycle")||t.has("seconds"))&&(this.texts=this.fill(this.value)),super.willUpdate(t)}items(){let t=m(),e=this.twelve,{separator:a,periodFirst:r,periods:s}=Un(this.resolvedLocale,e),i=(c,u,f,g,x=1)=>({key:c,label:u,placeholder:t.placeholderTime,spec:{min:f,max:g,length:2},step:x}),p=[e?i("hour",t.segmentHour,1,12):i("hour",t.segmentHour,0,23),{literal:a},i("minute",t.segmentMinute,0,59,Math.max(1,Math.round(this.step)||1))];if(this.seconds&&p.push({literal:a},i("second",t.segmentSecond,0,59)),e){let c={key:"period",label:t.segmentDayPeriod,placeholder:t.placeholderTime,choices:s};r?p.unshift(c,{literal:" "}):p.push({literal:" "},c)}return p}fill(t){let e=t===null?null:ba(t);if(e===null)return{hour:"",minute:"",second:"",period:""};let a=Math.floor(e/3600);return{hour:zr(this.twelve?a%12||12:a),minute:zr(Math.floor(e/60)%60),second:zr(e%60),period:a<12?"0":"1"}}read(t){let{hour:e="",minute:a="",second:r="",period:s=""}=t,i=this.twelve;if(e.length<2||a.length<2||this.seconds&&r.length<2||i&&s==="")return{value:null,error:""};let p=Number(e);if(i){if(p<1||p>12)return{value:null,error:""};p=p%12+(s==="1"?12:0)}let c=`${zr(p)}:${a}${this.seconds?`:${r}`:""}`,u=ba(c);if(u===null)return{value:null,error:""};let f=ba(this.min),g=ba(this.max);return f!==null&&u<f||g!==null&&u>g?{value:null,error:m().timeOutOfRange}:{value:c,error:""}}completeOnBlur(t,e){if(!t.spec||e.length!==1)return null;let a=Number(e);return a<t.spec.min?null:zr(a)}requiredMessage(){return m().timeRequired}};So([n({type:Boolean,reflect:!0})],or.prototype,"seconds");So([n({type:String,attribute:"hour-cycle"})],or.prototype,"hourCycle");So([n({type:Number})],or.prototype,"step");b("kt-time-input",or);var Hn=Object.defineProperty,sr=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Hn(t,e,r),r},ee=class extends h{constructor(){super(...arguments),this.internals=null,this.defaultChecked=!1,this.checked=!1,this.disabled=!1,this.formDisabled=!1,this.size="medium",this.name="",this.value="on",this.label=""}static{this.formAssociated=!0}static{this.styles=[h.styles,v`
|
|
3654
3927
|
:host {
|
|
3655
3928
|
display: inline-flex;
|
|
3656
3929
|
align-items: center;
|
|
@@ -3736,7 +4009,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3736
4009
|
color: var(--text-disabled);
|
|
3737
4010
|
cursor: not-allowed;
|
|
3738
4011
|
}
|
|
3739
|
-
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=
|
|
4012
|
+
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=q(this),this.defaultChecked=this.checked,this.syncFormValue()}willUpdate(t){(t.has("checked")||t.has("value"))&&this.syncFormValue()}syncFormValue(){R(this.internals,this.checked?this.value:null)}formResetCallback(){this.checked=this.defaultChecked}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){this.checked=t===this.value}focus(t){this.shadowRoot?.querySelector("button")?.focus(t)}toggle(){this.inactive||(this.checked=!this.checked,y(this,"kt-change",{checked:this.checked}))}render(){return d`<button
|
|
3740
4013
|
part="base"
|
|
3741
4014
|
type="button"
|
|
3742
4015
|
role="switch"
|
|
@@ -3750,7 +4023,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3750
4023
|
<span part="thumb" class="thumb"></span>
|
|
3751
4024
|
</span>
|
|
3752
4025
|
</button>
|
|
3753
|
-
<span id="label" class="label" @click=${this.toggle}><slot></slot></span>`}};
|
|
4026
|
+
<span id="label" class="label" @click=${this.toggle}><slot></slot></span>`}};sr([n({type:Boolean,reflect:!0})],ee.prototype,"checked");sr([n({type:Boolean,reflect:!0})],ee.prototype,"disabled");sr([k()],ee.prototype,"formDisabled");sr([n({type:String,reflect:!0})],ee.prototype,"size");sr([n({type:String})],ee.prototype,"name");sr([n({type:String})],ee.prototype,"value");sr([n({type:String})],ee.prototype,"label");b("kt-toggle",ee);var Nn=Object.defineProperty,Ks=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Nn(t,e,r),r},vr=class extends h{constructor(){super(...arguments),this.items=[],this.label=void 0}static{this.styles=[h.styles,v`
|
|
3754
4027
|
:host {
|
|
3755
4028
|
display: block;
|
|
3756
4029
|
}
|
|
@@ -3790,7 +4063,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3790
4063
|
display: inline-flex;
|
|
3791
4064
|
color: var(--color-text-600);
|
|
3792
4065
|
}
|
|
3793
|
-
`]}onSelect(t,e,a){t.metaKey||t.ctrlKey||t.shiftKey||t.button!==0||!y(this,"kt-navigate",{item:e,index:a}).defaultPrevented||t.preventDefault()}render(){let t=this.items.length-1;return d`<nav part="nav" aria-label=${this.label??
|
|
4066
|
+
`]}onSelect(t,e,a){t.metaKey||t.ctrlKey||t.shiftKey||t.button!==0||!y(this,"kt-navigate",{item:e,index:a}).defaultPrevented||t.preventDefault()}render(){let t=this.items.length-1;return d`<nav part="nav" aria-label=${this.label??m().breadcrumb}>
|
|
3794
4067
|
${this.items.map((e,a)=>a===t?d`<span part="item" class="item current" aria-current="page">${e.label}</span>`:d`<a
|
|
3795
4068
|
part="item"
|
|
3796
4069
|
class="item"
|
|
@@ -3802,7 +4075,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3802
4075
|
<kt-icon name="chevron-right" size="14"></kt-icon>
|
|
3803
4076
|
</span>`)}
|
|
3804
4077
|
${this.items.length===0?l:""}
|
|
3805
|
-
</nav>`}};
|
|
4078
|
+
</nav>`}};Ks([n({attribute:!1})],vr.prototype,"items");Ks([n({type:String})],vr.prototype,"label");b("kt-breadcrumb",vr);var _n=Object.defineProperty,ya=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&_n(t,e,r),r},Ke=class extends h{constructor(){super(...arguments),this.eyebrow="",this.heading="",this.description="",this.level="page"}static{this.styles=[h.styles,v`
|
|
3806
4079
|
:host {
|
|
3807
4080
|
display: block;
|
|
3808
4081
|
}
|
|
@@ -3873,7 +4146,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3873
4146
|
<slot></slot>
|
|
3874
4147
|
</div>
|
|
3875
4148
|
<div class="actions"><slot name="actions"></slot></div>
|
|
3876
|
-
</div>`}};
|
|
4149
|
+
</div>`}};ya([n({type:String})],Ke.prototype,"eyebrow");ya([n({type:String})],Ke.prototype,"heading");ya([n({type:String})],Ke.prototype,"description");ya([n({type:String,reflect:!0})],Ke.prototype,"level");b("kt-page-header",Ke);var Vn=Object.defineProperty,de=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Vn(t,e,r),r},jn={small:16,medium:20,large:24},Mt=class extends h{constructor(){super(...arguments),this.internals=null,this.defaultValue=null,this.options=[],this.value=null,this.size="medium",this.orientation="horizontal",this.disabled=!1,this.formDisabled=!1,this.label="",this.name="",this.required=!1}static{this.formAssociated=!0}static{this.styles=[h.styles,v`
|
|
3877
4150
|
:host {
|
|
3878
4151
|
display: inline-block;
|
|
3879
4152
|
}
|
|
@@ -3983,7 +4256,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
3983
4256
|
flex: 1;
|
|
3984
4257
|
text-align: center;
|
|
3985
4258
|
}
|
|
3986
|
-
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=
|
|
4259
|
+
`]}get inactive(){return this.disabled||this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals??=q(this),this.defaultValue=this.value}willUpdate(t){if(t.has("value")||t.has("required")||this.stringsChanged(t)){R(this.internals,this.value===null?null:String(this.value));let e=this.required&&this.value===null;H(this.internals,{valueMissing:e},e?m().selectOption:"")}}formResetCallback(){this.value=this.defaultValue}formDisabledCallback(t){this.formDisabled=t}formStateRestoreCallback(t){this.value=this.options.find(e=>String(e.value)===t)?.value??t}get selectedIndex(){return this.options.findIndex(t=>t.value===this.value)}choose(t){this.inactive||t.disabled||this.value===t.value||(this.value=t.value,y(this,"kt-change",{value:t.value,option:t}))}onKeyDown(t){let e=this.orientation==="vertical"?"ArrowDown":"ArrowRight",a=this.orientation==="vertical"?"ArrowUp":"ArrowLeft",r;if(t.key===e)r=this.step(1);else if(t.key===a)r=this.step(-1);else if(t.key==="Home")r=this.options.findIndex(p=>!p.disabled);else if(t.key==="End")r=this.options.length-1-[...this.options].reverse().findIndex(p=>!p.disabled);else return;if(t.preventDefault(),r===void 0||r<0)return;let s=this.options[r];if(!s)return;let i=r;this.choose(s),this.updateComplete.then(()=>this.segments[i]?.focus())}step(t){let e=this.options.length;if(e===0)return;let a=this.selectedIndex<0?t===1?-1:0:this.selectedIndex;for(let r=1;r<=e;r+=1){let s=((a+t*r)%e+e)%e;if(!this.options[s]?.disabled)return s}}render(){let t=this.selectedIndex,e=t>=0?t:this.options.findIndex(a=>!a.disabled);return d`<div
|
|
3987
4260
|
part="base"
|
|
3988
4261
|
class=${w({track:!0,[this.size]:!0,vertical:this.orientation==="vertical"})}
|
|
3989
4262
|
role="radiogroup"
|
|
@@ -4003,10 +4276,10 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4003
4276
|
?disabled=${this.inactive||a.disabled}
|
|
4004
4277
|
@click=${()=>this.choose(a)}
|
|
4005
4278
|
>
|
|
4006
|
-
${a.icon?d`<kt-icon name=${a.icon} size=${
|
|
4279
|
+
${a.icon?d`<kt-icon name=${a.icon} size=${jn[this.size]}></kt-icon>`:l}
|
|
4007
4280
|
${p?l:d`<span class="text">${i}</span>`}
|
|
4008
4281
|
</button>`})}
|
|
4009
|
-
</div>`}};
|
|
4282
|
+
</div>`}};de([ra(".option")],Mt.prototype,"segments");de([n({attribute:!1})],Mt.prototype,"options");de([n({type:String})],Mt.prototype,"value");de([n({type:String,reflect:!0})],Mt.prototype,"size");de([n({type:String,reflect:!0})],Mt.prototype,"orientation");de([n({type:Boolean,reflect:!0})],Mt.prototype,"disabled");de([k()],Mt.prototype,"formDisabled");de([n({type:String})],Mt.prototype,"label");de([n({type:String})],Mt.prototype,"name");de([n({type:Boolean,reflect:!0})],Mt.prototype,"required");b("kt-segmented-control",Mt);var Gn=Object.defineProperty,br=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Gn(t,e,r),r},pe=class extends h{constructor(){super(...arguments),this.sections=[],this.activeHref="",this.label=void 0,this.flush=!1,this.collapsed=!1,this.overrides={}}static{this.styles=[h.styles,v`
|
|
4010
4283
|
:host {
|
|
4011
4284
|
display: block;
|
|
4012
4285
|
}
|
|
@@ -4152,7 +4425,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4152
4425
|
}
|
|
4153
4426
|
`]}isActive(t){return t.active===!0||this.activeHref!==""&&t.href===this.activeHref}holdsActive(t){return this.isActive(t)?!0:(t.children??[]).some(e=>this.holdsActive(e))}isOpen(t,e){return this.holdsActive(t)?!0:this.overrides[e]??t.open===!0}onSelect(t,e){t.metaKey||t.ctrlKey||t.shiftKey||t.button!==0||y(this,"kt-navigate",{item:e}).defaultPrevented&&t.preventDefault()}onToggle(t,e){let a=!this.isOpen(t,e);this.overrides={...this.overrides,[e]:a},y(this,"kt-toggle",{item:t,open:a})}renderItems(t,e,a){return d`<ul>
|
|
4154
4427
|
${t.map((r,s)=>this.renderItem(r,e,`${a}.${s}`))}
|
|
4155
|
-
</ul>`}renderItem(t,e,a){let r=(t.children??[]).length>0,s=this.isActive(t),i=r&&this.isOpen(t,a),p=w({item:!0,active:s,within:r&&!s&&this.holdsActive(t)}),c=
|
|
4428
|
+
</ul>`}renderItem(t,e,a){let r=(t.children??[]).length>0,s=this.isActive(t),i=r&&this.isOpen(t,a),p=w({item:!0,active:s,within:r&&!s&&this.holdsActive(t)}),c=Tt({"--depth":String(e)}),u=d`
|
|
4156
4429
|
${t.icon?d`<kt-icon name=${t.icon} size="16"></kt-icon>`:l}
|
|
4157
4430
|
<span class="label">${t.label}</span>
|
|
4158
4431
|
${t.badge?d`<kt-badge variant="count">${t.badge}</kt-badge>`:l}
|
|
@@ -4184,12 +4457,12 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4184
4457
|
${u}
|
|
4185
4458
|
</a>`}
|
|
4186
4459
|
${r&&i?d`<div class="children">${this.renderItems(t.children,e+1,a)}</div>`:l}
|
|
4187
|
-
</li>`}render(){return d`<nav part="nav" aria-label=${this.label??
|
|
4460
|
+
</li>`}render(){return d`<nav part="nav" aria-label=${this.label??m().secondaryNavigation}>
|
|
4188
4461
|
${this.sections.map((t,e)=>d`<div part="section">
|
|
4189
4462
|
${t.title?d`<h6 part="title" class="title">${t.title}</h6>`:l}
|
|
4190
4463
|
${this.renderItems(t.items,0,String(e))}
|
|
4191
4464
|
</div>`)}
|
|
4192
|
-
</nav>`}};
|
|
4465
|
+
</nav>`}};br([n({attribute:!1})],pe.prototype,"sections");br([n({type:String,attribute:"active-href"})],pe.prototype,"activeHref");br([n({type:String})],pe.prototype,"label");br([n({type:Boolean,reflect:!0})],pe.prototype,"flush");br([n({type:Boolean,reflect:!0})],pe.prototype,"collapsed");br([k()],pe.prototype,"overrides");b("kt-sub-menu-navigation",pe);var Wn=Object.defineProperty,yr=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Wn(t,e,r),r},ce=class extends h{constructor(){super(...arguments),this.tabs=[],this.value=null,this.disabled=!1,this.loading=!1,this.label=""}static{this.styles=[h.styles,v`
|
|
4193
4466
|
:host {
|
|
4194
4467
|
display: block;
|
|
4195
4468
|
}
|
|
@@ -4279,7 +4552,191 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4279
4552
|
${a.icon?d`<kt-icon name=${a.icon} size="16"></kt-icon>`:l}
|
|
4280
4553
|
${a.label??String(a.value)}
|
|
4281
4554
|
</button>`})}
|
|
4282
|
-
</div>`}};
|
|
4555
|
+
</div>`}};yr([ra(".tab")],ce.prototype,"tabElements");yr([n({attribute:!1})],ce.prototype,"tabs");yr([n({type:String})],ce.prototype,"value");yr([n({type:Boolean,reflect:!0})],ce.prototype,"disabled");yr([n({type:Boolean,reflect:!0})],ce.prototype,"loading");yr([n({type:String})],ce.prototype,"label");b("kt-tabs",ce);var Yn=Object.defineProperty,qr=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Yn(t,e,r),r},$e=class extends h{constructor(){super(...arguments),this.steps=[],this.current="",this.label="",this.orientation="horizontal",this.navigable=!1}static{this.styles=[h.styles,v`
|
|
4556
|
+
:host {
|
|
4557
|
+
display: block;
|
|
4558
|
+
--kt-steps-marker: calc(28px * var(--density-scale, 1));
|
|
4559
|
+
}
|
|
4560
|
+
|
|
4561
|
+
ol {
|
|
4562
|
+
display: flex;
|
|
4563
|
+
margin: 0;
|
|
4564
|
+
padding: 0;
|
|
4565
|
+
list-style: none;
|
|
4566
|
+
}
|
|
4567
|
+
:host([orientation='vertical']) ol {
|
|
4568
|
+
flex-direction: column;
|
|
4569
|
+
}
|
|
4570
|
+
|
|
4571
|
+
/* Across, the steps share the width evenly: a column each, the marker
|
|
4572
|
+
on top and the text centred under it. */
|
|
4573
|
+
li {
|
|
4574
|
+
position: relative;
|
|
4575
|
+
flex: 1 1 0;
|
|
4576
|
+
min-width: 0;
|
|
4577
|
+
}
|
|
4578
|
+
.step {
|
|
4579
|
+
display: flex;
|
|
4580
|
+
flex-direction: column;
|
|
4581
|
+
gap: 8px;
|
|
4582
|
+
align-items: center;
|
|
4583
|
+
text-align: center;
|
|
4584
|
+
}
|
|
4585
|
+
:host([orientation='vertical']) li {
|
|
4586
|
+
flex: none;
|
|
4587
|
+
padding-bottom: 24px;
|
|
4588
|
+
}
|
|
4589
|
+
:host([orientation='vertical']) li:last-child {
|
|
4590
|
+
padding-bottom: 0;
|
|
4591
|
+
}
|
|
4592
|
+
:host([orientation='vertical']) .step {
|
|
4593
|
+
flex-direction: row;
|
|
4594
|
+
gap: 12px;
|
|
4595
|
+
align-items: flex-start;
|
|
4596
|
+
text-align: start;
|
|
4597
|
+
}
|
|
4598
|
+
|
|
4599
|
+
/* The line to the next step, from marker to marker through their
|
|
4600
|
+
middle, clear of each: 8px across, 6px down. */
|
|
4601
|
+
.connector {
|
|
4602
|
+
position: absolute;
|
|
4603
|
+
top: calc(var(--kt-steps-marker) / 2 - 1px);
|
|
4604
|
+
left: calc(50% + var(--kt-steps-marker) / 2 + 8px);
|
|
4605
|
+
width: calc(100% - var(--kt-steps-marker) - 16px);
|
|
4606
|
+
height: 2px;
|
|
4607
|
+
background: var(--border-field);
|
|
4608
|
+
border-radius: var(--radius-full);
|
|
4609
|
+
}
|
|
4610
|
+
li[data-state='complete'] .connector {
|
|
4611
|
+
background: var(--color-primary-base);
|
|
4612
|
+
}
|
|
4613
|
+
:host([orientation='vertical']) .connector {
|
|
4614
|
+
top: calc(var(--kt-steps-marker) + 6px);
|
|
4615
|
+
left: calc(var(--kt-steps-marker) / 2 - 1px);
|
|
4616
|
+
width: 2px;
|
|
4617
|
+
height: calc(100% - var(--kt-steps-marker) - 12px);
|
|
4618
|
+
}
|
|
4619
|
+
|
|
4620
|
+
/* A filled circle: the tick when done, the number otherwise. */
|
|
4621
|
+
.marker {
|
|
4622
|
+
display: grid;
|
|
4623
|
+
flex: none;
|
|
4624
|
+
place-items: center;
|
|
4625
|
+
width: var(--kt-steps-marker);
|
|
4626
|
+
height: var(--kt-steps-marker);
|
|
4627
|
+
color: var(--text-body);
|
|
4628
|
+
font: var(--font-normal-small);
|
|
4629
|
+
font-weight: 600;
|
|
4630
|
+
/* A field's border colour: a grey that reads on a card and a page,
|
|
4631
|
+
in both themes. */
|
|
4632
|
+
background: var(--border-field);
|
|
4633
|
+
border-radius: 50%;
|
|
4634
|
+
transition:
|
|
4635
|
+
background-color var(--duration-fast) var(--easing-standard),
|
|
4636
|
+
color var(--duration-fast) var(--easing-standard);
|
|
4637
|
+
}
|
|
4638
|
+
li[data-state='complete'] .marker,
|
|
4639
|
+
li[data-state='current'] .marker {
|
|
4640
|
+
color: var(--color-white);
|
|
4641
|
+
background: var(--color-primary-base);
|
|
4642
|
+
}
|
|
4643
|
+
li[data-state='error'] .marker {
|
|
4644
|
+
color: var(--color-white);
|
|
4645
|
+
background: var(--color-danger-base);
|
|
4646
|
+
}
|
|
4647
|
+
/* Trimmed to the digits' height, so the grid centres the ink, not a
|
|
4648
|
+
line box padded by the font's ascent and descent. */
|
|
4649
|
+
.number {
|
|
4650
|
+
display: block;
|
|
4651
|
+
line-height: 1;
|
|
4652
|
+
font-variant-numeric: tabular-nums;
|
|
4653
|
+
text-box: trim-both cap alphabetic;
|
|
4654
|
+
}
|
|
4655
|
+
/* Lucide's tick sits high in its square; this puts its ink on the
|
|
4656
|
+
marker's middle. */
|
|
4657
|
+
.marker kt-icon[name='check'] {
|
|
4658
|
+
translate: 0 0.5px;
|
|
4659
|
+
}
|
|
4660
|
+
|
|
4661
|
+
.text {
|
|
4662
|
+
display: grid;
|
|
4663
|
+
gap: 2px;
|
|
4664
|
+
min-width: 0;
|
|
4665
|
+
padding: 0 4px;
|
|
4666
|
+
}
|
|
4667
|
+
:host([orientation='vertical']) .text {
|
|
4668
|
+
gap: 0;
|
|
4669
|
+
padding: 0;
|
|
4670
|
+
}
|
|
4671
|
+
.label {
|
|
4672
|
+
color: var(--text-muted);
|
|
4673
|
+
font: var(--font-normal-medium);
|
|
4674
|
+
}
|
|
4675
|
+
/* Down, as tall as the marker, so the label sits on its middle. */
|
|
4676
|
+
:host([orientation='vertical']) .label {
|
|
4677
|
+
display: flex;
|
|
4678
|
+
align-items: center;
|
|
4679
|
+
min-height: var(--kt-steps-marker);
|
|
4680
|
+
}
|
|
4681
|
+
li[data-state='current'] .label,
|
|
4682
|
+
li[data-state='complete'] .label {
|
|
4683
|
+
color: var(--text-body);
|
|
4684
|
+
}
|
|
4685
|
+
li[data-state='error'] .label {
|
|
4686
|
+
color: var(--color-danger-text);
|
|
4687
|
+
}
|
|
4688
|
+
.description {
|
|
4689
|
+
color: var(--text-muted);
|
|
4690
|
+
font: var(--font-normal-small);
|
|
4691
|
+
}
|
|
4692
|
+
|
|
4693
|
+
button.step {
|
|
4694
|
+
width: 100%;
|
|
4695
|
+
margin: 0;
|
|
4696
|
+
padding: 0;
|
|
4697
|
+
color: inherit;
|
|
4698
|
+
font: inherit;
|
|
4699
|
+
background: none;
|
|
4700
|
+
border: none;
|
|
4701
|
+
border-radius: var(--radius-input);
|
|
4702
|
+
cursor: pointer;
|
|
4703
|
+
}
|
|
4704
|
+
button.step:hover .label {
|
|
4705
|
+
color: var(--color-primary-text);
|
|
4706
|
+
}
|
|
4707
|
+
button.step:hover .marker {
|
|
4708
|
+
background: var(--color-primary-hover);
|
|
4709
|
+
}
|
|
4710
|
+
button.step:focus-visible {
|
|
4711
|
+
outline: var(--outline-width) solid var(--color-primary-base);
|
|
4712
|
+
outline-offset: 4px;
|
|
4713
|
+
}
|
|
4714
|
+
|
|
4715
|
+
.visually-hidden {
|
|
4716
|
+
position: absolute;
|
|
4717
|
+
width: 1px;
|
|
4718
|
+
height: 1px;
|
|
4719
|
+
overflow: hidden;
|
|
4720
|
+
clip-path: inset(50%);
|
|
4721
|
+
white-space: nowrap;
|
|
4722
|
+
}
|
|
4723
|
+
`]}stateOf(t,e,a){return t.error?"error":e<a?"complete":e===a?"current":"upcoming"}goTo(t){this.current=t.id,y(this,"kt-change",{id:t.id})}render(){let t=m(),e=this.steps.findIndex(r=>r.id===this.current),a={complete:t.stepComplete,current:t.stepCurrent,upcoming:t.stepUpcoming,error:t.stepError};return d`<ol part="list" aria-label=${this.label||l}>
|
|
4724
|
+
${this.steps.map((r,s)=>{let i=this.stateOf(r,s,e),p=i==="complete"?d`<kt-icon name="check" size="14"></kt-icon>`:i==="error"?d`<kt-icon name="circle-alert" size="14"></kt-icon>`:d`<span class="number">${s+1}</span>`,c=d`<span part="marker" class="marker" aria-hidden="true">${p}</span>
|
|
4725
|
+
<span class="text">
|
|
4726
|
+
<span class="label">${r.label}</span>
|
|
4727
|
+
${r.description?d`<span class="description">${r.description}</span>`:l}
|
|
4728
|
+
<span class="visually-hidden">${a[i]}</span>
|
|
4729
|
+
</span>`,u=this.navigable&&s<e;return d`<li
|
|
4730
|
+
part="step"
|
|
4731
|
+
data-state=${i}
|
|
4732
|
+
aria-current=${s===e?"step":l}
|
|
4733
|
+
>
|
|
4734
|
+
${u?d`<button class="step" type="button" @click=${()=>this.goTo(r)}>
|
|
4735
|
+
${c}
|
|
4736
|
+
</button>`:d`<span class="step">${c}</span>`}
|
|
4737
|
+
${s<this.steps.length-1?d`<span part="connector" class="connector" aria-hidden="true"></span>`:l}
|
|
4738
|
+
</li>`})}
|
|
4739
|
+
</ol>`}};qr([n({attribute:!1})],$e.prototype,"steps");qr([n({type:String,reflect:!0})],$e.prototype,"current");qr([n({type:String})],$e.prototype,"label");qr([n({type:String,reflect:!0})],$e.prototype,"orientation");qr([n({type:Boolean,reflect:!0})],$e.prototype,"navigable");b("kt-steps",$e);var Xn=Object.defineProperty,Kr=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Xn(t,e,r),r},Ce=class extends h{constructor(){super(...arguments),this.menuOpen=!1,this.sticky=!1,this.navAlign="center",this.bordered=!0,this.label=""}static{this.styles=[h.styles,v`
|
|
4283
4740
|
:host {
|
|
4284
4741
|
display: block;
|
|
4285
4742
|
--kt-header-height: 64px;
|
|
@@ -4408,7 +4865,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4408
4865
|
variant="secondary-no-bg"
|
|
4409
4866
|
size="small"
|
|
4410
4867
|
icon=${this.menuOpen?"x":"menu"}
|
|
4411
|
-
label=${this.menuOpen?
|
|
4868
|
+
label=${this.menuOpen?m().closeMenu:m().openMenu}
|
|
4412
4869
|
aria-expanded=${this.menuOpen?"true":"false"}
|
|
4413
4870
|
@click=${this.toggleMenu}
|
|
4414
4871
|
></kt-button>
|
|
@@ -4419,7 +4876,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4419
4876
|
</div>
|
|
4420
4877
|
|
|
4421
4878
|
<div part="bottom" class="bottom"><slot name="bottom"></slot></div>
|
|
4422
|
-
</header>`}};
|
|
4879
|
+
</header>`}};Kr([k()],Ce.prototype,"menuOpen");Kr([n({type:Boolean,reflect:!0})],Ce.prototype,"sticky");Kr([n({type:String,reflect:!0,attribute:"nav-align"})],Ce.prototype,"navAlign");Kr([n({type:Boolean,reflect:!0})],Ce.prototype,"bordered");Kr([n({type:String})],Ce.prototype,"label");b("kt-header",Ce);var Zn=Object.defineProperty,Se=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Zn(t,e,r),r},Qn={small:16,medium:20,large:24},$t=class extends h{constructor(){super(...arguments),this.selected=!1,this.disabled=!1,this.variant="primary",this.size="medium",this.value="",this.icon="",this.iconPosition="left",this.label="",this.managed=!1}static{this.styles=[h.styles,v`
|
|
4423
4880
|
:host {
|
|
4424
4881
|
display: inline-flex;
|
|
4425
4882
|
}
|
|
@@ -4528,7 +4985,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4528
4985
|
.text {
|
|
4529
4986
|
white-space: nowrap;
|
|
4530
4987
|
}
|
|
4531
|
-
`]}focus(t){this.shadowRoot?.querySelector("button")?.focus(t)}toggle(){this.disabled||this.managed||(this.selected=!this.selected,y(this,"kt-change",{selected:this.selected,value:this.value}))}render(){let t=this.textContent!==null&&this.textContent.trim().length>0,e=!!this.icon&&!t,a=this.icon?d`<kt-icon name=${this.icon} size=${
|
|
4988
|
+
`]}focus(t){this.shadowRoot?.querySelector("button")?.focus(t)}toggle(){this.disabled||this.managed||(this.selected=!this.selected,y(this,"kt-change",{selected:this.selected,value:this.value}))}render(){let t=this.textContent!==null&&this.textContent.trim().length>0,e=!!this.icon&&!t,a=this.icon?d`<kt-icon name=${this.icon} size=${Qn[this.size]}></kt-icon>`:l;return d`<button
|
|
4532
4989
|
part="button"
|
|
4533
4990
|
type="button"
|
|
4534
4991
|
class=${w({[this.variant]:!0,[this.size]:!0,selected:this.selected,"icon-only":e})}
|
|
@@ -4540,7 +4997,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4540
4997
|
${this.iconPosition==="left"?a:l}
|
|
4541
4998
|
${e?l:d`<span class="text"><slot></slot></span>`}
|
|
4542
4999
|
${this.iconPosition==="right"?a:l}
|
|
4543
|
-
</button>`}};
|
|
5000
|
+
</button>`}};Se([n({type:Boolean,reflect:!0})],$t.prototype,"selected");Se([n({type:Boolean,reflect:!0})],$t.prototype,"disabled");Se([n({type:String,reflect:!0})],$t.prototype,"variant");Se([n({type:String,reflect:!0})],$t.prototype,"size");Se([n({type:String})],$t.prototype,"value");Se([n({type:String})],$t.prototype,"icon");Se([n({type:String,attribute:"icon-position"})],$t.prototype,"iconPosition");Se([n({type:String})],$t.prototype,"label");Se([n({attribute:!1})],$t.prototype,"managed");b("kt-toggle-button",$t);var Jn=Object.defineProperty,Ir=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Jn(t,e,r),r},Pe=class extends h{constructor(){super(...arguments),this.multiple=!1,this.orientation="horizontal",this.label="",this.value=null,this.onButtonClick=t=>{let e=t.composedPath().find(a=>a instanceof $t);if(!(!e||e.disabled)&&this.buttons?.includes(e)){if(this.multiple){let a=Array.isArray(this.value)?this.value:[];this.value=a.includes(e.value)?a.filter(r=>r!==e.value):[...a,e.value]}else this.value=this.value===e.value?null:e.value;this.syncButtons(),y(this,"kt-change",{value:this.value})}}}static{this.styles=[h.styles,v`
|
|
4544
5001
|
:host {
|
|
4545
5002
|
display: inline-flex;
|
|
4546
5003
|
width: fit-content;
|
|
@@ -4596,10 +5053,10 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4596
5053
|
part="base"
|
|
4597
5054
|
class="group"
|
|
4598
5055
|
role="group"
|
|
4599
|
-
aria-label=${this.label||
|
|
5056
|
+
aria-label=${this.label||m().options}
|
|
4600
5057
|
>
|
|
4601
5058
|
<slot @slotchange=${this.syncButtons}></slot>
|
|
4602
|
-
</div>`}};
|
|
5059
|
+
</div>`}};Ir([ur({selector:"kt-toggle-button"})],Pe.prototype,"buttons");Ir([n({type:Boolean,reflect:!0})],Pe.prototype,"multiple");Ir([n({type:String,reflect:!0})],Pe.prototype,"orientation");Ir([n({type:String})],Pe.prototype,"label");Ir([n({attribute:!1})],Pe.prototype,"value");b("kt-toggle-button-group",Pe);var tl=Object.defineProperty,kr=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&tl(t,e,r),r},el={info:"info",success:"circle-check",warning:"triangle-alert",danger:"circle-alert",neutral:"info"},ue=class extends h{constructor(){super(...arguments),this.variant="info",this.heading="",this.description="",this.dismissible=!1,this.noIcon=!1,this.icon=""}static{this.styles=[h.styles,v`
|
|
4603
5060
|
:host {
|
|
4604
5061
|
display: block;
|
|
4605
5062
|
}
|
|
@@ -4706,7 +5163,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4706
5163
|
}
|
|
4707
5164
|
`]}render(){let t=this.variant==="danger"?"assertive":"polite";return d`<div part="base" class="alert" role="alert" aria-live=${t}>
|
|
4708
5165
|
${this.noIcon?l:d`<span class="icon">
|
|
4709
|
-
<kt-icon name=${this.icon||
|
|
5166
|
+
<kt-icon name=${this.icon||el[this.variant]} size="20"></kt-icon>
|
|
4710
5167
|
</span>`}
|
|
4711
5168
|
|
|
4712
5169
|
<div class="content">
|
|
@@ -4719,12 +5176,12 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4719
5176
|
${this.dismissible?d`<button
|
|
4720
5177
|
part="close"
|
|
4721
5178
|
class="close"
|
|
4722
|
-
aria-label=${
|
|
5179
|
+
aria-label=${m().dismiss}
|
|
4723
5180
|
@click=${()=>y(this,"kt-close")}
|
|
4724
5181
|
>
|
|
4725
5182
|
<kt-icon name="x" size="16"></kt-icon>
|
|
4726
5183
|
</button>`:l}
|
|
4727
|
-
</div>`}};
|
|
5184
|
+
</div>`}};kr([n({type:String,reflect:!0})],ue.prototype,"variant");kr([n({type:String})],ue.prototype,"heading");kr([n({type:String})],ue.prototype,"description");kr([n({type:Boolean})],ue.prototype,"dismissible");kr([n({type:Boolean,attribute:"no-icon"})],ue.prototype,"noIcon");kr([n({type:String})],ue.prototype,"icon");b("kt-alert",ue);var rl=Object.defineProperty,ka=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&rl(t,e,r),r},Ie=class extends h{constructor(){super(...arguments),this.icon="inbox",this.heading="",this.description="",this.compact=!1}static{this.styles=[h.styles,v`
|
|
4728
5185
|
:host {
|
|
4729
5186
|
display: block;
|
|
4730
5187
|
}
|
|
@@ -4784,7 +5241,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4784
5241
|
${this.description?d`<p class="description">${this.description}</p>`:l}
|
|
4785
5242
|
<slot></slot>
|
|
4786
5243
|
<div class="actions"><slot name="actions"></slot></div>
|
|
4787
|
-
</div>`}};
|
|
5244
|
+
</div>`}};ka([n({type:String})],Ie.prototype,"icon");ka([n({type:String})],Ie.prototype,"heading");ka([n({type:String})],Ie.prototype,"description");ka([n({type:Boolean,reflect:!0})],Ie.prototype,"compact");b("kt-empty-state",Ie);var al=Object.defineProperty,Ae=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&al(t,e,r),r},Rt=class extends h{constructor(){super(...arguments),this.value=0,this.max=100,this.size="medium",this.variant="primary",this.showValue=!1,this.showLabel=!1,this.striped=!1,this.animated=!1,this.label=""}static{this.styles=[h.styles,v`
|
|
4788
5245
|
:host {
|
|
4789
5246
|
display: block;
|
|
4790
5247
|
width: 100%;
|
|
@@ -4926,10 +5383,10 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
4926
5383
|
<div
|
|
4927
5384
|
part="fill"
|
|
4928
5385
|
class=${w({fill:!0,complete:e,striped:this.striped,animated:this.animated})}
|
|
4929
|
-
style=${
|
|
5386
|
+
style=${Tt({width:`${t}%`})}
|
|
4930
5387
|
></div>
|
|
4931
5388
|
</div>
|
|
4932
|
-
</div>`}};
|
|
5389
|
+
</div>`}};Ae([n({type:Number})],Rt.prototype,"value");Ae([n({type:Number})],Rt.prototype,"max");Ae([n({type:String,reflect:!0})],Rt.prototype,"size");Ae([n({type:String,reflect:!0})],Rt.prototype,"variant");Ae([n({type:Boolean,attribute:"show-value"})],Rt.prototype,"showValue");Ae([n({type:Boolean,attribute:"show-label"})],Rt.prototype,"showLabel");Ae([n({type:Boolean,reflect:!0})],Rt.prototype,"striped");Ae([n({type:Boolean,reflect:!0})],Rt.prototype,"animated");Ae([n({type:String})],Rt.prototype,"label");b("kt-progress-bar",Rt);var ol=Object.defineProperty,wr=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&ol(t,e,r),r},sl={success:{icon:"circle-check",progress:"success"},information:{icon:"info",progress:"info"},warning:{icon:"triangle-alert",progress:"warning"},error:{icon:"circle-alert",progress:"danger"}},Is=50,he=class extends h{constructor(){super(...arguments),this.remaining=0,this.variant="information",this.heading="",this.description="",this.dismissible=!1,this.duration=0}static{this.styles=[h.styles,v`
|
|
4933
5390
|
:host {
|
|
4934
5391
|
display: block;
|
|
4935
5392
|
}
|
|
@@ -5063,7 +5520,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5063
5520
|
left: 0;
|
|
5064
5521
|
width: 100%;
|
|
5065
5522
|
}
|
|
5066
|
-
`]}connectedCallback(){super.connectedCallback(),this.startCountdown()}disconnectedCallback(){super.disconnectedCallback(),this.stopCountdown()}startCountdown(){this.stopCountdown(),!(this.duration<=0)&&(this.remaining=this.duration,this.tick())}tick(){this.timer=setInterval(()=>{this.remaining-=
|
|
5523
|
+
`]}connectedCallback(){super.connectedCallback(),this.startCountdown()}disconnectedCallback(){super.disconnectedCallback(),this.stopCountdown()}startCountdown(){this.stopCountdown(),!(this.duration<=0)&&(this.remaining=this.duration,this.tick())}tick(){this.timer=setInterval(()=>{this.remaining-=Is,!(this.remaining>0)&&(this.stopCountdown(),this.close())},Is)}stopCountdown(){this.timer!==void 0&&clearInterval(this.timer),this.timer=void 0}pause(){this.timer!==void 0&&this.stopCountdown()}resume(){this.duration<=0||this.timer!==void 0||this.remaining<=0||this.tick()}close(){this.stopCountdown(),y(this,"kt-toast-close")}render(){let t=sl[this.variant],e=this.duration>0;return d`<div
|
|
5067
5524
|
part="base"
|
|
5068
5525
|
class="toast"
|
|
5069
5526
|
role=${this.variant==="error"?"alert":"status"}
|
|
@@ -5080,7 +5537,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5080
5537
|
${this.dismissible?d`<button
|
|
5081
5538
|
part="close"
|
|
5082
5539
|
class="close"
|
|
5083
|
-
aria-label=${
|
|
5540
|
+
aria-label=${m().close}
|
|
5084
5541
|
@click=${this.close}
|
|
5085
5542
|
>
|
|
5086
5543
|
<kt-icon name="x" size="18"></kt-icon>
|
|
@@ -5093,10 +5550,10 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5093
5550
|
animated
|
|
5094
5551
|
.value=${this.remaining}
|
|
5095
5552
|
.max=${this.duration}
|
|
5096
|
-
label=${
|
|
5553
|
+
label=${m().timeRemaining}
|
|
5097
5554
|
></kt-progress-bar>
|
|
5098
5555
|
</div>`:l}
|
|
5099
|
-
</div>`}};
|
|
5556
|
+
</div>`}};wr([k()],he.prototype,"remaining");wr([n({type:String,reflect:!0})],he.prototype,"variant");wr([n({type:String})],he.prototype,"heading");wr([n({type:String})],he.prototype,"description");wr([n({type:Boolean})],he.prototype,"dismissible");wr([n({type:Number})],he.prototype,"duration");b("kt-toast",he);var il=Object.defineProperty,Fs=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&il(t,e,r),r},Fe=class extends h{constructor(){super(...arguments),this.position="bottom-right",this.limit=5,this.pauseAll=()=>{for(let t of this.toasts)t.pause()},this.resumeAll=()=>{for(let t of this.toasts)t.resume()}}static{this.styles=[h.styles,v`
|
|
5100
5557
|
:host {
|
|
5101
5558
|
position: fixed;
|
|
5102
5559
|
z-index: var(--z-toast);
|
|
@@ -5130,7 +5587,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5130
5587
|
::slotted(kt-toast) {
|
|
5131
5588
|
pointer-events: auto;
|
|
5132
5589
|
}
|
|
5133
|
-
`]}get toasts(){return[...this.querySelectorAll("kt-toast")]}show(t={}){let e=document.createElement("kt-toast");return e.variant=t.variant??"information",e.heading=t.heading??"",e.description=t.description??"",e.dismissible=t.dismissible??!0,e.duration=t.duration??0,e.addEventListener("kt-toast-close",()=>this.dismiss(e),{once:!0}),this.position.startsWith("top")?this.prepend(e):this.append(e),this.enforceLimit(),e}dismiss(t){t.remove()}clear(){for(let t of this.toasts)t.remove()}enforceLimit(){if(this.limit<=0)return;let t=this.toasts,e=t.length-this.limit,a=this.position.startsWith("top")?[...t].reverse():t;for(let r=0;r<e;r+=1)a[r]?.remove()}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.pauseAll),this.addEventListener("pointerleave",this.resumeAll)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("pointerenter",this.pauseAll),this.removeEventListener("pointerleave",this.resumeAll)}render(){return d`<slot></slot>`}};
|
|
5590
|
+
`]}get toasts(){return[...this.querySelectorAll("kt-toast")]}show(t={}){let e=document.createElement("kt-toast");return e.variant=t.variant??"information",e.heading=t.heading??"",e.description=t.description??"",e.dismissible=t.dismissible??!0,e.duration=t.duration??0,e.addEventListener("kt-toast-close",()=>this.dismiss(e),{once:!0}),this.position.startsWith("top")?this.prepend(e):this.append(e),this.enforceLimit(),e}dismiss(t){t.remove()}clear(){for(let t of this.toasts)t.remove()}enforceLimit(){if(this.limit<=0)return;let t=this.toasts,e=t.length-this.limit,a=this.position.startsWith("top")?[...t].reverse():t;for(let r=0;r<e;r+=1)a[r]?.remove()}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.pauseAll),this.addEventListener("pointerleave",this.resumeAll)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("pointerenter",this.pauseAll),this.removeEventListener("pointerleave",this.resumeAll)}render(){return d`<slot></slot>`}};Fs([n({type:String,reflect:!0})],Fe.prototype,"position");Fs([n({type:Number})],Fe.prototype,"limit");b("kt-toast-container",Fe);var Po=class{constructor(){this.position="bottom-right"}getContainer(){if(this.container?.isConnected)return this.container;let t=document.querySelector("kt-toast-container");if(t)return this.container=t,t;let e=new Fe;return e.position=this.position,document.body.append(e),this.container=e,e}show(t){return this.getContainer().show(t)}success(t,e={}){return this.show({duration:4e3,...e,variant:"success",heading:t})}info(t,e={}){return this.show({duration:4e3,...e,variant:"information",heading:t})}warning(t,e={}){return this.show({duration:6e3,...e,variant:"warning",heading:t})}error(t,e={}){return this.show({duration:0,...e,variant:"error",heading:t})}clear(){this.container?.clear()}},nl=new Po;var ll=Object.defineProperty,Ao=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&ll(t,e,r),r},ir=class extends h{constructor(){super(...arguments),this.open=!1,this.heading="",this.plain=!1}static{this.styles=[h.styles,v`
|
|
5134
5591
|
:host {
|
|
5135
5592
|
display: block;
|
|
5136
5593
|
}
|
|
@@ -5195,7 +5652,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5195
5652
|
<span class="label"><slot name="summary">${this.heading||l}</slot></span>
|
|
5196
5653
|
</summary>
|
|
5197
5654
|
<div part="content" class="content"><slot></slot></div>
|
|
5198
|
-
</details>`}};
|
|
5655
|
+
</details>`}};Ao([n({type:Boolean,reflect:!0})],ir.prototype,"open");Ao([n({type:String})],ir.prototype,"heading");Ao([n({type:Boolean,reflect:!0})],ir.prototype,"plain");b("kt-collapsible",ir);function fe(o){if(!o.open){if(typeof o.showModal=="function"){o.showModal();return}o.setAttribute("open","")}}function Ue(o){if(o.open){if(typeof o.close=="function"){o.close();return}o.removeAttribute("open")}}function He(o,t){if(t.target!==o)return!1;let e=o.getBoundingClientRect();return e.width===0&&e.height===0?!1:t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom}var dl=Object.defineProperty,Ne=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&dl(t,e,r),r},Ht=class extends h{constructor(){super(...arguments),this.open=!1,this.heading=void 0,this.message="",this.confirmLabel=void 0,this.cancelLabel=void 0,this.variant="danger"}static{this.styles=[h.styles,v`
|
|
5199
5656
|
:host {
|
|
5200
5657
|
display: contents;
|
|
5201
5658
|
}
|
|
@@ -5276,29 +5733,29 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5276
5733
|
transition: none;
|
|
5277
5734
|
}
|
|
5278
5735
|
}
|
|
5279
|
-
`]}updated(t){t.has("open")&&(this.open?(
|
|
5736
|
+
`]}updated(t){t.has("open")&&(this.open?(fe(this.dialog),this.cancelButton?.focus()):Ue(this.dialog))}confirm(){this.open=!1,y(this,"kt-confirm")}cancel(){this.open=!1,y(this,"kt-cancel")}onDialogClose(){this.open&&this.cancel()}onDialogClick(t){He(this.dialog,t)&&this.cancel()}render(){return d`<dialog
|
|
5280
5737
|
part="dialog"
|
|
5281
5738
|
role="alertdialog"
|
|
5282
|
-
aria-label=${this.heading??
|
|
5739
|
+
aria-label=${this.heading??m().confirmHeading}
|
|
5283
5740
|
aria-describedby=${this.message?"kt-confirm-message":l}
|
|
5284
5741
|
@close=${this.onDialogClose}
|
|
5285
5742
|
@click=${this.onDialogClick}
|
|
5286
5743
|
>
|
|
5287
|
-
<h2>${this.heading??
|
|
5744
|
+
<h2>${this.heading??m().confirmHeading}</h2>
|
|
5288
5745
|
${this.message?d`<p id="kt-confirm-message">${this.message}</p>`:l}
|
|
5289
5746
|
<slot></slot>
|
|
5290
5747
|
|
|
5291
5748
|
<div part="actions" class="actions">
|
|
5292
5749
|
<kt-button data-cancel variant="dark" @click=${this.cancel}
|
|
5293
|
-
>${this.cancelLabel??
|
|
5750
|
+
>${this.cancelLabel??m().cancel}</kt-button
|
|
5294
5751
|
>
|
|
5295
5752
|
<kt-button
|
|
5296
5753
|
variant=${this.variant==="danger"?"delete":"primary"}
|
|
5297
5754
|
@click=${this.confirm}
|
|
5298
|
-
>${this.confirmLabel??
|
|
5755
|
+
>${this.confirmLabel??m().confirm}</kt-button
|
|
5299
5756
|
>
|
|
5300
5757
|
</div>
|
|
5301
|
-
</dialog>`}};
|
|
5758
|
+
</dialog>`}};Ne([T("dialog")],Ht.prototype,"dialog");Ne([T("kt-button[data-cancel]")],Ht.prototype,"cancelButton");Ne([n({type:Boolean,reflect:!0})],Ht.prototype,"open");Ne([n({type:String})],Ht.prototype,"heading");Ne([n({type:String})],Ht.prototype,"message");Ne([n({type:String,attribute:"confirm-label"})],Ht.prototype,"confirmLabel");Ne([n({type:String,attribute:"cancel-label"})],Ht.prototype,"cancelLabel");Ne([n({type:String,reflect:!0})],Ht.prototype,"variant");b("kt-confirm-dialog",Ht);var pl=Object.defineProperty,nr=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&pl(t,e,r),r},re=class extends h{constructor(){super(...arguments),this.open=!1,this.heading="",this.description="",this.size="medium",this.noCloseButton=!1,this.noBackdropClose=!1,this.hasFooter=!1}static{this.styles=[h.styles,v`
|
|
5302
5759
|
:host {
|
|
5303
5760
|
display: contents;
|
|
5304
5761
|
}
|
|
@@ -5404,7 +5861,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5404
5861
|
transition: none;
|
|
5405
5862
|
}
|
|
5406
5863
|
}
|
|
5407
|
-
`]}updated(t){t.has("open")&&(this.open?
|
|
5864
|
+
`]}updated(t){t.has("open")&&(this.open?fe(this.dialog):Ue(this.dialog)),this.readFooter()}readFooter(){let t=tr(this.shadowRoot?.querySelector('slot[name="footer"]'));t!==this.hasFooter&&(this.hasFooter=t,this.requestUpdate())}requestClose(){if(y(this,"kt-close").defaultPrevented){this.dialog.open||fe(this.dialog);return}this.open=!1}onDialogClose(){this.open&&this.requestClose()}onDialogClick(t){this.noBackdropClose||He(this.dialog,t)&&this.requestClose()}render(){let t=!!this.heading||!!this.description;return d`<dialog
|
|
5408
5865
|
part="dialog"
|
|
5409
5866
|
aria-label=${this.heading||l}
|
|
5410
5867
|
@close=${this.onDialogClose}
|
|
@@ -5421,7 +5878,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5421
5878
|
variant="secondary-no-bg"
|
|
5422
5879
|
size="small"
|
|
5423
5880
|
icon="x"
|
|
5424
|
-
label=${
|
|
5881
|
+
label=${m().close}
|
|
5425
5882
|
@click=${this.requestClose}
|
|
5426
5883
|
></kt-button>`}
|
|
5427
5884
|
</div>`:l}
|
|
@@ -5431,7 +5888,203 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5431
5888
|
<div part="footer" class=${this.hasFooter?"footer":"footer empty"}>
|
|
5432
5889
|
<slot name="footer" @slotchange=${this.readFooter}></slot>
|
|
5433
5890
|
</div>
|
|
5434
|
-
</dialog>`}};
|
|
5891
|
+
</dialog>`}};nr([T("dialog")],re.prototype,"dialog");nr([n({type:Boolean,reflect:!0})],re.prototype,"open");nr([n({type:String})],re.prototype,"heading");nr([n({type:String})],re.prototype,"description");nr([n({type:String,reflect:!0})],re.prototype,"size");nr([n({type:Boolean,attribute:"no-close-button"})],re.prototype,"noCloseButton");nr([n({type:Boolean,attribute:"no-backdrop-close"})],re.prototype,"noBackdropClose");b("kt-modal",re);function Mo(o){return o.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase()}function cl(o,t,e){let a=Mo(o.label),r=Mo([...o.keywords??[],o.group??""].join(" ")),s=`${a} ${r}`;if(!e.every(p=>s.includes(p)))return 1/0;if(a.startsWith(t))return 0;let i=a.split(/[^\p{L}\p{N}]+/u);return e.every(p=>i.some(c=>c.startsWith(p)))?1:e.every(p=>a.includes(p))?2:3}function ul(o,t){let e=Mo(t.trim());if(!e)return[...o];let a=e.split(/\s+/);return o.map((r,s)=>({command:r,index:s,rank:cl(r,e,a)})).filter(r=>r.rank!==1/0).sort((r,s)=>r.rank-s.rank||r.index-s.index).map(r=>r.command)}var hl=Object.defineProperty,_e=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&hl(t,e,r),r};function fl(o){let t=new Map;for(let e of o){let a=e.group??"";t.has(a)||t.set(a,[]),t.get(a).push(e)}return[...t].map(([e,a])=>({name:e,commands:a}))}var Nt=class extends h{constructor(){super(...arguments),this.commands=[],this.open=!1,this.placeholder="",this.hotkey="k",this.query="",this.activeIndex=0,this.listId=j("kt-command-list"),this.returnFocus=null,this.onDocumentKeyDown=t=>{if(!this.hotkey||t.defaultPrevented||t.repeat||!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey)return;let e=this.hotkey.toLowerCase();(t.key?.toLowerCase()===e||t.code===`Key${e.toUpperCase()}`)&&(t.preventDefault(),this.open=!this.open)}}static{this.styles=[h.styles,v`
|
|
5892
|
+
:host {
|
|
5893
|
+
display: contents;
|
|
5894
|
+
}
|
|
5895
|
+
|
|
5896
|
+
/* Never-opened, a dialog must not keep its box: see kt-modal. */
|
|
5897
|
+
dialog {
|
|
5898
|
+
display: none;
|
|
5899
|
+
flex-direction: column;
|
|
5900
|
+
box-sizing: border-box;
|
|
5901
|
+
width: 600px;
|
|
5902
|
+
max-width: calc(100vw - 32px);
|
|
5903
|
+
max-height: min(560px, calc(100vh - 128px));
|
|
5904
|
+
margin: 12vh auto auto;
|
|
5905
|
+
padding: 0;
|
|
5906
|
+
overflow: hidden;
|
|
5907
|
+
color: var(--text-body);
|
|
5908
|
+
background: var(--surface-popover);
|
|
5909
|
+
border: var(--border-width) solid var(--border-popover);
|
|
5910
|
+
border-radius: var(--radius-modal);
|
|
5911
|
+
box-shadow: var(--shadow-popover);
|
|
5912
|
+
opacity: 0;
|
|
5913
|
+
transform: scale(0.98);
|
|
5914
|
+
transition:
|
|
5915
|
+
transform var(--duration-fast) var(--easing-standard),
|
|
5916
|
+
opacity var(--duration-fast) var(--easing-standard),
|
|
5917
|
+
overlay var(--duration-fast) allow-discrete,
|
|
5918
|
+
display var(--duration-fast) allow-discrete;
|
|
5919
|
+
}
|
|
5920
|
+
dialog[open] {
|
|
5921
|
+
display: flex;
|
|
5922
|
+
opacity: 1;
|
|
5923
|
+
transform: scale(1);
|
|
5924
|
+
}
|
|
5925
|
+
@starting-style {
|
|
5926
|
+
dialog[open] {
|
|
5927
|
+
opacity: 0;
|
|
5928
|
+
transform: scale(0.98);
|
|
5929
|
+
}
|
|
5930
|
+
}
|
|
5931
|
+
dialog::backdrop {
|
|
5932
|
+
background: var(--color-backdrop, rgba(0, 0, 0, 0.45));
|
|
5933
|
+
}
|
|
5934
|
+
|
|
5935
|
+
.search {
|
|
5936
|
+
display: flex;
|
|
5937
|
+
flex: none;
|
|
5938
|
+
align-items: center;
|
|
5939
|
+
gap: 10px;
|
|
5940
|
+
padding: 0 16px;
|
|
5941
|
+
color: var(--text-muted);
|
|
5942
|
+
border-bottom: var(--border-width) solid var(--divider-popover);
|
|
5943
|
+
}
|
|
5944
|
+
input {
|
|
5945
|
+
flex: 1;
|
|
5946
|
+
min-width: 0;
|
|
5947
|
+
height: calc(var(--button-height) + 12px);
|
|
5948
|
+
padding: 0;
|
|
5949
|
+
color: var(--text-body);
|
|
5950
|
+
font: var(--font-normal-regular);
|
|
5951
|
+
font-size: calc(16px * var(--text-scale, 1));
|
|
5952
|
+
background: none;
|
|
5953
|
+
border: none;
|
|
5954
|
+
outline: none;
|
|
5955
|
+
}
|
|
5956
|
+
input::placeholder {
|
|
5957
|
+
color: var(--text-muted);
|
|
5958
|
+
}
|
|
5959
|
+
|
|
5960
|
+
.list {
|
|
5961
|
+
flex: 1 1 auto;
|
|
5962
|
+
min-height: 0;
|
|
5963
|
+
margin: 0;
|
|
5964
|
+
padding: 6px;
|
|
5965
|
+
overflow: auto;
|
|
5966
|
+
scrollbar-width: thin;
|
|
5967
|
+
}
|
|
5968
|
+
.group + .group {
|
|
5969
|
+
margin-top: 6px;
|
|
5970
|
+
}
|
|
5971
|
+
.heading {
|
|
5972
|
+
padding: 8px 10px 4px;
|
|
5973
|
+
color: var(--text-muted);
|
|
5974
|
+
font: var(--font-normal-small);
|
|
5975
|
+
}
|
|
5976
|
+
.option {
|
|
5977
|
+
display: flex;
|
|
5978
|
+
align-items: center;
|
|
5979
|
+
gap: 10px;
|
|
5980
|
+
padding: 8px 10px;
|
|
5981
|
+
color: var(--text-body);
|
|
5982
|
+
font: var(--font-normal-regular);
|
|
5983
|
+
border-radius: var(--radius-input);
|
|
5984
|
+
cursor: pointer;
|
|
5985
|
+
}
|
|
5986
|
+
.option kt-icon {
|
|
5987
|
+
flex: none;
|
|
5988
|
+
color: var(--text-muted);
|
|
5989
|
+
}
|
|
5990
|
+
.option .label {
|
|
5991
|
+
flex: 1;
|
|
5992
|
+
min-width: 0;
|
|
5993
|
+
overflow: hidden;
|
|
5994
|
+
white-space: nowrap;
|
|
5995
|
+
text-overflow: ellipsis;
|
|
5996
|
+
}
|
|
5997
|
+
.option.active {
|
|
5998
|
+
background: var(--color-primary-soft);
|
|
5999
|
+
}
|
|
6000
|
+
.option.active kt-icon {
|
|
6001
|
+
color: var(--color-primary-text);
|
|
6002
|
+
}
|
|
6003
|
+
.option.disabled {
|
|
6004
|
+
color: var(--text-disabled);
|
|
6005
|
+
cursor: not-allowed;
|
|
6006
|
+
}
|
|
6007
|
+
.empty {
|
|
6008
|
+
padding: 28px 10px;
|
|
6009
|
+
color: var(--text-muted);
|
|
6010
|
+
font: var(--font-normal-regular);
|
|
6011
|
+
text-align: center;
|
|
6012
|
+
}
|
|
6013
|
+
|
|
6014
|
+
.footer {
|
|
6015
|
+
display: flex;
|
|
6016
|
+
flex: none;
|
|
6017
|
+
flex-wrap: wrap;
|
|
6018
|
+
gap: 16px;
|
|
6019
|
+
padding: 10px 16px;
|
|
6020
|
+
color: var(--text-muted);
|
|
6021
|
+
font: var(--font-normal-small);
|
|
6022
|
+
border-top: var(--border-width) solid var(--divider-popover);
|
|
6023
|
+
}
|
|
6024
|
+
.footer span {
|
|
6025
|
+
display: inline-flex;
|
|
6026
|
+
align-items: center;
|
|
6027
|
+
gap: 6px;
|
|
6028
|
+
}
|
|
6029
|
+
|
|
6030
|
+
@media (prefers-reduced-motion: reduce) {
|
|
6031
|
+
dialog {
|
|
6032
|
+
transition: none;
|
|
6033
|
+
}
|
|
6034
|
+
}
|
|
6035
|
+
`]}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.onDocumentKeyDown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onDocumentKeyDown)}get results(){return ul(this.commands,this.query)}willUpdate(t){t.has("open")&&this.open&&(this.query="",this.activeIndex=this.firstEnabled(this.results)),t.has("commands")&&(this.activeIndex=this.firstEnabled(this.results))}updated(t){let e=t;(e.has("activeIndex")||e.has("query"))&&this.renderRoot.querySelector(`#${this.optionId(this.activeIndex)}`)?.scrollIntoView({block:"nearest"}),t.has("open")&&(this.open?(this.returnFocus=ml(),fe(this.dialog),this.input.value="",this.input.focus(),y(this,"kt-open")):t.get("open")===!0&&(Ue(this.dialog),this.returnFocus?.isConnected&&this.returnFocus.focus(),this.returnFocus=null,y(this,"kt-close")))}firstEnabled(t){return t.findIndex(e=>!e.disabled)}step(t,e,a){for(let r=1;r<=t.length;r+=1){let s=(e+a*r+t.length*r)%t.length;if(!t[s].disabled)return s}return-1}onInput(){this.query=this.input.value,this.activeIndex=this.firstEnabled(this.results)}onKeyDown(t){let e=this.results;switch(t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),e.length&&(this.activeIndex=this.step(e,this.activeIndex,t.key==="ArrowDown"?1:-1));break;case"Home":case"End":if(!e.length)return;t.preventDefault(),this.activeIndex=t.key==="Home"?this.firstEnabled(e):this.step(e,0,-1);break;case"Enter":{t.preventDefault();let a=e[this.activeIndex];a&&this.run(a);break}case"Escape":t.preventDefault(),this.open=!1;break}}run(t){t.disabled||(this.open=!1,y(this,"kt-select",{id:t.id,command:t}))}onDialogCancel(t){t.preventDefault(),this.open=!1}onDialogClose(){this.open&&(this.open=!1)}onDialogClick(t){He(this.dialog,t)&&(this.open=!1)}optionId(t){return`${this.listId}-${t}`}render(){let t=m(),e=this.results,a=e[this.activeIndex],r=-1;return d`<dialog
|
|
6036
|
+
part="dialog"
|
|
6037
|
+
aria-label=${t.commandPalette}
|
|
6038
|
+
@cancel=${this.onDialogCancel}
|
|
6039
|
+
@close=${this.onDialogClose}
|
|
6040
|
+
@click=${this.onDialogClick}
|
|
6041
|
+
>
|
|
6042
|
+
<div class="search">
|
|
6043
|
+
<kt-icon name="search" size="18"></kt-icon>
|
|
6044
|
+
<input
|
|
6045
|
+
part="input"
|
|
6046
|
+
type="text"
|
|
6047
|
+
role="combobox"
|
|
6048
|
+
aria-expanded="true"
|
|
6049
|
+
aria-controls=${this.listId}
|
|
6050
|
+
aria-autocomplete="list"
|
|
6051
|
+
aria-activedescendant=${a?this.optionId(this.activeIndex):l}
|
|
6052
|
+
aria-label=${t.commandPalette}
|
|
6053
|
+
placeholder=${this.placeholder||t.commandPlaceholder}
|
|
6054
|
+
autocomplete="off"
|
|
6055
|
+
spellcheck="false"
|
|
6056
|
+
@input=${this.onInput}
|
|
6057
|
+
@keydown=${this.onKeyDown}
|
|
6058
|
+
/>
|
|
6059
|
+
</div>
|
|
6060
|
+
|
|
6061
|
+
<div part="list" class="list" id=${this.listId} role="listbox" aria-label=${t.commandPalette}>
|
|
6062
|
+
${e.length===0?d`<div class="empty" aria-hidden="true">${t.noResults}</div>`:fl(e).map(s=>d`<div class="group" role="group" aria-label=${s.name||t.commandPalette}>
|
|
6063
|
+
${s.name?d`<div class="heading" aria-hidden="true">${s.name}</div>`:l}
|
|
6064
|
+
${s.commands.map(i=>{r+=1;let p=r;return d`<div
|
|
6065
|
+
id=${this.optionId(p)}
|
|
6066
|
+
class=${w({option:!0,active:p===this.activeIndex,disabled:!!i.disabled})}
|
|
6067
|
+
role="option"
|
|
6068
|
+
aria-selected=${p===this.activeIndex?"true":"false"}
|
|
6069
|
+
aria-disabled=${i.disabled?"true":l}
|
|
6070
|
+
@pointermove=${()=>{!i.disabled&&this.activeIndex!==p&&(this.activeIndex=p)}}
|
|
6071
|
+
@click=${()=>this.run(i)}
|
|
6072
|
+
>
|
|
6073
|
+
${i.icon?d`<kt-icon name=${i.icon} size="16"></kt-icon>`:l}
|
|
6074
|
+
<span class="label">${i.label}</span>
|
|
6075
|
+
${i.shortcut?d`<kt-kbd keys=${i.shortcut}></kt-kbd>`:l}
|
|
6076
|
+
</div>`})}
|
|
6077
|
+
</div>`)}
|
|
6078
|
+
</div>
|
|
6079
|
+
|
|
6080
|
+
<div class="visually-hidden" role="status">${e.length===0?t.noResults:l}</div>
|
|
6081
|
+
|
|
6082
|
+
<div part="footer" class="footer" aria-hidden="true">
|
|
6083
|
+
<span><kt-kbd>↑</kt-kbd><kt-kbd>↓</kt-kbd>${t.commandHintMove}</span>
|
|
6084
|
+
<span><kt-kbd>↵</kt-kbd>${t.commandHintRun}</span>
|
|
6085
|
+
<span><kt-kbd>esc</kt-kbd>${t.commandHintClose}</span>
|
|
6086
|
+
</div>
|
|
6087
|
+
</dialog>`}};_e([n({attribute:!1})],Nt.prototype,"commands");_e([n({type:Boolean,reflect:!0})],Nt.prototype,"open");_e([n({type:String})],Nt.prototype,"placeholder");_e([n({type:String})],Nt.prototype,"hotkey");_e([k()],Nt.prototype,"query");_e([k()],Nt.prototype,"activeIndex");_e([T("dialog")],Nt.prototype,"dialog");_e([T("input")],Nt.prototype,"input");function ml(){let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o instanceof HTMLElement?o:null}b("kt-command-palette",Nt);var gl=Object.defineProperty,Fr=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&gl(t,e,r),r},Me=class extends h{constructor(){super(...arguments),this.open=!1,this.eyebrow=void 0,this.heading="",this.noBackdropClose=!1}static{this.styles=[h.styles,v`
|
|
5435
6088
|
:host {
|
|
5436
6089
|
display: contents;
|
|
5437
6090
|
}
|
|
@@ -5522,7 +6175,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5522
6175
|
transition: none;
|
|
5523
6176
|
}
|
|
5524
6177
|
}
|
|
5525
|
-
`]}updated(t){t.has("open")&&(this.open?
|
|
6178
|
+
`]}updated(t){t.has("open")&&(this.open?fe(this.dialog):Ue(this.dialog))}requestClose(){if(y(this,"kt-close").defaultPrevented){this.dialog.open||fe(this.dialog);return}this.open=!1}onDialogClose(){this.open&&this.requestClose()}onDialogClick(t){this.noBackdropClose||He(this.dialog,t)&&this.requestClose()}render(){return d`<dialog
|
|
5526
6179
|
part="dialog"
|
|
5527
6180
|
aria-label=${this.heading||l}
|
|
5528
6181
|
@close=${this.onDialogClose}
|
|
@@ -5530,14 +6183,14 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5530
6183
|
>
|
|
5531
6184
|
<div part="header" class="header">
|
|
5532
6185
|
<div class="titles">
|
|
5533
|
-
${this.eyebrow??
|
|
6186
|
+
${this.eyebrow??m().details?d`<div class="eyebrow">${this.eyebrow??m().details}</div>`:l}
|
|
5534
6187
|
<h2>${this.heading}</h2>
|
|
5535
6188
|
</div>
|
|
5536
6189
|
<kt-button
|
|
5537
6190
|
variant="secondary"
|
|
5538
6191
|
size="small"
|
|
5539
6192
|
icon="x"
|
|
5540
|
-
label=${
|
|
6193
|
+
label=${m().close}
|
|
5541
6194
|
@click=${this.requestClose}
|
|
5542
6195
|
></kt-button>
|
|
5543
6196
|
</div>
|
|
@@ -5546,47 +6199,47 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5546
6199
|
|
|
5547
6200
|
<div part="body" class="body"><slot></slot></div>
|
|
5548
6201
|
<slot name="footer"></slot>
|
|
5549
|
-
</dialog>`}};
|
|
6202
|
+
</dialog>`}};Fr([T("dialog")],Me.prototype,"dialog");Fr([n({type:Boolean,reflect:!0})],Me.prototype,"open");Fr([n({type:String})],Me.prototype,"eyebrow");Fr([n({type:String})],Me.prototype,"heading");Fr([n({type:Boolean,attribute:"no-backdrop-close"})],Me.prototype,"noBackdropClose");b("kt-side-panel",Me);function xl(o){let t=Math.floor(Math.log10(o)),e=o/10**t;return(e<1.5?1:e<3?2:e<7?5:10)*10**t}function Bo(o,t,e){if(t===o){let u=Math.abs(o)||1;o-=u,t+=u}let a=xl((t-o)/Math.max(1,e-1)),r=Math.max(0,-Math.floor(Math.log10(a))),s=u=>Number(u.toFixed(r))||0,i=s(Math.floor(o/a)*a),p=s(Math.ceil(t/a)*a),c=[];for(let u=0;i+u*a<=p+a/2;u+=1)c.push(s(i+u*a));return{min:i,max:p,step:a,values:c}}function vl(o,t,{includeZero:e}){let a=t.flat();for(let p of o){let c=Math.max(0,...p.map(u=>u.length));for(let u=0;u<c;u+=1){let f=0,g=0;for(let x of p){let $=x[u]??0;$>=0?f+=$:g+=$}a.push(f,g)}}let r=a.filter(Number.isFinite);if(r.length===0)return{lo:0,hi:1};let s=Math.min(...r),i=Math.max(...r);return e&&(s=Math.min(s,0),i=Math.max(i,0)),{lo:s,hi:i}}function $a(o,t,e,a){let r=Bo(a.min??o,a.max??t,e),s=a.min??r.min,i=a.max??r.max;return i<=s?r:{min:s,max:i,step:r.step,values:r.values.filter(p=>p>=s&&p<=i)}}function Ve(o,t,e,a){return e+(o-t.min)/(t.max-t.min)*(a-e)}function Ca(o,t){return Math.min(6,Math.max(3,Math.round(o/t)))}var Cr=Math.PI*2,ge=o=>Math.round(o*100)/100||0,Y=([o,t])=>`${ge(o)},${ge(t)}`;function Ur(o,t=!0){return o.map((e,a)=>`${a===0&&t?"M":"L"}${Y(e)}`).join(" ")}function bl(o){let t=o.length;if(t<3)return[];let e=o.slice(0,-1).map(([r,s],i)=>{let[p,c]=o[i+1];return p===r?0:(c-s)/(p-r)}),a=o.map((r,s)=>{if(s===0)return e[0];if(s===t-1)return e[t-2];let i=e[s-1],p=e[s];return i*p<=0?0:(i+p)/2});return e.forEach((r,s)=>{if(r===0){a[s]=0,a[s+1]=0;return}let i=a[s]/r,p=a[s+1]/r,c=i*i+p*p;if(c>9){let u=3/Math.sqrt(c);a[s]=u*i*r,a[s+1]=u*p*r}}),e.map((r,s)=>{let i=o[s],p=o[s+1],c=(p[0]-i[0])/3;return{from:i,c1:[i[0]+c,i[1]+a[s]*c],c2:[p[0]-c,p[1]-a[s+1]*c],to:p}})}function yl(o,t=!0){return o.length<3?Ur(o,t):[t?`M${Y(o[0])}`:`L${Y(o[0])}`,...bl(o).map(({c1:e,c2:a,to:r})=>`C${Y(e)} ${Y(a)} ${Y(r)}`)].join(" ")}function Dt(o,t,e,a){return[o+e*Math.sin(a),t-e*Math.cos(a)]}function kl(o,t,e,a,r,s){let i=s-r;if(i<=0||a<=0)return"";if(i>=Cr-1e-6){let f=(g,x)=>{let $=Dt(o,t,g,0),M=Dt(o,t,g,Math.PI),S=`A${ge(g)},${ge(g)} 0 1 ${x}`;return`M${Y($)} ${S} ${Y(M)} ${S} ${Y($)} Z`};return e>0?`${f(a,1)} ${f(e,0)}`:f(a,1)}let p=i>Math.PI?1:0,c=`A${ge(a)},${ge(a)} 0 ${p} 1 ${Y(Dt(o,t,a,s))}`;if(e<=0)return`M${Y([o,t])} L${Y(Dt(o,t,a,r))} ${c} Z`;let u=`A${ge(e)},${ge(e)} 0 ${p} 0 ${Y(Dt(o,t,e,r))}`;return`M${Y(Dt(o,t,a,r))} ${c} L${Y(Dt(o,t,e,s))} ${u} Z`}function Us(o,t,e,a,r,s){let i=Math.max(0,s==="top"||s==="bottom"?Math.min(r,e/2,a):Math.min(r,a/2,e)),[p,c,u,f]=[o,t,o+e,t+a],g=$=>`A${ge(i)},${ge(i)} 0 0 1 ${Y($)}`,x=$=>`L${Y($)}`;if(s==="none"||i===0)return`M${Y([p,c])} ${x([u,c])} ${x([u,f])} ${x([p,f])} Z`;switch(s){case"top":return`M${Y([p,f])} ${x([p,c+i])} ${g([p+i,c])} ${x([u-i,c])} ${g([u,c+i])} ${x([u,f])} Z`;case"bottom":return`M${Y([p,c])} ${x([u,c])} ${x([u,f-i])} ${g([u-i,f])} ${x([p+i,f])} ${g([p,f-i])} Z`;case"right":return`M${Y([p,c])} ${x([u-i,c])} ${g([u,c+i])} ${x([u,f-i])} ${g([u-i,f])} ${x([p,f])} Z`;case"left":return`M${Y([u,c])} ${x([u,f])} ${x([p+i,f])} ${g([p,f-i])} ${x([p,c+i])} ${g([p+i,c])} Z`}}var me={top:12,right:8,bottom:24},Sa=12,Hs={vertical:48,horizontal:96},lr=o=>o?.values??[];function wl(o){let{series:t,hidden:e,labels:a,measure:r,format:s,noAxis:i,width:p,height:c}=o,u=t.map(B=>B.type??o.type),f=t.map((B,ut)=>ut).filter(B=>!e.has(B)),g=f.map(B=>u[B]),x=Math.max(a.length,0,...t.map(B=>lr(B).length)),$=g.length>0?g.includes("bar"):o.type==="bar",M=o.horizontal&&$&&(g.length===0||g.every(B=>B==="bar")),S=B=>f.filter(ut=>u[ut]===B).map(ut=>lr(t[ut])),P=o.stacked?[S("bar"),S("area")].filter(B=>B.length):[],L=o.stacked?S("line"):f.map(B=>lr(t[B])),D=g.length>0?g.some(B=>B!=="line"):o.type!=="line",{lo:Z,hi:E}=vl(P,L,{includeZero:D}),C={min:o.min,max:o.max};if(!M){let B=Math.max(0,c-me.top-me.bottom),ut=$a(Z,E,Ca(B,Hs.vertical),C),Vr=i?0:Math.max(0,...ut.values.map(ci=>r(s(ci)))),Fo=i?4:Math.ceil(Vr)+Sa;return{box:{x:Fo,y:me.top,width:Math.max(0,p-Fo-me.right),height:B},ticks:ut,count:x,horizontal:M,banded:$,marks:u,visible:f}}let O=Math.max(0,...a.map(r)),z=Math.ceil(Math.min(O,p*.4))+Sa,V=Math.max(0,p-z-me.right),Vt=$a(Z,E,Ca(V,Hs.horizontal),C),jt=i?me.right:Math.max(me.right,r(s(Vt.max))/2);return{box:{x:z,y:me.top,width:Math.max(0,p-z-jt),height:Math.max(0,c-me.top-(i?4:me.bottom))},ticks:Vt,count:x,horizontal:M,banded:$,marks:u,visible:f}}function je(o,t){let{box:e,count:a,horizontal:r,banded:s}=o,i=r?e.y:e.x,p=r?e.height:e.width;return s?i+(t+.5)*p/Math.max(1,a):a<=1?i+p/2:i+t/(a-1)*p}function De(o,t){let{box:e,ticks:a,horizontal:r}=o;return r?Ve(t,a,e.x,e.x+e.width):Ve(t,a,e.y+e.height,e.y)}function $l(o,t,e){let{box:a,count:r,horizontal:s,banded:i}=o;if(r===0)return-1;let p=s?e-a.y:t-a.x,c=s?a.height:a.width;if(c<=0)return-1;let u=i?Math.floor(p/(c/r)):Math.round(p/c*(r-1));return Math.min(Math.max(u,0),r-1)}var Cl=.64,Do=2,Ns=4,_s={grouped:40,stacked:48},Sl=12;function Vs(o,t){for(let e=o.length-1;e>=0;e-=1)if(t(o[e]))return e;return-1}function Pl(o,t,e){if(e(o)<=t)return o;let a=o;for(;a.length>1&&e(`${a}\u2026`)>t;)a=a.slice(0,-1);return`${a}\u2026`}function Al(o){let{layout:t,noGrid:e,noAxis:a,format:r}=o,{box:s,ticks:i,horizontal:p}=t,c=e?l:i.values.map(g=>{let x=De(t,g);return p?A`<line class="grid" x1=${x} y1=${s.y} x2=${x} y2=${s.y+s.height} />`:A`<line class="grid" x1=${s.x} y1=${x} x2=${s.x+s.width} y2=${x} />`}),u=i.min<0&&i.max>0?(()=>{let g=De(t,0);return p?A`<line class="baseline" x1=${g} y1=${s.y} x2=${g} y2=${s.y+s.height} />`:A`<line class="baseline" x1=${s.x} y1=${g} x2=${s.x+s.width} y2=${g} />`})():l,f=a?l:i.values.map(g=>{let x=De(t,g);return p?A`<text class="tick-label" x=${x} y=${s.y+s.height+16} text-anchor="middle">${r(g)}</text>`:A`<text class="tick-label" x=${s.x-8} y=${x} text-anchor="end" dominant-baseline="middle">${r(g)}</text>`});return A`${c}${u}${f}`}function Ml(o){let{layout:t,labels:e,measure:a}=o,{box:r,count:s,horizontal:i,banded:p}=t;if(i){let f=Math.max(1,Math.ceil(s/Math.max(1,Math.floor(r.height/18))));return A`${e.map((g,x)=>x%f===0?A`<text
|
|
5550
6203
|
class="axis-label"
|
|
5551
6204
|
x=${r.x-8}
|
|
5552
|
-
y=${
|
|
6205
|
+
y=${je(t,x)}
|
|
5553
6206
|
text-anchor="end"
|
|
5554
6207
|
dominant-baseline="middle"
|
|
5555
|
-
>${
|
|
6208
|
+
>${Pl(g,r.x-Sa,a)}</text>`:l)}`}let c=Math.max(0,...e.map(a))+Sa,u=Math.max(1,Math.ceil(s/Math.max(1,Math.floor(r.width/c))));return A`${e.map((f,g)=>{if(g%u!==0)return l;let x=p||s<=1?"middle":g===0?"start":g===s-1?"end":"middle";return A`<text
|
|
5556
6209
|
class="axis-label"
|
|
5557
|
-
x=${
|
|
6210
|
+
x=${je(t,g)}
|
|
5558
6211
|
y=${r.y+r.height+16}
|
|
5559
6212
|
text-anchor=${x}
|
|
5560
|
-
>${f}</text>`})}`}function
|
|
6213
|
+
>${f}</text>`})}`}function Dl(o,t,e){return t.map((a,r)=>[je(o.layout,r),De(o.layout,a+(e?.[r]??0))])}function To(o,t,e=!0){return o.smooth?yl(t,e):Ur(t,e)}function Tl(o){let{layout:t,series:e,colorOf:a,active:r,idPrefix:s,stacked:i,smooth:p}=o,{box:c,count:u,visible:f,marks:g}=t,x=De(t,Math.min(Math.max(0,t.ticks.min),t.ticks.max)),$=new Array(u).fill(0),M=[],S=[];for(let L of f){let D=g[L];if(D==="bar")continue;let Z=lr(e[L]);if(Z.length===0)continue;let E=a(L),C=D==="area"&&i?[...$]:void 0,O=Dl(o,Z,C);if(D==="area"){let z=`${s}-fill-${L}`,V=C?Z.map((jt,B)=>[je(t,B),De(t,C[B])]):[[O.at(-1)[0],x],[O[0][0],x]],Vt=C?To(o,[...V].reverse(),!1):Ur(V,!1);M.push(A`
|
|
5561
6214
|
<defs>
|
|
5562
|
-
<linearGradient id=${
|
|
5563
|
-
<stop offset="0%" stop-color=${
|
|
5564
|
-
<stop offset="100%" stop-color=${
|
|
6215
|
+
<linearGradient id=${z} x1="0" y1="0" x2="0" y2="1">
|
|
6216
|
+
<stop offset="0%" stop-color=${E} stop-opacity="0.28" />
|
|
6217
|
+
<stop offset="100%" stop-color=${E} stop-opacity="0.02" />
|
|
5565
6218
|
</linearGradient>
|
|
5566
6219
|
</defs>
|
|
5567
|
-
<path class="area" d=${`${
|
|
5568
|
-
x1=${
|
|
5569
|
-
x2=${
|
|
6220
|
+
<path class="area" d=${`${To(o,O)} ${Vt} Z`} fill=${`url(#${z})`} />`),C&&Z.forEach((jt,B)=>$[B]=C[B]+jt)}if(S.push(A`<path class="line" d=${To(o,O)} stroke=${E} pathLength="1" />`),u<=Sl&&!p&&S.push(A`${O.map(([z,V])=>A`<circle class="point" cx=${z} cy=${V} r="3" fill=${E} />`)}`),r>=0&&O[r]){let[z,V]=O[r];S.push(A`<circle class="marker" cx=${z} cy=${V} r="5" fill=${E} />`)}}let P=r>=0&&!t.banded?A`<line class="crosshair"
|
|
6221
|
+
x1=${je(t,r)} y1=${c.y}
|
|
6222
|
+
x2=${je(t,r)} y2=${c.y+c.height} />`:l;return A`${M}${P}${S}`}function js(o,t){let{layout:e,active:a,colorOf:r}=o,{from:s,to:i,offset:p,thickness:c,outer:u,series:f,index:g}=t,x=i<s,$=De(e,s),M=De(e,i),S=.5,P=Math.sign(M-$)||1;s!==0&&($+=S*P),u||(M-=S*P),Math.abs(M-$)<1&&(M=$+P);let L=Math.min($,M),D=Math.abs(M-$),Z=u?e.horizontal?x?"left":"right":x?"bottom":"top":"none",E=e.horizontal?Us(L,p,D,c,Ns,Z):Us(p,L,c,D,Ns,Z);return A`<path
|
|
5570
6223
|
class=${`bar${x?" negative":""}${e.horizontal?" sideways":""}`}
|
|
5571
|
-
d=${
|
|
6224
|
+
d=${E}
|
|
5572
6225
|
fill=${r(f)}
|
|
5573
6226
|
data-series=${f}
|
|
5574
|
-
data-index=${
|
|
5575
|
-
opacity=${a===-1||a===
|
|
5576
|
-
/>`}function
|
|
5577
|
-
${
|
|
5578
|
-
${
|
|
5579
|
-
${
|
|
5580
|
-
${
|
|
5581
|
-
${t.y.values.map(S=>{let P=
|
|
5582
|
-
${t.x.values.map(S=>{let P=
|
|
5583
|
-
${t.y.values.map(S=>A`<text class="tick-label" x=${f.x-8} y=${
|
|
6227
|
+
data-index=${g}
|
|
6228
|
+
opacity=${a===-1||a===g?1:.45}
|
|
6229
|
+
/>`}function Bl(o){let{layout:t,series:e}=o,{box:a,count:r,horizontal:s,visible:i,marks:p}=t,c=i.filter(g=>p[g]==="bar");if(c.length===0||r===0)return l;let u=(s?a.height:a.width)/r*Cl,f=[];for(let g=0;g<r;g+=1){let x=je(t,g);if(o.stacked){let S=Math.max(2,Math.min(_s.stacked,u)),P=c.map(C=>lr(e[C])[g]??0),L=Vs(P,C=>C>0),D=Vs(P,C=>C<0),Z=0,E=0;P.forEach((C,O)=>{if(C===0)return;let z=C>0?Z:E,V=z+C;C>0?Z=V:E=V,f.push(js(o,{from:z,to:V,offset:x-S/2,thickness:S,outer:O===(C>0?L:D),series:c[O],index:g}))});continue}let $=Math.max(2,Math.min(_s.grouped,(u-Do*(c.length-1))/c.length)),M=$*c.length+Do*(c.length-1);c.forEach((S,P)=>{let L=lr(e[S])[g];L===void 0||L===0||f.push(js(o,{from:0,to:L,offset:x-M/2+P*($+Do),thickness:$,outer:!0,series:S,index:g}))})}return A`${f}`}function Ll(o){return A`
|
|
6230
|
+
${Al(o)}
|
|
6231
|
+
${Bl(o)}
|
|
6232
|
+
${Tl(o)}
|
|
6233
|
+
${Ml(o)}`}function El(o){let{layout:t,series:e,active:a,stacked:r}=o,s=u=>lr(e[u])[a]??0,i=t.ticks.min;for(let u of["bar","area","line"]){let f=t.visible.filter(x=>t.marks[x]===u).map(s);if(f.length===0)continue;let g=r&&u!=="line"?f.filter(x=>x>0).reduce((x,$)=>x+$,0):Math.max(...f);i=Math.max(i,g)}let p=je(t,a),c=De(t,Math.min(i,t.ticks.max));return t.horizontal?{x:c,y:p}:{x:p,y:c}}var $r={top:16,right:16,bottom:24},Ol=12,Rl=24,Gs=3,zl=4,ql=24,Hr=o=>o?.points??[];function Kl(o){return o.series.flatMap((t,e)=>o.hidden.has(e)?[]:Hr(t))}function Ws(o){return o.length===0?[0,1]:[Math.min(...o),Math.max(...o)]}function Il(o){let{width:t,height:e,measure:a,format:r,formatX:s,noAxis:i}=o,p=Kl(o),c=Math.max(0,e-$r.top-$r.bottom),[u,f]=Ws(p.map(D=>D.y)),g=$a(u,f,Ca(c,48),{min:o.min,max:o.max}),x=i?0:Math.max(0,...g.values.map(D=>a(r(D)))),$=i?4:Math.ceil(x)+Ol,[M,S]=Ws(p.map(D=>D.x)),P=$a(M,S,Ca(Math.max(0,t-$-$r.right),96),{min:null,max:null}),L=i?$r.right:Math.max($r.right,a(s(P.max))/2);return{box:{x:$,y:$r.top,width:Math.max(0,t-$-L),height:c},x:P,y:g,maxR:o.bubble?Math.max(0,...p.map(D=>D.r??0)):0}}function Pa(o,t){let{box:e}=o;return[Ve(t.x,o.x,e.x,e.x+e.width),Ve(t.y,o.y,e.y+e.height,e.y)]}function Fl(o,t){return o===void 0||t<=0||o<=0?Gs:Math.max(Gs,Rl*Math.sqrt(o/t))}function Lo(o,t,e){return o.bubble?Fl(e.r,t.maxR):zl}function Ul(o,t,e,a){let r=null,s=1/0;return o.series.forEach((i,p)=>{o.hidden.has(p)||Hr(i).forEach((c,u)=>{let[f,g]=Pa(t,c),x=Math.hypot(f-e,g-a),$=Math.max(ql,Lo(o,t,c)+4);x<=$&&x<s&&(r={series:p,index:u},s=x)})}),r}function Ys(o){let t=Hr(o);return t.map((e,a)=>a).sort((e,a)=>t[e].x-t[a].x)}function Hl(o){let{layout:t,noGrid:e,noAxis:a,format:r,formatX:s,bubble:i,colorOf:p,active:c,activeSeries:u}=o,{box:f}=t,g=e?l:A`
|
|
6234
|
+
${t.y.values.map(S=>{let P=Ve(S,t.y,f.y+f.height,f.y);return A`<line class="grid" x1=${f.x} y1=${P} x2=${f.x+f.width} y2=${P} />`})}
|
|
6235
|
+
${t.x.values.map(S=>{let P=Ve(S,t.x,f.x,f.x+f.width);return A`<line class="grid" x1=${P} y1=${f.y} x2=${P} y2=${f.y+f.height} />`})}`,x=a?l:A`
|
|
6236
|
+
${t.y.values.map(S=>A`<text class="tick-label" x=${f.x-8} y=${Ve(S,t.y,f.y+f.height,f.y)}
|
|
5584
6237
|
text-anchor="end" dominant-baseline="middle">${r(S)}</text>`)}
|
|
5585
|
-
${t.x.values.map(S=>A`<text class="tick-label" x=${
|
|
5586
|
-
y=${f.y+f.height+16} text-anchor="middle">${s(S)}</text>`)}`,$=o.series.flatMap((S,P)=>o.hidden.has(P)?[]:
|
|
6238
|
+
${t.x.values.map(S=>A`<text class="tick-label" x=${Ve(S,t.x,f.x,f.x+f.width)}
|
|
6239
|
+
y=${f.y+f.height+16} text-anchor="middle">${s(S)}</text>`)}`,$=o.series.flatMap((S,P)=>o.hidden.has(P)?[]:Hr(S).map((L,D)=>({point:L,index:D,seriesIndex:P,radius:Lo(o,t,L)}))).sort((S,P)=>P.radius-S.radius).map(({point:S,index:P,seriesIndex:L,radius:D})=>{let[Z,E]=Pa(t,S),C=p(L);return A`<circle
|
|
5587
6240
|
class="dot"
|
|
5588
|
-
cx=${
|
|
5589
|
-
cy=${
|
|
6241
|
+
cx=${Z}
|
|
6242
|
+
cy=${E}
|
|
5590
6243
|
r=${D}
|
|
5591
6244
|
fill=${C}
|
|
5592
6245
|
fill-opacity=${i?.55:.85}
|
|
@@ -5594,10 +6247,10 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5594
6247
|
stroke-width=${i?1.5:2}
|
|
5595
6248
|
data-series=${L}
|
|
5596
6249
|
data-index=${P}
|
|
5597
|
-
/>`}),M=(()=>{let S=
|
|
5598
|
-
r=${
|
|
6250
|
+
/>`}),M=(()=>{let S=Hr(o.series[u])[c];if(!S||o.hidden.has(u))return l;let[P,L]=Pa(t,S);return A`<circle class="focus-ring" cx=${P} cy=${L}
|
|
6251
|
+
r=${Lo(o,t,S)+4} fill="none" stroke=${p(u)} stroke-width="2" />`})();return A`${g}${x}${$}${M}`}var Nl=8,_l=.62,Xs=4,Aa=12;function Vl(o){let{width:t,height:e,kind:a,series:r,hidden:s,labels:i,measure:p}=o,c=t/2,u=e/2;if(a==="radar"){let E=r.flatMap((B,ut)=>s.has(ut)?[]:B.values??[]),C=Math.min(0,...E),O=Math.max(0,...E),z=Bo(C,O===C?C+1:O,Xs),V=Math.min(Math.max(0,...i.map(p)),t*.25)+Aa,Vt=Math.max(0,Math.min(c-V,u-Aa*2)),jt=Math.max(i.length,...r.map(B=>B.values?.length??0));return{cx:c,cy:u,outer:Vt,inner:0,slices:Array.from({length:jt},(B,ut)=>{let Vr=ut*Cr/Math.max(1,jt);return{index:ut,value:0,start:Vr,end:Vr,outer:Vt}}),ticks:z,total:0}}let f=r[0]?.values??[],g=Math.max(i.length,f.length),x=E=>s.has(E)?0:Math.max(0,f[E]??0),$=Array.from({length:g},(E,C)=>x(C)).reduce((E,C)=>E+C,0),M=Math.max(0,Math.min(t,e)/2-Nl),S=Math.max(0,...Array.from({length:g},(E,C)=>x(C))),P=Bo(0,S||1,Xs),L=Array.from({length:g},(E,C)=>C).filter(E=>!s.has(E)).length,D=0,Z=Array.from({length:g},(E,C)=>{let O=x(C),z=D;return a==="polar-area"?(s.has(C)||(D+=Cr/Math.max(1,L)),{index:C,value:O,start:z,end:D,outer:M*Math.sqrt(O/P.max)}):(D+=$>0?O/$*Cr:0,{index:C,value:O,start:z,end:D,outer:M})});return{cx:c,cy:u,outer:M,inner:a==="doughnut"?M*_l:0,slices:Z,ticks:P,total:$}}function jl(o,t,e,a){let r=e-o.cx,s=a-o.cy,i=Math.hypot(r,s),p=Math.atan2(r,-s);if(p<0&&(p+=Cr),t==="radar"){let c=o.slices.length;return c===0||i>o.outer+Aa*2?-1:Math.round(p/(Cr/c))%c}return i>o.outer||i<o.inner?-1:o.slices.find(({start:c,end:u})=>u>c&&p>=c&&p<u)?.index??-1}function Gl(o,t){let e=o.slices[t];if(!e)return[o.cx,o.cy];let a=(e.start+e.end)/2,r=o.inner>0?(o.inner+e.outer)/2:e.outer*.6;return Dt(o.cx,o.cy,r,a)}function wa(o,t){let{ticks:e,outer:a}=o;return(t-e.min)/(e.max-e.min)*a}function Wl(o){let{layout:t,active:e,sliceColor:a,kind:r,noGrid:s,format:i,centerLabel:p}=o,{cx:c,cy:u,inner:f,ticks:g}=t,x=r==="polar-area"&&!s?g.values.filter(P=>P>0).map(P=>A`<circle class="grid" cx=${c} cy=${u} r=${t.outer*Math.sqrt(P/g.max)} fill="none" />`):l,$=t.slices.filter(P=>P.end>P.start&&P.outer>0),M=$.map(P=>A`<path
|
|
5599
6252
|
class="slice"
|
|
5600
|
-
d=${
|
|
6253
|
+
d=${kl(c,u,f,P.outer,P.start,P.end)}
|
|
5601
6254
|
fill=${a(P.index)}
|
|
5602
6255
|
fill-rule="evenodd"
|
|
5603
6256
|
stroke="var(--surface-card)"
|
|
@@ -5607,11 +6260,11 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5607
6260
|
opacity=${e===-1||e===P.index?1:.45}
|
|
5608
6261
|
/>`),S=r==="doughnut"?A`
|
|
5609
6262
|
<text class="center-value" x=${c} y=${u} text-anchor="middle" dominant-baseline="middle">${i(t.total)}</text>
|
|
5610
|
-
${f>36?A`<text class="center-label" x=${c} y=${u+20} text-anchor="middle" dominant-baseline="middle">${p}</text>`:l}`:l;return A`${x}${M}${S}`}function
|
|
5611
|
-
${$.values.filter(C=>C>$.min).map(C=>{let
|
|
5612
|
-
${S.map(C=>{let[
|
|
5613
|
-
<path class="radar" d=${`${
|
|
5614
|
-
${
|
|
6263
|
+
${f>36?A`<text class="center-label" x=${c} y=${u+20} text-anchor="middle" dominant-baseline="middle">${p}</text>`:l}`:l;return A`${x}${M}${S}`}function Yl(o){let{layout:t,series:e,hidden:a,labels:r,colorOf:s,active:i,noGrid:p,noAxis:c,format:u}=o,{cx:f,cy:g,outer:x,ticks:$,slices:M}=t,S=M.map(C=>C.start),P=p?l:A`
|
|
6264
|
+
${$.values.filter(C=>C>$.min).map(C=>{let O=wa(t,C);return A`<path class="grid" fill="none" d=${`${Ur(S.map(z=>Dt(f,g,O,z)))} Z`} />`})}
|
|
6265
|
+
${S.map(C=>{let[O,z]=Dt(f,g,x,C);return A`<line class="grid" x1=${f} y1=${g} x2=${O} y2=${z} />`})}`,L=c?l:$.values.filter(C=>C>$.min).map(C=>A`<text class="tick-label ring-label" x=${f+4} y=${g-wa(t,C)+3} dominant-baseline="hanging">${u(C)}</text>`),D=S.map((C,O)=>{let z=Math.sin(C),V=Math.cos(C),Vt=z>.1?"start":z<-.1?"end":"middle",[jt,B]=Dt(f,g,x+(Math.abs(V)>.5?8:Aa),C),ut=V>.5?"auto":V<-.5?"hanging":"middle";return A`<text class="axis-label" x=${jt} y=${B} text-anchor=${Vt} dominant-baseline=${ut}>${r[O]??""}</text>`}),Z=e.map((C,O)=>{if(a.has(O))return l;let z=s(O),V=S.map((jt,B)=>Dt(f,g,wa(t,C.values?.[B]??$.min),jt)),Vt=i>=0&&V[i]?A`<circle class="marker" cx=${V[i][0]} cy=${V[i][1]} r="5" fill=${z} />`:l;return A`
|
|
6266
|
+
<path class="radar" d=${`${Ur(V)} Z`} stroke=${z} fill=${z} />
|
|
6267
|
+
${Vt}`}),E=i>=0&&S[i]!==void 0?(()=>{let[C,O]=Dt(f,g,x,S[i]);return A`<line class="crosshair" x1=${f} y1=${g} x2=${C} y2=${O} />`})():l;return A`${P}${E}${Z}${L}${D}`}function Xl(o){return o.kind==="radar"?Yl(o):Wl(o)}var Zl=Object.defineProperty,X=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Zl(t,e,r),r},Zs=8,F=class extends h{constructor(){super(...arguments),this.tableId=j("kt-chart-table"),this.box={width:0,height:0},this.active=-1,this.activeSeries=-1,this.hiddenSeries=new Set,this.type="area",this.series=[],this.labels=[],this.height=200,this.format=t=>String(t),this.formatX=t=>String(t),this.noGrid=!1,this.noAxis=!1,this.showTable=!1,this.smooth=!1,this.stacked=!1,this.horizontal=!1,this.min=null,this.max=null,this.centerLabel=void 0,this.totalLabel=void 0,this.label="",this.colorOf=t=>{let e=this.series[t];return e?.color?e.color:this.series.length===1?"var(--color-primary-base)":`var(--chart-series-${t%Zs+1})`},this.measure=t=>{if(this.measureContext===void 0)try{let e=document.createElement("canvas").getContext("2d"),a=getComputedStyle(this).getPropertyValue("--font-family-body").trim();e&&(e.font=`12px ${a||"sans-serif"}`),this.measureContext=e}catch{this.measureContext=null}return this.measureContext?this.measureContext.measureText(t).width:t.length*6.5},this.sliceColor=t=>`var(--chart-series-${t%Zs+1})`}static{this.styles=[h.styles,v`
|
|
5615
6268
|
:host {
|
|
5616
6269
|
display: block;
|
|
5617
6270
|
position: relative;
|
|
@@ -5904,7 +6557,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5904
6557
|
color: var(--text-body);
|
|
5905
6558
|
text-align: left;
|
|
5906
6559
|
}
|
|
5907
|
-
`]}connectedCallback(){super.connectedCallback(),this.observer=new ResizeObserver(([t])=>{t&&(this.box={width:t.contentRect.width,height:this.height})})}firstUpdated(){this.plot&&this.observer?.observe(this.plot)}disconnectedCallback(){super.disconnectedCallback(),this.observer?.disconnect()}willUpdate(t){(t.has("series")||t.has("type")||t.has("labels"))&&(this.hiddenSeries.size>0&&(this.hiddenSeries=new Set),this.active>=this.pointCount&&(this.active=-1,this.activeSeries=-1))}get family(){return this.type==="scatter"||this.type==="bubble"?"point":this.type==="pie"||this.type==="doughnut"||this.type==="polar-area"||this.type==="radar"?"radial":"cartesian"}get pointCount(){return Math.max(this.labels.length,0,...this.series.map(t=>t.values?.length??0))}get cartesianView(){let t={width:this.box.width,height:this.height,series:this.series,hidden:this.hiddenSeries,labels:this.labels,type:this.family==="cartesian"?this.type:"line",stacked:this.stacked,horizontal:this.horizontal,min:this.min,max:this.max,noAxis:this.noAxis,measure:this.measure,format:this.format};return{...t,layout:
|
|
6560
|
+
`]}connectedCallback(){super.connectedCallback(),this.observer=new ResizeObserver(([t])=>{t&&(this.box={width:t.contentRect.width,height:this.height})})}firstUpdated(){this.plot&&this.observer?.observe(this.plot)}disconnectedCallback(){super.disconnectedCallback(),this.observer?.disconnect()}willUpdate(t){(t.has("series")||t.has("type")||t.has("labels"))&&(this.hiddenSeries.size>0&&(this.hiddenSeries=new Set),this.active>=this.pointCount&&(this.active=-1,this.activeSeries=-1))}get family(){return this.type==="scatter"||this.type==="bubble"?"point":this.type==="pie"||this.type==="doughnut"||this.type==="polar-area"||this.type==="radar"?"radial":"cartesian"}get pointCount(){return Math.max(this.labels.length,0,...this.series.map(t=>t.values?.length??0))}get cartesianView(){let t={width:this.box.width,height:this.height,series:this.series,hidden:this.hiddenSeries,labels:this.labels,type:this.family==="cartesian"?this.type:"line",stacked:this.stacked,horizontal:this.horizontal,min:this.min,max:this.max,noAxis:this.noAxis,measure:this.measure,format:this.format};return{...t,layout:wl(t),active:this.active,smooth:this.smooth,noGrid:this.noGrid,colorOf:this.colorOf,idPrefix:this.tableId}}get pointView(){let t={width:this.box.width,height:this.height,series:this.series,hidden:this.hiddenSeries,bubble:this.type==="bubble",min:this.min,max:this.max,noAxis:this.noAxis,measure:this.measure,format:this.format,formatX:this.formatX};return{...t,layout:Il(t),active:this.active,activeSeries:this.activeSeries,noGrid:this.noGrid,colorOf:this.colorOf}}get sliced(){return this.type==="pie"||this.type==="doughnut"||this.type==="polar-area"}get radialView(){let t={width:this.box.width,height:this.height,kind:this.type,series:this.series,hidden:this.hiddenSeries,labels:this.labels,measure:this.measure};return{...t,layout:Vl(t),active:this.active,noGrid:this.noGrid,noAxis:this.noAxis,centerLabel:this.centerLabel??m().total,format:this.format,colorOf:this.colorOf,sliceColor:this.sliceColor}}get hasData(){return this.family==="point"?this.series.some(t=>(t.points?.length??0)>0):this.pointCount>0}setActive(t,e=-1){t===this.active&&e===this.activeSeries||(this.active=t,this.activeSeries=e,y(this,"kt-point-hover",{index:t,series:e}))}onPointerMove(t){if(this.box.width!==0){if(this.family==="cartesian"){let e=$l(this.cartesianView.layout,t.offsetX,t.offsetY);this.setActive(e)}else if(this.family==="radial"){let e=this.radialView;this.setActive(jl(e.layout,e.kind,t.offsetX,t.offsetY))}else if(this.family==="point"){let e=this.pointView,a=Ul(e,e.layout,t.offsetX,t.offsetY);this.setActive(a?.index??-1,a?.series??-1)}}}onPointerLeave(){this.setActive(-1)}get stops(){let t=Array.from({length:this.pointCount},(e,a)=>a);return this.sliced?t.filter(e=>!this.hiddenSeries.has(e)):t}onKeyDown(t){if(this.family==="point"){this.onPointKeyDown(t);return}let e=this.stops;if(e.length===0)return;let a=e.indexOf(this.active),r=e.length-1,s={ArrowRight:a<0?0:Math.min(a+1,r),ArrowDown:a<0?0:Math.min(a+1,r),ArrowLeft:a<0?0:Math.max(a-1,0),ArrowUp:a<0?0:Math.max(a-1,0),Home:0,End:r};if(t.key==="Escape"){this.setActive(-1);return}let i=s[t.key];i!==void 0&&(t.preventDefault(),this.setActive(e[i]))}onPointKeyDown(t){let e=this.series.map((u,f)=>({index:f,count:u.points?.length??0})).filter(({index:u,count:f})=>f>0&&!this.hiddenSeries.has(u)).map(({index:u})=>u);if(e.length===0)return;if(t.key==="Escape"){this.setActive(-1);return}let a=e.indexOf(this.activeSeries),r=a<0?e[0]:this.activeSeries,s=Ys(this.series[r]),i=a<0?-1:s.indexOf(this.active),p=s.length-1,c=u=>{let f=e[Math.min(Math.max((a<0?0:a)+u,0),e.length-1)];this.setActive(Ys(this.series[f])[0],f)};switch(t.key){case"ArrowRight":this.setActive(s[i<0?0:Math.min(i+1,p)],r);break;case"ArrowLeft":this.setActive(s[i<0?0:Math.max(i-1,0)],r);break;case"ArrowDown":c(a<0?0:1);break;case"ArrowUp":c(a<0?0:-1);break;case"Home":this.setActive(s[0],r);break;case"End":this.setActive(s[p],r);break;default:return}t.preventDefault()}toggle(t){let e=!this.hiddenSeries.has(t);if(y(this,"kt-series-toggle",{series:t,hidden:e}).defaultPrevented)return;let a=new Set(this.hiddenSeries);e?a.add(t):a.delete(t),this.hiddenSeries=a,this.setActive(-1)}renderMarks(){return this.family==="cartesian"?Ll(this.cartesianView):this.family==="point"?Hl(this.pointView):Xl(this.radialView)}get tooltip(){if(this.active<0||this.box.width===0)return null;if(this.family==="cartesian"){let t=this.cartesianView,e=t.layout.visible.map(p=>({color:this.colorOf(p),name:this.series[p].name,value:this.format(this.series[p].values?.[this.active]??0)})),{x:a,y:r}=El(t),s=t.layout.visible.filter(p=>this.stacked&&t.layout.marks[p]!=="line"),i=s.length>1?this.format(s.reduce((p,c)=>p+(this.series[c].values?.[this.active]??0),0)):void 0;return{title:this.labels[this.active]??`#${this.active+1}`,rows:e,...i===void 0?{}:{total:i},x:a,y:r,side:t.layout.horizontal?"right":"above"}}if(this.sliced){let t=this.radialView.layout,e=this.series[0]?.values?.[this.active]??0,a=t.total>0?Math.round(Math.max(0,e)/t.total*100):0,[r,s]=Gl(t,this.active);return{title:this.labels[this.active]??`#${this.active+1}`,rows:[{color:this.sliceColor(this.active),name:this.series[0]?.name??"",value:`${this.format(e)} (${a}%)`}],x:r,y:s,side:"above"}}if(this.type==="radar"){let t=this.radialView.layout,e=this.series.map((p,c)=>c).filter(p=>!this.hiddenSeries.has(p)),a=Math.max(t.ticks.min,...e.map(p=>this.series[p].values?.[this.active]??t.ticks.min)),r=t.slices[this.active]?.start??0,[s,i]=Dt(t.cx,t.cy,wa(t,a),r);return{title:this.labels[this.active]??`#${this.active+1}`,rows:e.map(p=>({color:this.colorOf(p),name:this.series[p].name,value:this.format(this.series[p].values?.[this.active]??0)})),x:s,y:i,side:"above"}}if(this.family==="point"){let t=this.series[this.activeSeries],e=t?.points?.[this.active];if(!t||!e)return null;let[a,r]=Pa(this.pointView.layout,e),s=this.colorOf(this.activeSeries),i=[{color:s,name:"x",value:this.formatX(e.x)},{color:s,name:"y",value:this.format(e.y)}];return this.type==="bubble"&&e.r!==void 0&&i.push({color:s,name:"r",value:String(e.r)}),{title:e.label??t.name,...e.label?{subtitle:t.name}:{},rows:i,x:a,y:r,side:"above"}}return null}renderTooltip(){let t=this.tooltip;if(!t)return l;let e=36+t.rows.length*20+(t.total?24:0),a=20,r=t.side,s=t.x,i=t.y;return r==="above"&&t.y-e<0&&(r="right",s=t.x+a),r==="right"&&s+180>this.box.width&&(r="left",s=t.x-(t.side==="above"?a:0)),r==="above"?s=Math.min(Math.max(s,72),Math.max(72,this.box.width-72)):i=Math.min(Math.max(i,e/2),Math.max(e/2,this.height-e/2)),d`<div class=${`tooltip ${r}`} style=${`left:${s}px;top:${i}px`} role="status">
|
|
5908
6561
|
<strong>${t.title}</strong>
|
|
5909
6562
|
${t.subtitle?d`<span class="tooltip-subtitle">${t.subtitle}</span>`:l}
|
|
5910
6563
|
${t.rows.map(p=>d`<span class="tooltip-row">
|
|
@@ -5913,7 +6566,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5913
6566
|
<span class="tooltip-value">${p.value}</span>
|
|
5914
6567
|
</span>`)}
|
|
5915
6568
|
${t.total?d`<span class="tooltip-total"
|
|
5916
|
-
><span>${this.totalLabel??
|
|
6569
|
+
><span>${this.totalLabel??m().total}</span><span>${t.total}</span></span
|
|
5917
6570
|
>`:l}
|
|
5918
6571
|
</div>`}renderLegend(){let t=this.sliced?Array.from({length:this.pointCount},(e,a)=>({name:this.labels[a]??`#${a+1}`,color:this.sliceColor(a)})):this.series.map((e,a)=>({name:e.name,color:this.colorOf(a)}));return t.length===0||!this.sliced&&t.length<2?l:d`<div part="legend" class="legend">
|
|
5919
6572
|
${t.map((e,a)=>{let r=this.hiddenSeries.has(a);return d`<button
|
|
@@ -5931,12 +6584,12 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5931
6584
|
</div>`}renderPointTable(){let t=this.type==="bubble";return d`<div part="table" class="table" id=${this.tableId}>
|
|
5932
6585
|
<table>
|
|
5933
6586
|
<caption>
|
|
5934
|
-
${this.label||
|
|
6587
|
+
${this.label||m().chartData}
|
|
5935
6588
|
</caption>
|
|
5936
6589
|
<thead>
|
|
5937
6590
|
<tr>
|
|
5938
|
-
<th scope="col">${
|
|
5939
|
-
<th scope="col">${
|
|
6591
|
+
<th scope="col">${m().chartSeries}</th>
|
|
6592
|
+
<th scope="col">${m().chartPoint}</th>
|
|
5940
6593
|
<th scope="col">x</th>
|
|
5941
6594
|
<th scope="col">y</th>
|
|
5942
6595
|
${t?d`<th scope="col">r</th>`:l}
|
|
@@ -5955,13 +6608,13 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5955
6608
|
</div>`}renderSliceTable(){let t=this.series[0]?.values??[],e=t.reduce((a,r)=>a+Math.max(0,r),0);return d`<div part="table" class="table" id=${this.tableId}>
|
|
5956
6609
|
<table>
|
|
5957
6610
|
<caption>
|
|
5958
|
-
${this.label||
|
|
6611
|
+
${this.label||m().chartData}
|
|
5959
6612
|
</caption>
|
|
5960
6613
|
<thead>
|
|
5961
6614
|
<tr>
|
|
5962
|
-
<th scope="col">${
|
|
5963
|
-
<th scope="col">${this.series[0]?.name??
|
|
5964
|
-
<th scope="col">${
|
|
6615
|
+
<th scope="col">${m().chartSlice}</th>
|
|
6616
|
+
<th scope="col">${this.series[0]?.name??m().chartValue}</th>
|
|
6617
|
+
<th scope="col">${m().chartShare}</th>
|
|
5965
6618
|
</tr>
|
|
5966
6619
|
</thead>
|
|
5967
6620
|
<tbody>
|
|
@@ -5975,13 +6628,13 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
5975
6628
|
</div>`}renderTable(){if(this.family==="point")return this.renderPointTable();if(this.sliced)return this.renderSliceTable();let t=this.family==="cartesian"&&this.stacked&&this.series.length>1,e=a=>this.series.reduce((r,s)=>r+(s.type==="line"?0:s.values?.[a]??0),0);return d`<div part="table" class="table" id=${this.tableId}>
|
|
5976
6629
|
<table>
|
|
5977
6630
|
<caption>
|
|
5978
|
-
${this.label||
|
|
6631
|
+
${this.label||m().chartData}
|
|
5979
6632
|
</caption>
|
|
5980
6633
|
<thead>
|
|
5981
6634
|
<tr>
|
|
5982
|
-
<th scope="col">${
|
|
6635
|
+
<th scope="col">${m().chartPoint}</th>
|
|
5983
6636
|
${this.series.map(a=>d`<th scope="col">${a.name}</th>`)}
|
|
5984
|
-
${t?d`<th scope="col">${this.totalLabel??
|
|
6637
|
+
${t?d`<th scope="col">${this.totalLabel??m().total}</th>`:l}
|
|
5985
6638
|
</tr>
|
|
5986
6639
|
</thead>
|
|
5987
6640
|
<tbody>
|
|
@@ -6010,7 +6663,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6010
6663
|
</svg>
|
|
6011
6664
|
${this.renderTooltip()}
|
|
6012
6665
|
</div>
|
|
6013
|
-
${this.renderLegend()} ${this.renderTable()}`}};
|
|
6666
|
+
${this.renderLegend()} ${this.renderTable()}`}};X([T(".plot")],F.prototype,"plot");X([k()],F.prototype,"box");X([k()],F.prototype,"active");X([k()],F.prototype,"activeSeries");X([k()],F.prototype,"hiddenSeries");X([n({type:String,reflect:!0})],F.prototype,"type");X([n({attribute:!1})],F.prototype,"series");X([n({attribute:!1})],F.prototype,"labels");X([n({type:Number})],F.prototype,"height");X([n({attribute:!1})],F.prototype,"format");X([n({attribute:!1})],F.prototype,"formatX");X([n({type:Boolean,attribute:"no-grid"})],F.prototype,"noGrid");X([n({type:Boolean,attribute:"no-axis"})],F.prototype,"noAxis");X([n({type:Boolean,reflect:!0,attribute:"show-table"})],F.prototype,"showTable");X([n({type:Boolean})],F.prototype,"smooth");X([n({type:Boolean})],F.prototype,"stacked");X([n({type:Boolean})],F.prototype,"horizontal");X([n({type:Number})],F.prototype,"min");X([n({type:Number})],F.prototype,"max");X([n({type:String,attribute:"center-label"})],F.prototype,"centerLabel");X([n({type:String,attribute:"total-label"})],F.prototype,"totalLabel");X([n({type:String})],F.prototype,"label");b("kt-chart",F);var Ql=Object.defineProperty,Ge=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Ql(t,e,r),r},_t=class extends h{constructor(){super(...arguments),this.label="",this.used="",this.total="",this.value=0,this.segments=[],this.max=0,this.showLegend=!1,this.format=t=>String(t)}static{this.styles=[h.styles,v`
|
|
6014
6667
|
:host {
|
|
6015
6668
|
display: block;
|
|
6016
6669
|
}
|
|
@@ -6114,7 +6767,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6114
6767
|
<span class="value">${this.format(a.value)}</span>
|
|
6115
6768
|
</li>`)}
|
|
6116
6769
|
</ul>`:l}
|
|
6117
|
-
</div>`}};
|
|
6770
|
+
</div>`}};Ge([n({type:String})],_t.prototype,"label");Ge([n({type:String})],_t.prototype,"used");Ge([n({type:String})],_t.prototype,"total");Ge([n({type:Number})],_t.prototype,"value");Ge([n({attribute:!1})],_t.prototype,"segments");Ge([n({type:Number})],_t.prototype,"max");Ge([n({type:Boolean,attribute:"show-legend"})],_t.prototype,"showLegend");Ge([n({attribute:!1})],_t.prototype,"format");b("kt-meter",_t);var Jl=Object.defineProperty,Eo=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&Jl(t,e,r),r},dr=class extends h{constructor(){super(...arguments),this.page=1,this.totalPages=1,this.label=void 0}static{this.styles=[h.styles,v`
|
|
6118
6771
|
:host {
|
|
6119
6772
|
display: block;
|
|
6120
6773
|
}
|
|
@@ -6132,7 +6785,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6132
6785
|
font-variant-numeric: tabular-nums;
|
|
6133
6786
|
white-space: nowrap;
|
|
6134
6787
|
}
|
|
6135
|
-
`]}go(t){let e=Math.min(Math.max(t,1),Math.max(this.totalPages,1));e!==this.page&&(this.page=e,y(this,"kt-page-change",{page:e}))}render(){let t=this.page<=1,e=this.page>=this.totalPages;return d`<nav aria-label=${this.label??
|
|
6788
|
+
`]}go(t){let e=Math.min(Math.max(t,1),Math.max(this.totalPages,1));e!==this.page&&(this.page=e,y(this,"kt-page-change",{page:e}))}render(){let t=this.page<=1,e=this.page>=this.totalPages;return d`<nav aria-label=${this.label??m().pagination}>
|
|
6136
6789
|
<kt-button
|
|
6137
6790
|
part="previous"
|
|
6138
6791
|
variant="dark"
|
|
@@ -6140,13 +6793,13 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6140
6793
|
icon="chevron-left"
|
|
6141
6794
|
?disabled=${t}
|
|
6142
6795
|
@click=${()=>this.go(this.page-1)}
|
|
6143
|
-
>${
|
|
6796
|
+
>${m().previous}</kt-button
|
|
6144
6797
|
>
|
|
6145
6798
|
|
|
6146
6799
|
<!-- polite, so a page change is announced without interrupting whatever
|
|
6147
6800
|
the reader is already working through -->
|
|
6148
6801
|
<span part="info" class="info" aria-live="polite">
|
|
6149
|
-
${
|
|
6802
|
+
${m().pageOf(this.page,this.totalPages)}
|
|
6150
6803
|
</span>
|
|
6151
6804
|
|
|
6152
6805
|
<kt-button
|
|
@@ -6157,9 +6810,9 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6157
6810
|
icon-position="right"
|
|
6158
6811
|
?disabled=${e}
|
|
6159
6812
|
@click=${()=>this.go(this.page+1)}
|
|
6160
|
-
>${
|
|
6813
|
+
>${m().next}</kt-button
|
|
6161
6814
|
>
|
|
6162
|
-
</nav>`}}
|
|
6815
|
+
</nav>`}};Eo([n({type:Number})],dr.prototype,"page");Eo([n({type:Number,attribute:"total-pages"})],dr.prototype,"totalPages");Eo([n({type:String})],dr.prototype,"label");b("kt-pagination",dr);var td=Object.defineProperty,Te=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&td(t,e,r),r},zt=class extends h{constructor(){super(...arguments),this.label="",this.value="",this.delta="",this.trend="flat",this.inverted=!1,this.icon="",this.caption="",this.size="medium",this.loading=!1}static{this.styles=[h.styles,v`
|
|
6163
6816
|
:host {
|
|
6164
6817
|
display: block;
|
|
6165
6818
|
}
|
|
@@ -6234,7 +6887,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6234
6887
|
</div>`}
|
|
6235
6888
|
${this.caption?d`<span class="caption">${this.caption}</span>`:l}
|
|
6236
6889
|
<slot></slot>
|
|
6237
|
-
</div>`}};
|
|
6890
|
+
</div>`}};Te([n({type:String})],zt.prototype,"label");Te([n({type:String})],zt.prototype,"value");Te([n({type:String})],zt.prototype,"delta");Te([n({type:String,reflect:!0})],zt.prototype,"trend");Te([n({type:Boolean})],zt.prototype,"inverted");Te([n({type:String})],zt.prototype,"icon");Te([n({type:String})],zt.prototype,"caption");Te([n({type:String,reflect:!0})],zt.prototype,"size");Te([n({type:Boolean,reflect:!0})],zt.prototype,"loading");b("kt-stat",zt);var ed=50;function rd({rowCount:o,rowHeight:t,viewportHeight:e,scrollTop:a,overscan:r}){if(o===0)return{start:0,end:0};if(t<=0)return{start:0,end:Math.min(o,ed)};let s=Math.ceil(e/t),i=Math.min(Math.floor(a/t),Math.max(0,o-s)),p=Math.ceil((a+e)/t);return{start:Math.max(0,i-r),end:Math.min(o,p+r)}}var ad=Object.defineProperty,W=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&ad(t,e,r),r},od=8,Qs=new Map;function sd(o){let t=Qs.get(o);return t||(t=new Intl.Collator(o,{numeric:!0,sensitivity:"base"}),Qs.set(o,t)),t}function Js(o){if(typeof o=="string")return o;if(typeof o=="number"||typeof o=="boolean"||typeof o=="bigint")return String(o);try{return JSON.stringify(o)??""}catch{return""}}function Ma(o){return o.id??o.uid??o}var I=class extends h{constructor(){super(...arguments),this.page=1,this.manual=!1,this.virtual=!1,this.scrollOffset=0,this.viewportHeight=0,this.headerHeight=0,this.rowHeight=0,this.totalRows=0,this.columns=[],this.data=[],this.selectable=!1,this.selectionMode="multiple",this.selected=[],this.pageSize=0,this.loading=!1,this.compact=!1,this.sortKey=null,this.sortDirection=null,this.emptyText=void 0,this.loadingText=void 0,this.label="",this.locale="",this.onScroll=t=>{this.scrollOffset=t.currentTarget.scrollTop}}static{this.styles=[h.styles,v`
|
|
6238
6891
|
:host {
|
|
6239
6892
|
display: block;
|
|
6240
6893
|
width: 100%;
|
|
@@ -6381,10 +7034,10 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6381
7034
|
padding: calc(10px * var(--density-scale, 1)) calc(12px * var(--density-scale, 1));
|
|
6382
7035
|
}
|
|
6383
7036
|
}
|
|
6384
|
-
`]}get sortedRows(){if(this.manual)return this.data;let t=this.sortCache,e=
|
|
7037
|
+
`]}get sortedRows(){if(this.manual)return this.data;let t=this.sortCache,e=se(this.locale);if(t?.data===this.data&&t.key===this.sortKey&&t.direction===this.sortDirection&&t.locale===e)return t.rows;let a=this.sort(sd(e));return this.sortCache={data:this.data,key:this.sortKey,direction:this.sortDirection,locale:e,rows:a},a}sort(t){if(!this.sortKey||!this.sortDirection)return this.data;let e=this.sortKey,a=this.sortDirection==="asc"?1:-1;return[...this.data].sort((r,s)=>{let i=r[e],p=s[e],c=i==null,u=p==null;return c&&u?0:c?1:u?-1:typeof i=="number"&&typeof p=="number"?(i-p)*a:t.compare(Js(i),Js(p))*a})}get totalPages(){if(this.pageSize<=0)return 1;let t=this.manual?this.totalRows||this.data.length:this.data.length;return Math.max(1,Math.ceil(t/this.pageSize))}get visibleRows(){let t=this.sortedRows;if(this.pageSize<=0||this.manual)return t;let e=Math.min(this.page,this.totalPages);return t.slice((e-1)*this.pageSize,e*this.pageSize)}toggleSort(t){t.sortable&&(this.sortKey!==t.key?(this.sortKey=t.key,this.sortDirection="asc"):this.sortDirection==="asc"?this.sortDirection="desc":(this.sortKey=null,this.sortDirection=null),this.manual&&(this.page=1),y(this,"kt-sort-change",{key:this.sortKey,direction:this.sortDirection}))}isSelected(t){return this.selected.includes(Ma(t))}toggleSelection(t){let e=Ma(t);this.selectionMode==="single"?this.selected=this.isSelected(t)?[]:[e]:this.selected=this.isSelected(t)?this.selected.filter(a=>a!==e):[...this.selected,e],y(this,"kt-selection-change",{selected:this.selected,rows:this.selectedRows})}toggleAll(){let t=this.visibleRows.map(Ma),e=t.every(a=>this.selected.includes(a));this.selected=e?this.selected.filter(a=>!t.includes(a)):[...new Set([...this.selected,...t])],y(this,"kt-selection-change",{selected:this.selected,rows:this.selectedRows})}get selectedRows(){return this.data.filter(t=>this.selected.includes(Ma(t)))}get isVirtual(){return this.virtual&&this.pageSize<=0}updated(t){if(t.has("compact")&&(this.rowHeight=0),!this.isVirtual){this.observe(void 0);return}let e=this.shadowRoot?.querySelector(".scroller")??void 0;this.observe(e);let a=this.shadowRoot?.querySelector('tbody tr[part="row"]');a&&this.rowHeight===0&&(this.rowHeight=a.getBoundingClientRect().height);let r=this.shadowRoot?.querySelector("thead");r&&(this.headerHeight=r.getBoundingClientRect().height),e&&(this.viewportHeight=e.clientHeight)}disconnectedCallback(){super.disconnectedCallback(),this.observe(void 0)}observe(t){t!==this.observed&&(this.resizeObserver?.disconnect(),this.observed=t,!(!t||typeof ResizeObserver>"u")&&(this.resizeObserver??=new ResizeObserver(([e])=>{e&&(this.viewportHeight=e.target.clientHeight)}),this.resizeObserver.observe(t)))}onPageChange(t){t.stopPropagation(),this.page=t.detail.page,y(this,"kt-page-change",{page:this.page})}sortStateFor(t){return this.sortKey!==t.key||!this.sortDirection?"none":this.sortDirection==="asc"?"ascending":"descending"}renderHeaderCell(t){let e=t.label??t.key,a=this.sortKey===t.key&&this.sortDirection!==null;return d`<th
|
|
6385
7038
|
part="header-cell"
|
|
6386
7039
|
scope="col"
|
|
6387
|
-
style=${
|
|
7040
|
+
style=${Tt(t.width?{width:t.width}:{})}
|
|
6388
7041
|
aria-sort=${this.sortStateFor(t)}
|
|
6389
7042
|
>
|
|
6390
7043
|
${t.sortable?d`<button type="button" @click=${()=>this.toggleSort(t)}>
|
|
@@ -6398,9 +7051,9 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6398
7051
|
</button>`:d`<span>${e}</span>`}
|
|
6399
7052
|
</th>`}renderBody(){let t=this.visibleRows,e=this.columns.length+(this.selectable?1:0);if(t.length===0)return d`<tr>
|
|
6400
7053
|
<td colspan=${e}>
|
|
6401
|
-
<div class="placeholder">${this.emptyText??
|
|
7054
|
+
<div class="placeholder">${this.emptyText??m().noData}</div>
|
|
6402
7055
|
</td>
|
|
6403
|
-
</tr>`;if(!this.isVirtual)return d`${t.map((i,p)=>this.renderRow(i,p))}`;let{start:a,end:r}=
|
|
7056
|
+
</tr>`;if(!this.isVirtual)return d`${t.map((i,p)=>this.renderRow(i,p))}`;let{start:a,end:r}=rd({rowCount:t.length,rowHeight:this.rowHeight,viewportHeight:Math.max(0,this.viewportHeight-this.headerHeight),scrollTop:Math.max(0,this.scrollOffset-this.headerHeight),overscan:od}),s=i=>i>0&&this.rowHeight>0?d`<tr class="spacer" aria-hidden="true">
|
|
6404
7057
|
<td colspan=${e} style=${`height: ${i*this.rowHeight}px`}></td>
|
|
6405
7058
|
</tr>`:l;return d`${s(a)}${t.slice(a,r).map((i,p)=>this.renderRow(i,a+p))}${s(t.length-r)}`}renderRow(t,e){let a=this.isSelected(t);return d`<tr
|
|
6406
7059
|
part="row"
|
|
@@ -6414,16 +7067,16 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6414
7067
|
type=${this.selectionMode==="single"?"radio":"checkbox"}
|
|
6415
7068
|
name=${this.selectionMode==="single"?"kt-table-selection":l}
|
|
6416
7069
|
.checked=${a}
|
|
6417
|
-
aria-label=${
|
|
7070
|
+
aria-label=${m().selectRow}
|
|
6418
7071
|
@click=${r=>r.stopPropagation()}
|
|
6419
7072
|
@change=${()=>this.toggleSelection(t)}
|
|
6420
7073
|
/>
|
|
6421
7074
|
</td>`:l}
|
|
6422
|
-
${this.columns.map(r=>{let s=this.renderCell?.(t,r);return d`<td part="cell" style=${
|
|
7075
|
+
${this.columns.map(r=>{let s=this.renderCell?.(t,r);return d`<td part="cell" style=${Tt({textAlign:r.align??"left"})}>
|
|
6423
7076
|
${s===void 0?t[r.key]:s}
|
|
6424
7077
|
</td>`})}
|
|
6425
7078
|
</tr>`}render(){let t=this.loading&&this.manual&&this.data.length>0;if(this.loading&&!t)return d`<div class="placeholder" role="status" aria-live="polite">
|
|
6426
|
-
${this.loadingText??
|
|
7079
|
+
${this.loadingText??m().loading}
|
|
6427
7080
|
</div>`;let e=this.visibleRows,a=e.length>0&&e.every(i=>this.isSelected(i)),r=e.some(i=>this.isSelected(i)),s=this.isVirtual;return d`<div class="scroller" @scroll=${s?this.onScroll:l}>
|
|
6428
7081
|
<table
|
|
6429
7082
|
part="table"
|
|
@@ -6438,7 +7091,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6438
7091
|
type="checkbox"
|
|
6439
7092
|
.checked=${a}
|
|
6440
7093
|
.indeterminate=${r&&!a}
|
|
6441
|
-
aria-label=${
|
|
7094
|
+
aria-label=${m().selectAll}
|
|
6442
7095
|
@change=${this.toggleAll}
|
|
6443
7096
|
/>`:l}
|
|
6444
7097
|
</th>`:l}
|
|
@@ -6457,7 +7110,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6457
7110
|
.totalPages=${this.totalPages}
|
|
6458
7111
|
@kt-page-change=${this.onPageChange}
|
|
6459
7112
|
></kt-pagination>
|
|
6460
|
-
</footer>`:l}`}};
|
|
7113
|
+
</footer>`:l}`}};W([n({type:Number})],I.prototype,"page");W([n({type:Boolean,reflect:!0})],I.prototype,"manual");W([n({type:Boolean,reflect:!0})],I.prototype,"virtual");W([k()],I.prototype,"scrollOffset");W([k()],I.prototype,"viewportHeight");W([k()],I.prototype,"headerHeight");W([k()],I.prototype,"rowHeight");W([n({type:Number,attribute:"total-rows"})],I.prototype,"totalRows");W([n({attribute:!1})],I.prototype,"columns");W([n({attribute:!1})],I.prototype,"data");W([n({type:Boolean,reflect:!0})],I.prototype,"selectable");W([n({type:String,attribute:"selection-mode"})],I.prototype,"selectionMode");W([n({attribute:!1})],I.prototype,"selected");W([n({type:Number,attribute:"page-size"})],I.prototype,"pageSize");W([n({type:Boolean,reflect:!0})],I.prototype,"loading");W([n({type:Boolean,reflect:!0})],I.prototype,"compact");W([n({type:String,attribute:"sort-key"})],I.prototype,"sortKey");W([n({type:String,attribute:"sort-direction"})],I.prototype,"sortDirection");W([n({attribute:!1})],I.prototype,"renderCell");W([n({type:String,attribute:"empty-text"})],I.prototype,"emptyText");W([n({type:String,attribute:"loading-text"})],I.prototype,"loadingText");W([n({type:String})],I.prototype,"label");W([n({type:String})],I.prototype,"locale");b("kt-table",I);var id=Object.defineProperty,pr=(o,t,e,a)=>{for(var r=void 0,s=o.length-1,i;s>=0;s--)(i=o[s])&&(r=i(t,e,r)||r);return r&&id(t,e,r),r},Nr=class extends h{constructor(){super(...arguments),this.compact=!1,this.#t=()=>{let t=this.shadowRoot?.querySelector("slot");if(!t)return;let e=t.assignedElements({flatten:!0}).filter(a=>a instanceof ae);e.forEach((a,r)=>{a.last=r===e.length-1,a.compact=this.compact})}}static{this.styles=[h.styles,v`
|
|
6461
7114
|
:host {
|
|
6462
7115
|
display: block;
|
|
6463
7116
|
}
|
|
@@ -6468,7 +7121,7 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6468
7121
|
}
|
|
6469
7122
|
`]}render(){return d`<div part="base" class="timeline" role="list">
|
|
6470
7123
|
<slot @slotchange=${this.#t}></slot>
|
|
6471
|
-
</div>`}firstUpdated(){this.#t()}updated(t){t.has("compact")&&this.#t()}#t};
|
|
7124
|
+
</div>`}firstUpdated(){this.#t()}updated(t){t.has("compact")&&this.#t()}#t};pr([n({type:Boolean,reflect:!0})],Nr.prototype,"compact");var ae=class extends h{constructor(){super(...arguments),this.heading="",this.time="",this.icon="",this.variant="neutral",this.last=!1,this.compact=!1}static{this.styles=[h.styles,v`
|
|
6472
7125
|
:host {
|
|
6473
7126
|
display: block;
|
|
6474
7127
|
}
|
|
@@ -6616,4 +7269,4 @@ var qr=globalThis,Kr=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeSha
|
|
|
6616
7269
|
</div>`:l}
|
|
6617
7270
|
<div class="body"><slot></slot></div>
|
|
6618
7271
|
</div>
|
|
6619
|
-
</div>`}};
|
|
7272
|
+
</div>`}};pr([n({type:String})],ae.prototype,"heading");pr([n({type:String})],ae.prototype,"time");pr([n({type:String})],ae.prototype,"icon");pr([n({type:String,reflect:!0})],ae.prototype,"variant");pr([n({type:Boolean,reflect:!0})],ae.prototype,"last");pr([n({type:Boolean,reflect:!0})],ae.prototype,"compact");b("kt-timeline",Nr);b("kt-timeline-item",ae);var oi=o=>{let t=o/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},Oo=o=>255*(o<=.0031308?12.92*o:1.055*o**(1/2.4)-.055);function nd([o,t,e]){let[a,r,s]=[o,t,e].map(oi),i=Math.cbrt(.4122214708*a+.5363325363*r+.0514459929*s),p=Math.cbrt(.2119034982*a+.6806995451*r+.1073969566*s),c=Math.cbrt(.0883024619*a+.2817188376*r+.6299787005*s),u=.2104542553*i+.793617785*p-.0040720468*c,f=1.9779984951*i-2.428592205*p+.4505937099*c,g=.0259040371*i+.7827717662*p-.808675766*c;return[u,Math.hypot(f,g),(Math.atan2(g,f)*180/Math.PI+360)%360]}function _r([o,t,e]){let a=t*Math.cos(e*Math.PI/180),r=t*Math.sin(e*Math.PI/180),s=(o+.3963377774*a+.2158037573*r)**3,i=(o-.1055613458*a-.0638541728*r)**3,p=(o-.0894841775*a-1.291485548*r)**3;return[Oo(4.0767416621*s-3.3077115913*i+.2309699292*p),Oo(-1.2684380046*s+2.6097574011*i-.3413193965*p),Oo(-.0041960863*s-.7034186147*i+1.707614701*p)]}var ti=o=>o.every(t=>t>=-.5&&t<=255.5);function si(o,t,e){if(ti(_r([o,e,t])))return e;let a=0,r=e;for(let s=0;s<24;s+=1){let i=(a+r)/2;ti(_r([o,i,t]))?a=i:r=i}return a}var Io=o=>o.map(t=>Math.min(255,Math.max(0,Math.round(t))));function ei(o){let[t,e,a]=o.map(oi);return .2126*t+.7152*e+.0722*a}function Ro(o,t){let[e,a]=[ei(o),ei(t)].sort((r,s)=>s-r);return(e+.05)/(a+.05)}var ri=(o,t,e)=>o.map((a,r)=>a*t+e[r]*(1-t)),Da=o=>`#${Io(o).map(t=>t.toString(16).padStart(2,"0")).join("")}`;function ii(o){let t=o.trim().toLowerCase(),e=/^#([0-9a-f]{3}|[0-9a-f]{6})$/.exec(t);if(e){let a=e[1].length===3?[...e[1]].map(r=>r+r).join(""):e[1];return[0,2,4].map(r=>parseInt(a.slice(r,r+2),16))}if(e=/^rgba?\(\s*(\d*\.?\d+)[\s,]+(\d*\.?\d+)[\s,]+(\d*\.?\d+)(?:\s*[,/]\s*\d*\.?\d+%?)?\s*\)$/.exec(t),e){let a=e.slice(1,4).map(Number);if(a.every(r=>r<=255))return a}if(e=/^oklch\(\s*(\d*\.?\d+)(%?)\s+(\d*\.?\d+)\s+(\d*\.?\d+)(?:deg)?\s*(?:\/\s*\d*\.?\d+%?\s*)?\)$/.exec(t),e){let a=Number(e[1])/(e[2]?100:1),r=Number(e[4]);if(a<=1)return Io(_r([a,si(a,r,Number(e[3])),r]))}throw new TypeError(`Not a colour Kanto can read: "${o}". Use #rrggbb, rgb() or oklch().`)}var ld={base:"#5f5dea",hover:"#5856e0",textDark:"#8e97ff",textLight:"#4f30ef",wash:"rgba(111, 116, 246, 0.16)",neutralHue:278,neutralChroma:1},ni=[{id:"violet",label:"Violet",color:"#5f5dea"},{id:"blue",label:"Blue",color:"#1f6feb"},{id:"teal",label:"Teal",color:"#0d9488"},{id:"green",label:"Green",color:"#16a34a"},{id:"orange",label:"Orange",color:"#ea580c"},{id:"pink",label:"Pink",color:"#db2777"},{id:"slate",label:"Slate",color:"#64748b"}],dd=[.3074,.018,16.5],pd=[[1,0,0],[.9023,.0081,8.2]],cd=[244,244,245],zo=4.6;function ud(o){let[t,e,a]=nd(ii(o)),r=e<5e-4?0:a,s=Math.round(Math.min(1,e/.08)*100)/100,i=D=>_r([D,si(D,r,e),r]),p=([D,Z,E])=>_r([D,Z*s,r+E]),c=Math.min(t,.72);for(;c>0&&Ro(cd,i(c))<zo;)c-=.0025;let u=i(c),f=D=>[D,ri(u,.12,D),ri(u,.16,D)],g=f(p(dd)),x=.45;for(;x<1&&g.some(D=>Ro(i(x),D)<zo);)x+=.0025;let $=pd.map(p).flatMap(f),M=.7;for(;M>0&&$.some(D=>Ro(i(M),D)<zo);)M-=.0025;let[S,P,L]=Io(u);return{base:Da(u),hover:Da(i(Math.max(0,c-.025))),textDark:Da(i(x)),textLight:Da(i(M)),wash:`rgba(${S}, ${P}, ${L}, 0.16)`,neutralHue:Math.round(r*10)/10,neutralChroma:s}}function li(o){return{"--accent-base":o.base,"--accent-hover":o.hover,"--accent-text-dark":o.textDark,"--accent-text-light":o.textLight,"--accent-wash":o.wash,"--neutral-hue":String(o.neutralHue),"--neutral-chroma":String(o.neutralChroma)}}var hd=Object.keys(li(ld));function ai(o,t=document.documentElement){if(o===null){for(let e of hd)t.style.removeProperty(e);t.dataset.accent==="custom"&&delete t.dataset.accent;return}for(let[e,a]of Object.entries(li(ud(o))))t.style.setProperty(e,a);t.dataset.accent??="custom"}var fd=[{id:"dark",label:"Dark"},{id:"light",label:"Light"},{id:"auto",label:"Auto"}],md=[{id:"kanto",label:"Kanto",family:"'Mulish', system-ui, sans-serif"},{id:"system",label:"System",family:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif"},{id:"inter",label:"Inter",family:"'Inter', system-ui, sans-serif"},{id:"plex",label:"IBM Plex Sans",family:"'IBM Plex Sans', system-ui, sans-serif"},{id:"geist",label:"Geist",family:"'Geist', system-ui, sans-serif"}],gd=[{id:"sharp",label:"Sharp"},{id:"default",label:"Default"},{id:"round",label:"Round"}],xd=[{id:"compact",label:"Compact"},{id:"default",label:"Default"},{id:"comfortable",label:"Comfortable"}],vd=[{id:"small",label:"Small"},{id:"default",label:"Default"},{id:"large",label:"Large"}],di={theme:"dark",accent:"violet",font:"kanto",radius:"default",density:"default",textSize:"default"},pi={theme:fd,font:md,radius:gd,density:xd,textSize:vd},qo=Object.keys(pi),Ko=o=>pi[o].map(t=>t.id);function g0(o,t=document.documentElement){for(let s of qo){let i=o[s];if(i!==void 0&&!Ko(s).includes(i))throw new TypeError(`Unknown ${s} "${i}". Use one of: ${Ko(s).join(", ")}.`)}let e=ni.find(s=>s.id===o.accent);o.accent!==void 0&&!e&&ii(o.accent);let a=t===document.documentElement,r=(s,i)=>i===di[s]&&(a||s==="theme");for(let s of qo){let i=o[s];i!==void 0&&(r(s,i)?delete t.dataset[s]:t.dataset[s]=i)}o.accent!==void 0&&(e?(ai(null,t),r("accent",e.id)?delete t.dataset.accent:t.dataset.accent=e.id):(delete t.dataset.accent,ai(o.accent,t)))}function x0(o=document.documentElement){let t={...di};for(let r of qo){let s=o.dataset[r];s!==void 0&&Ko(r).includes(s)&&(t[r]=s)}let e=o.style.getPropertyValue("--accent-base").trim(),a=o.dataset.accent;return e?t.accent=e:a&&ni.some(r=>r.id===a)&&(t.accent=a),t}export{ni as KT_ACCENTS,ld as KT_DEFAULT_ACCENT,di as KT_DEFAULT_APPEARANCE,xd as KT_DENSITIES,md as KT_FONTS,gd as KT_RADII,vd as KT_TEXT_SIZES,fd as KT_THEMES,ue as KtAlert,Wt as KtAvatar,Ct as KtBadge,vr as KtBreadcrumb,lt as KtButton,vt as KtCalendar,Kt as KtCard,F as KtChart,gt as KtCheckbox,ks as KtCode,ir as KtCollapsible,Nt as KtCommandPalette,Ht as KtConfirmDialog,ze as KtDateInput,Es as KtDatePicker,st as KtDragDrop,ft as KtDropdown,h as KtElement,Ie as KtEmptyState,Jt as KtForm,Ce as KtHeader,Ee as KtIcon,K as KtInput,at as KtInputMenu,gr as KtKbd,ar as KtLabelInput,_t as KtMeter,re as KtModal,tt as KtMultiSelect,et as KtNumberInput,Ke as KtPageHeader,dr as KtPagination,Rt as KtProgressBar,Ut as KtRadio,Et as KtRadioGroup,Mt as KtSegmentedControl,ot as KtSelect,Me as KtSidePanel,we as KtSkeleton,wt as KtSlider,mt as KtSplitButton,zt as KtStat,$e as KtSteps,pe as KtSubMenuNavigation,I as KtTable,ce as KtTabs,it as KtTextarea,or as KtTimeInput,Nr as KtTimeline,ae as KtTimelineItem,he as KtToast,Fe as KtToastContainer,ee as KtToggle,$t as KtToggleButton,Pe as KtToggleButtonGroup,le as KtTooltip,ud as accentPalette,li as accentProperties,Ro as contrastRatio,Ua as defaultStrings,b as defineElement,go as getIcon,m as getStrings,ii as parseColor,x0 as readAppearance,ds as registerIcon,ps as registerIcons,Ai as registeredIcons,Pi as resetStrings,ai as setAccent,g0 as setAppearance,ss as setStrings,nl as toaster};
|