@optionfactory/fml 9.0.0-rc33 → 9.0.0-rc35

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/dist/ful.min.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{ParsedElement as e,Attributes as t,Fragments as s,Rendering as i,Localization as r,BoundedCache as a,Templates as n,Nodes as o}from"./ftl.min.mjs";import{Failure as l,HttpClient as d}from"./httpc.min.mjs";const u=e=>{const t=t=>{try{e().removeItem(t)}catch{}},s=s=>{let i;try{i=e().getItem(s)}catch{return}if(null!==i)try{return JSON.parse(i)}catch{return void t(s)}};return{save:(t,s)=>{e().setItem(t,JSON.stringify(s))},load:s,remove:t,pop:e=>{const i=s(e);return t(e),i}}},c=e=>({save(t,s,i){e.save(t,{revision:s,data:i})},load(t,s){const i=e.load(t);if(null!=i&&"object"==typeof i&&i.revision===s)return i.data;e.remove(t)}}),h=u(()=>localStorage),p=u(()=>sessionStorage),f=c(h),m=c(p);class g{static async fireAsync(e,t,s){e.dispatchEvent(t);const i=t.async?.promises??[],r=s?.mode??"broadcast";if("pipeline"===r&&i.length>1||"delegate"===r&&1!==i.length)throw Promise.all(i).catch(()=>{}),new Error("pipeline"===r?`[AsyncEvents] Event "${t.type}" is configured in 'pipeline' mode and expects at most one async listener, but ${i.length} listeners were triggered on this element.`:`[AsyncEvents] Event "${t.type}" is configured in 'delegate' mode and requires exactly one async listener, but ${i.length} were registered.`);return"broadcast"===r?Promise.all(i):Promise.resolve(i[0])}static asyncOn(e,t,s,i){const r=async e=>{const t=e;t.async||(t.async={promises:[]});const{promise:i,resolve:r,reject:a}=Promise.withResolvers();t.async.promises.push(i);try{r(await s(t))}catch(e){a(e)}};return e.addEventListener(t,r,i),r}static asyncOff(e,t,s,i){e.removeEventListener(t,s,i)}static mixInto(...e){for(const t of e)Object.assign(t.prototype,{async fireAsync(e,t){return await g.fireAsync(this,e,t)},asyncOn(e,t,s){return g.asyncOn(this,e,t,s)},asyncOff(e,t,s){g.asyncOff(this,e,t,s)}})}}class b{static guard(e,t){window.addEventListener("beforeunload",t=>{e()&&t.preventDefault()},{signal:t})}}class v{#e=0;take(){return++this.#e,this.hold()}hold(){const e=this.#e,t=this;return{get stale(){return e!==t.#e}}}invalidate(){++this.#e}}const y=e=>{for(let t=e.parentElement;t;t=t.parentElement)if("function"==typeof t.describedBy)return t;return null};class w{static sleep(e){return new Promise(t=>setTimeout(t,e))}static debounce(e,t,s){const i=s?.immediate??!1;let r=null,a=[],n=0;const o=()=>{const s=performance.now()-n;e>s?r=setTimeout(o,e-s):(r=null,i||t(...a),null===r&&(a=[]))};return[(...s)=>{a=s,n=performance.now(),null===r&&(r=setTimeout(o,e),i&&t(...a))},()=>{clearTimeout(r??void 0),r=null,a=[]}]}static throttle(e,t,s){const i=s?.leading??!0,r=s?.trailing??!0;let a=null,n=[],o=0;const l=()=>{o=i?performance.now():0,a=null,t(...n),null===a&&(n=[])};return[(...s)=>{const d=performance.now();o||i||(o=d);const u=0===o?0:e-(d-o);n=s,u<=0||u>e?(null!==a&&(clearTimeout(a),a=null),o=d,t(...n),null===a&&(n=[])):null===a&&r&&(a=setTimeout(l,u))},()=>{clearTimeout(a??void 0),a=null,n=[]}]}}class E{static flatten(e,t,s){return Object.keys(e).reduce((i,r)=>{const a=t.length?`${t}.${r}`:r;return s.has(a)||"object"!=typeof e[r]||null===e[r]?i[a]=e[r]:Object.assign(i,E.flatten(e[r],a,s)),i},{})}static#t=new Set(["__proto__","prototype","constructor"]);static providePath(e,t,s){const i=t.split(".").map(e=>/^[0-9]+$/.test(e)?+e:e);for(const e of i)if(E.#t.has(e))throw new Error(`unsupported name segment '${e}' in '${t}'`);let r=e??{},a=null;for(let t=0;;++t){const n=i[t],o=i[t-1];if(Number.isInteger(n)&&!Array.isArray(r)&&(null!==a?a[o]=r=[]:e=r=[]),t===i.length-1)return r[n]=void 0!==s?s:n in r?r[n]:null,e;"object"==typeof r[n]&&null!==r[n]||(r[n]={}),a=r,r=r[n]}}static extract(e){if("radio"===e.getAttribute("type")){if(!e.checked)return;return"boolean"===e.dataset.fulBindType?"true"===e.value:e.value}return"checkbox"===e.getAttribute("type")?e.checked:"boolean"===e.dataset.fulBindType?e.value?"true"===e.value:null:"SELECT"===e.tagName&&e.multiple?Array.from(e.selectedOptions).map(e=>e.value):"INPUT"!==e.tagName&&"SELECT"!==e.tagName&&"TEXTAREA"!==e.tagName||""!==e.value&&void 0!==e.value?e.value:null}static#s(e){return"submit"===e.type||"reset"===e.type||"button"===e.type}static extractFrom(e,t){let s={};for(const i of e.elements)i.hasAttribute("name")&&(E.#s(i)&&i!==t||i.matches(":disabled")&&i!==t||(s=E.providePath(s,i.getAttribute("name"),E.extract(i))));return s}static mutate(e,t){if("radio"!==e.getAttribute("type"))if("checkbox"!==e.getAttribute("type")){if("SELECT"===e.tagName&&e.multiple){const s=Array.isArray(t)?t.map(String):null==t?[]:[String(t)];return void Array.from(e.options).forEach(e=>{e.selected=s.includes(e.value)})}e.value=t}else e.checked=t;else e.checked=null!=t&&e.getAttribute("value")===String(t)}static mutateIn(e,t){const s=E.#i(e);for(const[e,i]of Object.entries(E.flatten(t,"",new Set(s.keys()))))for(const t of s.get(e)??[])E.mutate(t,i)}static#i(e){const t=new Map;for(const s of e.elements){const e=s.getAttribute("name");if(!e)continue;const i=t.get(e);i?i.push(s):t.set(e,[s])}return t}static errors(e,t,s){const i=t=>t.closest("form")===e;Array.from(e.querySelectorAll("ful-field-error")).filter(i).forEach(e=>{e.setAttribute("aria-live",s?"off":"polite")});const r=e=>("FIELD_ERROR"===e.type||"INVALID_FORMAT"===e.type)&&e.context,a=t.filter(r),n=t.filter(e=>!r(e)),o=E.#i(e);for(const e of o.values())e.forEach(e=>{e.setCustomValidity?.("")});const l=[],d=new Map;a.forEach(e=>{const t=e.context.replace(/\[/g,".").replace(/\]\./g,".").replace(/\]/g,"").split(".");for(let s=t.length;0!==s;--s){const i=t.slice(0,s).join("."),r=(o.get(i)??[]).filter(e=>"function"==typeof e.setCustomValidity);if(0===r.length)continue;const a=t.slice(s).join(".");return void r.forEach(t=>{const s=d.get(t)??new Map;s.set(a,[...s.get(a)??[],e.reason]),d.set(t,s)})}l.push(e)});for(const[e,t]of d)for(const[s,i]of t)e.setCustomValidity(i.join("\n"),s);const u=[...n,...l];e.querySelectorAll("ful-errors").forEach(e=>{if(!i(e))return;const t=e;if(e.setAttribute("role","alert"),0===u.length)return e.replaceChildren(),void e.setAttribute("hidden","");e.removeAttribute("hidden"),t.innerText=u.map(e=>e.reason).join("\n")}),0!==t.length&&s&&Array.from(e.elements).filter(e=>"fieldset"!==e.localName&&e.matches(":invalid")).sort((e,t)=>e.getBoundingClientRect().y-t.getBoundingClientRect().y)[0]?.focus()}}class x extends e{static formAssociated=!0;static observed=["disabled:presence","readonly:presence","required:presence","value"];static ROLE="presentation";#r;#a=null;#n;#o=[];#l=null;#d;#u;#c;#h=[];#p=null;#f=null;constructor(){super(),this.internals.role=this.constructor.ROLE}#m(){return[this.#u??this.#r,...this.#h].filter(e=>e)}#g({fragment:e,control:s,error:i,label:r=null,described:a=null,claims:n=null,announces:o=s,freeze:l=null,also:d=[]}){if(this.#r=s,this.#d=i,this.#u=n,this.#c=o,this.#h=d,l&&l.addEventListener("click",e=>{this.readonly&&e.preventDefault()},!0),this.#n=a??s,i&&(i.id=i.id||t.uid("ful-field-error"),this.#l=i.id),this.#b(),r&&x.#v(this,r,s),this.addEventListener("keydown",e=>{if("Enter"!==e.key||e.defaultPrevented||e.isComposing)return;const t=e.target;t.form!==this.form&&x.#y(t)&&this._requestSubmit()}),this.replaceChildren(e),null!==this.#a){const e=this.#a;this.#a=null,s.focus(e)}if(null!==this.#f){const{error:e,context:t}=this.#f;this.#f=null,this.setCustomValidity(e,t)}}static#y(e){return e instanceof HTMLInputElement&&!["file","button","submit","reset","image"].includes(e.type)}describedBy(e){return!!e&&(e.id||(e.id=t.uid("ful-described")),this.#o.includes(e.id)||this.#o.push(e.id),this.#b(),!0)}#b(){if(!this.#n)return;const e=[...this.#o,this.#l].filter(e=>e);e.length&&this.#n.setAttribute("aria-describedby",e.join(" "))}focus(e){this.#r?this.#r.focus(e):this.#a=e??{}}setCustomValidity(e,s){if(this.#d){if(t.set(this.#c??this.#r,"aria-invalid",e?"true":null),!e)return this.internals.setValidity({}),void(this.#d.innerText="");this.internals.setValidity({customError:!0}," "),this.#d.innerText=e}else this.#f=e?{error:e,context:s}:null}get form(){return this.internals.form}_requestSubmit(){const e=this.form;if(!e)return;const t=e.querySelectorAll("button:not(:disabled), input:not(:disabled)");e.requestSubmit([...t].find(t=>"submit"===t.type&&t.form===e))}_notifyChange(e={}){this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value,...e}}))}static#w=new Set(["BUTTON","INPUT","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA"]);static#v(e,s,i){if(!x.#w.has(i.tagName)||"hidden"===i.getAttribute("type"))return s.id||(s.id=t.uid("ful-label")),i.setAttribute("aria-labelledby",s.id),void s.addEventListener("click",()=>e.focus());i.id||(i.id=t.uid("ful-control")),s.setAttribute("for",i.id)}_interactive(){return!this.matches(":disabled")&&!this.readonly}async upgrade(){if(await super.upgrade(),null===this.#p)return;const{value:e}=this.#p;this.#p=null,this.value=e}_holdValue(e){this.#p={value:e}}_heldValue(){return null===this.#p?this.declared("value"):this.#p.value}get value(){}set value(e){}formResetCallback(){this.value=this.unmarshal("value",this.getAttribute("value"))}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.reflectTo("disabled",e);for(const t of this.#m())t.toggleAttribute("disabled",e)}get readonly(){return this.hasAttribute("readonly")}set readonly(e){for(const t of this.#m())t.readOnly=e;this.#c&&t.set(this.#c,"aria-readonly",e?"true":null),this.reflectTo("readonly",e)}get required(){return this.hasAttribute("required")}set required(e){this.#c&&t.set(this.#c,"aria-required",e?"true":null),this.reflectTo("required",e)}render(e){e.slots?.default&&s.isBlank(e.slots.default)&&e.slots.default.replaceChildren();const t=this._build(e);if(t instanceof Promise)return t.then(e=>this.#g(e));this.#g(t)}_build(e){throw new Error(`${this.constructor.name} must implement _build`)}}class A{#E;#x;#A;#S;#_;constructor(e,t,s,i,r){this.#E=e,this.#x=t,this.#A=s,this.#S=i,this.#_=r}prepare(e,t){return this.#S(e,t)}async submit(e,t){return await this.#E.request(this.#A,this.#x).json(e).fetch()}transform(e,t){return this.#_(e,t)}}class S{#S;#_;constructor(e,t){this.#S=e,this.#_=t}async prepare(e,t){return await this.#S(e,t)}async submit(e,t,s){return s}async transform(e,t){return await this.#_(e,t)}}class _{static create(e,t){const s=e.component("http-client"),i=e.declared("request-mapper")?e.component(e.declared("request-mapper")):e=>e,r=e.declared("response-mapper")?e.component(e.declared("response-mapper")):e=>e,a=e.declared("action");if(!a)return new S(i,r);const n=e.declared("method")??"POST";return new A(s,a,n,i,r)}}const q=e=>void 0!==e.form?e.form:e.constructor?.formAssociated?e.internals?.form:void 0;class C extends e{static attributes=["action","method","loader","request-mapper","response-mapper","clear-invalid-on-change:presence","scroll-on-error:presence","autocomplete","track-changes:presence","guard-leave:presence"];form;render(){const e=document.createElement("form");this.form=e,e.setAttribute("novalidate",""),t.set(e,"autocomplete",this.declared("autocomplete")),t.forward("form-",this,e),e.replaceChildren(...this.childNodes),e.addEventListener("submit",async e=>{e.preventDefault(),e.stopPropagation(),await this.submit(e.submitter??void 0)}),this.addEventListener("click",e=>{const t=e.target;t.closest?.('[aria-disabled="true"]')&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.declared("clear-invalid-on-change")&&this.addEventListener("change",e=>{q(e.target)===this.form&&e.target.setCustomValidity?.("")}),this.replaceChildren(e),this.#q=this.declared("track-changes")||this.declared("guard-leave"),this.#q&&(this.addEventListener("input",e=>this.#C(e.target)),this.addEventListener("change",e=>this.#C(e.target)),this.addEventListener("focusin",e=>this.#k(e.target)),this.form.addEventListener("reset",e=>{if(e.target===this.form){for(const e of new Set([...this.#R.keys(),...this.#T().keys()]))this.#L.set(e,++this.#z);0===this.#N&&(this.#N=requestAnimationFrame(()=>this.#O()))}}),i.waitForChildren(this).catch(()=>{}).then(()=>this.commit()),this.#M())}connectedCallback(){super.connectedCallback(),this.#q&&this.#M()}disconnectedCallback(){this.#I?.abort(),this.#I=null}#F=!1;async submit(e){if(this.#F)return!1;let t,s,i;this.#F=!0,this.spinner(!0);try{const r=this.component(this.declared("loader")??"loaders:form").create(this);t=E.extractFrom(this.form,e);const a=this.#q?{saved:this.#T(),upTo:this.#z}:null;s=await r.prepare(t,this);const n=new CustomEvent("submit",{bubbles:!0,cancelable:!0,detail:{submitter:e,values:t,request:s}});if(!this.dispatchEvent(n))return!1;this.errors=[];const o=new CustomEvent("submit:requested",{bubbles:!0,cancelable:!1,detail:{submitter:e,values:n.detail.values,request:n.detail.request}});let l=await g.fireAsync(this,o,{mode:"pipeline"});s=o.detail.request,l=await r.submit(s,this,l);const d=await r.transform(l,this);a&&this.#B(a.saved,a.upTo),i=new CustomEvent("submit:success",{bubbles:!0,cancelable:!1,detail:{submitter:e,values:t,request:s,response:d}})}catch(r){i=new CustomEvent("submit:failure",{bubbles:!0,cancelable:!1,detail:{submitter:e,values:t,request:s,exception:r}}),r instanceof l?this.errors=r.problems:console.warn("failed to submit form",this,"reason:",r)}finally{this.#F=!1,this.spinner(!1)}return this.dispatchEvent(i),"submit:success"===i.type}async save(e){return!(!this.#q||this.dirty)||await this.submit(e)&&!this.dirty}reset(){this.form.reset(),this.#q&&this.#O()}#R=new Map;#P=new Map;#L=new Map;#z=0;#D=!1;#N=0;#I=null;#q=!1;get dirty(){if(!this.#q)return!1;for(const e of this.#L.keys()){const t=this.#$(e);if((this.#R.has(e)||"[]"!==t)&&(this.#R.get(e)??this.#P.get(e))!==t)return!0}return!1}commit(){this.#q&&this.#B(this.#T(),this.#z)}edited(...e){for(const t of e)this.#C(t)}#B(e,t){this.#R=e;for(const[e,s]of this.#L)s<=t&&this.#L.delete(e);for(const t of this.#P.keys())e.has(t)&&this.#P.delete(t);this.#O()}#W(e){for(let t=e;t&&t!==this;t=t.parentElement)if(q(t)===this.form&&t.hasAttribute("name"))return t.getAttribute("name");return null}#C(e){if(!this.#q)return;const t=this.#W(e);null!==t&&(this.#L.set(t,++this.#z),0===this.#N&&(this.#N=requestAnimationFrame(()=>this.#O())))}#k(e){const t=this.#W(e);null===t||this.#R.has(t)||this.#P.has(t)||this.#P.set(t,this.#$(t))}#V(){return Array.from(this.form.elements).filter(e=>e.hasAttribute("name")&&!["submit","reset","button"].includes(e.type)&&!e.matches(":disabled"))}#T(){const e=new Map;for(const t of this.#V()){const s=t.getAttribute("name");e.set(s,[...e.get(s)??[],E.extract(t)])}return new Map(Array.from(e,([e,t])=>[e,JSON.stringify(t)]))}#$(e){return JSON.stringify(this.#V().filter(t=>t.getAttribute("name")===e).map(e=>E.extract(e)))}#O(){cancelAnimationFrame(this.#N),this.#N=0;const e=this.dirty;this.querySelectorAll("button").forEach(t=>{const s=t;s.form===this.form&&"submit"===s.type&&s.toggleAttribute("data-ful-dirty",e)}),e!==this.#D&&(this.#D=e,e?this.internals.states.add("dirty"):this.internals.states.delete("dirty"),this.dispatchEvent(new CustomEvent("dirty:change",{bubbles:!0,cancelable:!1,detail:{dirty:e}})))}#M(){this.declared("guard-leave")&&!this.#I&&(this.#I=new AbortController,b.guard(()=>this.dirty,this.#I.signal))}#H=0;#j(e){if(t.defaultValue(e,"role","status"),e.hidden=!1,""!==e.textContent.trim())return;const s=document.createElement("span");s.className="ful-sr-only",s.dataset.ref="spinner-label",e.append(s),s.textContent=r.of().t("spinner.loading")}spinner(e){if(e){if(++this.#H,1!==this.#H)return}else if(this.#H=Math.max(0,this.#H-1),0!==this.#H)return;t.set(this,"aria-busy",e?"true":null),this.querySelectorAll("ful-spinner").forEach(t=>{if(t.closest("form")!==this.form)return;const s=t;e?this.#j(s):(s.hidden=!0,s.querySelector(":scope > [data-ref=spinner-label]")?.remove())}),this.querySelectorAll("input,button").forEach(s=>{const i=s;if(i.form===this.form&&("submit"===i.type||"reset"===i.type))if(e)i.dataset.wd=i.getAttribute("aria-disabled")??"",i.setAttribute("aria-disabled","true");else{if(void 0===i.dataset.wd)return;t.set(i,"aria-disabled",i.dataset.wd||null),delete i.dataset.wd}})}set values(e){E.mutateIn(this.form,e)}get values(){return E.extractFrom(this.form)}set errors(e){E.errors(this.form,e,this.declared("scroll-on-error"))}}const k=new a(100),R=(e,t)=>k.getOrCompute(`${e}:${t}`,()=>{try{return new RegExp(t,"g")}catch(s){return console.warn(`invalid ${e} attribute`,t,s),null}}),T={numeric:"numeric",decimal:"decimal"},L=new Set(["date","time","datetime-local","month","week"]),z={numeric:e=>e.replace(/\D/g,""),decimal:e=>{const t=e.replace(/[^\d.,]/g,""),s=t.search(/[.,]/);return-1===s?t:t.slice(0,s+1)+t.slice(s+1).replace(/[.,]/g,"")}};class N extends x{static observed=["placeholder"];static attributes=["type","v-type","keep","reject","uppercase:presence","trim:presence","unsigned:presence","autocomplete"];static slots=!0;static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <input data-tpl-if="type != \'textarea\'" data-tpl-type="type" placeholder=" " form="">\n <textarea data-tpl-if="type == \'textarea\'" placeholder=" " form=""></textarea>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_input;#G=[];#K=null;_type(){return this.declared("type")??("number"===this.declared("v-type")?"number":"text")}_build({slots:e}){const t=this._type(),s=T[t],i=s?"text":t,r=this.template().withOverlay({type:i,slots:e}).render();this.#G=[...r.querySelectorAll(":is(ful-control-group, ful-control) > :is(input, textarea)")],this._input=this.#G[0];const a=this.declared("autocomplete")??(this.closest("form")?.getAttribute("autocomplete")??null);const n=(e=>{const t=e.declared("keep"),s=e.declared("reject");if(null!==t&&null!==s&&console.warn("a ful-input declares both keep and reject: keep is applied, reject is ignored",e),null!==t){const e=R("keep",t);return e&&(t=>(t.match(e)??[]).join(""))}if(null!==s){const e=R("reject",s);return e&&(t=>t.replace(e,""))}return((e,t)=>{const s=z[e];return s?t?s:e=>((e,t)=>(e.startsWith("-")?"-":"")+t(e))(e,s):null})(e._type(),e.declared("unsigned"))})(this);for(const e of this.#G)this.#U(e,s,a,n);return{fragment:r,control:this._input,error:r.querySelector("ful-field-error"),label:r.querySelector("label")}}#U(e,s,i,r){s&&t.set(e,"inputmode",s),t.set(e,"autocomplete",i);const a=e.id;t.forward("input-",this,e),e!==this._input&&t.set(e,"id",a||null),this.#Q(e),e.addEventListener("input",()=>{if(!r)return;const t=e.value,s=r(t);if(t===s)return;const i=e.selectionStart;if(e.value=s,null===i)return;const a=r(t.slice(0,i)).length;e.setSelectionRange(a,a)})}#Q(e){if(!L.has(e.type))return void e.addEventListener("change",e=>{e.stopPropagation(),this._notifyChange()});let t=!1;const s=()=>{t=!1;const e=JSON.stringify(this.value);e!==this.#K&&(this.#K=e,this._notifyChange())};e.addEventListener("focus",()=>{this.#K=JSON.stringify(this.value)}),e.addEventListener("keydown",e=>{"Enter"!==e.key||e.isComposing?t=!0:s()}),e.addEventListener("blur",s),e.addEventListener("change",e=>{e.stopPropagation(),t||s()})}get value(){const e=this.declared("uppercase"),t=this.declared("trim"),s=this._input?this._input.value:`${this._heldValue()??""}`,i=e?s.toUpperCase():s,r=t?i.trim():i;if(""===r)return null;const a="decimal"===this._type()?r.replaceAll(",","."):r;if("number"===this.declared("v-type")){const e=Number(a);return Number.isNaN(e)?a:e}return a}set value(e){this._input?(this._input.value=""===e||null==e?"":`${e}`,this.#K=JSON.stringify(this.value)):this._holdValue(e)}get placeholder(){const e=this._input.getAttribute("placeholder");return" "===e?null:e}set placeholder(e){for(const s of this.#G)t.set(s,"placeholder",e??" ");this.reflectTo("placeholder",e)}}const O=e=>""===e?null:e,M=e=>{const[t,s,i]=e.split("-").map(Number),r=new Date(0);return r.setFullYear(t,s-1,i),r.setHours(0,0,0,0),r.getFullYear()===t&&r.getMonth()===s-1&&r.getDate()===i?r:new Date(Number.NaN)};class I extends e{static attributes=["locale","default"];render(){const e=M(this.textContent.trim());if(Number.isNaN(e.getTime()))return void this.replaceChildren(this.declared("default")??"");const{date:t}=r.of({locale:this.declared("locale")??void 0});this.replaceChildren(t(e,{year:"numeric",month:"numeric",day:"numeric"}))}}class F extends e{static attributes=["locale","default"];render(){const e=this.textContent.trim(),t=""===e?null:new Date(F.isoToLocal(e));if(null===t||Number.isNaN(t.getTime()))return void this.replaceChildren(this.declared("default")??"");const{date:s}=r.of({locale:this.declared("locale")??void 0});this.replaceChildren(s(t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}))}static#J(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?M(e):new Date(e)}static isoToLocal(e){const t=F.#J(e),s=(e,t)=>String(t).padStart(e,"0");return`${t.getFullYear()}-${s(2,t.getMonth()+1)}-${s(2,t.getDate())}T${s(2,t.getHours())}:${s(2,t.getMinutes())}:${s(2,t.getSeconds())}.${s(3,t.getMilliseconds())}`}static localToIso(e){const t=F.#J(e);return Number.isNaN(t.getTime())?null:t.toISOString()}}class B extends N{static observed=["step","min","max"];_type(){return"date"}get min(){return O(this._input.min)}set min(e){this._input.min=B.#Y(e)}get max(){return O(this._input.max)}set max(e){this._input.max=B.#Y(e)}get step(){return O(this._input.step)}set step(e){this._input.step=e??""}static#Y(e){if(!e)return"";const t=e=>new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString().split("T")[0];if("now"===e)return t(new Date);const s=/^([+-])(\d+)([dmy])$/.exec(e);if(!s)return e;const i="-"===s[1]?-1:1,r=+s[2],a=new Date;switch(a.setHours(0,0,0,0),s[3]){case"d":a.setDate(a.getDate()+r*i);break;case"m":{const e=a.getDate();a.setMonth(a.getMonth()+r*i),a.getDate()!==e&&a.setDate(0);break}case"y":a.setFullYear(a.getFullYear()+r*i)}return t(a)}}class P extends B{_type(){return"time"}get min(){return O(this._input.min)}set min(e){this._input.min=this.#X(e)}get max(){return O(this._input.max)}set max(e){this._input.max=this.#X(e)}#X(e){if(!e)return"";const t=new Date;if("now"!==e){const s=/^([+-])(\d+)([hm])$/.exec(e);if(!s)return e;const i="-"===s[1]?-1:1,r=+s[2]*i;"h"===s[3]?t.setHours(t.getHours()+r):t.setMinutes(t.getMinutes()+r)}return P.#Z(t,Number(this._input.step)||60)}static#Z(e,t){const s=e=>String(e).padStart(2,"0"),i=3600*e.getHours()+60*e.getMinutes()+e.getSeconds(),r=Math.floor(i/t)*t,a=s(Math.floor(r/3600)),n=s(Math.floor(r%3600/60));return t%60==0?`${a}:${n}`:`${a}:${n}:${s(r%60)}`}}class D extends N{static observed=["step","min","max"];_type(){return"datetime-local"}get value(){if(!this._input){const e=this._heldValue();return F.localToIso(e?F.isoToLocal(e):"")}return F.localToIso(this._input.value)}set value(e){this._input?super.value=e?F.isoToLocal(e):"":this._holdValue(e)}get min(){return F.localToIso(this._input.min)}set min(e){this._input.min=e?F.isoToLocal(e):""}get max(){return F.localToIso(this._input.max)}set max(e){this._input.max=e?F.isoToLocal(e):""}get step(){return O(this._input.step)}set step(e){this._input.step=e??""}}class $ extends N{static WARNING_TIMEOUT=5e3;static list(e=[]){const t=new DataTransfer;for(const s of e)t.items.add(s);return t.files}static observed=["placeholder","accept:csv","multiple:presence","item-list:presence","dropzone:presence","no-input:presence","max-files:number","max-file-size:number","max-total-size:number","value"];#ee;#te;#se;#ie;#re;_type(){return"file"}static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <input data-tpl-type="type" placeholder=" " form="">\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <div data-ref="dropzone" class="dropzone" data-tpl-if="slots.dropzone">\n {{{{ slots.dropzone }}}}\n </div>\n <div data-ref="dropzone" class="default-dropzone" data-tpl-if="!slots.dropzone">\n {{ #l10n:t(\'files.dropzone-label\') }}\n </div>\n <ful-item-list></ful-item-list>\n <ful-field-warnings role="status" aria-live="polite"></ful-field-warnings>\n <ful-field-error></ful-field-error>\n ';static templates={items:'\n <ful-item data-tpl-each="files" data-tpl-var="file" data-tpl-data-name="file.name">\n <div><span>{{ file.name }}</span><span>{{ #l10n:bytes(file.size) }}</span><button type="button" data-tpl-aria-label="#l10n:t(\'files.remove\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button></div>\n </ful-item>\n ',warning:"<ful-field-warning>{{ #l10n:t(key, args) }}</ful-field-warning>"};#ae;_build(e){const t=super._build(e),i=t.fragment;return this.#te=i.querySelector("ful-item-list"),this.#ae=e.slots?.items&&!s.isBlank(e.slots.items)?n.fromFragment(e.slots.items):null,this.#se=i.querySelector("[data-ref=dropzone]"),this.#ie=i.querySelector("ful-field-warnings"),this.#re=i.querySelector("ful-control-group"),this.#ie.addEventListener("animationend",e=>{e.target.remove()}),this.#te.addEventListener("click",e=>{if(!e.target.closest("button"))return;if(!this._interactive())return;const t=[...this.#te.children].indexOf(e.target.closest("ful-item"));-1!==t&&(this.files=$.list([...this.files].filter((e,s)=>s!==t)),this._notifyChange())}),this.#se.addEventListener("click",e=>{this._interactive()&&this._input.click()}),this.#se.addEventListener("dragover",e=>{e.preventDefault(),this.toggleAttribute("dragover",!0)}),this.#se.addEventListener("dragleave",()=>{this.toggleAttribute("dragover",!1)}),this.#se.addEventListener("drop",e=>{if(e.preventDefault(),this.toggleAttribute("dragover",!1),!this._interactive())return;const t=[...e.dataTransfer.items].filter(e=>"file"===e.kind).map(e=>e.getAsFile()).filter(e=>null!==e);0===t.length||t.length>1&&!this.multiple||(this.files=$.list(t),this._notifyChange())}),this._input.addEventListener("change",()=>{this.#ne()},{capture:!0}),{...t,freeze:this.#re}}#ne(){this.setCustomValidity(),this.#ie.replaceChildren(),this.#oe(),this.#le(),this.#de(),this.#ue(),(this.#ae??this.template("items")).withOverlay({files:this.files}).renderTo(this.#te)}warning(e,t){this.template("warning").withOverlay({key:e,args:t}).appendTo(this.#ie);const s=this.#ie.lastElementChild;setTimeout(()=>s.remove(),$.WARNING_TIMEOUT)}#ce(e){const t=e.name.toLowerCase();return this.#ee.some(s=>{const i=s.toLowerCase().split(";")[0].trim();return i.startsWith(".")?t.endsWith(i):i.endsWith("/*")?e.type.startsWith(`${i.slice(0,-1)}`):i.includes("/")&&e.type===i})}#oe(){if(!this.#ee.length)return;const e=[...this.files].filter(e=>!this.#ce(e));0!==e.length&&(this.warning("files.unacceptable-file-type",{types:this.#ee.join(", ")}),this._input.files=$.list([...this.files].filter(t=>!e.includes(t))))}#ue(){null!==this.#he&&(this.files.length<=this.#he||(this.warning("files.max-files-exceeded",{count:this.#he}),this._input.files=$.list()))}#le(){if(null===this.#pe)return;const e=[...this.files].filter(e=>e.size>this.#pe);0!==e.length&&(this.warning("files.max-file-size-exceeded",{size:r.of().bytes(this.#pe)}),this._input.files=$.list([...this.files].filter(t=>!e.includes(t))))}#de(){null!==this.#fe&&([...this.files].reduce((e,t)=>e+t.size,0)<=this.#fe||(this.warning("files.max-total-size-exceeded",{size:r.of().bytes(this.#fe)}),this._input.files=$.list()))}get accept(){return this.#ee}set accept(e){this._input.accept=e.join(","),this.#ee=e,this.reflectTo("accept",e)}get multiple(){return this._input?this._input.multiple:this.declared("multiple")}set multiple(e){this._input.multiple=e,this.reflectTo("multiple",e)}get files(){return this._input?this._input.files:$.list()}set files(e){this._input.files=e,this.#ne()}get file(){return this.files[0]??null}set file(e){this.files=$.list(e?[e]:[])}get value(){const e=Array.from(this.files).map(e=>e.name);return this.multiple?e:e[0]??null}set value(e){!e&&this._input&&(this.files=$.list())}formResetCallback(){this.value=null}get totalSize(){return Array.from(this.files).reduce((e,t)=>e+t.size,0)}#he;get maxFiles(){return this.#he}set maxFiles(e){this.#he=e,this.reflectTo("max-files",e)}#pe;get maxFileSize(){return this.#pe}set maxFileSize(e){this.#pe=e,this.reflectTo("max-file-size",e)}#fe;get maxTotalSize(){return this.#fe}set maxTotalSize(e){this.#fe=e,this.reflectTo("max-total-size",e)}#me;get itemList(){return this.#me}set itemList(e){this.#me=e,this.reflectTo("item-list",e)}#ge;get dropzone(){return this.#ge}set dropzone(e){this.#ge=e,this.reflectTo("dropzone",e)}#be;get noInput(){return this.#be}set noInput(e){this.#be=e,this.reflectTo("no-input",e)}}const W=new Map;let V=0,H=!1;const j=(e,t,s)=>Math.min(Math.max(e,t),Math.max(t,s)),G=(e,t)=>{const{invoker:s,stretch:i}=t,r=s.getBoundingClientRect(),a=document.documentElement,n=a.clientWidth,o=a.clientHeight;e.style.removeProperty("margin");const l=getComputedStyle(e),d=parseFloat(l.marginTop)||0,u=parseFloat(l.marginRight)||0,c=parseFloat(l.marginBottom)||0,h=parseFloat(l.marginLeft)||0;if(e.style.right="auto",e.style.bottom="auto",e.style.margin="0",i){e.style.removeProperty("width"),e.style.removeProperty("min-width"),e.style.removeProperty("max-width");const t=Math.min(parseFloat(l.maxWidth)||n,n-16);e.style.minWidth=`${Math.min(r.width,n-16)}px`,e.style.maxWidth=`${t}px`;const s=e.getBoundingClientRect().width;e.style.left=`${j(r.left,8,n-s-8)}px`;const i=e.getBoundingClientRect().height,a=r.bottom+d,u=a+i<=o-8?a:r.top-c-i;return void(e.style.top=`${j(u,8,o-i-8)}px`)}const p=(e=>e.matches("ful-note, .ful-note, [placement]"))(e),f=p?e.getAttribute("placement")??"bottom":"bottom";e.style.removeProperty("max-width");const m=Math.min(parseFloat(l.maxWidth)||n,n-16);e.style.maxWidth=`${m}px`,e.style.left="8px";const g=e.getBoundingClientRect().width;let b="right"===f?r.right+h:"left"===f?r.left-u-g:p?r.left+r.width/2-g/2:r.left;b=j(b,8,n-g-8),e.style.left=`${b}px`,e.style.maxWidth=`${Math.min(m,n-8-b)}px`;const v=e.getBoundingClientRect().height,y="top"===f?r.top-c-v:"right"===f||"left"===f?r.top+r.height/2-v/2:r.bottom+d;e.style.top=`${j(y,8,o-v-8)}px`,p&&((e,t)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();e.style.setProperty("--ful-note-callout-inline",s.left+s.width/2-i.left-e.clientLeft+"px"),e.style.setProperty("--ful-note-callout-block",s.top+s.height/2-i.top-e.clientTop+"px")})(e,s)},K=()=>{V=0;for(const[e,t]of W)e.isConnected&&t.invoker.isConnected?G(e,t):W.delete(e)},U=()=>{!V&&W.size>0&&(V=requestAnimationFrame(K))};class Q{static wire(e,s,{prefix:i="ful-anchor",invoke:r=!1,expanded:a=!1,stretch:n=!1,handPlace:o=!1}={}){const l=t.uid(i);if(r)if(s.id=s.id||l,"button"===e.localName||"input"===e.localName)e.setAttribute("popovertarget",s.id);else{let t=!1;e.addEventListener("pointerdown",()=>{t=s.matches(":popover-open")},!0),e.addEventListener("click",()=>{const e=t&&!s.matches(":popover-open");t=!1,e||s.togglePopover()}),e.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s.togglePopover())})}const d=`--${l}`;if(e.style.anchorName=d,s.style.positionAnchor=d,a&&(e.setAttribute("aria-expanded","false"),s.addEventListener("toggle",t=>{e.setAttribute("aria-expanded","open"===t.newState?"true":"false")})),!o&&CSS.supports("anchor-name: --ful-probe")&&CSS.supports("position-anchor: --ful-probe")&&CSS.supports("position-area: bottom")&&CSS.supports("top: anchor(bottom)")&&CSS.supports("width: anchor-size(width)"))return;const u={invoker:e,stretch:n};s.addEventListener("beforetoggle",e=>{"open"===e.newState&&((e,t)=>{e.style.visibility="hidden",queueMicrotask(()=>{e.matches(":popover-open")&&G(e,t),e.style.removeProperty("visibility")})})(s,u)}),s.addEventListener("toggle",e=>{"open"===e.newState?(W.set(s,u),G(s,u)):(W.delete(s),(e=>{for(const t of["top","left","right","bottom","margin","max-width","min-width","width","visibility","--ful-note-callout-inline","--ful-note-callout-block"])e.style.removeProperty(t)})(s))}),H||(H=!0,document.addEventListener("scroll",U,!0),window.addEventListener("resize",U))}static show(e,t,{flip:s=!1,gap:i=0}={}){return"function"!=typeof e.showPopover||e.matches(":popover-open")||e.showPopover(),(()=>{const r=t instanceof Element?t.getBoundingClientRect():t,a=document.documentElement,n=e.getBoundingClientRect(),o=r.bottom+i,l=r.top-i-n.height,d=s&&o+n.height>a.clientHeight-8&&l>=8?l:o;e.style.right="auto",e.style.bottom="auto",e.style.margin="0",e.style.left=`${j(r.left,8,Math.max(8,a.clientWidth-n.width-8))}px`,e.style.top=`${j(d,8,Math.max(8,a.clientHeight-n.height-8))}px`})(),e}}const J=(e,t)=>e.filter(({key:e})=>t.some(t=>String(t)===String(e))),Y=(e,t)=>e.filter(({label:e})=>(e??"").toLowerCase().includes(t?.toLowerCase()??""));class X{#E;#x;#A;#_;#ve;#ye;#we=null;#Ee=null;#xe=new v;constructor({http:e,url:t,method:s,responseMapper:i,prefetch:r,revision:a}){this.#E=e,this.#x=t,this.#A=s,this.#_=i,this.#ve=r,this.#ye=a}async prefetch(){this.#ve&&await this.#Ae()}async exact(...e){return J(await this.#Ae(),e)}async load(e){return Y(await this.#Ae(),e)}async invalidate(){this.#xe.invalidate(),this.#we=null,this.#Ee=null}async#Ae(){if(null===this.#we){if(null===this.#Ee){const e=this.#xe.hold();this.#Ee=X.#Se(this.#E,this.#A,this.#x,this.#ye).then(t=>{e.stale||(this.#we=this.#_(t))}).finally(()=>{e.stale||(this.#Ee=null)})}await this.#Ee}if(null===this.#we)throw new Error("superseded by an invalidation");return this.#we}static async#Se(e,t,s,i){const r=`${t}@${s}`;if(null!==i){const e=f.load(r,i);if(void 0!==e)return e}const a=await e.request(t,s).fetchJson();if(null!==i)try{f.save(r,i,a)}catch(e){console.warn("failed to cache the select options",e)}return a}}class Z{#E;#x;#A;#_;constructor({http:e,url:t,method:s,responseMapper:i}){this.#E=e,this.#x=t,this.#A=s,this.#_=i}async invalidate(){}async exact(...e){const t=await this.#E.request(this.#A,this.#x).param("k",...e).fetchJson();return this.#_(t)}async load(e){const t=await this.#E.request(this.#A,this.#x).param("s",e).fetchJson();return this.#_(t)}}class ee{#we;constructor(e){this.#we=e}update(e){this.#we=e}async invalidate(){}exact(...e){return J(this.#we,e)}load(e){return Y(this.#we,e)}}class te{static from({data:e,http:t,url:s,method:i="POST",mode:r,prefetch:a=!1,revision:n=null,responseMapper:o}){return s?"chunked"===r?new Z({http:t,url:s,method:i,responseMapper:o}):new X({http:t,url:s,method:i,responseMapper:o,prefetch:a,revision:n}):new ee(e??[])}static create(e,t){if(!e.declared("src")){const e=Array.from(t.options?.querySelectorAll("option")??[]);return te.from({data:e.map(e=>({key:e.getAttribute("value")??e.innerText.trim(),label:e.innerText.trim(),metadata:void 0}))})}return te.from({http:e.component("http-client"),url:e.declared("src"),method:e.declared("method")??"POST",mode:e.declared("mode"),prefetch:e.declared("preload"),revision:te.#_e(e),responseMapper:te.#qe(e)})}static#_e(e){const t=e.declared("revision");if(""!==t)return t;const s=e.component("revision");return null==s?(console.warn("a valueless revision asks the registry for one, and no 'revision' component is defined: the vocabulary will not be cached",e),null):"function"==typeof s?s():s}static#qe(e){return e.declared("k-expr")&&e.declared("l-expr")?t=>e._registry.evaluator().withOverlay(t).evaluateExpression(e.declared("d-expr")??"self").map(t=>{const s=e._registry.evaluator().withOverlay(t);return{key:s.evaluateExpression(e.declared("k-expr")),label:s.evaluateExpression(e.declared("l-expr")),metadata:s.evaluateExpression(e.declared("m-expr")??"self")}}):e.declared("response-mapper")?e.component(e.declared("response-mapper")):e=>e.map(([e,t,s])=>({key:e,label:t,metadata:s}))}}class se extends e{static attributes=["listbox"];static slots=!0;static template='\n <ful-spinner class="centered" role="status" hidden><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner>\n <ful-empty data-ref="empty" aria-live="polite" hidden>{{ #l10n:t(\'dropdown.empty\') }}</ful-empty>\n <menu tabindex="-1" role="listbox" hidden></menu>\n ';static templates={options:'\n <li data-tpl-each="self" data-tpl-selected="index == 0" data-tpl-value="index" role="option">\n {{ label }}\n </li>\n '};#Ce;#ke;#Re;#Te;#Le=new Map;#ze=new v;render({slots:e}){const i=this.template().render();this.#Te=s.isBlank(e.default)?this.template("options"):n.fromFragment(e.default),this.#Ce=i.querySelector("ful-spinner"),this.#Re=i.querySelector("[data-ref=empty]"),this.#ke=i.querySelector("menu"),this.#ke.id=this.declared("listbox")||t.uid("ful-listbox"),this.#ke.addEventListener("mousedown",e=>{e.target.closest("li")&&e.preventDefault()}),this.#ke.addEventListener("click",e=>{e.stopPropagation();const t=e.target.closest("li");t?t.matches('[aria-disabled="true"]')||this.#Ne(t):this.hide()}),this.replaceChildren(i)}#Oe(){return!this.#ke||this.#ke.hidden?null:this.#ke.querySelector("li[selected]")??this.#ke.querySelector('li:not([aria-disabled="true"])')}#Me(e){if(e){for(const t of this.#ke.querySelectorAll("li"))t.toggleAttribute("selected",t===e);e.id||=t.uid("ful-option"),this.#Ie(e.id),e.scrollIntoView({block:"nearest",behavior:matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"})}else this.#Ie(null)}acceptSelection(){const e=this.#Oe();e&&!e.matches('[aria-disabled="true"]')&&this.#Ne(e)}update(e,t=[]){if(void 0===e)throw new Error("null data");this.#Le=new Map(e.map((e,t)=>[String(t),e]));const s=e.map((e,t)=>({index:t,...e}));this.#Te.withOverlay(s).renderTo(this.#ke);for(const[s,i]of[...this.#ke.children].entries()){const r=e[s],a=t.some(e=>String(e)===String(r?.key));i.toggleAttribute("picked",a),i.setAttribute("aria-selected",a?"true":"false");const n=!!r?.metadata?.disabled;n?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),n&&r.metadata.reason?i.setAttribute("title",String(r.metadata.reason)):i.removeAttribute("title")}this.#Re.toggleAttribute("hidden",0!==e.length),this.#ke.toggleAttribute("hidden",0===e.length);const i=e.findIndex(({key:e})=>t.some(t=>String(t)===String(e)));this.#Me(i>=0?this.#ke.children[i]:this.#ke.querySelector('li[selected]:not([aria-disabled="true"])')??this.#ke.querySelector('li:not([aria-disabled="true"])'))}#Ne(e){const t=e.getAttribute("value"),s=this.#Le.get(t);this.hide(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{index:t,entry:s}}))}hide(){this.#ze.invalidate(),this.matches(":popover-open")&&this.hidePopover(),this.#Ie(null)}#Ie(e){this.dispatchEvent(new CustomEvent("activechange",{bubbles:!1,cancelable:!1,detail:{id:e}}))}get shown(){return this.matches(":popover-open")}async show(e,t=[]){const s=this.#ze.take();this.matches(":popover-open")||this.showPopover(),this.#ke.setAttribute("hidden",""),this.#Ce.removeAttribute("hidden");try{const i=await e();if(s.stale)return;this.update(i,t)}catch(e){if(s.stale)return;throw this.hide(),e}finally{s.stale||this.#Ce.setAttribute("hidden","")}}async moveOrShow(e,t,s=[]){if(this.shown){const t=this.#Oe(),s=t?.[(e?"next":"previous")+"ElementSibling"],i=s?this.#Fe(s,e):null;return void(t&&i&&this.#Me(i))}await this.show(t,s)}#Fe(e,t){for(let s=e;s;s=s[(t?"next":"previous")+"ElementSibling"])if(!s.matches('[aria-disabled="true"]'))return s;return null}jump(e){if(this.#ke.hidden)return;const t=e?this.#ke.firstElementChild:this.#ke.lastElementChild,s=this.#Fe(t,e);s&&this.#Me(s)}page(e){const t=this.#Oe();if(!t)return;let s=t;for(let t=0;t!==this.#Be();++t){const t=this.#Fe(s[(e?"next":"previous")+"ElementSibling"],e);if(!t)break;s=t}this.#Me(s)}#Be(){const e=this.#ke.firstElementChild;return e&&0!==e.offsetHeight?Math.max(1,Math.trunc(this.#ke.clientHeight/e.offsetHeight)):1}}class ie extends x{static attributes=["name","loader","k-type","mode","preload:presence","revision","k-expr","l-expr","d-expr","m-expr","response-mapper"];static observed=["multiple:presence","item-list:presence","value:csv","src","method"];unmarshal(e,t){return"value"!==e||""!==t||this.hasAttribute("multiple")?super.unmarshal(e,t):[""]}static slots=!0;static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-control>\n <input type="text" form="" autocomplete="off" role="combobox" aria-autocomplete="list" aria-haspopup="listbox" aria-expanded="false">\n </ful-control>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n <ful-dropdown popover="manual">{{{{ slots.dropdown }}}}</ful-dropdown>\n </ful-control-group>\n <ful-item-list></ful-item-list>\n <ful-field-error></ful-field-error>\n ';static templates={items:'\n <ful-item data-tpl-each="entries" data-tpl-var="entry" data-tpl-data-key="entry.key">\n <div><span>{{ entry.label }}</span><button type="button" data-tpl-aria-label="#l10n:t(\'select.remove\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button></div>\n </ful-item>\n '};#Pe;#De={src:null,method:null};#Le;#r;#$e;#We;#Ve;#te;#ae;#He;#je=!1;#Ge=new Map;#Ke=new v;#Ue=!1;#Qe;#Je;_build({slots:e}){const i=this.declared("name");this.#Le=e.options,this.#Ye(),this.#He=this.declared("multiple"),this.#Pe.prefetch?.()?.catch(e=>{console.warn("failed to prefetch select options",this,"reason:",e)});const r=this.template().withOverlay({slots:e,name:i}).render();this.#We=r.querySelector("ful-control > input"),this.#Ve=r.querySelector("label"),this.#te=r.querySelector("ful-item-list"),this.#ae=e.items&&!s.isBlank(e.items)?n.fromFragment(e.items):null,t.forward("input-",this,this.#We),this.#r=r.querySelector("ful-control"),this.#$e=r.querySelector("ful-dropdown");const a=t.uid("ful-listbox");this.#$e.setAttribute("listbox",a),this.#We.setAttribute("aria-controls",a),this.#$e.addEventListener("beforetoggle",e=>{const t="open"===e.newState;this.#We.setAttribute("aria-expanded",t?"true":"false"),t||this.#We.removeAttribute("aria-activedescendant")}),this.#$e.addEventListener("activechange",e=>{t.set(this.#We,"aria-activedescendant",e.detail.id)});const o=r.querySelector("ful-control-group");return Q.wire(o,this.#$e,{prefix:"ful-select",stretch:!0}),[this.#Qe,this.#Je]=w.throttle(400,()=>this.#Xe()),this.#Ze(),this.#et(),this.#tt(),this.#st(),{fragment:r,control:this.#We,error:r.querySelector("ful-field-error"),label:this.#Ve}}#Ze(){this.addEventListener("click",e=>{if(!this._interactive()||this.#Ve.contains(e.target))return;const t=e.target.closest('button, [role="button"], a[href], input, select, textarea');if(!t||t===this.#We){if(this.#$e.shown)return this.#Je(),void this.#it();this.#We.focus(),this.#Qe()}}),this.#te.addEventListener("click",e=>{e.stopPropagation(),e.target.closest("button")&&this._interactive()&&this.#rt([...this.#te.children].indexOf(e.target.closest("ful-item")))}),this.#r.addEventListener("click",e=>{const t=e.target instanceof Element?e.target.closest("ful-badge"):null;t&&(e.stopPropagation(),this.#at(t))})}#et(){this.addEventListener("keydown",e=>{const t=e.target instanceof Element?e.target.closest("ful-badge"):null;t?this.#nt(e,t):"ArrowLeft"===e.code&&e.target===this.#We&&0===this.#We.selectionStart&&0===this.#We.selectionEnd&&this.#ot().at(-1)?.focus()})}#tt(){this.#We.addEventListener("change",e=>{e.stopPropagation()}),this.#We.addEventListener("focus",()=>{this.#Ue||this.#We.select()}),this.#We.addEventListener("blur",e=>{e.stopPropagation(),e.relatedTarget&&this.contains(e.relatedTarget)||(this.#Je(),this.#it(!0))}),this.#We.addEventListener("keydown",e=>{this._interactive()&&this.#lt(e)}),this.#We.addEventListener("input",e=>{e.stopPropagation(),this._interactive()&&(this.#Ue=!0,this.#Qe())})}#st(){this.#$e.addEventListener("change",e=>{e.stopPropagation(),this.#Je(),this._interactive()?(this.#He||this.#Ge.clear(),this.#Ue=!1,this.#Ge.set(this.#dt(e.detail.entry.key),e.detail.entry),this.#ut(),this.#We.focus(),this.#$e.hide(),this.#He||this.#We.select()):this.#it()})}async withLoader(e){return await e(this.#Pe)}async reload(){await(this.#Pe.invalidate?.()),await(this.#Pe.prefetch?.());const e=[...this.#Ge.keys()];0!==e.length&&await this.#ct(e,this.#Ke.take()),this.#$e.shown&&await this.#Xe()}get src(){return this.getAttribute("src")}set src(e){this.reflectTo("src",e??null),this.#ht()&&this.reload()}get method(){return this.getAttribute("method")}set method(e){this.reflectTo("method",e??null),this.#ht()&&this.reload()}async reconfigure(e,{notify:t=!1}={}){for(const t of["src","method"])t in e&&this.reflectTo(t,e[t]??null);this.#ht();const s=[...this.#Ge.keys()];await this.reload();const i=[...this.#Ge.keys()];t&&i.length!==s.length&&this._notifyChange({entry:this.entry})}#Ye(){this.#De={src:this.getAttribute("src"),method:this.getAttribute("method")},this.#Pe=this.component(this.declared("loader")??"loaders:select").create(this,{options:this.#Le})}#ht(){return(this.getAttribute("src")!==this.#De.src||this.getAttribute("method")!==this.#De.method)&&(this.#Je(),this.#it(),this.#Ye(),!0)}#ot(){return Array.from(this.#r.querySelectorAll(":scope > ful-badge"))}#at(e){this._interactive()&&this.#rt(this.#ot().indexOf(e))}#rt(e){const t=Array.from(this.#Ge.keys())[e];void 0!==t&&(this.#Ge.delete(t),this.#ut())}#nt(e,t){switch(e.code){case"NumpadEnter":case"Enter":case"Space":case"Backspace":case"Delete":e.preventDefault(),this.#at(t),this.#We.focus();break;case"ArrowLeft":e.preventDefault(),(this.#ot()[this.#ot().indexOf(t)-1]??this.#We).focus();break;case"ArrowRight":e.preventDefault(),(this.#ot()[this.#ot().indexOf(t)+1]??this.#We).focus();break;case"Escape":this.#We.focus()}}#lt(e){switch(e.code){case"ArrowUp":case"ArrowDown":e.preventDefault(),this.#pt(e);break;case"Home":this.#$e.shown&&(e.preventDefault(),this.#$e.jump(!0));break;case"End":this.#$e.shown&&(e.preventDefault(),this.#$e.jump(!1));break;case"PageDown":case"PageUp":this.#$e.shown&&(e.preventDefault(),this.#$e.page("PageDown"===e.code));break;case"Escape":this.#Je(),this.#it();break;case"NumpadEnter":case"Enter":if(!this.#$e.shown)return;e.preventDefault(),this.#Je(),this.#Ue=!1,this.#ft(),this.#$e.acceptSelection();break;case"Backspace":0===this.#We.selectionStart&&0===this.#We.selectionEnd&&this.#rt(this.#Ge.size-1);break;case"Tab":this.#Je(),this.#it(!0)}}#pt(e){const t="ArrowDown"===e.code;e.altKey?t&&!this.#$e.shown?this.#Xe():!t&&this.#$e.shown&&(this.#Je(),this.#it()):this.#$e.moveOrShow(t,()=>this.#Pe.load(this.#mt()),[...this.#Ge.keys()])}#it(e=!1){this.#$e.hide();const t=e&&this.#Ue&&!this.#He&&""===this.#We.value&&0!==this.#Ge.size;this.#Ue=!1,t&&(this.#Ge.clear(),this.#ut()),this.#ft()}#Xe(){return this.#$e.show(()=>this.#Pe.load(this.#mt()),[...this.#Ge.keys()])}#mt(){return this.#Ue?this.#We.value:""}get query(){return this.#mt()}#ft(){const e=this.#Ge.values().next().value;this.#We.value=this.#He?"":e?.label??""}#gt(){return[...this.#Ge.values()]}#ut(){this.#bt(),this._notifyChange({entry:this.entry})}#bt(){const e=this.#He?Array.from(this.#Ge.entries()).map(([e,t],s)=>{const i=document.createElement("ful-badge");return i.setAttribute("role","button"),i.setAttribute("tabindex",0===s?"0":"-1"),i.setAttribute("value",e),i.innerText=t.label,i}):[];for(const e of this.#r.querySelectorAll(":scope > ful-badge"))e.remove();this.#We.before(...e),this.#Ue||this.#ft(),this.#te.replaceChildren(),(this.#ae??this.template("items")).withOverlay({entries:this.#gt()}).renderTo(this.#te)}#dt(e){switch(this.declared("k-type")){case"number":{const t=""===e?Number.NaN:Number(e);return Number.isNaN(t)?e:t}case"boolean":return!0===e||"true"===e||!1!==e&&"false"!==e&&e;default:return String(e)}}set value(e){if(!this.#r)return void this._holdValue(e);const t=(null==e?[]:Array.isArray(e)?e:[e]).map(e=>this.#dt(e)),s=this.#He?t:t.slice(0,1);!this.#je&&s.some(e=>"string"==typeof e&&e.includes(","))&&(this.#je=!0,console.warn("a ful-select key cannot contain a comma: it is unexpressible in the value attribute",this)),this.#Ge=new Map(s.map(e=>[e,{key:e,label:e,metadata:void 0}]));const i=this.#Ke.take();this.#bt(),0!==s.length&&this.#ct(s,i)}async#ct(e,t){const s=await this.#Pe.exact(...e);if(t.stale)return;const i=new Map(s.map(e=>[this.#dt(e.key),e]));for(const t of e)this.#Ge.has(t)&&(i.has(t)?this.#Ge.set(t,i.get(t)):this.#Ge.delete(t));this.#bt()}get value(){if(!this.#r){const e=[this._heldValue()??[]].flat().map(e=>this.#dt(e));return this.multiple?e:e[0]??null}return this.#He?[...this.#Ge.keys()]:[...this.#Ge.keys()][0]??null}get entry(){const e=this.#gt();return this.#He?e:e[0]??null}get disabled(){return super.disabled}set disabled(e){super.disabled=e,e&&this.#$e?.shown&&(this.#Je(),this.#it())}get readonly(){return super.readonly}set readonly(e){super.readonly=e,e&&this.#$e?.shown&&(this.#Je(),this.#it())}#me;get multiple(){return this.#He??this.declared("multiple")}set multiple(e){this.#He=e,this.reflectTo("multiple",e),e||(this.#Ge=new Map([...this.#Ge].slice(0,1))),this.#r&&this.#bt()}get itemList(){return this.#me}set itemList(e){this.#me=e,this.reflectTo("item-list",e)}}class re extends x{static attributes=["name","type"];static slots=!0;static ROLE="radiogroup";static template='\n <fieldset>\n <legend>{{{{ slots.default }}}}</legend>\n <header data-tpl-if="slots.header">\n {{{{ slots.header }}}}\n </header>\n <ful-radio-list>\n <div class="label-wrapper" data-tpl-each="inputsAndLabels" data-tpl-var="ial">\n <label>\n {{{{ ial[0] }}}}\n <div>{{{{ ial[1] }}}}</div>\n </label>\n </div>\n </ful-radio-list>\n <ful-field-error></ful-field-error>\n <footer data-tpl-if="slots.footer">\n {{{{ slots.footer }}}}\n </footer>\n </fieldset>\n ';#vt;#yt;#wt;_build({slots:e}){const i=t.uid(this.declared("name")??"ful-radiogroup"),r=Array.from(e.default.querySelectorAll("ful-radio")),a=r.map(e=>{const r=document.createElement("input");return r.setAttribute("type","radio"),t.forward("input-",this,r),t.forward("",e,r),r.setAttribute("name",`${i}-ignore`),r.setAttribute("form",""),r.addEventListener("change",e=>{e.stopPropagation(),this._notifyChange()}),[r,s.fromChildNodes(e)]});r.forEach(e=>{e.remove()}),s.isBlank(e.default)&&e.default.replaceChildren();const n=this.template().withOverlay({name:i,slots:e,inputsAndLabels:a}).render();return this.#vt=n.firstElementChild,this.#yt=n.querySelector("input[type=radio]"),this.#wt="boolean"===this.declared("type"),{fragment:n,control:this.#yt,error:n.querySelector("ful-field-error"),described:this,claims:this.#vt,announces:this,freeze:this.#vt}}get value(){if(!this.#vt){const e=this._heldValue(),t=null===e?null:this.querySelector(`ful-radio[value="${CSS.escape(String(e))}"]`),s=t?.getAttribute("value")??null;return null===s||"boolean"!==this.declared("type")?s:"true"===s}const e=this.querySelector("input[type=radio]:checked");return e?this.#wt?"true"===e.value:e.value:null}set value(e){if(!this.#vt)return void this._holdValue(e);const t=this.querySelectorAll("input[type=radio]"),s=()=>{t.forEach(e=>{e.checked=!1})};if(null===e)return void s();const i=this.querySelector(`input[type=radio][value="${CSS.escape(String(e))}"]`);null!==i?i.checked=!0:s()}}class ae extends x{static attributes=["type"];static observed=["value:bool"];static slots=!0;static template='\n <ful-choice data-tpl-switch="isSwitch">\n <input type="checkbox" data-tpl-role="isSwitch ? \'switch\' : false" form="">\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n </ful-choice>\n <ful-field-error></ful-field-error>\n ';#Et;#We;_build({slots:e}){const s="switch"===this.declared("type"),i=this.template().withOverlay({slots:e,isSwitch:s}).render();this.#Et=i.firstElementChild,this.#We=i.querySelector("input"),t.forward("input-",this,this.#We),this.#We.addEventListener("change",e=>{e.stopPropagation(),this._notifyChange()});const r=i.querySelector("label");return{fragment:i,control:this.#We,error:i.querySelector("ful-field-error"),label:r,freeze:this.#Et}}get value(){return this.#We?this.#We.checked:Boolean(this._heldValue())}set value(e){this.#We?this.#We.checked=e:this._holdValue(e)}}class ne extends e{static attributes=["sorter"];static observed=["order"];#xt;render(){const e=this.declared("sorter"),t=["asc","desc",null];this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.addEventListener("click",()=>{const s=t[(t.indexOf(this.order)+1)%3];this.dispatchEvent(new CustomEvent("sort:requested",{bubbles:!0,cancelable:!1,detail:{value:{sorter:e,order:s}}}))}),this.addEventListener("keydown",e=>{["Enter","NumpadEnter","Space"].includes(e.code)&&(e.preventDefault(),this.click())})}get order(){return this.#xt||null}set order(e){this.#xt=e||null,this.reflectTo("order",this.#xt);const s=this.closest("th");s&&t.set(s,"aria-sort",this.#xt?"asc"===this.#xt?"ascending":"descending":null)}}class oe extends e{static observed=["total:number","current:number"];static attributes=["pages:number"];static config={prevIcon:"chevron-left",nextIcon:"chevron-right",reloadIcon:"arrow-clockwise"};static template='\n <ful-pagination-bar role="navigation" data-tpl-aria-label="#l10n:t(\'pagination.navigation\')">\n <ul>\n <li data-ref="index"> {{ #l10n:t(\'pagination.showing\', { \'current\': curr.label, \'total\': total }) }}</li>\n <li data-ref="reload"><button type="button" data-tpl-aria-label="#l10n:t(\'pagination.reload\')"><ful-icon data-tpl-name="config.reloadIcon" aria-hidden="true"></ful-icon></button></li>\n <li data-ref="prev">\n <button type="button" data-tpl-disabled="prev.enabled ? false : true" data-tpl-aria-label="#l10n:t(\'pagination.previous\')" data-tpl-data-page="prev.index">\n <ful-icon data-tpl-name="config.prevIcon" aria-hidden="true"></ful-icon>\n </button>\n </li>\n <li data-ref="page" data-tpl-each="pages" data-tpl-var="page">\n <button type="button" data-tpl-aria-current="curr.index == page.index ? \'page\' : false" data-tpl-data-page="page.index" >\n {{ page.label }}\n </button>\n </li>\n <li data-ref="next">\n <button type="button" data-tpl-disabled="next.enabled ? false : true" data-tpl-aria-label="#l10n:t(\'pagination.next\')" data-tpl-data-page="next.index">\n <ful-icon data-tpl-name="config.nextIcon" aria-hidden="true"></ful-icon>\n </button>\n </li>\n </ul>\n </ful-pagination-bar>\n ';#At=0;#St=0;render(){this.addEventListener("click",e=>{const t=e.target.closest("button");t&&!t.hasAttribute("disabled")&&"page"!==t.getAttribute("aria-current")&&this.dispatchEvent(new CustomEvent("page:requested",{bubbles:!0,cancelable:!1,detail:{value:Number(t.dataset.page??this.#St)}}))})}update({current:e,total:t}={}){void 0!==e&&(this.#St=e??0),void 0!==t&&(this.#At=t??0),this.reflectTo("current",this.#St),this.reflectTo("total",this.#At);const s=this.#St,i=this.#At,r=this.declared("pages")??5,a=Math.max(i,1),n=s>0,o=s+1<a,l={index:n?s-1:null,enabled:n},d={index:s,label:s+1},u={index:o?s+1:null,enabled:o},c=Math.max(1,Math.min(r,a)),h=Math.max(0,Math.min(s-Math.floor((c-1)/2),a-c)),p=Array.from({length:c},(e,t)=>({index:h+t,label:h+t+1})),f=this.contains(document.activeElement)?document.activeElement.closest("li")?.getAttribute("data-ref"):null,m="page"===f?document.activeElement.dataset.page:null;if(this.template().withOverlay({total:a,prev:l,curr:d,next:u,pages:p}).renderTo(this),!f)return;const g=(null===m?null:this.querySelector(`li[data-ref=page] button[data-page="${m}"]`))??this.querySelector(`li[data-ref=${f}] button:not(:disabled)`)??this.querySelector("li[data-ref=page] button[aria-current=page]");g?.focus()}get total(){return this.#At}set total(e){this.update({total:e})}get current(){return this.#St}set current(e){this.update({current:e})}}class le{static parse(e,t){const i=e?o.queryChildren(e,"schema"):null;if(!i)throw new Error('missing expected <schema>: ful-table needs a <template slot="schema"> holding one');const r=document.createElement("tr"),a=document.createElement("tr");a.setAttribute("data-tpl-each","rows");for(const e of i.getAttributeNames()){const t=i.getAttribute(e);r.setAttribute(e,t??""),a.setAttribute(e,t??"")}const n=o.queryChildrenAll(i,"column"),l=n.filter(e=>e.hasAttribute("order")&&e.hasAttribute("sorter")).map(e=>({sorter:e.getAttribute("sorter"),order:e.getAttribute("order")}))[0]??null;for(const e of n){const t=o.queryChildren(e,"title"),s=e.getAttribute("sorter"),i=e.getAttribute("order"),n=t??document.createTextNode(e.getAttribute("title")??"");t?.remove(),e.removeAttribute("sorter"),e.removeAttribute("order"),e.removeAttribute("title");const l=s||i?(()=>{const e=document.createElement("ful-sorter");return s&&e.setAttribute("sorter",s),i&&e.setAttribute("order",i),e.append(n),e})():n,d=document.createElement("th"),u=document.createElement("td");for(const t of e.getAttributeNames()){const s=e.getAttribute(t);d.setAttribute(t,s??""),u.setAttribute(t,s??"")}d.append(l),u.append(...e.childNodes),r.append(d),a.append(u)}return{headersTemplate:t.withOverlay({inHeaders:!0,inRows:!1}).withFragment(s.from(r)),rowsTemplate:t.withOverlay({inHeaders:!1,inRows:!0}).withFragment(s.from(a)),sort:l,length:n.length}}}class de{#we;constructor(e){this.#we=e}async load(e,t,s){const i=this.#_t(t),r=Number(e.size),a=e.page*r,n=a+r;return{data:i.slice(a,n),size:i.length}}#_t(e){if(!e?.sorter)return this.#we;const{sorter:t,order:s}=e,i="desc"===s?-1:1;return[...this.#we].sort((e,s)=>{const r=e?.[t],a=s?.[t];return r===a?0:null==r?1:null==a?-1:(r<a?-1:1)*i})}update(e){this.#we=e}}class ue{#E;#x;#A;#_;constructor(e,t,s,i=e=>e){this.#E=e,this.#x=t,this.#A=s,this.#_=i}async load(e,t,s){const i=Object.entries(s).filter(([e,t])=>t);return await this.#E.request(this.#A,this.#x).param("page",e.page).param("size",e.size).param("sort",t?`${t.sorter},${t.order}`:null).param("filters",i.length>0?JSON.stringify(Object.fromEntries(i)):null).fetchJson().then(e=>this.#_(e))}}class ce{static create(e,t){const s=e.getAttribute("src");if(s){const t=e.component("http-client"),i=e.getAttribute("method")??"GET",r=e.hasAttribute("response-mapper")?e.component(e.getAttribute("response-mapper")):e=>e;return new ue(t,s,i,r)}return new de([])}}class he extends e{static attributes=["loader","autoload:presence","paging"];static observed=["page-size:number","src","method"];static slots=!0;static config={searchIcon:"search",emptyIcon:"inbox",reloadIcon:"arrow-clockwise"};static template='\n <ful-form data-tpl-if="slots.filters">\n {{{{ slots.filters }}}}\n </ful-form>\n <ful-table-wrapper>\n <table>\n <caption data-tpl-if="slots.caption">{{{{ slots.caption }}}}</caption>\n <thead></thead>\n <tbody data-tpl-if="virtual" data-ref="before" aria-hidden="true"><tr><td data-tpl-colspan="schema.length"></td></tr></tbody>\n <tbody></tbody>\n <tbody data-tpl-if="virtual" data-ref="after" aria-hidden="true"><tr><td data-tpl-colspan="schema.length"></td></tr></tbody>\n <tbody data-ref="initial">\n <tr>\n <td data-tpl-colspan="schema.length">\n <ful-empty>\n <ful-icon data-tpl-if="config.searchIcon" data-tpl-name="config.searchIcon" aria-hidden="true"></ful-icon>\n {{ #l10n:t(\'table.initial\') }}\n </ful-empty>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="empty" hidden>\n <tr>\n <td data-tpl-colspan="schema.length">\n <ful-empty data-tpl-if="slots.empty" data-ref="empty-authors"></ful-empty>\n <ful-empty data-tpl-if="!slots.empty">\n <ful-icon data-tpl-if="config.emptyIcon" data-tpl-name="config.emptyIcon" aria-hidden="true"></ful-icon>\n {{ #l10n:t(\'table.no-data\') }}\n </ful-empty>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="loading" hidden>\n <tr>\n <td data-tpl-colspan="schema.length">\n <ful-spinner class="big" role="status"><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="feedback" hidden>\n <tr>\n <td data-tpl-colspan="schema.length">\n <div role="alert">\n <p>{{ #l10n:t(\'table.error\') }}</p>\n <div data-ref="feedback-error"></div>\n </div>\n </td>\n </tr>\n </tbody>\n <tfoot data-tpl-if="slots.footer">\n {{{{ slots.footer }}}}\n </tfoot>\n </table>\n </ful-table-wrapper>\n <ful-pagination data-tpl-if="!scrolled" current="0" total="1"></ful-pagination>\n <ful-table-status data-tpl-if="scrolled">\n <span data-ref="count"></span>\n <ful-spinner data-ref="appending" role="status" hidden><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner>\n <div data-ref="append-failure" role="alert" hidden>\n <span>{{ #l10n:t(\'table.error\') }} <span data-ref="append-error"></span></span>\n <button type="button" data-ref="retry">{{ #l10n:t(\'table.retry\') }}</button>\n </div>\n <button type="button" data-ref="reload" data-tpl-aria-label="#l10n:t(\'pagination.reload\')"><ful-icon data-tpl-name="config.reloadIcon" aria-hidden="true"></ful-icon></button>\n </ful-table-status>\n ';static templates={row:"\n {{{{ schema.rowsTemplate.withOverlay({'rows': pageResponse.data}).render() }}}}\n "};#Pe;#qt;#Ct;#kt;#Rt;#Re;#Tt;#Lt;#zt;#Nt;#Ot;#Mt;#It=null;#Ft=null;#Bt=[];#Pt={next:1,shown:0,total:0,last:0};#Dt=!1;#$t=null;#Wt=null;#At=0;#Vt=0;#Ht=null;#jt=!1;#Gt=void 0;#Kt={pageRequest:{page:0,size:10},sortRequest:null,filterRequest:{}};#Ut=!1;#Qt={};#Jt=null;#Yt=!1;#Xt=null;#Zt=new v;#De={src:null,method:null};get pageSize(){return this.#Kt.pageRequest.size}set pageSize(e){const t=Number(e??10);!Number.isFinite(t)||t<=0||t===this.#Kt.pageRequest.size||(this.#Kt={...this.#Kt,pageRequest:{page:0,size:t}},this.#Ut&&this.load(this.#Kt.pageRequest,this.#Kt.sortRequest,this.#Qt))}get src(){return this.getAttribute("src")}set src(e){this.reflectTo("src",e??null),this.#ht()&&this.#Ut&&this.reload()}get method(){return this.getAttribute("method")}set method(e){this.reflectTo("method",e??null),this.#ht()&&this.#Ut&&this.reload()}async reconfigure(e){for(const t of["src","method"])t in e&&this.reflectTo(t,e[t]??null);return this.#ht(),await this.reload()}#Ye(){this.#De={src:this.getAttribute("src"),method:this.getAttribute("method")},this.#Pe=this.component(this.declared("loader")??"loaders:table").create(this)}#ht(){return(this.getAttribute("src")!==this.#De.src||this.getAttribute("method")!==this.#De.method)&&(this.#Ye(),this.#Kt={...this.#Kt,pageRequest:{...this.#Kt.pageRequest,page:0}},this.#Wt=null,!0)}async render({slots:e}){const r=this.template(),a=le.parse(e.schema,r),l=this.declared("paging"),d=r.withOverlay({slots:e,schema:a,scrolled:"infinite"===l||"virtual"===l,virtual:"virtual"===l}).render(),u=o.queryChildren(d,"ful-table-wrapper"),c=u.querySelector("table");t.forward("table-",this,c),this.#Ye(),this.#Mt=u;const h=o.queryChildren(d,"ful-table-status");if(this.#qt=a,this.#Ct=c.querySelector(":scope > tbody:not([data-ref])"),this.#kt=c.querySelector(":scope > tbody[data-ref=loading]"),this.#Rt=c.querySelector(":scope > tbody[data-ref=initial]"),this.#Re=c.querySelector(":scope > tbody[data-ref=empty]"),this.#Tt=this.#Re.querySelector("ful-empty[data-ref=empty-authors]"),this.#Lt=e.empty&&!s.isBlank(e.empty)?n.fromFragment(e.empty):null,this.#zt=c.querySelector(":scope > tbody[data-ref=feedback]"),this.#Nt=o.queryChildren(d,"ful-pagination"),this.replaceChildren(d),"virtual"===l){const e=getComputedStyle(u).overflowY;this.#Dt="auto"===e||"scroll"===e,this.#Dt||console.warn('ful-table: paging="virtual" needs rows that scroll inside the table, as ful-fill makes them; this one appends its pages as paging="infinite" does')}if(h){const e=e=>h.querySelector(`[data-ref=${e}]`);this.#It={count:e("count"),appending:e("appending"),failure:e("append-failure"),error:e("append-error")},e("reload").addEventListener("click",()=>this.reload()),e("retry").addEventListener("click",()=>{this.#Dt?(this.#jt=!1,this.#es(!0)):this.#ts()})}this.#Dt?(this.#$t={before:c.querySelector(":scope > tbody[data-ref=before] td"),after:c.querySelector(":scope > tbody[data-ref=after] td")},u.addEventListener("scroll",()=>{this.#ss(),this.#es(!1)},{passive:!0}),new ResizeObserver(()=>{this.#ss(),this.#es(!1)}).observe(u)):h&&(this.#Ft=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting&&this.#Bt.includes(e.target))&&this.#ts()}));const p=this.querySelector("thead");a.headersTemplate.renderTo(p),this.#Ot=p.querySelectorAll("ful-sorter"),await i.waitForChildren(this);const f=o.queryChildren(this,"ful-form"),m=this.declared("page-size");this.#Kt={pageRequest:{page:0,size:Number.isFinite(m)&&m>0?m:10},sortRequest:a.sort,filterRequest:f?.values??{}},this.#Qt=this.#Kt.filterRequest,this.#Jt=f,f?.addEventListener("submit:success",async e=>{this.#Xt=this.#is(0,e.detail.request),await this.#Xt}),this.addEventListener("page:requested",async e=>{e.composedPath().find(e=>e instanceof he)===this&&await this.#is(e.detail.value,this.#Qt)}),this.addEventListener("sort:requested",async e=>{if(e.composedPath().find(e=>e instanceof he)!==this)return;const t=e.detail.value.order?e.detail.value:null;await this.load(this.#Kt.pageRequest,t,this.#Qt),this.#Kt.sortRequest===t&&(this.#Ot.forEach(e=>{e.order=null}),e.target.order=e.detail.value.order)}),this.declared("autoload")&&this.reload()}async reload(){if(!this.#Jt||this.#Yt)return this.#Wt?await this.#rs():await this.load(this.#Kt.pageRequest,this.#Kt.sortRequest,this.#Kt.filterRequest);await this.#Jt.submit()&&await this.#Xt}async load(e,t,s){this.#Ut=!0,this.#Qt=s;const r=this.#Zt.take();let a;this.#Bt=[],this.#Ft?.disconnect(),clearTimeout(this.#Gt),this.#Ht=null,this.#jt=!1,this.#It?.appending.setAttribute("hidden",""),this.#It?.failure.setAttribute("hidden",""),this.#kt.toggleAttribute("hidden",this.#Ct.childElementCount>0),this.#zt.setAttribute("hidden",""),this.#Rt.setAttribute("hidden",""),this.#Re.setAttribute("hidden",""),this.setAttribute("aria-busy","true");try{const n=await this.#Pe.load(e,t,s);if(r.stale)return;if(a=Math.max(0,Math.ceil(n.size/e.size)-1),!Number.isFinite(a))throw new Error(`ful-table cannot page the loader's answer: it needs { data, size }, size being the total number of rows, and got a size of ${n.size} for pages of ${e.size}. A response of another shape needs a response-mapper`);if(e.page<=a){if(this.#Kt={pageRequest:e,sortRequest:t,filterRequest:s},this.#Yt=!0,this.#ne(e,t,s,n),await Promise.all([i.waitForChildren(this.#Ct),i.waitForChildren(this.#Re)]).catch(()=>{}),r.stale)return;return this.#Dt&&this.#as(),this.removeAttribute("aria-busy"),this.dispatchEvent(new CustomEvent("load:success",{bubbles:!0,cancelable:!1,detail:{pageRequest:e,sortRequest:t,filterRequest:s,response:n}})),this.#ns(e.size),void this.#es(!1)}}catch(i){if(r.stale)return;throw this.#os(i,{pageRequest:e,sortRequest:t,filterRequest:s}),i}return await this.load({page:a,size:e.size},t,s)}async withLoader(e){return await e(this.#Pe)}async resetWithFilter(e){return await this.#is(0,e)}#is(e,t){return this.load({page:e,size:this.#Kt.pageRequest.size},this.#Kt.sortRequest,t)}#ns(e){const{shown:t,total:s,last:i}=this.#Pt;if(!(this.#Ft&&t<s&&0!==i))return;const r=[...this.#Ct.children];this.#Bt=r.slice(Math.max(0,r.length-Math.ceil(e/2)));for(const e of this.#Bt)this.#Ft.observe(e)}async#ts(){const e=this.#It;this.#Bt=[],this.#Ft?.disconnect();const{sortRequest:t,filterRequest:s}=this.#Kt,a={page:this.#Pt.next,size:this.#Kt.pageRequest.size},n=this.#Zt.take();e.failure.setAttribute("hidden",""),e.appending.removeAttribute("hidden");try{const o=await this.#Pe.load(a,t,s);if(n.stale)return;if(this.#Ct.append(this.template("row").withOverlay({schema:this.#qt,pageRequest:a,filterRequest:s,pageResponse:o}).render()),this.#Pt={next:a.page+1,shown:this.#Pt.shown+o.data.length,total:o.size,last:o.data.length},e.count.textContent=r.of().t("table.loaded",{loaded:this.#Pt.shown,total:this.#Pt.total}),await i.waitForChildren(this.#Ct).catch(()=>{}),n.stale)return;e.appending.setAttribute("hidden",""),this.dispatchEvent(new CustomEvent("load:success",{bubbles:!0,cancelable:!1,detail:{pageRequest:a,sortRequest:t,filterRequest:s,response:o}})),this.#ns(a.size)}catch(i){if(n.stale)return;e.appending.setAttribute("hidden",""),e.error.textContent=r.of().failure(i),e.failure.removeAttribute("hidden"),this.dispatchEvent(new CustomEvent("load:failure",{bubbles:!0,cancelable:!1,detail:{pageRequest:a,sortRequest:t,filterRequest:s,exception:i}}))}}#ls(e,t,s){const i=[...this.template("row").withOverlay({schema:this.#qt,pageRequest:e,filterRequest:t,pageResponse:s}).render().children];return this.#Dt&&i.forEach((t,s)=>{t.setAttribute("aria-rowindex",String(e.page*e.size+s+2))}),i}#os(e,t){this.#kt.setAttribute("hidden",""),this.#Ct.replaceChildren(),this.#Wt=null,this.#ds(),this.#It?.count.replaceChildren(),this.#zt.removeAttribute("hidden"),this.#zt.querySelector("[data-ref=feedback-error]").textContent=r.of().failure(e),this.removeAttribute("aria-busy"),this.dispatchEvent(new CustomEvent("load:failure",{bubbles:!0,cancelable:!1,detail:{...t,exception:e}}))}#as(){const e=this.#Ct.parentElement;e.setAttribute("aria-rowcount",String(this.#At+1)),e.tHead?.rows[0]?.setAttribute("aria-rowindex","1");const t=this.#It,s=this.#Wt;if(!s)return this.#ds(),void(t.count.textContent=r.of().t("table.loaded",{loaded:0,total:this.#At}));const i=this.#Kt.pageRequest.size,a=s.first*i;t.count.textContent=r.of().t("table.range",{from:a+1,to:a+s.pages.get(s.first).length,total:this.#At}),this.#us()&&(this.#Mt.scrollTop=a*this.#Vt)}#us(){if(this.#Vt>0)return!0;const e=this.#Ct.childElementCount,t=this.#Ct.getBoundingClientRect().height;return 0!==e&&0!==t&&(this.#Vt=t/e,this.#cs(),this.#ds(),!0)}#cs(){const e=this.#Ct.parentElement,t=[...e.tHead?.rows[0]?.cells??[]].map(e=>e.getBoundingClientRect().width),s=t.reduce((e,t)=>e+t,0),i=document.createElement("colgroup");i.setAttribute("data-ref","widths");for(const e of t){const t=document.createElement("col");t.style.width=e/s*100+"%",i.append(t)}e.insertBefore(i,e.tHead)}#hs(){this.#Ct.parentElement?.querySelector(":scope > colgroup[data-ref=widths]")?.remove()}#ds(){if(!this.#$t)return;const e=this.#Wt,t=this.#Kt.pageRequest.size,s=e?e.first*t:0,i=e?Math.max(0,this.#At-(e.last+1)*t):0;this.#$t.before.style.height=s*this.#Vt+"px",this.#$t.after.style.height=i*this.#Vt+"px"}#ss(){const e=this.#It,t=this.#Kt.pageRequest.size,s=this.#Mt.getBoundingClientRect(),i=s.top+(this.#Ct.parentElement?.querySelector(":scope > thead")?.getBoundingClientRect().height??0);let a=0,n=0;for(const[e,r]of this.#Wt?.pages??[])r.forEach((r,o)=>{const l=r.getBoundingClientRect();l.bottom>i&&l.top<s.bottom&&(a||=e*t+o+1,n=e*t+o+1)});a>0&&(e.count.textContent=r.of().t("table.range",{from:a,to:n,total:this.#At}))}#ps(e){const t=this.#Kt.pageRequest.size*this.#Vt,s=this.#Mt.getBoundingClientRect(),i=s.top+s.height/2,r=this.#Ct.getBoundingClientRect();if(i<r.top)return Math.max(0,e.first-Math.ceil((r.top-i)/t));if(i>=r.bottom)return e.last+1+Math.floor((i-r.bottom)/t);let a=e.first;for(const[t,s]of e.pages)s.length>0&&s[0].getBoundingClientRect().top<=i&&(a=t);return a}#es(e){const t=this.#Wt,s=Math.ceil(this.#At/this.#Kt.pageRequest.size);if(!t||this.#Ht||this.#jt||this.hasAttribute("aria-busy")||!this.#Mt.isConnected||!(s>0)||!this.#us())return;const i=Math.min(s-1,this.#ps(t));let r=Math.max(0,i-1),a=Math.min(s-1,i+1);const n=this.#Ct.contains(document.activeElement)?document.activeElement.closest("tr"):null,o=[...t.pages].find(([,e])=>n&&e.includes(n))?.[0];void 0!==o&&Math.max(a,o)-Math.min(r,o)<=4&&(r=Math.min(r,o),a=Math.max(a,o)),r===t.first&&a===t.last||(clearTimeout(this.#Gt),e||!(a<t.first-1||r>t.last+1)?this.#fs(t,r,a):this.#Gt=setTimeout(()=>this.#es(!0),150))}async#fs(e,t,s){const a=this.#It,n=this.#Zt.hold();this.#Ht=n;const{sortRequest:o,filterRequest:l}=this.#Kt,d=this.#Kt.pageRequest.size,u=Array.from({length:s-t+1},(e,s)=>t+s),c=u.filter(t=>!e.pages.has(t));a.failure.setAttribute("hidden",""),a.appending.removeAttribute("hidden");try{const r=await Promise.all(c.map(async e=>{const t={page:e,size:d};return{pageRequest:t,response:await this.#Pe.load(t,o,l)}}));if(n.stale)return;const h=u.filter(t=>e.pages.has(t)),p=this.#Mt.getBoundingClientRect().top,f=h.flatMap(t=>e.pages.get(t)??[]).find(e=>e.getBoundingClientRect().bottom>p),m=f?.getBoundingClientRect().top??0;for(const[i,r]of e.pages)if(i<t||i>s)for(const e of r)e.remove();const g=new Map;for(const t of u){const s=r.find(e=>e.pageRequest.page===t);g.set(t,e.pages.get(t)??(s?this.#ls(s.pageRequest,l,s.response):[]))}if(0===h.length?this.#Ct.replaceChildren(...[...g.values()].flat()):(this.#Ct.prepend(...u.filter(e=>e<h[0]).flatMap(e=>g.get(e)??[])),this.#Ct.append(...u.filter(e=>e>h.at(-1)).flatMap(e=>g.get(e)??[]))),this.#Wt={first:t,last:s,pages:g},this.#At=r.at(-1)?.response.size??this.#At,this.#Ct.parentElement?.setAttribute("aria-rowcount",String(this.#At+1)),this.#ds(),f&&(this.#Mt.scrollTop+=f.getBoundingClientRect().top-m),await i.waitForChildren(this.#Ct).catch(()=>{}),n.stale)return;f&&(this.#Mt.scrollTop+=f.getBoundingClientRect().top-m),a.appending.setAttribute("hidden",""),this.#ss();for(const{pageRequest:e,response:t}of r)this.dispatchEvent(new CustomEvent("load:success",{bubbles:!0,cancelable:!1,detail:{pageRequest:e,sortRequest:o,filterRequest:l,response:t}}))}catch(e){if(n.stale)return;return this.#jt=!0,a.appending.setAttribute("hidden",""),a.error.textContent=r.of().failure(e),a.failure.removeAttribute("hidden"),void this.dispatchEvent(new CustomEvent("load:failure",{bubbles:!0,cancelable:!1,detail:{pageRequest:{page:c[0],size:d},sortRequest:o,filterRequest:l,exception:e}}))}finally{this.#Ht===n&&(this.#Ht=null)}this.#es(!1)}async#rs(){const e=this.#Wt,t=this.#It,{sortRequest:s,filterRequest:r}=this.#Kt,a=this.#Kt.pageRequest.size;this.#Qt=r;const n=this.#Zt.take();clearTimeout(this.#Gt),this.#Ht=null,this.#jt=!1,t.appending.setAttribute("hidden",""),t.failure.setAttribute("hidden",""),this.setAttribute("aria-busy","true");const o=Array.from({length:e.last-e.first+1},(t,s)=>e.first+s);try{const t=await Promise.all(o.map(async e=>{const t={page:e,size:a};return{pageRequest:t,response:await this.#Pe.load(t,s,r)}}));if(n.stale)return;const l=t.at(-1).response.size,d=Math.ceil(l/a);if(!(e.first<d))return await this.load({page:0,size:a},s,r);const u=t.filter(e=>e.pageRequest.page<d),c=new Map(u.map(e=>[e.pageRequest.page,this.#ls(e.pageRequest,r,e.response)]));if(this.#Ct.replaceChildren(...[...c.values()].flat()),this.#Wt={first:e.first,last:Math.min(e.last,d-1),pages:c},this.#At=l,this.#Ct.parentElement?.setAttribute("aria-rowcount",String(l+1)),this.#ds(),await i.waitForChildren(this.#Ct).catch(()=>{}),n.stale)return;this.removeAttribute("aria-busy"),this.#ss();for(const{pageRequest:e,response:t}of u)this.dispatchEvent(new CustomEvent("load:success",{bubbles:!0,cancelable:!1,detail:{pageRequest:e,sortRequest:s,filterRequest:r,response:t}}));this.#es(!1)}catch(t){if(n.stale)return;throw this.#os(t,{pageRequest:{page:e.first,size:a},sortRequest:s,filterRequest:r}),t}}#ne(e,t,s,i){this.#kt.setAttribute("hidden",""),this.#Dt&&(this.#Vt=0,this.#hs());const a=this.#ls(e,s,i);return this.#Ct.replaceChildren(...a),this.#Re.toggleAttribute("hidden",0!==i.data.length),this.#Lt&&0===i.data.length&&this.#Tt.replaceChildren(this.#Lt.withOverlay({schema:this.#qt,pageRequest:e,filterRequest:s,pageResponse:i}).render()),this.#Dt?(this.#Mt.scrollTop=0,this.#At=i.size,void(this.#Wt=a.length>0?{first:e.page,last:e.page,pages:new Map([[e.page,a]])}:null)):this.#It?(this.#Mt.scrollTop=0,this.#Pt={next:e.page+1,shown:i.data.length,total:i.size,last:i.data.length},void(this.#It.count.textContent=r.of().t("table.loaded",{loaded:this.#Pt.shown,total:this.#Pt.total}))):void this.#Nt.update({current:e.page,total:Math.ceil(i.size/e.size)})}}const pe=(e,t,{items:s,current:i=()=>null})=>{let r="",a=0;t.addEventListener("beforetoggle",s=>{"closed"===s.newState&&t.contains(document.activeElement)&&e()?.focus()}),t.addEventListener("toggle",e=>{if("open"!==e.newState)return;const t=s();(i()??t[0])?.focus()}),t.addEventListener("keydown",t=>{const i=t.target,n=s(),o=n.find(e=>e===i||e.contains(i));if(!o)return;const l=n.indexOf(o);switch(t.code){case"ArrowDown":return t.preventDefault(),void n[(l+1)%n.length]?.focus();case"ArrowUp":return t.preventDefault(),void n[(l-1+n.length)%n.length]?.focus();case"Home":return t.preventDefault(),void n[0]?.focus();case"End":return t.preventDefault(),void n[n.length-1]?.focus();case"Enter":case"NumpadEnter":case"Space":return t.preventDefault(),o.click(),void e()?.focus();case"Escape":return void e()?.focus()}if(1!==t.key.length||t.ctrlKey||t.altKey||t.metaKey)return;const d=Date.now();r=d-a>500?t.key:r+t.key,a=d;const u=r.toLowerCase(),c=[...u].every(e=>e===u[0]),h=c?u[0]:u,p=c?l+1:l,f=[...n.slice(p),...n.slice(0,p)].find(e=>(e.textContent??"").trim().toLowerCase().startsWith(h));f&&(t.preventDefault(),f.focus())})};class fe{static narrow(e,t){const s=(e??[]).filter(e=>t.includes(e));return s.length>0?s:[...t]}#ms;#ke;#gs;#bs;#vs;#ft;#ys;#ws;#Es;#xs=!1;#As=!1;constructor(e,{vocabulary:t,glyphs:s={},labelFor:i=e=>e,display:r=null,interactive:a=()=>!0,onPick:n=()=>{}}){this.#ms=e,this.#ke=e.nextElementSibling,this.#gs=t,this.#bs=s,this.#vs=i,this.#ft=r??(e=>s[e]??e),this.#ys=a,this.#ws=n,this.#Es=[...t],this.#ke.addEventListener("click",e=>{const t=e.target.closest("li > a");if(!t||!this.#ys())return;const s=t.getAttribute("value"),i=this.value;this.value=s,this.#ke.hidePopover?.(),i!==s&&this.#ws(s)})}get allowed(){return this.#Es}set allowed(e){this.#Es=fe.narrow(e,this.#gs),this.#Ss(),!this.#As&&this.#Es.length>1&&(this.#g(),this.#As=!0),this.#_s(),this.pinned&&(this.value=this.#Es[0])}preferring(e){return null!==e&&this.#Es.includes(e)?e:this.#Es[0]}get pinned(){return this.#Es.length<2}set fixed(e){this.#ms.toggleAttribute("hidden",!!e)}get value(){return this.#ms.getAttribute("value")}set value(e){this.#ms.setAttribute("value",e),this.#ms.textContent=this.#ft(e),t.set(this.#ms,"aria-label",this.#vs(e)),this.#qs()}#qs(){const e=this.value;for(const t of this.#te())t.setAttribute("aria-checked",String(t.getAttribute("value")===e))}set claimed(e){this.#xs=e,this.#_s()}#Ss(){this.#ke.replaceChildren(...this.#Es.map(e=>{const t=document.createElement("li");t.setAttribute("role","none");const s=document.createElement("a");s.setAttribute("role","menuitemradio"),s.setAttribute("tabindex","-1"),s.setAttribute("value",e);const i=this.#vs(e),r=this.#bs[e]??e;if(i===e&&r===e)s.innerText=e;else{const e=document.createElement("span");e.innerText=r;const t=document.createElement("span");t.innerText=i,s.append(e,t)}return t.append(s),t})),this.#qs()}#_s(){const e=this.pinned;this.#ms.toggleAttribute("disabled",e||this.#xs),t.set(this.#ms,"aria-haspopup",e?null:"true"),t.set(this.#ms,"aria-expanded",e?null:"false"),e?this.#ms.removeAttribute("popovertarget"):this.#ke.id&&this.#ms.setAttribute("popovertarget",this.#ke.id)}#te(){return Array.from(this.#ke.querySelectorAll("li > a"),e=>e)}#g(){Q.wire(this.#ms,this.#ke,{prefix:"ful-filter-menu",invoke:!0,expanded:!0}),pe(()=>this.#ms,this.#ke,{items:()=>this.#te(),current:()=>this.#te().find(e=>e.getAttribute("value")===this.value)})}}const me={EQ:"=",NEQ:"≠",LT:"<",GT:">",LTE:"≤",GTE:"≥",BETWEEN:"↔",CONTAINS:"…a…",STARTS_WITH:"a…",ENDS_WITH:"…a"},ge=["EQ","NEQ","LT","GT","LTE","GTE","BETWEEN"],be=[...ge,"CONTAINS","STARTS_WITH","ENDS_WITH"],ve=["IGNORE_CASE","CASE_SENSITIVE"],ye={IGNORE_CASE:"aa",CASE_SENSITIVE:"Aa"},{t:we}=r.of(),Ee=e=>we(`filters.op.${e}`),xe=e=>we(`filters.sensitivity.${e}`),Ae=e=>we(""===e?"filters.boolean.any":`filters.boolean.${e}`),Se=e=>e.querySelector(":scope > label")?.textContent.trim()||null,_e=(e,t,{singular:s,plural:i,vocabulary:r,fallback:a})=>{const n=e.declared(s);if(null===n)return;e.hasAttribute(i)&&console.warn(`${e.localName}: ${s} fixes what ${i} offers a menu for, the plural is ignored`,e);const o=r.includes(n);o||console.warn(`${e.localName}: '${n}' is not one of its ${i}, the default is pinned instead`,e),t.allowed=[o?n:a],t.fixed=!0},qe=(e,t,s)=>{const i=s.filter(e=>null!=e&&""!=`${e}`);return 0===i.length?null:{label:e,operator:t,operands:i.map(e=>`${e}`)}};class Ce extends N{static observed=["value:json","operators:csv"];static attributes=["operator"];static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-affix>\n <button data-ref="operator" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n </ful-affix>\n <ful-control>\n <input data-ref="value1" data-tpl-type="type" form="">\n <input data-ref="value2" data-tpl-type="type" form="" hidden>\n </ful-control>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_operator;_container;_value1;_value2;_build(e){const t=super._build(e),s=t.fragment;return this._container=s.querySelector("ful-control-group"),this._value1=s.querySelector("[data-ref=value1]"),this._value2=s.querySelector("[data-ref=value2]"),this._operator=new fe(s.querySelector("[data-ref=operator]"),{vocabulary:this._vocabulary(),glyphs:me,labelFor:Ee,interactive:()=>this._interactive(),onPick:()=>{this._syncBetween(),this._notifyChange()}}),this.operators=this.declared("operators"),null===this._operator.value&&this._showDefaultOperator(),_e(this,this._operator,{singular:"operator",plural:"operators",vocabulary:this._vocabulary(),fallback:this._defaultOperator()}),{...t,freeze:this._container,also:[this._value2]}}_showDefaultOperator(){this._showOperator(this._operator.preferring(this._defaultOperator()))}formResetCallback(){super.formResetCallback(),this.hasAttribute("value")||this._showDefaultOperator()}_type(){return"text"}_serialize(e){return e}_deserialize(e){return e}_defaultOperator(){return"EQ"}_vocabulary(){return ge}_declaredOperators;get operators(){return this._operator?this._operator.allowed:this._declaredOperators}set operators(e){null===this.declared("operator")&&(this._operator?(this._operator.allowed=e,null!==this._operator.value&&this._showOperator(this._operator.preferring(this._operator.value))):this._declaredOperators=fe.narrow(e,this._vocabulary()))}get value(){return this._operator?this._tuple():this._shownTuple(this._heldValue())}set value(e){this._operator?this._applyTuple(e):this._holdValue(e)}_shownTuple(e){if(null==e)return null;const[t,...s]=e,i=this.declared("operator"),r=this._vocabulary().includes(i),a=null===i?fe.narrow(this.declared("operators"),this._vocabulary()):[r?i:this._defaultOperator()],n=a.includes(t)?t:a[0],o=[s[0],s[1]].map(e=>`${e?this._deserialize(e):e??""}`),l="BETWEEN"===n?o:o.slice(0,1);return l.some(e=>""===e)?null:[n,...l.map(e=>this._serialize(e))]}_tuple(){const e=this._operator.value,t=this.#Cs();return t.some(e=>""===e)?null:[e,...t.map(e=>this._serialize(e))]}_applyTuple(e){if(null==e)return this._value1.value="",void(this._value2.value="");const[t,...s]=e;this._showOperator(this._operator.preferring(t)),this._value1.value=s[0]?this._deserialize(s[0]):s[0]??"",this._value2.value=s[1]?this._deserialize(s[1]):s[1]??""}_showOperator(e){this._operator.value=e,this._syncBetween()}_syncBetween(){this._value2.toggleAttribute("hidden","BETWEEN"!==this._operator.value)}get criterion(){return this._operator?qe(Se(this),this._operator.value,this.#Cs()):null}#Cs(){return"BETWEEN"===this._operator.value?[this._value1.value,this._value2.value]:[this._value1.value]}get disabled(){return super.disabled}set disabled(e){super.disabled=e;for(const t of this._choices())t.claimed=e}_choices(){return[this._operator].filter(e=>e)}}class ke extends Ce{_defaultOperator(){return"LTE"}_type(){return"datetime-local"}_serialize(e){return F.localToIso(e)}_deserialize(e){return F.isoToLocal(e)}}class Re extends Ce{_type(){return"date"}}class Te extends Ce{_type(){return"number"}}class Le extends Ce{static observed=["sensitivities:csv"];static attributes=["sensitivity"];static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-affix>\n <button data-ref="operator" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n <button data-ref="sensitivity" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n </ful-affix>\n <ful-control>\n <input data-ref="value1" data-tpl-type="type" form="">\n <input data-ref="value2" data-tpl-type="type" form="" hidden>\n </ful-control>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_defaultOperator(){return"CONTAINS"}_vocabulary(){return be}_sensitivityButton;_build(e){const t=super._build(e);return this._sensitivityButton=new fe(t.fragment.querySelector("[data-ref=sensitivity]"),{vocabulary:ve,glyphs:ye,labelFor:xe,interactive:()=>this._interactive(),onPick:()=>this._notifyChange()}),this._sensitivityButton.allowed=null,this._sensitivityButton.value=ve[0],_e(this,this._sensitivityButton,{singular:"sensitivity",plural:"sensitivities",vocabulary:ve,fallback:"IGNORE_CASE"}),t}_choices(){return[...super._choices(),this._sensitivityButton].filter(e=>e)}get _sensitivity(){return this._sensitivityButton.value}_declaredSensitivities;get sensitivities(){return this._sensitivityButton?this._sensitivityButton.allowed:this._declaredSensitivities}set sensitivities(e){if(null!==this.declared("sensitivity"))return;if(!this._sensitivityButton)return void(this._declaredSensitivities=fe.narrow(e,ve));const t=this._sensitivityButton.value;this._sensitivityButton.allowed=e,this._sensitivityButton.value=this._sensitivityButton.preferring(t)}get value(){if(!this._sensitivityButton){const e=this._heldValue(),t=null==e?null:this._shownTuple([e[0],...e.slice(2)]);if(null===t)return null;const s=this.declared("sensitivity"),i=null===s?fe.narrow(this.declared("sensitivities"),ve):[ve.includes(s)?s:"IGNORE_CASE"],r=i.includes(e[1])?e[1]:"IGNORE_CASE";return[t[0],i.includes(r)?r:i[0],...t.slice(1)]}const e=this._tuple();return null==e?null:[e[0],this._sensitivity,...e.slice(1)]}set value(e){this._sensitivityButton?null!=e?(this._sensitivityButton.allowed.includes(e[1])&&(this._sensitivityButton.value=e[1]),this._applyTuple([e[0],...e.slice(2)])):this._applyTuple(e):this._holdValue(e)}formResetCallback(){super.formResetCallback(),this.hasAttribute("value")||(this._sensitivityButton.value=this._sensitivityButton.preferring("IGNORE_CASE"))}}const ze=["","true","false"],Ne={true:"✓",false:"✗"};class Oe extends x{static observed=["value:json","operators:csv"];static slots=!0;static OPERATORS=["EQ","NEQ"];static DEFAULT_OPERATOR="EQ";static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-affix>\n <button data-ref="operator" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n </ful-affix>\n <button data-ref="value" type="button" form=""></button>\n <ul popover role="menu"></ul>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_operator;_value;_container;_build({slots:e}){const t=this.template().withOverlay({slots:e}).render();this._container=t.querySelector("ful-control-group");const s=t.querySelector("[data-ref=value]");return this._operator=new fe(t.querySelector("[data-ref=operator]"),{vocabulary:Oe.OPERATORS,glyphs:me,labelFor:Ee,interactive:()=>this._interactive(),onPick:()=>this._notifyChange()}),this._value=new fe(s,{vocabulary:ze,glyphs:Ne,labelFor:Ae,display:Ae,interactive:()=>this._interactive(),onPick:()=>this._notifyChange()}),this.operators=this.declared("operators"),this._operator.value=this._operator.preferring(Oe.DEFAULT_OPERATOR),this._value.allowed=null,this._value.value="",{fragment:t,control:s,error:t.querySelector("ful-field-error"),label:t.querySelector("label"),announces:null,freeze:this._container}}_declaredOperators;get operators(){return this._operator?this._operator.allowed:this._declaredOperators}set operators(e){this._operator?(this._operator.allowed=e,null!==this._operator.value&&(this._operator.value=this._operator.preferring(this._operator.value))):this._declaredOperators=fe.narrow(e,this._vocabulary())}_vocabulary(){return Oe.OPERATORS}get value(){if(!this._value){const e=this._heldValue(),t=`${e?.[1]??""}`;if(""===t)return null;const s=fe.narrow(this.declared("operators"),this._vocabulary());return[s.includes(e[0])?e[0]:s[0],t]}return""===this._value.value?null:[this._operator.value,this._value.value]}set value(e){this._value?null!=e?(this._operator.value=this._operator.preferring(e[0]),this._value.value=e[1]??""):this._value.value="":this._holdValue(e)}formResetCallback(){super.formResetCallback(),this.hasAttribute("value")||(this._operator.value=this._operator.preferring(Oe.DEFAULT_OPERATOR))}get criterion(){if(!this._value)return null;const e=this._value.value;return qe(Se(this),this._operator.value,[""===e?"":Ae(e)])}get disabled(){return super.disabled}set disabled(e){super.disabled=e;for(const t of[this._operator,this._value].filter(e=>e))t.claimed=e}}class Me extends ie{static attributes=["operator"];#ks(){const e=super.value;return this.multiple?e:null==e?[]:[e]}get value(){const e=this.#ks();if(0===e.length)return null;const t=this.declared("operator");return t?[t,...e]:e}set value(e){const t=this.declared("operator");let s=null==e?[]:Array.isArray(e)?e:[e];t&&s[0]===t&&(s=s.slice(1)),super.value=this.multiple?s:s[0]??null}get criterion(){return qe(Se(this),this.declared("operator"),[super.entry].flat().filter(e=>e).map(e=>e.label))}}class Ie extends e{static slots=!0;static attributes=["placement","icon","describes:presence"];static config={icon:"info-circle-fill"};static template='\n <span role="button" tabindex="0" class="ful-tip" data-ref="trigger" data-tpl-aria-label="#l10n:t(\'info.tooltip\')"><ful-icon data-tpl-name="icon ?? config.icon" aria-hidden="true"></ful-icon></span>\n <ful-note popover data-ref="content">{{{{ slots.default }}}}</ful-note>\n ';render({slots:e}){const t=this.template().withOverlay({slots:e,icon:this.declared("icon")}).render(),s=t.querySelector("[data-ref=trigger]"),i=t.querySelector("[data-ref=content]");Q.wire(s,i,{prefix:"ful-tooltip",invoke:!0,expanded:!0,handPlace:!0}),i.setAttribute("placement",this.declared("placement")??"top"),this.replaceChildren(t),this.declared("describes")&&Ie.#b(this,s,i)}static#b(e,t,s){y(e)?.describedBy(s)?t.tabIndex=-1:console.warn("a ful-tooltip declares describes but stands in nothing that takes a description",e)}}class Fe{#Rs=new WeakSet;#Ts=new WeakSet;#u=new WeakMap;async request(e,t,s,i){const r=!this.#Rs.has(t)&&!this.#Ts.has(t),a={name:s,section:t,index:i,first:r},n=["section:requested",...null!=i?[`section:requested:#${i}`]:[],...s?[`section:requested:${s}`]:[]],o=[];for(const t of n){const s=new CustomEvent(t,{bubbles:!0,detail:a});e.dispatchEvent(s),o.push(...s.async?.promises??[])}if(0===o.length)return;r&&this.#Ts.add(t);let l=this.#u.get(t);l||(l=new v,this.#u.set(t,l));const d=l.take(),u=()=>!d.stale;t.querySelector(":scope > .ful-section-error")?.remove();const c=requestAnimationFrame(()=>{u()&&(t.toggleAttribute("loading",!0),t.setAttribute("aria-busy","true"))});try{const e=await Promise.all(o);return r&&this.#Rs.add(t),e}catch(e){throw u()&&this.#Ls(t,e),e}finally{r&&this.#Ts.delete(t),cancelAnimationFrame(c),u()&&(t.toggleAttribute("loading",!1),t.removeAttribute("aria-busy"))}}#Ls(e,t){e.querySelector(":scope > .ful-section-error")?.remove();const s=document.createElement("div");s.className="ful-section-error",s.setAttribute("role","alert"),s.textContent=r.of().failure(t),e.prepend(s)}}class Be{#zs;#Ns;#Os;#kt;#Ms;#Is=new Fe;#Fs=new v;#Bs=null;constructor(e,t,s){this.#zs=e,this.#Ns=t.querySelector("[data-ref=dialog]"),this.#Os=t.querySelector(`[data-ref=${s}]`),this.#kt=t.querySelector("[data-ref=loading]"),this.#Ms=t.querySelector("[data-ref=error]")}get dialog(){return this.#Ns}get section(){return this.#Os}get dirty(){return Array.from(this.#Ns.querySelectorAll("ful-form")).some(e=>e.closest("dialog")===this.#Ns&&e.dirty)}dismiss(e,t,s){return this.#Bs?this.#Bs:this.#zs.dispatchEvent(e)?e.cancelable?s&&this.dirty?(this.#Bs=s().then(e=>(e&&this.#Ns.open&&t(),e)).finally(()=>{this.#Bs=null}),this.#Bs):(t(),Promise.resolve(!0)):Promise.resolve(!0):Promise.resolve(!1)}onBackdrop(e){const t=e=>{if(e.target!==this.#Ns)return!1;const t=this.#Ns.getBoundingClientRect();return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom};let s=!1;this.#Ns.addEventListener("mousedown",e=>{s=t(e)}),this.#Ns.addEventListener("click",i=>{s&&t(i)&&e()})}onSubmitted(e){this.#Os.addEventListener("submit:success",t=>{"ful-form"===t.target.localName&&t.target.parentElement===this.#Os&&e(t.detail.response)})}restChrome(){this.#Ms?.replaceChildren(),this.#Ms?.setAttribute("hidden",""),this.#kt?.setAttribute("hidden",""),this.#Os?.removeAttribute("hidden")}request(){return this.#Is.request(this.#zs,this.#Os,null,null).catch(()=>{})}async update(e,t){const s=this.#Fs.take();this.#Os.replaceChildren(),this.restChrome(),this.#kt?.removeAttribute("hidden"),this.#Os.setAttribute("hidden",""),t();try{const t=await e();return s.stale?null:(this.#Os.replaceChildren(t),this.#kt?.setAttribute("hidden",""),this.#Os.removeAttribute("hidden"),this.#Os)}catch(e){throw s.stale||(this.#Ms?.removeAttribute("hidden"),this.#Ms&&(this.#Ms.textContent=r.of().failure(e)),this.#kt?.setAttribute("hidden",""),this.#Os.setAttribute("hidden","")),e}}}let Pe=!1;const De=()=>{Pe||(Pe=!0,document.addEventListener("click",e=>{const t=e.target.closest?.("[dialog-target]");t&&document.getElementById(t.getAttribute("dialog-target"))?.open?.()}))};class $e extends e{static attributes=["header","requires-answer:presence","close-on-submit:presence","guard-dismiss:presence"];static slots=!0;static template='\n <dialog data-ref="dialog" class="ful-dialog">\n <header data-tpl-if="header || slots.header || !requiresAnswer" class="ful-dialog-header">\n {{{{ slots.header }}}}\n <h2 data-tpl-if="header">{{ header }}</h2>\n <button data-tpl-if="!requiresAnswer" type="button" data-ref="close" data-tpl-aria-label="#l10n:t(\'dialog.close\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button>\n </header>\n <section data-ref="loading" hidden><ful-spinner class="centered" role="status"><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner></section>\n <section data-ref="error" role="alert" hidden></section>\n <div data-ref="body" class="ful-dialog-body">{{{{ slots.default }}}}</div>\n <footer class="ful-dialog-footer"><button type="button" data-ref="acknowledge" data-result="acknowledged" data-tpl-if="!slots.buttons && !closeOnSubmit" data-tpl-aria-label="#l10n:t(\'dialog.acknowledge\')">{{ #l10n:t(\'dialog.acknowledge\') }}</button>{{{{ slots.buttons }}}}</footer>\n </dialog>\n ';#Ns;#Ps;#Ds=[];#$s=null;render({slots:e}){const s=this.declared("requires-answer"),i=this.declared("close-on-submit"),r=this.template().withOverlay({slots:e,header:this.declared("header")??"",requiresAnswer:s,closeOnSubmit:i}).render();this.#Ps=new Be(this,r,"body"),this.#Ns=this.#Ps.dialog;const a=r.querySelector("h2");a&&(a.id||=t.uid("ful-dialog-title"),this.#Ns.setAttribute("aria-labelledby",a.id)),this.#Ns.addEventListener("close",()=>{const e=this.#Ws();this.dispatchEvent(new CustomEvent("close",{detail:e})),this.#Vs(e)}),this.#Ns.addEventListener("click",e=>{const t=e.target.closest("button[data-result]");t&&t.closest("dialog")===this.#Ns&&this.#Ns.close(t.dataset.result)}),s||this.#Ps.onBackdrop(()=>this.dismiss("backdrop")),r.querySelector("[data-ref=close]")?.addEventListener("click",()=>this.dismiss("button")),i&&this.#Ps.onSubmitted(e=>{this.#$s={dismissed:!1,result:null,response:e},this.#Ns.close("submitted")}),this.#Ns.addEventListener("cancel",e=>{if(!e.cancelable)return this.#Ns.returnValue="",void this.#Hs("escape",!1);e.preventDefault(),s||this.dismiss("escape")}),this.replaceChildren(r),De()}#Ws(){if(this.#$s)return this.#$s;const e=this.#Ns?.returnValue??"";return""===e?{dismissed:!0,result:null,response:null}:{dismissed:!1,result:e,response:null}}#Vs(e){const t=this.#Ds;this.#Ds=[];for(const s of t)s(e)}disconnectedCallback(){this.#Vs(this.#Ws())}open(){return this.ask()}ask(){return this.#js()&&(this.#Ps.restChrome(),this.#Ps.request()),new Promise(e=>{this.#Ds.push(e)})}async update(e){return await this.#Ps.update(e,()=>this.#js())}refresh(){return this.#Ps.request()}dismiss(e){return this.#Ns.open?this.#Hs(e,!0):Promise.resolve(!0)}#Hs(e,t){return this.#Ps.dismiss(new CustomEvent("dialog:dismiss",{cancelable:t,detail:{reason:e}}),()=>this.#Ns.close(""),this.declared("guard-dismiss")?We:null)}close(e){this.#Ns.close(e??"")}#js(){return this.#Ns.open&&!this.#Ns.matches(":modal")&&this.#Ns.removeAttribute("open"),!this.#Ns.open&&(this.#Ns.returnValue="",this.#$s=null,this.#Ns.showModal(),!0)}static async ask(e,t,s=[],{className:r}={}){const a=document.createElement("ful-dialog");if(a.setAttribute("header",e),r&&(a.className=r),"string"==typeof t?a.textContent=t:t&&a.append(t),s.length>0){const e=document.createElement("template");e.setAttribute("slot","buttons");for(const t of s){if(t instanceof Node){e.content.append(t);continue}const[s,i,r]=t,a=document.createElement("button");a.type="button",a.dataset.result=s,r&&(a.className=r),a.textContent=i,e.content.append(a)}a.append(e)}document.body.append(a);try{return await i.waitFor(a),await a.ask()}finally{a.remove()}}static async confirm(e,t,s={},i={}){const a=await $e.ask(e,t,[["cancel",s.cancel??r.of().t("dialog.cancel")],["confirm",s.confirm??r.of().t("dialog.confirm"),"ful-button"]],i);return!a.dismissed&&"confirm"===a.result}}const We=()=>{const e=r.of();return $e.confirm(e.t("dialog.discard.header"),e.t("dialog.discard.body"),{confirm:e.t("dialog.discard.confirm"),cancel:e.t("dialog.discard.cancel")})};class Ve extends e{static attributes=["header","placement","close-on-submit:presence","guard-dismiss:presence"];static slots=!0;static template='\n <dialog data-ref="dialog" class="ful-drawer">\n <header>\n {{{{ slots.header }}}}\n <h2 data-ref="title">{{ title }}</h2>\n <button type="button" data-ref="close" data-tpl-aria-label="#l10n:t(\'drawer.close\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button>\n </header>\n <section data-ref="loading" hidden><ful-spinner class="centered" role="status"><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner></section>\n <section data-ref="error" role="alert" hidden></section>\n <section data-ref="content">{{{{ slots.default }}}}</section>\n </dialog>\n ';#Ns;#Gs;#Ps;#$s=null;#Ds=[];#Ks=!1;#Us=new v;render({slots:e}){const s=this.template().withOverlay({slots:e,title:this.declared("header")??""}).render();this.#Ps=new Be(this,s,"content"),this.#Ns=this.#Ps.dialog,this.#Gs=s.querySelector("[data-ref=title]"),this.#Gs.id||=t.uid("ful-drawer-title"),this.#Ns.setAttribute("aria-labelledby",this.#Gs.id);const i=this.declared("placement");i&&this.#Ns.setAttribute("placement",i),s.querySelector("[data-ref=close]").addEventListener("click",()=>this.dismiss("button")),this.#Ps.onBackdrop(()=>this.dismiss("backdrop")),this.#Ns.addEventListener("cancel",e=>{if(!e.cancelable)return this.#Qs(),void this.#Hs("escape",!1);e.preventDefault(),this.dismiss("escape")}),this.#Ns.addEventListener("click",e=>{const t=e.target.closest("button[data-result]");t&&t.closest("dialog")===this.#Ns&&this.close(t.dataset.result)}),this.#Ns.addEventListener("close",()=>{const e=this.#Ws();this.dispatchEvent(new CustomEvent("close",{detail:e})),this.#Vs(e)}),this.declared("close-on-submit")&&this.#Ps.onSubmitted(e=>{this.#$s={dismissed:!1,result:null,response:e},this.close()}),this.replaceChildren(s),De()}get header(){return this.#Gs.textContent}set header(e){this.#Gs.textContent=e??""}async update(e,t){return this.header=e,await this.#Ps.update(t,()=>this.#js())}refresh(){return this.#Ps.request()}#Ws(){return this.#$s??{dismissed:!0,result:null,response:null}}#Vs(e){const t=this.#Ds;this.#Ds=[];for(const s of t)s(e)}disconnectedCallback(){this.#Vs(this.#Ws())}open(){return this.ask()}ask(){return this.#js()&&(this.#Ps.restChrome(),this.#Ps.request()),new Promise(e=>{this.#Ds.push(e)})}dismiss(e){return this.#Ks||!this.#Ns.open?Promise.resolve(!0):this.#Hs(e,!0)}#Hs(e,t){return this.#Ps.dismiss(new CustomEvent("drawer:dismiss",{cancelable:t,detail:{reason:e}}),()=>this.close(),this.declared("guard-dismiss")?We:null)}close(e){if(this.#Ks||!this.#Ns.open)return;if(e&&(this.#$s={dismissed:!1,result:e,response:null}),matchMedia("(prefers-reduced-motion: reduce)").matches)return void this.#Ns.close();this.#Ns.setAttribute("closing","");const t=this.#Ns.getAnimations();if(0===t.length)return void this.#Js();this.#Ks=!0;const s=this.#Us.take();Promise.allSettled(t.map(e=>e.finished)).then(()=>{s.stale||this.#Js()})}#Js(){this.#Qs(),this.#Ns.close()}#Qs(){this.#Ks=!1,this.#Us.invalidate(),this.#Ns.removeAttribute("closing")}#js(){return this.#Ks&&(this.#$s=null),this.#Qs(),this.#Ns.open&&!this.#Ns.matches(":modal")&&this.#Ns.removeAttribute("open"),!this.#Ns.open&&(this.#$s=null,this.#Ns.showModal(),!0)}}class He extends e{static attributes=["for"];#Ys=null;#Xs=null;#Zs=e=>{const t=e.target;this.#Xs=this.matches(":popover-open")&&this.#Ys?.contains(t)?this.#Ys:null};connectedCallback(){super.connectedCallback(),this.rendered&&!this.declared("for")&&document.addEventListener("pointerdown",this.#Zs,!0)}disconnectedCallback(){document.removeEventListener("pointerdown",this.#Zs,!0)}render(){const e=this.declared("for"),t=e?document.getElementById(e):null;if(e&&!t)throw new Error(`ful-menu names no invoker: for="${e}" must name an element already in the page when the menu upgrades`);this.setAttribute("role","menu"),this.hasAttribute("popover")||this.setAttribute("popover",""),t?(this.#Ys=t,t.setAttribute("aria-haspopup","menu"),Q.wire(t,this,{prefix:"ful-menu",invoke:!0,expanded:!0})):this.#ei(),pe(()=>this.#Ys,this,{items:()=>this.items}),this.#qs(),this.addEventListener("click",e=>{const t=e.target;this.items.some(e=>e===t||e.contains(t))&&this.hidePopover()})}showFor(e){if(this.declared("for"))throw new Error("ful-menu: showFor serves a menu without for; a menu with for is opened by its invoker");const t=this.#Xs;if(this.#Xs=null,t===e)return;this.#Ys&&this.#Ys!==e&&this.#Ys.setAttribute("aria-expanded","false"),this.#Ys=e,e.setAttribute("aria-haspopup","menu"),e.setAttribute("aria-expanded","true"),this.style.margin="";const s=Number.parseFloat(getComputedStyle(this).marginBlockStart)||0,i=this.matches(":popover-open");Q.show(this,e,{flip:!0,gap:s}),i&&this.items[0]?.focus()}get items(){return this.#qs().filter(e=>!e.hasAttribute("disabled")&&!e.hasAttribute("hidden"))}#ei(){document.addEventListener("pointerdown",this.#Zs,!0),this.addEventListener("toggle",e=>{"closed"===e.newState&&this.#Ys?.setAttribute("aria-expanded","false")})}#qs(){const e=[...this.querySelectorAll(":scope > button, :scope > a[href]")];for(const t of e)t.hasAttribute("role")||t.setAttribute("role","menuitem"),t.tabIndex=-1;return e}}const je=["info","success","warning","error"],Ge=new Set;let Ke=!1;class Ue extends e{static attributes=["timeout:number"];#ti;connectedCallback(){super.connectedCallback(),this.rendered&&Ge.add(this)}disconnectedCallback(){Ge.delete(this)}render(){this.#ti=this.declared("timeout")||5e3,this.setAttribute("role","region"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-label",r.of().t("toast.region")),this.setAttribute("popover","manual"),Ke||(Ke=!0,document.addEventListener("show-toast",e=>{if(e.detail)for(const t of Ge)t.show(e.detail.message,e.detail)})),Ge.add(this)}show(e,t={}){const s=je.includes(t.severity)?t.severity:"info",i=document.createElement("ful-toast");i.classList.add(s),i.setAttribute("role","error"===s?"alert":"status");const a=document.createElement("div");a.textContent=r.of().failure(e);const n=document.createElement("button");n.type="button",n.setAttribute("aria-label",r.of().t("toast.dismiss"));const o=document.createElement("ful-icon");o.setAttribute("name","x-lg"),o.setAttribute("aria-hidden","true"),n.append(o),i.append(a);let l=t.timeout??this.#ti,d=performance.now(),u=0;const c=()=>{clearTimeout(u),i.contains(document.activeElement)&&this.focus(),matchMedia("(prefers-reduced-motion: reduce)").matches?i.remove():(i.classList.add("ful-toast-out"),0===i.getAnimations().length&&i.remove())};if(t.action?.label){const e=document.createElement("button");e.type="button",e.className="ful-toast-action",e.textContent=String(t.action.label),e.addEventListener("click",()=>{t.action.onClick?.(),c()}),i.append(e)}i.append(n),i.addEventListener("animationend",()=>{i.classList.contains("ful-toast-out")&&i.remove()});let h=0;const p=()=>{0===h&&(clearTimeout(u),l=Math.max(0,l-(performance.now()-d))),++h},f=()=>{0!==h&&0===--h&&(d=performance.now(),u=setTimeout(c,l))};return i.addEventListener("mouseenter",p),i.addEventListener("mouseleave",f),i.addEventListener("focusin",p),i.addEventListener("focusout",f),n.addEventListener("click",c),this.append(i),this.#si(),u=setTimeout(c,l),i}#si(){this.isConnected&&(this.matches(":popover-open")&&this.hidePopover(),this.showPopover())}}class Qe extends e{static slots=!0;static observed=["active:number"];static template='\n <button type="button" class="ful-tabs-scroll" data-ref="scroll-start" tabindex="-1" hidden data-tpl-aria-label="#l10n:t(\'tabs.previous\')"><ful-icon name="chevron-left" aria-hidden="true"></ful-icon></button>\n <ful-tablist role="tablist">{{{{ slots.tabs }}}}</ful-tablist>\n <button type="button" class="ful-tabs-scroll" data-ref="scroll-end" tabindex="-1" hidden data-tpl-aria-label="#l10n:t(\'tabs.next\')"><ful-icon name="chevron-right" aria-hidden="true"></ful-icon></button>\n {{{{ slots.default }}}}\n ';#ii;#ri;#ai;#ni=[];#oi=[];#Is=new Fe;#li=0;render({slots:e}){const s=this.template().withOverlay({slots:e}).render();this.#ii=s.querySelector("ful-tablist"),this.#ri=s.querySelector('[data-ref="scroll-start"]'),this.#ai=s.querySelector('[data-ref="scroll-end"]');const i=[this.#ii,this.#ri,this.#ai],r=[...this.#ii.children];this.#oi=[...s.children].filter(e=>!i.includes(e)),r.length!==this.#oi.length&&console.warn(`ful-tabs: ${r.length} tabs declared for ${this.#oi.length} panels, the surplus is left alone`);const a=Math.min(r.length,this.#oi.length);this.#ni=[];for(let e=0;e!==a;++e){const s=this.#oi[e],i=document.createElement("button");i.type="button",i.role="tab",i.id=t.uid("ful-tab"),s.id||(s.id=t.uid("ful-tabpanel")),i.setAttribute("aria-controls",s.id),s.role="tabpanel",s.setAttribute("aria-labelledby",i.id),s.tabIndex=0,i.append(...r[e].childNodes),i.addEventListener("click",()=>{this.active=e}),r[e].replaceWith(i),this.#ni.push(i)}this.#ii.addEventListener("keydown",e=>{const t=this.#li;let s=null;"ArrowRight"===e.key?s=(t+1)%this.#ni.length:"ArrowLeft"===e.key?s=(t-1+this.#ni.length)%this.#ni.length:"Home"===e.key?s=0:"End"===e.key&&(s=this.#ni.length-1),null!==s&&s!==t&&(e.preventDefault(),this.active=s,this.#ni[s].focus())}),this.#ri.addEventListener("click",()=>this.#di(-1)),this.#ai.addEventListener("click",()=>this.#di(1)),this.#ii.addEventListener("scroll",()=>this.#ui(),{passive:!0});let n=-1;const o=new ResizeObserver(()=>{this.#ui(),this.#ii.clientWidth!==n&&(n=this.#ii.clientWidth,this.#ci(this.#ni[this.#li],"auto"))});o.observe(this.#ii);for(const e of this.#ni)o.observe(e);this.replaceChildren(s)}#ui(){const e=this.#ii,t=e.scrollWidth-e.clientWidth,s=Math.abs(e.scrollLeft);this.#ri.hidden=s<=1,this.#ai.hidden=s>=t-1,this.#ri.style.blockSize=this.#ai.style.blockSize=`${e.clientHeight}px`}#hi(){const e=this.#ii.getBoundingClientRect(),t="rtl"===getComputedStyle(this.#ii).direction,[s,i]=t?[this.#ai,this.#ri]:[this.#ri,this.#ai];return{left:e.left+s.offsetWidth,right:e.right-i.offsetWidth}}#di(e){const{left:t,right:s}=this.#hi(),i=e>0!=("rtl"===getComputedStyle(this.#ii).direction)?e=>e.getBoundingClientRect().right>s+1:e=>e.getBoundingClientRect().left<t-1,r=e>0?this.#ni.find(i):this.#ni.findLast(i);this.#ci(r,matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth")}#ci(e,t){if(!e)return;const{left:s,right:i}=this.#hi(),r=e.getBoundingClientRect();r.right>i?this.#ii.scrollBy({left:Math.ceil(r.right-i),behavior:t}):r.left<s&&this.#ii.scrollBy({left:Math.floor(r.left-s),behavior:t})}get active(){return this.#li}refresh(e){const t=e instanceof Element?this.#oi.indexOf(e):Number.isInteger(e)?e:NaN,s=this.#oi[t];if(s)return this.#Is.request(this,s,null,t).catch(()=>{});console.warn(`ful-tabs: no panel answers to "${e}"`)}set active(e){const t=Math.min(Math.max(0,Number(e)||0),Math.max(0,this.#ni.length-1)),s=this.#li;for(const[e,s]of this.#ni.entries())s.setAttribute("aria-selected",e===t?"true":"false"),s.tabIndex=e===t?0:-1,this.#oi[e].hidden=e!==t;this.#li=t,this.reflectTo("active",t),this.#ci(this.#ni[t],"auto"),this.rendered&&t!==s&&this.dispatchEvent(new CustomEvent("tabs:change",{detail:{active:t,previous:s}})),this.#oi.length>0&&(t!==s||!this.rendered)&&this.#Is.request(this,this.#oi[t],null,t).catch(()=>{})}}class Je extends e{static slots=!0;static observed=["exclusive:presence"];static template="\n <ful-accordion-group>{{{{ slots.default }}}}</ful-accordion-group>\n ";#re;#pi=!1;render({slots:e}){const t=this.template().withOverlay({slots:e}).render();this.#re=t.querySelector("ful-accordion-group"),this.replaceChildren(t)}get exclusive(){return this.#pi}set exclusive(e){this.#pi=!0===e,this.reflectTo("exclusive",this.#pi);const s=this.#pi?t.uid("ful-accordion"):null;for(const e of this.#re.querySelectorAll(":scope > details"))null===s?e.removeAttribute("name"):e.setAttribute("name",s)}}class Ye extends e{static slots=!0;static observed=["progress"];static template="\n <ful-steps><ol data-tpl-aria-label=\"#l10n:t('wizard.progress')\">{{{{ slots.steps }}}}</ol></ful-steps>\n {{{{ slots.default }}}}\n ";#fi=[];#Ps=[];#Is=new Fe;#mi=0;#gi;render({slots:e}){const t=this.template().withOverlay({slots:e}).render(),s=[...t.querySelector("ful-steps ol").children];this.#Ps=[...t.children].filter(e=>"ful-steps"!==e.localName),s.length!==this.#Ps.length&&console.warn(`ful-wizard: ${s.length} steps declared for ${this.#Ps.length} sections, the surplus is left alone`);const i=Math.min(s.length,this.#Ps.length);this.#fi=[];for(let e=0;e!==i;++e){const t=document.createElement("li");t.append(...s[e].childNodes),s[e].replaceWith(t),this.#fi.push(t),this.#Ps[e].tabIndex=-1}if(this.replaceChildren(t),i>0){const e=this.#Ps.findIndex(e=>"step"===e.getAttribute("aria-current"));this.#bi(-1===e?0:Math.min(e,i-1)),this.#vi(this.#mi).catch(()=>{})}}get index(){return this.#mi}get step(){return this.#Ps[this.#mi]?.getAttribute("data-step")??null}get progress(){return this.#gi}set progress(e){this.#gi=e,this.reflectTo("progress",e)}next(){return this.#yi(this.#mi+1)}prev(){return this.#yi(this.#mi-1)}move(e){const t=this.#Ps.findIndex(t=>t.getAttribute("data-step")===e);if(!(-1===t||t>=this.#fi.length))return this.#yi(t);console.warn(`ful-wizard: no section paired with a step carries data-step="${e}"`)}refresh(e){const t=e instanceof Element?this.#Ps.indexOf(e):this.#Ps.findIndex(t=>t.getAttribute("data-step")===e);if(!(-1===t||t>=this.#fi.length))return this.#vi(t).catch(()=>{});console.warn(`ful-wizard: no section answers to "${e}"`)}#vi(e){return this.#Is.request(this,this.#Ps[e],this.#Ps[e].getAttribute("data-step"),e)}#yi(e){const t=Math.min(Math.max(0,e),Math.max(0,this.#fi.length-1));if(t!==this.#mi)return this.#bi(t),this.#Ps[this.#mi].focus(),this.rendered&&this.dispatchEvent(new CustomEvent("wizard:change",{detail:{index:this.#mi,step:this.step}})),this.#vi(t)}#bi(e){for(const[t,s]of this.#fi.entries())t===e?(s.setAttribute("aria-current","step"),this.#Ps[t].setAttribute("aria-current","step")):(s.removeAttribute("aria-current"),this.#Ps[t].removeAttribute("aria-current"));this.#mi=e}}const Xe={en:{"pagination.showing":"Page {current} of {total}","pagination.navigation":"Page navigation","pagination.previous":"Previous","pagination.next":"Next","pagination.reload":"Reload","table.initial":"Start searching to see results.","table.error":"Error while loading data:","table.no-data":"No elements found.","table.loaded":"Showing {loaded} of {total}","table.range":"Rows {from}-{to} of {total}","table.retry":"Retry","dropdown.empty":"No results","select.remove":"Remove","files.dropzone-label":"Click or drop your files here","files.remove":"Remove","files.unacceptable-file-type":"Only files of type {types} are supported","files.max-file-size-exceeded":"Maximum supported file size is {size}","files.max-total-size-exceeded":"Maximum supported total file size is {size}","files.max-files-exceeded":{one:"Maximum of {count} file exceeded",other:"Maximum of {count} files exceeded"},"filters.op.EQ":"Equals","filters.op.NEQ":"Not equal","filters.op.LT":"Less than","filters.op.GT":"Greater than","filters.op.LTE":"At most","filters.op.GTE":"At least","filters.op.BETWEEN":"Between","filters.op.CONTAINS":"Contains","filters.op.STARTS_WITH":"Starts with","filters.op.ENDS_WITH":"Ends with","filters.sensitivity.IGNORE_CASE":"Ignore case","filters.sensitivity.CASE_SENSITIVE":"Case sensitive","filters.boolean.any":"Any","filters.boolean.true":"Yes","filters.boolean.false":"No","info.tooltip":"More information","failure.no-reason":"Something went wrong","dialog.acknowledge":"Got it","dialog.close":"Close","dialog.confirm":"Confirm","dialog.cancel":"Cancel","dialog.discard.header":"Unsaved changes","dialog.discard.body":"There are unsaved changes: close anyway?","dialog.discard.confirm":"Close without saving","dialog.discard.cancel":"Keep editing","drawer.close":"Close","spinner.loading":"Loading…","tabs.previous":"Previous tabs","tabs.next":"Next tabs","toast.region":"Notifications","toast.dismiss":"Dismiss","wizard.progress":"Progress"},it:{"pagination.showing":"Pagina {current} di {total}","pagination.navigation":"Navigazione pagine","pagination.previous":"Precedente","pagination.next":"Successivo","pagination.reload":"Ricarica","table.initial":"Avvia la ricerca per visualizzare i risultati.","table.error":"Errore nel caricamento dei dati:","table.no-data":"Nessun elemento trovato.","table.loaded":"Mostrati {loaded} di {total}","table.range":"Righe {from}-{to} di {total}","table.retry":"Riprova","dropdown.empty":"Nessun risultato","select.remove":"Rimuovi","files.dropzone-label":"Clicca o trascina i file qui","files.remove":"Rimuovi","files.unacceptable-file-type":"Solo i file di tipo {types} sono supportati","files.max-file-size-exceeded":"La dimensione massima di un file è di {size}","files.max-total-size-exceeded":"La dimensione massima complessiva dei file è di {size}","files.max-files-exceeded":{other:"Superato il numero massimo di {count} file"},"filters.op.EQ":"Uguale","filters.op.NEQ":"Diverso","filters.op.LT":"Minore","filters.op.GT":"Maggiore","filters.op.LTE":"Al massimo","filters.op.GTE":"Almeno","filters.op.BETWEEN":"Tra","filters.op.CONTAINS":"Contiene","filters.op.STARTS_WITH":"Inizia con","filters.op.ENDS_WITH":"Termina con","filters.sensitivity.IGNORE_CASE":"Ignora maiuscole","filters.sensitivity.CASE_SENSITIVE":"Distingui maiuscole","filters.boolean.any":"Qualsiasi","filters.boolean.true":"Sì","filters.boolean.false":"No","info.tooltip":"Maggiori informazioni","failure.no-reason":"Si è verificato un errore","dialog.acknowledge":"Ho capito","dialog.close":"Chiudi","dialog.confirm":"Conferma","dialog.cancel":"Annulla","dialog.discard.header":"Modifiche non salvate","dialog.discard.body":"Ci sono modifiche non salvate: chiudere comunque?","dialog.discard.confirm":"Chiudi senza salvare","dialog.discard.cancel":"Continua a modificare","drawer.close":"Chiudi","spinner.loading":"Caricamento…","tabs.previous":"Schede precedenti","tabs.next":"Schede successive","toast.region":"Notifiche","toast.dismiss":"Chiudi","wizard.progress":"Avanzamento"},es:{"pagination.showing":"Página {current} de {total}","pagination.navigation":"Navegación de páginas","pagination.previous":"Anterior","pagination.next":"Siguiente","pagination.reload":"Recargar","table.initial":"Inicia la búsqueda para ver los resultados.","table.error":"Error al cargar los datos:","table.no-data":"No se encontraron elementos.","table.loaded":"Mostrando {loaded} de {total}","table.range":"Filas {from}-{to} de {total}","table.retry":"Reintentar","dropdown.empty":"Sin resultados","select.remove":"Eliminar","files.dropzone-label":"Haz clic o arrastra tus archivos aquí","files.remove":"Eliminar","files.unacceptable-file-type":"Solo se admiten archivos de tipo {types}","files.max-file-size-exceeded":"El tamaño máximo de archivo admitido es {size}","files.max-total-size-exceeded":"El tamaño total máximo admitido es {size}","files.max-files-exceeded":{one:"Se ha superado el número máximo de {count} archivo",other:"Se ha superado el número máximo de {count} archivos"},"filters.op.EQ":"Igual","filters.op.NEQ":"Distinto","filters.op.LT":"Menor","filters.op.GT":"Mayor","filters.op.LTE":"Como máximo","filters.op.GTE":"Al menos","filters.op.BETWEEN":"Entre","filters.op.CONTAINS":"Contiene","filters.op.STARTS_WITH":"Empieza por","filters.op.ENDS_WITH":"Termina por","filters.sensitivity.IGNORE_CASE":"Ignorar mayúsculas","filters.sensitivity.CASE_SENSITIVE":"Distinguir mayúsculas","filters.boolean.any":"Cualquiera","filters.boolean.true":"Sí","filters.boolean.false":"No","info.tooltip":"Más información","failure.no-reason":"Se ha producido un error","dialog.acknowledge":"Entendido","dialog.close":"Cerrar","dialog.confirm":"Confirmar","dialog.cancel":"Cancelar","dialog.discard.header":"Cambios sin guardar","dialog.discard.body":"Hay cambios sin guardar: ¿cerrar de todos modos?","dialog.discard.confirm":"Cerrar sin guardar","dialog.discard.cancel":"Seguir editando","drawer.close":"Cerrar","spinner.loading":"Cargando…","tabs.previous":"Pestañas anteriores","tabs.next":"Pestañas siguientes","toast.region":"Notificaciones","toast.dismiss":"Cerrar","wizard.progress":"Progreso"},fr:{"pagination.showing":"Page {current} sur {total}","pagination.navigation":"Navigation des pages","pagination.previous":"Précédent","pagination.next":"Suivant","pagination.reload":"Recharger","table.initial":"Lancez la recherche pour voir les résultats.","table.error":"Erreur lors du chargement des données :","table.no-data":"Aucun élément trouvé.","table.loaded":"Affichage de {loaded} sur {total}","table.range":"Lignes {from} à {to} sur {total}","table.retry":"Réessayer","dropdown.empty":"Aucun résultat","select.remove":"Retirer","files.dropzone-label":"Cliquez ou déposez vos fichiers ici","files.remove":"Retirer","files.unacceptable-file-type":"Seuls les fichiers de type {types} sont pris en charge","files.max-file-size-exceeded":"La taille maximale de fichier prise en charge est {size}","files.max-total-size-exceeded":"La taille totale maximale prise en charge est {size}","files.max-files-exceeded":{one:"Nombre maximal de {count} fichier dépassé",other:"Nombre maximal de {count} fichiers dépassé"},"filters.op.EQ":"Égal","filters.op.NEQ":"Différent","filters.op.LT":"Inférieur","filters.op.GT":"Supérieur","filters.op.LTE":"Au plus","filters.op.GTE":"Au moins","filters.op.BETWEEN":"Entre","filters.op.CONTAINS":"Contient","filters.op.STARTS_WITH":"Commence par","filters.op.ENDS_WITH":"Finit par","filters.sensitivity.IGNORE_CASE":"Ignorer la casse","filters.sensitivity.CASE_SENSITIVE":"Respecter la casse","filters.boolean.any":"Indifférent","filters.boolean.true":"Oui","filters.boolean.false":"Non","info.tooltip":"Plus d’informations","failure.no-reason":"Une erreur s'est produite","dialog.acknowledge":"J’ai compris","dialog.close":"Fermer","dialog.confirm":"Confirmer","dialog.cancel":"Annuler","dialog.discard.header":"Modifications non enregistrées","dialog.discard.body":"Des modifications ne sont pas enregistrées : fermer quand même ?","dialog.discard.confirm":"Fermer sans enregistrer","dialog.discard.cancel":"Continuer à modifier","drawer.close":"Fermer","spinner.loading":"Chargement…","tabs.previous":"Onglets précédents","tabs.next":"Onglets suivants","toast.region":"Notifications","toast.dismiss":"Fermer","wizard.progress":"Progression"}};class Ze{#wi;#Ei;#xi;constructor(e={}){const t=e.language||navigator?.language||"en";try{this.#wi=Intl.getCanonicalLocales(String(t).replaceAll("_","-"))[0]}catch{throw new RangeError(`Plugin: language '${t}' is not a language tag: pass a BCP-47 tag such as 'it' or 'it-IT', or leave it out for the browser's language`)}this.#Ei=e.translations??{},this.#xi=e.httpClient??null}configure(e){const t=this.#xi??d.builder().withCsrfToken().withRedirectOnUnauthorized("/").build(),s=this.#wi.split("-")[0],i={...Xe.en,...Xe[s],...this.#Ei};e.defineModule("l10n",r).defineComponent("http-client",t).defineElement("ful-tooltip",Ie).defineElement("ful-dialog",$e).defineElement("ful-drawer",Ve).defineElement("ful-menu",He).defineElement("ful-toasts",Ue).defineElement("ful-tabs",Qe).defineElement("ful-accordion",Je).defineElement("ful-wizard",Ye).defineElement("ful-form",C).defineElement("ful-checkbox",ae).defineElement("ful-input",N).defineElement("ful-input-file",$).defineElement("ful-local-date",I).defineElement("ful-instant",F).defineElement("ful-input-local-date",B).defineElement("ful-input-local-time",P).defineElement("ful-input-instant",D).defineElement("ful-radio-group",re).defineElement("ful-table",he).defineElement("ful-pagination",oe).defineElement("ful-sorter",ne).defineElement("ful-filter-instant",ke).defineElement("ful-filter-local-date",Re).defineElement("ful-filter-number",Te).defineElement("ful-filter-boolean",Oe).defineElement("ful-filter-text",Le).defineElement("ful-filter-in",Me).defineElement("ful-select",ie).defineElement("ful-dropdown",se).defineComponent("loaders:select",te).defineComponent("loaders:form",_).defineComponent("loaders:table",ce).defineOverlay({l10n:i,locale:this.#wi})}}export{Je as Accordion,Q as Anchors,g as AsyncEvents,E as Bindings,Oe as BooleanFilter,ae as Checkbox,v as Claims,Ce as CompareFilter,$e as Dialog,Ve as Drawer,se as Dropdown,x as Field,C as Form,_ as FormLoader,Me as InFilter,N as Input,$ as InputFile,D as InputInstant,B as InputLocalDate,P as InputLocalTime,F as Instant,ke as InstantFilter,I as LocalDate,Re as LocalDateFilter,h as LocalStorage,He as Menu,Te as NumberFilter,b as PageLeave,oe as Pagination,Ze as Plugin,re as RadioGroup,ie as Select,te as SelectLoader,p as SessionStorage,ne as SortButton,he as Table,ce as TableLoader,Qe as Tabs,Le as TextFilter,w as Timing,Ue as Toasts,Ie as Tooltip,f as VersionedLocalStorage,m as VersionedSessionStorage,Ye as Wizard,y as describable};
1
+ import{ParsedElement as e,Attributes as t,Fragments as s,Rendering as i,Localization as r,BoundedCache as a,Templates as n,Nodes as o}from"./ftl.min.mjs";import{Failure as l,HttpClient as d}from"./httpc.min.mjs";const u=e=>{const t=t=>{try{e().removeItem(t)}catch{}},s=s=>{let i;try{i=e().getItem(s)}catch{return}if(null!==i)try{return JSON.parse(i)}catch{return void t(s)}};return{save:(t,s)=>{e().setItem(t,JSON.stringify(s))},load:s,remove:t,pop:e=>{const i=s(e);return t(e),i}}},c=e=>({save(t,s,i){e.save(t,{revision:s,data:i})},load(t,s){const i=e.load(t);if(null!=i&&"object"==typeof i&&i.revision===s)return i.data;e.remove(t)}}),h=u(()=>localStorage),p=u(()=>sessionStorage),f=c(h),m=c(p);class g{static async fireAsync(e,t,s){e.dispatchEvent(t);const i=t.async?.promises??[],r=s?.mode??"broadcast";if("pipeline"===r&&i.length>1||"delegate"===r&&1!==i.length)throw Promise.all(i).catch(()=>{}),new Error("pipeline"===r?`[AsyncEvents] Event "${t.type}" is configured in 'pipeline' mode and expects at most one async listener, but ${i.length} listeners were triggered on this element.`:`[AsyncEvents] Event "${t.type}" is configured in 'delegate' mode and requires exactly one async listener, but ${i.length} were registered.`);return"broadcast"===r?Promise.all(i):Promise.resolve(i[0])}static asyncOn(e,t,s,i){const r=async e=>{const t=e;t.async||(t.async={promises:[]});const{promise:i,resolve:r,reject:a}=Promise.withResolvers();t.async.promises.push(i);try{r(await s(t))}catch(e){a(e)}};return e.addEventListener(t,r,i),r}static asyncOff(e,t,s,i){e.removeEventListener(t,s,i)}static mixInto(...e){for(const t of e)Object.assign(t.prototype,{async fireAsync(e,t){return await g.fireAsync(this,e,t)},asyncOn(e,t,s){return g.asyncOn(this,e,t,s)},asyncOff(e,t,s){g.asyncOff(this,e,t,s)}})}}class b{static guard(e,t){window.addEventListener("beforeunload",t=>{e()&&t.preventDefault()},{signal:t})}}class v{#e=0;take(){return++this.#e,this.hold()}hold(){const e=this.#e,t=this;return{get stale(){return e!==t.#e}}}invalidate(){++this.#e}}const y=e=>{for(let t=e.parentElement;t;t=t.parentElement)if("function"==typeof t.describedBy)return t;return null};class w{static sleep(e){return new Promise(t=>setTimeout(t,e))}static debounce(e,t,s){const i=s?.immediate??!1;let r=null,a=[],n=0;const o=()=>{const s=performance.now()-n;e>s?r=setTimeout(o,e-s):(r=null,i||t(...a),null===r&&(a=[]))};return[(...s)=>{a=s,n=performance.now(),null===r&&(r=setTimeout(o,e),i&&t(...a))},()=>{clearTimeout(r??void 0),r=null,a=[]}]}static throttle(e,t,s){const i=s?.leading??!0,r=s?.trailing??!0;let a=null,n=[],o=0;const l=()=>{o=i?performance.now():0,a=null,t(...n),null===a&&(n=[])};return[(...s)=>{const d=performance.now();o||i||(o=d);const u=0===o?0:e-(d-o);n=s,u<=0||u>e?(null!==a&&(clearTimeout(a),a=null),o=d,t(...n),null===a&&(n=[])):null===a&&r&&(a=setTimeout(l,u))},()=>{clearTimeout(a??void 0),a=null,n=[]}]}}class E{static flatten(e,t,s){return Object.keys(e).reduce((i,r)=>{const a=t.length?`${t}.${r}`:r;return s.has(a)||"object"!=typeof e[r]||null===e[r]?i[a]=e[r]:Object.assign(i,E.flatten(e[r],a,s)),i},{})}static#t=new Set(["__proto__","prototype","constructor"]);static providePath(e,t,s){const i=t.split(".").map(e=>/^[0-9]+$/.test(e)?+e:e);for(const e of i)if(E.#t.has(e))throw new Error(`unsupported name segment '${e}' in '${t}'`);let r=e??{},a=null;for(let t=0;;++t){const n=i[t],o=i[t-1];if(Number.isInteger(n)&&!Array.isArray(r)&&(null!==a?a[o]=r=[]:e=r=[]),t===i.length-1)return r[n]=void 0!==s?s:n in r?r[n]:null,e;"object"==typeof r[n]&&null!==r[n]||(r[n]={}),a=r,r=r[n]}}static extract(e){if("radio"===e.getAttribute("type")){if(!e.checked)return;return"boolean"===e.dataset.fulBindType?"true"===e.value:e.value}return"checkbox"===e.getAttribute("type")?e.checked:"boolean"===e.dataset.fulBindType?e.value?"true"===e.value:null:"SELECT"===e.tagName&&e.multiple?Array.from(e.selectedOptions).map(e=>e.value):"INPUT"!==e.tagName&&"SELECT"!==e.tagName&&"TEXTAREA"!==e.tagName||""!==e.value&&void 0!==e.value?e.value:null}static#s(e){return"submit"===e.type||"reset"===e.type||"button"===e.type}static extractFrom(e,t){let s={};for(const i of e.elements)i.hasAttribute("name")&&(E.#s(i)&&i!==t||i.matches(":disabled")&&i!==t||(s=E.providePath(s,i.getAttribute("name"),E.extract(i))));return s}static mutate(e,t){if("radio"!==e.getAttribute("type"))if("checkbox"!==e.getAttribute("type")){if("SELECT"===e.tagName&&e.multiple){const s=Array.isArray(t)?t.map(String):null==t?[]:[String(t)];return void Array.from(e.options).forEach(e=>{e.selected=s.includes(e.value)})}e.value=t}else e.checked=t;else e.checked=null!=t&&e.getAttribute("value")===String(t)}static mutateIn(e,t){const s=E.#i(e);for(const[e,i]of Object.entries(E.flatten(t,"",new Set(s.keys()))))for(const t of s.get(e)??[])E.mutate(t,i)}static#i(e){const t=new Map;for(const s of e.elements){const e=s.getAttribute("name");if(!e)continue;const i=t.get(e);i?i.push(s):t.set(e,[s])}return t}static errors(e,t,s){const i=t=>t.closest("form")===e;Array.from(e.querySelectorAll("ful-field-error")).filter(i).forEach(e=>{e.setAttribute("aria-live",s?"off":"polite")});const r=e=>("FIELD_ERROR"===e.type||"INVALID_FORMAT"===e.type)&&e.context,a=t.filter(r),n=t.filter(e=>!r(e)),o=E.#i(e);for(const e of o.values())e.forEach(e=>{e.setCustomValidity?.("")});const l=[],d=new Map;a.forEach(e=>{const t=e.context.replace(/\[/g,".").replace(/\]\./g,".").replace(/\]/g,"").split(".");for(let s=t.length;0!==s;--s){const i=t.slice(0,s).join("."),r=(o.get(i)??[]).filter(e=>"function"==typeof e.setCustomValidity);if(0===r.length)continue;const a=t.slice(s).join(".");return void r.forEach(t=>{const s=d.get(t)??new Map;s.set(a,[...s.get(a)??[],e.reason]),d.set(t,s)})}l.push(e)});for(const[e,t]of d)for(const[s,i]of t)e.setCustomValidity(i.join("\n"),s);const u=[...n,...l];e.querySelectorAll("ful-errors").forEach(e=>{if(!i(e))return;const t=e;if(e.setAttribute("role","alert"),0===u.length)return e.replaceChildren(),void e.setAttribute("hidden","");e.removeAttribute("hidden"),t.innerText=u.map(e=>e.reason).join("\n")}),0!==t.length&&s&&Array.from(e.elements).filter(e=>"fieldset"!==e.localName&&e.matches(":invalid")).sort((e,t)=>e.getBoundingClientRect().y-t.getBoundingClientRect().y)[0]?.focus()}}class x extends e{static formAssociated=!0;static observed=["disabled:presence","readonly:presence","required:presence","value"];static ROLE="presentation";#r;#a=null;#n;#o=[];#l=null;#d;#u;#c;#h=[];#p=null;#f=null;constructor(){super(),this.internals.role=this.constructor.ROLE}#m(){return[this.#u??this.#r,...this.#h].filter(e=>e)}#g({fragment:e,control:s,error:i,label:r=null,described:a=null,claims:n=null,announces:o=s,freeze:l=null,also:d=[]}){if(this.#r=s,this.#d=i,this.#u=n,this.#c=o,this.#h=d,l&&l.addEventListener("click",e=>{this.readonly&&e.preventDefault()},!0),this.#n=a??s,i&&(i.id=i.id||t.uid("ful-field-error"),this.#l=i.id),this.#b(),r&&x.#v(this,r,s),this.addEventListener("keydown",e=>{if("Enter"!==e.key||e.defaultPrevented||e.isComposing)return;const t=e.target;t.form!==this.form&&x.#y(t)&&this._requestSubmit()}),this.replaceChildren(e),null!==this.#a){const e=this.#a;this.#a=null,s.focus(e)}if(null!==this.#f){const{error:e,context:t}=this.#f;this.#f=null,this.setCustomValidity(e,t)}}static#y(e){return e instanceof HTMLInputElement&&!["file","button","submit","reset","image"].includes(e.type)}describedBy(e){return!!e&&(e.id||(e.id=t.uid("ful-described")),this.#o.includes(e.id)||this.#o.push(e.id),this.#b(),!0)}#b(){if(!this.#n)return;const e=[...this.#o,this.#l].filter(e=>e);e.length&&this.#n.setAttribute("aria-describedby",e.join(" "))}focus(e){this.#r?this.#r.focus(e):this.#a=e??{}}setCustomValidity(e,s){if(this.#d){if(t.set(this.#c??this.#r,"aria-invalid",e?"true":null),!e)return this.internals.setValidity({}),void(this.#d.innerText="");this.internals.setValidity({customError:!0}," "),this.#d.innerText=e}else this.#f=e?{error:e,context:s}:null}get form(){return this.internals.form}_requestSubmit(){const e=this.form;if(!e)return;const t=e.querySelectorAll("button:not(:disabled), input:not(:disabled)");e.requestSubmit([...t].find(t=>"submit"===t.type&&t.form===e))}_notifyChange(e={}){this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value,...e}}))}static#w=new Set(["BUTTON","INPUT","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA"]);static#v(e,s,i){if(!x.#w.has(i.tagName)||"hidden"===i.getAttribute("type"))return s.id||(s.id=t.uid("ful-label")),i.setAttribute("aria-labelledby",s.id),void s.addEventListener("click",()=>e.focus());i.id||(i.id=t.uid("ful-control")),s.setAttribute("for",i.id)}_interactive(){return!this.matches(":disabled")&&!this.readonly}async upgrade(){if(await super.upgrade(),null===this.#p)return;const{value:e}=this.#p;this.#p=null,this.value=e}_holdValue(e){this.#p={value:e}}_heldValue(){return null===this.#p?this.declared("value"):this.#p.value}get value(){}set value(e){}formResetCallback(){this.value=this.unmarshal("value",this.getAttribute("value"))}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.reflectTo("disabled",e);for(const t of this.#m())t.toggleAttribute("disabled",e)}get readonly(){return this.hasAttribute("readonly")}set readonly(e){for(const t of this.#m())t.readOnly=e;this.#c&&t.set(this.#c,"aria-readonly",e?"true":null),this.reflectTo("readonly",e)}get required(){return this.hasAttribute("required")}set required(e){this.#c&&t.set(this.#c,"aria-required",e?"true":null),this.reflectTo("required",e)}render(e){e.slots?.default&&s.isBlank(e.slots.default)&&e.slots.default.replaceChildren();const t=this._build(e);if(t instanceof Promise)return t.then(e=>this.#g(e));this.#g(t)}_build(e){throw new Error(`${this.constructor.name} must implement _build`)}}class A{#E;#x;#A;#S;#_;constructor(e,t,s,i,r){this.#E=e,this.#x=t,this.#A=s,this.#S=i,this.#_=r}prepare(e,t){return this.#S(e,t)}async submit(e,t){return await this.#E.request(this.#A,this.#x).json(e).fetch()}transform(e,t){return this.#_(e,t)}}class S{#S;#_;constructor(e,t){this.#S=e,this.#_=t}async prepare(e,t){return await this.#S(e,t)}async submit(e,t,s){return s}async transform(e,t){return await this.#_(e,t)}}class _{static create(e,t){const s=e.component("http-client"),i=e.declared("request-mapper")?e.component(e.declared("request-mapper")):e=>e,r=e.declared("response-mapper")?e.component(e.declared("response-mapper")):e=>e,a=e.declared("action");if(!a)return new S(i,r);const n=e.declared("method")??"POST";return new A(s,a,n,i,r)}}const q=e=>void 0!==e.form?e.form:e.constructor?.formAssociated?e.internals?.form:void 0;class C extends e{static attributes=["action","method","loader","request-mapper","response-mapper","clear-invalid-on-change:presence","scroll-on-error:presence","autocomplete","track-changes:presence","guard-leave:presence"];form;render(){const e=document.createElement("form");this.form=e,e.setAttribute("novalidate",""),t.set(e,"autocomplete",this.declared("autocomplete")),t.forward("form-",this,e),e.replaceChildren(...this.childNodes),e.addEventListener("submit",async e=>{e.preventDefault(),e.stopPropagation(),await this.submit(e.submitter??void 0)}),this.addEventListener("click",e=>{const t=e.target;t.closest?.('[aria-disabled="true"]')&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.declared("clear-invalid-on-change")&&this.addEventListener("change",e=>{q(e.target)===this.form&&e.target.setCustomValidity?.("")}),this.replaceChildren(e),this.#q=this.declared("track-changes")||this.declared("guard-leave"),this.#q&&(this.addEventListener("input",e=>this.#C(e.target)),this.addEventListener("change",e=>this.#C(e.target)),this.addEventListener("focusin",e=>this.#k(e.target)),this.form.addEventListener("reset",e=>{if(e.target===this.form){for(const e of new Set([...this.#R.keys(),...this.#T().keys()]))this.#L.set(e,++this.#z);0===this.#N&&(this.#N=requestAnimationFrame(()=>this.#O()))}}),i.waitForChildren(this).catch(()=>{}).then(()=>this.commit()),this.#M())}connectedCallback(){super.connectedCallback(),this.#q&&this.#M()}disconnectedCallback(){this.#I?.abort(),this.#I=null}#F=!1;async submit(e){if(this.#F)return!1;let t,s,i;this.#F=!0,this.spinner(!0);try{const r=this.component(this.declared("loader")??"loaders:form").create(this);t=E.extractFrom(this.form,e);const a=this.#q?{saved:this.#T(),upTo:this.#z}:null;s=await r.prepare(t,this);const n=new CustomEvent("submit",{bubbles:!0,cancelable:!0,detail:{submitter:e,values:t,request:s}});if(!this.dispatchEvent(n))return!1;this.errors=[];const o=new CustomEvent("submit:requested",{bubbles:!0,cancelable:!1,detail:{submitter:e,values:n.detail.values,request:n.detail.request}});let l=await g.fireAsync(this,o,{mode:"pipeline"});s=o.detail.request,l=await r.submit(s,this,l);const d=await r.transform(l,this);a&&this.#B(a.saved,a.upTo),i=new CustomEvent("submit:success",{bubbles:!0,cancelable:!1,detail:{submitter:e,values:t,request:s,response:d}})}catch(r){i=new CustomEvent("submit:failure",{bubbles:!0,cancelable:!1,detail:{submitter:e,values:t,request:s,exception:r}}),r instanceof l?this.errors=r.problems:console.warn("failed to submit form",this,"reason:",r)}finally{this.#F=!1,this.spinner(!1)}return this.dispatchEvent(i),"submit:success"===i.type}async save(e){return!(!this.#q||this.dirty)||await this.submit(e)&&!this.dirty}reset(){this.form.reset(),this.#q&&this.#O()}#R=new Map;#P=new Map;#L=new Map;#z=0;#D=!1;#N=0;#I=null;#q=!1;get dirty(){if(!this.#q)return!1;for(const e of this.#L.keys()){const t=this.#$(e);if((this.#R.has(e)||"[]"!==t)&&(this.#R.get(e)??this.#P.get(e))!==t)return!0}return!1}commit(){this.#q&&this.#B(this.#T(),this.#z)}edited(...e){for(const t of e)this.#C(t)}#B(e,t){this.#R=e;for(const[e,s]of this.#L)s<=t&&this.#L.delete(e);for(const t of this.#P.keys())e.has(t)&&this.#P.delete(t);this.#O()}#W(e){for(let t=e;t&&t!==this;t=t.parentElement)if(q(t)===this.form&&t.hasAttribute("name"))return t.getAttribute("name");return null}#C(e){if(!this.#q)return;const t=this.#W(e);null!==t&&(this.#L.set(t,++this.#z),0===this.#N&&(this.#N=requestAnimationFrame(()=>this.#O())))}#k(e){const t=this.#W(e);null===t||this.#R.has(t)||this.#P.has(t)||this.#P.set(t,this.#$(t))}#V(){return Array.from(this.form.elements).filter(e=>e.hasAttribute("name")&&!["submit","reset","button"].includes(e.type)&&!e.matches(":disabled"))}#T(){const e=new Map;for(const t of this.#V()){const s=t.getAttribute("name");e.set(s,[...e.get(s)??[],E.extract(t)])}return new Map(Array.from(e,([e,t])=>[e,JSON.stringify(t)]))}#$(e){return JSON.stringify(this.#V().filter(t=>t.getAttribute("name")===e).map(e=>E.extract(e)))}#O(){cancelAnimationFrame(this.#N),this.#N=0;const e=this.dirty;this.querySelectorAll("button").forEach(t=>{const s=t;s.form===this.form&&"submit"===s.type&&s.toggleAttribute("data-ful-dirty",e)}),e!==this.#D&&(this.#D=e,e?this.internals.states.add("dirty"):this.internals.states.delete("dirty"),this.dispatchEvent(new CustomEvent("dirty:change",{bubbles:!0,cancelable:!1,detail:{dirty:e}})))}#M(){this.declared("guard-leave")&&!this.#I&&(this.#I=new AbortController,b.guard(()=>this.dirty,this.#I.signal))}#H=0;#j(e){if(t.defaultValue(e,"role","status"),e.hidden=!1,""!==e.textContent.trim())return;const s=document.createElement("span");s.className="ful-sr-only",s.dataset.ref="spinner-label",e.append(s),s.textContent=r.of().t("spinner.loading")}spinner(e){if(e){if(++this.#H,1!==this.#H)return}else if(this.#H=Math.max(0,this.#H-1),0!==this.#H)return;t.set(this,"aria-busy",e?"true":null),this.querySelectorAll("ful-spinner").forEach(t=>{if(t.closest("form")!==this.form)return;const s=t;e?this.#j(s):(s.hidden=!0,s.querySelector(":scope > [data-ref=spinner-label]")?.remove())}),this.querySelectorAll("input,button").forEach(s=>{const i=s;if(i.form===this.form&&("submit"===i.type||"reset"===i.type))if(e)i.dataset.wd=i.getAttribute("aria-disabled")??"",i.setAttribute("aria-disabled","true");else{if(void 0===i.dataset.wd)return;t.set(i,"aria-disabled",i.dataset.wd||null),delete i.dataset.wd}})}set values(e){E.mutateIn(this.form,e)}get values(){return E.extractFrom(this.form)}set errors(e){E.errors(this.form,e,this.declared("scroll-on-error"))}}const k=new a(100),R=(e,t)=>k.getOrCompute(`${e}:${t}`,()=>{try{return new RegExp(t,"g")}catch(s){return console.warn(`invalid ${e} attribute`,t,s),null}}),T={numeric:"numeric",decimal:"decimal"},L=new Set(["date","time","datetime-local","month","week"]),z={numeric:e=>e.replace(/\D/g,""),decimal:e=>{const t=e.replace(/[^\d.,]/g,""),s=t.search(/[.,]/);return-1===s?t:t.slice(0,s+1)+t.slice(s+1).replace(/[.,]/g,"")}};class N extends x{static observed=["placeholder"];static attributes=["type","v-type","keep","reject","uppercase:presence","trim:presence","unsigned:presence","autocomplete"];static slots=!0;static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <input data-tpl-if="type != \'textarea\'" data-tpl-type="type" placeholder=" " form="">\n <textarea data-tpl-if="type == \'textarea\'" placeholder=" " form=""></textarea>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_input;#G=[];#K=null;_type(){return this.declared("type")??("number"===this.declared("v-type")?"number":"text")}_build({slots:e}){const t=this._type(),s=T[t],i=s?"text":t,r=this.template().withOverlay({type:i,slots:e}).render();this.#G=[...r.querySelectorAll(":is(ful-control-group, ful-control) > :is(input, textarea)")],this._input=this.#G[0];const a=this.declared("autocomplete")??(this.closest("form")?.getAttribute("autocomplete")??null);const n=(e=>{const t=e.declared("keep"),s=e.declared("reject");if(null!==t&&null!==s&&console.warn("a ful-input declares both keep and reject: keep is applied, reject is ignored",e),null!==t){const e=R("keep",t);return e&&(t=>(t.match(e)??[]).join(""))}if(null!==s){const e=R("reject",s);return e&&(t=>t.replace(e,""))}return((e,t)=>{const s=z[e];return s?t?s:e=>((e,t)=>(e.startsWith("-")?"-":"")+t(e))(e,s):null})(e._type(),e.declared("unsigned"))})(this);for(const e of this.#G)this.#U(e,s,a,n);return{fragment:r,control:this._input,error:r.querySelector("ful-field-error"),label:r.querySelector("label")}}#U(e,s,i,r){s&&t.set(e,"inputmode",s),t.set(e,"autocomplete",i);const a=e.id;t.forward("input-",this,e),e!==this._input&&t.set(e,"id",a||null),this.#Q(e),e.addEventListener("input",()=>{if(!r)return;const t=e.value,s=r(t);if(t===s)return;const i=e.selectionStart;if(e.value=s,null===i)return;const a=r(t.slice(0,i)).length;e.setSelectionRange(a,a)})}#Q(e){if(!L.has(e.type))return void e.addEventListener("change",e=>{e.stopPropagation(),this._notifyChange()});let t=!1;const s=()=>{t=!1;const e=JSON.stringify(this.value);e!==this.#K&&(this.#K=e,this._notifyChange())};e.addEventListener("focus",()=>{this.#K=JSON.stringify(this.value)}),e.addEventListener("keydown",e=>{"Enter"!==e.key||e.isComposing?t=!0:s()}),e.addEventListener("blur",s),e.addEventListener("change",e=>{e.stopPropagation(),t||s()})}get value(){const e=this.declared("uppercase"),t=this.declared("trim"),s=this._input?this._input.value:`${this._heldValue()??""}`,i=e?s.toUpperCase():s,r=t?i.trim():i;if(""===r)return null;const a="decimal"===this._type()?r.replaceAll(",","."):r;if("number"===this.declared("v-type")){const e=Number(a);return Number.isNaN(e)?a:e}return a}set value(e){this._input?(this._input.value=""===e||null==e?"":`${e}`,this.#K=JSON.stringify(this.value)):this._holdValue(e)}get placeholder(){const e=this._input.getAttribute("placeholder");return" "===e?null:e}set placeholder(e){for(const s of this.#G)t.set(s,"placeholder",e??" ");this.reflectTo("placeholder",e)}}const O=e=>""===e?null:e,M=e=>{const[t,s,i]=e.split("-").map(Number),r=new Date(0);return r.setFullYear(t,s-1,i),r.setHours(0,0,0,0),r.getFullYear()===t&&r.getMonth()===s-1&&r.getDate()===i?r:new Date(Number.NaN)};class I extends e{static attributes=["locale","default"];render(){const e=M(this.textContent.trim());if(Number.isNaN(e.getTime()))return void this.replaceChildren(this.declared("default")??"");const{date:t}=r.of({locale:this.declared("locale")??void 0});this.replaceChildren(t(e,{year:"numeric",month:"numeric",day:"numeric"}))}}class F extends e{static attributes=["locale","default"];render(){const e=this.textContent.trim(),t=""===e?null:new Date(F.isoToLocal(e));if(null===t||Number.isNaN(t.getTime()))return void this.replaceChildren(this.declared("default")??"");const{date:s}=r.of({locale:this.declared("locale")??void 0});this.replaceChildren(s(t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}))}static#J(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?M(e):new Date(e)}static isoToLocal(e){const t=F.#J(e),s=(e,t)=>String(t).padStart(e,"0");return`${t.getFullYear()}-${s(2,t.getMonth()+1)}-${s(2,t.getDate())}T${s(2,t.getHours())}:${s(2,t.getMinutes())}:${s(2,t.getSeconds())}.${s(3,t.getMilliseconds())}`}static localToIso(e){const t=F.#J(e);return Number.isNaN(t.getTime())?null:t.toISOString()}}class B extends N{static observed=["step","min","max"];_type(){return"date"}get min(){return O(this._input.min)}set min(e){this._input.min=B.#Y(e)}get max(){return O(this._input.max)}set max(e){this._input.max=B.#Y(e)}get step(){return O(this._input.step)}set step(e){this._input.step=e??""}static#Y(e){if(!e)return"";const t=e=>new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString().split("T")[0];if("now"===e)return t(new Date);const s=/^([+-])(\d+)([dmy])$/.exec(e);if(!s)return e;const i="-"===s[1]?-1:1,r=+s[2],a=new Date;switch(a.setHours(0,0,0,0),s[3]){case"d":a.setDate(a.getDate()+r*i);break;case"m":{const e=a.getDate();a.setMonth(a.getMonth()+r*i),a.getDate()!==e&&a.setDate(0);break}case"y":a.setFullYear(a.getFullYear()+r*i)}return t(a)}}class P extends B{_type(){return"time"}get min(){return O(this._input.min)}set min(e){this._input.min=this.#X(e)}get max(){return O(this._input.max)}set max(e){this._input.max=this.#X(e)}#X(e){if(!e)return"";const t=new Date;if("now"!==e){const s=/^([+-])(\d+)([hm])$/.exec(e);if(!s)return e;const i="-"===s[1]?-1:1,r=+s[2]*i;"h"===s[3]?t.setHours(t.getHours()+r):t.setMinutes(t.getMinutes()+r)}return P.#Z(t,Number(this._input.step)||60)}static#Z(e,t){const s=e=>String(e).padStart(2,"0"),i=3600*e.getHours()+60*e.getMinutes()+e.getSeconds(),r=Math.floor(i/t)*t,a=s(Math.floor(r/3600)),n=s(Math.floor(r%3600/60));return t%60==0?`${a}:${n}`:`${a}:${n}:${s(r%60)}`}}class D extends N{static observed=["step","min","max"];_type(){return"datetime-local"}get value(){if(!this._input){const e=this._heldValue();return F.localToIso(e?F.isoToLocal(e):"")}return F.localToIso(this._input.value)}set value(e){this._input?super.value=e?F.isoToLocal(e):"":this._holdValue(e)}get min(){return F.localToIso(this._input.min)}set min(e){this._input.min=e?F.isoToLocal(e):""}get max(){return F.localToIso(this._input.max)}set max(e){this._input.max=e?F.isoToLocal(e):""}get step(){return O(this._input.step)}set step(e){this._input.step=e??""}}class $ extends N{static WARNING_TIMEOUT=5e3;static list(e=[]){const t=new DataTransfer;for(const s of e)t.items.add(s);return t.files}static observed=["placeholder","accept:csv","multiple:presence","item-list:presence","dropzone:presence","no-input:presence","max-files:number","max-file-size:number","max-total-size:number","value"];#ee;#te;#se;#ie;#re;_type(){return"file"}static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <input data-tpl-type="type" placeholder=" " form="">\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <div data-ref="dropzone" class="dropzone" data-tpl-if="slots.dropzone">\n {{{{ slots.dropzone }}}}\n </div>\n <div data-ref="dropzone" class="default-dropzone" data-tpl-if="!slots.dropzone">\n {{ #l10n:t(\'files.dropzone-label\') }}\n </div>\n <ful-item-list></ful-item-list>\n <ful-field-warnings role="status" aria-live="polite"></ful-field-warnings>\n <ful-field-error></ful-field-error>\n ';static templates={items:'\n <ful-item data-tpl-each="files" data-tpl-var="file" data-tpl-data-name="file.name">\n <div><span>{{ file.name }}</span><span>{{ #l10n:bytes(file.size) }}</span><button type="button" data-tpl-aria-label="#l10n:t(\'files.remove\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button></div>\n </ful-item>\n ',warning:"<ful-field-warning>{{ #l10n:t(key, args) }}</ful-field-warning>"};#ae;_build(e){const t=super._build(e),i=t.fragment;return this.#te=i.querySelector("ful-item-list"),this.#ae=e.slots?.items&&!s.isBlank(e.slots.items)?n.fromFragment(e.slots.items):null,this.#se=i.querySelector("[data-ref=dropzone]"),this.#ie=i.querySelector("ful-field-warnings"),this.#re=i.querySelector("ful-control-group"),this.#ie.addEventListener("animationend",e=>{e.target.remove()}),this.#te.addEventListener("click",e=>{if(!e.target.closest("button"))return;if(!this._interactive())return;const t=[...this.#te.children].indexOf(e.target.closest("ful-item"));-1!==t&&(this.files=$.list([...this.files].filter((e,s)=>s!==t)),this._notifyChange())}),this.#se.addEventListener("click",e=>{this._interactive()&&this._input.click()}),this.#se.addEventListener("dragover",e=>{e.preventDefault(),this.toggleAttribute("dragover",!0)}),this.#se.addEventListener("dragleave",()=>{this.toggleAttribute("dragover",!1)}),this.#se.addEventListener("drop",e=>{if(e.preventDefault(),this.toggleAttribute("dragover",!1),!this._interactive())return;const t=[...e.dataTransfer.items].filter(e=>"file"===e.kind).map(e=>e.getAsFile()).filter(e=>null!==e);0===t.length||t.length>1&&!this.multiple||(this.files=$.list(t),this._notifyChange())}),this._input.addEventListener("change",()=>{this.#ne()},{capture:!0}),{...t,freeze:this.#re}}#ne(){this.setCustomValidity(),this.#ie.replaceChildren(),this.#oe(),this.#le(),this.#de(),this.#ue(),(this.#ae??this.template("items")).withOverlay({files:this.files}).renderTo(this.#te)}warning(e,t){this.template("warning").withOverlay({key:e,args:t}).appendTo(this.#ie);const s=this.#ie.lastElementChild;setTimeout(()=>s.remove(),$.WARNING_TIMEOUT)}#ce(e){const t=e.name.toLowerCase();return this.#ee.some(s=>{const i=s.toLowerCase().split(";")[0].trim();return i.startsWith(".")?t.endsWith(i):i.endsWith("/*")?e.type.startsWith(`${i.slice(0,-1)}`):i.includes("/")&&e.type===i})}#oe(){if(!this.#ee.length)return;const e=[...this.files].filter(e=>!this.#ce(e));0!==e.length&&(this.warning("files.unacceptable-file-type",{types:this.#ee.join(", ")}),this._input.files=$.list([...this.files].filter(t=>!e.includes(t))))}#ue(){null!==this.#he&&(this.files.length<=this.#he||(this.warning("files.max-files-exceeded",{count:this.#he}),this._input.files=$.list()))}#le(){if(null===this.#pe)return;const e=[...this.files].filter(e=>e.size>this.#pe);0!==e.length&&(this.warning("files.max-file-size-exceeded",{size:r.of().bytes(this.#pe)}),this._input.files=$.list([...this.files].filter(t=>!e.includes(t))))}#de(){null!==this.#fe&&([...this.files].reduce((e,t)=>e+t.size,0)<=this.#fe||(this.warning("files.max-total-size-exceeded",{size:r.of().bytes(this.#fe)}),this._input.files=$.list()))}get accept(){return this.#ee}set accept(e){this._input.accept=e.join(","),this.#ee=e,this.reflectTo("accept",e)}get multiple(){return this._input?this._input.multiple:this.declared("multiple")}set multiple(e){this._input.multiple=e,this.reflectTo("multiple",e)}get files(){return this._input?this._input.files:$.list()}set files(e){this._input.files=e,this.#ne()}get file(){return this.files[0]??null}set file(e){this.files=$.list(e?[e]:[])}get value(){const e=Array.from(this.files).map(e=>e.name);return this.multiple?e:e[0]??null}set value(e){!e&&this._input&&(this.files=$.list())}formResetCallback(){this.value=null}get totalSize(){return Array.from(this.files).reduce((e,t)=>e+t.size,0)}#he;get maxFiles(){return this.#he}set maxFiles(e){this.#he=e,this.reflectTo("max-files",e)}#pe;get maxFileSize(){return this.#pe}set maxFileSize(e){this.#pe=e,this.reflectTo("max-file-size",e)}#fe;get maxTotalSize(){return this.#fe}set maxTotalSize(e){this.#fe=e,this.reflectTo("max-total-size",e)}#me;get itemList(){return this.#me}set itemList(e){this.#me=e,this.reflectTo("item-list",e)}#ge;get dropzone(){return this.#ge}set dropzone(e){this.#ge=e,this.reflectTo("dropzone",e)}#be;get noInput(){return this.#be}set noInput(e){this.#be=e,this.reflectTo("no-input",e)}}const W=new Map;let V=0,H=!1;const j=(e,t,s)=>Math.min(Math.max(e,t),Math.max(t,s)),G=(e,t)=>{const{invoker:s,stretch:i}=t,r=s.getBoundingClientRect(),a=document.documentElement,n=a.clientWidth,o=a.clientHeight;e.style.removeProperty("margin");const l=getComputedStyle(e),d=parseFloat(l.marginTop)||0,u=parseFloat(l.marginRight)||0,c=parseFloat(l.marginBottom)||0,h=parseFloat(l.marginLeft)||0;if(e.style.right="auto",e.style.bottom="auto",e.style.margin="0",i){e.style.removeProperty("width"),e.style.removeProperty("min-width"),e.style.removeProperty("max-width");const t=Math.min(parseFloat(l.maxWidth)||n,n-16);e.style.minWidth=`${Math.min(r.width,n-16)}px`,e.style.maxWidth=`${t}px`;const s=e.getBoundingClientRect().width;e.style.left=`${j(r.left,8,n-s-8)}px`;const i=e.getBoundingClientRect().height,a=r.bottom+d,u=a+i<=o-8?a:r.top-c-i;return void(e.style.top=`${j(u,8,o-i-8)}px`)}const p=(e=>e.matches("ful-note, .ful-note, [placement]"))(e),f=p?e.getAttribute("placement")??"bottom":"bottom";e.style.removeProperty("max-width");const m=Math.min(parseFloat(l.maxWidth)||n,n-16);e.style.maxWidth=`${m}px`,e.style.left="8px";const g=e.getBoundingClientRect().width;let b="right"===f?r.right+h:"left"===f?r.left-u-g:p?r.left+r.width/2-g/2:r.left;b=j(b,8,n-g-8),e.style.left=`${b}px`,e.style.maxWidth=`${Math.min(m,n-8-b)}px`;const v=e.getBoundingClientRect().height,y="top"===f?r.top-c-v:"right"===f||"left"===f?r.top+r.height/2-v/2:r.bottom+d;e.style.top=`${j(y,8,o-v-8)}px`,p&&((e,t)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();e.style.setProperty("--ful-note-callout-inline",s.left+s.width/2-i.left-e.clientLeft+"px"),e.style.setProperty("--ful-note-callout-block",s.top+s.height/2-i.top-e.clientTop+"px")})(e,s)},K=()=>{V=0;for(const[e,t]of W)e.isConnected&&t.invoker.isConnected?G(e,t):W.delete(e)},U=()=>{!V&&W.size>0&&(V=requestAnimationFrame(K))};class Q{static wire(e,s,{prefix:i="ful-anchor",invoke:r=!1,expanded:a=!1,stretch:n=!1,handPlace:o=!1}={}){const l=t.uid(i);if(r)if(s.id=s.id||l,"button"===e.localName||"input"===e.localName)e.setAttribute("popovertarget",s.id);else{let t=!1;e.addEventListener("pointerdown",()=>{t=s.matches(":popover-open")},!0),e.addEventListener("click",()=>{const e=t&&!s.matches(":popover-open");t=!1,e||s.togglePopover()}),e.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s.togglePopover())})}const d=`--${l}`;if(e.style.anchorName=d,s.style.positionAnchor=d,a&&(e.setAttribute("aria-expanded","false"),s.addEventListener("toggle",t=>{e.setAttribute("aria-expanded","open"===t.newState?"true":"false")})),!o&&CSS.supports("anchor-name: --ful-probe")&&CSS.supports("position-anchor: --ful-probe")&&CSS.supports("position-area: bottom")&&CSS.supports("top: anchor(bottom)")&&CSS.supports("width: anchor-size(width)"))return;const u={invoker:e,stretch:n};s.addEventListener("beforetoggle",e=>{"open"===e.newState&&((e,t)=>{e.style.visibility="hidden",queueMicrotask(()=>{e.matches(":popover-open")&&G(e,t),e.style.removeProperty("visibility")})})(s,u)}),s.addEventListener("toggle",e=>{"open"===e.newState?(W.set(s,u),G(s,u)):(W.delete(s),(e=>{for(const t of["top","left","right","bottom","margin","max-width","min-width","width","visibility","--ful-note-callout-inline","--ful-note-callout-block"])e.style.removeProperty(t)})(s))}),H||(H=!0,document.addEventListener("scroll",U,!0),window.addEventListener("resize",U))}static show(e,t,{flip:s=!1,gap:i=0}={}){return"function"!=typeof e.showPopover||e.matches(":popover-open")||e.showPopover(),(()=>{const r=t instanceof Element?t.getBoundingClientRect():t,a=document.documentElement,n=e.getBoundingClientRect(),o=r.bottom+i,l=r.top-i-n.height,d=s&&o+n.height>a.clientHeight-8&&l>=8?l:o;e.style.right="auto",e.style.bottom="auto",e.style.margin="0",e.style.left=`${j(r.left,8,Math.max(8,a.clientWidth-n.width-8))}px`,e.style.top=`${j(d,8,Math.max(8,a.clientHeight-n.height-8))}px`})(),e}}const J=(e,t)=>e.filter(({key:e})=>t.some(t=>String(t)===String(e))),Y=(e,t)=>e.filter(({label:e})=>(e??"").toLowerCase().includes(t?.toLowerCase()??""));class X{#E;#x;#A;#_;#ve;#ye;#we=null;#Ee=null;#xe=new v;constructor({http:e,url:t,method:s,responseMapper:i,prefetch:r,revision:a}){this.#E=e,this.#x=t,this.#A=s,this.#_=i,this.#ve=r,this.#ye=a}async prefetch(){this.#ve&&await this.#Ae()}async exact(...e){return J(await this.#Ae(),e)}async load(e){return Y(await this.#Ae(),e)}async invalidate(){this.#xe.invalidate(),this.#we=null,this.#Ee=null}async#Ae(){if(null===this.#we){if(null===this.#Ee){const e=this.#xe.hold();this.#Ee=X.#Se(this.#E,this.#A,this.#x,this.#ye).then(t=>{e.stale||(this.#we=this.#_(t))}).finally(()=>{e.stale||(this.#Ee=null)})}await this.#Ee}if(null===this.#we)throw new Error("superseded by an invalidation");return this.#we}static async#Se(e,t,s,i){const r=`${t}@${s}`;if(null!==i){const e=f.load(r,i);if(void 0!==e)return e}const a=await e.request(t,s).fetchJson();if(null!==i)try{f.save(r,i,a)}catch(e){console.warn("failed to cache the select options",e)}return a}}class Z{#E;#x;#A;#_;constructor({http:e,url:t,method:s,responseMapper:i}){this.#E=e,this.#x=t,this.#A=s,this.#_=i}async invalidate(){}async exact(...e){const t=await this.#E.request(this.#A,this.#x).param("k",...e).fetchJson();return this.#_(t)}async load(e){const t=await this.#E.request(this.#A,this.#x).param("s",e).fetchJson();return this.#_(t)}}class ee{#we;constructor(e){this.#we=e}update(e){this.#we=e}async invalidate(){}exact(...e){return J(this.#we,e)}load(e){return Y(this.#we,e)}}class te{static from({data:e,http:t,url:s,method:i="POST",mode:r,prefetch:a=!1,revision:n=null,responseMapper:o}){return s?"chunked"===r?new Z({http:t,url:s,method:i,responseMapper:o}):new X({http:t,url:s,method:i,responseMapper:o,prefetch:a,revision:n}):new ee(e??[])}static create(e,t){if(!e.declared("src")){const e=Array.from(t.options?.querySelectorAll("option")??[]);return te.from({data:e.map(e=>({key:e.getAttribute("value")??e.innerText.trim(),label:e.innerText.trim(),metadata:void 0}))})}return te.from({http:e.component("http-client"),url:e.declared("src"),method:e.declared("method")??"POST",mode:e.declared("mode"),prefetch:e.declared("preload"),revision:te.#_e(e),responseMapper:te.#qe(e)})}static#_e(e){const t=e.declared("revision");if(""!==t)return t;const s=e.component("revision");return null==s?(console.warn("a valueless revision asks the registry for one, and no 'revision' component is defined: the vocabulary will not be cached",e),null):"function"==typeof s?s():s}static#qe(e){return e.declared("k-expr")&&e.declared("l-expr")?t=>e._registry.evaluator().withOverlay(t).evaluateExpression(e.declared("d-expr")??"self").map(t=>{const s=e._registry.evaluator().withOverlay(t);return{key:s.evaluateExpression(e.declared("k-expr")),label:s.evaluateExpression(e.declared("l-expr")),metadata:s.evaluateExpression(e.declared("m-expr")??"self")}}):e.declared("response-mapper")?e.component(e.declared("response-mapper")):e=>e.map(([e,t,s])=>({key:e,label:t,metadata:s}))}}class se extends e{static attributes=["listbox"];static slots=!0;static template='\n <ful-spinner class="centered" role="status" hidden><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner>\n <ful-empty data-ref="empty" aria-live="polite" hidden>{{ #l10n:t(\'dropdown.empty\') }}</ful-empty>\n <menu tabindex="-1" role="listbox" hidden></menu>\n ';static templates={options:'\n <li data-tpl-each="self" data-tpl-selected="index == 0" data-tpl-value="index" role="option">\n {{ label }}\n </li>\n '};#Ce;#ke;#Re;#Te;#Le=new Map;#ze=new v;render({slots:e}){const i=this.template().render();this.#Te=s.isBlank(e.default)?this.template("options"):n.fromFragment(e.default),this.#Ce=i.querySelector("ful-spinner"),this.#Re=i.querySelector("[data-ref=empty]"),this.#ke=i.querySelector("menu"),this.#ke.id=this.declared("listbox")||t.uid("ful-listbox"),this.#ke.addEventListener("mousedown",e=>{e.target.closest("li")&&e.preventDefault()}),this.#ke.addEventListener("click",e=>{e.stopPropagation();const t=e.target.closest("li");t?t.matches('[aria-disabled="true"]')||this.#Ne(t):this.hide()}),this.replaceChildren(i)}#Oe(){return!this.#ke||this.#ke.hidden?null:this.#ke.querySelector("li[selected]")??this.#ke.querySelector('li:not([aria-disabled="true"])')}#Me(e){if(e){for(const t of this.#ke.querySelectorAll("li"))t.toggleAttribute("selected",t===e);e.id||=t.uid("ful-option"),this.#Ie(e.id),e.scrollIntoView({block:"nearest",behavior:matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"})}else this.#Ie(null)}acceptSelection(){const e=this.#Oe();e&&!e.matches('[aria-disabled="true"]')&&this.#Ne(e)}update(e,t=[]){if(void 0===e)throw new Error("null data");this.#Le=new Map(e.map((e,t)=>[String(t),e]));const s=e.map((e,t)=>({index:t,...e}));this.#Te.withOverlay(s).renderTo(this.#ke);for(const[s,i]of[...this.#ke.children].entries()){const r=e[s],a=t.some(e=>String(e)===String(r?.key));i.toggleAttribute("picked",a),i.setAttribute("aria-selected",a?"true":"false");const n=!!r?.metadata?.disabled;n?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),n&&r.metadata.reason?i.setAttribute("title",String(r.metadata.reason)):i.removeAttribute("title")}this.#Re.toggleAttribute("hidden",0!==e.length),this.#ke.toggleAttribute("hidden",0===e.length);const i=e.findIndex(({key:e})=>t.some(t=>String(t)===String(e)));this.#Me(i>=0?this.#ke.children[i]:this.#ke.querySelector('li[selected]:not([aria-disabled="true"])')??this.#ke.querySelector('li:not([aria-disabled="true"])'))}#Ne(e){const t=e.getAttribute("value"),s=this.#Le.get(t);this.hide(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{index:t,entry:s}}))}hide(){this.#ze.invalidate(),this.matches(":popover-open")&&this.hidePopover(),this.#Ie(null)}#Ie(e){this.dispatchEvent(new CustomEvent("activechange",{bubbles:!1,cancelable:!1,detail:{id:e}}))}get shown(){return this.matches(":popover-open")}async show(e,t=[]){const s=this.#ze.take();this.matches(":popover-open")||this.showPopover(),this.#ke.setAttribute("hidden",""),this.#Ce.removeAttribute("hidden");try{const i=await e();if(s.stale)return;this.update(i,t)}catch(e){if(s.stale)return;throw this.hide(),e}finally{s.stale||this.#Ce.setAttribute("hidden","")}}async moveOrShow(e,t,s=[]){if(this.shown){const t=this.#Oe(),s=t?.[(e?"next":"previous")+"ElementSibling"],i=s?this.#Fe(s,e):null;return void(t&&i&&this.#Me(i))}await this.show(t,s)}#Fe(e,t){for(let s=e;s;s=s[(t?"next":"previous")+"ElementSibling"])if(!s.matches('[aria-disabled="true"]'))return s;return null}jump(e){if(this.#ke.hidden)return;const t=e?this.#ke.firstElementChild:this.#ke.lastElementChild,s=this.#Fe(t,e);s&&this.#Me(s)}page(e){const t=this.#Oe();if(!t)return;let s=t;for(let t=0;t!==this.#Be();++t){const t=this.#Fe(s[(e?"next":"previous")+"ElementSibling"],e);if(!t)break;s=t}this.#Me(s)}#Be(){const e=this.#ke.firstElementChild;return e&&0!==e.offsetHeight?Math.max(1,Math.trunc(this.#ke.clientHeight/e.offsetHeight)):1}}class ie extends x{static attributes=["name","loader","k-type","mode","preload:presence","revision","k-expr","l-expr","d-expr","m-expr","response-mapper"];static observed=["multiple:presence","item-list:presence","value:csv","src","method"];unmarshal(e,t){return"value"!==e||""!==t||this.hasAttribute("multiple")?super.unmarshal(e,t):[""]}static slots=!0;static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-control>\n <input type="text" form="" autocomplete="off" role="combobox" aria-autocomplete="list" aria-haspopup="listbox" aria-expanded="false">\n </ful-control>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n <ful-dropdown popover="manual">{{{{ slots.dropdown }}}}</ful-dropdown>\n </ful-control-group>\n <ful-item-list></ful-item-list>\n <ful-field-error></ful-field-error>\n ';static templates={items:'\n <ful-item data-tpl-each="entries" data-tpl-var="entry" data-tpl-data-key="entry.key">\n <div><span>{{ entry.label }}</span><button type="button" data-tpl-aria-label="#l10n:t(\'select.remove\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button></div>\n </ful-item>\n '};#Pe;#De={src:null,method:null};#Le;#r;#$e;#We;#Ve;#te;#ae;#He;#je=!1;#Ge=new Map;#Ke=new v;#Ue=!1;#Qe;#Je;_build({slots:e}){const i=this.declared("name");this.#Le=e.options,this.#Ye(),this.#He=this.declared("multiple"),this.#Pe.prefetch?.()?.catch(e=>{console.warn("failed to prefetch select options",this,"reason:",e)});const r=this.template().withOverlay({slots:e,name:i}).render();this.#We=r.querySelector("ful-control > input"),this.#Ve=r.querySelector("label"),this.#te=r.querySelector("ful-item-list"),this.#ae=e.items&&!s.isBlank(e.items)?n.fromFragment(e.items):null,t.forward("input-",this,this.#We),this.#r=r.querySelector("ful-control"),this.#$e=r.querySelector("ful-dropdown");const a=t.uid("ful-listbox");this.#$e.setAttribute("listbox",a),this.#We.setAttribute("aria-controls",a),this.#$e.addEventListener("beforetoggle",e=>{const t="open"===e.newState;this.#We.setAttribute("aria-expanded",t?"true":"false"),t||this.#We.removeAttribute("aria-activedescendant")}),this.#$e.addEventListener("activechange",e=>{t.set(this.#We,"aria-activedescendant",e.detail.id)});const o=r.querySelector("ful-control-group");return Q.wire(o,this.#$e,{prefix:"ful-select",stretch:!0}),[this.#Qe,this.#Je]=w.throttle(400,()=>this.#Xe()),this.#Ze(),this.#et(),this.#tt(),this.#st(),{fragment:r,control:this.#We,error:r.querySelector("ful-field-error"),label:this.#Ve}}#Ze(){this.addEventListener("click",e=>{if(!this._interactive()||this.#Ve.contains(e.target))return;const t=e.target.closest('button, [role="button"], a[href], input, select, textarea');if(!t||t===this.#We){if(this.#$e.shown)return this.#Je(),void this.#it();this.#We.focus(),this.#Qe()}}),this.#te.addEventListener("click",e=>{e.stopPropagation(),e.target.closest("button")&&this._interactive()&&this.#rt([...this.#te.children].indexOf(e.target.closest("ful-item")))}),this.#r.addEventListener("click",e=>{const t=e.target instanceof Element?e.target.closest("ful-badge"):null;t&&(e.stopPropagation(),this.#at(t))})}#et(){this.addEventListener("keydown",e=>{const t=e.target instanceof Element?e.target.closest("ful-badge"):null;t?this.#nt(e,t):"ArrowLeft"===e.code&&e.target===this.#We&&0===this.#We.selectionStart&&0===this.#We.selectionEnd&&this.#ot().at(-1)?.focus()})}#tt(){this.#We.addEventListener("change",e=>{e.stopPropagation()}),this.#We.addEventListener("focus",()=>{this.#Ue||this.#We.select()}),this.#We.addEventListener("blur",e=>{e.stopPropagation(),e.relatedTarget&&this.contains(e.relatedTarget)||(this.#Je(),this.#it(!0))}),this.#We.addEventListener("keydown",e=>{this._interactive()&&this.#lt(e)}),this.#We.addEventListener("input",e=>{e.stopPropagation(),this._interactive()&&(this.#Ue=!0,this.#Qe())})}#st(){this.#$e.addEventListener("change",e=>{e.stopPropagation(),this.#Je(),this._interactive()?(this.#He||this.#Ge.clear(),this.#Ue=!1,this.#Ge.set(this.#dt(e.detail.entry.key),e.detail.entry),this.#ut(),this.#We.focus(),this.#$e.hide(),this.#He||this.#We.select()):this.#it()})}async withLoader(e){return await e(this.#Pe)}async reload(){await(this.#Pe.invalidate?.()),await(this.#Pe.prefetch?.());const e=[...this.#Ge.keys()];0!==e.length&&await this.#ct(e,this.#Ke.take()),this.#$e.shown&&await this.#Xe()}get src(){return this.getAttribute("src")}set src(e){this.reflectTo("src",e??null),this.#ht()&&this.reload()}get method(){return this.getAttribute("method")}set method(e){this.reflectTo("method",e??null),this.#ht()&&this.reload()}async reconfigure(e,{notify:t=!1}={}){for(const t of["src","method"])t in e&&this.reflectTo(t,e[t]??null);this.#ht();const s=[...this.#Ge.keys()];await this.reload();const i=[...this.#Ge.keys()];t&&i.length!==s.length&&this._notifyChange({entry:this.entry})}#Ye(){this.#De={src:this.getAttribute("src"),method:this.getAttribute("method")},this.#Pe=this.component(this.declared("loader")??"loaders:select").create(this,{options:this.#Le})}#ht(){return(this.getAttribute("src")!==this.#De.src||this.getAttribute("method")!==this.#De.method)&&(this.#Je(),this.#it(),this.#Ye(),!0)}#ot(){return Array.from(this.#r.querySelectorAll(":scope > ful-badge"))}#at(e){this._interactive()&&this.#rt(this.#ot().indexOf(e))}#rt(e){const t=Array.from(this.#Ge.keys())[e];void 0!==t&&(this.#Ge.delete(t),this.#ut())}#nt(e,t){switch(e.code){case"NumpadEnter":case"Enter":case"Space":case"Backspace":case"Delete":e.preventDefault(),this.#at(t),this.#We.focus();break;case"ArrowLeft":e.preventDefault(),(this.#ot()[this.#ot().indexOf(t)-1]??this.#We).focus();break;case"ArrowRight":e.preventDefault(),(this.#ot()[this.#ot().indexOf(t)+1]??this.#We).focus();break;case"Escape":this.#We.focus()}}#lt(e){switch(e.code){case"ArrowUp":case"ArrowDown":e.preventDefault(),this.#pt(e);break;case"Home":this.#$e.shown&&(e.preventDefault(),this.#$e.jump(!0));break;case"End":this.#$e.shown&&(e.preventDefault(),this.#$e.jump(!1));break;case"PageDown":case"PageUp":this.#$e.shown&&(e.preventDefault(),this.#$e.page("PageDown"===e.code));break;case"Escape":this.#Je(),this.#it();break;case"NumpadEnter":case"Enter":if(!this.#$e.shown)return;e.preventDefault(),this.#Je(),this.#Ue=!1,this.#ft(),this.#$e.acceptSelection();break;case"Backspace":0===this.#We.selectionStart&&0===this.#We.selectionEnd&&this.#rt(this.#Ge.size-1);break;case"Tab":this.#Je(),this.#it(!0)}}#pt(e){const t="ArrowDown"===e.code;e.altKey?t&&!this.#$e.shown?this.#Xe():!t&&this.#$e.shown&&(this.#Je(),this.#it()):this.#$e.moveOrShow(t,()=>this.#Pe.load(this.#mt()),[...this.#Ge.keys()])}#it(e=!1){this.#$e.hide();const t=e&&this.#Ue&&!this.#He&&""===this.#We.value&&0!==this.#Ge.size;this.#Ue=!1,t&&(this.#Ge.clear(),this.#ut()),this.#ft()}#Xe(){return this.#$e.show(()=>this.#Pe.load(this.#mt()),[...this.#Ge.keys()])}#mt(){return this.#Ue?this.#We.value:""}get query(){return this.#mt()}#ft(){const e=this.#Ge.values().next().value;this.#We.value=this.#He?"":e?.label??""}#gt(){return[...this.#Ge.values()]}#ut(){this.#bt(),this._notifyChange({entry:this.entry})}#bt(){const e=this.#He?Array.from(this.#Ge.entries()).map(([e,t],s)=>{const i=document.createElement("ful-badge");return i.setAttribute("role","button"),i.setAttribute("tabindex",0===s?"0":"-1"),i.setAttribute("value",e),i.innerText=t.label,i}):[];for(const e of this.#r.querySelectorAll(":scope > ful-badge"))e.remove();this.#We.before(...e),this.#Ue||this.#ft(),this.#te.replaceChildren(),(this.#ae??this.template("items")).withOverlay({entries:this.#gt()}).renderTo(this.#te)}#dt(e){switch(this.declared("k-type")){case"number":{const t=""===e?Number.NaN:Number(e);return Number.isNaN(t)?e:t}case"boolean":return!0===e||"true"===e||!1!==e&&"false"!==e&&e;default:return String(e)}}set value(e){if(!this.#r)return void this._holdValue(e);const t=(null==e?[]:Array.isArray(e)?e:[e]).map(e=>this.#dt(e)),s=this.#He?t:t.slice(0,1);!this.#je&&s.some(e=>"string"==typeof e&&e.includes(","))&&(this.#je=!0,console.warn("a ful-select key cannot contain a comma: it is unexpressible in the value attribute",this)),this.#Ge=new Map(s.map(e=>[e,{key:e,label:e,metadata:void 0}]));const i=this.#Ke.take();this.#bt(),0!==s.length&&this.#ct(s,i)}async#ct(e,t){const s=await this.#Pe.exact(...e);if(t.stale)return;const i=new Map(s.map(e=>[this.#dt(e.key),e]));for(const t of e)this.#Ge.has(t)&&(i.has(t)?this.#Ge.set(t,i.get(t)):this.#Ge.delete(t));this.#bt()}get value(){if(!this.#r){const e=[this._heldValue()??[]].flat().map(e=>this.#dt(e));return this.multiple?e:e[0]??null}return this.#He?[...this.#Ge.keys()]:[...this.#Ge.keys()][0]??null}get entry(){const e=this.#gt();return this.#He?e:e[0]??null}get disabled(){return super.disabled}set disabled(e){super.disabled=e,e&&this.#$e?.shown&&(this.#Je(),this.#it())}get readonly(){return super.readonly}set readonly(e){super.readonly=e,e&&this.#$e?.shown&&(this.#Je(),this.#it())}#me;get multiple(){return this.#He??this.declared("multiple")}set multiple(e){this.#He=e,this.reflectTo("multiple",e),e||(this.#Ge=new Map([...this.#Ge].slice(0,1))),this.#r&&this.#bt()}get itemList(){return this.#me}set itemList(e){this.#me=e,this.reflectTo("item-list",e)}}class re extends x{static attributes=["name","type"];static slots=!0;static ROLE="radiogroup";static template='\n <fieldset>\n <legend>{{{{ slots.default }}}}</legend>\n <header data-tpl-if="slots.header">\n {{{{ slots.header }}}}\n </header>\n <ful-radio-list>\n <div class="label-wrapper" data-tpl-each="inputsAndLabels" data-tpl-var="ial">\n <label>\n {{{{ ial[0] }}}}\n <div>{{{{ ial[1] }}}}</div>\n </label>\n </div>\n </ful-radio-list>\n <ful-field-error></ful-field-error>\n <footer data-tpl-if="slots.footer">\n {{{{ slots.footer }}}}\n </footer>\n </fieldset>\n ';#vt;#yt;#wt;_build({slots:e}){const i=t.uid(this.declared("name")??"ful-radiogroup"),r=Array.from(e.default.querySelectorAll("ful-radio")),a=r.map(e=>{const r=document.createElement("input");return r.setAttribute("type","radio"),t.forward("input-",this,r),t.forward("",e,r),r.setAttribute("name",`${i}-ignore`),r.setAttribute("form",""),r.addEventListener("change",e=>{e.stopPropagation(),this._notifyChange()}),[r,s.fromChildNodes(e)]});r.forEach(e=>{e.remove()}),s.isBlank(e.default)&&e.default.replaceChildren();const n=this.template().withOverlay({name:i,slots:e,inputsAndLabels:a}).render();return this.#vt=n.firstElementChild,this.#yt=n.querySelector("input[type=radio]"),this.#wt="boolean"===this.declared("type"),{fragment:n,control:this.#yt,error:n.querySelector("ful-field-error"),described:this,claims:this.#vt,announces:this,freeze:this.#vt}}get value(){if(!this.#vt){const e=this._heldValue(),t=null===e?null:this.querySelector(`ful-radio[value="${CSS.escape(String(e))}"]`),s=t?.getAttribute("value")??null;return null===s||"boolean"!==this.declared("type")?s:"true"===s}const e=this.querySelector("input[type=radio]:checked");return e?this.#wt?"true"===e.value:e.value:null}set value(e){if(!this.#vt)return void this._holdValue(e);const t=this.querySelectorAll("input[type=radio]"),s=()=>{t.forEach(e=>{e.checked=!1})};if(null===e)return void s();const i=this.querySelector(`input[type=radio][value="${CSS.escape(String(e))}"]`);null!==i?i.checked=!0:s()}}class ae extends x{static attributes=["type"];static observed=["value:bool"];static slots=!0;static template='\n <ful-choice data-tpl-switch="isSwitch">\n <input type="checkbox" data-tpl-role="isSwitch ? \'switch\' : false" form="">\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n </ful-choice>\n <ful-field-error></ful-field-error>\n ';#Et;#We;_build({slots:e}){const s="switch"===this.declared("type"),i=this.template().withOverlay({slots:e,isSwitch:s}).render();this.#Et=i.firstElementChild,this.#We=i.querySelector("input"),t.forward("input-",this,this.#We),this.#We.addEventListener("change",e=>{e.stopPropagation(),this._notifyChange()});const r=i.querySelector("label");return{fragment:i,control:this.#We,error:i.querySelector("ful-field-error"),label:r,freeze:this.#Et}}get value(){return this.#We?this.#We.checked:Boolean(this._heldValue())}set value(e){this.#We?this.#We.checked=e:this._holdValue(e)}}class ne extends e{static attributes=["sorter"];static observed=["order"];#xt;render(){const e=this.declared("sorter"),t=["asc","desc",null];this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.addEventListener("click",()=>{const s=t[(t.indexOf(this.order)+1)%3];this.dispatchEvent(new CustomEvent("sort:requested",{bubbles:!0,cancelable:!1,detail:{value:{sorter:e,order:s}}}))}),this.addEventListener("keydown",e=>{["Enter","NumpadEnter","Space"].includes(e.code)&&(e.preventDefault(),this.click())})}get order(){return this.#xt||null}set order(e){this.#xt=e||null,this.reflectTo("order",this.#xt);const s=this.closest("th");s&&t.set(s,"aria-sort",this.#xt?"asc"===this.#xt?"ascending":"descending":null)}}class oe extends e{static observed=["total:number","current:number"];static attributes=["pages:number"];static config={prevIcon:"chevron-left",nextIcon:"chevron-right",reloadIcon:"arrow-clockwise"};static template='\n <ful-pagination-bar role="navigation" data-tpl-aria-label="#l10n:t(\'pagination.navigation\')">\n <ul>\n <li data-ref="index"> {{ #l10n:t(\'pagination.showing\', { \'current\': curr.label, \'total\': total }) }}</li>\n <li data-ref="reload"><button type="button" data-tpl-aria-label="#l10n:t(\'pagination.reload\')"><ful-icon data-tpl-name="config.reloadIcon" aria-hidden="true"></ful-icon></button></li>\n <li data-ref="prev">\n <button type="button" data-tpl-disabled="prev.enabled ? false : true" data-tpl-aria-label="#l10n:t(\'pagination.previous\')" data-tpl-data-page="prev.index">\n <ful-icon data-tpl-name="config.prevIcon" aria-hidden="true"></ful-icon>\n </button>\n </li>\n <li data-ref="page" data-tpl-each="pages" data-tpl-var="page">\n <button type="button" data-tpl-aria-current="curr.index == page.index ? \'page\' : false" data-tpl-data-page="page.index" >\n {{ page.label }}\n </button>\n </li>\n <li data-ref="next">\n <button type="button" data-tpl-disabled="next.enabled ? false : true" data-tpl-aria-label="#l10n:t(\'pagination.next\')" data-tpl-data-page="next.index">\n <ful-icon data-tpl-name="config.nextIcon" aria-hidden="true"></ful-icon>\n </button>\n </li>\n </ul>\n </ful-pagination-bar>\n ';#At=0;#St=0;render(){this.addEventListener("click",e=>{const t=e.target.closest("button");t&&!t.hasAttribute("disabled")&&"page"!==t.getAttribute("aria-current")&&this.dispatchEvent(new CustomEvent("page:requested",{bubbles:!0,cancelable:!1,detail:{value:Number(t.dataset.page??this.#St)}}))})}update({current:e,total:t}={}){void 0!==e&&(this.#St=e??0),void 0!==t&&(this.#At=t??0),this.reflectTo("current",this.#St),this.reflectTo("total",this.#At);const s=this.#St,i=this.#At,r=this.declared("pages")??5,a=Math.max(i,1),n=s>0,o=s+1<a,l={index:n?s-1:null,enabled:n},d={index:s,label:s+1},u={index:o?s+1:null,enabled:o},c=Math.max(1,Math.min(r,a)),h=Math.max(0,Math.min(s-Math.floor((c-1)/2),a-c)),p=Array.from({length:c},(e,t)=>({index:h+t,label:h+t+1})),f=this.contains(document.activeElement)?document.activeElement.closest("li")?.getAttribute("data-ref"):null,m="page"===f?document.activeElement.dataset.page:null;if(this.template().withOverlay({total:a,prev:l,curr:d,next:u,pages:p}).renderTo(this),!f)return;const g=(null===m?null:this.querySelector(`li[data-ref=page] button[data-page="${m}"]`))??this.querySelector(`li[data-ref=${f}] button:not(:disabled)`)??this.querySelector("li[data-ref=page] button[aria-current=page]");g?.focus()}get total(){return this.#At}set total(e){this.update({total:e})}get current(){return this.#St}set current(e){this.update({current:e})}}class le{static parse(e,t){const i=e?o.queryChildren(e,"schema"):null;if(!i)throw new Error('missing expected <schema>: ful-table needs a <template slot="schema"> holding one');const r=document.createElement("tr"),a=document.createElement("tr");a.setAttribute("data-tpl-each","rows");for(const e of i.getAttributeNames()){const t=i.getAttribute(e);r.setAttribute(e,t??""),a.setAttribute(e,t??"")}const n=o.queryChildrenAll(i,"column"),l=n.filter(e=>e.hasAttribute("order")&&e.hasAttribute("sorter")).map(e=>({sorter:e.getAttribute("sorter"),order:e.getAttribute("order")}))[0]??null;for(const e of n){const t=o.queryChildren(e,"title"),s=e.getAttribute("sorter"),i=e.getAttribute("order"),n=t??document.createTextNode(e.getAttribute("title")??"");t?.remove(),e.removeAttribute("sorter"),e.removeAttribute("order"),e.removeAttribute("title");const l=s||i?(()=>{const e=document.createElement("ful-sorter");return s&&e.setAttribute("sorter",s),i&&e.setAttribute("order",i),e.append(n),e})():n,d=document.createElement("th"),u=document.createElement("td");for(const t of e.getAttributeNames()){const s=e.getAttribute(t);d.setAttribute(t,s??""),u.setAttribute(t,s??"")}d.append(l),u.append(...e.childNodes),r.append(d),a.append(u)}return{headersTemplate:t.withOverlay({inHeaders:!0,inRows:!1}).withFragment(s.from(r)),rowsTemplate:t.withOverlay({inHeaders:!1,inRows:!0}).withFragment(s.from(a)),sort:l,length:n.length}}}class de{#we;constructor(e){this.#we=e}async load(e,t,s){const i=this.#_t(t),r=Number(e.size),a=e.page*r,n=a+r;return{data:i.slice(a,n),size:i.length}}#_t(e){if(!e?.sorter)return this.#we;const{sorter:t,order:s}=e,i="desc"===s?-1:1;return[...this.#we].sort((e,s)=>{const r=e?.[t],a=s?.[t];return r===a?0:null==r?1:null==a?-1:(r<a?-1:1)*i})}update(e){this.#we=e}}class ue{#E;#x;#A;#_;constructor(e,t,s,i=e=>e){this.#E=e,this.#x=t,this.#A=s,this.#_=i}async load(e,t,s){const i=Object.entries(s).filter(([e,t])=>t);return await this.#E.request(this.#A,this.#x).param("page",e.page).param("size",e.size).param("sort",t?`${t.sorter},${t.order}`:null).param("filters",i.length>0?JSON.stringify(Object.fromEntries(i)):null).fetchJson().then(e=>this.#_(e))}}class ce{static create(e,t){const s=e.getAttribute("src");if(s){const t=e.component("http-client"),i=e.getAttribute("method")??"GET",r=e.hasAttribute("response-mapper")?e.component(e.getAttribute("response-mapper")):e=>e;return new ue(t,s,i,r)}return new de([])}}class he extends e{static attributes=["loader","autoload:presence","paging"];static observed=["page-size:number","src","method"];static slots=!0;static config={searchIcon:"search",emptyIcon:"inbox",reloadIcon:"arrow-clockwise"};static template='\n <ful-form data-tpl-if="slots.filters">\n {{{{ slots.filters }}}}\n </ful-form>\n <ful-table-wrapper>\n <table>\n <caption data-tpl-if="slots.caption">{{{{ slots.caption }}}}</caption>\n <thead></thead>\n <tbody data-tpl-if="virtual" data-ref="before" aria-hidden="true"><tr><td data-tpl-colspan="schema.length"></td></tr></tbody>\n <tbody></tbody>\n <tbody data-tpl-if="virtual" data-ref="after" aria-hidden="true"><tr><td data-tpl-colspan="schema.length"></td></tr></tbody>\n <tbody data-ref="initial">\n <tr>\n <td data-tpl-colspan="schema.length">\n <ful-empty>\n <ful-icon data-tpl-if="config.searchIcon" data-tpl-name="config.searchIcon" aria-hidden="true"></ful-icon>\n {{ #l10n:t(\'table.initial\') }}\n </ful-empty>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="empty" hidden>\n <tr>\n <td data-tpl-colspan="schema.length">\n <ful-empty data-tpl-if="slots.empty" data-ref="empty-authors"></ful-empty>\n <ful-empty data-tpl-if="!slots.empty">\n <ful-icon data-tpl-if="config.emptyIcon" data-tpl-name="config.emptyIcon" aria-hidden="true"></ful-icon>\n {{ #l10n:t(\'table.no-data\') }}\n </ful-empty>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="loading" hidden>\n <tr>\n <td data-tpl-colspan="schema.length">\n <ful-spinner class="big" role="status"><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="feedback" hidden>\n <tr>\n <td data-tpl-colspan="schema.length">\n <div role="alert">\n <p>{{ #l10n:t(\'table.error\') }}</p>\n <div data-ref="feedback-error"></div>\n </div>\n </td>\n </tr>\n </tbody>\n <tfoot data-tpl-if="slots.footer">\n {{{{ slots.footer }}}}\n </tfoot>\n </table>\n </ful-table-wrapper>\n <ful-pagination data-tpl-if="!scrolled" current="0" total="1"></ful-pagination>\n <ful-table-status data-tpl-if="scrolled">\n <span data-ref="count"></span>\n <ful-spinner data-ref="appending" role="status" hidden><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner>\n <div data-ref="append-failure" role="alert" hidden>\n <span>{{ #l10n:t(\'table.error\') }} <span data-ref="append-error"></span></span>\n <button type="button" data-ref="retry">{{ #l10n:t(\'table.retry\') }}</button>\n </div>\n <button type="button" data-ref="reload" data-tpl-aria-label="#l10n:t(\'pagination.reload\')"><ful-icon data-tpl-name="config.reloadIcon" aria-hidden="true"></ful-icon></button>\n </ful-table-status>\n ';static templates={row:"\n {{{{ schema.rowsTemplate.withOverlay({'rows': pageResponse.data}).render() }}}}\n "};#Pe;#qt;#Ct;#kt;#Rt;#Re;#Tt;#Lt;#zt;#Nt;#Ot;#Mt;#It=null;#Ft=null;#Bt=[];#Pt={next:1,shown:0,total:0,last:0};#Dt=!1;#$t=null;#Wt=null;#At=0;#Vt=0;#Ht=null;#jt=!1;#Gt=void 0;#Kt={pageRequest:{page:0,size:10},sortRequest:null,filterRequest:{}};#Ut=!1;#Qt={};#Jt=null;#Yt=!1;#Xt=null;#Zt=new v;#De={src:null,method:null};get pageSize(){return this.#Kt.pageRequest.size}set pageSize(e){const t=Number(e??10);!Number.isFinite(t)||t<=0||t===this.#Kt.pageRequest.size||(this.#Kt={...this.#Kt,pageRequest:{page:0,size:t}},this.#Ut&&this.load(this.#Kt.pageRequest,this.#Kt.sortRequest,this.#Qt))}get src(){return this.getAttribute("src")}set src(e){this.reflectTo("src",e??null),this.#ht()&&this.#Ut&&this.reload()}get method(){return this.getAttribute("method")}set method(e){this.reflectTo("method",e??null),this.#ht()&&this.#Ut&&this.reload()}async reconfigure(e){for(const t of["src","method"])t in e&&this.reflectTo(t,e[t]??null);return this.#ht(),await this.reload()}#Ye(){this.#De={src:this.getAttribute("src"),method:this.getAttribute("method")},this.#Pe=this.component(this.declared("loader")??"loaders:table").create(this)}#ht(){return(this.getAttribute("src")!==this.#De.src||this.getAttribute("method")!==this.#De.method)&&(this.#Ye(),this.#Kt={...this.#Kt,pageRequest:{...this.#Kt.pageRequest,page:0}},this.#Wt=null,!0)}async render({slots:e}){const r=this.template(),a=le.parse(e.schema,r),l=this.declared("paging"),d=r.withOverlay({slots:e,schema:a,scrolled:"infinite"===l||"virtual"===l,virtual:"virtual"===l}).render(),u=o.queryChildren(d,"ful-table-wrapper"),c=u.querySelector("table");t.forward("table-",this,c),this.#Ye(),this.#Mt=u;const h=o.queryChildren(d,"ful-table-status");if(this.#qt=a,this.#Ct=c.querySelector(":scope > tbody:not([data-ref])"),this.#kt=c.querySelector(":scope > tbody[data-ref=loading]"),this.#Rt=c.querySelector(":scope > tbody[data-ref=initial]"),this.#Re=c.querySelector(":scope > tbody[data-ref=empty]"),this.#Tt=this.#Re.querySelector("ful-empty[data-ref=empty-authors]"),this.#Lt=e.empty&&!s.isBlank(e.empty)?n.fromFragment(e.empty):null,this.#zt=c.querySelector(":scope > tbody[data-ref=feedback]"),this.#Nt=o.queryChildren(d,"ful-pagination"),this.replaceChildren(d),"virtual"===l){const e=getComputedStyle(u).overflowY;this.#Dt="auto"===e||"scroll"===e,this.#Dt||console.warn('ful-table: paging="virtual" needs rows that scroll inside the table, as ful-fill makes them; this one appends its pages as paging="infinite" does')}if(h){const e=e=>h.querySelector(`[data-ref=${e}]`);this.#It={count:e("count"),appending:e("appending"),failure:e("append-failure"),error:e("append-error")},e("reload").addEventListener("click",()=>this.reload()),e("retry").addEventListener("click",()=>{this.#Dt?(this.#jt=!1,this.#es(!0)):this.#ts()})}this.#Dt?(this.#$t={before:c.querySelector(":scope > tbody[data-ref=before] td"),after:c.querySelector(":scope > tbody[data-ref=after] td")},u.addEventListener("scroll",()=>{this.#ss(),this.#es(!1)},{passive:!0}),new ResizeObserver(()=>{requestAnimationFrame(()=>{this.#ss(),this.#es(!1)})}).observe(u)):h&&(this.#Ft=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting&&this.#Bt.includes(e.target))&&this.#ts()}));const p=this.querySelector("thead");a.headersTemplate.renderTo(p),new ResizeObserver(()=>{u.style.setProperty("--ful-table-header-height",`${p.getBoundingClientRect().height}px`)}).observe(p),this.#Ot=p.querySelectorAll("ful-sorter"),await i.waitForChildren(this);const f=o.queryChildren(this,"ful-form"),m=this.declared("page-size");this.#Kt={pageRequest:{page:0,size:Number.isFinite(m)&&m>0?m:10},sortRequest:a.sort,filterRequest:f?.values??{}},this.#Qt=this.#Kt.filterRequest,this.#Jt=f,f?.addEventListener("submit:success",async e=>{this.#Xt=this.#is(0,e.detail.request),await this.#Xt}),this.addEventListener("page:requested",async e=>{e.composedPath().find(e=>e instanceof he)===this&&await this.#is(e.detail.value,this.#Qt)}),this.addEventListener("sort:requested",async e=>{if(e.composedPath().find(e=>e instanceof he)!==this)return;const t=e.detail.value.order?e.detail.value:null;await this.load(this.#Kt.pageRequest,t,this.#Qt),this.#Kt.sortRequest===t&&(this.#Ot.forEach(e=>{e.order=null}),e.target.order=e.detail.value.order)}),this.declared("autoload")&&this.reload()}async reload(){if(!this.#Jt||this.#Yt)return this.#Wt?await this.#rs():await this.load(this.#Kt.pageRequest,this.#Kt.sortRequest,this.#Kt.filterRequest);await this.#Jt.submit()&&await this.#Xt}async load(e,t,s){this.#Ut=!0,this.#Qt=s;const r=this.#Zt.take();let a;this.#Bt=[],this.#Ft?.disconnect(),clearTimeout(this.#Gt),this.#Ht=null,this.#jt=!1,this.#It?.appending.setAttribute("hidden",""),this.#It?.failure.setAttribute("hidden",""),this.#kt.toggleAttribute("hidden",this.#Ct.childElementCount>0),this.#zt.setAttribute("hidden",""),this.#Rt.setAttribute("hidden",""),this.#Re.setAttribute("hidden",""),this.setAttribute("aria-busy","true");try{const n=await this.#Pe.load(e,t,s);if(r.stale)return;if(a=Math.max(0,Math.ceil(n.size/e.size)-1),!Number.isFinite(a))throw new Error(`ful-table cannot page the loader's answer: it needs { data, size }, size being the total number of rows, and got a size of ${n.size} for pages of ${e.size}. A response of another shape needs a response-mapper`);if(e.page<=a){if(this.#Kt={pageRequest:e,sortRequest:t,filterRequest:s},this.#Yt=!0,this.#ne(e,t,s,n),await Promise.all([i.waitForChildren(this.#Ct),i.waitForChildren(this.#Re)]).catch(()=>{}),r.stale)return;return this.#Dt&&this.#as(),this.removeAttribute("aria-busy"),this.dispatchEvent(new CustomEvent("load:success",{bubbles:!0,cancelable:!1,detail:{pageRequest:e,sortRequest:t,filterRequest:s,response:n}})),this.#ns(e.size),void this.#es(!1)}}catch(i){if(r.stale)return;throw this.#os(i,{pageRequest:e,sortRequest:t,filterRequest:s}),i}return await this.load({page:a,size:e.size},t,s)}async withLoader(e){return await e(this.#Pe)}async resetWithFilter(e){return await this.#is(0,e)}#is(e,t){return this.load({page:e,size:this.#Kt.pageRequest.size},this.#Kt.sortRequest,t)}#ns(e){const{shown:t,total:s,last:i}=this.#Pt;if(!(this.#Ft&&t<s&&0!==i))return;const r=[...this.#Ct.children];this.#Bt=r.slice(Math.max(0,r.length-Math.ceil(e/2)));for(const e of this.#Bt)this.#Ft.observe(e)}async#ts(){const e=this.#It;this.#Bt=[],this.#Ft?.disconnect();const{sortRequest:t,filterRequest:s}=this.#Kt,a={page:this.#Pt.next,size:this.#Kt.pageRequest.size},n=this.#Zt.take();e.failure.setAttribute("hidden",""),e.appending.removeAttribute("hidden");try{const o=await this.#Pe.load(a,t,s);if(n.stale)return;if(this.#Ct.append(this.template("row").withOverlay({schema:this.#qt,pageRequest:a,filterRequest:s,pageResponse:o}).render()),this.#Pt={next:a.page+1,shown:this.#Pt.shown+o.data.length,total:o.size,last:o.data.length},e.count.textContent=r.of().t("table.loaded",{loaded:this.#Pt.shown,total:this.#Pt.total}),await i.waitForChildren(this.#Ct).catch(()=>{}),n.stale)return;e.appending.setAttribute("hidden",""),this.dispatchEvent(new CustomEvent("load:success",{bubbles:!0,cancelable:!1,detail:{pageRequest:a,sortRequest:t,filterRequest:s,response:o}})),this.#ns(a.size)}catch(i){if(n.stale)return;e.appending.setAttribute("hidden",""),e.error.textContent=r.of().failure(i),e.failure.removeAttribute("hidden"),this.dispatchEvent(new CustomEvent("load:failure",{bubbles:!0,cancelable:!1,detail:{pageRequest:a,sortRequest:t,filterRequest:s,exception:i}}))}}#ls(e,t,s){const i=[...this.template("row").withOverlay({schema:this.#qt,pageRequest:e,filterRequest:t,pageResponse:s}).render().children];return this.#Dt&&i.forEach((t,s)=>{t.setAttribute("aria-rowindex",String(e.page*e.size+s+2))}),i}#os(e,t){this.#kt.setAttribute("hidden",""),this.#Ct.replaceChildren(),this.#Wt=null,this.#ds(),this.#It?.count.replaceChildren(),this.#zt.removeAttribute("hidden"),this.#zt.querySelector("[data-ref=feedback-error]").textContent=r.of().failure(e),this.removeAttribute("aria-busy"),this.dispatchEvent(new CustomEvent("load:failure",{bubbles:!0,cancelable:!1,detail:{...t,exception:e}}))}#as(){const e=this.#Ct.parentElement;e.setAttribute("aria-rowcount",String(this.#At+1)),e.tHead?.rows[0]?.setAttribute("aria-rowindex","1");const t=this.#It,s=this.#Wt;if(!s)return this.#ds(),void(t.count.textContent=r.of().t("table.loaded",{loaded:0,total:this.#At}));const i=this.#Kt.pageRequest.size,a=s.first*i;t.count.textContent=r.of().t("table.range",{from:a+1,to:a+s.pages.get(s.first).length,total:this.#At}),this.#us()&&(this.#Mt.scrollTop=a*this.#Vt)}#us(){if(this.#Vt>0)return!0;const e=this.#Ct.childElementCount,t=this.#Ct.getBoundingClientRect().height;return 0!==e&&0!==t&&(this.#Vt=t/e,this.#cs(),this.#ds(),!0)}#cs(){const e=this.#Ct.parentElement,t=[...e.tHead?.rows[0]?.cells??[]].map(e=>e.getBoundingClientRect().width),s=t.reduce((e,t)=>e+t,0),i=document.createElement("colgroup");i.setAttribute("data-ref","widths");for(const e of t){const t=document.createElement("col");t.style.width=e/s*100+"%",i.append(t)}e.insertBefore(i,e.tHead)}#hs(){this.#Ct.parentElement?.querySelector(":scope > colgroup[data-ref=widths]")?.remove()}#ds(){if(!this.#$t)return;const e=this.#Wt,t=this.#Kt.pageRequest.size,s=e?e.first*t:0,i=e?Math.max(0,this.#At-(e.last+1)*t):0;this.#$t.before.style.height=s*this.#Vt+"px",this.#$t.after.style.height=i*this.#Vt+"px"}#ss(){const e=this.#It,t=this.#Kt.pageRequest.size,s=this.#Mt.getBoundingClientRect(),i=s.top+(this.#Ct.parentElement?.querySelector(":scope > thead")?.getBoundingClientRect().height??0);let a=0,n=0;for(const[e,r]of this.#Wt?.pages??[])r.forEach((r,o)=>{const l=r.getBoundingClientRect();l.bottom>i&&l.top<s.bottom&&(a||=e*t+o+1,n=e*t+o+1)});a>0&&(e.count.textContent=r.of().t("table.range",{from:a,to:n,total:this.#At}))}#ps(e){const t=this.#Kt.pageRequest.size*this.#Vt,s=this.#Mt.getBoundingClientRect(),i=s.top+s.height/2,r=this.#Ct.getBoundingClientRect();if(i<r.top)return Math.max(0,e.first-Math.ceil((r.top-i)/t));if(i>=r.bottom)return e.last+1+Math.floor((i-r.bottom)/t);let a=e.first;for(const[t,s]of e.pages)s.length>0&&s[0].getBoundingClientRect().top<=i&&(a=t);return a}#es(e){const t=this.#Wt,s=Math.ceil(this.#At/this.#Kt.pageRequest.size);if(!t||this.#Ht||this.#jt||this.hasAttribute("aria-busy")||!this.#Mt.isConnected||!(s>0)||!this.#us())return;const i=Math.min(s-1,this.#ps(t));let r=Math.max(0,i-1),a=Math.min(s-1,i+1);const n=this.#Ct.contains(document.activeElement)?document.activeElement.closest("tr"):null,o=[...t.pages].find(([,e])=>n&&e.includes(n))?.[0];void 0!==o&&Math.max(a,o)-Math.min(r,o)<=4&&(r=Math.min(r,o),a=Math.max(a,o)),r===t.first&&a===t.last||(clearTimeout(this.#Gt),e||!(a<t.first-1||r>t.last+1)?this.#fs(t,r,a):this.#Gt=setTimeout(()=>this.#es(!0),150))}async#fs(e,t,s){const a=this.#It,n=this.#Zt.hold();this.#Ht=n;const{sortRequest:o,filterRequest:l}=this.#Kt,d=this.#Kt.pageRequest.size,u=Array.from({length:s-t+1},(e,s)=>t+s),c=u.filter(t=>!e.pages.has(t));a.failure.setAttribute("hidden",""),a.appending.removeAttribute("hidden");try{const r=await Promise.all(c.map(async e=>{const t={page:e,size:d};return{pageRequest:t,response:await this.#Pe.load(t,o,l)}}));if(n.stale)return;const h=u.filter(t=>e.pages.has(t)),p=this.#Mt.getBoundingClientRect().top,f=h.flatMap(t=>e.pages.get(t)??[]).find(e=>e.getBoundingClientRect().bottom>p),m=f?.getBoundingClientRect().top??0;for(const[i,r]of e.pages)if(i<t||i>s)for(const e of r)e.remove();const g=new Map;for(const t of u){const s=r.find(e=>e.pageRequest.page===t);g.set(t,e.pages.get(t)??(s?this.#ls(s.pageRequest,l,s.response):[]))}if(0===h.length?this.#Ct.replaceChildren(...[...g.values()].flat()):(this.#Ct.prepend(...u.filter(e=>e<h[0]).flatMap(e=>g.get(e)??[])),this.#Ct.append(...u.filter(e=>e>h.at(-1)).flatMap(e=>g.get(e)??[]))),this.#Wt={first:t,last:s,pages:g},this.#At=r.at(-1)?.response.size??this.#At,this.#Ct.parentElement?.setAttribute("aria-rowcount",String(this.#At+1)),this.#ds(),f&&(this.#Mt.scrollTop+=f.getBoundingClientRect().top-m),await i.waitForChildren(this.#Ct).catch(()=>{}),n.stale)return;f&&(this.#Mt.scrollTop+=f.getBoundingClientRect().top-m),a.appending.setAttribute("hidden",""),this.#ss();for(const{pageRequest:e,response:t}of r)this.dispatchEvent(new CustomEvent("load:success",{bubbles:!0,cancelable:!1,detail:{pageRequest:e,sortRequest:o,filterRequest:l,response:t}}))}catch(e){if(n.stale)return;return this.#jt=!0,a.appending.setAttribute("hidden",""),a.error.textContent=r.of().failure(e),a.failure.removeAttribute("hidden"),void this.dispatchEvent(new CustomEvent("load:failure",{bubbles:!0,cancelable:!1,detail:{pageRequest:{page:c[0],size:d},sortRequest:o,filterRequest:l,exception:e}}))}finally{this.#Ht===n&&(this.#Ht=null)}this.#es(!1)}async#rs(){const e=this.#Wt,t=this.#It,{sortRequest:s,filterRequest:r}=this.#Kt,a=this.#Kt.pageRequest.size;this.#Qt=r;const n=this.#Zt.take();clearTimeout(this.#Gt),this.#Ht=null,this.#jt=!1,t.appending.setAttribute("hidden",""),t.failure.setAttribute("hidden",""),this.setAttribute("aria-busy","true");const o=Array.from({length:e.last-e.first+1},(t,s)=>e.first+s);try{const t=await Promise.all(o.map(async e=>{const t={page:e,size:a};return{pageRequest:t,response:await this.#Pe.load(t,s,r)}}));if(n.stale)return;const l=t.at(-1).response.size,d=Math.ceil(l/a);if(!(e.first<d))return await this.load({page:0,size:a},s,r);const u=t.filter(e=>e.pageRequest.page<d),c=new Map(u.map(e=>[e.pageRequest.page,this.#ls(e.pageRequest,r,e.response)]));if(this.#Ct.replaceChildren(...[...c.values()].flat()),this.#Wt={first:e.first,last:Math.min(e.last,d-1),pages:c},this.#At=l,this.#Ct.parentElement?.setAttribute("aria-rowcount",String(l+1)),this.#ds(),await i.waitForChildren(this.#Ct).catch(()=>{}),n.stale)return;this.removeAttribute("aria-busy"),this.#ss();for(const{pageRequest:e,response:t}of u)this.dispatchEvent(new CustomEvent("load:success",{bubbles:!0,cancelable:!1,detail:{pageRequest:e,sortRequest:s,filterRequest:r,response:t}}));this.#es(!1)}catch(t){if(n.stale)return;throw this.#os(t,{pageRequest:{page:e.first,size:a},sortRequest:s,filterRequest:r}),t}}#ne(e,t,s,i){this.#kt.setAttribute("hidden",""),this.#Dt&&(this.#Vt=0,this.#hs());const a=this.#ls(e,s,i);return this.#Ct.replaceChildren(...a),this.#Re.toggleAttribute("hidden",0!==i.data.length),this.#Lt&&0===i.data.length&&this.#Tt.replaceChildren(this.#Lt.withOverlay({schema:this.#qt,pageRequest:e,filterRequest:s,pageResponse:i}).render()),this.#Dt?(this.#Mt.scrollTop=0,this.#At=i.size,void(this.#Wt=a.length>0?{first:e.page,last:e.page,pages:new Map([[e.page,a]])}:null)):this.#It?(this.#Mt.scrollTop=0,this.#Pt={next:e.page+1,shown:i.data.length,total:i.size,last:i.data.length},void(this.#It.count.textContent=r.of().t("table.loaded",{loaded:this.#Pt.shown,total:this.#Pt.total}))):void this.#Nt.update({current:e.page,total:Math.ceil(i.size/e.size)})}}const pe=(e,t,{items:s,current:i=()=>null})=>{let r="",a=0;t.addEventListener("beforetoggle",s=>{"closed"===s.newState&&t.contains(document.activeElement)&&e()?.focus()}),t.addEventListener("toggle",e=>{if("open"!==e.newState)return;const t=s();(i()??t[0])?.focus()}),t.addEventListener("keydown",t=>{const i=t.target,n=s(),o=n.find(e=>e===i||e.contains(i));if(!o)return;const l=n.indexOf(o);switch(t.code){case"ArrowDown":return t.preventDefault(),void n[(l+1)%n.length]?.focus();case"ArrowUp":return t.preventDefault(),void n[(l-1+n.length)%n.length]?.focus();case"Home":return t.preventDefault(),void n[0]?.focus();case"End":return t.preventDefault(),void n[n.length-1]?.focus();case"Enter":case"NumpadEnter":case"Space":return t.preventDefault(),o.click(),void e()?.focus();case"Escape":return void e()?.focus()}if(1!==t.key.length||t.ctrlKey||t.altKey||t.metaKey)return;const d=Date.now();r=d-a>500?t.key:r+t.key,a=d;const u=r.toLowerCase(),c=[...u].every(e=>e===u[0]),h=c?u[0]:u,p=c?l+1:l,f=[...n.slice(p),...n.slice(0,p)].find(e=>(e.textContent??"").trim().toLowerCase().startsWith(h));f&&(t.preventDefault(),f.focus())})};class fe{static narrow(e,t){const s=(e??[]).filter(e=>t.includes(e));return s.length>0?s:[...t]}#ms;#ke;#gs;#bs;#vs;#ft;#ys;#ws;#Es;#xs=!1;#As=!1;constructor(e,{vocabulary:t,glyphs:s={},labelFor:i=e=>e,display:r=null,interactive:a=()=>!0,onPick:n=()=>{}}){this.#ms=e,this.#ke=e.nextElementSibling,this.#gs=t,this.#bs=s,this.#vs=i,this.#ft=r??(e=>s[e]??e),this.#ys=a,this.#ws=n,this.#Es=[...t],this.#ke.addEventListener("click",e=>{const t=e.target.closest("li > a");if(!t||!this.#ys())return;const s=t.getAttribute("value"),i=this.value;this.value=s,this.#ke.hidePopover?.(),i!==s&&this.#ws(s)})}get allowed(){return this.#Es}set allowed(e){this.#Es=fe.narrow(e,this.#gs),this.#Ss(),!this.#As&&this.#Es.length>1&&(this.#g(),this.#As=!0),this.#_s(),this.pinned&&(this.value=this.#Es[0])}preferring(e){return null!==e&&this.#Es.includes(e)?e:this.#Es[0]}get pinned(){return this.#Es.length<2}set fixed(e){this.#ms.toggleAttribute("hidden",!!e)}get value(){return this.#ms.getAttribute("value")}set value(e){this.#ms.setAttribute("value",e),this.#ms.textContent=this.#ft(e),t.set(this.#ms,"aria-label",this.#vs(e)),this.#qs()}#qs(){const e=this.value;for(const t of this.#te())t.setAttribute("aria-checked",String(t.getAttribute("value")===e))}set claimed(e){this.#xs=e,this.#_s()}#Ss(){this.#ke.replaceChildren(...this.#Es.map(e=>{const t=document.createElement("li");t.setAttribute("role","none");const s=document.createElement("a");s.setAttribute("role","menuitemradio"),s.setAttribute("tabindex","-1"),s.setAttribute("value",e);const i=this.#vs(e),r=this.#bs[e]??e;if(i===e&&r===e)s.innerText=e;else{const e=document.createElement("span");e.innerText=r;const t=document.createElement("span");t.innerText=i,s.append(e,t)}return t.append(s),t})),this.#qs()}#_s(){const e=this.pinned;this.#ms.toggleAttribute("disabled",e||this.#xs),t.set(this.#ms,"aria-haspopup",e?null:"true"),t.set(this.#ms,"aria-expanded",e?null:"false"),e?this.#ms.removeAttribute("popovertarget"):this.#ke.id&&this.#ms.setAttribute("popovertarget",this.#ke.id)}#te(){return Array.from(this.#ke.querySelectorAll("li > a"),e=>e)}#g(){Q.wire(this.#ms,this.#ke,{prefix:"ful-filter-menu",invoke:!0,expanded:!0}),pe(()=>this.#ms,this.#ke,{items:()=>this.#te(),current:()=>this.#te().find(e=>e.getAttribute("value")===this.value)})}}const me={EQ:"=",NEQ:"≠",LT:"<",GT:">",LTE:"≤",GTE:"≥",BETWEEN:"↔",CONTAINS:"…a…",STARTS_WITH:"a…",ENDS_WITH:"…a"},ge=["EQ","NEQ","LT","GT","LTE","GTE","BETWEEN"],be=[...ge,"CONTAINS","STARTS_WITH","ENDS_WITH"],ve=["IGNORE_CASE","CASE_SENSITIVE"],ye={IGNORE_CASE:"aa",CASE_SENSITIVE:"Aa"},{t:we}=r.of(),Ee=e=>we(`filters.op.${e}`),xe=e=>we(`filters.sensitivity.${e}`),Ae=e=>we(""===e?"filters.boolean.any":`filters.boolean.${e}`),Se=e=>e.querySelector(":scope > label")?.textContent.trim()||null,_e=(e,t,{singular:s,plural:i,vocabulary:r,fallback:a})=>{const n=e.declared(s);if(null===n)return;e.hasAttribute(i)&&console.warn(`${e.localName}: ${s} fixes what ${i} offers a menu for, the plural is ignored`,e);const o=r.includes(n);o||console.warn(`${e.localName}: '${n}' is not one of its ${i}, the default is pinned instead`,e),t.allowed=[o?n:a],t.fixed=!0},qe=(e,t,s)=>{const i=s.filter(e=>null!=e&&""!=`${e}`);return 0===i.length?null:{label:e,operator:t,operands:i.map(e=>`${e}`)}};class Ce extends N{static observed=["value:json","operators:csv"];static attributes=["operator"];static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-affix>\n <button data-ref="operator" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n </ful-affix>\n <ful-control>\n <input data-ref="value1" data-tpl-type="type" form="">\n <input data-ref="value2" data-tpl-type="type" form="" hidden>\n </ful-control>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_operator;_container;_value1;_value2;_build(e){const t=super._build(e),s=t.fragment;return this._container=s.querySelector("ful-control-group"),this._value1=s.querySelector("[data-ref=value1]"),this._value2=s.querySelector("[data-ref=value2]"),this._operator=new fe(s.querySelector("[data-ref=operator]"),{vocabulary:this._vocabulary(),glyphs:me,labelFor:Ee,interactive:()=>this._interactive(),onPick:()=>{this._syncBetween(),this._notifyChange()}}),this.operators=this.declared("operators"),null===this._operator.value&&this._showDefaultOperator(),_e(this,this._operator,{singular:"operator",plural:"operators",vocabulary:this._vocabulary(),fallback:this._defaultOperator()}),{...t,freeze:this._container,also:[this._value2]}}_showDefaultOperator(){this._showOperator(this._operator.preferring(this._defaultOperator()))}formResetCallback(){super.formResetCallback(),this.hasAttribute("value")||this._showDefaultOperator()}_type(){return"text"}_serialize(e){return e}_deserialize(e){return e}_defaultOperator(){return"EQ"}_vocabulary(){return ge}_declaredOperators;get operators(){return this._operator?this._operator.allowed:this._declaredOperators}set operators(e){null===this.declared("operator")&&(this._operator?(this._operator.allowed=e,null!==this._operator.value&&this._showOperator(this._operator.preferring(this._operator.value))):this._declaredOperators=fe.narrow(e,this._vocabulary()))}get value(){return this._operator?this._tuple():this._shownTuple(this._heldValue())}set value(e){this._operator?this._applyTuple(e):this._holdValue(e)}_shownTuple(e){if(null==e)return null;const[t,...s]=e,i=this.declared("operator"),r=this._vocabulary().includes(i),a=null===i?fe.narrow(this.declared("operators"),this._vocabulary()):[r?i:this._defaultOperator()],n=a.includes(t)?t:a[0],o=[s[0],s[1]].map(e=>`${e?this._deserialize(e):e??""}`),l="BETWEEN"===n?o:o.slice(0,1);return l.some(e=>""===e)?null:[n,...l.map(e=>this._serialize(e))]}_tuple(){const e=this._operator.value,t=this.#Cs();return t.some(e=>""===e)?null:[e,...t.map(e=>this._serialize(e))]}_applyTuple(e){if(null==e)return this._value1.value="",void(this._value2.value="");const[t,...s]=e;this._showOperator(this._operator.preferring(t)),this._value1.value=s[0]?this._deserialize(s[0]):s[0]??"",this._value2.value=s[1]?this._deserialize(s[1]):s[1]??""}_showOperator(e){this._operator.value=e,this._syncBetween()}_syncBetween(){this._value2.toggleAttribute("hidden","BETWEEN"!==this._operator.value)}get criterion(){return this._operator?qe(Se(this),this._operator.value,this.#Cs()):null}#Cs(){return"BETWEEN"===this._operator.value?[this._value1.value,this._value2.value]:[this._value1.value]}get disabled(){return super.disabled}set disabled(e){super.disabled=e;for(const t of this._choices())t.claimed=e}_choices(){return[this._operator].filter(e=>e)}}class ke extends Ce{_defaultOperator(){return"LTE"}_type(){return"datetime-local"}_serialize(e){return F.localToIso(e)}_deserialize(e){return F.isoToLocal(e)}}class Re extends Ce{_type(){return"date"}}class Te extends Ce{_type(){return"number"}}class Le extends Ce{static observed=["sensitivities:csv"];static attributes=["sensitivity"];static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-affix>\n <button data-ref="operator" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n <button data-ref="sensitivity" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n </ful-affix>\n <ful-control>\n <input data-ref="value1" data-tpl-type="type" form="">\n <input data-ref="value2" data-tpl-type="type" form="" hidden>\n </ful-control>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_defaultOperator(){return"CONTAINS"}_vocabulary(){return be}_sensitivityButton;_build(e){const t=super._build(e);return this._sensitivityButton=new fe(t.fragment.querySelector("[data-ref=sensitivity]"),{vocabulary:ve,glyphs:ye,labelFor:xe,interactive:()=>this._interactive(),onPick:()=>this._notifyChange()}),this._sensitivityButton.allowed=null,this._sensitivityButton.value=ve[0],_e(this,this._sensitivityButton,{singular:"sensitivity",plural:"sensitivities",vocabulary:ve,fallback:"IGNORE_CASE"}),t}_choices(){return[...super._choices(),this._sensitivityButton].filter(e=>e)}get _sensitivity(){return this._sensitivityButton.value}_declaredSensitivities;get sensitivities(){return this._sensitivityButton?this._sensitivityButton.allowed:this._declaredSensitivities}set sensitivities(e){if(null!==this.declared("sensitivity"))return;if(!this._sensitivityButton)return void(this._declaredSensitivities=fe.narrow(e,ve));const t=this._sensitivityButton.value;this._sensitivityButton.allowed=e,this._sensitivityButton.value=this._sensitivityButton.preferring(t)}get value(){if(!this._sensitivityButton){const e=this._heldValue(),t=null==e?null:this._shownTuple([e[0],...e.slice(2)]);if(null===t)return null;const s=this.declared("sensitivity"),i=null===s?fe.narrow(this.declared("sensitivities"),ve):[ve.includes(s)?s:"IGNORE_CASE"],r=i.includes(e[1])?e[1]:"IGNORE_CASE";return[t[0],i.includes(r)?r:i[0],...t.slice(1)]}const e=this._tuple();return null==e?null:[e[0],this._sensitivity,...e.slice(1)]}set value(e){this._sensitivityButton?null!=e?(this._sensitivityButton.allowed.includes(e[1])&&(this._sensitivityButton.value=e[1]),this._applyTuple([e[0],...e.slice(2)])):this._applyTuple(e):this._holdValue(e)}formResetCallback(){super.formResetCallback(),this.hasAttribute("value")||(this._sensitivityButton.value=this._sensitivityButton.preferring("IGNORE_CASE"))}}const ze=["","true","false"],Ne={true:"✓",false:"✗"};class Oe extends x{static observed=["value:json","operators:csv"];static slots=!0;static OPERATORS=["EQ","NEQ"];static DEFAULT_OPERATOR="EQ";static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-affix>\n <button data-ref="operator" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n </ful-affix>\n <button data-ref="value" type="button" form=""></button>\n <ul popover role="menu"></ul>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_operator;_value;_container;_build({slots:e}){const t=this.template().withOverlay({slots:e}).render();this._container=t.querySelector("ful-control-group");const s=t.querySelector("[data-ref=value]");return this._operator=new fe(t.querySelector("[data-ref=operator]"),{vocabulary:Oe.OPERATORS,glyphs:me,labelFor:Ee,interactive:()=>this._interactive(),onPick:()=>this._notifyChange()}),this._value=new fe(s,{vocabulary:ze,glyphs:Ne,labelFor:Ae,display:Ae,interactive:()=>this._interactive(),onPick:()=>this._notifyChange()}),this.operators=this.declared("operators"),this._operator.value=this._operator.preferring(Oe.DEFAULT_OPERATOR),this._value.allowed=null,this._value.value="",{fragment:t,control:s,error:t.querySelector("ful-field-error"),label:t.querySelector("label"),announces:null,freeze:this._container}}_declaredOperators;get operators(){return this._operator?this._operator.allowed:this._declaredOperators}set operators(e){this._operator?(this._operator.allowed=e,null!==this._operator.value&&(this._operator.value=this._operator.preferring(this._operator.value))):this._declaredOperators=fe.narrow(e,this._vocabulary())}_vocabulary(){return Oe.OPERATORS}get value(){if(!this._value){const e=this._heldValue(),t=`${e?.[1]??""}`;if(""===t)return null;const s=fe.narrow(this.declared("operators"),this._vocabulary());return[s.includes(e[0])?e[0]:s[0],t]}return""===this._value.value?null:[this._operator.value,this._value.value]}set value(e){this._value?null!=e?(this._operator.value=this._operator.preferring(e[0]),this._value.value=e[1]??""):this._value.value="":this._holdValue(e)}formResetCallback(){super.formResetCallback(),this.hasAttribute("value")||(this._operator.value=this._operator.preferring(Oe.DEFAULT_OPERATOR))}get criterion(){if(!this._value)return null;const e=this._value.value;return qe(Se(this),this._operator.value,[""===e?"":Ae(e)])}get disabled(){return super.disabled}set disabled(e){super.disabled=e;for(const t of[this._operator,this._value].filter(e=>e))t.claimed=e}}class Me extends ie{static attributes=["operator"];#ks(){const e=super.value;return this.multiple?e:null==e?[]:[e]}get value(){const e=this.#ks();if(0===e.length)return null;const t=this.declared("operator");return t?[t,...e]:e}set value(e){const t=this.declared("operator");let s=null==e?[]:Array.isArray(e)?e:[e];t&&s[0]===t&&(s=s.slice(1)),super.value=this.multiple?s:s[0]??null}get criterion(){return qe(Se(this),this.declared("operator"),[super.entry].flat().filter(e=>e).map(e=>e.label))}}class Ie extends e{static slots=!0;static attributes=["placement","icon","describes:presence"];static config={icon:"info-circle-fill"};static template='\n <span role="button" tabindex="0" class="ful-tip" data-ref="trigger" data-tpl-aria-label="#l10n:t(\'info.tooltip\')"><ful-icon data-tpl-name="icon ?? config.icon" aria-hidden="true"></ful-icon></span>\n <ful-note popover data-ref="content">{{{{ slots.default }}}}</ful-note>\n ';render({slots:e}){const t=this.template().withOverlay({slots:e,icon:this.declared("icon")}).render(),s=t.querySelector("[data-ref=trigger]"),i=t.querySelector("[data-ref=content]");Q.wire(s,i,{prefix:"ful-tooltip",invoke:!0,expanded:!0,handPlace:!0}),i.setAttribute("placement",this.declared("placement")??"top"),this.replaceChildren(t),this.declared("describes")&&Ie.#b(this,s,i)}static#b(e,t,s){y(e)?.describedBy(s)?t.tabIndex=-1:console.warn("a ful-tooltip declares describes but stands in nothing that takes a description",e)}}class Fe{#Rs=new WeakSet;#Ts=new WeakSet;#u=new WeakMap;async request(e,t,s,i){const r=!this.#Rs.has(t)&&!this.#Ts.has(t),a={name:s,section:t,index:i,first:r},n=["section:requested",...null!=i?[`section:requested:#${i}`]:[],...s?[`section:requested:${s}`]:[]],o=[];for(const t of n){const s=new CustomEvent(t,{bubbles:!0,detail:a});e.dispatchEvent(s),o.push(...s.async?.promises??[])}if(0===o.length)return;r&&this.#Ts.add(t);let l=this.#u.get(t);l||(l=new v,this.#u.set(t,l));const d=l.take(),u=()=>!d.stale;t.querySelector(":scope > .ful-section-error")?.remove();const c=requestAnimationFrame(()=>{u()&&(t.toggleAttribute("loading",!0),t.setAttribute("aria-busy","true"))});try{const e=await Promise.all(o);return r&&this.#Rs.add(t),e}catch(e){throw u()&&this.#Ls(t,e),e}finally{r&&this.#Ts.delete(t),cancelAnimationFrame(c),u()&&(t.toggleAttribute("loading",!1),t.removeAttribute("aria-busy"))}}#Ls(e,t){e.querySelector(":scope > .ful-section-error")?.remove();const s=document.createElement("div");s.className="ful-section-error",s.setAttribute("role","alert"),s.textContent=r.of().failure(t),e.prepend(s)}}class Be{#zs;#Ns;#Os;#kt;#Ms;#Is=new Fe;#Fs=new v;#Bs=null;constructor(e,t,s){this.#zs=e,this.#Ns=t.querySelector("[data-ref=dialog]"),this.#Os=t.querySelector(`[data-ref=${s}]`),this.#kt=t.querySelector("[data-ref=loading]"),this.#Ms=t.querySelector("[data-ref=error]")}get dialog(){return this.#Ns}get section(){return this.#Os}get dirty(){return Array.from(this.#Ns.querySelectorAll("ful-form")).some(e=>e.closest("dialog")===this.#Ns&&e.dirty)}dismiss(e,t,s){return this.#Bs?this.#Bs:this.#zs.dispatchEvent(e)?e.cancelable?s&&this.dirty?(this.#Bs=s().then(e=>(e&&this.#Ns.open&&t(),e)).finally(()=>{this.#Bs=null}),this.#Bs):(t(),Promise.resolve(!0)):Promise.resolve(!0):Promise.resolve(!1)}onBackdrop(e){const t=e=>{if(e.target!==this.#Ns)return!1;const t=this.#Ns.getBoundingClientRect();return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom};let s=!1;this.#Ns.addEventListener("mousedown",e=>{s=t(e)}),this.#Ns.addEventListener("click",i=>{s&&t(i)&&e()})}onSubmitted(e){this.#Os.addEventListener("submit:success",t=>{"ful-form"===t.target.localName&&t.target.parentElement===this.#Os&&e(t.detail.response)})}restChrome(){this.#Ms?.replaceChildren(),this.#Ms?.setAttribute("hidden",""),this.#kt?.setAttribute("hidden",""),this.#Os?.removeAttribute("hidden")}request(){return this.#Is.request(this.#zs,this.#Os,null,null).catch(()=>{})}async update(e,t){const s=this.#Fs.take();this.#Os.replaceChildren(),this.restChrome(),this.#kt?.removeAttribute("hidden"),this.#Os.setAttribute("hidden",""),t();try{const t=await e();return s.stale?null:(this.#Os.replaceChildren(t),this.#kt?.setAttribute("hidden",""),this.#Os.removeAttribute("hidden"),this.#Os)}catch(e){throw s.stale||(this.#Ms?.removeAttribute("hidden"),this.#Ms&&(this.#Ms.textContent=r.of().failure(e)),this.#kt?.setAttribute("hidden",""),this.#Os.setAttribute("hidden","")),e}}}let Pe=!1;const De=()=>{Pe||(Pe=!0,document.addEventListener("click",e=>{const t=e.target.closest?.("[dialog-target]");t&&document.getElementById(t.getAttribute("dialog-target"))?.open?.()}))};class $e extends e{static attributes=["header","requires-answer:presence","close-on-submit:presence","guard-dismiss:presence"];static slots=!0;static template='\n <dialog data-ref="dialog" class="ful-dialog">\n <header data-tpl-if="header || slots.header || !requiresAnswer" class="ful-dialog-header">\n {{{{ slots.header }}}}\n <h2 data-tpl-if="header">{{ header }}</h2>\n <button data-tpl-if="!requiresAnswer" type="button" data-ref="close" data-tpl-aria-label="#l10n:t(\'dialog.close\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button>\n </header>\n <section data-ref="loading" hidden><ful-spinner class="centered" role="status"><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner></section>\n <section data-ref="error" role="alert" hidden></section>\n <div data-ref="body" class="ful-dialog-body">{{{{ slots.default }}}}</div>\n <footer class="ful-dialog-footer"><button type="button" data-ref="acknowledge" data-result="acknowledged" data-tpl-if="!slots.buttons && !closeOnSubmit" data-tpl-aria-label="#l10n:t(\'dialog.acknowledge\')">{{ #l10n:t(\'dialog.acknowledge\') }}</button>{{{{ slots.buttons }}}}</footer>\n </dialog>\n ';#Ns;#Ps;#Ds=[];#$s=null;render({slots:e}){const s=this.declared("requires-answer"),i=this.declared("close-on-submit"),r=this.template().withOverlay({slots:e,header:this.declared("header")??"",requiresAnswer:s,closeOnSubmit:i}).render();this.#Ps=new Be(this,r,"body"),this.#Ns=this.#Ps.dialog;const a=r.querySelector("h2");a&&(a.id||=t.uid("ful-dialog-title"),this.#Ns.setAttribute("aria-labelledby",a.id)),this.#Ns.addEventListener("close",()=>{const e=this.#Ws();this.dispatchEvent(new CustomEvent("close",{detail:e})),this.#Vs(e)}),this.#Ns.addEventListener("click",e=>{const t=e.target.closest("button[data-result]");t&&t.closest("dialog")===this.#Ns&&this.#Ns.close(t.dataset.result)}),s||this.#Ps.onBackdrop(()=>this.dismiss("backdrop")),r.querySelector("[data-ref=close]")?.addEventListener("click",()=>this.dismiss("button")),i&&this.#Ps.onSubmitted(e=>{this.#$s={dismissed:!1,result:null,response:e},this.#Ns.close("submitted")}),this.#Ns.addEventListener("cancel",e=>{if(!e.cancelable)return this.#Ns.returnValue="",void this.#Hs("escape",!1);e.preventDefault(),s||this.dismiss("escape")}),this.replaceChildren(r),De()}#Ws(){if(this.#$s)return this.#$s;const e=this.#Ns?.returnValue??"";return""===e?{dismissed:!0,result:null,response:null}:{dismissed:!1,result:e,response:null}}#Vs(e){const t=this.#Ds;this.#Ds=[];for(const s of t)s(e)}disconnectedCallback(){this.#Vs(this.#Ws())}open(){return this.ask()}ask(){return this.#js()&&(this.#Ps.restChrome(),this.#Ps.request()),new Promise(e=>{this.#Ds.push(e)})}async update(e){return await this.#Ps.update(e,()=>this.#js())}refresh(){return this.#Ps.request()}dismiss(e){return this.#Ns.open?this.#Hs(e,!0):Promise.resolve(!0)}#Hs(e,t){return this.#Ps.dismiss(new CustomEvent("dialog:dismiss",{cancelable:t,detail:{reason:e}}),()=>this.#Ns.close(""),this.declared("guard-dismiss")?We:null)}close(e){this.#Ns.close(e??"")}#js(){return this.#Ns.open&&!this.#Ns.matches(":modal")&&this.#Ns.removeAttribute("open"),!this.#Ns.open&&(this.#Ns.returnValue="",this.#$s=null,this.#Ns.showModal(),!0)}static async ask(e,t,s=[],{className:r}={}){const a=document.createElement("ful-dialog");if(a.setAttribute("header",e),r&&(a.className=r),"string"==typeof t?a.textContent=t:t&&a.append(t),s.length>0){const e=document.createElement("template");e.setAttribute("slot","buttons");for(const t of s){if(t instanceof Node){e.content.append(t);continue}const[s,i,r]=t,a=document.createElement("button");a.type="button",a.dataset.result=s,r&&(a.className=r),a.textContent=i,e.content.append(a)}a.append(e)}document.body.append(a);try{return await i.waitFor(a),await a.ask()}finally{a.remove()}}static async confirm(e,t,s={},i={}){const a=await $e.ask(e,t,[["cancel",s.cancel??r.of().t("dialog.cancel")],["confirm",s.confirm??r.of().t("dialog.confirm"),"ful-button"]],i);return!a.dismissed&&"confirm"===a.result}}const We=()=>{const e=r.of();return $e.confirm(e.t("dialog.discard.header"),e.t("dialog.discard.body"),{confirm:e.t("dialog.discard.confirm"),cancel:e.t("dialog.discard.cancel")})};class Ve extends e{static attributes=["header","placement","close-on-submit:presence","guard-dismiss:presence"];static slots=!0;static template='\n <dialog data-ref="dialog" class="ful-drawer">\n <header>\n {{{{ slots.header }}}}\n <h2 data-ref="title">{{ title }}</h2>\n <button type="button" data-ref="close" data-tpl-aria-label="#l10n:t(\'drawer.close\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button>\n </header>\n <section data-ref="loading" hidden><ful-spinner class="centered" role="status"><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner></section>\n <section data-ref="error" role="alert" hidden></section>\n <section data-ref="content">{{{{ slots.default }}}}</section>\n </dialog>\n ';#Ns;#Gs;#Ps;#$s=null;#Ds=[];#Ks=!1;#Us=new v;render({slots:e}){const s=this.template().withOverlay({slots:e,title:this.declared("header")??""}).render();this.#Ps=new Be(this,s,"content"),this.#Ns=this.#Ps.dialog,this.#Gs=s.querySelector("[data-ref=title]"),this.#Gs.id||=t.uid("ful-drawer-title"),this.#Ns.setAttribute("aria-labelledby",this.#Gs.id);const i=this.declared("placement");i&&this.#Ns.setAttribute("placement",i),s.querySelector("[data-ref=close]").addEventListener("click",()=>this.dismiss("button")),this.#Ps.onBackdrop(()=>this.dismiss("backdrop")),this.#Ns.addEventListener("cancel",e=>{if(!e.cancelable)return this.#Qs(),void this.#Hs("escape",!1);e.preventDefault(),this.dismiss("escape")}),this.#Ns.addEventListener("click",e=>{const t=e.target.closest("button[data-result]");t&&t.closest("dialog")===this.#Ns&&this.close(t.dataset.result)}),this.#Ns.addEventListener("close",()=>{const e=this.#Ws();this.dispatchEvent(new CustomEvent("close",{detail:e})),this.#Vs(e)}),this.declared("close-on-submit")&&this.#Ps.onSubmitted(e=>{this.#$s={dismissed:!1,result:null,response:e},this.close()}),this.replaceChildren(s),De()}get header(){return this.#Gs.textContent}set header(e){this.#Gs.textContent=e??""}async update(e,t){return this.header=e,await this.#Ps.update(t,()=>this.#js())}refresh(){return this.#Ps.request()}#Ws(){return this.#$s??{dismissed:!0,result:null,response:null}}#Vs(e){const t=this.#Ds;this.#Ds=[];for(const s of t)s(e)}disconnectedCallback(){this.#Vs(this.#Ws())}open(){return this.ask()}ask(){return this.#js()&&(this.#Ps.restChrome(),this.#Ps.request()),new Promise(e=>{this.#Ds.push(e)})}dismiss(e){return this.#Ks||!this.#Ns.open?Promise.resolve(!0):this.#Hs(e,!0)}#Hs(e,t){return this.#Ps.dismiss(new CustomEvent("drawer:dismiss",{cancelable:t,detail:{reason:e}}),()=>this.close(),this.declared("guard-dismiss")?We:null)}close(e){if(this.#Ks||!this.#Ns.open)return;if(e&&(this.#$s={dismissed:!1,result:e,response:null}),matchMedia("(prefers-reduced-motion: reduce)").matches)return void this.#Ns.close();this.#Ns.setAttribute("closing","");const t=this.#Ns.getAnimations();if(0===t.length)return void this.#Js();this.#Ks=!0;const s=this.#Us.take();Promise.allSettled(t.map(e=>e.finished)).then(()=>{s.stale||this.#Js()})}#Js(){this.#Qs(),this.#Ns.close()}#Qs(){this.#Ks=!1,this.#Us.invalidate(),this.#Ns.removeAttribute("closing")}#js(){return this.#Ks&&(this.#$s=null),this.#Qs(),this.#Ns.open&&!this.#Ns.matches(":modal")&&this.#Ns.removeAttribute("open"),!this.#Ns.open&&(this.#$s=null,this.#Ns.showModal(),!0)}}class He extends e{static attributes=["for"];#Ys=null;#Xs=null;#Zs=e=>{const t=e.target;this.#Xs=this.matches(":popover-open")&&this.#Ys?.contains(t)?this.#Ys:null};connectedCallback(){super.connectedCallback(),this.rendered&&!this.declared("for")&&document.addEventListener("pointerdown",this.#Zs,!0)}disconnectedCallback(){document.removeEventListener("pointerdown",this.#Zs,!0)}render(){const e=this.declared("for"),t=e?document.getElementById(e):null;if(e&&!t)throw new Error(`ful-menu names no invoker: for="${e}" must name an element already in the page when the menu upgrades`);this.setAttribute("role","menu"),this.hasAttribute("popover")||this.setAttribute("popover",""),t?(this.#Ys=t,t.setAttribute("aria-haspopup","menu"),Q.wire(t,this,{prefix:"ful-menu",invoke:!0,expanded:!0})):this.#ei(),pe(()=>this.#Ys,this,{items:()=>this.items}),this.#qs(),this.addEventListener("click",e=>{const t=e.target;this.items.some(e=>e===t||e.contains(t))&&this.hidePopover()})}showFor(e){if(this.declared("for"))throw new Error("ful-menu: showFor serves a menu without for; a menu with for is opened by its invoker");const t=this.#Xs;if(this.#Xs=null,t===e)return;this.#Ys&&this.#Ys!==e&&this.#Ys.setAttribute("aria-expanded","false"),this.#Ys=e,e.setAttribute("aria-haspopup","menu"),e.setAttribute("aria-expanded","true"),this.style.margin="";const s=Number.parseFloat(getComputedStyle(this).marginBlockStart)||0,i=this.matches(":popover-open");Q.show(this,e,{flip:!0,gap:s}),i&&this.items[0]?.focus()}get items(){return this.#qs().filter(e=>!e.hasAttribute("disabled")&&!e.hasAttribute("hidden"))}#ei(){document.addEventListener("pointerdown",this.#Zs,!0),this.addEventListener("toggle",e=>{"closed"===e.newState&&this.#Ys?.setAttribute("aria-expanded","false")})}#qs(){const e=[...this.querySelectorAll(":scope > button, :scope > a[href]")];for(const t of e)t.hasAttribute("role")||t.setAttribute("role","menuitem"),t.tabIndex=-1;return e}}const je=["info","success","warning","error"],Ge=new Set;let Ke=!1;class Ue extends e{static attributes=["timeout:number"];#ti;connectedCallback(){super.connectedCallback(),this.rendered&&Ge.add(this)}disconnectedCallback(){Ge.delete(this)}render(){this.#ti=this.declared("timeout")||5e3,this.setAttribute("role","region"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-label",r.of().t("toast.region")),this.setAttribute("popover","manual"),Ke||(Ke=!0,document.addEventListener("show-toast",e=>{if(e.detail)for(const t of Ge)t.show(e.detail.message,e.detail)})),Ge.add(this)}show(e,t={}){const s=je.includes(t.severity)?t.severity:"info",i=document.createElement("ful-toast");i.classList.add(s),i.setAttribute("role","error"===s?"alert":"status");const a=document.createElement("div");a.textContent=r.of().failure(e);const n=document.createElement("button");n.type="button",n.setAttribute("aria-label",r.of().t("toast.dismiss"));const o=document.createElement("ful-icon");o.setAttribute("name","x-lg"),o.setAttribute("aria-hidden","true"),n.append(o),i.append(a);let l=t.timeout??this.#ti,d=performance.now(),u=0;const c=()=>{clearTimeout(u),i.contains(document.activeElement)&&this.focus(),matchMedia("(prefers-reduced-motion: reduce)").matches?i.remove():(i.classList.add("ful-toast-out"),0===i.getAnimations().length&&i.remove())};if(t.action?.label){const e=document.createElement("button");e.type="button",e.className="ful-toast-action",e.textContent=String(t.action.label),e.addEventListener("click",()=>{t.action.onClick?.(),c()}),i.append(e)}i.append(n),i.addEventListener("animationend",()=>{i.classList.contains("ful-toast-out")&&i.remove()});let h=0;const p=()=>{0===h&&(clearTimeout(u),l=Math.max(0,l-(performance.now()-d))),++h},f=()=>{0!==h&&0===--h&&(d=performance.now(),u=setTimeout(c,l))};return i.addEventListener("mouseenter",p),i.addEventListener("mouseleave",f),i.addEventListener("focusin",p),i.addEventListener("focusout",f),n.addEventListener("click",c),this.append(i),this.#si(),u=setTimeout(c,l),i}#si(){this.isConnected&&(this.matches(":popover-open")&&this.hidePopover(),this.showPopover())}}class Qe extends e{static slots=!0;static observed=["active:number"];static template='\n <button type="button" class="ful-tabs-scroll" data-ref="scroll-start" tabindex="-1" hidden data-tpl-aria-label="#l10n:t(\'tabs.previous\')"><ful-icon name="chevron-left" aria-hidden="true"></ful-icon></button>\n <ful-tablist role="tablist">{{{{ slots.tabs }}}}</ful-tablist>\n <button type="button" class="ful-tabs-scroll" data-ref="scroll-end" tabindex="-1" hidden data-tpl-aria-label="#l10n:t(\'tabs.next\')"><ful-icon name="chevron-right" aria-hidden="true"></ful-icon></button>\n {{{{ slots.default }}}}\n ';#ii;#ri;#ai;#ni=[];#oi=[];#Is=new Fe;#li=0;render({slots:e}){const s=this.template().withOverlay({slots:e}).render();this.#ii=s.querySelector("ful-tablist"),this.#ri=s.querySelector('[data-ref="scroll-start"]'),this.#ai=s.querySelector('[data-ref="scroll-end"]');const i=[this.#ii,this.#ri,this.#ai],r=[...this.#ii.children];this.#oi=[...s.children].filter(e=>!i.includes(e)),r.length!==this.#oi.length&&console.warn(`ful-tabs: ${r.length} tabs declared for ${this.#oi.length} panels, the surplus is left alone`);const a=Math.min(r.length,this.#oi.length);this.#ni=[];for(let e=0;e!==a;++e){const s=this.#oi[e],i=document.createElement("button");i.type="button",i.role="tab",i.id=t.uid("ful-tab"),s.id||(s.id=t.uid("ful-tabpanel")),i.setAttribute("aria-controls",s.id),s.role="tabpanel",s.setAttribute("aria-labelledby",i.id),s.tabIndex=0,i.append(...r[e].childNodes),i.addEventListener("click",()=>{this.active=e}),r[e].replaceWith(i),this.#ni.push(i)}this.#ii.addEventListener("keydown",e=>{const t=this.#li;let s=null;"ArrowRight"===e.key?s=(t+1)%this.#ni.length:"ArrowLeft"===e.key?s=(t-1+this.#ni.length)%this.#ni.length:"Home"===e.key?s=0:"End"===e.key&&(s=this.#ni.length-1),null!==s&&s!==t&&(e.preventDefault(),this.active=s,this.#ni[s].focus())}),this.#ri.addEventListener("click",()=>this.#di(-1)),this.#ai.addEventListener("click",()=>this.#di(1)),this.#ii.addEventListener("scroll",()=>this.#ui(),{passive:!0});let n=-1;const o=new ResizeObserver(()=>{this.#ui(),this.#ii.clientWidth!==n&&(n=this.#ii.clientWidth,this.#ci(this.#ni[this.#li],"auto"))});o.observe(this.#ii);for(const e of this.#ni)o.observe(e);this.replaceChildren(s)}#ui(){const e=this.#ii,t=e.scrollWidth-e.clientWidth,s=Math.abs(e.scrollLeft);this.#ri.hidden=s<=1,this.#ai.hidden=s>=t-1,this.#ri.style.blockSize=this.#ai.style.blockSize=`${e.clientHeight}px`}#hi(){const e=this.#ii.getBoundingClientRect(),t="rtl"===getComputedStyle(this.#ii).direction,[s,i]=t?[this.#ai,this.#ri]:[this.#ri,this.#ai];return{left:e.left+s.offsetWidth,right:e.right-i.offsetWidth}}#di(e){const{left:t,right:s}=this.#hi(),i=e>0!=("rtl"===getComputedStyle(this.#ii).direction)?e=>e.getBoundingClientRect().right>s+1:e=>e.getBoundingClientRect().left<t-1,r=e>0?this.#ni.find(i):this.#ni.findLast(i);this.#ci(r,matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth")}#ci(e,t){if(!e)return;const{left:s,right:i}=this.#hi(),r=e.getBoundingClientRect();r.right>i?this.#ii.scrollBy({left:Math.ceil(r.right-i),behavior:t}):r.left<s&&this.#ii.scrollBy({left:Math.floor(r.left-s),behavior:t})}get active(){return this.#li}refresh(e){const t=e instanceof Element?this.#oi.indexOf(e):Number.isInteger(e)?e:NaN,s=this.#oi[t];if(s)return this.#Is.request(this,s,null,t).catch(()=>{});console.warn(`ful-tabs: no panel answers to "${e}"`)}set active(e){const t=Math.min(Math.max(0,Number(e)||0),Math.max(0,this.#ni.length-1)),s=this.#li;for(const[e,s]of this.#ni.entries())s.setAttribute("aria-selected",e===t?"true":"false"),s.tabIndex=e===t?0:-1,this.#oi[e].hidden=e!==t;this.#li=t,this.reflectTo("active",t),this.#ci(this.#ni[t],"auto"),this.rendered&&t!==s&&this.dispatchEvent(new CustomEvent("tabs:change",{detail:{active:t,previous:s}})),this.#oi.length>0&&(t!==s||!this.rendered)&&this.#Is.request(this,this.#oi[t],null,t).catch(()=>{})}}class Je extends e{static slots=!0;static observed=["exclusive:presence"];static template="\n <ful-accordion-group>{{{{ slots.default }}}}</ful-accordion-group>\n ";#re;#pi=!1;render({slots:e}){const t=this.template().withOverlay({slots:e}).render();this.#re=t.querySelector("ful-accordion-group"),this.replaceChildren(t)}get exclusive(){return this.#pi}set exclusive(e){this.#pi=!0===e,this.reflectTo("exclusive",this.#pi);const s=this.#pi?t.uid("ful-accordion"):null;for(const e of this.#re.querySelectorAll(":scope > details"))null===s?e.removeAttribute("name"):e.setAttribute("name",s)}}class Ye extends e{static slots=!0;static observed=["progress"];static template="\n <ful-steps><ol data-tpl-aria-label=\"#l10n:t('wizard.progress')\">{{{{ slots.steps }}}}</ol></ful-steps>\n {{{{ slots.default }}}}\n ";#fi=[];#Ps=[];#Is=new Fe;#mi=0;#gi;render({slots:e}){const t=this.template().withOverlay({slots:e}).render(),s=[...t.querySelector("ful-steps ol").children];this.#Ps=[...t.children].filter(e=>"ful-steps"!==e.localName),s.length!==this.#Ps.length&&console.warn(`ful-wizard: ${s.length} steps declared for ${this.#Ps.length} sections, the surplus is left alone`);const i=Math.min(s.length,this.#Ps.length);this.#fi=[];for(let e=0;e!==i;++e){const t=document.createElement("li");t.append(...s[e].childNodes),s[e].replaceWith(t),this.#fi.push(t),this.#Ps[e].tabIndex=-1}if(this.replaceChildren(t),i>0){const e=this.#Ps.findIndex(e=>"step"===e.getAttribute("aria-current"));this.#bi(-1===e?0:Math.min(e,i-1)),this.#vi(this.#mi).catch(()=>{})}}get index(){return this.#mi}get step(){return this.#Ps[this.#mi]?.getAttribute("data-step")??null}get progress(){return this.#gi}set progress(e){this.#gi=e,this.reflectTo("progress",e)}next(){return this.#yi(this.#mi+1)}prev(){return this.#yi(this.#mi-1)}move(e){const t=this.#Ps.findIndex(t=>t.getAttribute("data-step")===e);if(!(-1===t||t>=this.#fi.length))return this.#yi(t);console.warn(`ful-wizard: no section paired with a step carries data-step="${e}"`)}refresh(e){const t=e instanceof Element?this.#Ps.indexOf(e):this.#Ps.findIndex(t=>t.getAttribute("data-step")===e);if(!(-1===t||t>=this.#fi.length))return this.#vi(t).catch(()=>{});console.warn(`ful-wizard: no section answers to "${e}"`)}#vi(e){return this.#Is.request(this,this.#Ps[e],this.#Ps[e].getAttribute("data-step"),e)}#yi(e){const t=Math.min(Math.max(0,e),Math.max(0,this.#fi.length-1));if(t!==this.#mi)return this.#bi(t),this.#Ps[this.#mi].focus(),this.rendered&&this.dispatchEvent(new CustomEvent("wizard:change",{detail:{index:this.#mi,step:this.step}})),this.#vi(t)}#bi(e){for(const[t,s]of this.#fi.entries())t===e?(s.setAttribute("aria-current","step"),this.#Ps[t].setAttribute("aria-current","step")):(s.removeAttribute("aria-current"),this.#Ps[t].removeAttribute("aria-current"));this.#mi=e}}const Xe={en:{"pagination.showing":"Page {current} of {total}","pagination.navigation":"Page navigation","pagination.previous":"Previous","pagination.next":"Next","pagination.reload":"Reload","table.initial":"Start searching to see results.","table.error":"Error while loading data:","table.no-data":"No elements found.","table.loaded":"Showing {loaded} of {total}","table.range":"Rows {from}-{to} of {total}","table.retry":"Retry","dropdown.empty":"No results","select.remove":"Remove","files.dropzone-label":"Click or drop your files here","files.remove":"Remove","files.unacceptable-file-type":"Only files of type {types} are supported","files.max-file-size-exceeded":"Maximum supported file size is {size}","files.max-total-size-exceeded":"Maximum supported total file size is {size}","files.max-files-exceeded":{one:"Maximum of {count} file exceeded",other:"Maximum of {count} files exceeded"},"filters.op.EQ":"Equals","filters.op.NEQ":"Not equal","filters.op.LT":"Less than","filters.op.GT":"Greater than","filters.op.LTE":"At most","filters.op.GTE":"At least","filters.op.BETWEEN":"Between","filters.op.CONTAINS":"Contains","filters.op.STARTS_WITH":"Starts with","filters.op.ENDS_WITH":"Ends with","filters.sensitivity.IGNORE_CASE":"Ignore case","filters.sensitivity.CASE_SENSITIVE":"Case sensitive","filters.boolean.any":"Any","filters.boolean.true":"Yes","filters.boolean.false":"No","info.tooltip":"More information","failure.no-reason":"Something went wrong","dialog.acknowledge":"Got it","dialog.close":"Close","dialog.confirm":"Confirm","dialog.cancel":"Cancel","dialog.discard.header":"Unsaved changes","dialog.discard.body":"There are unsaved changes: close anyway?","dialog.discard.confirm":"Close without saving","dialog.discard.cancel":"Keep editing","drawer.close":"Close","spinner.loading":"Loading…","tabs.previous":"Previous tabs","tabs.next":"Next tabs","toast.region":"Notifications","toast.dismiss":"Dismiss","wizard.progress":"Progress"},it:{"pagination.showing":"Pagina {current} di {total}","pagination.navigation":"Navigazione pagine","pagination.previous":"Precedente","pagination.next":"Successivo","pagination.reload":"Ricarica","table.initial":"Avvia la ricerca per visualizzare i risultati.","table.error":"Errore nel caricamento dei dati:","table.no-data":"Nessun elemento trovato.","table.loaded":"Mostrati {loaded} di {total}","table.range":"Righe {from}-{to} di {total}","table.retry":"Riprova","dropdown.empty":"Nessun risultato","select.remove":"Rimuovi","files.dropzone-label":"Clicca o trascina i file qui","files.remove":"Rimuovi","files.unacceptable-file-type":"Solo i file di tipo {types} sono supportati","files.max-file-size-exceeded":"La dimensione massima di un file è di {size}","files.max-total-size-exceeded":"La dimensione massima complessiva dei file è di {size}","files.max-files-exceeded":{other:"Superato il numero massimo di {count} file"},"filters.op.EQ":"Uguale","filters.op.NEQ":"Diverso","filters.op.LT":"Minore","filters.op.GT":"Maggiore","filters.op.LTE":"Al massimo","filters.op.GTE":"Almeno","filters.op.BETWEEN":"Tra","filters.op.CONTAINS":"Contiene","filters.op.STARTS_WITH":"Inizia con","filters.op.ENDS_WITH":"Termina con","filters.sensitivity.IGNORE_CASE":"Ignora maiuscole","filters.sensitivity.CASE_SENSITIVE":"Distingui maiuscole","filters.boolean.any":"Qualsiasi","filters.boolean.true":"Sì","filters.boolean.false":"No","info.tooltip":"Maggiori informazioni","failure.no-reason":"Si è verificato un errore","dialog.acknowledge":"Ho capito","dialog.close":"Chiudi","dialog.confirm":"Conferma","dialog.cancel":"Annulla","dialog.discard.header":"Modifiche non salvate","dialog.discard.body":"Ci sono modifiche non salvate: chiudere comunque?","dialog.discard.confirm":"Chiudi senza salvare","dialog.discard.cancel":"Continua a modificare","drawer.close":"Chiudi","spinner.loading":"Caricamento…","tabs.previous":"Schede precedenti","tabs.next":"Schede successive","toast.region":"Notifiche","toast.dismiss":"Chiudi","wizard.progress":"Avanzamento"},es:{"pagination.showing":"Página {current} de {total}","pagination.navigation":"Navegación de páginas","pagination.previous":"Anterior","pagination.next":"Siguiente","pagination.reload":"Recargar","table.initial":"Inicia la búsqueda para ver los resultados.","table.error":"Error al cargar los datos:","table.no-data":"No se encontraron elementos.","table.loaded":"Mostrando {loaded} de {total}","table.range":"Filas {from}-{to} de {total}","table.retry":"Reintentar","dropdown.empty":"Sin resultados","select.remove":"Eliminar","files.dropzone-label":"Haz clic o arrastra tus archivos aquí","files.remove":"Eliminar","files.unacceptable-file-type":"Solo se admiten archivos de tipo {types}","files.max-file-size-exceeded":"El tamaño máximo de archivo admitido es {size}","files.max-total-size-exceeded":"El tamaño total máximo admitido es {size}","files.max-files-exceeded":{one:"Se ha superado el número máximo de {count} archivo",other:"Se ha superado el número máximo de {count} archivos"},"filters.op.EQ":"Igual","filters.op.NEQ":"Distinto","filters.op.LT":"Menor","filters.op.GT":"Mayor","filters.op.LTE":"Como máximo","filters.op.GTE":"Al menos","filters.op.BETWEEN":"Entre","filters.op.CONTAINS":"Contiene","filters.op.STARTS_WITH":"Empieza por","filters.op.ENDS_WITH":"Termina por","filters.sensitivity.IGNORE_CASE":"Ignorar mayúsculas","filters.sensitivity.CASE_SENSITIVE":"Distinguir mayúsculas","filters.boolean.any":"Cualquiera","filters.boolean.true":"Sí","filters.boolean.false":"No","info.tooltip":"Más información","failure.no-reason":"Se ha producido un error","dialog.acknowledge":"Entendido","dialog.close":"Cerrar","dialog.confirm":"Confirmar","dialog.cancel":"Cancelar","dialog.discard.header":"Cambios sin guardar","dialog.discard.body":"Hay cambios sin guardar: ¿cerrar de todos modos?","dialog.discard.confirm":"Cerrar sin guardar","dialog.discard.cancel":"Seguir editando","drawer.close":"Cerrar","spinner.loading":"Cargando…","tabs.previous":"Pestañas anteriores","tabs.next":"Pestañas siguientes","toast.region":"Notificaciones","toast.dismiss":"Cerrar","wizard.progress":"Progreso"},fr:{"pagination.showing":"Page {current} sur {total}","pagination.navigation":"Navigation des pages","pagination.previous":"Précédent","pagination.next":"Suivant","pagination.reload":"Recharger","table.initial":"Lancez la recherche pour voir les résultats.","table.error":"Erreur lors du chargement des données :","table.no-data":"Aucun élément trouvé.","table.loaded":"Affichage de {loaded} sur {total}","table.range":"Lignes {from} à {to} sur {total}","table.retry":"Réessayer","dropdown.empty":"Aucun résultat","select.remove":"Retirer","files.dropzone-label":"Cliquez ou déposez vos fichiers ici","files.remove":"Retirer","files.unacceptable-file-type":"Seuls les fichiers de type {types} sont pris en charge","files.max-file-size-exceeded":"La taille maximale de fichier prise en charge est {size}","files.max-total-size-exceeded":"La taille totale maximale prise en charge est {size}","files.max-files-exceeded":{one:"Nombre maximal de {count} fichier dépassé",other:"Nombre maximal de {count} fichiers dépassé"},"filters.op.EQ":"Égal","filters.op.NEQ":"Différent","filters.op.LT":"Inférieur","filters.op.GT":"Supérieur","filters.op.LTE":"Au plus","filters.op.GTE":"Au moins","filters.op.BETWEEN":"Entre","filters.op.CONTAINS":"Contient","filters.op.STARTS_WITH":"Commence par","filters.op.ENDS_WITH":"Finit par","filters.sensitivity.IGNORE_CASE":"Ignorer la casse","filters.sensitivity.CASE_SENSITIVE":"Respecter la casse","filters.boolean.any":"Indifférent","filters.boolean.true":"Oui","filters.boolean.false":"Non","info.tooltip":"Plus d’informations","failure.no-reason":"Une erreur s'est produite","dialog.acknowledge":"J’ai compris","dialog.close":"Fermer","dialog.confirm":"Confirmer","dialog.cancel":"Annuler","dialog.discard.header":"Modifications non enregistrées","dialog.discard.body":"Des modifications ne sont pas enregistrées : fermer quand même ?","dialog.discard.confirm":"Fermer sans enregistrer","dialog.discard.cancel":"Continuer à modifier","drawer.close":"Fermer","spinner.loading":"Chargement…","tabs.previous":"Onglets précédents","tabs.next":"Onglets suivants","toast.region":"Notifications","toast.dismiss":"Fermer","wizard.progress":"Progression"}};class Ze{#wi;#Ei;#xi;constructor(e={}){const t=e.language||navigator?.language||"en";try{this.#wi=Intl.getCanonicalLocales(String(t).replaceAll("_","-"))[0]}catch{throw new RangeError(`Plugin: language '${t}' is not a language tag: pass a BCP-47 tag such as 'it' or 'it-IT', or leave it out for the browser's language`)}this.#Ei=e.translations??{},this.#xi=e.httpClient??null}configure(e){const t=this.#xi??d.builder().withCsrfToken().withRedirectOnUnauthorized("/").build(),s=this.#wi.split("-")[0],i={...Xe.en,...Xe[s],...this.#Ei};e.defineModule("l10n",r).defineComponent("http-client",t).defineElement("ful-tooltip",Ie).defineElement("ful-dialog",$e).defineElement("ful-drawer",Ve).defineElement("ful-menu",He).defineElement("ful-toasts",Ue).defineElement("ful-tabs",Qe).defineElement("ful-accordion",Je).defineElement("ful-wizard",Ye).defineElement("ful-form",C).defineElement("ful-checkbox",ae).defineElement("ful-input",N).defineElement("ful-input-file",$).defineElement("ful-local-date",I).defineElement("ful-instant",F).defineElement("ful-input-local-date",B).defineElement("ful-input-local-time",P).defineElement("ful-input-instant",D).defineElement("ful-radio-group",re).defineElement("ful-table",he).defineElement("ful-pagination",oe).defineElement("ful-sorter",ne).defineElement("ful-filter-instant",ke).defineElement("ful-filter-local-date",Re).defineElement("ful-filter-number",Te).defineElement("ful-filter-boolean",Oe).defineElement("ful-filter-text",Le).defineElement("ful-filter-in",Me).defineElement("ful-select",ie).defineElement("ful-dropdown",se).defineComponent("loaders:select",te).defineComponent("loaders:form",_).defineComponent("loaders:table",ce).defineOverlay({l10n:i,locale:this.#wi})}}export{Je as Accordion,Q as Anchors,g as AsyncEvents,E as Bindings,Oe as BooleanFilter,ae as Checkbox,v as Claims,Ce as CompareFilter,$e as Dialog,Ve as Drawer,se as Dropdown,x as Field,C as Form,_ as FormLoader,Me as InFilter,N as Input,$ as InputFile,D as InputInstant,B as InputLocalDate,P as InputLocalTime,F as Instant,ke as InstantFilter,I as LocalDate,Re as LocalDateFilter,h as LocalStorage,He as Menu,Te as NumberFilter,b as PageLeave,oe as Pagination,Ze as Plugin,re as RadioGroup,ie as Select,te as SelectLoader,p as SessionStorage,ne as SortButton,he as Table,ce as TableLoader,Qe as Tabs,Le as TextFilter,w as Timing,Ue as Toasts,Ie as Tooltip,f as VersionedLocalStorage,m as VersionedSessionStorage,Ye as Wizard,y as describable};
2
2
  //# sourceMappingURL=ful.min.mjs.map