From ab9f385db8afdf94769e400a9b121fff7db3b16d Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Fri, 16 Oct 2026 20:35:13 +0200 Subject: [PATCH] chore(quick-261016-s8x): rebuild embedded admin dist --- .../dist/assets/{editor-CAfF7dSg.js => editor-b0KknApp.js} | 2 +- .../dist/assets/{index-DhO7DrQh.js => index-DzKf4ihI.js} | 2 +- modules/boardwalk/dist/assets/index-GIpW_WLy.css | 1 + modules/boardwalk/dist/assets/index-e1TjFTR3.css | 1 - modules/boardwalk/dist/index.html | 4 ++-- 5 files changed, 5 insertions(+), 5 deletions(-) rename modules/boardwalk/dist/assets/{editor-CAfF7dSg.js => editor-b0KknApp.js} (99%) rename modules/boardwalk/dist/assets/{index-DhO7DrQh.js => index-DzKf4ihI.js} (99%) create mode 100644 modules/boardwalk/dist/assets/index-GIpW_WLy.css delete mode 100644 modules/boardwalk/dist/assets/index-e1TjFTR3.css diff --git a/modules/boardwalk/dist/assets/editor-CAfF7dSg.js b/modules/boardwalk/dist/assets/editor-b0KknApp.js similarity index 99% rename from modules/boardwalk/dist/assets/editor-CAfF7dSg.js rename to modules/boardwalk/dist/assets/editor-b0KknApp.js index 1fe4c21..11d78f1 100644 --- a/modules/boardwalk/dist/assets/editor-CAfF7dSg.js +++ b/modules/boardwalk/dist/assets/editor-b0KknApp.js @@ -1,4 +1,4 @@ -import{L as mu,i as gu}from"./index-DhO7DrQh.js";var Vs=Object.defineProperty,yu=(n,e)=>{let t={};for(var r in n)Vs(t,r,{get:n[r],enumerable:!0});return Vs(t,Symbol.toStringTag,{value:"Module"}),t};function Q(n){this.content=n}Q.prototype={constructor:Q,find:function(n){for(var e=0;e>1}};Q.from=function(n){if(n instanceof Q)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Q(e)};function Cl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)t++;return a&&a0&&f>0&&c[d-1]==u[f-1];)d--,f--,t--,r--;return d&&f&&d=56320&&n<57344}function El(n){return n>=55296&&n<56320}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;re&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);se)for(let s=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),i+=l.nodeSize),o=a}return new k(r,i)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),s=r+i.nodeSize;if(s>=e)return s==e?Rn(t+1,s):Rn(t,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return k.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-i.type.rank),t}};B.none=[];class gn extends Error{}class w{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Al(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new w(r,this.openStart,this.openEnd)}removeBetween(e,t){return new w(vl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return w.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new w(k.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new w(e,r,i)}}w.empty=new w(k.empty,0,0);function vl(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(i==e||s.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(vl(s.content,e-i-1,t-i-1)))}function Al(n,e,t,r,i,s){let{index:o,offset:l}=n.findIndex(e),a=n.maybeChild(o);if(l==e||a.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=Al(a.content,e-l-1,t,o==0?r-1:0,o==n.childCount-1?i-1:0,a);return c&&n.replaceChild(o,a.copy(c))}function ku(n,e,t){if(t.openStart>n.depth)throw new gn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new gn("Inconsistent open depths");return Ol(n,e,t,0)}function Ol(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function nn(n,e,t,r){let i=(e||n).node(t),s=0,o=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(mt(n.nodeAfter,r),s++));for(let l=s;li&&Ai(n,e,i+1),o=r.depth>i&&Ai(t,r,i+1),l=[];return nn(null,n,i,l),s&&o&&e.index(i)==t.index(i)?(Nl(s,o),mt(gt(s,Dl(n,e,t,r,i+1)),l)):(s&&mt(gt(s,Qn(n,e,i+1)),l),nn(e,t,i,l),o&&mt(gt(o,Qn(t,r,i+1)),l)),nn(r,null,i,l),new k(l)}function Qn(n,e,t){let r=[];if(nn(null,n,t,r),n.depth>t){let i=Ai(n,e,t+1);mt(gt(i,Qn(n,e,t+1)),r)}return nn(e,null,t,r),new k(r)}function bu(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(k.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class yn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Zn(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(r.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new yn(t,r,s)}static resolveCached(e,t){let r=Hs.get(e);if(r)for(let s=0;se&&this.nodesBetween(e,t,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Il(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=k.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};yt.prototype.text=void 0;class er extends yt{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Il(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new er(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new er(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Il(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function js(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${r}`);for(let i in n)n[i].validate&&n[i].validate(e[i])}class xt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Cu(e,t);if(r.next==null)return xt.empty;let i=Rl(r);r.next&&r.err("Unexpected trailing text");let s=Nu(Ou(i));return Du(s,r),s}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(r.next[o].next);return s}).join(` +import{L as mu,i as gu}from"./index-DzKf4ihI.js";var Vs=Object.defineProperty,yu=(n,e)=>{let t={};for(var r in n)Vs(t,r,{get:n[r],enumerable:!0});return Vs(t,Symbol.toStringTag,{value:"Module"}),t};function Q(n){this.content=n}Q.prototype={constructor:Q,find:function(n){for(var e=0;e>1}};Q.from=function(n){if(n instanceof Q)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Q(e)};function Cl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)t++;return a&&a0&&f>0&&c[d-1]==u[f-1];)d--,f--,t--,r--;return d&&f&&d=56320&&n<57344}function El(n){return n>=55296&&n<56320}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;re&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);se)for(let s=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),i+=l.nodeSize),o=a}return new k(r,i)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),s=r+i.nodeSize;if(s>=e)return s==e?Rn(t+1,s):Rn(t,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return k.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-i.type.rank),t}};B.none=[];class gn extends Error{}class w{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Al(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new w(r,this.openStart,this.openEnd)}removeBetween(e,t){return new w(vl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return w.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new w(k.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new w(e,r,i)}}w.empty=new w(k.empty,0,0);function vl(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(i==e||s.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(vl(s.content,e-i-1,t-i-1)))}function Al(n,e,t,r,i,s){let{index:o,offset:l}=n.findIndex(e),a=n.maybeChild(o);if(l==e||a.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=Al(a.content,e-l-1,t,o==0?r-1:0,o==n.childCount-1?i-1:0,a);return c&&n.replaceChild(o,a.copy(c))}function ku(n,e,t){if(t.openStart>n.depth)throw new gn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new gn("Inconsistent open depths");return Ol(n,e,t,0)}function Ol(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function nn(n,e,t,r){let i=(e||n).node(t),s=0,o=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(mt(n.nodeAfter,r),s++));for(let l=s;li&&Ai(n,e,i+1),o=r.depth>i&&Ai(t,r,i+1),l=[];return nn(null,n,i,l),s&&o&&e.index(i)==t.index(i)?(Nl(s,o),mt(gt(s,Dl(n,e,t,r,i+1)),l)):(s&&mt(gt(s,Qn(n,e,i+1)),l),nn(e,t,i,l),o&&mt(gt(o,Qn(t,r,i+1)),l)),nn(r,null,i,l),new k(l)}function Qn(n,e,t){let r=[];if(nn(null,n,t,r),n.depth>t){let i=Ai(n,e,t+1);mt(gt(i,Qn(n,e,t+1)),r)}return nn(e,null,t,r),new k(r)}function bu(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(k.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class yn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Zn(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(r.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new yn(t,r,s)}static resolveCached(e,t){let r=Hs.get(e);if(r)for(let s=0;se&&this.nodesBetween(e,t,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Il(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=k.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};yt.prototype.text=void 0;class er extends yt{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Il(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new er(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new er(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Il(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function js(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${r}`);for(let i in n)n[i].validate&&n[i].validate(e[i])}class xt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Cu(e,t);if(r.next==null)return xt.empty;let i=Rl(r);r.next&&r.err("Unexpected trailing text");let s=Nu(Ou(i));return Du(s,r),s}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(r.next[o].next);return s}).join(` `)}}xt.empty=new xt(!0);class Cu{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Rl(n){let e=[];do e.push(Mu(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Mu(n){let e=[];do e.push(Tu(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Tu(n){let e=Au(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Eu(n,e);else break;return e}function Ws(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Eu(n,e){let t=Ws(n),r=t;return n.eat(",")&&(n.next!="}"?r=Ws(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function vu(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let s in t){let o=t[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Au(n){if(n.eat("(")){let e=Rl(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=vu(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Ou(n){let e=[[]];return i(s(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=s(o.exprs[a],l);if(a==o.exprs.length-1)return c;i(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),i(s(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return i(s(o.expr,l),a),i(s(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u{c||i.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new xt(r.indexOf(n.length-1)>-1);for(let o=0;o-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Bl(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new yt(this,this.computeAttrs(e),k.from(t),B.setFrom(r))}createChecked(e=null,t,r){return t=k.from(t),this.checkContent(t),new yt(this,this.computeAttrs(e),t,B.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=k.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(k.empty,!0);return s?new yt(this,e,t.append(s),B.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[s]=new $l(s,t,o));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Iu(n,e,t){let r=t.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`)}}class Ru{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Iu(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Fr{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=zl(e,i.attrs),this.excluded=null;let s=Pl(this.attrs);this.instance=s?new B(this,s):null}create(e=null){return!e&&this.instance?this.instance:new B(this,Bl(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Fr(s,i++,t,o)),r}removeFromSet(e){for(var t=0;t-1}}class Fl{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Q.from(e.nodes),t.marks=Q.from(e.marks||{}),this.nodes=Us.compile(this.spec.nodes,this),this.marks=Fr.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=xt.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?_s(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:_s(this,o.split(" "))}this.nodeFromJSON=i=>yt.fromJSON(this,i),this.markFromJSON=i=>B.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Us){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new er(r,r.defaultAttrs,e,B.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function _s(n,e){let t=[];for(let r=0;r-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Lu(n){return n.tag!=null}function Pu(n){return n.style!=null}class Xe{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(Lu(i))this.tags.push(i);else if(Pu(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let r=new Js(this,t,!1);return r.addAll(e,B.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Js(this,t,!0);return r.addAll(e,B.none,t.from,t.to),w.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o{r(o=Gs(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=Gs(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xe(e,Xe.schemaRules(e)))}}const Vl={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Bu={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Hl={ol:!0,ul:!0},kn=1,Ni=2,rn=4;function qs(n,e,t){return e!=null?(e?kn:0)|(e==="full"?Ni:0):n&&n.whitespace=="pre"?kn|Ni:t&~rn}class Ln{constructor(e,t,r,i,s,o){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=B.none,this.match=s||(o&rn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(k.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&kn)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=k.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Vl.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Js{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=qs(null,t.preserveWhitespace,0)|(r?rn:0);i?s=new Ln(i.type,i.attrs,B.none,!0,t.topMatch||i.type.contentMatch,o):r?s=new Ln(null,null,B.none,!0,null,o):s=new Ln(e.schema.topNodeType,null,B.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,s=i.options&Ni?"full":this.localPreserveWS||(i.options&kn)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,` `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(s=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,t,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,r){let i,s;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!i||i.length>c.length+l)&&(i=c,s=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o(o.type?o.type.allowsMarkType(c.type):Ys(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Ln(e,t,a,i,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=kn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=s?r.node(a-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function zu(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Hl.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function $u(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Gs(n){let e={};for(let t in n)e[t]=n[t];return e}function Ys(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],o=l=>{s.push(l);for(let a=0;a{if(s.length||o.marks.length){let l=0,a=0;for(;l=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&_n(Pn(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return typeof t=="string"?{dom:e.createTextNode(t)}:_n(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Tt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Xs(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Xs(e.marks)}}function Xs(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Pn(n){return n.document||window.document}const Qs=new WeakMap;function Fu(n){let e=Qs.get(n);return e===void 0&&Qs.set(n,e=Vu(n)),e}function Vu(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let l,a=t?n.createElementNS(t,i):n.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;du)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(n.createTextNode(f));else{let{dom:h,contentDOM:p}=_n(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const jl=65535,Wl=Math.pow(2,16);function Hu(n,e){return n+e*Wl}function Zs(n){return n&jl}function ju(n){return(n-(n&jl))/Wl}const Kl=1,Ul=2,qn=4,_l=8;class Di{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&_l)>0}get deletedBefore(){return(this.delInfo&(Kl|qn))>0}get deletedAfter(){return(this.delInfo&(Ul|qn))>0}get deletedAcross(){return(this.delInfo&qn)>0}}class de{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&de.empty)return de.empty}recover(e){let t=0,r=Zs(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[l+s],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+i+(f<0?0:u);if(r)return h;let p=e==(t<0?a:d)?null:Hu(l/3,e-a),m=0;return c&&(m|=e==a?Ul:e==d?Kl:qn,(t<0?e!=a:e!=d)&&(m|=_l)),new Di(h,m,p)}i+=u-c}return r?e+i:new Di(e+i,0,null)}touches(e,t){let r=0,i=Zs(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+s],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new bn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;rs&&a!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return K.fromReplace(e,this.from,this.to,s)}invert(){return new Ce(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ge(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ge&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ge(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ge(t.from,t.to,e.markFromJSON(t.mark))}}se.jsonID("addMark",Ge);class Ce extends se{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new w(ss(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return K.fromReplace(e,this.from,this.to,r)}invert(){return new Ge(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ce(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ce&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ce(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ce(t.from,t.to,e.markFromJSON(t.mark))}}se.jsonID("removeMark",Ce);class Ye extends se{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return K.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return K.fromReplace(e,this.pos,this.pos+1,new w(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;ir.pos?null:new G(t.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new G(t.from,t.to,t.gapFrom,t.gapTo,w.fromJSON(e,t.slice),t.insert,!!t.structure)}}se.jsonID("replaceAround",G);function Ii(n,e,t){let r=n.resolve(e),i=t-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Wu(n,e,t,r){let i=[],s=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let m=0;mn.step(a)),s.forEach(a=>n.step(a))}function Ku(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(r instanceof Fr){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;un.step(new Ce(o.from,o.to,o.style)))}function ls(n,e,t,r=t.contentMatch,i=!0){let s=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a=0;a--)n.step(o[a])}function Uu(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function _t(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,i=0,s=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+i,a=n.$to.indexAfter(r)-s;if(rt;p--)m||r.index(p)>0?(m=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=s,m=!1;p>t;p--)m||i.after(p+1)=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(t[o].type.create(t[o].attrs,r))}let i=e.start,s=e.end;n.step(new G(i,s,i,s,new w(r,0,0),t.length,!0))}function Yu(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,a)&&Xu(n.doc,n.mapping.slice(s).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Jl(n,o,l,s),ls(n,n.mapping.slice(s).map(l,1),r,void 0,c===null);let u=n.mapping.slice(s),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new G(d,f,d+1,f-1,new w(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&ql(n,o,l,s),!1}})}function ql(n,e,t,r){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=n.mapping.slice(r).map(t+1+s+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Jl(n,e,t,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+s);n.replaceWith(o,o+1,e.type.schema.text(` diff --git a/modules/boardwalk/dist/assets/index-DhO7DrQh.js b/modules/boardwalk/dist/assets/index-DzKf4ihI.js similarity index 99% rename from modules/boardwalk/dist/assets/index-DhO7DrQh.js rename to modules/boardwalk/dist/assets/index-DzKf4ihI.js index 5f51857..16ad5a5 100644 --- a/modules/boardwalk/dist/assets/index-DhO7DrQh.js +++ b/modules/boardwalk/dist/assets/index-DzKf4ihI.js @@ -8,4 +8,4 @@ Defaulting to \`null\`.`),null)}function iM(e){return Mi(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ts}\`.`),ts)}var uM=ne({__name:"ProgressRoot",props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:ts},getValueLabel:{type:Function,required:!1,default:(e,t)=>Mi(e)?`${Math.round(e/t*ts)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue","update:max"],setup(e,{emit:t}){const n=e,a=t;et();const r=At(n,"modelValue",a,{passive:n.modelValue===void 0}),l=At(n,"max",a,{passive:n.max===void 0});Ue(()=>r.value,async s=>{const u=sM(s,n.max);u!==s&&(await Xe(),r.value=u)},{immediate:!0}),Ue(()=>n.max,s=>{const u=iM(n.max);u!==s&&(l.value=u)},{immediate:!0});const o=b(()=>hn(r.value)?"indeterminate":r.value===l.value?"complete":"loading");return oM({modelValue:r,max:l,progressState:o}),(s,u)=>(v(),z(i(nt),{"as-child":s.asChild,as:s.as,"aria-valuemax":i(l),"aria-valuemin":0,"aria-valuenow":Mi(i(r))?i(r):void 0,"aria-valuetext":s.getValueText?.(i(r),i(l)),"aria-label":s.getValueLabel(i(r),i(l)),role:"progressbar","data-state":o.value,"data-value":i(r)??void 0,"data-max":i(l)},{default:B(()=>[_e(s.$slots,"default",{modelValue:i(r)})]),_:3},8,["as-child","as","aria-valuemax","aria-valuenow","aria-valuetext","aria-label","data-state","data-value","data-max"]))}}),yc=uM,cM=ne({__name:"ProgressIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=lM();return et(),(a,r)=>(v(),z(i(nt),Ve(t,{"data-state":i(n).progressState.value,"data-value":i(n).modelValue?.value??void 0,"data-max":i(n).max.value}),{default:B(()=>[_e(a.$slots,"default")]),_:3},16,["data-state","data-value","data-max"]))}}),gc=cM;const dM="radio.select";function fM(e,t,n){af(dM,n,{originalEvent:e,value:t})}var pM=ne({__name:"Radio",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:checked","select"],setup(e,{emit:t}){const n=e,a=t,r=At(n,"checked",a,{passive:n.checked===void 0}),{value:l}=Ut(n),{forwardRef:o,currentElement:s}=et(),u=kf(s),c=b(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText??n.value:void 0);function d(f){n.disabled||fM(f,n.value,m=>{a("select",m),!m?.defaultPrevented&&(r.value=!0,u.value&&m.stopPropagation())})}return(f,m)=>(v(),z(i(nt),Ve(f.$attrs,{id:f.id,ref:i(o),role:"radio",type:f.as==="button"?"button":void 0,as:f.as,"aria-checked":i(r),"aria-label":c.value,"as-child":f.asChild,disabled:f.disabled?"":void 0,"data-state":i(r)?"checked":"unchecked","data-disabled":f.disabled?"":void 0,value:i(l),required:f.required,name:f.name,onClick:mt(d,["stop"])}),{default:B(()=>[_e(f.$slots,"default",{checked:i(r)}),i(u)&&f.name?(v(),z(i(Af),{key:0,type:"radio",tabindex:"-1",value:i(l),checked:!!i(r),name:f.name,disabled:f.disabled,required:f.required},null,8,["value","checked","name","disabled","required"])):ae("v-if",!0)]),_:3},16,["id","type","as","aria-checked","aria-label","as-child","disabled","data-state","data-disabled","value","required","name"]))}}),vM=pM;const[mM,hM]=kt("RadioGroupRoot");var yM=ne({__name:"RadioGroupRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,{forwardRef:r,currentElement:l}=et(),o=At(n,"modelValue",a,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:u,orientation:c,name:d,required:f,dir:m}=Ut(n),p=Ma(m),h=kf(l);return hM({modelValue:o,changeModelValue:x=>{o.value=x},disabled:s,loop:u,orientation:c,name:d?.value,required:f}),(x,$)=>(v(),z(i(Bf),{"as-child":"",orientation:i(c),dir:i(p),loop:i(u)},{default:B(()=>[F(i(nt),{ref:i(r),role:"radiogroup","data-disabled":i(s)?"":void 0,"as-child":x.asChild,as:x.as,"aria-orientation":i(c),"aria-required":i(f),dir:i(p)},{default:B(()=>[_e(x.$slots,"default",{modelValue:i(o)}),i(h)&&i(d)?(v(),z(i(Af),{key:0,required:i(f),disabled:i(s),value:i(o),name:i(d)},null,8,["required","disabled","value","name"])):ae("v-if",!0)]),_:3},8,["data-disabled","as-child","as","aria-orientation","aria-required","dir"])]),_:3},8,["orientation","dir","loop"]))}}),l1=yM;const[C7,gM]=kt("RadioGroupItem");var bM=ne({inheritAttrs:!1,__name:"RadioGroupItem",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["select"],setup(e,{emit:t}){const n=e,a=t,{forwardRef:r,currentElement:l}=et(),o=mM(),s=b(()=>o.disabled.value||n.disabled),u=b(()=>o.required.value||n.required),c=b(()=>Yo(o.modelValue?.value,n.value));gM({disabled:s,checked:c});const d=P(!1),f=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];Vl("keydown",p=>{f.includes(p.key)&&(d.value=!0)}),Vl("keyup",()=>{d.value=!1});function m(){setTimeout(()=>{d.value&&l.value?.click()},0)}return(p,h)=>(v(),z(i(Ff),{checked:c.value,disabled:s.value,"as-child":"",focusable:!s.value,active:c.value},{default:B(()=>[F(vM,Ve({...p.$attrs,...n},{ref:i(r),checked:c.value,required:u.value,disabled:s.value,"onUpdate:checked":h[0]||(h[0]=x=>i(o).changeModelValue(p.value)),onSelect:h[1]||(h[1]=x=>a("select",x)),onKeydown:h[2]||(h[2]=rr(mt(()=>{},["prevent"]),["enter"])),onFocus:m}),{default:B(()=>[_e(p.$slots,"default",{checked:c.value,required:u.value,disabled:s.value})]),_:3},16,["checked","required","disabled"])]),_:3},8,["checked","disabled","focusable","active"]))}}),o1=bM,_M=ne({__name:"BaseSeparator",props:{orientation:{type:String,required:!1,default:"horizontal"},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=["horizontal","vertical"];function a(s){return n.includes(s)}const r=b(()=>a(t.orientation)?t.orientation:"horizontal"),l=b(()=>r.value==="vertical"?t.orientation:void 0),o=b(()=>t.decorative?{role:"none"}:{"aria-orientation":l.value,role:"separator"});return(s,u)=>(v(),z(i(nt),Ve({as:s.as,"as-child":s.asChild,"data-orientation":r.value},o.value),{default:B(()=>[_e(s.$slots,"default")]),_:3},16,["as","as-child","data-orientation"]))}}),xM=_M;const[kM,wM]=kt("TimeFieldRoot");function Bs(e,t=ys(Ln())){return e&&"day"in e?e:na(t,e)}var $M=ne({inheritAttrs:!1,__name:"TimeFieldRoot",props:{defaultValue:{type:Object,required:!1,default:void 0},defaultPlaceholder:{type:Object,required:!1},placeholder:{type:Object,required:!1,default:void 0},modelValue:{type:[Object,null],required:!1},hourCycle:{type:null,required:!1},step:{type:Object,required:!1},stepSnapping:{type:Boolean,required:!1,default:!1},granularity:{type:String,required:!1},hideTimeZone:{type:Boolean,required:!1},maxValue:{type:Object,required:!1},minValue:{type:Object,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},id:{type:String,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:placeholder"],setup(e,{expose:t,emit:n}){const a=e,r=n,{disabled:l,readonly:o,granularity:s,defaultValue:u,minValue:c,maxValue:d,stepSnapping:f,dir:m,locale:p}=Ut(a),h=mu(p),x=Ma(m),$=xf(h.value,{hourCycle:Xo(a.hourCycle)}),{primitiveElement:g,currentElement:S}=zr(),T=P(new Set),O=b(()=>vb(a)),E=b(()=>c.value?Bs(c.value):void 0),I=b(()=>d.value?Bs(d.value):void 0);St(()=>{Cm(S.value).forEach(re=>T.value.add(re))});const R=At(a,"modelValue",r,{defaultValue:u.value,passive:a.modelValue===void 0}),G=b({get(){return hn(R.value)?R.value:Bs(R.value)},set(re){return re?R.value=R.value&&"day"in R.value?re:new Yn(re.hour,re.minute,re.second,R.value?.millisecond):R.value=re,re}}),w=xA({defaultPlaceholder:a.placeholder,defaultValue:R.value}),L=At(a,"placeholder",r,{defaultValue:a.defaultPlaceholder??w.copy(),passive:a.placeholder===void 0}),j=b({get(){return Bs(L.value)},set(re){return re&&(L.value="day"in L.value?re.copy():new Yn(re.hour,re.minute,re.second,L.value?.millisecond)),re}}),q=b(()=>s.value?s.value:"minute"),W=b(()=>R.value?!!(E.value&&Qa(G.value,E.value)||I.value&&Qa(I.value,G.value)):!1),X=e4(q.value),V=P(R.value?{..._d({value:G.value,formatter:$})}:{...X}),H=b(()=>Ub({granularity:q.value,dateRef:j.value,formatter:$,hideTimeZone:a.hideTimeZone,hourCycle:a.hourCycle,segmentValues:V.value,locale:h,isTimeValue:!0})),le=b(()=>{const re=H.value.arr;return a.hourCycle===12?re.map(Q=>{if(Q.part==="hour"&&"hour"in V.value){const ce=V.value.hour;if(ce!==null){const Z=ce===0?12:ce>12?ce-12:ce;return{...Q,value:Z.toString()}}}return Q}):re}),ue=b(()=>le.value.filter(({part:re})=>re!=="literal"));Ue(h,re=>{$.getLocale()!==re&&($.setLocale(re),Xe(()=>{T.value.clear(),Cm(S.value).forEach(Q=>T.value.add(Q))}))}),Ue(G,re=>{!hn(re)&&(!Dl(j.value,re)||j.value.compare(re)!==0)&&(L.value=re.copy())}),Ue([G,h],([re])=>{hn(re)?Object.values(V.value).every(Q=>Q!==null)&&hn(re)&&(V.value={...X}):V.value={..._d({value:re,formatter:$})}});const Oe=P(null),Ee=b(()=>Array.from(T.value).findIndex(re=>re.getAttribute("data-reka-time-field-segment")===Oe.value?.getAttribute("data-reka-time-field-segment"))),pe=b(()=>{const re=x.value==="rtl"?-1:1;return(re<0?Ee.value<0:Ee.value>T.value.size-1)?null:Array.from(T.value)[Ee.value+re]}),fe=b(()=>{const re=x.value==="rtl"?-1:1;return(re>0?Ee.value<0:Ee.value>T.value.size-1)?null:Array.from(T.value)[Ee.value-re]}),ge=Hl();function K(re){re.isComposing||fa(re.key)&&(re.key===ge.ARROW_LEFT&&fe.value?.focus(),re.key===ge.ARROW_RIGHT&&pe.value?.focus())}function xe(re){Oe.value=re}return wM({locale:h,modelValue:G,placeholder:j,disabled:l,formatter:$,hourCycle:a.hourCycle,step:O,stepSnapping:f,readonly:o,segmentValues:V,isInvalid:W,segmentContents:ue,elements:T,setFocusedElement:xe,focusNext(){pe.value?.focus()}}),t({setFocusedElement:xe}),(re,Q)=>(v(),z(i(nt),Ve(re.$attrs,{ref_key:"primitiveElement",ref:g,role:"group","aria-disabled":i(l)?!0:void 0,"data-disabled":i(l)?"":void 0,"data-readonly":i(o)?"":void 0,"data-invalid":W.value?"":void 0,dir:i(x),onKeydown:rr(K,["left","right"])}),{default:B(()=>[_e(re.$slots,"default",{modelValue:i(R),segments:le.value,isInvalid:W.value}),F(i(Ef),{id:re.id,as:"input",feature:"focusable",tabindex:"-1",value:i(R)?i(R).toString():"",name:re.name,disabled:i(l),required:re.required,onFocus:Q[0]||(Q[0]=ce=>Array.from(T.value)?.[0]?.focus())},null,8,["id","value","name","disabled","required"])]),_:3},16,["aria-disabled","data-disabled","data-readonly","data-invalid","dir"]))}}),Am=$M,CM=ne({__name:"TimeFieldInput",props:{part:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=kM(),a=P(!0),r=P(!1),{handleSegmentClick:l,handleSegmentKeydown:o,handleSegmentBeforeInput:s,handleSegmentCompositionStart:u,handleSegmentCompositionEnd:c,handleSegmentFocusOut:d,attributes:f}=Hb({hasLeftFocus:a,lastKeyZero:r,placeholder:n.placeholder,hourCycle:n.hourCycle,step:n.step,stepSnapping:n.stepSnapping,segmentValues:n.segmentValues,formatter:n.formatter,part:t.part,disabled:n.disabled,readonly:n.readonly,focusNext:n.focusNext,modelValue:n.modelValue}),m=b(()=>n.disabled.value),p=b(()=>n.readonly.value),h=b(()=>n.isInvalid.value);return(x,$)=>(v(),z(i(nt),Ve({as:x.as,"as-child":x.asChild},i(f),{contenteditable:m.value||p.value?!1:x.part!=="literal","data-reka-time-field-segment":x.part,"aria-disabled":m.value?!0:void 0,"aria-readonly":p.value?!0:void 0,"data-disabled":m.value?"":void 0,"data-invalid":h.value?"":void 0,"aria-invalid":h.value?!0:void 0},iy(x.part!=="literal"?{mousedown:i(l),keydown:i(o),beforeinput:i(s),compositionstart:i(u),compositionend:i(c),focusout:()=>{a.value=!0,i(d)()},focusin:g=>{i(n).setFocusedElement(g.target)}}:{})),{default:B(()=>[_e(x.$slots,"default")]),_:3},16,["as","as-child","contenteditable","data-reka-time-field-segment","aria-disabled","aria-readonly","data-disabled","data-invalid","aria-invalid"]))}}),Tm=CM,SM=ne({__name:"ToolbarButton",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,{forwardRef:n}=et();return(a,r)=>(v(),z(i(Ff),{"as-child":"",focusable:!a.disabled},{default:B(()=>[F(i(nt),Ve({ref:i(n),type:a.as==="button"?"button":void 0},t),{default:B(()=>[_e(a.$slots,"default")]),_:3},16,["type"])]),_:3},8,["focusable"]))}}),vo=SM;const[EM,AM]=kt("ToolbarRoot");var TM=ne({__name:"ToolbarRoot",props:{orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},loop:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{orientation:n,dir:a}=Ut(t),r=Ma(a),{forwardRef:l}=et();return AM({orientation:n,dir:r}),(o,s)=>(v(),z(i(Bf),{"as-child":"",orientation:i(n),dir:i(r),loop:o.loop},{default:B(()=>[F(i(nt),{ref:i(l),role:"toolbar","aria-orientation":i(n),"as-child":o.asChild,as:o.as},{default:B(()=>[_e(o.$slots,"default")]),_:3},8,["aria-orientation","as-child","as"])]),_:3},8,["orientation","dir","loop"]))}}),DM=TM,OM=ne({__name:"ToolbarSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=EM();return et(),(a,r)=>(v(),z(xM,{orientation:i(n).orientation.value,"as-child":t.asChild,as:a.as},{default:B(()=>[_e(a.$slots,"default")]),_:3},8,["orientation","as-child","as"]))}}),bc=OM;const MM=/^filter\[(.+)\]$/,PM=/^[1-9]\d*$/;function ul(e){const t=Array.isArray(e)?e[e.length-1]:e;return typeof t=="string"?t:""}function Dm(e){return PM.test(e)?Number(e):void 0}function s1(e){const t={},n=ul(e.search).trim();n!==""&&(t.search=n);const a=ul(e.sort).trim();if(a!==""){t.sort=a;const s=ul(e.dir);t.dir=s==="desc"?"desc":"asc"}const r=Dm(ul(e.page));r!==void 0&&(t.page=r);const l=Dm(ul(e.per_page));l!==void 0&&(t.per_page=l);const o={};for(const s of Object.keys(e).sort()){const u=MM.exec(s)?.[1],c=ul(e[s]);u&&c!==""&&(o[u]=c)}return Object.keys(o).length>0&&(t.filter=o),t}function Pi(e){const t={};e.search&&(t.search=e.search),e.sort&&(t.sort=e.sort,t.dir=e.dir==="desc"?"desc":"asc"),e.page!==void 0&&e.page>1&&(t.page=String(e.page)),e.per_page!==void 0&&(t.per_page=String(e.per_page));for(const n of Object.keys(e.filter??{}).sort()){const a=e.filter?.[n];a!==void 0&&a!==""&&(t[`filter[${n}]`]=a)}return t}function kl(e){return JSON.stringify(Pi(e))}const i1="summer-admin.list:",RM=kl({});let kd=null;function wu(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function u1(e){return`${i1}${e}:`}function c1(e){return kd===null?null:u1(kd)+e}function wd(e){try{wu()?.removeItem(e)}catch{}}function Om(e){const t=wu();if(t)try{const n=[];for(let a=0;a!0);return}const n=u1(t);Om(a=>!a.startsWith(n))}function IM(e){const t=c1(e);if(t===null)return{};let n=null;try{n=wu()?.getItem(t)??null}catch{return{}}if(n===null)return{};let a;try{a=JSON.parse(n)}catch{return wd(t),{}}return typeof a!="object"||a===null||Array.isArray(a)||Object.getPrototypeOf(a)!==Object.prototype||!Object.values(a).every(r=>typeof r=="string")?(wd(t),{}):s1(a)}function Fs(e,t){const n=c1(e);if(n!==null){if(kl(t)===RM){wd(n);return}try{wu()?.setItem(n,JSON.stringify(Pi(t)))}catch{}}}const qr=P(null),d1=P(null);let Fo=null;function f1(e){p1(),d1.value=e,!(e===null||e<=0)&&(Fo=setTimeout(()=>{Fo=null,Kd()},e*800))}function p1(){Fo!==null&&(clearTimeout(Fo),Fo=null)}yw(f1);const ln=Ct(qr);async function qM(e,t){const{data:n,response:a}=await Be.POST("/auth/login",{body:{login:e,password:t}});return!a.ok||!n?!1:(f1(typeof n.data.expires_in=="number"?n.data.expires_in:null),!0)}async function v1(){const{data:e,response:t}=await Be.GET("/auth/me");return qr.value=t.ok&&e?e.data:null,Uf(qr.value?.id??null),await PS(qr.value),qr.value}function m1(e){if(!e)return"";const t=[e.first_name,e.last_name].map(n=>n.trim()).filter(Boolean);return t.length>0?t.slice(0,2).map(n=>n.charAt(0).toUpperCase()).join(""):e.login.slice(0,2).toUpperCase()}function _c(e){qr.value=e,Uf(e.id)}function h1(){p1(),qr.value=null,d1.value=null,Uf(null)}function NM(e){h1();const t=e.currentRoute.value;t.name!=="login"&&e.push({name:"login",query:{redirect:t.fullPath}}).catch(()=>{})}async function LM(e){try{await Be.POST("/auth/logout")}catch{}finally{h1(),ww([]),Sw([])}e&&await e.replace({name:"login"}).catch(()=>{})}const BM=["src"],FM={key:1,class:"flex size-[34px] shrink-0 items-center justify-center rounded-full bg-accent text-[13px] font-bold text-on-accent","aria-hidden":"true","data-user-initials":""},VM={class:"flex flex-col leading-tight max-[1099px]:hidden","data-user-identity":""},zM={class:"font-semibold"},jM={key:0,class:"text-[12px] text-muted","data-user-role":""},UM={class:"flex items-center gap-3 px-2 py-2"},HM=["src"],WM={key:1,class:"flex size-10 shrink-0 items-center justify-center rounded-full bg-accent text-[14px] font-bold text-on-accent","aria-hidden":"true"},KM={class:"flex min-w-0 flex-col leading-tight"},GM={class:"truncate font-bold"},YM={class:"truncate text-[13px] text-muted"},JM={class:"flex size-[18px] items-center justify-center"},ZM=ne({__name:"UserMenu",setup(e){const t=Wr(),n=b(()=>{const m=ln.value;if(!m)return"";const p=`${m.first_name} ${m.last_name}`.trim();return p===""?m.login:p}),a=b(()=>m1(ln.value)),r=b(()=>ln.value?.avatar?.thumb_url||ln.value?.avatar?.url||""),l=b(()=>ln.value?.role?.name??""),o=b(()=>ES.value||ta.value);function s(m){try{const p=new Intl.DisplayNames([m],{type:"language"}).of(m);if(p&&p!==m)return p.charAt(0).toLocaleUpperCase(m)+p.slice(1)}catch{}return m.toUpperCase()}const u=b(()=>_w.value.map(m=>({code:m,name:s(m)})));function c(m){typeof m=="string"&&m!==""&&RS(m)}async function d(){await t.push({name:"account"}).catch(()=>{})}async function f(){await LM(t)}return(m,p)=>(v(),z(i(t1),{modal:!1},{default:B(()=>[F(i(r1),{"data-user-menu":"",disabled:!i(ln),"aria-label":`${i(k)("backend::lang.nav.user_menu")}: ${n.value}`,class:"flex h-input items-center gap-2.5 rounded-inner px-2 text-left transition-colors duration-150 ease-out hover:bg-hover"},{default:B(()=>[r.value?(v(),_("img",{key:0,src:r.value,alt:"","data-user-avatar":"",class:"size-[34px] shrink-0 rounded-full object-cover"},null,8,BM)):(v(),_("span",FM,D(a.value),1)),C("span",VM,[C("span",zM,D(n.value),1),l.value?(v(),_("span",jM,D(l.value),1)):ae("",!0)]),F(i(lr),{size:16,class:"text-muted","aria-hidden":"true"})]),_:1},8,["disabled","aria-label"]),F(i(a1),null,{default:B(()=>[F(i(n1),{"data-user-menu-content":"",align:"end","side-offset":8,class:"z-50 flex w-[280px] flex-col rounded-[14px] border border-border bg-surface p-2 text-text shadow-menu"},{default:B(()=>[C("div",UM,[r.value?(v(),_("img",{key:0,src:r.value,alt:"","data-user-avatar":"",class:"size-10 shrink-0 rounded-full object-cover"},null,8,HM)):(v(),_("span",WM,D(a.value),1)),C("span",KM,[C("span",GM,D(n.value),1),C("span",YM,D(i(ln)?.email),1)])]),F(i(xd),{"data-action":"account",class:"flex h-10 cursor-pointer items-center gap-2.5 rounded-control px-3 font-medium outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover",onSelect:d},{default:B(()=>[F(i(iS),{size:18,"aria-hidden":"true"}),C("span",null,D(i(k)("backend::lang.myaccount.menu_label")),1)]),_:1}),u.value.length>1?(v(),_(ve,{key:0},[F(i(Em),{class:"my-1 h-px bg-border"}),F(i(ZO),{class:"px-3 pt-1 pb-1 text-[12px] font-semibold text-muted","data-language-label":""},{default:B(()=>[ke(D(i(k)("backend::lang.nav.language")),1)]),_:1}),F(i(eM),{"model-value":o.value,"onUpdate:modelValue":c},{default:B(()=>[(v(!0),_(ve,null,qe(u.value,h=>(v(),z(i(nM),{key:h.code,value:h.code,"data-locale-option":h.code,lang:h.code,class:"flex h-10 cursor-pointer items-center gap-2.5 rounded-control px-3 font-medium outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover"},{default:B(()=>[C("span",JM,[F(i(YO),null,{default:B(()=>[F(i(Sa),{size:18,"aria-hidden":"true"})]),_:1})]),C("span",null,D(h.name),1)]),_:2},1032,["value","data-locale-option","lang"]))),128))]),_:1},8,["model-value"])],64)):ae("",!0),F(i(Em),{class:"my-1 h-px bg-border"}),F(i(xd),{"data-action":"logout",class:"flex h-10 cursor-pointer items-center gap-2.5 rounded-control px-3 font-medium outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover",onSelect:f},{default:B(()=>[F(i(gg),{size:18,"aria-hidden":"true"}),C("span",null,D(i(k)("backend::lang.auth.logout")),1)]),_:1})]),_:1})]),_:1})]),_:1}))}}),XM=["role","data-tone"],QM={class:"font-medium"},e5=["aria-label","onClick"],t5=ne({__name:"Toast",setup(e){return(t,n)=>(v(),z(Ux,{tag:"div",name:"toast",class:"pointer-events-none fixed inset-x-0 bottom-[88px] z-50 flex flex-col items-center gap-2 px-4"},{default:B(()=>[(v(!0),_(ve,null,qe(i(CS),a=>(v(),_("div",{key:a.id,role:a.tone==="danger"?"alert":"status","data-tone":a.tone,class:"pointer-events-auto flex max-w-[560px] items-center gap-3 rounded-[14px] bg-[#1d2740] py-3 pr-2.5 pl-3.5 text-white shadow-toast"},[C("span",{class:ye([a.tone==="danger"?"bg-[#f58a8a] text-[#1d2740]":"bg-accent text-on-accent","flex size-[26px] shrink-0 items-center justify-center rounded-full"]),"aria-hidden":"true"},[a.tone==="danger"?(v(),z(i(gt),{key:0,size:16})):(v(),z(i(Sa),{key:1,size:16}))],2),C("span",QM,D(a.text),1),C("button",{type:"button","aria-label":i(k)("backend::lang.form.close"),class:"flex size-8 items-center justify-center rounded-pager text-[#c3cbda] transition-colors duration-150 ease-out hover:bg-side-hover hover:text-white",onClick:r=>i(Dg)(a.id)},[F(i(un),{size:16,"aria-hidden":"true"})],8,e5)],8,XM))),128))]),_:1}))}}),n5={class:"flex min-w-0 flex-1 flex-col"},a5={class:"flex h-header shrink-0 items-center justify-between gap-4 border-b border-border bg-surface pr-6 pl-8"},r5={class:"flex shrink-0 items-center gap-1"},l5=["title","aria-label"],o5={class:"min-w-0 flex-1 px-8 py-7"},s5=ne({__name:"AppShell",setup(e){const t=Tn(),{collapsed:n,watchViewport:a}=Ig(),r=a();Dt(r);const l=`${window.location.origin}/`,o=b(()=>ds(String(t.params.vendor??""),String(t.params.plugin??""))),s=b(()=>o.value&&!n.value?"calc(var(--spacing-rail) + var(--spacing-panel))":"var(--spacing-rail)");return(u,c)=>(v(),_("div",{class:"flex min-h-screen bg-bg text-text",style:Sn({"--shell-offset":s.value})},[F(GS),o.value&&!i(n)?(v(),z(QS,{key:0,entry:o.value},null,8,["entry"])):ae("",!0),C("div",n5,[C("header",a5,[F(aE),C("div",r5,[C("a",{"data-view-site":"",href:l,target:"_blank",rel:"noopener noreferrer",title:i(k)("backend::lang.nav.view_site"),"aria-label":i(k)("backend::lang.nav.view_site"),class:"flex size-input items-center justify-center rounded-inner text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text"},[F(i(vg),{class:"size-[18px]","aria-hidden":"true"})],8,l5),F(ZM)])]),C("main",o5,[_e(u.$slots,"default")])]),F(t5)],4))}}),i5=ne({__name:"App",setup(e){const t=Tn(),n=b(()=>t.meta.shell===!0);return bn(()=>{document.title=Aw(t)}),(a,r)=>n.value?(v(),z(s5,{key:0},{default:B(()=>[F(i(Qc),null,{default:B(({Component:l,route:o})=>[(v(),z(Bt(l),{key:o.path}))]),_:1})]),_:1})):(v(),z(i(Qc),{key:1}))}}),u5="data-summer-controller",y1="*",xc=new Map,$d=new Map;let g1="";function b1(){return`${au.base}/assets/`}function _1(e){if(!e.startsWith(b1())||e.includes("\\"))return!1;for(const n of e){const a=n.codePointAt(0)??0;if(a<=32||a===127)return!1}return!(e.split(/[?#]/,1)[0]??"").split("/").some(n=>{const a=n.toLowerCase().replaceAll("%2e",".");return a==="."||a===".."})}function x1(e){if(!_1(e))return Promise.reject(new Error(`plugin script outside ${b1()}: ${e}`));const t=xc.get(e);if(t)return t;const n=new Promise((a,r)=>{const l=document.createElement("script");l.type="module",l.addEventListener("load",()=>a(),{once:!0}),l.addEventListener("error",()=>{xc.delete(e),l.remove(),r(new Error(`plugin script failed to load: ${e}`))},{once:!0}),l.src=e,document.head.appendChild(l)});return xc.set(e,n),n}function k1(e,t){for(const n of t){const a=`${e} ${n}`;if(!_1(n)||$d.has(a))continue;const r=document.createElement("link");r.rel="stylesheet",r.setAttribute(u5,e),r.disabled=!w1(e),r.href=n,$d.set(a,{owner:e,link:r}),document.head.appendChild(r)}}function c5(e){g1=e;for(const{owner:t,link:n}of $d.values())n.disabled=!w1(t)}function w1(e){return e===y1||e===g1}function d5(e){k1(y1,e)}async function Hf(e,t){k1(e,t?.styles??[]);const n=t?.scripts??[],a=await Promise.allSettled(n.map(r=>x1(r)));return n.filter((r,l)=>a[l]?.status==="rejected")}const $1=new Map;async function C1(){let e=[];try{const{data:t,response:n}=await Be.GET("/field-types");e=n.ok&&t?t.data:[]}catch{return[]}for(const t of e){d5(t.styles??[]);const n=t.scripts??[];$1.set(t.element,Promise.allSettled(n.map(a=>x1(a))).then(a=>n.filter((r,l)=>a[l]?.status==="rejected")))}return e}function f5(e){return $1.get(e)??Promise.resolve([])}const p5={class:"flex min-h-screen items-center justify-center px-4",style:{background:"radial-gradient(ellipse at 50% 35%, #2b3a5c 0%, #1d2740 60%)"}},v5={class:"flex w-full max-w-[400px] flex-col gap-6"},m5={class:"flex items-center justify-center gap-3"},h5={class:"flex size-[34px] items-center justify-center rounded-full bg-accent-soft"},y5={class:"text-[22px] font-bold tracking-[-0.02em]"},g5={class:"flex flex-col gap-1.5"},b5={class:"font-semibold"},_5={class:"flex flex-col gap-1.5"},x5={class:"font-semibold"},k5=["aria-invalid"],w5={key:0,role:"alert",class:"flex items-center gap-2.5 rounded-control bg-[#fdf0f0] px-3.5 py-3 text-[#c62828]"},$5=["disabled"],C5=ne({__name:"LoginView",setup(e){const t=Tn(),n=Wr(),a=P(""),r=P(""),l=P(!1),o=P(!1);async function s(){if(!o.value){o.value=!0,l.value=!1;try{if(!await qM(a.value.trim(),r.value)||!await v1()){l.value=!0;return}r.value="",await Promise.all([ag(),rg().catch(()=>[]),C1()]),await n.replace(f0(t.query.redirect)??"/")}finally{o.value=!1}}}return(u,c)=>(v(),_("main",p5,[C("div",v5,[C("div",m5,[C("span",h5,[F(i(ou),{size:20,class:"text-accent","aria-hidden":"true"})]),c[2]||(c[2]=C("span",{class:"text-[18px] font-bold text-white"},[ke("Summer"),C("span",{class:"text-accent"},"CMS")],-1))]),C("form",{class:"flex flex-col gap-[18px] rounded-card bg-white p-8 text-[#141b2d] shadow-login",novalidate:"",onSubmit:mt(s,["prevent"])},[C("h1",y5,D(i(k)("backend::lang.auth.title")),1),C("label",g5,[C("span",b5,D(i(k)("backend::lang.auth.login")),1),Qn(C("input",{"onUpdate:modelValue":c[0]||(c[0]=d=>a.value=d),name:"login",type:"text",autocomplete:"username",required:"",class:"h-input rounded-control border border-[#d2d8e2] bg-white px-3.5"},null,512),[[Nl,a.value]])]),C("label",_5,[C("span",x5,D(i(k)("backend::lang.auth.password")),1),Qn(C("input",{"onUpdate:modelValue":c[1]||(c[1]=d=>r.value=d),name:"password",type:"password",autocomplete:"current-password",required:"","aria-invalid":l.value?"true":void 0,class:ye([l.value?"border-[#c62828]":"border-[#d2d8e2]","h-input rounded-control border bg-white px-3.5"])},null,10,k5),[[Nl,r.value]])]),l.value?(v(),_("div",w5,[F(i(gt),{size:18,"aria-hidden":"true"}),C("span",null,D(i(k)("backend::lang.auth.invalid")),1)])):ae("",!0),C("button",{type:"submit",disabled:o.value,class:"h-input rounded-control bg-[#22304d] font-semibold text-white disabled:opacity-60"},D(i(k)("backend::lang.auth.submit")),9,$5)],32)])]))}}),Mm=/^\d+$/;function S1(e,t,n){const a=tu(t),r=qn(t);if(!a||!r)return"/";const o=((e??"").trim().split(/[?#]/,1)[0]??"").split("/").filter(d=>d!==""),s=[a.vendor,a.plugin,a.controller];if(!s.every((d,f)=>o[f]?.toLowerCase()===d.toLowerCase()))return r;const c=o.slice(s.length);if(c.length===0)return r;if(c.length===1&&c[0]==="create")return`${r}/create`;if(c.length===2&&c[0]==="update"){const d=c[1]===":id"?String(n??""):c[1]??"";return Mm.test(d)?`${r}/${d}`:r}if(c.length===2&&c[0]==="preview"){const d=c[1]===":id"?String(n??""):c[1]??"";return Mm.test(d)?`${r}/${d}/preview`:r}return r}const Pm=/^[0-9]+$/;function S5(e,t){const n=e.replace(/[\s ]/g,"");if(n==="")return{value:null,error:null};let a=n,r=!1;a.startsWith("-")&&(r=!0,a=a.slice(1));const l=a.match(/[.,]/g)??[];if(l.length>1)return{value:null,error:"invalid"};const[o,s=""]=a.split(/[.,]/);if(!Pm.test(o??"")||l.length===1&&!Pm.test(s))return{value:null,error:"invalid"};if(s.replace(/0+$/,"").length>t)return{value:null,error:"too_precise"};const u=s===""?o:`${o}.${s}`;return{value:`${r?"-":""}${u}`,error:null}}function E5(e){const[t,n]=e.split(".");if(n===void 0||n.length<=2)return e;let a=n.length;for(;a>2&&n.charAt(a-1)==="0";)a-=1;return`${t}.${n.slice(0,a)}`}function A5(e){return new Intl.NumberFormat(e).formatToParts(1.1).find(n=>n.type==="decimal")?.value??"."}function E1(e,t,n,a=4){const r={minimumFractionDigits:2,maximumFractionDigits:Math.max(2,a)},l=t===""?{style:"decimal",...r}:{style:"currency",currency:t,currencyDisplay:"code",...r};let o;try{o=new Intl.NumberFormat(n,l)}catch{return`${new Intl.NumberFormat(n,{style:"decimal",...r}).format(e)} ${t}`.trim()}return o.format(e)}const T5={key:0,"data-switch":"true",class:"inline-flex h-6 items-center gap-1 rounded-pill bg-ok-bg px-2.5 text-[12px] font-semibold text-ok-text"},D5={key:1,"data-switch":"false",class:"inline-flex h-6 items-center rounded-pill border border-border-strong px-2.5 text-[12px] font-semibold text-muted"},O5={key:1,class:"text-muted","data-empty":""},M5={key:2,class:"text-[13px] text-muted tabular-nums"},P5={key:3,"data-money":"",class:"tabular-nums whitespace-nowrap"},cl=ne({__name:"CellValue",props:{column:{},value:{},row:{}},setup(e){const t=e;function n(p){return p==null||p===""}function a(p){return n(p)?"":Array.isArray(p)?p.map(a).filter(h=>h!=="").join(", "):typeof p=="boolean"?k(p?"backend::lang.list.column_switch_true":"backend::lang.list.column_switch_false"):typeof p=="object"?"":String(p)}function r(p){return String(p).padStart(2,"0")}function l(p){if(typeof p!="string"&&typeof p!="number")return"";const h=new Date(p);return Number.isNaN(h.getTime())?String(p):`${h.getFullYear()}-${r(h.getMonth()+1)}-${r(h.getDate())} ${r(h.getHours())}:${r(h.getMinutes())}`}function o(p){if(typeof p!="string")return"";const h=/^\d{4}-\d{2}-\d{2}/.exec(p.trim());return h?h[0]:p.trim()}function s(p){if(typeof p!="string")return"";const h=/(\d{2}):(\d{2})/.exec(p);return h?`${h[1]}:${h[2]}`:p.trim()}function u(p){return typeof p=="string"?p!==""&&p!=="0"&&p.toLowerCase()!=="false":!!p}function c(){if(t.column.currencyFrom){const p=t.row?.[t.column.currencyFrom];return typeof p=="string"?p.trim():""}return t.column.currency??""}function d(p){return typeof p!="string"||p.trim()===""?"":E1(p.trim(),c(),ta.value,4)}const f=b(()=>t.column.type==="switch"?"switch":t.column.type==="money"?"money":t.column.type==="datetime"?"datetime":t.column.type==="date"?"date":t.column.type==="time"?"time":"text"),m=b(()=>{switch(f.value){case"datetime":return l(t.value);case"date":return o(t.value);case"time":return s(t.value);case"money":return d(t.value);default:return a(t.value)}});return(p,h)=>f.value==="switch"&&!n(e.value)?(v(),_(ve,{key:0},[u(e.value)?(v(),_("span",T5,[F(i(ig),{size:14,"aria-hidden":"true"}),ke(D(i(k)("backend::lang.list.column_switch_true")),1)])):(v(),_("span",D5,D(i(k)("backend::lang.list.column_switch_false")),1))],64)):m.value===""?(v(),_("span",O5,"—")):f.value==="datetime"||f.value==="date"||f.value==="time"?(v(),_("span",M5,D(m.value),1)):f.value==="money"?(v(),_("span",P5,D(m.value),1)):(v(),_(ve,{key:4},[ke(D(m.value),1)],64))}}),R5={key:0,class:"flex shrink-0 gap-2"},I5=["data-row-state"],q5=ne({__name:"RowStateBadges",props:{states:{},labels:{}},setup(e){const t=e,n={deleted:"border border-border-strong text-muted",negative:"bg-danger-soft text-danger",disabled:"bg-subtle text-muted"},a=["deleted","negative","disabled"],r=b(()=>a.filter(l=>t.states.includes(l)));return(l,o)=>r.value.length>0?(v(),_("span",R5,[(v(!0),_(ve,null,qe(r.value,s=>(v(),_("span",{key:s,"data-row-state":s,class:ye([n[s],"inline-flex h-6 shrink-0 items-center rounded-pill px-2.5 text-[12px] font-semibold whitespace-nowrap"])},D(e.labels[s]??s),11,I5))),128))])):ae("",!0)}}),N5={class:"overflow-x-auto"},L5={class:"sticky top-0 z-10"},B5={class:"h-row-head border-y border-border bg-subtle"},F5={key:0,scope:"col","data-select":"",class:"w-[52px] pl-5"},V5=["aria-checked","aria-label","disabled"],z5=["aria-sort"],j5=["data-sort","onClick"],U5={key:1,class:"w-[56px] pr-5"},H5=["aria-busy"],W5={key:0,class:"pl-5"},K5={key:1,class:"pr-5"},G5={key:1},Y5=["colspan"],J5={class:"text-muted"},Z5=["aria-selected","data-row-states","onClick"],X5={key:0,"data-select":"",class:"pl-5"},Q5=["aria-checked","aria-label","onClick"],e6={key:0,class:"flex items-center gap-3"},t6={"data-avatar":"",class:"flex size-[30px] shrink-0 items-center justify-center rounded-full bg-subtle text-[12px] font-bold text-text","aria-hidden":"true"},n6=["onClick"],a6={key:1,class:"flex items-center gap-2"},r6={key:1,"data-trailing":"",class:"w-[56px] pr-5"},A1=ne({__name:"DataTable",props:{columns:{},rows:{},loading:{type:Boolean,default:!1},rowLink:{type:Function,default:void 0},selectable:{type:Boolean,default:!1},selected:{default:()=>[]},sortable:{type:Boolean,default:!1},sort:{default:null},variant:{default:"list"},openable:{type:Boolean,default:!1},trailing:{type:Boolean,default:!1},rowStates:{default:()=>({})},stateLabels:{default:()=>({})}},emits:["update:selected","sort","open"],setup(e,{emit:t}){const n=e,a=t,r=Wr();function l(X){const V=X.id;return typeof V=="number"||typeof V=="string"?V:null}function o(X,V){const H=l(X);return H===null?`row-${V}`:String(H)}function s(X){return n.rowLink?n.rowLink(X):null}function u(X,V){if(X.target?.closest("a, button, input, label, select"))return;if(n.openable){const ue=X.currentTarget?.querySelector("[data-row-open]")??null;a("open",V,ue);return}const le=s(V);le&&r.push(le)}const c=b(()=>n.rows.map(l).filter(X=>X!==null)),d=b(()=>new Set(n.selected.map(String))),f=b(()=>{const X=c.value,V=X.filter(H=>d.value.has(String(H))).length;return V===0?"false":V===X.length?"true":"mixed"});function m(X){const V=l(X);return V!==null&&d.value.has(String(V))}function p(){a("update:selected",f.value==="true"?[]:[...c.value])}function h(X){const V=l(X);V!==null&&(d.value.has(String(V))?a("update:selected",n.selected.filter(H=>String(H)!==String(V))):a("update:selected",[...n.selected,V]))}function x(X){if(n.sort?.column===X.key)return n.sort.dir==="desc"?"descending":"ascending"}function $(X){return n.sortable&&X.sortable}const g=b(()=>n.variant==="relation"),S=b(()=>g.value?"h-[56px]":"h-row"),T=b(()=>g.value?3:8);function O(X){return(typeof X=="string"||typeof X=="number"?String(X):"").split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(H=>H.charAt(0).toUpperCase()).join("")}const E=["deleted","negative","disabled"];function I(X){const V=l(X),H=V===null?void 0:n.rowStates[String(V)];return Array.isArray(H)?E.filter(le=>H.includes(le)):[]}function R(X,V,H=[]){const le=H.includes("deleted")||H.includes("disabled"),ue=G(X);return V===0?[le?"font-semibold text-muted":"font-semibold",ue].filter(Boolean).join(" "):[le||g.value||X.relation?"text-muted":"",ue].filter(Boolean).join(" ")}function G(X){return X.type==="money"?"text-right":""}function w(X){return["min-w-0 truncate",X.includes("deleted")?"line-through":"no-underline",X.includes("negative")?"text-danger":X.includes("deleted")||X.includes("disabled")?"text-muted":"text-text"]}const L=b(()=>n.columns.filter(X=>!X.invisible)),j=b(()=>Math.max(L.value.length+(n.selectable?1:0)+(n.trailing?1:0),1));function q(X,V){a("open",V,X.currentTarget)}const W=["w-3/5","w-2/5","w-1/2","w-3/4","w-1/3","w-2/3","w-1/2","w-2/5"];return(X,V)=>(v(),_("div",N5,[C("table",{class:ye([g.value?"min-w-[480px]":"min-w-[640px]","w-full border-collapse text-left"])},[C("thead",L5,[C("tr",B5,[e.selectable?(v(),_("th",F5,[C("button",{type:"button",role:"checkbox","aria-checked":f.value,"aria-label":i(k)("backend::lang.list.select_all"),disabled:e.loading||c.value.length===0,class:ye([f.value==="false"?"border-border-strong bg-surface":"border-primary bg-primary text-on-primary","flex size-[18px] items-center justify-center rounded-checkbox border disabled:opacity-60"]),onClick:p},[f.value==="mixed"?(v(),z(i(bg),{key:0,size:14,"aria-hidden":"true"})):f.value==="true"?(v(),z(i(Sa),{key:1,size:14,"aria-hidden":"true"})):ae("",!0)],10,V5)])):ae("",!0),(v(!0),_(ve,null,qe(L.value,H=>(v(),_("th",{key:H.key,scope:"col","aria-sort":$(H)?x(H)??"none":void 0,class:ye([[x(H)?"text-text":"text-muted",G(H)],"px-3.5 text-[12px] font-semibold first:pl-5 last:pr-5"])},[$(H)?(v(),_("button",{key:0,type:"button","data-sort":H.key,class:"inline-flex items-center gap-1 font-semibold",onClick:le=>a("sort",H.key)},[ke(D(H.label)+" ",1),x(H)==="ascending"?(v(),z(i(ug),{key:0,size:14,"aria-hidden":"true"})):x(H)==="descending"?(v(),z(i(og),{key:1,size:14,"aria-hidden":"true"})):ae("",!0)],8,j5)):(v(),_(ve,{key:1},[ke(D(H.label),1)],64))],10,z5))),128)),e.trailing?(v(),_("td",U5)):ae("",!0)])]),C("tbody",{"aria-busy":e.loading?"true":void 0},[e.loading?(v(!0),_(ve,{key:0},qe(T.value,H=>(v(),_("tr",{key:`skeleton-${H}`,"data-skeleton":"",class:ye([S.value,"border-b border-border"])},[e.selectable?(v(),_("td",W5,[...V[0]||(V[0]=[C("span",{class:"block size-[18px] rounded-checkbox bg-skel"},null,-1)])])):ae("",!0),(v(!0),_(ve,null,qe(L.value,le=>(v(),_("td",{key:le.key,class:"px-3.5 first:pl-5 last:pr-5"},[C("span",{class:ye([W[(H-1)%W.length],"block h-3 rounded-[6px] bg-skel"])},null,2)]))),128)),e.trailing?(v(),_("td",K5)):ae("",!0)],2))),128)):e.rows.length===0?(v(),_("tr",G5,[C("td",{colspan:j.value,class:"px-5 py-20 text-center"},[_e(X.$slots,"empty",{},()=>[C("span",J5,D(i(k)("backend::lang.list.no_records")),1)])],8,Y5)])):(v(!0),_(ve,{key:2},qe(e.rows,(H,le)=>(v(),_("tr",{key:o(H,le),class:ye([[S.value,m(H)?"bg-sel":s(H)||e.openable?"hover:bg-hover":"",s(H)||e.openable?"cursor-pointer":""],"border-b border-border transition-colors duration-150 ease-out"]),"aria-selected":e.selectable?m(H)?"true":"false":void 0,"data-row-states":I(H).length>0?I(H).join(" "):void 0,onClick:ue=>u(ue,H)},[e.selectable?(v(),_("td",X5,[C("button",{type:"button",role:"checkbox","aria-checked":m(H)?"true":"false","aria-label":i(k)("backend::lang.list.select_row"),class:ye([m(H)?"border-primary bg-primary text-on-primary":"border-border-strong bg-surface","flex size-[18px] items-center justify-center rounded-checkbox border"]),onClick:ue=>h(H)},[m(H)?(v(),z(i(Sa),{key:0,size:14,"aria-hidden":"true"})):ae("",!0)],10,Q5)])):ae("",!0),(v(!0),_(ve,null,qe(L.value,(ue,Oe)=>(v(),_("td",{key:ue.key,class:ye([R(ue,Oe,I(H)),"px-3.5 first:pl-5 last:pr-5"])},[g.value&&Oe===0?(v(),_("span",e6,[C("span",t6,D(O(H[ue.key])),1),e.openable?(v(),_("button",{key:0,type:"button","data-row-open":"",class:"min-w-0 truncate text-left font-semibold text-text",onClick:Ee=>q(Ee,H)},[F(cl,{column:ue,value:H[ue.key],row:H},null,8,["column","value","row"])],8,n6)):(v(),z(cl,{key:1,column:ue,value:H[ue.key],row:H},null,8,["column","value","row"]))])):Oe===0&&I(H).length>0?(v(),_("span",a6,[s(H)?(v(),z(i(ea),{key:0,to:s(H),class:ye(w(I(H)))},{default:B(()=>[F(cl,{column:ue,value:H[ue.key],row:H},null,8,["column","value","row"])]),_:2},1032,["to","class"])):(v(),_("span",{key:1,class:ye(w(I(H)))},[F(cl,{column:ue,value:H[ue.key],row:H},null,8,["column","value","row"])],2)),F(q5,{states:I(H),labels:e.stateLabels},null,8,["states","labels"])])):Oe===0&&s(H)?(v(),z(i(ea),{key:2,to:s(H),class:"text-text no-underline"},{default:B(()=>[F(cl,{column:ue,value:H[ue.key],row:H},null,8,["column","value","row"])]),_:2},1032,["to"])):(v(),z(cl,{key:3,column:ue,value:H[ue.key],row:H},null,8,["column","value","row"]))],2))),128)),e.trailing?(v(),_("td",r6,[_e(X.$slots,"trailing",{row:H})])):ae("",!0)],10,Z5))),128))],8,H5)],2)]))}}),l6=["aria-label"],o6={key:0,class:"flex flex-col gap-1 text-[13px]"},s6={class:"font-semibold text-muted"},i6=["data-filter","value","onChange"],u6=["value"],c6={key:1,class:"flex flex-col gap-1 text-[13px]"},d6={class:"mb-1 font-semibold text-muted"},f6={class:"flex items-center gap-2"},p6=["data-filter","aria-label","value","onChange"],v6=["data-filter","aria-label","value","onChange"],m6={key:2,class:"flex flex-col gap-1 text-[13px]"},h6={class:"font-semibold text-muted"},y6=["data-filter","value","onChange"],g6=["value"],mo="",Vs="h-button rounded-control border border-border-strong bg-surface px-3 text-text",b6=ne({__name:"FilterBar",props:{filters:{},values:{},source:{}},emits:["update"],setup(e,{emit:t}){const n=e,a=t;function r(f){if(f.options&&f.options.length>0)return f.options.map(p=>({value:JSON.stringify(p.value),label:p.label}));const m=[];return f.trueValue!==void 0&&m.push({value:JSON.stringify(f.trueValue),label:k("backend::lang.list.column_switch_true")}),f.falseValue!==void 0&&m.push({value:JSON.stringify(f.falseValue),label:k("backend::lang.list.column_switch_false")}),m}const l=P({});async function o(f){const{data:m}=await Be.GET("/{vendor}/{plugin}/{controller}/filters/{scope}/options",{params:{path:{...n.source,scope:f.name}}});l.value={...l.value,[f.name]:m?.data??[]}}St(()=>{for(const f of n.filters)f.type==="scope"&&o(f)});const s=Mn({});function u(){for(const f of n.filters){if(f.type!=="daterange")continue;const[m="",p=""]=(n.values[f.name]??"").split(".."),h=s[f.name];(!h||n.values[f.name]!==void 0||h.from!==""&&h.to!=="")&&(s[f.name]={from:m,to:p})}}Ue(()=>n.values,u,{immediate:!0,deep:!0});function c(f,m,p){const h={...s[f.name]??{from:"",to:""},[m]:p};s[f.name]=h,h.from!==""&&h.to!==""?a("update",f.name,`${h.from}..${h.to}`):(h.from===""&&h.to===""||n.values[f.name]!==void 0)&&a("update",f.name,null)}function d(f,m){a("update",f.name,m===mo?null:m)}return(f,m)=>(v(),_("div",{role:"group","aria-label":i(k)("backend::lang.list.filters"),"data-filter-bar":"",class:"flex flex-wrap items-end gap-4 border-t border-border px-5 py-3.5"},[(v(!0),_(ve,null,qe(e.filters,p=>(v(),_(ve,{key:p.name},[p.type==="switch"?(v(),_("label",o6,[C("span",s6,D(p.label||p.name),1),C("select",{"data-filter":p.name,value:e.values[p.name]??mo,class:ye(Vs),onChange:h=>d(p,h.target.value)},[C("option",{value:mo},D(i(k)("backend::lang.list.filter_all")),1),(v(!0),_(ve,null,qe(r(p),h=>(v(),_("option",{key:h.value,value:h.value},D(h.label),9,u6))),128))],40,i6)])):p.type==="daterange"?(v(),_("fieldset",c6,[C("legend",d6,D(p.label||p.name),1),C("div",f6,[C("input",{type:"date","data-filter":`${p.name}-from`,"aria-label":i(k)("backend::lang.list.filter_from"),value:s[p.name]?.from??"",class:ye(Vs),onChange:h=>c(p,"from",h.target.value)},null,40,p6),m[0]||(m[0]=C("span",{"aria-hidden":"true"},"–",-1)),C("input",{type:"date","data-filter":`${p.name}-to`,"aria-label":i(k)("backend::lang.list.filter_to"),value:s[p.name]?.to??"",class:ye(Vs),onChange:h=>c(p,"to",h.target.value)},null,40,v6)])])):p.type==="scope"?(v(),_("label",m6,[C("span",h6,D(p.label||p.name),1),(v(),_("select",{key:`${p.name}-${l.value[p.name]?.length??-1}`,"data-filter":p.name,value:e.values[p.name]??mo,class:ye(Vs),onChange:h=>d(p,h.target.value)},[C("option",{value:mo},D(i(k)("backend::lang.list.filter_all")),1),(v(!0),_(ve,null,qe(l.value[p.name]??[],h=>(v(),_("option",{key:h.value,value:h.value},D(h.label),9,g6))),128))],40,y6))])):ae("",!0)],64))),128))],8,l6))}}),_6=["type","disabled"],Ze=ne({__name:"Button",props:{variant:{default:"outline"},size:{default:"md"},type:{default:"button"},disabled:{type:Boolean,default:!1},icon:{default:void 0},to:{default:void 0}},setup(e){const t=e,n={primary:"bg-primary text-on-primary hover:opacity-90",outline:"border border-border-strong bg-surface text-text hover:bg-hover",ghost:"text-muted hover:bg-hover hover:text-text",danger:"border border-danger bg-surface text-danger hover:bg-danger-soft"},a=b(()=>["inline-flex shrink-0 items-center justify-center gap-2 rounded-control px-4 font-semibold whitespace-nowrap no-underline transition-colors duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-60",t.size==="sm"?"h-[38px]":"h-button",n[t.variant]]);return(r,l)=>e.to!==void 0?(v(),z(i(ea),{key:0,to:e.to,class:ye(a.value)},{default:B(()=>[e.icon?(v(),z(Bt(e.icon),{key:0,size:16,"aria-hidden":"true"})):ae("",!0),_e(r.$slots,"default")]),_:3},8,["to","class"])):(v(),_("button",{key:1,type:e.type,disabled:e.disabled,class:ye(a.value)},[e.icon?(v(),z(Bt(e.icon),{key:0,size:16,"aria-hidden":"true"})):ae("",!0),_e(r.$slots,"default")],10,_6))}}),x6=ne({__name:"BulkActionsMenu",props:{actions:{},disabled:{type:Boolean}},emits:["select"],setup(e,{expose:t,emit:n}){const a=n,r=P(null);function l(){const o=r.value?.$el;o instanceof HTMLElement&&o.focus()}return t({focus:l}),(o,s)=>(v(),z(i(t1),{modal:!1},{default:B(()=>[F(i(r1),{"as-child":"",disabled:e.disabled},{default:B(()=>[F(Ze,{ref_key:"trigger",ref:r,variant:"outline",size:"md","data-action":"bulk-actions",disabled:e.disabled},{default:B(()=>[ke(D(i(k)("backend::lang.list.bulk_actions"))+" ",1),F(i(lr),{size:16,class:"text-muted","aria-hidden":"true"})]),_:1},8,["disabled"])]),_:1},8,["disabled"]),F(i(a1),null,{default:B(()=>[F(i(n1),{"data-bulk-menu":"",align:"end","side-offset":8,class:"z-50 flex w-[240px] max-w-[320px] flex-col rounded-[14px] border border-border bg-surface p-2 text-text shadow-menu"},{default:B(()=>[(v(!0),_(ve,null,qe(e.actions,u=>(v(),z(i(xd),{key:u.name,"data-bulk-action":u.name,class:"flex min-h-10 cursor-pointer items-center rounded-control px-3 py-2 outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover",onSelect:c=>a("select",u.name)},{default:B(()=>[ke(D(u.label),1)]),_:2},1032,["data-bulk-action","onSelect"]))),128))]),_:1})]),_:1})]),_:1}))}}),k6={class:"flex flex-wrap items-center justify-between gap-3 px-5 py-4"},w6={key:0,class:"relative block w-[320px] max-w-full"},$6={class:"sr-only"},C6=["value","placeholder"],S6={key:1},E6={class:"flex flex-wrap items-center justify-end gap-2.5"},A6={key:0,"data-selected-pill":"",class:"inline-flex h-8 items-center gap-1.5 rounded-pill bg-sel px-3 text-[13px] font-semibold"},T6=ne({__name:"ListToolbar",props:{showSearch:{type:Boolean},search:{},searchPrompt:{},buttons:{},selectedCount:{},selectedLabel:{},deleteLabel:{},actions:{default:()=>[]},busyAction:{default:null},bulkActions:{default:()=>[]},bulkBusy:{type:Boolean,default:!1}},emits:["update:search","delete","action","bulk"],setup(e,{expose:t,emit:n}){const a=e,r=n,l=b(()=>new Map(a.actions.map(u=>[u.name,u.label]))),o=P(null);function s(){o.value?.focus()}return t({focusBulk:s}),(u,c)=>(v(),_("div",k6,[e.showSearch?(v(),_("label",w6,[C("span",$6,D(i(k)("backend::lang.list.search")),1),F(i(lu),{size:18,class:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"}),C("input",{type:"search","data-list-search":"",value:e.search,placeholder:e.searchPrompt,class:"h-button w-full rounded-control border border-transparent bg-subtle pr-3.5 pl-10",onInput:c[0]||(c[0]=d=>r("update:search",d.target.value))},null,40,C6)])):(v(),_("span",S6)),C("div",E6,[e.selectedCount>0?(v(),_("span",A6,[F(i(Sa),{size:14,"aria-hidden":"true"}),ke(D(e.selectedLabel),1)])):ae("",!0),e.bulkActions.length>0?(v(),z(x6,{key:1,ref_key:"bulkMenu",ref:o,actions:e.bulkActions,disabled:e.selectedCount===0||e.bulkBusy,onSelect:c[1]||(c[1]=d=>r("bulk",d))},null,8,["actions","disabled"])):ae("",!0),(v(!0),_(ve,null,qe(e.buttons,d=>(v(),_(ve,{key:d},[d==="delete"?(v(),z(Ze,{key:0,"data-action":"delete",variant:e.selectedCount>0?"danger":"outline",icon:i(hr),disabled:e.selectedCount===0,onClick:c[2]||(c[2]=f=>r("delete"))},{default:B(()=>[ke(D(e.deleteLabel),1)]),_:1},8,["variant","icon","disabled"])):l.value.has(d)?(v(),z(Ze,{key:1,variant:"outline",size:"md","data-action":d,disabled:e.busyAction===d,"aria-busy":e.busyAction===d?"true":void 0,onClick:f=>r("action",d)},{default:B(()=>[ke(D(l.value.get(d)),1)]),_:2},1032,["data-action","disabled","aria-busy","onClick"])):ae("",!0)],64))),128))])]))}}),D6={class:"flex flex-wrap items-center gap-x-6 gap-y-3 border-t border-border px-5 py-3.5 text-[13px] text-muted"},O6={"data-range":""},M6={key:0,class:"flex items-center gap-2"},P6=["value"],R6=["value"],I6=["aria-label"],q6=["disabled"],N6={key:0,"aria-hidden":"true",class:"px-1"},L6=["data-page","aria-current","onClick"],B6=["disabled"],kc="inline-flex h-pager min-w-pager items-center justify-center gap-1 rounded-pager border border-border px-2.5 text-[13px] text-text disabled:cursor-not-allowed disabled:opacity-60 hover:bg-hover",T1=ne({__name:"Pagination",props:{meta:{},loading:{type:Boolean},perPageOptions:{},perPage:{}},emits:["page","perPage"],setup(e,{emit:t}){const n=e,a=t,r=b(()=>n.meta?.total??0),l=b(()=>n.meta?.page??1),o=b(()=>Math.max(n.meta?.last_page??1,1)),s=b(()=>{const d=n.meta;if(!d||d.total===0)return Br("backend::lang.list.results",0);const f=(d.page-1)*d.per_page+1,m=Math.min(d.page*d.per_page,d.total);return k("backend::lang.list.pagination_range",{from:f,to:m,total:d.total})}),u=b(()=>{const d=o.value,f=l.value,m=new Set([1,d,f-1,f,f+1].filter(x=>x>=1&&x<=d));f<=3&&[2,3].forEach(x=>x<=d&&m.add(x)),f>=d-2&&[d-1,d-2].forEach(x=>x>=1&&m.add(x));const p=[...m].sort((x,$)=>x-$),h=[];return p.forEach((x,$)=>{const g=p[$-1];g!==void 0&&x-g>1&&h.push(null),h.push(x)}),h});function c(d){const f=Number(d.target.value);Number.isFinite(f)&&f>0&&a("perPage",f)}return(d,f)=>(v(),_("footer",D6,[C("span",O6,D(e.loading?i(k)("backend::lang.list.loading"):s.value),1),e.perPageOptions.length>1?(v(),_("label",M6,[C("span",null,D(i(k)("backend::lang.list.records_per_page")),1),C("select",{"data-per-page":"",value:String(e.perPage),class:"h-pager rounded-pager border border-border-strong bg-surface px-2 text-text",onChange:c},[(v(!0),_(ve,null,qe(e.perPageOptions,m=>(v(),_("option",{key:m,value:String(m)},D(m),9,R6))),128))],40,P6)])):ae("",!0),!e.loading&&r.value>0?(v(),_("nav",{key:1,"aria-label":i(k)("backend::lang.list.pagination"),class:"ml-auto flex items-center gap-1.5"},[C("button",{type:"button","data-page":"prev",class:ye(kc),disabled:l.value<=1,onClick:f[0]||(f[0]=m=>a("page",l.value-1))},[F(i(ru),{size:14,"aria-hidden":"true"}),ke(D(i(k)("backend::lang.list.prev_page")),1)],8,q6),(v(!0),_(ve,null,qe(u.value,(m,p)=>(v(),_(ve,{key:m??`gap-${p}`},[m===null?(v(),_("span",N6,"…")):(v(),_("button",{key:1,type:"button","data-page":m,"aria-current":m===l.value?"page":void 0,class:ye([kc,m===l.value?"border-transparent bg-sel font-bold":""]),onClick:h=>m!==l.value&&a("page",m)},D(m),11,L6))],64))),128)),C("button",{type:"button","data-page":"next",class:ye(kc),disabled:l.value>=o.value,onClick:f[1]||(f[1]=m=>a("page",l.value+1))},[ke(D(i(k)("backend::lang.list.next_page")),1),F(i(ps),{size:14,"aria-hidden":"true"})],8,B6)],8,I6)):ae("",!0)]))}}),F6={role:"alert","data-extension-failure":"",class:"flex min-h-input items-center rounded-control border-[1.5px] border-dashed border-border-strong bg-subtle px-3.5 py-2.5 text-[13px] text-muted"},V6={class:"flex min-w-0 items-start gap-2.5"},z6={class:"min-w-0 [overflow-wrap:anywhere]"},$u=ne({__name:"ExtensionFailure",props:{text:{}},setup(e){return(t,n)=>(v(),_("div",F6,[C("span",V6,[F(i(gt),{size:16,class:"mt-0.5 shrink-0 text-danger","aria-hidden":"true"}),C("span",z6,D(e.text),1)])]))}}),j6=new Set(["div","span","p","strong","em","b","i","u","s","small","mark","code","pre","br","hr","ul","ol","li","dl","dt","dd","h2","h3","h4","h5","h6","table","thead","tbody","tfoot","tr","th","td","caption","section","header","footer","figure","figcaption","blockquote","q","abbr","time","data","meter","progress","sup","sub","a","img"]),U6=new Set(["script","style","template","iframe","object","embed","noscript","textarea","title","xmp","svg","math","form","input","button","select","link","meta","base"]),H6=32,W6=2e3,K6=new Set(["class","title","lang","dir","role"]),G6={a:new Set(["href"]),img:new Set(["src","alt","width","height"]),td:new Set(["colspan","rowspan","scope"]),th:new Set(["colspan","rowspan","scope"]),time:new Set(["datetime"]),data:new Set(["value"]),meter:new Set(["value","min","max","low","high","optimum"]),progress:new Set(["value","max"])},Y6=/^(aria|data)-[a-z0-9_-]+$/;function J6(e,t){if(e==="")return!1;for(const n of e){const a=n.codePointAt(0)??0;if(a<=32||a===127)return!1}return e.startsWith("#")?t:e.startsWith("/")?e.length===1||e[1]!=="/"&&e[1]!=="\\":!1}function Z6(e,t,n){return K6.has(t)||G6[e]?.has(t)===!0||Y6.test(t)?e==="a"&&t==="href"||e==="img"&&t==="src"?J6(n,e==="a"):!0:!1}function X6(e,t){const n={};for(const[a,r]of Object.entries(t??{})){const l=a.toLowerCase();typeof r=="string"&&Z6(e,l,r)&&(n[l]=r)}return n}function Cd(e,t,n){const a=[];for(const r of e??[]){if(n.left<=0)break;if(r.tag===void 0||r.tag===""){typeof r.text=="string"&&r.text!==""&&(n.left-=1,a.push(r.text));continue}const l=r.tag.toLowerCase();if(U6.has(l))continue;if(!j6.has(l)){a.push(...Cd(r.children,t,n));continue}if(t+1>H6)continue;n.left-=1;const o=Cd(r.children,t+1,n);a.push(En(l,X6(l,r.attrs),o.length>0?o:void 0))}return a}function Q6(e){return Cd(e,0,{left:W6})}const e8={key:1,"data-partial-loading":"","aria-busy":"true"},t8=["data-partial","aria-busy"],Wf=ne({__name:"PartialHost",props:{source:{},name:{},recordId:{default:null},variant:{},reloadKey:{default:0},hint:{type:Boolean,default:!1}},setup(e){const t=e,n=P(null),a=P(!1),r=P(!1);let l=0;const o=u=>Q6(u.nodes);o.props=["nodes"];async function s(){const u=++l;r.value=!0;let c=null;try{c=(await Be.GET("/{vendor}/{plugin}/{controller}/partials/{name}",{params:{path:{...t.source,name:t.name},query:t.recordId!=null?{id:t.recordId}:void 0}})).data?.data.nodes??null}catch{c=null}u===l&&(r.value=!1,a.value=c===null,n.value=c)}return Ue(()=>t.reloadKey,()=>{s()}),s(),(u,c)=>a.value?(v(),z($u,{key:0,"data-partial-failed":"",text:i(k)("backend::lang.extension.partial_failed")},null,8,["text"])):n.value===null?(v(),_("div",e8,[C("div",{"data-partial-skeleton":"",class:ye([e.hint?"h-[68px] w-full rounded-inner":e.variant==="header"?"h-[80px] w-full rounded-card":"h-[44px] w-full rounded-control","bg-skel"]),"aria-hidden":"true"},null,2)])):n.value.length>0?(v(),_("div",{key:2,class:"summer-partial","data-partial":e.variant,"aria-busy":r.value?"true":void 0},[F(o,{nodes:n.value},null,8,["nodes"])],8,t8)):ae("",!0)}}),n8={class:"flex gap-2.5"},a8=["disabled","aria-busy"],br=ne({__name:"ConfirmDialog",props:{open:{type:Boolean},message:{},title:{default:void 0},confirmLabel:{default:void 0},cancelLabel:{default:void 0},danger:{type:Boolean,default:!1},busy:{type:Boolean,default:!1}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,a=t;function r(o){!o&&n.busy||(a("update:open",o),o||a("cancel"))}function l(){n.busy||(a("confirm"),a("update:open",!1))}return(o,s)=>(v(),z(i(T3),{open:e.open,"onUpdate:open":r},{default:B(()=>[F(i(E3),null,{default:B(()=>[F(i(C3),{class:"pointer-events-auto fixed inset-0 z-[80] bg-overlay"}),F(i(b3),{"data-confirm-dialog":"",class:"pointer-events-auto fixed top-1/2 left-1/2 z-[90] flex w-[calc(100%-32px)] max-w-[440px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-modal bg-surface p-6 text-text shadow-pop"},{default:B(()=>[F(i(O3),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:B(()=>[ke(D(e.title??i(k)("backend::lang.form.confirm")),1)]),_:1}),F(i(w3),{class:"text-muted [overflow-wrap:anywhere]"},{default:B(()=>[ke(D(e.message),1)]),_:1}),C("div",n8,[F(i(x3),{"data-action":"cancel",disabled:e.busy,class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60"},{default:B(()=>[ke(D(e.cancelLabel??i(k)("backend::lang.form.cancel")),1)]),_:1},8,["disabled"]),C("button",{type:"button","data-action":"confirm",disabled:e.busy,"aria-busy":e.busy?"true":void 0,class:ye([e.danger?"bg-danger text-white":"bg-primary text-on-primary","inline-flex h-button flex-1 items-center justify-center gap-2 rounded-control font-semibold hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60"]),onClick:mt(l,["prevent"])},[e.busy?(v(),z(i(Al),{key:0,size:16,class:"animate-spin","aria-hidden":"true"})):ae("",!0),ke(" "+D(e.confirmLabel??i(k)("backend::lang.form.confirm")),1)],10,a8)])]),_:1})]),_:1})]),_:1},8,["open"]))}});function _r(){const e=P(null),t=P(!1);let n=null,a=null;function r(u){const c=n;n=null,a=null,e.value=null,c?.(u)}function l(u,c){return r(!1),e.value=u,a=c??null,new Promise(d=>{n=d})}async function o(){if(t.value)return;const u=a;if(u){t.value=!0;try{await u()}finally{t.value=!1}}r(!0)}function s(){t.value||r(!1)}return{request:e,busy:t,ask:l,confirm:o,cancel:s}}const r8={class:"flex flex-col gap-5"},l8={class:"flex flex-wrap items-end justify-between gap-4"},o8={class:"flex flex-col"},s8={class:"text-[26px] font-bold tracking-[-0.02em]"},i8={key:0,"data-record-count":"",class:"text-muted"},u8={key:0,class:"flex items-center gap-2.5"},c8={class:"overflow-hidden rounded-card border border-border bg-surface shadow-card"},d8={key:2,"data-list-failed":"",class:"flex flex-wrap items-center justify-between gap-3 border-t border-border px-5 py-4"},f8={role:"alert",class:"text-danger"},p8={key:0,"data-empty-search":"",class:"flex flex-col items-center gap-3"},v8={class:"flex size-14 items-center justify-center rounded-full bg-subtle text-muted"},m8={class:"text-[17px] font-bold"},h8={class:"max-w-[420px] text-muted"},y8={key:1,"data-empty-list":"",class:"text-muted"},g8=300,b8=ne({__name:"ListView",setup(e){const t=Tn(),n=Wr(),a={vendor:String(t.params.vendor??""),plugin:String(t.params.plugin??""),controller:String(t.params.controller??"")},r=us(a),l=qn(r)??"/",o=P(null),s=P([]),u=P(null),c=P(!0),d=P(!1),f=P(!1),m=b(()=>d.value||f.value),p=P([]),h=P(!1),x=P(0),$=_r(),g=b(()=>s1(t.query)),S=P(g.value.search??""),T=b(()=>o.value?.messages),O=b(()=>o.value?.title?o.value.title:ds(a.vendor,a.plugin)?.sideMenu.find($e=>$e.controller===r)?.label??r),E=b(()=>u.value?Ye(T.value?.recordCount,u.value.total):""),I=b(()=>o.value?.toolbarButtons??[]),R=b(()=>I.value.filter(oe=>oe==="create")),G=b(()=>{const oe=o.value?.reorder;if(!oe)return null;const $e=oe.partition?.column,he=$e?o.value?.filters.find(Fe=>Fe.column===$e||Fe.name===$e):void 0,Re=he?g.value.filter?.[he.name]:void 0;return{path:`${l}/reorder`,query:Re!==void 0&&Re!==""?{partition:String(Re)}:{}}}),w=b(()=>o.value?.toolbarActions??[]),L=b(()=>I.value.filter(oe=>oe==="delete"||w.value.some($e=>$e.name===oe))),j=P(null),q=b(()=>u.value?.row_states??{}),W=b(()=>({deleted:Ye(T.value?.rowStateDeleted),negative:Ye(T.value?.rowStateNegative),disabled:Ye(T.value?.rowStateDisabled)})),X=b(()=>(o.value?.bulkActions??[]).filter(oe=>oe.name!=="delete")),V=P(!1),H=P(null),le=b(()=>{const oe=o.value?.perPageOptions??[];return oe.length>0?oe:[o.value?.recordsPerPage||20]}),ue=b(()=>g.value.per_page??u.value?.per_page??o.value?.recordsPerPage??20),Oe=b(()=>g.value.sort?{column:g.value.sort,dir:g.value.dir==="desc"?"desc":"asc"}:null);function Ee(oe){const $e=o.value?.recordUrl,he=oe.id;return!$e||typeof he!="number"&&typeof he!="string"?null:S1($e,r,he)}function pe(oe){Fs(r,oe),n.replace({path:t.path,query:Pi(oe)})}const fe=kl({}),ge=b(()=>kl(g.value)!==fe);let K=0,xe=null;function re(){pe({})}async function Q(oe=!1){const $e=++K;c.value=!0,f.value=!1;let he=null;try{he=await Z()}catch{he=null}if($e!==K)return;if(!he?.data&&oe){Fs(r,{}),n.replace({path:t.path,query:{}});return}if(!he?.data&&he?.response?.status===404&&await ce($e))return;if(s.value=he?.data?.data??[],u.value=he?.data?.meta??null,f.value=!he?.data,c.value=!1,he?.response?.status===422){Fs(r,{});return}const Re=u.value?.last_page??0;Re>=1&&(u.value?.page??0)>Re&&pe({...g.value,page:Re})}async function ce(oe){try{const{data:$e}=await Be.GET("/{vendor}/{plugin}/{controller}/singleton",{params:{path:a}});return oe!==K?!0:$e?(await n.replace(`${l}/${$e.data.id}`),!0):!1}catch{return!1}}function Z(){return Be.GET("/{vendor}/{plugin}/{controller}",{params:{path:a,query:g.value}})}async function U(){const oe=await Be.GET("/{vendor}/{plugin}/{controller}/schema/list",{params:{path:a}});o.value=oe.data?.data??null,d.value=!o.value,o.value&&Hf(r,o.value.assets)}U(),Ue(()=>kl(g.value),oe=>{if(oe===fe){const he=IM(r),Re=kl(he);if(Re!==fe){xe=Re,n.replace({path:t.path,query:Pi(he)});return}}const $e=xe!==null&&xe===oe;xe=null,Fs(r,g.value),p.value=[],S.value=g.value.search??"",Q($e)},{immediate:!0});let te=null;function y(oe){S.value=oe,te!==null&&clearTimeout(te),te=setTimeout(()=>{te=null;const $e=oe.trim();pe({...g.value,search:$e===""?void 0:$e,page:void 0})},g8)}Dt(()=>{te!==null&&clearTimeout(te)});function A(){S.value="",pe({...g.value,search:void 0,page:void 0})}function M(oe){const $e=Oe.value;$e?.column!==oe?pe({...g.value,sort:oe,dir:"asc",page:void 0}):$e.dir==="asc"?pe({...g.value,sort:oe,dir:"desc",page:void 0}):pe({...g.value,sort:void 0,dir:void 0,page:void 0})}function ie(oe){pe({...g.value,page:oe})}function Y(oe){pe({...g.value,per_page:oe,page:void 0})}function de(oe,$e){const he={...g.value.filter??{}};$e===null?delete he[oe]:he[oe]=$e,pe({...g.value,filter:he,page:void 0})}async function we(){const oe=p.value.map(Number).filter(he=>Number.isInteger(he)&&he>0);if(!(oe.length===0||h.value||!await $.ask({message:Ye(T.value?.deleteConfirm,oe.length),confirmLabel:k("backend::lang.form.delete"),danger:!0}))){h.value=!0;try{const he=await Be.POST("/{vendor}/{plugin}/{controller}/bulk-delete",{params:{path:a},body:{ids:oe}});if(he.data){Ne(Ye(T.value?.deleted,he.data.data.deleted)),p.value=[],await Q(),x.value+=1;return}Ne(he.error?.error.message||k("backend::lang.list.delete_failed"),"danger")}catch{Ne(k("backend::lang.list.delete_failed"),"danger")}finally{h.value=!1}}}async function Se(oe){const $e=X.value.find(Le=>Le.name===oe),he=p.value.map(Number).filter(Le=>Number.isInteger(Le)&&Le>0);if(!$e||he.length===0||V.value)return;const Re=$e.label??oe;let Fe=0,Ke=null,Je="";const be=await $.ask({message:$e.confirm||Br("backend::lang.list.bulk_confirm",he.length,{action:Re}),confirmLabel:Re,danger:!1},async()=>{V.value=!0;try{const Le=await Be.POST("/{vendor}/{plugin}/{controller}/bulk/{action}",{params:{path:{...a,action:oe}},body:{ids:he}});Fe=Le.response.status,Ke=Le.data?.data??null,Je=Le.error?.error.message??""}catch{Fe=0}finally{V.value=!1}});if(await new Promise(Le=>setTimeout(Le,0)),H.value?.focusBulk(),!be)return;const Me=Ke;if(Me){Ne(Me.message||Br("backend::lang.list.bulk_done",Me.affected)),p.value=[],await Q(),x.value+=1;return}if(Fe===409){Ne(k("backend::lang.list.bulk_stale"),"danger"),p.value=[],await Q();return}if(Fe===403){Ne(Je||k("backend::lang.list.action_forbidden"),"danger");return}Ne(Je||k("backend::lang.extension.action_failed"),"danger")}async function Ae(oe){if(j.value===null){j.value=oe;try{const $e=await Be.POST("/{vendor}/{plugin}/{controller}/toolbar/{action}",{params:{path:{...a,action:oe}},body:{}});if($e.data){$e.data.data.message&&Ne($e.data.data.message),await Q(),x.value+=1;return}Ne($e.error?.error.message||k("backend::lang.extension.action_failed"),"danger")}catch{Ne(k("backend::lang.extension.action_failed"),"danger")}finally{j.value=null}}}return(oe,$e)=>(v(),_("section",r8,[C("header",l8,[C("div",o8,[C("h1",s8,D(O.value),1),E.value?(v(),_("p",i8,D(E.value),1)):ae("",!0)]),R.value.length>0||G.value?(v(),_("div",u8,[G.value?(v(),z(Ze,{key:0,"data-action":"reorder",variant:"outline",icon:i(sg),to:G.value},{default:B(()=>[ke(D(i(k)("backend::lang.messages.list.reorder")),1)]),_:1},8,["icon","to"])):ae("",!0),(v(!0),_(ve,null,qe(R.value,he=>(v(),z(Ze,{key:he,"data-action":"create",variant:"primary",icon:i(ms),to:`${i(l)}/create`},{default:B(()=>[ke(D(i(Ye)(T.value?.create)),1)]),_:1},8,["icon","to"]))),128))])):ae("",!0)]),o.value?.headerPartial?(v(),z(Wf,{key:0,variant:"header",source:a,name:o.value.headerPartial,"reload-key":x.value},null,8,["name","reload-key"])):ae("",!0),C("div",c8,[o.value?(v(),z(T6,{key:0,ref_key:"toolbar",ref:H,"show-search":o.value.showSearch,search:S.value,"search-prompt":i(Ye)(T.value?.searchPrompt),buttons:L.value,"selected-count":p.value.length,"selected-label":i(Ye)(T.value?.selected,p.value.length),"delete-label":i(Ye)(T.value?.deleteSelected,p.value.length),actions:w.value,"busy-action":j.value,"bulk-actions":X.value,"bulk-busy":V.value,"onUpdate:search":y,onDelete:we,onAction:Ae,onBulk:Se},null,8,["show-search","search","search-prompt","buttons","selected-count","selected-label","delete-label","actions","busy-action","bulk-actions","bulk-busy"])):ae("",!0),o.value&&o.value.filters.length>0?(v(),z(b6,{key:1,filters:o.value.filters,values:g.value.filter??{},source:a,onUpdate:de},null,8,["filters","values"])):ae("",!0),m.value&&!c.value?(v(),_("div",d8,[C("p",f8,D(i(k)("backend::lang.list.load_failed")),1),f.value&&ge.value?(v(),z(Ze,{key:0,"data-action":"reset-list",onClick:re},{default:B(()=>[ke(D(i(k)("backend::lang.list.reset_list")),1)]),_:1})):ae("",!0)])):(v(),z(A1,{key:3,columns:o.value?.columns??[],rows:s.value,loading:c.value||!o.value,"row-link":Ee,selectable:o.value?.showCheckboxes??!1,selected:p.value,sortable:o.value?.showSorting??!1,sort:Oe.value,"row-states":q.value,"state-labels":W.value,"onUpdate:selected":$e[0]||($e[0]=he=>p.value=he),onSort:M},{empty:B(()=>[g.value.search?(v(),_("div",p8,[C("span",v8,[F(i(wg),{size:24,"aria-hidden":"true"})]),C("p",m8,D(i(Ye)(T.value?.emptySearch,void 0,{term:g.value.search})),1),C("p",h8,D(i(Ye)(T.value?.emptySearchHint,void 0,{term:g.value.search})),1),F(Ze,{"data-action":"clear-search",onClick:A},{default:B(()=>[ke(D(i(k)("backend::lang.list.clear_search")),1)]),_:1})])):(v(),_("p",y8,D(i(Ye)(T.value?.empty)||o.value?.noRecordsMessage||i(k)("backend::lang.list.no_records")),1))]),_:1},8,["columns","rows","loading","selectable","selected","sortable","sort","row-states","state-labels"])),F(T1,{meta:u.value,loading:c.value||!o.value,"per-page-options":le.value,"per-page":ue.value,onPage:ie,onPerPage:Y},null,8,["meta","loading","per-page-options","per-page"])]),F(br,{open:i($).request.value!==null,message:i($).request.value?.message??"","confirm-label":i($).request.value?.confirmLabel,danger:i($).request.value?.danger,busy:i($).busy.value,onConfirm:i($).confirm,onCancel:i($).cancel},null,8,["open","message","confirm-label","danger","busy","onConfirm","onCancel"])]))}}),dr="X-Session-Key",D1="X-Child-Session-Key",_8=32;function ns(){const e=new Uint8Array(_8);globalThis.crypto.getRandomValues(e);let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const x8="X-Upload-Id";async function er(e){try{const t=await e();return{data:t.data?t.data.data:null,status:t.response.status,error:t.error?.error??null}}catch{return{data:null,status:0,error:null}}}async function Ri(e){try{const t=await e();return t.response.ok&&t.data instanceof Blob?t.data:null}catch{return null}}function ba(e){return encodeURIComponent(String(e))}function O1(e){return`${au.api}/${ba(e.vendor)}/${ba(e.plugin)}/${ba(e.controller)}`}function k8(e){try{return e===""?null:JSON.parse(e)}catch{return null}}function Kf(e){if(!e)return"";for(const t of Object.values(e.details??{})){const n=Array.isArray(t)?t.find(a=>typeof a=="string"&&a!==""):t;if(typeof n=="string"&&n!=="")return n}return e.message??""}function w8(e,t){const n=t;if((e===200||e===201)&&n?.data)return{ok:!0,item:n.data};const a=Kf(n?.error);return e===413?{ok:!1,reason:"too_large",status:e,message:a}:e===422?{ok:!1,reason:"invalid",status:e,message:a}:e===0?{ok:!1,reason:"network",status:e,message:a}:{ok:!1,reason:"failed",status:e,message:a}}function M1(e,t,n,a,r){let l=null,o=!1;const s=()=>new Promise(c=>{const d=new XMLHttpRequest;l=d,d.open("POST",e),d.setRequestHeader("X-Requested-With",Qy),d.setRequestHeader("Accept","application/json");for(const[m,p]of Object.entries(n))d.setRequestHeader(m,p);r&&d.setRequestHeader(x8,r),d.upload.onprogress=m=>{m.lengthComputable&&a?.(m.loaded,m.total)},d.onload=()=>c({status:d.status,body:k8(d.responseText)}),d.onerror=()=>c("network"),d.ontimeout=()=>c("network"),d.onabort=()=>c("aborted");const f=new FormData;f.append("file_data",t,t.name),d.send(f)});return{promise:(async()=>{let c=await s();return typeof c=="object"&&c.status===401&&!o&&(await Kd()&&(c=o?"aborted":await s()),typeof c=="object"&&c.status===401&&hw()),c==="aborted"||o?{ok:!1,reason:"aborted",status:0,message:""}:c==="network"?{ok:!1,reason:"network",status:0,message:""}:w8(c.status,c.body)})(),abort(){o=!0,l?.abort()}}}function P1(e,t,n,a){const r={...e,id:t,field:n},l={[dr]:a},o=`${O1(e)}/${ba(t)}/files/${ba(n)}`;return{list:()=>er(()=>Be.GET("/{vendor}/{plugin}/{controller}/{id}/files/{field}",{params:{path:r,header:l}})),upload:(s,u,c)=>M1(o,s,{...l},u,c),update:(s,u)=>er(()=>Be.PUT("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}",{params:{path:{...r,file:s},header:l},body:u})),remove:s=>er(()=>Be.DELETE("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}",{params:{path:{...r,file:s},header:l}})),reorder:s=>er(()=>Be.POST("/{vendor}/{plugin}/{controller}/{id}/files/{field}/reorder",{params:{path:r,header:l},body:{ids:s}})),download:s=>Ri(()=>Be.GET("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}/download",{params:{path:{...r,file:s},header:l},parseAs:"blob"})),thumb:s=>Ri(()=>Be.GET("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}/thumb",{params:{path:{...r,file:s},header:l},parseAs:"blob"}))}}function $8(e,t,n,a,r,l,o){const s={...e,id:t,name:n,child:a,field:r},u={[dr]:l,[D1]:o},c=`${O1(e)}/${ba(t)}/relations/${ba(n)}/records/${ba(a)}/files/${ba(r)}`;return{list:()=>er(()=>Be.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}",{params:{path:s,header:u}})),upload:(d,f,m)=>M1(c,d,{...u},f,m),update:(d,f)=>er(()=>Be.PUT("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}",{params:{path:{...s,file:d},header:u},body:f})),remove:d=>er(()=>Be.DELETE("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}",{params:{path:{...s,file:d},header:u}})),reorder:d=>er(()=>Be.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/reorder",{params:{path:s,header:u},body:{ids:d}})),download:d=>Ri(()=>Be.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}/download",{params:{path:{...s,file:d},header:u},parseAs:"blob"})),thumb:d=>Ri(()=>Be.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}/thumb",{params:{path:{...s,file:d},header:u},parseAs:"blob"}))}}const C8=new Set(["readonly","placeholder","maxlength","minlength","min","max","step","autocomplete","spellcheck","pattern"]);function xr(e){const t={};for(const[n,a]of Object.entries(e.attributes??{})){const r=n.toLowerCase();!C8.has(r)||a===null||a===!1||(t[r]=a)}return t}function qt(e){return["w-full rounded-control border bg-surface px-3.5 text-text transition-colors duration-150 ease-out",e?"border-danger":"border-border-strong"].join(" ")}function Gf(e){return typeof e=="string"?e!==""&&e!=="0"&&e.toLowerCase()!=="false":!!e}function R1(e,t){return typeof e=="number"?t?1:0:t}function I1(e,t){const n={};if(t===null||typeof t!="object"||Array.isArray(t))return n;const a=t;for(const r of e.permissionOptions??[]){const l=Number(a[r.code]);(l===1||e.mode==="radio"&&l===-1)&&(n[r.code]=l)}return n}const S8=new Set(["mltext","mltextarea","mlmarkdown"]);function E8(e){return e!==void 0&&S8.has(e)}function fr(e){return e?E8(e.type)||!!e.element&&e.translatable===!0:!1}const as="summer:ml-locale";function A8(e){typeof window>"u"||e===""||window.dispatchEvent(new CustomEvent(as,{detail:e}))}function Zn(e){const t={};if(e===null||typeof e!="object"||Array.isArray(e))return t;for(const[n,a]of Object.entries(e))typeof a=="string"&&(t[n]=a);return t}const T8={class:"flex min-w-0 flex-col"},D8=["for"],O8={key:0,class:"text-danger","aria-hidden":"true"},M8=["id"],P8=["id","name","checked","aria-invalid","aria-describedby"],R8=ne({__name:"CheckboxField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=b(()=>Gf(n.modelValue));function l(o){a("update:modelValue",R1(n.modelValue,o.target.checked))}return(o,s)=>(v(),_("div",{class:ye([e.invalid?"border-danger":"border-border","flex items-center justify-between gap-4 rounded-inner border px-4 py-3.5"]),"data-toggle-card":""},[C("div",T8,[C("label",{for:e.controlId,class:"font-semibold"},[ke(D(e.field.label||e.field.name),1),e.field.required?(v(),_("span",O8," *")):ae("",!0)],8,D8),e.field.comment?(v(),_("p",{key:0,id:`${e.controlId}-comment`,class:"text-[13px] text-muted"},D(e.field.comment),9,M8)):ae("",!0)]),C("input",{id:e.controlId,type:"checkbox",name:e.field.name,checked:r.value,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"size-5 shrink-0 rounded-[6px] accent-primary",onChange:l},null,40,P8)],2))}});function I8(e){return e==="date"||e==="time"?e:"datetime"}function rn(e,t=2){return String(e).padStart(t,"0")}const q8=/(Z|[+-]\d{2}:?\d{2})$/i;function N8(e,t,n=!1){if(typeof t!="string"||t.trim()==="")return null;const a=t.trim();try{if(e==="date")return tb(a.slice(0,10));if(e==="time"){const l=/(\d{2}:\d{2}(:\d{2})?)/.exec(a.includes("T")?a.slice(a.indexOf("T")):a);return l?WE(l[1]):null}const r=q8.test(a)?a.replace(" ","T"):`${a.replace(" ","T")}Z`;return n?na(Uv(r,"UTC")):Uv(r,Ln())}catch{return null}}function wc(e){return`${rn(e.year,4)}-${rn(e.month)}-${rn(e.day)}`}function $c(e){return`${rn(e.hour)}:${rn(e.minute)}:${rn(e.second)}`}function Rm(e,t,n=!1){if(!t)return null;if(e==="time")return"hour"in t?$c(t):null;if(!("year"in t))return null;if(e==="date")return wc(t);if(n){const l=t instanceof Ea?na(t):t,o="hour"in l?$c(l):"00:00:00";return`${wc(l)}T${o}Z`}const a=t instanceof Ea?t:df(t instanceof ht?na(t):t,Ln()),r=fu(a,"UTC");return`${wc(r)}T${$c(r)}Z`}const L8={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm",time:"HH:mm"},B8=/\[([^\]]*)\]|YYYY|YY|MMMM|MMM|MM|M|dddd|ddd|DD|D|HH|H|hh|h|mm|ss|A|a/g;function F8(e){return"year"in e?new ht(e.year,e.month,e.day):null}function Cc(e,t,n,a){return new Dn(e,{...n,timeZone:"UTC"}).formatToParts(t.toDate("UTC")).find(l=>l.type===a)?.value??""}function V8(e,t,n,a){if(!e)return"";const r=n||L8[t],l=F8(e),o="hour"in e?e:null,s=/D/.test(r.replace(/\[[^\]]*\]/g,""));return r.replace(B8,(u,c)=>{if(c!==void 0)return c;switch(u){case"YYYY":return l?rn(l.year,4):"";case"YY":return l?rn(l.year%100):"";case"MMMM":case"MMM":{if(!l)return"";const d=u==="MMMM"?"long":"short";return s?Cc(a,l,{day:"numeric",month:d},"month"):Cc(a,l,{month:d},"month")}case"MM":return l?rn(l.month):"";case"M":return l?String(l.month):"";case"dddd":case"ddd":return l?Cc(a,l,{weekday:u==="dddd"?"long":"short"},"weekday"):"";case"DD":return l?rn(l.day):"";case"D":return l?String(l.day):"";case"HH":return o?rn(o.hour):"";case"H":return o?String(o.hour):"";case"hh":return o?rn(o.hour%12||12):"";case"h":return o?String(o.hour%12||12):"";case"mm":return o?rn(o.minute):"";case"ss":return o?rn(o.second):"";case"A":return o?o.hour<12?"AM":"PM":"";case"a":return o?o.hour<12?"am":"pm":"";default:return u}})}const z8=new ht(2026,10,4);function j8(e,t){if(typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=6)return t;try{return(7-du(z8,e))%7}catch{return 1}}function Im(e){if(e)try{return tb(e.slice(0,10))}catch{return}}function U8(e,t=ys(Ln())){const n=Im(e.minDate),a=Im(e.maxDate);if(n||a)return{min:n,max:a};const r=e.yearRange??[];return r.length===1&&typeof r[0]=="number"?{min:new ht(t.year-r[0],1,1),max:new ht(t.year+r[0],12,31)}:r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"?{min:new ht(r[0],1,1),max:new ht(r[1],12,31)}:{}}function Sd(e,t,n,a){if(!e||t==="time")return;if(t==="date")return e;const r=new sr(e.year,e.month,e.day,a?23:0,a?59:0,a?59:0);return n?r:fu(df(r,"UTC"),Ln())}function H8(e,t){const n=ys(Ln());return Sd(n,e==="time"?"datetime":e,t,!1)??n}const W8=["id","aria-describedby"],K8={key:0},G8={key:1,class:"text-muted","data-empty":""},Y8=["aria-label"],J8={class:"flex size-8 shrink-0 items-center justify-center text-muted","aria-hidden":"true"},Z8=["data-mode"],X8=["aria-label"],Q8={key:0,"data-datepicker-time":"",class:"mt-3 flex items-center gap-2 border-t border-border pt-3"},ho="flex size-8 shrink-0 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",eP=ne({__name:"DatepickerField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=b(()=>I8(n.field.mode)),l=b(()=>r.value==="datetime"&&!!n.field.ignoreTimezone),o=b(()=>ta.value||"pl"),s=b(()=>{const fe=n.field.attributes?.readonly;return!!n.field.readOnly||fe!=null&&fe!==!1}),u=b(()=>N8(r.value,n.modelValue,l.value)),c=b(()=>r.value==="time"?null:u.value),d=b(()=>r.value==="time"?u.value:null),f=b(()=>U8(n.field)),m=b(()=>Sd(f.value.min,r.value,l.value,!1)),p=b(()=>Sd(f.value.max,r.value,l.value,!0)),h=H8(r.value,l.value),x=b(()=>j8(o.value,n.field.firstDay)),$=b(()=>n.field.twelveHour?12:24),g=b(()=>r.value==="date"?"day":"minute"),S=b(()=>V8(u.value,r.value,n.field.displayFormat,o.value)),T=b(()=>!n.field.required&&u.value!==null&&!s.value),O=b(()=>{const fe=c.value;return fe?!!m.value&&fe.compare(m.value)<0||!!p.value&&fe.compare(p.value)>0:!1}),E=new Set(["day","month","year","hour","minute","second"]),I=P(null),R=P(!1);function G(){const fe=I.value;if(!fe){R.value=!1;return}const ge=Array.from(fe.querySelectorAll("[data-reka-date-field-segment], [data-reka-time-field-segment]")).filter(xe=>E.has(xe.dataset.rekaDateFieldSegment??xe.dataset.rekaTimeFieldSegment??"")),K=ge.filter(xe=>!xe.hasAttribute("data-placeholder")).length;R.value=K>0&&K!!n.invalid||O.value||R.value),j=b(()=>Rm(r.value,u.value,l.value));function q(fe){const ge=Rm(r.value,fe??null,l.value);w(),!(ge===j.value&&(ge!==null||n.modelValue===null))&&a("update:modelValue",ge)}function W(fe){if(!fe||r.value!=="datetime"){q(fe);return}const ge=c.value,K=H.value,xe=!ge||ge.year!==fe.year||ge.month!==fe.month||ge.day!==fe.day,re=!("hour"in fe)||fe.hour!==K.hour||fe.minute!==K.minute;xe&&re&&(fe=le(fe,K)),V.value=fe,q(fe)}function X(){a("update:modelValue",null),w()}const V=P(null);Ue(c,fe=>{V.value=fe},{immediate:!0});const H=b(()=>{const fe=V.value??c.value;return fe&&"hour"in fe?new Yn(fe.hour,fe.minute):new Yn(0,0)});function le(fe,ge){return"hour"in fe?fe.set({hour:ge.hour,minute:ge.minute,second:0,millisecond:0}):new sr(fe.year,fe.month,fe.day,ge.hour,ge.minute)}function ue(fe){if(!fe)return;const ge=fe instanceof Yn?fe:new Yn(fe.hour,fe.minute),K=V.value??c.value??h,xe=le(K,ge);V.value=xe,q(xe)}function Oe(fe){return fe.charAt(0).toLocaleUpperCase(o.value)+fe.slice(1)}const Ee=b(()=>[qt(L.value),"h-input flex min-w-0 items-center gap-1 pl-3.5 pr-1.5","focus-within:border-primary focus-within:shadow-[0_0_0_3px_var(--c-ring)]","has-[[data-invalid]]:border-danger"]);function pe(fe){return fe==="literal"?"text-muted":fe==="timeZoneName"?"ml-2 min-w-0 truncate text-[13px] text-muted":"rounded-[4px] px-0.5 tabular-nums outline-none focus:bg-sel focus:text-text focus-visible:outline-none data-[placeholder]:text-placeholder focus:data-[placeholder]:text-text"}return(fe,ge)=>s.value?(v(),_("p",{key:0,id:e.controlId,"data-datepicker-readonly":"","aria-describedby":e.describedBy||void 0,class:"flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 tabular-nums"},[S.value!==""?(v(),_("span",K8,D(S.value),1)):(v(),_("span",G8,"—"))],8,W8)):r.value==="time"?(v(),_("div",{key:1,ref_key:"container",ref:I,"data-datepicker":"","data-mode":"time",class:ye(Ee.value),onKeyup:w,onFocusout:w},[F(i(Am),{id:e.controlId,"model-value":d.value,locale:o.value,"hour-cycle":$.value,granularity:"minute",name:e.field.name,required:e.field.required||void 0,"aria-invalid":L.value?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"flex min-w-0 flex-1 items-center","onUpdate:modelValue":q},{default:B(({segments:K})=>[(v(!0),_(ve,null,qe(K,xe=>(v(),z(i(Tm),{key:xe.part,part:xe.part,class:ye(pe(xe.part))},{default:B(()=>[ke(D(xe.value),1)]),_:2},1032,["part","class"]))),128))]),_:1},8,["id","model-value","locale","hour-cycle","name","required","aria-invalid","aria-describedby"]),T.value?(v(),_("button",{key:0,type:"button","data-action":"clear","aria-label":i(k)("backend::lang.datepicker.clear"),class:ye(ho),onClick:X},[F(i(un),{size:16,"aria-hidden":"true"})],8,Y8)):ae("",!0),C("span",J8,[F(i(td),{size:16})])],34)):(v(),z(i(aO),{key:2,id:e.controlId,"model-value":c.value,"default-placeholder":i(h),locale:o.value,granularity:g.value,"hour-cycle":$.value,"hide-time-zone":r.value!=="datetime"||l.value,"min-value":m.value,"max-value":p.value,"week-starts-on":x.value,name:e.field.name,required:e.field.required||void 0,"close-on-select":r.value==="date","prevent-deselect":"","onUpdate:modelValue":W},{default:B(()=>[C("div",{ref_key:"container",ref:I,"data-datepicker":"","data-mode":r.value,class:ye(Ee.value),onKeyup:w,onFocusout:w},[F(i(_O),{"aria-invalid":L.value?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"flex min-w-0 flex-1 items-center overflow-hidden"},{default:B(({segments:K})=>[(v(!0),_(ve,null,qe(K,xe=>(v(),z(i(IO),{key:xe.part,part:xe.part,class:ye(pe(xe.part))},{default:B(()=>[ke(D(xe.value),1)]),_:2},1032,["part","class"]))),128))]),_:1},8,["aria-invalid","aria-describedby"]),T.value?(v(),_("button",{key:0,type:"button","data-action":"clear","aria-label":i(k)("backend::lang.datepicker.clear"),class:ye(ho),onClick:X},[F(i(un),{size:16,"aria-hidden":"true"})],8,X8)):ae("",!0),F(i(jO),{"data-action":"open-calendar","aria-label":i(k)("backend::lang.datepicker.open_calendar"),class:ye(ho)},{default:B(()=>[F(i(cg),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])],42,Z8),F(i(gO),{"data-datepicker-calendar":"","side-offset":4,align:"end",class:"z-50 w-[284px] rounded-inner border border-border bg-surface p-4 text-text shadow-menu"},{default:B(()=>[F(i(lO),null,{default:B(({weekDays:K,grid:xe})=>[F(i(OO),{class:"flex h-9 items-center justify-between"},{default:B(()=>[F(i(BO),{"aria-label":i(k)("backend::lang.datepicker.prev_month"),class:ye(ho)},{default:B(()=>[F(i(ru),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"]),F(i(PO),{class:"font-semibold"},{default:B(({headingValue:re})=>[ke(D(Oe(re)),1)]),_:1}),F(i(NO),{"aria-label":i(k)("backend::lang.datepicker.next_month"),class:ye(ho)},{default:B(()=>[F(i(ps),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])]),_:1}),(v(!0),_(ve,null,qe(xe,re=>(v(),z(i(kO),{key:re.value.toString(),class:"mt-2 w-full border-collapse select-none"},{default:B(()=>[F(i(SO),null,{default:B(()=>[F(i(Sm),{class:"flex"},{default:B(()=>[(v(!0),_(ve,null,qe(K,Q=>(v(),z(i(TO),{key:Q,class:"flex h-9 w-9 items-center justify-center text-[13px] font-normal text-muted"},{default:B(()=>[ke(D(Q),1)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024),F(i($O),null,{default:B(()=>[(v(!0),_(ve,null,qe(re.rows,(Q,ce)=>(v(),z(i(Sm),{key:`week-${ce}`,class:"flex"},{default:B(()=>[(v(!0),_(ve,null,qe(Q,Z=>(v(),z(i(sO),{key:Z.toString(),date:Z,class:"p-0"},{default:B(()=>[F(i(uO),{day:Z,month:re.value,class:"flex size-9 items-center justify-center rounded-pager tabular-nums text-text transition-colors duration-150 ease-out hover:bg-hover data-[outside-view]:text-placeholder data-[today]:font-semibold data-[today]:shadow-[inset_0_0_0_1px_var(--c-border-strong)] data-[selected]:bg-primary data-[selected]:font-semibold data-[selected]:text-on-primary data-[disabled]:cursor-not-allowed data-[disabled]:text-placeholder data-[disabled]:opacity-40 data-[disabled]:hover:bg-transparent data-[unavailable]:cursor-not-allowed data-[unavailable]:opacity-40"},null,8,["day","month"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024))),128))]),_:1}),r.value==="datetime"?(v(),_("div",Q8,[F(i(td),{size:16,class:"shrink-0 text-muted","aria-hidden":"true"}),F(i(Am),{"model-value":H.value,locale:o.value,"hour-cycle":$.value,granularity:"minute","hide-time-zone":"",class:"flex min-w-0 items-center","onUpdate:modelValue":ue},{default:B(({segments:K})=>[(v(!0),_(ve,null,qe(K,xe=>(v(),z(i(Tm),{key:xe.part,part:xe.part,class:ye(pe(xe.part))},{default:B(()=>[ke(D(xe.value),1)]),_:2},1032,["part","class"]))),128))]),_:1},8,["model-value","locale","hour-cycle"])])):ae("",!0)]),_:1})]),_:1},8,["id","model-value","default-placeholder","locale","granularity","hour-cycle","hide-time-zone","min-value","max-value","week-starts-on","name","required","close-on-select"]))}}),Yf=Symbol("summer.form.values"),Jf=Symbol("summer.form.patch"),Zf=Symbol("summer.form.locale"),Ii=Symbol("summer.form.enabledLocales"),q1=Symbol("summer.form.assets");function Xf(){const e=P(0);return{activeUploads:e,beginUpload(){e.value++;let t=!1;return()=>{t||(t=!0,e.value>0&&e.value--)}}}}const eo=Symbol("summer.form.session"),N1=Symbol("summer.settings.secrets"),qm="summer-action",tP="summer-result",Nm="summer-change",Lm="summer-upload",nP="summer-upload-result",L1=5e3,Qf=Symbol("summer.form.feedback"),Cu=Symbol("summer.form.fieldScope"),B1=Symbol("summer.form.dependentCache"),aP=["data-dependent"],rP={class:"relative"},lP=["id","name","value","disabled","required","aria-required","aria-invalid","aria-busy","aria-describedby"],oP={key:0,value:"state",class:"text-muted"},sP=["value"],iP=["id"],uP={key:1,class:"flex flex-wrap items-center gap-2"},cP=["id"],zs="empty",js="placeholder",dP=ne({__name:"DropdownField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=" ".repeat(4),l=ct(Cu,null),o=ct(Qf,null),s=ct(B1,null)??new Map,u=b(()=>n.field.dependsOn??""),c=b(()=>u.value!==""),d=P("waiting"),f=P([]),m=b(()=>{const H=l?.values.value[u.value];return H==null||H===""||typeof H=="object"?null:String(H)}),p=b(()=>l?.fields.value.find(H=>H.name===u.value)),h=b(()=>p.value?.label||u.value),x=b(()=>(p.value?.options??[]).find(le=>g(le.value,m.value))?.label??m.value??""),$=b(()=>c.value?f.value:n.field.options??[]);function g(H,le){return H==null||le===null||le===void 0?H===le||H==null&&le==null:String(H)===String(le)}function S(){return n.modelValue!==null&&n.modelValue!==void 0&&n.modelValue!==""}function T(){S()&&(a("update:modelValue",null),o?.announce(k("backend::lang.form.dependent_cleared",{field:n.field.label||n.field.name})))}function O(H,le){if(!H.applies){f.value=[],d.value="unused",le&&T();return}f.value=H.options.map(ue=>({value:ue.value,label:r.repeat(Math.max(0,ue.depth))+ue.label})),d.value=f.value.length>0?"ready":"empty",le&&S()&&!f.value.some(ue=>g(ue.value,n.modelValue))&&T()}let E=0,I=!1;async function R(H){const le=++E,ue=m.value;if(ue===null){f.value=[],d.value="waiting",H&&T();return}const Oe=l?.path(n.field.name)??n.field.name,Ee=`${Oe}\0${ue}`,pe=s.get(Ee);if(pe){O(pe,H);return}if(!n.source){I=H,d.value="failed";return}d.value="loading";try{const{data:fe}=await Be.GET("/{vendor}/{plugin}/{controller}/fields/{field}/dependent-options",{params:{path:{...n.source,field:Oe},query:{[`values[${u.value}]`]:ue}}});if(le!==E)return;if(!fe){I=H,d.value="failed";return}s.set(Ee,fe.data),O(fe.data,H)}catch{le===E&&(I=H,d.value="failed")}}function G(){R(I)}Ue(m,(H,le)=>{c.value&&H!==le&&R(!0)}),St(()=>{c.value&&R(!1)}),Dt(()=>{E++});const w=b(()=>{const H=$.value.findIndex(le=>g(le.value,n.modelValue));return H>=0?String(H):n.field.emptyOption!==void 0&&!S()?zs:js}),L=b(()=>{switch(d.value){case"waiting":return k("backend::lang.form.dependent_waiting",{field:h.value});case"loading":return k("backend::lang.form.loading_options");case"unused":return k("backend::lang.form.dependent_not_used");case"empty":return k("backend::lang.form.dependent_empty",{type:x.value});case"failed":return k("backend::lang.form.dependent_failed");default:return""}}),j=b(()=>c.value&&d.value!=="ready"),q=b(()=>j.value||w.value===zs||w.value===js),W=b(()=>`${n.controlId}-dependent`),X=b(()=>[n.describedBy??"",c.value&&(d.value==="empty"||d.value==="failed")?W.value:""].filter(Boolean).join(" "));function V(H){const le=H.target.value;if(le===zs){a("update:modelValue",null);return}const ue=$.value[Number(le)];ue&&a("update:modelValue",ue.value)}return(H,le)=>(v(),_("div",{class:"flex flex-col gap-1.5","data-dependent":c.value?d.value:void 0},[C("div",rP,[C("select",{id:e.controlId,name:e.field.name,value:j.value?"state":w.value,disabled:j.value||void 0,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-busy":c.value&&d.value==="loading"?"true":void 0,"aria-describedby":X.value||void 0,class:ye([[i(qt)(e.invalid),q.value?"text-muted":""],"h-input appearance-none pr-10 disabled:cursor-not-allowed"]),onChange:V},[j.value?(v(),_("option",oP,D(L.value),1)):(v(),_(ve,{key:1},[e.field.emptyOption!==void 0?(v(),_("option",{key:0,value:zs,class:"text-muted"},D(e.field.emptyOption),1)):ae("",!0),w.value===js?(v(),_("option",{key:1,value:js,disabled:""},D(i(k)("backend::lang.form.select_placeholder")),1)):ae("",!0),(v(!0),_(ve,null,qe($.value,(ue,Oe)=>(v(),_("option",{key:Oe,value:String(Oe),class:"text-text"},D(ue.label),9,sP))),128))],64))],42,lP),F(i(lr),{size:16,class:"pointer-events-none absolute top-1/2 right-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"})]),c.value&&d.value==="empty"?(v(),_("p",{key:0,id:W.value,"data-dependent-hint":"",class:"text-[13px] text-muted"},D(L.value),9,iP)):c.value&&d.value==="failed"?(v(),_("div",uP,[C("p",{id:W.value,role:"alert",class:"flex items-center gap-1.5 text-[13px] text-danger"},[F(i(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),C("span",null,D(i(k)("backend::lang.form.dependent_failed")),1)],8,cP),F(Ze,{variant:"ghost",size:"sm",icon:i(Zs),"data-action":"dependent-retry",onClick:G},{default:B(()=>[ke(D(i(k)("backend::lang.form.dependent_retry")),1)]),_:1},8,["icon"])])):ae("",!0)],8,aP))}}),fP={class:"flex items-start gap-3"},pP={class:"flex min-w-0 flex-1 flex-col gap-1"},vP={key:0,class:"flex items-center gap-4"},mP=["src"],hP={key:1,class:"flex size-16 shrink-0 items-center justify-center rounded-inner bg-subtle","aria-hidden":"true"},yP=["title"],gP={class:"flex flex-col gap-1.5"},bP=["for"],_P=["id","disabled","aria-invalid","aria-describedby"],xP=["id"],kP={class:"flex flex-col gap-1.5"},wP=["for"],$P=["id","disabled","aria-invalid","aria-describedby"],CP=["id"],SP={class:"flex gap-2.5"},EP=["disabled"],AP=["disabled"],TP=ne({__name:"FileCaptionModal",props:{open:{type:Boolean},file:{},routes:{},preview:{},idPrefix:{}},emits:["update:open","saved","closed"],setup(e,{emit:t}){const n=e,a=t,r=P(""),l=P(""),o=P({}),s=P(!1),u=_r();function c($){const g={};for(const[S,T]of Object.entries($??{})){const O=(Array.isArray(T)?T:[T]).filter(E=>typeof E=="string"&&E!=="");O.length>0&&(g[S]=O)}return g}const d=b(()=>`${n.idPrefix}-caption-title`),f=b(()=>`${n.idPrefix}-caption-description`),m=b(()=>!!n.file&&(r.value!==n.file.title||l.value!==n.file.description));Ue(()=>n.open,$=>{$&&n.file&&(r.value=n.file.title??"",l.value=n.file.description??"",o.value={},s.value=!1)},{immediate:!0});async function p($){if($){a("update:open",!0);return}s.value||m.value&&!await u.ask({message:k("backend::lang.form.unsaved_confirm"),confirmLabel:k("backend::lang.form.discard"),danger:!0})||a("update:open",!1)}async function h(){if(!(s.value||!n.file||!n.routes)){s.value=!0;try{const $=await n.routes.update(n.file.id,{title:r.value,description:l.value});if($.data){o.value={},a("saved",$.data),a("update:open",!1),Ne(k("backend::lang.fileupload.details_saved"));return}if($.status===422){o.value=c($.error?.details),Object.keys(o.value).length===0&&(o.value={title:[Kf($.error)||k("backend::lang.form.error_generic")]});return}Ne($.error?.message||k("backend::lang.form.error_generic"),"danger")}finally{s.value=!1}}}function x($){$.preventDefault(),a("closed")}return($,g)=>(v(),_(ve,null,[F(i(Kl),{open:e.open,"onUpdate:open":p},{default:B(()=>[F(i(gs),null,{default:B(()=>[F(i(Yl),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),F(i(Gl),{"data-caption-modal":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[560px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 overflow-y-auto rounded-modal bg-surface p-6 text-text shadow-pop",onCloseAutoFocus:x},{default:B(()=>[C("div",fP,[C("div",pP,[F(i(Jl),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:B(()=>[ke(D(i(k)("backend::lang.fileupload.attachment")),1)]),_:1}),F(i(jr),{class:"text-muted"},{default:B(()=>[ke(D(i(k)("backend::lang.fileupload.help")),1)]),_:1})]),F(i(jl),{"data-action":"close","aria-label":i(k)("backend::lang.form.close"),disabled:s.value,class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:B(()=>[F(i(un),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label","disabled"])]),e.file?(v(),_("div",vP,[e.preview?(v(),_("img",{key:0,src:e.preview,alt:"",class:"size-16 shrink-0 rounded-inner object-cover"},null,8,mP)):(v(),_("span",hP,[F(i(xl),{size:16,class:"text-muted"})])),C("span",{class:"min-w-0 truncate text-[13px] text-muted",title:e.file.file_name},D(e.file.file_name),9,yP)])):ae("",!0),C("form",{class:"flex flex-col gap-4",novalidate:"",onSubmit:mt(h,["prevent"])},[C("div",gP,[C("label",{for:d.value,class:"font-semibold"},D(i(k)("backend::lang.fileupload.title_label")),9,bP),Qn(C("input",{id:d.value,"onUpdate:modelValue":g[0]||(g[0]=S=>r.value=S),type:"text","data-caption-title":"",disabled:s.value,"aria-invalid":o.value.title?"true":void 0,"aria-describedby":o.value.title?`${d.value}-error`:void 0,class:ye([i(qt)(!!o.value.title),"h-input"])},null,10,_P),[[Nl,r.value]]),o.value.title?(v(),_("p",{key:0,id:`${d.value}-error`,class:"flex items-center gap-1.5 text-[13px] text-danger"},[F(i(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),C("span",null,D(o.value.title.join(" ")),1)],8,xP)):ae("",!0)]),C("div",kP,[C("label",{for:f.value,class:"font-semibold"},D(i(k)("backend::lang.fileupload.description_label")),9,wP),Qn(C("textarea",{id:f.value,"onUpdate:modelValue":g[1]||(g[1]=S=>l.value=S),rows:"3","data-caption-description":"",disabled:s.value,"aria-invalid":o.value.description?"true":void 0,"aria-describedby":o.value.description?`${f.value}-error`:void 0,class:ye([i(qt)(!!o.value.description),"min-h-input resize-y py-2.5"])},null,10,$P),[[Nl,l.value]]),o.value.description?(v(),_("p",{key:0,id:`${f.value}-error`,class:"flex items-center gap-1.5 text-[13px] text-danger"},[F(i(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),C("span",null,D(o.value.description.join(" ")),1)],8,CP)):ae("",!0)]),C("div",SP,[C("button",{type:"button","data-action":"cancel",disabled:s.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",onClick:g[2]||(g[2]=S=>p(!1))},D(i(k)("backend::lang.form.cancel")),9,EP),C("button",{type:"submit","data-action":"save-caption",disabled:s.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control bg-primary font-semibold text-on-primary hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60"},D(s.value?i(k)("backend::lang.form.saving"):i(k)("backend::lang.fileupload.details_submit")),9,AP)])],32)]),_:1})]),_:1})]),_:1},8,["open"]),F(br,{open:i(u).request.value!==null,message:i(u).request.value?.message??"","confirm-label":i(u).request.value?.confirmLabel,danger:i(u).request.value?.danger,onConfirm:i(u).confirm,onCancel:i(u).cancel},null,8,["open","message","confirm-label","danger","onConfirm","onCancel"])],64))}}),DP=["id","data-field-name","aria-labelledby","aria-describedby","aria-busy"],OP={key:0,"data-fileupload-loading":"",class:"h-[112px] rounded-control bg-skel","aria-hidden":"true"},MP={key:1,role:"alert","data-fileupload-failed":"",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},PP={key:0,"data-fileupload-empty":"",class:"flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 text-muted"},RP={key:1,"data-fileupload-grid":"",class:"grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-4"},IP=["data-file-item","data-state","onDragover","onDrop"],qP={class:"relative flex aspect-square items-center justify-center bg-subtle"},NP=["href","aria-label"],LP=["src","alt","onError"],BP=["aria-label","onClick"],FP=["src","alt"],VP={key:2,"data-preview-unavailable":"",class:"flex flex-col items-center gap-2 text-[13px] text-muted"},zP=["data-handle","aria-label","onKeydown","onDragstart"],jP={key:5,class:"absolute top-2 right-2 flex gap-1"},UP=["data-caption","aria-label","onClick"],HP=["aria-label","onClick"],WP=["aria-label","onClick"],KP={class:"flex flex-col gap-1 p-2"},GP=["title"],YP={class:"flex items-center gap-2 text-[13px] text-muted tabular-nums"},JP={key:0},ZP={key:1},XP={key:2},QP={key:3,"data-unsaved-chip":"",class:"inline-flex h-6 items-center rounded-pill bg-sel px-2 text-[13px] font-semibold text-text"},eR={key:1,"data-file-error":"",class:"text-[13px] text-danger"},tR={class:"sr-only"},nR={key:2,"data-fileupload-single":"",class:"flex flex-col gap-2"},aR=["data-file-item","data-state"],rR=["src","alt","onError"],lR={key:3,"data-preview-unavailable":"",class:"flex flex-col items-center gap-2 text-[13px] text-muted"},oR={class:"flex min-w-0 flex-1 flex-col gap-1"},sR=["title"],iR={class:"flex items-center gap-2 text-[13px] text-muted tabular-nums"},uR={key:0},cR={key:1},dR={key:2},fR={key:3,"data-unsaved-chip":"",class:"inline-flex h-6 items-center rounded-pill bg-sel px-2 text-[13px] font-semibold text-text"},pR={key:1,"data-file-error":"",class:"text-[13px] text-danger"},vR={class:"sr-only"},mR={key:2,class:"mt-1 flex flex-wrap gap-2"},hR={key:3,"data-fileupload-rows":"",class:"flex flex-col gap-2"},yR=["data-file-item","data-state","onDragover","onDrop"],gR={class:"flex items-center gap-3"},bR=["data-handle","aria-label","onKeydown","onDragstart"],_R={class:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-pager bg-subtle"},xR=["src","onError"],kR={class:"flex min-w-0 flex-1 flex-col leading-tight"},wR=["title"],$R=["title"],CR=["title"],SR={class:"flex shrink-0 items-center gap-2 text-[13px] text-muted tabular-nums"},ER={key:0},AR={key:1},TR={key:2},DR={key:3,"data-unsaved-chip":"",class:"inline-flex h-6 items-center rounded-pill bg-sel px-2 text-[13px] font-semibold text-text"},OR={class:"flex shrink-0 items-center gap-1"},MR=["href","aria-label"],PR=["aria-label","onClick"],RR=["data-caption","aria-label","onClick"],IR=["aria-label","onClick"],qR=["aria-label","onClick"],NR={key:1,"data-file-error":"",class:"text-[13px] text-danger"},LR={class:"sr-only"},BR=["aria-describedby"],FR={class:"flex size-10 items-center justify-center rounded-full bg-surface","aria-hidden":"true"},VR={class:"text-text"},zR={key:0,"data-fileupload-limits":"",class:"text-[13px] text-muted tabular-nums"},jR={key:5,"data-fileupload-limits":"",class:"text-[13px] text-muted tabular-nums"},UR={key:6,role:"alert","data-fileupload-too-many":"",class:"flex items-center gap-1.5 text-[13px] text-danger"},HR=["accept","multiple"],WR={class:"sr-only","aria-live":"polite","data-fileupload-live":""},KR=1<<20,GR=400,Sc="inline-flex size-8 items-center justify-center rounded-pager border border-border bg-surface text-muted hover:text-text",YR="inline-flex size-8 items-center justify-center rounded-pager border border-border bg-surface text-muted hover:bg-danger-soft hover:text-danger",dl="inline-flex size-8 shrink-0 items-center justify-center rounded-pager text-muted hover:bg-hover hover:text-text",JR=ne({__name:"FileuploadField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,n=ct(eo,null),a=["jpg","jpeg","png","gif","webp"],r=["image/jpeg","image/png","image/gif","image/webp"];let l=1;const o=P([]),s=P("loading"),u=P(!1),c=P(0),d=P(""),f=P(null),m=P(null),p=P(null),h=P(null),x=P(null),$=P(!1),g=P({}),S=P(new Set),T=new Set,O=[],E=n?n.routes(t.field.name):null;let I=null,R=null,G=!1,w=null,L=0,j=!1;const q=b(()=>{const J=t.field.attributes?.readonly;return!!t.field.readOnly||J!=null&&J!==!1}),W=b(()=>t.field.multiple===!0),X=b(()=>t.field.mode==="image"),V=b(()=>W.value?t.field.maxFiles:1),H=b(()=>(n?.recordId??0)!==0),le=b(()=>o.value.filter(J=>J.state!=="failed")),ue=b(()=>{if(W.value)return o.value;const J=le.value,Te=J[J.length-1];return o.value.filter(ee=>ee.state==="failed"||ee===Te)}),Oe=b(()=>ue.value.filter(J=>J.state!=="failed").length),Ee=b(()=>q.value||s.value!=="ready"?!1:W.value?V.value===void 0||V.value===null||le.value.lengthW.value&&!q.value&&typeof V.value=="number"&&le.value.length>=V.value),fe=b(()=>t.field.fileTypes?.length?t.field.fileTypes.map(J=>J.toLowerCase()):X.value&&!t.field.mimeTypes?.length?a:null),ge=b(()=>(t.field.fileTypes?.length?t.field.fileTypes:t.field.mimeTypes??[]).join(", ")),K=b(()=>{const J=[];for(const Te of t.field.fileTypes??[])J.push(`.${Te.toLowerCase()}`);for(const Te of t.field.mimeTypes??[])J.push(Te.includes("/")?Te:`.${Te.toLowerCase()}`);return J.length===0&&X.value&&J.push(...r),J.length>0?J.join(","):void 0}),xe=b(()=>t.field.prompt||k(W.value?"backend::lang.fileupload.default_prompt_many":"backend::lang.fileupload.default_prompt"));function re(J,Te){return new Intl.NumberFormat(ta.value,{minimumFractionDigits:Te,maximumFractionDigits:Te}).format(J)}function Q(J){const Te=["B","kB","MB","GB"];let ee=J,Ie=0;for(;ee>=1e3&&Ie{const J=t.field.maxFilesize;return typeof J=="number"?`${new Intl.NumberFormat(ta.value).format(J)} MB`:""}),Z=b(()=>{const J=[];return ge.value!==""&&J.push(k("backend::lang.fileupload.limits_types",{types:ge.value})),ce.value!==""&&J.push(k("backend::lang.fileupload.limits_size",{size:ce.value})),W.value&&typeof V.value=="number"&&J.push(k("backend::lang.fileupload.limits_count",{current:le.value.length,max:V.value})),J.join(" · ")});function U(J){const Te=J.lastIndexOf(".");return Te<0?"":J.slice(Te+1).toLowerCase()}function te(J){const Te=t.field.mimeTypes??[];if(Te.length===0||J.type==="")return!0;const ee=J.type.toLowerCase(),Ie=U(J.name);return Te.some(Qe=>{const Vt=Qe.toLowerCase();return Vt.includes("/")?Vt.endsWith("/*")?ee.startsWith(Vt.slice(0,-1)):ee===Vt:Vt===Ie})}function y(J){const Te=fe.value;if(Te&&!Te.includes(U(J.name)))return k("backend::lang.fileupload.wrong_type",{name:J.name,types:Te.join(", ")});if(!te(J))return k("backend::lang.fileupload.wrong_type",{name:J.name,types:ge.value});const ee=t.field.maxFilesize;return typeof ee=="number"&&J.size>Math.ceil(ee*KR)?k("backend::lang.fileupload.too_large",{name:J.name,size:ce.value}):""}function A(J){return Mn({uid:l++,name:J.file_name,size:J.file_size,state:"done",progress:100,error:"",retryable:!1,file:J,source:null,handle:null,uploadId:""})}function M(){return globalThis.crypto?.randomUUID?.()??`u${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`}function ie(J,Te){return Mn({uid:l++,name:J.name,size:J.size,state:Te===""?"queued":"failed",progress:0,error:Te,retryable:!1,file:null,source:li(J),handle:null,uploadId:M()})}function Y(J){return o.value.find(Te=>Te.uid===J)}async function de(J){if(!E){s.value="failed";return}J&&(s.value="loading");const Te=await E.list();if(j)return;if(!Te.data){J&&(s.value="failed");return}const ee=o.value.filter(Ie=>Ie.state!=="done");for(const Ie of o.value)Ie.state==="done"&&Xr(Ie.uid);o.value=[...Te.data.map(A),...ee],s.value="ready"}function we(){q.value||f.value?.click()}function Se(J){if(J.length===0||q.value)return;if(c.value=0,!W.value)for(const Qe of[...o.value])Qe.state!=="failed"&&(Qe.state!=="done"||Qe.file?.pending)&&be(Qe);let Te=W.value?typeof V.value=="number"?Math.max(V.value-le.value.length,0):Number.POSITIVE_INFINITY:1,ee=0;const Ie=[];for(const Qe of J.slice(0,W.value?J.length:1)){const Vt=y(Qe);if(Vt===""&&Te<=0){ee++;continue}Vt===""&&Te--,Ie.push(ie(Qe,Vt))}o.value=[...o.value,...Ie],c.value=ee,Re()}function Ae(J){const Te=J.target;Se(Array.from(Te.files??[])),Te.value=""}function oe(J){return p.value===null&&Array.from(J.dataTransfer?.types??[]).includes("Files")}function $e(J){oe(J)&&(J.preventDefault(),u.value=!0)}function he(J){oe(J)&&(J.preventDefault(),u.value=!1,Se(Array.from(J.dataTransfer?.files??[])))}function Re(){if(!E||o.value.some(Te=>Te.state==="uploading"))return;const J=o.value.find(Te=>Te.state==="queued");J&&Fe(J)}async function Fe(J){if(!E||!J.source)return;J.state="uploading",J.progress=0,J.error="",J.retryable=!1;const Te=new Set(o.value.filter(Ie=>Ie.file).map(Ie=>Ie.file.id)),ee=n?.beginUpload();try{const Ie=E.upload(J.source,(nn,La)=>{J.progress=La>0?Math.min(100,Math.round(nn/La*100)):0},J.uploadId||void 0);J.handle=li(Ie);const Qe=await Ie.promise;J.handle=null;const Vt=!!Y(J.uid);if(Qe.ok)!Vt||j?E.remove(Qe.item.id):(J.state="done",J.progress=100,J.file=Qe.item,J.name=Qe.item.file_name,J.size=Qe.item.file_size,n?.markDirty());else if(Qe.reason==="aborted"||Qe.reason==="network"){const nn=await Ke(Te);if(Qe.reason==="aborted"){for(const La of nn)E.remove(La.id);o.value=o.value.filter(La=>La.uid!==J.uid),Xr(J.uid)}else Vt&&nn[0]&&nn.length===1?(J.state="done",J.progress=100,J.file=nn[0],J.name=nn[0].file_name,J.size=nn[0].file_size,n?.markDirty()):(J.state="failed",J.error=k("backend::lang.fileupload.upload_failed"),J.retryable=!0)}else if(Vt)switch(J.state="failed",Qe.reason){case"too_large":J.error=ce.value?k("backend::lang.fileupload.too_large",{name:J.name,size:ce.value}):Qe.message||k("backend::lang.fileupload.upload_failed");break;case"invalid":J.error=Qe.message||k("backend::lang.fileupload.upload_failed");break;default:J.error=Qe.message||k("backend::lang.fileupload.upload_failed"),J.retryable=Qe.status>=500}}finally{ee?.(),j||Re()}}async function Ke(J){if(!E)return[];const Te=await E.list();return Te.data?Te.data.filter(ee=>ee.pending&&!J.has(ee.id)):[]}function Je(J){J.state!=="failed"||!J.source||(J.state="queued",J.error="",J.retryable=!1,Re())}async function be(J){const Te=o.value.findIndex(Ie=>Ie.uid===J.uid);if(Te<0)return;switch(o.value=o.value.filter(Ie=>Ie.uid!==J.uid),Xr(J.uid),J.state){case"uploading":J.handle?.abort(),n?.markDirty(),Re();return;case"queued":case"failed":return}if(!E||!J.file)return;n?.markDirty();const ee=await E.remove(J.file.id);if(!ee.data&&!j){const Ie=[...o.value];Ie.splice(Math.min(Te,Ie.length),0,J),o.value=Ie,Ne(ee.error?.message||k("backend::lang.form.error_generic"),"danger")}}function Me(){return o.value.map(J=>J.uid)}function Le(J){const Te=new Map(o.value.map(Qe=>[Qe.uid,Qe])),ee=J.map(Qe=>Te.get(Qe)).filter(Qe=>!!Qe),Ie=o.value.filter(Qe=>!J.includes(Qe.uid));o.value=[...ee,...Ie]}function at(){I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,Mt()},GR)}function st(){return o.value.filter(J=>J.state==="done"&&J.file).map(J=>J.file.id)}async function Mt(){if(!E)return;const J=st();if(G){w=J;return}const Te=R;R=null;const ee=++L;G=!0;try{const Ie=await E.reorder(J);if(w)return;!Ie.data&&!j&&ee===L&&(Te&&Le(Te),Ne(k("backend::lang.fileupload.reorder_failed"),"danger"))}finally{G=!1,w&&(w=null,Mt())}}function je(J,Te){const ee=o.value.findIndex(Vt=>Vt.uid===J);if(ee<0||Te<0||Te>=o.value.length||Te===ee)return!1;R===null&&(R=Me());const Ie=[...o.value],[Qe]=Ie.splice(ee,1);return Ie.splice(Te,0,Qe),o.value=Ie,d.value=k("backend::lang.fileupload.moved",{name:Qe.name,position:Te+1,total:Ie.length}),at(),!0}async function ze(J,Te){const ee=o.value.findIndex(Qe=>Qe.uid===Te.uid);let Ie;switch(J.key){case"ArrowUp":case"ArrowLeft":Ie=ee-1;break;case"ArrowDown":case"ArrowRight":Ie=ee+1;break;default:return}J.preventDefault(),je(Te.uid,Ie)&&(await Xe(),m.value?.querySelector(`[data-handle="${Te.uid}"]`)?.focus())}function We(J,Te){p.value=Te.uid,J.dataTransfer&&(J.dataTransfer.effectAllowed="move",J.dataTransfer.setData("text/plain",Te.name))}function Nt(J,Te){p.value!==null&&(J.preventDefault(),h.value=Te.uid)}function Ia(J,Te){p.value!==null&&(J.preventDefault(),je(p.value,o.value.findIndex(ee=>ee.uid===Te.uid)),kr())}function kr(){p.value=null,h.value=null}function Zr(J){const Te=J.file?.content_type??J.source?.type??"";return r.includes(Te.toLowerCase())}function Ht(J){return!J.file||!Zr(J)||S.value.has(J.uid)?null:t.field.protected?g.value[J.uid]??null:J.file.thumb_url||J.file.url||null}function sa(){return typeof URL.revokeObjectURL=="function"}function Xr(J){const Te=g.value[J];if(Te!==void 0){sa()&&URL.revokeObjectURL(Te);const ee={...g.value};delete ee[J],g.value=ee}T.delete(J)}async function _s(J){if(!E||!J.file||T.has(J.uid)||typeof URL.createObjectURL!="function")return;T.add(J.uid);const Te=await E.thumb(J.file.id);if(!(j||!Y(J.uid)||!T.has(J.uid))){if(!Te){S.value=new Set([...S.value,J.uid]);return}g.value={...g.value,[J.uid]:URL.createObjectURL(Te)}}}Ue(()=>o.value.map(J=>`${J.uid}:${J.state}`).join(","),()=>{if(t.field.protected)for(const J of o.value)J.state==="done"&&Zr(J)&&_s(J)});function Qr(J){S.value=new Set([...S.value,J.uid])}async function ao(J,Te){if(!E||!J.file||typeof URL.createObjectURL!="function")return;const ee=await E.download(J.file.id);if(!ee){Ne(k("backend::lang.form.error_generic"),"danger");return}const Ie=URL.createObjectURL(ee);O.push(Ie);const Qe=document.createElement("a");Qe.href=Ie,Qe.rel="noopener",Te?Qe.download=J.file.file_name:Qe.target="_blank",Qe.click()}function Bn(J){return t.field.useCaption&&J.file?.title?J.file.title:J.name}function qa(J){return H.value&&!!J.file?.pending}const ia=b(()=>x.value===null?void 0:Y(x.value));function tn(J){x.value=J.uid,$.value=!0}function Na(J){const Te=ia.value;Te&&(Te.file=J)}function ro(){const J=x.value;x.value=null,J!==null&&m.value?.querySelector(`[data-caption="${J}"]`)?.focus()}const wr=b(()=>{const J=t.field.thumbOptions?.mode;return J==="fit"||J==="auto"?"object-contain":"object-cover"});return St(()=>{de(!0)}),n&&Ue(n.revision,()=>{de(!1)}),Dt(()=>{j=!0,I!==null&&(clearTimeout(I),I=null);for(const J of o.value)J.handle?.abort();if(sa()){for(const J of Object.values(g.value))URL.revokeObjectURL(J);for(const J of O)URL.revokeObjectURL(J)}}),(J,Te)=>(v(),_("div",{id:e.controlId,ref_key:"root",ref:m,role:"group","data-fileupload":"","data-field-name":e.field.name,"aria-labelledby":e.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0,"aria-busy":s.value==="loading"?"true":void 0,class:"flex min-w-0 flex-col gap-4"},[s.value==="loading"?(v(),_("span",OP)):s.value==="failed"?(v(),_("p",MP,D(i(k)("backend::lang.fileupload.load_failed")),1)):(v(),_(ve,{key:2},[q.value&&ue.value.length===0?(v(),_("p",PP,D(i(k)("backend::lang.fileupload.empty")),1)):X.value&&W.value&&ue.value.length>0?(v(),_("ul",RP,[(v(!0),_(ve,null,qe(ue.value,ee=>(v(),_("li",{key:ee.uid,"data-file-item":ee.uid,"data-state":ee.state,class:ye([[ee.state==="failed"?"border-danger":"border-border",p.value===ee.uid?"opacity-50":"",h.value===ee.uid&&p.value!==ee.uid?"border-2 border-dashed border-primary bg-sel":""],"relative overflow-hidden rounded-inner border bg-surface"]),onDragover:Ie=>Nt(Ie,ee),onDrop:Ie=>Ia(Ie,ee)},[C("div",qP,[ee.state==="uploading"?(v(),z(i(Al),{key:0,size:20,class:"animate-spin text-muted","aria-hidden":"true"})):ee.state==="failed"?(v(),z(i(gt),{key:1,size:16,class:"text-danger","aria-hidden":"true"})):ee.state==="done"?(v(),_(ve,{key:2},[Ht(ee)&&!e.field.protected&&ee.file?.url?(v(),_("a",{key:0,href:ee.file.url,target:"_blank",rel:"noopener",class:"block size-full","aria-label":i(k)("backend::lang.fileupload.open_preview",{name:ee.name})},[C("img",{src:Ht(ee)??void 0,alt:Bn(ee),class:ye([wr.value,"size-full"]),onError:Ie=>Qr(ee)},null,42,LP)],8,NP)):Ht(ee)?(v(),_("button",{key:1,type:"button",class:"block size-full","aria-label":i(k)("backend::lang.fileupload.open_preview",{name:ee.name}),onClick:Ie=>ao(ee,!1)},[C("img",{src:Ht(ee)??void 0,alt:Bn(ee),class:ye([wr.value,"size-full"])},null,10,FP)],8,BP)):S.value.has(ee.uid)?(v(),_("span",VP,[F(i(Av),{size:20,"aria-hidden":"true"}),ke(" "+D(i(k)("backend::lang.fileupload.preview_unavailable")),1)])):(v(),z(i(xl),{key:3,size:20,class:"text-muted","aria-hidden":"true"}))],64)):(v(),z(i(xl),{key:3,size:20,class:"text-muted","aria-hidden":"true"})),!q.value&&ee.state==="done"?(v(),_("button",{key:4,type:"button",draggable:"true","data-handle":ee.uid,"aria-label":i(k)("backend::lang.fileupload.move",{name:ee.name}),class:ye([Sc,"absolute top-2 left-2 cursor-grab"]),onKeydown:Ie=>ze(Ie,ee),onDragstart:Ie=>We(Ie,ee),onDragend:kr},[F(i(xi),{size:16,"aria-hidden":"true"})],40,zP)):ae("",!0),q.value?ae("",!0):(v(),_("div",jP,[e.field.useCaption&&ee.state==="done"?(v(),_("button",{key:0,type:"button","data-caption":ee.uid,"aria-label":i(k)("backend::lang.fileupload.edit_details",{name:ee.name}),class:ye(Sc),onClick:Ie=>tn(ee)},[F(i(qo),{size:16,"aria-hidden":"true"})],8,UP)):ae("",!0),ee.state==="failed"&&ee.retryable?(v(),_("button",{key:1,type:"button","data-action":"retry","aria-label":i(k)("backend::lang.fileupload.retry"),class:ye(Sc),onClick:Ie=>Je(ee)},[F(i(Zs),{size:16,"aria-hidden":"true"})],8,HP)):ae("",!0),C("button",{type:"button","data-action":"remove-file","aria-label":ee.state==="uploading"||ee.state==="queued"?i(k)("backend::lang.fileupload.cancel_upload",{name:ee.name}):i(k)("backend::lang.form.remove_item",{name:ee.name}),class:ye(YR),onClick:Ie=>be(ee)},[F(i(un),{size:16,"aria-hidden":"true"})],8,WP)]))]),C("div",KP,[C("span",{class:"truncate text-[13px]",title:Bn(ee)},D(Bn(ee)),9,GP),C("span",YP,[ee.state==="queued"?(v(),_("span",JP,D(i(k)("backend::lang.fileupload.queued")),1)):ee.state==="uploading"?(v(),_("span",ZP,D(i(k)("backend::lang.fileupload.uploading",{percent:ee.progress})),1)):(v(),_("span",XP,D(Q(ee.size)),1)),qa(ee)?(v(),_("span",QP,D(i(k)("backend::lang.fileupload.unsaved")),1)):ae("",!0)]),ee.state==="uploading"?(v(),z(i(yc),{key:0,"model-value":ee.progress,max:100,"aria-label":i(k)("backend::lang.fileupload.uploading",{percent:ee.progress}),class:"h-1 w-full overflow-hidden rounded-pill bg-subtle"},{default:B(()=>[F(i(gc),{class:"h-full bg-primary",style:Sn({width:`${ee.progress}%`})},null,8,["style"])]),_:2},1032,["model-value","aria-label"])):ae("",!0),ee.state==="failed"?(v(),_("p",eR,[C("span",tR,D(i(k)("backend::lang.fileupload.upload_error"))+": ",1),ke(D(ee.error),1)])):ae("",!0)])],42,IP))),128))])):X.value&&!W.value&&ue.value.length>0?(v(),_("div",nR,[(v(!0),_(ve,null,qe(ue.value,ee=>(v(),_("div",{key:ee.uid,"data-file-item":ee.uid,"data-state":ee.state,class:"flex items-start gap-4"},[C("div",{class:ye([ee.state==="failed"?"border-danger":"border-border","flex size-40 shrink-0 items-center justify-center overflow-hidden rounded-inner border bg-subtle"])},[ee.state==="uploading"?(v(),z(i(Al),{key:0,size:20,class:"animate-spin text-muted","aria-hidden":"true"})):ee.state==="failed"?(v(),z(i(gt),{key:1,size:16,class:"text-danger","aria-hidden":"true"})):Ht(ee)?(v(),_("img",{key:2,src:Ht(ee)??void 0,alt:Bn(ee),class:ye([wr.value,"size-full"]),onError:Ie=>Qr(ee)},null,42,rR)):S.value.has(ee.uid)?(v(),_("span",lR,[F(i(Av),{size:20,"aria-hidden":"true"}),ke(" "+D(i(k)("backend::lang.fileupload.preview_unavailable")),1)])):(v(),z(i(xl),{key:4,size:20,class:"text-muted","aria-hidden":"true"}))],2),C("div",oR,[C("span",{class:"truncate font-semibold",title:Bn(ee)},D(Bn(ee)),9,sR),C("span",iR,[ee.state==="queued"?(v(),_("span",uR,D(i(k)("backend::lang.fileupload.queued")),1)):ee.state==="uploading"?(v(),_("span",cR,D(i(k)("backend::lang.fileupload.uploading",{percent:ee.progress})),1)):(v(),_("span",dR,D(Q(ee.size)),1)),qa(ee)?(v(),_("span",fR,D(i(k)("backend::lang.fileupload.unsaved")),1)):ae("",!0)]),ee.state==="uploading"?(v(),z(i(yc),{key:0,"model-value":ee.progress,max:100,"aria-label":i(k)("backend::lang.fileupload.uploading",{percent:ee.progress}),class:"h-1 w-full overflow-hidden rounded-pill bg-subtle"},{default:B(()=>[F(i(gc),{class:"h-full bg-primary",style:Sn({width:`${ee.progress}%`})},null,8,["style"])]),_:2},1032,["model-value","aria-label"])):ae("",!0),ee.state==="failed"?(v(),_("p",pR,[C("span",vR,D(i(k)("backend::lang.fileupload.upload_error"))+": ",1),ke(D(ee.error),1)])):ae("",!0),q.value?ae("",!0):(v(),_("div",mR,[ee.state!=="failed"?(v(),z(Ze,{key:0,size:"sm",variant:"outline","data-action":"replace-file",icon:i(Xs),onClick:we},{default:B(()=>[ke(D(i(k)("backend::lang.fileupload.replace_file")),1)]),_:1},8,["icon"])):ae("",!0),ee.state==="failed"&&ee.retryable?(v(),z(Ze,{key:1,size:"sm",variant:"outline","data-action":"retry",icon:i(Zs),onClick:Ie=>Je(ee)},{default:B(()=>[ke(D(i(k)("backend::lang.fileupload.retry")),1)]),_:1},8,["icon","onClick"])):ae("",!0),e.field.useCaption&&ee.state==="done"?(v(),z(Ze,{key:2,size:"sm",variant:"outline","data-caption":ee.uid,icon:i(qo),onClick:Ie=>tn(ee)},{default:B(()=>[ke(D(i(k)("backend::lang.fileupload.details_submit")),1)]),_:1},8,["data-caption","icon","onClick"])):ae("",!0),F(Ze,{size:"sm",variant:"danger","data-action":"remove-file",icon:i(un),onClick:Ie=>be(ee)},{default:B(()=>[ke(D(i(k)("backend::lang.fileupload.remove_file")),1)]),_:1},8,["icon","onClick"])]))])],8,aR))),128))])):ue.value.length>0?(v(),_("ul",hR,[(v(!0),_(ve,null,qe(ue.value,ee=>(v(),_("li",{key:ee.uid,"data-file-item":ee.uid,"data-state":ee.state,class:ye([[ee.state==="failed"?"border-danger":"border-border",p.value===ee.uid?"opacity-50":"",h.value===ee.uid&&p.value!==ee.uid?"border-2 border-dashed border-primary bg-sel":""],"flex min-h-14 flex-col justify-center gap-1 rounded-inner border bg-surface px-3 py-2"]),onDragover:Ie=>Nt(Ie,ee),onDrop:Ie=>Ia(Ie,ee)},[C("div",gR,[W.value&&!q.value&&ee.state==="done"?(v(),_("button",{key:0,type:"button",draggable:"true","data-handle":ee.uid,"aria-label":i(k)("backend::lang.fileupload.move",{name:ee.name}),class:ye([dl,"cursor-grab"]),onKeydown:Ie=>ze(Ie,ee),onDragstart:Ie=>We(Ie,ee),onDragend:kr},[F(i(xi),{size:16,"aria-hidden":"true"})],40,bR)):ae("",!0),C("span",_R,[ee.state==="uploading"?(v(),z(i(Al),{key:0,size:16,class:"animate-spin text-muted","aria-hidden":"true"})):ee.state==="failed"?(v(),z(i(gt),{key:1,size:16,class:"text-danger","aria-hidden":"true"})):Ht(ee)?(v(),_("img",{key:2,src:Ht(ee)??void 0,alt:"",class:"size-8 object-cover",onError:Ie=>Qr(ee)},null,40,xR)):(v(),z(i(xl),{key:3,size:16,class:"text-muted","aria-hidden":"true"}))]),C("span",kR,[e.field.useCaption&&ee.file?.title?(v(),_(ve,{key:0},[C("span",{class:"truncate font-semibold",title:ee.file.title},D(ee.file.title),9,wR),C("span",{class:"truncate text-[13px] text-muted",title:ee.name},D(ee.name),9,$R)],64)):(v(),_("span",{key:1,class:"truncate",title:ee.name},D(ee.name),9,CR))]),C("span",SR,[ee.state==="queued"?(v(),_("span",ER,D(i(k)("backend::lang.fileupload.queued")),1)):ee.state==="uploading"?(v(),_("span",AR,D(i(k)("backend::lang.fileupload.uploading",{percent:ee.progress})),1)):(v(),_("span",TR,D(Q(ee.size)),1)),qa(ee)?(v(),_("span",DR,D(i(k)("backend::lang.fileupload.unsaved")),1)):ae("",!0)]),!W.value&&!q.value&&ee.state!=="failed"?(v(),z(Ze,{key:1,size:"sm",variant:"outline","data-action":"replace-file",icon:i(Xs),onClick:we},{default:B(()=>[ke(D(i(k)("backend::lang.fileupload.replace_file")),1)]),_:1},8,["icon"])):ae("",!0),C("span",OR,[ee.state==="done"&&ee.file?(v(),_(ve,{key:0},[!e.field.protected&&ee.file.url?(v(),_("a",{key:0,href:ee.file.url,download:"",target:"_blank",rel:"noopener","aria-label":i(k)("backend::lang.fileupload.download",{name:ee.name}),class:ye(dl)},[F(i(nd),{size:16,"aria-hidden":"true"})],8,MR)):e.field.protected?(v(),_("button",{key:1,type:"button","data-action":"download","aria-label":i(k)("backend::lang.fileupload.download",{name:ee.name}),class:ye(dl),onClick:Ie=>ao(ee,!0)},[F(i(nd),{size:16,"aria-hidden":"true"})],8,PR)):ae("",!0),e.field.useCaption&&!q.value?(v(),_("button",{key:2,type:"button","data-caption":ee.uid,"aria-label":i(k)("backend::lang.fileupload.edit_details",{name:ee.name}),class:ye(dl),onClick:Ie=>tn(ee)},[F(i(qo),{size:16,"aria-hidden":"true"})],8,RR)):ae("",!0)],64)):ae("",!0),ee.state==="failed"&&ee.retryable?(v(),_("button",{key:1,type:"button","data-action":"retry","aria-label":i(k)("backend::lang.fileupload.retry"),class:ye(dl),onClick:Ie=>Je(ee)},[F(i(Zs),{size:16,"aria-hidden":"true"})],8,IR)):ae("",!0),q.value?ae("",!0):(v(),_("button",{key:2,type:"button","data-action":"remove-file","aria-label":ee.state==="uploading"||ee.state==="queued"?i(k)("backend::lang.fileupload.cancel_upload",{name:ee.name}):i(k)("backend::lang.form.remove_item",{name:ee.name}),class:ye([dl,"hover:bg-danger-soft hover:text-danger"]),onClick:Ie=>be(ee)},[F(i(un),{size:16,"aria-hidden":"true"})],8,qR))])]),ee.state==="uploading"?(v(),z(i(yc),{key:0,"model-value":ee.progress,max:100,"aria-label":i(k)("backend::lang.fileupload.uploading",{percent:ee.progress}),class:"h-1 w-full overflow-hidden rounded-pill bg-subtle"},{default:B(()=>[F(i(gc),{class:"h-full bg-primary",style:Sn({width:`${ee.progress}%`})},null,8,["style"])]),_:2},1032,["model-value","aria-label"])):ae("",!0),ee.state==="failed"?(v(),_("p",NR,[C("span",LR,D(i(k)("backend::lang.fileupload.upload_error"))+": ",1),ke(D(ee.error),1)])):ae("",!0)],42,yR))),128))])):ae("",!0),Ee.value?(v(),_("button",{key:4,type:"button","data-fileupload-dropzone":"","aria-describedby":e.describedBy||void 0,class:ye([[u.value?"border-solid border-primary bg-sel":e.invalid?"border-dashed border-danger bg-subtle":"border-dashed border-border-strong bg-subtle"],"flex min-h-[112px] w-full flex-col items-center justify-center gap-2 rounded-control border-[1.5px] px-4 py-6 text-center transition-colors duration-150 ease-out hover:bg-hover"]),onClick:we,onDragover:$e,onDragleave:Te[0]||(Te[0]=ee=>u.value=!1),onDrop:he},[C("span",FR,[F(i(Xs),{size:20,class:"text-muted"})]),C("span",VR,D(xe.value),1),Z.value!==""?(v(),_("span",zR,D(Z.value),1)):ae("",!0)],42,BR)):pe.value&&Z.value!==""?(v(),_("p",jR,D(Z.value),1)):ae("",!0),c.value>0?(v(),_("p",UR,[F(i(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),C("span",null,D(i(Br)("backend::lang.fileupload.too_many",c.value,{max:V.value??0})),1)])):ae("",!0)],64)),C("input",{ref_key:"input",ref:f,type:"file",hidden:"",tabindex:"-1","data-fileupload-input":"",accept:K.value,multiple:W.value||void 0,onChange:Ae},null,40,HR),C("p",WR,D(d.value),1),e.field.useCaption?(v(),z(TP,{key:3,open:$.value,"onUpdate:open":Te[1]||(Te[1]=ee=>$.value=ee),file:ia.value?.file??null,routes:i(E),preview:ia.value?Ht(ia.value):null,"id-prefix":e.controlId,onSaved:Na,onClosed:ro},null,8,["open","file","routes","preview","id-prefix"])):ae("",!0)],8,DP))}}),ZR=["id","name","value","required","aria-required","aria-invalid","aria-describedby"],XR=ne({__name:"NumberField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=b(()=>n.modelValue===null||n.modelValue===void 0?"":String(n.modelValue)),l=b(()=>xr(n.field));function o(s){const u=s.target.value.trim();if(u===""){a("update:modelValue",null);return}const c=Number(u);a("update:modelValue",Number.isFinite(c)?c:null)}return(s,u)=>(v(),_("input",Ve({id:e.controlId},l.value,{name:e.field.name,type:"number",inputmode:"decimal",value:r.value,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:[i(qt)(e.invalid),"h-input tabular-nums"],onInput:o}),null,16,ZR))}}),QR=["id","aria-labelledby","aria-describedby"],eI=ne({__name:"PartialField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e;return(n,a)=>(v(),_("div",{id:e.controlId,role:"group","data-partial-field":"","aria-labelledby":t.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0},[e.source?(v(),z(Wf,{key:0,variant:"field",source:e.source,name:t.field.path||t.field.name,"record-id":e.recordId??null},null,8,["source","name","record-id"])):(v(),z($u,{key:1,"data-partial-failed":"",text:i(k)("backend::lang.extension.partial_failed")},null,8,["text"]))],8,QR))}}),tI={class:"flex min-w-0 flex-col gap-1.5"},nI={class:"relative"},aI=["id","name","type","value","placeholder","disabled","required","aria-required","aria-invalid","aria-describedby"],rI=["aria-pressed","aria-label","disabled"],lI=["id","data-secret-state","role"],oI={key:3},sI=ne({__name:"PasswordField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=P(!1),l=b(()=>typeof n.modelValue=="string"?n.modelValue:""),o=b(()=>xr(n.field)),s=ct(eo,null);s&&Ue(s.revision,()=>{r.value=!1});const u=ct(N1,null),c=b(()=>u?.value[n.field.name]??""),d=b(()=>c.value!==""),f=b(()=>c.value==="stored"&&n.modelValue===null),m=b(()=>`${n.controlId}-secret`),p=b(()=>[n.describedBy??"",d.value?m.value:""].filter(Boolean).join(" ")),h=b(()=>{if(c.value==="stored"&&!f.value)return k("backend::lang.secret.placeholder_stored");const g=o.value.placeholder;return typeof g=="string"?g:void 0});function x(){r.value=!1,a("update:modelValue",null)}function $(){a("update:modelValue","")}return(g,S)=>(v(),_("div",tI,[C("div",nI,[C("input",Ve({id:e.controlId,autocomplete:"new-password",spellcheck:"false"},o.value,{name:e.field.name,type:r.value?"text":"password",value:f.value?"":l.value,placeholder:h.value,disabled:f.value||void 0,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":p.value||void 0,class:[i(qt)(e.invalid),"h-input pr-12"],onInput:S[0]||(S[0]=T=>a("update:modelValue",T.target.value))}),null,16,aI),C("button",{type:"button","data-password-toggle":"","aria-pressed":r.value?"true":"false","aria-label":i(k)(r.value?"backend::lang.form.hide_password":"backend::lang.form.show_password"),disabled:f.value||void 0,class:"absolute top-1/2 right-1.5 flex size-8 -translate-y-1/2 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:opacity-60",onClick:S[1]||(S[1]=T=>r.value=!r.value)},[(v(),z(Bt(r.value?i(j2):i(H2)),{size:16,"aria-hidden":"true"}))],8,rI)]),d.value?(v(),_("p",{key:0,id:m.value,"data-secret-state":f.value?"clearing":c.value,role:f.value?"status":void 0,class:ye([f.value?"text-danger":"text-muted","flex flex-wrap items-center gap-2 text-[13px]"])},[f.value?(v(),_(ve,{key:0},[F(i(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),C("span",null,D(i(k)("backend::lang.secret.clear_pending")),1),F(Ze,{variant:"ghost",size:"sm",icon:i(Sg),"data-action":"secret-undo",onClick:$},{default:B(()=>[ke(D(i(k)("backend::lang.secret.undo")),1)]),_:1},8,["icon"])],64)):c.value==="stored"?(v(),_(ve,{key:1},[F(i(Za),{size:14,class:"shrink-0","aria-hidden":"true"}),C("span",null,D(i(k)("backend::lang.secret.stored")),1),F(Ze,{variant:"ghost",size:"sm",icon:i(hr),"data-action":"secret-clear",onClick:x},{default:B(()=>[ke(D(i(k)("backend::lang.secret.clear")),1)]),_:1},8,["icon"])],64)):c.value==="env"?(v(),_(ve,{key:2},[F(i(vs),{size:14,class:"shrink-0","aria-hidden":"true"}),C("span",null,D(i(k)("backend::lang.secret.env")),1)],64)):(v(),_("span",oI,D(i(k)("backend::lang.secret.empty")),1))],10,lI)):ae("",!0)]))}}),iI=["aria-labelledby","data-ml-field"],uI={class:"flex flex-wrap items-center gap-2"},cI=["value","aria-label"],dI=["value"],Su=ne({__name:"MLField",props:{inner:{},innerType:{},mlType:{},contentLocale:{type:Boolean},field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=b(()=>Zn(n.modelValue)),l=ct(Ii,null),o=b(()=>{const g=l?.value;return g&&g.length>0?[...g]:[]}),s=P(o.value[0]??"en"),u=b(()=>`${n.controlId}-label`),c=b(()=>`${n.controlId}-editor`),d=b(()=>r.value[s.value]??""),f=b(()=>({...n.field,type:n.innerType})),m=b(()=>n.contentLocale?{contentLocale:s.value}:{});function p(g){g&&(s.value=g)}function h(g){const S=g.target.value;p(S),A8(S)}function x(g){a("update:modelValue",{...r.value,[s.value]:g})}function $(g){const S=g.detail;typeof S=="string"&&S!==""&&p(S)}return St(()=>{window.addEventListener(as,$)}),Da(()=>{window.removeEventListener(as,$)}),(g,S)=>(v(),_("div",{class:"flex flex-col gap-1.5",role:"group","aria-labelledby":u.value,"data-ml-field":e.mlType},[C("div",uI,[C("select",{"data-ml-locale":"",class:"rounded-control border border-border-strong bg-surface px-2 py-1 text-[13px]",value:s.value,"aria-label":`Locale for ${e.field.label||e.field.name}`,onChange:h},[(v(!0),_(ve,null,qe(o.value,T=>(v(),_("option",{key:T,value:T},D(T),9,dI))),128))],40,cI)]),(v(),z(Bt(e.inner),Ve({field:f.value,"model-value":d.value,"control-id":c.value,invalid:e.invalid,"described-by":e.describedBy,source:e.source,"record-id":e.recordId},m.value,{"onUpdate:modelValue":x}),null,16,["field","model-value","control-id","invalid","described-by","source","record-id"]))],8,iI))}}),fI=["id","aria-labelledby","aria-describedby","aria-busy"],pI={key:0,"data-plugin-field-skeleton":"",class:"h-[42px] w-full rounded-control bg-skel","aria-hidden":"true"},F1=ne({__name:"PluginField",props:{contentLocale:{},field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=ct(Zf,null),l=P("loading"),o=P(null);let s=null,u=!1;const c=b(()=>r?.value||ta.value),d=b(()=>JSON.stringify(n.field.typeOptions??{})),f=b(()=>n.field.readOnly===!0);function m(E,I){if(Object.is(E,I))return!0;if(E===null||I===null||typeof E!="object"||typeof I!="object")return!1;try{return JSON.stringify(E)===JSON.stringify(I)}catch{return!1}}function p(E,I){m(E.value,I)||(E.value=I)}function h(E,I,R){R?E.setAttribute(I,""):E.removeAttribute(I)}function x(E){E.setAttribute("field-name",n.field.name),E.setAttribute("record-id",n.recordId==null?"":String(n.recordId)),E.setAttribute("locale",n.contentLocale??""),E.setAttribute("ui-locale",c.value),E.setAttribute("options",d.value),h(E,"disabled",f.value),h(E,"invalid",n.invalid===!0)}function $(E){let I;return{promise:new Promise((G,w)=>{I=setTimeout(()=>w(new Error("field type element was not defined in time")),E)}),cancel:()=>clearTimeout(I)}}async function g(E){const I=await f5(E);if(customElements.get(E))return;if(I.length>0)throw new Error(`plugin script failed: ${I.join(", ")}`);const R=$(L1);try{await Promise.race([customElements.whenDefined(E),R.promise])}finally{R.cancel()}}async function S(E){const I=s,R=E.detail;if(!I||R===null||typeof R!="object")return;const{id:G,file:w}=R,L=X=>{!u&&s===I&&I.dispatchEvent(new CustomEvent(nP,{detail:{id:G,...X}}))},j=()=>k("backend::lang.fileupload.upload_failed"),q=n.source;if(!(w instanceof Blob)||!q){L({error:j()});return}const W=w instanceof File&&w.name!==""?w.name:"upload";try{const X=await Be.POST("/{vendor}/{plugin}/{controller}/{id}/fields/{field}/upload",{params:{path:{...q,id:n.recordId??0,field:n.field.name}},body:{file:""},bodySerializer:()=>{const H=new FormData;return H.append("file",w,W),H}});if(X.data){L({url:X.data.data.url});return}const V=X.response.status===422?Kf(X.error?.error):"";L({error:V||j()})}catch{L({error:j()})}}function T(E){S(E)}function O(E){const I=E.detail;I!==null&&typeof I=="object"&&Object.hasOwn(I,"value")&&a("update:modelValue",I.value)}return St(async()=>{const E=n.field.element??"";try{if(E==="")throw new Error("plugin field without an element");if(await g(E),u||!o.value)return;const I=document.createElement(E);x(I),p(I,n.modelValue),I.addEventListener(Nm,O),I.addEventListener(Lm,T),o.value.append(I),s=I,l.value="ready"}catch{u||(l.value="failed")}}),Ue(()=>[n.recordId,n.invalid,n.contentLocale,f.value,c.value,d.value],()=>{s&&x(s)}),Ue(()=>n.modelValue,E=>{s&&p(s,E)},{deep:!0}),Dt(()=>{u=!0,s?.removeEventListener(Nm,O),s?.removeEventListener(Lm,T),s=null}),(E,I)=>l.value==="failed"?(v(),z($u,{key:0,id:e.controlId,"data-plugin-field-failed":"","aria-describedby":e.describedBy||void 0,text:i(k)("backend::lang.extension.widget_failed")},null,8,["id","aria-describedby","text"])):(v(),_("div",{key:1,id:e.controlId,role:"group","data-plugin-field":"","aria-labelledby":e.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0,"aria-busy":l.value==="loading"?"true":void 0,class:"flex min-h-input min-w-0 flex-col"},[l.value==="loading"?(v(),_("span",pI)):ae("",!0),C("div",{ref_key:"mountPoint",ref:o,class:"contents"},null,512)],8,fI))}}),vI=ne({__name:"MLPluginField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t;return(r,l)=>(v(),z(Su,Ve(n,{inner:F1,"inner-type":e.field.type,"ml-type":e.field.type,"content-locale":"","onUpdate:modelValue":l[0]||(l[0]=o=>a("update:modelValue",o))}),null,16,["inner-type","ml-type"]))}}),mI=["id"],hI=["id","aria-labelledby","aria-label","aria-describedby","data-mode"],yI=["aria-labelledby"],gI=["id"],bI={class:"min-w-0 [overflow-wrap:anywhere]"},_I={key:0,class:"shrink-0 text-[12px] font-semibold text-muted","aria-hidden":"true"},xI=["data-permission","data-locked"],kI={class:"flex min-w-0 flex-col"},wI=["id"],$I=["id"],CI=ne({__name:"PermissionEditorField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=b(()=>n.field.permissionOptions??[]),l=b(()=>n.field.mode==="radio"),o=b(()=>!!n.field.readOnly||!!xr(n.field).readonly),s=b(()=>I1(n.field,n.modelValue)),u=b(()=>{const $=[],g=[];for(const S of r.value){if(!S.tab){g.push(S);continue}let T=$.find(O=>O.label===S.tab);T||(T={key:`tab:${S.tab}`,label:S.tab,options:[]},$.push(T)),T.options.push(S)}return g.length>0&&$.push({key:"other",label:k("backend::lang.permissioneditor.other"),options:g}),$}),c=[{value:"1",label:"backend::lang.permissioneditor.allow",checked:"data-[state=checked]:bg-ok-bg data-[state=checked]:text-ok-text"},{value:"0",label:"backend::lang.permissioneditor.inherit",checked:"data-[state=checked]:bg-surface data-[state=checked]:text-text data-[state=checked]:shadow-tab"},{value:"-1",label:"backend::lang.permissioneditor.deny",checked:"data-[state=checked]:bg-danger-soft data-[state=checked]:text-danger"}],d=b(()=>`${n.controlId}-label`);function f($,g){return`${n.controlId}-${$}-${g}`}function m($){return o.value||!!$.locked}function p($){return!!$.locked&&!o.value}function h($){return s.value[$.code]??0}function x($,g){if(m($))return;const S={...s.value};g===1||l.value&&g===-1?S[$.code]=g:delete S[$.code],a("update:modelValue",S)}return($,g)=>r.value.length===0?(v(),_("div",{key:0,id:e.controlId,"data-permission-empty":"",class:"flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 text-muted"},D(i(k)("backend::lang.permissioneditor.empty")),9,mI)):(v(),_("div",{key:1,id:e.controlId,role:"group","aria-labelledby":e.field.label?d.value:void 0,"aria-label":e.field.label?void 0:e.field.name,"aria-describedby":e.describedBy||void 0,class:ye([e.invalid?"border-danger":"border-border","overflow-hidden rounded-inner border"]),"data-permission-editor":"","data-mode":l.value?"radio":"checkbox"},[(v(!0),_(ve,null,qe(u.value,(S,T)=>(v(),_("div",{key:S.key,role:"group","aria-labelledby":`${e.controlId}-section-${T}`,"data-permission-section":""},[C("h3",{id:`${e.controlId}-section-${T}`,class:ye([T>0?"border-t border-border":"","flex h-row-head items-center justify-between gap-4 bg-subtle px-4 font-semibold"])},[C("span",bI,D(S.label),1),l.value?ae("",!0):(v(),_("span",_I,D(i(k)("backend::lang.permissioneditor.allow")),1))],10,gI),(v(!0),_(ve,null,qe(S.options,(O,E)=>(v(),_("div",{key:O.code,"data-permission":O.code,"data-locked":p(O)?"":void 0,class:"flex min-h-[56px] items-center justify-between gap-x-4 gap-y-2 border-t border-border px-4 py-3 max-sm:flex-col max-sm:items-start"},[C("div",kI,[(v(),z(Bt(l.value?"span":"label"),{id:`${f(T,E)}-label`,for:l.value?void 0:f(T,E),class:"[overflow-wrap:anywhere]"},{default:B(()=>[ke(D(O.label||O.code)+" ",1),p(O)?(v(),z(i(Za),{key:0,size:14,class:"ml-1 inline-block align-[-2px] text-muted","aria-hidden":"true"})):ae("",!0)]),_:2},1032,["id","for"])),p(O)?(v(),_("p",{key:0,id:`${f(T,E)}-note`,class:"text-[13px] text-muted [overflow-wrap:anywhere]","data-permission-locked":""},D(i(k)("backend::lang.permissioneditor.locked")),9,wI)):O.comment?(v(),_("p",{key:1,id:`${f(T,E)}-note`,class:"text-[13px] text-muted [overflow-wrap:anywhere]"},D(O.comment),9,$I)):ae("",!0)]),l.value?(v(),z(i(l1),{key:0,orientation:"horizontal","model-value":String(h(O)),disabled:m(O),"aria-disabled":m(O)?"true":void 0,"aria-labelledby":`${f(T,E)}-label`,"aria-describedby":p(O)||O.comment?`${f(T,E)}-note`:void 0,class:"inline-flex shrink-0 gap-1 rounded-inner border border-border bg-subtle p-1","onUpdate:modelValue":I=>x(O,Number(I))},{default:B(()=>[(v(),_(ve,null,qe(c,I=>F(i(o1),{key:I.value,value:I.value,"data-segment":I.value,class:ye([I.checked,"inline-flex h-pager items-center rounded-tab px-4 text-[13px] whitespace-nowrap text-muted transition-colors duration-150 ease-out hover:text-text disabled:cursor-not-allowed disabled:hover:text-muted data-[state=checked]:text-[14px] data-[state=checked]:font-semibold"])},{default:B(()=>[ke(D(i(k)(I.label)),1)]),_:2},1032,["value","data-segment","class"])),64))]),_:1},8,["model-value","disabled","aria-disabled","aria-labelledby","aria-describedby","onUpdate:modelValue"])):(v(),z(i(aD),{key:1,id:f(T,E),"model-value":h(O)===1,disabled:m(O),"aria-disabled":m(O)?"true":void 0,"aria-labelledby":`${f(T,E)}-label`,"aria-describedby":p(O)||O.comment?`${f(T,E)}-note`:void 0,class:"flex size-[18px] shrink-0 items-center justify-center rounded-checkbox border border-border-strong bg-surface disabled:cursor-not-allowed disabled:opacity-60 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-on-primary","onUpdate:modelValue":I=>x(O,I===!0?1:0)},{default:B(()=>[F(i(lD),null,{default:B(()=>[F(i(Sa),{size:14,"aria-hidden":"true"})]),_:1})]),_:1},8,["id","model-value","disabled","aria-disabled","aria-labelledby","aria-describedby","onUpdate:modelValue"]))],8,xI))),128))],8,yI))),128))],10,hI))}}),SI=ne({__name:"FieldRenderer",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=b(()=>n0(n.field));return(l,o)=>(v(),z(Bt(r.value),{field:e.field,"model-value":e.modelValue,"control-id":e.controlId,invalid:e.invalid,"described-by":e.describedBy,labels:e.labels,source:e.source,"record-id":e.recordId,"onUpdate:modelValue":o[0]||(o[0]=s=>a("update:modelValue",s))},null,8,["field","model-value","control-id","invalid","described-by","labels","source","record-id"]))}}),EI=["data-field"],AI=["id"],TI={key:0,class:"text-danger","aria-hidden":"true"},DI=["id","for"],OI={key:0,class:"text-danger","aria-hidden":"true"},MI=["id"],PI=["id"],RI=["id"],II=ne({__name:"FormField",props:{field:{},modelValue:{},errors:{},notices:{},labels:{},source:{},recordId:{},idPrefix:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=b(()=>`${n.idPrefix??"field"}-${n.field.name}`),l=b(()=>r.value),o=b(()=>`${r.value}-comment`),s=b(()=>`${r.value}-error`),u=b(()=>`${r.value}-notice`),c=b(()=>(n.errors?.length??0)>0),d=b(()=>(n.notices?.length??0)>0),f=b(()=>tB(n.field.type)),m=b(()=>nB(n.field.type)||Au(n.field)),p=b(()=>!f.value&&!!n.field.comment),h=b(()=>[p.value||f.value&&n.field.comment?o.value:"",c.value?s.value:"",d.value?u.value:""].filter(Boolean).join(" "));return(x,$)=>(v(),_("div",{class:"flex min-w-0 flex-col gap-1.5","data-field":e.field.name},[m.value&&e.field.label?(v(),_("span",{key:0,id:`${l.value}-label`,class:"font-semibold"},[ke(D(e.field.label),1),e.field.required?(v(),_("span",TI," *")):ae("",!0)],8,AI)):!f.value&&!m.value?(v(),_("label",{key:1,id:`${l.value}-label`,for:l.value,class:"font-semibold"},[ke(D(e.field.label||e.field.name),1),e.field.required?(v(),_("span",OI," *")):ae("",!0)],8,DI)):ae("",!0),F(SI,{field:e.field,"model-value":e.modelValue,"control-id":l.value,invalid:c.value,"described-by":h.value,labels:e.labels,source:e.source,"record-id":e.recordId,"onUpdate:modelValue":$[0]||($[0]=g=>a("update:modelValue",g))},null,8,["field","model-value","control-id","invalid","described-by","labels","source","record-id"]),p.value?(v(),_("p",{key:2,id:o.value,class:"text-[13px] text-muted"},D(e.field.comment),9,MI)):ae("",!0),d.value?(v(),_("div",{key:3,id:u.value,role:"status","data-field-notice":"",class:"summer-callout summer-callout--warning text-[13px]!"},[(v(!0),_(ve,null,qe(e.notices,(g,S)=>(v(),_("p",{key:S,class:"summer-callout__text"},D(g),1))),128))],8,PI)):ae("",!0),c.value?(v(),_("div",{key:4,id:s.value,class:"flex flex-col gap-0.5 text-[13px] text-danger"},[(v(!0),_(ve,null,qe(e.errors,(g,S)=>(v(),_("p",{key:S,class:"flex items-center gap-1.5"},[F(i(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),C("span",null,D(g),1)]))),128))],8,RI)):ae("",!0)],8,EI))}}),qI={class:"grid grid-cols-1 gap-x-6 gap-y-[22px] min-[600px]:grid-cols-2"},to=ne({__name:"FormGrid",props:{fields:{},values:{},errors:{},notices:{},labels:{},source:{},recordId:{},idPrefix:{},scopePath:{}},emits:["update"],setup(e,{emit:t}){const n=e,a=t;wt(Cu,{fields:b(()=>n.fields),values:b(()=>n.values),path:l=>n.scopePath?`${n.scopePath}.${l}`:l});function r(l){if(l.type===Jr)return"col-span-full";switch(l.span){case"left":return"min-[600px]:col-start-1";case"right":return"min-[600px]:col-start-2";case"auto":case"row":return"";default:return"col-span-full"}}return(l,o)=>(v(),_("div",qI,[(v(!0),_(ve,null,qe(e.fields,s=>(v(),z(II,{key:s.name,class:ye(r(s)),field:s,"model-value":e.values[s.name],errors:e.errors[s.name],notices:e.notices?.[s.name],labels:e.labels?.[s.name],source:e.source,"record-id":e.recordId,"id-prefix":e.idPrefix,"onUpdate:modelValue":u=>a("update",s.name,u)},null,8,["class","field","model-value","errors","notices","labels","source","record-id","id-prefix","onUpdate:modelValue"]))),128))]))}}),NI=["data-preview-field"],LI=["id"],BI={class:"m-0 min-w-0"},FI={key:0,"data-switch":"true",class:"inline-flex h-6 items-center rounded-pill bg-ok-bg px-2.5 text-[12px] font-semibold text-ok-text"},VI={key:1,"data-switch":"false",class:"inline-flex h-6 items-center rounded-pill border border-border-strong px-2.5 text-[12px] font-semibold text-muted"},zI={class:"flex size-[22px] shrink-0 items-center justify-center rounded-full bg-primary text-[10px] font-bold text-on-primary","aria-hidden":"true"},jI={class:"font-semibold"},UI={key:0,class:"px-2 text-muted","data-empty":""},HI={key:0},WI={key:1,class:"text-muted","data-empty":""},KI={key:0},GI={key:1,class:"text-muted","data-empty":""},Ec="flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 [overflow-wrap:anywhere]",V1=ne({__name:"PreviewField",props:{field:{},value:{},labels:{},source:{},recordId:{},idPrefix:{}},setup(e){const t=e,n=new Set(["datepicker","fileupload","partial","permissioneditor","richeditor","repeater","money","taglist"]),a=b(()=>`${t.idPrefix??"preview"}-${t.field.name}`),r=b(()=>`${a.value}-label`),l=b(()=>{const p=t.field.type;return n.has(p)||Au(t.field)?"control":p==="checkbox"||p==="switch"?"toggle":p==="relation"?t.field.multiple?"chips":"relation":p==="textarea"?"textarea":"text"}),o=b(()=>({...t.field,readOnly:!0})),s=b(()=>n0(t.field));function u(p){return p==null||p===""}const c=b(()=>{const p=t.value;if(u(p)||typeof p=="object")return"";if(t.field.type==="dropdown"){const h=(t.field.options??[]).find(x=>String(x.value)===String(p));return h?h.label:String(p)}return String(p)}),d=b(()=>t.labels?.[0]?.label??""),f=b(()=>Array.isArray(t.value)?t.labels??[]:[]);function m(p){return p.trim().split(/\s+/).filter(Boolean).slice(0,2).map(x=>x.charAt(0).toUpperCase()).join("")}return(p,h)=>(v(),_("div",{class:"flex min-w-0 flex-col gap-1.5","data-preview-field":e.field.name},[C("dt",{id:r.value,class:"font-semibold"},D(e.field.label||e.field.name),9,LI),C("dd",BI,[l.value==="control"?(v(),z(Bt(s.value),{key:0,field:o.value,"model-value":e.value,"control-id":a.value,labels:e.labels,source:e.source,"record-id":e.recordId},null,8,["field","model-value","control-id","labels","source","record-id"])):l.value==="toggle"?(v(),_(ve,{key:1},[i(Gf)(e.value)?(v(),_("span",FI,D(i(k)("backend::lang.list.column_switch_true")),1)):(v(),_("span",VI,D(i(k)("backend::lang.list.column_switch_false")),1))],64)):l.value==="chips"?(v(),_("div",{key:2,"data-preview-value":"",class:ye([Ec,"flex-wrap gap-1.5 p-1.5"])},[(v(!0),_(ve,null,qe(f.value,x=>(v(),_("span",{key:String(x.value),"data-chip":"",class:"inline-flex min-h-[30px] items-center gap-1.5 rounded-pill bg-surface pr-3 pl-1"},[C("span",zI,D(m(x.label)),1),C("span",jI,D(x.label),1)]))),128)),f.value.length===0?(v(),_("span",UI,D(i(k)("backend::lang.list.empty_value")),1)):ae("",!0)])):l.value==="relation"?(v(),_("div",{key:3,"data-preview-value":"",class:ye(Ec)},[d.value!==""?(v(),_("span",HI,D(d.value),1)):(v(),_("span",WI,D(e.field.emptyOption||i(k)("backend::lang.list.empty_value")),1))])):(v(),_("div",{key:4,"data-preview-value":"",class:ye([Ec,l.value==="textarea"?"items-start! py-3 whitespace-pre-wrap":""])},[c.value!==""?(v(),_("span",KI,D(c.value),1)):(v(),_("span",GI,D(i(k)("backend::lang.list.empty_value")),1))],2))])],8,NI))}}),z1=new Set(["p","br","strong","b","em","i","u","s","h3","ul","ol","li","blockquote","a","div","span"]);function j1(e){const t=document.createElement("template");return t.innerHTML=e,t.content}function YI(e){if(e==="")return[];const t=new Set;for(const n of Array.from(j1(e).querySelectorAll("*")))t.add(n.localName.toLowerCase());return[...t]}function Bm(e){return YI(e).some(t=>!z1.has(t))}const JI=["aria-labelledby","aria-describedby","data-repeater"],ZI={key:0,"data-repeater-empty":"",class:"flex flex-col items-center gap-2 rounded-inner border border-dashed border-border-strong px-6 py-8 text-center"},XI={class:"font-semibold"},QI={key:0,class:"max-w-[420px] text-[13px] text-muted"},eq={key:0,"data-repeater-slot":"",class:"h-12 rounded-inner border-2 border-dashed border-primary bg-sel"},tq=["data-repeater-row","data-repeater-key","onDragover"],nq=["data-repeater-handle","aria-label","onKeydown","onDragstart"],aq={class:"text-[13px] text-muted tabular-nums"},rq=["title"],lq={key:1,"data-repeater-errors":"",class:"inline-flex h-6 items-center rounded-pill bg-danger-soft px-2.5 text-[13px] font-semibold text-danger"},oq={key:2,class:"flex gap-1"},sq=["aria-label","disabled","onClick"],iq=["aria-label","disabled","onClick"],uq=["aria-label","aria-expanded","aria-controls","onClick"],cq=["aria-label","disabled","onClick"],dq=["id"],fq={key:0,class:"m-0 grid grid-cols-1 gap-x-6 gap-y-[22px] min-[600px]:grid-cols-2"},pq={key:2,class:"flex flex-wrap items-center gap-4"},vq={key:0,"data-repeater-count":"",class:"text-[13px] text-muted tabular-nums"},yo="inline-flex size-8 shrink-0 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-40",mq=ne({__name:"RepeaterField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=ct(Qf,null),l=b(()=>n.field.form?.fields??[]),o=b(()=>!!n.field.readOnly),s=b(()=>Array.isArray(n.modelValue)?n.modelValue.map(Z=>Z!==null&&typeof Z=="object"&&!Array.isArray(Z)?Z:{}):[]),u=b(()=>typeof n.field.maxItems=="number"?n.field.maxItems:null),c=b(()=>typeof n.field.minItems=="number"?n.field.minItems:0),d=b(()=>n.field.prompt||k("backend::lang.repeater.add")),f=b(()=>`${n.controlId}-label`);let m=0;const p=P([]),h=P(new Set);let x;function $(){return m+=1,`r${m}`}Ue(()=>n.modelValue,Z=>{Z===x&&p.value.length===s.value.length||p.value.length!==s.value.length&&(p.value=s.value.map(()=>$()),h.value=new Set)},{immediate:!0});function g(Z,U){p.value=U,x=Z,a("update:modelValue",Z)}function S(Z){return Z==null||Z===""||Z===!1||Array.isArray(Z)&&Z.length===0}function T(){const Z={};for(const U of l.value)U.default!==void 0?Z[U.name]=U.default:U.type==="checkbox"||U.type==="switch"?Z[U.name]=!1:Z[U.name]=null;return Z}function O(Z){return l.value.some(U=>{const te=Z[U.name];return S(te)?!1:U.default===void 0||String(U.default)!==String(te)})}function E(Z){return(j1(Z).textContent??"").replace(/\s+/g," ").trim()}function I(Z){const U=s.value[Z]??{},te=l.value.find(M=>M.name===n.field.titleFrom),y=te?U[te.name]:void 0;let A="";return te&&!S(y)&&typeof y!="object"&&(te.type==="dropdown"?A=(te.options??[]).find(M=>String(M.value)===String(y))?.label??String(y):te.type==="richeditor"?A=E(String(y)):A=String(y).trim()),A!==""?A:k("backend::lang.repeater.untitled",{n:Z+1})}function R(Z,U){const te=`${n.field.name}.${U}.`,y={};for(const[A,M]of Object.entries(Z??{}))A.startsWith(te)&&A.length>te.length&&(y[A.slice(te.length)]=M);return y}const G=b(()=>s.value.map((Z,U)=>R(r?.errors.value,U))),w=b(()=>s.value.map((Z,U)=>R(r?.notices.value,U))),L=Z=>Object.keys(G.value[Z]??{}).length;Ue(G,Z=>{const U=Z.flatMap((te,y)=>Object.keys(te).length>0?[p.value[y]]:[]);if(U.length>0){const te=new Set(h.value);for(const y of U)te.delete(y);h.value=te}});function j(Z){return o.value||!h.value.has(Z)}function q(Z,U){const te=new Set(h.value);U?te.delete(Z):te.add(Z),h.value=te}const W=b(()=>p.value.some(Z=>!h.value.has(Z)));function X(){h.value=W.value?new Set(p.value):new Set}const V=P(null),H=P(null);function le(Z){return V.value?.querySelector(`[data-repeater-handle="${Z}"]`)??null}function ue(Z,U,te){const y=s.value.map((A,M)=>M===Z?{...A,[U]:te}:A);g(y,[...p.value]),r?.clearError(`${n.field.name}.${Z}.${U}`)}async function Oe(){if(o.value||u.value!==null&&s.value.length>=u.value)return;const Z=$();g([...s.value,T()],[...p.value,Z]),await Xe(),V.value?.querySelector(`[data-repeater-key="${Z}"]`)?.querySelector('[data-repeater-body] input, [data-repeater-body] select, [data-repeater-body] textarea, [data-repeater-body] [contenteditable="true"]')?.focus()}async function Ee(Z){const U=s.value[Z];if(!U||o.value||s.value.length<=c.value)return;if(O(U)&&r){const M=I(Z);if(!await r.confirm({message:k("backend::lang.repeater.remove_confirm",{title:M}),confirmLabel:k("backend::lang.repeater.remove"),danger:!0}))return}const te=p.value.filter((M,ie)=>ie!==Z);g(s.value.filter((M,ie)=>ie!==Z),te),await Xe();const y=te[Z]??te[Z-1],A=y?le(y):null;A?A.focus():H.value?.$el.focus()}async function pe(Z,U){const te=s.value.length;if(o.value||Z===U||Z<0||U<0||Z>=te||U>=te)return;const y=[...s.value],A=[...p.value],[M]=y.splice(Z,1),[ie]=A.splice(Z,1);y.splice(U,0,M),A.splice(U,0,ie),g(y,A),await Xe(),le(ie)?.focus(),r?.announce(k("backend::lang.repeater.moved",{title:I(U),position:U+1,total:te}))}function fe(Z,U){(Z.key==="ArrowUp"||Z.key==="ArrowDown")&&(Z.preventDefault(),pe(U,Z.key==="ArrowUp"?U-1:U+1))}const ge=P(null),K=P(null);function xe(Z,U){ge.value=U,K.value=null,Z.dataTransfer?.setData("text/plain",p.value[U]??""),Z.dataTransfer&&(Z.dataTransfer.effectAllowed="move")}function re(Z,U){if(ge.value===null)return;Z.preventDefault();const y=Z.currentTarget.getBoundingClientRect();K.value=Z.clientY>y.top+y.height/2?U+1:U}function Q(Z){if(ge.value===null||K.value===null)return;Z.preventDefault();const U=ge.value,te=K.value>U?K.value-1:K.value;ce(),pe(U,te)}function ce(){ge.value=null,K.value=null}return(Z,U)=>(v(),_("div",{ref_key:"root",ref:V,role:"group","aria-labelledby":f.value,"aria-describedby":e.describedBy||void 0,"data-repeater":e.field.name,class:"flex flex-col gap-4"},[s.value.length===0?(v(),_("div",ZI,[C("p",XI,D(i(k)("backend::lang.repeater.empty")),1),o.value?ae("",!0):(v(),_("p",QI,D(i(k)("backend::lang.repeater.empty_hint",{prompt:d.value})),1))])):ae("",!0),(v(!0),_(ve,null,qe(s.value,(te,y)=>(v(),_(ve,{key:p.value[y]},[ge.value!==null&&K.value===y&&K.value!==ge.value&&K.value!==ge.value+1?(v(),_("div",eq)):ae("",!0),C("div",{"data-repeater-row":y,"data-repeater-key":p.value[y],class:ye([[L(y)>0?"border-danger":"border-border",ge.value===y?"opacity-50":""],"rounded-inner border bg-surface"]),onDragover:A=>re(A,y),onDrop:Q},[C("div",{class:ye([j(p.value[y])?"rounded-t-inner border-b border-border":"rounded-inner","flex min-h-12 items-center gap-2 bg-subtle px-2"])},[o.value?ae("",!0):(v(),_("button",{key:0,type:"button",draggable:"true","data-repeater-handle":p.value[y],"aria-label":i(k)("backend::lang.repeater.move",{title:I(y)}),class:ye([yo,"cursor-grab"]),onKeydown:A=>fe(A,y),onDragstart:A=>xe(A,y),onDragend:ce},[F(i(xi),{size:16,"aria-hidden":"true"})],40,nq)),C("span",aq,D(y+1)+".",1),C("span",{"data-repeater-title":"",class:"min-w-0 flex-1 truncate font-semibold",title:I(y)},D(I(y)),9,rq),L(y)>0?(v(),_("span",lq,D(i(Br)("backend::lang.form.tab_errors",L(y))),1)):ae("",!0),o.value?ae("",!0):(v(),_("div",oq,[C("button",{type:"button","data-action":"repeater-up","aria-label":i(k)("backend::lang.repeater.move_up",{title:I(y)}),disabled:y===0,class:ye(yo),onClick:A=>pe(y,y-1)},[F(i(dg),{size:16,"aria-hidden":"true"})],8,sq),C("button",{type:"button","data-action":"repeater-down","aria-label":i(k)("backend::lang.repeater.move_down",{title:I(y)}),disabled:y===s.value.length-1,class:ye(yo),onClick:A=>pe(y,y+1)},[F(i(lr),{size:16,"aria-hidden":"true"})],8,iq),C("button",{type:"button","data-action":"repeater-toggle","aria-label":i(k)(j(p.value[y])?"backend::lang.repeater.collapse":"backend::lang.repeater.expand",{title:I(y)}),"aria-expanded":j(p.value[y])?"true":"false","aria-controls":`${e.controlId}-${p.value[y]}-body`,class:ye(yo),onClick:A=>q(p.value[y],!j(p.value[y]))},[F(i(lr),{size:16,class:ye([j(p.value[y])?"rotate-180":"","transition-transform duration-150"]),"aria-hidden":"true"},null,8,["class"])],8,uq),C("button",{type:"button","data-action":"repeater-remove","aria-label":i(k)("backend::lang.repeater.remove_named",{title:I(y)}),disabled:s.value.length<=c.value,class:ye([yo,"hover:bg-danger-soft hover:text-danger"]),onClick:A=>Ee(y)},[F(i(hr),{size:16,"aria-hidden":"true"})],8,cq)]))],2),j(p.value[y])?(v(),_("div",{key:0,id:`${e.controlId}-${p.value[y]}-body`,"data-repeater-body":"",class:"p-4"},[o.value?(v(),_("dl",fq,[(v(!0),_(ve,null,qe(l.value,A=>(v(),z(V1,{key:A.name,class:ye(A.span==="left"?"min-[600px]:col-start-1":A.span==="right"?"min-[600px]:col-start-2":"col-span-full"),field:{...A,readOnly:!0},value:te[A.name],source:e.source,"record-id":e.recordId,"id-prefix":`${e.controlId}-${p.value[y]}`},null,8,["class","field","value","source","record-id","id-prefix"]))),128))])):(v(),z(to,{key:1,fields:l.value,values:te,errors:G.value[y]??{},notices:w.value[y],source:e.source,"record-id":e.recordId,"id-prefix":`${e.controlId}-${p.value[y]}`,"scope-path":e.field.name,onUpdate:(A,M)=>ue(y,A,M)},null,8,["fields","values","errors","notices","source","record-id","id-prefix","scope-path","onUpdate"]))],8,dq)):ae("",!0)],42,tq)],64))),128)),ge.value!==null&&K.value===s.value.length&&K.value!==ge.value+1?(v(),_("div",{key:1,"data-repeater-slot":"",class:"h-12 rounded-inner border-2 border-dashed border-primary bg-sel",onDragover:U[0]||(U[0]=mt(()=>{},["prevent"])),onDrop:Q},null,32)):ae("",!0),o.value?ae("",!0):(v(),_("div",pq,[F(Ze,{ref_key:"addButton",ref:H,variant:"outline",size:"sm",icon:i(ms),"data-action":"repeater-add",disabled:u.value!==null&&s.value.length>=u.value,onClick:Oe},{default:B(()=>[ke(D(d.value),1)]),_:1},8,["icon","disabled"]),u.value!==null?(v(),_("span",vq,D(i(k)("backend::lang.repeater.count",{current:s.value.length,max:u.value})),1)):ae("",!0),s.value.length>1?(v(),z(Ze,{key:1,variant:"ghost",size:"sm",class:"ml-auto","data-action":"repeater-toggle-all",onClick:X},{default:B(()=>[ke(D(i(k)(W.value?"backend::lang.repeater.collapse_all":"backend::lang.repeater.expand_all")),1)]),_:1})):ae("",!0)]))],8,JI))}}),hq="modulepreload",yq=function(e,t){return new URL(e,t).href},Fm={},gq=function(t,n,a){let r=Promise.resolve();if(n&&n.length>0){let c=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};const o=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),u=s?.nonce||s?.getAttribute("nonce");r=c(n.map(d=>{if(d=yq(d,a),d in Fm)return;Fm[d]=!0;const f=d.endsWith(".css"),m=f?'[rel="stylesheet"]':"";if(a)for(let h=o.length-1;h>=0;h--){const x=o[h];if(x.href===d&&(!f||x.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${m}`))return;const p=document.createElement("link");if(p.rel=f?"stylesheet":hq,f||(p.as="script"),p.crossOrigin="",p.href=d,u&&p.setAttribute("nonce",u),document.head.appendChild(p),f)return new Promise((h,x)=>{p.addEventListener("load",h),p.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${d}`)))})}))}function l(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return r.then(o=>{for(const s of o||[])s.status==="rejected"&&l(s.reason);return t().catch(l)})};function Vm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n2?a-2:0),l=2;l1?n-1:0),r=1;r"u"?null:Ot(BigInt.prototype.toString),Km=typeof Symbol>"u"?null:Ot(Symbol.prototype.toString),an=Ot(Object.prototype.hasOwnProperty),_o=Ot(Object.prototype.toString),Wt=Ot(RegExp.prototype.test),ja=Mq(TypeError);function Ot(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:Eo;if(zm&&zm(e,null),!Rl(t))return e;let a=t.length;for(;a--;){let r=t[a];if(typeof r=="string"){const l=n(r);l!==r&&($q(t)||(t[a]=l),r=l)}e[r]=!0}return e}function Pq(e){for(let t=0;t/g),Fq=Ft(/\${[\w\W]*/g),Vq=Ft(/^data-[\-\w.\u00B7-\uFFFF]+$/),zq=Ft(/^aria-[\-\w]+$/),Xm=Ft(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jq=Ft(/^(?:\w+script|data):/i),Uq=Ft(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hq=Ft(/^html$/i),Wq=Ft(/^[a-z][.\w]*(-[.\w]+)+$/i),Qm=Ft(/<[/\w!]/g),eh=Ft(/<[/\w]/g),Kq=Ft(/<\/no(script|embed|frames)/i),Gq=Ft(/\/>/i),pn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},W1=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Yq=It(ut({},W1)),Jq=(function(){const e={};return Mr(W1,t=>{e[t]=Ft(new RegExp("])","i"))}),It(e)})(),Zq=function(){return typeof window>"u"?null:window},Xq=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let a=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(a=n.getAttribute(r));const l="dompurify"+(a?"#"+a:"");try{return t.createPolicy(l,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},th=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ua=function(t,n,a,r){return an(t,n)&&Rl(t[n])?ut(r.base?vn(r.base):{},t[n],r.transform):a},Pc=function(t,n,a){const r=an(t,n)?t[n]:void 0;return r&&typeof r=="object"?vn(r):a()};function K1(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Zq();const t=De=>K1(De);if(t.version="3.4.16",t.removed=[],!e||!e.document||e.document.nodeType!==pn.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const a=n,r=a.currentScript;e.DocumentFragment;const l=e.HTMLTemplateElement,o=e.Node,s=e.Element,u=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const c=e.DOMParser,d=e.trustedTypes,f=s.prototype,m=kn(f,"cloneNode"),p=kn(f,"remove"),h=kn(f,"removeAttributeNode"),x=kn(f,"nextSibling"),$=kn(f,"childNodes"),g=kn(f,"parentNode"),S=kn(f,"shadowRoot"),T=kn(f,"attributes"),O=o&&o.prototype?kn(o.prototype,"nodeType"):null,E=o&&o.prototype?kn(o.prototype,"nodeName"):null,I=o&&o.prototype?kn(o.prototype,"ownerDocument"):null,R=function(N){return O?O(N):N.nodeType},G=function(N){return E?E(N):N.nodeName};if(typeof l=="function"){const De=n.createElement("template");De.content&&De.content.ownerDocument&&(n=De.content.ownerDocument)}let w,L="",j,q=!1,W=0;const X=function(){if(W>0)throw ja('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},V=function(N){X(),W++;try{return w.createHTML(N)}finally{W--}},H=function(N){X(),W++;try{return w.createScriptURL(N)}finally{W--}},le=function(){return q||(j=Xq(d,r),q=!0),j},ue=n,Oe=ue.implementation,Ee=ue.createNodeIterator,pe=ue.createDocumentFragment,fe=ue.getElementsByTagName,ge=a.importNode;let K=th();t.isSupported=typeof U1=="function"&&typeof g=="function"&&Oe&&Oe.createHTMLDocument!==void 0;const xe=Lq,re=Bq,Q=Fq,ce=Vq,Z=zq,U=jq,te=Uq,y=Wq;let A=Xm,M=null;const ie=ut({},[...Gm,...Tc,...Dc,...Oc,...Ym]);let Y=null;const de=ut({},[...Jm,...Mc,...Zm,...Us]);let we=Object.seal(gl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,Ae=null;const oe=Object.seal(gl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let $e=!0,he=!0,Re=!1,Fe=!0,Ke=!1,Je=!0,be=!1,Me=!1,Le=null,at=null,st=!1,Mt=!1,je=!1,ze=!1,We=!0,Nt=!1;const Ia="user-content-";let kr=!0,Zr=!1,Ht={},sa=null;const Xr=ut({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let _s=null;const Qr=ut({},["audio","video","img","source","image","track"]);let ao=null;const Bn=ut({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qa="http://www.w3.org/1998/Math/MathML",ia="http://www.w3.org/2000/svg",tn="http://www.w3.org/1999/xhtml";let Na=tn,ro=!1,wr=null;const J=ut({},[qa,ia,tn],Ac),Te=It(["mi","mo","mn","ms","mtext"]);let ee=ut({},Te);const Ie=It(["annotation-xml"]);let Qe=ut({},Ie);const Vt=ut({},["title","style","font","a","script"]);let nn=null;const La=["application/xhtml+xml","text/html"],p0="text/html";let Et=null,el=null;const v0=n.createElement("form"),tp=function(N){return N instanceof RegExp||N instanceof Function},Tu=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(el&&el===N)return;(!N||typeof N!="object")&&(N={}),N=vn(N),nn=La.indexOf(N.PARSER_MEDIA_TYPE)===-1?p0:N.PARSER_MEDIA_TYPE,Et=nn==="application/xhtml+xml"?Ac:Eo,M=Ua(N,"ALLOWED_TAGS",ie,{transform:Et}),Y=Ua(N,"ALLOWED_ATTR",de,{transform:Et}),wr=Ua(N,"ALLOWED_NAMESPACES",J,{transform:Ac}),ao=Ua(N,"ADD_URI_SAFE_ATTR",Bn,{transform:Et,base:Bn}),_s=Ua(N,"ADD_DATA_URI_TAGS",Qr,{transform:Et,base:Qr}),sa=Ua(N,"FORBID_CONTENTS",Xr,{transform:Et}),Se=Ua(N,"FORBID_TAGS",vn({}),{transform:Et}),Ae=Ua(N,"FORBID_ATTR",vn({}),{transform:Et}),Ht=an(N,"USE_PROFILES")?N.USE_PROFILES&&typeof N.USE_PROFILES=="object"?vn(N.USE_PROFILES):N.USE_PROFILES:!1,$e=N.ALLOW_ARIA_ATTR!==!1,he=N.ALLOW_DATA_ATTR!==!1,Re=N.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ke=N.SAFE_FOR_TEMPLATES||!1,Je=N.SAFE_FOR_XML!==!1,be=N.WHOLE_DOCUMENT||!1,Mt=N.RETURN_DOM||!1,je=N.RETURN_DOM_FRAGMENT||!1,ze=N.RETURN_TRUSTED_TYPE||!1,st=N.FORCE_BODY||!1,We=N.SANITIZE_DOM!==!1,Nt=N.SANITIZE_NAMED_PROPS||!1,kr=N.KEEP_CONTENT!==!1,Zr=N.IN_PLACE||!1,A=Iq(N.ALLOWED_URI_REGEXP)?N.ALLOWED_URI_REGEXP:Xm,Na=typeof N.NAMESPACE=="string"?N.NAMESPACE:tn,ee=Pc(N,"MATHML_TEXT_INTEGRATION_POINTS",()=>ut({},Te)),Qe=Pc(N,"HTML_INTEGRATION_POINTS",()=>ut({},Ie));const se=Pc(N,"CUSTOM_ELEMENT_HANDLING",()=>gl(null));if(we=gl(null),an(se,"tagNameCheck")&&tp(se.tagNameCheck)&&(we.tagNameCheck=se.tagNameCheck),an(se,"attributeNameCheck")&&tp(se.attributeNameCheck)&&(we.attributeNameCheck=se.attributeNameCheck),an(se,"allowCustomizedBuiltInElements")&&typeof se.allowCustomizedBuiltInElements=="boolean"&&(we.allowCustomizedBuiltInElements=se.allowCustomizedBuiltInElements),Ft(we),Ke&&(he=!1),je&&(Mt=!0),Ht&&(M=ut({},Ym),Y=gl(null),Ht.html===!0&&(ut(M,Gm),ut(Y,Jm)),Ht.svg===!0&&(ut(M,Tc),ut(Y,Mc),ut(Y,Us)),Ht.svgFilters===!0&&(ut(M,Dc),ut(Y,Mc),ut(Y,Us)),Ht.mathMl===!0&&(ut(M,Oc),ut(Y,Zm),ut(Y,Us))),oe.tagCheck=null,oe.attributeCheck=null,an(N,"ADD_TAGS")&&(typeof N.ADD_TAGS=="function"?oe.tagCheck=N.ADD_TAGS:Rl(N.ADD_TAGS)&&(M===ie&&(M=vn(M)),ut(M,N.ADD_TAGS,Et))),an(N,"ADD_ATTR")&&(typeof N.ADD_ATTR=="function"?oe.attributeCheck=N.ADD_ATTR:Rl(N.ADD_ATTR)&&(Y===de&&(Y=vn(Y)),ut(Y,N.ADD_ATTR,Et))),an(N,"ADD_FORBID_CONTENTS")&&Rl(N.ADD_FORBID_CONTENTS)&&(sa===Xr&&(sa=vn(sa)),ut(sa,N.ADD_FORBID_CONTENTS,Et)),kr&&(M["#text"]=!0),be&&ut(M,["html","head","body"]),M.table&&(ut(M,["tbody"]),delete Se.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw ja('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ja('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Ce=w;w=N.TRUSTED_TYPES_POLICY;try{L=V("")}catch(Pe){throw w=Ce,Pe}}else N.TRUSTED_TYPES_POLICY===null?(w=void 0,L=""):(w===void 0&&(w=le()),w&&typeof L=="string"&&(L=V("")));It&&It(N),el=N},np=ut({},[...Tc,...Dc,...qq]),ap=ut({},[...Oc,...Nq]),m0=function(N,se,Ce){return se.namespaceURI===tn?N==="svg":se.namespaceURI===qa?N==="svg"&&(Ce==="annotation-xml"||ee[Ce]):!!np[N]},h0=function(N,se,Ce){return se.namespaceURI===tn?N==="math":se.namespaceURI===ia?N==="math"&&Qe[Ce]:!!ap[N]},y0=function(N,se,Ce){return se.namespaceURI===ia&&!Qe[Ce]||se.namespaceURI===qa&&!ee[Ce]?!1:!ap[N]&&(Vt[N]||!np[N])},g0=function(N){let se=g(N);(!se||!se.tagName)&&(se={namespaceURI:Na,tagName:"template"});const Ce=Eo(N.tagName),Pe=Eo(se.tagName);return wr[N.namespaceURI]?N.namespaceURI===ia?m0(Ce,se,Pe):N.namespaceURI===qa?h0(Ce,se,Pe):N.namespaceURI===tn?y0(Ce,se,Pe):!!(nn==="application/xhtml+xml"&&wr[N.namespaceURI]):!1},Ba=function(N){go(t.removed,{element:N});try{g(N).removeChild(N)}catch{if(p(N),!g(N))throw ja("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},rp=function(N,se,Ce){try{h(N,se)}catch{try{N.removeAttribute(Ce)}catch{}}},xs=function(N){ks(N);const se=$(N);if(se){const Pe=[];Mr(se,He=>{go(Pe,He)}),Mr(Pe,He=>{try{p(He)}catch{}})}const Ce=T(N);if(Ce)for(let Pe=Ce.length-1;Pe>=0;--Pe){const He=Ce[Pe],ot=He&&He.name;typeof ot=="string"&&rp(N,He,ot)}},$r=function(N,se,Ce){if(!Ce)try{Ce=se.getAttributeNode(N)}catch{Ce=null}go(t.removed,{attribute:Ce||null,from:se});try{Ce?h(se,Ce):se.removeAttribute(N)}catch{try{se.removeAttribute(N)}catch{}}if(N==="is")if(Mt||je)try{Ba(se)}catch{}else try{se.setAttribute(N,"")}catch{}},b0=function(N){const se=T(N);if(se)for(let Ce=se.length-1;Ce>=0;--Ce){const Pe=se[Ce],He=Pe&&Pe.name;typeof He!="string"||Y[Et(He)]||rp(N,Pe,He)}},ks=function(N){const se=[N];for(;se.length>0;){const Ce=se.pop();R(Ce)===pn.element&&b0(Ce);const Pe=$(Ce);if(Pe)for(let He=Pe.length-1;He>=0;--He)se.push(Pe[He])}},lp=function(N,se){return Je?N==="patchsrc"?!0:N==="for"&&se!=="label"&&se!=="output":!1},_0=function(N){if(!Je)return;const se=[N];for(;se.length>0;){const Ce=se.pop(),Pe=R(Ce);if(Pe===pn.processingInstruction||Pe===pn.comment&&Wt(eh,Ce.data)){try{p(Ce)}catch{}continue}if(Pe===pn.element){const ot=Ce,it=Et(G(Ce));try{ot.hasAttribute&&ot.hasAttribute("patchsrc")&&ot.removeAttribute("patchsrc"),ot.hasAttribute&&ot.hasAttribute("for")&&lp("for",it)&&ot.removeAttribute("for")}catch{}}const He=$(Ce);if(He)for(let ot=He.length-1;ot>=0;--ot)se.push(He[ot])}},op=function(N){let se=null,Ce=null;if(st)N=""+N;else{const ot=Um(N,/^[\r\n\t ]+/);Ce=ot&&ot[0]}nn==="application/xhtml+xml"&&Na===tn&&(N=''+N+"");const Pe=w?V(N):N;if(Na===tn)try{se=new c().parseFromString(Pe,nn)}catch{}if(!se||!se.documentElement){se=Oe.createDocument(Na,"template",null);try{se.documentElement.innerHTML=ro?L:Pe}catch{}}const He=se.body||se.documentElement;return N&&Ce&&He.insertBefore(n.createTextNode(Ce),He.childNodes[0]||null),Na===tn?fe.call(se,be?"html":"body")[0]:be?se.documentElement:He},sp=function(N){const se=I?I(N):N.ownerDocument;return Ee.call(se||N,N,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},ws=function(N){return N=bo(N,xe," "),N=bo(N,re," "),N=bo(N,Q," "),N},Du=function(N){var se;N.normalize();const Ce=I?I(N):N.ownerDocument,Pe=Ee.call(Ce||N,N,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let He=Pe.nextNode();for(;He;)He.data=ws(He.data),He=Pe.nextNode();const ot=(se=N.querySelectorAll)===null||se===void 0?void 0:se.call(N,"template");ot&&Mr(ot,it=>{tl(it.content)&&Du(it.content)})},$s=function(N){const se=E?E(N):null;return typeof se!="string"||Et(se)!=="form"?!1:typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||N.attributes!==T(N)||typeof N.removeAttribute!="function"||typeof N.removeAttributeNode!="function"||typeof N.getAttributeNode!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function"||N.nodeType!==O(N)||N.childNodes!==$(N)},tl=function(N){if(!O||typeof N!="object"||N===null)return!1;try{return O(N)===pn.documentFragment}catch{return!1}},lo=function(N){if(!O||typeof N!="object"||N===null)return!1;try{return typeof O(N)=="number"}catch{return!1}};function Fn(De,N,se){De.length!==0&&Mr(De,Ce=>{Ce.call(t,N,se,el)})}const x0=function(N,se){return!!(Je&&N.hasChildNodes()&&!lo(N.firstElementChild)&&Wt(Qm,N.textContent)&&Wt(Qm,N.innerHTML)||Je&&N.namespaceURI===tn&&Yq[se]&&(lo(N.firstElementChild)||typeof N.textContent=="string"&&Wt(Jq[se],N.textContent))||N.nodeType===pn.processingInstruction||Je&&N.nodeType===pn.comment&&Wt(eh,N.data))},Cs=function(N,se){if(N instanceof RegExp)return Wt(N,se);if(N instanceof Function){for(var Ce=arguments.length,Pe=new Array(Ce>2?Ce-2:0),He=2;He=0;--it){const $t=N===Ce?m(He[it],!0):He[it];Pe.insertBefore($t,x(N))}}}return Ba(N),!0},ip=function(N,se,Ce,Pe){return N.length===0?se:se===Ce||se===Pe?vn(se):se},nl=function(N,se){return N===se||g(N)!==null?!1:(Zr&&ks(N),!0)},up=function(N,se){if(Fn(K.beforeSanitizeElements,N,null),nl(N,se))return!0;if($s(N))return Ba(N),!0;const Ce=Et(G(N));if(M=ip(K.uponSanitizeElement,M,ie,Le),Fn(K.uponSanitizeElement,N,{tagName:Ce,allowedTags:M}),nl(N,se))return!0;if(x0(N,Ce))return Ba(N),!0;if(Se[Ce]||!(oe.tagCheck instanceof Function&&oe.tagCheck(Ce))&&!M[Ce]){const Pe=k0(N,Ce,se);return Pe===!1&&(Fn(K.afterSanitizeElements,N,null),nl(N,se))?!0:Pe}if(R(N)===pn.element&&!g0(N)||(Ce==="noscript"||Ce==="noembed"||Ce==="noframes")&&Wt(Kq,N.innerHTML))return Ba(N),!0;if(Ke&&N.nodeType===pn.text){const Pe=ws(N.textContent);N.textContent!==Pe&&(go(t.removed,{element:N.cloneNode()}),N.textContent=Pe)}return Fn(K.afterSanitizeElements,N,null),nl(N,se)},cp=function(N,se,Ce){if(Ae[se]||lp(se,N)||We&&(se==="id"||se==="name")&&(Ce in n||Ce in v0))return!1;const Pe=Y[se]||oe.attributeCheck instanceof Function&&oe.attributeCheck(se,N);return he&&Wt(ce,se)||$e&&Wt(Z,se)?!0:Pe?ao[se]||Wt(A,bo(Ce,te,""))||(se==="src"||se==="xlink:href"||se==="href")&&N!=="script"&&Hm(Ce,"data:")===0&&_s[N]||Re&&!Wt(U,bo(Ce,te,""))?!0:!Ce:dp(N)&&Cs(we.tagNameCheck,N)&&Cs(we.attributeNameCheck,se,N)||se==="is"&&we.allowCustomizedBuiltInElements&&Cs(we.tagNameCheck,Ce)},w0=ut({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),dp=function(N){return!w0[Eo(N)]&&Wt(y,N)},$0=function(N,se,Ce,Pe){if(w&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Ce)switch(d.getAttributeType(N,se)){case"TrustedHTML":return V(Pe);case"TrustedScriptURL":return H(Pe)}return Pe},C0=function(N,se,Ce,Pe){try{return Ce?N.setAttributeNS(Ce,se,Pe):N.setAttribute(se,Pe),$s(N)?(Ba(N),!1):!0}catch{return $r(se,N),!1}},fp=function(N,se){if(Fn(K.beforeSanitizeAttributes,N,null),nl(N,se))return;const Ce=N.attributes;if(!Ce||$s(N))return;Y=ip(K.uponSanitizeAttribute,Y,de,at);const Pe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let He=Ce.length;const ot=Et(N.nodeName);for(;He--;){const it=Ce[He],$t=it.name,_n=it.namespaceURI,dn=it.value,al=Et($t),Mu=dn;let Jt=$t==="value"?Mu:Tq(Mu),pp=!1;if(Pe.attrName=al,Pe.attrValue=Jt,Pe.keepAttr=!0,Pe.forceKeepAttr=void 0,Fn(K.uponSanitizeAttribute,N,Pe),Jt=Pe.attrValue,Nt&&(al==="id"||al==="name")&&Hm(Jt,Ia)!==0&&($r($t,N,it),Jt=Ia+Jt,pp=!0),Je&&Wt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Jt)){$r($t,N,it);continue}if(al==="attributename"&&Um(Jt,"href")){$r($t,N,it);continue}if(!Pe.forceKeepAttr){if(!Pe.keepAttr){$r($t,N,it);continue}if(!Fe&&Wt(Gq,Jt)){$r($t,N,it);continue}if(Ke&&(Jt=ws(Jt)),!cp(ot,al,Jt)){$r($t,N,it);continue}Jt=$0(ot,al,_n,Jt),Jt!==Mu&&C0(N,$t,_n,Jt)&&pp&&jm(t.removed)}}Fn(K.afterSanitizeAttributes,N,null),nl(N,se)},Ss=function(N){let se=null;const Ce=sp(N);for(Fn(K.beforeSanitizeShadowDOM,N,null);se=Ce.nextNode();)if(Fn(K.uponSanitizeShadowNode,se,null),up(se,N),fp(se,N),tl(se.content)&&Ss(se.content),R(se)===pn.element){const Pe=S(se);tl(Pe)&&(Ou(Pe),Ss(Pe))}Fn(K.afterSanitizeShadowDOM,N,null)},Ou=function(N){const se=[{node:N,shadow:null}];for(;se.length>0;){const Ce=se.pop();if(Ce.shadow){Ss(Ce.shadow);continue}const Pe=Ce.node,He=R(Pe)===pn.element,ot=$(Pe);if(ot)for(let it=ot.length-1;it>=0;--it)se.push({node:ot[it],shadow:null});if(He){const it=E?E(Pe):null;if(typeof it=="string"&&Et(it)==="template"){const $t=Pe.content;tl($t)&&se.push({node:$t,shadow:null})}}if(He){const it=S(Pe);tl(it)&&se.push({node:null,shadow:it},{node:it,shadow:null})}}};return t.sanitize=function(De){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},se=null,Ce=null,Pe=null,He=null;if(ro=!De,ro&&(De=""),typeof De!="string"&&!lo(De)&&(De=Rq(De),typeof De!="string"))throw ja("dirty is not a string, aborting");if(!t.isSupported)return De;Me?(M=Le,Y=at):Tu(N),(K.uponSanitizeElement.length>0||K.uponSanitizeAttribute.length>0)&&(M=vn(M)),K.uponSanitizeAttribute.length>0&&(Y=vn(Y)),t.removed=[];const ot=Zr&&typeof De!="string"&&lo(De);if(ot){_0(De);const _n=G(De);if(typeof _n=="string"){const dn=Et(_n);if(!M[dn]||Se[dn])throw xs(De),ja("root node is forbidden and cannot be sanitized in-place")}if($s(De))throw xs(De),ja("root node is clobbered and cannot be sanitized in-place");try{Ou(De)}catch(dn){throw xs(De),dn}}else if(lo(De))se=op(""),Ce=se.ownerDocument.importNode(De,!0),Ce.nodeType===pn.element&&Ce.nodeName==="BODY"||Ce.nodeName==="HTML"?se=Ce:se.appendChild(Ce),Ou(se);else{if(!Mt&&!Ke&&!be&&De.indexOf("<")===-1)return w&&ze?V(De):De;if(se=op(De),!se)return Mt?null:ze?L:""}se&&st&&Ba(se.firstChild);const it=ot?De:se;try{const _n=sp(it);for(;Pe=_n.nextNode();)up(Pe,it),fp(Pe,it),tl(Pe.content)&&Ss(Pe.content)}catch(_n){throw ot&&(xs(De),Mr(t.removed,dn=>{dn.element&&ks(dn.element)})),_n}if(ot){let _n=!1;if(Mr(t.removed,dn=>{dn.element&&(dn.element===De&&(_n=!0),ks(dn.element))}),_n)throw ja("a node selected for removal could not be safely returned; refusing to sanitize in place");return Ke&&Du(De),De}if(Mt){if(Ke&&Du(se),je)for(He=pe.call(se.ownerDocument);se.firstChild;)He.appendChild(se.firstChild);else He=se;return(Y.shadowroot||Y.shadowrootmode)&&(He=ge.call(a,He,!0)),He}let $t=be?se.outerHTML:se.innerHTML;return be&&M["!doctype"]&&se.ownerDocument&&se.ownerDocument.doctype&&se.ownerDocument.doctype.name&&Wt(Hq,se.ownerDocument.doctype.name)&&($t=" -`+$t),Ke&&($t=ws($t)),w&&ze?V($t):$t},t.setConfig=function(){let De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tu(De),Me=!0,Le=M,at=Y},t.clearConfig=function(){el=null,Me=!1,Le=null,at=null,w=j,L=""},t.isValidAttribute=function(De,N,se){el||Tu({});const Ce=Et(De),Pe=Et(N);return cp(Ce,Pe,se)},t.addHook=function(De,N){typeof N=="function"&&an(K,De)&&go(K[De],N)},t.removeHook=function(De,N){if(an(K,De)){if(N!==void 0){const se=Eq(K[De],N);return se===-1?void 0:Aq(K[De],se,1)[0]}return jm(K[De])}},t.removeHooks=function(De){an(K,De)&&(K[De]=[])},t.removeAllHooks=function(){K=th()},t}var Qq=K1();const eN=["http","https","mailto","tel"],tN=/[\x00-\x20\x7f]+/g,nN=/^([a-z][a-z0-9+.-]*):/i;function G1(e){if(e==null)return!1;const t=e.replace(tN,"");if(t==="")return!1;const n=nN.exec(t);if(n)return eN.includes(n[1].toLowerCase());try{return new URL(t,"https://admin.invalid/"),!0}catch{return!1}}const aN=["script","style","template","noscript","iframe","frame","frameset","object","embed","applet","svg","math","title","head","meta","link","base"],Y1=Object.freeze({ALLOWED_TAGS:[...z1],ALLOWED_ATTR:["href"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1,ADD_FORBID_CONTENTS:[...aN],KEEP_CONTENT:!0,RETURN_TRUSTED_TYPE:!1}),rN='

a - + +