@mattilsynet/design 1.0.8 → 1.0.10

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.
@@ -11,3 +11,4 @@ export declare const Default: Story;
11
11
  export declare const React: Story;
12
12
  export declare const Sizes: Story;
13
13
  export declare const WithBadge: Story;
14
+ export declare const InButton: Story;
@@ -6,4 +6,5 @@ export default meta;
6
6
  type Story = StoryObj<typeof meta>;
7
7
  export declare const Default: Story;
8
8
  export declare const InField: Story;
9
+ export declare const InFieldset: Story;
9
10
  export declare const React: Story;
@@ -1,9 +1,9 @@
1
- var mtds=function(W){"use strict";const Qn=(t,e,n)=>{const o=(n-1)/2,i=Math.max(Math.min(t-Math.floor(o),e-n+1),1),s=Math.min(Math.max(t+Math.ceil(o),n),e),a=Array.from({length:s+1-i},(r,d)=>d+i);return n>4&&i>1&&a.splice(0,2,1,0),n>3&&s<e&&a.splice(-2,2,0,e),a},Jn=({current:t=1,total:e=10,show:n=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:Qn(t,e,n).map((o,i)=>({current:o===t&&"page",key:`key-${o}-${i}`,page:o}))}),Yt="_alert_zm1dk_1 _ds-alert_oaddr_1",Kt="_avatar_zm1dk_1 _ds-avatar_oaddr_1",Wt="_badge_zm1dk_1",qt="_breadcrumbs_zm1dk_1 _ds-breadcrumbs_oaddr_1",Xt="__onInjectCrumb_zm1dk_1",Gt="_button_zm1dk_1 _ds-button_oaddr_1",Qt="_card_zm1dk_1",Jt="_info_zm1dk_1",Zt="_group_zm1dk_1",te="_chip_zm1dk_1 _ds-chip_oaddr_1",ee="_details_zm1dk_1 _ds-details_oaddr_1",ne="_dialog_zm1dk_1 _ds-dialog_oaddr_1",oe="_divider_zm1dk_1",ie="_errorsummary_zm1dk_1 _ds-error-summary_oaddr_1",se="__errorsummary_zm1dk_1",ae="_field_zm1dk_1 _ds-field_oaddr_1",re="_affixes_zm1dk_1 _ds-field-affixes_oaddr_1",le="_fieldset_zm1dk_1 _ds-fieldset_oaddr_1",de="_heading_zm1dk_1 _ds-heading_oaddr_1",ce="_helptext_zm1dk_1 _ds-focus_oaddr_1",ue="_input_zm1dk_1 _ds-input_oaddr_1",fe="_app_zm1dk_1",pe="_grid_zm1dk_1",he="_flex_zm1dk_1",me="_prose_zm1dk_1",_e="_link_zm1dk_1",ve="_logo_zm1dk_1",be="__onInjectLogo_zm1dk_1",ge="_pagination_zm1dk_1 _ds-pagination_oaddr_1",ye="_popover_zm1dk_1",Ee="_skeleton_zm1dk_1 _ds-skeleton_oaddr_1",$e="__skeleton_zm1dk_1",we="_spinner_zm1dk_1",Te="_table_zm1dk_1 _ds-table_oaddr_1",Ie="__onInjectTable_zm1dk_1",ke="__scrollShadow_zm1dk_1",Se="_tabs_zm1dk_1 _ds-tabs_oaddr_1",Ce="_tag_zm1dk_1 _ds-tag_oaddr_1",xe="__tooltip_zm1dk_1",Le="_validation_zm1dk_1 _ds-validation-message_oaddr_1",Ae="_body_zm1dk_127",g={alert:Yt,avatar:Kt,badge:Wt,breadcrumbs:qt,_onInjectCrumb:Xt,button:Gt,card:Qt,info:Jt,group:Zt,chip:te,details:ee,dialog:ne,divider:oe,errorsummary:ie,_errorsummary:se,field:ae,affixes:re,fieldset:le,heading:de,helptext:ce,input:ue,app:fe,grid:pe,flex:he,prose:me,link:_e,logo:ve,_onInjectLogo:be,pagination:ge,popover:ye,skeleton:Ee,_skeleton:$e,spinner:we,table:Te,_onInjectTable:Ie,_scrollShadow:ke,tabs:Se,tag:Ce,_tooltip:xe,validation:Le,body:Ae},Zn=Object.freeze(Object.defineProperty({__proto__:null,_errorsummary:se,_onInjectCrumb:Xt,_onInjectLogo:be,_onInjectTable:Ie,_scrollShadow:ke,_skeleton:$e,_tooltip:xe,affixes:re,alert:Yt,app:fe,avatar:Kt,badge:Wt,body:Ae,breadcrumbs:qt,button:Gt,card:Qt,chip:te,default:g,details:ee,dialog:ne,divider:oe,errorsummary:ie,field:ae,fieldset:le,flex:he,grid:pe,group:Zt,heading:de,helptext:ce,info:Jt,input:ue,link:_e,logo:ve,pagination:ge,popover:ye,prose:me,skeleton:Ee,spinner:we,table:Te,tabs:Se,tag:Ce,validation:Le},Symbol.toStringTag,{value:"Module"})),_=typeof window<"u"&&typeof document<"u",v={capture:!0,passive:!0};function to(t,e){let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>t(...o),e)}}function c(t,e,n){return n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}let eo=0;const no=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function N(t){return t.id||(t.id=`${no}${++eo}`),t.id}const oo=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,e[`${t}EventListener`](...n)},b=(t,...e)=>oo("add",t,e),q=new Map,$=_?document.createElement("div"):null;$&&c($,"style","position:absolute;padding:1px;top:0;left:0px"),_&&b(window,"load,resize,scroll",()=>{for(const[t,e]of q)e()},v);const C={top:0,right:1,bottom:2,left:3};function B(t,e,n){var Gn;if(e===!1||!e.isConnected||!t.isConnected)return q.delete(t);if($!=null&&$.isConnected||document.body.append($||""),!q.has(t)){const Hi=C[n]??C.bottom;return(Gn=q.set(t,()=>B(t,e,Hi)).get(t))==null?void 0:Gn()}const{offsetWidth:o,offsetHeight:i}=t,{offsetWidth:s,offsetHeight:a}=e,{width:r,height:d,left:l,top:f}=e.getBoundingClientRect(),h=Math.round(l-(s-r)/2),y=Math.round(f-(a-d)/2),T=h-o>0,jt=s+s+o<window.innerWidth,H=y-i>0,ft=y+a+i<window.innerHeight,m=n===C.bottom&&jt||!T,Y=n===C.bottom&&ft||!H,K=Math.min(Math.max(10,h-(o-s)/2),window.innerWidth-o-10),Vt=Math.min(Math.max(10,y-(i-a)/2),window.innerHeight-i-10),Xn=n===C.top||n===C.bottom;t.style.left=`${Math.round(Xn?K:m?h+s:h-o)}px`,t.style.top=`${Math.round(Xn?Y?y+a:y-i:Vt)}px`,$==null||$.style.setProperty("translate",`${Math.round(window.scrollX+h+s+o+30)} ${Math.round(window.scrollY+y+a+i+30)}px`)}function Oe(t){let e=0;const n=()=>setTimeout(o,200),o=()=>{t([],i),e=0},i=new MutationObserver(()=>{e||(e=requestAnimationFrame(n))});return i}const z=new WeakMap,io=t=>{var n;const e=z.get(t);if(!e||!t.isConnected)(n=e==null?void 0:e.observer)==null||n.disconnect(),z.delete(t);else for(const[,o]of e.collections)o()},Me=(t,e,n)=>{const o=t.getElementsByClassName(e);let i=z.get(t);i||(i={collections:new Map,observer:Oe(()=>io(t))},i.observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),z.set(t,i)),n?i.collections.set(e,()=>n(o)):i.collections.delete(e),i.collections.size||(i.observer.disconnect(),z.delete(t))},pt=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),so=g.breadcrumbs.split(" ")[0],De=_&&document.getElementsByClassName(so);function ao(t){if(!(!De||t.animationName!==g._onInjectCrumb))for(const e of De)e.querySelectorAll("li a").forEach((n,o,{length:i})=>{c(n,"aria-current",o===i-1?"page":null)})}_&&b(document,"animationend",to(ao,100),v);function ro(t){var n;if(t.animationName!==g._errorsummary)return;const e=(n=t.target)==null?void 0:n.firstElementChild;e instanceof HTMLHeadingElement&&(c(e,"tabindex","-1"),e.focus())}_&&b(document,"animationend",ro,v);const lo=g.dialog.split(" ")[0],co=_?document.getElementsByClassName(lo):[],Pe=t=>{t.stopImmediatePropagation(),t.stopPropagation()},uo=()=>{for(const t of co)t.matches('[open]:not([data-modal="false"]):not(:modal)')&&(t.addEventListener("close",Pe,v),t.close(),t.showModal(),window.requestAnimationFrame(()=>t.removeEventListener("close",Pe,v)))};_&&(b(document,"click",({clientX:t,clientY:e,target:n})=>{var o;if(n instanceof HTMLDialogElement&&c(n,"data-closedby")==="any"){const{top:i,right:s,bottom:a,left:r}=n.getBoundingClientRect();i<=e&&e<=a&&r<=t&&t<=s||n.close()}else n instanceof Element&&n.closest('button[data-command="close"]')&&((o=n==null?void 0:n.closest("dialog"))==null||o.close())},v),Oe(uo).observe(document.documentElement,{attributeFilter:["open"],attributes:!0,childList:!0,subtree:!0}));var fo=Object.defineProperty,Re=Object.getOwnPropertySymbols,po=Object.prototype.hasOwnProperty,ho=Object.prototype.propertyIsEnumerable,He=(t,e,n)=>e in t?fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,mo=(t,e)=>{for(var n in e||(e={}))po.call(e,n)&&He(t,n,e[n]);if(Re)for(var n of Re(e))ho.call(e,n)&&He(t,n,e[n]);return t},x=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",_o=x&&/android/i.test(navigator.userAgent),ht=x&&/iPad|iPhone|iPod/.test(navigator.userAgent),Ne=x&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Be;x&&/^Mac/i.test(((Be=navigator.userAgentData)==null?void 0:Be.platform)||navigator.platform);var vo=`${_o?"data":"aria"}-labelledby`,ze=`${Ne?"aria":"data"}-multiselectable`,Fe=":host(:not([hidden])) { display: block }",bo="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Ue=typeof HTMLElement>"u"?class{}:HTMLElement;function p(t,e,n){var o;return n===void 0?(o=t.getAttribute(e))!=null?o:null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var je=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},mt=(t,...e)=>je("add",t,e),_t=(t,...e)=>je("remove",t,e),Ve=(t,e)=>t.attachShadow({mode:"open"}).append(bt("slot"),bt("style",e)),X=new WeakMap,Ye=(t,e)=>{if(e===void 0)return X.get(t);try{X.get(t).disconnect(),X.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),X.set(t,n)}},Ke=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},go=0,vt=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++go).toString(32)}`),t.id):"",bt=(t,e,n)=>{const o=document.createElement(t);return e&&(o.textContent=e),o},We={define:(t,e)=>!x||window.customElements.get(t)||window.customElements.define(t,e)},yo=t=>{const e=bt("div");return e.style.cssText="position:fixed;overflow:hidden;width:1px;white-space:nowrap",p(e,"aria-live",t),e};function qe(t,e,n){if(!e)return Object.keys(t).map(i=>`data-sr-${i}`);const o=(e==null?void 0:e.startsWith("data-sr-"))&&e.slice(8);return o&&n&&t[o]&&(t[o]=n),[]}var gt="disabled",F="selected",Eo=class extends Ue{static get observedAttributes(){return[gt,F]}constructor(){super(),Ve(this,`${Fe}:host(:focus){${bo}}:host{ cursor: pointer }`)}connectedCallback(){ht||(this.tabIndex=-1),p(this,"role")||p(this,"role","option"),this.attributeChangedCallback()}attributeChangedCallback(){p(this,"aria-disabled",`${this.disabled}`),p(this,"aria-selected",`${this.selected}`)}get defaultSelected(){return this[F]}set defaultSelected(e){this[F]=e}get disabled(){return p(this,gt)!==null}set disabled(e){p(this,gt,e?"":null)}get form(){return this.closest("form")}get index(){var e;const n=(e=this.closest("u-datalist"))==null?void 0:e.getElementsByTagName("u-option");return Array.from(n||[this]).indexOf(this)}get label(){return p(this,"label")||this.text}set label(e){p(this,"label",e)}get selected(){return p(this,F)!==null}set selected(e){p(this,F,e?"":null)}get text(){var e;return((e=this.textContent)==null?void 0:e.trim())||""}set text(e){this.textContent=e}get value(){return p(this,"value")||this.text}set value(e){p(this,"value",e)}};We.define("u-option",Eo);var yt=!1,Xe,$o=0,L,wo=Ne&&!ht,Ge="click,focusout,input,keydown,mousedown,mouseup",Qe={singular:"%d hit",plural:"%d hits"},Je=class extends Ue{constructor(){super(),this._blurTimer=0,this._input=null,this._root=null,this._value="",this._texts=mo({},Qe),Ve(this,`${Fe}::slotted(u-option[disabled]) { display: none !important }`)}static get observedAttributes(){return["id",...qe(Qe)]}connectedCallback(){this.hidden=!0,this._root=Ke(this),L||(L=yo("assertive")),L.isConnected||document.body.appendChild(L),p(this,"role","listbox"),mt(this._root,"focusin",this),mt(this._root,"focus",this,!0),setTimeout(()=>this.attributeChangedCallback())}disconnectedCallback(){_t(this._root||this,"focus",this,!0),_t(this._root||this,"focusin",this),Et(this),this._root=null}attributeChangedCallback(e,n,o){var i;qe(this._texts,e,o);const s=(i=this._root)==null?void 0:i.querySelectorAll(`input[list="${this.id}"]`);for(const a of s||[])tn(this,a)}handleEvent(e){const{type:n}=e;e.defaultPrevented||(n==="click"&&ko(this,e),(n==="focus"||n==="focusin")&&To(this,e),n==="focusout"&&Io(this),n==="keydown"&&So(this,e),(n==="mutation"||n==="input")&&nn(this,e),n==="mouseup"&&(yt=!1),n==="mousedown"&&(yt=this.contains(e.target)))}get options(){return this.getElementsByTagName("u-option")}},To=(t,{target:e})=>{var n;const o=t._input===e;if(o||t.contains(e))return clearTimeout(t._blurTimer);!o&&e instanceof HTMLInputElement&&p(e,"list")===t.id&&(t._input&&Et(t),t._input=e,p(t,vo,vt((n=t._input.labels)==null?void 0:n[0])),mt(t._root||t,Ge,t),Ye(t,{attributeFilter:["value"],attributes:!0,childList:!0,subtree:!0}),A(t,!0))},Io=t=>{yt||(t._blurTimer=setTimeout(()=>Et(t)))},ko=(t,{target:e})=>{var n,o,i,s,a;const r=p(t,ze)!=="true",d=[...t.options].find(l=>l.contains(e));if(t._input===e)A(t,!0);else if(d&&G(d)){for(const l of t.options)l===d?l.selected=!0:r&&(l.selected=!1);(o=(n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:n.set)==null||o.call(t._input,d.value),r&&((i=t._input)==null||i.focus(),A(t,!1)),(s=t._input)==null||s.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),(a=t._input)==null||a.dispatchEvent(new Event("change",{bubbles:!0}))}},So=(t,e)=>{var n,o;if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;e.key!=="Escape"&&A(t,!0);const{key:i}=e,s=(n=t._root)==null?void 0:n.activeElement,a=Ze(t),r=a.indexOf(s);let d=-1;if(i==="ArrowDown"&&(d=(r+1)%a.length),i==="ArrowUp"&&(d=(~r?r:a.length)-1),~r&&((i==="Home"||i==="PageUp")&&(d=0),(i==="End"||i==="PageDown")&&(d=a.length-1),i==="Enter"))return a[r].click(),e.preventDefault();if(a[d])for(const l of a)l.tabIndex=-1;a[d]&&e.preventDefault(),(o=a[d]||t._input)==null||o.focus(),i==="Escape"&&A(t,!1)},A=(t,e)=>{t.hidden=!e,t.popover&&t.togglePopover(e),t._input&&tn(t,t._input,e),e&&nn(t)},Et=t=>{_t(t._root||t,Ge,t),Ye(t,!1),A(t,!1),t._input=null},Ze=t=>[...t.options].filter(e=>!e.disabled&&e.offsetWidth&&e.offsetHeight),G=t=>t instanceof HTMLOptionElement||t.getAttribute("role")==="option",tn=(t,e,n=!1)=>{p(e,"popovertarget",vt(t)),p(e,"aria-autocomplete","list"),p(e,"aria-controls",vt(t)),p(e,"aria-expanded",`${wo||n}`),p(e,"autocomplete","off"),p(e,"role","combobox")},en=t=>(t==null?void 0:t.toLowerCase().trim())||"",nn=(t,e)=>{var n;const o=en((n=t._input)==null?void 0:n.value);if(!((e==null?void 0:e.type)==="mutation"||t._value!==o))return;const s=t.hidden,a=p(t,ze)!=="true",r=e instanceof InputEvent&&!Lo(e);t.hidden=!0,t._value=o;for(const l of t.options){const f=[l.value,l.label,l.text].map(en);l.hidden=!f.some(h=>h.includes(o)),a&&r&&G(l)&&(l.selected=f.includes(o))}t.hidden=s;const d=Ze(t);clearTimeout(Xe),Xe=setTimeout(()=>{const{length:l}=d.filter(G),f=++$o%2?" ":"",h=`${`${t._texts[l===1?"singular":"plural"]}`.replace("%d",`${l}`)}`;L&&(L.textContent=`${!l&&t.innerText.trim()||h}${f}`)},1e3),ht&&d.map((l,f,h)=>{l.title=`${f+1}/${h}`})};x&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){return Ke(this).getElementById(p(this,"list")||"")}}),We.define("u-datalist",Je);var Co=" ".repeat(100),xo="insertReplacementText";function Lo(t){var e;const n=t instanceof Event&&t.type==="input"&&t.target instanceof HTMLInputElement&&(!t.inputType||t.inputType===xo);if(n){const o=t.target.value,i=Array.from(((e=t.target.list)==null?void 0:e.options)||[]).some(s=>s.value===o&&!G(s));t.target.value=o.split(Co)[i?1:0]}return n}const on=g.field.split(" ")[0],Ao="--mtds-text-count-over",Oo="--mtds-text-count-under",sn=g.validation.split(" "),Mo=sn[0];function Do(t){for(const e of t){const n=[],o=[];let i=null,s=null,a=!0;for(const r of e.getElementsByTagName("*"))r instanceof HTMLLabelElement?n.push(r):r instanceof Je?s=r:pt(r)?i=r:r.classList.contains(Mo)?(a=c(r,"data-color")==="success",o.unshift(N(r))):r instanceof HTMLParagraphElement&&o.push(N(r));if(i){for(const r of n)r.htmlFor=N(i);Po(i,s),rn(i),an(i),c(i,"aria-describedby",o.join(" ")),c(i,"aria-invalid",`${!a}`)}}}function an(t){t instanceof HTMLTextAreaElement&&(t.style.setProperty("--mtds-textarea-height","auto"),t.style.setProperty("--mtds-textarea-height",`${t.scrollHeight}px`))}function Po(t,e){if(c(t,"list",e?N(e):null),!e)return;t.hasAttribute("placeholder")||c(t,"placeholder","");const n=window.getComputedStyle(e),o=t.closest("u-tags"),i=s=>n.getPropertyValue(`--mtds-text-${s}`);c(e,"data-sr-plural",i("datalist-plural")),c(e,"data-sr-singular",i("datalist-singular")),o&&(c(o,"data-sr-added",i("tags-added")),c(o,"data-sr-empty",i("tags-empty")),c(o,"data-sr-found",i("tags-found")),c(o,"data-sr-of",i("tags-of")),c(o,"data-sr-remove",i("tags-remove")),c(o,"data-sr-removed",i("tags-removed")))}function rn(t){var o,i;const e=t==null?void 0:t.nextElementSibling,n=e&&c(e,"data-count");if(e&&n){const s=Number(n)-t.value.length,a=s<0,r=c(e,"aria-live")==="polite",d=window.getComputedStyle(e||t),l=((o=d.getPropertyValue(Ao))==null?void 0:o.slice(1,-1))||"",f=((i=d.getPropertyValue(Oo))==null?void 0:i.slice(1,-1))||"";if(r!==a){c(e,"aria-live",a?"polite":"off");for(const h of sn)e.classList.toggle(h,a)}e.textContent=(a?l:f).replace("%d",`${Math.abs(s)}`)}}function Ro({target:t}){pt(t)&&(rn(t),an(t))}function Ho(t){var e,n;(n=(e=t.target)==null?void 0:e.closest)!=null&&n.call(e,`.${on}`)&&t.preventDefault()}_&&(Me(document.documentElement,on,Do),b(document,"input",Ro,v),b(document,"invalid",Ho,!0));const No=g.fieldset.split(" ")[0],Bo=g.validation.split(" ")[0];function zo(t){for(const e of t){const n=[];let o=null;for(const i of e.getElementsByTagName("*"))i.classList.contains(Bo)?o=N(i):pt(i)&&n.push(i);for(const i of n)c(i,"aria-describedby",o),c(i,"aria-invalid",`${!!o}`)}}_&&Me(document.documentElement,No,zo);const $t="--mtds-app-expanded",ln="mtds-app-menu",Fo=({target:t})=>{t!=null&&t.closest('[data-command="toggle-app-expanded"]')&&(document.startViewTransition?document.startViewTransition(()=>Tt(!wt())):Tt(!wt()))},wt=()=>{var t;return!((t=document.documentElement.style.getPropertyValue($t))!=null&&t.includes("--false"))},Tt=t=>{document.documentElement.style.setProperty($t,`var(${$t}--${t})`),window.localStorage.setItem(ln,`${t}`)};if(_){const t=window.localStorage.getItem(ln);Tt(t?t==="true":wt()),b(document,"click",Fo,v)}let It;function Uo(t){if(t.animationName!==g._onInjectLogo)return;const e=t.target,n=e==null?void 0:e.firstElementChild;if(!n)return;if(!It){const r=document.head.getElementsByTagName("link[rel~='icon']"),d=document.createElement("link");for(const l of r)l.remove();It=document.head.appendChild(Object.assign(d,{rel:"icon"}))}const o=e==null?void 0:e.hasAttribute("data-env"),i=window.getComputedStyle(n),s=i.getPropertyValue("color"),a=i.getPropertyValue("--mtds-logo-color");It.href=`data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${o?"none":a}' width='51' height='51' x='2' y='2' stroke='${s}' stroke-dasharray='0.09 6.38' stroke-linecap='round' stroke-opacity='${o?.6:0}' stroke-width='2.3' rx='25.5'/><g transform="translate(7.5 7.5)">${n.outerHTML.replace(/(fill|width|height|xmlns)=\S+/gi,"").replace("<svg",`<svg width="40" height="40" fill="${s}"`)}</g></svg>`)}`}_&&b(document,"animationend",Uo,v);const dn=g.popover.split(" ")[0];function jo({target:t,newState:e}){var n;if(t instanceof HTMLElement&&t.classList.contains(dn)){const o=(n=t.getRootNode())==null?void 0:n.querySelector(`[popovertarget="${t.id}"]`);e==="closed"?B(t,!1):o&&B(t,o,c(t,"data-position")||"bottom")}}function Vo({target:t}){var n,o;const e=(n=t==null?void 0:t.closest)==null?void 0:n.call(t,"a");if(e){const i=e.getRootNode(),s=((o=i.getElementById)==null?void 0:o.call(i,c(e,"popovertarget")||""))||e.closest(`.${dn}`),a=c(e,"popovertargetaction")||"toggle";s==null||s.togglePopover(a==="show"||(a==="hide"?!1:void 0))}}_&&(b(document,"beforetoggle",jo,v),b(document,"click",Vo));function Yo(t){if(t.animationName!==g._onInjectTable)return;const e=t.target,n=[];c(e,"role","table"),e.caption&&c(e.caption,"role","caption");for(const o of[e.tHead,e.tFoot,...e.tBodies])if(o){c(o,"role","rowgroup");const i=o.nodeName==="TBODY";for(const s of o.rows){c(s,"role","row");for(const a of s.cells)i?c(a,"data-th",n[a.cellIndex]||":empty"):n.push(a.innerText.trim()),a.nodeName==="TD"?c(a,"role","cell"):(c(a,"role",i?"rowheader":"columnheader"),c(a,"scope",i?"row":"col"))}}}_&&b(document,"animationend",Yo,v);const cn="aria-describedby",un="Escape",Q="aria-labelledby",Ko="--mtds-tooltip-position",Wo=300,kt="mtds-tooltip";let w=null,fn=Number.NEGATIVE_INFINITY,pn=0,I=null;const qo=()=>Object.assign(document.createElement("div"),{className:g._tooltip,id:kt,popover:"manual"});function St({target:t,type:e,key:n}){if(e==="keydown"&&n!==un)return;const o=fn+Wo-Date.now();clearTimeout(pn),pn=setTimeout(Xo,Math.max(o,0),n===un?null:t)}function Xo(t){var r,d;if(fn=Date.now(),I||(I=document.body.appendChild(qo())),t===I)return;let e=((r=t==null?void 0:t.closest)==null?void 0:r.call(t,"[data-tooltip]"))||null;if(e===w)return;const n=e&&c(e,"data-tooltip")||"",o=e&&c(e,"data-tooltip-position")||((d=window.getComputedStyle(e||document.body).getPropertyValue(Ko))==null?void 0:d.trim())||"top";(!n||n==="false"||n==="true"||o==="none")&&(e=null),e&&(I.textContent=n);const s=w&&c(w,Q)===kt,a=!!(e!=null&&e.innerText.trim())||(e==null?void 0:e.hasAttribute(Q))||(e==null?void 0:e.hasAttribute("aria-label"));w==null||w.removeAttribute(s?Q:cn),B(I,!1),w=e,w&&c(w,a?cn:Q,kt),I.togglePopover(!!e),B(I,e||!1,o)}_&&(b(document,"blur,focus,mouseout,mouseover",St,v),b(window,"keydown",St,v),b(window,"blur",St,v));var hn=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",mn;hn&&/^Mac/i.test(((mn=navigator.userAgentData)==null?void 0:mn.platform)||navigator.platform);var Go=":host(:not([hidden])) { display: block }",_n=typeof HTMLElement>"u"?class{}:HTMLElement;function k(t,e,n){var o;return n===void 0?(o=t.getAttribute(e))!=null?o:null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var vn=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},bn=(t,...e)=>vn("add",t,e),gn=(t,...e)=>vn("remove",t,e),Qo=t=>{const e="key"in t&&(t.key===" "||t.key==="Enter");return e&&t.preventDefault(),e&&t.target instanceof HTMLElement&&t.target.click(),e},Jo=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Ct=(t,e,n)=>{const o=document.createElement(t);if(e&&(o.textContent=e),n)for(const[i,s]of Object.entries(n))k(o,i,s);return o},yn={define:(t,e)=>!hn||window.customElements.get(t)||window.customElements.define(t,e)},Zo=class extends _n{constructor(){super(),this._content=null,this.attachShadow({mode:"open"}).append(Ct("slot",null,{name:"summary"}),Ct("slot",null,{part:"details-content"}),Ct("style",`${Go}
1
+ var mtds=function(X){"use strict";var Gn;const Zn=(t,e,n)=>{const o=(n-1)/2,i=Math.max(Math.min(t-Math.floor(o),e-n+1),1),s=Math.min(Math.max(t+Math.ceil(o),n),e),a=Array.from({length:s+1-i},(r,c)=>c+i);return n>4&&i>1&&a.splice(0,2,1,0),n>3&&s<e&&a.splice(-2,2,0,e),a},to=({current:t=1,total:e=10,show:n=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:Zn(t,e,n).map((o,i)=>({current:o===t&&"page",key:`key-${o}-${i}`,page:o}))}),Wt="_alert_1nbm3_1 _ds-alert_oaddr_1",Yt="_avatar_1nbm3_1 _ds-avatar_oaddr_1",qt="_badge_1nbm3_1",Xt="_breadcrumbs_1nbm3_1 _ds-breadcrumbs_oaddr_1",zt="__onInjectCrumb_1nbm3_1",Gt="_button_1nbm3_1 _ds-button_oaddr_1",Qt="_card_1nbm3_1",Jt="_info_1nbm3_1",Zt="_group_1nbm3_1",te="_chip_1nbm3_1 _ds-chip_oaddr_1",ee="_details_1nbm3_1 _ds-details_oaddr_1",ne="_dialog_1nbm3_1 _ds-dialog_oaddr_1",oe="_divider_1nbm3_1",ie="_errorsummary_1nbm3_1 _ds-error-summary_oaddr_1",se="__errorsummary_1nbm3_1",ae="_field_1nbm3_1 _ds-field_oaddr_1",re="_affixes_1nbm3_1 _ds-field-affixes_oaddr_1",le="_fieldset_1nbm3_1 _ds-fieldset_oaddr_1",ce="_heading_1nbm3_1 _ds-heading_oaddr_1",de="_helptext_1nbm3_1 _ds-focus_oaddr_1",ue="_input_1nbm3_1 _ds-input_oaddr_1",fe="_app_1nbm3_1",pe="_grid_1nbm3_1",he="_flex_1nbm3_1",me="_prose_1nbm3_1",_e="_link_1nbm3_1",be="_logo_1nbm3_1",ve="__onInjectLogo_1nbm3_1",ge="_pagination_1nbm3_1 _ds-pagination_oaddr_1",ye="_popover_1nbm3_1",Ee="_skeleton_1nbm3_1 _ds-skeleton_oaddr_1",$e="__skeleton_1nbm3_1",we="_spinner_1nbm3_1",Te="_table_1nbm3_1 _ds-table_oaddr_1",Ie="__onInjectTable_1nbm3_1",Se="__scrollShadow_1nbm3_1",Ce="_tabs_1nbm3_1 _ds-tabs_oaddr_1",xe="_tag_1nbm3_1 _ds-tag_oaddr_1",Le="__tooltip_1nbm3_1",Ae="_validation_1nbm3_1 _ds-validation-message_oaddr_1",ke="_body_1nbm3_133",_={alert:Wt,avatar:Yt,badge:qt,breadcrumbs:Xt,_onInjectCrumb:zt,button:Gt,card:Qt,info:Jt,group:Zt,chip:te,details:ee,dialog:ne,divider:oe,errorsummary:ie,_errorsummary:se,field:ae,affixes:re,fieldset:le,heading:ce,helptext:de,input:ue,app:fe,grid:pe,flex:he,prose:me,link:_e,logo:be,_onInjectLogo:ve,pagination:ge,popover:ye,skeleton:Ee,_skeleton:$e,spinner:we,table:Te,_onInjectTable:Ie,_scrollShadow:Se,tabs:Ce,tag:xe,_tooltip:Le,validation:Ae,body:ke},eo=Object.freeze(Object.defineProperty({__proto__:null,_errorsummary:se,_onInjectCrumb:zt,_onInjectLogo:ve,_onInjectTable:Ie,_scrollShadow:Se,_skeleton:$e,_tooltip:Le,affixes:re,alert:Wt,app:fe,avatar:Yt,badge:qt,body:ke,breadcrumbs:Xt,button:Gt,card:Qt,chip:te,default:_,details:ee,dialog:ne,divider:oe,errorsummary:ie,field:ae,fieldset:le,flex:he,grid:pe,group:Zt,heading:ce,helptext:de,info:Jt,input:ue,link:_e,logo:be,pagination:ge,popover:ye,prose:me,skeleton:Ee,spinner:we,table:Te,tabs:Ce,tag:xe,validation:Ae},Symbol.toStringTag,{value:"Module"})),b=typeof window<"u"&&typeof document<"u",v={capture:!0,passive:!0};function no(t,e){let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>t(...o),e)}}function d(t,e,n){return n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}let oo=0;const io=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function N(t){return t.id||(t.id=`${io}${++oo}`),t.id}const so=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,e[`${t}EventListener`](...n)},g=(t,...e)=>so("add",t,e),z=new Map,w=b?document.createElement("div"):null;w&&d(w,"style","position:absolute;padding:1px;top:0;left:0px"),b&&g(window,"load,resize,scroll",()=>{for(const[t,e]of z)e()},v);const x={top:0,right:1,bottom:2,left:3};function B(t,e,n){var Jn;if(e===!1||!e.isConnected||!t.isConnected)return z.delete(t);if(w!=null&&w.isConnected||document.body.append(w||""),!z.has(t)){const ji=x[n]??x.bottom;return(Jn=z.set(t,()=>B(t,e,ji)).get(t))==null?void 0:Jn()}const o=e instanceof HTMLElement,{offsetWidth:i,offsetHeight:s}=t,a=o?e.offsetWidth:e.clientWidth,r=o?e.offsetHeight:e.clientHeight,{width:c,height:l,left:f,top:h}=e.getBoundingClientRect(),$=Math.round(f-(a-c)/2),y=Math.round(h-(r-l)/2),jt=$-i>0,H=a+a+i<window.innerWidth,pt=y-s>0,m=y+r+s<window.innerHeight,Y=n===x.bottom&&H||!jt,q=n===x.bottom&&m||!pt,Kt=Math.min(Math.max(10,$-(i-a)/2),window.innerWidth-i-10),Vi=Math.min(Math.max(10,y-(s-r)/2),window.innerHeight-s-10),Qn=n===x.top||n===x.bottom;t.style.left=`${Math.round(Qn?Kt:Y?$+a:$-i)}px`,t.style.top=`${Math.round(Qn?q?y+r:y-s:Vi)}px`,w==null||w.style.setProperty("translate",`${Math.round(window.scrollX+$+a+i+30)} ${Math.round(window.scrollY+y+r+s+30)}px`)}function Oe(t){let e=0;const n=()=>setTimeout(o,200),o=()=>{t([],i),e=0},i=new MutationObserver(()=>{e||(e=requestAnimationFrame(n))});return i}const F=new WeakMap,ao=t=>{var n;const e=F.get(t);if(!e||!t.isConnected)(n=e==null?void 0:e.observer)==null||n.disconnect(),F.delete(t);else for(const[,o]of e.collections)o()},Me=(t,e,n)=>{const o=t.getElementsByClassName(e);let i=F.get(t);i||(i={collections:new Map,observer:Oe(()=>ao(t))},i.observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),F.set(t,i)),n?i.collections.set(e,()=>n(o)):i.collections.delete(e),i.collections.size||(i.observer.disconnect(),F.delete(t))},ht=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),ro=_.breadcrumbs.split(" ")[0],De=b&&document.getElementsByClassName(ro);function lo(t){if(!(!De||t.animationName!==_._onInjectCrumb))for(const e of De)e.querySelectorAll("li a").forEach((n,o,{length:i})=>{d(n,"aria-current",o===i-1?"page":null)})}b&&g(document,"animationend",no(lo,100),v);function co(t){var n;if(t.animationName!==_._errorsummary)return;const e=(n=t.target)==null?void 0:n.firstElementChild;e instanceof HTMLHeadingElement&&(d(e,"tabindex","-1"),e.focus())}b&&g(document,"animationend",co,v);const uo=_.dialog.split(" ")[0],fo=b?document.getElementsByClassName(uo):[],Pe=t=>{t.stopImmediatePropagation(),t.stopPropagation()},po=()=>{for(const t of fo)t.matches('[open]:not([data-modal="false"]):not(:modal)')&&(t.addEventListener("close",Pe,v),t.close(),t.showModal(),window.requestAnimationFrame(()=>t.removeEventListener("close",Pe,v)))};b&&(g(document,"click",({clientX:t,clientY:e,target:n})=>{var o;if(n instanceof HTMLDialogElement&&d(n,"data-closedby")==="any"){const{top:i,right:s,bottom:a,left:r}=n.getBoundingClientRect();i<=e&&e<=a&&r<=t&&t<=s||n.close()}else n instanceof Element&&n.closest('button[data-command="close"]')&&((o=n==null?void 0:n.closest("dialog"))==null||o.close())},v),Oe(po).observe(document.documentElement,{attributeFilter:["open"],attributes:!0,childList:!0,subtree:!0}));var ho=Object.defineProperty,Re=Object.getOwnPropertySymbols,mo=Object.prototype.hasOwnProperty,_o=Object.prototype.propertyIsEnumerable,He=(t,e,n)=>e in t?ho(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,bo=(t,e)=>{for(var n in e||(e={}))mo.call(e,n)&&He(t,n,e[n]);if(Re)for(var n of Re(e))_o.call(e,n)&&He(t,n,e[n]);return t},L=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",vo=L&&/android/i.test(navigator.userAgent),mt=L&&/iPad|iPhone|iPod/.test(navigator.userAgent),Ne=L&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Be;L&&/^Mac/i.test(((Be=navigator.userAgentData)==null?void 0:Be.platform)||navigator.platform);var go=`${vo?"data":"aria"}-labelledby`,Fe=`${Ne?"aria":"data"}-multiselectable`,Ue=":host(:not([hidden])) { display: block }",yo="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Ve=typeof HTMLElement>"u"?class{}:HTMLElement;function p(t,e,n){var o;return n===void 0?(o=t.getAttribute(e))!=null?o:null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var je=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},_t=(t,...e)=>je("add",t,e),bt=(t,...e)=>je("remove",t,e),Ke=(t,e)=>t.attachShadow({mode:"open"}).append(gt("slot"),gt("style",e)),G=new WeakMap,We=(t,e)=>{if(e===void 0)return G.get(t);try{G.get(t).disconnect(),G.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),G.set(t,n)}},Ye=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Eo=0,vt=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++Eo).toString(32)}`),t.id):"",gt=(t,e,n)=>{const o=document.createElement(t);return e&&(o.textContent=e),o},qe={define:(t,e)=>!L||window.customElements.get(t)||window.customElements.define(t,e)},$o=t=>{const e=gt("div");return e.style.cssText="position:fixed;overflow:hidden;width:1px;white-space:nowrap",p(e,"aria-live",t),e};function Xe(t,e,n){if(!e)return Object.keys(t).map(i=>`data-sr-${i}`);const o=(e==null?void 0:e.startsWith("data-sr-"))&&e.slice(8);return o&&n&&t[o]&&(t[o]=n),[]}var yt="disabled",U="selected",wo=class extends Ve{static get observedAttributes(){return[yt,U]}constructor(){super(),Ke(this,`${Ue}:host(:focus){${yo}}:host{ cursor: pointer }`)}connectedCallback(){mt||(this.tabIndex=-1),p(this,"role")||p(this,"role","option"),this.attributeChangedCallback()}attributeChangedCallback(){p(this,"aria-disabled",`${this.disabled}`),p(this,"aria-selected",`${this.selected}`)}get defaultSelected(){return this[U]}set defaultSelected(e){this[U]=e}get disabled(){return p(this,yt)!==null}set disabled(e){p(this,yt,e?"":null)}get form(){return this.closest("form")}get index(){var e;const n=(e=this.closest("u-datalist"))==null?void 0:e.getElementsByTagName("u-option");return Array.from(n||[this]).indexOf(this)}get label(){return p(this,"label")||this.text}set label(e){p(this,"label",e)}get selected(){return p(this,U)!==null}set selected(e){p(this,U,e?"":null)}get text(){var e;return((e=this.textContent)==null?void 0:e.trim())||""}set text(e){this.textContent=e}get value(){return p(this,"value")||this.text}set value(e){p(this,"value",e)}};qe.define("u-option",wo);var Et=!1,ze,To=0,A,Io=Ne&&!mt,Ge="click,focusout,input,keydown,mousedown,mouseup",Qe={singular:"%d hit",plural:"%d hits"},Je=class extends Ve{constructor(){super(),this._blurTimer=0,this._input=null,this._root=null,this._value="",this._texts=bo({},Qe),Ke(this,`${Ue}::slotted(u-option[disabled]) { display: none !important }`)}static get observedAttributes(){return["id",...Xe(Qe)]}connectedCallback(){this.hidden=!0,this._root=Ye(this),A||(A=$o("assertive")),A.isConnected||document.body.appendChild(A),p(this,"role","listbox"),_t(this._root,"focusin",this),_t(this._root,"focus",this,!0),setTimeout(()=>this.attributeChangedCallback())}disconnectedCallback(){bt(this._root||this,"focus",this,!0),bt(this._root||this,"focusin",this),$t(this),this._root=null}attributeChangedCallback(e,n,o){var i;Xe(this._texts,e,o);const s=(i=this._root)==null?void 0:i.querySelectorAll(`input[list="${this.id}"]`);for(const a of s||[])tn(this,a)}handleEvent(e){const{type:n}=e;e.defaultPrevented||(n==="click"&&xo(this,e),(n==="focus"||n==="focusin")&&So(this,e),n==="focusout"&&Co(this),n==="keydown"&&Lo(this,e),(n==="mutation"||n==="input")&&nn(this,e),n==="mouseup"&&(Et=!1),n==="mousedown"&&(Et=this.contains(e.target)))}get options(){return this.getElementsByTagName("u-option")}},So=(t,{target:e})=>{var n;const o=t._input===e;if(o||t.contains(e))return clearTimeout(t._blurTimer);!o&&e instanceof HTMLInputElement&&p(e,"list")===t.id&&(t._input&&$t(t),t._input=e,p(t,go,vt((n=t._input.labels)==null?void 0:n[0])),_t(t._root||t,Ge,t),We(t,{attributeFilter:["value"],attributes:!0,childList:!0,subtree:!0}),k(t,!0))},Co=t=>{Et||(t._blurTimer=setTimeout(()=>$t(t)))},xo=(t,{target:e})=>{var n,o,i,s,a;const r=p(t,Fe)!=="true",c=[...t.options].find(l=>l.contains(e));if(t._input===e)k(t,!0);else if(c&&Q(c)){for(const l of t.options)l===c?l.selected=!0:r&&(l.selected=!1);(o=(n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:n.set)==null||o.call(t._input,c.value),r&&((i=t._input)==null||i.focus(),k(t,!1)),(s=t._input)==null||s.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),(a=t._input)==null||a.dispatchEvent(new Event("change",{bubbles:!0}))}},Lo=(t,e)=>{var n,o;if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;e.key!=="Escape"&&k(t,!0);const{key:i}=e,s=(n=t._root)==null?void 0:n.activeElement,a=Ze(t),r=a.indexOf(s);let c=-1;if(i==="ArrowDown"&&(c=(r+1)%a.length),i==="ArrowUp"&&(c=(~r?r:a.length)-1),~r&&((i==="Home"||i==="PageUp")&&(c=0),(i==="End"||i==="PageDown")&&(c=a.length-1),i==="Enter"))return a[r].click(),e.preventDefault();if(a[c])for(const l of a)l.tabIndex=-1;a[c]&&e.preventDefault(),(o=a[c]||t._input)==null||o.focus(),i==="Escape"&&k(t,!1)},k=(t,e)=>{t.hidden=!e,t.popover&&t.togglePopover(e),t._input&&tn(t,t._input,e),e&&nn(t)},$t=t=>{bt(t._root||t,Ge,t),We(t,!1),k(t,!1),t._input=null},Ze=t=>[...t.options].filter(e=>!e.disabled&&e.offsetWidth&&e.offsetHeight),Q=t=>t instanceof HTMLOptionElement||t.getAttribute("role")==="option",tn=(t,e,n=!1)=>{p(e,"popovertarget",vt(t)),p(e,"aria-autocomplete","list"),p(e,"aria-controls",vt(t)),p(e,"aria-expanded",`${Io||n}`),p(e,"autocomplete","off"),p(e,"role","combobox")},en=t=>(t==null?void 0:t.toLowerCase().trim())||"",nn=(t,e)=>{var n;const o=en((n=t._input)==null?void 0:n.value);if(!((e==null?void 0:e.type)==="mutation"||t._value!==o))return;const s=t.hidden,a=p(t,Fe)!=="true",r=e instanceof InputEvent&&!Oo(e);t.hidden=!0,t._value=o;for(const l of t.options){const f=[l.value,l.label,l.text].map(en);l.hidden=!f.some(h=>h.includes(o)),a&&r&&Q(l)&&(l.selected=f.includes(o))}t.hidden=s;const c=Ze(t);clearTimeout(ze),ze=setTimeout(()=>{const{length:l}=c.filter(Q),f=++To%2?" ":"",h=`${`${t._texts[l===1?"singular":"plural"]}`.replace("%d",`${l}`)}`;A&&(A.textContent=`${!l&&t.innerText.trim()||h}${f}`)},1e3),mt&&c.map((l,f,h)=>{l.title=`${f+1}/${h}`})};L&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){return Ye(this).getElementById(p(this,"list")||"")}}),qe.define("u-datalist",Je);var Ao=" ".repeat(100),ko="insertReplacementText";function Oo(t){var e;const n=t instanceof Event&&t.type==="input"&&t.target instanceof HTMLInputElement&&(!t.inputType||t.inputType===ko);if(n){const o=t.target.value,i=Array.from(((e=t.target.list)==null?void 0:e.options)||[]).some(s=>s.value===o&&!Q(s));t.target.value=o.split(Ao)[i?1:0]}return n}const on=_.field.split(" ")[0],Mo="--mtds-text-count-over",Do="--mtds-text-count-under",sn=_.validation.split(" "),Po=sn[0];function Ro(t){for(const e of t){const n=[],o=[];let i=null,s=null,a=!0;for(const r of e.getElementsByTagName("*"))r instanceof HTMLLabelElement?n.push(r):r instanceof Je?s=r:ht(r)?i=r:r.classList.contains(Po)?(a=d(r,"data-color")==="success",o.unshift(N(r))):r instanceof HTMLParagraphElement&&o.push(N(r));if(i){for(const r of n)r.htmlFor=N(i);Ho(i,s),rn(i),an(i),d(i,"aria-describedby",o.join(" ")),d(i,"aria-invalid",`${!a}`)}}}function an(t){t instanceof HTMLTextAreaElement&&(t.style.setProperty("--mtds-textarea-height","auto"),t.style.setProperty("--mtds-textarea-height",`${t.scrollHeight}px`))}function Ho(t,e){if(d(t,"list",e?N(e):null),!e)return;t.hasAttribute("placeholder")||d(t,"placeholder","");const n=window.getComputedStyle(e),o=t.closest("u-tags"),i=s=>n.getPropertyValue(`--mtds-text-${s}`);d(e,"data-sr-plural",i("datalist-plural")),d(e,"data-sr-singular",i("datalist-singular")),o&&(d(o,"data-sr-added",i("tags-added")),d(o,"data-sr-empty",i("tags-empty")),d(o,"data-sr-found",i("tags-found")),d(o,"data-sr-of",i("tags-of")),d(o,"data-sr-remove",i("tags-remove")),d(o,"data-sr-removed",i("tags-removed")))}function rn(t){var o,i;const e=t==null?void 0:t.nextElementSibling,n=e&&d(e,"data-count");if(e&&n){const s=Number(n)-t.value.length,a=s<0,r=d(e,"aria-live")==="polite",c=window.getComputedStyle(e||t),l=((o=c.getPropertyValue(Mo))==null?void 0:o.slice(1,-1))||"",f=((i=c.getPropertyValue(Do))==null?void 0:i.slice(1,-1))||"";if(r!==a){d(e,"aria-live",a?"polite":"off");for(const h of sn)e.classList.toggle(h,a)}e.textContent=(a?l:f).replace("%d",`${Math.abs(s)}`)}}function No({target:t}){ht(t)&&(rn(t),an(t))}function Bo(t){var e,n;(n=(e=t.target)==null?void 0:e.closest)!=null&&n.call(e,`.${on}`)&&t.preventDefault()}b&&(Me(document.documentElement,on,Ro),g(document,"input",No,v),g(document,"invalid",Bo,!0));const Fo=_.fieldset.split(" ")[0],Uo=_.validation.split(" ")[0];function Vo(t){for(const e of t){const n=[];let o=null;for(const i of e.getElementsByTagName("*"))i.classList.contains(Uo)?o=N(i):ht(i)&&n.push(i);for(const i of n)d(i,"aria-describedby",o),d(i,"aria-invalid",`${!!o}`)}}b&&Me(document.documentElement,Fo,Vo);const jo=960,V=b?new CSSStyleSheet:null,Ko=`.${_.app} > nav, .${_.app} nav:has(+ main)`,Wo='[data-command="toggle-app-expanded"]',ln="--mtds-app-expanded",cn="mtds-app-menu",Yo=t=>{t.target instanceof Element&&(t.target.closest(Wo)&&(t.preventDefault(),document.startViewTransition?document.startViewTransition(()=>Tt(!wt())):Tt(!wt())),window.innerWidth<=jo&&t.target.matches(Ko)&&console.log(t.target))},wt=()=>window.localStorage.getItem(cn)!=="false",Tt=t=>{V==null||V.replaceSync(`:root { ${ln}: var(${ln}--${t}) }`),window.localStorage.setItem(cn,`${t}`)};b&&(V&&((Gn=document.adoptedStyleSheets)==null||Gn.push(V)),Tt(wt()),g(document,"click",Yo,v));let It;function qo(t){if(t.animationName!==_._onInjectLogo)return;const e=t.target,n=e==null?void 0:e.firstElementChild;if(!n)return;if(!It){const r=document.head.getElementsByTagName("link[rel~='icon']"),c=document.createElement("link");for(const l of r)l.remove();It=document.head.appendChild(Object.assign(c,{rel:"icon"}))}const o=e==null?void 0:e.hasAttribute("data-env"),i=window.getComputedStyle(n),s=i.getPropertyValue("color"),a=i.getPropertyValue("--mtds-logo-color");It.href=`data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${o?"none":a}' width='51' height='51' x='2' y='2' stroke='${s}' stroke-dasharray='0.09 6.38' stroke-linecap='round' stroke-opacity='${o?.6:0}' stroke-width='2.3' rx='25.5'/><g transform="translate(7.5 7.5)">${n.outerHTML.replace(/(fill|width|height|xmlns)=\S+/gi,"").replace("<svg",`<svg width="40" height="40" fill="${s}"`)}</g></svg>`)}`}b&&g(document,"animationend",qo,v);const dn=_.popover.split(" ")[0];function Xo({target:t,newState:e}){var n;if(t instanceof HTMLElement&&t.classList.contains(dn)){const o=(n=t.getRootNode())==null?void 0:n.querySelector(`[popovertarget="${t.id}"]`);e==="closed"?B(t,!1):o&&B(t,o,d(t,"data-position")||"bottom")}}function zo({target:t}){var n,o;const e=(n=t==null?void 0:t.closest)==null?void 0:n.call(t,"a");if(e){const i=e.getRootNode(),s=((o=i.getElementById)==null?void 0:o.call(i,d(e,"popovertarget")||""))||e.closest(`.${dn}`),a=d(e,"popovertargetaction")||"toggle";s==null||s.togglePopover(a==="show"||(a==="hide"?!1:void 0))}}b&&(g(document,"beforetoggle",Xo,v),g(document,"click",zo));function Go(t){if(t.animationName!==_._onInjectTable)return;const e=t.target,n=[];d(e,"role","table"),e.caption&&d(e.caption,"role","caption");for(const o of[e.tHead,e.tFoot,...e.tBodies])if(o){d(o,"role","rowgroup");const i=o.nodeName==="TBODY";for(const s of o.rows){d(s,"role","row");for(const a of s.cells)i?d(a,"data-th",n[a.cellIndex]||":empty"):n.push(a.innerText.trim()),a.nodeName==="TD"?d(a,"role","cell"):(d(a,"role",i?"rowheader":"columnheader"),d(a,"scope",i?"row":"col"))}}}b&&g(document,"animationend",Go,v);const un="aria-describedby",fn="Escape",J="aria-labelledby",Qo="--mtds-tooltip-position",Jo=300,St="mtds-tooltip";let T=null,pn=Number.NEGATIVE_INFINITY,hn=0,I=null;const Zo=()=>Object.assign(document.createElement("div"),{className:_._tooltip,id:St,popover:"manual"});function Ct({target:t,type:e,key:n}){if(e==="keydown"&&n!==fn)return;const o=pn+Jo-Date.now();clearTimeout(hn),hn=setTimeout(ti,Math.max(o,0),n===fn?null:t)}function ti(t){var r,c,l;if(pn=Date.now(),I||(I=document.body.appendChild(Zo())),t===I)return;let e=((r=t==null?void 0:t.closest)==null?void 0:r.call(t,"[data-tooltip]"))||null;if(e===T)return;const n=e&&d(e,"data-tooltip")||"",o=e&&d(e,"data-tooltip-position")||((c=window.getComputedStyle(e||document.body).getPropertyValue(Qo))==null?void 0:c.trim())||"top";(!n||n==="false"||n==="true"||o==="none")&&(e=null),e&&(I.textContent=n);const s=T&&d(T,J)===St,a=((l=e instanceof HTMLElement?e.innerText:e==null?void 0:e.textContent)==null?void 0:l.trim())||(e==null?void 0:e.hasAttribute(J))||(e==null?void 0:e.hasAttribute("aria-label"));T==null||T.removeAttribute(s?J:un),B(I,!1),T=e,T&&d(T,a?un:J,St),I.togglePopover(!!e),B(I,e||!1,o)}b&&(g(document,"blur,focus,mouseout,mouseover",Ct,v),g(window,"keydown",Ct,v),g(window,"blur",Ct,v));var mn=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",_n;mn&&/^Mac/i.test(((_n=navigator.userAgentData)==null?void 0:_n.platform)||navigator.platform);var ei=":host(:not([hidden])) { display: block }",bn=typeof HTMLElement>"u"?class{}:HTMLElement;function S(t,e,n){var o;return n===void 0?(o=t.getAttribute(e))!=null?o:null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var vn=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},gn=(t,...e)=>vn("add",t,e),yn=(t,...e)=>vn("remove",t,e),ni=t=>{const e="key"in t&&(t.key===" "||t.key==="Enter");return e&&t.preventDefault(),e&&t.target instanceof HTMLElement&&t.target.click(),e},oi=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},xt=(t,e,n)=>{const o=document.createElement(t);if(e&&(o.textContent=e),n)for(const[i,s]of Object.entries(n))S(o,i,s);return o},En={define:(t,e)=>!mn||window.customElements.get(t)||window.customElements.define(t,e)},ii=class extends bn{constructor(){super(),this._content=null,this.attachShadow({mode:"open"}).append(xt("slot",null,{name:"summary"}),xt("slot",null,{part:"details-content"}),xt("style",`${ei}
2
2
  ::slotted(u-summary) { cursor: pointer; display: block }
3
3
  ::slotted(u-summary)::before { content: ''; display: inline-block; vertical-align: middle; margin-inline: .05em .3125em; border-block: .3125em solid transparent; border-inline-start: .5em solid }
4
4
  ::slotted(u-summary[aria-expanded="true"])::before { rotate: 90deg }
5
- :host > [part="details-content"]:not([hidden=""]) { display: block }`))}static get observedAttributes(){return["open"]}connectedCallback(){var t;this._content=(t=this.shadowRoot)==null?void 0:t.children[1],bn(this._content,"beforematch",this),bn(this,"click,keydown",this),this.attributeChangedCallback()}disconnectedCallback(){this._content&&gn(this._content,"beforematch",this),gn(this,"click,keydown",this),this._content=null}attributeChangedCallback(t,e,n){const o="onbeforematch"in this?"until-found":!0,i=this.open;for(const s of this.children)s.nodeName==="U-SUMMARY"&&k(s,"aria-expanded",`${i}`);if(this._content&&(k(this._content,"aria-hidden",`${!i}`),this._content.hidden=i?!1:o),i&&this.name){const s=Jo(this).querySelectorAll(`${this.nodeName}[name="${this.name}"]`);for(const a of s)a!==this&&(a.open=!1)}t==="open"&&e===null!=(n===null)&&this.dispatchEvent(new Event("toggle"))}handleEvent(t){const e=this.querySelector(":scope > u-summary"),n=e==null?void 0:e.contains(t.target);t.defaultPrevented||(t.type==="beforematch"&&(this.open=!0),n&&t.type==="keydown"&&Qo(t),n&&t.type==="click"&&(this.open=!this.open))}get open(){return this.hasAttribute("open")}set open(t){k(this,"open",t?"":null)}get name(){return k(this,"name")||""}set name(t){k(this,"name",t)}},ti=class extends _n{connectedCallback(){k(this,"role","button"),this.slot="summary",this.tabIndex=0}};yn.define("u-details",Zo),yn.define("u-summary",ti);var xt=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",ei=xt&&/android/i.test(navigator.userAgent),En;xt&&/^Mac/i.test(((En=navigator.userAgentData)==null?void 0:En.platform)||navigator.platform);var ni=`${ei?"data":"aria"}-labelledby`,Lt=":host(:not([hidden])) { display: block }",J=typeof HTMLElement>"u"?class{}:HTMLElement;function E(t,e,n){var o;return n===void 0?(o=t.getAttribute(e))!=null?o:null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var $n=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},oi=(t,...e)=>$n("add",t,e),ii=(t,...e)=>$n("remove",t,e),Z=(t,e)=>t.attachShadow({mode:"open"}).append(kn("slot"),kn("style",e)),tt=new WeakMap,wn=(t,e)=>{if(e===void 0)return tt.get(t);try{tt.get(t).disconnect(),tt.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),tt.set(t,n)}},si=t=>{const e="key"in t&&(t.key===" "||t.key==="Enter");return e&&t.preventDefault(),e&&t.target instanceof HTMLElement&&t.target.click(),e},Tn=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},ai=0,In=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++ai).toString(32)}`),t.id):"",kn=(t,e,n)=>{const o=document.createElement(t);return e&&(o.textContent=e),o},et={define:(t,e)=>!xt||window.customElements.get(t)||window.customElements.define(t,e)},nt="aria-controls",O="aria-selected",ri=class extends J{constructor(){super(),Z(this,Lt)}get tabList(){return ot("u-tablist",this)[0]||null}get selectedIndex(){return it(this.tabs)}set selectedIndex(t){Mt(this.tabs[t])}get tabs(){return ot("u-tab",this)}get panels(){return ot("u-tabpanel",this)}},li=class extends J{constructor(){super(),Z(this,Lt)}connectedCallback(){E(this,"role","tablist"),oi(this,"click,keydown",this),wn(this,{childList:!0}),this.tabs.length&&this.handleEvent()}disconnectedCallback(){ii(this,"click,keydown",this),wn(this,!1)}handleEvent(t){if(!t||t.type==="mutation"){const s=this.tabs[Math.max(this.selectedIndex,0)];return s==null?void 0:s.setAttribute(O,"true")}const{key:e}=t,n=[...this.tabs],o=n.findIndex(s=>s.contains(t.target));let i=o;if(!(t.defaultPrevented||o===-1)&&(t.type==="click"&&Mt(n[o]),t.type==="keydown"&&!si(t))){if(e==="ArrowDown"||e==="ArrowRight")i=(o+1)%n.length;else if(e==="ArrowUp"||e==="ArrowLeft")i=(o||n.length)-1;else if(e==="End")i=n.length-1;else if(e==="Home")i=0;else if(e==="Tab")i=it(n);else return;setTimeout(()=>{n[o].tabIndex=-1,n[i].tabIndex=0}),e!=="Tab"&&(t.preventDefault(),n[i].focus())}}get tabsElement(){return this.closest("u-tabs")}get tabs(){return this.querySelectorAll("u-tab")}get selectedIndex(){return it(this.tabs)}set selectedIndex(t){Mt(this.tabs[t])}},At=!1,di=class extends J{static get observedAttributes(){return["id",O,nt]}constructor(){super(),Z(this,":host(:not([hidden])) { cursor: pointer; display: inline-block }")}connectedCallback(){E(this,"role","tab"),this.tabIndex=this.selected?0:-1}attributeChangedCallback(){if(!At&&this.selected&&this.tabList){At=!0;const t=[...this.tabList.querySelectorAll("u-tab")],e=ot("u-tabpanel",this.tabsElement||this),n=Ot(this,e[t.indexOf(this)]);n&&E(n,ni,In(this)),t.forEach((o,i)=>{const s=Ot(o,e[i]);o.tabIndex=o===this?0:-1,E(o,O,`${o===this}`),s&&(s.hidden=s!==n),s&&E(o,nt,s.id)}),At=!1}}get tabsElement(){return this.closest("u-tabs")}get tabList(){const t=this.parentElement;return(t==null?void 0:t.nodeName)==="U-TABLIST"?t:null}get selected(){return E(this,O)==="true"}set selected(t){E(this,O,`${!!t}`)}get index(){const t=this.tabList;return t?[...t.querySelectorAll("u-tab")].indexOf(this):0}get panel(){return Ot(this)}},ci=class extends J{static get observedAttributes(){return["hidden"]}constructor(){super(),Z(this,Lt)}connectedCallback(){E(this,"role","tabpanel"),this.hidden=it(this.tabs)===-1,this.attributeChangedCallback()}attributeChangedCallback(){this.hidden||ui(this.firstChild)?E(this,"tabindex",null):this.tabIndex=0}get tabsElement(){return this.closest("u-tabs")}get tabs(){const t=`u-tab[${nt}="${this.id}"]`;return Tn(this).querySelectorAll(t)}},ot=(t,e)=>e.querySelectorAll(`${t}:not(:scope u-tabpanel ${t})`),Ot=(t,e)=>{const n=E(t,nt)||In(e),o=Tn(t).getElementById(n);return(o==null?void 0:o.nodeName)==="U-TABPANEL"?o:null},it=t=>[...t].findIndex(e=>E(e,O)==="true"),Mt=t=>t&&E(t,"aria-selected","true"),ui=t=>t instanceof Element&&!t.matches(':disabled,[tabindex^="-"]')&&t.matches('[contenteditable],[controls],[href],[tabindex],input:not([type="hidden"]),select,textarea,button,summary,iframe');et.define("u-tabs",ri),et.define("u-tablist",li),et.define("u-tab",di),et.define("u-tabpanel",ci);var fi=Object.defineProperty,Sn=Object.getOwnPropertySymbols,pi=Object.prototype.hasOwnProperty,hi=Object.prototype.propertyIsEnumerable,Cn=(t,e,n)=>e in t?fi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xn=(t,e)=>{for(var n in e||(e={}))pi.call(e,n)&&Cn(t,n,e[n]);if(Sn)for(var n of Sn(e))hi.call(e,n)&&Cn(t,n,e[n]);return t},S=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Ln=S&&/android/i.test(navigator.userAgent),mi=S&&/firefox/i.test(navigator.userAgent),st=S&&/iPad|iPhone|iPod/.test(navigator.userAgent),An=S&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),On,_i=S&&/^Mac/i.test(((On=navigator.userAgentData)==null?void 0:On.platform)||navigator.platform),vi=`${Ln?"data":"aria"}-labelledby`,Dt=`${An?"aria":"data"}-multiselectable`,Mn=":host(:not([hidden])) { display: block }",Dn="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Pt=typeof HTMLElement>"u"?class{}:HTMLElement;function u(t,e,n){var o;return n===void 0?(o=t.getAttribute(e))!=null?o:null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var Pn=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},U=(t,...e)=>Pn("add",t,e),j=(t,...e)=>Pn("remove",t,e),Rn=(t,e)=>t.attachShadow({mode:"open"}).append(M("slot"),M("style",e)),at=new WeakMap,rt=(t,e)=>{if(e===void 0)return at.get(t);try{at.get(t).disconnect(),at.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),at.set(t,n)}},bi=t=>{const e="key"in t&&(t.key===" "||t.key==="Enter");return e&&t.preventDefault(),e&&t.target instanceof HTMLElement&&t.target.click(),e},lt=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},gi=0,Rt=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++gi).toString(32)}`),t.id):"",M=(t,e,n)=>{const o=document.createElement(t);if(e&&(o.textContent=e),n)for(const[i,s]of Object.entries(n))u(o,i,s);return o},Ht={define:(t,e)=>!S||window.customElements.get(t)||window.customElements.define(t,e)},Hn=t=>{const e=M("div");return e.style.cssText="position:fixed;overflow:hidden;width:1px;white-space:nowrap",u(e,"aria-live",t),e};function dt(t,e,n){if(!e)return Object.keys(t).map(i=>`data-sr-${i}`);const o=(e==null?void 0:e.startsWith("data-sr-"))&&e.slice(8);return o&&n&&t[o]&&(t[o]=n),[]}var Nt="disabled",V="selected",yi=class extends Pt{static get observedAttributes(){return[Nt,V]}constructor(){super(),Rn(this,`${Mn}:host(:focus){${Dn}}:host{ cursor: pointer }`)}connectedCallback(){st||(this.tabIndex=-1),u(this,"role")||u(this,"role","option"),this.attributeChangedCallback()}attributeChangedCallback(){u(this,"aria-disabled",`${this.disabled}`),u(this,"aria-selected",`${this.selected}`)}get defaultSelected(){return this[V]}set defaultSelected(t){this[V]=t}get disabled(){return u(this,Nt)!==null}set disabled(t){u(this,Nt,t?"":null)}get form(){return this.closest("form")}get index(){var t;const e=(t=this.closest("u-datalist"))==null?void 0:t.getElementsByTagName("u-option");return Array.from(e||[this]).indexOf(this)}get label(){return u(this,"label")||this.text}set label(t){u(this,"label",t)}get selected(){return u(this,V)!==null}set selected(t){u(this,V,t?"":null)}get text(){var t;return((t=this.textContent)==null?void 0:t.trim())||""}set text(t){this.textContent=t}get value(){return u(this,"value")||this.text}set value(t){u(this,"value",t)}};Ht.define("u-option",yi);var Bt=!1,Nn,Ei=0,D,$i=An&&!st,Bn="click,focusout,input,keydown,mousedown,mouseup",zn={singular:"%d hit",plural:"%d hits"},wi=class extends Pt{constructor(){super(),this._blurTimer=0,this._input=null,this._root=null,this._value="",this._texts=xn({},zn),Rn(this,`${Mn}::slotted(u-option[disabled]) { display: none !important }`)}static get observedAttributes(){return["id",...dt(zn)]}connectedCallback(){this.hidden=!0,this._root=lt(this),D||(D=Hn("assertive")),D.isConnected||document.body.appendChild(D),u(this,"role","listbox"),U(this._root,"focusin",this),U(this._root,"focus",this,!0),setTimeout(()=>this.attributeChangedCallback())}disconnectedCallback(){j(this._root||this,"focus",this,!0),j(this._root||this,"focusin",this),zt(this),this._root=null}attributeChangedCallback(t,e,n){var o;dt(this._texts,t,n);const i=(o=this._root)==null?void 0:o.querySelectorAll(`input[list="${this.id}"]`);for(const s of i||[])Un(this,s)}handleEvent(t){const{type:e}=t;t.defaultPrevented||(e==="click"&&ki(this,t),(e==="focus"||e==="focusin")&&Ti(this,t),e==="focusout"&&Ii(this),e==="keydown"&&Si(this,t),(e==="mutation"||e==="input")&&Vn(this,t),e==="mouseup"&&(Bt=!1),e==="mousedown"&&(Bt=this.contains(t.target)))}get options(){return this.getElementsByTagName("u-option")}},Ti=(t,{target:e})=>{var n;const o=t._input===e;if(o||t.contains(e))return clearTimeout(t._blurTimer);!o&&e instanceof HTMLInputElement&&u(e,"list")===t.id&&(t._input&&zt(t),t._input=e,u(t,vi,Rt((n=t._input.labels)==null?void 0:n[0])),U(t._root||t,Bn,t),rt(t,{attributeFilter:["value"],attributes:!0,childList:!0,subtree:!0}),P(t,!0))},Ii=t=>{Bt||(t._blurTimer=setTimeout(()=>zt(t)))},ki=(t,{target:e})=>{var n,o,i,s,a;const r=u(t,Dt)!=="true",d=[...t.options].find(l=>l.contains(e));if(t._input===e)P(t,!0);else if(d&&ct(d)){for(const l of t.options)l===d?l.selected=!0:r&&(l.selected=!1);(o=(n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:n.set)==null||o.call(t._input,d.value),r&&((i=t._input)==null||i.focus(),P(t,!1)),(s=t._input)==null||s.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),(a=t._input)==null||a.dispatchEvent(new Event("change",{bubbles:!0}))}},Si=(t,e)=>{var n,o;if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;e.key!=="Escape"&&P(t,!0);const{key:i}=e,s=(n=t._root)==null?void 0:n.activeElement,a=Fn(t),r=a.indexOf(s);let d=-1;if(i==="ArrowDown"&&(d=(r+1)%a.length),i==="ArrowUp"&&(d=(~r?r:a.length)-1),~r&&((i==="Home"||i==="PageUp")&&(d=0),(i==="End"||i==="PageDown")&&(d=a.length-1),i==="Enter"))return a[r].click(),e.preventDefault();if(a[d])for(const l of a)l.tabIndex=-1;a[d]&&e.preventDefault(),(o=a[d]||t._input)==null||o.focus(),i==="Escape"&&P(t,!1)},P=(t,e)=>{t.hidden=!e,t.popover&&t.togglePopover(e),t._input&&Un(t,t._input,e),e&&Vn(t)},zt=t=>{j(t._root||t,Bn,t),rt(t,!1),P(t,!1),t._input=null},Fn=t=>[...t.options].filter(e=>!e.disabled&&e.offsetWidth&&e.offsetHeight),ct=t=>t instanceof HTMLOptionElement||t.getAttribute("role")==="option",Un=(t,e,n=!1)=>{u(e,"popovertarget",Rt(t)),u(e,"aria-autocomplete","list"),u(e,"aria-controls",Rt(t)),u(e,"aria-expanded",`${$i||n}`),u(e,"autocomplete","off"),u(e,"role","combobox")},jn=t=>(t==null?void 0:t.toLowerCase().trim())||"",Vn=(t,e)=>{var n;const o=jn((n=t._input)==null?void 0:n.value);if(!((e==null?void 0:e.type)==="mutation"||t._value!==o))return;const s=t.hidden,a=u(t,Dt)!=="true",r=e instanceof InputEvent&&!Kn(e);t.hidden=!0,t._value=o;for(const l of t.options){const f=[l.value,l.label,l.text].map(jn);l.hidden=!f.some(h=>h.includes(o)),a&&r&&ct(l)&&(l.selected=f.includes(o))}t.hidden=s;const d=Fn(t);clearTimeout(Nn),Nn=setTimeout(()=>{const{length:l}=d.filter(ct),f=++Ei%2?" ":"",h=`${`${t._texts[l===1?"singular":"plural"]}`.replace("%d",`${l}`)}`;D&&(D.textContent=`${!l&&t.innerText.trim()||h}${f}`)},1e3),st&&d.map((l,f,h)=>{l.title=`${f+1}/${h}`})};S&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){return lt(this).getElementById(u(this,"list")||"")}}),Ht.define("u-datalist",wi);var Yn=" ".repeat(100),Ci="insertReplacementText",Ft=({value:t})=>t.split(Yn)[0];function Kn(t){var e;const n=t instanceof Event&&t.type==="input"&&t.target instanceof HTMLInputElement&&(!t.inputType||t.inputType===Ci);if(n){const o=t.target.value,i=Array.from(((e=t.target.list)==null?void 0:e.options)||[]).some(s=>s.value===o&&!ct(s));t.target.value=o.split(Yn)[i?1:0]}return n}var R,xi=Ln||st,Li=mi||_i,Wn="input,focusin,focusout,keydown",qn={added:"Added",remove:"Press to remove",removed:"Removed",empty:"No selected",found:"Navigate left to find %d selected",of:"of"},Ai=class extends Pt{constructor(){super(),this._blurAnnounceReset=!1,this._blurTimer=0,this._focusIndex=null,this._root=null,this._texts=xn({},qn),this.attachShadow({mode:"open"}).append(M("slot"),M("style",`:host(:not([hidden])){ display: inline-block }
5
+ :host > [part="details-content"]:not([hidden=""]) { display: block }`))}static get observedAttributes(){return["open"]}connectedCallback(){var t;this._content=(t=this.shadowRoot)==null?void 0:t.children[1],gn(this._content,"beforematch",this),gn(this,"click,keydown",this),this.attributeChangedCallback()}disconnectedCallback(){this._content&&yn(this._content,"beforematch",this),yn(this,"click,keydown",this),this._content=null}attributeChangedCallback(t,e,n){const o="onbeforematch"in this?"until-found":!0,i=this.open;for(const s of this.children)s.nodeName==="U-SUMMARY"&&S(s,"aria-expanded",`${i}`);if(this._content&&(S(this._content,"aria-hidden",`${!i}`),this._content.hidden=i?!1:o),i&&this.name){const s=oi(this).querySelectorAll(`${this.nodeName}[name="${this.name}"]`);for(const a of s)a!==this&&(a.open=!1)}t==="open"&&e===null!=(n===null)&&this.dispatchEvent(new Event("toggle"))}handleEvent(t){const e=this.querySelector(":scope > u-summary"),n=e==null?void 0:e.contains(t.target);t.defaultPrevented||(t.type==="beforematch"&&(this.open=!0),n&&t.type==="keydown"&&ni(t),n&&t.type==="click"&&(this.open=!this.open))}get open(){return this.hasAttribute("open")}set open(t){S(this,"open",t?"":null)}get name(){return S(this,"name")||""}set name(t){S(this,"name",t)}},si=class extends bn{connectedCallback(){S(this,"role","button"),this.slot="summary",this.tabIndex=0}};En.define("u-details",ii),En.define("u-summary",si);var Lt=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",ai=Lt&&/android/i.test(navigator.userAgent),$n;Lt&&/^Mac/i.test((($n=navigator.userAgentData)==null?void 0:$n.platform)||navigator.platform);var ri=`${ai?"data":"aria"}-labelledby`,At=":host(:not([hidden])) { display: block }",Z=typeof HTMLElement>"u"?class{}:HTMLElement;function E(t,e,n){var o;return n===void 0?(o=t.getAttribute(e))!=null?o:null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var wn=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},li=(t,...e)=>wn("add",t,e),ci=(t,...e)=>wn("remove",t,e),tt=(t,e)=>t.attachShadow({mode:"open"}).append(Cn("slot"),Cn("style",e)),et=new WeakMap,Tn=(t,e)=>{if(e===void 0)return et.get(t);try{et.get(t).disconnect(),et.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),et.set(t,n)}},di=t=>{const e="key"in t&&(t.key===" "||t.key==="Enter");return e&&t.preventDefault(),e&&t.target instanceof HTMLElement&&t.target.click(),e},In=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},ui=0,Sn=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++ui).toString(32)}`),t.id):"",Cn=(t,e,n)=>{const o=document.createElement(t);return e&&(o.textContent=e),o},nt={define:(t,e)=>!Lt||window.customElements.get(t)||window.customElements.define(t,e)},ot="aria-controls",O="aria-selected",fi=class extends Z{constructor(){super(),tt(this,At)}get tabList(){return it("u-tablist",this)[0]||null}get selectedIndex(){return st(this.tabs)}set selectedIndex(t){Mt(this.tabs[t])}get tabs(){return it("u-tab",this)}get panels(){return it("u-tabpanel",this)}},pi=class extends Z{constructor(){super(),tt(this,At)}connectedCallback(){E(this,"role","tablist"),li(this,"click,keydown",this),Tn(this,{childList:!0}),this.tabs.length&&this.handleEvent()}disconnectedCallback(){ci(this,"click,keydown",this),Tn(this,!1)}handleEvent(t){if(!t||t.type==="mutation"){const s=this.tabs[Math.max(this.selectedIndex,0)];return s==null?void 0:s.setAttribute(O,"true")}const{key:e}=t,n=[...this.tabs],o=n.findIndex(s=>s.contains(t.target));let i=o;if(!(t.defaultPrevented||o===-1)&&(t.type==="click"&&Mt(n[o]),t.type==="keydown"&&!di(t))){if(e==="ArrowDown"||e==="ArrowRight")i=(o+1)%n.length;else if(e==="ArrowUp"||e==="ArrowLeft")i=(o||n.length)-1;else if(e==="End")i=n.length-1;else if(e==="Home")i=0;else if(e==="Tab")i=st(n);else return;setTimeout(()=>{n[o].tabIndex=-1,n[i].tabIndex=0}),e!=="Tab"&&(t.preventDefault(),n[i].focus())}}get tabsElement(){return this.closest("u-tabs")}get tabs(){return this.querySelectorAll("u-tab")}get selectedIndex(){return st(this.tabs)}set selectedIndex(t){Mt(this.tabs[t])}},kt=!1,hi=class extends Z{static get observedAttributes(){return["id",O,ot]}constructor(){super(),tt(this,":host(:not([hidden])) { cursor: pointer; display: inline-block }")}connectedCallback(){E(this,"role","tab"),this.tabIndex=this.selected?0:-1}attributeChangedCallback(){if(!kt&&this.selected&&this.tabList){kt=!0;const t=[...this.tabList.querySelectorAll("u-tab")],e=it("u-tabpanel",this.tabsElement||this),n=Ot(this,e[t.indexOf(this)]);n&&E(n,ri,Sn(this)),t.forEach((o,i)=>{const s=Ot(o,e[i]);o.tabIndex=o===this?0:-1,E(o,O,`${o===this}`),s&&(s.hidden=s!==n),s&&E(o,ot,s.id)}),kt=!1}}get tabsElement(){return this.closest("u-tabs")}get tabList(){const t=this.parentElement;return(t==null?void 0:t.nodeName)==="U-TABLIST"?t:null}get selected(){return E(this,O)==="true"}set selected(t){E(this,O,`${!!t}`)}get index(){const t=this.tabList;return t?[...t.querySelectorAll("u-tab")].indexOf(this):0}get panel(){return Ot(this)}},mi=class extends Z{static get observedAttributes(){return["hidden"]}constructor(){super(),tt(this,At)}connectedCallback(){E(this,"role","tabpanel"),this.hidden=st(this.tabs)===-1,this.attributeChangedCallback()}attributeChangedCallback(){this.hidden||_i(this.firstChild)?E(this,"tabindex",null):this.tabIndex=0}get tabsElement(){return this.closest("u-tabs")}get tabs(){const t=`u-tab[${ot}="${this.id}"]`;return In(this).querySelectorAll(t)}},it=(t,e)=>e.querySelectorAll(`${t}:not(:scope u-tabpanel ${t})`),Ot=(t,e)=>{const n=E(t,ot)||Sn(e),o=In(t).getElementById(n);return(o==null?void 0:o.nodeName)==="U-TABPANEL"?o:null},st=t=>[...t].findIndex(e=>E(e,O)==="true"),Mt=t=>t&&E(t,"aria-selected","true"),_i=t=>t instanceof Element&&!t.matches(':disabled,[tabindex^="-"]')&&t.matches('[contenteditable],[controls],[href],[tabindex],input:not([type="hidden"]),select,textarea,button,summary,iframe');nt.define("u-tabs",fi),nt.define("u-tablist",pi),nt.define("u-tab",hi),nt.define("u-tabpanel",mi);var bi=Object.defineProperty,xn=Object.getOwnPropertySymbols,vi=Object.prototype.hasOwnProperty,gi=Object.prototype.propertyIsEnumerable,Ln=(t,e,n)=>e in t?bi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,An=(t,e)=>{for(var n in e||(e={}))vi.call(e,n)&&Ln(t,n,e[n]);if(xn)for(var n of xn(e))gi.call(e,n)&&Ln(t,n,e[n]);return t},C=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",kn=C&&/android/i.test(navigator.userAgent),yi=C&&/firefox/i.test(navigator.userAgent),at=C&&/iPad|iPhone|iPod/.test(navigator.userAgent),On=C&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Mn,Ei=C&&/^Mac/i.test(((Mn=navigator.userAgentData)==null?void 0:Mn.platform)||navigator.platform),$i=`${kn?"data":"aria"}-labelledby`,Dt=`${On?"aria":"data"}-multiselectable`,Dn=":host(:not([hidden])) { display: block }",Pn="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Pt=typeof HTMLElement>"u"?class{}:HTMLElement;function u(t,e,n){var o;return n===void 0?(o=t.getAttribute(e))!=null?o:null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var Rn=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},j=(t,...e)=>Rn("add",t,e),K=(t,...e)=>Rn("remove",t,e),Hn=(t,e)=>t.attachShadow({mode:"open"}).append(M("slot"),M("style",e)),rt=new WeakMap,lt=(t,e)=>{if(e===void 0)return rt.get(t);try{rt.get(t).disconnect(),rt.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),rt.set(t,n)}},wi=t=>{const e="key"in t&&(t.key===" "||t.key==="Enter");return e&&t.preventDefault(),e&&t.target instanceof HTMLElement&&t.target.click(),e},ct=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Ti=0,Rt=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++Ti).toString(32)}`),t.id):"",M=(t,e,n)=>{const o=document.createElement(t);if(e&&(o.textContent=e),n)for(const[i,s]of Object.entries(n))u(o,i,s);return o},Ht={define:(t,e)=>!C||window.customElements.get(t)||window.customElements.define(t,e)},Nn=t=>{const e=M("div");return e.style.cssText="position:fixed;overflow:hidden;width:1px;white-space:nowrap",u(e,"aria-live",t),e};function dt(t,e,n){if(!e)return Object.keys(t).map(i=>`data-sr-${i}`);const o=(e==null?void 0:e.startsWith("data-sr-"))&&e.slice(8);return o&&n&&t[o]&&(t[o]=n),[]}var Nt="disabled",W="selected",Ii=class extends Pt{static get observedAttributes(){return[Nt,W]}constructor(){super(),Hn(this,`${Dn}:host(:focus){${Pn}}:host{ cursor: pointer }`)}connectedCallback(){at||(this.tabIndex=-1),u(this,"role")||u(this,"role","option"),this.attributeChangedCallback()}attributeChangedCallback(){u(this,"aria-disabled",`${this.disabled}`),u(this,"aria-selected",`${this.selected}`)}get defaultSelected(){return this[W]}set defaultSelected(t){this[W]=t}get disabled(){return u(this,Nt)!==null}set disabled(t){u(this,Nt,t?"":null)}get form(){return this.closest("form")}get index(){var t;const e=(t=this.closest("u-datalist"))==null?void 0:t.getElementsByTagName("u-option");return Array.from(e||[this]).indexOf(this)}get label(){return u(this,"label")||this.text}set label(t){u(this,"label",t)}get selected(){return u(this,W)!==null}set selected(t){u(this,W,t?"":null)}get text(){var t;return((t=this.textContent)==null?void 0:t.trim())||""}set text(t){this.textContent=t}get value(){return u(this,"value")||this.text}set value(t){u(this,"value",t)}};Ht.define("u-option",Ii);var Bt=!1,Bn,Si=0,D,Ci=On&&!at,Fn="click,focusout,input,keydown,mousedown,mouseup",Un={singular:"%d hit",plural:"%d hits"},xi=class extends Pt{constructor(){super(),this._blurTimer=0,this._input=null,this._root=null,this._value="",this._texts=An({},Un),Hn(this,`${Dn}::slotted(u-option[disabled]) { display: none !important }`)}static get observedAttributes(){return["id",...dt(Un)]}connectedCallback(){this.hidden=!0,this._root=ct(this),D||(D=Nn("assertive")),D.isConnected||document.body.appendChild(D),u(this,"role","listbox"),j(this._root,"focusin",this),j(this._root,"focus",this,!0),setTimeout(()=>this.attributeChangedCallback())}disconnectedCallback(){K(this._root||this,"focus",this,!0),K(this._root||this,"focusin",this),Ft(this),this._root=null}attributeChangedCallback(t,e,n){var o;dt(this._texts,t,n);const i=(o=this._root)==null?void 0:o.querySelectorAll(`input[list="${this.id}"]`);for(const s of i||[])jn(this,s)}handleEvent(t){const{type:e}=t;t.defaultPrevented||(e==="click"&&ki(this,t),(e==="focus"||e==="focusin")&&Li(this,t),e==="focusout"&&Ai(this),e==="keydown"&&Oi(this,t),(e==="mutation"||e==="input")&&Wn(this,t),e==="mouseup"&&(Bt=!1),e==="mousedown"&&(Bt=this.contains(t.target)))}get options(){return this.getElementsByTagName("u-option")}},Li=(t,{target:e})=>{var n;const o=t._input===e;if(o||t.contains(e))return clearTimeout(t._blurTimer);!o&&e instanceof HTMLInputElement&&u(e,"list")===t.id&&(t._input&&Ft(t),t._input=e,u(t,$i,Rt((n=t._input.labels)==null?void 0:n[0])),j(t._root||t,Fn,t),lt(t,{attributeFilter:["value"],attributes:!0,childList:!0,subtree:!0}),P(t,!0))},Ai=t=>{Bt||(t._blurTimer=setTimeout(()=>Ft(t)))},ki=(t,{target:e})=>{var n,o,i,s,a;const r=u(t,Dt)!=="true",c=[...t.options].find(l=>l.contains(e));if(t._input===e)P(t,!0);else if(c&&ut(c)){for(const l of t.options)l===c?l.selected=!0:r&&(l.selected=!1);(o=(n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:n.set)==null||o.call(t._input,c.value),r&&((i=t._input)==null||i.focus(),P(t,!1)),(s=t._input)==null||s.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),(a=t._input)==null||a.dispatchEvent(new Event("change",{bubbles:!0}))}},Oi=(t,e)=>{var n,o;if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;e.key!=="Escape"&&P(t,!0);const{key:i}=e,s=(n=t._root)==null?void 0:n.activeElement,a=Vn(t),r=a.indexOf(s);let c=-1;if(i==="ArrowDown"&&(c=(r+1)%a.length),i==="ArrowUp"&&(c=(~r?r:a.length)-1),~r&&((i==="Home"||i==="PageUp")&&(c=0),(i==="End"||i==="PageDown")&&(c=a.length-1),i==="Enter"))return a[r].click(),e.preventDefault();if(a[c])for(const l of a)l.tabIndex=-1;a[c]&&e.preventDefault(),(o=a[c]||t._input)==null||o.focus(),i==="Escape"&&P(t,!1)},P=(t,e)=>{t.hidden=!e,t.popover&&t.togglePopover(e),t._input&&jn(t,t._input,e),e&&Wn(t)},Ft=t=>{K(t._root||t,Fn,t),lt(t,!1),P(t,!1),t._input=null},Vn=t=>[...t.options].filter(e=>!e.disabled&&e.offsetWidth&&e.offsetHeight),ut=t=>t instanceof HTMLOptionElement||t.getAttribute("role")==="option",jn=(t,e,n=!1)=>{u(e,"popovertarget",Rt(t)),u(e,"aria-autocomplete","list"),u(e,"aria-controls",Rt(t)),u(e,"aria-expanded",`${Ci||n}`),u(e,"autocomplete","off"),u(e,"role","combobox")},Kn=t=>(t==null?void 0:t.toLowerCase().trim())||"",Wn=(t,e)=>{var n;const o=Kn((n=t._input)==null?void 0:n.value);if(!((e==null?void 0:e.type)==="mutation"||t._value!==o))return;const s=t.hidden,a=u(t,Dt)!=="true",r=e instanceof InputEvent&&!qn(e);t.hidden=!0,t._value=o;for(const l of t.options){const f=[l.value,l.label,l.text].map(Kn);l.hidden=!f.some(h=>h.includes(o)),a&&r&&ut(l)&&(l.selected=f.includes(o))}t.hidden=s;const c=Vn(t);clearTimeout(Bn),Bn=setTimeout(()=>{const{length:l}=c.filter(ut),f=++Si%2?" ":"",h=`${`${t._texts[l===1?"singular":"plural"]}`.replace("%d",`${l}`)}`;D&&(D.textContent=`${!l&&t.innerText.trim()||h}${f}`)},1e3),at&&c.map((l,f,h)=>{l.title=`${f+1}/${h}`})};C&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){return ct(this).getElementById(u(this,"list")||"")}}),Ht.define("u-datalist",xi);var Yn=" ".repeat(100),Mi="insertReplacementText",Ut=({value:t})=>t.split(Yn)[0];function qn(t){var e;const n=t instanceof Event&&t.type==="input"&&t.target instanceof HTMLInputElement&&(!t.inputType||t.inputType===Mi);if(n){const o=t.target.value,i=Array.from(((e=t.target.list)==null?void 0:e.options)||[]).some(s=>s.value===o&&!ut(s));t.target.value=o.split(Yn)[i?1:0]}return n}var R,Di=kn||at,Pi=yi||Ei,Xn="input,focusin,focusout,keydown",zn={added:"Added",remove:"Press to remove",removed:"Removed",empty:"No selected",found:"Navigate left to find %d selected",of:"of"},Ri=class extends Pt{constructor(){super(),this._blurAnnounceReset=!1,this._blurTimer=0,this._focusIndex=null,this._root=null,this._texts=An({},zn),this.attachShadow({mode:"open"}).append(M("slot"),M("style",`:host(:not([hidden])){ display: inline-block }
6
6
  ::slotted(data) { cursor: pointer; display: inline-block; outline: none; pointer-events: none }
7
7
  ::slotted(data)::after { content: '\\00D7'; content: '\\00D7' / ''; padding-inline: .5ch; pointer-events: auto }
8
- ::slotted(data:focus)::after { ${Dn} }`))}static get observedAttributes(){return dt(qn)}connectedCallback(){this._root=lt(this),R||(R=Hn("polite")),R.isConnected||document.body.appendChild(R),rt(this,{childList:!0}),U(this._root,"click",this),U(this,Wn,this),setTimeout(()=>ut(this))}attributeChangedCallback(t,e,n){dt(this._texts,t,n)}disconnectedCallback(){rt(this,!1),j(this._root||this,"click",this),j(this,Wn,this),this._root=null}handleEvent(t){t.defaultPrevented||(t.type==="click"&&Di(this,t),t.type==="focusin"&&Oi(this,t),t.type==="focusout"&&Mi(this),t.type==="input"&&Pi(this,t),t.type==="keydown"&&Ri(this,t),t.type==="mutation"&&ut(this,t))}get items(){return this.querySelectorAll("data")}get control(){return this.querySelector("input")}},Ut=(t,e)=>t.dispatchEvent(new CustomEvent("tags",{bubbles:!0,cancelable:!0,detail:{item:e,action:e.isConnected?"remove":"add"}})),ut=(t,e)=>{var n,o,i,s,a;const r=t._texts,d=Number.isNaN(t._focusIndex)?null:e==null?void 0:e.detail[0],l=(d==null?void 0:d.addedNodes[0])||(d==null?void 0:d.removedNodes[0]),f=`${l?`${l.isConnected?r.added:r.removed} ${l.textContent}, `:""}`,h=((i=(o=(n=t.control)==null?void 0:n.labels)==null?void 0:o[0])==null?void 0:i.textContent)||"",y=[];u(t,"role","group"),u(t,"aria-label",h),t.items.forEach((m,Y,{length:K})=>{const Vt=`${f}${m.textContent}, ${r.remove}, ${Y+1} ${r.of} ${K}`;u(m,"aria-label",Vt),u(m,"role","button"),m.tabIndex=-1,m.value=(m.value||m.textContent||"").trim(),y.push(m.value)});const T=t.control,jt=`${f}${h}, ${y.length?r.found.replace("%d",`${y.length}`):r.empty}`,H=T&&document.getElementById(u(T,"list")||""),ft=H==null?void 0:H.children;T&&u(T,"aria-label",jt),H&&u(H,Dt,"true");for(const m of ft||[])m.selected=y.includes(Ft(m));if(f){const m=t.items[(t._focusIndex||1)-1]||T,Y=m===((s=lt(t))==null?void 0:s.activeElement),K=ft||t.items;t._blurAnnounceReset=!1,m===T?(Y&&(xi&&R?R.textContent=f:(a=K[0])==null||a.focus()),setTimeout(()=>m==null?void 0:m.focus(),100)):m==null||m.focus(),setTimeout(()=>{if(!Li)return ut(t);t._blurAnnounceReset=!0},500)}},Oi=(t,{target:e})=>{clearTimeout(t._blurTimer),t._focusIndex=[...t.items].indexOf(e)},Mi=t=>{t._blurAnnounceReset&&ut(t),t._blurTimer=setTimeout(()=>{t._focusIndex=null})},Di=(t,{target:e,clientX:n,clientY:o})=>{var i;const s=t.contains(e)?[...t.items]:null,a=s==null?void 0:s.find(d=>d.contains(e)),r=s==null?void 0:s.find(d=>{const{top:l,right:f,bottom:h,left:y}=d.getBoundingClientRect();return o>=l&&o<=h&&n>=y&&n<=f});a?Ut(t,a)&&a.remove():r?r.focus():e===t&&((i=t.control)==null||i.focus())},Pi=(t,e)=>{var n;const o=e.target;if(!Kn(e)||!(o!=null&&o.value.trim()))return;const i=Ft(o),s=[...t.items],r=[...((n=o==null?void 0:o.list)==null?void 0:n.children)||[]].find(f=>Ft(f)===i),d=s.find(f=>f.value===i),l=M("data",(r==null?void 0:r.text)||i,{value:i});if(o.value="",!!Ut(t,d||l)){if(d)return d.remove();if(!s[0])return t.prepend(l);s[s.length-1].insertAdjacentElement("afterend",l)}},Ri=(t,e)=>{var n,o;const{key:i,repeat:s,target:a}=e,r=t.control===a?t.control:null,d=r==null?void 0:r.selectionEnd;let l=r?t.items.length:(n=t._focusIndex)!=null?n:-1;if(!(l===-1||!r&&bi(e))){if(i==="ArrowRight"&&!r)l+=1;else if(i==="ArrowLeft"&&!d)l-=1;else{if(i==="Enter"&&r)return e.preventDefault(),r.dispatchEvent(new Event("input",{bubbles:!0}));if((i==="Backspace"||i==="Delete")&&!d){const f=!s&&t.items[l];if(e.preventDefault(),f)return Ut(t,f)&&f.remove();r&&(l-=1)}else return}e.preventDefault(),(o=t.items[Math.max(0,l)]||t.control)==null||o.focus()}};return Ht.define("u-tags",Ai),W.pagination=Jn,W.styles=Zn,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"}),W}({});
8
+ ::slotted(data:focus)::after { ${Pn} }`))}static get observedAttributes(){return dt(zn)}connectedCallback(){this._root=ct(this),R||(R=Nn("polite")),R.isConnected||document.body.appendChild(R),lt(this,{childList:!0}),j(this._root,"click",this),j(this,Xn,this),setTimeout(()=>ft(this))}attributeChangedCallback(t,e,n){dt(this._texts,t,n)}disconnectedCallback(){lt(this,!1),K(this._root||this,"click",this),K(this,Xn,this),this._root=null}handleEvent(t){t.defaultPrevented||(t.type==="click"&&Bi(this,t),t.type==="focusin"&&Hi(this,t),t.type==="focusout"&&Ni(this),t.type==="input"&&Fi(this,t),t.type==="keydown"&&Ui(this,t),t.type==="mutation"&&ft(this,t))}get items(){return this.querySelectorAll("data")}get control(){return this.querySelector("input")}},Vt=(t,e)=>t.dispatchEvent(new CustomEvent("tags",{bubbles:!0,cancelable:!0,detail:{item:e,action:e.isConnected?"remove":"add"}})),ft=(t,e)=>{var n,o,i,s,a;const r=t._texts,c=Number.isNaN(t._focusIndex)?null:e==null?void 0:e.detail[0],l=(c==null?void 0:c.addedNodes[0])||(c==null?void 0:c.removedNodes[0]),f=`${l?`${l.isConnected?r.added:r.removed} ${l.textContent}, `:""}`,h=((i=(o=(n=t.control)==null?void 0:n.labels)==null?void 0:o[0])==null?void 0:i.textContent)||"",$=[];u(t,"role","group"),u(t,"aria-label",h),t.items.forEach((m,Y,{length:q})=>{const Kt=`${f}${m.textContent}, ${r.remove}, ${Y+1} ${r.of} ${q}`;u(m,"aria-label",Kt),u(m,"role","button"),m.tabIndex=-1,m.value=(m.value||m.textContent||"").trim(),$.push(m.value)});const y=t.control,jt=`${f}${h}, ${$.length?r.found.replace("%d",`${$.length}`):r.empty}`,H=y&&document.getElementById(u(y,"list")||""),pt=H==null?void 0:H.children;y&&u(y,"aria-label",jt),H&&u(H,Dt,"true");for(const m of pt||[])m.selected=$.includes(Ut(m));if(f){const m=t.items[(t._focusIndex||1)-1]||y,Y=m===((s=ct(t))==null?void 0:s.activeElement),q=pt||t.items;t._blurAnnounceReset=!1,m===y?(Y&&(Di&&R?R.textContent=f:(a=q[0])==null||a.focus()),setTimeout(()=>m==null?void 0:m.focus(),100)):m==null||m.focus(),setTimeout(()=>{if(!Pi)return ft(t);t._blurAnnounceReset=!0},500)}},Hi=(t,{target:e})=>{clearTimeout(t._blurTimer),t._focusIndex=[...t.items].indexOf(e)},Ni=t=>{t._blurAnnounceReset&&ft(t),t._blurTimer=setTimeout(()=>{t._focusIndex=null})},Bi=(t,{target:e,clientX:n,clientY:o})=>{var i;const s=t.contains(e)?[...t.items]:null,a=s==null?void 0:s.find(c=>c.contains(e)),r=s==null?void 0:s.find(c=>{const{top:l,right:f,bottom:h,left:$}=c.getBoundingClientRect();return o>=l&&o<=h&&n>=$&&n<=f});a?Vt(t,a)&&a.remove():r?r.focus():e===t&&((i=t.control)==null||i.focus())},Fi=(t,e)=>{var n;const o=e.target;if(!qn(e)||!(o!=null&&o.value.trim()))return;const i=Ut(o),s=[...t.items],r=[...((n=o==null?void 0:o.list)==null?void 0:n.children)||[]].find(f=>Ut(f)===i),c=s.find(f=>f.value===i),l=M("data",(r==null?void 0:r.text)||i,{value:i});if(o.value="",!!Vt(t,c||l)){if(c)return c.remove();if(!s[0])return t.prepend(l);s[s.length-1].insertAdjacentElement("afterend",l)}},Ui=(t,e)=>{var n,o;const{key:i,repeat:s,target:a}=e,r=t.control===a?t.control:null,c=r==null?void 0:r.selectionEnd;let l=r?t.items.length:(n=t._focusIndex)!=null?n:-1;if(!(l===-1||!r&&wi(e))){if(i==="ArrowRight"&&!r)l+=1;else if(i==="ArrowLeft"&&!c)l-=1;else{if(i==="Enter"&&r)return e.preventDefault(),r.dispatchEvent(new Event("input",{bubbles:!0}));if((i==="Backspace"||i==="Delete")&&!c){const f=!s&&t.items[l];if(e.preventDefault(),f)return Vt(t,f)&&f.remove();r&&(l-=1)}else return}e.preventDefault(),(o=t.items[Math.max(0,l)]||t.control)==null||o.focus()}};return Ht.define("u-tags",Ri),X.pagination=to,X.styles=eo,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),X}({});
9
9
  //# sourceMappingURL=index.iife.js.map