@optionfactory/ful 4.0.6 → 4.0.8

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{registry as t,ParsedElement as e,Attributes as s,Fragments as r,Nodes as i,Rendering as a}from"@optionfactory/ftl";class n{static encode(t,e){const s=e||n.URL_SAFE,r=t.byteLength,i=new Uint8Array(t);let a="";for(let t=0;t<r;t+=3){a+=s[i[t]>>2]+s[(3&i[t])<<4|i[t+1]>>4]+s[(15&i[t+1])<<2|i[t+2]>>6]+s[63&i[t+2]]}return r%3==2?a=a.substring(0,a.length-1):r%3==1&&(a=a.substring(0,a.length-2)),a}static decode(t,e){const s=e||n.URL_SAFE;let r=Math.floor(.75*t.length);for(let e=0;e!==t.length&&"="===t[t.length-e-1];++e)--r;const i=new Uint8Array(r);let a=0,l=0;for(;a<.75*t.length;){const e=s.indexOf(t.charAt(l++)),r=s.indexOf(t.charAt(l++)),n=s.indexOf(t.charAt(l++)),o=s.indexOf(t.charAt(l++));i[a++]=e<<2|r>>4,i[a++]=(15&r)<<4|n>>2,i[a++]=(3&n)<<6|o}return i.buffer}}n.STANDARD="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n.URL_SAFE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";class l{static decode(t){if(t.length%2!=0)throw new Error("invalid length");const e=t.length/2;return new Uint8Array(e).map((e,s)=>{const r=2*s,i=t.substring(r,r+2);return parseInt(i,16)})}static encode(t,e){return Array.from(t).map(t=>t.toString(16)).map(t=>e?t.toUpperCase():t).map(t=>t.padStart(2,0)).join("")}}class o extends Error{constructor(t,e,s){super(t,{cause:s}),this.name="Failure",this.problems=e}dropping(t){return new o(this.message,o.dropProblemsContext(this.problems,t),this)}static dropProblemsContext(t,e){return t.map(({type:t,context:s,reason:r,details:i})=>({type:t,context:s?.startsWith(e)?s.substring(e.length):s,reason:r,details:i}))}}class u{#t;#e;constructor(t,e){this.#t=t,this.#e=e}get normalized(){return`${this.#t}/${this.#e}`}get type(){return this.#t}get subtype(){return this.#e}static parse(t){if(!t)return new u("unknown","unknown");const[e,s]=t.split(";"),[r,i]=e.trim().split("/");return new u(r.toLowerCase(),i?.toLowerCase())}}class c extends o{constructor(t,e,s,r){super(t,s,r),this.name="HttpClientError",this.status=e}dropping(t){return new c(this.message,this.status,o.dropProblemsContext(this.problems,t),this)}static of(t,e){return new c(e.message,0,[{type:t,context:null,reason:e.message,details:null}],e)}static async fromResponse(t){switch(u.parse(t.headers.get("Content-Type")).normalized){case"application/failures+json":{const e=await t.json(),s=`${t.status} ${t.statusText}: ${e.length} failures`;return new c(s,t.status,e)}case"application/problem+json":{const e=await t.json(),s=`${t.status} ${t.statusText}: ${e.title} ${e.detail}`;return new c(s,t.status,e.problems||[{type:"GENERIC_PROBLEM",context:null,reason:s,details:null}])}default:{const e=await t.text(),s=`${t.status} ${t.statusText}: ${e}`;return new c(s,t.status,[{type:"GENERIC_PROBLEM",context:null,reason:s,details:null}])}}}}class d{#s;#r;constructor(){this.#s=document.querySelector("meta[name='_csrf_header']")?.getAttribute("content"),this.#r=document.querySelector("meta[name='_csrf']")?.getAttribute("content")}async intercept(t,e,s){return this.#s&&this.#r&&e.headers.set(this.#s,this.#r),await s.proceed(t,e)}}class h{#i;constructor(t){this.#i=t}async intercept(t,e,s){const r=await s.proceed(t,e);return 401===r.status&&(window.location.href=this.#i),r}}class p{#a;constructor(){this.#a=[]}withCsrfToken(){return this.#a.push(new d),this}withRedirectOnUnauthorized(t){return this.#a.push(new h(t)),this}withInterceptors(...t){return this.#a.push(...t),this}build(){return new b(this.#a)}}class f{async intercept(t,e,s){return await fetch(new Request(t,e))}}class m{#a;#n;constructor(t,e){this.#a=t,this.#n=e}async proceed(t,e){const s=this.#a[this.#n];return await s.intercept(t,e,new m(this.#a,this.#n+1))}}class b{#a;static builder(){return new p}constructor(t){this.#a=t||[]}async exchange(t,e,s){const r=[...this.#a,...s||[],new f],i=new m(r,0),a=new URL(new Request(t).url);return await i.proceed(a,e??{})}request(t,e){return g.create(this,t,e)}get(t){return g.create(this,"GET",t)}head(t){return g.create(this,"HEAD",t)}post(t){return g.create(this,"POST",t)}put(t){return g.create(this,"PUT",t)}patch(t){return g.create(this,"PATCH",t)}delete(t){return g.create(this,"DELETE",t)}}const v=async(t,e)=>{try{return await t[e]()}catch(t){throw c.of("UNMARSHALING_PROBLEM",t)}};class g{#l;#o;#u;#c;#d;#h;#p;#a;static create(t,e,s){return new g(t,e,s,new URLSearchParams,new Headers,void 0,{},[])}constructor(t,e,s,r,i,a,n,l){this.#l=t,this.#o=e,this.#u=s,this.#c=r,this.#h=a,this.#d=i,this.#p=n,this.#a=l}headers(t){for(const[e,s]of new Headers(t).entries())null==s?this.#d.delete(e):this.#d.set(e,s);return this}header(t,e){return null==e?this.#d.delete(t):this.#d.set(t,e),this}params(t){for(const[e,s]of new URLSearchParams(t).entries())null==s?this.#c.delete(e):this.#c.set(e,s);return this}param(t,...e){if(0===e.length||null===e[0]||void 0===e[0])return this.#c.delete(t),this;for(const s of e)this.#c.append(t,s);return this}body(t){return this.#h=t,this}json(t){return this.#d.set("Content-Type","application/json"),this.#h=JSON.stringify(t),this}multipart(t){const e=new FormData;return t(new y(e)),this.#h=e,this}options(t){for(const[e,s]of Object.entries(t))this.#p[e]=s;return this}option(t,e){return this.#p[t]=e,this}interceptors(t){for(const e of t)this.#a.push(e);return this}interceptor(t){return this.#a.push(t),this}async exchange(){const t=this.#c.size?`${this.#u}?${this.#c}`:this.#u,e={...this.#p,headers:this.#d,method:this.#o,body:this.#h};return await this.#l.exchange(t,e,this.#a)}async fetch(){const t=this.#c.size?`${this.#u}?${this.#c}`:this.#u,e={...this.#p,headers:this.#d,method:this.#o,body:this.#h};try{const s=await this.#l.exchange(t,e,this.#a);if(!s.ok)throw await c.fromResponse(s);return s}catch(t){if(t instanceof o)throw t;throw c.of("CONNECTION_PROBLEM",t)}}async fetchText(){const t=await this.fetch();return await v(t,"text")}async fetchJson(){const t=await this.fetch();return await v(t,"json")}async fetchBlob(){const t=await this.fetch();return await v(t,"blob")}async fetchArrayBuffer(){const t=await this.fetch();return await v(t,"arrayBuffer")}}class y{#f;constructor(t){this.#f=t}field(t,e){return this.#f.append(t,e),this}blob(t,e,s){return this.#f.append(t,e,s),this}blobs(t,e){for(let s of e)this.#f.append(t,s);return this}json(t,e,s){const r=new Blob([JSON.stringify(e)],{type:"application/json"});return this.#f.append(t,r,s),this}}class w extends Storage{static save(t,e){localStorage.setItem(t,JSON.stringify(e))}static load(t){const e=localStorage.getItem(t);return null===e?void 0:JSON.parse(e)}static remove(t){localStorage.removeItem(t)}static pop(t){const e=w.load(t);return w.remove(t),e}}class E extends Storage{static save(t,e){sessionStorage.setItem(t,JSON.stringify(e))}static load(t){const e=sessionStorage.getItem(t);return null===e?void 0:JSON.parse(e)}static remove(t){sessionStorage.removeItem(t)}static pop(t){const e=E.load(t);return E.remove(t),e}}class A{static save(t,e,s){w.save(t,{revision:e,data:s})}static load(t,e){const s=w.load(t);if(void 0!==s){if(s.revision===e)return s.data;localStorage.removeItem(t)}}}class T{static save(t,e,s){E.save(t,{revision:e,data:s})}static load(t,e){const s=E.load(t);if(void 0!==s){if(s.revision===e)return s.data;localStorage.removeItem(t)}}}class x{static forKeycloak(t,e,s,r){return new x(t,r??"openid profile",{auth:new URL("protocol/openid-connect/auth",e),token:new URL("protocol/openid-connect/token",e),logout:new URL("protocol/openid-connect/logout",e),registration:new URL("protocol/openid-connect/registrations",e),redirect:s})}constructor(t,e,{auth:s,token:r,registration:i,logout:a,redirect:n}){this.clientId=t,this.scope=e,this.uri={auth:s,token:r,registration:i,logout:a,redirect:n}}async action(t,e){const s=n.encode(crypto.getRandomValues(new Uint8Array(32)).buffer),r=n.encode(await crypto.subtle.digest("SHA-256",(new TextEncoder).encode(s))),i=this.clientId+n.encode(crypto.getRandomValues(new Uint8Array(16)).buffer);E.save(`${x.PKCE_AND_STATE_KEY}-${this.clientId}`,{state:i,verifier:s});const a=new URL(t);a.searchParams.set("client_id",this.clientId),a.searchParams.set("redirect_uri",this.uri.redirect),a.searchParams.set("response_type","code"),a.searchParams.set("scope",this.scope),a.searchParams.set("state",i),a.searchParams.set("code_challenge",r),a.searchParams.set("code_challenge_method","S256"),Object.entries(e||{}).forEach(t=>{a.searchParams.set(t[0],t[1])}),window.location.href=a.toString()}async registration(t){await this.action(this.uri.registration,t)}async applicationInitiatedAction(t,e){await this.action(this.uri.auth,{...e,kc_action:t})}async#m(t,e){window.history.replaceState("","",this.uri.redirect);const s=E.pop(`${x.PKCE_AND_STATE_KEY}-${this.clientId}`);if(s.state!==e)throw new Error("State mismatch");const r=await fetch(this.uri.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams([["client_id",this.clientId],["code",t],["grant_type","authorization_code"],["code_verifier",s.verifier],["state",s.state],["redirect_uri",this.uri.redirect]])});if(!r.ok){const t=await r.text();throw new Error("Error:"+r.status+": "+t)}const i=await r.json();return new S(this.clientId,i,this.uri)}async ensureLoggedIn(){const t=new URL(window.location.href),e=t.searchParams.get("code");if(e&&E.load(`${x.PKCE_AND_STATE_KEY}-${this.clientId}`)){const s=t.searchParams.get("state");return await this.#m(e,s)}return await this.action(this.uri.auth,{}),null}}x.PKCE_AND_STATE_KEY="state-and-verifier";class S{static parseToken(t){const[e,s,r]=t.split("."),i=new TextDecoder("utf-8");return{header:JSON.parse(i.decode(n.decode(e,n.STANDARD))),payload:JSON.parse(i.decode(n.decode(s,n.STANDARD))),signature:r}}constructor(t,e,{token:s,logout:r,redirect:i}){this.clientId=t,this.token=e,this.idToken=S.parseToken(e.id_token),this.accessToken=S.parseToken(e.access_token),this.refreshToken=S.parseToken(e.refresh_token),this.uri={token:s,logout:r,redirect:i},this.refreshCallback=null}onRefresh(t){this.refreshCallback=t}async refresh(){const t=await fetch(this.uri.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams([["client_id",this.clientId],["grant_type","refresh_token"],["refresh_token",this.token.refresh_token]])});if(!t.ok){const e=await t.text();throw new Error("Error:"+t.status+": "+e)}const e=await t.json();this.token=e,this.idToken=S.parseToken(e.id_token),this.accessToken=S.parseToken(e.access_token),this.refreshToken=S.parseToken(e.refresh_token),this.refreshCallback&&this.refreshCallback(this.token,this.accessToken,this.refreshToken)}shouldBeRefreshed(t){const e=(new Date).getTime(),s=1e3*this.refreshToken.payload.exp;return!(e>s)&&e-t>s}async refreshIf(t){this.shouldBeRefreshed(t)&&await this.refresh()}logout(){const t=new URL(this.uri.logout);t.searchParams.set("post_logout_redirect_uri",this.uri.redirect),t.searchParams.set("id_token_hint",this.token.id_token),window.location.href=t.toString()}bearerToken(){return`Bearer ${this.token.access_token}`}interceptor(t,e){return new k(this,t,e)}}class k{#b;#v;#g;constructor(t,e,s){this.#b=t,this.#v=e||2e3,this.#g=s||3e4}async intercept(t,e,s){await this.#b.refreshIf(this.#v),e.headers.set("Authorization",this.#b.bearerToken());const r=await s.proceed(t,e);return await this.#b.refreshIf(this.#g),r}}class q{static async fireAsync(t,e){return t.dispatchEvent(e),await(e.async?.promise)}static asyncOn(t,e,s,r){const i=async t=>{let e,r;const i=new Promise((t,s)=>{e=t,r=s});t.async={promise:i};try{e(await s(t))}catch(t){r(t)}};return t.addEventListener(e,i,r),i}static asyncOff(t,e,s,r){t.removeEventListener(e,s,r)}static mixInto(...t){for(const e of t)Object.assign(e.prototype,{async fireAsync(t){return await q.fireAsync(this,t)},asyncOn(t,e,s){return q.asyncOn(this,t,e,s)},asyncOff(t,e,s){return q.asyncOff(this,t,e,s)}})}}class L{static sleep(t){return new Promise(e=>setTimeout(e,t))}static DEBOUNCE_DEFAULT=0;static DEBOUNCE_IMMEDIATE=1;static debounce(t,e,s){const r=s??L.DEBOUNCE_DEFAULT;let i=null,a=[],n=0;const l=()=>{const s=(new Date).getTime()-n;t>s?i=setTimeout(l,t-s):(i=null,r!==L.DEBOUNCE_IMMEDIATE&&e(...a),null===i&&(a=[]))};return[function(){a=[...arguments],n=(new Date).getTime(),null===i&&(i=setTimeout(l,t),r===L.DEBOUNCE_IMMEDIATE&&e(...a))},()=>clearTimeout(i)]}static THROTTLE_DEFAULT=0;static THROTTLE_NO_LEADING=1;static THROTTLE_NO_TRAILING=2;static throttle(t,e,s){const r=s??L.THROTTLE_DEFAULT;let i=null,a=[],n=0;const l=()=>{n=r&L.THROTTLE_NO_LEADING?0:(new Date).getTime(),i=null,e(...a),null===i&&(a=[])};return[function(){const s=(new Date).getTime();!n&&r&L.THROTTLE_NO_LEADING&&(n=s);const o=t-(s-n);a=[...arguments],o<=0||o>t?(null!==i&&(clearTimeout(i),i=null),n=s,e(...a),null===i&&(a=[])):null!==i||r&L.THROTTLE_NO_TRAILING||(i=setTimeout(l,o))},()=>clearTimeout(i)]}}class _{static fromAttributes(e,s,r){const i=t.component("http-client"),a=e.hasAttribute("request-mapper")?t.component(e.getAttribute("request-mapper")):t=>t,n=e.hasAttribute("response-mapper")?t.component(e.getAttribute("response-mapper")):t=>t;return t.component(e.getAttribute("loader")??s).create({el:e,http:i,requestMapper:a,responseMapper:n,options:r??{}})}}class C{static flatten(t,e,s){return Object.keys(t).reduce((r,i)=>{const a=e.length?e+"."+i:i;return s.has(a)||"object"!=typeof t[i]||null===t[i]?r[a]=t[i]:Object.assign(r,C.flatten(t[i],a,s)),r},{})}static providePath(t,e,s){const r=e.split(".").map(t=>/^[0-9]+$/.test(t)?+t:t);let i=t??{},a=null;for(let e=0;;++e){const n=r[e],l=r[e-1];if(Number.isInteger(n)&&!Array.isArray(i)&&(null!==a?a[l]=i=[]:t=i=[]),e===r.length-1)return i[n]=void 0!==s?s:n in i?i[n]:null,t;void 0===i[n]&&(i[n]={}),a=i,i=i[n]}}static extract(t){if("radio"===t.getAttribute("type")){if(!t.checked)return;return"boolean"===t.dataset.fulBindType?"true"===t.value:t.value}return"checkbox"===t.getAttribute("type")?t.checked:"boolean"===t.dataset.fulBindType?t.value?"true"===t.value:null:!("INPUT"!==t.tagName&&"SELECT"!==t.tagName||""!==t.value&&void 0!==t.value)?null:t.value}static extractFrom(t){let e={};for(const s of t.elements)s.hasAttribute("name")&&!s.matches(":disabled")&&(e=C.providePath(e,s.getAttribute("name"),C.extract(s)));return e}static mutate(t,e){"radio"!==t.getAttribute("type")?"checkbox"!==t.getAttribute("type")?t.value=e:t.checked=e:t.checked=t.getAttribute("value")===e}static mutateIn(t,e){const s=Array.from(t.elements).map(t=>t.getAttribute("name")).filter(t=>t);for(const[r,i]of Object.entries(C.flatten(e,"",new Set(s))))for(const e of t.querySelectorAll(`[name='${CSS.escape(r)}']`))C.mutate(e,i)}static errors(t,e,s){const r=e.filter(t=>"FIELD_ERROR"===t.type||"INVALID_FORMAT"===t.type),i=e.filter(t=>"FIELD_ERROR"!==t.type&&"INVALID_FORMAT"!==t.type);t.querySelectorAll("[name]").forEach(t=>t.setCustomValidity?.("")),t.querySelectorAll("ful-errors").forEach(t=>{t.replaceChildren(),t.setAttribute("hidden","")}),r.forEach(e=>{const s=e.context.replace("[",".").replace("].",".").replace("]","").split(".");for(let r=s.length;0!=r;--r){const i=s.slice(0,r).join("."),a=s.slice(r,s.length).join(".");t.querySelectorAll(`[name='${CSS.escape(i)}']`).forEach(t=>t.setCustomValidity?.(e.reason,a))}}),t.querySelectorAll("ful-errors").forEach(t=>{t.innerText=i.map(t=>t.reason).join("\n"),0!==i.length&&t.removeAttribute("hidden")}),0!=e.length&&s&&Array.from(t.querySelectorAll(":invalid")).sort((t,e)=>t.getBoundingClientRect().y-e.getBoundingClientRect().y)[0]?.focus()}}class O{#y;#w;#o;#E;#A;constructor(t,e,s,r,i){this.#y=t,this.#w=e,this.#o=s,this.#E=r,this.#A=i}prepare(t,e){return this.#E(t,e)}async submit(t,e){return await this.#y.request(this.#o,this.#w).json(t).fetch()}transform(t,e){return this.#A(t,e)}}class R{#E;#A;constructor(t,e){this.#E=t,this.#A=e}async prepare(t,e){return await this.#E(t,e)}async submit(t,e,s){return s}async transform(t,e){return await this.#A(t,e)}}class I{static create({el:t,http:e,requestMapper:s,responseMapper:r}){const i=t.getAttribute("action");if(!i)return new R(s,r);const a=t.getAttribute("method")??"POST";return new O(e,i,a,s,r)}}class N extends e{form;render(){const t=this.form=document.createElement("form");t.setAttribute("novalidate",""),s.forward("form-",this,t),t.replaceChildren(...this.childNodes),t.addEventListener("submit",async t=>{t.preventDefault(),t.stopPropagation(),await this.submit()}),this.hasAttribute("clear-invalid-on-change")&&this.addEventListener("change",t=>{t.target.setCustomValidity?.("")}),this.replaceChildren(t)}async submit(){this.spinner(!0);try{const t=_.fromAttributes(this,"loaders:form"),e=this.values;let s=await t.prepare(e,this);try{const r=new CustomEvent("submit",{bubbles:!0,cancelable:!0,detail:{values:e,request:s}});if(!this.dispatchEvent(r))return;const i=new CustomEvent("submit:requested",{bubbles:!0,cancelable:!1,detail:{values:r.detail.values,request:r.detail.request}});let a=await q.fireAsync(this,i);s=i.detail.request,a=await t.submit(s,this,a);const n=await t.transform(a,this);this.dispatchEvent(new CustomEvent("submit:success",{bubbles:!0,cancelable:!1,detail:{values:e,request:s,response:n}}))}catch(t){this.dispatchEvent(new CustomEvent("submit:failure",{bubbles:!0,cancelable:!1,detail:{values:e,request:s,exception:t}})),t instanceof o&&(this.errors=t.problems),console.warn("failed to submit form",this,"reason:",t)}}finally{this.spinner(!1)}}reset(){this.form.reset()}spinner(t){this.querySelectorAll("ful-spinner").forEach(e=>{e.hidden=!t}),this.querySelectorAll("[type=submit],[type=reset]").forEach(e=>{e.disabled=t})}set values(t){C.mutateIn(this.form,t)}get values(){return C.extractFrom(this.form)}set errors(t){C.errors(this.form,t,this.hasAttribute("scroll-on-error"))}}class D extends e{static observed=["value","readonly:presence"];static slots=!0;static template='\n <div class="form-label">\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n </div>\n <div class="input-group">\n <span data-tpl-if="slots.ibefore" class="input-group-text">{{{{ slots.ibefore }}}}</span>\n {{{{ slots.before }}}}\n <input data-tpl-if="type != \'textarea\'" class="form-control" data-tpl-type="type" placeholder=" " form="">\n <textarea data-tpl-if="type == \'textarea\'" class="form-control" placeholder=" " form=""></textarea>\n {{{{ slots.after }}}}\n <span data-tpl-if="slots.iafter" class="input-group-text">{{{{ slots.iafter }}}}</span>\n </div>\n <ful-field-error></ful-field-error>\n ';static formAssociated=!0;_input;_fieldError;constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}_type(){return this.getAttribute("type")??"text"}_fragment(t,e){return this.template().withOverlay({type:t,slots:e}).render()}render({slots:t,observed:e,disabled:r}){const i=this._type(),a=this._fragment(i,t);this._input=a.querySelector("input,textarea"),s.forward("input-",this,this._input),this.disabled=r,this.readonly=e.readonly,this.value=e.value,this._input.addEventListener("change",t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))});const n=a.querySelector("label");n.addEventListener("click",()=>this.focus()),this._fieldError=a.querySelector("ful-field-error"),this._input.ariaDescribedByElements=[this._fieldError],this._input.ariaLabelledByElements=[n],this.replaceChildren(a)}get value(){return""===this._input.value?null:this._input.value}set value(t){this._input.value=""===t?null:t}get readonly(){return this._input.readOnly}set readonly(t){this._input.readOnly=t,this.reflect(()=>{s.toggle(this,"readonly",t)})}get disabled(){return this._input.hasAttribute("disabled")}set disabled(t){s.toggle(this._input,"disabled",t)}focus(t){this._input.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this._fieldError.innerText="");this.internals.setValidity({customError:!0}," "),this._fieldError.innerText=t}formResetCallback(){this.value=this.getAttribute("value")}}class M extends e{render(){const t=this.innerHTML.trim();if(""===t)return void(this.innerHTML=this.getAttribute("default")??"");const e=this.getAttribute("locale")??Intl.DateTimeFormat().resolvedOptions().locale,s=new Intl.DateTimeFormat(e,{year:"numeric",month:"numeric",day:"numeric"}),[r,i,a]=t.split("-").map(Number);this.innerHTML=s.format(new Date(r,i-1,a))}}class P extends e{render(){const t=this.innerHTML.trim();if(""===t)return void(this.innerHTML=this.getAttribute("default")??"");const e=this.getAttribute("locale")??Intl.DateTimeFormat().resolvedOptions().locale,s=new Intl.DateTimeFormat(e,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1});this.innerHTML=s.format(new Date(P.isoToLocal(t)))}static isoToLocal(t){const e=new Date(t),s=(t,e)=>String(e).padStart(t,"0");return`${`${e.getFullYear()}-${s(2,e.getMonth()+1)}-${s(2,e.getDate())}`}T${`${s(2,e.getHours())}:${s(2,e.getMinutes())}:${s(2,e.getSeconds())}.${s(3,e.getMilliseconds())}`}`}}class B extends D{static observed=["value","readonly:presence","min","max","step"];_type(){return"date"}render(t){const{observed:e}=t;super.render(t),this.min=e.min,this.max=e.max,this.step=e.step}get min(){const t=this._input.min;return""===t?null:t}set min(t){this._input.min=B.#T(t)}get max(){const t=this._input.max;return""===t?null:t}set max(t){this._input.max=B.#T(t)}get step(){const t=this._input.step;return""===t?null:t}set step(t){this._input.step=t??""}static#T(t){if(!t)return"";if("now"===t)return(new Date).toISOString().split("T")[0];const e=/^([+-])(\d+)([dmy])$/.exec(t);if(!e)return t;const s="-"===e[1]?-1:1,r=+e[2],i=new Date;switch(e[3]){case"d":i.setDate(i.getDate()+r*s);break;case"m":i.setMonth(i.getMonth()+r*s);break;case"y":i.setFullYear(i.getFullYear()+r*s)}return i.toISOString().split("T")[0]}}class $ extends B{_type(){return"time"}}class U extends D{static observed=["value","readonly:presence","min","max","step"];_type(){return"datetime-local"}render(t){const{observed:e}=t;super.render(t),this.min=e.min,this.max=e.min,this.step=e.min}get value(){const t=this._input.value;return""===t?null:new Date(t).toISOString()}set value(t){this._input.value=t?P.isoToLocal(t):""}get min(){const t=this._input.min;return""===t?null:new Date(t).toISOString()}set min(t){this._input.min=t?P.isoToLocal(t):""}get max(){const t=this._input.max;return""===t?null:new Date(t).toISOString()}set max(t){this._input.max=t?P.isoToLocal(t):""}get step(){const t=this._input.step;return""===t?null:t}set step(t){this._input.step=t??""}}class H{#y;#w;#o;#A;#x;#S;#k;static create({el:t,http:e,responseMapper:s}){return new H({http:e,url:t.getAttribute("src"),method:t.getAttribute("method")??"POST",responseMapper:s,prefetch:t.hasAttribute("preload"),revision:t.getAttribute("revision")})}constructor({http:t,url:e,method:s,responseMapper:r,prefetch:i,revision:a}){this.#y=t,this.#w=e,this.#o=s,this.#A=r,this.#x=i,this.#S=a,this.#k=null}async prefetch(){this.#x&&await this.#q()}async exact(...t){return await this.#q(),this.#k.filter(([e,s])=>t.some(t=>t==e))}async load(t){return await this.#q(),this.#k.filter(([e,s])=>(s??"").toLowerCase().includes(t?.toLowerCase()))}async#q(){if(null!==this.#k)return;const t=`${this.#o}@${this.#w}`;if(null!==this.#S){const e=A.load(t,this.#S);if(void 0!==e)return void(this.#k=e)}const e=await this.#y.request(this.#o,this.#w).fetchJson();this.#k=this.#A(e),null!==this.#S&&A.save(t,this.#S,this.#k)}}class F{#y;#w;#o;#A;static create({el:t,http:e,responseMapper:s}){return new F({http:e,url:t.getAttribute("src"),method:t.getAttribute("method")??"POST",responseMapper:s})}constructor({http:t,url:e,method:s,responseMapper:r}){this.#y=t,this.#w=e,this.#o=s,this.#A=r}async exact(...t){const e=await this.#y.request(this.#o,this.#w).param("k",...t).fetchJson();return this.#A(e)}async load(t){const e=await this.#y.request(this.#o,this.#w).param("s",t).fetchJson();return this.#A(e)}}class V{#k;constructor(t){this.#k=t}update(t){this.#k=t}exact(...t){return this.#k.filter(([e,s])=>t.some(t=>t==e))}load(t){return this.#k.filter(([e,s])=>(s??"").toLowerCase().includes(t?.toLowerCase()))}}class j{static create(t){if(!t.el.hasAttribute("src")){const e=Array.from(t.options.options?.querySelectorAll("option")??[]).map(t=>[t.getAttribute("value")??t.innerText.trim(),t.innerText.trim()]);return new V(e)}return"chunked"==t.el.getAttribute("mode")?F.create(t):H.create(t)}}class z extends e{static slots=!0;static template='\n <ful-spinner class="centered" hidden></ful-spinner>\n <menu tabindex="-1" hidden></menu>\n ';#L;#_;#p=new Map;render({slots:t}){const e=this.template().render();this.#L=e.querySelector("ful-spinner"),this.#_=e.querySelector("menu"),this.#_.addEventListener("click",t=>{t.stopPropagation(),t.target.matches("li")?this.#C(t.target):this.hide()}),this.replaceChildren(e)}acceptSelection(){const t=this.#_.querySelector("[selected]")??this.#_.firstElementChild;this.#C(t)}update(t){if(void 0===t)throw new Error("null data");if(this.#p=new Map(t.map((t,e)=>[String(e),t])),0===t.length){const t=document.createElement("div");return t.classList.add("text-center","py-2","bi","bi-database-slash"),void this.#_.replaceChildren(t)}this.#_.replaceChildren(...t.map(([t,e,s],r)=>{const i=document.createElement("li");return 0===r&&i.setAttribute("selected",""),i.setAttribute("value",r),i.innerText=e,i}))}#C(t){const e=t.getAttribute("value"),s=this.#p.get(e);this.hide(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{index:e,data:s}}))}hide(){this.setAttribute("hidden","")}get shown(){return!this.hasAttribute("hidden")}async show(t){this.removeAttribute("hidden"),this.#_.setAttribute("hidden",""),this.#L.removeAttribute("hidden");try{const e=await t();this.update(e)}finally{this.#L.setAttribute("hidden",""),this.#_.removeAttribute("hidden")}}async moveOrShow(t,e){if(this.shown){const e=this.#_.querySelector("[selected]")??this.#_.firstElementChild,s=e[(t?"next":"previous")+"ElementSibling"];return void(s&&(e.removeAttribute("selected"),s.setAttribute("selected",""),s.scrollIntoView({block:"nearest",behavior:"smooth"})))}await this.show(e)}}class J extends e{static observed=["value:csvm","readonly:presence"];static slots=!0;static template='\n <div class="form-label">\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n </div>\n <div class="input-group flex-nowrap" tabindex="-1">\n <span data-tpl-if="slots.ibefore" class="input-group-text">{{{{ slots.ibefore }}}}</span>\n {{{{ slots.before }}}}\n <div class="ful-select-input-container">\n <div class="ful-select-input">\n <badges></badges>\n <input type="text" form="">\n </div>\n <ful-dropdown hidden popover="manual"></ful-dropdown>\n </div>\n {{{{ slots.after }}}}\n <span data-tpl-if="slots.iafter" class="input-group-text">{{{{ slots.iafter }}}}</span>\n </div>\n <ful-field-error></ful-field-error>\n ';static mappers={csvm:(t,e,s)=>s.hasAttribute("multiple")?null===t?[]:t.split(",").map(t=>t.trim()).filter(t=>t):null===t||""===t?null:t};static formAssociated=!0;internals;#O;#R;#I;#N;#D;#M;#P=new Map;constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}async render({slots:t,observed:e,disabled:r}){const i=this.getAttribute("name");this.#O=_.fromAttributes(this,"loaders:select",{options:t.options}),this.#D=this.hasAttribute("multiple"),await(this.#O.prefetch?.());const a=this.template().withOverlay({slots:t,name:i}).render();this.#N=a.querySelector("input"),s.forward("input-",this,this.#N),this.#R=a.querySelector("badges"),this.value=e.value,this.disabled=r,this.readonly=e.readonly,this.#I=a.querySelector("ful-dropdown");const n=a.querySelector("label");n.addEventListener("click",()=>this.focus()),this.#M=a.querySelector("ful-field-error"),this.#N.ariaDescribedByElements=[this.#M],this.#N.ariaLabelledByElements=[n];const l=this,[o,u]=L.throttle(400,()=>l.#I.show(()=>l.#O.load(l.#N.value)));this.addEventListener("click",t=>{t.target.matches("input")||this.disabled||this.readonly||(this.#I.shown?this.#I.hide():(this.#N.focus(),o()))}),this.#R.addEventListener("click",t=>{if(t.stopPropagation(),this.disabled||this.readonly)return;-1!==[...this.#R.children].indexOf(t.target)&&(this.#P.delete(Array.from(this.#P.keys()).pop()),this.#B(),this.#$())}),this.#N.addEventListener("blur",t=>{t.stopPropagation(),t.relatedTarget&&this.contains(t.relatedTarget)||(u(),this.#I.hide(),this.#N.value="")}),this.#N.addEventListener("keydown",t=>{if(t.stopPropagation(),!this.disabled&&!this.readonly)switch(t.code){case"ArrowUp":this.#I.moveOrShow(!1,()=>l.#O.load(l.#N.value));break;case"ArrowDown":this.#I.moveOrShow(!0,()=>l.#O.load(l.#N.value));break;case"Escape":this.#I.hide();break;case"Enter":this.#I.acceptSelection(),this.#N.value="";break;case"Backspace":this.#P.size&&0===this.#N.selectionStart&&0===this.#N.selectionEnd&&(this.#P.delete(Array.from(this.#P.keys()).pop()),this.#B(),this.#$());break;case"Tab":this.#I.hide(),u()}}),this.#N.addEventListener("input",t=>{t.stopPropagation(),this.disabled||this.readonly||o()}),this.#I.addEventListener("change",t=>{t.stopPropagation(),this.#D||this.#P.clear(),this.#P.set(t.detail.data[0],t.detail.data.slice(1)),this.#B(),this.#$(),this.#N.focus(),this.#I.hide()}),this.replaceChildren(a)}withLoader(t){t(this.#O)}#B(){const t=[...this.#P.entries()].map(t=>({key:t[0],label:t[1][0],metadata:t[1].slice(1)})),e=this.#D?t:t[0]??null;this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:e}}))}#$(){const t=Array.from(this.#P.entries()).map(([t,e])=>{const s=document.createElement("badge");return s.setAttribute("role","button"),s.setAttribute("value",t),s.innerText=e[0],s});this.#R.innerHTML="",this.#R.append(...t)}set value(t){if(null===t)return this.#P=new Map,void this.#$();(async()=>{const e=await(this.#D?this.#O.exact(...t):this.#O.exact(t));this.#P=new Map(e.map(t=>[t[0],t.slice(1)])),this.#$()})()}get value(){return this.#D?[...this.#P.keys()]:[...this.#P.keys()][0]??null}get entry(){return this.#D?[...this.#P.entries()]:[...this.#P.entries()][0]??null}get disabled(){return this.#N.hasAttribute("disabled")}set disabled(t){s.toggle(this.#N,"disabled",t)}get readonly(){return this.#N.readOnly}set readonly(t){this.#N.readOnly=t,this.reflect(()=>{s.toggle(this,"readonly",t)})}focus(t){this.#N.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this.#M.innerText="");this.internals.setValidity({customError:!0}," "),this.#M.innerText=t}}class G extends e{static observed=["value","readonly:presence"];static slots=!0;static template='\n <fieldset>\n <legend class="form-label">\n {{{{ slots.default }}}}\n </legend>\n <header data-tpl-if="slots.header">\n {{{{ slots.header }}}}\n </header>\n <section>\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 </section>\n <ful-field-error></ful-field-error>\n <footer data-tpl-if="slots.footer">\n {{{{ slots.footer }}}}\n </footer>\n </fieldset>\n ';static formAssociated=!0;#U;#M;#H;#F;constructor(){super(),this.internals=this.attachInternals(),this.internals.role="radiogroup"}render({slots:t,observed:e,disabled:i}){const a=this.getAttribute("name")??s.uid("ful-radiogroup"),n=Array.from(t.default.querySelectorAll("ful-radio")),l=n.map(t=>{const e=document.createElement("input");e.setAttribute("type","radio"),s.forward("input-",this,e),s.forward("",t,e),e.setAttribute("name",`${a}-ignore`),e.setAttribute("form",""),e.addEventListener("change",t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))});return[e,r.fromChildNodes(t)]});n.forEach(t=>t.remove()),this.template().withOverlay({name:a,slots:t,inputsAndLabels:l}).renderTo(this),this.#U=this.firstElementChild,this.disabled=i,this.readonly=e.readonly,this.value=e.value,this.#M=this.querySelector("ful-field-error"),this.ariaDescribedByElements=[this.#M],this.#H=this.querySelector("input[type=radio]"),this.#F="boolean"===this.getAttribute("type")}get value(){const t=this.querySelector("input[type=radio]:checked");return t?this.#F?"true"===t.value:t.value:null}set value(t){if(null===t)return void this.querySelectorAll("input[type=radio]").forEach(t=>{t.checked=!1});const e=this.querySelector(`input[type=radio][value=${CSS.escape(String(t))}]`);e&&(e.checked=!0)}get readonly(){return this.#U.inert}set readonly(t){this.#U.inert=t,this.reflect(()=>{s.toggle(this,"readonly",t)})}get disabled(){return this.#U.hasAttribute("disabled")}set disabled(t){s.toggle(this.#U,"disabled",t)}focus(t){this.#H.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this.#M.innerText="");this.internals.setValidity({customError:!0}," "),this.#M.innerText=t}}class W extends e{static observed=["value:bool","readonly:presence"];static slots=!0;static template='\n <div data-tpl-class="klass">\n <div class="input-container">\n <input class="form-check-input" type="checkbox" role="switch" form="" placeholder=" ">\n </div>\n <div class="form-check-label">\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n </div>\n </div>\n <ful-field-error></ful-field-error>\n ';#V;#N;#M;static formAssociated=!0;constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}render({slots:t,observed:e,disabled:r}){const i="switch"==this.getAttribute("type")?"form-check form-switch":"form-check",a=this.template().withOverlay({slots:t,klass:i}).render();this.#V=a.firstElementChild,this.#N=a.querySelector("input"),s.forward("input-",this,this.#N),this.disabled=r,this.readonly=e.readonly,this.value=e.value,this.#N.addEventListener("change",t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))});const n=a.querySelector("label");n.addEventListener("click",()=>{this.focus(),this.disabled||this.readonly||(this.value=!this.value)}),this.#M=a.querySelector("ful-field-error"),this.#N.ariaDescribedByElements=[this.#M],this.#N.ariaLabelledByElements=[n],this.replaceChildren(a)}get value(){return this.#N.checked}set value(t){this.#N.checked=t}get readonly(){return this.#V.inert}set readonly(t){this.#V.inert=t,this.reflect(()=>{s.toggle(this,"readonly",t)})}get disabled(){return this.#N.hasAttribute("disabled")}set disabled(t){s.toggle(this.#N,"disabled",t)}focus(t){this.#N.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this.#M.innerText="");this.internals.setValidity({customError:!0}," "),this.#M.innerText=t}}class K extends e{static slots=!0;static template='\n <div class="ful-spinner-wrapper" role="status">\n <div class="ful-spinner-text">{{{{ slots.default }}}}</div>\n <div class="ful-spinner-icon"></div>\n </div>\n ';render({slots:t}){this.template().withOverlay({slots:t}).renderTo(this)}}class Y extends e{static observed=["order"];#j;render(){const t=this.getAttribute("sorter"),e=["asc","desc",null];this.addEventListener("click",()=>{const s=e[(e.indexOf(this.order)+1)%3];this.dispatchEvent(new CustomEvent("sort-requested",{bubbles:!0,cancelable:!0,detail:{value:{sorter:t,order:s}}}))})}get order(){return this.#j||null}set order(t){this.#j=t||null,this.reflect(()=>{this.#j?this.setAttribute("order",t):this.removeAttribute("order")})}}class Q extends e{static observed=["total:number","current:number"];static template='\n <nav aria-label="Page navigation" class="user-select-none">\n <ul class="pagination">\n <li class="page-item ms-auto me-2" data-tpl-if="paginationLabel"> Showing page {{ curr.label }} of {{ total }}</li>\n <li class="page-item ms-auto me-2" data-tpl-if="!paginationLabel"></li>\n <li class="page-item reload me-2"><a role="button"><i class="bi bi-arrow-clockwise"></i></a></li> \n <li class="page-item prev">\n <a data-tpl-class="prev.enabled?\'page-link\':\'page-link disabled\'" aria-label="Previous" role="button" data-tpl-data-page="prev.index">\n <i aria-hidden="true" class="bi bi-chevron-left"></i>\n </a>\n </li>\n <li class="page-item" data-tpl-each="pages" data-tpl-var="page">\n <a data-tpl-class="curr.index != page.index ? \'page-link\': \'page-link disabled\'" role="button" data-tpl-data-page="page.index" >\n {{ page.label }}\n </a>\n </li>\n <li class="page-item next">\n <a data-tpl-class="next.enabled?\'page-link\':\'page-link disabled\'" aria-label="Next" role="button" data-tpl-data-page="next.index">\n <i aria-hidden="true" class="bi bi-chevron-right"></i>\n </a>\n </li>\n </ul>\n </nav>\n ';#z;#J=0;#n=0;render({observed:t}){this.#z=this.hasAttribute("pagination-label"),this.update(t.current??0,t.total??0),this.addEventListener("click",t=>{const e=t.target.closest("a");e&&this.dispatchEvent(new CustomEvent("page-requested",{bubbles:!0,cancelable:!0,detail:{value:Number(e.dataset.page??this.#n)}}))})}update(t,e){const s=Number(this.getAttribute("pages")??"5"),r={index:Math.max(0,t-1),enabled:t>0},i={index:t,label:t+1},a={index:Math.min(e,t+1),enabled:t+1<e},n=[{index:t,label:t+1}];for(let r=t,i=1;i!==s&&n.length!=s;++i){const t=r-i;t>=0&&n.unshift({index:t,label:t+1});const s=r+i;s<e&&n.push({index:s,label:s+1})}const l=this.#z;this.template().withOverlay({total:e,prev:r,curr:i,next:a,pages:n,paginationLabel:l}).renderTo(this)}get total(){return this.#J}set total(t){this.#J=t,this.reflect(()=>{this.setAttribute("total",String(t)),this.update(this.#n??0,this.#J)})}get current(){return this.#n}set current(t){this.#n=t,this.reflect(()=>{this.setAttribute("current",String(t)),this.update(this.#n,this.#J??0)})}}class X{static parse(t,e){const s=i.queryChildren(t,"schema");if(!s)throw new Error(`missing expected <schema> in ${t}`);return i.queryChildrenAll(s,"column").map(t=>({sorter:t.getAttribute("sorter"),order:t.getAttribute("order"),title:X.#G(t,e),content:X.#W(t,e)}))}static#G(t,e){const s=i.queryChildren(t,"title");s&&s.remove();const a=s?e.withFragment(r.fromChildNodes(s)).render():document.createTextNode(t.getAttribute("title")??"");return{classes:t.getAttribute("th-class"),fragment:a}}static#W(t,e){return{classes:t.getAttribute("td-class"),template:e.withFragment(r.fromChildNodes(t))}}}class Z{#y;#w;#o;constructor(t,e,s){this.#y=t,this.#w=e,this.#o=s}async load(t,e,s){const r=Object.entries(s).filter(([t,e])=>e);return await this.#y.request(this.#o,this.#w).param("page",t.page).param("size",t.size).param("sort",e.order?`${e.sorter},${e.order}`:null).param("filters",r.length>0?JSON.stringify(Object.fromEntries(r)):null).fetchJson()}}class tt{static create({el:t,http:e}){const s=t.getAttribute("src"),r=t.getAttribute("method")??"GET";return new Z(e,s,r)}}class et extends e{static slots=!0;static template='\n <ful-form data-tpl-if="slots.filters">\n {{{{ slots.filters }}}}\n </ful-form>\n <div class="table-wrapper">\n <table class="table">\n <caption data-tpl-if="slots.caption">{{{{ slots.caption }}}}</caption>\n <thead>\n <tr>\n <th data-tpl-each="schema" scope="col" data-tpl-class="title.classes">\n {{{{ title.fragment }}}}\n <ful-sorter data-tpl-if="sorter || order" data-tpl-sorter="sorter" data-tpl-order="order"></ful-sorter>\n </th>\n </tr>\n </thead>\n <tbody></tbody>\n <tbody data-ref="no-autoload">\n <tr>\n <td data-tpl-colspan="schema.length" class="text-center align-middle p-4">\n <i class="bi bi-search" style="font-size: 40px; color: #BDC3CA"></i>\n <p class="mt-3 mb-0" style="color: #BDC3CA">\n Avvia la ricerca per visualizzare i risultati...\n </p>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="loading" hidden>\n <tr>\n <td data-tpl-colspan="schema.length" class="text-center align-middle p-4">\n <ful-spinner class="big"></ful-spinner>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="feedback" hidden>\n <tr>\n <td data-tpl-colspan="schema.length" class="text-center align-middle p-4">\n <div class="alert alert-danger">\n <p>Errore nel caricamento della tabella:</p>\n <p class="mb-0" data-ref="feedback-error"></p>\n </div>\n </td>\n </tr>\n </tbody>\n <tfoot data-tpl-if="slots.footer">\n {{{{ slots.footer }}}}\n </tfoot>\n </table>\n </div>\n <ful-pagination current="0" total="1"></ful-pagination>\n ';static templates={row:'\n <tr data-tpl-if="pageResponse.data.length == 0">\n <td data-tpl-colspan="schema.length" class="text-center align-middle p-4">\n Nessun elemento trovato.\n </td>\n </tr>\n <tr data-tpl-each="pageResponse.data" data-tpl-var="row">\n <td data-tpl-each="schema" data-tpl-class="content.classes">\n {{{{ content.template.withOverlay(row).render() }}}}\n </td>\n </tr>\n '};#K;#h;#Y;#Q;#X;#Z;#tt;#et;async render({slots:t,observed:e}){const r=this.template(),n=X.parse(t.default,r),l=r.withOverlay({slots:t,schema:n}).render(),o=i.queryChildren(l,".table-wrapper").querySelector("table");s.forward("table-",this,o),this.#K=n,this.#h=o.querySelector(":scope > tbody"),this.#Y=o.querySelector(":scope > tbody[data-ref=loading]"),this.#Q=o.querySelector(":scope > tbody[data-ref=no-autoload]"),this.#X=o.querySelector(":scope > tbody[data-ref=feedback]"),this.#Z=i.queryChildren(l,"ful-pagination"),this.#tt=o.querySelectorAll(":scope > thead ful-sorter")??[],this.replaceChildren(l),await a.waitForChildren(this);const u=n.find(t=>t.order),c=i.queryChildren(this,"ful-form");this.#et={pageRequest:{page:0,size:this.getAttribute("page-size")?Number(this.getAttribute("page-size")):10},sortRequest:{order:u?.order,sorter:u?.sorter},filterRequest:c?.values??{}},c?.addEventListener("submit:success",async t=>{await this.load({page:0,size:this.#et.pageRequest.size},this.#et.sortRequest,t.detail.request)}),this.addEventListener("page-requested",async t=>{await this.load({page:t.detail.value,size:this.#et.pageRequest.size},this.#et.sortRequest,this.#et.filterRequest)}),this.addEventListener("sort-requested",async t=>{await this.load(this.#et.pageRequest,t.detail.value,this.#et.filterRequest),this.#tt.forEach(t=>t.order=null),t.target.order=t.detail.value.order}),this.hasAttribute("autoload")&&await this.reload()}async reload(){return await this.load(this.#et.pageRequest,this.#et.sortRequest,this.#et.filterRequest)}async load(t,e,s){this.#h.innerHTML="",this.#Y.removeAttribute("hidden",""),this.#X.setAttribute("hidden",""),this.#Q.setAttribute("hidden","");try{const r=_.fromAttributes(this,"loaders:table"),i=await r.load(t,e,s);this.#et={pageRequest:t,sortRequest:e,filterRequest:s},this.#st(t,e,s,i)}catch(t){throw this.#Y.setAttribute("hidden",""),this.#X.removeAttribute("hidden",""),t.problems?this.#X.querySelector("[data-ref=feedback-error]").textContent=t.problems.map(t=>`${t.reason}`):this.#X.querySelector("[data-ref=feedback-error]").textContent=t,t}}async resetWithFilter(t){return await this.load({page:0,size:this.#et.pageRequest.size},this.#et.sortRequest,t)}#st(t,e,s,r){this.#Y.setAttribute("hidden",""),this.#h.replaceChildren(this.template("row").withOverlay({schema:this.#K,pageRequest:t,filterRequest:s,pageResponse:r}).render()),this.#Z.current=t.page,this.#Z.total=Math.ceil(r.size/t.size)}}class st extends e{static observed=["value:json"];static slots=!0;static template='\n <div class="form-label" data-tpl-if="label">\n <label>{{{{ label }}}}</label>\n {{{{ slots.info }}}}\n </div>\n <div class="input-group">\n <button data-ref="operator" class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" value="LTE" form="">&PrecedesSlantEqual;</button>\n <ul class="dropdown-menu">\n <li><a class="dropdown-item" role="button" value="EQ">=</a></li>\n <li><a class="dropdown-item" role="button" value="NEQ">&ne;</a></li>\n <li><a class="dropdown-item" role="button" value="LT">&prec;</a></li>\n <li><a class="dropdown-item" role="button" value="GT">&succ;</a></li>\n <li><a class="dropdown-item" role="button" value="LTE">&PrecedesSlantEqual;</a></li>\n <li><a class="dropdown-item" role="button" value="GTE">&SucceedsSlantEqual;</a></li>\n <li><a class="dropdown-item" role="button" value="BETWEEN">&LeftRightArrow;</a></li>\n </ul>\n <input data-ref="value1" type="datetime-local" class="form-control" form="">\n <input data-ref="value2" type="datetime-local" class="form-control" form="" hidden>\n <span class="input-group-text"><i class="bi bi-search"></i></span>\n </div>\n <ful-field-error></ful-field-error>\n ';static formAssociated=!0;#rt;#it;#at;#M;constructor(){super(),this.internals=this.attachInternals()}render({slots:t}){const e=0===r.toHtml(t.default.cloneNode(!0)).trim().length?null:t.default,i=this.getAttribute("name"),a=this.template().withOverlay({label:e,name:i}).render(this);this.#rt=a.querySelector("[data-ref=operator]"),this.#it=a.querySelector("[data-ref=value1]"),this.#at=a.querySelector("[data-ref=value2]"),this.#M=a.querySelector("ful-field-error");const n=a.querySelector("label");n?.addEventListener("click",()=>this.focus()),this.#it.ariaDescribedByElements=[this.#M],this.#it.ariaLabelledByElements=n?[n]:[],this.replaceChildren(a),this.addEventListener("click",t=>{const e=t.target;if(!e.matches("ul > li > a"))return;const r=e.closest("ul")?.previousElementSibling,i=e.getAttribute("value");s.toggle(this.#at,"hidden","BETWEEN"!==i),r.setAttribute("value",i),r.innerHTML=e.innerHTML})}get value(){const t=this.#rt.getAttribute("value"),e="BETWEEN"===t?[this.#it.value,this.#at.value]:[this.#it.value];return e.some(t=>""===t)?void 0:[t,...e.map(t=>new Date(t).toISOString())]}set value(t){if(null==t)return this.#it.value="",this.#at.value="",void this.reflect(()=>{this.removeAttribute("value")});const[e,...s]=t;this.#rt.setAttribute("value",e),this.#it.value=s[0]?P.isoToLocal(s[0]):s[0],this.#at.value=s[1]?P.isoToLocal(s[1]):s[1],this.reflect(()=>{this.setAttribute("value",JSON.stringify(t))})}focus(t){this.#it.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this.#M.innerText="");this.internals.setValidity({customError:!0}," "),this.#M.innerText=t}}class rt extends e{static observed=["value:json"];static slots=!0;static template='\n <div class="form-label" data-tpl-if="label">\n <label>{{{{ label }}}}</label>\n {{{{ slots.info }}}}\n </div>\n <div class="input-group">\n <button data-ref="operator" class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" value="EQ" form="">=</button>\n <ul class="dropdown-menu">\n <li><a class="dropdown-item" role="button" value="EQ">=</a></li>\n <li><a class="dropdown-item" role="button" value="NEQ">&ne;</a></li>\n <li><a class="dropdown-item" role="button" value="LT">&prec;</a></li>\n <li><a class="dropdown-item" role="button" value="GT">&succ;</a></li>\n <li><a class="dropdown-item" role="button" value="LTE">&PrecedesSlantEqual;</a></li>\n <li><a class="dropdown-item" role="button" value="GTE">&SucceedsSlantEqual;</a></li>\n <li><a class="dropdown-item" role="button" value="BETWEEN">&LeftRightArrow;</a></li>\n </ul>\n <input data-ref="value1" type="date" class="form-control" form="">\n <input data-ref="value2" type="date" class="form-control" form="" hidden>\n <span class="input-group-text"><i class="bi bi-search"></i></span>\n </div>\n <ful-field-error></ful-field-error>\n ';static formAssociated=!0;#rt;#it;#at;#M;constructor(){super(),this.internals=this.attachInternals()}render({slots:t}){const e=0===r.toHtml(t.default.cloneNode(!0)).trim().length?null:t.default,i=this.getAttribute("name"),a=this.template().withOverlay({label:e,name:i}).render(this);this.#rt=a.querySelector("[data-ref=operator]"),this.#it=a.querySelector("[data-ref=value1]"),this.#at=a.querySelector("[data-ref=value2]"),this.#M=a.querySelector("ful-field-error");const n=a.querySelector("label");n?.addEventListener("click",()=>this.focus()),this.#it.ariaDescribedByElements=[this.#M],this.#it.ariaLabelledByElements=n?[n]:[],this.replaceChildren(a),this.addEventListener("click",t=>{const e=t.target;if(!e.matches("ul > li > a"))return;const r=e.closest("ul")?.previousElementSibling,i=e.getAttribute("value");s.toggle(this.#at,"hidden","BETWEEN"!==i),r.setAttribute("value",i),r.innerHTML=e.innerHTML})}get value(){const t=this.#rt.getAttribute("value"),e="BETWEEN"==t?[this.#it.value,this.#at.value]:[this.#it.value];return e.some(t=>""===t)?void 0:[t,"ISO_8601",...e]}set value(t){if(null==t)return this.#it.value="",this.#at.value="",void this.reflect(()=>{this.removeAttribute("value")});const[e,...s]=t;this.#rt.setAttibute("value",e),this.#it.value=s[0],this.#at.value=s[1],this.reflect(()=>{this.setAttribute("value",JSON.stringify(t))})}focus(t){this.#it.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this.#M.innerText="");this.internals.setValidity({customError:!0}," "),this.#M.innerText=t}}class it extends e{static observed=["value:json"];static slots=!0;static template='\n <div class="form-label" data-tpl-if="label">\n <label>{{{{ label }}}}</label>\n {{{{ slots.info }}}}\n </div>\n <div class="input-group">\n <button data-ref="operator" class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" value="CONTAINS" form="">&mldr;a&mldr;</button>\n <ul class="dropdown-menu">\n <li><a class="dropdown-item" role="button" value="CONTAINS">&mldr;a&mldr;</a></li>\n <li><a class="dropdown-item" role="button" value="STARTS_WITH">a&mldr;</a></li>\n <li><a class="dropdown-item" role="button" value="ENDS_WITH">&mldr;a</a></li>\n <li><a class="dropdown-item" role="button" value="EQ">=</a></li>\n </ul>\n <input data-ref="value" type="text" class="form-control" form="">\n <span class="input-group-text"><i class="bi bi-search"></i></span>\n </div>\n <ful-field-error></ful-field-error>\n ';static formAssociated=!0;#rt;#nt;#M;constructor(){super(),this.internals=this.attachInternals()}render({slots:t}){const e=0===r.toHtml(t.default.cloneNode(!0)).trim().length?null:t.default,s=this.getAttribute("name"),i=this.template().withOverlay({label:e,name:s}).render(this);this.#rt=i.querySelector("[data-ref=operator]"),this.#nt=i.querySelector("[data-ref=value]"),this.#M=i.querySelector("ful-field-error");const a=i.querySelector("label");a?.addEventListener("click",()=>this.focus()),this.#nt.ariaDescribedByElements=[this.#M],this.#nt.ariaLabelledByElements=a?[a]:[],this.replaceChildren(i),this.addEventListener("click",t=>{const e=t.target;if(!e.matches("ul > li > a"))return;const s=e.closest("ul")?.previousElementSibling,r=e.getAttribute("value");s.setAttribute("value",r),s.innerHTML=e.innerHTML})}get value(){const t=this.#rt.getAttribute("value");return""===this.#nt.value?void 0:[t,"IGNORE_CASE",this.#nt.value]}set value(t){if(null==t)return this.#nt.value="",void this.reflect(()=>{this.removeAttribute("value")});const[e,s,r]=t;this.#rt.setAttribute("value",e),this.#nt.value=r,this.reflect(()=>{this.setAttribute("value",JSON.stringify(t))})}focus(t){this.#nt.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this.#M.innerText="");this.internals.setValidity({customError:!0}," "),this.#M.innerText=t}}class at{configure(t){const e=b.builder().withCsrfToken().withRedirectOnUnauthorized("/").build();t.defineComponent("http-client",e).defineElement("ful-spinner",K).defineElement("ful-form",N).defineElement("ful-checkbox",W).defineElement("ful-input",D).defineElement("ful-local-date",M).defineElement("ful-instant",P).defineElement("ful-input-local-date",B).defineElement("ful-input-local-time",$).defineElement("ful-input-instant",U).defineElement("ful-radio-group",G).defineElement("ful-table",et).defineElement("ful-pagination",Q).defineElement("ful-sorter",Y).defineElement("ful-filter-instant",st).defineElement("ful-filter-local-date",rt).defineElement("ful-filter-text",it).defineElement("ful-select",J).defineElement("ful-dropdown",z).defineComponent("loaders:select",j).defineComponent("loaders:form",I).defineComponent("loaders:table",tt)}}export{q as AsyncEvents,x as AuthorizationCodeFlow,k as AuthorizationCodeFlowInterceptor,S as AuthorizationCodeFlowSession,n as Base64,C as Bindings,W as Checkbox,z as Dropdown,o as Failure,N as Form,I as FormLoader,l as Hex,b as HttpClient,c as HttpClientError,D as Input,U as InputInstant,B as InputLocalDate,$ as InputLocalTime,P as Instant,st as InstantFilter,_ as Loaders,M as LocalDate,rt as LocalDateFilter,w as LocalStorage,u as MediaType,Q as Pagination,at as Plugin,G as RadioGroup,J as Select,j as SelectLoader,E as SessionStorage,Y as SortButton,K as Spinner,et as Table,X as TableSchemaParser,it as TextFilter,L as Timing,A as VersionedLocalStorage,T as VersionedSessionStorage};
1
+ import{registry as t,ParsedElement as e,Attributes as s,Fragments as r,Nodes as i,Rendering as a}from"@optionfactory/ftl";class n{static encode(t,e){const s=e||n.URL_SAFE,r=t.byteLength,i=new Uint8Array(t);let a="";for(let t=0;t<r;t+=3){a+=s[i[t]>>2]+s[(3&i[t])<<4|i[t+1]>>4]+s[(15&i[t+1])<<2|i[t+2]>>6]+s[63&i[t+2]]}return r%3==2?a=a.substring(0,a.length-1):r%3==1&&(a=a.substring(0,a.length-2)),a}static decode(t,e){const s=e||n.URL_SAFE;let r=Math.floor(.75*t.length);for(let e=0;e!==t.length&&"="===t[t.length-e-1];++e)--r;const i=new Uint8Array(r);let a=0,l=0;for(;a<.75*t.length;){const e=s.indexOf(t.charAt(l++)),r=s.indexOf(t.charAt(l++)),n=s.indexOf(t.charAt(l++)),o=s.indexOf(t.charAt(l++));i[a++]=e<<2|r>>4,i[a++]=(15&r)<<4|n>>2,i[a++]=(3&n)<<6|o}return i.buffer}}n.STANDARD="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n.URL_SAFE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";class l{static decode(t){if(t.length%2!=0)throw new Error("invalid length");const e=t.length/2;return new Uint8Array(e).map((e,s)=>{const r=2*s,i=t.substring(r,r+2);return parseInt(i,16)})}static encode(t,e){return Array.from(t).map(t=>t.toString(16)).map(t=>e?t.toUpperCase():t).map(t=>t.padStart(2,0)).join("")}}class o extends Error{constructor(t,e,s){super(t,{cause:s}),this.name="Failure",this.problems=e}dropping(t){return new o(this.message,o.dropProblemsContext(this.problems,t),this)}static dropProblemsContext(t,e){return t.map(({type:t,context:s,reason:r,details:i})=>({type:t,context:s?.startsWith(e)?s.substring(e.length):s,reason:r,details:i}))}}class c{#t;#e;constructor(t,e){this.#t=t,this.#e=e}get normalized(){return`${this.#t}/${this.#e}`}get type(){return this.#t}get subtype(){return this.#e}static parse(t){if(!t)return new c("unknown","unknown");const[e,s]=t.split(";"),[r,i]=e.trim().split("/");return new c(r.toLowerCase(),i?.toLowerCase())}}class u extends o{constructor(t,e,s,r){super(t,s,r),this.name="HttpClientError",this.status=e}dropping(t){return new u(this.message,this.status,o.dropProblemsContext(this.problems,t),this)}static of(t,e){return new u(e.message,0,[{type:t,context:null,reason:e.message,details:null}],e)}static async fromResponse(t){switch(c.parse(t.headers.get("Content-Type")).normalized){case"application/failures+json":{const e=await t.json(),s=`${t.status} ${t.statusText}: ${e.length} failures`;return new u(s,t.status,e)}case"application/problem+json":{const e=await t.json(),s=`${t.status} ${t.statusText}: ${e.title} ${e.detail}`;return new u(s,t.status,e.problems||[{type:"GENERIC_PROBLEM",context:null,reason:s,details:null}])}default:{const e=await t.text(),s=`${t.status} ${t.statusText}: ${e}`;return new u(s,t.status,[{type:"GENERIC_PROBLEM",context:null,reason:s,details:null}])}}}}class d{#s;#r;constructor(){this.#s=document.querySelector("meta[name='_csrf_header']")?.getAttribute("content"),this.#r=document.querySelector("meta[name='_csrf']")?.getAttribute("content")}async intercept(t,e,s){return this.#s&&this.#r&&e.headers.set(this.#s,this.#r),await s.proceed(t,e)}}class h{#i;constructor(t){this.#i=t}async intercept(t,e,s){const r=await s.proceed(t,e);return 401===r.status&&(window.location.href=this.#i),r}}class p{#a;constructor(){this.#a=[]}withCsrfToken(){return this.#a.push(new d),this}withRedirectOnUnauthorized(t){return this.#a.push(new h(t)),this}withInterceptors(...t){return this.#a.push(...t),this}build(){return new b(this.#a)}}class f{async intercept(t,e,s){return await fetch(new Request(t,e))}}class m{#a;#n;constructor(t,e){this.#a=t,this.#n=e}async proceed(t,e){const s=this.#a[this.#n];return await s.intercept(t,e,new m(this.#a,this.#n+1))}}class b{#a;static builder(){return new p}constructor(t){this.#a=t||[]}async exchange(t,e,s){const r=[...this.#a,...s||[],new f],i=new m(r,0),a=new URL(new Request(t).url);return await i.proceed(a,e??{})}request(t,e){return g.create(this,t,e)}get(t){return g.create(this,"GET",t)}head(t){return g.create(this,"HEAD",t)}post(t){return g.create(this,"POST",t)}put(t){return g.create(this,"PUT",t)}patch(t){return g.create(this,"PATCH",t)}delete(t){return g.create(this,"DELETE",t)}}const v=async(t,e)=>{try{return await t[e]()}catch(t){throw u.of("UNMARSHALING_PROBLEM",t)}};class g{#l;#o;#c;#u;#d;#h;#p;#a;static create(t,e,s){return new g(t,e,s,new URLSearchParams,new Headers,void 0,{},[])}constructor(t,e,s,r,i,a,n,l){this.#l=t,this.#o=e,this.#c=s,this.#u=r,this.#h=a,this.#d=i,this.#p=n,this.#a=l}headers(t){for(const[e,s]of new Headers(t).entries())null==s?this.#d.delete(e):this.#d.set(e,s);return this}header(t,e){return null==e?this.#d.delete(t):this.#d.set(t,e),this}params(t){for(const[e,s]of new URLSearchParams(t).entries())null==s?this.#u.delete(e):this.#u.set(e,s);return this}param(t,...e){if(0===e.length||null===e[0]||void 0===e[0])return this.#u.delete(t),this;for(const s of e)this.#u.append(t,s);return this}body(t){return this.#h=t,this}json(t){return this.#d.set("Content-Type","application/json"),this.#h=JSON.stringify(t),this}multipart(t){const e=new FormData;return t(new y(e)),this.#h=e,this}options(t){for(const[e,s]of Object.entries(t))this.#p[e]=s;return this}option(t,e){return this.#p[t]=e,this}interceptors(t){for(const e of t)this.#a.push(e);return this}interceptor(t){return this.#a.push(t),this}async exchange(){const t=this.#u.size?`${this.#c}?${this.#u}`:this.#c,e={...this.#p,headers:this.#d,method:this.#o,body:this.#h};return await this.#l.exchange(t,e,this.#a)}async fetch(){const t=this.#u.size?`${this.#c}?${this.#u}`:this.#c,e={...this.#p,headers:this.#d,method:this.#o,body:this.#h};try{const s=await this.#l.exchange(t,e,this.#a);if(!s.ok)throw await u.fromResponse(s);return s}catch(t){if(t instanceof o)throw t;throw u.of("CONNECTION_PROBLEM",t)}}async fetchText(){const t=await this.fetch();return await v(t,"text")}async fetchJson(){const t=await this.fetch();return await v(t,"json")}async fetchBlob(){const t=await this.fetch();return await v(t,"blob")}async fetchArrayBuffer(){const t=await this.fetch();return await v(t,"arrayBuffer")}}class y{#f;constructor(t){this.#f=t}field(t,e){return this.#f.append(t,e),this}blob(t,e,s){return this.#f.append(t,e,s),this}blobs(t,e){for(let s of e)this.#f.append(t,s);return this}json(t,e,s){const r=new Blob([JSON.stringify(e)],{type:"application/json"});return this.#f.append(t,r,s),this}}class w extends Storage{static save(t,e){localStorage.setItem(t,JSON.stringify(e))}static load(t){const e=localStorage.getItem(t);return null===e?void 0:JSON.parse(e)}static remove(t){localStorage.removeItem(t)}static pop(t){const e=w.load(t);return w.remove(t),e}}class E extends Storage{static save(t,e){sessionStorage.setItem(t,JSON.stringify(e))}static load(t){const e=sessionStorage.getItem(t);return null===e?void 0:JSON.parse(e)}static remove(t){sessionStorage.removeItem(t)}static pop(t){const e=E.load(t);return E.remove(t),e}}class A{static save(t,e,s){w.save(t,{revision:e,data:s})}static load(t,e){const s=w.load(t);if(void 0!==s){if(s.revision===e)return s.data;localStorage.removeItem(t)}}}class T{static save(t,e,s){E.save(t,{revision:e,data:s})}static load(t,e){const s=E.load(t);if(void 0!==s){if(s.revision===e)return s.data;localStorage.removeItem(t)}}}class x{static forKeycloak(t,e,s,r){return new x(t,r??"openid profile",{auth:new URL("protocol/openid-connect/auth",e),token:new URL("protocol/openid-connect/token",e),logout:new URL("protocol/openid-connect/logout",e),registration:new URL("protocol/openid-connect/registrations",e),redirect:s})}constructor(t,e,{auth:s,token:r,registration:i,logout:a,redirect:n}){this.clientId=t,this.scope=e,this.uri={auth:s,token:r,registration:i,logout:a,redirect:n}}async action(t,e){const s=n.encode(crypto.getRandomValues(new Uint8Array(32)).buffer),r=n.encode(await crypto.subtle.digest("SHA-256",(new TextEncoder).encode(s))),i=this.clientId+n.encode(crypto.getRandomValues(new Uint8Array(16)).buffer);E.save(`${x.PKCE_AND_STATE_KEY}-${this.clientId}`,{state:i,verifier:s});const a=new URL(t);a.searchParams.set("client_id",this.clientId),a.searchParams.set("redirect_uri",this.uri.redirect),a.searchParams.set("response_type","code"),a.searchParams.set("scope",this.scope),a.searchParams.set("state",i),a.searchParams.set("code_challenge",r),a.searchParams.set("code_challenge_method","S256"),Object.entries(e||{}).forEach(t=>{a.searchParams.set(t[0],t[1])}),window.location.href=a.toString()}async registration(t){await this.action(this.uri.registration,t)}async applicationInitiatedAction(t,e){await this.action(this.uri.auth,{...e,kc_action:t})}async#m(t,e){window.history.replaceState("","",this.uri.redirect);const s=E.pop(`${x.PKCE_AND_STATE_KEY}-${this.clientId}`);if(s.state!==e)throw new Error("State mismatch");const r=await fetch(this.uri.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams([["client_id",this.clientId],["code",t],["grant_type","authorization_code"],["code_verifier",s.verifier],["state",s.state],["redirect_uri",this.uri.redirect]])});if(!r.ok){const t=await r.text();throw new Error("Error:"+r.status+": "+t)}const i=await r.json();return new S(this.clientId,i,this.uri)}async ensureLoggedIn(){const t=new URL(window.location.href),e=t.searchParams.get("code");if(e&&E.load(`${x.PKCE_AND_STATE_KEY}-${this.clientId}`)){const s=t.searchParams.get("state");return await this.#m(e,s)}return await this.action(this.uri.auth,{}),null}}x.PKCE_AND_STATE_KEY="state-and-verifier";class S{static parseToken(t){const[e,s,r]=t.split("."),i=new TextDecoder("utf-8");return{header:JSON.parse(i.decode(n.decode(e,n.STANDARD))),payload:JSON.parse(i.decode(n.decode(s,n.STANDARD))),signature:r}}constructor(t,e,{token:s,logout:r,redirect:i}){this.clientId=t,this.token=e,this.idToken=S.parseToken(e.id_token),this.accessToken=S.parseToken(e.access_token),this.refreshToken=S.parseToken(e.refresh_token),this.uri={token:s,logout:r,redirect:i},this.refreshCallback=null}onRefresh(t){this.refreshCallback=t}async refresh(){const t=await fetch(this.uri.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams([["client_id",this.clientId],["grant_type","refresh_token"],["refresh_token",this.token.refresh_token]])});if(!t.ok){const e=await t.text();throw new Error("Error:"+t.status+": "+e)}const e=await t.json();this.token=e,this.idToken=S.parseToken(e.id_token),this.accessToken=S.parseToken(e.access_token),this.refreshToken=S.parseToken(e.refresh_token),this.refreshCallback&&this.refreshCallback(this.token,this.accessToken,this.refreshToken)}shouldBeRefreshed(t){const e=(new Date).getTime(),s=1e3*this.refreshToken.payload.exp;return!(e>s)&&e-t>s}async refreshIf(t){this.shouldBeRefreshed(t)&&await this.refresh()}logout(){const t=new URL(this.uri.logout);t.searchParams.set("post_logout_redirect_uri",this.uri.redirect),t.searchParams.set("id_token_hint",this.token.id_token),window.location.href=t.toString()}bearerToken(){return`Bearer ${this.token.access_token}`}interceptor(t,e){return new k(this,t,e)}}class k{#b;#v;#g;constructor(t,e,s){this.#b=t,this.#v=e||2e3,this.#g=s||3e4}async intercept(t,e,s){await this.#b.refreshIf(this.#v),e.headers.set("Authorization",this.#b.bearerToken());const r=await s.proceed(t,e);return await this.#b.refreshIf(this.#g),r}}class q{static async fireAsync(t,e){return t.dispatchEvent(e),await(e.async?.promise)}static asyncOn(t,e,s,r){const i=async t=>{let e,r;const i=new Promise((t,s)=>{e=t,r=s});t.async={promise:i};try{e(await s(t))}catch(t){r(t)}};return t.addEventListener(e,i,r),i}static asyncOff(t,e,s,r){t.removeEventListener(e,s,r)}static mixInto(...t){for(const e of t)Object.assign(e.prototype,{async fireAsync(t){return await q.fireAsync(this,t)},asyncOn(t,e,s){return q.asyncOn(this,t,e,s)},asyncOff(t,e,s){return q.asyncOff(this,t,e,s)}})}}class L{static sleep(t){return new Promise(e=>setTimeout(e,t))}static DEBOUNCE_DEFAULT=0;static DEBOUNCE_IMMEDIATE=1;static debounce(t,e,s){const r=s??L.DEBOUNCE_DEFAULT;let i=null,a=[],n=0;const l=()=>{const s=(new Date).getTime()-n;t>s?i=setTimeout(l,t-s):(i=null,r!==L.DEBOUNCE_IMMEDIATE&&e(...a),null===i&&(a=[]))};return[function(){a=[...arguments],n=(new Date).getTime(),null===i&&(i=setTimeout(l,t),r===L.DEBOUNCE_IMMEDIATE&&e(...a))},()=>clearTimeout(i)]}static THROTTLE_DEFAULT=0;static THROTTLE_NO_LEADING=1;static THROTTLE_NO_TRAILING=2;static throttle(t,e,s){const r=s??L.THROTTLE_DEFAULT;let i=null,a=[],n=0;const l=()=>{n=r&L.THROTTLE_NO_LEADING?0:(new Date).getTime(),i=null,e(...a),null===i&&(a=[])};return[function(){const s=(new Date).getTime();!n&&r&L.THROTTLE_NO_LEADING&&(n=s);const o=t-(s-n);a=[...arguments],o<=0||o>t?(null!==i&&(clearTimeout(i),i=null),n=s,e(...a),null===i&&(a=[])):null!==i||r&L.THROTTLE_NO_TRAILING||(i=setTimeout(l,o))},()=>clearTimeout(i)]}}class _{static fromAttributes(e,s,r){const i=t.component("http-client"),a=e.hasAttribute("request-mapper")?t.component(e.getAttribute("request-mapper")):t=>t,n=e.hasAttribute("response-mapper")?t.component(e.getAttribute("response-mapper")):t=>t;return t.component(e.getAttribute("loader")??s).create({el:e,http:i,requestMapper:a,responseMapper:n,options:r??{}})}}class C{static flatten(t,e,s){return Object.keys(t).reduce((r,i)=>{const a=e.length?e+"."+i:i;return s.has(a)||"object"!=typeof t[i]||null===t[i]?r[a]=t[i]:Object.assign(r,C.flatten(t[i],a,s)),r},{})}static providePath(t,e,s){const r=e.split(".").map(t=>/^[0-9]+$/.test(t)?+t:t);let i=t??{},a=null;for(let e=0;;++e){const n=r[e],l=r[e-1];if(Number.isInteger(n)&&!Array.isArray(i)&&(null!==a?a[l]=i=[]:t=i=[]),e===r.length-1)return i[n]=void 0!==s?s:n in i?i[n]:null,t;void 0===i[n]&&(i[n]={}),a=i,i=i[n]}}static extract(t){if("radio"===t.getAttribute("type")){if(!t.checked)return;return"boolean"===t.dataset.fulBindType?"true"===t.value:t.value}return"checkbox"===t.getAttribute("type")?t.checked:"boolean"===t.dataset.fulBindType?t.value?"true"===t.value:null:!("INPUT"!==t.tagName&&"SELECT"!==t.tagName||""!==t.value&&void 0!==t.value)?null:t.value}static extractFrom(t){let e={};for(const s of t.elements)s.hasAttribute("name")&&!s.matches(":disabled")&&(e=C.providePath(e,s.getAttribute("name"),C.extract(s)));return e}static mutate(t,e){"radio"!==t.getAttribute("type")?"checkbox"!==t.getAttribute("type")?t.value=e:t.checked=e:t.checked=t.getAttribute("value")===e}static mutateIn(t,e){const s=Array.from(t.elements).map(t=>t.getAttribute("name")).filter(t=>t);for(const[r,i]of Object.entries(C.flatten(e,"",new Set(s))))for(const e of t.querySelectorAll(`[name='${CSS.escape(r)}']`))C.mutate(e,i)}static errors(t,e,s){const r=e.filter(t=>"FIELD_ERROR"===t.type||"INVALID_FORMAT"===t.type),i=e.filter(t=>"FIELD_ERROR"!==t.type&&"INVALID_FORMAT"!==t.type);t.querySelectorAll("[name]").forEach(t=>t.setCustomValidity?.("")),t.querySelectorAll("ful-errors").forEach(t=>{t.replaceChildren(),t.setAttribute("hidden","")}),r.forEach(e=>{const s=e.context.replace("[",".").replace("].",".").replace("]","").split(".");for(let r=s.length;0!=r;--r){const i=s.slice(0,r).join("."),a=s.slice(r,s.length).join(".");t.querySelectorAll(`[name='${CSS.escape(i)}']`).forEach(t=>t.setCustomValidity?.(e.reason,a))}}),t.querySelectorAll("ful-errors").forEach(t=>{t.innerText=i.map(t=>t.reason).join("\n"),0!==i.length&&t.removeAttribute("hidden")}),0!=e.length&&s&&Array.from(t.querySelectorAll(":invalid")).sort((t,e)=>t.getBoundingClientRect().y-e.getBoundingClientRect().y)[0]?.focus()}}class O{#y;#w;#o;#E;#A;constructor(t,e,s,r,i){this.#y=t,this.#w=e,this.#o=s,this.#E=r,this.#A=i}prepare(t,e){return this.#E(t,e)}async submit(t,e){return await this.#y.request(this.#o,this.#w).json(t).fetch()}transform(t,e){return this.#A(t,e)}}class R{#E;#A;constructor(t,e){this.#E=t,this.#A=e}async prepare(t,e){return await this.#E(t,e)}async submit(t,e,s){return s}async transform(t,e){return await this.#A(t,e)}}class I{static create({el:t,http:e,requestMapper:s,responseMapper:r}){const i=t.getAttribute("action");if(!i)return new R(s,r);const a=t.getAttribute("method")??"POST";return new O(e,i,a,s,r)}}class N extends e{form;render(){const t=this.form=document.createElement("form");t.setAttribute("novalidate",""),s.forward("form-",this,t),t.replaceChildren(...this.childNodes),t.addEventListener("submit",async t=>{t.preventDefault(),t.stopPropagation(),await this.submit()}),this.hasAttribute("clear-invalid-on-change")&&this.addEventListener("change",t=>{t.target.setCustomValidity?.("")}),this.replaceChildren(t)}async submit(){this.spinner(!0);try{const t=_.fromAttributes(this,"loaders:form"),e=this.values;let s=await t.prepare(e,this);try{const r=new CustomEvent("submit",{bubbles:!0,cancelable:!0,detail:{values:e,request:s}});if(!this.dispatchEvent(r))return;const i=new CustomEvent("submit:requested",{bubbles:!0,cancelable:!1,detail:{values:r.detail.values,request:r.detail.request}});let a=await q.fireAsync(this,i);s=i.detail.request,a=await t.submit(s,this,a);const n=await t.transform(a,this);this.dispatchEvent(new CustomEvent("submit:success",{bubbles:!0,cancelable:!1,detail:{values:e,request:s,response:n}}))}catch(t){this.dispatchEvent(new CustomEvent("submit:failure",{bubbles:!0,cancelable:!1,detail:{values:e,request:s,exception:t}})),t instanceof o&&(this.errors=t.problems),console.warn("failed to submit form",this,"reason:",t)}}finally{this.spinner(!1)}}reset(){this.form.reset()}spinner(t){this.querySelectorAll("ful-spinner").forEach(e=>{e.hidden=!t}),this.querySelectorAll("[type=submit],[type=reset]").forEach(e=>{e.disabled=t})}set values(t){C.mutateIn(this.form,t)}get values(){return C.extractFrom(this.form)}set errors(t){C.errors(this.form,t,this.hasAttribute("scroll-on-error"))}}class D extends e{static observed=["value","readonly:presence"];static slots=!0;static template='\n <div class="form-label">\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n </div>\n <div class="input-group">\n <span data-tpl-if="slots.ibefore" class="input-group-text">{{{{ slots.ibefore }}}}</span>\n {{{{ slots.before }}}}\n <input data-tpl-if="type != \'textarea\'" class="form-control" data-tpl-type="type" placeholder=" " form="">\n <textarea data-tpl-if="type == \'textarea\'" class="form-control" placeholder=" " form=""></textarea>\n {{{{ slots.after }}}}\n <span data-tpl-if="slots.iafter" class="input-group-text">{{{{ slots.iafter }}}}</span>\n </div>\n <ful-field-error></ful-field-error>\n ';static formAssociated=!0;_input;_fieldError;constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}_type(){return this.getAttribute("type")??"text"}_fragment(t,e){return this.template().withOverlay({type:t,slots:e}).render()}render({slots:t,observed:e,disabled:r}){const i=this._type(),a=this._fragment(i,t);this._input=a.querySelector("input,textarea"),s.forward("input-",this,this._input),this.disabled=r,this.readonly=e.readonly,this.value=e.value,this._input.addEventListener("change",t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))});const n=a.querySelector("label");n.addEventListener("click",()=>this.focus()),this._fieldError=a.querySelector("ful-field-error"),this._input.ariaDescribedByElements=[this._fieldError],this._input.ariaLabelledByElements=[n],this.replaceChildren(a)}get value(){return""===this._input.value?null:this._input.value}set value(t){this._input.value=""===t?null:t}get readonly(){return this._input.readOnly}set readonly(t){this._input.readOnly=t,this.reflect(()=>{s.toggle(this,"readonly",t)})}get disabled(){return this._input.hasAttribute("disabled")}set disabled(t){s.toggle(this._input,"disabled",t)}focus(t){this._input.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this._fieldError.innerText="");this.internals.setValidity({customError:!0}," "),this._fieldError.innerText=t}formResetCallback(){this.value=this.getAttribute("value")}}class M extends e{render(){const t=this.innerHTML.trim();if(""===t)return void(this.innerHTML=this.getAttribute("default")??"");const e=this.getAttribute("locale")??Intl.DateTimeFormat().resolvedOptions().locale,s=new Intl.DateTimeFormat(e,{year:"numeric",month:"numeric",day:"numeric"}),[r,i,a]=t.split("-").map(Number);this.innerHTML=s.format(new Date(r,i-1,a))}}class P extends e{render(){const t=this.innerHTML.trim();if(""===t)return void(this.innerHTML=this.getAttribute("default")??"");const e=this.getAttribute("locale")??Intl.DateTimeFormat().resolvedOptions().locale,s=new Intl.DateTimeFormat(e,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1});this.innerHTML=s.format(new Date(P.isoToLocal(t)))}static isoToLocal(t){const e=new Date(t),s=(t,e)=>String(e).padStart(t,"0");return`${`${e.getFullYear()}-${s(2,e.getMonth()+1)}-${s(2,e.getDate())}`}T${`${s(2,e.getHours())}:${s(2,e.getMinutes())}:${s(2,e.getSeconds())}.${s(3,e.getMilliseconds())}`}`}}class B extends D{static observed=["value","readonly:presence","min","max","step"];_type(){return"date"}render(t){const{observed:e}=t;super.render(t),this.min=e.min,this.max=e.max,this.step=e.step}get min(){const t=this._input.min;return""===t?null:t}set min(t){this._input.min=B.#T(t)}get max(){const t=this._input.max;return""===t?null:t}set max(t){this._input.max=B.#T(t)}get step(){const t=this._input.step;return""===t?null:t}set step(t){this._input.step=t??""}static#T(t){if(!t)return"";if("now"===t)return(new Date).toISOString().split("T")[0];const e=/^([+-])(\d+)([dmy])$/.exec(t);if(!e)return t;const s="-"===e[1]?-1:1,r=+e[2],i=new Date;switch(e[3]){case"d":i.setDate(i.getDate()+r*s);break;case"m":i.setMonth(i.getMonth()+r*s);break;case"y":i.setFullYear(i.getFullYear()+r*s)}return i.toISOString().split("T")[0]}}class $ extends B{_type(){return"time"}}class U extends D{static observed=["value","readonly:presence","min","max","step"];_type(){return"datetime-local"}render(t){const{observed:e}=t;super.render(t),this.min=e.min,this.max=e.min,this.step=e.min}get value(){const t=this._input.value;return""===t?null:new Date(t).toISOString()}set value(t){this._input.value=t?P.isoToLocal(t):""}get min(){const t=this._input.min;return""===t?null:new Date(t).toISOString()}set min(t){this._input.min=t?P.isoToLocal(t):""}get max(){const t=this._input.max;return""===t?null:new Date(t).toISOString()}set max(t){this._input.max=t?P.isoToLocal(t):""}get step(){const t=this._input.step;return""===t?null:t}set step(t){this._input.step=t??""}}class H{#y;#w;#o;#A;#x;#S;#k;static create({el:t,http:e,responseMapper:s}){return new H({http:e,url:t.getAttribute("src"),method:t.getAttribute("method")??"POST",responseMapper:s,prefetch:t.hasAttribute("preload"),revision:t.getAttribute("revision")})}constructor({http:t,url:e,method:s,responseMapper:r,prefetch:i,revision:a}){this.#y=t,this.#w=e,this.#o=s,this.#A=r,this.#x=i,this.#S=a,this.#k=null}async prefetch(){this.#x&&await this.#q()}async exact(...t){return await this.#q(),this.#k.filter(([e,s])=>t.some(t=>t==e))}async load(t){return await this.#q(),this.#k.filter(([e,s])=>(s??"").toLowerCase().includes(t?.toLowerCase()))}async#q(){if(null!==this.#k)return;const t=`${this.#o}@${this.#w}`;if(null!==this.#S){const e=A.load(t,this.#S);if(void 0!==e)return void(this.#k=e)}const e=await this.#y.request(this.#o,this.#w).fetchJson();this.#k=this.#A(e),null!==this.#S&&A.save(t,this.#S,this.#k)}}class F{#y;#w;#o;#A;static create({el:t,http:e,responseMapper:s}){return new F({http:e,url:t.getAttribute("src"),method:t.getAttribute("method")??"POST",responseMapper:s})}constructor({http:t,url:e,method:s,responseMapper:r}){this.#y=t,this.#w=e,this.#o=s,this.#A=r}async exact(...t){const e=await this.#y.request(this.#o,this.#w).param("k",...t).fetchJson();return this.#A(e)}async load(t){const e=await this.#y.request(this.#o,this.#w).param("s",t).fetchJson();return this.#A(e)}}class V{#k;constructor(t){this.#k=t}update(t){this.#k=t}exact(...t){return this.#k.filter(([e,s])=>t.some(t=>t==e))}load(t){return this.#k.filter(([e,s])=>(s??"").toLowerCase().includes(t?.toLowerCase()))}}class j{static create(t){if(!t.el.hasAttribute("src")){const e=Array.from(t.options.options?.querySelectorAll("option")??[]).map(t=>[t.getAttribute("value")??t.innerText.trim(),t.innerText.trim()]);return new V(e)}return"chunked"==t.el.getAttribute("mode")?F.create(t):H.create(t)}}class z extends e{static slots=!0;static template='\n <ful-spinner class="centered" hidden></ful-spinner>\n <menu tabindex="-1" hidden></menu>\n ';#L;#_;#p=new Map;render({slots:t}){const e=this.template().render();this.#L=e.querySelector("ful-spinner"),this.#_=e.querySelector("menu"),this.#_.addEventListener("click",t=>{t.stopPropagation(),t.target.matches("li")?this.#C(t.target):this.hide()}),this.replaceChildren(e)}acceptSelection(){const t=this.#_.querySelector("[selected]")??this.#_.firstElementChild;this.#C(t)}update(t){if(void 0===t)throw new Error("null data");if(this.#p=new Map(t.map((t,e)=>[String(e),t])),0===t.length){const t=document.createElement("div");return t.classList.add("text-center","py-2","bi","bi-database-slash"),void this.#_.replaceChildren(t)}this.#_.replaceChildren(...t.map(([t,e,s],r)=>{const i=document.createElement("li");return 0===r&&i.setAttribute("selected",""),i.setAttribute("value",r),i.innerText=e,i}))}#C(t){const e=t.getAttribute("value"),s=this.#p.get(e);this.hide(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{index:e,data:s}}))}hide(){this.setAttribute("hidden","")}get shown(){return!this.hasAttribute("hidden")}async show(t){this.removeAttribute("hidden"),this.#_.setAttribute("hidden",""),this.#L.removeAttribute("hidden");try{const e=await t();this.update(e)}finally{this.#L.setAttribute("hidden",""),this.#_.removeAttribute("hidden")}}async moveOrShow(t,e){if(this.shown){const e=this.#_.querySelector("[selected]")??this.#_.firstElementChild,s=e[(t?"next":"previous")+"ElementSibling"];return void(s&&(e.removeAttribute("selected"),s.setAttribute("selected",""),s.scrollIntoView({block:"nearest",behavior:"smooth"})))}await this.show(e)}}class J extends e{static observed=["value:csvm","readonly:presence"];static slots=!0;static template='\n <div class="form-label">\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n </div>\n <div class="input-group flex-nowrap" tabindex="-1">\n <span data-tpl-if="slots.ibefore" class="input-group-text">{{{{ slots.ibefore }}}}</span>\n {{{{ slots.before }}}}\n <div class="ful-select-input-container">\n <div class="ful-select-input">\n <badges></badges>\n <input type="text" form="">\n </div>\n <ful-dropdown hidden popover="manual"></ful-dropdown>\n </div>\n {{{{ slots.after }}}}\n <span data-tpl-if="slots.iafter" class="input-group-text">{{{{ slots.iafter }}}}</span>\n </div>\n <ful-field-error></ful-field-error>\n ';static mappers={csvm:(t,e,s)=>s.hasAttribute("multiple")?null===t?[]:t.split(",").map(t=>t.trim()).filter(t=>t):null===t||""===t?null:t};static formAssociated=!0;internals;#O;#R;#I;#N;#D;#M;#P=new Map;constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}async render({slots:t,observed:e,disabled:r}){const i=this.getAttribute("name");this.#O=_.fromAttributes(this,"loaders:select",{options:t.options}),this.#D=this.hasAttribute("multiple"),await(this.#O.prefetch?.());const a=this.template().withOverlay({slots:t,name:i}).render();this.#N=a.querySelector("input"),s.forward("input-",this,this.#N),this.#R=a.querySelector("badges"),this.value=e.value,this.disabled=r,this.readonly=e.readonly,this.#I=a.querySelector("ful-dropdown");const n=a.querySelector("label");n.addEventListener("click",()=>this.focus()),this.#M=a.querySelector("ful-field-error"),this.#N.ariaDescribedByElements=[this.#M],this.#N.ariaLabelledByElements=[n];const l=this,[o,c]=L.throttle(400,()=>l.#I.show(()=>l.#O.load(l.#N.value)));this.addEventListener("click",t=>{t.target.matches("input")||this.disabled||this.readonly||(this.#I.shown?this.#I.hide():(this.#N.focus(),o()))}),this.#R.addEventListener("click",t=>{if(t.stopPropagation(),this.disabled||this.readonly)return;-1!==[...this.#R.children].indexOf(t.target)&&(this.#P.delete(Array.from(this.#P.keys()).pop()),this.#B(),this.#$())}),this.#N.addEventListener("blur",t=>{t.stopPropagation(),t.relatedTarget&&this.contains(t.relatedTarget)||(c(),this.#I.hide(),this.#N.value="")}),this.#N.addEventListener("keydown",t=>{if(t.stopPropagation(),!this.disabled&&!this.readonly)switch(t.code){case"ArrowUp":this.#I.moveOrShow(!1,()=>l.#O.load(l.#N.value));break;case"ArrowDown":this.#I.moveOrShow(!0,()=>l.#O.load(l.#N.value));break;case"Escape":this.#I.hide();break;case"Enter":this.#I.acceptSelection(),this.#N.value="";break;case"Backspace":this.#P.size&&0===this.#N.selectionStart&&0===this.#N.selectionEnd&&(this.#P.delete(Array.from(this.#P.keys()).pop()),this.#B(),this.#$());break;case"Tab":this.#I.hide(),c()}}),this.#N.addEventListener("input",t=>{t.stopPropagation(),this.disabled||this.readonly||o()}),this.#I.addEventListener("change",t=>{t.stopPropagation(),this.#D||this.#P.clear(),this.#P.set(t.detail.data[0],t.detail.data.slice(1)),this.#B(),this.#$(),this.#N.focus(),this.#I.hide()}),this.replaceChildren(a)}withLoader(t){t(this.#O)}#B(){const t=[...this.#P.entries()].map(t=>({key:t[0],label:t[1][0],metadata:t[1].slice(1)})),e=this.#D?t:t[0]??null;this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:e}}))}#$(){const t=Array.from(this.#P.entries()).map(([t,e])=>{const s=document.createElement("badge");return s.setAttribute("role","button"),s.setAttribute("value",t),s.innerText=e[0],s});this.#R.innerHTML="",this.#R.append(...t)}set value(t){if(null===t)return this.#P=new Map,void this.#$();(async()=>{const e=await(this.#D?this.#O.exact(...t):this.#O.exact(t));this.#P=new Map(e.map(t=>[t[0],t.slice(1)])),this.#$()})()}get value(){return this.#D?[...this.#P.keys()]:[...this.#P.keys()][0]??null}get entry(){return this.#D?[...this.#P.entries()]:[...this.#P.entries()][0]??null}get disabled(){return this.#N.hasAttribute("disabled")}set disabled(t){s.toggle(this.#N,"disabled",t)}get readonly(){return this.#N.readOnly}set readonly(t){this.#N.readOnly=t,this.reflect(()=>{s.toggle(this,"readonly",t)})}focus(t){this.#N.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this.#M.innerText="");this.internals.setValidity({customError:!0}," "),this.#M.innerText=t}}class G extends e{static observed=["value","readonly:presence"];static slots=!0;static template='\n <fieldset>\n <legend class="form-label">\n {{{{ slots.default }}}}\n </legend>\n <header data-tpl-if="slots.header">\n {{{{ slots.header }}}}\n </header>\n <section>\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 </section>\n <ful-field-error></ful-field-error>\n <footer data-tpl-if="slots.footer">\n {{{{ slots.footer }}}}\n </footer>\n </fieldset>\n ';static formAssociated=!0;#U;#M;#H;#F;constructor(){super(),this.internals=this.attachInternals(),this.internals.role="radiogroup"}render({slots:t,observed:e,disabled:i}){const a=this.getAttribute("name")??s.uid("ful-radiogroup"),n=Array.from(t.default.querySelectorAll("ful-radio")),l=n.map(t=>{const e=document.createElement("input");e.setAttribute("type","radio"),s.forward("input-",this,e),s.forward("",t,e),e.setAttribute("name",`${a}-ignore`),e.setAttribute("form",""),e.addEventListener("change",t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))});return[e,r.fromChildNodes(t)]});n.forEach(t=>t.remove()),this.template().withOverlay({name:a,slots:t,inputsAndLabels:l}).renderTo(this),this.#U=this.firstElementChild,this.disabled=i,this.readonly=e.readonly,this.value=e.value,this.#M=this.querySelector("ful-field-error"),this.ariaDescribedByElements=[this.#M],this.#H=this.querySelector("input[type=radio]"),this.#F="boolean"===this.getAttribute("type")}get value(){const t=this.querySelector("input[type=radio]:checked");return t?this.#F?"true"===t.value:t.value:null}set value(t){if(null===t)return void this.querySelectorAll("input[type=radio]").forEach(t=>{t.checked=!1});const e=this.querySelector(`input[type=radio][value=${CSS.escape(String(t))}]`);e&&(e.checked=!0)}get readonly(){return this.#U.inert}set readonly(t){this.#U.inert=t,this.reflect(()=>{s.toggle(this,"readonly",t)})}get disabled(){return this.#U.hasAttribute("disabled")}set disabled(t){s.toggle(this.#U,"disabled",t)}focus(t){this.#H.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this.#M.innerText="");this.internals.setValidity({customError:!0}," "),this.#M.innerText=t}}class W extends e{static observed=["value:bool","readonly:presence"];static slots=!0;static template='\n <div data-tpl-class="klass">\n <div class="input-container">\n <input class="form-check-input" type="checkbox" role="switch" form="" placeholder=" ">\n </div>\n <div class="form-check-label">\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n </div>\n </div>\n <ful-field-error></ful-field-error>\n ';#V;#N;#M;static formAssociated=!0;constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}render({slots:t,observed:e,disabled:r}){const i="switch"==this.getAttribute("type")?"form-check form-switch":"form-check",a=this.template().withOverlay({slots:t,klass:i}).render();this.#V=a.firstElementChild,this.#N=a.querySelector("input"),s.forward("input-",this,this.#N),this.disabled=r,this.readonly=e.readonly,this.value=e.value,this.#N.addEventListener("change",t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))});const n=a.querySelector("label");n.addEventListener("click",()=>{this.focus(),this.disabled||this.readonly||(this.value=!this.value)}),this.#M=a.querySelector("ful-field-error"),this.#N.ariaDescribedByElements=[this.#M],this.#N.ariaLabelledByElements=[n],this.replaceChildren(a)}get value(){return this.#N.checked}set value(t){this.#N.checked=t}get readonly(){return this.#V.inert}set readonly(t){this.#V.inert=t,this.reflect(()=>{s.toggle(this,"readonly",t)})}get disabled(){return this.#N.hasAttribute("disabled")}set disabled(t){s.toggle(this.#N,"disabled",t)}focus(t){this.#N.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this.#M.innerText="");this.internals.setValidity({customError:!0}," "),this.#M.innerText=t}}class K extends e{static slots=!0;static template='\n <div class="ful-spinner-wrapper" role="status">\n <div class="ful-spinner-text">{{{{ slots.default }}}}</div>\n <div class="ful-spinner-icon"></div>\n </div>\n ';render({slots:t}){this.template().withOverlay({slots:t}).renderTo(this)}}class Y extends e{static observed=["order"];#j;render(){const t=this.getAttribute("sorter"),e=["asc","desc",null];this.addEventListener("click",()=>{const s=e[(e.indexOf(this.order)+1)%3];this.dispatchEvent(new CustomEvent("sort-requested",{bubbles:!0,cancelable:!0,detail:{value:{sorter:t,order:s}}}))})}get order(){return this.#j||null}set order(t){this.#j=t||null,this.reflect(()=>{this.#j?this.setAttribute("order",t):this.removeAttribute("order")})}}class Q extends e{static observed=["total:number","current:number"];static l10n={en:{showing:"Page {0} of {1}",navigation:"Page navigation",previous:"Previous",next:"Next"},it:{showing:"Pagina {0} di {1}",navigation:"Navigazione pagine",previous:"Precedente",next:"Successivo"}};static config={prevIcon:"bi bi-chevron-left",nextIcon:"bi bi-chevron-right",reloadIcon:"bi bi-arrow-clockwise"};static template='\n <nav data-tpl-aria-label="#l10n:t(\'navigation\')" class="user-select-none">\n <ul class="pagination">\n <li class="page-item ms-auto me-2 pagination-index"> {{ #l10n:t(\'showing\', curr.label, total) }}</li>\n <li class="page-item reload me-2"><a role="button"><i data-tpl-class="config.reloadIcon"></i></a></li> \n <li class="page-item prev">\n <a data-tpl-class="prev.enabled?\'page-link\':\'page-link disabled\'" data-tpl-aria-label="#l10n:t(\'previous\')" role="button" data-tpl-data-page="prev.index">\n <i aria-hidden="true" data-tpl-class="config.prevIcon"></i>\n </a>\n </li>\n <li class="page-item" data-tpl-each="pages" data-tpl-var="page">\n <a data-tpl-class="curr.index != page.index ? \'page-link\': \'page-link disabled\'" role="button" data-tpl-data-page="page.index" >\n {{ page.label }}\n </a>\n </li>\n <li class="page-item next">\n <a data-tpl-class="next.enabled?\'page-link\':\'page-link disabled\'" data-tpl-aria-label="#l10n:t(\'next\')" role="button" data-tpl-data-page="next.index">\n <i aria-hidden="true" data-tpl-class="config.nextIcon"></i>\n </a>\n </li>\n </ul>\n </nav>\n ';#z=0;#n=0;render({observed:t}){this.update(t.current??0,t.total??0),this.addEventListener("click",t=>{const e=t.target.closest("a");e&&this.dispatchEvent(new CustomEvent("page-requested",{bubbles:!0,cancelable:!0,detail:{value:Number(e.dataset.page??this.#n)}}))})}update(t,e){const s=Number(this.getAttribute("pages")??"5"),r={index:Math.max(0,t-1),enabled:t>0},i={index:t,label:t+1},a={index:Math.min(e,t+1),enabled:t+1<e},n=[{index:t,label:t+1}];for(let r=t,i=1;i!==s&&n.length!=s;++i){const t=r-i;t>=0&&n.unshift({index:t,label:t+1});const s=r+i;s<e&&n.push({index:s,label:s+1})}this.template().withOverlay({total:e,prev:r,curr:i,next:a,pages:n}).renderTo(this)}get total(){return this.#z}set total(t){this.#z=t,this.reflect(()=>{this.setAttribute("total",String(t)),this.update(this.#n??0,this.#z)})}get current(){return this.#n}set current(t){this.#n=t,this.reflect(()=>{this.setAttribute("current",String(t)),this.update(this.#n,this.#z??0)})}}class X{static parse(t,e){const s=i.queryChildren(t,"schema");if(!s)throw new Error(`missing expected <schema> in ${t}`);return i.queryChildrenAll(s,"column").map(t=>({sorter:t.getAttribute("sorter"),order:t.getAttribute("order"),title:X.#J(t,e),content:X.#G(t,e)}))}static#J(t,e){const s=i.queryChildren(t,"title");s&&s.remove();const a=s?e.withFragment(r.fromChildNodes(s)).render():document.createTextNode(t.getAttribute("title")??"");return{classes:t.getAttribute("th-class"),fragment:a}}static#G(t,e){return{classes:t.getAttribute("td-class"),template:e.withFragment(r.fromChildNodes(t))}}}class Z{#y;#w;#o;constructor(t,e,s){this.#y=t,this.#w=e,this.#o=s}async load(t,e,s){const r=Object.entries(s).filter(([t,e])=>e);return await this.#y.request(this.#o,this.#w).param("page",t.page).param("size",t.size).param("sort",e.order?`${e.sorter},${e.order}`:null).param("filters",r.length>0?JSON.stringify(Object.fromEntries(r)):null).fetchJson()}}class tt{static create({el:t,http:e}){const s=t.getAttribute("src"),r=t.getAttribute("method")??"GET";return new Z(e,s,r)}}class et extends e{static slots=!0;static l10n={en:{notloaded:"Start searching to see results.",error:"Error while loading data:",nodata:"No elements found."},it:{notloaded:"Avvia la ricerca per visualizzare i risultati.",error:"Errore nel caricamento dei dati:",nodata:"Nessun elemento trovato."}};static conf={sortIcon:""};static template='\n <ful-form data-tpl-if="slots.filters">\n {{{{ slots.filters }}}}\n </ful-form>\n <div class="table-wrapper">\n <table class="table">\n <caption data-tpl-if="slots.caption">{{{{ slots.caption }}}}</caption>\n <thead>\n <tr>\n <th data-tpl-each="schema" scope="col" data-tpl-class="title.classes">\n {{{{ title.fragment }}}}\n <ful-sorter data-tpl-if="sorter || order" data-tpl-sorter="sorter" data-tpl-order="order"></ful-sorter>\n </th>\n </tr>\n </thead>\n <tbody></tbody>\n <tbody data-ref="no-autoload">\n <tr>\n <td data-tpl-colspan="schema.length" class="text-center align-middle p-4">\n <i class="bi bi-search" style="font-size: 40px; color: #BDC3CA"></i>\n <p class="mt-3 mb-0" style="color: #BDC3CA">\n {{ #l10n:t(\'notloaded\') }}\n </p>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="loading" hidden>\n <tr>\n <td data-tpl-colspan="schema.length" class="text-center align-middle p-4">\n <ful-spinner class="big"></ful-spinner>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="feedback" hidden>\n <tr>\n <td data-tpl-colspan="schema.length" class="text-center align-middle p-4">\n <div class="alert alert-danger">\n <p>{{ #l10n:t(\'error\') }}</p>\n <p class="mb-0" data-ref="feedback-error"></p>\n </div>\n </td>\n </tr>\n </tbody>\n <tfoot data-tpl-if="slots.footer">\n {{{{ slots.footer }}}}\n </tfoot>\n </table>\n </div>\n <ful-pagination current="0" total="1"></ful-pagination>\n ';static templates={row:'\n <tr data-tpl-if="pageResponse.data.length == 0">\n <td data-tpl-colspan="schema.length" class="text-center align-middle p-4">\n {{ #l10n:t(\'nodata\') }}\n </td>\n </tr>\n <tr data-tpl-each="pageResponse.data" data-tpl-var="row">\n <td data-tpl-each="schema" data-tpl-class="content.classes">\n {{{{ content.template.withOverlay(row).render() }}}}\n </td>\n </tr>\n '};#W;#h;#K;#Y;#Q;#X;#Z;#tt;async render({slots:t,observed:e}){const r=this.template(),n=X.parse(t.default,r),l=r.withOverlay({slots:t,schema:n}).render(),o=i.queryChildren(l,".table-wrapper").querySelector("table");s.forward("table-",this,o),this.#W=n,this.#h=o.querySelector(":scope > tbody"),this.#K=o.querySelector(":scope > tbody[data-ref=loading]"),this.#Y=o.querySelector(":scope > tbody[data-ref=no-autoload]"),this.#Q=o.querySelector(":scope > tbody[data-ref=feedback]"),this.#X=i.queryChildren(l,"ful-pagination"),this.#Z=o.querySelectorAll(":scope > thead ful-sorter")??[],this.replaceChildren(l),await a.waitForChildren(this);const c=n.find(t=>t.order),u=i.queryChildren(this,"ful-form");this.#tt={pageRequest:{page:0,size:this.getAttribute("page-size")?Number(this.getAttribute("page-size")):10},sortRequest:{order:c?.order,sorter:c?.sorter},filterRequest:u?.values??{}},u?.addEventListener("submit:success",async t=>{await this.load({page:0,size:this.#tt.pageRequest.size},this.#tt.sortRequest,t.detail.request)}),this.addEventListener("page-requested",async t=>{await this.load({page:t.detail.value,size:this.#tt.pageRequest.size},this.#tt.sortRequest,this.#tt.filterRequest)}),this.addEventListener("sort-requested",async t=>{await this.load(this.#tt.pageRequest,t.detail.value,this.#tt.filterRequest),this.#Z.forEach(t=>t.order=null),t.target.order=t.detail.value.order}),this.hasAttribute("autoload")&&await this.reload()}async reload(){return await this.load(this.#tt.pageRequest,this.#tt.sortRequest,this.#tt.filterRequest)}async load(t,e,s){this.#h.innerHTML="",this.#K.removeAttribute("hidden",""),this.#Q.setAttribute("hidden",""),this.#Y.setAttribute("hidden","");try{const r=_.fromAttributes(this,"loaders:table"),i=await r.load(t,e,s);this.#tt={pageRequest:t,sortRequest:e,filterRequest:s},this.#et(t,e,s,i)}catch(t){throw this.#K.setAttribute("hidden",""),this.#Q.removeAttribute("hidden",""),t.problems?this.#Q.querySelector("[data-ref=feedback-error]").textContent=t.problems.map(t=>`${t.reason}`):this.#Q.querySelector("[data-ref=feedback-error]").textContent=t,t}}async resetWithFilter(t){return await this.load({page:0,size:this.#tt.pageRequest.size},this.#tt.sortRequest,t)}#et(t,e,s,r){this.#K.setAttribute("hidden",""),this.#h.replaceChildren(this.template("row").withOverlay({schema:this.#W,pageRequest:t,filterRequest:s,pageResponse:r}).render()),this.#X.current=t.page,this.#X.total=Math.ceil(r.size/t.size)}}class st extends e{static observed=["value:json"];static slots=!0;static template='\n <div class="form-label" data-tpl-if="label">\n <label>{{{{ label }}}}</label>\n {{{{ slots.info }}}}\n </div>\n <div class="input-group">\n <button data-ref="operator" class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" value="LTE" form="">&PrecedesSlantEqual;</button>\n <ul class="dropdown-menu">\n <li><a class="dropdown-item" role="button" value="EQ">=</a></li>\n <li><a class="dropdown-item" role="button" value="NEQ">&ne;</a></li>\n <li><a class="dropdown-item" role="button" value="LT">&prec;</a></li>\n <li><a class="dropdown-item" role="button" value="GT">&succ;</a></li>\n <li><a class="dropdown-item" role="button" value="LTE">&PrecedesSlantEqual;</a></li>\n <li><a class="dropdown-item" role="button" value="GTE">&SucceedsSlantEqual;</a></li>\n <li><a class="dropdown-item" role="button" value="BETWEEN">&LeftRightArrow;</a></li>\n </ul>\n <input data-ref="value1" type="datetime-local" class="form-control" form="">\n <input data-ref="value2" type="datetime-local" class="form-control" form="" hidden>\n <span class="input-group-text"><i class="bi bi-search"></i></span>\n </div>\n <ful-field-error></ful-field-error>\n ';static formAssociated=!0;#st;#rt;#it;#M;constructor(){super(),this.internals=this.attachInternals()}render({slots:t}){const e=0===r.toHtml(t.default.cloneNode(!0)).trim().length?null:t.default,i=this.getAttribute("name"),a=this.template().withOverlay({slots:t,label:e,name:i}).render();this.#st=a.querySelector("[data-ref=operator]"),this.#rt=a.querySelector("[data-ref=value1]"),this.#it=a.querySelector("[data-ref=value2]"),this.#M=a.querySelector("ful-field-error");const n=a.querySelector("label");n?.addEventListener("click",()=>this.focus()),this.#rt.ariaDescribedByElements=[this.#M],this.#rt.ariaLabelledByElements=n?[n]:[],this.replaceChildren(a),this.addEventListener("click",t=>{const e=t.target;if(!e.matches("ul > li > a"))return;const r=e.closest("ul")?.previousElementSibling,i=e.getAttribute("value");s.toggle(this.#it,"hidden","BETWEEN"!==i),r.setAttribute("value",i),r.innerHTML=e.innerHTML})}get value(){const t=this.#st.getAttribute("value"),e="BETWEEN"===t?[this.#rt.value,this.#it.value]:[this.#rt.value];return e.some(t=>""===t)?void 0:[t,...e.map(t=>new Date(t).toISOString())]}set value(t){if(null==t)return this.#rt.value="",this.#it.value="",void this.reflect(()=>{this.removeAttribute("value")});const[e,...s]=t;this.#st.setAttribute("value",e),this.#rt.value=s[0]?P.isoToLocal(s[0]):s[0],this.#it.value=s[1]?P.isoToLocal(s[1]):s[1],this.reflect(()=>{this.setAttribute("value",JSON.stringify(t))})}focus(t){this.#rt.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this.#M.innerText="");this.internals.setValidity({customError:!0}," "),this.#M.innerText=t}}class rt extends e{static observed=["value:json"];static slots=!0;static template='\n <div class="form-label" data-tpl-if="label">\n <label>{{{{ label }}}}</label>\n {{{{ slots.info }}}}\n </div>\n <div class="input-group">\n <button data-ref="operator" class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" value="EQ" form="">=</button>\n <ul class="dropdown-menu">\n <li><a class="dropdown-item" role="button" value="EQ">=</a></li>\n <li><a class="dropdown-item" role="button" value="NEQ">&ne;</a></li>\n <li><a class="dropdown-item" role="button" value="LT">&prec;</a></li>\n <li><a class="dropdown-item" role="button" value="GT">&succ;</a></li>\n <li><a class="dropdown-item" role="button" value="LTE">&PrecedesSlantEqual;</a></li>\n <li><a class="dropdown-item" role="button" value="GTE">&SucceedsSlantEqual;</a></li>\n <li><a class="dropdown-item" role="button" value="BETWEEN">&LeftRightArrow;</a></li>\n </ul>\n <input data-ref="value1" type="date" class="form-control" form="">\n <input data-ref="value2" type="date" class="form-control" form="" hidden>\n <span class="input-group-text"><i class="bi bi-search"></i></span>\n </div>\n <ful-field-error></ful-field-error>\n ';static formAssociated=!0;#st;#rt;#it;#M;constructor(){super(),this.internals=this.attachInternals()}render({slots:t}){const e=0===r.toHtml(t.default.cloneNode(!0)).trim().length?null:t.default,i=this.getAttribute("name"),a=this.template().withOverlay({slots:t,label:e,name:i}).render();this.#st=a.querySelector("[data-ref=operator]"),this.#rt=a.querySelector("[data-ref=value1]"),this.#it=a.querySelector("[data-ref=value2]"),this.#M=a.querySelector("ful-field-error");const n=a.querySelector("label");n?.addEventListener("click",()=>this.focus()),this.#rt.ariaDescribedByElements=[this.#M],this.#rt.ariaLabelledByElements=n?[n]:[],this.replaceChildren(a),this.addEventListener("click",t=>{const e=t.target;if(!e.matches("ul > li > a"))return;const r=e.closest("ul")?.previousElementSibling,i=e.getAttribute("value");s.toggle(this.#it,"hidden","BETWEEN"!==i),r.setAttribute("value",i),r.innerHTML=e.innerHTML})}get value(){const t=this.#st.getAttribute("value"),e="BETWEEN"==t?[this.#rt.value,this.#it.value]:[this.#rt.value];return e.some(t=>""===t)?void 0:[t,...e]}set value(t){if(null==t)return this.#rt.value="",this.#it.value="",void this.reflect(()=>{this.removeAttribute("value")});const[e,...s]=t;this.#st.setAttibute("value",e),this.#rt.value=s[0],this.#it.value=s[1],this.reflect(()=>{this.setAttribute("value",JSON.stringify(t))})}focus(t){this.#rt.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this.#M.innerText="");this.internals.setValidity({customError:!0}," "),this.#M.innerText=t}}class it extends e{static observed=["value:json"];static slots=!0;static template='\n <div class="form-label" data-tpl-if="label">\n <label>{{{{ label }}}}</label>\n {{{{ slots.info }}}}\n </div>\n <div class="input-group">\n <button data-ref="operator" class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" value="CONTAINS" form="">&mldr;a&mldr;</button>\n <ul class="dropdown-menu">\n <li><a class="dropdown-item" role="button" value="CONTAINS">&mldr;a&mldr;</a></li>\n <li><a class="dropdown-item" role="button" value="STARTS_WITH">a&mldr;</a></li>\n <li><a class="dropdown-item" role="button" value="ENDS_WITH">&mldr;a</a></li>\n <li><a class="dropdown-item" role="button" value="EQ">=</a></li>\n </ul>\n <input data-ref="value" type="text" class="form-control" form="">\n <span class="input-group-text"><i class="bi bi-search"></i></span>\n </div>\n <ful-field-error></ful-field-error>\n ';static formAssociated=!0;#st;#at;#M;constructor(){super(),this.internals=this.attachInternals()}render({slots:t}){const e=0===r.toHtml(t.default.cloneNode(!0)).trim().length?null:t.default,s=this.getAttribute("name"),i=this.template().withOverlay({slots:t,label:e,name:s}).render();this.#st=i.querySelector("[data-ref=operator]"),this.#at=i.querySelector("[data-ref=value]"),this.#M=i.querySelector("ful-field-error");const a=i.querySelector("label");a?.addEventListener("click",()=>this.focus()),this.#at.ariaDescribedByElements=[this.#M],this.#at.ariaLabelledByElements=a?[a]:[],this.replaceChildren(i),this.addEventListener("click",t=>{const e=t.target;if(!e.matches("ul > li > a"))return;const s=e.closest("ul")?.previousElementSibling,r=e.getAttribute("value");s.setAttribute("value",r),s.innerHTML=e.innerHTML})}get value(){const t=this.#st.getAttribute("value");return""===this.#at.value?void 0:[t,"IGNORE_CASE",this.#at.value]}set value(t){if(null==t)return this.#at.value="",void this.reflect(()=>{this.removeAttribute("value")});const[e,s,r]=t;this.#st.setAttribute("value",e),this.#at.value=r,this.reflect(()=>{this.setAttribute("value",JSON.stringify(t))})}focus(t){this.#at.focus(t)}setCustomValidity(t){if(!t)return this.internals.setValidity({}),void(this.#M.innerText="");this.internals.setValidity({customError:!0}," "),this.#M.innerText=t}}class at{configure(t){const e=b.builder().withCsrfToken().withRedirectOnUnauthorized("/").build();t.defineModule("l10n",{t:function(t,...e){const s=this.l10n[this.language][t]??this.l10n.en[t]??t;return 0===e.length?s:s.replace(/{(\d+)}/g,(t,s)=>e[Number(s)])}}).defineComponent("http-client",e).defineElement("ful-spinner",K).defineElement("ful-form",N).defineElement("ful-checkbox",W).defineElement("ful-input",D).defineElement("ful-local-date",M).defineElement("ful-instant",P).defineElement("ful-input-local-date",B).defineElement("ful-input-local-time",$).defineElement("ful-input-instant",U).defineElement("ful-radio-group",G).defineElement("ful-table",et).defineElement("ful-pagination",Q).defineElement("ful-sorter",Y).defineElement("ful-filter-instant",st).defineElement("ful-filter-local-date",rt).defineElement("ful-filter-text",it).defineElement("ful-select",J).defineElement("ful-dropdown",z).defineComponent("loaders:select",j).defineComponent("loaders:form",I).defineComponent("loaders:table",tt).defineOverlay({language:navigator?.language?.split("-")?.[0]??"en"})}}export{q as AsyncEvents,x as AuthorizationCodeFlow,k as AuthorizationCodeFlowInterceptor,S as AuthorizationCodeFlowSession,n as Base64,C as Bindings,W as Checkbox,z as Dropdown,o as Failure,N as Form,I as FormLoader,l as Hex,b as HttpClient,u as HttpClientError,D as Input,U as InputInstant,B as InputLocalDate,$ as InputLocalTime,P as Instant,st as InstantFilter,_ as Loaders,M as LocalDate,rt as LocalDateFilter,w as LocalStorage,c as MediaType,Q as Pagination,at as Plugin,G as RadioGroup,J as Select,j as SelectLoader,E as SessionStorage,Y as SortButton,K as Spinner,et as Table,X as TableSchemaParser,it as TextFilter,L as Timing,A as VersionedLocalStorage,T as VersionedSessionStorage};
2
2
  //# sourceMappingURL=ful.min.mjs.map