@optionfactory/fml 9.0.0-rc2 → 9.0.0-rc20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -89
- package/dist/client-errors.iife.js +23 -37
- package/dist/client-errors.iife.js.map +1 -1
- package/dist/client-errors.iife.min.js +1 -1
- package/dist/client-errors.iife.min.js.map +1 -1
- package/dist/custom-elements.json +459 -36
- package/dist/fml.css +24 -19
- package/dist/fml.css.map +1 -1
- package/dist/fml.iife.js +4646 -1779
- package/dist/fml.iife.js.map +1 -1
- package/dist/fml.iife.min.js +1 -1
- package/dist/fml.iife.min.js.map +1 -1
- package/dist/ftl.d.mts +395 -224
- package/dist/ftl.iife.js +402 -332
- package/dist/ftl.iife.js.map +1 -1
- package/dist/ftl.iife.min.js +1 -1
- package/dist/ftl.iife.min.js.map +1 -1
- package/dist/ftl.min.mjs +1 -1
- package/dist/ftl.min.mjs.map +1 -1
- package/dist/ftl.mjs +402 -332
- package/dist/ftl.mjs.map +1 -1
- package/dist/ful.css +24 -19
- package/dist/ful.css.map +1 -1
- package/dist/ful.d.mts +2801 -519
- package/dist/ful.iife.js +4096 -1275
- package/dist/ful.iife.js.map +1 -1
- package/dist/ful.iife.min.js +1 -1
- package/dist/ful.iife.min.js.map +1 -1
- package/dist/ful.min.mjs +1 -1
- package/dist/ful.min.mjs.map +1 -1
- package/dist/ful.mjs +4093 -1277
- package/dist/ful.mjs.map +1 -1
- package/dist/httpc.d.mts +139 -121
- package/dist/httpc.iife.js +137 -166
- package/dist/httpc.iife.js.map +1 -1
- package/dist/httpc.iife.min.js +1 -1
- package/dist/httpc.iife.min.js.map +1 -1
- package/dist/httpc.min.mjs +1 -1
- package/dist/httpc.min.mjs.map +1 -1
- package/dist/httpc.mjs +137 -166
- package/dist/httpc.mjs.map +1 -1
- package/dist/vscode.html-custom-data.json +215 -27
- package/dist/web-types.json +463 -36
- package/package.json +1 -1
package/dist/fml.iife.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var fml=function(e){"use strict";class t{#e;#t=new Map;constructor(e){this.#e=e}getOrCompute(e,t){if(this.#t.has(e))return this.#t.get(e);const s=t(e);return this.#t.size>=this.#e&&this.#t.delete(this.#t.keys().next().value),this.#t.set(e,s),s}get size(){return this.#t.size}}const s={ter:Symbol("ternary"),elv:Symbol("elvis"),nullc:Symbol("null-coalescence"),or:Symbol("or"),and:Symbol("and"),eq:Symbol("eq"),cmp:Symbol("cmp"),not:Symbol("not"),access:Symbol("access"),member:Symbol("access-member"),subscript:Symbol("access-subscript"),method:Symbol("access-method-call"),call:Symbol("module-function-call"),tstring:Symbol("tstring"),literal:Symbol("literal"),array:Symbol("array-literal"),dict:Symbol("dict-literal"),function:Symbol("module-function"),symbol:Symbol("symbol"),templated:{ten:Symbol("templated-node"),teh:Symbol("templated-html"),tet:Symbol("templated-text"),tel:Symbol("templated-literal")},dom:{t:Symbol("text"),h:Symbol("html"),n:Symbol("node")}},r=new Map([["true",!0],["false",!1],["null",null],["undefined",void 0]]);class i extends SyntaxError{constructor(e,t,s,r){super(e),this.expected=t,this.found=s,this.location=r,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let s=null;const r=e.find(e=>e.source===this.location.source);r&&(s=r.text.split(/\r\n|\n|\r/g));const i=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,a=this.location.source+":"+n.line+":"+n.column;if(s){const e=this.location.end,r="".padEnd(n.line.toString().length," "),o=s[i.line-1],l=(i.line===e.line?e.column:o.length+1)-i.column||1;t+="\n --\x3e "+a+"\n"+r+" |\n"+n.line+" | "+o+"\n"+r+" | "+"".padEnd(i.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+a}return t}static buildMessage(e,t){function s(e){return e.codePointAt(0).toString(16).toUpperCase()}const r=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function i(e){return r?e.replace(r,e=>"\\u{"+s(e)+"}"):e}function n(e){return i(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+s(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+s(e)))}function a(e){return i(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+s(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+s(e)))}const o={literal:e=>'"'+n(e.text)+'"',class(e){const t=e.parts.map(e=>Array.isArray(e)?a(e[0])+"-"+a(e[1]):a(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return o[e.type](e)}return"Expected "+function(e){const t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let s=1;s<t.length;s++)t[s-1]!==t[s]&&(t[e]=t[s],e++);t.length=e}switch(t.length){case 1:return t[0];case 2:return t[0]+" or "+t[1];default:return t.slice(0,-1).join(", ")+", or "+t[t.length-1]}}(e)+" but "+function(e){return e?'"'+n(e)+'"':"end of input"}(t)+" found."}}const n=(e,t)=>{if("self"===t)return e[e.length-1];for(let s=e.length-1;s>=0;s--){const r=e[s];if(null!=r&&("object"==typeof r||"function"==typeof r)&&t in r)return r[t]}};class a{#s;#r;constructor(e,t){this.#s=e,this.#r=t}#i(e){return n(this.#r,e)}#n(e,t){const r=0===t?e.lhs:e.rhs[t-1];return r.type===s.symbol?r.value:r.type===s.member?r.rhs:null}#a;#o(){return this.#a||(this.#a=new Proxy(this.#r,{get:(e,t)=>this.#i(t)})),this.#a}[s.and](e){return this.visit(e.lhs)&&this.visit(e.rhs)}[s.or](e){return this.visit(e.lhs)||this.visit(e.rhs)}[s.nullc](e){const t=this.visit(e.lhs);return null!=t?t:this.visit(e.rhs)}[s.not](e){return!this.visit(e.expr)}[s.eq](e){const t=this.visit(e.lhs)===this.visit(e.rhs);return"=="===e.op?t:!t}[s.cmp](e){const t=this.visit(e.lhs),s=this.visit(e.rhs);switch(e.op){case">":return t>s;case"<":return t<s;case">=":return t>=s;case"<=":return t<=s;default:throw new Error(`unknown cmp op ${e.op}`)}}[s.call](e){const t=e.value,s=null===t.module?this.#s:this.#s?.[t.module];if(!s)throw new Error(`Module "${t.module}" not found`);const r=s[t.value];if(!r)throw new Error(`Function "#${null===t.module?"":`${t.module}:`}${t.value}" not found`);const i=e.args.map(e=>this.visit(e));return r.apply(this.#o(),i)}[s.literal](e){return e.value}[s.tstring](e){let t="";const s=e.parts;for(let e=0,r=s.length;e<r;e++){const r=this.visit(s[e]);null!=r&&(t+=r)}return t}[s.symbol](e){return this.#i(e.value)}[s.dict](e){return Object.fromEntries(e.value.map(e=>[this.visit(e[0]),this.visit(e[1])]))}[s.array](e){return e.value.map(e=>this.visit(e))}[s.ter](e){return this.visit(e.cond)?this.visit(e.ifTrue):this.visit(e.ifFalse)}[s.elv](e){return this.visit(e.cond)||this.visit(e.ifFalse)}[s.access](e){let t,r=this.visit(e.lhs);for(let i=0;i!==e.rhs.length;++i){const n=e.rhs[i];if(n.ns&&null==r)return;let a;switch(n.type){case s.member:a=r[n.rhs];break;case s.subscript:a=r[this.visit(n.rhs)];break;case s.method:{if(!r){const t=this.#n(e,i);throw new Error(null===t?"Method missing":`Method missing "${t}"`)}const s=n.args.map(e=>this.visit(e));a=r.apply(t,s);break}}t=r,r=a}return r}visit(e,...t){return this[e.type](e,...t)}visitRoot(e,t){return t?e.map(e=>{switch(e.type){case s.templated.tel:return{type:s.dom.t,value:e.value};case s.templated.tet:return{type:s.dom.t,value:this.visit(e.value)};case s.templated.teh:return{type:s.dom.h,value:this.visit(e.value)};case s.templated.ten:return{type:s.dom.n,value:this.visit(e.value)};default:throw new Error(`unknown node type ${e.type.toString()}`)}}):this.visit(e)}}class o{static MODE_EXPRESSION=Symbol("MODE_EXPRESSION");static MODE_TEMPLATED=Symbol("MODE_TEMPLATED");static#l=new t(1e3);static parse(e,t){const n=t?.toString()+e;return this.#l.getOrCompute(n,()=>function(e,t){const n={},a=(t=void 0!==t?t:{}).grammarSource,o={TemplatedRoot:mt,ExpressionRoot:bt};let l=mt;const u="{{{{",c="}}}}",d="{{{",h="}}}",p="{{",f="}}",m="\\",g="{",b="?",v=":",y="?:",w="??",E="||",x="&&",A="!",S="?.",T=".",C="[",_="]",O="(",q=",",R=")",N="-",P="'",L='"',k="`",z="}",M="#",D="==",F="!=",I=">=",$=">",B="<=",j="<",H=/^[^\\{]/,W=/^[0-9]/,V=/^[^']/,U=/^[^"]/,G=/^[^\\`{]/,Q=/^[a-zA-Z$_]/,K=/^[a-zA-Z$_0-9]/,J=/^[ \t\n\r]/,X=ut("{{{{",!1),Y=ut("}}}}",!1),Z=ut("{{{",!1),ee=ut("}}}",!1),te=ut("{{",!1),se=ut("}}",!1),re=ct(["\\","{"],!0,!1,!1),ie=ut("\\",!1),ne={type:"any"},ae=ut("{",!1),oe=ut("?",!1),le=ut(":",!1),ue=ut("?:",!1),ce=ut("??",!1),de=ut("||",!1),he=ut("&&",!1),pe=ut("!",!1),fe=dt("member"),me=ut("?.",!1),ge=ut(".",!1),be=dt("subscript"),ve=ut("[",!1),ye=ut("]",!1),we=dt("method-call"),Ee=ut("(",!1),xe=ut(",",!1),Ae=ut(")",!1),Se=dt("module-function-call"),Te=dt("number-literal"),Ce=ut("-",!1),_e=ct([["0","9"]],!1,!1,!1),Oe=dt("string-literal"),qe=ut("'",!1),Re=ct(["'"],!0,!1,!1),Ne=ut('"',!1),Pe=ct(['"'],!0,!1,!1),Le=ut("`",!1),ke=dt("tstring-expression"),ze=ut("}",!1),Me=dt("tstring-literal"),De=ct(["\\","`","{"],!0,!1,!1),Fe=dt("array-literal"),Ie=dt("dict-literal"),$e=dt("module-function"),Be=ut("#",!1),je=ct([["a","z"],["A","Z"],"$","_"],!1,!1,!1),He=ct([["a","z"],["A","Z"],"$","_",["0","9"]],!1,!1,!1),We=dt("identifier-or-keyword"),Ve=ut("==",!1),Ue=ut("!=",!1),Ge=ut(">=",!1),Qe=ut(">",!1),Ke=ut("<=",!1),Je=ut("<",!1),Xe=ct([" ","\t","\n","\r"],!1,!1,!1);function Ye(e){return e}function Ze(e,t,s){return{op:t,rhs:s}}function et(e,t,s){return{op:t,rhs:s}}function tt(e){return e}let st=0|t.peg$currPos;const rt=[{line:1,column:1}];let it,nt=st,at=t.peg$maxFailExpected||[],ot=0|t.peg$silentFails,lt={};if(t.startRule){if(!(t.startRule in o))throw new Error("Can't start parsing from rule \""+t.startRule+'".');l=o[t.startRule]}function ut(e,t){return{type:"literal",text:e,ignoreCase:t}}function ct(e,t,s,r){return{type:"class",parts:e,inverted:t,ignoreCase:s,unicode:r}}function dt(e){return{type:"other",description:e}}function ht(t){let s,r=rt[t];if(r)return r;if(t>=rt.length)s=rt.length-1;else for(s=t;!rt[--s];);for(r=rt[s],r={line:r.line,column:r.column};s<t;)10===e.charCodeAt(s)?(r.line++,r.column=1):r.column++,s++;return rt[t]=r,r}function pt(e,t,s){const r=ht(e),i=ht(t);return{source:a,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:i.line,column:i.column}}}function ft(e){st<nt||(st>nt&&(nt=st,at=[]),at.push(e))}function mt(){let e,t;const s=38*st+0,r=lt[s];if(r)return st=r.nextPos,r.result;for(e=[],t=gt();t!==n;)e.push(t),t=gt();return lt[s]={nextPos:st,result:e},e}function gt(){let t,r,i,a,o;const l=38*st+1,b=lt[l];return b?(st=b.nextPos,b.result):(t=st,r=st,i=function(){let t;const s=38*st+2,r=lt[s];return r?(st=r.nextPos,r.result):(e.substr(st,4)===u?(t=u,st+=4):(t=n,0===ot&&ft(X)),lt[s]={nextPos:st,result:t},t)}(),i!==n?(a=bt(),a!==n?(o=function(){let t;const s=38*st+3,r=lt[s];return r?(st=r.nextPos,r.result):(e.substr(st,4)===c?(t=c,st+=4):(t=n,0===ot&&ft(Y)),lt[s]={nextPos:st,result:t},t)}(),o!==n?r=a:(st=r,r=n)):(st=r,r=n)):(st=r,r=n),r!==n&&(v=r,r={type:s.templated.ten,value:v}),t=r,t===n&&(t=st,r=st,i=function(){let t;const s=38*st+4,r=lt[s];return r?(st=r.nextPos,r.result):(e.substr(st,3)===d?(t=d,st+=3):(t=n,0===ot&&ft(Z)),lt[s]={nextPos:st,result:t},t)}(),i!==n?(a=bt(),a!==n?(o=function(){let t;const s=38*st+5,r=lt[s];return r?(st=r.nextPos,r.result):(e.substr(st,3)===h?(t=h,st+=3):(t=n,0===ot&&ft(ee)),lt[s]={nextPos:st,result:t},t)}(),o!==n?r=a:(st=r,r=n)):(st=r,r=n)):(st=r,r=n),r!==n&&(r=function(e){return{type:s.templated.teh,value:e}}(r)),t=r,t===n&&(t=st,r=st,i=function(){let t;const s=38*st+6,r=lt[s];return r?(st=r.nextPos,r.result):(e.substr(st,2)===p?(t=p,st+=2):(t=n,0===ot&&ft(te)),lt[s]={nextPos:st,result:t},t)}(),i!==n?(a=bt(),a!==n?(o=function(){let t;const s=38*st+7,r=lt[s];return r?(st=r.nextPos,r.result):(e.substr(st,2)===f?(t=f,st+=2):(t=n,0===ot&&ft(se)),lt[s]={nextPos:st,result:t},t)}(),o!==n?r=a:(st=r,r=n)):(st=r,r=n)):(st=r,r=n),r!==n&&(r=function(e){return{type:s.templated.tet,value:e}}(r)),t=r,t===n&&(t=st,r=function(){let t,s,r,i,a,o,l;const u=38*st+8,c=lt[u];if(c)return st=c.nextPos,c.result;if(t=st,s=[],r=st,i=[],a=e.charAt(st),H.test(a)?st++:(a=n,0===ot&&ft(re)),a!==n)for(;a!==n;)i.push(a),a=e.charAt(st),H.test(a)?st++:(a=n,0===ot&&ft(re));else i=n;if(r=i!==n?e.substring(r,st):i,r===n&&(r=st,92===e.charCodeAt(st)?(i=m,st++):(i=n,0===ot&&ft(ie)),i!==n?(e.length>st?(a=e.charAt(st),st++):(a=n,0===ot&&ft(ne)),a!==n?r=a:(st=r,r=n)):(st=r,r=n),r===n&&(r=st,i=st,123===e.charCodeAt(st)?(a=g,st++):(a=n,0===ot&&ft(ae)),a!==n?(o=st,ot++,123===e.charCodeAt(st)?(l=g,st++):(l=n,0===ot&&ft(ae)),ot--,l===n?o=void 0:(st=o,o=n),o!==n?(a=[a,o],i=a):(st=i,i=n)):(st=i,i=n),r=i!==n?e.substring(r,st):i)),r!==n)for(;r!==n;){if(s.push(r),r=st,i=[],a=e.charAt(st),H.test(a)?st++:(a=n,0===ot&&ft(re)),a!==n)for(;a!==n;)i.push(a),a=e.charAt(st),H.test(a)?st++:(a=n,0===ot&&ft(re));else i=n;r=i!==n?e.substring(r,st):i,r===n&&(r=st,92===e.charCodeAt(st)?(i=m,st++):(i=n,0===ot&&ft(ie)),i!==n?(e.length>st?(a=e.charAt(st),st++):(a=n,0===ot&&ft(ne)),a!==n?r=Ye(a):(st=r,r=n)):(st=r,r=n),r===n&&(r=st,i=st,123===e.charCodeAt(st)?(a=g,st++):(a=n,0===ot&&ft(ae)),a!==n?(o=st,ot++,123===e.charCodeAt(st)?(l=g,st++):(l=n,0===ot&&ft(ae)),ot--,l===n?o=void 0:(st=o,o=n),o!==n?(a=[a,o],i=a):(st=i,i=n)):(st=i,i=n),r=i!==n?e.substring(r,st):i))}else s=n;return s!==n&&(s=s.join("")),t=s,lt[u]={nextPos:st,result:t},t}(),r!==n&&(r=function(e){return{type:s.templated.tel,value:e}}(r)),t=r))),lt[l]={nextPos:st,result:t},t);var v}function bt(){let e,t;const s=38*st+9,r=lt[s];return r?(st=r.nextPos,r.result):(e=st,kt(),t=vt(),t!==n?(kt(),e=t):(st=e,e=n),lt[s]={nextPos:st,result:e},e)}function vt(){let t,r,i,a,o,l;const u=38*st+10,c=lt[u];return c?(st=c.nextPos,c.result):(t=st,r=yt(),r!==n?(kt(),63===e.charCodeAt(st)?(i=b,st++):(i=n,0===ot&&ft(oe)),i!==n?(kt(),a=vt(),a!==n?(kt(),58===e.charCodeAt(st)?(o=v,st++):(o=n,0===ot&&ft(le)),o!==n?(kt(),l=vt(),l!==n?t={type:s.ter,cond:r,ifTrue:a,ifFalse:l}:(st=t,t=n)):(st=t,t=n)):(st=t,t=n)):(st=t,t=n)):(st=t,t=n),t===n&&(t=yt()),lt[u]={nextPos:st,result:t},t)}function yt(){let t,r,i,a;const o=38*st+11,l=lt[o];return l?(st=l.nextPos,l.result):(t=st,r=wt(),r!==n?(kt(),e.substr(st,2)===y?(i=y,st+=2):(i=n,0===ot&&ft(ue)),i!==n?(kt(),a=yt(),a!==n?t={type:s.elv,cond:r,ifFalse:a}:(st=t,t=n)):(st=t,t=n)):(st=t,t=n),t===n&&(t=wt()),lt[o]={nextPos:st,result:t},t)}function wt(){let t,r,i,a;const o=38*st+12,l=lt[o];return l?(st=l.nextPos,l.result):(t=st,r=Et(),r!==n?(kt(),e.substr(st,2)===w?(i=w,st+=2):(i=n,0===ot&&ft(ce)),i!==n?(kt(),a=wt(),a!==n?t={type:s.nullc,lhs:r,rhs:a}:(st=t,t=n)):(st=t,t=n)):(st=t,t=n),t===n&&(t=Et()),lt[o]={nextPos:st,result:t},t)}function Et(){let t,r,i,a,o,l;const u=38*st+13,c=lt[u];if(c)return st=c.nextPos,c.result;if(t=st,r=xt(),r!==n){for(i=[],a=st,kt(),e.substr(st,2)===E?(o=E,st+=2):(o=n,0===ot&&ft(de)),o!==n?(kt(),l=xt(),l!==n?a=l:(st=a,a=n)):(st=a,a=n);a!==n;)i.push(a),a=st,kt(),e.substr(st,2)===E?(o=E,st+=2):(o=n,0===ot&&ft(de)),o!==n?(kt(),l=xt(),l!==n?a=l:(st=a,a=n)):(st=a,a=n);t=function(e,t){let r=e;for(const e of t)r={type:s.or,lhs:r,rhs:e};return r}(r,i)}else st=t,t=n;return lt[u]={nextPos:st,result:t},t}function xt(){let t,r,i,a,o,l;const u=38*st+14,c=lt[u];if(c)return st=c.nextPos,c.result;if(t=st,r=At(),r!==n){for(i=[],a=st,kt(),e.substr(st,2)===x?(o=x,st+=2):(o=n,0===ot&&ft(he)),o!==n?(kt(),l=At(),l!==n?a=l:(st=a,a=n)):(st=a,a=n);a!==n;)i.push(a),a=st,kt(),e.substr(st,2)===x?(o=x,st+=2):(o=n,0===ot&&ft(he)),o!==n?(kt(),l=At(),l!==n?a=l:(st=a,a=n)):(st=a,a=n);t=function(e,t){let r=e;for(const e of t)r={type:s.and,lhs:r,rhs:e};return r}(r,i)}else st=t,t=n;return lt[u]={nextPos:st,result:t},t}function At(){let e,t,r,i,a,o;const l=38*st+15,u=lt[l];if(u)return st=u.nextPos,u.result;if(e=st,t=St(),t!==n){for(r=[],i=st,kt(),a=Pt(),a!==n?(kt(),o=St(),o!==n?i=Ze(0,a,o):(st=i,i=n)):(st=i,i=n);i!==n;)r.push(i),i=st,kt(),a=Pt(),a!==n?(kt(),o=St(),o!==n?i=Ze(0,a,o):(st=i,i=n)):(st=i,i=n);e=function(e,t){let r=e;for(const e of t)r={type:s.eq,op:e.op,lhs:r,rhs:e.rhs};return r}(t,r)}else st=e,e=n;return lt[l]={nextPos:st,result:e},e}function St(){let e,t,r,i,a,o;const l=38*st+16,u=lt[l];if(u)return st=u.nextPos,u.result;if(e=st,t=Tt(),t!==n){for(r=[],i=st,kt(),a=Lt(),a!==n?(kt(),o=Tt(),o!==n?i=et(0,a,o):(st=i,i=n)):(st=i,i=n);i!==n;)r.push(i),i=st,kt(),a=Lt(),a!==n?(kt(),o=Tt(),o!==n?i=et(0,a,o):(st=i,i=n)):(st=i,i=n);e=function(e,t){let r=e;for(const e of t)r={type:s.cmp,op:e.op,lhs:r,rhs:e.rhs};return r}(t,r)}else st=e,e=n;return lt[l]={nextPos:st,result:e},e}function Tt(){let t,r,i;const a=38*st+17,o=lt[a];return o?(st=o.nextPos,o.result):(t=st,33===e.charCodeAt(st)?(r=A,st++):(r=n,0===ot&&ft(pe)),r!==n?(kt(),i=Tt(),i!==n?t={type:s.not,expr:i}:(st=t,t=n)):(st=t,t=n),t===n&&(t=function(){let e,t,r,i,a;const o=38*st+18,l=lt[o];if(l)return st=l.nextPos,l.result;if(e=st,t=_t(),t!==n){if(kt(),r=[],i=st,a=Ct(),a!==n?(kt(),i=a):(st=i,i=n),i!==n)for(;i!==n;)r.push(i),i=st,a=Ct(),a!==n?(kt(),i=a):(st=i,i=n);else r=n;r!==n?e={type:s.access,lhs:t,rhs:r}:(st=e,e=n)}else st=e,e=n;return e===n&&(e=_t()),lt[o]={nextPos:st,result:e},e}()),lt[a]={nextPos:st,result:t},t)}function Ct(){let t;const r=38*st+19,i=lt[r];return i?(st=i.nextPos,i.result):(t=function(){let t,r,i;const a=38*st+20,o=lt[a];return o?(st=o.nextPos,o.result):(ot++,t=st,e.substr(st,2)===S?(r=S,st+=2):(r=n,0===ot&&ft(me)),r===n&&(46===e.charCodeAt(st)?(r=T,st++):(r=n,0===ot&&ft(ge))),r!==n?(kt(),i=Nt(),i!==n?t={type:s.member,ns:"?."===r,rhs:i}:(st=t,t=n)):(st=t,t=n),ot--,t===n&&(r=n,0===ot&&ft(fe)),lt[a]={nextPos:st,result:t},t)}(),t===n&&(t=function(){let t,r,i,a,o;const l=38*st+21,u=lt[l];return u?(st=u.nextPos,u.result):(ot++,t=st,e.substr(st,2)===S?(r=S,st+=2):(r=n,0===ot&&ft(me)),r===n&&(r=null),91===e.charCodeAt(st)?(i=C,st++):(i=n,0===ot&&ft(ve)),i!==n?(kt(),a=vt(),a!==n?(kt(),93===e.charCodeAt(st)?(o=_,st++):(o=n,0===ot&&ft(ye)),o!==n?t={type:s.subscript,ns:null!==r,rhs:a}:(st=t,t=n)):(st=t,t=n)):(st=t,t=n),ot--,t===n&&(r=n,0===ot&&ft(be)),lt[l]={nextPos:st,result:t},t)}(),t===n&&(t=function(){let t,r,i,a,o,l,u,c;const d=38*st+22,h=lt[d];if(h)return st=h.nextPos,h.result;if(ot++,t=st,e.substr(st,2)===S?(r=S,st+=2):(r=n,0===ot&&ft(me)),r===n&&(r=null),40===e.charCodeAt(st)?(i=O,st++):(i=n,0===ot&&ft(Ee)),i!==n){for(kt(),a=st,o=vt(),o!==n?(l=kt(),a=o):(st=a,a=n),a===n&&(a=null),o=[],l=st,44===e.charCodeAt(st)?(u=q,st++):(u=n,0===ot&&ft(xe)),u!==n?(kt(),c=vt(),c!==n?(kt(),l=c):(st=l,l=n)):(st=l,l=n);l!==n;)o.push(l),l=st,44===e.charCodeAt(st)?(u=q,st++):(u=n,0===ot&&ft(xe)),u!==n?(kt(),c=vt(),c!==n?(kt(),l=c):(st=l,l=n)):(st=l,l=n);41===e.charCodeAt(st)?(l=R,st++):(l=n,0===ot&&ft(Ae)),l!==n?t=function(e,t,r){return{type:s.method,ns:null!==e,args:null===t?[]:[t,...r]}}(r,a,o):(st=t,t=n)}else st=t,t=n;return ot--,t===n&&(r=n,0===ot&&ft(we)),lt[d]={nextPos:st,result:t},t}())),lt[r]={nextPos:st,result:t},t)}function _t(){let t,i,a,o;const l=38*st+23,u=lt[l];return u?(st=u.nextPos,u.result):(t=st,40===e.charCodeAt(st)?(i=O,st++):(i=n,0===ot&&ft(Ee)),i!==n?(kt(),a=vt(),a!==n?(kt(),41===e.charCodeAt(st)?(o=R,st++):(o=n,0===ot&&ft(Ae)),o!==n?t=a:(st=t,t=n)):(st=t,t=n)):(st=t,t=n),t===n&&(t=function(){let t,r,i,a,o,l,u,c;const d=38*st+24,h=lt[d];if(h)return st=h.nextPos,h.result;if(ot++,t=st,r=function(){let t,r,i,a,o;const l=38*st+32,u=lt[l];return u?(st=u.nextPos,u.result):(ot++,t=st,35===e.charCodeAt(st)?(r=M,st++):(r=n,0===ot&&ft(Be)),r!==n?(i=st,a=Nt(),a!==n?(58===e.charCodeAt(st)?(o=v,st++):(o=n,0===ot&&ft(le)),o!==n?i=a:(st=i,i=n)):(st=i,i=n),i===n&&(i=null),a=Nt(),a!==n?t={type:s.function,module:i,value:a}:(st=t,t=n)):(st=t,t=n),ot--,t===n&&(r=n,0===ot&&ft($e)),lt[l]={nextPos:st,result:t},t)}(),r!==n)if(40===e.charCodeAt(st)?(i=O,st++):(i=n,0===ot&&ft(Ee)),i!==n){for(kt(),a=st,o=vt(),o!==n?(l=kt(),a=o):(st=a,a=n),a===n&&(a=null),o=[],l=st,44===e.charCodeAt(st)?(u=q,st++):(u=n,0===ot&&ft(xe)),u!==n?(kt(),c=vt(),c!==n?(kt(),l=c):(st=l,l=n)):(st=l,l=n);l!==n;)o.push(l),l=st,44===e.charCodeAt(st)?(u=q,st++):(u=n,0===ot&&ft(xe)),u!==n?(kt(),c=vt(),c!==n?(kt(),l=c):(st=l,l=n)):(st=l,l=n);41===e.charCodeAt(st)?(l=R,st++):(l=n,0===ot&&ft(Ae)),l!==n?t=function(e,t,r){const i=null===t?[]:[t,...r];return{type:s.call,value:e,args:i}}(r,a,o):(st=t,t=n)}else st=t,t=n;else st=t,t=n;return ot--,t===n&&(r=n,0===ot&&ft(Se)),lt[d]={nextPos:st,result:t},t}(),t===n&&(t=function(){let t;const r=38*st+25,i=lt[r];return i?(st=i.nextPos,i.result):(t=function(){let t,r,i,a,o,l,u,c,d,h;const p=38*st+26,f=lt[p];if(f)return st=f.nextPos,f.result;if(ot++,t=st,r=st,i=st,45===e.charCodeAt(st)?(a=N,st++):(a=n,0===ot&&ft(Ce)),a===n&&(a=null),o=st,l=[],u=e.charAt(st),W.test(u)?st++:(u=n,0===ot&&ft(_e)),u!==n)for(;u!==n;)l.push(u),u=e.charAt(st),W.test(u)?st++:(u=n,0===ot&&ft(_e));else l=n;if(l!==n){if(u=st,46===e.charCodeAt(st)?(c=T,st++):(c=n,0===ot&&ft(ge)),c!==n){for(d=[],h=e.charAt(st),W.test(h)?st++:(h=n,0===ot&&ft(_e));h!==n;)d.push(h),h=e.charAt(st),W.test(h)?st++:(h=n,0===ot&&ft(_e));c=[c,d],u=c}else st=u,u=n;u===n&&(u=null),l=[l,u],o=l}else st=o,o=n;if(o===n)if(o=st,46===e.charCodeAt(st)?(l=T,st++):(l=n,0===ot&&ft(ge)),l!==n){if(u=[],c=e.charAt(st),W.test(c)?st++:(c=n,0===ot&&ft(_e)),c!==n)for(;c!==n;)u.push(c),c=e.charAt(st),W.test(c)?st++:(c=n,0===ot&&ft(_e));else u=n;u!==n?(l=[l,u],o=l):(st=o,o=n)}else st=o,o=n;return o!==n?(a=[a,o],i=a):(st=i,i=n),r=i!==n?e.substring(r,st):i,r!==n&&(r={type:s.literal,value:parseFloat(r)}),t=r,ot--,t===n&&(r=n,0===ot&&ft(Te)),lt[p]={nextPos:st,result:t},t}(),t===n&&(t=Ot(),t===n&&(t=function(){let t,r,i,a,o,l,u;const c=38*st+30,d=lt[c];if(d)return st=d.nextPos,d.result;if(ot++,t=st,91===e.charCodeAt(st)?(r=C,st++):(r=n,0===ot&&ft(ve)),r!==n){for(kt(),i=vt(),i===n&&(i=null),kt(),a=[],o=st,44===e.charCodeAt(st)?(l=q,st++):(l=n,0===ot&&ft(xe)),l!==n?(kt(),u=vt(),u!==n?(kt(),o=u):(st=o,o=n)):(st=o,o=n);o!==n;)a.push(o),o=st,44===e.charCodeAt(st)?(l=q,st++):(l=n,0===ot&&ft(xe)),l!==n?(kt(),u=vt(),u!==n?(kt(),o=u):(st=o,o=n)):(st=o,o=n);93===e.charCodeAt(st)?(o=_,st++):(o=n,0===ot&&ft(ye)),o!==n?t=function(e,t){const r=null===e?[]:[e,...t];return{type:s.array,value:r}}(i,a):(st=t,t=n)}else st=t,t=n;return ot--,t===n&&(r=n,0===ot&&ft(Fe)),lt[c]={nextPos:st,result:t},t}(),t===n&&(t=function(){let t,r,i,a,o,l,u,c,d,h,p;const f=38*st+31,m=lt[f];if(m)return st=m.nextPos,m.result;if(ot++,t=st,123===e.charCodeAt(st)?(r=g,st++):(r=n,0===ot&&ft(ae)),r!==n){for(kt(),i=st,a=Ot(),a!==n?(o=kt(),58===e.charCodeAt(st)?(l=v,st++):(l=n,0===ot&&ft(le)),l!==n?(u=kt(),c=vt(),c!==n?i=[a,c]:(st=i,i=n)):(st=i,i=n)):(st=i,i=n),i===n&&(i=null),a=kt(),o=[],l=st,44===e.charCodeAt(st)?(u=q,st++):(u=n,0===ot&&ft(xe)),u!==n?(c=kt(),d=Ot(),d!==n?(kt(),58===e.charCodeAt(st)?(h=v,st++):(h=n,0===ot&&ft(le)),h!==n?(kt(),p=vt(),p!==n?(kt(),l=[d,p]):(st=l,l=n)):(st=l,l=n)):(st=l,l=n)):(st=l,l=n);l!==n;)o.push(l),l=st,44===e.charCodeAt(st)?(u=q,st++):(u=n,0===ot&&ft(xe)),u!==n?(c=kt(),d=Ot(),d!==n?(kt(),58===e.charCodeAt(st)?(h=v,st++):(h=n,0===ot&&ft(le)),h!==n?(kt(),p=vt(),p!==n?(kt(),l=[d,p]):(st=l,l=n)):(st=l,l=n)):(st=l,l=n)):(st=l,l=n);125===e.charCodeAt(st)?(l=z,st++):(l=n,0===ot&&ft(ze)),l!==n?t=function(e,t){var r=[];return null!==e&&r.push(e),r.push.apply(r,t),{type:s.dict,value:r}}(i,o):(st=t,t=n)}else st=t,t=n;return ot--,t===n&&(r=n,0===ot&&ft(Ie)),lt[f]={nextPos:st,result:t},t}()))),lt[r]={nextPos:st,result:t},t)}(),t===n&&(t=function(){let e,t;const i=38*st+34,a=lt[i];return a?(st=a.nextPos,a.result):(ot++,e=st,t=Nt(),t!==n&&(o=t,t=r.has(o)?{type:s.literal,value:r.get(o)}:{type:s.symbol,value:o}),e=t,ot--,e===n&&(t=n,0===ot&&ft(We)),lt[i]={nextPos:st,result:e},e);var o}()))),lt[l]={nextPos:st,result:t},t)}function Ot(){let t,r,i,a,o;const l=38*st+27,u=lt[l];if(u)return st=u.nextPos,u.result;if(ot++,t=st,39===e.charCodeAt(st)?(r=P,st++):(r=n,0===ot&&ft(qe)),r!==n){for(i=st,a=[],o=e.charAt(st),V.test(o)?st++:(o=n,0===ot&&ft(Re));o!==n;)a.push(o),o=e.charAt(st),V.test(o)?st++:(o=n,0===ot&&ft(Re));i=e.substring(i,st),39===e.charCodeAt(st)?(a=P,st++):(a=n,0===ot&&ft(qe)),a!==n?t={type:s.literal,value:i}:(st=t,t=n)}else st=t,t=n;if(t===n){if(t=st,34===e.charCodeAt(st)?(r=L,st++):(r=n,0===ot&&ft(Ne)),r!==n){for(i=st,a=[],o=e.charAt(st),U.test(o)?st++:(o=n,0===ot&&ft(Pe));o!==n;)a.push(o),o=e.charAt(st),U.test(o)?st++:(o=n,0===ot&&ft(Pe));i=e.substring(i,st),34===e.charCodeAt(st)?(a=L,st++):(a=n,0===ot&&ft(Ne)),a!==n?t={type:s.literal,value:i}:(st=t,t=n)}else st=t,t=n;if(t===n)if(t=st,96===e.charCodeAt(st)?(r=k,st++):(r=n,0===ot&&ft(Le)),r!==n){for(i=[],a=qt(),a===n&&(a=Rt());a!==n;)i.push(a),a=qt(),a===n&&(a=Rt());96===e.charCodeAt(st)?(a=k,st++):(a=n,0===ot&&ft(Le)),a!==n?t={type:s.tstring,parts:i}:(st=t,t=n)}else st=t,t=n}return ot--,t===n&&(r=n,0===ot&&ft(Oe)),lt[l]={nextPos:st,result:t},t}function qt(){let t,s,r,i;const a=38*st+28,o=lt[a];return o?(st=o.nextPos,o.result):(ot++,t=st,123===e.charCodeAt(st)?(s=g,st++):(s=n,0===ot&&ft(ae)),s!==n?(kt(),r=vt(),r!==n?(kt(),125===e.charCodeAt(st)?(i=z,st++):(i=n,0===ot&&ft(ze)),i!==n?t=r:(st=t,t=n)):(st=t,t=n)):(st=t,t=n),ot--,t===n&&(s=n,0===ot&&ft(ke)),lt[a]={nextPos:st,result:t},t)}function Rt(){let t,r,i,a,o;const l=38*st+29,u=lt[l];if(u)return st=u.nextPos,u.result;if(ot++,t=st,r=[],i=st,a=[],o=e.charAt(st),G.test(o)?st++:(o=n,0===ot&&ft(De)),o!==n)for(;o!==n;)a.push(o),o=e.charAt(st),G.test(o)?st++:(o=n,0===ot&&ft(De));else a=n;if(i=a!==n?e.substring(i,st):a,i===n&&(i=st,92===e.charCodeAt(st)?(a=m,st++):(a=n,0===ot&&ft(ie)),a!==n?(e.length>st?(o=e.charAt(st),st++):(o=n,0===ot&&ft(ne)),o!==n?i=o:(st=i,i=n)):(st=i,i=n)),i!==n)for(;i!==n;){if(r.push(i),i=st,a=[],o=e.charAt(st),G.test(o)?st++:(o=n,0===ot&&ft(De)),o!==n)for(;o!==n;)a.push(o),o=e.charAt(st),G.test(o)?st++:(o=n,0===ot&&ft(De));else a=n;i=a!==n?e.substring(i,st):a,i===n&&(i=st,92===e.charCodeAt(st)?(a=m,st++):(a=n,0===ot&&ft(ie)),a!==n?(e.length>st?(o=e.charAt(st),st++):(o=n,0===ot&&ft(ne)),o!==n?i=tt(o):(st=i,i=n)):(st=i,i=n))}else r=n;return r!==n&&(r={type:s.literal,value:r.join("")}),t=r,t===n&&(t=st,123===e.charCodeAt(st)?(r=g,st++):(r=n,0===ot&&ft(ae)),r!==n&&(r={type:s.literal,value:r}),t=r),ot--,t===n&&(r=n,0===ot&&ft(Me)),lt[l]={nextPos:st,result:t},t}function Nt(){let t,s,r,i,a;const o=38*st+33,l=lt[o];if(l)return st=l.nextPos,l.result;if(t=st,s=st,r=e.charAt(st),Q.test(r)?st++:(r=n,0===ot&&ft(je)),r!==n){for(i=[],a=e.charAt(st),K.test(a)?st++:(a=n,0===ot&&ft(He));a!==n;)i.push(a),a=e.charAt(st),K.test(a)?st++:(a=n,0===ot&&ft(He));r=[r,i],s=r}else st=s,s=n;return t=s!==n?e.substring(t,st):s,lt[o]={nextPos:st,result:t},t}function Pt(){let t;const s=38*st+35,r=lt[s];return r?(st=r.nextPos,r.result):(e.substr(st,2)===D?(t=D,st+=2):(t=n,0===ot&&ft(Ve)),t===n&&(e.substr(st,2)===F?(t=F,st+=2):(t=n,0===ot&&ft(Ue))),lt[s]={nextPos:st,result:t},t)}function Lt(){let t;const s=38*st+36,r=lt[s];return r?(st=r.nextPos,r.result):(e.substr(st,2)===I?(t=I,st+=2):(t=n,0===ot&&ft(Ge)),t===n&&(62===e.charCodeAt(st)?(t=$,st++):(t=n,0===ot&&ft(Qe)),t===n&&(e.substr(st,2)===B?(t=B,st+=2):(t=n,0===ot&&ft(Ke)),t===n&&(60===e.charCodeAt(st)?(t=j,st++):(t=n,0===ot&&ft(Je))))),lt[s]={nextPos:st,result:t},t)}function kt(){let t,s;const r=38*st+37,i=lt[r];if(i)return st=i.nextPos,i.result;for(ot++,t=[],s=e.charAt(st),J.test(s)?st++:(s=n,0===ot&&ft(Xe));s!==n;)t.push(s),s=e.charAt(st),J.test(s)?st++:(s=n,0===ot&&ft(Xe));return ot--,lt[r]={nextPos:st,result:t},t}it=l();const zt=it!==n&&st===e.length;function Mt(){throw it!==n&&st<e.length&&ft({type:"end"}),t=at,s=nt<e.length?function(t=st){const s=e.codePointAt(t);return void 0===s?"":String.fromCodePoint(s)}(nt):null,r=nt<e.length?pt(nt,nt+1):pt(nt,nt),new i(i.buildMessage(t,s),t,s,r);var t,s,r}return t.peg$library?{peg$result:it,peg$currPos:st,peg$FAILED:n,peg$maxFailExpected:at,peg$maxFailPos:nt,peg$success:zt,peg$throw:zt?void 0:Mt}:zt?it:void Mt()}(e,{startRule:t===o.MODE_TEMPLATED?"TemplatedRoot":"ExpressionRoot"}))}static evaluate(e,t,s,r){return new a(e,t).visitRoot(s,r===o.MODE_TEMPLATED)}static interpret(e,t,s,r){return o.evaluate(e,t,o.parse(s,r),r)}}class l{#s;#r;constructor(e,t){this.#s=e,this.#r=t}withModule(e,t){const s=e?{[e]:t}:t;return new l({...this.#s,...s},this.#r)}withOverlay(...e){return new l(this.#s,0===e.length?this.#r:[...this.#r,...e])}resolve(e){return n(this.#r,e)}evaluateExpression(e){return o.interpret(this.#s,this.#r,e,o.MODE_EXPRESSION)}evaluateTemplated(e){return o.interpret(this.#s,this.#r,e,o.MODE_TEMPLATED)}}class u{static fromHtml(...e){const t=document.createElement("template");return t.innerHTML=e.map(e=>e.trim()).join(""),document.adoptNode(t.content)}static toHtml(e){var t=document.createElement("template");return t.content.appendChild(e),t.innerHTML}static isBlank(e){return 0===e.childElementCount&&""===e.textContent.trim()}static from(...e){const t=new DocumentFragment;for(const s of e)t.appendChild(s);return t}static fromChildNodes(e){const t=new DocumentFragment;for(;e.firstChild;)t.appendChild(e.firstChild);return t}}class c{static id=0;static uid(e){return`${e}-${++c.id}`}static defaultValue(e,t,s){return e.hasAttribute(t)||e.setAttribute(t,s),e.getAttribute(t)}static forward(e,t,s){t.getAttributeNames().filter(t=>t.startsWith(e)).forEach(r=>{const i=r.substring(e.length);if("class"===i){const r=t.getAttribute(`${e}class`)?.split(/\s+/).filter(e=>e.length)??[];return void s.classList.add(...r)}s.setAttribute(i,t.getAttribute(r))})}static set(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)}}class d{static from(e){for(const t of e.children)t.matches('[slot=""]')&&t.removeAttribute("slot");const t=Array.from(e.children).filter(e=>e.matches("[slot]")).map(e=>{e.remove();const t=e.getAttribute("slot");return e.removeAttribute("slot"),[t,d.slotFromNode(e)]}),s={};s.default=new DocumentFragment,s.default.append(...e.childNodes);for(const[e,r]of t)e in s||(s[e]=new DocumentFragment),s[e].append(r);return s}static slotFromNode(e){return e instanceof HTMLTemplateElement?document.adoptNode(e.content):e instanceof HTMLScriptElement&&"text/html"===e.type?u.fromHtml(e.innerHTML):e}}class h{static isParsed(e){for(let t=e;t;t=t.parentNode)if(t.nextSibling)return!0;return!1}static waitDomContentLoaded(e){if("loading"===e.readyState)return new Promise(t=>{e.addEventListener("DOMContentLoaded",()=>t(void 0),{once:!0})});if("complete"===e.readyState)return Promise.resolve();const t=e.defaultView;return null===t?Promise.resolve():new Promise(e=>{const s=()=>{t.removeEventListener("DOMContentLoaded",s),t.removeEventListener("load",s),e(void 0)};t.addEventListener("DOMContentLoaded",s),t.addEventListener("load",s)})}static waitParsed(e){return h.isParsed(e)?Promise.resolve(e):new Promise(t=>{const s=new MutationObserver(()=>{h.isParsed(e)&&(s.disconnect(),t(e))});for(let t=e.parentNode;t;t=t.parentNode)s.observe(t,{childList:!0});h.waitDomContentLoaded(e.ownerDocument).then(()=>{s.disconnect(),t(e)})})}static queryChildren(e,t){for(const s of e.children)if(s.matches(t))return s;return null}static queryChildrenAll(e,t){const s=[];for(const r of e.children)r.matches(t)&&s.push(r);return s}}class p{#u=new Set;removed(e){return this.#u.has(e)}remove(e){e.replaceChildren?.(),Object.keys(e.dataset||{}).filter(e=>e.startsWith("tpl")).forEach(t=>{delete e.dataset[t]}),this.#u.add(e)}popData(e,t){const s=e.dataset[t];return delete e.dataset[t],s}prepend(e,t){e.parentNode.insertBefore(t,e)}append(e,t){e.parentNode.insertBefore(t,e.nextSibling)}replace(e,t){this.prepend(e,t),this.remove(e)}cleanup(){for(const e of this.#u)e.remove();this.#u.clear()}}class f{static ORDERED_COMMANDS=["tplIf","tplWith","tplEach","tplWhen","tplClassAppend","tplAttrAppend","tplRemove","tplVerbatim"];static tplIf(e,t,s,r){r.evaluateExpression(t)||s.remove(e)}static tplWith(e,t,s,r){const i=r.evaluateExpression(t),n=s.popData(e,"tplVar"),a=new b(e,r).withOverlay(n?{[n]:i}:i).render();s.replace(e,a)}static tplEach(e,t,s,r){const i=s.popData(e,"tplVar"),n=s.popData(e,"tplStat"),a=new b(e,r),o=r.evaluateExpression(t),l=null===o||"object"!=typeof o?void 0:Object.getPrototypeOf(o),u=o instanceof Map?[...o]:o?.[Symbol.iterator]||l!==Object.prototype&&null!==l?null:Object.entries(o),c=null===u?o:u.map(([e,t])=>({key:e,value:t}));if(!c?.[Symbol.iterator])throw new Error(`Expected an iterable got '${o}'`);if(!n){for(const t of c)s.prepend(e,a.withOverlay(i?{[i]:t}:t).render());return void s.remove(e)}const d=Array.isArray(c)||"number"==typeof c.length?c.length:"number"==typeof c.size?c.size:null;let h=0;for(const t of c){const r={index:h,count:h+1,size:d,first:0===h,last:null===d?null:h===d-1,even:h%2==0,odd:h%2==1};s.prepend(e,a.withOverlay({[n]:r},i?{[i]:t}:t).render()),++h}s.remove(e)}static tplWhen(e,t,s,r){r.evaluateExpression(t)||s.remove(e)}static tplVerbatim(e,t,s,r){const i=e.cloneNode(!0);s.replace(e,i)}static tplRemove(e,t,s,r){switch(t.toLowerCase()){case"tag":{const t=new DocumentFragment;for(;e.firstChild;)t.appendChild(e.firstChild);"tplVerbatim"in e.dataset?(s.popData(e,"tplVerbatim"),s.replace(e,t)):(s.append(e,t),s.remove(e));break}case"body":e.replaceChildren();break;case"all":s.remove(e)}}static tplClassAppend(e,t,s,r){const i=r.evaluateExpression(t);if(!i)return;const n=(Array.isArray(i)?i:[i]).flatMap(e=>"string"==typeof e?e.split(" "):e).filter(Boolean);0!==n.length&&e.classList.add(...n)}static tplAttrAppend(e,t,s,r){const i=r.evaluateExpression(t);i&&0!==i.length&&(Array.isArray(i[0])?i:[i]).forEach(([t,s])=>{e.setAttribute(t,s)})}static textNode(e,t,r,i){for(const n of i.evaluateTemplated(t))if(null!=n.value)switch(n.type){case s.dom.t:r.prepend(e,document.createTextNode(n.value));break;case s.dom.h:r.prepend(e,u.fromHtml("string"==typeof n.value?n.value:String(n.value)));break;case s.dom.n:if(!(n.value instanceof Node))throw new TypeError(`Expected a Node, got '${typeof n.value}'`);r.prepend(e,n.value)}r.remove(e)}}const m=new t(1e3);function g(e){return m.getOrCompute(e,e=>e.substring(3).split(/(?=[A-Z])/).join("-").toLowerCase())}class b{static fromHtml(e,t,...s){return new b(u.fromHtml(e),new l(t,s))}static fromSelector(e,t,...s){const r=document.querySelector(e);if(!(r instanceof HTMLTemplateElement))throw new Error("template selector does not match any template tag");const i=document.adoptNode(r.content);return new b(i,new l(t,s))}static fromTemplate(e,t,...s){const r=document.adoptNode(e.content);return new b(r,new l(t,s))}static fromFragment(e,t,...s){return new b(e,new l(t,s))}#c;#d;constructor(e,t){this.#c=e,this.#d=t}withEvaluator(e){return new b(this.#c,e)}withFragment(e){return new b(e,this.#d)}withModule(e,t){return new b(this.#c,this.#d.withModule(e,t))}withOverlay(...e){return new b(this.#c,this.#d.withOverlay(...e))}evaluateExpression(e,...t){return this.#d.withOverlay(...t).evaluateExpression(e)}evaluateTemplated(e,...t){return this.#d.withOverlay(...t).evaluateTemplated(e)}evaluator(){return this.#d}render(){try{const e=new p,t=document.importNode(this.#c,!0),s=t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?t:(()=>{const e=new DocumentFragment;return e.appendChild(t),e})(),r=document.createNodeIterator(s,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,b.#h);let i;for(;null!==(i=r.nextNode());){if(e.cleanup(),i.nodeType===Node.TEXT_NODE){try{f.textNode(i,i.nodeValue,e,this.#d)}catch(e){throw v.wrap("Error evaluating text node",i,e)}continue}const t=i;for(const s of f.ORDERED_COMMANDS){if(!(s in t.dataset))continue;const r=e.popData(t,s);try{f[s](t,r,e,this.#d)}catch(e){throw v.wrap(`Error evaluating data-tpl-${g(s)}="${r}"`,t,e)}if(e.removed(t))break}for(const s of Object.keys(t.dataset||{})){if(!s.startsWith("tpl"))continue;const r=g(s),i=e.popData(t,s);try{const e=this.#d.evaluateExpression(i);if("boolean"==typeof e){t.toggleAttribute(r,e);continue}null!=e&&t.setAttribute(r,e)}catch(e){throw v.wrap(`Error evaluating data-tpl-${g(s)}="${i}"`,t,e)}}}return e.cleanup(),s}catch(e){if(e instanceof v)throw e;throw new v("Error rendering template",this.#c,e)}}renderTo(e){e.replaceChildren(this.render())}appendTo(e){e.appendChild(this.render())}renderToSelector(e){const t=document.querySelector(e);t&&this.renderTo(t)}appendToSelector(e){const t=document.querySelector(e);t&&this.appendTo(t)}static#h(e){if(e.nodeType===Node.TEXT_NODE)return e.nodeValue.includes("{{")&&e.nodeValue.includes("}}")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT;for(const t of e.attributes)if(t.name.startsWith("data-tpl-"))return NodeFilter.FILTER_ACCEPT;return NodeFilter.FILTER_SKIP}}class v extends Error{static FRAMES=3;#p;#f;truncated=!1;static wrap(e,t,s){return s instanceof v&&s.depth>=v.FRAMES?(s.truncated=!0,s):new v(e,t,s)}constructor(e,t,s){super(`${e} in \`${v.describe(t)}\``,{cause:s}),this.name="RenderError",this.#p=t,this.#f=(s instanceof v?s.depth:0)+1}get depth(){return this.#f}get node(){return this.#p}get html(){return v.stringify(this.#p)}static describe(e){if(e.nodeType===Node.TEXT_NODE)return v.#m(String(e.nodeValue).trim());if(e.nodeType===Node.ELEMENT_NODE){const t=e,s=Array.from(t.attributes,e=>` ${e.name}="${e.value}"`).join("");return v.#m(`<${t.localName}${s}>`)}const t=Array.from(e.childNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE||String(e.nodeValue??"").trim().length>0).map(e=>v.describe(e));return v.#m(t.join(""))}static#m(e){return e.length>120?`${e.slice(0,120)}…`:e}static stringify(e){const t=document.createElement("template");return t.content.appendChild(v.#g(e.cloneNode(!0))),t.innerHTML}static#g(e){e.nodeType===Node.TEXT_NODE&&(e.nodeValue=e.nodeValue.trim());for(let t=0;t<e.childNodes.length;t++){const s=e.childNodes[t];s.nodeType===Node.TEXT_NODE?(s.nodeValue=s.nodeValue.trim(),0===s.nodeValue.length&&(e.removeChild(s),t--)):s.nodeType===Node.ELEMENT_NODE&&v.#g(s)}return e}}class y{#b=new Map;#v;#y=new Promise(e=>{this.#v=e});constructor(){h.waitDomContentLoaded(document).then(()=>{this.#w()})}ready(){return this.#y}async#w(){await this.settled(),document.dispatchEvent(new CustomEvent("ftl:ready",{bubbles:!1,cancelable:!1})),this.#v()}enqueue(e){if(this.#b.has(e))return;const{promise:t,resolve:s}=Promise.withResolvers(),r=h.waitParsed(e).then(()=>e.upgrade()).finally(()=>{this.#b.delete(e),s()});this.#b.set(e,{upgrade:r,finished:t})}async#E(e,t){for(;;){const s=Array.from(this.#b).filter(([t])=>e(t)).map(([,e])=>t(e));if(0===s.length)return;await Promise.all(s)}}settled(){return this.#E(()=>!0,e=>e.finished)}upgraded(e){return this.#E(e,e=>e.upgrade)}whenUpgraded(e){return this.#b.get(e)?.upgrade}pending(){return Array.from(this.#b.keys())}}class w{#x={};#A=!1;#S={string:{unmarshal:(e,t,s)=>e,marshal:(e,t,s)=>null==e?null:String(e)},number:{unmarshal:(e,t,s)=>null===e?null:Number(e),marshal:(e,t,s)=>null==e?null:String(e)},presence:{unmarshal:(e,t,s)=>null!==e,marshal:(e,t,s)=>e?"":null},bool:{unmarshal:(e,t,s)=>"true"===e,marshal:(e,t,s)=>null==e?null:String(!0===e)},json:{unmarshal:(e,t,s)=>null===e?null:JSON.parse(e),marshal:(e,t,s)=>null==e?null:JSON.stringify(e)},csv:{unmarshal:(e,t,s)=>null===e?[]:e.split(",").map(e=>e.trim()).filter(e=>e),marshal:(e,t,s)=>null==e?null:e.join(",")}};#T={};#s;#C=[];#d=new l(void 0,[]);#_=new y;defineElement(e,t){return this.#A?(this.#O(e,t),this):(this.#x[e]=t,this)}static declarationsOf(e){const t=[];for(let s=e;null!==s&&s!==HTMLElement;s=Object.getPrototypeOf(s))t.unshift(s);const s=e=>t.flatMap(t=>Object.getOwnPropertyDescriptor(t,e)?.value??[]);return{observed:s("observed"),attributes:s("attributes")}}static propertyOf(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}#O(e,t){const{observed:s,attributes:r}=w.declarationsOf(t),{template:i,templates:n,slots:a,mappers:o,config:l}=t,u=s.map(e=>e.split(":")[0]),c=[...new Set(u.reverse())].reverse(),d=[...r,...s].reduce((e,t)=>{const[s,r]=t.split(":"),i=r??"string";if(!(i in this.#S)&&!(i in(o??{})))throw new Error(`unsupported attribute type: ${i}`);return e[s]=o?.[i]??this.#S[i],e},{}),h=Object.entries(Object.assign({},n,i?{default:i}:{})).map(([e,t])=>[e,b.fromHtml(t)]),p=Object.fromEntries(h);t.BITS={registry:this,enqueue:e=>this.#_.enqueue(e),SLOTS:a,CONFIG:l,OBSERVED:c,DECLARED:[...new Set([...c,...r.map(e=>e.split(":")[0])])],ATTR_TO_MAPPER:d,ATTR_TO_PROPERTY:Object.fromEntries(c.map(e=>[e,w.propertyOf(e)])),TEMPLATES:p},customElements.define(e,t)}defineModule(e,t){const s=e?{[e]:t}:t;return this.#s={...this.#s,...s},this.#q(),this}defineModules(e){return this.#s=e,this.#q(),this}defineComponent(e,t){return this.#T[e]=t,this}defineData(...e){return this.#C=e,this.#q(),this}defineOverlay(...e){return this.#C=[...this.#C,...e],this.#q(),this}defineMapper(e,t){return this.#S[e]=t,this}plugin(e){return e.configure(this),this}configure(){for(const[e,t]of Object.entries(this.#x))this.#O(e,t),delete this.#x[e];return this.#A=!0,this}settle(e){return this.#_.upgraded(e)}whenUpgraded(e){return this.#_.whenUpgraded(e)}pending(){return this.#_.pending()}ready(){return this.#_.ready()}#q(){this.#d=new l(this.#s,this.#C)}evaluator(){return this.#d}component(e){return this.#T[e]}}const E=new w;class x{static fromHtml(e){return b.fromHtml(e).withEvaluator(E.evaluator())}static fromSelector(e){return b.fromSelector(e).withEvaluator(E.evaluator())}static fromTemplate(e){return b.fromTemplate(e).withEvaluator(E.evaluator())}static fromFragment(e){return b.fromFragment(e).withEvaluator(E.evaluator())}}class A{static waitFor(e){return E.settle(t=>e.contains(t))}static waitForChildren(e){return E.settle(t=>e!==t&&e.contains(t))}}class S extends HTMLElement{static BITS={registry:E,enqueue:e=>{},SLOTS:!1,CONFIG:void 0,OBSERVED:[],DECLARED:[],ATTR_TO_MAPPER:{},ATTR_TO_PROPERTY:{},TEMPLATES:{}};static get observedAttributes(){return this.BITS.OBSERVED}constructor(){super(),this.internals=this.attachInternals()}internals;#R=!1;#N=!1;#P=new Set;#L=null;#k={};#z(){return this.constructor.BITS}#M(e){const t=this.#z().ATTR_TO_MAPPER[e];if(!t)throw new Error(`${this.constructor.name} declares no attribute '${e}': declare it in static observed or static attributes, or read it with getAttribute`);return t}unmarshal(e,t){return this.#M(e).unmarshal(t,e,this)}marshal(e,t){return this.#M(e).marshal(t,e,this)}get _registry(){return this.#z().registry}component(e){return this.#z().registry.component(e)}template(e){const t=this.#z().TEMPLATES[e??"default"];if(!t)throw new Error(`no template named '${e??"default"}' on ${this.constructor.name}`);const s=t.withEvaluator(this.#z().registry.evaluator()),r=this.#z().CONFIG;return r?s.withOverlay({config:r}):s}connectedCallback(){this.#N||this.#z().enqueue(this)}attributeChangedCallback(e,t,s){t!==s&&(this.#P.has(e)||(this.#R?this[this.#z().ATTR_TO_PROPERTY[e]]=this.unmarshal(e,s):null!==this.#L&&e in this.#L&&(this.#L[e]=this.unmarshal(e,s))))}async upgrade(){if(this.#N)return;this.#N=!0;const e=this.#z().SLOTS?d.from(this):void 0,t=Object.fromEntries(this.#z().DECLARED.map(e=>[e,this.unmarshal(e,this.getAttribute(e))])),s=new Set(this.#z().OBSERVED);this.#k=Object.fromEntries(Object.entries(t).filter(([e])=>!s.has(e))),this.#L=t;try{await this.render({slots:e});const s=this.#z().ATTR_TO_PROPERTY;for(const e of this.#z().OBSERVED)this[s[e]]=t[e];this.#R=!0,this.internals.states.add("rendered")}finally{this.#L=null}}render(e){}declared(e){return e in this.#k?this.#k[e]:null!==this.#L&&e in this.#L?this.#L[e]:this.unmarshal(e,this.getAttribute(e))}get rendered(){return this.#R}reflectTo(e,t){const s=this.marshal(e,t);if(s!==this.getAttribute(e)){this.#P.add(e);try{c.set(this,e,s)}finally{this.#P.delete(e)}}}}const T=/\{(\w+)\}/g,C=/\{(\d+)\}/g,_=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),O=new Set,q=e=>{O.has(e)||(O.add(e),console.warn(`l10n: ${e}`))},R=new t(100),N=(e,t,s)=>{const r=`${e.name}|${t??""}|${void 0===s?"":JSON.stringify(s)}`;return R.getOrCompute(r,()=>new e(t,s))};class P{static t(e,...t){let s=(this.l10n??{})[e];if(void 0===s)return q(`missing message "${e}"`),e;if(_(s)){const r=1===t.length&&_(t[0])?t[0]:{};if("number"!=typeof r.count)q(`plural message "${e}" needs a numeric {count}`),s=s.other;else{const e=this.locale??navigator?.language??"en";s=s[N(Intl.PluralRules,e).select(r.count)]??s.other}}if(void 0===s||"object"==typeof s)return q(`plural message "${e}" has no "other" form`),e;if(1===t.length&&_(t[0])){const r=t[0];return s.replace(T,(t,s)=>s in r?String(r[s]):(q(`message "${e}" wants {${s}}`),t))}return t.length>0?s.replace(C,(s,r)=>{const i=Number(r);return i>=t.length?(q(`message "${e}" wants {${r}}`),s):String(t[i])}):s}static date(e,t){return N(Intl.DateTimeFormat,this.locale,t).format(e)}static number(e,t){return N(Intl.NumberFormat,this.locale,t).format(e)}static bytes(e){const t=N(Intl.NumberFormat,this.locale,{maximumFractionDigits:2}).format;return e>=1073741824?`${t(e/1024/1024/1024)}GiB`:e>=1048576?`${t(e/1024/1024)}MiB`:e>=1024?`${t(e/1024)}KiB`:`${t(e)}B`}static of(e={}){const t=e=>E.evaluator().resolve(e),s=s=>(...r)=>s.apply({l10n:t("l10n"),locale:e.locale??t("locale")},r);return{t:s(P.t),date:s(P.date),number:s(P.number),bytes:s(P.bytes)}}}var L=Object.freeze({__proto__:null,Attributes:c,BoundedCache:t,ExpressionEvaluator:l,Expressions:o,Fragments:u,LightSlots:d,Localization:P,Nodes:h,ParsedElement:S,Registry:w,RenderError:v,Rendering:A,Template:b,Templates:x,registry:E});class k extends Error{constructor(e,t,s){super(e,{cause:s}),this.name="Failure",this.problems=t}dropping(e){return new k(this.message,k.dropProblemsContext(this.problems,e),this)}static dropProblemsContext(e,t){return e.map(({type:e,context:s,reason:r,details:i})=>({type:e,context:s?.startsWith(t)?s.substring(t.length):s,reason:r,details:i}))}static problemsText(e,t=null){return e?.problems?.length?e.problems.map(e=>`${e.reason}`).join("\n"):t??`${e?.message??e}`}}class z{static encode(e,t){const s=t||z.URL_SAFE,r=e.byteLength,i=new Uint8Array(e);let n="";for(let e=0;e<r;e+=3)n+=s[i[e]>>2]+s[(3&i[e])<<4|i[e+1]>>4]+s[(15&i[e+1])<<2|i[e+2]>>6]+s[63&i[e+2]];return r%3==2?n=n.substring(0,n.length-1):r%3==1&&(n=n.substring(0,n.length-2)),n}static decode(e,t){const s=t||z.URL_SAFE;let r=e.length;for(;r>0&&"="===e.charAt(r-1);)--r;const i=e.substring(0,r);if(e.length-r>2||i.includes("=")||0===i.length&&e.length>0)throw new Error("invalid padding");if(i.length%4==1)throw new Error("invalid length");for(const e of i)if(-1===s.indexOf(e))throw new Error(`invalid character '${e}'`);const n=Math.floor(.75*i.length),a=new Uint8Array(n);let o=0,l=0;for(;o<n;){const e=s.indexOf(i.charAt(l++)),t=s.indexOf(i.charAt(l++)),r=s.indexOf(i.charAt(l++)),u=s.indexOf(i.charAt(l++));if(a[o++]=e<<2|t>>4,o===n)break;if(a[o++]=(15&t)<<4|r>>2,o===n)break;a[o++]=(3&r)<<6|u}return a.buffer}}z.STANDARD="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",z.URL_SAFE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";class M{static decode(e){if(e.length%2!=0)throw new Error("invalid length");if(!/^[0-9a-fA-F]*$/.test(e))throw new Error("invalid character");const t=e.length/2;return new Uint8Array(t).map((t,s)=>{const r=2*s,i=e.substring(r,r+2);return parseInt(i,16)})}static encode(e,t){return Array.from(e).map(e=>e.toString(16)).map(e=>t?e.toUpperCase():e).map(e=>e.padStart(2,"0")).join("")}}class D{#D;#F;constructor(e,t){this.#D=e,this.#F=t}get normalized(){return`${this.#D}/${this.#F}`}get type(){return this.#D}get subtype(){return this.#F}static parse(e){if(!e)return new D("unknown","unknown");const[t,s]=e.split(";"),[r,i]=t.trim().toLowerCase().split("/");return r&&i?new D(r,i):new D("unknown","unknown")}}class F extends k{constructor(e,t,s,r){super(e,s,r),this.name="HttpClientError",this.status=t}dropping(e){return new F(this.message,this.status,k.dropProblemsContext(this.problems,e),this)}static problem(e,t){return{type:e,context:null,reason:t,details:null}}static of(e,t){const s=String(t?.message??t??"unknown failure");return new F(s,0,[F.problem(e,s)],t)}static async fromResponse(e){switch(D.parse(e.headers.get("Content-Type")).normalized){case"application/failures+json":{const t=await e.json().catch(()=>F.#I);if(t===F.#I)return F.#$(e);if(!Array.isArray(t))return F.#$(e,"as a failures array");const s=`${e.status} ${e.statusText}: ${t.length} failures`;return new F(s,e.status,t)}case"application/problem+json":{const t=await e.json().catch(()=>F.#I);if(t===F.#I)return F.#$(e);if("object"!=typeof t||null===t||Array.isArray(t))return F.#$(e,"as a problem object");const s=`${e.status} ${e.statusText}: ${t.title} ${t.detail}`;return new F(s,e.status,t.problems||[F.problem("GENERIC_PROBLEM",s)])}default:return F.#B(e)}}static#I=Symbol("unreadable body");static#$(e,t="as json"){const s=D.parse(e.headers.get("Content-Type")).normalized,r=`${e.status} ${e.statusText}: the ${s} body does not decode ${t}`;return new F(r,e.status,[F.problem("GENERIC_PROBLEM",r)])}static async#B(e){const t=await e.text().catch(()=>null),s=null===t?`${e.status} ${e.statusText}: the body could not be read`:`${e.status} ${e.statusText}: ${t}`;return new F(s,e.status,[F.problem("GENERIC_PROBLEM",s)])}}const I=e=>globalThis.document?.querySelector(`meta[name="${e}"]`)?.getAttribute("content")??void 0;class ${async intercept(e,t,s){if(e.origin!==(globalThis.window?.location?.origin??e.origin))return await s.proceed(e,t);const r=I("_csrf_header"),i=I("_csrf");return r&&i&&t.headers.set(r,i),await s.proceed(e,t)}}class B{#j;constructor(e){this.#j=e}async intercept(e,t,s){const r=await s.proceed(e,t);return 401===r.status?(window.location.href=this.#j,new Promise(()=>{})):r}}class j{#H;constructor(){this.#H=[]}withCsrfToken(){return this.#H.push(new $),this}withRedirectOnUnauthorized(e){return this.#H.push(new B(e)),this}withInterceptors(...e){return this.#H.push(...e),this}build(){return new V(this.#H)}}class H{async intercept(e,t,s){try{return await fetch(e,t)}catch(e){throw F.of("CONNECTION_PROBLEM",e)}}}class W{#H;#W;constructor(e,t){this.#H=e,this.#W=t}async proceed(e,t){const s=this.#H[this.#W];return await s.intercept(e,t,new W(this.#H,this.#W+1))}}class V{#H;static builder(){return new j}constructor(e){this.#H=e||[]}async exchange(e,t,s){const r=[...this.#H,...s||[],new H],i=new W(r,0),n=new URL(new Request(e).url),a={...t,headers:new Headers(t?.headers)};return await i.proceed(n,a)}request(e,t){return Q.create(this,e,t)}get(e){return Q.create(this,"GET",e)}head(e){return Q.create(this,"HEAD",e)}post(e){return Q.create(this,"POST",e)}put(e){return Q.create(this,"PUT",e)}patch(e){return Q.create(this,"PATCH",e)}delete(e){return Q.create(this,"DELETE",e)}}const U=async(e,t)=>{try{return await e[t]()}catch(e){throw F.of("UNMARSHALING_PROBLEM",e)}},G=e=>null==e?[]:"string"==typeof e?new URLSearchParams(e):"function"==typeof e[Symbol.iterator]?e:Object.entries(e);class Q{#V;#U;#G;#Q;#K;#J;#X;#H;#c;static create(e,t,s){const r=s.indexOf("#"),i=-1===r?"":s.slice(r),n=-1===r?s:s.slice(0,r),a=n.indexOf("?");return new Q(e,t,-1===a?n:n.slice(0,a),new URLSearchParams(-1===a?"":n.slice(a+1)),new Headers,void 0,{},[],i)}constructor(e,t,s,r,i,n,a,o,l=""){this.#V=e,this.#U=t,this.#G=s,this.#Q=r,this.#J=n,this.#K=i,this.#X=a,this.#H=o,this.#c=l}headers(e){for(const[t,s]of G(e))null==s?this.#K.delete(t):this.#K.set(t,s);return this}header(e,t){return null==t?this.#K.delete(e):this.#K.set(e,t),this}params(e){for(const[t,s]of G(e))null==s?this.#Q.delete(t):this.#Q.set(t,s);return this}param(e,...t){this.#Q.delete(e);const s=t.filter(e=>null!=e);if(0===s.length)return this;for(const t of s)this.#Q.append(e,t);return this}body(e){return this.#J=e,this}json(e){if(void 0===e)return this;const t=JSON.stringify(e);return this.#K.set("Content-Type","application/json"),this.#J=t,this}multipart(e){const t=new FormData;return e(new K(t)),this.#J=t,this}options(e){for(const[t,s]of Object.entries(e))this.#X[t]=s;return this}option(e,t){return this.#X[e]=t,this}interceptors(e){for(const t of e)this.#H.push(t);return this}interceptor(e){return this.#H.push(e),this}async exchange(){const e=this.#Q.size?`?${this.#Q}`:"",t={...this.#X,headers:this.#K,method:this.#U,body:this.#J};return await this.#V.exchange(`${this.#G}${e}${this.#c}`,t,this.#H)}async fetch(){try{const e=await this.exchange();if(!e.ok)throw await F.fromResponse(e);return e}catch(e){if(e instanceof k)throw e;throw F.of("UNEXPECTED_PROBLEM",e)}}async fetchText(){const e=await this.fetch();return await U(e,"text")}async fetchJson(){const e=await this.fetch();return 204===e.status?null:await U(e,"json")}async fetchBlob(){const e=await this.fetch();return await U(e,"blob")}async fetchArrayBuffer(){const e=await this.fetch();return await U(e,"arrayBuffer")}}class K{#Y;constructor(e){this.#Y=e}field(e,t){return this.#Y.append(e,t),this}blob(e,t,s){return this.#Y.append(e,t,s),this}blobs(e,t){for(const s of t)this.#Y.append(e,s);return this}json(e,t,s){const r=new Blob([JSON.stringify(t)],{type:"application/json"});return this.#Y.append(e,r,s),this}}var J=Object.freeze({__proto__:null,Base64:z,Failure:k,Hex:M,HttpClient:V,HttpClientBuilder:j,HttpClientError:F,HttpInterceptorChain:W,HttpMultipartRequestCustomizer:K,HttpRequestBuilder:Q,MediaType:D});const X=e=>{const t=t=>{try{e().removeItem(t)}catch{}},s=s=>{let r;try{r=e().getItem(s)}catch{return}if(null!==r)try{return JSON.parse(r)}catch{return void t(s)}};return{save:(t,s)=>{e().setItem(t,JSON.stringify(s))},load:s,remove:t,pop:e=>{const r=s(e);return t(e),r}}},Y=e=>({save(t,s,r){e.save(t,{revision:s,data:r})},load(t,s){const r=e.load(t);if(null!=r&&"object"==typeof r&&r.revision===s)return r.data;e.remove(t)}}),Z=X(()=>localStorage),ee=X(()=>sessionStorage),te=Y(Z),se=Y(ee);class re{static async fireAsync(e,t,s){e.dispatchEvent(t);const r=t.async?.promises??[],i=s?.mode??"broadcast";if("pipeline"===i&&r.length>1||"delegate"===i&&1!==r.length)throw Promise.all(r).catch(()=>{}),new Error("pipeline"===i?`[AsyncEvents] Event "${t.type}" is configured in 'pipeline' mode and expects at most one async listener, but ${r.length} listeners were triggered on this element.`:`[AsyncEvents] Event "${t.type}" is configured in 'delegate' mode and requires exactly one async listener, but ${r.length} were registered.`);return"broadcast"===i?Promise.all(r):Promise.resolve(r[0])}static asyncOn(e,t,s,r){const i=async e=>{const t=e;t.async||(t.async={promises:[]});const{promise:r,resolve:i,reject:n}=Promise.withResolvers();t.async.promises.push(r);try{i(await s(t))}catch(e){n(e)}};return e.addEventListener(t,i,r),i}static asyncOff(e,t,s,r){e.removeEventListener(t,s,r)}static mixInto(...e){for(const t of e)Object.assign(t.prototype,{async fireAsync(e,t){return await re.fireAsync(this,e,t)},asyncOn(e,t,s){return re.asyncOn(this,e,t,s)},asyncOff(e,t,s){re.asyncOff(this,e,t,s)}})}}class ie{#Z=0;take(){return++this.#Z,this.hold()}hold(){const e=this.#Z,t=this;return{get stale(){return e!==t.#Z}}}invalidate(){++this.#Z}}class ne{static sleep(e){return new Promise(t=>setTimeout(t,e))}static debounce(e,t,s){const r=s?.immediate??!1;let i=null,n=[],a=0;const o=()=>{const s=performance.now()-a;e>s?i=setTimeout(o,e-s):(i=null,r||t(...n),null===i&&(n=[]))};return[(...s)=>{n=s,a=performance.now(),null===i&&(i=setTimeout(o,e),r&&t(...n))},()=>{clearTimeout(i??void 0),i=null,n=[]}]}static throttle(e,t,s){const r=s?.leading??!0,i=s?.trailing??!0;let n=null,a=[],o=0;const l=()=>{o=r?performance.now():0,n=null,t(...a),null===n&&(a=[])};return[(...s)=>{const u=performance.now();o||r||(o=u);const c=0===o?0:e-(u-o);a=s,c<=0||c>e?(null!==n&&(clearTimeout(n),n=null),o=u,t(...a),null===n&&(a=[])):null===n&&i&&(n=setTimeout(l,c))},()=>{clearTimeout(n??void 0),n=null,a=[]}]}}class ae{static flatten(e,t,s){return Object.keys(e).reduce((r,i)=>{const n=t.length?`${t}.${i}`:i;return s.has(n)||"object"!=typeof e[i]||null===e[i]?r[n]=e[i]:Object.assign(r,ae.flatten(e[i],n,s)),r},{})}static#ee=new Set(["__proto__","prototype","constructor"]);static providePath(e,t,s){const r=t.split(".").map(e=>/^[0-9]+$/.test(e)?+e:e);for(const e of r)if(ae.#ee.has(e))throw new Error(`unsupported name segment '${e}' in '${t}'`);let i=e??{},n=null;for(let t=0;;++t){const a=r[t],o=r[t-1];if(Number.isInteger(a)&&!Array.isArray(i)&&(null!==n?n[o]=i=[]:e=i=[]),t===r.length-1)return i[a]=void 0!==s?s:a in i?i[a]:null,e;"object"==typeof i[a]&&null!==i[a]||(i[a]={}),n=i,i=i[a]}}static extract(e){if("radio"===e.getAttribute("type")){if(!e.checked)return;return"boolean"===e.dataset.fulBindType?"true"===e.value:e.value}return"checkbox"===e.getAttribute("type")?e.checked:"boolean"===e.dataset.fulBindType?e.value?"true"===e.value:null:"SELECT"===e.tagName&&e.multiple?Array.from(e.selectedOptions).map(e=>e.value):"INPUT"!==e.tagName&&"SELECT"!==e.tagName&&"TEXTAREA"!==e.tagName||""!==e.value&&void 0!==e.value?e.value:null}static#te(e){return"submit"===e.type||"reset"===e.type||"button"===e.type}static extractFrom(e,t){let s={};for(const r of e.elements)r.hasAttribute("name")&&(ae.#te(r)&&r!==t||r.matches(":disabled")&&r!==t||(s=ae.providePath(s,r.getAttribute("name"),ae.extract(r))));return s}static mutate(e,t){if("radio"!==e.getAttribute("type"))if("checkbox"!==e.getAttribute("type")){if("SELECT"===e.tagName&&e.multiple){const s=Array.isArray(t)?t.map(String):null==t?[]:[String(t)];return void Array.from(e.options).forEach(e=>{e.selected=s.includes(e.value)})}e.value=t}else e.checked=t;else e.checked=null!=t&&e.getAttribute("value")===String(t)}static mutateIn(e,t){const s=Array.from(e.elements).map(e=>e.getAttribute("name")).filter(e=>e);for(const[r,i]of Object.entries(ae.flatten(t,"",new Set(s))))for(const t of e.querySelectorAll(`[name='${CSS.escape(r)}']`))ae.mutate(t,i)}static errors(e,t,s){e.querySelectorAll("ful-field-error").forEach(e=>{e.setAttribute("aria-live",s?"off":"polite")});const r=e=>("FIELD_ERROR"===e.type||"INVALID_FORMAT"===e.type)&&e.context,i=t.filter(r),n=t.filter(e=>!r(e));e.querySelectorAll("[name]").forEach(e=>{e.setCustomValidity?.("")}),e.querySelectorAll("ful-errors").forEach(e=>{e.setAttribute("role","alert"),e.replaceChildren(),e.setAttribute("hidden","")});const a=[];i.forEach(t=>{const s=t.context.replace(/\[/g,".").replace(/\]\./g,".").replace(/\]/g,"").split(".");for(let r=s.length;0!==r;--r){const i=s.slice(0,r).join("."),n=e.querySelectorAll(`[name='${CSS.escape(i)}']`);if(0===n.length)continue;const a=s.slice(r).join(".");return void n.forEach(e=>{e.setCustomValidity?.(t.reason,a)})}a.push(t)});const o=[...n,...a];e.querySelectorAll("ful-errors").forEach(e=>{const t=e;0!==o.length?(e.removeAttribute("hidden"),t.innerText=o.map(e=>e.reason).join("\n")):t.innerText=""}),0!==t.length&&s&&Array.from(e.querySelectorAll(":invalid")).sort((e,t)=>e.getBoundingClientRect().y-t.getBoundingClientRect().y)[0]?.focus()}}class oe extends S{static formAssociated=!0;static observed=["disabled:presence","readonly:presence","required:presence","value"];static ROLE="presentation";#se;#re;#ie;#ne;#ae=[];constructor(){super(),this.internals.role=this.constructor.ROLE}#oe(){return[this.#ie??this.#se,...this.#ae].filter(e=>e)}#le({fragment:e,control:t,error:s,label:r=null,described:i=null,claims:n=null,announces:a=t,freeze:o=null,also:l=[]}){this.#se=t,this.#re=s,this.#ie=n,this.#ne=a,this.#ae=l,o&&o.addEventListener("click",e=>{this.readonly&&e.preventDefault()},!0),s&&((i??t).ariaDescribedByElements=[s]),r&&(t.ariaLabelledByElements=[r],r.addEventListener("click",()=>this.focus())),this.addEventListener("keydown",e=>{if("Enter"!==e.key||e.defaultPrevented||e.isComposing)return;const t=e.target;t.form!==this.internals.form&&oe.#ue(t)&&this._requestSubmit()}),this.replaceChildren(e)}static#ue(e){return e instanceof HTMLInputElement&&!["file","button","submit","reset","image"].includes(e.type)}focus(e){this.#se?.focus(e)}setCustomValidity(e,t){if(c.set(this.#ne??this.#se,"aria-invalid",e?"true":null),!e)return this.internals.setValidity({}),void(this.#re.innerText="");this.internals.setValidity({customError:!0}," "),this.#re.innerText=e}_requestSubmit(){const e=this.internals.form;if(!e)return;const t=e.querySelectorAll("button:not(:disabled), input:not(:disabled)");e.requestSubmit([...t].find(t=>"submit"===t.type&&t.form===e))}_notifyChange(e={}){this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value,...e}}))}_interactive(){return!this.matches(":disabled")&&!this.readonly}get value(){}set value(e){}formResetCallback(){this.value=this.unmarshal("value",this.getAttribute("value"))}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.reflectTo("disabled",e);for(const t of this.#oe())t.toggleAttribute("disabled",e)}get readonly(){return this.hasAttribute("readonly")}set readonly(e){for(const t of this.#oe())t.readOnly=e;this.#ne&&c.set(this.#ne,"aria-readonly",e?"true":null),this.reflectTo("readonly",e)}get required(){return this.hasAttribute("required")}set required(e){this.#ne&&c.set(this.#ne,"aria-required",e?"true":null),this.reflectTo("required",e)}render(e){const t=this._build(e);if(t instanceof Promise)return t.then(e=>this.#ce(e));this.#ce(t)}#ce(e){this.#le(e)}_build(e){throw new Error(`${this.constructor.name} must implement _build`)}}class le{#de;#he;#U;#pe;#fe;constructor(e,t,s,r,i){this.#de=e,this.#he=t,this.#U=s,this.#pe=r,this.#fe=i}prepare(e,t){return this.#pe(e,t)}async submit(e,t){return await this.#de.request(this.#U,this.#he).json(e).fetch()}transform(e,t){return this.#fe(e,t)}}class ue{#pe;#fe;constructor(e,t){this.#pe=e,this.#fe=t}async prepare(e,t){return await this.#pe(e,t)}async submit(e,t,s){return s}async transform(e,t){return await this.#fe(e,t)}}class ce{static create(e,t){const s=e.component("http-client"),r=e.declared("request-mapper")?e.component(e.declared("request-mapper")):e=>e,i=e.declared("response-mapper")?e.component(e.declared("response-mapper")):e=>e,n=e.declared("action");if(!n)return new ue(r,i);const a=e.declared("method")??"POST";return new le(s,n,a,r,i)}}class de extends S{static attributes=["action","method","loader","request-mapper","response-mapper","clear-invalid-on-change:presence","scroll-on-error:presence","autocomplete"];form;render(){const e=document.createElement("form");this.form=e,e.setAttribute("novalidate",""),c.forward("form-",this,e),c.set(e,"autocomplete",this.declared("autocomplete")),e.replaceChildren(...this.childNodes),e.addEventListener("submit",async e=>{e.preventDefault(),e.stopPropagation(),await this.submit(e.submitter??void 0)}),this.addEventListener("click",e=>{const t=e.target;t.closest?.('[aria-disabled="true"]')&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.declared("clear-invalid-on-change")&&this.addEventListener("change",e=>{e.target.setCustomValidity?.("")}),this.replaceChildren(e)}#me=!1;async submit(e){if(this.#me)return;let t,s;this.#me=!0,this.spinner(!0);try{const r=this.component(this.declared("loader")??"loaders:form").create(this);t=ae.extractFrom(this.form,e),s=await r.prepare(t,this);const i=new CustomEvent("submit",{bubbles:!0,cancelable:!0,detail:{submitter:e,values:t,request:s}});if(!this.dispatchEvent(i))return;this.errors=[];const n=new CustomEvent("submit:requested",{bubbles:!0,cancelable:!1,detail:{submitter:e,values:i.detail.values,request:i.detail.request}});let a=await re.fireAsync(this,n,{mode:"pipeline"});s=n.detail.request,a=await r.submit(s,this,a);const o=await r.transform(a,this);this.dispatchEvent(new CustomEvent("submit:success",{bubbles:!0,cancelable:!1,detail:{submitter:e,values:t,request:s,response:o}}))}catch(r){this.dispatchEvent(new CustomEvent("submit:failure",{bubbles:!0,cancelable:!1,detail:{submitter:e,values:t,request:s,exception:r}})),r instanceof k&&(this.errors=r.problems),console.warn("failed to submit form",this,"reason:",r)}finally{this.#me=!1,this.spinner(!1)}}reset(){this.form.reset()}#ge=0;#be(e){if(c.defaultValue(e,"role","status"),e.hidden=!1,""!==e.textContent.trim())return;const t=document.createElement("span");t.className="ful-sr-only",t.dataset.ref="spinner-label",e.append(t),t.textContent=P.of().t("spinner.loading")}spinner(e){if(e){if(++this.#ge,1!==this.#ge)return}else if(this.#ge=Math.max(0,this.#ge-1),0!==this.#ge)return;c.set(this,"aria-busy",e?"true":null),this.querySelectorAll("ful-spinner").forEach(t=>{const s=t;e?this.#be(s):(s.hidden=!0,s.querySelector(":scope > [data-ref=spinner-label]")?.remove())}),this.querySelectorAll("input,button").forEach(t=>{const s=t;if("submit"===s.type||"reset"===s.type)if(e)s.dataset.wd=s.getAttribute("aria-disabled")??"",s.setAttribute("aria-disabled","true");else{if(void 0===s.dataset.wd)return;c.set(s,"aria-disabled",s.dataset.wd||null),delete s.dataset.wd}})}set values(e){ae.mutateIn(this.form,e)}get values(){return ae.extractFrom(this.form)}set errors(e){ae.errors(this.form,e,this.declared("scroll-on-error"))}}const he=new t(100),pe=(e,t)=>he.getOrCompute(`${e}:${t}`,()=>{try{return new RegExp(t,"g")}catch(s){return console.warn(`invalid ${e} attribute`,t,s),null}}),fe=new WeakSet;class me extends oe{static observed=["placeholder"];static attributes=["type","v-type","keep","reject","uppercase:presence","trim:presence","autocomplete"];static slots=!0;static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <input data-tpl-if="type != \'textarea\'" data-tpl-type="type" placeholder=" " form="">\n <textarea data-tpl-if="type == \'textarea\'" placeholder=" " form=""></textarea>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_input;_type(){return this.declared("type")??("number"===this.declared("v-type")?"number":"text")}_build({slots:e}){const t=this._type(),s=this.template().withOverlay({type:t,slots:e}).render();return this._input=s.querySelector("input,textarea"),c.set(this._input,"autocomplete",this.declared("autocomplete")??(this.closest("form")?.getAttribute("autocomplete")??null)),c.forward("input-",this,this._input),this._input.addEventListener("input",e=>{const t=(e=>{const t=e.declared("keep"),s=e.declared("reject");if(null===t||null===s||fe.has(e)||(fe.add(e),console.warn("a ful-input declares both keep and reject: keep is applied, reject is ignored",e)),null!==t){const e=pe("keep",t);return e&&(t=>(t.match(e)??[]).join(""))}if(null!==s){const e=pe("reject",s);return e&&(t=>t.replace(e,""))}return null})(this);if(!t)return;const s=e.target.value,r=t(s);if(s===r)return;const i=e.target.selectionStart;if(e.target.value=r,null===i)return;const n=t(s.slice(0,i)).length;e.target.setSelectionRange(n,n)}),this._input.addEventListener("change",e=>{e.stopPropagation(),this._notifyChange()}),{fragment:s,control:this._input,error:s.querySelector("ful-field-error"),label:s.querySelector("label")}}get value(){const e=this.declared("uppercase"),t=this.declared("trim"),s=this._input.value,r=e?s.toUpperCase():s,i=t?r.trim():r;if(""===i)return null;if("number"===this.declared("v-type")){const e=Number(i);return Number.isNaN(e)?i:e}return i}set value(e){this._input.value=""===e||void 0===e?null:e}get placeholder(){const e=this._input.getAttribute("placeholder");return" "===e?null:e}set placeholder(e){c.set(this._input,"placeholder",e??" "),this.reflectTo("placeholder",e)}}class ge extends S{static attributes=["locale","default"];render(){const e=this.textContent.trim(),[t,s,r]=e.split("-").map(Number),i=""===e?null:new Date(t,s-1,r);if(null===i||Number.isNaN(i.getTime()))return void this.replaceChildren(this.declared("default")??"");const{date:n}=P.of({locale:this.declared("locale")??void 0});this.replaceChildren(n(i,{year:"numeric",month:"numeric",day:"numeric"}))}}class be extends S{static attributes=["locale","default"];render(){const e=this.textContent.trim(),t=""===e?null:new Date(be.isoToLocal(e));if(null===t||Number.isNaN(t.getTime()))return void this.replaceChildren(this.declared("default")??"");const{date:s}=P.of({locale:this.declared("locale")??void 0});this.replaceChildren(s(t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}))}static#ve(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):new Date(e)}static isoToLocal(e){const t=be.#ve(e),s=(e,t)=>String(t).padStart(e,"0");return`${t.getFullYear()}-${s(2,t.getMonth()+1)}-${s(2,t.getDate())}T${s(2,t.getHours())}:${s(2,t.getMinutes())}:${s(2,t.getSeconds())}.${s(3,t.getMilliseconds())}`}static localToIso(e){const t=be.#ve(e);return Number.isNaN(t.getTime())?null:t.toISOString()}}class ve extends me{static observed=["step","min","max"];_type(){return"date"}get min(){const e=this._input.min;return""===e?null:e}set min(e){this._input.min=ve.#ye(e)}get max(){const e=this._input.max;return""===e?null:e}set max(e){this._input.max=ve.#ye(e)}get step(){const e=this._input.step;return""===e?null:e}set step(e){this._input.step=e??""}static#ye(e){if(!e)return"";const t=e=>new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString().split("T")[0];if("now"===e)return t(new Date);const s=/^([+-])(\d+)([dmy])$/.exec(e);if(!s)return e;const r="-"===s[1]?-1:1,i=+s[2],n=new Date;switch(n.setHours(0,0,0,0),s[3]){case"d":n.setDate(n.getDate()+i*r);break;case"m":{const e=n.getDate();n.setMonth(n.getMonth()+i*r),n.getDate()!==e&&n.setDate(0);break}case"y":n.setFullYear(n.getFullYear()+i*r)}return t(n)}}class ye extends ve{_type(){return"time"}get min(){const e=this._input.min;return""===e?null:e}set min(e){this._input.min=this.#we(e)}get max(){const e=this._input.max;return""===e?null:e}set max(e){this._input.max=this.#we(e)}#we(e){if(!e)return"";const t=new Date;if("now"!==e){const s=/^([+-])(\d+)([hm])$/.exec(e);if(!s)return e;const r="-"===s[1]?-1:1,i=+s[2]*r;"h"===s[3]?t.setHours(t.getHours()+i):t.setMinutes(t.getMinutes()+i)}return ye.#Ee(t,Number(this._input.step)||60)}static#Ee(e,t){const s=e=>String(e).padStart(2,"0"),r=3600*e.getHours()+60*e.getMinutes()+e.getSeconds(),i=Math.floor(r/t)*t,n=s(Math.floor(i/3600)),a=s(Math.floor(i%3600/60));return t%60==0?`${n}:${a}`:`${n}:${a}:${s(i%60)}`}}class we extends me{static observed=["step","min","max"];_type(){return"datetime-local"}get value(){return be.localToIso(this._input.value)}set value(e){this._input.value=e?be.isoToLocal(e):""}get min(){return be.localToIso(this._input.min)}set min(e){this._input.min=e?be.isoToLocal(e):""}get max(){return be.localToIso(this._input.max)}set max(e){this._input.max=e?be.isoToLocal(e):""}get step(){const e=this._input.step;return""===e?null:e}set step(e){this._input.step=e??""}}class Ee extends me{static WARNING_TIMEOUT=5e3;static list(e=[]){const t=new DataTransfer;for(const s of e)t.items.add(s);return t.files}static observed=["placeholder","accept:csv","multiple:presence","item-list:presence","dropzone:presence","max-files:number","max-file-size:number","max-total-size:number","value"];#xe;#Ae;#Se;#Te;#Ce;_type(){return"file"}static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <input data-tpl-type="type" placeholder=" " form="">\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <div data-ref="dropzone" class="dropzone" data-tpl-if="slots.dropzone">\n {{{{ slots.dropzone }}}}\n </div>\n <div data-ref="dropzone" class="default-dropzone" data-tpl-if="!slots.dropzone">\n {{ #l10n:t(\'files.dropzone-label\') }}\n </div>\n <ful-item-list></ful-item-list>\n <ful-field-warnings role="status" aria-live="polite"></ful-field-warnings>\n <ful-field-error></ful-field-error>\n ';static templates={items:'\n <ful-item data-tpl-each="files" data-tpl-var="file" data-tpl-data-name="file.name">\n <div><span>{{ file.name }}</span><span>{{ #l10n:bytes(file.size) }}</span><button type="button" data-tpl-aria-label="#l10n:t(\'files.remove\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button></div>\n </ful-item>\n ',warning:"<ful-field-warning>{{ #l10n:t(key, args) }}</ful-field-warning>"};#_e;_build(e){const t=super._build(e),s=t.fragment;return this.#Ae=s.querySelector("ful-item-list"),this.#_e=e.slots?.items&&!u.isBlank(e.slots.items)?x.fromFragment(e.slots.items):null,this.#Se=s.querySelector("[data-ref=dropzone]"),this.#Te=s.querySelector("ful-field-warnings"),this.#Ce=s.querySelector("ful-control-group"),this.#Te.addEventListener("animationend",e=>{e.target.remove()}),this.#Ae.addEventListener("click",e=>{if(!e.target.closest("button"))return;if(!this._interactive())return;const t=[...this.#Ae.children].indexOf(e.target.closest("ful-item"));-1!==t&&(this.files=Ee.list([...this.files].filter((e,s)=>s!==t)),this._notifyChange())}),this.#Se.addEventListener("click",e=>{this._interactive()&&this.querySelector("input")?.click()}),this.#Se.addEventListener("dragover",e=>{e.preventDefault(),this.toggleAttribute("dragover",!0)}),this.#Se.addEventListener("dragleave",()=>{this.toggleAttribute("dragover",!1)}),this.#Se.addEventListener("drop",e=>{if(e.preventDefault(),this.toggleAttribute("dragover",!1),!this._interactive())return;const t=[...e.dataTransfer.items].filter(e=>"file"===e.kind).map(e=>e.getAsFile()).filter(e=>null!==e);0===t.length||t.length>1&&!this.multiple||(this.files=Ee.list(t),this._notifyChange())}),this._input.addEventListener("change",e=>{this.#Oe()}),{...t,freeze:this.#Ce}}#Oe(){this.setCustomValidity(),this.#Te.replaceChildren(),this.#qe(),this.#Re(),this.#Ne(),this.#Pe(),(this.#_e??this.template("items")).withOverlay({files:this.files}).renderTo(this.#Ae)}warning(e,t){this.template("warning").withOverlay({key:e,args:t}).appendTo(this.#Te);const s=this.#Te.lastElementChild;setTimeout(()=>s.remove(),Ee.WARNING_TIMEOUT)}#Le(e){const t=e.name.toLowerCase();return this.#xe.some(s=>{const r=s.toLowerCase().split(";")[0].trim();return r.startsWith(".")?t.endsWith(r):r.endsWith("/*")?e.type.startsWith(`${r.slice(0,-1)}`):r.includes("/")&&e.type===r})}#qe(){if(!this.#xe.length)return;const e=[...this.files].filter(e=>!this.#Le(e));0!==e.length&&(this.warning("files.unacceptable-file-type",{types:this.#xe.join(", ")}),this._input.files=Ee.list([...this.files].filter(t=>!e.includes(t))))}#Pe(){null!==this.#ke&&(this.files.length<=this.#ke||(this.warning("files.max-files-exceeded",{count:this.#ke}),this._input.files=Ee.list()))}#Re(){if(null===this.#ze)return;const e=[...this.files].filter(e=>e.size>this.#ze);0!==e.length&&(this.warning("files.max-file-size-exceeded",{size:P.of().bytes(this.#ze)}),this._input.files=Ee.list([...this.files].filter(t=>!e.includes(t))))}#Ne(){null!==this.#Me&&([...this.files].reduce((e,t)=>e+t.size,0)<=this.#Me||(this.warning("files.max-total-size-exceeded",{size:P.of().bytes(this.#Me)}),this._input.files=Ee.list()))}get accept(){return this.#xe}set accept(e){this._input.accept=e.join(","),this.#xe=e,this.reflectTo("accept",e)}get multiple(){return this._input.multiple}set multiple(e){this._input.multiple=e,this.reflectTo("multiple",e)}get files(){return this._input.files}set files(e){this._input.files=e,this.#Oe()}get file(){return this.files[0]??null}set file(e){this.files=Ee.list(e?[e]:[])}get value(){const e=Array.from(this._input.files).map(e=>e.name);return this.multiple?e:e[0]??null}set value(e){e||(this.files=Ee.list())}formResetCallback(){this.value=null}get totalsize(){return Array.from(this.files).reduce((e,t)=>e+t.size,0)}#ke;get maxFiles(){return this.#ke}set maxFiles(e){this.#ke=e,this.reflectTo("max-files",e)}#ze;get maxFileSize(){return this.#ze}set maxFileSize(e){this.#ze=e,this.reflectTo("max-file-size",e)}#Me;get maxTotalSize(){return this.#Me}set maxTotalSize(e){this.#Me=e,this.reflectTo("max-total-size",e)}#De;get itemList(){return this.#De}set itemList(e){this.#De=e,this.reflectTo("item-list",e)}#Fe;get dropzone(){return this.#Fe}set dropzone(e){this.#Fe=e,this.reflectTo("dropzone",e)}}const xe=new Map;let Ae=0,Se=!1;const Te=(e,t,s)=>Math.min(Math.max(e,t),Math.max(t,s)),Ce=(e,t)=>{const{invoker:s,stretch:r}=t,i=s.getBoundingClientRect(),n=document.documentElement,a=n.clientWidth,o=n.clientHeight;e.style.removeProperty("margin");const l=getComputedStyle(e),u=parseFloat(l.marginTop)||0,c=parseFloat(l.marginRight)||0,d=parseFloat(l.marginBottom)||0,h=parseFloat(l.marginLeft)||0;if(e.style.right="auto",e.style.bottom="auto",e.style.margin="0",r){const t=Math.min(i.width,a-16);e.style.width=`${t}px`,e.style.left=`${Te(i.left,8,a-t-8)}px`;const s=e.getBoundingClientRect().height;return void(e.style.top=`${Te(i.bottom+u,8,o-s-8)}px`)}const p=(e=>e.matches("ful-note, .ful-note, [placement]"))(e),f=p?e.getAttribute("placement")??"bottom":"bottom";e.style.removeProperty("max-width");const m=Math.min(parseFloat(l.maxWidth)||a,a-16);e.style.maxWidth=`${m}px`,e.style.left="8px";const g=e.getBoundingClientRect().width;let b="right"===f?i.right+h:"left"===f?i.left-c-g:p?i.left+i.width/2-g/2:i.left;b=Te(b,8,a-g-8),e.style.left=`${b}px`,e.style.maxWidth=`${Math.min(m,a-8-b)}px`;const v=e.getBoundingClientRect().height,y="top"===f?i.top-d-v:"right"===f||"left"===f?i.top+i.height/2-v/2:i.bottom+u;e.style.top=`${Te(y,8,o-v-8)}px`,p&&((e,t)=>{const s=t.getBoundingClientRect(),r=e.getBoundingClientRect();e.style.setProperty("--ful-note-callout-inline",s.left+s.width/2-r.left-e.clientLeft+"px"),e.style.setProperty("--ful-note-callout-block",s.top+s.height/2-r.top-e.clientTop+"px")})(e,s)},_e=()=>{Ae=0;for(const[e,t]of xe)e.isConnected&&t.invoker.isConnected?Ce(e,t):xe.delete(e)},Oe=()=>{!Ae&&xe.size>0&&(Ae=requestAnimationFrame(_e))},qe=(e,t,{prefix:s="ful-anchor",invoke:r=!1,expanded:i=!1,stretch:n=!1,handPlace:a=!1}={})=>{const o=c.uid(s);r&&(t.id=t.id||o,e.setAttribute("popovertarget",t.id));const l=`--${o}`;if(e.style.anchorName=l,t.style.positionAnchor=l,i&&(e.setAttribute("aria-expanded","false"),t.addEventListener("toggle",t=>{e.setAttribute("aria-expanded","open"===t.newState?"true":"false")})),!a&&CSS.supports("anchor-name: --ful-probe")&&CSS.supports("position-anchor: --ful-probe")&&CSS.supports("position-area: bottom")&&CSS.supports("top: anchor(bottom)")&&CSS.supports("width: anchor-size(width)"))return;const u={invoker:e,stretch:n};t.addEventListener("beforetoggle",e=>{"open"===e.newState&&Ce(t,u)}),t.addEventListener("toggle",e=>{"open"===e.newState?(xe.set(t,u),Ce(t,u)):(xe.delete(t),(e=>{for(const t of["top","left","right","bottom","margin","max-width","width","--ful-note-callout-inline","--ful-note-callout-block"])e.style.removeProperty(t)})(t))}),Se||(Se=!0,document.addEventListener("scroll",Oe,!0),window.addEventListener("resize",Oe))};class Re{#de;#he;#U;#fe;#Ie;#$e;#C;#Be;#je=new ie;constructor({http:e,url:t,method:s,responseMapper:r,prefetch:i,revision:n}){this.#de=e,this.#he=t,this.#U=s,this.#fe=r,this.#Ie=i,this.#$e=n,this.#C=null,this.#Be=null}async prefetch(){this.#Ie&&await this.#He()}async exact(...e){return(await this.#He()).filter(({key:t})=>e.some(e=>e==t))}async load(e){return(await this.#He()).filter(({label:t})=>(t??"").toLowerCase().includes(e?.toLowerCase()??""))}async invalidate(){this.#je.invalidate(),this.#C=null,this.#Be=null}async reconfigureUrl(e){await this.invalidate(),this.#he=e}async#He(){if(null===this.#C){if(null===this.#Be){const e=this.#je.hold();this.#Be=Re.#We(this.#de,this.#U,this.#he,this.#$e).then(t=>{e.stale||(this.#C=this.#fe(t))}).finally(()=>{e.stale||(this.#Be=null)})}await this.#Be}if(null===this.#C)throw new Error("superseded by a reconfiguration");return this.#C}static async#We(e,t,s,r){const i=`${t}@${s}`;if(null!==r){const e=te.load(i,r);if(void 0!==e)return e}const n=await e.request(t,s).fetchJson();if(null!==r)try{te.save(i,r,n)}catch(e){console.warn("failed to cache the select options",e)}return n}}class Ne{#de;#he;#U;#fe;constructor({http:e,url:t,method:s,responseMapper:r}){this.#de=e,this.#he=t,this.#U=s,this.#fe=r}async invalidate(){}async reconfigureUrl(e){this.#he=e}async exact(...e){const t=await this.#de.request(this.#U,this.#he).param("k",...e).fetchJson();return this.#fe(t)}async load(e){const t=await this.#de.request(this.#U,this.#he).param("s",e).fetchJson();return this.#fe(t)}}class Pe{#C;constructor(e){this.#C=e}update(e){this.#C=e}async invalidate(){}exact(...e){return this.#C.filter(({key:t})=>e.some(e=>e==t))}load(e){return this.#C.filter(({label:t})=>(t??"").toLowerCase().includes(e?.toLowerCase()??""))}}class Le{static from({data:e,http:t,url:s,method:r="POST",mode:i,prefetch:n=!1,revision:a=null,responseMapper:o}){return s?"chunked"===i?new Ne({http:t,url:s,method:r,responseMapper:o}):new Re({http:t,url:s,method:r,responseMapper:o,prefetch:n,revision:a}):new Pe(e??[])}static create(e,t){if(!e.declared("src")){const e=Array.from(t.options?.querySelectorAll("option")??[]);return Le.from({data:e.map(e=>({key:e.getAttribute("value")??e.innerText.trim(),label:e.innerText.trim(),metadata:void 0}))})}return Le.from({http:e.component("http-client"),url:e.declared("src"),method:e.declared("method")??"POST",mode:e.declared("mode"),prefetch:e.declared("preload"),revision:e.declared("revision"),responseMapper:Le.#Ve(e)})}static#Ve(e){return e.declared("k-expr")&&e.declared("l-expr")?t=>e._registry.evaluator().withOverlay(t).evaluateExpression(e.declared("d-expr")??"self").map(t=>{const s=e._registry.evaluator().withOverlay(t);return{key:s.evaluateExpression(e.declared("k-expr")),label:s.evaluateExpression(e.declared("l-expr")),metadata:s.evaluateExpression(e.declared("m-expr")??"self")}}):e.declared("response-mapper")?e.component(e.declared("response-mapper")):e=>e.map(([e,t,s])=>({key:e,label:t,metadata:s}))}}class ke extends S{static attributes=["listbox"];static slots=!0;static template='\n <ful-spinner class="centered" role="status" hidden><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner>\n <p data-ref="empty" aria-live="polite" hidden>{{ #l10n:t(\'dropdown.empty\') }}</p>\n <menu tabindex="-1" role="listbox" hidden></menu>\n ';static templates={options:'\n <li data-tpl-each="self" data-tpl-selected="index == 0" data-tpl-value="index" role="option">\n {{ label }}\n </li>\n '};#Ue;#Ge;#Qe;#Ke;#X=new Map;#Je=new ie;render({slots:e}){const t=this.template().render();this.#Ke=u.isBlank(e.default)?this.template("options"):x.fromFragment(e.default),this.#Ue=t.querySelector("ful-spinner"),this.#Qe=t.querySelector("p[data-ref=empty]"),this.#Ge=t.querySelector("menu"),this.#Ge.id=this.declared("listbox")||c.uid("ful-listbox"),this.#Ge.addEventListener("click",e=>{e.stopPropagation();const t=e.target.closest("li");t?this.#Xe(t):this.hide()}),this.replaceChildren(t)}#Ye(){return this.#Ge?.querySelector("[selected]")??this.#Ge?.firstElementChild??null}#Ze(e){if(e){for(const t of this.#Ge.querySelectorAll("li"))t.toggleAttribute("selected",t===e);e.id||=c.uid("ful-option"),this.#et(e.id),e.scrollIntoView({block:"nearest",behavior:matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"})}else this.#et(null)}acceptSelection(){const e=this.#Ye();e&&this.#Xe(e)}update(e,t=[]){if(void 0===e)throw new Error("null data");this.#X=new Map(e.map((e,t)=>[String(t),e]));const s=e.map((e,t)=>({index:t,...e}));this.#Ke.withOverlay(s).renderTo(this.#Ge);for(const[s,r]of[...this.#Ge.children].entries()){const i=t.some(t=>t==e[s]?.key);r.toggleAttribute("picked",i),r.setAttribute("aria-selected",i?"true":"false")}this.#Qe.toggleAttribute("hidden",0!==e.length),this.#Ge.toggleAttribute("hidden",0===e.length);const r=e.findIndex(({key:e})=>t.some(t=>t==e));this.#Ze(r>=0?this.#Ge.children[r]:this.#Ye())}#Xe(e){const t=e.getAttribute("value"),s=this.#X.get(t);this.hide(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{index:t,entry:s}}))}hide(){this.#Je.invalidate(),this.matches(":popover-open")&&this.hidePopover(),this.#et(null)}#et(e){this.dispatchEvent(new CustomEvent("activechange",{bubbles:!1,cancelable:!1,detail:{id:e}}))}get shown(){return this.matches(":popover-open")}async show(e,t=[]){const s=this.#Je.take();this.matches(":popover-open")||this.showPopover(),this.#Ge.setAttribute("hidden",""),this.#Ue.removeAttribute("hidden");try{const r=await e();if(s.stale)return;this.update(r,t)}catch(e){if(s.stale)return;throw this.hide(),e}finally{s.stale||this.#Ue.setAttribute("hidden","")}}async moveOrShow(e,t,s=[]){if(this.shown){const t=this.#Ye(),s=t?.[(e?"next":"previous")+"ElementSibling"];return void(t&&s&&this.#Ze(s))}await this.show(t,s)}jump(e){const t=e?this.#Ge.firstElementChild:this.#Ge.lastElementChild;t&&this.#Ze(t)}page(e){const t=this.#Ye();if(!t)return;const s=Array.from(this.#Ge.children),r=this.#tt(),i=s[Math.max(0,Math.min(s.length-1,s.indexOf(t)+(e?r:-r)))];this.#Ze(i)}#tt(){const e=this.#Ge.firstElementChild;return e&&0!==e.offsetHeight?Math.max(1,Math.trunc(this.#Ge.clientHeight/e.offsetHeight)):1}}class ze extends oe{static attributes=["name","loader","k-type","src","method","mode","preload:presence","revision","k-expr","l-expr","d-expr","m-expr","response-mapper"];static observed=["multiple:presence","item-list:presence","value:csv"];static slots=!0;static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-control>\n <input type="text" form="" autocomplete="off" role="combobox" aria-autocomplete="list" aria-haspopup="listbox" aria-expanded="false">\n </ful-control>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n <ful-dropdown popover="manual">{{{{ slots.dropdown }}}}</ful-dropdown>\n </ful-control-group>\n <ful-item-list></ful-item-list>\n <ful-field-error></ful-field-error>\n ';static templates={items:'\n <ful-item data-tpl-each="entries" data-tpl-var="entry" data-tpl-data-key="entry.key">\n <div><span>{{ entry.label }}</span><button type="button" data-tpl-aria-label="#l10n:t(\'select.remove\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button></div>\n </ful-item>\n '};#st;#se;#rt;#it;#Ae;#_e;#nt;#at=!1;#ot=new Map;#lt=new ie;#ut=!1;#ct;#dt;_build({slots:e}){const t=this.declared("name");this.#st=this.component(this.declared("loader")??"loaders:select").create(this,{options:e.options}),this.#nt=this.declared("multiple"),this.#st.prefetch?.()?.catch(e=>{console.warn("failed to prefetch select options",this,"reason:",e)});const s=this.template().withOverlay({slots:e,name:t}).render();this.#it=s.querySelector("input"),this.#Ae=s.querySelector("ful-item-list"),this.#_e=e.items&&!u.isBlank(e.items)?x.fromFragment(e.items):null,c.forward("input-",this,this.#it),this.#se=s.querySelector("ful-control"),this.#rt=s.querySelector("ful-dropdown");const r=c.uid("ful-listbox");this.#rt.setAttribute("listbox",r),this.#it.setAttribute("aria-controls",r),this.#rt.addEventListener("beforetoggle",e=>{const t="open"===e.newState;this.#it.setAttribute("aria-expanded",t?"true":"false"),t||this.#it.removeAttribute("aria-activedescendant")}),this.#rt.addEventListener("activechange",e=>{c.set(this.#it,"aria-activedescendant",e.detail.id)});const i=s.querySelector("ful-control-group");return qe(i,this.#rt,{prefix:"ful-select",stretch:!0}),[this.#ct,this.#dt]=ne.throttle(400,()=>this.#ht()),this.#pt(),this.#ft(),this.#mt(),this.#gt(),{fragment:s,control:this.#it,error:s.querySelector("ful-field-error"),label:s.querySelector("label")}}#pt(){this.addEventListener("click",e=>{this._interactive()&&(this.#rt.shown?this.#bt():(this.#it.focus(),this.#ct()))}),this.#Ae.addEventListener("click",e=>{e.stopPropagation(),e.target.closest("button")&&this._interactive()&&this.#vt([...this.#Ae.children].indexOf(e.target.closest("ful-item")))}),this.#se.addEventListener("click",e=>{const t=e.target instanceof Element?e.target.closest("ful-badge"):null;t&&(e.stopPropagation(),this.#yt(t))})}#ft(){this.addEventListener("keydown",e=>{const t=e.target instanceof Element?e.target.closest("ful-badge"):null;t?this.#wt(e,t):"ArrowLeft"===e.code&&e.target===this.#it&&0===this.#it.selectionStart&&0===this.#it.selectionEnd&&this.#Et().at(-1)?.focus()})}#mt(){this.#it.addEventListener("change",e=>{e.stopPropagation()}),this.#it.addEventListener("focus",()=>{this.#ut||this.#it.select()}),this.#it.addEventListener("blur",e=>{e.stopPropagation(),e.relatedTarget&&this.contains(e.relatedTarget)||(this.#dt(),this.#bt())}),this.#it.addEventListener("keydown",e=>{this._interactive()&&this.#xt(e)}),this.#it.addEventListener("input",e=>{e.stopPropagation(),this._interactive()&&(this.#ut=!0,this.#ct())})}#gt(){this.#rt.addEventListener("change",e=>{e.stopPropagation(),this._interactive()?(this.#nt||this.#ot.clear(),this.#ut=!1,this.#ot.set(this.#At(e.detail.entry.key),e.detail.entry),this.#St(),this.#Tt(),this.#it.focus(),this.#rt.hide(),this.#nt||this.#it.select()):this.#bt()})}async withLoader(e){return await e(this.#st)}async reload(){await(this.#st.invalidate?.()),await(this.#st.prefetch?.());const e=[...this.#ot.keys()];0!==e.length&&await this.#i(e,this.#lt.take())}#Et(){return Array.from(this.#se.querySelectorAll(":scope > ful-badge"))}#yt(e){this._interactive()&&this.#vt(this.#Et().indexOf(e))}#vt(e){const t=Array.from(this.#ot.keys())[e];void 0!==t&&(this.#ot.delete(t),this.#St(),this.#Tt())}#wt(e,t){switch(e.code){case"NumpadEnter":case"Enter":case"Space":case"Backspace":case"Delete":e.preventDefault(),this.#yt(t),this.#it.focus();break;case"ArrowLeft":e.preventDefault(),(this.#Et()[this.#Et().indexOf(t)-1]??this.#it).focus();break;case"ArrowRight":e.preventDefault(),(this.#Et()[this.#Et().indexOf(t)+1]??this.#it).focus();break;case"Escape":this.#it.focus()}}#xt(e){switch(e.code){case"ArrowUp":case"ArrowDown":e.preventDefault(),this.#Ct(e);break;case"Home":this.#rt.shown&&(e.preventDefault(),this.#rt.jump(!0));break;case"End":this.#rt.shown&&(e.preventDefault(),this.#rt.jump(!1));break;case"PageDown":case"PageUp":this.#rt.shown&&(e.preventDefault(),this.#rt.page("PageDown"===e.code));break;case"Escape":case"Tab":this.#dt(),this.#bt();break;case"NumpadEnter":case"Enter":if(!this.#rt.shown)return;e.preventDefault(),this.#ut=!1,this.#_t(),this.#rt.acceptSelection();break;case"Backspace":0===this.#it.selectionStart&&0===this.#it.selectionEnd&&this.#vt(this.#ot.size-1)}}#Ct(e){const t="ArrowDown"===e.code;e.altKey?t&&!this.#rt.shown?this.#ht():!t&&this.#rt.shown&&this.#bt():(this.#Ot(),this.#rt.moveOrShow(t,()=>this.#st.load(this.#it.value),[...this.#ot.keys()]))}#bt(){this.#rt.hide(),this.#ut=!1,this.#_t()}#ht(){return this.#Ot(),this.#rt.show(()=>this.#st.load(this.#it.value),[...this.#ot.keys()])}#Ot(){this.#ut||(this.#it.value="")}#_t(){const e=this.#ot.values().next().value;this.#it.value=this.#nt?"":e?.label??""}#qt(){return[...this.#ot.values()]}#St(){this._notifyChange({entry:this.entry})}#Tt(){const e=this.#nt?Array.from(this.#ot.entries()).map(([e,t],s)=>{const r=document.createElement("ful-badge");return r.setAttribute("role","button"),r.setAttribute("tabindex",0===s?"0":"-1"),r.setAttribute("value",e),r.innerText=t.label,r}):[];for(const e of this.#se.querySelectorAll(":scope > ful-badge"))e.remove();this.#it.before(...e),this.#ut||this.#_t(),this.#Ae.replaceChildren(),(this.#_e??this.template("items")).withOverlay({entries:this.#qt()}).renderTo(this.#Ae)}#At(e){switch(this.declared("k-type")){case"number":{const t=""===e?Number.NaN:Number(e);return Number.isNaN(t)?e:t}case"boolean":return!0===e||"true"===e||!1!==e&&"false"!==e&&e;default:return String(e)}}set value(e){const t=(null==e?[]:Array.isArray(e)?e:[e]).map(e=>this.#At(e));!this.#at&&t.some(e=>"string"==typeof e&&e.includes(","))&&(this.#at=!0,console.warn("a ful-select key cannot contain a comma: it is unexpressible in the value attribute",this)),this.#ot=new Map(t.map(e=>[e,{key:e,label:e,metadata:void 0}]));const s=this.#lt.take();this.#se&&(this.#Tt(),0!==t.length&&this.#i(t,s))}async#i(e,t){const s=await this.#st.exact(...e);if(t.stale)return;const r=new Map(s.map(e=>[this.#At(e.key),e]));for(const t of e)this.#ot.has(t)&&(r.has(t)?this.#ot.set(t,r.get(t)):this.#ot.delete(t));this.#Tt()}get value(){return this.#nt?[...this.#ot.keys()]:[...this.#ot.keys()][0]??null}get entry(){const e=this.#qt();return this.#nt?e:e[0]??null}#De;get multiple(){return this.#nt}set multiple(e){this.#nt=e,this.reflectTo("multiple",e)}get itemList(){return this.#De}set itemList(e){this.#De=e,this.reflectTo("item-list",e)}}class Me extends oe{static attributes=["name","type"];static slots=!0;static ROLE="radiogroup";static template='\n <fieldset>\n <legend>\n {{{{ slots.default }}}}\n </legend>\n <header data-tpl-if="slots.header">\n {{{{ slots.header }}}}\n </header>\n <ful-radio-list>\n <div class="label-wrapper" data-tpl-each="inputsAndLabels" data-tpl-var="ial">\n <label>\n {{{{ ial[0] }}}}\n <div>{{{{ ial[1] }}}}</div>\n </label>\n </div>\n </ful-radio-list>\n <ful-field-error></ful-field-error>\n <footer data-tpl-if="slots.footer">\n {{{{ slots.footer }}}}\n </footer>\n </fieldset>\n ';#Rt;#Nt;#Pt;_build({slots:e}){const t=this.declared("name")??c.uid("ful-radiogroup"),s=Array.from(e.default.querySelectorAll("ful-radio")),r=s.map(e=>{const s=document.createElement("input");return s.setAttribute("type","radio"),c.forward("input-",this,s),c.forward("",e,s),s.setAttribute("name",`${t}-ignore`),s.setAttribute("form",""),s.addEventListener("change",e=>{e.stopPropagation(),this._notifyChange()}),[s,u.fromChildNodes(e)]});s.forEach(e=>{e.remove()});const i=this.template().withOverlay({name:t,slots:e,inputsAndLabels:r}).render();return this.#Rt=i.firstElementChild,this.#Nt=i.querySelector("input[type=radio]"),this.#Pt="boolean"===this.declared("type"),{fragment:i,control:this.#Nt,error:i.querySelector("ful-field-error"),described:this,claims:this.#Rt,announces:this,freeze:this.#Rt}}get value(){const e=this.querySelector("input[type=radio]:checked");return e?this.#Pt?"true"===e.value:e.value:null}set value(e){const t=this.querySelectorAll("input[type=radio]"),s=()=>{t.forEach(e=>{e.checked=!1})};if(null===e)return void s();const r=this.querySelector(`input[type=radio][value=${CSS.escape(String(e))}]`);null!==r?r.checked=!0:s()}}class De extends oe{static attributes=["type"];static observed=["value:bool"];static slots=!0;static template='\n <ful-choice data-tpl-switch="isSwitch">\n <input type="checkbox" data-tpl-role="isSwitch ? \'switch\' : false" form="" placeholder=" ">\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n </ful-choice>\n <ful-field-error></ful-field-error>\n ';#Lt;#it;_build({slots:e}){const t="switch"===this.declared("type"),s=this.template().withOverlay({slots:e,isSwitch:t}).render();this.#Lt=s.firstElementChild,this.#it=s.querySelector("input"),c.forward("input-",this,this.#it),this.#it.addEventListener("change",e=>{e.stopPropagation(),this._notifyChange()});const r=s.querySelector("label");return r.addEventListener("click",()=>{this._interactive()&&(this.value=!this.value,this._notifyChange())}),{fragment:s,control:this.#it,error:s.querySelector("ful-field-error"),label:r,freeze:this.#Lt}}get value(){return this.#it.checked}set value(e){this.#it.checked=e}}class Fe extends S{static attributes=["sorter"];static observed=["order"];#kt;render(){const e=this.declared("sorter"),t=["asc","desc",null];this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.addEventListener("click",()=>{const s=t[(t.indexOf(this.order)+1)%3];this.dispatchEvent(new CustomEvent("sort:requested",{bubbles:!0,cancelable:!0,detail:{value:{sorter:e,order:s}}}))}),this.addEventListener("keydown",e=>{"Enter"!==e.code&&"Space"!==e.code||(e.preventDefault(),this.click())})}get order(){return this.#kt||null}set order(e){this.#kt=e||null,this.reflectTo("order",this.#kt);const t=this.closest("th");t&&c.set(t,"aria-sort",this.#kt?"asc"===this.#kt?"ascending":"descending":null)}}class Ie extends S{static observed=["total:number","current:number"];static attributes=["pages:number"];static config={prevIcon:"chevron-left",nextIcon:"chevron-right",reloadIcon:"arrow-clockwise"};static template='\n <ful-pagination-bar role="navigation" data-tpl-aria-label="#l10n:t(\'pagination.navigation\')">\n <ul>\n <li data-ref="index"> {{ #l10n:t(\'pagination.showing\', { \'current\': curr.label, \'total\': total }) }}</li>\n <li data-ref="reload"><button type="button" data-tpl-aria-label="#l10n:t(\'pagination.reload\')"><ful-icon data-tpl-name="config.reloadIcon" aria-hidden="true"></ful-icon></button></li>\n <li data-ref="prev">\n <button type="button" data-tpl-disabled="prev.enabled ? false : true" data-tpl-aria-label="#l10n:t(\'pagination.previous\')" data-tpl-data-page="prev.index">\n <ful-icon data-tpl-name="config.prevIcon" aria-hidden="true"></ful-icon>\n </button>\n </li>\n <li data-ref="page" data-tpl-each="pages" data-tpl-var="page">\n <button type="button" data-tpl-aria-current="curr.index == page.index ? \'page\' : false" data-tpl-data-page="page.index" >\n {{ page.label }}\n </button>\n </li>\n <li data-ref="next">\n <button type="button" data-tpl-disabled="next.enabled ? false : true" data-tpl-aria-label="#l10n:t(\'pagination.next\')" data-tpl-data-page="next.index">\n <ful-icon data-tpl-name="config.nextIcon" aria-hidden="true"></ful-icon>\n </button>\n </li>\n </ul>\n </ful-pagination-bar>\n ';#zt=0;#W=0;render(){this.addEventListener("click",e=>{const t=e.target.closest("button");t&&!t.hasAttribute("disabled")&&"page"!==t.getAttribute("aria-current")&&this.dispatchEvent(new CustomEvent("page:requested",{bubbles:!0,cancelable:!0,detail:{value:Number(t.dataset.page??this.#W)}}))})}update({current:e,total:t}={}){void 0!==e&&(this.#W=e??0),void 0!==t&&(this.#zt=t??0),this.reflectTo("current",this.#W),this.reflectTo("total",this.#zt);const s=this.#W,r=this.#zt,i=this.declared("pages")??5,n=Math.max(r,1),a=s>0,o=s+1<n,l={index:a?s-1:null,enabled:a},u={index:s,label:s+1},c={index:o?s+1:null,enabled:o},d=Math.max(1,Math.min(i,n)),h=Math.max(0,Math.min(s-Math.floor((d-1)/2),n-d)),p=Array.from({length:d},(e,t)=>({index:h+t,label:h+t+1})),f=this.contains(document.activeElement)?document.activeElement.closest("li")?.getAttribute("data-ref"):null,m="page"===f?document.activeElement.dataset.page:null;if(this.template().withOverlay({total:n,prev:l,curr:u,next:c,pages:p}).renderTo(this),!f)return;const g=(null===m?null:this.querySelector(`li[data-ref=page] button[data-page="${m}"]`))??this.querySelector(`li[data-ref=${f}] button:not(:disabled)`)??this.querySelector("li[data-ref=page] button[aria-current=page]");g?.focus()}get total(){return this.#zt}set total(e){this.update({total:e})}get current(){return this.#W}set current(e){this.update({current:e})}}class $e{static parse(e,t){const s=e?h.queryChildren(e,"schema"):null;if(!s)throw new Error('missing expected <schema>: ful-table needs a <template slot="schema"> holding one');const r=document.createElement("tr"),i=document.createElement("tr");i.setAttribute("data-tpl-each","rows");for(const e of s.getAttributeNames()){const t=s.getAttribute(e);r.setAttribute(e,t??""),i.setAttribute(e,t??"")}const n=h.queryChildrenAll(s,"column"),a=n.filter(e=>e.hasAttribute("order")&&e.hasAttribute("sorter")).map(e=>({sorter:e.getAttribute("sorter"),order:e.getAttribute("order")}))[0]??null;for(var o of n){const e=h.queryChildren(o,"title"),t=o.getAttribute("sorter"),s=o.getAttribute("order"),n=e??document.createTextNode(o.getAttribute("title")??"");e?.remove(),o.removeAttribute("sorter"),o.removeAttribute("order"),o.removeAttribute("title");const a=t||s?(()=>{const e=document.createElement("ful-sorter");return t&&e.setAttribute("sorter",t),s&&e.setAttribute("order",s),e.append(n),e})():n,l=document.createElement("th"),u=document.createElement("td");for(const e of o.getAttributeNames()){const t=o.getAttribute(e);l.setAttribute(e,t??""),u.setAttribute(e,t??"")}l.append(a),u.append(...o.childNodes),r.append(l),i.append(u)}return{headersTemplate:t.withOverlay({inHeaders:!0,inRows:!1}).withFragment(u.from(r)),rowsTemplate:t.withOverlay({inHeaders:!1,inRows:!0}).withFragment(u.from(i)),sort:a,length:n.length}}}class Be{#C;constructor(e){this.#C=e}async load(e,t,s){const r=this.#Mt(t),i=e.page*e.size,n=i+e.size;return{data:r.slice(i,n),size:r.length}}#Mt(e){if(!e?.sorter)return this.#C;const{sorter:t,order:s}=e,r="desc"===s?-1:1;return[...this.#C].sort((e,s)=>{const i=e?.[t],n=s?.[t];return i===n?0:null==i?1:null==n?-1:(i<n?-1:1)*r})}update(e){this.#C=e}}class je{#de;#he;#U;#fe;constructor(e,t,s,r=e=>e){this.#de=e,this.#he=t,this.#U=s,this.#fe=r}async load(e,t,s){const r=Object.entries(s).filter(([e,t])=>t);return await this.#de.request(this.#U,this.#he).param("page",e.page).param("size",e.size).param("sort",t?`${t.sorter},${t.order}`:null).param("filters",r.length>0?JSON.stringify(Object.fromEntries(r)):null).fetchJson().then(e=>this.#fe(e))}}class He{static create(e,t){const s=e.getAttribute("src");if(s){const t=e.component("http-client"),r=e.getAttribute("method")??"GET",i=e.hasAttribute("response-mapper")?e.component(e.getAttribute("response-mapper")):e=>e;return new je(t,s,r,i)}return new Be([])}}class We extends S{static attributes=["loader","autoload:presence"];static observed=["page-size:number"];static slots=!0;static config={searchIcon:"search"};static template='\n <ful-form data-tpl-if="slots.filters">\n {{{{ slots.filters }}}}\n </ful-form>\n <ful-table-wrapper>\n <table>\n <caption data-tpl-if="slots.caption">{{{{ slots.caption }}}}</caption>\n <thead></thead>\n <tbody></tbody>\n <tbody data-ref="initial">\n <tr>\n <td data-tpl-colspan="schema.length">\n <div>\n <p data-tpl-if="config.searchIcon"><ful-icon data-tpl-name="config.searchIcon" aria-hidden="true"></ful-icon></p>\n {{ #l10n:t(\'table.initial\') }}\n </div>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="loading" hidden>\n <tr>\n <td data-tpl-colspan="schema.length">\n <ful-spinner class="big" role="status"><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="feedback" hidden>\n <tr>\n <td data-tpl-colspan="schema.length">\n <div role="alert">\n <p>{{ #l10n:t(\'table.error\') }}</p>\n <div data-ref="feedback-error"></div>\n </div>\n </td>\n </tr>\n </tbody>\n <tfoot data-tpl-if="slots.footer">\n {{{{ slots.footer }}}}\n </tfoot>\n </table>\n </ful-table-wrapper>\n <ful-pagination 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\">\n {{ #l10n:t('table.no-data') }}\n </td>\n </tr>\n {{{{ schema.rowsTemplate.withOverlay({'rows': pageResponse.data}).render() }}}}\n "};#st;#Dt;#J;#Ft;#It;#$t;#Bt;#jt;#Ht={pageRequest:{page:0,size:10},sortRequest:null,filterRequest:{}};#Wt=!1;#Vt=new ie;get pageSize(){return this.#Ht.pageRequest.size}set pageSize(e){const t=e??10;t!==this.#Ht.pageRequest.size&&(this.#Ht={...this.#Ht,pageRequest:{page:0,size:t}},this.#Wt&&this.reload())}async render({slots:e}){const t=this.template(),s=$e.parse(e.schema,t),r=t.withOverlay({slots:e,schema:s}).render(),i=h.queryChildren(r,"ful-table-wrapper").querySelector("table");c.forward("table-",this,i),this.#st=this.component(this.declared("loader")??"loaders:table").create(this),this.#Dt=s,this.#J=i.querySelector(":scope > tbody"),this.#Ft=i.querySelector(":scope > tbody[data-ref=loading]"),this.#It=i.querySelector(":scope > tbody[data-ref=initial]"),this.#$t=i.querySelector(":scope > tbody[data-ref=feedback]"),this.#Bt=h.queryChildren(r,"ful-pagination"),this.replaceChildren(r);const n=this.querySelector("thead");s.headersTemplate.renderTo(n),this.#jt=n.querySelectorAll("ful-sorter"),await A.waitForChildren(this);const a=h.queryChildren(this,"ful-form");this.#Ht={pageRequest:{page:0,size:this.declared("page-size")??10},sortRequest:s.sort,filterRequest:a?.values??{}},a?.addEventListener("submit:success",async e=>{await this.load({page:0,size:this.#Ht.pageRequest.size},this.#Ht.sortRequest,e.detail.request)}),this.addEventListener("page:requested",async e=>{await this.load({page:e.detail.value,size:this.#Ht.pageRequest.size},this.#Ht.sortRequest,this.#Ht.filterRequest)}),this.addEventListener("sort:requested",async e=>{const t=e.detail.value.order?e.detail.value:null;await this.load(this.#Ht.pageRequest,t,this.#Ht.filterRequest),this.#Ht.sortRequest===t&&(this.#jt.forEach(e=>{e.order=null}),e.target.order=e.detail.value.order)}),this.declared("autoload")&&this.reload()}async reload(){return await this.load(this.#Ht.pageRequest,this.#Ht.sortRequest,this.#Ht.filterRequest)}async load(e,t,s){this.#Wt=!0;const r=this.#Vt.take();this.#J.replaceChildren(),this.#Ft.removeAttribute("hidden"),this.#$t.setAttribute("hidden",""),this.#It.setAttribute("hidden",""),this.setAttribute("aria-busy","true");try{const i=await this.#st.load(e,t,s);if(r.stale)return;this.#Ht={pageRequest:e,sortRequest:t,filterRequest:s},this.#Oe(e,t,s,i)}catch(e){if(r.stale)return;throw this.#Ft.setAttribute("hidden",""),this.#$t.removeAttribute("hidden"),this.#$t.querySelector("[data-ref=feedback-error]").textContent=k.problemsText(e,`${e}`),e}finally{r.stale||this.removeAttribute("aria-busy")}}async withLoader(e){return await e(this.#st)}async resetWithFilter(e){return await this.load({page:0,size:this.#Ht.pageRequest.size},this.#Ht.sortRequest,e)}#Oe(e,t,s,r){const i=Math.ceil(r.size/e.size),n=Math.max(0,i-1);e.page>n?this.load({page:n,size:e.size},t,s):(this.#Ft.setAttribute("hidden",""),this.#J.replaceChildren(this.template("row").withOverlay({schema:this.#Dt,pageRequest:e,filterRequest:s,pageResponse:r}).render()),this.#Bt.update({current:e.page,total:i}))}}class Ve{static narrow(e,t){const s=(e??[]).filter(e=>t.includes(e));return s.length>0?s:[...t]}#Ut;#Ge;#Gt;#Qt;#Kt;#_t;#Jt;#Xt;#Yt;#Zt=!1;#es=!1;constructor(e,{vocabulary:t,glyphs:s={},labelFor:r=e=>e,display:i=null,interactive:n=()=>!0,onPick:a=()=>{}}){this.#Ut=e,this.#Ge=e.nextElementSibling,this.#Gt=t,this.#Qt=s,this.#Kt=r,this.#_t=i??(e=>s[e]??e),this.#Jt=n,this.#Xt=a,this.#Yt=[...t],this.#Ge.addEventListener("click",e=>{const t=e.target.closest("li > a");if(!t||!this.#Jt())return;const s=t.getAttribute("value"),r=this.value;this.value=s,this.#Ge.hidePopover?.(),r!==s&&this.#Xt(s)})}get allowed(){return this.#Yt}set allowed(e){this.#Yt=Ve.narrow(e,this.#Gt),this.#ts(),!this.#es&&this.#Yt.length>1&&(this.#le(),this.#es=!0),this.#ss(),this.pinned&&(this.value=this.#Yt[0])}get pinned(){return this.#Yt.length<2}get value(){return this.#Ut.getAttribute("value")}set value(e){this.#Ut.setAttribute("value",e),this.#Ut.textContent=this.#_t(e),c.set(this.#Ut,"aria-label",this.#Kt(e))}set claimed(e){this.#Zt=e,this.#ss()}#ts(){this.#Ge.replaceChildren(...this.#Yt.map(e=>{const t=document.createElement("li");t.setAttribute("role","none");const s=document.createElement("a");s.setAttribute("role","menuitem"),s.setAttribute("tabindex","-1"),s.setAttribute("value",e);const r=this.#Kt(e),i=this.#Qt[e]??e;if(r===e&&i===e)s.innerText=e;else{const e=document.createElement("span");e.innerText=i;const t=document.createElement("span");t.innerText=r,s.append(e,t)}return t.append(s),t}))}#ss(){const e=this.pinned;this.#Ut.toggleAttribute("disabled",e||this.#Zt),c.set(this.#Ut,"aria-haspopup",e?null:"true"),c.set(this.#Ut,"aria-expanded",e?null:"false"),e?this.#Ut.removeAttribute("popovertarget"):this.#Ge.id&&this.#Ut.setAttribute("popovertarget",this.#Ge.id)}#Ae(){return Array.from(this.#Ge.querySelectorAll("li > a"),e=>e)}#le(){const e=this.#Ut,t=this.#Ge;qe(e,t,{prefix:"ful-filter-menu",invoke:!0,expanded:!0}),t.addEventListener("toggle",s=>{if("open"!==s.newState)return void(t.contains(document.activeElement)&&e.focus());const r=this.#Ae();(r.find(e=>e.getAttribute("value")===this.value)??r[0])?.focus()}),t.addEventListener("keydown",t=>{const s=t.target.closest("li > a");if(!s)return;const r=this.#Ae(),i=r.indexOf(s);switch(t.code){case"ArrowDown":t.preventDefault(),r[(i+1)%r.length]?.focus();break;case"ArrowUp":t.preventDefault(),r[(i-1+r.length)%r.length]?.focus();break;case"Home":t.preventDefault(),r[0]?.focus();break;case"End":t.preventDefault(),r[r.length-1]?.focus();break;case"Enter":case"Space":t.preventDefault(),s.click(),e.focus();break;case"Escape":e.focus()}})}}const Ue={EQ:"=",NEQ:"≠",LT:"<",GT:">",LTE:"≤",GTE:"≥",BETWEEN:"↔",CONTAINS:"…a…",STARTS_WITH:"a…",ENDS_WITH:"…a"},Ge=["EQ","NEQ","LT","GT","LTE","GTE","BETWEEN"],Qe=[...Ge,"CONTAINS","STARTS_WITH","ENDS_WITH"],Ke=["IGNORE_CASE","CASE_SENSITIVE"],Je={IGNORE_CASE:"aa",CASE_SENSITIVE:"Aa"},{t:Xe}=P.of(),Ye=e=>Xe(`filters.op.${e}`),Ze=e=>Xe(`filters.sensitivity.${e}`),et=e=>Xe(""===e?"filters.boolean.any":`filters.boolean.${e}`);class tt extends me{static observed=["value:json","operators:csv"];static OPERATORS=Ge;static DEFAULT_OPERATOR="EQ";static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-affix>\n <button data-ref="operator" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n </ful-affix>\n <ful-control>\n <input data-ref="value1" data-tpl-type="type" form="">\n <input data-ref="value2" data-tpl-type="type" form="" hidden>\n </ful-control>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_operator;_container;_value1;_value2;_build(e){const t=super._build(e),s=t.fragment;return this._container=s.querySelector("ful-control-group"),this._value1=s.querySelector("[data-ref=value1]"),this._value2=s.querySelector("[data-ref=value2]"),this._operator=new Ve(s.querySelector("[data-ref=operator]"),{vocabulary:this._vocabulary(),glyphs:Ue,labelFor:Ye,interactive:()=>this._interactive(),onPick:()=>{this._syncBetween(),this._notifyChange()}}),this.operators=this.declared("operators"),this._value2.addEventListener("change",e=>{e.stopPropagation(),this._notifyChange()}),null===this._operator.value&&this._showDefaultOperator(),{...t,freeze:this._container,also:[this._value2]}}_showDefaultOperator(){const e=this._defaultOperator(),t=this._operator.allowed;this._showOperator(t.includes(e)?e:t[0])}formResetCallback(){super.formResetCallback(),this.hasAttribute("value")||this._showDefaultOperator()}_type(){return"text"}_serialize(e){return e}_deserialize(e){return e}_defaultOperator(){return"EQ"}_vocabulary(){return Ge}_declaredOperators;get operators(){return this._operator?this._operator.allowed:this._declaredOperators}set operators(e){this._operator?(this._operator.allowed=e,this._syncBetween()):this._declaredOperators=Ve.narrow(e,this._vocabulary())}get value(){return this._tuple()}set value(e){this._applyTuple(e)}_tuple(){const e=this._operator.value,t="BETWEEN"===e?[this._value1.value,this._value2.value]:[this._value1.value];return t.some(e=>""===e)?null:[e,...t.map(e=>this._serialize(e))]}_applyTuple(e){if(null==e)return this._value1.value="",void(this._value2.value="");const[t,...s]=e,r=this._operator.pinned?this._operator.allowed[0]:t;this._showOperator(r),this._value1.value=s[0]?this._deserialize(s[0]):s[0]??"",this._value2.value=s[1]?this._deserialize(s[1]):s[1]??""}_showOperator(e){this._operator.value=e,this._syncBetween()}_syncBetween(){this._value2.toggleAttribute("hidden","BETWEEN"!==this._operator.value)}get disabled(){return super.disabled}set disabled(e){super.disabled=e;for(const t of this._choices())t.claimed=e}_choices(){return[this._operator].filter(e=>e)}}class st extends tt{_defaultOperator(){return"LTE"}_type(){return"datetime-local"}_serialize(e){return be.localToIso(e)}_deserialize(e){return be.isoToLocal(e)}}class rt extends tt{_type(){return"date"}}class it extends tt{_type(){return"number"}}class nt extends tt{static observed=["sensitivities:csv"];static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-affix>\n <button data-ref="operator" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n <button data-ref="sensitivity" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n </ful-affix>\n <ful-control>\n <input data-ref="value1" data-tpl-type="type" form="">\n <input data-ref="value2" data-tpl-type="type" form="" hidden>\n </ful-control>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_defaultOperator(){return"CONTAINS"}_vocabulary(){return Qe}_sensitivityButton;_build(e){const t=super._build(e);return this._sensitivityButton=new Ve(t.fragment.querySelector("[data-ref=sensitivity]"),{vocabulary:Ke,glyphs:Je,labelFor:Ze,interactive:()=>this._interactive(),onPick:()=>this._notifyChange()}),this._sensitivityButton.allowed=null,this._sensitivityButton.value=Ke[0],t}_choices(){return[...super._choices(),this._sensitivityButton].filter(e=>e)}get _sensitivity(){return this._sensitivityButton.value}_declaredSensitivities;get sensitivities(){return this._sensitivityButton?this._sensitivityButton.allowed:this._declaredSensitivities}set sensitivities(e){if(!this._sensitivityButton)return void(this._declaredSensitivities=Ve.narrow(e,Ke));const t=this._sensitivityButton.value;this._sensitivityButton.allowed=e,this._sensitivityButton.allowed.includes(t)||(this._sensitivityButton.value=this._sensitivityButton.allowed[0])}get value(){const e=this._tuple();return null==e?null:[e[0],this._sensitivity,...e.slice(1)]}set value(e){null!=e?(this._sensitivityButton.allowed.includes(e[1])&&(this._sensitivityButton.value=e[1]),this._applyTuple([e[0],...e.slice(2)])):this._applyTuple(e)}formResetCallback(){if(super.formResetCallback(),!this.hasAttribute("value")){const e=this._sensitivityButton.allowed;this._sensitivityButton.value=e.includes("IGNORE_CASE")?"IGNORE_CASE":e[0]}}}const at=["","true","false"],ot={true:"✓",false:"✗"};class lt extends oe{static observed=["value:json","operators:csv"];static slots=!0;static OPERATORS=["EQ","NEQ"];static DEFAULT_OPERATOR="EQ";static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-affix>\n <button data-ref="operator" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n </ful-affix>\n <button data-ref="value" type="button" form=""></button>\n <ul popover role="menu"></ul>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_operator;_value;_container;_build({slots:e}){const t=this.template().withOverlay({slots:e}).render();this._container=t.querySelector("ful-control-group");const s=t.querySelector("[data-ref=value]");this._operator=new Ve(t.querySelector("[data-ref=operator]"),{vocabulary:lt.OPERATORS,glyphs:Ue,labelFor:Ye,interactive:()=>this._interactive(),onPick:()=>this._notifyChange()}),this._value=new Ve(s,{vocabulary:at,glyphs:ot,labelFor:et,display:et,interactive:()=>this._interactive(),onPick:()=>this._notifyChange()}),this.operators=this.declared("operators");const r=this._operator.allowed;return this._operator.value=r.includes(lt.DEFAULT_OPERATOR)?lt.DEFAULT_OPERATOR:r[0],this._value.allowed=null,this._value.value="",{fragment:t,control:s,error:t.querySelector("ful-field-error"),label:t.querySelector("label"),announces:null,freeze:this._container}}_declaredOperators;get operators(){return this._operator?this._operator.allowed:this._declaredOperators}set operators(e){this._operator?this._operator.allowed=e:this._declaredOperators=Ve.narrow(e,this._vocabulary())}_vocabulary(){return lt.OPERATORS}get value(){return""===this._value.value?null:[this._operator.value,this._value.value]}set value(e){null!=e?(this._operator.value=this._operator.pinned?this._operator.allowed[0]:e[0],this._value.value=e[1]??""):this._value.value=""}get disabled(){return super.disabled}set disabled(e){super.disabled=e;for(const t of[this._operator,this._value].filter(e=>e))t.claimed=e}}class ut{#rs=new WeakSet;#ie=new WeakMap;async request(e,t,s,r){const i=!this.#rs.has(t),n={name:s,section:t,index:r,first:i},a=["section:requested",...null!=r?[`section:requested:#${r}`]:[],...s?[`section:requested:${s}`]:[]],o=[];for(const t of a){const s=new CustomEvent(t,{bubbles:!0,detail:n});e.dispatchEvent(s),o.push(...s.async?.promises??[])}if(0===o.length)return;this.#rs.add(t);let l=this.#ie.get(t);l||(l=new ie,this.#ie.set(t,l));const u=l.take(),c=()=>!u.stale;t.querySelector(":scope > .ful-section-error")?.remove();const d=requestAnimationFrame(()=>{c()&&(t.toggleAttribute("loading",!0),t.setAttribute("aria-busy","true"))});try{return await Promise.all(o)}catch(e){throw c()&&this.#is(t,e),e}finally{cancelAnimationFrame(d),c()&&(t.toggleAttribute("loading",!1),t.removeAttribute("aria-busy"))}}#is(e,t){e.querySelector(":scope > .ful-section-error")?.remove();const s=document.createElement("div");s.className="ful-section-error",s.setAttribute("role","alert"),s.textContent=k.problemsText(t),e.prepend(s)}}let ct=!1;const dt=()=>{ct||(ct=!0,document.addEventListener("click",e=>{const t=e.target.closest?.("[dialog-target]");t&&document.getElementById(t.getAttribute("dialog-target"))?.open?.()}))};class ht extends S{static slots=!0;static attributes=["placement"];static config={icon:"info-circle-fill"};static template='\n <button type="button" class="ful-tip" data-ref="trigger" data-tpl-aria-label="#l10n:t(\'info.tooltip\')"><ful-icon data-tpl-name="config.icon" aria-hidden="true"></ful-icon></button>\n <ful-note popover data-ref="content">{{{{ slots.default }}}}</ful-note>\n ';render({slots:e}){const t=this.template().withOverlay({slots:e}).render(),s=t.querySelector("[data-ref=trigger]"),r=t.querySelector("[data-ref=content]");qe(s,r,{prefix:"ful-tooltip",invoke:!0,expanded:!0,handPlace:!0});const i=this.declared("placement");i&&r.setAttribute("placement",i),this.replaceChildren(t)}}class pt extends S{static attributes=["header"];static slots=!0;static template='\n <dialog data-ref="dialog" class="ful-dialog">\n <header data-tpl-if="header"><h2>{{ header }}</h2></header>\n <div data-ref="body">{{{{ slots.default }}}}</div>\n <footer>\n <button type="button" data-ref="acknowledge" data-result="acknowledged" data-tpl-if="!slots.buttons" data-tpl-aria-label="#l10n:t(\'dialog.acknowledge\')">{{ #l10n:t(\'dialog.acknowledge\') }}</button>\n {{{{ slots.buttons }}}}\n </footer>\n </dialog>\n ';#ns;#J;#as=new ut;#os=[];render({slots:e}){const t=this.template().withOverlay({slots:e,header:this.declared("header")??""}).render();this.#ns=t.querySelector("[data-ref=dialog]"),this.#J=t.querySelector("[data-ref=body]"),this.#ns.addEventListener("close",()=>{this.dispatchEvent(new CustomEvent("close",{detail:{result:""===this.#ns.returnValue?null:this.#ns.returnValue}})),this.#ce()}),this.#ns.addEventListener("click",e=>{const t=e.target.closest("button[data-result]")?.dataset.result;void 0!==t&&this.#ns.close(t)}),this.replaceChildren(t),dt()}#ce(){const e=this.#os;this.#os=[];for(const t of e)t(""===this.#ns.returnValue?null:this.#ns.returnValue)}disconnectedCallback(){this.#ce()}open(){return this.ask()}ask(){return this.#ns.open||(this.#ns.returnValue="",this.#ns.showModal(),this.#ls()),new Promise(e=>{this.#os.push(e)})}#ls(){this.#as.request(this,this.#J,null,null)?.catch(()=>{})}refresh(){return this.#as.request(this,this.#J,null,null)?.then(void 0,()=>{})}close(e){this.#ns.close(e??"")}}class ft extends S{static attributes=["title","placement"];static slots=!0;static template='\n <dialog data-ref="dialog" class="ful-drawer">\n <header>\n <h2 data-ref="title">{{ title }}</h2>\n <button type="button" data-ref="close" data-tpl-aria-label="#l10n:t(\'drawer.close\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button>\n </header>\n <section data-ref="loading" hidden><ful-spinner class="centered" role="status"><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner></section>\n <section data-ref="error" role="alert" hidden></section>\n <section data-ref="content">{{{{ slots.default }}}}</section>\n </dialog>\n ';#ns;#us;#Ft;#cs;#ds;#as=new ut;#hs=new ie;render({slots:e}){const t=this.template().withOverlay({slots:e,title:this.declared("title")??""}).render();this.#ns=t.querySelector("[data-ref=dialog]"),this.#us=t.querySelector("[data-ref=title]"),this.#Ft=t.querySelector("[data-ref=loading]"),this.#cs=t.querySelector("[data-ref=error]"),this.#ds=t.querySelector("[data-ref=content]");const s=this.declared("placement");s&&this.#ns.setAttribute("placement",s),t.querySelector("[data-ref=close]").addEventListener("click",()=>this.close()),this.#ns.addEventListener("close",()=>{this.dispatchEvent(new CustomEvent("close"))}),this.replaceChildren(t),dt()}get title(){return this.#us.textContent}set title(e){this.#us.textContent=e??""}async update(e,t){const s=this.#hs.take();this.title=e,this.#ds.replaceChildren(),this.#ps(),this.#Ft.removeAttribute("hidden"),this.#ds.setAttribute("hidden",""),this.#fs();try{const e=await t();return s.stale||(this.#ds.replaceChildren(e),this.#Ft.setAttribute("hidden",""),this.#ds.removeAttribute("hidden")),this.#ds}catch(e){throw s.stale||(this.#cs.removeAttribute("hidden"),this.#cs.textContent=k.problemsText(e),this.#Ft.setAttribute("hidden",""),this.#ds.setAttribute("hidden","")),e}}refresh(){return this.#as.request(this,this.#ds,null,null)?.then(void 0,()=>{})}open(){this.#fs()&&(this.#ps(),this.#as.request(this,this.#ds,null,null)?.catch(()=>{}))}close(){this.#ns.close()}#fs(){return!this.#ns.open&&(this.#ns.showModal(),!0)}#ps(){this.#cs.replaceChildren(),this.#cs.setAttribute("hidden",""),this.#Ft.setAttribute("hidden",""),this.#ds.removeAttribute("hidden")}}const mt=["info","success","warning","error"],gt=new Set;let bt=!1;class vt extends S{static attributes=["timeout:number"];#ms;connectedCallback(){super.connectedCallback(),this.rendered&>.add(this)}disconnectedCallback(){gt.delete(this)}render(){this.#ms=this.declared("timeout")||5e3,this.setAttribute("role","region"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-label",P.of().t("toast.region")),bt||(bt=!0,document.addEventListener("show-toast",e=>{for(const t of gt)t.show(e.detail.message,e.detail)})),gt.add(this)}show(e,t={}){const s=mt.includes(t.severity)?t.severity:"info",r=document.createElement("ful-toast");r.classList.add(s),r.setAttribute("role","error"===s?"alert":"status");const i=document.createElement("div");i.textContent=k.problemsText(e,`${e??""}`);const n=document.createElement("button");n.type="button",n.setAttribute("aria-label",P.of().t("toast.dismiss"));const a=document.createElement("ful-icon");a.setAttribute("name","x-lg"),a.setAttribute("aria-hidden","true"),n.append(a),r.append(i,n),r.addEventListener("animationend",()=>{r.classList.contains("ful-toast-out")&&r.remove()});const o=()=>{r.contains(document.activeElement)&&this.focus(),matchMedia("(prefers-reduced-motion: reduce)").matches?r.remove():(r.classList.add("ful-toast-out"),0===r.getAnimations().length&&r.remove())};return n.addEventListener("click",o),this.append(r),setTimeout(o,t.timeout??this.#ms),r}}class yt extends S{static slots=!0;static observed=["active:number"];static template='\n <ful-tablist role="tablist">{{{{ slots.tabs }}}}</ful-tablist>\n {{{{ slots.default }}}}\n ';#gs;#bs=[];#vs=[];#as=new ut;#ys=0;render({slots:e}){const t=this.template().withOverlay({slots:e}).render();this.#gs=t.querySelector("ful-tablist");const s=[...this.#gs.children];this.#vs=[...t.children].filter(e=>e!==this.#gs),s.length!==this.#vs.length&&console.warn(`ful-tabs: ${s.length} tabs declared for ${this.#vs.length} panels, the surplus is left alone`);const r=Math.min(s.length,this.#vs.length);this.#bs=[];for(let e=0;e!==r;++e){const t=this.#vs[e],r=document.createElement("button");r.type="button",r.role="tab",r.id=c.uid("ful-tab"),t.id||(t.id=c.uid("ful-tabpanel")),r.setAttribute("aria-controls",t.id),t.role="tabpanel",t.setAttribute("aria-labelledby",r.id),t.tabIndex=0,r.append(...s[e].childNodes),r.addEventListener("click",()=>{this.active=e}),s[e].replaceWith(r),this.#bs.push(r)}this.#gs.addEventListener("keydown",e=>{const t=this.#ys;let s=null;"ArrowRight"===e.key?s=(t+1)%this.#bs.length:"ArrowLeft"===e.key?s=(t-1+this.#bs.length)%this.#bs.length:"Home"===e.key?s=0:"End"===e.key&&(s=this.#bs.length-1),null!==s&&s!==t&&(e.preventDefault(),this.active=s,this.#bs[s].focus())}),this.replaceChildren(t)}get active(){return this.#ys}refresh(e){const t=e instanceof Element?this.#vs.indexOf(e):Number.isInteger(e)?e:NaN,s=this.#vs[t];if(s)return this.#as.request(this,s,null,t)?.then(void 0,()=>{});console.warn(`ful-tabs: no panel answers to "${e}"`)}set active(e){const t=Math.min(Math.max(0,Number(e)||0),Math.max(0,this.#bs.length-1)),s=this.#ys;for(const[e,s]of this.#bs.entries())s.setAttribute("aria-selected",e===t?"true":"false"),s.tabIndex=e===t?0:-1,this.#vs[e].hidden=e!==t;this.#ys=t,this.reflectTo("active",t),this.rendered&&t!==s&&this.dispatchEvent(new CustomEvent("change",{detail:{active:t,previous:s}})),this.#vs.length>0&&(t!==s||!this.rendered)&&this.#as.request(this,this.#vs[t],null,t)?.catch(()=>{})}}class wt extends S{static slots=!0;static observed=["exclusive:presence"];static template="\n <ful-accordion-group>{{{{ slots.default }}}}</ful-accordion-group>\n ";#Ce;#ws=!1;render({slots:e}){const t=this.template().withOverlay({slots:e}).render();this.#Ce=t.querySelector("ful-accordion-group"),this.replaceChildren(t)}get exclusive(){return this.#ws}set exclusive(e){this.#ws=!0===e,this.reflectTo("exclusive",this.#ws);const t=this.#ws?c.uid("ful-accordion"):null;for(const e of this.#Ce.querySelectorAll(":scope > details"))null===t?e.removeAttribute("name"):e.setAttribute("name",t)}}class Et extends S{static slots=!0;static observed=["progress"];static template="\n <ful-steps><ol data-tpl-aria-label=\"#l10n:t('wizard.progress')\">{{{{ slots.steps }}}}</ol></ful-steps>\n {{{{ slots.default }}}}\n ";#Es=[];#xs=[];#as=new ut;#As=0;#Ss;render({slots:e}){const t=this.template().withOverlay({slots:e}).render(),s=[...t.querySelector("ful-steps ol").children];this.#xs=[...t.children].filter(e=>"ful-steps"!==e.localName),s.length!==this.#xs.length&&console.warn(`ful-wizard: ${s.length} steps declared for ${this.#xs.length} sections, the surplus is left alone`);const r=Math.min(s.length,this.#xs.length);this.#Es=[];for(let e=0;e!==r;++e){const t=document.createElement("li");t.append(...s[e].childNodes),s[e].replaceWith(t),this.#Es.push(t),this.#xs[e].tabIndex=-1}if(this.replaceChildren(t),r>0){const e=this.#xs.findIndex(e=>"step"===e.getAttribute("aria-current"));this.#Ts(-1===e?0:Math.min(e,r-1)),this.#Cs(this.#As)?.catch(()=>{})}}get index(){return this.#As}get step(){return this.#xs[this.#As]?.getAttribute("data-step")??null}get progress(){return this.#Ss}set progress(e){this.#Ss=e,this.reflectTo("progress",e)}next(){return this.#_s(this.#As+1)}prev(){return this.#_s(this.#As-1)}move(e){const t=this.#xs.findIndex(t=>t.getAttribute("data-step")===e);if(-1!==t)return this.#_s(t);console.warn(`ful-wizard: no section carries data-step="${e}"`)}refresh(e){const t=e instanceof Element?e:"string"==typeof e?this.#xs.find(t=>t.getAttribute("data-step")===e):void 0,s=this.#xs.indexOf(t);if(-1!==s)return this.#Cs(s)?.then(void 0,()=>{});console.warn(`ful-wizard: no section answers to "${e}"`)}#Cs(e){return this.#as.request(this,this.#xs[e],this.#xs[e].getAttribute("data-step"),e)}#_s(e){const t=Math.min(Math.max(0,e),Math.max(0,this.#Es.length-1));if(t!==this.#As)return this.#Ts(t),this.#xs[this.#As].focus(),this.rendered&&this.dispatchEvent(new CustomEvent("change",{detail:{index:this.#As,step:this.step}})),this.#Cs(t)}#Ts(e){for(const[t,s]of this.#Es.entries())t===e?(s.setAttribute("aria-current","step"),this.#xs[t].setAttribute("aria-current","step")):(s.removeAttribute("aria-current"),this.#xs[t].removeAttribute("aria-current"));this.#As=e}}const xt={en:{"pagination.showing":"Page {current} of {total}","pagination.navigation":"Page navigation","pagination.previous":"Previous","pagination.next":"Next","pagination.reload":"Reload","table.initial":"Start searching to see results.","table.error":"Error while loading data:","table.no-data":"No elements found.","dropdown.empty":"No results","select.remove":"Remove","files.dropzone-label":"Click or drop your files here","files.remove":"Remove","files.unacceptable-file-type":"Only files of type {types} are supported","files.max-file-size-exceeded":"Maximum supported file size is {size}","files.max-total-size-exceeded":"Maximum supported total file size is {size}","files.max-files-exceeded":{one:"Maximum of {count} file exceeded",other:"Maximum of {count} files exceeded"},"filters.op.EQ":"Equals","filters.op.NEQ":"Not equal","filters.op.LT":"Less than","filters.op.GT":"Greater than","filters.op.LTE":"At most","filters.op.GTE":"At least","filters.op.BETWEEN":"Between","filters.op.CONTAINS":"Contains","filters.op.STARTS_WITH":"Starts with","filters.op.ENDS_WITH":"Ends with","filters.sensitivity.IGNORE_CASE":"Ignore case","filters.sensitivity.CASE_SENSITIVE":"Case sensitive","filters.boolean.any":"Any","filters.boolean.true":"Yes","filters.boolean.false":"No","info.tooltip":"More information","dialog.acknowledge":"Got it","drawer.close":"Close","spinner.loading":"Loading…","toast.region":"Notifications","toast.dismiss":"Dismiss","wizard.progress":"Progress"},it:{"pagination.showing":"Pagina {current} di {total}","pagination.navigation":"Navigazione pagine","pagination.previous":"Precedente","pagination.next":"Successivo","pagination.reload":"Ricarica","table.initial":"Avvia la ricerca per visualizzare i risultati.","table.error":"Errore nel caricamento dei dati:","table.no-data":"Nessun elemento trovato.","dropdown.empty":"Nessun risultato","select.remove":"Rimuovi","files.dropzone-label":"Clicca o trascina i file qui","files.remove":"Rimuovi","files.unacceptable-file-type":"Solo i file di tipo {types} sono supportati","files.max-file-size-exceeded":"La dimensione massima di un file è di {size}","files.max-total-size-exceeded":"La dimensione massima complessiva dei file è di {size}","files.max-files-exceeded":{other:"Superato il numero massimo di {count} file"},"filters.op.EQ":"Uguale","filters.op.NEQ":"Diverso","filters.op.LT":"Minore","filters.op.GT":"Maggiore","filters.op.LTE":"Al massimo","filters.op.GTE":"Almeno","filters.op.BETWEEN":"Tra","filters.op.CONTAINS":"Contiene","filters.op.STARTS_WITH":"Inizia con","filters.op.ENDS_WITH":"Termina con","filters.sensitivity.IGNORE_CASE":"Ignora maiuscole","filters.sensitivity.CASE_SENSITIVE":"Distingui maiuscole","filters.boolean.any":"Qualsiasi","filters.boolean.true":"Sì","filters.boolean.false":"No","info.tooltip":"Maggiori informazioni","dialog.acknowledge":"Ho capito","drawer.close":"Chiudi","spinner.loading":"Caricamento…","toast.region":"Notifiche","toast.dismiss":"Chiudi","wizard.progress":"Avanzamento"},es:{"pagination.showing":"Página {current} de {total}","pagination.navigation":"Navegación de páginas","pagination.previous":"Anterior","pagination.next":"Siguiente","pagination.reload":"Recargar","table.initial":"Inicia la búsqueda para ver los resultados.","table.error":"Error al cargar los datos:","table.no-data":"No se encontraron elementos.","dropdown.empty":"Sin resultados","select.remove":"Eliminar","files.dropzone-label":"Haz clic o arrastra tus archivos aquí","files.remove":"Eliminar","files.unacceptable-file-type":"Solo se admiten archivos de tipo {types}","files.max-file-size-exceeded":"El tamaño máximo de archivo admitido es {size}","files.max-total-size-exceeded":"El tamaño total máximo admitido es {size}","files.max-files-exceeded":{other:"Se ha superado el número máximo de {count} archivos"},"filters.op.EQ":"Igual","filters.op.NEQ":"Distinto","filters.op.LT":"Menor","filters.op.GT":"Mayor","filters.op.LTE":"Como máximo","filters.op.GTE":"Al menos","filters.op.BETWEEN":"Entre","filters.op.CONTAINS":"Contiene","filters.op.STARTS_WITH":"Empieza por","filters.op.ENDS_WITH":"Termina por","filters.sensitivity.IGNORE_CASE":"Ignorar mayúsculas","filters.sensitivity.CASE_SENSITIVE":"Distinguir mayúsculas","filters.boolean.any":"Cualquiera","filters.boolean.true":"Sí","filters.boolean.false":"No","info.tooltip":"Más información","dialog.acknowledge":"Entendido","drawer.close":"Cerrar","spinner.loading":"Cargando…","toast.region":"Notificaciones","toast.dismiss":"Cerrar","wizard.progress":"Progreso"},fr:{"pagination.showing":"Page {current} sur {total}","pagination.navigation":"Navigation des pages","pagination.previous":"Précédent","pagination.next":"Suivant","pagination.reload":"Recharger","table.initial":"Lancez la recherche pour voir les résultats.","table.error":"Erreur lors du chargement des données :","table.no-data":"Aucun élément trouvé.","dropdown.empty":"Aucun résultat","select.remove":"Retirer","files.dropzone-label":"Cliquez ou déposez vos fichiers ici","files.remove":"Retirer","files.unacceptable-file-type":"Seuls les fichiers de type {types} sont pris en charge","files.max-file-size-exceeded":"La taille maximale de fichier prise en charge est {size}","files.max-total-size-exceeded":"La taille totale maximale prise en charge est {size}","files.max-files-exceeded":{one:"Nombre maximal de {count} fichier dépassé",other:"Nombre maximal de {count} fichiers dépassé"},"filters.op.EQ":"Égal","filters.op.NEQ":"Différent","filters.op.LT":"Inférieur","filters.op.GT":"Supérieur","filters.op.LTE":"Au plus","filters.op.GTE":"Au moins","filters.op.BETWEEN":"Entre","filters.op.CONTAINS":"Contient","filters.op.STARTS_WITH":"Commence par","filters.op.ENDS_WITH":"Finit par","filters.sensitivity.IGNORE_CASE":"Ignorer la casse","filters.sensitivity.CASE_SENSITIVE":"Respecter la casse","filters.boolean.any":"Indifférent","filters.boolean.true":"Oui","filters.boolean.false":"Non","info.tooltip":"Plus d’informations","dialog.acknowledge":"J’ai compris","drawer.close":"Fermer","spinner.loading":"Chargement…","toast.region":"Notifications","toast.dismiss":"Fermer","wizard.progress":"Progression"}};class At{#Os;#qs;#Rs;constructor(e={}){this.#Os=e.language??navigator?.language??"en",this.#qs=e.translations??{},this.#Rs=e.httpClient??null}configure(e){const t=this.#Rs??V.builder().withCsrfToken().withRedirectOnUnauthorized("/").build(),s=this.#Os.split("-")[0],r={...xt.en,...xt[s],...this.#qs};e.defineModule("l10n",P).defineComponent("http-client",t).defineElement("ful-tooltip",ht).defineElement("ful-dialog",pt).defineElement("ful-drawer",ft).defineElement("ful-toasts",vt).defineElement("ful-tabs",yt).defineElement("ful-accordion",wt).defineElement("ful-wizard",Et).defineElement("ful-form",de).defineElement("ful-checkbox",De).defineElement("ful-input",me).defineElement("ful-input-file",Ee).defineElement("ful-local-date",ge).defineElement("ful-instant",be).defineElement("ful-input-local-date",ve).defineElement("ful-input-local-time",ye).defineElement("ful-input-instant",we).defineElement("ful-radio-group",Me).defineElement("ful-table",We).defineElement("ful-pagination",Ie).defineElement("ful-sorter",Fe).defineElement("ful-filter-instant",st).defineElement("ful-filter-local-date",rt).defineElement("ful-filter-number",it).defineElement("ful-filter-boolean",lt).defineElement("ful-filter-text",nt).defineElement("ful-select",ze).defineElement("ful-dropdown",ke).defineComponent("loaders:select",Le).defineComponent("loaders:form",ce).defineComponent("loaders:table",He).defineOverlay({l10n:r,locale:this.#Os})}}var St=Object.freeze({__proto__:null,Accordion:wt,AsyncEvents:re,Bindings:ae,BooleanFilter:lt,Checkbox:De,Claims:ie,CompareFilter:tt,Dialog:pt,Drawer:ft,Dropdown:ke,Field:oe,Form:de,FormLoader:ce,Input:me,InputFile:Ee,InputInstant:we,InputLocalDate:ve,InputLocalTime:ye,Instant:be,InstantFilter:st,LocalDate:ge,LocalDateFilter:rt,LocalStorage:Z,NumberFilter:it,Pagination:Ie,Plugin:At,RadioGroup:Me,Select:ze,SelectLoader:Le,SessionStorage:ee,SortButton:Fe,Table:We,TableLoader:He,TableSchemaParser:$e,Tabs:yt,TextFilter:nt,Timing:ne,Toasts:vt,Tooltip:ht,VersionedLocalStorage:te,VersionedSessionStorage:se,Wizard:Et});return"undefined"!=typeof window&&(window.ftl=L,window.httpc=J,window.ful=St),e.Accordion=wt,e.AsyncEvents=re,e.Attributes=c,e.Base64=z,e.Bindings=ae,e.BooleanFilter=lt,e.BoundedCache=t,e.Checkbox=De,e.Claims=ie,e.CompareFilter=tt,e.Dialog=pt,e.Drawer=ft,e.Dropdown=ke,e.ExpressionEvaluator=l,e.Expressions=o,e.Failure=k,e.Field=oe,e.Form=de,e.FormLoader=ce,e.Fragments=u,e.Hex=M,e.HttpClient=V,e.HttpClientBuilder=j,e.HttpClientError=F,e.HttpInterceptorChain=W,e.HttpMultipartRequestCustomizer=K,e.HttpRequestBuilder=Q,e.Input=me,e.InputFile=Ee,e.InputInstant=we,e.InputLocalDate=ve,e.InputLocalTime=ye,e.Instant=be,e.InstantFilter=st,e.LightSlots=d,e.LocalDate=ge,e.LocalDateFilter=rt,e.LocalStorage=Z,e.Localization=P,e.MediaType=D,e.Nodes=h,e.NumberFilter=it,e.Pagination=Ie,e.ParsedElement=S,e.Plugin=At,e.RadioGroup=Me,e.Registry=w,e.RenderError=v,e.Rendering=A,e.Select=ze,e.SelectLoader=Le,e.SessionStorage=ee,e.SortButton=Fe,e.Table=We,e.TableLoader=He,e.TableSchemaParser=$e,e.Tabs=yt,e.Template=b,e.Templates=x,e.TextFilter=nt,e.Timing=ne,e.Toasts=vt,e.Tooltip=ht,e.VersionedLocalStorage=te,e.VersionedSessionStorage=se,e.Wizard=Et,e.registry=E,e}({});
|
|
1
|
+
var fml=function(t){"use strict";class e{#t;#e=new Map;constructor(t){this.#t=t}getOrCompute(t,e){if(this.#e.has(t))return this.#e.get(t);const s=e(t);return this.#e.size>=this.#t&&this.#e.delete(this.#e.keys().next().value),this.#e.set(t,s),s}get size(){return this.#e.size}}const s={ter:Symbol("ternary"),elv:Symbol("elvis"),nullc:Symbol("null-coalescence"),or:Symbol("or"),and:Symbol("and"),eq:Symbol("eq"),cmp:Symbol("cmp"),not:Symbol("not"),access:Symbol("access"),member:Symbol("access-member"),subscript:Symbol("access-subscript"),method:Symbol("access-method-call"),call:Symbol("module-function-call"),tstring:Symbol("tstring"),literal:Symbol("literal"),array:Symbol("array-literal"),dict:Symbol("dict-literal"),function:Symbol("module-function"),symbol:Symbol("symbol"),templated:{ten:Symbol("templated-node"),teh:Symbol("templated-html"),tet:Symbol("templated-text"),tel:Symbol("templated-literal")},dom:{t:Symbol("text"),h:Symbol("html"),n:Symbol("node")}},r=new Map([["true",!0],["false",!1],["null",null],["undefined",void 0]]);class i extends SyntaxError{constructor(t,e,s,r){super(t),this.expected=e,this.found=s,this.location=r,this.name="SyntaxError"}format(t){let e="Error: "+this.message;if(this.location){let s=null;const r=t.find(t=>t.source===this.location.source);r&&(s=r.text.split(/\r\n|\n|\r/g));const i=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,a=this.location.source+":"+n.line+":"+n.column;if(s){const t=this.location.end,r="".padEnd(n.line.toString().length," "),o=s[i.line-1],l=(i.line===t.line?t.column:o.length+1)-i.column||1;e+="\n --\x3e "+a+"\n"+r+" |\n"+n.line+" | "+o+"\n"+r+" | "+"".padEnd(i.column-1," ")+"".padEnd(l,"^")}else e+="\n at "+a}return e}static buildMessage(t,e){function s(t){return t.codePointAt(0).toString(16).toUpperCase()}const r=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function i(t){return r?t.replace(r,t=>"\\u{"+s(t)+"}"):t}function n(t){return i(t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+s(t)).replace(/[\x10-\x1F\x7F-\x9F]/g,t=>"\\x"+s(t)))}function a(t){return i(t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+s(t)).replace(/[\x10-\x1F\x7F-\x9F]/g,t=>"\\x"+s(t)))}const o={literal:t=>'"'+n(t.text)+'"',class(t){const e=t.parts.map(t=>Array.isArray(t)?a(t[0])+"-"+a(t[1]):a(t));return"["+(t.inverted?"^":"")+e.join("")+"]"+(t.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:t=>t.description};function l(t){return o[t.type](t)}return"Expected "+function(t){const e=t.map(l);if(e.sort(),e.length>0){let t=1;for(let s=1;s<e.length;s++)e[s-1]!==e[s]&&(e[t]=e[s],t++);e.length=t}switch(e.length){case 1:return e[0];case 2:return e[0]+" or "+e[1];default:return e.slice(0,-1).join(", ")+", or "+e[e.length-1]}}(t)+" but "+function(t){return t?'"'+n(t)+'"':"end of input"}(e)+" found."}}const n=(t,e)=>{if("self"===e)return t[t.length-1];for(let s=t.length-1;s>=0;s--){const r=t[s];if(null!=r&&("object"==typeof r||"function"==typeof r)&&e in r)return r[e]}};class a{#s;#r;constructor(t,e){this.#s=t,this.#r=e}#i(t){return n(this.#r,t)}#n(t,e){const r=0===e?t.lhs:t.rhs[e-1];return r.type===s.symbol?r.value:r.type===s.member?r.rhs:null}#a;#o(){return this.#a||(this.#a=new Proxy(this.#r,{get:(t,e)=>this.#i(e)})),this.#a}[s.and](t){return this.visit(t.lhs)&&this.visit(t.rhs)}[s.or](t){return this.visit(t.lhs)||this.visit(t.rhs)}[s.nullc](t){return this.visit(t.lhs)??this.visit(t.rhs)}[s.not](t){return!this.visit(t.expr)}[s.eq](t){const e=this.visit(t.lhs)===this.visit(t.rhs);return"=="===t.op?e:!e}[s.cmp](t){const e=this.visit(t.lhs),s=this.visit(t.rhs);switch(t.op){case">":return e>s;case"<":return e<s;case">=":return e>=s;case"<=":return e<=s;default:throw new Error(`unknown cmp op ${t.op}`)}}[s.call](t){const e=t.value,s=null===e.module?this.#s:this.#s?.[e.module];if(!s)throw new Error(`Module "${e.module}" not found`);const r=s[e.value];if(!r)throw new Error(`Function "#${null===e.module?"":`${e.module}:`}${e.value}" not found`);const i=t.args.map(t=>this.visit(t));return r.apply(this.#o(),i)}[s.literal](t){return t.value}[s.tstring](t){let e="";const s=t.parts;for(let t=0,r=s.length;t<r;t++){const r=this.visit(s[t]);null!=r&&(e+=r)}return e}[s.symbol](t){return this.#i(t.value)}[s.dict](t){return Object.fromEntries(t.value.map(t=>[this.visit(t[0]),this.visit(t[1])]))}[s.array](t){return t.value.map(t=>this.visit(t))}[s.ter](t){return this.visit(t.cond)?this.visit(t.ifTrue):this.visit(t.ifFalse)}[s.elv](t){return this.visit(t.cond)||this.visit(t.ifFalse)}[s.access](t){let e,r=this.visit(t.lhs);for(let i=0;i!==t.rhs.length;++i){const n=t.rhs[i];if(n.ns&&null==r)return;let a;switch(n.type){case s.member:a=r[n.rhs];break;case s.subscript:a=r[this.visit(n.rhs)];break;case s.method:{if(!r){const e=this.#n(t,i);throw new Error(null===e?"Method missing":`Method missing "${e}"`)}const s=n.args.map(t=>this.visit(t));a=r.apply(e,s);break}}e=r,r=a}return r}visit(t,...e){return this[t.type](t,...e)}visitRoot(t,e){return e?t.map(t=>{switch(t.type){case s.templated.tel:return{type:s.dom.t,value:t.value};case s.templated.tet:return{type:s.dom.t,value:this.visit(t.value)};case s.templated.teh:return{type:s.dom.h,value:this.visit(t.value)};case s.templated.ten:return{type:s.dom.n,value:this.visit(t.value)};default:throw new Error(`unknown node type ${t.type.toString()}`)}}):this.visit(t)}}class o{static MODE_EXPRESSION=Symbol("MODE_EXPRESSION");static MODE_TEMPLATED=Symbol("MODE_TEMPLATED");static#l=new e(1e3);static parse(t,e){const n=e?.toString()+t;return this.#l.getOrCompute(n,()=>function(t,e){const n={},a=(e=void 0!==e?e:{}).grammarSource,o={TemplatedRoot:me,ExpressionRoot:be};let l=me;const u="{{{{",c="}}}}",d="{{{",h="}}}",p="{{",f="}}",m="\\",g="{",b="?",v=":",y="?:",w="??",E="||",x="&&",A="!",S="?.",T=".",C="[",_="]",O="(",k=",",q=")",L="-",R="'",N='"',P="`",M="}",F="#",D="==",z="!=",I=">=",$=">",B="<=",j="<",H=/^[^\\{]/,W=/^[0-9]/,V=/^[^']/,U=/^[^"]/,G=/^[^\\`{]/,Q=/^[a-zA-Z$_]/,K=/^[a-zA-Z$_0-9]/,J=/^[ \t\n\r]/,X=ue("{{{{",!1),Y=ue("}}}}",!1),Z=ue("{{{",!1),tt=ue("}}}",!1),et=ue("{{",!1),st=ue("}}",!1),rt=ce(["\\","{"],!0,!1,!1),it=ue("\\",!1),nt={type:"any"},at=ue("{",!1),ot=ue("?",!1),lt=ue(":",!1),ut=ue("?:",!1),ct=ue("??",!1),dt=ue("||",!1),ht=ue("&&",!1),pt=ue("!",!1),ft=de("member"),mt=ue("?.",!1),gt=ue(".",!1),bt=de("subscript"),vt=ue("[",!1),yt=ue("]",!1),wt=de("method-call"),Et=ue("(",!1),xt=ue(",",!1),At=ue(")",!1),St=de("module-function-call"),Tt=de("number-literal"),Ct=ue("-",!1),_t=ce([["0","9"]],!1,!1,!1),Ot=de("string-literal"),kt=ue("'",!1),qt=ce(["'"],!0,!1,!1),Lt=ue('"',!1),Rt=ce(['"'],!0,!1,!1),Nt=ue("`",!1),Pt=de("tstring-expression"),Mt=ue("}",!1),Ft=de("tstring-literal"),Dt=ce(["\\","`","{"],!0,!1,!1),zt=de("array-literal"),It=de("dict-literal"),$t=de("module-function"),Bt=ue("#",!1),jt=ce([["a","z"],["A","Z"],"$","_"],!1,!1,!1),Ht=ce([["a","z"],["A","Z"],"$","_",["0","9"]],!1,!1,!1),Wt=de("identifier-or-keyword"),Vt=ue("==",!1),Ut=ue("!=",!1),Gt=ue(">=",!1),Qt=ue(">",!1),Kt=ue("<=",!1),Jt=ue("<",!1),Xt=ce([" ","\t","\n","\r"],!1,!1,!1);function Yt(t){return t}function Zt(t,e,s){return{op:e,rhs:s}}function te(t,e,s){return{op:e,rhs:s}}function ee(t){return t}let se=0|e.peg$currPos;const re=[{line:1,column:1}];let ie,ne=se,ae=e.peg$maxFailExpected||[],oe=0|e.peg$silentFails,le={};if(e.startRule){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');l=o[e.startRule]}function ue(t,e){return{type:"literal",text:t,ignoreCase:e}}function ce(t,e,s,r){return{type:"class",parts:t,inverted:e,ignoreCase:s,unicode:r}}function de(t){return{type:"other",description:t}}function he(e){let s,r=re[e];if(r)return r;if(e>=re.length)s=re.length-1;else for(s=e;!re[--s];);for(r=re[s],r={line:r.line,column:r.column};s<e;)10===t.charCodeAt(s)?(r.line++,r.column=1):r.column++,s++;return re[e]=r,r}function pe(t,e,s){const r=he(t),i=he(e);return{source:a,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:i.line,column:i.column}}}function fe(t){se<ne||(se>ne&&(ne=se,ae=[]),ae.push(t))}function me(){let t,e;const s=38*se+0,r=le[s];if(r)return se=r.nextPos,r.result;for(t=[],e=ge();e!==n;)t.push(e),e=ge();return le[s]={nextPos:se,result:t},t}function ge(){let e,r,i,a,o;const l=38*se+1,b=le[l];return b?(se=b.nextPos,b.result):(e=se,r=se,i=function(){let e;const s=38*se+2,r=le[s];return r?(se=r.nextPos,r.result):(t.substr(se,4)===u?(e=u,se+=4):(e=n,0===oe&&fe(X)),le[s]={nextPos:se,result:e},e)}(),i!==n?(a=be(),a!==n?(o=function(){let e;const s=38*se+3,r=le[s];return r?(se=r.nextPos,r.result):(t.substr(se,4)===c?(e=c,se+=4):(e=n,0===oe&&fe(Y)),le[s]={nextPos:se,result:e},e)}(),o!==n?r=a:(se=r,r=n)):(se=r,r=n)):(se=r,r=n),r!==n&&(v=r,r={type:s.templated.ten,value:v}),e=r,e===n&&(e=se,r=se,i=function(){let e;const s=38*se+4,r=le[s];return r?(se=r.nextPos,r.result):(t.substr(se,3)===d?(e=d,se+=3):(e=n,0===oe&&fe(Z)),le[s]={nextPos:se,result:e},e)}(),i!==n?(a=be(),a!==n?(o=function(){let e;const s=38*se+5,r=le[s];return r?(se=r.nextPos,r.result):(t.substr(se,3)===h?(e=h,se+=3):(e=n,0===oe&&fe(tt)),le[s]={nextPos:se,result:e},e)}(),o!==n?r=a:(se=r,r=n)):(se=r,r=n)):(se=r,r=n),r!==n&&(r=function(t){return{type:s.templated.teh,value:t}}(r)),e=r,e===n&&(e=se,r=se,i=function(){let e;const s=38*se+6,r=le[s];return r?(se=r.nextPos,r.result):(t.substr(se,2)===p?(e=p,se+=2):(e=n,0===oe&&fe(et)),le[s]={nextPos:se,result:e},e)}(),i!==n?(a=be(),a!==n?(o=function(){let e;const s=38*se+7,r=le[s];return r?(se=r.nextPos,r.result):(t.substr(se,2)===f?(e=f,se+=2):(e=n,0===oe&&fe(st)),le[s]={nextPos:se,result:e},e)}(),o!==n?r=a:(se=r,r=n)):(se=r,r=n)):(se=r,r=n),r!==n&&(r=function(t){return{type:s.templated.tet,value:t}}(r)),e=r,e===n&&(e=se,r=function(){let e,s,r,i,a,o,l;const u=38*se+8,c=le[u];if(c)return se=c.nextPos,c.result;if(e=se,s=[],r=se,i=[],a=t.charAt(se),H.test(a)?se++:(a=n,0===oe&&fe(rt)),a!==n)for(;a!==n;)i.push(a),a=t.charAt(se),H.test(a)?se++:(a=n,0===oe&&fe(rt));else i=n;if(r=i!==n?t.substring(r,se):i,r===n&&(r=se,92===t.charCodeAt(se)?(i=m,se++):(i=n,0===oe&&fe(it)),i!==n?(t.length>se?(a=t.charAt(se),se++):(a=n,0===oe&&fe(nt)),a!==n?r=a:(se=r,r=n)):(se=r,r=n),r===n&&(r=se,i=se,123===t.charCodeAt(se)?(a=g,se++):(a=n,0===oe&&fe(at)),a!==n?(o=se,oe++,123===t.charCodeAt(se)?(l=g,se++):(l=n,0===oe&&fe(at)),oe--,l===n?o=void 0:(se=o,o=n),o!==n?(a=[a,o],i=a):(se=i,i=n)):(se=i,i=n),r=i!==n?t.substring(r,se):i)),r!==n)for(;r!==n;){if(s.push(r),r=se,i=[],a=t.charAt(se),H.test(a)?se++:(a=n,0===oe&&fe(rt)),a!==n)for(;a!==n;)i.push(a),a=t.charAt(se),H.test(a)?se++:(a=n,0===oe&&fe(rt));else i=n;r=i!==n?t.substring(r,se):i,r===n&&(r=se,92===t.charCodeAt(se)?(i=m,se++):(i=n,0===oe&&fe(it)),i!==n?(t.length>se?(a=t.charAt(se),se++):(a=n,0===oe&&fe(nt)),a!==n?r=Yt(a):(se=r,r=n)):(se=r,r=n),r===n&&(r=se,i=se,123===t.charCodeAt(se)?(a=g,se++):(a=n,0===oe&&fe(at)),a!==n?(o=se,oe++,123===t.charCodeAt(se)?(l=g,se++):(l=n,0===oe&&fe(at)),oe--,l===n?o=void 0:(se=o,o=n),o!==n?(a=[a,o],i=a):(se=i,i=n)):(se=i,i=n),r=i!==n?t.substring(r,se):i))}else s=n;return s!==n&&(s=s.join("")),e=s,le[u]={nextPos:se,result:e},e}(),r!==n&&(r=function(t){return{type:s.templated.tel,value:t}}(r)),e=r))),le[l]={nextPos:se,result:e},e);var v}function be(){let t,e;const s=38*se+9,r=le[s];return r?(se=r.nextPos,r.result):(t=se,Pe(),e=ve(),e!==n?(Pe(),t=e):(se=t,t=n),le[s]={nextPos:se,result:t},t)}function ve(){let e,r,i,a,o,l;const u=38*se+10,c=le[u];return c?(se=c.nextPos,c.result):(e=se,r=ye(),r!==n?(Pe(),63===t.charCodeAt(se)?(i=b,se++):(i=n,0===oe&&fe(ot)),i!==n?(Pe(),a=ve(),a!==n?(Pe(),58===t.charCodeAt(se)?(o=v,se++):(o=n,0===oe&&fe(lt)),o!==n?(Pe(),l=ve(),l!==n?e={type:s.ter,cond:r,ifTrue:a,ifFalse:l}:(se=e,e=n)):(se=e,e=n)):(se=e,e=n)):(se=e,e=n)):(se=e,e=n),e===n&&(e=ye()),le[u]={nextPos:se,result:e},e)}function ye(){let e,r,i,a;const o=38*se+11,l=le[o];return l?(se=l.nextPos,l.result):(e=se,r=we(),r!==n?(Pe(),t.substr(se,2)===y?(i=y,se+=2):(i=n,0===oe&&fe(ut)),i!==n?(Pe(),a=ye(),a!==n?e={type:s.elv,cond:r,ifFalse:a}:(se=e,e=n)):(se=e,e=n)):(se=e,e=n),e===n&&(e=we()),le[o]={nextPos:se,result:e},e)}function we(){let e,r,i,a;const o=38*se+12,l=le[o];return l?(se=l.nextPos,l.result):(e=se,r=Ee(),r!==n?(Pe(),t.substr(se,2)===w?(i=w,se+=2):(i=n,0===oe&&fe(ct)),i!==n?(Pe(),a=we(),a!==n?e={type:s.nullc,lhs:r,rhs:a}:(se=e,e=n)):(se=e,e=n)):(se=e,e=n),e===n&&(e=Ee()),le[o]={nextPos:se,result:e},e)}function Ee(){let e,r,i,a,o,l;const u=38*se+13,c=le[u];if(c)return se=c.nextPos,c.result;if(e=se,r=xe(),r!==n){for(i=[],a=se,Pe(),t.substr(se,2)===E?(o=E,se+=2):(o=n,0===oe&&fe(dt)),o!==n?(Pe(),l=xe(),l!==n?a=l:(se=a,a=n)):(se=a,a=n);a!==n;)i.push(a),a=se,Pe(),t.substr(se,2)===E?(o=E,se+=2):(o=n,0===oe&&fe(dt)),o!==n?(Pe(),l=xe(),l!==n?a=l:(se=a,a=n)):(se=a,a=n);e=function(t,e){let r=t;for(const t of e)r={type:s.or,lhs:r,rhs:t};return r}(r,i)}else se=e,e=n;return le[u]={nextPos:se,result:e},e}function xe(){let e,r,i,a,o,l;const u=38*se+14,c=le[u];if(c)return se=c.nextPos,c.result;if(e=se,r=Ae(),r!==n){for(i=[],a=se,Pe(),t.substr(se,2)===x?(o=x,se+=2):(o=n,0===oe&&fe(ht)),o!==n?(Pe(),l=Ae(),l!==n?a=l:(se=a,a=n)):(se=a,a=n);a!==n;)i.push(a),a=se,Pe(),t.substr(se,2)===x?(o=x,se+=2):(o=n,0===oe&&fe(ht)),o!==n?(Pe(),l=Ae(),l!==n?a=l:(se=a,a=n)):(se=a,a=n);e=function(t,e){let r=t;for(const t of e)r={type:s.and,lhs:r,rhs:t};return r}(r,i)}else se=e,e=n;return le[u]={nextPos:se,result:e},e}function Ae(){let t,e,r,i,a,o;const l=38*se+15,u=le[l];if(u)return se=u.nextPos,u.result;if(t=se,e=Se(),e!==n){for(r=[],i=se,Pe(),a=Re(),a!==n?(Pe(),o=Se(),o!==n?i=Zt(0,a,o):(se=i,i=n)):(se=i,i=n);i!==n;)r.push(i),i=se,Pe(),a=Re(),a!==n?(Pe(),o=Se(),o!==n?i=Zt(0,a,o):(se=i,i=n)):(se=i,i=n);t=function(t,e){let r=t;for(const t of e)r={type:s.eq,op:t.op,lhs:r,rhs:t.rhs};return r}(e,r)}else se=t,t=n;return le[l]={nextPos:se,result:t},t}function Se(){let t,e,r,i,a,o;const l=38*se+16,u=le[l];if(u)return se=u.nextPos,u.result;if(t=se,e=Te(),e!==n){for(r=[],i=se,Pe(),a=Ne(),a!==n?(Pe(),o=Te(),o!==n?i=te(0,a,o):(se=i,i=n)):(se=i,i=n);i!==n;)r.push(i),i=se,Pe(),a=Ne(),a!==n?(Pe(),o=Te(),o!==n?i=te(0,a,o):(se=i,i=n)):(se=i,i=n);t=function(t,e){let r=t;for(const t of e)r={type:s.cmp,op:t.op,lhs:r,rhs:t.rhs};return r}(e,r)}else se=t,t=n;return le[l]={nextPos:se,result:t},t}function Te(){let e,r,i;const a=38*se+17,o=le[a];return o?(se=o.nextPos,o.result):(e=se,33===t.charCodeAt(se)?(r=A,se++):(r=n,0===oe&&fe(pt)),r!==n?(Pe(),i=Te(),i!==n?e={type:s.not,expr:i}:(se=e,e=n)):(se=e,e=n),e===n&&(e=function(){let t,e,r,i,a;const o=38*se+18,l=le[o];if(l)return se=l.nextPos,l.result;if(t=se,e=_e(),e!==n){if(Pe(),r=[],i=se,a=Ce(),a!==n?(Pe(),i=a):(se=i,i=n),i!==n)for(;i!==n;)r.push(i),i=se,a=Ce(),a!==n?(Pe(),i=a):(se=i,i=n);else r=n;r!==n?t={type:s.access,lhs:e,rhs:r}:(se=t,t=n)}else se=t,t=n;return t===n&&(t=_e()),le[o]={nextPos:se,result:t},t}()),le[a]={nextPos:se,result:e},e)}function Ce(){let e;const r=38*se+19,i=le[r];return i?(se=i.nextPos,i.result):(e=function(){let e,r,i;const a=38*se+20,o=le[a];return o?(se=o.nextPos,o.result):(oe++,e=se,t.substr(se,2)===S?(r=S,se+=2):(r=n,0===oe&&fe(mt)),r===n&&(46===t.charCodeAt(se)?(r=T,se++):(r=n,0===oe&&fe(gt))),r!==n?(Pe(),i=Le(),i!==n?e={type:s.member,ns:"?."===r,rhs:i}:(se=e,e=n)):(se=e,e=n),oe--,e===n&&(r=n,0===oe&&fe(ft)),le[a]={nextPos:se,result:e},e)}(),e===n&&(e=function(){let e,r,i,a,o;const l=38*se+21,u=le[l];return u?(se=u.nextPos,u.result):(oe++,e=se,t.substr(se,2)===S?(r=S,se+=2):(r=n,0===oe&&fe(mt)),r===n&&(r=null),91===t.charCodeAt(se)?(i=C,se++):(i=n,0===oe&&fe(vt)),i!==n?(Pe(),a=ve(),a!==n?(Pe(),93===t.charCodeAt(se)?(o=_,se++):(o=n,0===oe&&fe(yt)),o!==n?e={type:s.subscript,ns:null!==r,rhs:a}:(se=e,e=n)):(se=e,e=n)):(se=e,e=n),oe--,e===n&&(r=n,0===oe&&fe(bt)),le[l]={nextPos:se,result:e},e)}(),e===n&&(e=function(){let e,r,i,a,o,l,u,c;const d=38*se+22,h=le[d];if(h)return se=h.nextPos,h.result;if(oe++,e=se,t.substr(se,2)===S?(r=S,se+=2):(r=n,0===oe&&fe(mt)),r===n&&(r=null),40===t.charCodeAt(se)?(i=O,se++):(i=n,0===oe&&fe(Et)),i!==n){for(Pe(),a=se,o=ve(),o!==n?(l=Pe(),a=o):(se=a,a=n),a===n&&(a=null),o=[],l=se,44===t.charCodeAt(se)?(u=k,se++):(u=n,0===oe&&fe(xt)),u!==n?(Pe(),c=ve(),c!==n?(Pe(),l=c):(se=l,l=n)):(se=l,l=n);l!==n;)o.push(l),l=se,44===t.charCodeAt(se)?(u=k,se++):(u=n,0===oe&&fe(xt)),u!==n?(Pe(),c=ve(),c!==n?(Pe(),l=c):(se=l,l=n)):(se=l,l=n);41===t.charCodeAt(se)?(l=q,se++):(l=n,0===oe&&fe(At)),l!==n?e=function(t,e,r){return{type:s.method,ns:null!==t,args:null===e?[]:[e,...r]}}(r,a,o):(se=e,e=n)}else se=e,e=n;return oe--,e===n&&(r=n,0===oe&&fe(wt)),le[d]={nextPos:se,result:e},e}())),le[r]={nextPos:se,result:e},e)}function _e(){let e,i,a,o;const l=38*se+23,u=le[l];return u?(se=u.nextPos,u.result):(e=se,40===t.charCodeAt(se)?(i=O,se++):(i=n,0===oe&&fe(Et)),i!==n?(Pe(),a=ve(),a!==n?(Pe(),41===t.charCodeAt(se)?(o=q,se++):(o=n,0===oe&&fe(At)),o!==n?e=a:(se=e,e=n)):(se=e,e=n)):(se=e,e=n),e===n&&(e=function(){let e,r,i,a,o,l,u,c;const d=38*se+24,h=le[d];if(h)return se=h.nextPos,h.result;if(oe++,e=se,r=function(){let e,r,i,a,o;const l=38*se+32,u=le[l];return u?(se=u.nextPos,u.result):(oe++,e=se,35===t.charCodeAt(se)?(r=F,se++):(r=n,0===oe&&fe(Bt)),r!==n?(i=se,a=Le(),a!==n?(58===t.charCodeAt(se)?(o=v,se++):(o=n,0===oe&&fe(lt)),o!==n?i=a:(se=i,i=n)):(se=i,i=n),i===n&&(i=null),a=Le(),a!==n?e={type:s.function,module:i,value:a}:(se=e,e=n)):(se=e,e=n),oe--,e===n&&(r=n,0===oe&&fe($t)),le[l]={nextPos:se,result:e},e)}(),r!==n)if(40===t.charCodeAt(se)?(i=O,se++):(i=n,0===oe&&fe(Et)),i!==n){for(Pe(),a=se,o=ve(),o!==n?(l=Pe(),a=o):(se=a,a=n),a===n&&(a=null),o=[],l=se,44===t.charCodeAt(se)?(u=k,se++):(u=n,0===oe&&fe(xt)),u!==n?(Pe(),c=ve(),c!==n?(Pe(),l=c):(se=l,l=n)):(se=l,l=n);l!==n;)o.push(l),l=se,44===t.charCodeAt(se)?(u=k,se++):(u=n,0===oe&&fe(xt)),u!==n?(Pe(),c=ve(),c!==n?(Pe(),l=c):(se=l,l=n)):(se=l,l=n);41===t.charCodeAt(se)?(l=q,se++):(l=n,0===oe&&fe(At)),l!==n?e=function(t,e,r){const i=null===e?[]:[e,...r];return{type:s.call,value:t,args:i}}(r,a,o):(se=e,e=n)}else se=e,e=n;else se=e,e=n;return oe--,e===n&&(r=n,0===oe&&fe(St)),le[d]={nextPos:se,result:e},e}(),e===n&&(e=function(){let e;const r=38*se+25,i=le[r];return i?(se=i.nextPos,i.result):(e=function(){let e,r,i,a,o,l,u,c,d,h;const p=38*se+26,f=le[p];if(f)return se=f.nextPos,f.result;if(oe++,e=se,r=se,i=se,45===t.charCodeAt(se)?(a=L,se++):(a=n,0===oe&&fe(Ct)),a===n&&(a=null),o=se,l=[],u=t.charAt(se),W.test(u)?se++:(u=n,0===oe&&fe(_t)),u!==n)for(;u!==n;)l.push(u),u=t.charAt(se),W.test(u)?se++:(u=n,0===oe&&fe(_t));else l=n;if(l!==n){if(u=se,46===t.charCodeAt(se)?(c=T,se++):(c=n,0===oe&&fe(gt)),c!==n){for(d=[],h=t.charAt(se),W.test(h)?se++:(h=n,0===oe&&fe(_t));h!==n;)d.push(h),h=t.charAt(se),W.test(h)?se++:(h=n,0===oe&&fe(_t));c=[c,d],u=c}else se=u,u=n;u===n&&(u=null),l=[l,u],o=l}else se=o,o=n;if(o===n)if(o=se,46===t.charCodeAt(se)?(l=T,se++):(l=n,0===oe&&fe(gt)),l!==n){if(u=[],c=t.charAt(se),W.test(c)?se++:(c=n,0===oe&&fe(_t)),c!==n)for(;c!==n;)u.push(c),c=t.charAt(se),W.test(c)?se++:(c=n,0===oe&&fe(_t));else u=n;u!==n?(l=[l,u],o=l):(se=o,o=n)}else se=o,o=n;return o!==n?(a=[a,o],i=a):(se=i,i=n),r=i!==n?t.substring(r,se):i,r!==n&&(r={type:s.literal,value:parseFloat(r)}),e=r,oe--,e===n&&(r=n,0===oe&&fe(Tt)),le[p]={nextPos:se,result:e},e}(),e===n&&(e=Oe(),e===n&&(e=function(){let e,r,i,a,o,l,u;const c=38*se+30,d=le[c];if(d)return se=d.nextPos,d.result;if(oe++,e=se,91===t.charCodeAt(se)?(r=C,se++):(r=n,0===oe&&fe(vt)),r!==n){for(Pe(),i=ve(),i===n&&(i=null),Pe(),a=[],o=se,44===t.charCodeAt(se)?(l=k,se++):(l=n,0===oe&&fe(xt)),l!==n?(Pe(),u=ve(),u!==n?(Pe(),o=u):(se=o,o=n)):(se=o,o=n);o!==n;)a.push(o),o=se,44===t.charCodeAt(se)?(l=k,se++):(l=n,0===oe&&fe(xt)),l!==n?(Pe(),u=ve(),u!==n?(Pe(),o=u):(se=o,o=n)):(se=o,o=n);93===t.charCodeAt(se)?(o=_,se++):(o=n,0===oe&&fe(yt)),o!==n?e=function(t,e){const r=null===t?[]:[t,...e];return{type:s.array,value:r}}(i,a):(se=e,e=n)}else se=e,e=n;return oe--,e===n&&(r=n,0===oe&&fe(zt)),le[c]={nextPos:se,result:e},e}(),e===n&&(e=function(){let e,r,i,a,o,l,u,c,d,h,p;const f=38*se+31,m=le[f];if(m)return se=m.nextPos,m.result;if(oe++,e=se,123===t.charCodeAt(se)?(r=g,se++):(r=n,0===oe&&fe(at)),r!==n){for(Pe(),i=se,a=Oe(),a!==n?(o=Pe(),58===t.charCodeAt(se)?(l=v,se++):(l=n,0===oe&&fe(lt)),l!==n?(u=Pe(),c=ve(),c!==n?i=[a,c]:(se=i,i=n)):(se=i,i=n)):(se=i,i=n),i===n&&(i=null),a=Pe(),o=[],l=se,44===t.charCodeAt(se)?(u=k,se++):(u=n,0===oe&&fe(xt)),u!==n?(c=Pe(),d=Oe(),d!==n?(Pe(),58===t.charCodeAt(se)?(h=v,se++):(h=n,0===oe&&fe(lt)),h!==n?(Pe(),p=ve(),p!==n?(Pe(),l=[d,p]):(se=l,l=n)):(se=l,l=n)):(se=l,l=n)):(se=l,l=n);l!==n;)o.push(l),l=se,44===t.charCodeAt(se)?(u=k,se++):(u=n,0===oe&&fe(xt)),u!==n?(c=Pe(),d=Oe(),d!==n?(Pe(),58===t.charCodeAt(se)?(h=v,se++):(h=n,0===oe&&fe(lt)),h!==n?(Pe(),p=ve(),p!==n?(Pe(),l=[d,p]):(se=l,l=n)):(se=l,l=n)):(se=l,l=n)):(se=l,l=n);125===t.charCodeAt(se)?(l=M,se++):(l=n,0===oe&&fe(Mt)),l!==n?e=function(t,e){var r=[];return null!==t&&r.push(t),r.push.apply(r,e),{type:s.dict,value:r}}(i,o):(se=e,e=n)}else se=e,e=n;return oe--,e===n&&(r=n,0===oe&&fe(It)),le[f]={nextPos:se,result:e},e}()))),le[r]={nextPos:se,result:e},e)}(),e===n&&(e=function(){let t,e;const i=38*se+34,a=le[i];return a?(se=a.nextPos,a.result):(oe++,t=se,e=Le(),e!==n&&(o=e,e=r.has(o)?{type:s.literal,value:r.get(o)}:{type:s.symbol,value:o}),t=e,oe--,t===n&&(e=n,0===oe&&fe(Wt)),le[i]={nextPos:se,result:t},t);var o}()))),le[l]={nextPos:se,result:e},e)}function Oe(){let e,r,i,a,o;const l=38*se+27,u=le[l];if(u)return se=u.nextPos,u.result;if(oe++,e=se,39===t.charCodeAt(se)?(r=R,se++):(r=n,0===oe&&fe(kt)),r!==n){for(i=se,a=[],o=t.charAt(se),V.test(o)?se++:(o=n,0===oe&&fe(qt));o!==n;)a.push(o),o=t.charAt(se),V.test(o)?se++:(o=n,0===oe&&fe(qt));i=t.substring(i,se),39===t.charCodeAt(se)?(a=R,se++):(a=n,0===oe&&fe(kt)),a!==n?e={type:s.literal,value:i}:(se=e,e=n)}else se=e,e=n;if(e===n){if(e=se,34===t.charCodeAt(se)?(r=N,se++):(r=n,0===oe&&fe(Lt)),r!==n){for(i=se,a=[],o=t.charAt(se),U.test(o)?se++:(o=n,0===oe&&fe(Rt));o!==n;)a.push(o),o=t.charAt(se),U.test(o)?se++:(o=n,0===oe&&fe(Rt));i=t.substring(i,se),34===t.charCodeAt(se)?(a=N,se++):(a=n,0===oe&&fe(Lt)),a!==n?e={type:s.literal,value:i}:(se=e,e=n)}else se=e,e=n;if(e===n)if(e=se,96===t.charCodeAt(se)?(r=P,se++):(r=n,0===oe&&fe(Nt)),r!==n){for(i=[],a=ke(),a===n&&(a=qe());a!==n;)i.push(a),a=ke(),a===n&&(a=qe());96===t.charCodeAt(se)?(a=P,se++):(a=n,0===oe&&fe(Nt)),a!==n?e={type:s.tstring,parts:i}:(se=e,e=n)}else se=e,e=n}return oe--,e===n&&(r=n,0===oe&&fe(Ot)),le[l]={nextPos:se,result:e},e}function ke(){let e,s,r,i;const a=38*se+28,o=le[a];return o?(se=o.nextPos,o.result):(oe++,e=se,123===t.charCodeAt(se)?(s=g,se++):(s=n,0===oe&&fe(at)),s!==n?(Pe(),r=ve(),r!==n?(Pe(),125===t.charCodeAt(se)?(i=M,se++):(i=n,0===oe&&fe(Mt)),i!==n?e=r:(se=e,e=n)):(se=e,e=n)):(se=e,e=n),oe--,e===n&&(s=n,0===oe&&fe(Pt)),le[a]={nextPos:se,result:e},e)}function qe(){let e,r,i,a,o;const l=38*se+29,u=le[l];if(u)return se=u.nextPos,u.result;if(oe++,e=se,r=[],i=se,a=[],o=t.charAt(se),G.test(o)?se++:(o=n,0===oe&&fe(Dt)),o!==n)for(;o!==n;)a.push(o),o=t.charAt(se),G.test(o)?se++:(o=n,0===oe&&fe(Dt));else a=n;if(i=a!==n?t.substring(i,se):a,i===n&&(i=se,92===t.charCodeAt(se)?(a=m,se++):(a=n,0===oe&&fe(it)),a!==n?(t.length>se?(o=t.charAt(se),se++):(o=n,0===oe&&fe(nt)),o!==n?i=o:(se=i,i=n)):(se=i,i=n)),i!==n)for(;i!==n;){if(r.push(i),i=se,a=[],o=t.charAt(se),G.test(o)?se++:(o=n,0===oe&&fe(Dt)),o!==n)for(;o!==n;)a.push(o),o=t.charAt(se),G.test(o)?se++:(o=n,0===oe&&fe(Dt));else a=n;i=a!==n?t.substring(i,se):a,i===n&&(i=se,92===t.charCodeAt(se)?(a=m,se++):(a=n,0===oe&&fe(it)),a!==n?(t.length>se?(o=t.charAt(se),se++):(o=n,0===oe&&fe(nt)),o!==n?i=ee(o):(se=i,i=n)):(se=i,i=n))}else r=n;return r!==n&&(r={type:s.literal,value:r.join("")}),e=r,e===n&&(e=se,123===t.charCodeAt(se)?(r=g,se++):(r=n,0===oe&&fe(at)),r!==n&&(r={type:s.literal,value:r}),e=r),oe--,e===n&&(r=n,0===oe&&fe(Ft)),le[l]={nextPos:se,result:e},e}function Le(){let e,s,r,i,a;const o=38*se+33,l=le[o];if(l)return se=l.nextPos,l.result;if(e=se,s=se,r=t.charAt(se),Q.test(r)?se++:(r=n,0===oe&&fe(jt)),r!==n){for(i=[],a=t.charAt(se),K.test(a)?se++:(a=n,0===oe&&fe(Ht));a!==n;)i.push(a),a=t.charAt(se),K.test(a)?se++:(a=n,0===oe&&fe(Ht));r=[r,i],s=r}else se=s,s=n;return e=s!==n?t.substring(e,se):s,le[o]={nextPos:se,result:e},e}function Re(){let e;const s=38*se+35,r=le[s];return r?(se=r.nextPos,r.result):(t.substr(se,2)===D?(e=D,se+=2):(e=n,0===oe&&fe(Vt)),e===n&&(t.substr(se,2)===z?(e=z,se+=2):(e=n,0===oe&&fe(Ut))),le[s]={nextPos:se,result:e},e)}function Ne(){let e;const s=38*se+36,r=le[s];return r?(se=r.nextPos,r.result):(t.substr(se,2)===I?(e=I,se+=2):(e=n,0===oe&&fe(Gt)),e===n&&(62===t.charCodeAt(se)?(e=$,se++):(e=n,0===oe&&fe(Qt)),e===n&&(t.substr(se,2)===B?(e=B,se+=2):(e=n,0===oe&&fe(Kt)),e===n&&(60===t.charCodeAt(se)?(e=j,se++):(e=n,0===oe&&fe(Jt))))),le[s]={nextPos:se,result:e},e)}function Pe(){let e,s;const r=38*se+37,i=le[r];if(i)return se=i.nextPos,i.result;for(oe++,e=[],s=t.charAt(se),J.test(s)?se++:(s=n,0===oe&&fe(Xt));s!==n;)e.push(s),s=t.charAt(se),J.test(s)?se++:(s=n,0===oe&&fe(Xt));return oe--,le[r]={nextPos:se,result:e},e}ie=l();const Me=ie!==n&&se===t.length;function Fe(){throw ie!==n&&se<t.length&&fe({type:"end"}),e=ae,s=ne<t.length?function(e=se){const s=t.codePointAt(e);return void 0===s?"":String.fromCodePoint(s)}(ne):null,r=ne<t.length?pe(ne,ne+1):pe(ne,ne),new i(i.buildMessage(e,s),e,s,r);var e,s,r}return e.peg$library?{peg$result:ie,peg$currPos:se,peg$FAILED:n,peg$maxFailExpected:ae,peg$maxFailPos:ne,peg$success:Me,peg$throw:Me?void 0:Fe}:Me?ie:void Fe()}(t,{startRule:e===o.MODE_TEMPLATED?"TemplatedRoot":"ExpressionRoot"}))}static evaluate(t,e,s,r){return new a(t,e).visitRoot(s,r===o.MODE_TEMPLATED)}static interpret(t,e,s,r){return o.evaluate(t,e,o.parse(s,r),r)}}class l{#s;#r;constructor(t,e){this.#s=t,this.#r=e}withModule(t,e){const s=t?{[t]:e}:e;return new l({...this.#s,...s},this.#r)}withOverlay(...t){return new l(this.#s,0===t.length?this.#r:[...this.#r,...t])}resolve(t){return n(this.#r,t)}evaluateExpression(t){return o.interpret(this.#s,this.#r,t,o.MODE_EXPRESSION)}evaluateTemplated(t){return o.interpret(this.#s,this.#r,t,o.MODE_TEMPLATED)}}class u{static fromHtml(...t){const e=document.createElement("template");return e.innerHTML=t.map(t=>t.trim()).join(""),document.adoptNode(e.content)}static toHtml(t){var e=document.createElement("template");return e.content.appendChild(t),e.innerHTML}static isBlank(t){return 0===t.childElementCount&&""===t.textContent.trim()}static from(...t){const e=new DocumentFragment;for(const s of t)e.appendChild(s);return e}static fromChildNodes(t){const e=new DocumentFragment;for(;t.firstChild;)e.appendChild(t.firstChild);return e}}class c{static id=0;static uid(t){return`${t}-${++c.id}`}static defaultValue(t,e,s){return t.hasAttribute(e)||t.setAttribute(e,s),t.getAttribute(e)}static forward(t,e,s){e.getAttributeNames().filter(e=>e.startsWith(t)).forEach(r=>{const i=r.substring(t.length);if("class"===i){const r=e.getAttribute(`${t}class`)?.split(/\s+/).filter(t=>t.length)??[];return void s.classList.add(...r)}s.setAttribute(i,e.getAttribute(r))})}static set(t,e,s){null==s?t.removeAttribute(e):t.setAttribute(e,s)}}class d{static from(t){for(const e of t.children)e.matches('[slot=""]')&&e.removeAttribute("slot");const e=Array.from(t.children).filter(t=>t.matches("[slot]")).map(t=>{t.remove();const e=t.getAttribute("slot");return t.removeAttribute("slot"),[e,d.slotFromNode(t)]}),s={};s.default=new DocumentFragment,s.default.append(...t.childNodes);for(const[t,r]of e)t in s||(s[t]=new DocumentFragment),s[t].append(r);return s}static slotFromNode(t){return t instanceof HTMLTemplateElement?document.adoptNode(t.content):t instanceof HTMLScriptElement&&"text/html"===t.type?u.fromHtml(t.innerHTML):t}}class h{static isParsed(t){for(let e=t;e;e=e.parentNode)if(e.nextSibling)return!0;return!1}static waitDomContentLoaded(t){if("loading"===t.readyState)return new Promise(e=>{t.addEventListener("DOMContentLoaded",()=>e(void 0),{once:!0})});if("complete"===t.readyState)return Promise.resolve();const e=t.defaultView;return null===e?Promise.resolve():new Promise(t=>{const s=()=>{e.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s),t(void 0)};e.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s)})}static waitParsed(t){return h.isParsed(t)?Promise.resolve(t):new Promise(e=>{const s=new MutationObserver(()=>{h.isParsed(t)&&(s.disconnect(),e(t))});for(let e=t.parentNode;e;e=e.parentNode)s.observe(e,{childList:!0});h.waitDomContentLoaded(t.ownerDocument).then(()=>{s.disconnect(),e(t)})})}static queryChildren(t,e){for(const s of t.children)if(s.matches(e))return s;return null}static queryChildrenAll(t,e){const s=[];for(const r of t.children)r.matches(e)&&s.push(r);return s}}class p{#u=new Set;removed(t){return this.#u.has(t)}remove(t){t.replaceChildren?.(),Object.keys(t.dataset||{}).filter(t=>t.startsWith("tpl")).forEach(e=>{delete t.dataset[e]}),this.#u.add(t)}popData(t,e){const s=t.dataset[e];return delete t.dataset[e],s}prepend(t,e){t.parentNode.insertBefore(e,t)}append(t,e){t.parentNode.insertBefore(e,t.nextSibling)}replace(t,e){this.prepend(t,e),this.remove(t)}cleanup(){for(const t of this.#u)t.remove();this.#u.clear()}}class f{static ORDERED_COMMANDS=["tplIf","tplWith","tplEach","tplWhen","tplClassAppend","tplAttrAppend","tplRemove","tplVerbatim"];static tplIf(t,e,s,r){r.evaluateExpression(e)||s.remove(t)}static tplWith(t,e,s,r){const i=r.evaluateExpression(e),n=s.popData(t,"tplVar"),a=new b(t,r).withOverlay(n?{[n]:i}:i).render();s.replace(t,a)}static tplEach(t,e,s,r){const i=s.popData(t,"tplVar"),n=s.popData(t,"tplStat"),a=new b(t,r),o=r.evaluateExpression(e),l=null===o||"object"!=typeof o?void 0:Object.getPrototypeOf(o),u=o?.[Symbol.iterator]||l!==Object.prototype&&null!==l?null:Object.entries(o),c=o instanceof Map?[...o]:u,d=null===c?o:c.map(([t,e])=>({key:t,value:e}));if(!d?.[Symbol.iterator])throw new Error(`Expected an iterable got '${o}'`);const h=n?d:null,p="number"==typeof h?.length?h.length:h?.size,f="number"==typeof p?p:null;let m=0;for(const e of d){const r=i?{[i]:e}:e,o={index:m,count:m+1,size:f,first:0===m,last:null===f?null:m===f-1,even:m%2==0,odd:m%2==1},l=n?[{[n]:o},r]:[r];s.prepend(t,a.withOverlay(...l).render()),++m}s.remove(t)}static tplWhen(t,e,s,r){r.evaluateExpression(e)||s.remove(t)}static tplVerbatim(t,e,s,r){const i=t.cloneNode(!0);s.replace(t,i)}static tplRemove(t,e,s,r){switch(e.toLowerCase()){case"tag":{const e=u.fromChildNodes(t);"tplVerbatim"in t.dataset?(s.popData(t,"tplVerbatim"),s.replace(t,e)):(s.append(t,e),s.remove(t));break}case"body":t.replaceChildren();break;case"all":s.remove(t)}}static tplClassAppend(t,e,s,r){const i=r.evaluateExpression(e);if(!i)return;const n=(Array.isArray(i)?i:[i]).flatMap(t=>"string"==typeof t?t.split(" "):t).filter(Boolean);0!==n.length&&t.classList.add(...n)}static tplAttrAppend(t,e,s,r){const i=r.evaluateExpression(e);i&&0!==i.length&&(Array.isArray(i[0])?i:[i]).forEach(([e,s])=>{t.setAttribute(e,s)})}static textNode(t,e,r,i){for(const n of i.evaluateTemplated(e))if(null!=n.value)switch(n.type){case s.dom.t:r.prepend(t,document.createTextNode(n.value));break;case s.dom.h:r.prepend(t,u.fromHtml("string"==typeof n.value?n.value:String(n.value)));break;case s.dom.n:if(!(n.value instanceof Node))throw new TypeError(`Expected a Node, got '${typeof n.value}'`);r.prepend(t,n.value)}r.remove(t)}}const m=new e(1e3);function g(t){return m.getOrCompute(t,t=>t.substring(3).split(/(?=[A-Z])/).join("-").toLowerCase())}class b{static fromHtml(t,e,...s){return new b(u.fromHtml(t),new l(e,s))}static fromSelector(t,e,...s){const r=document.querySelector(t);if(!(r instanceof HTMLTemplateElement))throw new Error("template selector does not match any template tag");return b.fromTemplate(r,e,...s)}static fromTemplate(t,e,...s){const r=document.adoptNode(t.content);return new b(r,new l(e,s))}static fromFragment(t,e,...s){return new b(t,new l(e,s))}#c;#d;constructor(t,e){this.#c=t,this.#d=e}withEvaluator(t){return new b(this.#c,t)}withFragment(t){return new b(t,this.#d)}withModule(t,e){return new b(this.#c,this.#d.withModule(t,e))}withOverlay(...t){return new b(this.#c,this.#d.withOverlay(...t))}evaluateExpression(t,...e){return this.#d.withOverlay(...e).evaluateExpression(t)}evaluateTemplated(t,...e){return this.#d.withOverlay(...e).evaluateTemplated(t)}evaluator(){return this.#d}render(){try{const t=new p,e=document.importNode(this.#c,!0),s=e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e:u.from(e),r=document.createNodeIterator(s,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,b.#h);let i;for(;null!==(i=r.nextNode());){if(t.cleanup(),i.nodeType===Node.TEXT_NODE){try{f.textNode(i,i.nodeValue,t,this.#d)}catch(t){throw v.wrap("Error evaluating text node",i,t)}continue}const e=i;for(const s of f.ORDERED_COMMANDS){if(!(s in e.dataset))continue;const r=t.popData(e,s);try{f[s](e,r,t,this.#d)}catch(t){throw v.wrap(`Error evaluating data-tpl-${g(s)}="${r}"`,e,t)}if(t.removed(e))break}for(const s of Object.keys(e.dataset||{})){if(!s.startsWith("tpl"))continue;const r=g(s),i=t.popData(e,s);try{const t=this.#d.evaluateExpression(i);if("boolean"==typeof t){e.toggleAttribute(r,t);continue}null!=t&&e.setAttribute(r,t)}catch(t){throw v.wrap(`Error evaluating data-tpl-${r}="${i}"`,e,t)}}}return t.cleanup(),s}catch(t){if(t instanceof v)throw t;throw new v("Error rendering template",this.#c,t)}}renderTo(t){t.replaceChildren(this.render())}appendTo(t){t.appendChild(this.render())}renderToSelector(t){const e=document.querySelector(t);e&&this.renderTo(e)}appendToSelector(t){const e=document.querySelector(t);e&&this.appendTo(e)}static#h(t){if(t.nodeType===Node.TEXT_NODE)return t.nodeValue.includes("{{")&&t.nodeValue.includes("}}")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT;for(const e of t.attributes)if(e.name.startsWith("data-tpl-"))return NodeFilter.FILTER_ACCEPT;return NodeFilter.FILTER_SKIP}}class v extends Error{static FRAMES=3;#p;#f;truncated=!1;static wrap(t,e,s){return s instanceof v&&s.depth>=v.FRAMES?(s.truncated=!0,s):new v(t,e,s)}constructor(t,e,s){super(`${t} in \`${v.describe(e)}\``,{cause:s}),this.name="RenderError",this.#p=e,this.#f=(s instanceof v?s.depth:0)+1}get depth(){return this.#f}get node(){return this.#p}get html(){return v.stringify(this.#p)}static describe(t){if(t.nodeType===Node.TEXT_NODE)return v.#m(String(t.nodeValue).trim());if(t.nodeType===Node.ELEMENT_NODE){const e=t,s=Array.from(e.attributes,t=>` ${t.name}="${t.value}"`).join("");return v.#m(`<${e.localName}${s}>`)}const e=Array.from(t.childNodes).filter(t=>t.nodeType===Node.ELEMENT_NODE||String(t.nodeValue??"").trim().length>0).map(t=>v.describe(t));return v.#m(e.join(""))}static#m(t){return t.length>120?`${t.slice(0,120)}…`:t}static stringify(t){return u.toHtml(v.#g(t.cloneNode(!0)))}static#g(t){t.nodeType===Node.TEXT_NODE&&(t.nodeValue=t.nodeValue.trim());for(let e=0;e<t.childNodes.length;e++){const s=t.childNodes[e];s.nodeType===Node.TEXT_NODE?(s.nodeValue=s.nodeValue.trim(),0===s.nodeValue.length&&(t.removeChild(s),e--)):s.nodeType===Node.ELEMENT_NODE&&v.#g(s)}return t}}class y{#b=new Map;#v;#y=new Promise(t=>{this.#v=t});constructor(){h.waitDomContentLoaded(document).then(()=>{this.#w()})}ready(){return this.#y}async#w(){await this.settled(),document.dispatchEvent(new CustomEvent("ftl:ready",{bubbles:!1,cancelable:!1})),this.#v()}enqueue(t){if(this.#b.has(t))return;const{promise:e,resolve:s}=Promise.withResolvers(),r=h.waitParsed(t).then(()=>t.upgrade()).finally(()=>{this.#b.delete(t),s()});this.#b.set(t,{upgrade:r,finished:e})}async#E(t,e){for(;;){const s=Array.from(this.#b).filter(([e])=>t(e)).map(([,t])=>e(t));if(0===s.length)return;await Promise.all(s)}}settled(){return this.#E(()=>!0,t=>t.finished)}upgraded(t){return this.#E(t,t=>t.upgrade)}whenUpgraded(t){return this.#b.get(t)?.upgrade}pending(){return Array.from(this.#b.keys())}}class w{#x={};#A=!1;#S={string:{unmarshal:(t,e,s)=>t,marshal:(t,e,s)=>null==t?null:String(t)},number:{unmarshal:(t,e,s)=>null===t?null:Number(t),marshal:(t,e,s)=>null==t?null:String(t)},presence:{unmarshal:(t,e,s)=>null!==t,marshal:(t,e,s)=>t?"":null},bool:{unmarshal:(t,e,s)=>"true"===t,marshal:(t,e,s)=>null==t?null:String(!0===t)},json:{unmarshal:(t,e,s)=>null===t?null:JSON.parse(t),marshal:(t,e,s)=>null==t?null:JSON.stringify(t)},csv:{unmarshal:(t,e,s)=>null===t?[]:t.split(",").map(t=>t.trim()).filter(t=>t),marshal:(t,e,s)=>null==t?null:t.join(",")}};#T={};#s;#C=[];#d=new l(void 0,[]);#_=new y;defineElement(t,e){return this.#A?(this.#O(t,e),this):(this.#x[t]=e,this)}static declarationsOf(t){const e=[];for(let s=t;null!==s&&s!==HTMLElement;s=Object.getPrototypeOf(s))e.unshift(s);const s=t=>e.flatMap(e=>Object.getOwnPropertyDescriptor(e,t)?.value??[]);return{observed:s("observed"),attributes:s("attributes")}}static propertyOf(t){return t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase())}#O(t,e){const{observed:s,attributes:r}=w.declarationsOf(e),{template:i,templates:n,slots:a,mappers:o,config:l}=e,u=s.map(t=>t.split(":")[0]),c=[...new Set(u.reverse())].reverse(),d=[...r,...s].reduce((t,e)=>{const[s,r]=e.split(":"),i=r??"string";if(!(i in this.#S)&&!(i in(o??{})))throw new Error(`unsupported attribute type: ${i}`);return t[s]=o?.[i]??this.#S[i],t},{}),h=Object.entries(Object.assign({},n,i?{default:i}:{})).map(([t,e])=>[t,b.fromHtml(e)]),p=Object.fromEntries(h);e.BITS={registry:this,enqueue:t=>this.#_.enqueue(t),SLOTS:a,CONFIG:l,OBSERVED:c,DECLARED:[...new Set([...c,...r.map(t=>t.split(":")[0])])],ATTR_TO_MAPPER:d,ATTR_TO_PROPERTY:Object.fromEntries(c.map(t=>[t,w.propertyOf(t)])),TEMPLATES:p},customElements.define(t,e)}defineModule(t,e){const s=t?{[t]:e}:e;return this.#s={...this.#s,...s},this.#k(),this}defineModules(t){return this.#s=t,this.#k(),this}defineComponent(t,e){return this.#T[t]=e,this}defineData(...t){return this.#C=t,this.#k(),this}defineOverlay(...t){return this.#C=[...this.#C,...t],this.#k(),this}defineMapper(t,e){return this.#S[t]=e,this}plugin(t){return t.configure(this),this}configure(){for(const[t,e]of Object.entries(this.#x))this.#O(t,e),delete this.#x[t];return this.#A=!0,this}settle(t){return this.#_.upgraded(t)}whenUpgraded(t){return this.#_.whenUpgraded(t)}pending(){return this.#_.pending()}ready(){return this.#_.ready()}#k(){this.#d=new l(this.#s,this.#C)}evaluator(){return this.#d}component(t){return this.#T[t]}}const E=new w;class x{static fromHtml(t){return b.fromHtml(t).withEvaluator(E.evaluator())}static fromSelector(t){return b.fromSelector(t).withEvaluator(E.evaluator())}static fromTemplate(t){return b.fromTemplate(t).withEvaluator(E.evaluator())}static fromFragment(t){return b.fromFragment(t).withEvaluator(E.evaluator())}}class A{static waitFor(t){return E.settle(e=>t.contains(e))}static waitForChildren(t){return E.settle(e=>t!==e&&t.contains(e))}}class S extends HTMLElement{static BITS={registry:E,enqueue:t=>{},SLOTS:!1,CONFIG:void 0,OBSERVED:[],DECLARED:[],ATTR_TO_MAPPER:{},ATTR_TO_PROPERTY:{},TEMPLATES:{}};static get observedAttributes(){return this.BITS.OBSERVED}constructor(){super(),this.internals=this.attachInternals()}internals;#q=!1;#L=!1;#R=new Set;#N=null;#P={};#M(){return this.constructor.BITS}#F(t){const e=this.#M().ATTR_TO_MAPPER[t];if(!e)throw new Error(`${this.constructor.name} declares no attribute '${t}': declare it in static observed or static attributes, or read it with getAttribute`);return e}unmarshal(t,e){return this.#F(t).unmarshal(e,t,this)}marshal(t,e){return this.#F(t).marshal(e,t,this)}get _registry(){return this.#M().registry}component(t){return this.#M().registry.component(t)}template(t){const e=this.#M().TEMPLATES[t??"default"];if(!e)throw new Error(`no template named '${t??"default"}' on ${this.constructor.name}`);const s=e.withEvaluator(this.#M().registry.evaluator()),r=this.#M().CONFIG;return r?s.withOverlay({config:r}):s}connectedCallback(){this.#L||this.#M().enqueue(this)}attributeChangedCallback(t,e,s){e!==s&&(this.#R.has(t)||(this.#q?this[this.#M().ATTR_TO_PROPERTY[t]]=this.unmarshal(t,s):null!==this.#N&&t in this.#N&&(this.#N[t]=this.unmarshal(t,s))))}async upgrade(){if(this.#L)return;this.#L=!0;const t=this.#M().SLOTS?d.from(this):void 0,e=Object.fromEntries(this.#M().DECLARED.map(t=>[t,this.unmarshal(t,this.getAttribute(t))])),s=new Set(this.#M().OBSERVED);this.#P=Object.fromEntries(Object.entries(e).filter(([t])=>!s.has(t))),this.#N=e;try{await this.render({slots:t});const s=this.#M().ATTR_TO_PROPERTY;for(const t of this.#M().OBSERVED)this[s[t]]=e[t];this.#q=!0,this.internals.states.add("rendered")}finally{this.#N=null}}render(t){}declared(t){return t in this.#P?this.#P[t]:null!==this.#N&&t in this.#N?this.#N[t]:this.unmarshal(t,this.getAttribute(t))}get rendered(){return this.#q}reflectTo(t,e){const s=this.marshal(t,e);if(s!==this.getAttribute(t)){this.#R.add(t);try{c.set(this,t,s)}finally{this.#R.delete(t)}}}}const T=/\{(\w+)\}/g,C=/\{(\d+)\}/g,_=t=>"object"==typeof t&&null!==t&&!Array.isArray(t),O=new Set,k=t=>{O.has(t)||(O.add(t),console.warn(`l10n: ${t}`))},q=new e(100),L=(t,e,s)=>{const r=`${t.name}|${e??""}|${void 0===s?"":JSON.stringify(s)}`;return q.getOrCompute(r,()=>new t(e,s))};class R{static t(t,...e){const s=this.l10n??{};let r=Object.hasOwn(s,t)?s[t]:void 0;if(void 0===r)return k(`missing message "${t}"`),t;const i=1===e.length&&_(e[0])?e[0]:null;if(_(r))if("number"!=typeof i?.count)k(`plural message "${t}" needs a numeric {count}`),r=r.other;else{const t=this.locale??navigator?.language??"en";r=r[L(Intl.PluralRules,t).select(i.count)]??r.other}return void 0===r||"object"==typeof r?(k(`plural message "${t}" has no "other" form`),t):i?r.replace(T,(e,s)=>Object.hasOwn(i,s)?String(i[s]):(k(`message "${t}" wants {${s}}`),e)):e.length>0?r.replace(C,(s,r)=>{const i=Number(r);return i>=e.length?(k(`message "${t}" wants {${r}}`),s):String(e[i])}):r}static date(t,e){return L(Intl.DateTimeFormat,this.locale,e).format(t)}static number(t,e){return L(Intl.NumberFormat,this.locale,e).format(t)}static bytes(t){const e=L(Intl.NumberFormat,this.locale,{maximumFractionDigits:2}).format;return t>=1073741824?`${e(t/1024/1024/1024)}GiB`:t>=1048576?`${e(t/1024/1024)}MiB`:t>=1024?`${e(t/1024)}KiB`:`${e(t)}B`}static failure(t){return Array.isArray(t?.problems)&&t.problems.length>0?t.problems.map(t=>{return e=t,("string"==typeof e?.reason&&""!==e.reason.trim()?e.reason:void 0)??R.t.call(this,"failure.no-reason");var e}).join("\n"):void 0!==t?.message?String(t.message):null==t?"":String(t)}static of(t={}){const e=t=>E.evaluator().resolve(t),s=s=>(...r)=>s.apply({l10n:e("l10n"),locale:t.locale??e("locale")},r);return{t:s(R.t),date:s(R.date),number:s(R.number),bytes:s(R.bytes),failure:s(R.failure)}}}var N=Object.freeze({__proto__:null,Attributes:c,BoundedCache:e,ExpressionEvaluator:l,Expressions:o,Fragments:u,LightSlots:d,Localization:R,Nodes:h,ParsedElement:S,Registry:w,RenderError:v,Rendering:A,Template:b,Templates:x,registry:E});class P extends Error{constructor(t,e,s){super(t,{cause:s}),this.name="Failure",this.problems=e}dropping(t){return new P(this.message,P.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 M{static STANDARD="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";static URL_SAFE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";static encode(t,e){const s=e||M.URL_SAFE,r=t.byteLength,i=new Uint8Array(t);let n="";for(let t=0;t<r;t+=3)n+=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?n=n.substring(0,n.length-1):r%3==1&&(n=n.substring(0,n.length-2)),n}static decode(t,e){const s=e||M.URL_SAFE;let r=t.length;for(;r>0&&"="===t.charAt(r-1);)--r;const i=t.substring(0,r);if(t.length-r>2||i.includes("=")||0===i.length&&t.length>0)throw new Error("invalid padding");if(i.length%4==1)throw new Error("invalid length");for(const t of i)if(-1===s.indexOf(t))throw new Error(`invalid character '${t}'`);const n=Math.floor(.75*i.length),a=new Uint8Array(n);let o=0,l=0;for(;o<n;){const t=s.indexOf(i.charAt(l++)),e=s.indexOf(i.charAt(l++)),r=s.indexOf(i.charAt(l++)),u=s.indexOf(i.charAt(l++));if(a[o++]=t<<2|e>>4,o===n)break;if(a[o++]=(15&e)<<4|r>>2,o===n)break;a[o++]=(3&r)<<6|u}return a.buffer}}class F{static decode(t){if(t.length%2!=0)throw new Error("invalid length");if(!/^[0-9a-fA-F]*$/.test(t))throw new Error("invalid character");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 D{#D;#z;constructor(t,e){this.#D=t,this.#z=e}get normalized(){return`${this.#D}/${this.#z}`}get type(){return this.#D}get subtype(){return this.#z}static parse(t){if(!t)return new D("unknown","unknown");const[e,s]=t.split(";"),[r,i]=e.trim().toLowerCase().split("/");return r&&i?new D(r,i):new D("unknown","unknown")}}class z extends P{constructor(t,e,s,r){super(t,s,r),this.name="HttpClientError",this.status=e}dropping(t){return new z(this.message,this.status,P.dropProblemsContext(this.problems,t),this)}static problem(t,e){return{type:t,context:null,reason:e,details:null}}static of(t,e){const s=String(e?.message??e??"unknown failure");return new z(s,0,[z.problem(t,s)],e)}static async fromResponse(t){switch(D.parse(t.headers.get("Content-Type")).normalized){case"application/failures+json":{const e=await t.json().catch(()=>z.#I);if(e===z.#I)return z.#$(t);if(!Array.isArray(e))return z.#$(t,"as a failures array");const s=`${t.status} ${t.statusText}: ${e.length} failures`;return new z(s,t.status,e)}case"application/problem+json":{const e=await t.json().catch(()=>z.#I);if(e===z.#I)return z.#$(t);if("object"!=typeof e||null===e||Array.isArray(e))return z.#$(t,"as a problem object");const s=`${t.status} ${t.statusText}: ${e.title} ${e.detail}`;return new z(s,t.status,e.problems||[z.problem("GENERIC_PROBLEM",s)])}default:return z.#B(t)}}static#I=Symbol("unreadable body");static#$(t,e="as json"){const s=D.parse(t.headers.get("Content-Type")).normalized,r=`${t.status} ${t.statusText}: the ${s} body does not decode ${e}`;return new z(r,t.status,[z.problem("GENERIC_PROBLEM",r)])}static async#B(t){const e=await t.text().catch(()=>null),s=null===e?`${t.status} ${t.statusText}: the body could not be read`:`${t.status} ${t.statusText}: ${e}`;return new z(s,t.status,[z.problem("GENERIC_PROBLEM",s)])}}const I=t=>globalThis.document?.querySelector(`meta[name="${t}"]`)?.getAttribute("content")??void 0;class ${async intercept(t,e,s){if(t.origin!==(globalThis.window?.location?.origin??t.origin))return await s.proceed(t,e);const r=I("_csrf_header"),i=I("_csrf");return r&&i&&e.headers.set(r,i),await s.proceed(t,e)}}class B{#j;constructor(t){this.#j=t}async intercept(t,e,s){const r=await s.proceed(t,e);return 401===r.status?(window.location.href=this.#j,new Promise(()=>{})):r}}class j{#H;constructor(){this.#H=[]}withCsrfToken(){return this.#H.push(new $),this}withRedirectOnUnauthorized(t){return this.#H.push(new B(t)),this}withInterceptors(...t){return this.#H.push(...t),this}build(){return new V(this.#H)}}class H{async intercept(t,e,s){try{return await fetch(t,e)}catch(t){throw z.of("CONNECTION_PROBLEM",t)}}}class W{#H;#W;constructor(t,e){this.#H=t,this.#W=e}async proceed(t,e){const s=this.#H[this.#W];return await s.intercept(t,e,new W(this.#H,this.#W+1))}}class V{#H;static builder(){return new j}constructor(t){this.#H=t||[]}async exchange(t,e,s){const r=[...this.#H,...s||[],new H],i=new W(r,0),n=new URL(new Request(t).url),a={...e,headers:new Headers(e?.headers)};return await i.proceed(n,a)}request(t,e){return Q.create(this,t,e)}get(t){return Q.create(this,"GET",t)}head(t){return Q.create(this,"HEAD",t)}post(t){return Q.create(this,"POST",t)}put(t){return Q.create(this,"PUT",t)}patch(t){return Q.create(this,"PATCH",t)}delete(t){return Q.create(this,"DELETE",t)}}const U=async(t,e)=>{try{return await t[e]()}catch(t){throw z.of("UNMARSHALING_PROBLEM",t)}},G=t=>null==t?[]:"string"==typeof t?new URLSearchParams(t):"function"==typeof t[Symbol.iterator]?t:Object.entries(t);class Q{#V;#U;#G;#Q;#K;#J;#X;#H;#c;static create(t,e,s){const r=s.indexOf("#"),i=-1===r?"":s.slice(r),n=-1===r?s:s.slice(0,r),a=n.indexOf("?");return new Q(t,e,-1===a?n:n.slice(0,a),new URLSearchParams(-1===a?"":n.slice(a+1)),new Headers,void 0,{},[],i)}constructor(t,e,s,r,i,n,a,o,l=""){this.#V=t,this.#U=e,this.#G=s,this.#Q=r,this.#J=n,this.#K=i,this.#X=a,this.#H=o,this.#c=l}headers(t){for(const[e,s]of G(t))this.header(e,s);return this}header(t,e){return null==e?this.#K.delete(t):this.#K.set(t,e),this}params(t){for(const[e,s]of G(t))null==s?this.#Q.delete(e):this.#Q.set(e,s);return this}param(t,...e){this.#Q.delete(t);for(const s of e.filter(t=>null!=t))this.#Q.append(t,s);return this}body(t){return this.#J=t,this}json(t){if(void 0===t)return this;const e=JSON.stringify(t);return this.#K.set("Content-Type","application/json"),this.#J=e,this}multipart(t){const e=new FormData;return t(new K(e)),this.#J=e,this}options(t){for(const[e,s]of Object.entries(t))this.#X[e]=s;return this}option(t,e){return this.#X[t]=e,this}interceptors(t){for(const e of t)this.#H.push(e);return this}interceptor(t){return this.#H.push(t),this}async exchange(){const t=this.#Q.size?`?${this.#Q}`:"",e={...this.#X,headers:this.#K,method:this.#U,body:this.#J};return await this.#V.exchange(`${this.#G}${t}${this.#c}`,e,this.#H)}async fetch(){try{const t=await this.exchange();if(!t.ok)throw await z.fromResponse(t);return t}catch(t){if(t instanceof P)throw t;throw z.of("UNEXPECTED_PROBLEM",t)}}async fetchText(){const t=await this.fetch();return await U(t,"text")}async fetchJson(){const t=await this.fetch();return 204===t.status?null:await U(t,"json")}async fetchBlob(){const t=await this.fetch();return await U(t,"blob")}async fetchArrayBuffer(){const t=await this.fetch();return await U(t,"arrayBuffer")}}class K{#Y;constructor(t){this.#Y=t}field(t,e){return this.#Y.append(t,e),this}blob(t,e,s){return this.#Y.append(t,e,s),this}blobs(t,e){for(const s of e)this.#Y.append(t,s);return this}json(t,e,s){const r=new Blob([JSON.stringify(e)],{type:"application/json"});return this.#Y.append(t,r,s),this}}var J=Object.freeze({__proto__:null,Base64:M,Failure:P,Hex:F,HttpClient:V,HttpClientBuilder:j,HttpClientError:z,HttpInterceptorChain:W,HttpMultipartRequestCustomizer:K,HttpRequestBuilder:Q,MediaType:D});const X=t=>{const e=e=>{try{t().removeItem(e)}catch{}},s=s=>{let r;try{r=t().getItem(s)}catch{return}if(null!==r)try{return JSON.parse(r)}catch{return void e(s)}};return{save:(e,s)=>{t().setItem(e,JSON.stringify(s))},load:s,remove:e,pop:t=>{const r=s(t);return e(t),r}}},Y=t=>({save(e,s,r){t.save(e,{revision:s,data:r})},load(e,s){const r=t.load(e);if(null!=r&&"object"==typeof r&&r.revision===s)return r.data;t.remove(e)}}),Z=X(()=>localStorage),tt=X(()=>sessionStorage),et=Y(Z),st=Y(tt);class rt{static async fireAsync(t,e,s){t.dispatchEvent(e);const r=e.async?.promises??[],i=s?.mode??"broadcast";if("pipeline"===i&&r.length>1||"delegate"===i&&1!==r.length)throw Promise.all(r).catch(()=>{}),new Error("pipeline"===i?`[AsyncEvents] Event "${e.type}" is configured in 'pipeline' mode and expects at most one async listener, but ${r.length} listeners were triggered on this element.`:`[AsyncEvents] Event "${e.type}" is configured in 'delegate' mode and requires exactly one async listener, but ${r.length} were registered.`);return"broadcast"===i?Promise.all(r):Promise.resolve(r[0])}static asyncOn(t,e,s,r){const i=async t=>{const e=t;e.async||(e.async={promises:[]});const{promise:r,resolve:i,reject:n}=Promise.withResolvers();e.async.promises.push(r);try{i(await s(e))}catch(t){n(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,e){return await rt.fireAsync(this,t,e)},asyncOn(t,e,s){return rt.asyncOn(this,t,e,s)},asyncOff(t,e,s){rt.asyncOff(this,t,e,s)}})}}class it{static guard(t,e){window.addEventListener("beforeunload",e=>{t()&&e.preventDefault()},{signal:e})}}class nt{#Z=0;take(){return++this.#Z,this.hold()}hold(){const t=this.#Z,e=this;return{get stale(){return t!==e.#Z}}}invalidate(){++this.#Z}}const at=t=>{for(let e=t.parentElement;e;e=e.parentElement)if("function"==typeof e.describedBy)return e;return null};class ot{static sleep(t){return new Promise(e=>setTimeout(e,t))}static debounce(t,e,s){const r=s?.immediate??!1;let i=null,n=[],a=0;const o=()=>{const s=performance.now()-a;t>s?i=setTimeout(o,t-s):(i=null,r||e(...n),null===i&&(n=[]))};return[(...s)=>{n=s,a=performance.now(),null===i&&(i=setTimeout(o,t),r&&e(...n))},()=>{clearTimeout(i??void 0),i=null,n=[]}]}static throttle(t,e,s){const r=s?.leading??!0,i=s?.trailing??!0;let n=null,a=[],o=0;const l=()=>{o=r?performance.now():0,n=null,e(...a),null===n&&(a=[])};return[(...s)=>{const u=performance.now();o||r||(o=u);const c=0===o?0:t-(u-o);a=s,c<=0||c>t?(null!==n&&(clearTimeout(n),n=null),o=u,e(...a),null===n&&(a=[])):null===n&&i&&(n=setTimeout(l,c))},()=>{clearTimeout(n??void 0),n=null,a=[]}]}}class lt{static flatten(t,e,s){return Object.keys(t).reduce((r,i)=>{const n=e.length?`${e}.${i}`:i;return s.has(n)||"object"!=typeof t[i]||null===t[i]?r[n]=t[i]:Object.assign(r,lt.flatten(t[i],n,s)),r},{})}static#tt=new Set(["__proto__","prototype","constructor"]);static providePath(t,e,s){const r=e.split(".").map(t=>/^[0-9]+$/.test(t)?+t:t);for(const t of r)if(lt.#tt.has(t))throw new Error(`unsupported name segment '${t}' in '${e}'`);let i=t??{},n=null;for(let e=0;;++e){const a=r[e],o=r[e-1];if(Number.isInteger(a)&&!Array.isArray(i)&&(null!==n?n[o]=i=[]:t=i=[]),e===r.length-1)return i[a]=void 0!==s?s:a in i?i[a]:null,t;"object"==typeof i[a]&&null!==i[a]||(i[a]={}),n=i,i=i[a]}}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:"SELECT"===t.tagName&&t.multiple?Array.from(t.selectedOptions).map(t=>t.value):"INPUT"!==t.tagName&&"SELECT"!==t.tagName&&"TEXTAREA"!==t.tagName||""!==t.value&&void 0!==t.value?t.value:null}static#et(t){return"submit"===t.type||"reset"===t.type||"button"===t.type}static extractFrom(t,e){let s={};for(const r of t.elements)r.hasAttribute("name")&&(lt.#et(r)&&r!==e||r.matches(":disabled")&&r!==e||(s=lt.providePath(s,r.getAttribute("name"),lt.extract(r))));return s}static mutate(t,e){if("radio"!==t.getAttribute("type"))if("checkbox"!==t.getAttribute("type")){if("SELECT"===t.tagName&&t.multiple){const s=Array.isArray(e)?e.map(String):null==e?[]:[String(e)];return void Array.from(t.options).forEach(t=>{t.selected=s.includes(t.value)})}t.value=e}else t.checked=e;else t.checked=null!=e&&t.getAttribute("value")===String(e)}static mutateIn(t,e){const s=lt.#st(t);for(const[t,r]of Object.entries(lt.flatten(e,"",new Set(s.keys()))))for(const e of s.get(t)??[])lt.mutate(e,r)}static#st(t){const e=new Map;for(const s of t.elements){const t=s.getAttribute("name");if(!t)continue;const r=e.get(t);r?r.push(s):e.set(t,[s])}return e}static errors(t,e,s){const r=e=>e.closest("form")===t;Array.from(t.querySelectorAll("ful-field-error")).filter(r).forEach(t=>{t.setAttribute("aria-live",s?"off":"polite")});const i=t=>("FIELD_ERROR"===t.type||"INVALID_FORMAT"===t.type)&&t.context,n=e.filter(i),a=e.filter(t=>!i(t)),o=lt.#st(t);for(const t of o.values())t.forEach(t=>{t.setCustomValidity?.("")});const l=[];n.forEach(t=>{const e=t.context.replace(/\[/g,".").replace(/\]\./g,".").replace(/\]/g,"").split(".");for(let s=e.length;0!==s;--s){const r=e.slice(0,s).join("."),i=o.get(r)??[];if(0===i.length)continue;const n=e.slice(s).join(".");return void i.forEach(e=>{e.setCustomValidity?.(t.reason,n)})}l.push(t)});const u=[...a,...l];t.querySelectorAll("ful-errors").forEach(t=>{if(!r(t))return;const e=t;if(t.setAttribute("role","alert"),0===u.length)return t.replaceChildren(),void t.setAttribute("hidden","");t.removeAttribute("hidden"),e.innerText=u.map(t=>t.reason).join("\n")}),0!==e.length&&s&&Array.from(t.elements).filter(t=>t.matches(":invalid")).sort((t,e)=>t.getBoundingClientRect().y-e.getBoundingClientRect().y)[0]?.focus()}}class ut extends S{static formAssociated=!0;static observed=["disabled:presence","readonly:presence","required:presence","value"];static ROLE="presentation";#rt;#it=null;#nt;#at=[];#ot=null;#lt;#ut;#ct;#dt=[];constructor(){super(),this.internals.role=this.constructor.ROLE}#ht(){return[this.#ut??this.#rt,...this.#dt].filter(t=>t)}#pt({fragment:t,control:e,error:s,label:r=null,described:i=null,claims:n=null,announces:a=e,freeze:o=null,also:l=[]}){if(this.#rt=e,this.#lt=s,this.#ut=n,this.#ct=a,this.#dt=l,o&&o.addEventListener("click",t=>{this.readonly&&t.preventDefault()},!0),this.#nt=i??e,s&&(s.id=s.id||c.uid("ful-field-error"),this.#ot=s.id),this.#ft(),r&&ut.#mt(this,r,e),this.addEventListener("keydown",t=>{if("Enter"!==t.key||t.defaultPrevented||t.isComposing)return;const e=t.target;e.form!==this.form&&ut.#gt(e)&&this._requestSubmit()}),this.replaceChildren(t),null!==this.#it){const t=this.#it;this.#it=null,e.focus(t)}}static#gt(t){return t instanceof HTMLInputElement&&!["file","button","submit","reset","image"].includes(t.type)}describedBy(t){return!!t&&(t.id||(t.id=c.uid("ful-described")),this.#at.includes(t.id)||this.#at.push(t.id),this.#ft(),!0)}#ft(){if(!this.#nt)return;const t=[...this.#at,this.#ot].filter(t=>t);t.length&&this.#nt.setAttribute("aria-describedby",t.join(" "))}focus(t){this.#rt?this.#rt.focus(t):this.#it=t??{}}setCustomValidity(t,e){if(c.set(this.#ct??this.#rt,"aria-invalid",t?"true":null),!t)return this.internals.setValidity({}),void(this.#lt.innerText="");this.internals.setValidity({customError:!0}," "),this.#lt.innerText=t}get form(){return this.internals.form}_requestSubmit(){const t=this.form;if(!t)return;const e=t.querySelectorAll("button:not(:disabled), input:not(:disabled)");t.requestSubmit([...e].find(e=>"submit"===e.type&&e.form===t))}_notifyChange(t={}){this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value,...t}}))}static#bt=new Set(["BUTTON","INPUT","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA"]);static#mt(t,e,s){if(!ut.#bt.has(s.tagName)||"hidden"===s.getAttribute("type"))return e.id||(e.id=c.uid("ful-label")),s.setAttribute("aria-labelledby",e.id),void e.addEventListener("click",()=>t.focus());s.id||(s.id=c.uid("ful-control")),e.setAttribute("for",s.id)}_interactive(){return!this.matches(":disabled")&&!this.readonly}get value(){}set value(t){}formResetCallback(){this.value=this.unmarshal("value",this.getAttribute("value"))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.reflectTo("disabled",t);for(const e of this.#ht())e.toggleAttribute("disabled",t)}get readonly(){return this.hasAttribute("readonly")}set readonly(t){for(const e of this.#ht())e.readOnly=t;this.#ct&&c.set(this.#ct,"aria-readonly",t?"true":null),this.reflectTo("readonly",t)}get required(){return this.hasAttribute("required")}set required(t){this.#ct&&c.set(this.#ct,"aria-required",t?"true":null),this.reflectTo("required",t)}render(t){const e=this._build(t);if(e instanceof Promise)return e.then(t=>this.#pt(t));this.#pt(e)}_build(t){throw new Error(`${this.constructor.name} must implement _build`)}}class ct{#vt;#yt;#U;#wt;#Et;constructor(t,e,s,r,i){this.#vt=t,this.#yt=e,this.#U=s,this.#wt=r,this.#Et=i}prepare(t,e){return this.#wt(t,e)}async submit(t,e){return await this.#vt.request(this.#U,this.#yt).json(t).fetch()}transform(t,e){return this.#Et(t,e)}}class dt{#wt;#Et;constructor(t,e){this.#wt=t,this.#Et=e}async prepare(t,e){return await this.#wt(t,e)}async submit(t,e,s){return s}async transform(t,e){return await this.#Et(t,e)}}class ht{static create(t,e){const s=t.component("http-client"),r=t.declared("request-mapper")?t.component(t.declared("request-mapper")):t=>t,i=t.declared("response-mapper")?t.component(t.declared("response-mapper")):t=>t,n=t.declared("action");if(!n)return new dt(r,i);const a=t.declared("method")??"POST";return new ct(s,n,a,r,i)}}class pt extends S{static attributes=["action","method","loader","request-mapper","response-mapper","clear-invalid-on-change:presence","scroll-on-error:presence","autocomplete","track-changes:presence","guard-leave:presence"];form;render(){const t=document.createElement("form");this.form=t,t.setAttribute("novalidate",""),c.forward("form-",this,t),c.set(t,"autocomplete",this.declared("autocomplete")),t.replaceChildren(...this.childNodes),t.addEventListener("submit",async t=>{t.preventDefault(),t.stopPropagation(),await this.submit(t.submitter??void 0)}),this.addEventListener("click",t=>{const e=t.target;e.closest?.('[aria-disabled="true"]')&&(t.preventDefault(),t.stopImmediatePropagation())},!0),this.declared("clear-invalid-on-change")&&this.addEventListener("change",t=>{(t.target.form??t.target.internals?.form)===this.form&&t.target.setCustomValidity?.("")}),this.replaceChildren(t),this.#xt=this.declared("track-changes")||this.declared("guard-leave"),this.#xt&&(this.addEventListener("input",t=>this.#At(t.target)),this.addEventListener("change",t=>this.#At(t.target)),this.addEventListener("focusin",t=>this.#St(t.target)),A.waitForChildren(this).catch(()=>{}).then(()=>this.commit()),this.#Tt())}connectedCallback(){super.connectedCallback(),this.#xt&&this.#Tt()}disconnectedCallback(){this.#Ct?.abort(),this.#Ct=null}#_t=!1;async submit(t){if(this.#_t)return;let e,s;this.#_t=!0,this.spinner(!0);try{const r=this.component(this.declared("loader")??"loaders:form").create(this);e=lt.extractFrom(this.form,t);const i=this.#xt?{saved:this.#Ot(),upTo:this.#kt}:null;s=await r.prepare(e,this);const n=new CustomEvent("submit",{bubbles:!0,cancelable:!0,detail:{submitter:t,values:e,request:s}});if(!this.dispatchEvent(n))return;this.errors=[];const a=new CustomEvent("submit:requested",{bubbles:!0,cancelable:!1,detail:{submitter:t,values:n.detail.values,request:n.detail.request}});let o=await rt.fireAsync(this,a,{mode:"pipeline"});s=a.detail.request,o=await r.submit(s,this,o);const l=await r.transform(o,this);i&&this.#qt(i.saved,i.upTo),this.dispatchEvent(new CustomEvent("submit:success",{bubbles:!0,cancelable:!1,detail:{submitter:t,values:e,request:s,response:l}}))}catch(r){this.dispatchEvent(new CustomEvent("submit:failure",{bubbles:!0,cancelable:!1,detail:{submitter:t,values:e,request:s,exception:r}})),r instanceof P?this.errors=r.problems:console.warn("failed to submit form",this,"reason:",r)}finally{this.#_t=!1,this.spinner(!1)}}reset(){if(this.form.reset(),this.#xt){for(const t of new Set([...this.#Lt.keys(),...this.#Ot().keys()]))this.#Rt.set(t,++this.#kt);this.#Nt()}}#Lt=new Map;#Pt=new Map;#Rt=new Map;#kt=0;#Mt=!1;#Ft=0;#Ct=null;#xt=!1;get dirty(){if(!this.#xt)return!1;for(const t of this.#Rt.keys()){const e=this.#Dt(t);if((this.#Lt.has(t)||"[]"!==e)&&(this.#Lt.get(t)??this.#Pt.get(t))!==e)return!0}return!1}commit(){this.#xt&&this.#qt(this.#Ot(),this.#kt)}edited(t){this.#At(t)}#qt(t,e){this.#Lt=t;for(const[t,s]of this.#Rt)s<=e&&this.#Rt.delete(t);for(const e of this.#Pt.keys())t.has(e)&&this.#Pt.delete(e);this.#Nt()}#zt(t){for(let e=t;e&&e!==this;e=e.parentElement)if((e.form??e.internals?.form)===this.form&&e.hasAttribute("name"))return e.getAttribute("name");return null}#At(t){if(!this.#xt)return;const e=this.#zt(t);null!==e&&(this.#Rt.set(e,++this.#kt),0===this.#Ft&&(this.#Ft=requestAnimationFrame(()=>this.#Nt())))}#St(t){const e=this.#zt(t);null===e||this.#Lt.has(e)||this.#Pt.has(e)||this.#Pt.set(e,this.#Dt(e))}#It(){return Array.from(this.form.elements).filter(t=>t.hasAttribute("name")&&!["submit","reset","button"].includes(t.type)&&!t.matches(":disabled"))}#Ot(){const t=new Map;for(const e of this.#It()){const s=e.getAttribute("name");t.set(s,[...t.get(s)??[],lt.extract(e)])}return new Map(Array.from(t,([t,e])=>[t,JSON.stringify(e)]))}#Dt(t){return JSON.stringify(this.#It().filter(e=>e.getAttribute("name")===t).map(t=>lt.extract(t)))}#Nt(){cancelAnimationFrame(this.#Ft),this.#Ft=0;const t=this.dirty;this.querySelectorAll("button").forEach(e=>{const s=e;s.form===this.form&&"submit"===s.type&&s.toggleAttribute("data-ful-dirty",t)}),t!==this.#Mt&&(this.#Mt=t,t?this.internals.states.add("dirty"):this.internals.states.delete("dirty"),this.dispatchEvent(new CustomEvent("dirty:change",{bubbles:!0,cancelable:!1,detail:{dirty:t}})))}#Tt(){this.declared("guard-leave")&&!this.#Ct&&(this.#Ct=new AbortController,it.guard(()=>this.dirty,this.#Ct.signal))}#$t=0;#Bt(t){if(c.defaultValue(t,"role","status"),t.hidden=!1,""!==t.textContent.trim())return;const e=document.createElement("span");e.className="ful-sr-only",e.dataset.ref="spinner-label",t.append(e),e.textContent=R.of().t("spinner.loading")}spinner(t){if(t){if(++this.#$t,1!==this.#$t)return}else if(this.#$t=Math.max(0,this.#$t-1),0!==this.#$t)return;c.set(this,"aria-busy",t?"true":null),this.querySelectorAll("ful-spinner").forEach(e=>{if(e.closest("form")!==this.form)return;const s=e;t?this.#Bt(s):(s.hidden=!0,s.querySelector(":scope > [data-ref=spinner-label]")?.remove())}),this.querySelectorAll("input,button").forEach(e=>{const s=e;if(s.form===this.form&&("submit"===s.type||"reset"===s.type))if(t)s.dataset.wd=s.getAttribute("aria-disabled")??"",s.setAttribute("aria-disabled","true");else{if(void 0===s.dataset.wd)return;c.set(s,"aria-disabled",s.dataset.wd||null),delete s.dataset.wd}})}set values(t){lt.mutateIn(this.form,t)}get values(){return lt.extractFrom(this.form)}set errors(t){lt.errors(this.form,t,this.declared("scroll-on-error"))}}const ft=new e(100),mt=(t,e)=>ft.getOrCompute(`${t}:${e}`,()=>{try{return new RegExp(e,"g")}catch(s){return console.warn(`invalid ${t} attribute`,e,s),null}}),gt={numeric:"numeric",decimal:"decimal"},bt=new Set(["date","time","datetime-local","month","week"]),vt={numeric:t=>t.replace(/\D/g,""),decimal:t=>{const e=t.replace(/[^\d.,]/g,""),s=e.search(/[.,]/);return-1===s?e:e.slice(0,s+1)+e.slice(s+1).replace(/[.,]/g,"")}};class yt extends ut{static observed=["placeholder"];static attributes=["type","v-type","keep","reject","uppercase:presence","trim:presence","unsigned:presence","autocomplete"];static slots=!0;static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <input data-tpl-if="type != \'textarea\'" data-tpl-type="type" placeholder=" " form="">\n <textarea data-tpl-if="type == \'textarea\'" placeholder=" " form=""></textarea>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_input;#jt=[];_type(){return this.declared("type")??("number"===this.declared("v-type")?"number":"text")}_build({slots:t}){const e=this._type(),s=gt[e],r=s?"text":e,i=this.template().withOverlay({type:r,slots:t}).render();this.#jt=[...i.querySelectorAll(":is(ful-control-group, ful-control) > :is(input, textarea)")],this._input=this.#jt[0];const n=this.declared("autocomplete")??(this.closest("form")?.getAttribute("autocomplete")??null);const a=(t=>{const e=t.declared("keep"),s=t.declared("reject");if(null!==e&&null!==s&&console.warn("a ful-input declares both keep and reject: keep is applied, reject is ignored",t),null!==e){const t=mt("keep",e);return t&&(e=>(e.match(t)??[]).join(""))}if(null!==s){const t=mt("reject",s);return t&&(e=>e.replace(t,""))}return((t,e)=>{const s=vt[t];return s?e?s:t=>((t,e)=>(t.startsWith("-")?"-":"")+e(t))(t,s):null})(t._type(),t.declared("unsigned"))})(this);for(const t of this.#jt)this.#Ht(t,s,n,a);return{fragment:i,control:this._input,error:i.querySelector("ful-field-error"),label:i.querySelector("label")}}#Ht(t,e,s,r){e&&c.set(t,"inputmode",e),c.set(t,"autocomplete",s);const i=t.id;c.forward("input-",this,t),t!==this._input&&c.set(t,"id",i||null),this.#Wt(t),t.addEventListener("input",()=>{if(!r)return;const e=t.value,s=r(e);if(e===s)return;const i=t.selectionStart;if(t.value=s,null===i)return;const n=r(e.slice(0,i)).length;t.setSelectionRange(n,n)})}#Wt(t){if(!bt.has(t.type))return void t.addEventListener("change",t=>{t.stopPropagation(),this._notifyChange()});let e=null,s=!1;const r=()=>{s=!1;const t=JSON.stringify(this.value);t!==e&&(e=t,this._notifyChange())};t.addEventListener("focus",()=>{e=JSON.stringify(this.value)}),t.addEventListener("keydown",t=>{"Enter"!==t.key||t.isComposing?s=!0:r()}),t.addEventListener("blur",r),t.addEventListener("change",t=>{t.stopPropagation(),s||r()})}get value(){const t=this.declared("uppercase"),e=this.declared("trim"),s=this._input.value,r=t?s.toUpperCase():s,i=e?r.trim():r;if(""===i)return null;const n="decimal"===this._type()?i.replaceAll(",","."):i;if("number"===this.declared("v-type")){const t=Number(n);return Number.isNaN(t)?n:t}return n}set value(t){this._input.value=""===t||null==t?"":`${t}`}get placeholder(){const t=this._input.getAttribute("placeholder");return" "===t?null:t}set placeholder(t){for(const e of this.#jt)c.set(e,"placeholder",t??" ");this.reflectTo("placeholder",t)}}const wt=t=>""===t?null:t;class Et extends S{static attributes=["locale","default"];render(){const t=this.textContent.trim(),[e,s,r]=t.split("-").map(Number),i=""===t?null:new Date(e,s-1,r);if(null===i||Number.isNaN(i.getTime()))return void this.replaceChildren(this.declared("default")??"");const{date:n}=R.of({locale:this.declared("locale")??void 0});this.replaceChildren(n(i,{year:"numeric",month:"numeric",day:"numeric"}))}}class xt extends S{static attributes=["locale","default"];render(){const t=this.textContent.trim(),e=""===t?null:new Date(xt.isoToLocal(t));if(null===e||Number.isNaN(e.getTime()))return void this.replaceChildren(this.declared("default")??"");const{date:s}=R.of({locale:this.declared("locale")??void 0});this.replaceChildren(s(e,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}))}static#Vt(t){return/^\d{4}-\d{2}-\d{2}$/.test(t)?new Date(`${t}T00:00:00`):new Date(t)}static isoToLocal(t){const e=xt.#Vt(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())}`}static localToIso(t){const e=xt.#Vt(t);return Number.isNaN(e.getTime())?null:e.toISOString()}}class At extends yt{static observed=["step","min","max"];_type(){return"date"}get min(){return wt(this._input.min)}set min(t){this._input.min=At.#Ut(t)}get max(){return wt(this._input.max)}set max(t){this._input.max=At.#Ut(t)}get step(){return wt(this._input.step)}set step(t){this._input.step=t??""}static#Ut(t){if(!t)return"";const e=t=>new Date(t.getTime()-6e4*t.getTimezoneOffset()).toISOString().split("T")[0];if("now"===t)return e(new Date);const s=/^([+-])(\d+)([dmy])$/.exec(t);if(!s)return t;const r="-"===s[1]?-1:1,i=+s[2],n=new Date;switch(n.setHours(0,0,0,0),s[3]){case"d":n.setDate(n.getDate()+i*r);break;case"m":{const t=n.getDate();n.setMonth(n.getMonth()+i*r),n.getDate()!==t&&n.setDate(0);break}case"y":n.setFullYear(n.getFullYear()+i*r)}return e(n)}}class St extends At{_type(){return"time"}get min(){return wt(this._input.min)}set min(t){this._input.min=this.#Gt(t)}get max(){return wt(this._input.max)}set max(t){this._input.max=this.#Gt(t)}#Gt(t){if(!t)return"";const e=new Date;if("now"!==t){const s=/^([+-])(\d+)([hm])$/.exec(t);if(!s)return t;const r="-"===s[1]?-1:1,i=+s[2]*r;"h"===s[3]?e.setHours(e.getHours()+i):e.setMinutes(e.getMinutes()+i)}return St.#Qt(e,Number(this._input.step)||60)}static#Qt(t,e){const s=t=>String(t).padStart(2,"0"),r=3600*t.getHours()+60*t.getMinutes()+t.getSeconds(),i=Math.floor(r/e)*e,n=s(Math.floor(i/3600)),a=s(Math.floor(i%3600/60));return e%60==0?`${n}:${a}`:`${n}:${a}:${s(i%60)}`}}class Tt extends yt{static observed=["step","min","max"];_type(){return"datetime-local"}get value(){return xt.localToIso(this._input.value)}set value(t){super.value=t?xt.isoToLocal(t):""}get min(){return xt.localToIso(this._input.min)}set min(t){this._input.min=t?xt.isoToLocal(t):""}get max(){return xt.localToIso(this._input.max)}set max(t){this._input.max=t?xt.isoToLocal(t):""}get step(){return wt(this._input.step)}set step(t){this._input.step=t??""}}class Ct extends yt{static WARNING_TIMEOUT=5e3;static list(t=[]){const e=new DataTransfer;for(const s of t)e.items.add(s);return e.files}static observed=["placeholder","accept:csv","multiple:presence","item-list:presence","dropzone:presence","max-files:number","max-file-size:number","max-total-size:number","value"];#Kt;#Jt;#Xt;#Yt;#Zt;_type(){return"file"}static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <input data-tpl-type="type" placeholder=" " form="">\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <div data-ref="dropzone" class="dropzone" data-tpl-if="slots.dropzone">\n {{{{ slots.dropzone }}}}\n </div>\n <div data-ref="dropzone" class="default-dropzone" data-tpl-if="!slots.dropzone">\n {{ #l10n:t(\'files.dropzone-label\') }}\n </div>\n <ful-item-list></ful-item-list>\n <ful-field-warnings role="status" aria-live="polite"></ful-field-warnings>\n <ful-field-error></ful-field-error>\n ';static templates={items:'\n <ful-item data-tpl-each="files" data-tpl-var="file" data-tpl-data-name="file.name">\n <div><span>{{ file.name }}</span><span>{{ #l10n:bytes(file.size) }}</span><button type="button" data-tpl-aria-label="#l10n:t(\'files.remove\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button></div>\n </ful-item>\n ',warning:"<ful-field-warning>{{ #l10n:t(key, args) }}</ful-field-warning>"};#te;_build(t){const e=super._build(t),s=e.fragment;return this.#Jt=s.querySelector("ful-item-list"),this.#te=t.slots?.items&&!u.isBlank(t.slots.items)?x.fromFragment(t.slots.items):null,this.#Xt=s.querySelector("[data-ref=dropzone]"),this.#Yt=s.querySelector("ful-field-warnings"),this.#Zt=s.querySelector("ful-control-group"),this.#Yt.addEventListener("animationend",t=>{t.target.remove()}),this.#Jt.addEventListener("click",t=>{if(!t.target.closest("button"))return;if(!this._interactive())return;const e=[...this.#Jt.children].indexOf(t.target.closest("ful-item"));-1!==e&&(this.files=Ct.list([...this.files].filter((t,s)=>s!==e)),this._notifyChange())}),this.#Xt.addEventListener("click",t=>{this._interactive()&&this._input.click()}),this.#Xt.addEventListener("dragover",t=>{t.preventDefault(),this.toggleAttribute("dragover",!0)}),this.#Xt.addEventListener("dragleave",()=>{this.toggleAttribute("dragover",!1)}),this.#Xt.addEventListener("drop",t=>{if(t.preventDefault(),this.toggleAttribute("dragover",!1),!this._interactive())return;const e=[...t.dataTransfer.items].filter(t=>"file"===t.kind).map(t=>t.getAsFile()).filter(t=>null!==t);0===e.length||e.length>1&&!this.multiple||(this.files=Ct.list(e),this._notifyChange())}),this._input.addEventListener("change",t=>{this.#ee()}),{...e,freeze:this.#Zt}}#ee(){this.setCustomValidity(),this.#Yt.replaceChildren(),this.#se(),this.#re(),this.#ie(),this.#ne(),(this.#te??this.template("items")).withOverlay({files:this.files}).renderTo(this.#Jt)}warning(t,e){this.template("warning").withOverlay({key:t,args:e}).appendTo(this.#Yt);const s=this.#Yt.lastElementChild;setTimeout(()=>s.remove(),Ct.WARNING_TIMEOUT)}#ae(t){const e=t.name.toLowerCase();return this.#Kt.some(s=>{const r=s.toLowerCase().split(";")[0].trim();return r.startsWith(".")?e.endsWith(r):r.endsWith("/*")?t.type.startsWith(`${r.slice(0,-1)}`):r.includes("/")&&t.type===r})}#se(){if(!this.#Kt.length)return;const t=[...this.files].filter(t=>!this.#ae(t));0!==t.length&&(this.warning("files.unacceptable-file-type",{types:this.#Kt.join(", ")}),this._input.files=Ct.list([...this.files].filter(e=>!t.includes(e))))}#ne(){null!==this.#oe&&(this.files.length<=this.#oe||(this.warning("files.max-files-exceeded",{count:this.#oe}),this._input.files=Ct.list()))}#re(){if(null===this.#le)return;const t=[...this.files].filter(t=>t.size>this.#le);0!==t.length&&(this.warning("files.max-file-size-exceeded",{size:R.of().bytes(this.#le)}),this._input.files=Ct.list([...this.files].filter(e=>!t.includes(e))))}#ie(){null!==this.#ue&&([...this.files].reduce((t,e)=>t+e.size,0)<=this.#ue||(this.warning("files.max-total-size-exceeded",{size:R.of().bytes(this.#ue)}),this._input.files=Ct.list()))}get accept(){return this.#Kt}set accept(t){this._input.accept=t.join(","),this.#Kt=t,this.reflectTo("accept",t)}get multiple(){return this._input.multiple}set multiple(t){this._input.multiple=t,this.reflectTo("multiple",t)}get files(){return this._input.files}set files(t){this._input.files=t,this.#ee()}get file(){return this.files[0]??null}set file(t){this.files=Ct.list(t?[t]:[])}get value(){const t=Array.from(this._input.files).map(t=>t.name);return this.multiple?t:t[0]??null}set value(t){t||(this.files=Ct.list())}formResetCallback(){this.value=null}get totalsize(){return Array.from(this.files).reduce((t,e)=>t+e.size,0)}#oe;get maxFiles(){return this.#oe}set maxFiles(t){this.#oe=t,this.reflectTo("max-files",t)}#le;get maxFileSize(){return this.#le}set maxFileSize(t){this.#le=t,this.reflectTo("max-file-size",t)}#ue;get maxTotalSize(){return this.#ue}set maxTotalSize(t){this.#ue=t,this.reflectTo("max-total-size",t)}#ce;get itemList(){return this.#ce}set itemList(t){this.#ce=t,this.reflectTo("item-list",t)}#de;get dropzone(){return this.#de}set dropzone(t){this.#de=t,this.reflectTo("dropzone",t)}}const _t=new Map;let Ot=0,kt=!1;const qt=(t,e,s)=>Math.min(Math.max(t,e),Math.max(e,s)),Lt=(t,e)=>{const{invoker:s,stretch:r}=e,i=s.getBoundingClientRect(),n=document.documentElement,a=n.clientWidth,o=n.clientHeight;t.style.removeProperty("margin");const l=getComputedStyle(t),u=parseFloat(l.marginTop)||0,c=parseFloat(l.marginRight)||0,d=parseFloat(l.marginBottom)||0,h=parseFloat(l.marginLeft)||0;if(t.style.right="auto",t.style.bottom="auto",t.style.margin="0",r){t.style.removeProperty("width"),t.style.removeProperty("min-width"),t.style.removeProperty("max-width");const e=Math.min(parseFloat(l.maxWidth)||a,a-16);t.style.minWidth=`${Math.min(i.width,a-16)}px`,t.style.maxWidth=`${e}px`;const s=t.getBoundingClientRect().width;t.style.left=`${qt(i.left,8,a-s-8)}px`;const r=t.getBoundingClientRect().height,n=i.bottom+u,c=n+r<=o-8?n:i.top-d-r;return void(t.style.top=`${qt(c,8,o-r-8)}px`)}const p=(t=>t.matches("ful-note, .ful-note, [placement]"))(t),f=p?t.getAttribute("placement")??"bottom":"bottom";t.style.removeProperty("max-width");const m=Math.min(parseFloat(l.maxWidth)||a,a-16);t.style.maxWidth=`${m}px`,t.style.left="8px";const g=t.getBoundingClientRect().width;let b="right"===f?i.right+h:"left"===f?i.left-c-g:p?i.left+i.width/2-g/2:i.left;b=qt(b,8,a-g-8),t.style.left=`${b}px`,t.style.maxWidth=`${Math.min(m,a-8-b)}px`;const v=t.getBoundingClientRect().height,y="top"===f?i.top-d-v:"right"===f||"left"===f?i.top+i.height/2-v/2:i.bottom+u;t.style.top=`${qt(y,8,o-v-8)}px`,p&&((t,e)=>{const s=e.getBoundingClientRect(),r=t.getBoundingClientRect();t.style.setProperty("--ful-note-callout-inline",s.left+s.width/2-r.left-t.clientLeft+"px"),t.style.setProperty("--ful-note-callout-block",s.top+s.height/2-r.top-t.clientTop+"px")})(t,s)},Rt=()=>{Ot=0;for(const[t,e]of _t)t.isConnected&&e.invoker.isConnected?Lt(t,e):_t.delete(t)},Nt=()=>{!Ot&&_t.size>0&&(Ot=requestAnimationFrame(Rt))};class Pt{static wire(t,e,{prefix:s="ful-anchor",invoke:r=!1,expanded:i=!1,stretch:n=!1,handPlace:a=!1}={}){const o=c.uid(s);r&&(e.id=e.id||o,"button"===t.localName||"input"===t.localName?t.setAttribute("popovertarget",e.id):(t.addEventListener("click",()=>e.togglePopover()),t.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.togglePopover())})));const l=`--${o}`;if(t.style.anchorName=l,e.style.positionAnchor=l,i&&(t.setAttribute("aria-expanded","false"),e.addEventListener("toggle",e=>{t.setAttribute("aria-expanded","open"===e.newState?"true":"false")})),!a&&CSS.supports("anchor-name: --ful-probe")&&CSS.supports("position-anchor: --ful-probe")&&CSS.supports("position-area: bottom")&&CSS.supports("top: anchor(bottom)")&&CSS.supports("width: anchor-size(width)"))return;const u={invoker:t,stretch:n};e.addEventListener("beforetoggle",t=>{"open"===t.newState&&((t,e)=>{t.style.visibility="hidden",queueMicrotask(()=>{t.matches(":popover-open")&&Lt(t,e),t.style.removeProperty("visibility")})})(e,u)}),e.addEventListener("toggle",t=>{"open"===t.newState?(_t.set(e,u),Lt(e,u)):(_t.delete(e),(t=>{for(const e of["top","left","right","bottom","margin","max-width","min-width","width","visibility","--ful-note-callout-inline","--ful-note-callout-block"])t.style.removeProperty(e)})(e))}),kt||(kt=!0,document.addEventListener("scroll",Nt,!0),window.addEventListener("resize",Nt))}static show(t,e,{flip:s=!1,gap:r=0}={}){return"function"!=typeof t.showPopover||t.matches(":popover-open")||t.showPopover(),(()=>{const i=e instanceof Element?e.getBoundingClientRect():e,n=document.documentElement,a=t.getBoundingClientRect(),o=i.bottom+r,l=i.top-r-a.height,u=s&&o+a.height>n.clientHeight-8&&l>=8?l:o;t.style.right="auto",t.style.bottom="auto",t.style.margin="0",t.style.left=`${qt(i.left,8,Math.max(8,n.clientWidth-a.width-8))}px`,t.style.top=`${qt(u,8,Math.max(8,n.clientHeight-a.height-8))}px`})(),t}}const Mt=(t,e)=>t.filter(({key:t})=>e.some(e=>e==t)),Ft=(t,e)=>t.filter(({label:t})=>(t??"").toLowerCase().includes(e?.toLowerCase()??""));class Dt{#vt;#yt;#U;#Et;#he;#pe;#C=null;#fe=null;#me=new nt;constructor({http:t,url:e,method:s,responseMapper:r,prefetch:i,revision:n}){this.#vt=t,this.#yt=e,this.#U=s,this.#Et=r,this.#he=i,this.#pe=n}async prefetch(){this.#he&&await this.#ge()}async exact(...t){return Mt(await this.#ge(),t)}async load(t){return Ft(await this.#ge(),t)}async invalidate(){this.#me.invalidate(),this.#C=null,this.#fe=null}async#ge(){if(null===this.#C){if(null===this.#fe){const t=this.#me.hold();this.#fe=Dt.#be(this.#vt,this.#U,this.#yt,this.#pe).then(e=>{t.stale||(this.#C=this.#Et(e))}).finally(()=>{t.stale||(this.#fe=null)})}await this.#fe}if(null===this.#C)throw new Error("superseded by an invalidation");return this.#C}static async#be(t,e,s,r){const i=`${e}@${s}`;if(null!==r){const t=et.load(i,r);if(void 0!==t)return t}const n=await t.request(e,s).fetchJson();if(null!==r)try{et.save(i,r,n)}catch(t){console.warn("failed to cache the select options",t)}return n}}class zt{#vt;#yt;#U;#Et;constructor({http:t,url:e,method:s,responseMapper:r}){this.#vt=t,this.#yt=e,this.#U=s,this.#Et=r}async invalidate(){}async exact(...t){const e=await this.#vt.request(this.#U,this.#yt).param("k",...t).fetchJson();return this.#Et(e)}async load(t){const e=await this.#vt.request(this.#U,this.#yt).param("s",t).fetchJson();return this.#Et(e)}}class It{#C;constructor(t){this.#C=t}update(t){this.#C=t}async invalidate(){}exact(...t){return Mt(this.#C,t)}load(t){return Ft(this.#C,t)}}class $t{static from({data:t,http:e,url:s,method:r="POST",mode:i,prefetch:n=!1,revision:a=null,responseMapper:o}){return s?"chunked"===i?new zt({http:e,url:s,method:r,responseMapper:o}):new Dt({http:e,url:s,method:r,responseMapper:o,prefetch:n,revision:a}):new It(t??[])}static create(t,e){if(!t.declared("src")){const t=Array.from(e.options?.querySelectorAll("option")??[]);return $t.from({data:t.map(t=>({key:t.getAttribute("value")??t.innerText.trim(),label:t.innerText.trim(),metadata:void 0}))})}return $t.from({http:t.component("http-client"),url:t.declared("src"),method:t.declared("method")??"POST",mode:t.declared("mode"),prefetch:t.declared("preload"),revision:$t.#ve(t),responseMapper:$t.#ye(t)})}static#ve(t){const e=t.declared("revision");if(""!==e)return e;const s=t.component("revision");return null==s?(console.warn("a valueless revision asks the registry for one, and no 'revision' component is defined: the vocabulary will not be cached",t),null):"function"==typeof s?s():s}static#ye(t){return t.declared("k-expr")&&t.declared("l-expr")?e=>t._registry.evaluator().withOverlay(e).evaluateExpression(t.declared("d-expr")??"self").map(e=>{const s=t._registry.evaluator().withOverlay(e);return{key:s.evaluateExpression(t.declared("k-expr")),label:s.evaluateExpression(t.declared("l-expr")),metadata:s.evaluateExpression(t.declared("m-expr")??"self")}}):t.declared("response-mapper")?t.component(t.declared("response-mapper")):t=>t.map(([t,e,s])=>({key:t,label:e,metadata:s}))}}class Bt extends S{static attributes=["listbox"];static slots=!0;static template='\n <ful-spinner class="centered" role="status" hidden><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner>\n <ful-empty data-ref="empty" aria-live="polite" hidden>{{ #l10n:t(\'dropdown.empty\') }}</ful-empty>\n <menu tabindex="-1" role="listbox" hidden></menu>\n ';static templates={options:'\n <li data-tpl-each="self" data-tpl-selected="index == 0" data-tpl-value="index" role="option">\n {{ label }}\n </li>\n '};#we;#Ee;#xe;#Ae;#X=new Map;#Se=new nt;render({slots:t}){const e=this.template().render();this.#Ae=u.isBlank(t.default)?this.template("options"):x.fromFragment(t.default),this.#we=e.querySelector("ful-spinner"),this.#xe=e.querySelector("[data-ref=empty]"),this.#Ee=e.querySelector("menu"),this.#Ee.id=this.declared("listbox")||c.uid("ful-listbox"),this.#Ee.addEventListener("mousedown",t=>{t.target.closest("li")&&t.preventDefault()}),this.#Ee.addEventListener("click",t=>{t.stopPropagation();const e=t.target.closest("li");e?e.matches('[aria-disabled="true"]')||this.#Te(e):this.hide()}),this.replaceChildren(e)}#Ce(){return this.#Ee?.querySelector('[selected]:not([aria-disabled="true"])')??this.#Ee?.querySelector('li:not([aria-disabled="true"])')??null}#_e(t){if(t){for(const e of this.#Ee.querySelectorAll("li"))e.toggleAttribute("selected",e===t);t.id||=c.uid("ful-option"),this.#Oe(t.id),t.scrollIntoView({block:"nearest",behavior:matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"})}else this.#Oe(null)}acceptSelection(){const t=this.#Ce();t&&this.#Te(t)}update(t,e=[]){if(void 0===t)throw new Error("null data");this.#X=new Map(t.map((t,e)=>[String(e),t]));const s=t.map((t,e)=>({index:e,...t}));this.#Ae.withOverlay(s).renderTo(this.#Ee);for(const[s,r]of[...this.#Ee.children].entries()){const i=t[s],n=e.some(t=>t==i?.key);r.toggleAttribute("picked",n),r.setAttribute("aria-selected",n?"true":"false");const a=!!i?.metadata?.disabled;a?r.setAttribute("aria-disabled","true"):r.removeAttribute("aria-disabled"),a&&i.metadata.reason?r.setAttribute("title",String(i.metadata.reason)):r.removeAttribute("title")}this.#xe.toggleAttribute("hidden",0!==t.length),this.#Ee.toggleAttribute("hidden",0===t.length);const r=t.findIndex(({key:t})=>e.some(e=>e==t));this.#_e(r>=0?this.#Ee.children[r]:this.#Ce())}#Te(t){const e=t.getAttribute("value"),s=this.#X.get(e);this.hide(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{index:e,entry:s}}))}hide(){this.#Se.invalidate(),this.matches(":popover-open")&&this.hidePopover(),this.#Oe(null)}#Oe(t){this.dispatchEvent(new CustomEvent("activechange",{bubbles:!1,cancelable:!1,detail:{id:t}}))}get shown(){return this.matches(":popover-open")}async show(t,e=[]){const s=this.#Se.take();this.matches(":popover-open")||this.showPopover(),this.#Ee.setAttribute("hidden",""),this.#we.removeAttribute("hidden");try{const r=await t();if(s.stale)return;this.update(r,e)}catch(t){if(s.stale)return;throw this.hide(),t}finally{s.stale||this.#we.setAttribute("hidden","")}}async moveOrShow(t,e,s=[]){if(this.shown){const e=this.#Ce(),s=e?.[(t?"next":"previous")+"ElementSibling"],r=s?this.#ke(s,t):null;return void(e&&r&&this.#_e(r))}await this.show(e,s)}#ke(t,e){for(let s=t;s;s=s[(e?"next":"previous")+"ElementSibling"])if(!s.matches('[aria-disabled="true"]'))return s;return null}jump(t){const e=t?this.#Ee.firstElementChild:this.#Ee.lastElementChild,s=this.#ke(e,t);s&&this.#_e(s)}page(t){const e=this.#Ce();if(!e)return;let s=e;for(let e=0;e!==this.#qe();++e){const e=this.#ke(s[(t?"next":"previous")+"ElementSibling"],t);if(!e)break;s=e}this.#_e(s)}#qe(){const t=this.#Ee.firstElementChild;return t&&0!==t.offsetHeight?Math.max(1,Math.trunc(this.#Ee.clientHeight/t.offsetHeight)):1}}class jt extends ut{static attributes=["name","loader","k-type","mode","preload:presence","revision","k-expr","l-expr","d-expr","m-expr","response-mapper"];static observed=["multiple:presence","item-list:presence","value:csv","src","method"];unmarshal(t,e){return"value"!==t||""!==e||this.hasAttribute("multiple")?super.unmarshal(t,e):[""]}static slots=!0;static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-control>\n <input type="text" form="" autocomplete="off" role="combobox" aria-autocomplete="list" aria-haspopup="listbox" aria-expanded="false">\n </ful-control>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n <ful-dropdown popover="manual">{{{{ slots.dropdown }}}}</ful-dropdown>\n </ful-control-group>\n <ful-item-list></ful-item-list>\n <ful-field-error></ful-field-error>\n ';static templates={items:'\n <ful-item data-tpl-each="entries" data-tpl-var="entry" data-tpl-data-key="entry.key">\n <div><span>{{ entry.label }}</span><button type="button" data-tpl-aria-label="#l10n:t(\'select.remove\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button></div>\n </ful-item>\n '};#Le;#Re={src:null,method:null};#X;#rt;#Ne;#Pe;#Jt;#te;#Me;#Fe=!1;#De=new Map;#ze=new nt;#Ie=!1;#$e;#Be;_build({slots:t}){const e=this.declared("name");this.#X=t.options,this.#je(),this.#Me=this.declared("multiple"),this.#Le.prefetch?.()?.catch(t=>{console.warn("failed to prefetch select options",this,"reason:",t)});const s=this.template().withOverlay({slots:t,name:e}).render();this.#Pe=s.querySelector("ful-control > input"),this.#Jt=s.querySelector("ful-item-list"),this.#te=t.items&&!u.isBlank(t.items)?x.fromFragment(t.items):null,c.forward("input-",this,this.#Pe),this.#rt=s.querySelector("ful-control"),this.#Ne=s.querySelector("ful-dropdown");const r=c.uid("ful-listbox");this.#Ne.setAttribute("listbox",r),this.#Pe.setAttribute("aria-controls",r),this.#Ne.addEventListener("beforetoggle",t=>{const e="open"===t.newState;this.#Pe.setAttribute("aria-expanded",e?"true":"false"),e||this.#Pe.removeAttribute("aria-activedescendant")}),this.#Ne.addEventListener("activechange",t=>{c.set(this.#Pe,"aria-activedescendant",t.detail.id)});const i=s.querySelector("ful-control-group");return Pt.wire(i,this.#Ne,{prefix:"ful-select",stretch:!0}),[this.#$e,this.#Be]=ot.throttle(400,()=>this.#He()),this.#We(),this.#Ve(),this.#Ue(),this.#Ge(),{fragment:s,control:this.#Pe,error:s.querySelector("ful-field-error"),label:s.querySelector("label")}}#We(){this.addEventListener("click",t=>{if(!this._interactive())return;const e=t.target.closest('button, [role="button"], a[href], input, select, textarea');e&&e!==this.#Pe||(this.#Ne.shown?this.#Qe():(this.#Pe.focus(),this.#$e()))}),this.#Jt.addEventListener("click",t=>{t.stopPropagation(),t.target.closest("button")&&this._interactive()&&this.#Ke([...this.#Jt.children].indexOf(t.target.closest("ful-item")))}),this.#rt.addEventListener("click",t=>{const e=t.target instanceof Element?t.target.closest("ful-badge"):null;e&&(t.stopPropagation(),this.#Je(e))})}#Ve(){this.addEventListener("keydown",t=>{const e=t.target instanceof Element?t.target.closest("ful-badge"):null;e?this.#Xe(t,e):"ArrowLeft"===t.code&&t.target===this.#Pe&&0===this.#Pe.selectionStart&&0===this.#Pe.selectionEnd&&this.#Ye().at(-1)?.focus()})}#Ue(){this.#Pe.addEventListener("change",t=>{t.stopPropagation()}),this.#Pe.addEventListener("focus",()=>{this.#Ie||this.#Pe.select()}),this.#Pe.addEventListener("blur",t=>{t.stopPropagation(),t.relatedTarget&&this.contains(t.relatedTarget)||(this.#Be(),this.#Qe(!0))}),this.#Pe.addEventListener("keydown",t=>{this._interactive()&&this.#Ze(t)}),this.#Pe.addEventListener("input",t=>{t.stopPropagation(),this._interactive()&&(this.#Ie=!0,this.#$e())})}#Ge(){this.#Ne.addEventListener("change",t=>{t.stopPropagation(),this._interactive()?(this.#Me||this.#De.clear(),this.#Ie=!1,this.#De.set(this.#ts(t.detail.entry.key),t.detail.entry),this.#es(),this.#Pe.focus(),this.#Ne.hide(),this.#Me||this.#Pe.select()):this.#Qe()})}async withLoader(t){return await t(this.#Le)}async reload(){await(this.#Le.invalidate?.()),await(this.#Le.prefetch?.());const t=[...this.#De.keys()];0!==t.length&&await this.#i(t,this.#ze.take())}get src(){return this.getAttribute("src")}set src(t){this.reflectTo("src",t??null),this.#ss()&&this.reload()}get method(){return this.getAttribute("method")}set method(t){this.reflectTo("method",t??null),this.#ss()&&this.reload()}async reconfigure(t,{notify:e=!1}={}){for(const e of["src","method"])e in t&&this.reflectTo(e,t[e]??null);this.#ss();const s=[...this.#De.keys()];await this.reload();const r=[...this.#De.keys()];e&&r.length!==s.length&&this._notifyChange({entry:this.entry})}#je(){this.#Re={src:this.getAttribute("src"),method:this.getAttribute("method")},this.#Le=this.component(this.declared("loader")??"loaders:select").create(this,{options:this.#X})}#ss(){return(this.getAttribute("src")!==this.#Re.src||this.getAttribute("method")!==this.#Re.method)&&(this.#Be(),this.#Qe(),this.#je(),!0)}#Ye(){return Array.from(this.#rt.querySelectorAll(":scope > ful-badge"))}#Je(t){this._interactive()&&this.#Ke(this.#Ye().indexOf(t))}#Ke(t){const e=Array.from(this.#De.keys())[t];void 0!==e&&(this.#De.delete(e),this.#es())}#Xe(t,e){switch(t.code){case"NumpadEnter":case"Enter":case"Space":case"Backspace":case"Delete":t.preventDefault(),this.#Je(e),this.#Pe.focus();break;case"ArrowLeft":t.preventDefault(),(this.#Ye()[this.#Ye().indexOf(e)-1]??this.#Pe).focus();break;case"ArrowRight":t.preventDefault(),(this.#Ye()[this.#Ye().indexOf(e)+1]??this.#Pe).focus();break;case"Escape":this.#Pe.focus()}}#Ze(t){switch(t.code){case"ArrowUp":case"ArrowDown":t.preventDefault(),this.#rs(t);break;case"Home":this.#Ne.shown&&(t.preventDefault(),this.#Ne.jump(!0));break;case"End":this.#Ne.shown&&(t.preventDefault(),this.#Ne.jump(!1));break;case"PageDown":case"PageUp":this.#Ne.shown&&(t.preventDefault(),this.#Ne.page("PageDown"===t.code));break;case"Escape":this.#Be(),this.#Qe();break;case"NumpadEnter":case"Enter":if(!this.#Ne.shown)return;t.preventDefault(),this.#Ie=!1,this.#is(),this.#Ne.acceptSelection();break;case"Backspace":0===this.#Pe.selectionStart&&0===this.#Pe.selectionEnd&&this.#Ke(this.#De.size-1);break;case"Tab":this.#Be(),this.#Qe(!0)}}#rs(t){const e="ArrowDown"===t.code;t.altKey?e&&!this.#Ne.shown?this.#He():!e&&this.#Ne.shown&&this.#Qe():this.#Ne.moveOrShow(e,()=>this.#Le.load(this.#ns()),[...this.#De.keys()])}#Qe(t=!1){this.#Ne.hide();const e=t&&this.#Ie&&!this.#Me&&""===this.#Pe.value&&0!==this.#De.size;this.#Ie=!1,e&&(this.#De.clear(),this.#es()),this.#is()}#He(){return this.#Ne.show(()=>this.#Le.load(this.#ns()),[...this.#De.keys()])}#ns(){return this.#Ie?this.#Pe.value:""}get query(){return this.#ns()}#is(){const t=this.#De.values().next().value;this.#Pe.value=this.#Me?"":t?.label??""}#as(){return[...this.#De.values()]}#es(){this.#os(),this._notifyChange({entry:this.entry})}#os(){const t=this.#Me?Array.from(this.#De.entries()).map(([t,e],s)=>{const r=document.createElement("ful-badge");return r.setAttribute("role","button"),r.setAttribute("tabindex",0===s?"0":"-1"),r.setAttribute("value",t),r.innerText=e.label,r}):[];for(const t of this.#rt.querySelectorAll(":scope > ful-badge"))t.remove();this.#Pe.before(...t),this.#Ie||this.#is(),this.#Jt.replaceChildren(),(this.#te??this.template("items")).withOverlay({entries:this.#as()}).renderTo(this.#Jt)}#ts(t){switch(this.declared("k-type")){case"number":{const e=""===t?Number.NaN:Number(t);return Number.isNaN(e)?t:e}case"boolean":return!0===t||"true"===t||!1!==t&&"false"!==t&&t;default:return String(t)}}set value(t){const e=(null==t?[]:Array.isArray(t)?t:[t]).map(t=>this.#ts(t));!this.#Fe&&e.some(t=>"string"==typeof t&&t.includes(","))&&(this.#Fe=!0,console.warn("a ful-select key cannot contain a comma: it is unexpressible in the value attribute",this)),this.#De=new Map(e.map(t=>[t,{key:t,label:t,metadata:void 0}]));const s=this.#ze.take();this.#rt&&(this.#os(),0!==e.length&&this.#i(e,s))}async#i(t,e){const s=await this.#Le.exact(...t);if(e.stale)return;const r=new Map(s.map(t=>[this.#ts(t.key),t]));for(const e of t)this.#De.has(e)&&(r.has(e)?this.#De.set(e,r.get(e)):this.#De.delete(e));this.#os()}get value(){return this.#Me?[...this.#De.keys()]:[...this.#De.keys()][0]??null}get entry(){const t=this.#as();return this.#Me?t:t[0]??null}#ce;get multiple(){return this.#Me}set multiple(t){this.#Me=t,this.reflectTo("multiple",t)}get itemList(){return this.#ce}set itemList(t){this.#ce=t,this.reflectTo("item-list",t)}}class Ht extends ut{static attributes=["name","type"];static slots=!0;static ROLE="radiogroup";static template='\n <fieldset>\n <legend>\n {{{{ slots.default }}}}\n </legend>\n <header data-tpl-if="slots.header">\n {{{{ slots.header }}}}\n </header>\n <ful-radio-list>\n <div class="label-wrapper" data-tpl-each="inputsAndLabels" data-tpl-var="ial">\n <label>\n {{{{ ial[0] }}}}\n <div>{{{{ ial[1] }}}}</div>\n </label>\n </div>\n </ful-radio-list>\n <ful-field-error></ful-field-error>\n <footer data-tpl-if="slots.footer">\n {{{{ slots.footer }}}}\n </footer>\n </fieldset>\n ';#ls;#us;#cs;_build({slots:t}){const e=this.declared("name")??c.uid("ful-radiogroup"),s=Array.from(t.default.querySelectorAll("ful-radio")),r=s.map(t=>{const s=document.createElement("input");return s.setAttribute("type","radio"),c.forward("input-",this,s),c.forward("",t,s),s.setAttribute("name",`${e}-ignore`),s.setAttribute("form",""),s.addEventListener("change",t=>{t.stopPropagation(),this._notifyChange()}),[s,u.fromChildNodes(t)]});s.forEach(t=>{t.remove()});const i=this.template().withOverlay({name:e,slots:t,inputsAndLabels:r}).render();return this.#ls=i.firstElementChild,this.#us=i.querySelector("input[type=radio]"),this.#cs="boolean"===this.declared("type"),{fragment:i,control:this.#us,error:i.querySelector("ful-field-error"),described:this,claims:this.#ls,announces:this,freeze:this.#ls}}get value(){const t=this.querySelector("input[type=radio]:checked");return t?this.#cs?"true"===t.value:t.value:null}set value(t){const e=this.querySelectorAll("input[type=radio]"),s=()=>{e.forEach(t=>{t.checked=!1})};if(null===t)return void s();const r=this.querySelector(`input[type=radio][value=${CSS.escape(String(t))}]`);null!==r?r.checked=!0:s()}}class Wt extends ut{static attributes=["type"];static observed=["value:bool"];static slots=!0;static template='\n <ful-choice data-tpl-switch="isSwitch">\n <input type="checkbox" data-tpl-role="isSwitch ? \'switch\' : false" form="">\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n </ful-choice>\n <ful-field-error></ful-field-error>\n ';#ds;#Pe;_build({slots:t}){const e="switch"===this.declared("type"),s=this.template().withOverlay({slots:t,isSwitch:e}).render();this.#ds=s.firstElementChild,this.#Pe=s.querySelector("input"),c.forward("input-",this,this.#Pe),this.#Pe.addEventListener("change",t=>{t.stopPropagation(),this._notifyChange()});const r=s.querySelector("label");return{fragment:s,control:this.#Pe,error:s.querySelector("ful-field-error"),label:r,freeze:this.#ds}}get value(){return this.#Pe.checked}set value(t){this.#Pe.checked=t}}class Vt extends S{static attributes=["sorter"];static observed=["order"];#hs;render(){const t=this.declared("sorter"),e=["asc","desc",null];this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.addEventListener("click",()=>{const s=e[(e.indexOf(this.order)+1)%3];this.dispatchEvent(new CustomEvent("sort:requested",{bubbles:!0,cancelable:!1,detail:{value:{sorter:t,order:s}}}))}),this.addEventListener("keydown",t=>{["Enter","NumpadEnter","Space"].includes(t.code)&&(t.preventDefault(),this.click())})}get order(){return this.#hs||null}set order(t){this.#hs=t||null,this.reflectTo("order",this.#hs);const e=this.closest("th");e&&c.set(e,"aria-sort",this.#hs?"asc"===this.#hs?"ascending":"descending":null)}}class Ut extends S{static observed=["total:number","current:number"];static attributes=["pages:number"];static config={prevIcon:"chevron-left",nextIcon:"chevron-right",reloadIcon:"arrow-clockwise"};static template='\n <ful-pagination-bar role="navigation" data-tpl-aria-label="#l10n:t(\'pagination.navigation\')">\n <ul>\n <li data-ref="index"> {{ #l10n:t(\'pagination.showing\', { \'current\': curr.label, \'total\': total }) }}</li>\n <li data-ref="reload"><button type="button" data-tpl-aria-label="#l10n:t(\'pagination.reload\')"><ful-icon data-tpl-name="config.reloadIcon" aria-hidden="true"></ful-icon></button></li>\n <li data-ref="prev">\n <button type="button" data-tpl-disabled="prev.enabled ? false : true" data-tpl-aria-label="#l10n:t(\'pagination.previous\')" data-tpl-data-page="prev.index">\n <ful-icon data-tpl-name="config.prevIcon" aria-hidden="true"></ful-icon>\n </button>\n </li>\n <li data-ref="page" data-tpl-each="pages" data-tpl-var="page">\n <button type="button" data-tpl-aria-current="curr.index == page.index ? \'page\' : false" data-tpl-data-page="page.index" >\n {{ page.label }}\n </button>\n </li>\n <li data-ref="next">\n <button type="button" data-tpl-disabled="next.enabled ? false : true" data-tpl-aria-label="#l10n:t(\'pagination.next\')" data-tpl-data-page="next.index">\n <ful-icon data-tpl-name="config.nextIcon" aria-hidden="true"></ful-icon>\n </button>\n </li>\n </ul>\n </ful-pagination-bar>\n ';#ps=0;#W=0;render(){this.addEventListener("click",t=>{const e=t.target.closest("button");e&&!e.hasAttribute("disabled")&&"page"!==e.getAttribute("aria-current")&&this.dispatchEvent(new CustomEvent("page:requested",{bubbles:!0,cancelable:!1,detail:{value:Number(e.dataset.page??this.#W)}}))})}update({current:t,total:e}={}){void 0!==t&&(this.#W=t??0),void 0!==e&&(this.#ps=e??0),this.reflectTo("current",this.#W),this.reflectTo("total",this.#ps);const s=this.#W,r=this.#ps,i=this.declared("pages")??5,n=Math.max(r,1),a=s>0,o=s+1<n,l={index:a?s-1:null,enabled:a},u={index:s,label:s+1},c={index:o?s+1:null,enabled:o},d=Math.max(1,Math.min(i,n)),h=Math.max(0,Math.min(s-Math.floor((d-1)/2),n-d)),p=Array.from({length:d},(t,e)=>({index:h+e,label:h+e+1})),f=this.contains(document.activeElement)?document.activeElement.closest("li")?.getAttribute("data-ref"):null,m="page"===f?document.activeElement.dataset.page:null;if(this.template().withOverlay({total:n,prev:l,curr:u,next:c,pages:p}).renderTo(this),!f)return;const g=(null===m?null:this.querySelector(`li[data-ref=page] button[data-page="${m}"]`))??this.querySelector(`li[data-ref=${f}] button:not(:disabled)`)??this.querySelector("li[data-ref=page] button[aria-current=page]");g?.focus()}get total(){return this.#ps}set total(t){this.update({total:t})}get current(){return this.#W}set current(t){this.update({current:t})}}class Gt{static parse(t,e){const s=t?h.queryChildren(t,"schema"):null;if(!s)throw new Error('missing expected <schema>: ful-table needs a <template slot="schema"> holding one');const r=document.createElement("tr"),i=document.createElement("tr");i.setAttribute("data-tpl-each","rows");for(const t of s.getAttributeNames()){const e=s.getAttribute(t);r.setAttribute(t,e??""),i.setAttribute(t,e??"")}const n=h.queryChildrenAll(s,"column"),a=n.filter(t=>t.hasAttribute("order")&&t.hasAttribute("sorter")).map(t=>({sorter:t.getAttribute("sorter"),order:t.getAttribute("order")}))[0]??null;for(const t of n){const e=h.queryChildren(t,"title"),s=t.getAttribute("sorter"),n=t.getAttribute("order"),a=e??document.createTextNode(t.getAttribute("title")??"");e?.remove(),t.removeAttribute("sorter"),t.removeAttribute("order"),t.removeAttribute("title");const o=s||n?(()=>{const t=document.createElement("ful-sorter");return s&&t.setAttribute("sorter",s),n&&t.setAttribute("order",n),t.append(a),t})():a,l=document.createElement("th"),u=document.createElement("td");for(const e of t.getAttributeNames()){const s=t.getAttribute(e);l.setAttribute(e,s??""),u.setAttribute(e,s??"")}l.append(o),u.append(...t.childNodes),r.append(l),i.append(u)}return{headersTemplate:e.withOverlay({inHeaders:!0,inRows:!1}).withFragment(u.from(r)),rowsTemplate:e.withOverlay({inHeaders:!1,inRows:!0}).withFragment(u.from(i)),sort:a,length:n.length}}}class Qt{#C;constructor(t){this.#C=t}async load(t,e,s){const r=this.#fs(e),i=t.page*t.size,n=i+t.size;return{data:r.slice(i,n),size:r.length}}#fs(t){if(!t?.sorter)return this.#C;const{sorter:e,order:s}=t,r="desc"===s?-1:1;return[...this.#C].sort((t,s)=>{const i=t?.[e],n=s?.[e];return i===n?0:null==i?1:null==n?-1:(i<n?-1:1)*r})}update(t){this.#C=t}}class Kt{#vt;#yt;#U;#Et;constructor(t,e,s,r=t=>t){this.#vt=t,this.#yt=e,this.#U=s,this.#Et=r}async load(t,e,s){const r=Object.entries(s).filter(([t,e])=>e);return await this.#vt.request(this.#U,this.#yt).param("page",t.page).param("size",t.size).param("sort",e?`${e.sorter},${e.order}`:null).param("filters",r.length>0?JSON.stringify(Object.fromEntries(r)):null).fetchJson().then(t=>this.#Et(t))}}class Jt{static create(t,e){const s=t.getAttribute("src");if(s){const e=t.component("http-client"),r=t.getAttribute("method")??"GET",i=t.hasAttribute("response-mapper")?t.component(t.getAttribute("response-mapper")):t=>t;return new Kt(e,s,r,i)}return new Qt([])}}class Xt extends S{static attributes=["loader","autoload:presence"];static observed=["page-size:number","src","method"];static slots=!0;static config={searchIcon:"search",emptyIcon:"inbox"};static template='\n <ful-form data-tpl-if="slots.filters">\n {{{{ slots.filters }}}}\n </ful-form>\n <ful-table-wrapper>\n <table>\n <caption data-tpl-if="slots.caption">{{{{ slots.caption }}}}</caption>\n <thead></thead>\n <tbody></tbody>\n <tbody data-ref="initial">\n <tr>\n <td data-tpl-colspan="schema.length">\n <ful-empty>\n <ful-icon data-tpl-if="config.searchIcon" data-tpl-name="config.searchIcon" aria-hidden="true"></ful-icon>\n {{ #l10n:t(\'table.initial\') }}\n </ful-empty>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="empty" hidden>\n <tr>\n <td data-tpl-colspan="schema.length">\n <ful-empty data-tpl-if="slots.empty" data-ref="empty-authors"></ful-empty>\n <ful-empty data-tpl-if="!slots.empty">\n <ful-icon data-tpl-if="config.emptyIcon" data-tpl-name="config.emptyIcon" aria-hidden="true"></ful-icon>\n {{ #l10n:t(\'table.no-data\') }}\n </ful-empty>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="loading" hidden>\n <tr>\n <td data-tpl-colspan="schema.length">\n <ful-spinner class="big" role="status"><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner>\n </td>\n </tr>\n </tbody>\n <tbody data-ref="feedback" hidden>\n <tr>\n <td data-tpl-colspan="schema.length">\n <div role="alert">\n <p>{{ #l10n:t(\'table.error\') }}</p>\n <div data-ref="feedback-error"></div>\n </div>\n </td>\n </tr>\n </tbody>\n <tfoot data-tpl-if="slots.footer">\n {{{{ slots.footer }}}}\n </tfoot>\n </table>\n </ful-table-wrapper>\n <ful-pagination current="0" total="1"></ful-pagination>\n ';static templates={row:"\n {{{{ schema.rowsTemplate.withOverlay({'rows': pageResponse.data}).render() }}}}\n "};#Le;#ms;#J;#gs;#bs;#xe;#vs;#ys;#ws;#Es;#xs;#As={pageRequest:{page:0,size:10},sortRequest:null,filterRequest:{}};#Ss=!1;#Ts=new nt;#Re={src:null,method:null};get pageSize(){return this.#As.pageRequest.size}set pageSize(t){const e=t??10;e!==this.#As.pageRequest.size&&(this.#As={...this.#As,pageRequest:{page:0,size:e}},this.#Ss&&this.reload())}get src(){return this.getAttribute("src")}set src(t){this.reflectTo("src",t??null),this.#ss()&&this.#Ss&&this.reload()}get method(){return this.getAttribute("method")}set method(t){this.reflectTo("method",t??null),this.#ss()&&this.#Ss&&this.reload()}async reconfigure(t){for(const e of["src","method"])e in t&&this.reflectTo(e,t[e]??null);return this.#ss(),await this.reload()}#je(){this.#Re={src:this.getAttribute("src"),method:this.getAttribute("method")},this.#Le=this.component(this.declared("loader")??"loaders:table").create(this)}#ss(){return(this.getAttribute("src")!==this.#Re.src||this.getAttribute("method")!==this.#Re.method)&&(this.#je(),this.#As={...this.#As,pageRequest:{...this.#As.pageRequest,page:0}},!0)}async render({slots:t}){const e=this.template(),s=Gt.parse(t.schema,e),r=e.withOverlay({slots:t,schema:s}).render(),i=h.queryChildren(r,"ful-table-wrapper").querySelector("table");c.forward("table-",this,i),this.#je(),this.#ms=s,this.#J=i.querySelector(":scope > tbody"),this.#gs=i.querySelector(":scope > tbody[data-ref=loading]"),this.#bs=i.querySelector(":scope > tbody[data-ref=initial]"),this.#xe=i.querySelector(":scope > tbody[data-ref=empty]"),this.#vs=this.#xe.querySelector("ful-empty[data-ref=empty-authors]"),this.#ys=t.empty&&!u.isBlank(t.empty)?x.fromFragment(t.empty):null,this.#ws=i.querySelector(":scope > tbody[data-ref=feedback]"),this.#Es=h.queryChildren(r,"ful-pagination"),this.replaceChildren(r);const n=this.querySelector("thead");s.headersTemplate.renderTo(n),this.#xs=n.querySelectorAll("ful-sorter"),await A.waitForChildren(this);const a=h.queryChildren(this,"ful-form");this.#As={pageRequest:{page:0,size:this.declared("page-size")??10},sortRequest:s.sort,filterRequest:a?.values??{}},a?.addEventListener("submit:success",async t=>{await this.#Cs(0,t.detail.request)}),this.addEventListener("page:requested",async t=>{await this.#Cs(t.detail.value,this.#As.filterRequest)}),this.addEventListener("sort:requested",async t=>{const e=t.detail.value.order?t.detail.value:null;await this.load(this.#As.pageRequest,e,this.#As.filterRequest),this.#As.sortRequest===e&&(this.#xs.forEach(t=>{t.order=null}),t.target.order=t.detail.value.order)}),this.declared("autoload")&&this.reload()}async reload(){return await this.load(this.#As.pageRequest,this.#As.sortRequest,this.#As.filterRequest)}async load(t,e,s){this.#Ss=!0;const r=this.#Ts.take();let i;this.#gs.toggleAttribute("hidden",this.#J.childElementCount>0),this.#ws.setAttribute("hidden",""),this.#bs.setAttribute("hidden",""),this.#xe.setAttribute("hidden",""),this.setAttribute("aria-busy","true");try{const n=await this.#Le.load(t,e,s);if(r.stale)return;if(i=Math.max(0,Math.ceil(n.size/t.size)-1),t.page<=i)return this.#As={pageRequest:t,sortRequest:e,filterRequest:s},this.#ee(t,e,s,n),this.removeAttribute("aria-busy"),void this.dispatchEvent(new CustomEvent("load:success",{bubbles:!0,cancelable:!1,detail:{pageRequest:t,sortRequest:e,filterRequest:s,response:n}}))}catch(i){if(r.stale)return;throw this.#gs.setAttribute("hidden",""),this.#J.replaceChildren(),this.#ws.removeAttribute("hidden"),this.#ws.querySelector("[data-ref=feedback-error]").textContent=R.of().failure(i),this.removeAttribute("aria-busy"),this.dispatchEvent(new CustomEvent("load:failure",{bubbles:!0,cancelable:!1,detail:{pageRequest:t,sortRequest:e,filterRequest:s,exception:i}})),i}return await this.load({page:i,size:t.size},e,s)}async withLoader(t){return await t(this.#Le)}async resetWithFilter(t){return await this.#Cs(0,t)}#Cs(t,e){return this.load({page:t,size:this.#As.pageRequest.size},this.#As.sortRequest,e)}#ee(t,e,s,r){const i=Math.ceil(r.size/t.size);this.#gs.setAttribute("hidden",""),this.#J.replaceChildren(this.template("row").withOverlay({schema:this.#ms,pageRequest:t,filterRequest:s,pageResponse:r}).render()),this.#xe.toggleAttribute("hidden",0!==r.data.length),this.#ys&&0===r.data.length&&this.#vs.replaceChildren(this.#ys.withOverlay({schema:this.#ms,pageRequest:t,filterRequest:s,pageResponse:r}).render()),this.#Es.update({current:t.page,total:i})}}const Yt=(t,e,{items:s,current:r=()=>null})=>{let i="",n=0;e.addEventListener("beforetoggle",s=>{"closed"===s.newState&&e.contains(document.activeElement)&&t.focus()}),e.addEventListener("toggle",t=>{if("open"!==t.newState)return;const e=s();(r()??e[0])?.focus()}),e.addEventListener("keydown",e=>{const r=e.target,a=s(),o=a.find(t=>t===r||t.contains(r));if(!o)return;const l=a.indexOf(o);switch(e.code){case"ArrowDown":return e.preventDefault(),void a[(l+1)%a.length]?.focus();case"ArrowUp":return e.preventDefault(),void a[(l-1+a.length)%a.length]?.focus();case"Home":return e.preventDefault(),void a[0]?.focus();case"End":return e.preventDefault(),void a[a.length-1]?.focus();case"Enter":case"NumpadEnter":case"Space":return e.preventDefault(),o.click(),void t.focus();case"Escape":return void t.focus()}if(1!==e.key.length||e.ctrlKey||e.altKey||e.metaKey)return;const u=Date.now();i=u-n>500?e.key:i+e.key,n=u;const c=i.toLowerCase(),d=[...c].every(t=>t===c[0]),h=d?c[0]:c,p=d?l+1:l,f=[...a.slice(p),...a.slice(0,p)].find(t=>(t.textContent??"").trim().toLowerCase().startsWith(h));f&&(e.preventDefault(),f.focus())})};class Zt{static narrow(t,e){const s=(t??[]).filter(t=>e.includes(t));return s.length>0?s:[...e]}#_s;#Ee;#Os;#ks;#qs;#is;#Ls;#Rs;#Ns;#Ps=!1;#Ms=!1;constructor(t,{vocabulary:e,glyphs:s={},labelFor:r=t=>t,display:i=null,interactive:n=()=>!0,onPick:a=()=>{}}){this.#_s=t,this.#Ee=t.nextElementSibling,this.#Os=e,this.#ks=s,this.#qs=r,this.#is=i??(t=>s[t]??t),this.#Ls=n,this.#Rs=a,this.#Ns=[...e],this.#Ee.addEventListener("click",t=>{const e=t.target.closest("li > a");if(!e||!this.#Ls())return;const s=e.getAttribute("value"),r=this.value;this.value=s,this.#Ee.hidePopover?.(),r!==s&&this.#Rs(s)})}get allowed(){return this.#Ns}set allowed(t){this.#Ns=Zt.narrow(t,this.#Os),this.#Fs(),!this.#Ms&&this.#Ns.length>1&&(this.#pt(),this.#Ms=!0),this.#Ds(),this.pinned&&(this.value=this.#Ns[0])}preferring(t){return null!==t&&this.#Ns.includes(t)?t:this.#Ns[0]}get pinned(){return this.#Ns.length<2}set fixed(t){this.#_s.toggleAttribute("hidden",!!t)}get value(){return this.#_s.getAttribute("value")}set value(t){this.#_s.setAttribute("value",t),this.#_s.textContent=this.#is(t),c.set(this.#_s,"aria-label",this.#qs(t)),this.#zs()}#zs(){const t=this.value;for(const e of this.#Jt())e.setAttribute("aria-checked",String(e.getAttribute("value")===t))}set claimed(t){this.#Ps=t,this.#Ds()}#Fs(){this.#Ee.replaceChildren(...this.#Ns.map(t=>{const e=document.createElement("li");e.setAttribute("role","none");const s=document.createElement("a");s.setAttribute("role","menuitemradio"),s.setAttribute("tabindex","-1"),s.setAttribute("value",t);const r=this.#qs(t),i=this.#ks[t]??t;if(r===t&&i===t)s.innerText=t;else{const t=document.createElement("span");t.innerText=i;const e=document.createElement("span");e.innerText=r,s.append(t,e)}return e.append(s),e})),this.#zs()}#Ds(){const t=this.pinned;this.#_s.toggleAttribute("disabled",t||this.#Ps),c.set(this.#_s,"aria-haspopup",t?null:"true"),c.set(this.#_s,"aria-expanded",t?null:"false"),t?this.#_s.removeAttribute("popovertarget"):this.#Ee.id&&this.#_s.setAttribute("popovertarget",this.#Ee.id)}#Jt(){return Array.from(this.#Ee.querySelectorAll("li > a"),t=>t)}#pt(){Pt.wire(this.#_s,this.#Ee,{prefix:"ful-filter-menu",invoke:!0,expanded:!0}),Yt(this.#_s,this.#Ee,{items:()=>this.#Jt(),current:()=>this.#Jt().find(t=>t.getAttribute("value")===this.value)})}}const te={EQ:"=",NEQ:"≠",LT:"<",GT:">",LTE:"≤",GTE:"≥",BETWEEN:"↔",CONTAINS:"…a…",STARTS_WITH:"a…",ENDS_WITH:"…a"},ee=["EQ","NEQ","LT","GT","LTE","GTE","BETWEEN"],se=[...ee,"CONTAINS","STARTS_WITH","ENDS_WITH"],re=["IGNORE_CASE","CASE_SENSITIVE"],ie={IGNORE_CASE:"aa",CASE_SENSITIVE:"Aa"},{t:ne}=R.of(),ae=t=>ne(`filters.op.${t}`),oe=t=>ne(`filters.sensitivity.${t}`),le=t=>ne(""===t?"filters.boolean.any":`filters.boolean.${t}`),ue=t=>t.querySelector(":scope > label")?.textContent.trim()||null,ce=(t,e,{singular:s,plural:r,vocabulary:i,fallback:n})=>{const a=t.declared(s);if(null===a)return;t.hasAttribute(r)&&console.warn(`${t.localName}: ${s} fixes what ${r} offers a menu for, the plural is ignored`,t);const o=i.includes(a);o||console.warn(`${t.localName}: '${a}' is not one of its ${r}, the default is pinned instead`,t),e.allowed=[o?a:n],e.fixed=!0},de=(t,e,s)=>{const r=s.filter(t=>null!=t&&""!=`${t}`);return 0===r.length?null:{label:t,operator:e,operands:r.map(t=>`${t}`)}};class he extends yt{static observed=["value:json","operators:csv"];static attributes=["operator"];static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-affix>\n <button data-ref="operator" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n </ful-affix>\n <ful-control>\n <input data-ref="value1" data-tpl-type="type" form="">\n <input data-ref="value2" data-tpl-type="type" form="" hidden>\n </ful-control>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_operator;_container;_value1;_value2;_build(t){const e=super._build(t),s=e.fragment;return this._container=s.querySelector("ful-control-group"),this._value1=s.querySelector("[data-ref=value1]"),this._value2=s.querySelector("[data-ref=value2]"),this._operator=new Zt(s.querySelector("[data-ref=operator]"),{vocabulary:this._vocabulary(),glyphs:te,labelFor:ae,interactive:()=>this._interactive(),onPick:()=>{this._syncBetween(),this._notifyChange()}}),this.operators=this.declared("operators"),null===this._operator.value&&this._showDefaultOperator(),ce(this,this._operator,{singular:"operator",plural:"operators",vocabulary:this._vocabulary(),fallback:this._defaultOperator()}),{...e,freeze:this._container,also:[this._value2]}}_showDefaultOperator(){this._showOperator(this._operator.preferring(this._defaultOperator()))}formResetCallback(){super.formResetCallback(),this.hasAttribute("value")||this._showDefaultOperator()}_type(){return"text"}_serialize(t){return t}_deserialize(t){return t}_defaultOperator(){return"EQ"}_vocabulary(){return ee}_declaredOperators;get operators(){return this._operator?this._operator.allowed:this._declaredOperators}set operators(t){null===this.declared("operator")&&(this._operator?(this._operator.allowed=t,this._syncBetween()):this._declaredOperators=Zt.narrow(t,this._vocabulary()))}get value(){return this._tuple()}set value(t){this._applyTuple(t)}_tuple(){const t=this._operator.value,e=this.#Is();return e.some(t=>""===t)?null:[t,...e.map(t=>this._serialize(t))]}_applyTuple(t){if(null==t)return this._value1.value="",void(this._value2.value="");const[e,...s]=t,r=this._operator.pinned?this._operator.allowed[0]:e;this._showOperator(r),this._value1.value=s[0]?this._deserialize(s[0]):s[0]??"",this._value2.value=s[1]?this._deserialize(s[1]):s[1]??""}_showOperator(t){this._operator.value=t,this._syncBetween()}_syncBetween(){this._value2.toggleAttribute("hidden","BETWEEN"!==this._operator.value)}get criterion(){return de(ue(this),this._operator.value,this.#Is())}#Is(){return"BETWEEN"===this._operator.value?[this._value1.value,this._value2.value]:[this._value1.value]}get disabled(){return super.disabled}set disabled(t){super.disabled=t;for(const e of this._choices())e.claimed=t}_choices(){return[this._operator].filter(t=>t)}}class pe extends he{_defaultOperator(){return"LTE"}_type(){return"datetime-local"}_serialize(t){return xt.localToIso(t)}_deserialize(t){return xt.isoToLocal(t)}}class fe extends he{_type(){return"date"}}class me extends he{_type(){return"number"}}class ge extends he{static observed=["sensitivities:csv"];static attributes=["sensitivity"];static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-affix>\n <button data-ref="operator" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n <button data-ref="sensitivity" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n </ful-affix>\n <ful-control>\n <input data-ref="value1" data-tpl-type="type" form="">\n <input data-ref="value2" data-tpl-type="type" form="" hidden>\n </ful-control>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_defaultOperator(){return"CONTAINS"}_vocabulary(){return se}_sensitivityButton;_build(t){const e=super._build(t);return this._sensitivityButton=new Zt(e.fragment.querySelector("[data-ref=sensitivity]"),{vocabulary:re,glyphs:ie,labelFor:oe,interactive:()=>this._interactive(),onPick:()=>this._notifyChange()}),this._sensitivityButton.allowed=null,this._sensitivityButton.value=re[0],ce(this,this._sensitivityButton,{singular:"sensitivity",plural:"sensitivities",vocabulary:re,fallback:"IGNORE_CASE"}),e}_choices(){return[...super._choices(),this._sensitivityButton].filter(t=>t)}get _sensitivity(){return this._sensitivityButton.value}_declaredSensitivities;get sensitivities(){return this._sensitivityButton?this._sensitivityButton.allowed:this._declaredSensitivities}set sensitivities(t){if(null!==this.declared("sensitivity"))return;if(!this._sensitivityButton)return void(this._declaredSensitivities=Zt.narrow(t,re));const e=this._sensitivityButton.value;this._sensitivityButton.allowed=t,this._sensitivityButton.value=this._sensitivityButton.preferring(e)}get value(){const t=this._tuple();return null==t?null:[t[0],this._sensitivity,...t.slice(1)]}set value(t){null!=t?(this._sensitivityButton.allowed.includes(t[1])&&(this._sensitivityButton.value=t[1]),this._applyTuple([t[0],...t.slice(2)])):this._applyTuple(t)}formResetCallback(){super.formResetCallback(),this.hasAttribute("value")||(this._sensitivityButton.value=this._sensitivityButton.preferring("IGNORE_CASE"))}}const be=["","true","false"],ve={true:"✓",false:"✗"};class ye extends ut{static observed=["value:json","operators:csv"];static slots=!0;static OPERATORS=["EQ","NEQ"];static DEFAULT_OPERATOR="EQ";static template='\n <label>{{{{ slots.default }}}}</label>\n {{{{ slots.info }}}}\n <ful-control-group>\n <ful-affix data-tpl-if="slots.before">{{{{ slots.before }}}}</ful-affix>\n <ful-affix>\n <button data-ref="operator" type="button" form="" aria-expanded="false" aria-haspopup="true"></button>\n <ul popover role="menu"></ul>\n </ful-affix>\n <button data-ref="value" type="button" form=""></button>\n <ul popover role="menu"></ul>\n <ful-affix data-tpl-if="slots.after">{{{{ slots.after }}}}</ful-affix>\n </ful-control-group>\n <ful-field-error></ful-field-error>\n ';_operator;_value;_container;_build({slots:t}){const e=this.template().withOverlay({slots:t}).render();this._container=e.querySelector("ful-control-group");const s=e.querySelector("[data-ref=value]");return this._operator=new Zt(e.querySelector("[data-ref=operator]"),{vocabulary:ye.OPERATORS,glyphs:te,labelFor:ae,interactive:()=>this._interactive(),onPick:()=>this._notifyChange()}),this._value=new Zt(s,{vocabulary:be,glyphs:ve,labelFor:le,display:le,interactive:()=>this._interactive(),onPick:()=>this._notifyChange()}),this.operators=this.declared("operators"),this._operator.value=this._operator.preferring(ye.DEFAULT_OPERATOR),this._value.allowed=null,this._value.value="",{fragment:e,control:s,error:e.querySelector("ful-field-error"),label:e.querySelector("label"),announces:null,freeze:this._container}}_declaredOperators;get operators(){return this._operator?this._operator.allowed:this._declaredOperators}set operators(t){this._operator?this._operator.allowed=t:this._declaredOperators=Zt.narrow(t,this._vocabulary())}_vocabulary(){return ye.OPERATORS}get value(){return""===this._value.value?null:[this._operator.value,this._value.value]}set value(t){null!=t?(this._operator.value=this._operator.pinned?this._operator.allowed[0]:t[0],this._value.value=t[1]??""):this._value.value=""}formResetCallback(){super.formResetCallback(),this.hasAttribute("value")||(this._operator.value=this._operator.preferring(ye.DEFAULT_OPERATOR))}get criterion(){const t=this._value.value;return de(ue(this),this._operator.value,[""===t?"":le(t)])}get disabled(){return super.disabled}set disabled(t){super.disabled=t;for(const e of[this._operator,this._value].filter(t=>t))e.claimed=t}}class we extends jt{static attributes=["operator"];#$s(){const t=super.value;return this.multiple?t:null==t?[]:[t]}get value(){const t=this.#$s();if(0===t.length)return null;const e=this.declared("operator");return e?[e,...t]:t}set value(t){const e=this.declared("operator");let s=null==t?[]:Array.isArray(t)?t:[t];e&&s[0]===e&&(s=s.slice(1)),super.value=this.multiple?s:s[0]??null}get criterion(){return de(ue(this),this.declared("operator"),[super.entry].flat().filter(t=>t).map(t=>t.label))}}class Ee extends S{static slots=!0;static attributes=["placement","icon","describes:presence"];static config={icon:"info-circle-fill"};static template='\n <span role="button" tabindex="0" class="ful-tip" data-ref="trigger" data-tpl-aria-label="#l10n:t(\'info.tooltip\')"><ful-icon data-tpl-name="icon ?? config.icon" aria-hidden="true"></ful-icon></span>\n <ful-note popover data-ref="content">{{{{ slots.default }}}}</ful-note>\n ';render({slots:t}){const e=this.template().withOverlay({slots:t,icon:this.declared("icon")}).render(),s=e.querySelector("[data-ref=trigger]"),r=e.querySelector("[data-ref=content]");Pt.wire(s,r,{prefix:"ful-tooltip",invoke:!0,expanded:!0,handPlace:!0}),r.setAttribute("placement",this.declared("placement")??"top"),this.replaceChildren(e),this.declared("describes")&&Ee.#ft(this,s,r)}static#ft(t,e,s){at(t)?.describedBy(s)?e.tabIndex=-1:console.warn("a ful-tooltip declares describes but stands in nothing that takes a description",t)}}class xe{#Bs=new WeakSet;#ut=new WeakMap;async request(t,e,s,r){const i=!this.#Bs.has(e),n={name:s,section:e,index:r,first:i},a=["section:requested",...null!=r?[`section:requested:#${r}`]:[],...s?[`section:requested:${s}`]:[]],o=[];for(const e of a){const s=new CustomEvent(e,{bubbles:!0,detail:n});t.dispatchEvent(s),o.push(...s.async?.promises??[])}if(0===o.length)return;this.#Bs.add(e);let l=this.#ut.get(e);l||(l=new nt,this.#ut.set(e,l));const u=l.take(),c=()=>!u.stale;e.querySelector(":scope > .ful-section-error")?.remove();const d=requestAnimationFrame(()=>{c()&&(e.toggleAttribute("loading",!0),e.setAttribute("aria-busy","true"))});try{return await Promise.all(o)}catch(t){throw c()&&this.#js(e,t),t}finally{cancelAnimationFrame(d),c()&&(e.toggleAttribute("loading",!1),e.removeAttribute("aria-busy"))}}#js(t,e){t.querySelector(":scope > .ful-section-error")?.remove();const s=document.createElement("div");s.className="ful-section-error",s.setAttribute("role","alert"),s.textContent=R.of().failure(e),t.prepend(s)}}class Ae{#Hs;#Ws;#Vs;#gs;#Us;#Gs=new xe;#Qs=new nt;constructor(t,e,s){this.#Hs=t,this.#Ws=e.querySelector("[data-ref=dialog]"),this.#Vs=e.querySelector(`[data-ref=${s}]`),this.#gs=e.querySelector("[data-ref=loading]"),this.#Us=e.querySelector("[data-ref=error]")}get dialog(){return this.#Ws}get section(){return this.#Vs}dismiss(t,e){this.#Hs.dispatchEvent(t)&&t.cancelable&&e()}onBackdrop(t){let e=!1;this.#Ws.addEventListener("mousedown",t=>{e=t.target===this.#Ws}),this.#Ws.addEventListener("click",s=>{e&&s.target===this.#Ws&&t()})}onSubmitted(t){this.#Vs.addEventListener("submit:success",e=>{e.target===h.queryChildren(this.#Vs,"ful-form")&&t(e.detail.response)})}restChrome(){this.#Us?.replaceChildren(),this.#Us?.setAttribute("hidden",""),this.#gs?.setAttribute("hidden",""),this.#Vs?.removeAttribute("hidden")}request(){return this.#Gs.request(this.#Hs,this.#Vs,null,null).catch(()=>{})}async update(t,e){const s=this.#Qs.take();this.#Vs.replaceChildren(),this.restChrome(),this.#gs?.removeAttribute("hidden"),this.#Vs.setAttribute("hidden",""),e();try{const e=await t();return s.stale||(this.#Vs.replaceChildren(e),this.#gs?.setAttribute("hidden",""),this.#Vs.removeAttribute("hidden")),this.#Vs}catch(t){throw s.stale||(this.#Us?.removeAttribute("hidden"),this.#Us&&(this.#Us.textContent=R.of().failure(t)),this.#gs?.setAttribute("hidden",""),this.#Vs.setAttribute("hidden","")),t}}}let Se=!1;const Te=()=>{Se||(Se=!0,document.addEventListener("click",t=>{const e=t.target.closest?.("[dialog-target]");e&&document.getElementById(e.getAttribute("dialog-target"))?.open?.()}))};class Ce extends S{static attributes=["header","requires-answer:presence","close-on-submit:presence"];static slots=!0;static template='\n <dialog data-ref="dialog" class="ful-dialog">\n <header data-tpl-if="header || slots.header || !requiresAnswer" class="ful-dialog-header">\n {{{{ slots.header }}}}\n <h2 data-tpl-if="header">{{ header }}</h2>\n <button data-tpl-if="!requiresAnswer" type="button" data-ref="close" data-tpl-aria-label="#l10n:t(\'dialog.close\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button>\n </header>\n <section data-ref="loading" hidden><ful-spinner class="centered" role="status"><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner></section>\n <section data-ref="error" role="alert" hidden></section>\n <div data-ref="body" class="ful-dialog-body">{{{{ slots.default }}}}</div>\n <footer class="ful-dialog-footer">\n <button type="button" data-ref="acknowledge" data-result="acknowledged" data-tpl-if="!slots.buttons && !closeOnSubmit" data-tpl-aria-label="#l10n:t(\'dialog.acknowledge\')">{{ #l10n:t(\'dialog.acknowledge\') }}</button>\n {{{{ slots.buttons }}}}\n </footer>\n </dialog>\n ';#Ws;#Ks;#Js=[];#Xs=null;render({slots:t}){const e=this.declared("requires-answer"),s=this.declared("close-on-submit"),r=this.template().withOverlay({slots:t,header:this.declared("header")??"",requiresAnswer:e,closeOnSubmit:s}).render();this.#Ks=new Ae(this,r,"body"),this.#Ws=this.#Ks.dialog;const i=r.querySelector("h2");i&&(i.id||=c.uid("ful-dialog-title"),this.#Ws.setAttribute("aria-labelledby",i.id)),this.#Ws.addEventListener("close",()=>{const t=this.#Ys();this.dispatchEvent(new CustomEvent("close",{detail:t})),this.#Zs(t)}),this.#Ws.addEventListener("click",t=>{const e=t.target.closest("button[data-result]")?.dataset.result;void 0!==e&&this.#Ws.close(e)});const n=(t,e=!1)=>this.#Ks.dismiss(new CustomEvent("dialog:dismiss",{cancelable:!e,detail:{reason:t}}),()=>this.#Ws.close(""));e||this.#Ks.onBackdrop(()=>n("backdrop")),r.querySelector("[data-ref=close]")?.addEventListener("click",()=>n("button")),s&&this.#Ks.onSubmitted(t=>{this.#Xs={dismissed:!1,result:null,response:t},this.#Ws.close("submitted")}),this.#Ws.addEventListener("cancel",t=>{if(!t.cancelable)return this.#Ws.returnValue="",void n("escape",!0);t.preventDefault(),e||n("escape")}),this.replaceChildren(r),Te()}#Ys(){if(this.#Xs)return this.#Xs;const t=this.#Ws?.returnValue??"";return""===t?{dismissed:!0,result:null,response:null}:{dismissed:!1,result:t,response:null}}#Zs(t){const e=this.#Js;this.#Js=[];for(const s of e)s(t)}disconnectedCallback(){this.#Zs(this.#Ys())}open(){return this.ask()}ask(){return this.#tr()&&(this.#Ks.restChrome(),this.#Ks.request()),new Promise(t=>{this.#Js.push(t)})}async update(t){return await this.#Ks.update(t,()=>this.#tr())}refresh(){return this.#Ks.request()}close(t){this.#Ws.close(t??"")}#tr(){return!this.#Ws.open&&(this.#Ws.returnValue="",this.#Xs=null,this.#Ws.showModal(),!0)}static async ask(t,e,s=[],{className:r}={}){const i=document.createElement("ful-dialog");if(i.setAttribute("header",t),r&&(i.className=r),"string"==typeof e?i.textContent=e:e&&i.append(e),s.length>0){const t=document.createElement("template");t.setAttribute("slot","buttons");for(const e of s){if(e instanceof Node){t.content.append(e);continue}const[s,r,i]=e,n=document.createElement("button");n.type="button",n.dataset.result=s,i&&(n.className=i),n.textContent=r,t.content.append(n)}i.append(t)}document.body.append(i);try{return await A.waitFor(i),await i.ask()}finally{i.remove()}}static async confirm(t,e,s={},r={}){const i=await Ce.ask(t,e,[["cancel",s.cancel??R.of().t("dialog.cancel")],["confirm",s.confirm??R.of().t("dialog.confirm"),"ful-button"]],r);return!i.dismissed&&"confirm"===i.result}}class _e extends S{static attributes=["header","placement","close-on-submit:presence"];static slots=!0;static template='\n <dialog data-ref="dialog" class="ful-drawer">\n <header>\n {{{{ slots.header }}}}\n <h2 data-ref="title">{{ title }}</h2>\n <button type="button" data-ref="close" data-tpl-aria-label="#l10n:t(\'drawer.close\')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button>\n </header>\n <section data-ref="loading" hidden><ful-spinner class="centered" role="status"><span class="ful-sr-only">{{ #l10n:t(\'spinner.loading\') }}</span></ful-spinner></section>\n <section data-ref="error" role="alert" hidden></section>\n <section data-ref="content">{{{{ slots.default }}}}</section>\n </dialog>\n ';#Ws;#er;#Ks;#Xs=null;#sr=!1;#rr=t=>{t.target===this.#Ws&&this.#ir()};render({slots:t}){const e=this.template().withOverlay({slots:t,title:this.declared("header")??""}).render();this.#Ks=new Ae(this,e,"content"),this.#Ws=this.#Ks.dialog,this.#er=e.querySelector("[data-ref=title]"),this.#er.id||=c.uid("ful-drawer-title"),this.#Ws.setAttribute("aria-labelledby",this.#er.id);const s=this.declared("placement");s&&this.#Ws.setAttribute("placement",s);const r=(t,e=!1)=>this.#Ks.dismiss(new CustomEvent("drawer:dismiss",{cancelable:!e,detail:{reason:t}}),()=>this.close());e.querySelector("[data-ref=close]").addEventListener("click",()=>r("button")),this.#Ks.onBackdrop(()=>r("backdrop")),this.#Ws.addEventListener("cancel",t=>{if(!t.cancelable)return this.#nr(),void r("escape",!0);t.preventDefault(),r("escape")}),this.#Ws.addEventListener("close",()=>{this.dispatchEvent(new CustomEvent("close",{detail:this.#Xs??{dismissed:!0,response:null}}))}),this.declared("close-on-submit")&&this.#Ks.onSubmitted(t=>{this.#Xs={dismissed:!1,response:t},this.close()}),this.replaceChildren(e),Te()}get header(){return this.#er.textContent}set header(t){this.#er.textContent=t??""}async update(t,e){return this.header=t,await this.#Ks.update(e,()=>this.#tr())}refresh(){return this.#Ks.request()}open(){this.#tr()&&(this.#Ks.restChrome(),this.#Ks.request())}close(){!this.#sr&&this.#Ws.open&&(matchMedia("(prefers-reduced-motion: reduce)").matches?this.#Ws.close():(this.#Ws.setAttribute("closing",""),0!==this.#Ws.getAnimations().length?(this.#sr=!0,this.#Ws.addEventListener("animationend",this.#rr)):this.#ir()))}#ir(){this.#nr(),this.#Ws.close()}#nr(){this.#sr=!1,this.#Ws.removeEventListener("animationend",this.#rr),this.#Ws.removeAttribute("closing")}#tr(){return this.#nr(),!this.#Ws.open&&(this.#Xs=null,this.#Ws.showModal(),!0)}}class Oe extends S{static attributes=["for"];render(){const t=this.declared("for"),e=t?document.getElementById(t):null;if(!e)throw new Error(`ful-menu names no invoker: for="${t??""}" must name an element already in the page when the menu upgrades`);this.setAttribute("role","menu"),this.hasAttribute("popover")||this.setAttribute("popover",""),e.setAttribute("aria-haspopup","menu"),Pt.wire(e,this,{prefix:"ful-menu",invoke:!0,expanded:!0}),Yt(e,this,{items:()=>this.items}),this.#zs(),this.addEventListener("click",t=>{const e=t.target;this.items.some(t=>t===e||t.contains(e))&&this.hidePopover()})}get items(){return this.#zs().filter(t=>!t.hasAttribute("disabled")&&!t.hasAttribute("hidden"))}#zs(){const t=[...this.querySelectorAll(":scope > button, :scope > a[href]")];for(const e of t)e.hasAttribute("role")||e.setAttribute("role","menuitem"),e.tabIndex=-1;return t}}const ke=["info","success","warning","error"],qe=new Set;let Le=!1;class Re extends S{static attributes=["timeout:number"];#ar;connectedCallback(){super.connectedCallback(),this.rendered&&qe.add(this)}disconnectedCallback(){qe.delete(this)}render(){this.#ar=this.declared("timeout")||5e3,this.setAttribute("role","region"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-label",R.of().t("toast.region")),this.setAttribute("popover","manual"),Le||(Le=!0,document.addEventListener("show-toast",t=>{if(t.detail)for(const e of qe)e.show(t.detail.message,t.detail)})),qe.add(this)}show(t,e={}){const s=ke.includes(e.severity)?e.severity:"info",r=document.createElement("ful-toast");r.classList.add(s),r.setAttribute("role","error"===s?"alert":"status");const i=document.createElement("div");i.textContent=R.of().failure(t);const n=document.createElement("button");n.type="button",n.setAttribute("aria-label",R.of().t("toast.dismiss"));const a=document.createElement("ful-icon");a.setAttribute("name","x-lg"),a.setAttribute("aria-hidden","true"),n.append(a),r.append(i);let o=e.timeout??this.#ar,l=performance.now(),u=0;const c=()=>{clearTimeout(u),r.contains(document.activeElement)&&this.focus(),matchMedia("(prefers-reduced-motion: reduce)").matches?r.remove():(r.classList.add("ful-toast-out"),0===r.getAnimations().length&&r.remove())};if(e.action?.label){const t=document.createElement("button");t.type="button",t.className="ful-toast-action",t.textContent=String(e.action.label),t.addEventListener("click",()=>{e.action.onClick?.(),c()}),r.append(t)}r.append(n),r.addEventListener("animationend",()=>{r.classList.contains("ful-toast-out")&&r.remove()});let d=0;const h=()=>{0===d&&(clearTimeout(u),o=Math.max(0,o-(performance.now()-l))),++d},p=()=>{0!==d&&0===--d&&(l=performance.now(),u=setTimeout(c,o))};return r.addEventListener("mouseenter",h),r.addEventListener("mouseleave",p),r.addEventListener("focusin",h),r.addEventListener("focusout",p),n.addEventListener("click",c),this.append(r),this.#or(),u=setTimeout(c,o),r}#or(){this.isConnected&&(this.matches(":popover-open")&&this.hidePopover(),this.showPopover())}}class Ne extends S{static slots=!0;static observed=["active:number"];static template='\n <ful-tablist role="tablist">{{{{ slots.tabs }}}}</ful-tablist>\n {{{{ slots.default }}}}\n ';#lr;#ur=[];#cr=[];#Gs=new xe;#dr=0;render({slots:t}){const e=this.template().withOverlay({slots:t}).render();this.#lr=e.querySelector("ful-tablist");const s=[...this.#lr.children];this.#cr=[...e.children].filter(t=>t!==this.#lr),s.length!==this.#cr.length&&console.warn(`ful-tabs: ${s.length} tabs declared for ${this.#cr.length} panels, the surplus is left alone`);const r=Math.min(s.length,this.#cr.length);this.#ur=[];for(let t=0;t!==r;++t){const e=this.#cr[t],r=document.createElement("button");r.type="button",r.role="tab",r.id=c.uid("ful-tab"),e.id||(e.id=c.uid("ful-tabpanel")),r.setAttribute("aria-controls",e.id),e.role="tabpanel",e.setAttribute("aria-labelledby",r.id),e.tabIndex=0,r.append(...s[t].childNodes),r.addEventListener("click",()=>{this.active=t}),s[t].replaceWith(r),this.#ur.push(r)}this.#lr.addEventListener("keydown",t=>{const e=this.#dr;let s=null;"ArrowRight"===t.key?s=(e+1)%this.#ur.length:"ArrowLeft"===t.key?s=(e-1+this.#ur.length)%this.#ur.length:"Home"===t.key?s=0:"End"===t.key&&(s=this.#ur.length-1),null!==s&&s!==e&&(t.preventDefault(),this.active=s,this.#ur[s].focus())}),this.replaceChildren(e)}get active(){return this.#dr}refresh(t){const e=t instanceof Element?this.#cr.indexOf(t):Number.isInteger(t)?t:NaN,s=this.#cr[e];if(s)return this.#Gs.request(this,s,null,e).catch(()=>{});console.warn(`ful-tabs: no panel answers to "${t}"`)}set active(t){const e=Math.min(Math.max(0,Number(t)||0),Math.max(0,this.#ur.length-1)),s=this.#dr;for(const[t,s]of this.#ur.entries())s.setAttribute("aria-selected",t===e?"true":"false"),s.tabIndex=t===e?0:-1,this.#cr[t].hidden=t!==e;this.#dr=e,this.reflectTo("active",e),this.rendered&&e!==s&&this.dispatchEvent(new CustomEvent("tabs:change",{detail:{active:e,previous:s}})),this.#cr.length>0&&(e!==s||!this.rendered)&&this.#Gs.request(this,this.#cr[e],null,e).catch(()=>{})}}class Pe extends S{static slots=!0;static observed=["exclusive:presence"];static template="\n <ful-accordion-group>{{{{ slots.default }}}}</ful-accordion-group>\n ";#Zt;#hr=!1;render({slots:t}){const e=this.template().withOverlay({slots:t}).render();this.#Zt=e.querySelector("ful-accordion-group"),this.replaceChildren(e)}get exclusive(){return this.#hr}set exclusive(t){this.#hr=!0===t,this.reflectTo("exclusive",this.#hr);const e=this.#hr?c.uid("ful-accordion"):null;for(const t of this.#Zt.querySelectorAll(":scope > details"))null===e?t.removeAttribute("name"):t.setAttribute("name",e)}}class Me extends S{static slots=!0;static observed=["progress"];static template="\n <ful-steps><ol data-tpl-aria-label=\"#l10n:t('wizard.progress')\">{{{{ slots.steps }}}}</ol></ful-steps>\n {{{{ slots.default }}}}\n ";#pr=[];#Ks=[];#Gs=new xe;#fr=0;#mr;render({slots:t}){const e=this.template().withOverlay({slots:t}).render(),s=[...e.querySelector("ful-steps ol").children];this.#Ks=[...e.children].filter(t=>"ful-steps"!==t.localName),s.length!==this.#Ks.length&&console.warn(`ful-wizard: ${s.length} steps declared for ${this.#Ks.length} sections, the surplus is left alone`);const r=Math.min(s.length,this.#Ks.length);this.#pr=[];for(let t=0;t!==r;++t){const e=document.createElement("li");e.append(...s[t].childNodes),s[t].replaceWith(e),this.#pr.push(e),this.#Ks[t].tabIndex=-1}if(this.replaceChildren(e),r>0){const t=this.#Ks.findIndex(t=>"step"===t.getAttribute("aria-current"));this.#gr(-1===t?0:Math.min(t,r-1)),this.#br(this.#fr).catch(()=>{})}}get index(){return this.#fr}get step(){return this.#Ks[this.#fr]?.getAttribute("data-step")??null}get progress(){return this.#mr}set progress(t){this.#mr=t,this.reflectTo("progress",t)}next(){return this.#vr(this.#fr+1)}prev(){return this.#vr(this.#fr-1)}move(t){const e=this.#Ks.findIndex(e=>e.getAttribute("data-step")===t);if(-1!==e)return this.#vr(e);console.warn(`ful-wizard: no section carries data-step="${t}"`)}refresh(t){const e=t instanceof Element?t:"string"==typeof t?this.#Ks.find(e=>e.getAttribute("data-step")===t):void 0,s=this.#Ks.indexOf(e);if(-1!==s)return this.#br(s).catch(()=>{});console.warn(`ful-wizard: no section answers to "${t}"`)}#br(t){return this.#Gs.request(this,this.#Ks[t],this.#Ks[t].getAttribute("data-step"),t)}#vr(t){const e=Math.min(Math.max(0,t),Math.max(0,this.#pr.length-1));if(e!==this.#fr)return this.#gr(e),this.#Ks[this.#fr].focus(),this.rendered&&this.dispatchEvent(new CustomEvent("wizard:change",{detail:{index:this.#fr,step:this.step}})),this.#br(e)}#gr(t){for(const[e,s]of this.#pr.entries())e===t?(s.setAttribute("aria-current","step"),this.#Ks[e].setAttribute("aria-current","step")):(s.removeAttribute("aria-current"),this.#Ks[e].removeAttribute("aria-current"));this.#fr=t}}const Fe={en:{"pagination.showing":"Page {current} of {total}","pagination.navigation":"Page navigation","pagination.previous":"Previous","pagination.next":"Next","pagination.reload":"Reload","table.initial":"Start searching to see results.","table.error":"Error while loading data:","table.no-data":"No elements found.","dropdown.empty":"No results","select.remove":"Remove","files.dropzone-label":"Click or drop your files here","files.remove":"Remove","files.unacceptable-file-type":"Only files of type {types} are supported","files.max-file-size-exceeded":"Maximum supported file size is {size}","files.max-total-size-exceeded":"Maximum supported total file size is {size}","files.max-files-exceeded":{one:"Maximum of {count} file exceeded",other:"Maximum of {count} files exceeded"},"filters.op.EQ":"Equals","filters.op.NEQ":"Not equal","filters.op.LT":"Less than","filters.op.GT":"Greater than","filters.op.LTE":"At most","filters.op.GTE":"At least","filters.op.BETWEEN":"Between","filters.op.CONTAINS":"Contains","filters.op.STARTS_WITH":"Starts with","filters.op.ENDS_WITH":"Ends with","filters.sensitivity.IGNORE_CASE":"Ignore case","filters.sensitivity.CASE_SENSITIVE":"Case sensitive","filters.boolean.any":"Any","filters.boolean.true":"Yes","filters.boolean.false":"No","info.tooltip":"More information","failure.no-reason":"Something went wrong","dialog.acknowledge":"Got it","dialog.close":"Close","dialog.confirm":"Confirm","dialog.cancel":"Cancel","drawer.close":"Close","spinner.loading":"Loading…","toast.region":"Notifications","toast.dismiss":"Dismiss","wizard.progress":"Progress"},it:{"pagination.showing":"Pagina {current} di {total}","pagination.navigation":"Navigazione pagine","pagination.previous":"Precedente","pagination.next":"Successivo","pagination.reload":"Ricarica","table.initial":"Avvia la ricerca per visualizzare i risultati.","table.error":"Errore nel caricamento dei dati:","table.no-data":"Nessun elemento trovato.","dropdown.empty":"Nessun risultato","select.remove":"Rimuovi","files.dropzone-label":"Clicca o trascina i file qui","files.remove":"Rimuovi","files.unacceptable-file-type":"Solo i file di tipo {types} sono supportati","files.max-file-size-exceeded":"La dimensione massima di un file è di {size}","files.max-total-size-exceeded":"La dimensione massima complessiva dei file è di {size}","files.max-files-exceeded":{other:"Superato il numero massimo di {count} file"},"filters.op.EQ":"Uguale","filters.op.NEQ":"Diverso","filters.op.LT":"Minore","filters.op.GT":"Maggiore","filters.op.LTE":"Al massimo","filters.op.GTE":"Almeno","filters.op.BETWEEN":"Tra","filters.op.CONTAINS":"Contiene","filters.op.STARTS_WITH":"Inizia con","filters.op.ENDS_WITH":"Termina con","filters.sensitivity.IGNORE_CASE":"Ignora maiuscole","filters.sensitivity.CASE_SENSITIVE":"Distingui maiuscole","filters.boolean.any":"Qualsiasi","filters.boolean.true":"Sì","filters.boolean.false":"No","info.tooltip":"Maggiori informazioni","failure.no-reason":"Si è verificato un errore","dialog.acknowledge":"Ho capito","dialog.close":"Chiudi","dialog.confirm":"Conferma","dialog.cancel":"Annulla","drawer.close":"Chiudi","spinner.loading":"Caricamento…","toast.region":"Notifiche","toast.dismiss":"Chiudi","wizard.progress":"Avanzamento"},es:{"pagination.showing":"Página {current} de {total}","pagination.navigation":"Navegación de páginas","pagination.previous":"Anterior","pagination.next":"Siguiente","pagination.reload":"Recargar","table.initial":"Inicia la búsqueda para ver los resultados.","table.error":"Error al cargar los datos:","table.no-data":"No se encontraron elementos.","dropdown.empty":"Sin resultados","select.remove":"Eliminar","files.dropzone-label":"Haz clic o arrastra tus archivos aquí","files.remove":"Eliminar","files.unacceptable-file-type":"Solo se admiten archivos de tipo {types}","files.max-file-size-exceeded":"El tamaño máximo de archivo admitido es {size}","files.max-total-size-exceeded":"El tamaño total máximo admitido es {size}","files.max-files-exceeded":{one:"Se ha superado el número máximo de {count} archivo",other:"Se ha superado el número máximo de {count} archivos"},"filters.op.EQ":"Igual","filters.op.NEQ":"Distinto","filters.op.LT":"Menor","filters.op.GT":"Mayor","filters.op.LTE":"Como máximo","filters.op.GTE":"Al menos","filters.op.BETWEEN":"Entre","filters.op.CONTAINS":"Contiene","filters.op.STARTS_WITH":"Empieza por","filters.op.ENDS_WITH":"Termina por","filters.sensitivity.IGNORE_CASE":"Ignorar mayúsculas","filters.sensitivity.CASE_SENSITIVE":"Distinguir mayúsculas","filters.boolean.any":"Cualquiera","filters.boolean.true":"Sí","filters.boolean.false":"No","info.tooltip":"Más información","failure.no-reason":"Se ha producido un error","dialog.acknowledge":"Entendido","dialog.close":"Cerrar","dialog.confirm":"Confirmar","dialog.cancel":"Cancelar","drawer.close":"Cerrar","spinner.loading":"Cargando…","toast.region":"Notificaciones","toast.dismiss":"Cerrar","wizard.progress":"Progreso"},fr:{"pagination.showing":"Page {current} sur {total}","pagination.navigation":"Navigation des pages","pagination.previous":"Précédent","pagination.next":"Suivant","pagination.reload":"Recharger","table.initial":"Lancez la recherche pour voir les résultats.","table.error":"Erreur lors du chargement des données :","table.no-data":"Aucun élément trouvé.","dropdown.empty":"Aucun résultat","select.remove":"Retirer","files.dropzone-label":"Cliquez ou déposez vos fichiers ici","files.remove":"Retirer","files.unacceptable-file-type":"Seuls les fichiers de type {types} sont pris en charge","files.max-file-size-exceeded":"La taille maximale de fichier prise en charge est {size}","files.max-total-size-exceeded":"La taille totale maximale prise en charge est {size}","files.max-files-exceeded":{one:"Nombre maximal de {count} fichier dépassé",other:"Nombre maximal de {count} fichiers dépassé"},"filters.op.EQ":"Égal","filters.op.NEQ":"Différent","filters.op.LT":"Inférieur","filters.op.GT":"Supérieur","filters.op.LTE":"Au plus","filters.op.GTE":"Au moins","filters.op.BETWEEN":"Entre","filters.op.CONTAINS":"Contient","filters.op.STARTS_WITH":"Commence par","filters.op.ENDS_WITH":"Finit par","filters.sensitivity.IGNORE_CASE":"Ignorer la casse","filters.sensitivity.CASE_SENSITIVE":"Respecter la casse","filters.boolean.any":"Indifférent","filters.boolean.true":"Oui","filters.boolean.false":"Non","info.tooltip":"Plus d’informations","failure.no-reason":"Une erreur s'est produite","dialog.acknowledge":"J’ai compris","dialog.close":"Fermer","dialog.confirm":"Confirmer","dialog.cancel":"Annuler","drawer.close":"Fermer","spinner.loading":"Chargement…","toast.region":"Notifications","toast.dismiss":"Fermer","wizard.progress":"Progression"}};class De{#yr;#wr;#Er;constructor(t={}){this.#yr=t.language??navigator?.language??"en",this.#wr=t.translations??{},this.#Er=t.httpClient??null}configure(t){const e=this.#Er??V.builder().withCsrfToken().withRedirectOnUnauthorized("/").build(),s=this.#yr.split("-")[0].toLowerCase(),r={...Fe.en,...Fe[s],...this.#wr};t.defineModule("l10n",R).defineComponent("http-client",e).defineElement("ful-tooltip",Ee).defineElement("ful-dialog",Ce).defineElement("ful-drawer",_e).defineElement("ful-menu",Oe).defineElement("ful-toasts",Re).defineElement("ful-tabs",Ne).defineElement("ful-accordion",Pe).defineElement("ful-wizard",Me).defineElement("ful-form",pt).defineElement("ful-checkbox",Wt).defineElement("ful-input",yt).defineElement("ful-input-file",Ct).defineElement("ful-local-date",Et).defineElement("ful-instant",xt).defineElement("ful-input-local-date",At).defineElement("ful-input-local-time",St).defineElement("ful-input-instant",Tt).defineElement("ful-radio-group",Ht).defineElement("ful-table",Xt).defineElement("ful-pagination",Ut).defineElement("ful-sorter",Vt).defineElement("ful-filter-instant",pe).defineElement("ful-filter-local-date",fe).defineElement("ful-filter-number",me).defineElement("ful-filter-boolean",ye).defineElement("ful-filter-text",ge).defineElement("ful-filter-in",we).defineElement("ful-select",jt).defineElement("ful-dropdown",Bt).defineComponent("loaders:select",$t).defineComponent("loaders:form",ht).defineComponent("loaders:table",Jt).defineOverlay({l10n:r,locale:this.#yr})}}var ze=Object.freeze({__proto__:null,Accordion:Pe,Anchors:Pt,AsyncEvents:rt,Bindings:lt,BooleanFilter:ye,Checkbox:Wt,Claims:nt,CompareFilter:he,Dialog:Ce,Drawer:_e,Dropdown:Bt,Field:ut,Form:pt,FormLoader:ht,InFilter:we,Input:yt,InputFile:Ct,InputInstant:Tt,InputLocalDate:At,InputLocalTime:St,Instant:xt,InstantFilter:pe,LocalDate:Et,LocalDateFilter:fe,LocalStorage:Z,Menu:Oe,NumberFilter:me,PageLeave:it,Pagination:Ut,Plugin:De,RadioGroup:Ht,Select:jt,SelectLoader:$t,SessionStorage:tt,SortButton:Vt,Table:Xt,TableLoader:Jt,TableSchemaParser:Gt,Tabs:Ne,TextFilter:ge,Timing:ot,Toasts:Re,Tooltip:Ee,VersionedLocalStorage:et,VersionedSessionStorage:st,Wizard:Me,describable:at});return"undefined"!=typeof window&&(window.ftl=N,window.httpc=J,window.ful=ze),t.Accordion=Pe,t.Anchors=Pt,t.AsyncEvents=rt,t.Attributes=c,t.Base64=M,t.Bindings=lt,t.BooleanFilter=ye,t.BoundedCache=e,t.Checkbox=Wt,t.Claims=nt,t.CompareFilter=he,t.Dialog=Ce,t.Drawer=_e,t.Dropdown=Bt,t.ExpressionEvaluator=l,t.Expressions=o,t.Failure=P,t.Field=ut,t.Form=pt,t.FormLoader=ht,t.Fragments=u,t.Hex=F,t.HttpClient=V,t.HttpClientBuilder=j,t.HttpClientError=z,t.HttpInterceptorChain=W,t.HttpMultipartRequestCustomizer=K,t.HttpRequestBuilder=Q,t.InFilter=we,t.Input=yt,t.InputFile=Ct,t.InputInstant=Tt,t.InputLocalDate=At,t.InputLocalTime=St,t.Instant=xt,t.InstantFilter=pe,t.LightSlots=d,t.LocalDate=Et,t.LocalDateFilter=fe,t.LocalStorage=Z,t.Localization=R,t.MediaType=D,t.Menu=Oe,t.Nodes=h,t.NumberFilter=me,t.PageLeave=it,t.Pagination=Ut,t.ParsedElement=S,t.Plugin=De,t.RadioGroup=Ht,t.Registry=w,t.RenderError=v,t.Rendering=A,t.Select=jt,t.SelectLoader=$t,t.SessionStorage=tt,t.SortButton=Vt,t.Table=Xt,t.TableLoader=Jt,t.TableSchemaParser=Gt,t.Tabs=Ne,t.Template=b,t.Templates=x,t.TextFilter=ge,t.Timing=ot,t.Toasts=Re,t.Tooltip=Ee,t.VersionedLocalStorage=et,t.VersionedSessionStorage=st,t.Wizard=Me,t.describable=at,t.registry=E,t}({});
|
|
2
2
|
//# sourceMappingURL=fml.iife.min.js.map
|