diff --git a/apis/logs.go b/apis/logs.go index fd286de7..1cec710e 100644 --- a/apis/logs.go +++ b/apis/logs.go @@ -28,7 +28,7 @@ type logsApi struct { var requestFilterFields = []string{ "rowid", "id", "created", "updated", "url", "method", "status", "auth", - "ip", "referer", "userAgent", + "remoteIp", "userIp", "referer", "userAgent", } func (api *logsApi) requestsList(c echo.Context) error { diff --git a/apis/middlewares.go b/apis/middlewares.go index 2c44d09b..26de063b 100644 --- a/apis/middlewares.go +++ b/apis/middlewares.go @@ -252,7 +252,8 @@ func ActivityLogger(app core.App) echo.MiddlewareFunc { Method: strings.ToLower(httpRequest.Method), Status: status, Auth: requestAuth, - Ip: httpRequest.RemoteAddr, + UserIp: realUserIp(httpRequest), + RemoteIp: httpRequest.RemoteAddr, Referer: httpRequest.Referer(), UserAgent: httpRequest.UserAgent(), Meta: meta, @@ -297,3 +298,23 @@ func ActivityLogger(app core.App) echo.MiddlewareFunc { } } } + +// Returns the "real" user IP from common proxy headers +// (fallback to [r.RemoteAddr]). +// +// The returned IP shouldn't be trusted if not behind a trusted reverse proxy! +func realUserIp(r *http.Request) string { + ipHeaders := []string{ + "CF-Connecting-IP", + "X-Forwarded-For", + "X-Real-Ip", + } + + for _, header := range ipHeaders { + if ip := r.Header.Get(header); ip != "" { + return ip + } + } + + return r.RemoteAddr +} diff --git a/migrations/logs/1660821103_add_user_ip_column.go b/migrations/logs/1660821103_add_user_ip_column.go new file mode 100644 index 00000000..978bf9b8 --- /dev/null +++ b/migrations/logs/1660821103_add_user_ip_column.go @@ -0,0 +1,57 @@ +package logs + +import ( + "github.com/pocketbase/dbx" +) + +func init() { + LogsMigrations.Register(func(db dbx.Builder) error { + // delete old index (don't check for error because of backward compatability with old installations) + db.DropIndex("_requests", "_request_ip_idx").Execute() + + // rename ip -> remoteIp + if _, err := db.RenameColumn("_requests", "ip", "remoteIp").Execute(); err != nil { + return err + } + + // add new userIp column + if _, err := db.AddColumn("_requests", "userIp", `TEXT DEFAULT "127.0.0.1" NOT NULL`).Execute(); err != nil { + return err + } + + // add new indexes + if _, err := db.CreateIndex("_requests", "_request_remote_ip_idx", "remoteIp").Execute(); err != nil { + return err + } + if _, err := db.CreateIndex("_requests", "_request_user_ip_idx", "userIp").Execute(); err != nil { + return err + } + + return nil + }, func(db dbx.Builder) error { + // delete new indexes + if _, err := db.DropIndex("_requests", "_request_remote_ip_idx").Execute(); err != nil { + return err + } + if _, err := db.DropIndex("_requests", "_request_user_ip_idx").Execute(); err != nil { + return err + } + + // drop userIp column + if _, err := db.DropColumn("_requests", "userIp").Execute(); err != nil { + return err + } + + // restore original remoteIp column name + if _, err := db.RenameColumn("_requests", "remoteIp", "ip").Execute(); err != nil { + return err + } + + // restore original index + if _, err := db.CreateIndex("_requests", "_request_ip_idx", "ip").Execute(); err != nil { + return err + } + + return nil + }) +} diff --git a/models/request.go b/models/request.go index 5a3f91e2..662b9789 100644 --- a/models/request.go +++ b/models/request.go @@ -18,7 +18,8 @@ type Request struct { Method string `db:"method" json:"method"` Status int `db:"status" json:"status"` Auth string `db:"auth" json:"auth"` - Ip string `db:"ip" json:"ip"` + UserIp string `db:"userIp" json:"userIp"` + RemoteIp string `db:"remoteIp" json:"remoteIp"` Referer string `db:"referer" json:"referer"` UserAgent string `db:"userAgent" json:"userAgent"` Meta types.JsonMap `db:"meta" json:"meta"` diff --git a/tests/data/logs.db b/tests/data/logs.db index 693be4a3..3861eea0 100644 Binary files a/tests/data/logs.db and b/tests/data/logs.db differ diff --git a/tests/logs.go b/tests/logs.go index d3307b8d..24ee5f63 100644 --- a/tests/logs.go +++ b/tests/logs.go @@ -10,7 +10,8 @@ func MockRequestLogsData(app *TestApp) error { [[method]], [[status]], [[auth]], - [[ip]], + [[userIp]], + [[remoteIp]], [[referer]], [[userAgent]], [[meta]], @@ -25,6 +26,7 @@ func MockRequestLogsData(app *TestApp) error { 200, "guest", "127.0.0.1", + "127.0.0.1", "", "", "{}", @@ -38,6 +40,7 @@ func MockRequestLogsData(app *TestApp) error { 400, "admin", "127.0.0.1", + "127.0.0.1", "", "", '{"errorDetails":"error_details..."}', diff --git a/ui/dist/assets/CodeEditor.6a766e2d.js b/ui/dist/assets/CodeEditor.f0bf9689.js similarity index 99% rename from ui/dist/assets/CodeEditor.6a766e2d.js rename to ui/dist/assets/CodeEditor.f0bf9689.js index 9138cbd2..71f031e6 100644 --- a/ui/dist/assets/CodeEditor.6a766e2d.js +++ b/ui/dist/assets/CodeEditor.f0bf9689.js @@ -1,4 +1,4 @@ -import{S as me,i as Te,s as Se,e as be,f as Pe,M as SO,g as Re,y as bO,o as xe,I as ke,K as Xe,L as ye}from"./index.b371ee76.js";import{P as Ze,N as We,u as je,D as we,v as oO,T as C,I as KO,w as lO,x as o,y as _e,L as QO,z as cO,A as U,B as uO,F as HO,G as dO,H as v,J as ve,K as qe,E as X,M as _,O as ze,Q as Ge,R as m,U as Ce,a as W,h as Ue,b as Ye,c as Ve,d as Ee,e as Ie,s as Ae,f as Ne,g as De,i as Le,r as Fe,j as Je,k as Me,l as Be,m as Ke,n as He,o as Ot,p as et,q as tt,t as PO,C as q}from"./index.90bde420.js";class I{constructor(O,e,a,i,r,s,n,Q,u,d=0,l){this.p=O,this.stack=e,this.state=a,this.reducePos=i,this.pos=r,this.score=s,this.buffer=n,this.bufferBase=Q,this.curContext=u,this.lookAhead=d,this.parent=l}toString(){return`[${this.stack.filter((O,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,e,a=0){let i=O.parser.context;return new I(O,[],e,a,a,0,[],0,i?new RO(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=O}reduce(O){let e=O>>19,a=O&65535,{parser:i}=this.p,r=i.dynamicPrecedence(a);if(r&&(this.score+=r),e==0){this.pushState(i.getGoto(this.state,a,!0),this.reducePos),as;)this.stack.pop();this.reduceContext(a,n)}storeNode(O,e,a,i=4,r=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[n-4]==0&&s.buffer[n-1]>-1){if(e==a)return;if(s.buffer[n-2]>=e){s.buffer[n-2]=a;return}}}if(!r||this.pos==a)this.buffer.push(O,e,a,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>a;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4);this.buffer[s]=O,this.buffer[s+1]=e,this.buffer[s+2]=a,this.buffer[s+3]=i}}shift(O,e,a){let i=this.pos;if(O&131072)this.pushState(O&65535,this.pos);else if((O&262144)==0){let r=O,{parser:s}=this.p;(a>this.pos||e<=s.maxNode)&&(this.pos=a,s.stateFlag(r,1)||(this.reducePos=a)),this.pushState(r,i),this.shiftContext(e,i),e<=s.maxNode&&this.buffer.push(e,i,a,4)}else this.pos=a,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,a,4)}apply(O,e,a){O&65536?this.reduce(O):this.shift(O,e,a)}useNode(O,e){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let i=this.pos;this.reducePos=this.pos=i+O.length,this.pushState(e,i),this.buffer.push(a,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,e=O.buffer.length;for(;e>0&&O.buffer[e-2]>O.reducePos;)e-=4;let a=O.buffer.slice(e),i=O.bufferBase+e;for(;O&&i==O.bufferBase;)O=O.parent;return new I(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,i,this.curContext,this.lookAhead,O)}recoverByDelete(O,e){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,e,4),this.storeNode(0,this.pos,e,a?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(O){for(let e=new at(this);;){let a=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,O);if((a&65536)==0)return!0;if(a==0)return!1;e.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>4<<1||this.stack.length>=120){let i=[];for(let r=0,s;rQ&1&&n==s)||i.push(e[r],s)}e=i}let a=[];for(let i=0;i>19,i=O&65535,r=this.stack.length-a*3;if(r<0||e.getGoto(this.stack[r],i,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(O),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let e=0;ethis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class RO{constructor(O,e){this.tracker=O,this.context=e,this.hash=O.strict?O.hash(e):0}}var xO;(function(t){t[t.Insert=200]="Insert",t[t.Delete=190]="Delete",t[t.Reduce=100]="Reduce",t[t.MaxNext=4]="MaxNext",t[t.MaxInsertStackDepth=300]="MaxInsertStackDepth",t[t.DampenInsertStackDepth=120]="DampenInsertStackDepth"})(xO||(xO={}));class at{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let e=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=i}}class A{constructor(O,e,a){this.stack=O,this.pos=e,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,e=O.bufferBase+O.buffer.length){return new A(O,e,e-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new A(this.stack,this.pos,this.index)}}class Y{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const kO=new Y;class it{constructor(O,e){this.input=O,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=kO,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(O,e){let a=this.range,i=this.rangeIndex,r=this.pos+O;for(;ra.to:r>=a.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];r+=s.from-a.to,a=s}return r}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,e.from);return this.end}peek(O){let e=this.chunkOff+O,a,i;if(e>=0&&e=this.chunk2Pos&&an.to&&(this.chunk2=this.chunk2.slice(0,n.to-a)),i=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),i}acceptToken(O,e=0){let a=e?this.resolveOffset(e,-1):this.pos;if(a==null||a=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,e){if(e?(this.token=e,e.start=O,e.lookAhead=O+1,e.value=e.extended=-1):this.token=kO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,e-this.chunkPos);if(O>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,e-this.chunk2Pos);if(O>=this.range.from&&e<=this.range.to)return this.input.read(O,e);let a="";for(let i of this.ranges){if(i.from>=e)break;i.to>O&&(a+=this.input.read(Math.max(i.from,O),Math.min(i.to,e)))}return a}}class V{constructor(O,e){this.data=O,this.id=e}token(O,e){rt(this.data,O,e,this.id)}}V.prototype.contextual=V.prototype.fallback=V.prototype.extend=!1;class S{constructor(O,e={}){this.token=O,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function rt(t,O,e,a){let i=0,r=1<0){let h=t[$];if(n.allows(h)&&(O.token.value==-1||O.token.value==h||s.overrides(h,O.token.value))){O.acceptToken(h);break}}let u=O.next,d=0,l=t[i+2];if(O.next<0&&l>d&&t[Q+l*3-3]==65535){i=t[Q+l*3-1];continue O}for(;d>1,h=Q+$+($<<1),p=t[h],b=t[h+1];if(u=b)d=$+1;else{i=t[h+2],O.advance();continue O}}break}}function z(t,O=Uint16Array){if(typeof t!="string")return t;let e=null;for(let a=0,i=0;a=92&&s--,s>=34&&s--;let Q=s-32;if(Q>=46&&(Q-=46,n=!0),r+=Q,n)break;r*=46}e?e[i++]=r:e=new O(r)}return e}const T=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let M=null;var XO;(function(t){t[t.Margin=25]="Margin"})(XO||(XO={}));function yO(t,O,e){let a=t.cursor(KO.IncludeAnonymous);for(a.moveTo(O);;)if(!(e<0?a.childBefore(O):a.childAfter(O)))for(;;){if((e<0?a.toO)&&!a.type.isError)return e<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(t.length,Math.max(a.from+1,O+25));if(e<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return e<0?0:t.length}}class st{constructor(O,e){this.fragments=O,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?yO(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?yO(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=s,null;if(r instanceof C){if(s==O){if(s=Math.max(this.safeFrom,O)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[e]++,this.nextStart=s+r.length}}}class nt{constructor(O,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new Y)}getActions(O){let e=0,a=null,{parser:i}=O.p,{tokenizers:r}=i,s=i.stateSlot(O.state,3),n=O.curContext?O.curContext.hash:0,Q=0;for(let u=0;ul.end+25&&(Q=Math.max(l.lookAhead,Q)),l.value!=0)){let $=e;if(l.extended>-1&&(e=this.addActions(O,l.extended,l.end,e)),e=this.addActions(O,l.value,l.end,e),!d.extend&&(a=l,e>$))break}}for(;this.actions.length>e;)this.actions.pop();return Q&&O.setLookAhead(Q),!a&&O.pos==this.stream.end&&(a=new Y,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,e=this.addActions(O,a.value,a.end,e)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let e=new Y,{pos:a,p:i}=O;return e.start=a,e.end=Math.min(a+1,i.stream.end),e.value=a==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(O,e,a){let i=this.stream.clipPos(a.pos);if(e.token(this.stream.reset(i,O),a),O.value>-1){let{parser:r}=a.p;for(let s=0;s=0&&a.p.parser.dialect.allows(n>>1)){(n&1)==0?O.value=n>>1:O.extended=n>>1;break}}}else O.value=0,O.end=this.stream.clipPos(i+1)}putAction(O,e,a,i){for(let r=0;rO.bufferLength*4?new st(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,e=this.minStackPos,a=this.stacks=[],i,r;for(let s=0;se)a.push(n);else{if(this.advanceStack(n,a,O))continue;{i||(i=[],r=[]),i.push(n);let Q=this.tokens.getMainToken(n);r.push(Q.value,Q.end)}}break}}if(!a.length){let s=i&&Qt(i);if(s)return this.stackToTree(s);if(this.parser.strict)throw T&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+e);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,r,a);if(s)return this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(a.length>s)for(a.sort((n,Q)=>Q.score-n.score);a.length>s;)a.pop();a.some(n=>n.reducePos>e)&&this.recovering--}else if(a.length>1){O:for(let s=0;s500&&u.buffer.length>500)if((n.score-u.score||n.buffer.length-u.buffer.length)>0)a.splice(Q--,1);else{a.splice(s--,1);continue O}}}}this.minStackPos=a[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let u=O.curContext&&O.curContext.tracker.strict,d=u?O.curContext.hash:0;for(let l=this.fragments.nodeAt(i);l;){let $=this.parser.nodeSet.types[l.type.id]==l.type?r.getGoto(O.state,l.type.id):-1;if($>-1&&l.length&&(!u||(l.prop(oO.contextHash)||0)==d))return O.useNode(l,$),T&&console.log(s+this.stackID(O)+` (via reuse of ${r.getName(l.type.id)})`),!0;if(!(l instanceof C)||l.children.length==0||l.positions[0]>0)break;let h=l.children[0];if(h instanceof C&&l.positions[0]==0)l=h;else break}}let n=r.stateSlot(O.state,4);if(n>0)return O.reduce(n),T&&console.log(s+this.stackID(O)+` (via always-reduce ${r.getName(n&65535)})`),!0;if(O.stack.length>=15e3)for(;O.stack.length>9e3&&O.forceReduce(););let Q=this.tokens.getActions(O);for(let u=0;ui?e.push(p):a.push(p)}return!1}advanceFully(O,e){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return WO(O,e),!0}}runRecovery(O,e,a){let i=null,r=!1;for(let s=0;s ":"";if(n.deadEnd&&(r||(r=!0,n.restart(),T&&console.log(d+this.stackID(n)+" (restarted)"),this.advanceFully(n,a))))continue;let l=n.split(),$=d;for(let h=0;l.forceReduce()&&h<10&&(T&&console.log($+this.stackID(l)+" (via force-reduce)"),!this.advanceFully(l,a));h++)T&&($=this.stackID(l)+" -> ");for(let h of n.recoverByInsert(Q))T&&console.log(d+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,a);this.stream.end>n.pos?(u==n.pos&&(u++,Q=0),n.recoverByDelete(Q,u),T&&console.log(d+this.stackID(n)+` (via recover-delete ${this.parser.getName(Q)})`),WO(n,a)):(!i||i.scoret;class Oe{constructor(O){this.start=O.start,this.shift=O.shift||B,this.reduce=O.reduce||B,this.reuse=O.reuse||B,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class y extends Ze{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (${14})`);let e=O.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let n=0;nO.topRules[n][1]),i=[];for(let n=0;n=0)r(d,Q,n[u++]);else{let l=n[u+-d];for(let $=-d;$>0;$--)r(n[u++],Q,l);u++}}}this.nodeSet=new We(e.map((n,Q)=>je.define({name:Q>=this.minRepeatTerm?void 0:n,id:Q,props:i[Q],top:a.indexOf(Q)>-1,error:Q==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(Q)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=we;let s=z(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let n=0;ntypeof n=="number"?new V(s,n):n),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,e,a){let i=new ot(this,O,e,a);for(let r of this.wrappers)i=r(i,O,e,a);return i}getGoto(O,e,a=!1){let i=this.goto;if(e>=i[0])return-1;for(let r=i[e+1];;){let s=i[r++],n=s&1,Q=i[r++];if(n&&a)return Q;for(let u=r+(s>>1);r0}validAction(O,e){if(e==this.stateSlot(O,4))return!0;for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=R(this.data,a+2);else return!1;if(e==R(this.data,a+1))return!0}}nextStates(O){let e=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=R(this.data,a+2);else break;if((this.data[a+2]&1)==0){let i=this.data[a+1];e.some((r,s)=>s&1&&r==i)||e.push(this.data[a],i)}}return e}overrides(O,e){let a=jO(this.data,this.tokenPrecTable,e);return a<0||jO(this.data,this.tokenPrecTable,O){let i=O.tokenizers.find(r=>r.from==a);return i?i.to:a})),O.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((a,i)=>{let r=O.specializers.find(n=>n.from==a.external);if(!r)return a;let s=Object.assign(Object.assign({},a),{external:r.to});return e.specializers[i]=wO(s),s})),O.contextTracker&&(e.context=O.contextTracker),O.dialect&&(e.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(e.strict=O.strict),O.wrap&&(e.wrappers=e.wrappers.concat(O.wrap)),O.bufferLength!=null&&(e.bufferLength=O.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let e=this.dynamicPrecedences;return e==null?0:e[O]||0}parseDialect(O){let e=Object.keys(this.dialects),a=e.map(()=>!1);if(O)for(let r of O.split(" ")){let s=e.indexOf(r);s>=0&&(a[s]=!0)}let i=null;for(let r=0;ra)&&e.p.parser.stateFlag(e.state,2)&&(!O||O.scoret.external(e,a)<<1|O}return t.get}const ct=53,ut=1,dt=54,$t=2,ht=55,pt=3,N=4,ee=5,te=6,ae=7,ie=8,ft=9,gt=10,mt=11,K=56,Tt=12,_O=57,St=18,bt=27,Pt=30,Rt=33,xt=35,kt=0,Xt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},yt={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},vO={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Zt(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}function re(t){return t==9||t==10||t==13||t==32}let qO=null,zO=null,GO=0;function rO(t,O){let e=t.pos+O;if(GO==e&&zO==t)return qO;let a=t.peek(O);for(;re(a);)a=t.peek(++O);let i="";for(;Zt(a);)i+=String.fromCharCode(a),a=t.peek(++O);return zO=t,GO=e,qO=i?i.toLowerCase():a==Wt||a==jt?void 0:null}const se=60,ne=62,oe=47,Wt=63,jt=33,wt=45;function CO(t,O){this.name=t,this.parent=O,this.hash=O?O.hash:0;for(let e=0;e-1?new CO(rO(a,1)||"",t):t},reduce(t,O){return O==St&&t?t.parent:t},reuse(t,O,e,a){let i=O.type.id;return i==N||i==xt?new CO(rO(a,1)||"",t):t},hash(t){return t?t.hash:0},strict:!1}),qt=new S((t,O)=>{if(t.next!=se){t.next<0&&O.context&&t.acceptToken(K);return}t.advance();let e=t.next==oe;e&&t.advance();let a=rO(t,0);if(a===void 0)return;if(!a)return t.acceptToken(e?Tt:N);let i=O.context?O.context.name:null;if(e){if(a==i)return t.acceptToken(ft);if(i&&yt[i])return t.acceptToken(K,-2);if(O.dialectEnabled(kt))return t.acceptToken(gt);for(let r=O.context;r;r=r.parent)if(r.name==a)return;t.acceptToken(mt)}else{if(a=="script")return t.acceptToken(ee);if(a=="style")return t.acceptToken(te);if(a=="textarea")return t.acceptToken(ae);if(Xt.hasOwnProperty(a))return t.acceptToken(ie);i&&vO[i]&&vO[i][a]?t.acceptToken(K,-1):t.acceptToken(N)}},{contextual:!0}),zt=new S(t=>{for(let O=0,e=0;;e++){if(t.next<0){e&&t.acceptToken(_O);break}if(t.next==wt)O++;else if(t.next==ne&&O>=2){e>3&&t.acceptToken(_O,-2);break}else O=0;t.advance()}});function $O(t,O,e){let a=2+t.length;return new S(i=>{for(let r=0,s=0,n=0;;n++){if(i.next<0){n&&i.acceptToken(O);break}if(r==0&&i.next==se||r==1&&i.next==oe||r>=2&&rs?i.acceptToken(O,-s):i.acceptToken(e,-(s-2));break}else if((i.next==10||i.next==13)&&n){i.acceptToken(O,1);break}else r=s=0;i.advance()}})}const Gt=$O("script",ct,ut),Ct=$O("style",dt,$t),Ut=$O("textarea",ht,pt),Yt=lO({"Text RawText":o.content,"StartTag StartCloseTag SelfCloserEndTag EndTag SelfCloseEndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),Vt=y.deserialize({version:14,states:",xOVOxOOO!WQ!bO'#CoO!]Q!bO'#CyO!bQ!bO'#C|O!gQ!bO'#DPO!lQ!bO'#DRO!qOXO'#CnO!|OYO'#CnO#XO[O'#CnO$eOxO'#CnOOOW'#Cn'#CnO$lO!rO'#DSO$tQ!bO'#DUO$yQ!bO'#DVOOOW'#Dj'#DjOOOW'#DX'#DXQVOxOOO%OQ#tO,59ZO%WQ#tO,59eO%`Q#tO,59hO%hQ#tO,59kO%pQ#tO,59mOOOX'#D]'#D]O%xOXO'#CwO&TOXO,59YOOOY'#D^'#D^O&]OYO'#CzO&hOYO,59YOOO['#D_'#D_O&pO[O'#C}O&{O[O,59YOOOW'#D`'#D`O'TOxO,59YO'[Q!bO'#DQOOOW,59Y,59YOOO`'#Da'#DaO'aO!rO,59nOOOW,59n,59nO'iQ!bO,59pO'nQ!bO,59qOOOW-E7V-E7VO'sQ#tO'#CqOOQO'#DY'#DYO(OQ#tO1G.uOOOX1G.u1G.uO(WQ#tO1G/POOOY1G/P1G/PO(`Q#tO1G/SOOO[1G/S1G/SO(hQ#tO1G/VOOOW1G/V1G/VO(pQ#tO1G/XOOOW1G/X1G/XOOOX-E7Z-E7ZO(xQ!bO'#CxOOOW1G.t1G.tOOOY-E7[-E7[O(}Q!bO'#C{OOO[-E7]-E7]O)SQ!bO'#DOOOOW-E7^-E7^O)XQ!bO,59lOOO`-E7_-E7_OOOW1G/Y1G/YOOOW1G/[1G/[OOOW1G/]1G/]O)^Q&jO,59]OOQO-E7W-E7WOOOX7+$a7+$aOOOY7+$k7+$kOOO[7+$n7+$nOOOW7+$q7+$qOOOW7+$s7+$sO)iQ!bO,59dO)nQ!bO,59gO)sQ!bO,59jOOOW1G/W1G/WO)xO,UO'#CtO*ZO7[O'#CtOOQO1G.w1G.wOOOW1G/O1G/OOOOW1G/R1G/ROOOW1G/U1G/UOOOO'#DZ'#DZO*lO,UO,59`OOQO,59`,59`OOOO'#D['#D[O*}O7[O,59`OOOO-E7X-E7XOOQO1G.z1G.zOOOO-E7Y-E7Y",stateData:"+h~O!]OS~OSSOTPOUQOVROWTOY]OZ[O[^O^^O_^O`^Oa^Ow^Oz_O!cZO~OdaO~OdbO~OdcO~OddO~OdeO~O!VfOPkP!YkP~O!WiOQnP!YnP~O!XlORqP!YqP~OSSOTPOUQOVROWTOXqOY]OZ[O[^O^^O_^O`^Oa^Ow^O!cZO~O!YrO~P#dO!ZsO!duO~OdvO~OdwO~OfyOj|O~OfyOj!OO~OfyOj!QO~OfyOj!SO~OfyOj!UO~O!VfOPkX!YkX~OP!WO!Y!XO~O!WiOQnX!YnX~OQ!ZO!Y!XO~O!XlORqX!YqX~OR!]O!Y!XO~O!Y!XO~P#dOd!_O~O!ZsO!d!aO~Oj!bO~Oj!cO~Og!dOfeXjeX~OfyOj!fO~OfyOj!gO~OfyOj!hO~OfyOj!iO~OfyOj!jO~Od!kO~Od!lO~Od!mO~Oj!nO~Oi!qO!_!oO!a!pO~Oj!rO~Oj!sO~Oj!tO~O_!uO`!uOa!uO!_!wO!`!uO~O_!xO`!xOa!xO!a!wO!b!xO~O_!uO`!uOa!uO!_!{O!`!uO~O_!xO`!xOa!xO!a!{O!b!xO~O`_a!cwz!c~",goto:"%o!_PPPPPPPPPPPPPPPPPP!`!fP!lPP!xPP!{#O#R#X#[#_#e#h#k#q#w!`P!`!`P#}$T$k$q$w$}%T%Z%aPPPPPPPP%gX^OX`pXUOX`pezabcde{}!P!R!TR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!TeZ!e{}!P!R!TQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue EndTag ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:66,context:vt,nodeProps:[["closedBy",-11,1,2,3,4,5,6,7,8,9,10,11,"EndTag",-4,19,29,32,35,"CloseTag"],["group",-9,12,15,16,17,18,38,39,40,41,"Entity",14,"Entity TextContent",-3,27,30,33,"TextContent Entity"],["openedBy",26,"StartTag StartCloseTag",-4,28,31,34,36,"OpenTag"]],propSources:[Yt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!#b!aR!WOX$kXY)sYZ)sZ]$k]^)s^p$kpq)sqr$krs*zsv$kvw+dwx2yx}$k}!O3f!O!P$k!P!Q7_!Q![$k![!]8u!]!^$k!^!_>b!_!`!!p!`!a8T!a!c$k!c!}8u!}#R$k#R#S8u#S#T$k#T#o8u#o$f$k$f$g&R$g%W$k%W%o8u%o%p$k%p&a8u&a&b$k&b1p8u1p4U$k4U4d8u4d4e$k4e$IS8u$IS$I`$k$I`$Ib8u$Ib$Kh$k$Kh%#t8u%#t&/x$k&/x&Et8u&Et&FV$k&FV;'S8u;'S;:jiW!``!bpOq(kqr?Rrs'gsv(kwx(]x!a(k!a!bKj!b~(k!R?YZ!``!bpOr(krs'gsv(kwx(]x}(k}!O?{!O!f(k!f!gAR!g#W(k#W#XGz#X~(k!R@SV!``!bpOr(krs'gsv(kwx(]x}(k}!O@i!O~(k!R@rT!``!bp!cPOr(krs'gsv(kwx(]x~(k!RAYV!``!bpOr(krs'gsv(kwx(]x!q(k!q!rAo!r~(k!RAvV!``!bpOr(krs'gsv(kwx(]x!e(k!e!fB]!f~(k!RBdV!``!bpOr(krs'gsv(kwx(]x!v(k!v!wBy!w~(k!RCQV!``!bpOr(krs'gsv(kwx(]x!{(k!{!|Cg!|~(k!RCnV!``!bpOr(krs'gsv(kwx(]x!r(k!r!sDT!s~(k!RD[V!``!bpOr(krs'gsv(kwx(]x!g(k!g!hDq!h~(k!RDxW!``!bpOrDqrsEbsvDqvwEvwxFfx!`Dq!`!aGb!a~DqqEgT!bpOvEbvxEvx!`Eb!`!aFX!a~EbPEyRO!`Ev!`!aFS!a~EvPFXOzPqF`Q!bpzPOv'gx~'gaFkV!``OrFfrsEvsvFfvwEvw!`Ff!`!aGQ!a~FfaGXR!``zPOr(]sv(]w~(]!RGkT!``!bpzPOr(krs'gsv(kwx(]x~(k!RHRV!``!bpOr(krs'gsv(kwx(]x#c(k#c#dHh#d~(k!RHoV!``!bpOr(krs'gsv(kwx(]x#V(k#V#WIU#W~(k!RI]V!``!bpOr(krs'gsv(kwx(]x#h(k#h#iIr#i~(k!RIyV!``!bpOr(krs'gsv(kwx(]x#m(k#m#nJ`#n~(k!RJgV!``!bpOr(krs'gsv(kwx(]x#d(k#d#eJ|#e~(k!RKTV!``!bpOr(krs'gsv(kwx(]x#X(k#X#YDq#Y~(k!RKqW!``!bpOrKjrsLZsvKjvwLowxNPx!aKj!a!b! g!b~KjqL`T!bpOvLZvxLox!aLZ!a!bM^!b~LZPLrRO!aLo!a!bL{!b~LoPMORO!`Lo!`!aMX!a~LoPM^OwPqMcT!bpOvLZvxLox!`LZ!`!aMr!a~LZqMyQ!bpwPOv'gx~'gaNUV!``OrNPrsLosvNPvwLow!aNP!a!bNk!b~NPaNpV!``OrNPrsLosvNPvwLow!`NP!`!a! V!a~NPa! ^R!``wPOr(]sv(]w~(]!R! nW!``!bpOrKjrsLZsvKjvwLowxNPx!`Kj!`!a!!W!a~Kj!R!!aT!``!bpwPOr(krs'gsv(kwx(]x~(k!V!!{VgS^P!``!bpOr&Rrs&qsv&Rwx'rx!^&R!^!_(k!_~&R",tokenizers:[Gt,Ct,Ut,qt,zt,0,1,2,3,4,5],topRules:{Document:[0,13]},dialects:{noMatch:0},tokenPrec:476});function Et(t,O){let e=Object.create(null);for(let a of t.firstChild.getChildren("Attribute")){let i=a.getChild("AttributeName"),r=a.getChild("AttributeValue")||a.getChild("UnquotedAttributeValue");i&&(e[O.read(i.from,i.to)]=r?r.name=="AttributeValue"?O.read(r.from+1,r.to-1):O.read(r.from,r.to):"")}return e}function H(t,O,e){let a;for(let i of e)if(!i.attrs||i.attrs(a||(a=Et(t.node.parent,O))))return{parser:i.parser};return null}function It(t){let O=[],e=[],a=[];for(let i of t){let r=i.tag=="script"?O:i.tag=="style"?e:i.tag=="textarea"?a:null;if(!r)throw new RangeError("Only script, style, and textarea tags can host nested parsers");r.push(i)}return _e((i,r)=>{let s=i.type.id;return s==bt?H(i,r,O):s==Pt?H(i,r,e):s==Rt?H(i,r,a):null})}const At=93,UO=1,Nt=94,Dt=95,YO=2,le=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Lt=58,Ft=40,Qe=95,Jt=91,E=45,Mt=46,Bt=35,Kt=37;function D(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function Ht(t){return t>=48&&t<=57}const Oa=new S((t,O)=>{for(let e=!1,a=0,i=0;;i++){let{next:r}=t;if(D(r)||r==E||r==Qe||e&&Ht(r))!e&&(r!=E||i>0)&&(e=!0),a===i&&r==E&&a++,t.advance();else{e&&t.acceptToken(r==Ft?Nt:a==2&&O.canShift(YO)?YO:Dt);break}}}),ea=new S(t=>{if(le.includes(t.peek(-1))){let{next:O}=t;(D(O)||O==Qe||O==Bt||O==Mt||O==Jt||O==Lt||O==E)&&t.acceptToken(At)}}),ta=new S(t=>{if(!le.includes(t.peek(-1))){let{next:O}=t;if(O==Kt&&(t.advance(),t.acceptToken(UO)),D(O)){do t.advance();while(D(t.next));t.acceptToken(UO)}}}),aa=lO({"import charset namespace keyframes":o.definitionKeyword,"media supports":o.controlKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,AtKeyword:o.keyword,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ParenthesizedContent:o.special(o.name),ColorLiteral:o.color,StringLiteral:o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),ia={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,dir:32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},ra={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},sa={__proto__:null,not:128,only:128,from:158,to:160},na=y.deserialize({version:14,states:"7WOYQ[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO!ZQ[O'#CfO!}QXO'#CaO#UQ[O'#ChO#aQ[O'#DPO#fQ[O'#DTOOQP'#Ec'#EcO#kQdO'#DeO$VQ[O'#DrO#kQdO'#DtO$hQ[O'#DvO$sQ[O'#DyO$xQ[O'#EPO%WQ[O'#EROOQS'#Eb'#EbOOQS'#ES'#ESQYQ[OOOOQP'#Cg'#CgOOQP,59Q,59QO!ZQ[O,59QO%_Q[O'#EVO%yQWO,58{O&RQ[O,59SO#aQ[O,59kO#fQ[O,59oO%_Q[O,59sO%_Q[O,59uO%_Q[O,59vO'bQ[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO'iQWO,59SO'nQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO'sQ`O,59oOOQS'#Cp'#CpO#kQdO'#CqO'{QvO'#CsO)VQtO,5:POOQO'#Cx'#CxO'iQWO'#CwO)kQWO'#CyOOQS'#Ef'#EfOOQO'#Dh'#DhO)pQ[O'#DoO*OQWO'#EiO$xQ[O'#DmO*^QWO'#DpOOQO'#Ej'#EjO%|QWO,5:^O*cQpO,5:`OOQS'#Dx'#DxO*kQWO,5:bO*pQ[O,5:bOOQO'#D{'#D{O*xQWO,5:eO*}QWO,5:kO+VQWO,5:mOOQS-E8Q-E8QOOQP1G.l1G.lO+yQXO,5:qOOQO-E8T-E8TOOQS1G.g1G.gOOQP1G.n1G.nO'iQWO1G.nO'nQWO1G.nOOQP1G/V1G/VO,WQ`O1G/ZO,qQXO1G/_O-XQXO1G/aO-oQXO1G/bO.VQXO'#CdO.zQWO'#DaOOQS,59z,59zO/PQWO,59zO/XQ[O,59zO/`QdO'#CoO/gQ[O'#DOOOQP1G/Z1G/ZO#kQdO1G/ZO/nQpO,59]OOQS,59_,59_O#kQdO,59aO/vQWO1G/kOOQS,59c,59cO/{Q!bO,59eO0TQWO'#DhO0`QWO,5:TO0eQWO,5:ZO$xQ[O,5:VO$xQ[O'#EYO0mQWO,5;TO0xQWO,5:XO%_Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O1ZQWO1G/|O1`QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XOOQP7+$Y7+$YOOQP7+$u7+$uO#kQdO7+$uO#kQdO,59{O1nQ[O'#EXO1xQWO1G/fOOQS1G/f1G/fO1xQWO1G/fO2QQtO'#ETO2uQdO'#EeO3PQWO,59ZO3UQXO'#EhO3]QWO,59jO3bQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO3jQWO1G/PO#kQdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO3oQWO,5:tOOQO-E8W-E8WO3}QXO1G/vOOQS7+%h7+%hO4UQYO'#CsO%|QWO'#EZO4^QdO,5:hOOQS,5:h,5:hO4lQpO<O!c!}$w!}#O?[#O#P$w#P#Q?g#Q#R2U#R#T$w#T#U?r#U#c$w#c#d@q#d#o$w#o#pAQ#p#q2U#q#rA]#r#sAh#s#y$w#y#z%]#z$f$w$f$g%]$g#BY$w#BY#BZ%]#BZ$IS$w$IS$I_%]$I_$I|$w$I|$JO%]$JO$JT$w$JT$JU%]$JU$KV$w$KV$KW%]$KW&FU$w&FU&FV%]&FV~$wW$zQOy%Qz~%QW%VQoWOy%Qz~%Q~%bf#T~OX%QX^&v^p%Qpq&vqy%Qz#y%Q#y#z&v#z$f%Q$f$g&v$g#BY%Q#BY#BZ&v#BZ$IS%Q$IS$I_&v$I_$I|%Q$I|$JO&v$JO$JT%Q$JT$JU&v$JU$KV%Q$KV$KW&v$KW&FU%Q&FU&FV&v&FV~%Q~&}f#T~oWOX%QX^&v^p%Qpq&vqy%Qz#y%Q#y#z&v#z$f%Q$f$g&v$g#BY%Q#BY#BZ&v#BZ$IS%Q$IS$I_&v$I_$I|%Q$I|$JO&v$JO$JT%Q$JT$JU&v$JU$KV%Q$KV$KW&v$KW&FU%Q&FU&FV&v&FV~%Q^(fSOy%Qz#]%Q#]#^(r#^~%Q^(wSoWOy%Qz#a%Q#a#b)T#b~%Q^)YSoWOy%Qz#d%Q#d#e)f#e~%Q^)kSoWOy%Qz#c%Q#c#d)w#d~%Q^)|SoWOy%Qz#f%Q#f#g*Y#g~%Q^*_SoWOy%Qz#h%Q#h#i*k#i~%Q^*pSoWOy%Qz#T%Q#T#U*|#U~%Q^+RSoWOy%Qz#b%Q#b#c+_#c~%Q^+dSoWOy%Qz#h%Q#h#i+p#i~%Q^+wQ!VUoWOy%Qz~%Q~,QUOY+}Zr+}rs,ds#O+}#O#P,i#P~+}~,iOh~~,lPO~+}_,tWtPOy%Qz!Q%Q!Q![-^![!c%Q!c!i-^!i#T%Q#T#Z-^#Z~%Q^-cWoWOy%Qz!Q%Q!Q![-{![!c%Q!c!i-{!i#T%Q#T#Z-{#Z~%Q^.QWoWOy%Qz!Q%Q!Q![.j![!c%Q!c!i.j!i#T%Q#T#Z.j#Z~%Q^.qWfUoWOy%Qz!Q%Q!Q![/Z![!c%Q!c!i/Z!i#T%Q#T#Z/Z#Z~%Q^/bWfUoWOy%Qz!Q%Q!Q![/z![!c%Q!c!i/z!i#T%Q#T#Z/z#Z~%Q^0PWoWOy%Qz!Q%Q!Q![0i![!c%Q!c!i0i!i#T%Q#T#Z0i#Z~%Q^0pWfUoWOy%Qz!Q%Q!Q![1Y![!c%Q!c!i1Y!i#T%Q#T#Z1Y#Z~%Q^1_WoWOy%Qz!Q%Q!Q![1w![!c%Q!c!i1w!i#T%Q#T#Z1w#Z~%Q^2OQfUoWOy%Qz~%QY2XSOy%Qz!_%Q!_!`2e!`~%QY2lQzQoWOy%Qz~%QX2wQXPOy%Qz~%Q~3QUOY2}Zw2}wx,dx#O2}#O#P3d#P~2}~3gPO~2}_3oQbVOy%Qz~%Q~3zOa~_4RSUPjSOy%Qz!_%Q!_!`2e!`~%Q_4fUjS!PPOy%Qz!O%Q!O!P4x!P!Q%Q!Q![7_![~%Q^4}SoWOy%Qz!Q%Q!Q![5Z![~%Q^5bWoW#ZUOy%Qz!Q%Q!Q![5Z![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%Q^6PWoWOy%Qz{%Q{|6i|}%Q}!O6i!O!Q%Q!Q![6z![~%Q^6nSoWOy%Qz!Q%Q!Q![6z![~%Q^7RSoW#ZUOy%Qz!Q%Q!Q![6z![~%Q^7fYoW#ZUOy%Qz!O%Q!O!P5Z!P!Q%Q!Q![7_![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%Q_8ZQpVOy%Qz~%Q^8fUjSOy%Qz!O%Q!O!P4x!P!Q%Q!Q![7_![~%Q_8}S#WPOy%Qz!Q%Q!Q![5Z![~%Q~9`RjSOy%Qz{9i{~%Q~9nSoWOy9iyz9zz{:o{~9i~9}ROz9zz{:W{~9z~:ZTOz9zz{:W{!P9z!P!Q:j!Q~9z~:oOR~~:tUoWOy9iyz9zz{:o{!P9i!P!Q;W!Q~9i~;_QoWR~Oy%Qz~%Q^;jY#ZUOy%Qz!O%Q!O!P5Z!P!Q%Q!Q![7_![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%QX<_S]POy%Qz![%Q![!]RUOy%Qz!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX>lY!YPoWOy%Qz}%Q}!O>e!O!Q%Q!Q![>e![!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX?aQxPOy%Qz~%Q^?lQvUOy%Qz~%QX?uSOy%Qz#b%Q#b#c@R#c~%QX@WSoWOy%Qz#W%Q#W#X@d#X~%QX@kQ!`PoWOy%Qz~%QX@tSOy%Qz#f%Q#f#g@d#g~%QXAVQ!RPOy%Qz~%Q_AbQ!QVOy%Qz~%QZAmS!PPOy%Qz!_%Q!_!`2e!`~%Q",tokenizers:[ea,ta,Oa,0,1,2,3],topRules:{StyleSheet:[0,4]},specialized:[{term:94,get:t=>ia[t]||-1},{term:56,get:t=>ra[t]||-1},{term:95,get:t=>sa[t]||-1}],tokenPrec:1078});let OO=null;function eO(){if(!OO&&typeof document=="object"&&document.body){let t=[];for(let O in document.body.style)/[A-Z]|^-|^(item|length)$/.test(O)||t.push(O);OO=t.sort().map(O=>({type:"property",label:O}))}return OO||[]}const VO=["active","after","before","checked","default","disabled","empty","enabled","first-child","first-letter","first-line","first-of-type","focus","hover","in-range","indeterminate","invalid","lang","last-child","last-of-type","link","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-of-type","only-child","optional","out-of-range","placeholder","read-only","read-write","required","root","selection","target","valid","visited"].map(t=>({type:"class",label:t})),EO=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),oa=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),x=/^[\w-]*/,la=t=>{let{state:O,pos:e}=t,a=v(O).resolveInner(e,-1);if(a.name=="PropertyName")return{from:a.from,options:eO(),validFor:x};if(a.name=="ValueName")return{from:a.from,options:EO,validFor:x};if(a.name=="PseudoClassName")return{from:a.from,options:VO,validFor:x};if(a.name=="TagName"){for(let{parent:s}=a;s;s=s.parent)if(s.name=="Block")return{from:a.from,options:eO(),validFor:x};return{from:a.from,options:oa,validFor:x}}if(!t.explicit)return null;let i=a.resolve(e),r=i.childBefore(e);return r&&r.name==":"&&i.name=="PseudoClassSelector"?{from:e,options:VO,validFor:x}:r&&r.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:e,options:EO,validFor:x}:i.name=="Block"?{from:e,options:eO(),validFor:x}:null},sO=QO.define({parser:na.configure({props:[cO.add({Declaration:U()}),uO.add({Block:HO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Qa(){return new dO(sO,sO.data.of({autocomplete:la}))}const ca=1,IO=281,AO=2,ua=3,G=282,da=4,$a=283,NO=284,ha=286,pa=287,fa=5,ga=6,ma=1,Ta=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],ce=125,Sa=123,ba=59,DO=47,Pa=42,Ra=43,xa=45,ka=36,Xa=96,ya=92,Za=new Oe({start:!1,shift(t,O){return O==fa||O==ga||O==ha?t:O==pa},strict:!1}),Wa=new S((t,O)=>{let{next:e}=t;(e==ce||e==-1||O.context)&&O.canShift(NO)&&t.acceptToken(NO)},{contextual:!0,fallback:!0}),ja=new S((t,O)=>{let{next:e}=t,a;Ta.indexOf(e)>-1||e==DO&&((a=t.peek(1))==DO||a==Pa)||e!=ce&&e!=ba&&e!=-1&&!O.context&&O.canShift(IO)&&t.acceptToken(IO)},{contextual:!0}),wa=new S((t,O)=>{let{next:e}=t;if((e==Ra||e==xa)&&(t.advance(),e==t.next)){t.advance();let a=!O.context&&O.canShift(AO);t.acceptToken(a?AO:ua)}},{contextual:!0}),_a=new S(t=>{for(let O=!1,e=0;;e++){let{next:a}=t;if(a<0){e&&t.acceptToken(G);break}else if(a==Xa){e?t.acceptToken(G):t.acceptToken($a,1);break}else if(a==Sa&&O){e==1?t.acceptToken(da,1):t.acceptToken(G,-1);break}else if(a==10&&e){t.advance(),t.acceptToken(G);break}else a==ya&&t.advance();O=a==ka,t.advance()}}),va=new S((t,O)=>{if(!(t.next!=101||!O.dialectEnabled(ma))){t.advance();for(let e=0;e<6;e++){if(t.next!="xtends".charCodeAt(e))return;t.advance()}t.next>=57&&t.next<=65||t.next>=48&&t.next<=90||t.next==95||t.next>=97&&t.next<=122||t.next>160||t.acceptToken(ca)}}),qa=lO({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,LineComment:o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName}),za={__proto__:null,export:18,as:23,from:29,default:32,async:37,function:38,this:48,true:56,false:56,void:66,typeof:70,null:86,super:88,new:122,await:139,yield:141,delete:142,class:152,extends:154,public:197,private:197,protected:197,readonly:199,instanceof:220,in:222,const:224,import:256,keyof:307,unique:311,infer:317,is:351,abstract:371,implements:373,type:375,let:378,var:380,interface:387,enum:391,namespace:397,module:399,declare:403,global:407,for:428,of:437,while:440,with:444,do:448,if:452,else:454,switch:458,case:464,try:470,catch:474,finally:478,return:482,throw:486,break:490,continue:494,debugger:498},Ga={__proto__:null,async:109,get:111,set:113,public:161,private:161,protected:161,static:163,abstract:165,override:167,readonly:173,new:355},Ca={__proto__:null,"<":129},Ua=y.deserialize({version:14,states:"$8SO`QdOOO'QQ(C|O'#ChO'XOWO'#DVO)dQdO'#D]O)tQdO'#DhO){QdO'#DrO-xQdO'#DxOOQO'#E]'#E]O.]Q`O'#E[O.bQ`O'#E[OOQ(C['#Ef'#EfO0aQ(C|O'#ItO2wQ(C|O'#IuO3eQ`O'#EzO3jQ!bO'#FaOOQ(C['#FS'#FSO3rO#tO'#FSO4QQ&jO'#FhO5bQ`O'#FgOOQ(C['#Iu'#IuOOQ(CW'#It'#ItOOQS'#J^'#J^O5gQ`O'#HpO5lQ(ChO'#HqOOQS'#Ih'#IhOOQS'#Hr'#HrQ`QdOOO){QdO'#DjO5tQ`O'#G[O5yQ&jO'#CmO6XQ`O'#EZO6dQ`O'#EgO6iQ,UO'#FRO7TQ`O'#G[O7YQ`O'#G`O7eQ`O'#G`O7sQ`O'#GcO7sQ`O'#GdO7sQ`O'#GfO5tQ`O'#GiO8dQ`O'#GlO9rQ`O'#CdO:SQ`O'#GyO:[Q`O'#HPO:[Q`O'#HRO`QdO'#HTO:[Q`O'#HVO:[Q`O'#HYO:aQ`O'#H`O:fQ(CjO'#HfO){QdO'#HhO:qQ(CjO'#HjO:|Q(CjO'#HlO5lQ(ChO'#HnO){QdO'#DWOOOW'#Ht'#HtO;XOWO,59qOOQ(C[,59q,59qO=jQtO'#ChO=tQdO'#HuO>XQ`O'#IvO@WQtO'#IvO'dQdO'#IvO@_Q`O,59wO@uQ7[O'#DbOAnQ`O'#E]OA{Q`O'#JROBWQ`O'#JQOBWQ`O'#JQOB`Q`O,5:yOBeQ`O'#JPOBlQaO'#DyO5yQ&jO'#EZOBzQ`O'#EZOCVQpO'#FROOQ(C[,5:S,5:SOC_QdO,5:SOE]Q(C|O,5:^OEyQ`O,5:dOFdQ(ChO'#JOO7YQ`O'#I}OFkQ`O'#I}OFsQ`O,5:xOFxQ`O'#I}OGWQdO,5:vOIWQ&jO'#EWOJeQ`O,5:vOKwQ&jO'#DlOLOQdO'#DqOLYQ7[O,5;PO){QdO,5;POOQS'#Er'#ErOOQS'#Et'#EtO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;ROOQS'#Ex'#ExOLbQdO,5;cOOQ(C[,5;h,5;hOOQ(C[,5;i,5;iONbQ`O,5;iOOQ(C[,5;j,5;jO){QdO'#IPONgQ(ChO,5[OOQS'#Ik'#IkOOQS,5>],5>]OOQS-E;p-E;pO!+kQ(C|O,5:UOOQ(CX'#Cp'#CpO!,[Q&kO,5Q,5>QO){QdO,5>QO5lQ(ChO,5>SOOQS,5>U,5>UO!8cQ`O,5>UOOQS,5>W,5>WO!8cQ`O,5>WOOQS,5>Y,5>YO!8hQpO,59rOOOW-E;r-E;rOOQ(C[1G/]1G/]O!8mQtO,5>aO'dQdO,5>aOOQO,5>f,5>fO!8wQdO'#HuOOQO-E;s-E;sO!9UQ`O,5?bO!9^QtO,5?bO!9eQ`O,5?lOOQ(C[1G/c1G/cO!9mQ!bO'#DTOOQO'#Ix'#IxO){QdO'#IxO!:[Q!bO'#IxO!:yQ!bO'#DcO!;[Q7[O'#DcO!=gQdO'#DcO!=nQ`O'#IwO!=vQ`O,59|O!={Q`O'#EaO!>ZQ`O'#JSO!>cQ`O,5:zO!>yQ7[O'#DcO){QdO,5?mO!?TQ`O'#HzOOQO-E;x-E;xO!9eQ`O,5?lOOQ(CW1G0e1G0eO!@aQ7[O'#D|OOQ(C[,5:e,5:eO){QdO,5:eOIWQ&jO,5:eO!@hQaO,5:eO:aQ`O,5:uO!-OQ!bO,5:uO!-WQ&jO,5:uO5yQ&jO,5:uOOQ(C[1G/n1G/nOOQ(C[1G0O1G0OOOQ(CW'#EV'#EVO){QdO,5?jO!@sQ(ChO,5?jO!AUQ(ChO,5?jO!A]Q`O,5?iO!AeQ`O'#H|O!A]Q`O,5?iOOQ(CW1G0d1G0dO7YQ`O,5?iOOQ(C[1G0b1G0bO!BPQ(C|O1G0bO!CRQ(CyO,5:rOOQ(C]'#Fq'#FqO!CoQ(C}O'#IqOGWQdO1G0bO!EqQ,VO'#IyO!E{Q`O,5:WO!FQQtO'#IzO){QdO'#IzO!F[Q`O,5:]OOQ(C]'#DT'#DTOOQ(C[1G0k1G0kO!FaQ`O1G0kO!HrQ(C|O1G0mO!HyQ(C|O1G0mO!K^Q(C|O1G0mO!KeQ(C|O1G0mO!MlQ(C|O1G0mO!NPQ(C|O1G0mO#!pQ(C|O1G0mO#!wQ(C|O1G0mO#%[Q(C|O1G0mO#%cQ(C|O1G0mO#'WQ(C|O1G0mO#*QQMlO'#ChO#+{QMlO1G0}O#-vQMlO'#IuOOQ(C[1G1T1G1TO#.ZQ(C|O,5>kOOQ(CW-E;}-E;}O#.zQ(C}O1G0mOOQ(C[1G0m1G0mO#1PQ(C|O1G1QO#1pQ!bO,5;sO#1uQ!bO,5;tO#1zQ!bO'#F[O#2`Q`O'#FZOOQO'#JW'#JWOOQO'#H}'#H}O#2eQ!bO1G1]OOQ(C[1G1]1G1]OOOO1G1f1G1fO#2sQMlO'#ItO#2}Q`O,5;}OLbQdO,5;}OOOO-E;|-E;|OOQ(C[1G1Y1G1YOOQ(C[,5PQtO1G1VOOQ(C[1G1X1G1XO5tQ`O1G2}O#>WQ`O1G2}O#>]Q`O1G2}O#>bQ`O1G2}OOQS1G2}1G2}O#>gQ&kO1G2bO7YQ`O'#JQO7YQ`O'#EaO7YQ`O'#IWO#>xQ(ChO,5?yOOQS1G2f1G2fO!0VQ`O1G2lOIWQ&jO1G2iO#?TQ`O1G2iOOQS1G2j1G2jOIWQ&jO1G2jO#?YQaO1G2jO#?bQ7[O'#GhOOQS1G2l1G2lO!'VQ7[O'#IYO!0[QpO1G2oOOQS1G2o1G2oOOQS,5=Y,5=YO#?jQ&kO,5=[O5tQ`O,5=[O#6SQ`O,5=_O5bQ`O,5=_O!-OQ!bO,5=_O!-WQ&jO,5=_O5yQ&jO,5=_O#?{Q`O'#JaO#@WQ`O,5=`OOQS1G.j1G.jO#@]Q(ChO1G.jO#@hQ`O1G.jO#@mQ`O1G.jO5lQ(ChO1G.jO#@uQtO,5@OO#APQ`O,5@OO#A[QdO,5=gO#AcQ`O,5=gO7YQ`O,5@OOOQS1G3P1G3PO`QdO1G3POOQS1G3V1G3VOOQS1G3X1G3XO:[Q`O1G3ZO#AhQdO1G3]O#EcQdO'#H[OOQS1G3`1G3`O#EpQ`O'#HbO:aQ`O'#HdOOQS1G3f1G3fO#ExQdO1G3fO5lQ(ChO1G3lOOQS1G3n1G3nOOQ(CW'#Fx'#FxO5lQ(ChO1G3pO5lQ(ChO1G3rOOOW1G/^1G/^O#IvQpO,5aO#JYQ`O1G4|O#JbQ`O1G5WO#JjQ`O,5?dOLbQdO,5:{O7YQ`O,5:{O:aQ`O,59}OLbQdO,59}O!-OQ!bO,59}O#JoQMlO,59}OOQO,5:{,5:{O#JyQ7[O'#HvO#KaQ`O,5?cOOQ(C[1G/h1G/hO#KiQ7[O'#H{O#K}Q`O,5?nOOQ(CW1G0f1G0fO!;[Q7[O,59}O#LVQtO1G5XO7YQ`O,5>fOOQ(CW'#ES'#ESO#LaQ(DjO'#ETO!@XQ7[O'#D}OOQO'#Hy'#HyO#L{Q7[O,5:hOOQ(C[,5:h,5:hO#MSQ7[O'#D}O#MeQ7[O'#D}O#MlQ7[O'#EYO#MoQ7[O'#ETO#M|Q7[O'#ETO!@XQ7[O'#ETO#NaQ`O1G0PO#NfQqO1G0POOQ(C[1G0P1G0PO){QdO1G0POIWQ&jO1G0POOQ(C[1G0a1G0aO:aQ`O1G0aO!-OQ!bO1G0aO!-WQ&jO1G0aO#NmQ(C|O1G5UO){QdO1G5UO#N}Q(ChO1G5UO$ `Q`O1G5TO7YQ`O,5>hOOQO,5>h,5>hO$ hQ`O,5>hOOQO-E;z-E;zO$ `Q`O1G5TO$ vQ(C}O,59jO$#xQ(C}O,5m,5>mO$-rQ`O,5>mOOQ(C]1G2P1G2PP$-wQ`O'#IRPOQ(C]-Eo,5>oOOQO-Ep,5>pOOQO-Ex,5>xOOQO-E<[-E<[OOQ(C[7+&q7+&qO$6OQ`O7+(iO5lQ(ChO7+(iO5tQ`O7+(iO$6TQ`O7+(iO$6YQaO7+'|OOQ(CW,5>r,5>rOOQ(CW-Et,5>tOOQO-EO,5>OOOQS7+)Q7+)QOOQS7+)W7+)WOOQS7+)[7+)[OOQS7+)^7+)^OOQO1G5O1G5OO$:nQMlO1G0gO$:xQ`O1G0gOOQO1G/i1G/iO$;TQMlO1G/iO:aQ`O1G/iOLbQdO'#DcOOQO,5>b,5>bOOQO-E;t-E;tOOQO,5>g,5>gOOQO-E;y-E;yO!-OQ!bO1G/iO:aQ`O,5:iOOQO,5:o,5:oO){QdO,5:oO$;_Q(ChO,5:oO$;jQ(ChO,5:oO!-OQ!bO,5:iOOQO-E;w-E;wOOQ(C[1G0S1G0SO!@XQ7[O,5:iO$;xQ7[O,5:iO$PQ`O7+*oO$>XQ(C}O1G2[O$@^Q(C}O1G2^O$BcQ(C}O1G1yO$DnQ,VO,5>cOOQO-E;u-E;uO$DxQtO,5>dO){QdO,5>dOOQO-E;v-E;vO$ESQ`O1G5QO$E[QMlO1G0bO$GcQMlO1G0mO$GjQMlO1G0mO$IkQMlO1G0mO$IrQMlO1G0mO$KgQMlO1G0mO$KzQMlO1G0mO$NXQMlO1G0mO$N`QMlO1G0mO%!aQMlO1G0mO%!hQMlO1G0mO%$]QMlO1G0mO%$pQ(C|O<kOOOO7+'T7+'TOOOW1G/R1G/ROOQ(C]1G4X1G4XOJjQ&jO7+'zO%*VQ`O,5>lO5tQ`O,5>lOOQO-EnO%+dQ`O,5>nOIWQ&jO,5>nOOQO-Ew,5>wO%.vQ`O,5>wO%.{Q`O,5>wOOQO-EvOOQO-EqOOQO-EsOOQO-E{AN>{OOQOAN>uAN>uO%3rQ(C|OAN>{O:aQ`OAN>uO){QdOAN>{O!-OQ!bOAN>uO&)wQ(ChOAN>{O&*SQ(C}OG26lOOQ(CWG26bG26bOOQS!$( t!$( tOOQO<QQ`O'#E[O&>YQ`O'#EzO&>_Q`O'#EgO&>dQ`O'#JRO&>oQ`O'#JPO&>zQ`O,5:vO&?PQ,VO,5aO!O&PO~Ox&SO!W&^O!X&VO!Y&VO'^$dO~O]&TOk&TO!Q&WO'g&QO!S'kP!S'vP~P@dO!O'sX!R'sX!]'sX!c'sX'p'sX~O!{'sX#W#PX!S'sX~PA]O!{&_O!O'uX!R'uX~O!R&`O!O'tX~O!O&cO~O!{#eO~PA]OP&gO!T&dO!o&fO']$bO~Oc&lO!d$ZO']$bO~Ou$oO!d$nO~O!S&mO~P`Ou!{Ov!{Ox!|O!b!yO!d!zO'fQOQ!faZ!faj!fa!R!fa!a!fa!j!fa#[!fa#]!fa#^!fa#_!fa#`!fa#a!fa#b!fa#c!fa#e!fa#g!fa#i!fa#j!fa'p!fa'w!fa'x!fa~O_!fa'W!fa!O!fa!c!fan!fa!T!fa%Q!fa!]!fa~PCfO!c&nO~O!]!wO!{&pO'p&oO!R'rX_'rX'W'rX~O!c'rX~PFOO!R&tO!c'qX~O!c&vO~Ox$uO!T$vO#V&wO']$bO~OQTORTO]cOb!kOc!jOhcOjTOkcOlcOqTOsTOxRO{cO|cO}cO!TSO!_kO!dUO!gTO!hTO!iTO!jTO!kTO!n!iO#t!lO#x^O']9aO'fQO'oYO'|aO~O]#qOh$QOj#rOk#qOl#qOq$ROs9tOx#yO!T#zO!_;eO!d#vO#V9}O#t$VO$_9wO$a9zO$d$WO']&{O'b$PO'f#sO~O#W&}O~O]#qOh$QOj#rOk#qOl#qOq$ROs$SOx#yO!T#zO!_$XO!d#vO#V$YO#t$VO$_$TO$a$UO$d$WO']&{O'b$PO'f#sO~O'a'mP~PJjO!Q'RO!c'nP~P){O'g'TO'oYO~OQ9^OR9^O]cOb;`Oc!jOhcOj9^OkcOlcOq9^Os9^OxRO{cO|cO}cO!T!bO!_9`O!dUO!g9^O!h9^O!i9^O!j9^O!k9^O!n!iO#t!lO#x^O']'cO'fQO'oYO'|;^O~O!d!zO~O!R#bO_$]a'W$]a!c$]a!O$]a!T$]a%Q$]a!]$]a~O#d'jO~PIWO!]'lO!T'yX#w'yX#z'yX$R'yX~Ou'mO~P! YOu'mO!T'yX#w'yX#z'yX$R'yX~O!T'oO#w'sO#z'nO$R'tO~O!Q'wO~PLbO#z#fO$R'zO~OP$eXu$eXx$eX!b$eX'w$eX'x$eX~OPfX!RfX!{fX'afX'a$eX~P!!rOk'|O~OS'}O'U(OO'V(QO~OP(ZOu(SOx(TO'w(VO'x(XO~O'a(RO~P!#{O'a([O~O]#qOh$QOj#rOk#qOl#qOq$ROs9tOx#yO!T#zO!_;eO!d#vO#V9}O#t$VO$_9wO$a9zO$d$WO'b$PO'f#sO~O!Q(`O'](]O!c'}P~P!$jO#W(bO~O!d(cO~O!Q(hO'](eO!O(OP~P!$jOj(uOx(mO!W(sO!X(lO!Y(lO!d(cO!x(tO$w(oO'^$dO'g(jO~O!S(rO~P!&jO!b!yOP'eXu'eXx'eX'w'eX'x'eX!R'eX!{'eX~O'a'eX#m'eX~P!'cOP(xO!{(wO!R'dX'a'dX~O!R(yO'a'cX~O']${O'a'cP~O'](|O~O!d)RO~O']&{O~Ox$uO!Q!rO!T$vO#U!uO#V!rO']$bO!c'qP~O!]!wO#W)VO~OQ#^OZ#dOj#ROu!{Ov!{Ox!|O!a#TO!b!yO!d!zO!j#^O#[#PO#]#QO#^#QO#_#QO#`#SO#a#TO#b#TO#c#TO#e#UO#g#WO#i#YO#j#ZO'fQO'p#[O'w!}O'x#OO~O_!^a!R!^a'W!^a!O!^a!c!^an!^a!T!^a%Q!^a!]!^a~P!)wOP)_O!T&dO!o)^O%Q)]O'b$PO~O!])aO!T'`X_'`X!R'`X'W'`X~O!d$ZO'b$PO~O!d$ZO']$bO'b$PO~O!]!wO#W&}O~O])lO%R)mO'])iO!S(VP~O!R)nO^(UX~O'g'TO~OZ)rO~O^)sO~O!T$lO']$bO'^$dO^(UP~Ox$uO!Q)xO!R&`O!T$vO']$bO!O'tP~O]&ZOk&ZO!Q)yO'g'TO!S'vP~O!R)zO_(RX'W(RX~O!{*OO'b$PO~OP*RO!T#zO'b$PO~O!T*TO~Ou*VO!TSO~O!n*[O~Oc*aO~O'](|O!S(TP~Oc$jO~O%RtO']${O~P8wOZ*gO^*fO~OQTORTO]cObnOcmOhcOjTOkcOlcOqTOsTOxRO{cO|cO}cO!_kO!dUO!gTO!hTO!iTO!jTO!kTO!nlO#x^O%PqO'fQO'oYO'|aO~O!T!bO#t!lO']9aO~P!1_O^*fO_$^O'W$^O~O_*kO#d*mO%T*mO%U*mO~P){O!d%`O~O%t*rO~O!T*tO~O&V*vO&X*wOQ&SaR&SaX&Sa]&Sa_&Sab&Sac&Sah&Saj&Sak&Sal&Saq&Sas&Sax&Sa{&Sa|&Sa}&Sa!T&Sa!_&Sa!d&Sa!g&Sa!h&Sa!i&Sa!j&Sa!k&Sa!n&Sa#d&Sa#t&Sa#x&Sa%P&Sa%R&Sa%T&Sa%U&Sa%X&Sa%Z&Sa%^&Sa%_&Sa%a&Sa%n&Sa%t&Sa%v&Sa%x&Sa%z&Sa%}&Sa&T&Sa&Z&Sa&]&Sa&_&Sa&a&Sa&c&Sa'S&Sa']&Sa'f&Sa'o&Sa'|&Sa!S&Sa%{&Sa`&Sa&Q&Sa~O']*|O~On+PO~O!O&ia!R&ia~P!)wO!Q+TO!O&iX!R&iX~P){O!R%zO!O'ja~O!O'ja~P>aO!R&`O!O'ta~O!RwX!R!ZX!SwX!S!ZX!]wX!]!ZX!d!ZX!{wX'b!ZX~O!]+YO!{+XO!R#TX!R'lX!S#TX!S'lX!]'lX!d'lX'b'lX~O!]+[O!d$ZO'b$PO!R!VX!S!VX~O]&ROk&ROx&SO'g(jO~OQ9^OR9^O]cOb;`Oc!jOhcOj9^OkcOlcOq9^Os9^OxRO{cO|cO}cO!T!bO!_9`O!dUO!g9^O!h9^O!i9^O!j9^O!k9^O!n!iO#t!lO#x^O'fQO'oYO'|;^O~O']:SO~P!;jO!R+`O!S'kX~O!S+bO~O!]+YO!{+XO!R#TX!S#TX~O!R+cO!S'vX~O!S+eO~O]&ROk&ROx&SO'^$dO'g(jO~O!X+fO!Y+fO~P!>hOx$uO!Q+hO!T$vO']$bO!O&nX!R&nX~O_+lO!W+oO!X+kO!Y+kO!r+sO!s+qO!t+rO!u+pO!x+tO'^$dO'g(jO'o+iO~O!S+nO~P!?iOP+yO!T&dO!o+xO~O!{,PO!R'ra!c'ra_'ra'W'ra~O!]!wO~P!@sO!R&tO!c'qa~Ox$uO!Q,SO!T$vO#U,UO#V,SO']$bO!R&pX!c&pX~O_#Oi!R#Oi'W#Oi!O#Oi!c#Oin#Oi!T#Oi%Q#Oi!]#Oi~P!)wOP;tOu(SOx(TO'w(VO'x(XO~O#W!za!R!za!c!za!{!za!T!za_!za'W!za!O!za~P!BpO#W'eXQ'eXZ'eX_'eXj'eXv'eX!a'eX!d'eX!j'eX#['eX#]'eX#^'eX#_'eX#`'eX#a'eX#b'eX#c'eX#e'eX#g'eX#i'eX#j'eX'W'eX'f'eX'p'eX!c'eX!O'eX!T'eXn'eX%Q'eX!]'eX~P!'cO!R,_O'a'mX~P!#{O'a,aO~O!R,bO!c'nX~P!)wO!c,eO~O!O,fO~OQ#^Ou!{Ov!{Ox!|O!b!yO!d!zO!j#^O'fQOZ#Zi_#Zij#Zi!R#Zi!a#Zi#]#Zi#^#Zi#_#Zi#`#Zi#a#Zi#b#Zi#c#Zi#e#Zi#g#Zi#i#Zi#j#Zi'W#Zi'p#Zi'w#Zi'x#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~O#[#Zi~P!FfO#[#PO~P!FfOQ#^Ou!{Ov!{Ox!|O!b!yO!d!zO!j#^O#[#PO#]#QO#^#QO#_#QO'fQOZ#Zi_#Zi!R#Zi!a#Zi#`#Zi#a#Zi#b#Zi#c#Zi#e#Zi#g#Zi#i#Zi#j#Zi'W#Zi'p#Zi'w#Zi'x#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~Oj#Zi~P!IQOj#RO~P!IQOQ#^Oj#ROu!{Ov!{Ox!|O!b!yO!d!zO!j#^O#[#PO#]#QO#^#QO#_#QO#`#SO'fQO_#Zi!R#Zi#e#Zi#g#Zi#i#Zi#j#Zi'W#Zi'p#Zi'w#Zi'x#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~OZ#Zi!a#Zi#a#Zi#b#Zi#c#Zi~P!KlOZ#dO!a#TO#a#TO#b#TO#c#TO~P!KlOQ#^OZ#dOj#ROu!{Ov!{Ox!|O!a#TO!b!yO!d!zO!j#^O#[#PO#]#QO#^#QO#_#QO#`#SO#a#TO#b#TO#c#TO#e#UO'fQO_#Zi!R#Zi#g#Zi#i#Zi#j#Zi'W#Zi'p#Zi'x#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~O'w#Zi~P!NdO'w!}O~P!NdOQ#^OZ#dOj#ROu!{Ov!{Ox!|O!a#TO!b!yO!d!zO!j#^O#[#PO#]#QO#^#QO#_#QO#`#SO#a#TO#b#TO#c#TO#e#UO#g#WO'fQO'w!}O_#Zi!R#Zi#i#Zi#j#Zi'W#Zi'p#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~O'x#Zi~P##OO'x#OO~P##OOQ#^OZ#dOj#ROu!{Ov!{Ox!|O!a#TO!b!yO!d!zO!j#^O#[#PO#]#QO#^#QO#_#QO#`#SO#a#TO#b#TO#c#TO#e#UO#g#WO#i#YO'fQO'w!}O'x#OO~O_#Zi!R#Zi#j#Zi'W#Zi'p#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~P#%jOQ[XZ[Xj[Xu[Xv[Xx[X!a[X!b[X!d[X!j[X!{[X#WdX#[[X#][X#^[X#_[X#`[X#a[X#b[X#c[X#e[X#g[X#i[X#j[X#o[X'f[X'p[X'w[X'x[X!R[X!S[X~O#m[X~P#'}OQ#^OZ9rOj9gOu!{Ov!{Ox!|O!a9iO!b!yO!d!zO!j#^O#[9eO#]9fO#^9fO#_9fO#`9hO#a9iO#b9iO#c9iO#e9jO#g9lO#i9nO#j9oO'fQO'p#[O'w!}O'x#OO~O#m,hO~P#*XOQ'iXZ'iXj'iXu'iXv'iXx'iX!a'iX!b'iX!d'iX!j'iX#['iX#]'iX#^'iX#_'iX#`'iX#a'iX#b'iX#e'iX#g'iX#i'iX#j'iX'f'iX'p'iX'w'iX'x'iX!R'iX~O!{9sO#o9sO#c'iX#m'iX!S'iX~P#,SO_&sa!R&sa'W&sa!c&san&sa!O&sa!T&sa%Q&sa!]&sa~P!)wOQ#ZiZ#Zi_#Zij#Ziv#Zi!R#Zi!a#Zi!b#Zi!d#Zi!j#Zi#[#Zi#]#Zi#^#Zi#_#Zi#`#Zi#a#Zi#b#Zi#c#Zi#e#Zi#g#Zi#i#Zi#j#Zi'W#Zi'f#Zi'p#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~P!BpO_#ni!R#ni'W#ni!O#ni!c#nin#ni!T#ni%Q#ni!]#ni~P!)wO#z,jO~O#z,kO~O!]'lO!{,lO!T$OX#w$OX#z$OX$R$OX~O!Q,mO~O!T'oO#w,oO#z'nO$R,pO~O!R9pO!S'hX~P#*XO!S,qO~O$R,sO~OS'}O'U(OO'V,vO~O],yOk,yO!O,zO~O!RdX!]dX!cdX!c$eX'pdX~P!!rO!c-QO~P!BpO!R-RO!]!wO'p&oO!c'}X~O!c-WO~O!Q(`O']$bO!c'}P~O#W-YO~O!O$eX!R$eX!]$lX~P!!rO!R-ZO!O(OX~P!BpO!]-]O~O!O-_O~Oj-cO!]!wO!d$ZO'b$PO'p&oO~O!])aO~O_$^O!R-hO'W$^O~O!S-jO~P!&jO!X-kO!Y-kO'^$dO'g(jO~Ox-mO'g(jO~O!x-nO~O']${O!R&xX'a&xX~O!R(yO'a'ca~O'a-sO~Ou-tOv-tOx-uOPra'wra'xra!Rra!{ra~O'ara#mra~P#7pOu(SOx(TOP$^a'w$^a'x$^a!R$^a!{$^a~O'a$^a#m$^a~P#8fOu(SOx(TOP$`a'w$`a'x$`a!R$`a!{$`a~O'a$`a#m$`a~P#9XO]-vO~O#W-wO~O'a$na!R$na!{$na#m$na~P!#{O#W-zO~OP.TO!T&dO!o.SO%Q.RO~O]#qOj#rOk#qOl#qOq$ROs9tOx#yO!T#zO!_;eO!d#vO#V9}O#t$VO$_9wO$a9zO$d$WO'b$PO'f#sO~Oh.VO'].UO~P#:yO!])aO!T'`a_'`a!R'`a'W'`a~O#W.]O~OZ[X!RdX!SdX~O!R.^O!S(VX~O!S.`O~OZ.aO~O].cO'])iO~O!T$lO']$bO^'QX!R'QX~O!R)nO^(Ua~O!c.fO~P!)wO].hO~OZ.iO~O^.jO~OP.TO!T&dO!o.SO%Q.RO'b$PO~O!R)zO_(Ra'W(Ra~O!{.pO~OP.sO!T#zO~O'g'TO!S(SP~OP.}O!T.yO!o.|O%Q.{O'b$PO~OZ/XO!R/VO!S(TX~O!S/YO~O^/[O_$^O'W$^O~O]/]O~O]/^O'](|O~O#c/_O%r/`O~P0zO!{#eO#c/_O%r/`O~O_/aO~P){O_/cO~O%{/gOQ%yiR%yiX%yi]%yi_%yib%yic%yih%yij%yik%yil%yiq%yis%yix%yi{%yi|%yi}%yi!T%yi!_%yi!d%yi!g%yi!h%yi!i%yi!j%yi!k%yi!n%yi#d%yi#t%yi#x%yi%P%yi%R%yi%T%yi%U%yi%X%yi%Z%yi%^%yi%_%yi%a%yi%n%yi%t%yi%v%yi%x%yi%z%yi%}%yi&T%yi&Z%yi&]%yi&_%yi&a%yi&c%yi'S%yi']%yi'f%yi'o%yi'|%yi!S%yi`%yi&Q%yi~O`/mO!S/kO&Q/lO~P`O!TSO!d/oO~O&X*wOQ&SiR&SiX&Si]&Si_&Sib&Sic&Sih&Sij&Sik&Sil&Siq&Sis&Six&Si{&Si|&Si}&Si!T&Si!_&Si!d&Si!g&Si!h&Si!i&Si!j&Si!k&Si!n&Si#d&Si#t&Si#x&Si%P&Si%R&Si%T&Si%U&Si%X&Si%Z&Si%^&Si%_&Si%a&Si%n&Si%t&Si%v&Si%x&Si%z&Si%}&Si&T&Si&Z&Si&]&Si&_&Si&a&Si&c&Si'S&Si']&Si'f&Si'o&Si'|&Si!S&Si%{&Si`&Si&Q&Si~O!R#bOn$]a~O!O&ii!R&ii~P!)wO!R%zO!O'ji~O!R&`O!O'ti~O!O/uO~O!R!Va!S!Va~P#*XO]&ROk&RO!Q/{O'g(jO!R&jX!S&jX~P@dO!R+`O!S'ka~O]&ZOk&ZO!Q)yO'g'TO!R&oX!S&oX~O!R+cO!S'va~O!O'ui!R'ui~P!)wO_$^O!]!wO!d$ZO!j0VO!{0TO'W$^O'b$PO'p&oO~O!S0YO~P!?iO!X0ZO!Y0ZO'^$dO'g(jO'o+iO~O!W0[O~P#MSO!TSO!W0[O!u0^O!x0_O~P#MSO!W0[O!s0aO!t0aO!u0^O!x0_O~P#MSO!T&dO~O!T&dO~P!BpO!R'ri!c'ri_'ri'W'ri~P!)wO!{0jO!R'ri!c'ri_'ri'W'ri~O!R&tO!c'qi~Ox$uO!T$vO#V0lO']$bO~O#WraQraZra_rajra!ara!bra!dra!jra#[ra#]ra#^ra#_ra#`ra#ara#bra#cra#era#gra#ira#jra'Wra'fra'pra!cra!Ora!Tranra%Qra!]ra~P#7pO#W$^aQ$^aZ$^a_$^aj$^av$^a!a$^a!b$^a!d$^a!j$^a#[$^a#]$^a#^$^a#_$^a#`$^a#a$^a#b$^a#c$^a#e$^a#g$^a#i$^a#j$^a'W$^a'f$^a'p$^a!c$^a!O$^a!T$^an$^a%Q$^a!]$^a~P#8fO#W$`aQ$`aZ$`a_$`aj$`av$`a!a$`a!b$`a!d$`a!j$`a#[$`a#]$`a#^$`a#_$`a#`$`a#a$`a#b$`a#c$`a#e$`a#g$`a#i$`a#j$`a'W$`a'f$`a'p$`a!c$`a!O$`a!T$`an$`a%Q$`a!]$`a~P#9XO#W$naQ$naZ$na_$naj$nav$na!R$na!a$na!b$na!d$na!j$na#[$na#]$na#^$na#_$na#`$na#a$na#b$na#c$na#e$na#g$na#i$na#j$na'W$na'f$na'p$na!c$na!O$na!T$na!{$nan$na%Q$na!]$na~P!BpO_#Oq!R#Oq'W#Oq!O#Oq!c#Oqn#Oq!T#Oq%Q#Oq!]#Oq~P!)wO!R&kX'a&kX~PJjO!R,_O'a'ma~O!Q0tO!R&lX!c&lX~P){O!R,bO!c'na~O!R,bO!c'na~P!)wO#m!fa!S!fa~PCfO#m!^a!R!^a!S!^a~P#*XO!T1XO#x^O$P1YO~O!S1^O~On1_O~P!BpO_$Yq!R$Yq'W$Yq!O$Yq!c$Yqn$Yq!T$Yq%Q$Yq!]$Yq~P!)wO!O1`O~O],yOk,yO~Ou(SOx(TO'x(XOP$xi'w$xi!R$xi!{$xi~O'a$xi#m$xi~P$.POu(SOx(TOP$zi'w$zi'x$zi!R$zi!{$zi~O'a$zi#m$zi~P$.rO'p#[O~P!BpO!Q1cO']$bO!R&tX!c&tX~O!R-RO!c'}a~O!R-RO!]!wO!c'}a~O!R-RO!]!wO'p&oO!c'}a~O'a$gi!R$gi!{$gi#m$gi~P!#{O!Q1kO'](eO!O&vX!R&vX~P!$jO!R-ZO!O(Oa~O!R-ZO!O(Oa~P!BpO!]!wO~O!]!wO#c1sO~Oj1vO!]!wO'p&oO~O!R'di'a'di~P!#{O!{1yO!R'di'a'di~P!#{O!c1|O~O_$Zq!R$Zq'W$Zq!O$Zq!c$Zqn$Zq!T$Zq%Q$Zq!]$Zq~P!)wO!R2QO!T(PX~P!BpO!T&dO%Q2TO~O!T&dO%Q2TO~P!BpO!T$eX$u[X_$eX!R$eX'W$eX~P!!rO$u2XOPgXugXxgX!TgX'wgX'xgX_gX!RgX'WgX~O$u2XO~O]2_O%R2`O'])iO!R'PX!S'PX~O!R.^O!S(Va~OZ2dO~O^2eO~O]2hO~OP2jO!T&dO!o2iO%Q2TO~O_$^O'W$^O~P!BpO!T#zO~P!BpO!R2oO!{2qO!S(SX~O!S2rO~Ox;oO!W2{O!X2tO!Y2tO!r2zO!s2yO!t2yO!x2xO'^$dO'g(jO'o+iO~O!S2wO~P$7ZOP3SO!T.yO!o3RO%Q3QO~OP3SO!T.yO!o3RO%Q3QO'b$PO~O'](|O!R'OX!S'OX~O!R/VO!S(Ta~O]3^O'g3]O~O]3_O~O^3aO~O!c3dO~P){O_3fO~O_3fO~P){O#c3hO%r3iO~PFOO`/mO!S3mO&Q/lO~P`O!]3oO~O!R#Ti!S#Ti~P#*XO!{3qO!R#Ti!S#Ti~O!R!Vi!S!Vi~P#*XO_$^O!{3xO'W$^O~O_$^O!]!wO!{3xO'W$^O~O!X3|O!Y3|O'^$dO'g(jO'o+iO~O_$^O!]!wO!d$ZO!j3}O!{3xO'W$^O'b$PO'p&oO~O!W4OO~P$;xO!W4OO!u4RO!x4SO~P$;xO_$^O!]!wO!j3}O!{3xO'W$^O'p&oO~O!R'rq!c'rq_'rq'W'rq~P!)wO!R&tO!c'qq~O#W$xiQ$xiZ$xi_$xij$xiv$xi!a$xi!b$xi!d$xi!j$xi#[$xi#]$xi#^$xi#_$xi#`$xi#a$xi#b$xi#c$xi#e$xi#g$xi#i$xi#j$xi'W$xi'f$xi'p$xi!c$xi!O$xi!T$xin$xi%Q$xi!]$xi~P$.PO#W$ziQ$ziZ$zi_$zij$ziv$zi!a$zi!b$zi!d$zi!j$zi#[$zi#]$zi#^$zi#_$zi#`$zi#a$zi#b$zi#c$zi#e$zi#g$zi#i$zi#j$zi'W$zi'f$zi'p$zi!c$zi!O$zi!T$zin$zi%Q$zi!]$zi~P$.rO#W$giQ$giZ$gi_$gij$giv$gi!R$gi!a$gi!b$gi!d$gi!j$gi#[$gi#]$gi#^$gi#_$gi#`$gi#a$gi#b$gi#c$gi#e$gi#g$gi#i$gi#j$gi'W$gi'f$gi'p$gi!c$gi!O$gi!T$gi!{$gin$gi%Q$gi!]$gi~P!BpO!R&ka'a&ka~P!#{O!R&la!c&la~P!)wO!R,bO!c'ni~O#m#Oi!R#Oi!S#Oi~P#*XOQ#^Ou!{Ov!{Ox!|O!b!yO!d!zO!j#^O'fQOZ#Zij#Zi!a#Zi#]#Zi#^#Zi#_#Zi#`#Zi#a#Zi#b#Zi#c#Zi#e#Zi#g#Zi#i#Zi#j#Zi#m#Zi'p#Zi'w#Zi'x#Zi!R#Zi!S#Zi~O#[#Zi~P$EiO#[9eO~P$EiOQ#^Ou!{Ov!{Ox!|O!b!yO!d!zO!j#^O#[9eO#]9fO#^9fO#_9fO'fQOZ#Zi!a#Zi#`#Zi#a#Zi#b#Zi#c#Zi#e#Zi#g#Zi#i#Zi#j#Zi#m#Zi'p#Zi'w#Zi'x#Zi!R#Zi!S#Zi~Oj#Zi~P$GqOj9gO~P$GqOQ#^Oj9gOu!{Ov!{Ox!|O!b!yO!d!zO!j#^O#[9eO#]9fO#^9fO#_9fO#`9hO'fQO#e#Zi#g#Zi#i#Zi#j#Zi#m#Zi'p#Zi'w#Zi'x#Zi!R#Zi!S#Zi~OZ#Zi!a#Zi#a#Zi#b#Zi#c#Zi~P$IyOZ9rO!a9iO#a9iO#b9iO#c9iO~P$IyOQ#^OZ9rOj9gOu!{Ov!{Ox!|O!a9iO!b!yO!d!zO!j#^O#[9eO#]9fO#^9fO#_9fO#`9hO#a9iO#b9iO#c9iO#e9jO'fQO#g#Zi#i#Zi#j#Zi#m#Zi'p#Zi'x#Zi!R#Zi!S#Zi~O'w#Zi~P$L_O'w!}O~P$L_OQ#^OZ9rOj9gOu!{Ov!{Ox!|O!a9iO!b!yO!d!zO!j#^O#[9eO#]9fO#^9fO#_9fO#`9hO#a9iO#b9iO#c9iO#e9jO#g9lO'fQO'w!}O#i#Zi#j#Zi#m#Zi'p#Zi!R#Zi!S#Zi~O'x#Zi~P$NgO'x#OO~P$NgOQ#^OZ9rOj9gOu!{Ov!{Ox!|O!a9iO!b!yO!d!zO!j#^O#[9eO#]9fO#^9fO#_9fO#`9hO#a9iO#b9iO#c9iO#e9jO#g9lO#i9nO'fQO'w!}O'x#OO~O#j#Zi#m#Zi'p#Zi!R#Zi!S#Zi~P%!oO_#ky!R#ky'W#ky!O#ky!c#kyn#ky!T#ky%Q#ky!]#ky~P!)wOP;vOu(SOx(TO'w(VO'x(XO~OQ#ZiZ#Zij#Ziv#Zi!a#Zi!b#Zi!d#Zi!j#Zi#[#Zi#]#Zi#^#Zi#_#Zi#`#Zi#a#Zi#b#Zi#c#Zi#e#Zi#g#Zi#i#Zi#j#Zi#m#Zi'f#Zi'p#Zi!R#Zi!S#Zi~P%%aO!b!yOP'eXu'eXx'eX'w'eX'x'eX!S'eX~OQ'eXZ'eXj'eXv'eX!a'eX!d'eX!j'eX#['eX#]'eX#^'eX#_'eX#`'eX#a'eX#b'eX#c'eX#e'eX#g'eX#i'eX#j'eX#m'eX'f'eX'p'eX!R'eX~P%'eO#m#ni!R#ni!S#ni~P#*XO!S4eO~O!R&sa!S&sa~P#*XO!]!wO'p&oO!R&ta!c&ta~O!R-RO!c'}i~O!R-RO!]!wO!c'}i~O'a$gq!R$gq!{$gq#m$gq~P!#{O!O&va!R&va~P!BpO!]4lO~O!R-ZO!O(Oi~P!BpO!R-ZO!O(Oi~O!O4pO~O!]!wO#c4uO~Oj4vO!]!wO'p&oO~O!O4xO~O'a$iq!R$iq!{$iq#m$iq~P!#{O_$Zy!R$Zy'W$Zy!O$Zy!c$Zyn$Zy!T$Zy%Q$Zy!]$Zy~P!)wO!R2QO!T(Pa~O!T&dO%Q4}O~O!T&dO%Q4}O~P!BpO_#Oy!R#Oy'W#Oy!O#Oy!c#Oyn#Oy!T#Oy%Q#Oy!]#Oy~P!)wOZ5QO~O]5SO'])iO~O!R.^O!S(Vi~O]5VO~O^5WO~O'g'TO!R&{X!S&{X~O!R2oO!S(Sa~O!S5eO~P$7ZOx;sO'g(jO'o+iO~O!W5hO!X5gO!Y5gO!x0_O'^$dO'g(jO'o+iO~O!s5iO!t5iO~P%0^O!X5gO!Y5gO'^$dO'g(jO'o+iO~O!T.yO~O!T.yO%Q5kO~O!T.yO%Q5kO~P!BpOP5pO!T.yO!o5oO%Q5kO~OZ5uO!R'Oa!S'Oa~O!R/VO!S(Ti~O]5xO~O!c5yO~O!c5zO~O!c5{O~O!c5{O~P){O_5}O~O!]6QO~O!c6RO~O!R'ui!S'ui~P#*XO_$^O'W$^O~P!)wO_$^O!{6WO'W$^O~O_$^O!]!wO!{6WO'W$^O~O!X6]O!Y6]O'^$dO'g(jO'o+iO~O_$^O!]!wO!j6^O!{6WO'W$^O'p&oO~O!d$ZO'b$PO~P%4xO!W6_O~P%4gO!R'ry!c'ry_'ry'W'ry~P!)wO#W$gqQ$gqZ$gq_$gqj$gqv$gq!R$gq!a$gq!b$gq!d$gq!j$gq#[$gq#]$gq#^$gq#_$gq#`$gq#a$gq#b$gq#c$gq#e$gq#g$gq#i$gq#j$gq'W$gq'f$gq'p$gq!c$gq!O$gq!T$gq!{$gqn$gq%Q$gq!]$gq~P!BpO#W$iqQ$iqZ$iq_$iqj$iqv$iq!R$iq!a$iq!b$iq!d$iq!j$iq#[$iq#]$iq#^$iq#_$iq#`$iq#a$iq#b$iq#c$iq#e$iq#g$iq#i$iq#j$iq'W$iq'f$iq'p$iq!c$iq!O$iq!T$iq!{$iqn$iq%Q$iq!]$iq~P!BpO!R&li!c&li~P!)wO#m#Oq!R#Oq!S#Oq~P#*XOu-tOv-tOx-uOPra'wra'xra!Sra~OQraZrajra!ara!bra!dra!jra#[ra#]ra#^ra#_ra#`ra#ara#bra#cra#era#gra#ira#jra#mra'fra'pra!Rra~P%;OOu(SOx(TOP$^a'w$^a'x$^a!S$^a~OQ$^aZ$^aj$^av$^a!a$^a!b$^a!d$^a!j$^a#[$^a#]$^a#^$^a#_$^a#`$^a#a$^a#b$^a#c$^a#e$^a#g$^a#i$^a#j$^a#m$^a'f$^a'p$^a!R$^a~P%=SOu(SOx(TOP$`a'w$`a'x$`a!S$`a~OQ$`aZ$`aj$`av$`a!a$`a!b$`a!d$`a!j$`a#[$`a#]$`a#^$`a#_$`a#`$`a#a$`a#b$`a#c$`a#e$`a#g$`a#i$`a#j$`a#m$`a'f$`a'p$`a!R$`a~P%?WOQ$naZ$naj$nav$na!a$na!b$na!d$na!j$na#[$na#]$na#^$na#_$na#`$na#a$na#b$na#c$na#e$na#g$na#i$na#j$na#m$na'f$na'p$na!R$na!S$na~P%%aO#m$Yq!R$Yq!S$Yq~P#*XO#m$Zq!R$Zq!S$Zq~P#*XO!S6hO~O#m6iO~P!#{O!]!wO!R&ti!c&ti~O!]!wO'p&oO!R&ti!c&ti~O!R-RO!c'}q~O!O&vi!R&vi~P!BpO!R-ZO!O(Oq~O!O6oO~P!BpO!O6oO~O!R'dy'a'dy~P!#{O!R&ya!T&ya~P!BpO!T$tq_$tq!R$tq'W$tq~P!BpOZ6vO~O!R.^O!S(Vq~O]6yO~O!T&dO%Q6zO~O!T&dO%Q6zO~P!BpO!{6{O!R&{a!S&{a~O!R2oO!S(Si~P#*XO!X7RO!Y7RO'^$dO'g(jO'o+iO~O!W7TO!x4SO~P%GXO!T.yO%Q7WO~O!T.yO%Q7WO~P!BpO]7_O'g7^O~O!R/VO!S(Tq~O!c7aO~O!c7aO~P){O!c7cO~O!c7dO~O!R#Ty!S#Ty~P#*XO_$^O!{7jO'W$^O~O_$^O!]!wO!{7jO'W$^O~O!X7mO!Y7mO'^$dO'g(jO'o+iO~O_$^O!]!wO!j7nO!{7jO'W$^O'p&oO~O#m#ky!R#ky!S#ky~P#*XOQ$giZ$gij$giv$gi!a$gi!b$gi!d$gi!j$gi#[$gi#]$gi#^$gi#_$gi#`$gi#a$gi#b$gi#c$gi#e$gi#g$gi#i$gi#j$gi#m$gi'f$gi'p$gi!R$gi!S$gi~P%%aOu(SOx(TO'x(XOP$xi'w$xi!S$xi~OQ$xiZ$xij$xiv$xi!a$xi!b$xi!d$xi!j$xi#[$xi#]$xi#^$xi#_$xi#`$xi#a$xi#b$xi#c$xi#e$xi#g$xi#i$xi#j$xi#m$xi'f$xi'p$xi!R$xi~P%LjOu(SOx(TOP$zi'w$zi'x$zi!S$zi~OQ$ziZ$zij$ziv$zi!a$zi!b$zi!d$zi!j$zi#[$zi#]$zi#^$zi#_$zi#`$zi#a$zi#b$zi#c$zi#e$zi#g$zi#i$zi#j$zi#m$zi'f$zi'p$zi!R$zi~P%NnO#m$Zy!R$Zy!S$Zy~P#*XO#m#Oy!R#Oy!S#Oy~P#*XO!]!wO!R&tq!c&tq~O!R-RO!c'}y~O!O&vq!R&vq~P!BpO!O7tO~P!BpO!R.^O!S(Vy~O!R2oO!S(Sq~O!X8QO!Y8QO'^$dO'g(jO'o+iO~O!T.yO%Q8TO~O!T.yO%Q8TO~P!BpO!c8WO~O_$^O!{8]O'W$^O~O_$^O!]!wO!{8]O'W$^O~OQ$gqZ$gqj$gqv$gq!a$gq!b$gq!d$gq!j$gq#[$gq#]$gq#^$gq#_$gq#`$gq#a$gq#b$gq#c$gq#e$gq#g$gq#i$gq#j$gq#m$gq'f$gq'p$gq!R$gq!S$gq~P%%aOQ$iqZ$iqj$iqv$iq!a$iq!b$iq!d$iq!j$iq#[$iq#]$iq#^$iq#_$iq#`$iq#a$iq#b$iq#c$iq#e$iq#g$iq#i$iq#j$iq#m$iq'f$iq'p$iq!R$iq!S$iq~P%%aO'a$|!Z!R$|!Z!{$|!Z#m$|!Z~P!#{O!R&{q!S&{q~P#*XO_$^O!{8oO'W$^O~O#W$|!ZQ$|!ZZ$|!Z_$|!Zj$|!Zv$|!Z!R$|!Z!a$|!Z!b$|!Z!d$|!Z!j$|!Z#[$|!Z#]$|!Z#^$|!Z#_$|!Z#`$|!Z#a$|!Z#b$|!Z#c$|!Z#e$|!Z#g$|!Z#i$|!Z#j$|!Z'W$|!Z'f$|!Z'p$|!Z!c$|!Z!O$|!Z!T$|!Z!{$|!Zn$|!Z%Q$|!Z!]$|!Z~P!BpOP;uOu(SOx(TO'w(VO'x(XO~O!S!za!W!za!X!za!Y!za!r!za!s!za!t!za!x!za'^!za'g!za'o!za~P&,_O!W'eX!X'eX!Y'eX!r'eX!s'eX!t'eX!x'eX'^'eX'g'eX'o'eX~P%'eOQ$|!ZZ$|!Zj$|!Zv$|!Z!a$|!Z!b$|!Z!d$|!Z!j$|!Z#[$|!Z#]$|!Z#^$|!Z#_$|!Z#`$|!Z#a$|!Z#b$|!Z#c$|!Z#e$|!Z#g$|!Z#i$|!Z#j$|!Z#m$|!Z'f$|!Z'p$|!Z!R$|!Z!S$|!Z~P%%aO!Wra!Xra!Yra!rra!sra!tra!xra'^ra'gra'ora~P%;OO!W$^a!X$^a!Y$^a!r$^a!s$^a!t$^a!x$^a'^$^a'g$^a'o$^a~P%=SO!W$`a!X$`a!Y$`a!r$`a!s$`a!t$`a!x$`a'^$`a'g$`a'o$`a~P%?WO!S$na!W$na!X$na!Y$na!r$na!s$na!t$na!x$na'^$na'g$na'o$na~P&,_O!W$xi!X$xi!Y$xi!r$xi!s$xi!t$xi!x$xi'^$xi'g$xi'o$xi~P%LjO!W$zi!X$zi!Y$zi!r$zi!s$zi!t$zi!x$zi'^$zi'g$zi'o$zi~P%NnO!S$gi!W$gi!X$gi!Y$gi!r$gi!s$gi!t$gi!x$gi'^$gi'g$gi'o$gi~P&,_O!S$gq!W$gq!X$gq!Y$gq!r$gq!s$gq!t$gq!x$gq'^$gq'g$gq'o$gq~P&,_O!S$iq!W$iq!X$iq!Y$iq!r$iq!s$iq!t$iq!x$iq'^$iq'g$iq'o$iq~P&,_O!S$|!Z!W$|!Z!X$|!Z!Y$|!Z!r$|!Z!s$|!Z!t$|!Z!x$|!Z'^$|!Z'g$|!Z'o$|!Z~P&,_On'hX~P.jOn[X!O[X!c[X%r[X!T[X%Q[X!][X~P$zO!]dX!c[X!cdX'pdX~P;dOQ9^OR9^O]cOb;`Oc!jOhcOj9^OkcOlcOq9^Os9^OxRO{cO|cO}cO!TSO!_9`O!dUO!g9^O!h9^O!i9^O!j9^O!k9^O!n!iO#t!lO#x^O']'cO'fQO'oYO'|;^O~O]#qOh$QOj#rOk#qOl#qOq$ROs9uOx#yO!T#zO!_;fO!d#vO#V:OO#t$VO$_9xO$a9{O$d$WO']&{O'b$PO'f#sO~O!R9pO!S$]a~O]#qOh$QOj#rOk#qOl#qOq$ROs9vOx#yO!T#zO!_;gO!d#vO#V:PO#t$VO$_9yO$a9|O$d$WO']&{O'b$PO'f#sO~O#d'jO~P&]P!AQ!AY!A^!A^P!>YP!Ab!AbP!DVP!DZ?Z?Z!Da!GT8SP8SP8S8SP!HW8S8S!Jf8S!M_8S# g8S8S#!T#$c#$c#$g#$c#$oP#$cP8S#%k8S#'X8S8S-zPPP#(yPP#)c#)cP#)cP#)x#)cPP#*OP#)uP#)u#*b!!X#)u#+P#+V#+Y([#+]([P#+d#+d#+dP([P([P([P([PP([P#+j#+mP#+m([P#+qP#+tP([P([P([P([P([P([([#+z#,U#,[#,b#,p#,v#,|#-W#-^#-m#-s#.R#.X#._#.m#/S#0z#1Y#1`#1f#1l#1r#1|#2S#2Y#2d#2v#2|PPPPPPPP#3SPP#3v#7OPP#8f#8m#8uPP#>a#@t#Fp#Fs#Fv#GR#GUPP#GX#G]#Gz#Hq#Hu#IZPP#I_#Ie#IiP#Il#Ip#Is#Jc#Jy#KO#KR#KU#K[#K_#Kc#KgmhOSj}!n$]%c%f%g%i*o*t/g/jQ$imQ$ppQ%ZyS&V!b+`Q&k!jS(l#z(qQ)g$jQ)t$rQ*`%TQ+f&^S+k&d+mQ+}&lQ-k(sQ/U*aY0Z+o+p+q+r+sS2t.y2vU3|0[0^0aU5g2y2z2{S6]4O4RS7R5h5iQ7m6_R8Q7T$p[ORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%c%e%f%g%i%m%x%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8o!j'e#]#k&W'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aQ(}$SQ)l$lQ*b%WQ*i%`Q,X9tQ.W)aQ.c)mQ/^*gQ2_.^Q3Z/VQ4^9vQ5S2`R8{9upeOSjy}!n$]%Y%c%f%g%i*o*t/g/jR*d%[&WVOSTjkn}!S!W!k!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k$]$n%[%_%`%c%e%f%g%i%m%z&S&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;`;a[!cRU!]!`%x&WQ$clQ$hmS$mp$rv$wrs!r!u$Z$u&`&t&w)x)y)z*m+Y+h,S,U/o0lQ%PwQ&h!iQ&j!jS(_#v(cS)f$i$jQ)j$lQ)w$tQ*Z%RQ*_%TS+|&k&lQ-V(`Q.[)gQ.b)mQ.d)nQ.g)rQ/P*[S/T*`*aQ0h+}Q1b-RQ2^.^Q2b.aQ2g.iQ3Y/UQ4i1cQ5R2`Q5U2dQ6u5QR7w6vx#xa!y$T$U$Y(W(Y(b(w(x,_-Y-w1a1y6i;^;i;j;k!Y$fm!j$h$i$j&U&j&k&l(k)f)g+]+j+|+}-d.[0Q0W0]0h1u3{4Q6Z7k8^Q)`$cQ*P$|Q*S$}Q*^%TQ.k)wQ/O*ZU/S*_*`*aQ3T/PS3X/T/UQ5b2sQ5t3YS7P5c5fS8O7Q7SQ8f8PQ8u8g#[;b!w#d#v#y&g'}(Z(h)])_)a*O*R+y-Z-].R.T.p.s.{.}1k1s2Q2T2X2j3Q3S4l4u4}5k5p6z7W8T9w9z9}:U:X:[:a:d:j;l;n;t;u;vd;c9d9x9{:O:V:Y:]:b:e:ke;d9r9y9|:P:W:Z:^:c:f:lW#}a$P(y;^S$|t%YQ$}uQ%OvR)}$z%P#|a!w!y#d#v#y$T$U$Y&g'}(W(Y(Z(b(h(w(x)])_)a*O*R+y,_-Y-Z-]-w.R.T.p.s.{.}1a1k1s1y2Q2T2X2j3Q3S4l4u4}5k5p6i6z7W8T9d9r9w9x9y9z9{9|9}:O:P:U:V:W:X:Y:Z:[:]:^:a:b:c:d:e:f:j:k:l;^;i;j;k;l;n;t;u;vT(O#s(PX)O$S9t9u9vU&Z!b$v+cQ'U!{Q)q$oQ.t*TQ1z-tR5^2o&^cORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k$]$n%[%_%`%c%e%f%g%i%m%x%z&S&W&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;a$]#aZ!_!o$a%w%}&y'Q'W'X'Y'Z'[']'^'_'`'a'b'd'g'k'u)p+R+^+g,O,^,d,g,i,w-x/v/y0i0s0w0x0y0z0{0|0}1O1P1Q1R1S1T1W1]2O2[3s3v4W4[4]4b4c5`6S6V6b6f6g7g7z8Z8m8y9_:|T!XQ!Y&_cORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k$]$n%[%_%`%c%e%f%g%i%m%x%z&S&W&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aQ&X!bR/|+`Y&R!b&V&^+`+fS(k#z(qS+j&d+mS-d(l(sQ-e(mQ-l(tQ.v*VU0W+k+o+pU0]+q+r+sS0b+t2xQ1u-kQ1w-mQ1x-nS2s.y2vU3{0Z0[0^Q4P0_Q4Q0aS5c2t2{S5f2y2zU6Z3|4O4RQ6`4SS7Q5g5hQ7S5iS7k6]6_S8P7R7TQ8^7mQ8g8QQ;h;oR;m;slhOSj}!n$]%c%f%g%i*o*t/g/jQ%k!QS&x!v9cQ)d$gQ*X%PQ*Y%QQ+z&iS,]&}:RS-y)V:_Q.Y)eQ.x*WQ/n*vQ/p*wQ/x+ZQ0`+qQ0f+{S2P-z:gQ2Y.ZS2].]:hQ3r/zQ3u0RQ4U0gQ5P2ZQ6T3tQ6X3zQ6a4VQ7e6RQ7h6YQ8Y7iQ8l8[R8x8n$W#`Z!_!o%w%}&y'Q'W'X'Y'Z'[']'^'_'`'a'b'd'g'k'u)p+R+^+g,O,^,d,g,w-x/v/y0i0s0w0x0y0z0{0|0}1O1P1Q1R1S1T1W1]2O2[3s3v4W4[4]4b4c5`6S6V6b6f6g7g7z8Z8m8y9_:|W(v#{&|1V8qT)Z$a,i$W#_Z!_!o%w%}&y'Q'W'X'Y'Z'[']'^'_'`'a'b'd'g'k'u)p+R+^+g,O,^,d,g,w-x/v/y0i0s0w0x0y0z0{0|0}1O1P1Q1R1S1T1W1]2O2[3s3v4W4[4]4b4c5`6S6V6b6f6g7g7z8Z8m8y9_:|Q'f#`S)Y$a,iR-{)Z&^cORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k$]$n%[%_%`%c%e%f%g%i%m%x%z&S&W&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aQ%f{Q%g|Q%i!OQ%j!PR/f*rQ&e!iQ)[$cQ+w&hS.Q)`)wS0c+u+vW2S-}.O.P.kS4T0d0eU4|2U2V2WU6s4{5Y5ZQ7v6tR8b7yT+l&d+mS+j&d+mU0W+k+o+pU0]+q+r+sS0b+t2xS2s.y2vU3{0Z0[0^Q4P0_Q4Q0aS5c2t2{S5f2y2zU6Z3|4O4RQ6`4SS7Q5g5hQ7S5iS7k6]6_S8P7R7TQ8^7mR8g8QS+l&d+mT2u.y2vS&r!q/dQ-U(_Q-b(kS0V+j2sQ1g-VS1p-c-lU3}0]0b5fQ4h1bS4s1v1xU6^4P4Q7SQ6k4iQ6r4vR7n6`Q!xXS&q!q/dQ)W$[Q)b$eQ)h$kQ,Q&rQ-T(_Q-a(kQ-f(nQ.X)cQ/Q*]S0U+j2sS1f-U-VS1o-b-lQ1r-eQ1t-gQ3V/RW3y0V0]0b5fQ4g1bQ4k1gS4o1p1xQ4t1wQ5r3WW6[3}4P4Q7SS6j4h4iS6n4p:iQ6p4sQ6}5aQ7[5sS7l6^6`Q7r6kS7s6o:mQ7u6rQ7|7OQ8V7]Q8_7nS8a7t:nQ8d7}Q8s8eQ9Q8tQ9X9RQ:u:pQ;T:zQ;U:{Q;V;hR;[;m$rWORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%`%c%e%f%g%i%m%x%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8oS!xn!k!j:o#]#k&W'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aR:u;`$rXORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%`%c%e%f%g%i%m%x%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8oQ$[b!Y$em!j$h$i$j&U&j&k&l(k)f)g+]+j+|+}-d.[0Q0W0]0h1u3{4Q6Z7k8^S$kn!kQ)c$fQ*]%TW/R*^*_*`*aU3W/S/T/UQ5a2sS5s3X3YU7O5b5c5fQ7]5tU7}7P7Q7SS8e8O8PS8t8f8gQ9R8u!j:p#]#k&W'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aQ:z;_R:{;`$f]OSTjk}!S!W!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%c%e%f%g%i%m%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8oY!hRU!]!`%xv$wrs!r!u$Z$u&`&t&w)x)y)z*m+Y+h,S,U/o0lQ*j%`!h:q#]#k'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aR:t&WS&[!b$vR0O+c$p[ORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%c%e%f%g%i%m%x%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8o!j'e#]#k&W'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aR*i%`$roORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%`%c%e%f%g%i%m%x%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8oQ'U!{!k:r#]#k&W'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;a!h#VZ!_$a%w%}&y'Q'_'`'a'b'g'k)p+R+g,O,^,d,w-x0i0s1T2O2[3v4W4[6V7g8Z8m8y9_!R9k'd'u+^,i/v/y0w1P1Q1R1S1W1]3s4]4b4c5`6S6b6f6g7z:|!d#XZ!_$a%w%}&y'Q'a'b'g'k)p+R+g,O,^,d,w-x0i0s1T2O2[3v4W4[6V7g8Z8m8y9_}9m'd'u+^,i/v/y0w1R1S1W1]3s4]4b4c5`6S6b6f6g7z:|!`#]Z!_$a%w%}&y'Q'g'k)p+R+g,O,^,d,w-x0i0s1T2O2[3v4W4[6V7g8Z8m8y9_Q1a-Px;a'd'u+^,i/v/y0w1W1]3s4]4b4c5`6S6b6f6g7z:|Q;i;pQ;j;qR;k;r&^cORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k$]$n%[%_%`%c%e%f%g%i%m%x%z&S&W&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aS#l`#mR1Y,l&e_ORSTU`jk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k#m$]$n%[%_%`%c%e%f%g%i%m%x%z&S&W&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,l,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aS#g^#nT'n#i'rT#h^#nT'p#i'r&e`ORSTU`jk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k#m$]$n%[%_%`%c%e%f%g%i%m%x%z&S&W&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,l,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aT#l`#mQ#o`R'y#m$rbORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%`%c%e%f%g%i%m%x%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8o!k;_#]#k&W'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;a#RdOSUj}!S!W!n!|#k$]%[%_%`%c%e%f%g%i%m&S&f'w)^*k*o*t+x,m-u.S.|/_/`/a/c/g/j/l1X2i3R3f3h3i5o5}x#{a!y$T$U$Y(W(Y(b(w(x,_-Y-w1a1y6i;^;i;j;k#[&|!w#d#v#y&g'}(Z(h)])_)a*O*R+y-Z-].R.T.p.s.{.}1k1s2Q2T2X2j3Q3S4l4u4}5k5p6z7W8T9w9z9}:U:X:[:a:d:j;l;n;t;u;vQ)S$WQ,x(Sd1V9r9y9|:P:W:Z:^:c:f:le8q9d9x9{:O:V:Y:]:b:e:kx#wa!y$T$U$Y(W(Y(b(w(x,_-Y-w1a1y6i;^;i;j;kQ(d#xS(n#z(qQ)T$XQ-g(o#[:w!w#d#v#y&g'}(Z(h)])_)a*O*R+y-Z-].R.T.p.s.{.}1k1s2Q2T2X2j3Q3S4l4u4}5k5p6z7W8T9w9z9}:U:X:[:a:d:j;l;n;t;u;vd:x9d9x9{:O:V:Y:]:b:e:kd:y9r9y9|:P:W:Z:^:c:f:lQ:};bQ;O;cQ;P;dQ;Q;eQ;R;fR;S;gx#{a!y$T$U$Y(W(Y(b(w(x,_-Y-w1a1y6i;^;i;j;k#[&|!w#d#v#y&g'}(Z(h)])_)a*O*R+y-Z-].R.T.p.s.{.}1k1s2Q2T2X2j3Q3S4l4u4}5k5p6z7W8T9w9z9}:U:X:[:a:d:j;l;n;t;u;vd1V9r9y9|:P:W:Z:^:c:f:le8q9d9x9{:O:V:Y:]:b:e:klfOSj}!n$]%c%f%g%i*o*t/g/jQ(g#yQ*}%pQ+O%rR1j-Z%O#|a!w!y#d#v#y$T$U$Y&g'}(W(Y(Z(b(h(w(x)])_)a*O*R+y,_-Y-Z-]-w.R.T.p.s.{.}1a1k1s1y2Q2T2X2j3Q3S4l4u4}5k5p6i6z7W8T9d9r9w9x9y9z9{9|9}:O:P:U:V:W:X:Y:Z:[:]:^:a:b:c:d:e:f:j:k:l;^;i;j;k;l;n;t;u;vQ*Q$}Q.r*SQ2m.qR5]2nT(p#z(qS(p#z(qT2u.y2vQ)b$eQ-f(nQ.X)cQ/Q*]Q3V/RQ5r3WQ6}5aQ7[5sQ7|7OQ8V7]Q8d7}Q8s8eQ9Q8tR9X9Rp(W#t'O)U-X-o-p0q1h1}4f4w7q:v;W;X;Y!n:U&z'i(^(f+v,[,t-P-^-|.P.o.q0e0p1i1m2W2l2n3O4Y4Z4m4q4y5O5Z5n6m6q7Y8`;Z;];p;q;r[:V8p9O9V9Y9Z9]]:W1U4a6c7o7p8zr(Y#t'O)U,}-X-o-p0q1h1}4f4w7q:v;W;X;Y!p:X&z'i(^(f+v,[,t-P-^-|.P.o.q0e0n0p1i1m2W2l2n3O4Y4Z4m4q4y5O5Z5n6m6q7Y8`;Z;];p;q;r^:Y8p9O9T9V9Y9Z9]_:Z1U4a6c6d7o7p8zpeOSjy}!n$]%Y%c%f%g%i*o*t/g/jQ%VxR*k%`peOSjy}!n$]%Y%c%f%g%i*o*t/g/jR%VxQ*U%OR.n)}qeOSjy}!n$]%Y%c%f%g%i*o*t/g/jQ.z*ZS3P/O/PW5j2|2}3O3TU7V5l5m5nU8R7U7X7YQ8h8SR8v8iQ%^yR*e%YR3^/XR7_5uS$mp$rR.d)nQ%czR*o%dR*u%jT/h*t/jR*y%kQ*x%kR/q*yQjOQ!nST$`j!nQ(P#sR,u(PQ!YQR%u!YQ!^RU%{!^%|+UQ%|!_R+U%}Q+a&XR/}+aQ,`'OR0r,`Q,c'QS0u,c0vR0v,dQ+m&dR0X+mS!eR$uU&a!e&b+VQ&b!fR+V&OQ+d&[R0P+dQ&u!sQ,R&sU,V&u,R0mR0m,WQ'r#iR,n'rQ#m`R'x#mQ#cZU'h#c+Q9qQ+Q9_R9q'uQ-S(_W1d-S1e4j6lU1e-T-U-VS4j1f1gR6l4k$k(U#t&z'O'i(^(f)P)Q)U+v,Y,Z,[,t,}-O-P-X-^-o-p-|.P.o.q0e0n0o0p0q1U1h1i1m1}2W2l2n3O4Y4Z4_4`4a4f4m4q4w4y5O5Z5n6c6d6e6m6q7Y7o7p7q8`8p8z8|8}9O9T9U9V9Y9Z9]:v;W;X;Y;Z;];p;q;rQ-[(fU1l-[1n4nQ1n-^R4n1mQ(q#zR-i(qQ(z$OR-r(zQ2R-|R4z2RQ){$xR.m){Q2p.tS5_2p6|R6|5`Q*W%PR.w*WQ2v.yR5d2vQ/W*bS3[/W5vR5v3^Q._)jW2a._2c5T6wQ2c.bQ5T2bR6w5UQ)o$mR.e)oQ/j*tR3l/jWiOSj!nQ%h}Q)X$]Q*n%cQ*p%fQ*q%gQ*s%iQ/e*oS/h*t/jR3k/gQ$_gQ%l!RQ%o!TQ%q!UQ%s!VQ)v$sQ)|$yQ*d%^Q*{%nQ-h(pS/Z*e*hQ/r*zQ/s*}Q/t+OS0S+j2sQ2f.hQ2k.oQ3U/QQ3`/]Q3j/fY3w0U0V0]0b5fQ5X2hQ5[2lQ5q3VQ5w3_[6U3v3y3}4P4Q7SQ6x5VQ7Z5rQ7`5xW7f6V6[6^6`Q7x6yQ7{6}Q8U7[U8X7g7l7nQ8c7|Q8j8VS8k8Z8_Q8r8dQ8w8mQ9P8sQ9S8yQ9W9QR9[9XQ$gmQ&i!jU)e$h$i$jQ+Z&UU+{&j&k&lQ-`(kS.Z)f)gQ/z+]Q0R+jS0g+|+}Q1q-dQ2Z.[Q3t0QS3z0W0]Q4V0hQ4r1uS6Y3{4QQ7i6ZQ8[7kR8n8^S#ua;^R({$PU$Oa$P;^R-q(yQ#taS&z!w)aQ'O!yQ'i#dQ(^#vQ(f#yQ)P$TQ)Q$UQ)U$YQ+v&gQ,Y9wQ,Z9zQ,[9}Q,t'}Q,}(WQ-O(YQ-P(ZQ-X(bQ-^(hQ-o(wQ-p(xd-|)].R.{2T3Q4}5k6z7W8TQ.P)_Q.o*OQ.q*RQ0e+yQ0n:UQ0o:XQ0p:[Q0q,_Q1U9rQ1h-YQ1i-ZQ1m-]Q1}-wQ2W.TQ2l.pQ2n.sQ3O.}Q4Y:aQ4Z:dQ4_9yQ4`9|Q4a:PQ4f1aQ4m1kQ4q1sQ4w1yQ4y2QQ5O2XQ5Z2jQ5n3SQ6c:^Q6d:WQ6e:ZQ6m4lQ6q4uQ7Y5pQ7o:cQ7p:fQ7q6iQ8`:jQ8p9dQ8z:lQ8|9xQ8}9{Q9O:OQ9T:VQ9U:YQ9V:]Q9Y:bQ9Z:eQ9]:kQ:v;^Q;W;iQ;X;jQ;Y;kQ;Z;lQ;];nQ;p;tQ;q;uR;r;vlgOSj}!n$]%c%f%g%i*o*t/g/jS!pU%eQ%n!SQ%t!WQ'V!|Q'v#kS*h%[%_Q*l%`Q*z%mQ+W&SQ+u&fQ,r'wQ.O)^Q/b*kQ0d+xQ1[,mQ1{-uQ2V.SQ2}.|Q3b/_Q3c/`Q3e/aQ3g/cQ3n/lQ4d1XQ5Y2iQ5m3RQ5|3fQ6O3hQ6P3iQ7X5oR7b5}!vZOSUj}!S!n!|$]%[%_%`%c%e%f%g%i%m&S&f)^*k*o*t+x-u.S.|/_/`/a/c/g/j/l2i3R3f3h3i5o5}Q!_RQ!oTQ$akS%w!]%zQ%}!`Q&y!vQ'Q!zQ'W#PQ'X#QQ'Y#RQ'Z#SQ'[#TQ']#UQ'^#VQ'_#WQ'`#XQ'a#YQ'b#ZQ'd#]Q'g#bQ'k#eW'u#k'w,m1XQ)p$nS+R%x+TS+^&W/{Q+g&_Q,O&pQ,^&}Q,d'RQ,g9^Q,i9`Q,w(RQ-x)VQ/v+XQ/y+[Q0i,PQ0s,bQ0w9cQ0x9eQ0y9fQ0z9gQ0{9hQ0|9iQ0}9jQ1O9kQ1P9lQ1Q9mQ1R9nQ1S9oQ1T,hQ1W9sQ1]9pQ2O-zQ2[.]Q3s:QQ3v0TQ4W0jQ4[0tQ4]:RQ4b:TQ4c:_Q5`2qQ6S3qQ6V3xQ6b:`Q6f:gQ6g:hQ7g6WQ7z6{Q8Z7jQ8m8]Q8y8oQ9_!WR:|;aR!aRR&Y!bS&U!b+`S+]&V&^R0Q+fR'P!yR'S!zT!tU$ZS!sU$ZU$xrs*mS&s!r!uQ,T&tQ,W&wQ.l)zS0k,S,UR4X0l`!dR!]!`$u%x&`)x+hh!qUrs!r!u$Z&t&w)z,S,U0lQ/d*mQ/w+YQ3p/oT:s&W)yT!gR$uS!fR$uS%y!]&`S&O!`)xS+S%x+hT+_&W)yT&]!b$vQ#i^R'{#nT'q#i'rR1Z,lT(a#v(cR(i#yQ-})]Q2U.RQ2|.{Q4{2TQ5l3QQ6t4}Q7U5kQ7y6zQ8S7WR8i8TlhOSj}!n$]%c%f%g%i*o*t/g/jQ%]yR*d%YV$yrs*mR.u*TR*c%WQ$qpR)u$rR)k$lT%az%dT%bz%dT/i*t/j",nodeNames:"\u26A0 extends ArithOp ArithOp InterpolationStart LineComment BlockComment Script ExportDeclaration export Star as VariableName String from ; default FunctionDeclaration async function VariableDefinition TypeParamList TypeDefinition ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Interpolation null super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression await yield delete LogicOp BitOp ParenthesizedExpression ClassExpression class extends ClassBody MethodDeclaration Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression PrivatePropertyName BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody MethodDeclaration AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement",maxTerm:332,context:Za,nodeProps:[["closedBy",4,"InterpolationEnd",40,"]",51,"}",66,")",132,"JSXSelfCloseEndTag JSXEndTag",146,"JSXEndTag"],["group",-26,8,15,17,58,184,188,191,192,194,197,200,211,213,219,221,223,225,228,234,240,242,244,246,248,250,251,"Statement",-30,12,13,24,27,28,41,43,44,45,47,52,60,68,74,75,91,92,101,103,119,122,124,125,126,127,129,130,148,149,151,"Expression",-22,23,25,29,32,34,152,154,156,157,159,160,161,163,164,165,167,168,169,178,180,182,183,"Type",-3,79,85,90,"ClassItem"],["openedBy",30,"InterpolationStart",46,"[",50,"{",65,"(",131,"JSXStartTag",141,"JSXStartTag JSXStartCloseTag"]],propSources:[qa],skippedNodes:[0,5,6],repeatNodeCount:28,tokenData:"!C}~R!`OX%TXY%cYZ'RZ[%c[]%T]^'R^p%Tpq%cqr'crs(kst0htu2`uv4pvw5ewx6cxyk|}?O}!O>k!O!P?`!P!QCl!Q!R!0[!R![!1q![!]!7s!]!^!8V!^!_!8g!_!`!9d!`!a!:[!a!b!U#R#S2`#S#T!>i#T#o2`#o#p!>y#p#q!?O#q#r!?f#r#s!?x#s$f%T$f$g%c$g#BY2`#BY#BZ!@Y#BZ$IS2`$IS$I_!@Y$I_$I|2`$I|$I}!Bq$I}$JO!Bq$JO$JT2`$JT$JU!@Y$JU$KV2`$KV$KW!@Y$KW&FU2`&FU&FV!@Y&FV?HT2`?HT?HU!@Y?HU~2`W%YR$UWO!^%T!_#o%T#p~%T7Z%jg$UW'Y7ROX%TXY%cYZ%TZ[%c[p%Tpq%cq!^%T!_#o%T#p$f%T$f$g%c$g#BY%T#BY#BZ%c#BZ$IS%T$IS$I_%c$I_$JT%T$JT$JU%c$JU$KV%T$KV$KW%c$KW&FU%T&FU&FV%c&FV?HT%T?HT?HU%c?HU~%T7Z'YR$UW'Z7RO!^%T!_#o%T#p~%T$T'jS$UW!j#{O!^%T!_!`'v!`#o%T#p~%T$O'}S#e#v$UWO!^%T!_!`(Z!`#o%T#p~%T$O(bR#e#v$UWO!^%T!_#o%T#p~%T)X(rZ$UW]#eOY(kYZ)eZr(krs*rs!^(k!^!_+U!_#O(k#O#P-b#P#o(k#o#p+U#p~(k&r)jV$UWOr)ers*Ps!^)e!^!_*a!_#o)e#o#p*a#p~)e&r*WR$P&j$UWO!^%T!_#o%T#p~%T&j*dROr*ars*ms~*a&j*rO$P&j)X*{R$P&j$UW]#eO!^%T!_#o%T#p~%T)P+ZV]#eOY+UYZ*aZr+Urs+ps#O+U#O#P+w#P~+U)P+wO$P&j]#e)P+zROr+Urs,Ts~+U)P,[U$P&j]#eOY,nZr,nrs-Vs#O,n#O#P-[#P~,n#e,sU]#eOY,nZr,nrs-Vs#O,n#O#P-[#P~,n#e-[O]#e#e-_PO~,n)X-gV$UWOr(krs-|s!^(k!^!_+U!_#o(k#o#p+U#p~(k)X.VZ$P&j$UW]#eOY.xYZ%TZr.xrs/rs!^.x!^!_,n!_#O.x#O#P0S#P#o.x#o#p,n#p~.x#m/PZ$UW]#eOY.xYZ%TZr.xrs/rs!^.x!^!_,n!_#O.x#O#P0S#P#o.x#o#p,n#p~.x#m/yR$UW]#eO!^%T!_#o%T#p~%T#m0XT$UWO!^.x!^!_,n!_#o.x#o#p,n#p~.x3]0mZ$UWOt%Ttu1`u!^%T!_!c%T!c!}1`!}#R%T#R#S1`#S#T%T#T#o1`#p$g%T$g~1`3]1g]$UW'o3TOt%Ttu1`u!Q%T!Q![1`![!^%T!_!c%T!c!}1`!}#R%T#R#S1`#S#T%T#T#o1`#p$g%T$g~1`7Z2k_$UW#zS']$y'g3SOt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$g%T$g~2`[3q_$UW#zSOt%Ttu3ju}%T}!O3j!O!Q%T!Q![3j![!^%T!_!c%T!c!}3j!}#R%T#R#S3j#S#T%T#T#o3j#p$g%T$g~3j$O4wS#^#v$UWO!^%T!_!`5T!`#o%T#p~%T$O5[R$UW#o#vO!^%T!_#o%T#p~%T5b5lU'x5Y$UWOv%Tvw6Ow!^%T!_!`5T!`#o%T#p~%T$O6VS$UW#i#vO!^%T!_!`5T!`#o%T#p~%T)X6jZ$UW]#eOY6cYZ7]Zw6cwx*rx!^6c!^!_8T!_#O6c#O#P:T#P#o6c#o#p8T#p~6c&r7bV$UWOw7]wx*Px!^7]!^!_7w!_#o7]#o#p7w#p~7]&j7zROw7wwx*mx~7w)P8YV]#eOY8TYZ7wZw8Twx+px#O8T#O#P8o#P~8T)P8rROw8Twx8{x~8T)P9SU$P&j]#eOY9fZw9fwx-Vx#O9f#O#P9}#P~9f#e9kU]#eOY9fZw9fwx-Vx#O9f#O#P9}#P~9f#e:QPO~9f)X:YV$UWOw6cwx:ox!^6c!^!_8T!_#o6c#o#p8T#p~6c)X:xZ$P&j$UW]#eOY;kYZ%TZw;kwx/rx!^;k!^!_9f!_#O;k#O#PW{!^%T!_!`5T!`#o%T#p~%T$O>_S#[#v$UWO!^%T!_!`5T!`#o%T#p~%T%w>rSj%o$UWO!^%T!_!`5T!`#o%T#p~%T&i?VR!R&a$UWO!^%T!_#o%T#p~%T7Z?gVu5^$UWO!O%T!O!P?|!P!Q%T!Q![@r![!^%T!_#o%T#p~%T!{@RT$UWO!O%T!O!P@b!P!^%T!_#o%T#p~%T!{@iR!Q!s$UWO!^%T!_#o%T#p~%T!{@yZ$UWk!sO!Q%T!Q![@r![!^%T!_!g%T!g!hAl!h#R%T#R#S@r#S#X%T#X#YAl#Y#o%T#p~%T!{AqZ$UWO{%T{|Bd|}%T}!OBd!O!Q%T!Q![CO![!^%T!_#R%T#R#SCO#S#o%T#p~%T!{BiV$UWO!Q%T!Q![CO![!^%T!_#R%T#R#SCO#S#o%T#p~%T!{CVV$UWk!sO!Q%T!Q![CO![!^%T!_#R%T#R#SCO#S#o%T#p~%T7ZCs`$UW#]#vOYDuYZ%TZzDuz{Jl{!PDu!P!Q!-e!Q!^Du!^!_Fx!_!`!.^!`!a!/]!a!}Du!}#OHq#O#PJQ#P#oDu#o#pFx#p~DuXD|[$UW}POYDuYZ%TZ!PDu!P!QEr!Q!^Du!^!_Fx!_!}Du!}#OHq#O#PJQ#P#oDu#o#pFx#p~DuXEy_$UW}PO!^%T!_#Z%T#Z#[Er#[#]%T#]#^Er#^#a%T#a#bEr#b#g%T#g#hEr#h#i%T#i#jEr#j#m%T#m#nEr#n#o%T#p~%TPF}V}POYFxZ!PFx!P!QGd!Q!}Fx!}#OG{#O#PHh#P~FxPGiU}P#Z#[Gd#]#^Gd#a#bGd#g#hGd#i#jGd#m#nGdPHOTOYG{Z#OG{#O#PH_#P#QFx#Q~G{PHbQOYG{Z~G{PHkQOYFxZ~FxXHvY$UWOYHqYZ%TZ!^Hq!^!_G{!_#OHq#O#PIf#P#QDu#Q#oHq#o#pG{#p~HqXIkV$UWOYHqYZ%TZ!^Hq!^!_G{!_#oHq#o#pG{#p~HqXJVV$UWOYDuYZ%TZ!^Du!^!_Fx!_#oDu#o#pFx#p~Du7ZJs^$UW}POYJlYZKoZzJlz{NQ{!PJl!P!Q!,R!Q!^Jl!^!_!!]!_!}Jl!}#O!'|#O#P!+a#P#oJl#o#p!!]#p~Jl7ZKtV$UWOzKoz{LZ{!^Ko!^!_M]!_#oKo#o#pM]#p~Ko7ZL`X$UWOzKoz{LZ{!PKo!P!QL{!Q!^Ko!^!_M]!_#oKo#o#pM]#p~Ko7ZMSR$UWU7RO!^%T!_#o%T#p~%T7RM`ROzM]z{Mi{~M]7RMlTOzM]z{Mi{!PM]!P!QM{!Q~M]7RNQOU7R7ZNX^$UW}POYJlYZKoZzJlz{NQ{!PJl!P!Q! T!Q!^Jl!^!_!!]!_!}Jl!}#O!'|#O#P!+a#P#oJl#o#p!!]#p~Jl7Z! ^_$UWU7R}PO!^%T!_#Z%T#Z#[Er#[#]%T#]#^Er#^#a%T#a#bEr#b#g%T#g#hEr#h#i%T#i#jEr#j#m%T#m#nEr#n#o%T#p~%T7R!!bY}POY!!]YZM]Zz!!]z{!#Q{!P!!]!P!Q!&x!Q!}!!]!}#O!$`#O#P!&f#P~!!]7R!#VY}POY!!]YZM]Zz!!]z{!#Q{!P!!]!P!Q!#u!Q!}!!]!}#O!$`#O#P!&f#P~!!]7R!#|UU7R}P#Z#[Gd#]#^Gd#a#bGd#g#hGd#i#jGd#m#nGd7R!$cWOY!$`YZM]Zz!$`z{!${{#O!$`#O#P!&S#P#Q!!]#Q~!$`7R!%OYOY!$`YZM]Zz!$`z{!${{!P!$`!P!Q!%n!Q#O!$`#O#P!&S#P#Q!!]#Q~!$`7R!%sTU7ROYG{Z#OG{#O#PH_#P#QFx#Q~G{7R!&VTOY!$`YZM]Zz!$`z{!${{~!$`7R!&iTOY!!]YZM]Zz!!]z{!#Q{~!!]7R!&}_}POzM]z{Mi{#ZM]#Z#[!&x#[#]M]#]#^!&x#^#aM]#a#b!&x#b#gM]#g#h!&x#h#iM]#i#j!&x#j#mM]#m#n!&x#n~M]7Z!(R[$UWOY!'|YZKoZz!'|z{!(w{!^!'|!^!_!$`!_#O!'|#O#P!*o#P#QJl#Q#o!'|#o#p!$`#p~!'|7Z!(|^$UWOY!'|YZKoZz!'|z{!(w{!P!'|!P!Q!)x!Q!^!'|!^!_!$`!_#O!'|#O#P!*o#P#QJl#Q#o!'|#o#p!$`#p~!'|7Z!*PY$UWU7ROYHqYZ%TZ!^Hq!^!_G{!_#OHq#O#PIf#P#QDu#Q#oHq#o#pG{#p~Hq7Z!*tX$UWOY!'|YZKoZz!'|z{!(w{!^!'|!^!_!$`!_#o!'|#o#p!$`#p~!'|7Z!+fX$UWOYJlYZKoZzJlz{NQ{!^Jl!^!_!!]!_#oJl#o#p!!]#p~Jl7Z!,Yc$UW}POzKoz{LZ{!^Ko!^!_M]!_#ZKo#Z#[!,R#[#]Ko#]#^!,R#^#aKo#a#b!,R#b#gKo#g#h!,R#h#iKo#i#j!,R#j#mKo#m#n!,R#n#oKo#o#pM]#p~Ko7Z!-lV$UWT7ROY!-eYZ%TZ!^!-e!^!_!.R!_#o!-e#o#p!.R#p~!-e7R!.WQT7ROY!.RZ~!.R$P!.g[$UW#o#v}POYDuYZ%TZ!PDu!P!QEr!Q!^Du!^!_Fx!_!}Du!}#OHq#O#PJQ#P#oDu#o#pFx#p~Du]!/f[#wS$UW}POYDuYZ%TZ!PDu!P!QEr!Q!^Du!^!_Fx!_!}Du!}#OHq#O#PJQ#P#oDu#o#pFx#p~Du!{!0cd$UWk!sO!O%T!O!P@r!P!Q%T!Q![!1q![!^%T!_!g%T!g!hAl!h#R%T#R#S!1q#S#U%T#U#V!3X#V#X%T#X#YAl#Y#b%T#b#c!2w#c#d!4m#d#l%T#l#m!5{#m#o%T#p~%T!{!1x_$UWk!sO!O%T!O!P@r!P!Q%T!Q![!1q![!^%T!_!g%T!g!hAl!h#R%T#R#S!1q#S#X%T#X#YAl#Y#b%T#b#c!2w#c#o%T#p~%T!{!3OR$UWk!sO!^%T!_#o%T#p~%T!{!3^W$UWO!Q%T!Q!R!3v!R!S!3v!S!^%T!_#R%T#R#S!3v#S#o%T#p~%T!{!3}Y$UWk!sO!Q%T!Q!R!3v!R!S!3v!S!^%T!_#R%T#R#S!3v#S#b%T#b#c!2w#c#o%T#p~%T!{!4rV$UWO!Q%T!Q!Y!5X!Y!^%T!_#R%T#R#S!5X#S#o%T#p~%T!{!5`X$UWk!sO!Q%T!Q!Y!5X!Y!^%T!_#R%T#R#S!5X#S#b%T#b#c!2w#c#o%T#p~%T!{!6QZ$UWO!Q%T!Q![!6s![!^%T!_!c%T!c!i!6s!i#R%T#R#S!6s#S#T%T#T#Z!6s#Z#o%T#p~%T!{!6z]$UWk!sO!Q%T!Q![!6s![!^%T!_!c%T!c!i!6s!i#R%T#R#S!6s#S#T%T#T#Z!6s#Z#b%T#b#c!2w#c#o%T#p~%T$u!7|R!]V$UW#m$fO!^%T!_#o%T#p~%T!q!8^R_!i$UWO!^%T!_#o%T#p~%T5w!8rR'bd!a/n#x&s'|P!P!Q!8{!^!_!9Q!_!`!9_W!9QO$WW#v!9VP#`#v!_!`!9Y#v!9_O#o#v#v!9dO#a#v$u!9kT!{$m$UWO!^%T!_!`'v!`!a!9z!a#o%T#p~%T$P!:RR#W#w$UWO!^%T!_#o%T#p~%T%V!:gT'a!R#a#v$RS$UWO!^%T!_!`!:v!`!a!;W!a#o%T#p~%T$O!:}R#a#v$UWO!^%T!_#o%T#p~%T$O!;_T#`#v$UWO!^%T!_!`5T!`!a!;n!a#o%T#p~%T$O!;uS#`#v$UWO!^%T!_!`5T!`#o%T#p~%T*a!]S#g#v$UWO!^%T!_!`5T!`#o%T#p~%T$a!>pR$UW'f$XO!^%T!_#o%T#p~%T~!?OO!T~5b!?VT'w5Y$UWO!^%T!_!`5T!`#o%T#p#q!=P#q~%T6X!?oR!S5}nQ$UWO!^%T!_#o%T#p~%TX!@PR!kP$UWO!^%T!_#o%T#p~%T7Z!@gr$UW'Y7R#zS']$y'g3SOX%TXY%cYZ%TZ[%c[p%Tpq%cqt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$f%T$f$g%c$g#BY2`#BY#BZ!@Y#BZ$IS2`$IS$I_!@Y$I_$JT2`$JT$JU!@Y$JU$KV2`$KV$KW!@Y$KW&FU2`&FU&FV!@Y&FV?HT2`?HT?HU!@Y?HU~2`7Z!CO_$UW'Z7R#zS']$y'g3SOt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$g%T$g~2`",tokenizers:[va,ja,wa,_a,0,1,2,3,4,5,6,7,8,9,Wa],topRules:{Script:[0,7]},dialects:{jsx:12107,ts:12109},dynamicPrecedences:{149:1,176:1},specialized:[{term:289,get:t=>za[t]||-1},{term:299,get:t=>Ga[t]||-1},{term:63,get:t=>Ca[t]||-1}],tokenPrec:12130}),Ya=[m("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),m("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),m("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),m("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),m("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),m(`try { +import{S as me,i as Te,s as Se,e as be,f as Pe,M as SO,g as Re,y as bO,o as xe,I as ke,K as Xe,L as ye}from"./index.f4f9f1ef.js";import{P as Ze,N as We,u as je,D as we,v as oO,T as C,I as KO,w as lO,x as o,y as _e,L as QO,z as cO,A as U,B as uO,F as HO,G as dO,H as v,J as ve,K as qe,E as X,M as _,O as ze,Q as Ge,R as m,U as Ce,a as W,h as Ue,b as Ye,c as Ve,d as Ee,e as Ie,s as Ae,f as Ne,g as De,i as Le,r as Fe,j as Je,k as Me,l as Be,m as Ke,n as He,o as Ot,p as et,q as tt,t as PO,C as q}from"./index.afc1faa1.js";class I{constructor(O,e,a,i,r,s,n,Q,u,d=0,l){this.p=O,this.stack=e,this.state=a,this.reducePos=i,this.pos=r,this.score=s,this.buffer=n,this.bufferBase=Q,this.curContext=u,this.lookAhead=d,this.parent=l}toString(){return`[${this.stack.filter((O,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,e,a=0){let i=O.parser.context;return new I(O,[],e,a,a,0,[],0,i?new RO(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=O}reduce(O){let e=O>>19,a=O&65535,{parser:i}=this.p,r=i.dynamicPrecedence(a);if(r&&(this.score+=r),e==0){this.pushState(i.getGoto(this.state,a,!0),this.reducePos),as;)this.stack.pop();this.reduceContext(a,n)}storeNode(O,e,a,i=4,r=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[n-4]==0&&s.buffer[n-1]>-1){if(e==a)return;if(s.buffer[n-2]>=e){s.buffer[n-2]=a;return}}}if(!r||this.pos==a)this.buffer.push(O,e,a,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>a;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4);this.buffer[s]=O,this.buffer[s+1]=e,this.buffer[s+2]=a,this.buffer[s+3]=i}}shift(O,e,a){let i=this.pos;if(O&131072)this.pushState(O&65535,this.pos);else if((O&262144)==0){let r=O,{parser:s}=this.p;(a>this.pos||e<=s.maxNode)&&(this.pos=a,s.stateFlag(r,1)||(this.reducePos=a)),this.pushState(r,i),this.shiftContext(e,i),e<=s.maxNode&&this.buffer.push(e,i,a,4)}else this.pos=a,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,a,4)}apply(O,e,a){O&65536?this.reduce(O):this.shift(O,e,a)}useNode(O,e){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let i=this.pos;this.reducePos=this.pos=i+O.length,this.pushState(e,i),this.buffer.push(a,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,e=O.buffer.length;for(;e>0&&O.buffer[e-2]>O.reducePos;)e-=4;let a=O.buffer.slice(e),i=O.bufferBase+e;for(;O&&i==O.bufferBase;)O=O.parent;return new I(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,i,this.curContext,this.lookAhead,O)}recoverByDelete(O,e){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,e,4),this.storeNode(0,this.pos,e,a?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(O){for(let e=new at(this);;){let a=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,O);if((a&65536)==0)return!0;if(a==0)return!1;e.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>4<<1||this.stack.length>=120){let i=[];for(let r=0,s;rQ&1&&n==s)||i.push(e[r],s)}e=i}let a=[];for(let i=0;i>19,i=O&65535,r=this.stack.length-a*3;if(r<0||e.getGoto(this.stack[r],i,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(O),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let e=0;ethis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class RO{constructor(O,e){this.tracker=O,this.context=e,this.hash=O.strict?O.hash(e):0}}var xO;(function(t){t[t.Insert=200]="Insert",t[t.Delete=190]="Delete",t[t.Reduce=100]="Reduce",t[t.MaxNext=4]="MaxNext",t[t.MaxInsertStackDepth=300]="MaxInsertStackDepth",t[t.DampenInsertStackDepth=120]="DampenInsertStackDepth"})(xO||(xO={}));class at{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let e=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=i}}class A{constructor(O,e,a){this.stack=O,this.pos=e,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,e=O.bufferBase+O.buffer.length){return new A(O,e,e-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new A(this.stack,this.pos,this.index)}}class Y{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const kO=new Y;class it{constructor(O,e){this.input=O,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=kO,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(O,e){let a=this.range,i=this.rangeIndex,r=this.pos+O;for(;ra.to:r>=a.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];r+=s.from-a.to,a=s}return r}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,e.from);return this.end}peek(O){let e=this.chunkOff+O,a,i;if(e>=0&&e=this.chunk2Pos&&an.to&&(this.chunk2=this.chunk2.slice(0,n.to-a)),i=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),i}acceptToken(O,e=0){let a=e?this.resolveOffset(e,-1):this.pos;if(a==null||a=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,e){if(e?(this.token=e,e.start=O,e.lookAhead=O+1,e.value=e.extended=-1):this.token=kO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,e-this.chunkPos);if(O>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,e-this.chunk2Pos);if(O>=this.range.from&&e<=this.range.to)return this.input.read(O,e);let a="";for(let i of this.ranges){if(i.from>=e)break;i.to>O&&(a+=this.input.read(Math.max(i.from,O),Math.min(i.to,e)))}return a}}class V{constructor(O,e){this.data=O,this.id=e}token(O,e){rt(this.data,O,e,this.id)}}V.prototype.contextual=V.prototype.fallback=V.prototype.extend=!1;class S{constructor(O,e={}){this.token=O,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function rt(t,O,e,a){let i=0,r=1<0){let h=t[$];if(n.allows(h)&&(O.token.value==-1||O.token.value==h||s.overrides(h,O.token.value))){O.acceptToken(h);break}}let u=O.next,d=0,l=t[i+2];if(O.next<0&&l>d&&t[Q+l*3-3]==65535){i=t[Q+l*3-1];continue O}for(;d>1,h=Q+$+($<<1),p=t[h],b=t[h+1];if(u=b)d=$+1;else{i=t[h+2],O.advance();continue O}}break}}function z(t,O=Uint16Array){if(typeof t!="string")return t;let e=null;for(let a=0,i=0;a=92&&s--,s>=34&&s--;let Q=s-32;if(Q>=46&&(Q-=46,n=!0),r+=Q,n)break;r*=46}e?e[i++]=r:e=new O(r)}return e}const T=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let M=null;var XO;(function(t){t[t.Margin=25]="Margin"})(XO||(XO={}));function yO(t,O,e){let a=t.cursor(KO.IncludeAnonymous);for(a.moveTo(O);;)if(!(e<0?a.childBefore(O):a.childAfter(O)))for(;;){if((e<0?a.toO)&&!a.type.isError)return e<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(t.length,Math.max(a.from+1,O+25));if(e<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return e<0?0:t.length}}class st{constructor(O,e){this.fragments=O,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?yO(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?yO(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=s,null;if(r instanceof C){if(s==O){if(s=Math.max(this.safeFrom,O)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[e]++,this.nextStart=s+r.length}}}class nt{constructor(O,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new Y)}getActions(O){let e=0,a=null,{parser:i}=O.p,{tokenizers:r}=i,s=i.stateSlot(O.state,3),n=O.curContext?O.curContext.hash:0,Q=0;for(let u=0;ul.end+25&&(Q=Math.max(l.lookAhead,Q)),l.value!=0)){let $=e;if(l.extended>-1&&(e=this.addActions(O,l.extended,l.end,e)),e=this.addActions(O,l.value,l.end,e),!d.extend&&(a=l,e>$))break}}for(;this.actions.length>e;)this.actions.pop();return Q&&O.setLookAhead(Q),!a&&O.pos==this.stream.end&&(a=new Y,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,e=this.addActions(O,a.value,a.end,e)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let e=new Y,{pos:a,p:i}=O;return e.start=a,e.end=Math.min(a+1,i.stream.end),e.value=a==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(O,e,a){let i=this.stream.clipPos(a.pos);if(e.token(this.stream.reset(i,O),a),O.value>-1){let{parser:r}=a.p;for(let s=0;s=0&&a.p.parser.dialect.allows(n>>1)){(n&1)==0?O.value=n>>1:O.extended=n>>1;break}}}else O.value=0,O.end=this.stream.clipPos(i+1)}putAction(O,e,a,i){for(let r=0;rO.bufferLength*4?new st(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,e=this.minStackPos,a=this.stacks=[],i,r;for(let s=0;se)a.push(n);else{if(this.advanceStack(n,a,O))continue;{i||(i=[],r=[]),i.push(n);let Q=this.tokens.getMainToken(n);r.push(Q.value,Q.end)}}break}}if(!a.length){let s=i&&Qt(i);if(s)return this.stackToTree(s);if(this.parser.strict)throw T&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+e);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,r,a);if(s)return this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(a.length>s)for(a.sort((n,Q)=>Q.score-n.score);a.length>s;)a.pop();a.some(n=>n.reducePos>e)&&this.recovering--}else if(a.length>1){O:for(let s=0;s500&&u.buffer.length>500)if((n.score-u.score||n.buffer.length-u.buffer.length)>0)a.splice(Q--,1);else{a.splice(s--,1);continue O}}}}this.minStackPos=a[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let u=O.curContext&&O.curContext.tracker.strict,d=u?O.curContext.hash:0;for(let l=this.fragments.nodeAt(i);l;){let $=this.parser.nodeSet.types[l.type.id]==l.type?r.getGoto(O.state,l.type.id):-1;if($>-1&&l.length&&(!u||(l.prop(oO.contextHash)||0)==d))return O.useNode(l,$),T&&console.log(s+this.stackID(O)+` (via reuse of ${r.getName(l.type.id)})`),!0;if(!(l instanceof C)||l.children.length==0||l.positions[0]>0)break;let h=l.children[0];if(h instanceof C&&l.positions[0]==0)l=h;else break}}let n=r.stateSlot(O.state,4);if(n>0)return O.reduce(n),T&&console.log(s+this.stackID(O)+` (via always-reduce ${r.getName(n&65535)})`),!0;if(O.stack.length>=15e3)for(;O.stack.length>9e3&&O.forceReduce(););let Q=this.tokens.getActions(O);for(let u=0;ui?e.push(p):a.push(p)}return!1}advanceFully(O,e){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return WO(O,e),!0}}runRecovery(O,e,a){let i=null,r=!1;for(let s=0;s ":"";if(n.deadEnd&&(r||(r=!0,n.restart(),T&&console.log(d+this.stackID(n)+" (restarted)"),this.advanceFully(n,a))))continue;let l=n.split(),$=d;for(let h=0;l.forceReduce()&&h<10&&(T&&console.log($+this.stackID(l)+" (via force-reduce)"),!this.advanceFully(l,a));h++)T&&($=this.stackID(l)+" -> ");for(let h of n.recoverByInsert(Q))T&&console.log(d+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,a);this.stream.end>n.pos?(u==n.pos&&(u++,Q=0),n.recoverByDelete(Q,u),T&&console.log(d+this.stackID(n)+` (via recover-delete ${this.parser.getName(Q)})`),WO(n,a)):(!i||i.scoret;class Oe{constructor(O){this.start=O.start,this.shift=O.shift||B,this.reduce=O.reduce||B,this.reuse=O.reuse||B,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class y extends Ze{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (${14})`);let e=O.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let n=0;nO.topRules[n][1]),i=[];for(let n=0;n=0)r(d,Q,n[u++]);else{let l=n[u+-d];for(let $=-d;$>0;$--)r(n[u++],Q,l);u++}}}this.nodeSet=new We(e.map((n,Q)=>je.define({name:Q>=this.minRepeatTerm?void 0:n,id:Q,props:i[Q],top:a.indexOf(Q)>-1,error:Q==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(Q)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=we;let s=z(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let n=0;ntypeof n=="number"?new V(s,n):n),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,e,a){let i=new ot(this,O,e,a);for(let r of this.wrappers)i=r(i,O,e,a);return i}getGoto(O,e,a=!1){let i=this.goto;if(e>=i[0])return-1;for(let r=i[e+1];;){let s=i[r++],n=s&1,Q=i[r++];if(n&&a)return Q;for(let u=r+(s>>1);r0}validAction(O,e){if(e==this.stateSlot(O,4))return!0;for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=R(this.data,a+2);else return!1;if(e==R(this.data,a+1))return!0}}nextStates(O){let e=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=R(this.data,a+2);else break;if((this.data[a+2]&1)==0){let i=this.data[a+1];e.some((r,s)=>s&1&&r==i)||e.push(this.data[a],i)}}return e}overrides(O,e){let a=jO(this.data,this.tokenPrecTable,e);return a<0||jO(this.data,this.tokenPrecTable,O){let i=O.tokenizers.find(r=>r.from==a);return i?i.to:a})),O.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((a,i)=>{let r=O.specializers.find(n=>n.from==a.external);if(!r)return a;let s=Object.assign(Object.assign({},a),{external:r.to});return e.specializers[i]=wO(s),s})),O.contextTracker&&(e.context=O.contextTracker),O.dialect&&(e.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(e.strict=O.strict),O.wrap&&(e.wrappers=e.wrappers.concat(O.wrap)),O.bufferLength!=null&&(e.bufferLength=O.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let e=this.dynamicPrecedences;return e==null?0:e[O]||0}parseDialect(O){let e=Object.keys(this.dialects),a=e.map(()=>!1);if(O)for(let r of O.split(" ")){let s=e.indexOf(r);s>=0&&(a[s]=!0)}let i=null;for(let r=0;ra)&&e.p.parser.stateFlag(e.state,2)&&(!O||O.scoret.external(e,a)<<1|O}return t.get}const ct=53,ut=1,dt=54,$t=2,ht=55,pt=3,N=4,ee=5,te=6,ae=7,ie=8,ft=9,gt=10,mt=11,K=56,Tt=12,_O=57,St=18,bt=27,Pt=30,Rt=33,xt=35,kt=0,Xt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},yt={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},vO={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Zt(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}function re(t){return t==9||t==10||t==13||t==32}let qO=null,zO=null,GO=0;function rO(t,O){let e=t.pos+O;if(GO==e&&zO==t)return qO;let a=t.peek(O);for(;re(a);)a=t.peek(++O);let i="";for(;Zt(a);)i+=String.fromCharCode(a),a=t.peek(++O);return zO=t,GO=e,qO=i?i.toLowerCase():a==Wt||a==jt?void 0:null}const se=60,ne=62,oe=47,Wt=63,jt=33,wt=45;function CO(t,O){this.name=t,this.parent=O,this.hash=O?O.hash:0;for(let e=0;e-1?new CO(rO(a,1)||"",t):t},reduce(t,O){return O==St&&t?t.parent:t},reuse(t,O,e,a){let i=O.type.id;return i==N||i==xt?new CO(rO(a,1)||"",t):t},hash(t){return t?t.hash:0},strict:!1}),qt=new S((t,O)=>{if(t.next!=se){t.next<0&&O.context&&t.acceptToken(K);return}t.advance();let e=t.next==oe;e&&t.advance();let a=rO(t,0);if(a===void 0)return;if(!a)return t.acceptToken(e?Tt:N);let i=O.context?O.context.name:null;if(e){if(a==i)return t.acceptToken(ft);if(i&&yt[i])return t.acceptToken(K,-2);if(O.dialectEnabled(kt))return t.acceptToken(gt);for(let r=O.context;r;r=r.parent)if(r.name==a)return;t.acceptToken(mt)}else{if(a=="script")return t.acceptToken(ee);if(a=="style")return t.acceptToken(te);if(a=="textarea")return t.acceptToken(ae);if(Xt.hasOwnProperty(a))return t.acceptToken(ie);i&&vO[i]&&vO[i][a]?t.acceptToken(K,-1):t.acceptToken(N)}},{contextual:!0}),zt=new S(t=>{for(let O=0,e=0;;e++){if(t.next<0){e&&t.acceptToken(_O);break}if(t.next==wt)O++;else if(t.next==ne&&O>=2){e>3&&t.acceptToken(_O,-2);break}else O=0;t.advance()}});function $O(t,O,e){let a=2+t.length;return new S(i=>{for(let r=0,s=0,n=0;;n++){if(i.next<0){n&&i.acceptToken(O);break}if(r==0&&i.next==se||r==1&&i.next==oe||r>=2&&rs?i.acceptToken(O,-s):i.acceptToken(e,-(s-2));break}else if((i.next==10||i.next==13)&&n){i.acceptToken(O,1);break}else r=s=0;i.advance()}})}const Gt=$O("script",ct,ut),Ct=$O("style",dt,$t),Ut=$O("textarea",ht,pt),Yt=lO({"Text RawText":o.content,"StartTag StartCloseTag SelfCloserEndTag EndTag SelfCloseEndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),Vt=y.deserialize({version:14,states:",xOVOxOOO!WQ!bO'#CoO!]Q!bO'#CyO!bQ!bO'#C|O!gQ!bO'#DPO!lQ!bO'#DRO!qOXO'#CnO!|OYO'#CnO#XO[O'#CnO$eOxO'#CnOOOW'#Cn'#CnO$lO!rO'#DSO$tQ!bO'#DUO$yQ!bO'#DVOOOW'#Dj'#DjOOOW'#DX'#DXQVOxOOO%OQ#tO,59ZO%WQ#tO,59eO%`Q#tO,59hO%hQ#tO,59kO%pQ#tO,59mOOOX'#D]'#D]O%xOXO'#CwO&TOXO,59YOOOY'#D^'#D^O&]OYO'#CzO&hOYO,59YOOO['#D_'#D_O&pO[O'#C}O&{O[O,59YOOOW'#D`'#D`O'TOxO,59YO'[Q!bO'#DQOOOW,59Y,59YOOO`'#Da'#DaO'aO!rO,59nOOOW,59n,59nO'iQ!bO,59pO'nQ!bO,59qOOOW-E7V-E7VO'sQ#tO'#CqOOQO'#DY'#DYO(OQ#tO1G.uOOOX1G.u1G.uO(WQ#tO1G/POOOY1G/P1G/PO(`Q#tO1G/SOOO[1G/S1G/SO(hQ#tO1G/VOOOW1G/V1G/VO(pQ#tO1G/XOOOW1G/X1G/XOOOX-E7Z-E7ZO(xQ!bO'#CxOOOW1G.t1G.tOOOY-E7[-E7[O(}Q!bO'#C{OOO[-E7]-E7]O)SQ!bO'#DOOOOW-E7^-E7^O)XQ!bO,59lOOO`-E7_-E7_OOOW1G/Y1G/YOOOW1G/[1G/[OOOW1G/]1G/]O)^Q&jO,59]OOQO-E7W-E7WOOOX7+$a7+$aOOOY7+$k7+$kOOO[7+$n7+$nOOOW7+$q7+$qOOOW7+$s7+$sO)iQ!bO,59dO)nQ!bO,59gO)sQ!bO,59jOOOW1G/W1G/WO)xO,UO'#CtO*ZO7[O'#CtOOQO1G.w1G.wOOOW1G/O1G/OOOOW1G/R1G/ROOOW1G/U1G/UOOOO'#DZ'#DZO*lO,UO,59`OOQO,59`,59`OOOO'#D['#D[O*}O7[O,59`OOOO-E7X-E7XOOQO1G.z1G.zOOOO-E7Y-E7Y",stateData:"+h~O!]OS~OSSOTPOUQOVROWTOY]OZ[O[^O^^O_^O`^Oa^Ow^Oz_O!cZO~OdaO~OdbO~OdcO~OddO~OdeO~O!VfOPkP!YkP~O!WiOQnP!YnP~O!XlORqP!YqP~OSSOTPOUQOVROWTOXqOY]OZ[O[^O^^O_^O`^Oa^Ow^O!cZO~O!YrO~P#dO!ZsO!duO~OdvO~OdwO~OfyOj|O~OfyOj!OO~OfyOj!QO~OfyOj!SO~OfyOj!UO~O!VfOPkX!YkX~OP!WO!Y!XO~O!WiOQnX!YnX~OQ!ZO!Y!XO~O!XlORqX!YqX~OR!]O!Y!XO~O!Y!XO~P#dOd!_O~O!ZsO!d!aO~Oj!bO~Oj!cO~Og!dOfeXjeX~OfyOj!fO~OfyOj!gO~OfyOj!hO~OfyOj!iO~OfyOj!jO~Od!kO~Od!lO~Od!mO~Oj!nO~Oi!qO!_!oO!a!pO~Oj!rO~Oj!sO~Oj!tO~O_!uO`!uOa!uO!_!wO!`!uO~O_!xO`!xOa!xO!a!wO!b!xO~O_!uO`!uOa!uO!_!{O!`!uO~O_!xO`!xOa!xO!a!{O!b!xO~O`_a!cwz!c~",goto:"%o!_PPPPPPPPPPPPPPPPPP!`!fP!lPP!xPP!{#O#R#X#[#_#e#h#k#q#w!`P!`!`P#}$T$k$q$w$}%T%Z%aPPPPPPPP%gX^OX`pXUOX`pezabcde{}!P!R!TR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!TeZ!e{}!P!R!TQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue EndTag ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:66,context:vt,nodeProps:[["closedBy",-11,1,2,3,4,5,6,7,8,9,10,11,"EndTag",-4,19,29,32,35,"CloseTag"],["group",-9,12,15,16,17,18,38,39,40,41,"Entity",14,"Entity TextContent",-3,27,30,33,"TextContent Entity"],["openedBy",26,"StartTag StartCloseTag",-4,28,31,34,36,"OpenTag"]],propSources:[Yt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!#b!aR!WOX$kXY)sYZ)sZ]$k]^)s^p$kpq)sqr$krs*zsv$kvw+dwx2yx}$k}!O3f!O!P$k!P!Q7_!Q![$k![!]8u!]!^$k!^!_>b!_!`!!p!`!a8T!a!c$k!c!}8u!}#R$k#R#S8u#S#T$k#T#o8u#o$f$k$f$g&R$g%W$k%W%o8u%o%p$k%p&a8u&a&b$k&b1p8u1p4U$k4U4d8u4d4e$k4e$IS8u$IS$I`$k$I`$Ib8u$Ib$Kh$k$Kh%#t8u%#t&/x$k&/x&Et8u&Et&FV$k&FV;'S8u;'S;:jiW!``!bpOq(kqr?Rrs'gsv(kwx(]x!a(k!a!bKj!b~(k!R?YZ!``!bpOr(krs'gsv(kwx(]x}(k}!O?{!O!f(k!f!gAR!g#W(k#W#XGz#X~(k!R@SV!``!bpOr(krs'gsv(kwx(]x}(k}!O@i!O~(k!R@rT!``!bp!cPOr(krs'gsv(kwx(]x~(k!RAYV!``!bpOr(krs'gsv(kwx(]x!q(k!q!rAo!r~(k!RAvV!``!bpOr(krs'gsv(kwx(]x!e(k!e!fB]!f~(k!RBdV!``!bpOr(krs'gsv(kwx(]x!v(k!v!wBy!w~(k!RCQV!``!bpOr(krs'gsv(kwx(]x!{(k!{!|Cg!|~(k!RCnV!``!bpOr(krs'gsv(kwx(]x!r(k!r!sDT!s~(k!RD[V!``!bpOr(krs'gsv(kwx(]x!g(k!g!hDq!h~(k!RDxW!``!bpOrDqrsEbsvDqvwEvwxFfx!`Dq!`!aGb!a~DqqEgT!bpOvEbvxEvx!`Eb!`!aFX!a~EbPEyRO!`Ev!`!aFS!a~EvPFXOzPqF`Q!bpzPOv'gx~'gaFkV!``OrFfrsEvsvFfvwEvw!`Ff!`!aGQ!a~FfaGXR!``zPOr(]sv(]w~(]!RGkT!``!bpzPOr(krs'gsv(kwx(]x~(k!RHRV!``!bpOr(krs'gsv(kwx(]x#c(k#c#dHh#d~(k!RHoV!``!bpOr(krs'gsv(kwx(]x#V(k#V#WIU#W~(k!RI]V!``!bpOr(krs'gsv(kwx(]x#h(k#h#iIr#i~(k!RIyV!``!bpOr(krs'gsv(kwx(]x#m(k#m#nJ`#n~(k!RJgV!``!bpOr(krs'gsv(kwx(]x#d(k#d#eJ|#e~(k!RKTV!``!bpOr(krs'gsv(kwx(]x#X(k#X#YDq#Y~(k!RKqW!``!bpOrKjrsLZsvKjvwLowxNPx!aKj!a!b! g!b~KjqL`T!bpOvLZvxLox!aLZ!a!bM^!b~LZPLrRO!aLo!a!bL{!b~LoPMORO!`Lo!`!aMX!a~LoPM^OwPqMcT!bpOvLZvxLox!`LZ!`!aMr!a~LZqMyQ!bpwPOv'gx~'gaNUV!``OrNPrsLosvNPvwLow!aNP!a!bNk!b~NPaNpV!``OrNPrsLosvNPvwLow!`NP!`!a! V!a~NPa! ^R!``wPOr(]sv(]w~(]!R! nW!``!bpOrKjrsLZsvKjvwLowxNPx!`Kj!`!a!!W!a~Kj!R!!aT!``!bpwPOr(krs'gsv(kwx(]x~(k!V!!{VgS^P!``!bpOr&Rrs&qsv&Rwx'rx!^&R!^!_(k!_~&R",tokenizers:[Gt,Ct,Ut,qt,zt,0,1,2,3,4,5],topRules:{Document:[0,13]},dialects:{noMatch:0},tokenPrec:476});function Et(t,O){let e=Object.create(null);for(let a of t.firstChild.getChildren("Attribute")){let i=a.getChild("AttributeName"),r=a.getChild("AttributeValue")||a.getChild("UnquotedAttributeValue");i&&(e[O.read(i.from,i.to)]=r?r.name=="AttributeValue"?O.read(r.from+1,r.to-1):O.read(r.from,r.to):"")}return e}function H(t,O,e){let a;for(let i of e)if(!i.attrs||i.attrs(a||(a=Et(t.node.parent,O))))return{parser:i.parser};return null}function It(t){let O=[],e=[],a=[];for(let i of t){let r=i.tag=="script"?O:i.tag=="style"?e:i.tag=="textarea"?a:null;if(!r)throw new RangeError("Only script, style, and textarea tags can host nested parsers");r.push(i)}return _e((i,r)=>{let s=i.type.id;return s==bt?H(i,r,O):s==Pt?H(i,r,e):s==Rt?H(i,r,a):null})}const At=93,UO=1,Nt=94,Dt=95,YO=2,le=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Lt=58,Ft=40,Qe=95,Jt=91,E=45,Mt=46,Bt=35,Kt=37;function D(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function Ht(t){return t>=48&&t<=57}const Oa=new S((t,O)=>{for(let e=!1,a=0,i=0;;i++){let{next:r}=t;if(D(r)||r==E||r==Qe||e&&Ht(r))!e&&(r!=E||i>0)&&(e=!0),a===i&&r==E&&a++,t.advance();else{e&&t.acceptToken(r==Ft?Nt:a==2&&O.canShift(YO)?YO:Dt);break}}}),ea=new S(t=>{if(le.includes(t.peek(-1))){let{next:O}=t;(D(O)||O==Qe||O==Bt||O==Mt||O==Jt||O==Lt||O==E)&&t.acceptToken(At)}}),ta=new S(t=>{if(!le.includes(t.peek(-1))){let{next:O}=t;if(O==Kt&&(t.advance(),t.acceptToken(UO)),D(O)){do t.advance();while(D(t.next));t.acceptToken(UO)}}}),aa=lO({"import charset namespace keyframes":o.definitionKeyword,"media supports":o.controlKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,AtKeyword:o.keyword,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ParenthesizedContent:o.special(o.name),ColorLiteral:o.color,StringLiteral:o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),ia={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,dir:32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},ra={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},sa={__proto__:null,not:128,only:128,from:158,to:160},na=y.deserialize({version:14,states:"7WOYQ[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO!ZQ[O'#CfO!}QXO'#CaO#UQ[O'#ChO#aQ[O'#DPO#fQ[O'#DTOOQP'#Ec'#EcO#kQdO'#DeO$VQ[O'#DrO#kQdO'#DtO$hQ[O'#DvO$sQ[O'#DyO$xQ[O'#EPO%WQ[O'#EROOQS'#Eb'#EbOOQS'#ES'#ESQYQ[OOOOQP'#Cg'#CgOOQP,59Q,59QO!ZQ[O,59QO%_Q[O'#EVO%yQWO,58{O&RQ[O,59SO#aQ[O,59kO#fQ[O,59oO%_Q[O,59sO%_Q[O,59uO%_Q[O,59vO'bQ[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO'iQWO,59SO'nQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO'sQ`O,59oOOQS'#Cp'#CpO#kQdO'#CqO'{QvO'#CsO)VQtO,5:POOQO'#Cx'#CxO'iQWO'#CwO)kQWO'#CyOOQS'#Ef'#EfOOQO'#Dh'#DhO)pQ[O'#DoO*OQWO'#EiO$xQ[O'#DmO*^QWO'#DpOOQO'#Ej'#EjO%|QWO,5:^O*cQpO,5:`OOQS'#Dx'#DxO*kQWO,5:bO*pQ[O,5:bOOQO'#D{'#D{O*xQWO,5:eO*}QWO,5:kO+VQWO,5:mOOQS-E8Q-E8QOOQP1G.l1G.lO+yQXO,5:qOOQO-E8T-E8TOOQS1G.g1G.gOOQP1G.n1G.nO'iQWO1G.nO'nQWO1G.nOOQP1G/V1G/VO,WQ`O1G/ZO,qQXO1G/_O-XQXO1G/aO-oQXO1G/bO.VQXO'#CdO.zQWO'#DaOOQS,59z,59zO/PQWO,59zO/XQ[O,59zO/`QdO'#CoO/gQ[O'#DOOOQP1G/Z1G/ZO#kQdO1G/ZO/nQpO,59]OOQS,59_,59_O#kQdO,59aO/vQWO1G/kOOQS,59c,59cO/{Q!bO,59eO0TQWO'#DhO0`QWO,5:TO0eQWO,5:ZO$xQ[O,5:VO$xQ[O'#EYO0mQWO,5;TO0xQWO,5:XO%_Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O1ZQWO1G/|O1`QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XOOQP7+$Y7+$YOOQP7+$u7+$uO#kQdO7+$uO#kQdO,59{O1nQ[O'#EXO1xQWO1G/fOOQS1G/f1G/fO1xQWO1G/fO2QQtO'#ETO2uQdO'#EeO3PQWO,59ZO3UQXO'#EhO3]QWO,59jO3bQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO3jQWO1G/PO#kQdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO3oQWO,5:tOOQO-E8W-E8WO3}QXO1G/vOOQS7+%h7+%hO4UQYO'#CsO%|QWO'#EZO4^QdO,5:hOOQS,5:h,5:hO4lQpO<O!c!}$w!}#O?[#O#P$w#P#Q?g#Q#R2U#R#T$w#T#U?r#U#c$w#c#d@q#d#o$w#o#pAQ#p#q2U#q#rA]#r#sAh#s#y$w#y#z%]#z$f$w$f$g%]$g#BY$w#BY#BZ%]#BZ$IS$w$IS$I_%]$I_$I|$w$I|$JO%]$JO$JT$w$JT$JU%]$JU$KV$w$KV$KW%]$KW&FU$w&FU&FV%]&FV~$wW$zQOy%Qz~%QW%VQoWOy%Qz~%Q~%bf#T~OX%QX^&v^p%Qpq&vqy%Qz#y%Q#y#z&v#z$f%Q$f$g&v$g#BY%Q#BY#BZ&v#BZ$IS%Q$IS$I_&v$I_$I|%Q$I|$JO&v$JO$JT%Q$JT$JU&v$JU$KV%Q$KV$KW&v$KW&FU%Q&FU&FV&v&FV~%Q~&}f#T~oWOX%QX^&v^p%Qpq&vqy%Qz#y%Q#y#z&v#z$f%Q$f$g&v$g#BY%Q#BY#BZ&v#BZ$IS%Q$IS$I_&v$I_$I|%Q$I|$JO&v$JO$JT%Q$JT$JU&v$JU$KV%Q$KV$KW&v$KW&FU%Q&FU&FV&v&FV~%Q^(fSOy%Qz#]%Q#]#^(r#^~%Q^(wSoWOy%Qz#a%Q#a#b)T#b~%Q^)YSoWOy%Qz#d%Q#d#e)f#e~%Q^)kSoWOy%Qz#c%Q#c#d)w#d~%Q^)|SoWOy%Qz#f%Q#f#g*Y#g~%Q^*_SoWOy%Qz#h%Q#h#i*k#i~%Q^*pSoWOy%Qz#T%Q#T#U*|#U~%Q^+RSoWOy%Qz#b%Q#b#c+_#c~%Q^+dSoWOy%Qz#h%Q#h#i+p#i~%Q^+wQ!VUoWOy%Qz~%Q~,QUOY+}Zr+}rs,ds#O+}#O#P,i#P~+}~,iOh~~,lPO~+}_,tWtPOy%Qz!Q%Q!Q![-^![!c%Q!c!i-^!i#T%Q#T#Z-^#Z~%Q^-cWoWOy%Qz!Q%Q!Q![-{![!c%Q!c!i-{!i#T%Q#T#Z-{#Z~%Q^.QWoWOy%Qz!Q%Q!Q![.j![!c%Q!c!i.j!i#T%Q#T#Z.j#Z~%Q^.qWfUoWOy%Qz!Q%Q!Q![/Z![!c%Q!c!i/Z!i#T%Q#T#Z/Z#Z~%Q^/bWfUoWOy%Qz!Q%Q!Q![/z![!c%Q!c!i/z!i#T%Q#T#Z/z#Z~%Q^0PWoWOy%Qz!Q%Q!Q![0i![!c%Q!c!i0i!i#T%Q#T#Z0i#Z~%Q^0pWfUoWOy%Qz!Q%Q!Q![1Y![!c%Q!c!i1Y!i#T%Q#T#Z1Y#Z~%Q^1_WoWOy%Qz!Q%Q!Q![1w![!c%Q!c!i1w!i#T%Q#T#Z1w#Z~%Q^2OQfUoWOy%Qz~%QY2XSOy%Qz!_%Q!_!`2e!`~%QY2lQzQoWOy%Qz~%QX2wQXPOy%Qz~%Q~3QUOY2}Zw2}wx,dx#O2}#O#P3d#P~2}~3gPO~2}_3oQbVOy%Qz~%Q~3zOa~_4RSUPjSOy%Qz!_%Q!_!`2e!`~%Q_4fUjS!PPOy%Qz!O%Q!O!P4x!P!Q%Q!Q![7_![~%Q^4}SoWOy%Qz!Q%Q!Q![5Z![~%Q^5bWoW#ZUOy%Qz!Q%Q!Q![5Z![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%Q^6PWoWOy%Qz{%Q{|6i|}%Q}!O6i!O!Q%Q!Q![6z![~%Q^6nSoWOy%Qz!Q%Q!Q![6z![~%Q^7RSoW#ZUOy%Qz!Q%Q!Q![6z![~%Q^7fYoW#ZUOy%Qz!O%Q!O!P5Z!P!Q%Q!Q![7_![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%Q_8ZQpVOy%Qz~%Q^8fUjSOy%Qz!O%Q!O!P4x!P!Q%Q!Q![7_![~%Q_8}S#WPOy%Qz!Q%Q!Q![5Z![~%Q~9`RjSOy%Qz{9i{~%Q~9nSoWOy9iyz9zz{:o{~9i~9}ROz9zz{:W{~9z~:ZTOz9zz{:W{!P9z!P!Q:j!Q~9z~:oOR~~:tUoWOy9iyz9zz{:o{!P9i!P!Q;W!Q~9i~;_QoWR~Oy%Qz~%Q^;jY#ZUOy%Qz!O%Q!O!P5Z!P!Q%Q!Q![7_![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%QX<_S]POy%Qz![%Q![!]RUOy%Qz!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX>lY!YPoWOy%Qz}%Q}!O>e!O!Q%Q!Q![>e![!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX?aQxPOy%Qz~%Q^?lQvUOy%Qz~%QX?uSOy%Qz#b%Q#b#c@R#c~%QX@WSoWOy%Qz#W%Q#W#X@d#X~%QX@kQ!`PoWOy%Qz~%QX@tSOy%Qz#f%Q#f#g@d#g~%QXAVQ!RPOy%Qz~%Q_AbQ!QVOy%Qz~%QZAmS!PPOy%Qz!_%Q!_!`2e!`~%Q",tokenizers:[ea,ta,Oa,0,1,2,3],topRules:{StyleSheet:[0,4]},specialized:[{term:94,get:t=>ia[t]||-1},{term:56,get:t=>ra[t]||-1},{term:95,get:t=>sa[t]||-1}],tokenPrec:1078});let OO=null;function eO(){if(!OO&&typeof document=="object"&&document.body){let t=[];for(let O in document.body.style)/[A-Z]|^-|^(item|length)$/.test(O)||t.push(O);OO=t.sort().map(O=>({type:"property",label:O}))}return OO||[]}const VO=["active","after","before","checked","default","disabled","empty","enabled","first-child","first-letter","first-line","first-of-type","focus","hover","in-range","indeterminate","invalid","lang","last-child","last-of-type","link","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-of-type","only-child","optional","out-of-range","placeholder","read-only","read-write","required","root","selection","target","valid","visited"].map(t=>({type:"class",label:t})),EO=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),oa=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),x=/^[\w-]*/,la=t=>{let{state:O,pos:e}=t,a=v(O).resolveInner(e,-1);if(a.name=="PropertyName")return{from:a.from,options:eO(),validFor:x};if(a.name=="ValueName")return{from:a.from,options:EO,validFor:x};if(a.name=="PseudoClassName")return{from:a.from,options:VO,validFor:x};if(a.name=="TagName"){for(let{parent:s}=a;s;s=s.parent)if(s.name=="Block")return{from:a.from,options:eO(),validFor:x};return{from:a.from,options:oa,validFor:x}}if(!t.explicit)return null;let i=a.resolve(e),r=i.childBefore(e);return r&&r.name==":"&&i.name=="PseudoClassSelector"?{from:e,options:VO,validFor:x}:r&&r.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:e,options:EO,validFor:x}:i.name=="Block"?{from:e,options:eO(),validFor:x}:null},sO=QO.define({parser:na.configure({props:[cO.add({Declaration:U()}),uO.add({Block:HO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Qa(){return new dO(sO,sO.data.of({autocomplete:la}))}const ca=1,IO=281,AO=2,ua=3,G=282,da=4,$a=283,NO=284,ha=286,pa=287,fa=5,ga=6,ma=1,Ta=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],ce=125,Sa=123,ba=59,DO=47,Pa=42,Ra=43,xa=45,ka=36,Xa=96,ya=92,Za=new Oe({start:!1,shift(t,O){return O==fa||O==ga||O==ha?t:O==pa},strict:!1}),Wa=new S((t,O)=>{let{next:e}=t;(e==ce||e==-1||O.context)&&O.canShift(NO)&&t.acceptToken(NO)},{contextual:!0,fallback:!0}),ja=new S((t,O)=>{let{next:e}=t,a;Ta.indexOf(e)>-1||e==DO&&((a=t.peek(1))==DO||a==Pa)||e!=ce&&e!=ba&&e!=-1&&!O.context&&O.canShift(IO)&&t.acceptToken(IO)},{contextual:!0}),wa=new S((t,O)=>{let{next:e}=t;if((e==Ra||e==xa)&&(t.advance(),e==t.next)){t.advance();let a=!O.context&&O.canShift(AO);t.acceptToken(a?AO:ua)}},{contextual:!0}),_a=new S(t=>{for(let O=!1,e=0;;e++){let{next:a}=t;if(a<0){e&&t.acceptToken(G);break}else if(a==Xa){e?t.acceptToken(G):t.acceptToken($a,1);break}else if(a==Sa&&O){e==1?t.acceptToken(da,1):t.acceptToken(G,-1);break}else if(a==10&&e){t.advance(),t.acceptToken(G);break}else a==ya&&t.advance();O=a==ka,t.advance()}}),va=new S((t,O)=>{if(!(t.next!=101||!O.dialectEnabled(ma))){t.advance();for(let e=0;e<6;e++){if(t.next!="xtends".charCodeAt(e))return;t.advance()}t.next>=57&&t.next<=65||t.next>=48&&t.next<=90||t.next==95||t.next>=97&&t.next<=122||t.next>160||t.acceptToken(ca)}}),qa=lO({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,LineComment:o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName}),za={__proto__:null,export:18,as:23,from:29,default:32,async:37,function:38,this:48,true:56,false:56,void:66,typeof:70,null:86,super:88,new:122,await:139,yield:141,delete:142,class:152,extends:154,public:197,private:197,protected:197,readonly:199,instanceof:220,in:222,const:224,import:256,keyof:307,unique:311,infer:317,is:351,abstract:371,implements:373,type:375,let:378,var:380,interface:387,enum:391,namespace:397,module:399,declare:403,global:407,for:428,of:437,while:440,with:444,do:448,if:452,else:454,switch:458,case:464,try:470,catch:474,finally:478,return:482,throw:486,break:490,continue:494,debugger:498},Ga={__proto__:null,async:109,get:111,set:113,public:161,private:161,protected:161,static:163,abstract:165,override:167,readonly:173,new:355},Ca={__proto__:null,"<":129},Ua=y.deserialize({version:14,states:"$8SO`QdOOO'QQ(C|O'#ChO'XOWO'#DVO)dQdO'#D]O)tQdO'#DhO){QdO'#DrO-xQdO'#DxOOQO'#E]'#E]O.]Q`O'#E[O.bQ`O'#E[OOQ(C['#Ef'#EfO0aQ(C|O'#ItO2wQ(C|O'#IuO3eQ`O'#EzO3jQ!bO'#FaOOQ(C['#FS'#FSO3rO#tO'#FSO4QQ&jO'#FhO5bQ`O'#FgOOQ(C['#Iu'#IuOOQ(CW'#It'#ItOOQS'#J^'#J^O5gQ`O'#HpO5lQ(ChO'#HqOOQS'#Ih'#IhOOQS'#Hr'#HrQ`QdOOO){QdO'#DjO5tQ`O'#G[O5yQ&jO'#CmO6XQ`O'#EZO6dQ`O'#EgO6iQ,UO'#FRO7TQ`O'#G[O7YQ`O'#G`O7eQ`O'#G`O7sQ`O'#GcO7sQ`O'#GdO7sQ`O'#GfO5tQ`O'#GiO8dQ`O'#GlO9rQ`O'#CdO:SQ`O'#GyO:[Q`O'#HPO:[Q`O'#HRO`QdO'#HTO:[Q`O'#HVO:[Q`O'#HYO:aQ`O'#H`O:fQ(CjO'#HfO){QdO'#HhO:qQ(CjO'#HjO:|Q(CjO'#HlO5lQ(ChO'#HnO){QdO'#DWOOOW'#Ht'#HtO;XOWO,59qOOQ(C[,59q,59qO=jQtO'#ChO=tQdO'#HuO>XQ`O'#IvO@WQtO'#IvO'dQdO'#IvO@_Q`O,59wO@uQ7[O'#DbOAnQ`O'#E]OA{Q`O'#JROBWQ`O'#JQOBWQ`O'#JQOB`Q`O,5:yOBeQ`O'#JPOBlQaO'#DyO5yQ&jO'#EZOBzQ`O'#EZOCVQpO'#FROOQ(C[,5:S,5:SOC_QdO,5:SOE]Q(C|O,5:^OEyQ`O,5:dOFdQ(ChO'#JOO7YQ`O'#I}OFkQ`O'#I}OFsQ`O,5:xOFxQ`O'#I}OGWQdO,5:vOIWQ&jO'#EWOJeQ`O,5:vOKwQ&jO'#DlOLOQdO'#DqOLYQ7[O,5;PO){QdO,5;POOQS'#Er'#ErOOQS'#Et'#EtO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;RO){QdO,5;ROOQS'#Ex'#ExOLbQdO,5;cOOQ(C[,5;h,5;hOOQ(C[,5;i,5;iONbQ`O,5;iOOQ(C[,5;j,5;jO){QdO'#IPONgQ(ChO,5[OOQS'#Ik'#IkOOQS,5>],5>]OOQS-E;p-E;pO!+kQ(C|O,5:UOOQ(CX'#Cp'#CpO!,[Q&kO,5Q,5>QO){QdO,5>QO5lQ(ChO,5>SOOQS,5>U,5>UO!8cQ`O,5>UOOQS,5>W,5>WO!8cQ`O,5>WOOQS,5>Y,5>YO!8hQpO,59rOOOW-E;r-E;rOOQ(C[1G/]1G/]O!8mQtO,5>aO'dQdO,5>aOOQO,5>f,5>fO!8wQdO'#HuOOQO-E;s-E;sO!9UQ`O,5?bO!9^QtO,5?bO!9eQ`O,5?lOOQ(C[1G/c1G/cO!9mQ!bO'#DTOOQO'#Ix'#IxO){QdO'#IxO!:[Q!bO'#IxO!:yQ!bO'#DcO!;[Q7[O'#DcO!=gQdO'#DcO!=nQ`O'#IwO!=vQ`O,59|O!={Q`O'#EaO!>ZQ`O'#JSO!>cQ`O,5:zO!>yQ7[O'#DcO){QdO,5?mO!?TQ`O'#HzOOQO-E;x-E;xO!9eQ`O,5?lOOQ(CW1G0e1G0eO!@aQ7[O'#D|OOQ(C[,5:e,5:eO){QdO,5:eOIWQ&jO,5:eO!@hQaO,5:eO:aQ`O,5:uO!-OQ!bO,5:uO!-WQ&jO,5:uO5yQ&jO,5:uOOQ(C[1G/n1G/nOOQ(C[1G0O1G0OOOQ(CW'#EV'#EVO){QdO,5?jO!@sQ(ChO,5?jO!AUQ(ChO,5?jO!A]Q`O,5?iO!AeQ`O'#H|O!A]Q`O,5?iOOQ(CW1G0d1G0dO7YQ`O,5?iOOQ(C[1G0b1G0bO!BPQ(C|O1G0bO!CRQ(CyO,5:rOOQ(C]'#Fq'#FqO!CoQ(C}O'#IqOGWQdO1G0bO!EqQ,VO'#IyO!E{Q`O,5:WO!FQQtO'#IzO){QdO'#IzO!F[Q`O,5:]OOQ(C]'#DT'#DTOOQ(C[1G0k1G0kO!FaQ`O1G0kO!HrQ(C|O1G0mO!HyQ(C|O1G0mO!K^Q(C|O1G0mO!KeQ(C|O1G0mO!MlQ(C|O1G0mO!NPQ(C|O1G0mO#!pQ(C|O1G0mO#!wQ(C|O1G0mO#%[Q(C|O1G0mO#%cQ(C|O1G0mO#'WQ(C|O1G0mO#*QQMlO'#ChO#+{QMlO1G0}O#-vQMlO'#IuOOQ(C[1G1T1G1TO#.ZQ(C|O,5>kOOQ(CW-E;}-E;}O#.zQ(C}O1G0mOOQ(C[1G0m1G0mO#1PQ(C|O1G1QO#1pQ!bO,5;sO#1uQ!bO,5;tO#1zQ!bO'#F[O#2`Q`O'#FZOOQO'#JW'#JWOOQO'#H}'#H}O#2eQ!bO1G1]OOQ(C[1G1]1G1]OOOO1G1f1G1fO#2sQMlO'#ItO#2}Q`O,5;}OLbQdO,5;}OOOO-E;|-E;|OOQ(C[1G1Y1G1YOOQ(C[,5PQtO1G1VOOQ(C[1G1X1G1XO5tQ`O1G2}O#>WQ`O1G2}O#>]Q`O1G2}O#>bQ`O1G2}OOQS1G2}1G2}O#>gQ&kO1G2bO7YQ`O'#JQO7YQ`O'#EaO7YQ`O'#IWO#>xQ(ChO,5?yOOQS1G2f1G2fO!0VQ`O1G2lOIWQ&jO1G2iO#?TQ`O1G2iOOQS1G2j1G2jOIWQ&jO1G2jO#?YQaO1G2jO#?bQ7[O'#GhOOQS1G2l1G2lO!'VQ7[O'#IYO!0[QpO1G2oOOQS1G2o1G2oOOQS,5=Y,5=YO#?jQ&kO,5=[O5tQ`O,5=[O#6SQ`O,5=_O5bQ`O,5=_O!-OQ!bO,5=_O!-WQ&jO,5=_O5yQ&jO,5=_O#?{Q`O'#JaO#@WQ`O,5=`OOQS1G.j1G.jO#@]Q(ChO1G.jO#@hQ`O1G.jO#@mQ`O1G.jO5lQ(ChO1G.jO#@uQtO,5@OO#APQ`O,5@OO#A[QdO,5=gO#AcQ`O,5=gO7YQ`O,5@OOOQS1G3P1G3PO`QdO1G3POOQS1G3V1G3VOOQS1G3X1G3XO:[Q`O1G3ZO#AhQdO1G3]O#EcQdO'#H[OOQS1G3`1G3`O#EpQ`O'#HbO:aQ`O'#HdOOQS1G3f1G3fO#ExQdO1G3fO5lQ(ChO1G3lOOQS1G3n1G3nOOQ(CW'#Fx'#FxO5lQ(ChO1G3pO5lQ(ChO1G3rOOOW1G/^1G/^O#IvQpO,5aO#JYQ`O1G4|O#JbQ`O1G5WO#JjQ`O,5?dOLbQdO,5:{O7YQ`O,5:{O:aQ`O,59}OLbQdO,59}O!-OQ!bO,59}O#JoQMlO,59}OOQO,5:{,5:{O#JyQ7[O'#HvO#KaQ`O,5?cOOQ(C[1G/h1G/hO#KiQ7[O'#H{O#K}Q`O,5?nOOQ(CW1G0f1G0fO!;[Q7[O,59}O#LVQtO1G5XO7YQ`O,5>fOOQ(CW'#ES'#ESO#LaQ(DjO'#ETO!@XQ7[O'#D}OOQO'#Hy'#HyO#L{Q7[O,5:hOOQ(C[,5:h,5:hO#MSQ7[O'#D}O#MeQ7[O'#D}O#MlQ7[O'#EYO#MoQ7[O'#ETO#M|Q7[O'#ETO!@XQ7[O'#ETO#NaQ`O1G0PO#NfQqO1G0POOQ(C[1G0P1G0PO){QdO1G0POIWQ&jO1G0POOQ(C[1G0a1G0aO:aQ`O1G0aO!-OQ!bO1G0aO!-WQ&jO1G0aO#NmQ(C|O1G5UO){QdO1G5UO#N}Q(ChO1G5UO$ `Q`O1G5TO7YQ`O,5>hOOQO,5>h,5>hO$ hQ`O,5>hOOQO-E;z-E;zO$ `Q`O1G5TO$ vQ(C}O,59jO$#xQ(C}O,5m,5>mO$-rQ`O,5>mOOQ(C]1G2P1G2PP$-wQ`O'#IRPOQ(C]-Eo,5>oOOQO-Ep,5>pOOQO-Ex,5>xOOQO-E<[-E<[OOQ(C[7+&q7+&qO$6OQ`O7+(iO5lQ(ChO7+(iO5tQ`O7+(iO$6TQ`O7+(iO$6YQaO7+'|OOQ(CW,5>r,5>rOOQ(CW-Et,5>tOOQO-EO,5>OOOQS7+)Q7+)QOOQS7+)W7+)WOOQS7+)[7+)[OOQS7+)^7+)^OOQO1G5O1G5OO$:nQMlO1G0gO$:xQ`O1G0gOOQO1G/i1G/iO$;TQMlO1G/iO:aQ`O1G/iOLbQdO'#DcOOQO,5>b,5>bOOQO-E;t-E;tOOQO,5>g,5>gOOQO-E;y-E;yO!-OQ!bO1G/iO:aQ`O,5:iOOQO,5:o,5:oO){QdO,5:oO$;_Q(ChO,5:oO$;jQ(ChO,5:oO!-OQ!bO,5:iOOQO-E;w-E;wOOQ(C[1G0S1G0SO!@XQ7[O,5:iO$;xQ7[O,5:iO$PQ`O7+*oO$>XQ(C}O1G2[O$@^Q(C}O1G2^O$BcQ(C}O1G1yO$DnQ,VO,5>cOOQO-E;u-E;uO$DxQtO,5>dO){QdO,5>dOOQO-E;v-E;vO$ESQ`O1G5QO$E[QMlO1G0bO$GcQMlO1G0mO$GjQMlO1G0mO$IkQMlO1G0mO$IrQMlO1G0mO$KgQMlO1G0mO$KzQMlO1G0mO$NXQMlO1G0mO$N`QMlO1G0mO%!aQMlO1G0mO%!hQMlO1G0mO%$]QMlO1G0mO%$pQ(C|O<kOOOO7+'T7+'TOOOW1G/R1G/ROOQ(C]1G4X1G4XOJjQ&jO7+'zO%*VQ`O,5>lO5tQ`O,5>lOOQO-EnO%+dQ`O,5>nOIWQ&jO,5>nOOQO-Ew,5>wO%.vQ`O,5>wO%.{Q`O,5>wOOQO-EvOOQO-EqOOQO-EsOOQO-E{AN>{OOQOAN>uAN>uO%3rQ(C|OAN>{O:aQ`OAN>uO){QdOAN>{O!-OQ!bOAN>uO&)wQ(ChOAN>{O&*SQ(C}OG26lOOQ(CWG26bG26bOOQS!$( t!$( tOOQO<QQ`O'#E[O&>YQ`O'#EzO&>_Q`O'#EgO&>dQ`O'#JRO&>oQ`O'#JPO&>zQ`O,5:vO&?PQ,VO,5aO!O&PO~Ox&SO!W&^O!X&VO!Y&VO'^$dO~O]&TOk&TO!Q&WO'g&QO!S'kP!S'vP~P@dO!O'sX!R'sX!]'sX!c'sX'p'sX~O!{'sX#W#PX!S'sX~PA]O!{&_O!O'uX!R'uX~O!R&`O!O'tX~O!O&cO~O!{#eO~PA]OP&gO!T&dO!o&fO']$bO~Oc&lO!d$ZO']$bO~Ou$oO!d$nO~O!S&mO~P`Ou!{Ov!{Ox!|O!b!yO!d!zO'fQOQ!faZ!faj!fa!R!fa!a!fa!j!fa#[!fa#]!fa#^!fa#_!fa#`!fa#a!fa#b!fa#c!fa#e!fa#g!fa#i!fa#j!fa'p!fa'w!fa'x!fa~O_!fa'W!fa!O!fa!c!fan!fa!T!fa%Q!fa!]!fa~PCfO!c&nO~O!]!wO!{&pO'p&oO!R'rX_'rX'W'rX~O!c'rX~PFOO!R&tO!c'qX~O!c&vO~Ox$uO!T$vO#V&wO']$bO~OQTORTO]cOb!kOc!jOhcOjTOkcOlcOqTOsTOxRO{cO|cO}cO!TSO!_kO!dUO!gTO!hTO!iTO!jTO!kTO!n!iO#t!lO#x^O']9aO'fQO'oYO'|aO~O]#qOh$QOj#rOk#qOl#qOq$ROs9tOx#yO!T#zO!_;eO!d#vO#V9}O#t$VO$_9wO$a9zO$d$WO']&{O'b$PO'f#sO~O#W&}O~O]#qOh$QOj#rOk#qOl#qOq$ROs$SOx#yO!T#zO!_$XO!d#vO#V$YO#t$VO$_$TO$a$UO$d$WO']&{O'b$PO'f#sO~O'a'mP~PJjO!Q'RO!c'nP~P){O'g'TO'oYO~OQ9^OR9^O]cOb;`Oc!jOhcOj9^OkcOlcOq9^Os9^OxRO{cO|cO}cO!T!bO!_9`O!dUO!g9^O!h9^O!i9^O!j9^O!k9^O!n!iO#t!lO#x^O']'cO'fQO'oYO'|;^O~O!d!zO~O!R#bO_$]a'W$]a!c$]a!O$]a!T$]a%Q$]a!]$]a~O#d'jO~PIWO!]'lO!T'yX#w'yX#z'yX$R'yX~Ou'mO~P! YOu'mO!T'yX#w'yX#z'yX$R'yX~O!T'oO#w'sO#z'nO$R'tO~O!Q'wO~PLbO#z#fO$R'zO~OP$eXu$eXx$eX!b$eX'w$eX'x$eX~OPfX!RfX!{fX'afX'a$eX~P!!rOk'|O~OS'}O'U(OO'V(QO~OP(ZOu(SOx(TO'w(VO'x(XO~O'a(RO~P!#{O'a([O~O]#qOh$QOj#rOk#qOl#qOq$ROs9tOx#yO!T#zO!_;eO!d#vO#V9}O#t$VO$_9wO$a9zO$d$WO'b$PO'f#sO~O!Q(`O'](]O!c'}P~P!$jO#W(bO~O!d(cO~O!Q(hO'](eO!O(OP~P!$jOj(uOx(mO!W(sO!X(lO!Y(lO!d(cO!x(tO$w(oO'^$dO'g(jO~O!S(rO~P!&jO!b!yOP'eXu'eXx'eX'w'eX'x'eX!R'eX!{'eX~O'a'eX#m'eX~P!'cOP(xO!{(wO!R'dX'a'dX~O!R(yO'a'cX~O']${O'a'cP~O'](|O~O!d)RO~O']&{O~Ox$uO!Q!rO!T$vO#U!uO#V!rO']$bO!c'qP~O!]!wO#W)VO~OQ#^OZ#dOj#ROu!{Ov!{Ox!|O!a#TO!b!yO!d!zO!j#^O#[#PO#]#QO#^#QO#_#QO#`#SO#a#TO#b#TO#c#TO#e#UO#g#WO#i#YO#j#ZO'fQO'p#[O'w!}O'x#OO~O_!^a!R!^a'W!^a!O!^a!c!^an!^a!T!^a%Q!^a!]!^a~P!)wOP)_O!T&dO!o)^O%Q)]O'b$PO~O!])aO!T'`X_'`X!R'`X'W'`X~O!d$ZO'b$PO~O!d$ZO']$bO'b$PO~O!]!wO#W&}O~O])lO%R)mO'])iO!S(VP~O!R)nO^(UX~O'g'TO~OZ)rO~O^)sO~O!T$lO']$bO'^$dO^(UP~Ox$uO!Q)xO!R&`O!T$vO']$bO!O'tP~O]&ZOk&ZO!Q)yO'g'TO!S'vP~O!R)zO_(RX'W(RX~O!{*OO'b$PO~OP*RO!T#zO'b$PO~O!T*TO~Ou*VO!TSO~O!n*[O~Oc*aO~O'](|O!S(TP~Oc$jO~O%RtO']${O~P8wOZ*gO^*fO~OQTORTO]cObnOcmOhcOjTOkcOlcOqTOsTOxRO{cO|cO}cO!_kO!dUO!gTO!hTO!iTO!jTO!kTO!nlO#x^O%PqO'fQO'oYO'|aO~O!T!bO#t!lO']9aO~P!1_O^*fO_$^O'W$^O~O_*kO#d*mO%T*mO%U*mO~P){O!d%`O~O%t*rO~O!T*tO~O&V*vO&X*wOQ&SaR&SaX&Sa]&Sa_&Sab&Sac&Sah&Saj&Sak&Sal&Saq&Sas&Sax&Sa{&Sa|&Sa}&Sa!T&Sa!_&Sa!d&Sa!g&Sa!h&Sa!i&Sa!j&Sa!k&Sa!n&Sa#d&Sa#t&Sa#x&Sa%P&Sa%R&Sa%T&Sa%U&Sa%X&Sa%Z&Sa%^&Sa%_&Sa%a&Sa%n&Sa%t&Sa%v&Sa%x&Sa%z&Sa%}&Sa&T&Sa&Z&Sa&]&Sa&_&Sa&a&Sa&c&Sa'S&Sa']&Sa'f&Sa'o&Sa'|&Sa!S&Sa%{&Sa`&Sa&Q&Sa~O']*|O~On+PO~O!O&ia!R&ia~P!)wO!Q+TO!O&iX!R&iX~P){O!R%zO!O'ja~O!O'ja~P>aO!R&`O!O'ta~O!RwX!R!ZX!SwX!S!ZX!]wX!]!ZX!d!ZX!{wX'b!ZX~O!]+YO!{+XO!R#TX!R'lX!S#TX!S'lX!]'lX!d'lX'b'lX~O!]+[O!d$ZO'b$PO!R!VX!S!VX~O]&ROk&ROx&SO'g(jO~OQ9^OR9^O]cOb;`Oc!jOhcOj9^OkcOlcOq9^Os9^OxRO{cO|cO}cO!T!bO!_9`O!dUO!g9^O!h9^O!i9^O!j9^O!k9^O!n!iO#t!lO#x^O'fQO'oYO'|;^O~O']:SO~P!;jO!R+`O!S'kX~O!S+bO~O!]+YO!{+XO!R#TX!S#TX~O!R+cO!S'vX~O!S+eO~O]&ROk&ROx&SO'^$dO'g(jO~O!X+fO!Y+fO~P!>hOx$uO!Q+hO!T$vO']$bO!O&nX!R&nX~O_+lO!W+oO!X+kO!Y+kO!r+sO!s+qO!t+rO!u+pO!x+tO'^$dO'g(jO'o+iO~O!S+nO~P!?iOP+yO!T&dO!o+xO~O!{,PO!R'ra!c'ra_'ra'W'ra~O!]!wO~P!@sO!R&tO!c'qa~Ox$uO!Q,SO!T$vO#U,UO#V,SO']$bO!R&pX!c&pX~O_#Oi!R#Oi'W#Oi!O#Oi!c#Oin#Oi!T#Oi%Q#Oi!]#Oi~P!)wOP;tOu(SOx(TO'w(VO'x(XO~O#W!za!R!za!c!za!{!za!T!za_!za'W!za!O!za~P!BpO#W'eXQ'eXZ'eX_'eXj'eXv'eX!a'eX!d'eX!j'eX#['eX#]'eX#^'eX#_'eX#`'eX#a'eX#b'eX#c'eX#e'eX#g'eX#i'eX#j'eX'W'eX'f'eX'p'eX!c'eX!O'eX!T'eXn'eX%Q'eX!]'eX~P!'cO!R,_O'a'mX~P!#{O'a,aO~O!R,bO!c'nX~P!)wO!c,eO~O!O,fO~OQ#^Ou!{Ov!{Ox!|O!b!yO!d!zO!j#^O'fQOZ#Zi_#Zij#Zi!R#Zi!a#Zi#]#Zi#^#Zi#_#Zi#`#Zi#a#Zi#b#Zi#c#Zi#e#Zi#g#Zi#i#Zi#j#Zi'W#Zi'p#Zi'w#Zi'x#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~O#[#Zi~P!FfO#[#PO~P!FfOQ#^Ou!{Ov!{Ox!|O!b!yO!d!zO!j#^O#[#PO#]#QO#^#QO#_#QO'fQOZ#Zi_#Zi!R#Zi!a#Zi#`#Zi#a#Zi#b#Zi#c#Zi#e#Zi#g#Zi#i#Zi#j#Zi'W#Zi'p#Zi'w#Zi'x#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~Oj#Zi~P!IQOj#RO~P!IQOQ#^Oj#ROu!{Ov!{Ox!|O!b!yO!d!zO!j#^O#[#PO#]#QO#^#QO#_#QO#`#SO'fQO_#Zi!R#Zi#e#Zi#g#Zi#i#Zi#j#Zi'W#Zi'p#Zi'w#Zi'x#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~OZ#Zi!a#Zi#a#Zi#b#Zi#c#Zi~P!KlOZ#dO!a#TO#a#TO#b#TO#c#TO~P!KlOQ#^OZ#dOj#ROu!{Ov!{Ox!|O!a#TO!b!yO!d!zO!j#^O#[#PO#]#QO#^#QO#_#QO#`#SO#a#TO#b#TO#c#TO#e#UO'fQO_#Zi!R#Zi#g#Zi#i#Zi#j#Zi'W#Zi'p#Zi'x#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~O'w#Zi~P!NdO'w!}O~P!NdOQ#^OZ#dOj#ROu!{Ov!{Ox!|O!a#TO!b!yO!d!zO!j#^O#[#PO#]#QO#^#QO#_#QO#`#SO#a#TO#b#TO#c#TO#e#UO#g#WO'fQO'w!}O_#Zi!R#Zi#i#Zi#j#Zi'W#Zi'p#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~O'x#Zi~P##OO'x#OO~P##OOQ#^OZ#dOj#ROu!{Ov!{Ox!|O!a#TO!b!yO!d!zO!j#^O#[#PO#]#QO#^#QO#_#QO#`#SO#a#TO#b#TO#c#TO#e#UO#g#WO#i#YO'fQO'w!}O'x#OO~O_#Zi!R#Zi#j#Zi'W#Zi'p#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~P#%jOQ[XZ[Xj[Xu[Xv[Xx[X!a[X!b[X!d[X!j[X!{[X#WdX#[[X#][X#^[X#_[X#`[X#a[X#b[X#c[X#e[X#g[X#i[X#j[X#o[X'f[X'p[X'w[X'x[X!R[X!S[X~O#m[X~P#'}OQ#^OZ9rOj9gOu!{Ov!{Ox!|O!a9iO!b!yO!d!zO!j#^O#[9eO#]9fO#^9fO#_9fO#`9hO#a9iO#b9iO#c9iO#e9jO#g9lO#i9nO#j9oO'fQO'p#[O'w!}O'x#OO~O#m,hO~P#*XOQ'iXZ'iXj'iXu'iXv'iXx'iX!a'iX!b'iX!d'iX!j'iX#['iX#]'iX#^'iX#_'iX#`'iX#a'iX#b'iX#e'iX#g'iX#i'iX#j'iX'f'iX'p'iX'w'iX'x'iX!R'iX~O!{9sO#o9sO#c'iX#m'iX!S'iX~P#,SO_&sa!R&sa'W&sa!c&san&sa!O&sa!T&sa%Q&sa!]&sa~P!)wOQ#ZiZ#Zi_#Zij#Ziv#Zi!R#Zi!a#Zi!b#Zi!d#Zi!j#Zi#[#Zi#]#Zi#^#Zi#_#Zi#`#Zi#a#Zi#b#Zi#c#Zi#e#Zi#g#Zi#i#Zi#j#Zi'W#Zi'f#Zi'p#Zi!O#Zi!c#Zin#Zi!T#Zi%Q#Zi!]#Zi~P!BpO_#ni!R#ni'W#ni!O#ni!c#nin#ni!T#ni%Q#ni!]#ni~P!)wO#z,jO~O#z,kO~O!]'lO!{,lO!T$OX#w$OX#z$OX$R$OX~O!Q,mO~O!T'oO#w,oO#z'nO$R,pO~O!R9pO!S'hX~P#*XO!S,qO~O$R,sO~OS'}O'U(OO'V,vO~O],yOk,yO!O,zO~O!RdX!]dX!cdX!c$eX'pdX~P!!rO!c-QO~P!BpO!R-RO!]!wO'p&oO!c'}X~O!c-WO~O!Q(`O']$bO!c'}P~O#W-YO~O!O$eX!R$eX!]$lX~P!!rO!R-ZO!O(OX~P!BpO!]-]O~O!O-_O~Oj-cO!]!wO!d$ZO'b$PO'p&oO~O!])aO~O_$^O!R-hO'W$^O~O!S-jO~P!&jO!X-kO!Y-kO'^$dO'g(jO~Ox-mO'g(jO~O!x-nO~O']${O!R&xX'a&xX~O!R(yO'a'ca~O'a-sO~Ou-tOv-tOx-uOPra'wra'xra!Rra!{ra~O'ara#mra~P#7pOu(SOx(TOP$^a'w$^a'x$^a!R$^a!{$^a~O'a$^a#m$^a~P#8fOu(SOx(TOP$`a'w$`a'x$`a!R$`a!{$`a~O'a$`a#m$`a~P#9XO]-vO~O#W-wO~O'a$na!R$na!{$na#m$na~P!#{O#W-zO~OP.TO!T&dO!o.SO%Q.RO~O]#qOj#rOk#qOl#qOq$ROs9tOx#yO!T#zO!_;eO!d#vO#V9}O#t$VO$_9wO$a9zO$d$WO'b$PO'f#sO~Oh.VO'].UO~P#:yO!])aO!T'`a_'`a!R'`a'W'`a~O#W.]O~OZ[X!RdX!SdX~O!R.^O!S(VX~O!S.`O~OZ.aO~O].cO'])iO~O!T$lO']$bO^'QX!R'QX~O!R)nO^(Ua~O!c.fO~P!)wO].hO~OZ.iO~O^.jO~OP.TO!T&dO!o.SO%Q.RO'b$PO~O!R)zO_(Ra'W(Ra~O!{.pO~OP.sO!T#zO~O'g'TO!S(SP~OP.}O!T.yO!o.|O%Q.{O'b$PO~OZ/XO!R/VO!S(TX~O!S/YO~O^/[O_$^O'W$^O~O]/]O~O]/^O'](|O~O#c/_O%r/`O~P0zO!{#eO#c/_O%r/`O~O_/aO~P){O_/cO~O%{/gOQ%yiR%yiX%yi]%yi_%yib%yic%yih%yij%yik%yil%yiq%yis%yix%yi{%yi|%yi}%yi!T%yi!_%yi!d%yi!g%yi!h%yi!i%yi!j%yi!k%yi!n%yi#d%yi#t%yi#x%yi%P%yi%R%yi%T%yi%U%yi%X%yi%Z%yi%^%yi%_%yi%a%yi%n%yi%t%yi%v%yi%x%yi%z%yi%}%yi&T%yi&Z%yi&]%yi&_%yi&a%yi&c%yi'S%yi']%yi'f%yi'o%yi'|%yi!S%yi`%yi&Q%yi~O`/mO!S/kO&Q/lO~P`O!TSO!d/oO~O&X*wOQ&SiR&SiX&Si]&Si_&Sib&Sic&Sih&Sij&Sik&Sil&Siq&Sis&Six&Si{&Si|&Si}&Si!T&Si!_&Si!d&Si!g&Si!h&Si!i&Si!j&Si!k&Si!n&Si#d&Si#t&Si#x&Si%P&Si%R&Si%T&Si%U&Si%X&Si%Z&Si%^&Si%_&Si%a&Si%n&Si%t&Si%v&Si%x&Si%z&Si%}&Si&T&Si&Z&Si&]&Si&_&Si&a&Si&c&Si'S&Si']&Si'f&Si'o&Si'|&Si!S&Si%{&Si`&Si&Q&Si~O!R#bOn$]a~O!O&ii!R&ii~P!)wO!R%zO!O'ji~O!R&`O!O'ti~O!O/uO~O!R!Va!S!Va~P#*XO]&ROk&RO!Q/{O'g(jO!R&jX!S&jX~P@dO!R+`O!S'ka~O]&ZOk&ZO!Q)yO'g'TO!R&oX!S&oX~O!R+cO!S'va~O!O'ui!R'ui~P!)wO_$^O!]!wO!d$ZO!j0VO!{0TO'W$^O'b$PO'p&oO~O!S0YO~P!?iO!X0ZO!Y0ZO'^$dO'g(jO'o+iO~O!W0[O~P#MSO!TSO!W0[O!u0^O!x0_O~P#MSO!W0[O!s0aO!t0aO!u0^O!x0_O~P#MSO!T&dO~O!T&dO~P!BpO!R'ri!c'ri_'ri'W'ri~P!)wO!{0jO!R'ri!c'ri_'ri'W'ri~O!R&tO!c'qi~Ox$uO!T$vO#V0lO']$bO~O#WraQraZra_rajra!ara!bra!dra!jra#[ra#]ra#^ra#_ra#`ra#ara#bra#cra#era#gra#ira#jra'Wra'fra'pra!cra!Ora!Tranra%Qra!]ra~P#7pO#W$^aQ$^aZ$^a_$^aj$^av$^a!a$^a!b$^a!d$^a!j$^a#[$^a#]$^a#^$^a#_$^a#`$^a#a$^a#b$^a#c$^a#e$^a#g$^a#i$^a#j$^a'W$^a'f$^a'p$^a!c$^a!O$^a!T$^an$^a%Q$^a!]$^a~P#8fO#W$`aQ$`aZ$`a_$`aj$`av$`a!a$`a!b$`a!d$`a!j$`a#[$`a#]$`a#^$`a#_$`a#`$`a#a$`a#b$`a#c$`a#e$`a#g$`a#i$`a#j$`a'W$`a'f$`a'p$`a!c$`a!O$`a!T$`an$`a%Q$`a!]$`a~P#9XO#W$naQ$naZ$na_$naj$nav$na!R$na!a$na!b$na!d$na!j$na#[$na#]$na#^$na#_$na#`$na#a$na#b$na#c$na#e$na#g$na#i$na#j$na'W$na'f$na'p$na!c$na!O$na!T$na!{$nan$na%Q$na!]$na~P!BpO_#Oq!R#Oq'W#Oq!O#Oq!c#Oqn#Oq!T#Oq%Q#Oq!]#Oq~P!)wO!R&kX'a&kX~PJjO!R,_O'a'ma~O!Q0tO!R&lX!c&lX~P){O!R,bO!c'na~O!R,bO!c'na~P!)wO#m!fa!S!fa~PCfO#m!^a!R!^a!S!^a~P#*XO!T1XO#x^O$P1YO~O!S1^O~On1_O~P!BpO_$Yq!R$Yq'W$Yq!O$Yq!c$Yqn$Yq!T$Yq%Q$Yq!]$Yq~P!)wO!O1`O~O],yOk,yO~Ou(SOx(TO'x(XOP$xi'w$xi!R$xi!{$xi~O'a$xi#m$xi~P$.POu(SOx(TOP$zi'w$zi'x$zi!R$zi!{$zi~O'a$zi#m$zi~P$.rO'p#[O~P!BpO!Q1cO']$bO!R&tX!c&tX~O!R-RO!c'}a~O!R-RO!]!wO!c'}a~O!R-RO!]!wO'p&oO!c'}a~O'a$gi!R$gi!{$gi#m$gi~P!#{O!Q1kO'](eO!O&vX!R&vX~P!$jO!R-ZO!O(Oa~O!R-ZO!O(Oa~P!BpO!]!wO~O!]!wO#c1sO~Oj1vO!]!wO'p&oO~O!R'di'a'di~P!#{O!{1yO!R'di'a'di~P!#{O!c1|O~O_$Zq!R$Zq'W$Zq!O$Zq!c$Zqn$Zq!T$Zq%Q$Zq!]$Zq~P!)wO!R2QO!T(PX~P!BpO!T&dO%Q2TO~O!T&dO%Q2TO~P!BpO!T$eX$u[X_$eX!R$eX'W$eX~P!!rO$u2XOPgXugXxgX!TgX'wgX'xgX_gX!RgX'WgX~O$u2XO~O]2_O%R2`O'])iO!R'PX!S'PX~O!R.^O!S(Va~OZ2dO~O^2eO~O]2hO~OP2jO!T&dO!o2iO%Q2TO~O_$^O'W$^O~P!BpO!T#zO~P!BpO!R2oO!{2qO!S(SX~O!S2rO~Ox;oO!W2{O!X2tO!Y2tO!r2zO!s2yO!t2yO!x2xO'^$dO'g(jO'o+iO~O!S2wO~P$7ZOP3SO!T.yO!o3RO%Q3QO~OP3SO!T.yO!o3RO%Q3QO'b$PO~O'](|O!R'OX!S'OX~O!R/VO!S(Ta~O]3^O'g3]O~O]3_O~O^3aO~O!c3dO~P){O_3fO~O_3fO~P){O#c3hO%r3iO~PFOO`/mO!S3mO&Q/lO~P`O!]3oO~O!R#Ti!S#Ti~P#*XO!{3qO!R#Ti!S#Ti~O!R!Vi!S!Vi~P#*XO_$^O!{3xO'W$^O~O_$^O!]!wO!{3xO'W$^O~O!X3|O!Y3|O'^$dO'g(jO'o+iO~O_$^O!]!wO!d$ZO!j3}O!{3xO'W$^O'b$PO'p&oO~O!W4OO~P$;xO!W4OO!u4RO!x4SO~P$;xO_$^O!]!wO!j3}O!{3xO'W$^O'p&oO~O!R'rq!c'rq_'rq'W'rq~P!)wO!R&tO!c'qq~O#W$xiQ$xiZ$xi_$xij$xiv$xi!a$xi!b$xi!d$xi!j$xi#[$xi#]$xi#^$xi#_$xi#`$xi#a$xi#b$xi#c$xi#e$xi#g$xi#i$xi#j$xi'W$xi'f$xi'p$xi!c$xi!O$xi!T$xin$xi%Q$xi!]$xi~P$.PO#W$ziQ$ziZ$zi_$zij$ziv$zi!a$zi!b$zi!d$zi!j$zi#[$zi#]$zi#^$zi#_$zi#`$zi#a$zi#b$zi#c$zi#e$zi#g$zi#i$zi#j$zi'W$zi'f$zi'p$zi!c$zi!O$zi!T$zin$zi%Q$zi!]$zi~P$.rO#W$giQ$giZ$gi_$gij$giv$gi!R$gi!a$gi!b$gi!d$gi!j$gi#[$gi#]$gi#^$gi#_$gi#`$gi#a$gi#b$gi#c$gi#e$gi#g$gi#i$gi#j$gi'W$gi'f$gi'p$gi!c$gi!O$gi!T$gi!{$gin$gi%Q$gi!]$gi~P!BpO!R&ka'a&ka~P!#{O!R&la!c&la~P!)wO!R,bO!c'ni~O#m#Oi!R#Oi!S#Oi~P#*XOQ#^Ou!{Ov!{Ox!|O!b!yO!d!zO!j#^O'fQOZ#Zij#Zi!a#Zi#]#Zi#^#Zi#_#Zi#`#Zi#a#Zi#b#Zi#c#Zi#e#Zi#g#Zi#i#Zi#j#Zi#m#Zi'p#Zi'w#Zi'x#Zi!R#Zi!S#Zi~O#[#Zi~P$EiO#[9eO~P$EiOQ#^Ou!{Ov!{Ox!|O!b!yO!d!zO!j#^O#[9eO#]9fO#^9fO#_9fO'fQOZ#Zi!a#Zi#`#Zi#a#Zi#b#Zi#c#Zi#e#Zi#g#Zi#i#Zi#j#Zi#m#Zi'p#Zi'w#Zi'x#Zi!R#Zi!S#Zi~Oj#Zi~P$GqOj9gO~P$GqOQ#^Oj9gOu!{Ov!{Ox!|O!b!yO!d!zO!j#^O#[9eO#]9fO#^9fO#_9fO#`9hO'fQO#e#Zi#g#Zi#i#Zi#j#Zi#m#Zi'p#Zi'w#Zi'x#Zi!R#Zi!S#Zi~OZ#Zi!a#Zi#a#Zi#b#Zi#c#Zi~P$IyOZ9rO!a9iO#a9iO#b9iO#c9iO~P$IyOQ#^OZ9rOj9gOu!{Ov!{Ox!|O!a9iO!b!yO!d!zO!j#^O#[9eO#]9fO#^9fO#_9fO#`9hO#a9iO#b9iO#c9iO#e9jO'fQO#g#Zi#i#Zi#j#Zi#m#Zi'p#Zi'x#Zi!R#Zi!S#Zi~O'w#Zi~P$L_O'w!}O~P$L_OQ#^OZ9rOj9gOu!{Ov!{Ox!|O!a9iO!b!yO!d!zO!j#^O#[9eO#]9fO#^9fO#_9fO#`9hO#a9iO#b9iO#c9iO#e9jO#g9lO'fQO'w!}O#i#Zi#j#Zi#m#Zi'p#Zi!R#Zi!S#Zi~O'x#Zi~P$NgO'x#OO~P$NgOQ#^OZ9rOj9gOu!{Ov!{Ox!|O!a9iO!b!yO!d!zO!j#^O#[9eO#]9fO#^9fO#_9fO#`9hO#a9iO#b9iO#c9iO#e9jO#g9lO#i9nO'fQO'w!}O'x#OO~O#j#Zi#m#Zi'p#Zi!R#Zi!S#Zi~P%!oO_#ky!R#ky'W#ky!O#ky!c#kyn#ky!T#ky%Q#ky!]#ky~P!)wOP;vOu(SOx(TO'w(VO'x(XO~OQ#ZiZ#Zij#Ziv#Zi!a#Zi!b#Zi!d#Zi!j#Zi#[#Zi#]#Zi#^#Zi#_#Zi#`#Zi#a#Zi#b#Zi#c#Zi#e#Zi#g#Zi#i#Zi#j#Zi#m#Zi'f#Zi'p#Zi!R#Zi!S#Zi~P%%aO!b!yOP'eXu'eXx'eX'w'eX'x'eX!S'eX~OQ'eXZ'eXj'eXv'eX!a'eX!d'eX!j'eX#['eX#]'eX#^'eX#_'eX#`'eX#a'eX#b'eX#c'eX#e'eX#g'eX#i'eX#j'eX#m'eX'f'eX'p'eX!R'eX~P%'eO#m#ni!R#ni!S#ni~P#*XO!S4eO~O!R&sa!S&sa~P#*XO!]!wO'p&oO!R&ta!c&ta~O!R-RO!c'}i~O!R-RO!]!wO!c'}i~O'a$gq!R$gq!{$gq#m$gq~P!#{O!O&va!R&va~P!BpO!]4lO~O!R-ZO!O(Oi~P!BpO!R-ZO!O(Oi~O!O4pO~O!]!wO#c4uO~Oj4vO!]!wO'p&oO~O!O4xO~O'a$iq!R$iq!{$iq#m$iq~P!#{O_$Zy!R$Zy'W$Zy!O$Zy!c$Zyn$Zy!T$Zy%Q$Zy!]$Zy~P!)wO!R2QO!T(Pa~O!T&dO%Q4}O~O!T&dO%Q4}O~P!BpO_#Oy!R#Oy'W#Oy!O#Oy!c#Oyn#Oy!T#Oy%Q#Oy!]#Oy~P!)wOZ5QO~O]5SO'])iO~O!R.^O!S(Vi~O]5VO~O^5WO~O'g'TO!R&{X!S&{X~O!R2oO!S(Sa~O!S5eO~P$7ZOx;sO'g(jO'o+iO~O!W5hO!X5gO!Y5gO!x0_O'^$dO'g(jO'o+iO~O!s5iO!t5iO~P%0^O!X5gO!Y5gO'^$dO'g(jO'o+iO~O!T.yO~O!T.yO%Q5kO~O!T.yO%Q5kO~P!BpOP5pO!T.yO!o5oO%Q5kO~OZ5uO!R'Oa!S'Oa~O!R/VO!S(Ti~O]5xO~O!c5yO~O!c5zO~O!c5{O~O!c5{O~P){O_5}O~O!]6QO~O!c6RO~O!R'ui!S'ui~P#*XO_$^O'W$^O~P!)wO_$^O!{6WO'W$^O~O_$^O!]!wO!{6WO'W$^O~O!X6]O!Y6]O'^$dO'g(jO'o+iO~O_$^O!]!wO!j6^O!{6WO'W$^O'p&oO~O!d$ZO'b$PO~P%4xO!W6_O~P%4gO!R'ry!c'ry_'ry'W'ry~P!)wO#W$gqQ$gqZ$gq_$gqj$gqv$gq!R$gq!a$gq!b$gq!d$gq!j$gq#[$gq#]$gq#^$gq#_$gq#`$gq#a$gq#b$gq#c$gq#e$gq#g$gq#i$gq#j$gq'W$gq'f$gq'p$gq!c$gq!O$gq!T$gq!{$gqn$gq%Q$gq!]$gq~P!BpO#W$iqQ$iqZ$iq_$iqj$iqv$iq!R$iq!a$iq!b$iq!d$iq!j$iq#[$iq#]$iq#^$iq#_$iq#`$iq#a$iq#b$iq#c$iq#e$iq#g$iq#i$iq#j$iq'W$iq'f$iq'p$iq!c$iq!O$iq!T$iq!{$iqn$iq%Q$iq!]$iq~P!BpO!R&li!c&li~P!)wO#m#Oq!R#Oq!S#Oq~P#*XOu-tOv-tOx-uOPra'wra'xra!Sra~OQraZrajra!ara!bra!dra!jra#[ra#]ra#^ra#_ra#`ra#ara#bra#cra#era#gra#ira#jra#mra'fra'pra!Rra~P%;OOu(SOx(TOP$^a'w$^a'x$^a!S$^a~OQ$^aZ$^aj$^av$^a!a$^a!b$^a!d$^a!j$^a#[$^a#]$^a#^$^a#_$^a#`$^a#a$^a#b$^a#c$^a#e$^a#g$^a#i$^a#j$^a#m$^a'f$^a'p$^a!R$^a~P%=SOu(SOx(TOP$`a'w$`a'x$`a!S$`a~OQ$`aZ$`aj$`av$`a!a$`a!b$`a!d$`a!j$`a#[$`a#]$`a#^$`a#_$`a#`$`a#a$`a#b$`a#c$`a#e$`a#g$`a#i$`a#j$`a#m$`a'f$`a'p$`a!R$`a~P%?WOQ$naZ$naj$nav$na!a$na!b$na!d$na!j$na#[$na#]$na#^$na#_$na#`$na#a$na#b$na#c$na#e$na#g$na#i$na#j$na#m$na'f$na'p$na!R$na!S$na~P%%aO#m$Yq!R$Yq!S$Yq~P#*XO#m$Zq!R$Zq!S$Zq~P#*XO!S6hO~O#m6iO~P!#{O!]!wO!R&ti!c&ti~O!]!wO'p&oO!R&ti!c&ti~O!R-RO!c'}q~O!O&vi!R&vi~P!BpO!R-ZO!O(Oq~O!O6oO~P!BpO!O6oO~O!R'dy'a'dy~P!#{O!R&ya!T&ya~P!BpO!T$tq_$tq!R$tq'W$tq~P!BpOZ6vO~O!R.^O!S(Vq~O]6yO~O!T&dO%Q6zO~O!T&dO%Q6zO~P!BpO!{6{O!R&{a!S&{a~O!R2oO!S(Si~P#*XO!X7RO!Y7RO'^$dO'g(jO'o+iO~O!W7TO!x4SO~P%GXO!T.yO%Q7WO~O!T.yO%Q7WO~P!BpO]7_O'g7^O~O!R/VO!S(Tq~O!c7aO~O!c7aO~P){O!c7cO~O!c7dO~O!R#Ty!S#Ty~P#*XO_$^O!{7jO'W$^O~O_$^O!]!wO!{7jO'W$^O~O!X7mO!Y7mO'^$dO'g(jO'o+iO~O_$^O!]!wO!j7nO!{7jO'W$^O'p&oO~O#m#ky!R#ky!S#ky~P#*XOQ$giZ$gij$giv$gi!a$gi!b$gi!d$gi!j$gi#[$gi#]$gi#^$gi#_$gi#`$gi#a$gi#b$gi#c$gi#e$gi#g$gi#i$gi#j$gi#m$gi'f$gi'p$gi!R$gi!S$gi~P%%aOu(SOx(TO'x(XOP$xi'w$xi!S$xi~OQ$xiZ$xij$xiv$xi!a$xi!b$xi!d$xi!j$xi#[$xi#]$xi#^$xi#_$xi#`$xi#a$xi#b$xi#c$xi#e$xi#g$xi#i$xi#j$xi#m$xi'f$xi'p$xi!R$xi~P%LjOu(SOx(TOP$zi'w$zi'x$zi!S$zi~OQ$ziZ$zij$ziv$zi!a$zi!b$zi!d$zi!j$zi#[$zi#]$zi#^$zi#_$zi#`$zi#a$zi#b$zi#c$zi#e$zi#g$zi#i$zi#j$zi#m$zi'f$zi'p$zi!R$zi~P%NnO#m$Zy!R$Zy!S$Zy~P#*XO#m#Oy!R#Oy!S#Oy~P#*XO!]!wO!R&tq!c&tq~O!R-RO!c'}y~O!O&vq!R&vq~P!BpO!O7tO~P!BpO!R.^O!S(Vy~O!R2oO!S(Sq~O!X8QO!Y8QO'^$dO'g(jO'o+iO~O!T.yO%Q8TO~O!T.yO%Q8TO~P!BpO!c8WO~O_$^O!{8]O'W$^O~O_$^O!]!wO!{8]O'W$^O~OQ$gqZ$gqj$gqv$gq!a$gq!b$gq!d$gq!j$gq#[$gq#]$gq#^$gq#_$gq#`$gq#a$gq#b$gq#c$gq#e$gq#g$gq#i$gq#j$gq#m$gq'f$gq'p$gq!R$gq!S$gq~P%%aOQ$iqZ$iqj$iqv$iq!a$iq!b$iq!d$iq!j$iq#[$iq#]$iq#^$iq#_$iq#`$iq#a$iq#b$iq#c$iq#e$iq#g$iq#i$iq#j$iq#m$iq'f$iq'p$iq!R$iq!S$iq~P%%aO'a$|!Z!R$|!Z!{$|!Z#m$|!Z~P!#{O!R&{q!S&{q~P#*XO_$^O!{8oO'W$^O~O#W$|!ZQ$|!ZZ$|!Z_$|!Zj$|!Zv$|!Z!R$|!Z!a$|!Z!b$|!Z!d$|!Z!j$|!Z#[$|!Z#]$|!Z#^$|!Z#_$|!Z#`$|!Z#a$|!Z#b$|!Z#c$|!Z#e$|!Z#g$|!Z#i$|!Z#j$|!Z'W$|!Z'f$|!Z'p$|!Z!c$|!Z!O$|!Z!T$|!Z!{$|!Zn$|!Z%Q$|!Z!]$|!Z~P!BpOP;uOu(SOx(TO'w(VO'x(XO~O!S!za!W!za!X!za!Y!za!r!za!s!za!t!za!x!za'^!za'g!za'o!za~P&,_O!W'eX!X'eX!Y'eX!r'eX!s'eX!t'eX!x'eX'^'eX'g'eX'o'eX~P%'eOQ$|!ZZ$|!Zj$|!Zv$|!Z!a$|!Z!b$|!Z!d$|!Z!j$|!Z#[$|!Z#]$|!Z#^$|!Z#_$|!Z#`$|!Z#a$|!Z#b$|!Z#c$|!Z#e$|!Z#g$|!Z#i$|!Z#j$|!Z#m$|!Z'f$|!Z'p$|!Z!R$|!Z!S$|!Z~P%%aO!Wra!Xra!Yra!rra!sra!tra!xra'^ra'gra'ora~P%;OO!W$^a!X$^a!Y$^a!r$^a!s$^a!t$^a!x$^a'^$^a'g$^a'o$^a~P%=SO!W$`a!X$`a!Y$`a!r$`a!s$`a!t$`a!x$`a'^$`a'g$`a'o$`a~P%?WO!S$na!W$na!X$na!Y$na!r$na!s$na!t$na!x$na'^$na'g$na'o$na~P&,_O!W$xi!X$xi!Y$xi!r$xi!s$xi!t$xi!x$xi'^$xi'g$xi'o$xi~P%LjO!W$zi!X$zi!Y$zi!r$zi!s$zi!t$zi!x$zi'^$zi'g$zi'o$zi~P%NnO!S$gi!W$gi!X$gi!Y$gi!r$gi!s$gi!t$gi!x$gi'^$gi'g$gi'o$gi~P&,_O!S$gq!W$gq!X$gq!Y$gq!r$gq!s$gq!t$gq!x$gq'^$gq'g$gq'o$gq~P&,_O!S$iq!W$iq!X$iq!Y$iq!r$iq!s$iq!t$iq!x$iq'^$iq'g$iq'o$iq~P&,_O!S$|!Z!W$|!Z!X$|!Z!Y$|!Z!r$|!Z!s$|!Z!t$|!Z!x$|!Z'^$|!Z'g$|!Z'o$|!Z~P&,_On'hX~P.jOn[X!O[X!c[X%r[X!T[X%Q[X!][X~P$zO!]dX!c[X!cdX'pdX~P;dOQ9^OR9^O]cOb;`Oc!jOhcOj9^OkcOlcOq9^Os9^OxRO{cO|cO}cO!TSO!_9`O!dUO!g9^O!h9^O!i9^O!j9^O!k9^O!n!iO#t!lO#x^O']'cO'fQO'oYO'|;^O~O]#qOh$QOj#rOk#qOl#qOq$ROs9uOx#yO!T#zO!_;fO!d#vO#V:OO#t$VO$_9xO$a9{O$d$WO']&{O'b$PO'f#sO~O!R9pO!S$]a~O]#qOh$QOj#rOk#qOl#qOq$ROs9vOx#yO!T#zO!_;gO!d#vO#V:PO#t$VO$_9yO$a9|O$d$WO']&{O'b$PO'f#sO~O#d'jO~P&]P!AQ!AY!A^!A^P!>YP!Ab!AbP!DVP!DZ?Z?Z!Da!GT8SP8SP8S8SP!HW8S8S!Jf8S!M_8S# g8S8S#!T#$c#$c#$g#$c#$oP#$cP8S#%k8S#'X8S8S-zPPP#(yPP#)c#)cP#)cP#)x#)cPP#*OP#)uP#)u#*b!!X#)u#+P#+V#+Y([#+]([P#+d#+d#+dP([P([P([P([PP([P#+j#+mP#+m([P#+qP#+tP([P([P([P([P([P([([#+z#,U#,[#,b#,p#,v#,|#-W#-^#-m#-s#.R#.X#._#.m#/S#0z#1Y#1`#1f#1l#1r#1|#2S#2Y#2d#2v#2|PPPPPPPP#3SPP#3v#7OPP#8f#8m#8uPP#>a#@t#Fp#Fs#Fv#GR#GUPP#GX#G]#Gz#Hq#Hu#IZPP#I_#Ie#IiP#Il#Ip#Is#Jc#Jy#KO#KR#KU#K[#K_#Kc#KgmhOSj}!n$]%c%f%g%i*o*t/g/jQ$imQ$ppQ%ZyS&V!b+`Q&k!jS(l#z(qQ)g$jQ)t$rQ*`%TQ+f&^S+k&d+mQ+}&lQ-k(sQ/U*aY0Z+o+p+q+r+sS2t.y2vU3|0[0^0aU5g2y2z2{S6]4O4RS7R5h5iQ7m6_R8Q7T$p[ORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%c%e%f%g%i%m%x%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8o!j'e#]#k&W'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aQ(}$SQ)l$lQ*b%WQ*i%`Q,X9tQ.W)aQ.c)mQ/^*gQ2_.^Q3Z/VQ4^9vQ5S2`R8{9upeOSjy}!n$]%Y%c%f%g%i*o*t/g/jR*d%[&WVOSTjkn}!S!W!k!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k$]$n%[%_%`%c%e%f%g%i%m%z&S&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;`;a[!cRU!]!`%x&WQ$clQ$hmS$mp$rv$wrs!r!u$Z$u&`&t&w)x)y)z*m+Y+h,S,U/o0lQ%PwQ&h!iQ&j!jS(_#v(cS)f$i$jQ)j$lQ)w$tQ*Z%RQ*_%TS+|&k&lQ-V(`Q.[)gQ.b)mQ.d)nQ.g)rQ/P*[S/T*`*aQ0h+}Q1b-RQ2^.^Q2b.aQ2g.iQ3Y/UQ4i1cQ5R2`Q5U2dQ6u5QR7w6vx#xa!y$T$U$Y(W(Y(b(w(x,_-Y-w1a1y6i;^;i;j;k!Y$fm!j$h$i$j&U&j&k&l(k)f)g+]+j+|+}-d.[0Q0W0]0h1u3{4Q6Z7k8^Q)`$cQ*P$|Q*S$}Q*^%TQ.k)wQ/O*ZU/S*_*`*aQ3T/PS3X/T/UQ5b2sQ5t3YS7P5c5fS8O7Q7SQ8f8PQ8u8g#[;b!w#d#v#y&g'}(Z(h)])_)a*O*R+y-Z-].R.T.p.s.{.}1k1s2Q2T2X2j3Q3S4l4u4}5k5p6z7W8T9w9z9}:U:X:[:a:d:j;l;n;t;u;vd;c9d9x9{:O:V:Y:]:b:e:ke;d9r9y9|:P:W:Z:^:c:f:lW#}a$P(y;^S$|t%YQ$}uQ%OvR)}$z%P#|a!w!y#d#v#y$T$U$Y&g'}(W(Y(Z(b(h(w(x)])_)a*O*R+y,_-Y-Z-]-w.R.T.p.s.{.}1a1k1s1y2Q2T2X2j3Q3S4l4u4}5k5p6i6z7W8T9d9r9w9x9y9z9{9|9}:O:P:U:V:W:X:Y:Z:[:]:^:a:b:c:d:e:f:j:k:l;^;i;j;k;l;n;t;u;vT(O#s(PX)O$S9t9u9vU&Z!b$v+cQ'U!{Q)q$oQ.t*TQ1z-tR5^2o&^cORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k$]$n%[%_%`%c%e%f%g%i%m%x%z&S&W&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;a$]#aZ!_!o$a%w%}&y'Q'W'X'Y'Z'[']'^'_'`'a'b'd'g'k'u)p+R+^+g,O,^,d,g,i,w-x/v/y0i0s0w0x0y0z0{0|0}1O1P1Q1R1S1T1W1]2O2[3s3v4W4[4]4b4c5`6S6V6b6f6g7g7z8Z8m8y9_:|T!XQ!Y&_cORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k$]$n%[%_%`%c%e%f%g%i%m%x%z&S&W&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aQ&X!bR/|+`Y&R!b&V&^+`+fS(k#z(qS+j&d+mS-d(l(sQ-e(mQ-l(tQ.v*VU0W+k+o+pU0]+q+r+sS0b+t2xQ1u-kQ1w-mQ1x-nS2s.y2vU3{0Z0[0^Q4P0_Q4Q0aS5c2t2{S5f2y2zU6Z3|4O4RQ6`4SS7Q5g5hQ7S5iS7k6]6_S8P7R7TQ8^7mQ8g8QQ;h;oR;m;slhOSj}!n$]%c%f%g%i*o*t/g/jQ%k!QS&x!v9cQ)d$gQ*X%PQ*Y%QQ+z&iS,]&}:RS-y)V:_Q.Y)eQ.x*WQ/n*vQ/p*wQ/x+ZQ0`+qQ0f+{S2P-z:gQ2Y.ZS2].]:hQ3r/zQ3u0RQ4U0gQ5P2ZQ6T3tQ6X3zQ6a4VQ7e6RQ7h6YQ8Y7iQ8l8[R8x8n$W#`Z!_!o%w%}&y'Q'W'X'Y'Z'[']'^'_'`'a'b'd'g'k'u)p+R+^+g,O,^,d,g,w-x/v/y0i0s0w0x0y0z0{0|0}1O1P1Q1R1S1T1W1]2O2[3s3v4W4[4]4b4c5`6S6V6b6f6g7g7z8Z8m8y9_:|W(v#{&|1V8qT)Z$a,i$W#_Z!_!o%w%}&y'Q'W'X'Y'Z'[']'^'_'`'a'b'd'g'k'u)p+R+^+g,O,^,d,g,w-x/v/y0i0s0w0x0y0z0{0|0}1O1P1Q1R1S1T1W1]2O2[3s3v4W4[4]4b4c5`6S6V6b6f6g7g7z8Z8m8y9_:|Q'f#`S)Y$a,iR-{)Z&^cORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k$]$n%[%_%`%c%e%f%g%i%m%x%z&S&W&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aQ%f{Q%g|Q%i!OQ%j!PR/f*rQ&e!iQ)[$cQ+w&hS.Q)`)wS0c+u+vW2S-}.O.P.kS4T0d0eU4|2U2V2WU6s4{5Y5ZQ7v6tR8b7yT+l&d+mS+j&d+mU0W+k+o+pU0]+q+r+sS0b+t2xS2s.y2vU3{0Z0[0^Q4P0_Q4Q0aS5c2t2{S5f2y2zU6Z3|4O4RQ6`4SS7Q5g5hQ7S5iS7k6]6_S8P7R7TQ8^7mR8g8QS+l&d+mT2u.y2vS&r!q/dQ-U(_Q-b(kS0V+j2sQ1g-VS1p-c-lU3}0]0b5fQ4h1bS4s1v1xU6^4P4Q7SQ6k4iQ6r4vR7n6`Q!xXS&q!q/dQ)W$[Q)b$eQ)h$kQ,Q&rQ-T(_Q-a(kQ-f(nQ.X)cQ/Q*]S0U+j2sS1f-U-VS1o-b-lQ1r-eQ1t-gQ3V/RW3y0V0]0b5fQ4g1bQ4k1gS4o1p1xQ4t1wQ5r3WW6[3}4P4Q7SS6j4h4iS6n4p:iQ6p4sQ6}5aQ7[5sS7l6^6`Q7r6kS7s6o:mQ7u6rQ7|7OQ8V7]Q8_7nS8a7t:nQ8d7}Q8s8eQ9Q8tQ9X9RQ:u:pQ;T:zQ;U:{Q;V;hR;[;m$rWORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%`%c%e%f%g%i%m%x%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8oS!xn!k!j:o#]#k&W'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aR:u;`$rXORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%`%c%e%f%g%i%m%x%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8oQ$[b!Y$em!j$h$i$j&U&j&k&l(k)f)g+]+j+|+}-d.[0Q0W0]0h1u3{4Q6Z7k8^S$kn!kQ)c$fQ*]%TW/R*^*_*`*aU3W/S/T/UQ5a2sS5s3X3YU7O5b5c5fQ7]5tU7}7P7Q7SS8e8O8PS8t8f8gQ9R8u!j:p#]#k&W'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aQ:z;_R:{;`$f]OSTjk}!S!W!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%c%e%f%g%i%m%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8oY!hRU!]!`%xv$wrs!r!u$Z$u&`&t&w)x)y)z*m+Y+h,S,U/o0lQ*j%`!h:q#]#k'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aR:t&WS&[!b$vR0O+c$p[ORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%c%e%f%g%i%m%x%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8o!j'e#]#k&W'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aR*i%`$roORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%`%c%e%f%g%i%m%x%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8oQ'U!{!k:r#]#k&W'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;a!h#VZ!_$a%w%}&y'Q'_'`'a'b'g'k)p+R+g,O,^,d,w-x0i0s1T2O2[3v4W4[6V7g8Z8m8y9_!R9k'd'u+^,i/v/y0w1P1Q1R1S1W1]3s4]4b4c5`6S6b6f6g7z:|!d#XZ!_$a%w%}&y'Q'a'b'g'k)p+R+g,O,^,d,w-x0i0s1T2O2[3v4W4[6V7g8Z8m8y9_}9m'd'u+^,i/v/y0w1R1S1W1]3s4]4b4c5`6S6b6f6g7z:|!`#]Z!_$a%w%}&y'Q'g'k)p+R+g,O,^,d,w-x0i0s1T2O2[3v4W4[6V7g8Z8m8y9_Q1a-Px;a'd'u+^,i/v/y0w1W1]3s4]4b4c5`6S6b6f6g7z:|Q;i;pQ;j;qR;k;r&^cORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k$]$n%[%_%`%c%e%f%g%i%m%x%z&S&W&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aS#l`#mR1Y,l&e_ORSTU`jk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k#m$]$n%[%_%`%c%e%f%g%i%m%x%z&S&W&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,l,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aS#g^#nT'n#i'rT#h^#nT'p#i'r&e`ORSTU`jk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#]#b#e#k#m$]$n%[%_%`%c%e%f%g%i%m%x%z&S&W&_&f&p&}'R'w(R)V)^*k*o*t+T+X+[+x,P,b,h,l,m-u-z.S.].|/_/`/a/c/g/j/l/{0T0j0t1X2i2q3R3f3h3i3q3x5o5}6W6{7j8]8o9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;aT#l`#mQ#o`R'y#m$rbORSTUjk}!S!W!]!`!n!v!z!|#P#Q#R#S#T#U#V#W#X#Y#Z#b#e$]$n%[%_%`%c%e%f%g%i%m%x%z&S&_&f&p&}'R(R)V)^*k*o*t+T+x,P,b,h-u-z.S.].|/_/`/a/c/g/j/l0T0j0t2i3R3f3h3i3x5o5}6W7j8]8o!k;_#]#k&W'w+X+[,m/{1X2q3q6{9^9`9c9e9f9g9h9i9j9k9l9m9n9o9p9s:Q:R:T:_:`:g:h;a#RdOSUj}!S!W!n!|#k$]%[%_%`%c%e%f%g%i%m&S&f'w)^*k*o*t+x,m-u.S.|/_/`/a/c/g/j/l1X2i3R3f3h3i5o5}x#{a!y$T$U$Y(W(Y(b(w(x,_-Y-w1a1y6i;^;i;j;k#[&|!w#d#v#y&g'}(Z(h)])_)a*O*R+y-Z-].R.T.p.s.{.}1k1s2Q2T2X2j3Q3S4l4u4}5k5p6z7W8T9w9z9}:U:X:[:a:d:j;l;n;t;u;vQ)S$WQ,x(Sd1V9r9y9|:P:W:Z:^:c:f:le8q9d9x9{:O:V:Y:]:b:e:kx#wa!y$T$U$Y(W(Y(b(w(x,_-Y-w1a1y6i;^;i;j;kQ(d#xS(n#z(qQ)T$XQ-g(o#[:w!w#d#v#y&g'}(Z(h)])_)a*O*R+y-Z-].R.T.p.s.{.}1k1s2Q2T2X2j3Q3S4l4u4}5k5p6z7W8T9w9z9}:U:X:[:a:d:j;l;n;t;u;vd:x9d9x9{:O:V:Y:]:b:e:kd:y9r9y9|:P:W:Z:^:c:f:lQ:};bQ;O;cQ;P;dQ;Q;eQ;R;fR;S;gx#{a!y$T$U$Y(W(Y(b(w(x,_-Y-w1a1y6i;^;i;j;k#[&|!w#d#v#y&g'}(Z(h)])_)a*O*R+y-Z-].R.T.p.s.{.}1k1s2Q2T2X2j3Q3S4l4u4}5k5p6z7W8T9w9z9}:U:X:[:a:d:j;l;n;t;u;vd1V9r9y9|:P:W:Z:^:c:f:le8q9d9x9{:O:V:Y:]:b:e:klfOSj}!n$]%c%f%g%i*o*t/g/jQ(g#yQ*}%pQ+O%rR1j-Z%O#|a!w!y#d#v#y$T$U$Y&g'}(W(Y(Z(b(h(w(x)])_)a*O*R+y,_-Y-Z-]-w.R.T.p.s.{.}1a1k1s1y2Q2T2X2j3Q3S4l4u4}5k5p6i6z7W8T9d9r9w9x9y9z9{9|9}:O:P:U:V:W:X:Y:Z:[:]:^:a:b:c:d:e:f:j:k:l;^;i;j;k;l;n;t;u;vQ*Q$}Q.r*SQ2m.qR5]2nT(p#z(qS(p#z(qT2u.y2vQ)b$eQ-f(nQ.X)cQ/Q*]Q3V/RQ5r3WQ6}5aQ7[5sQ7|7OQ8V7]Q8d7}Q8s8eQ9Q8tR9X9Rp(W#t'O)U-X-o-p0q1h1}4f4w7q:v;W;X;Y!n:U&z'i(^(f+v,[,t-P-^-|.P.o.q0e0p1i1m2W2l2n3O4Y4Z4m4q4y5O5Z5n6m6q7Y8`;Z;];p;q;r[:V8p9O9V9Y9Z9]]:W1U4a6c7o7p8zr(Y#t'O)U,}-X-o-p0q1h1}4f4w7q:v;W;X;Y!p:X&z'i(^(f+v,[,t-P-^-|.P.o.q0e0n0p1i1m2W2l2n3O4Y4Z4m4q4y5O5Z5n6m6q7Y8`;Z;];p;q;r^:Y8p9O9T9V9Y9Z9]_:Z1U4a6c6d7o7p8zpeOSjy}!n$]%Y%c%f%g%i*o*t/g/jQ%VxR*k%`peOSjy}!n$]%Y%c%f%g%i*o*t/g/jR%VxQ*U%OR.n)}qeOSjy}!n$]%Y%c%f%g%i*o*t/g/jQ.z*ZS3P/O/PW5j2|2}3O3TU7V5l5m5nU8R7U7X7YQ8h8SR8v8iQ%^yR*e%YR3^/XR7_5uS$mp$rR.d)nQ%czR*o%dR*u%jT/h*t/jR*y%kQ*x%kR/q*yQjOQ!nST$`j!nQ(P#sR,u(PQ!YQR%u!YQ!^RU%{!^%|+UQ%|!_R+U%}Q+a&XR/}+aQ,`'OR0r,`Q,c'QS0u,c0vR0v,dQ+m&dR0X+mS!eR$uU&a!e&b+VQ&b!fR+V&OQ+d&[R0P+dQ&u!sQ,R&sU,V&u,R0mR0m,WQ'r#iR,n'rQ#m`R'x#mQ#cZU'h#c+Q9qQ+Q9_R9q'uQ-S(_W1d-S1e4j6lU1e-T-U-VS4j1f1gR6l4k$k(U#t&z'O'i(^(f)P)Q)U+v,Y,Z,[,t,}-O-P-X-^-o-p-|.P.o.q0e0n0o0p0q1U1h1i1m1}2W2l2n3O4Y4Z4_4`4a4f4m4q4w4y5O5Z5n6c6d6e6m6q7Y7o7p7q8`8p8z8|8}9O9T9U9V9Y9Z9]:v;W;X;Y;Z;];p;q;rQ-[(fU1l-[1n4nQ1n-^R4n1mQ(q#zR-i(qQ(z$OR-r(zQ2R-|R4z2RQ){$xR.m){Q2p.tS5_2p6|R6|5`Q*W%PR.w*WQ2v.yR5d2vQ/W*bS3[/W5vR5v3^Q._)jW2a._2c5T6wQ2c.bQ5T2bR6w5UQ)o$mR.e)oQ/j*tR3l/jWiOSj!nQ%h}Q)X$]Q*n%cQ*p%fQ*q%gQ*s%iQ/e*oS/h*t/jR3k/gQ$_gQ%l!RQ%o!TQ%q!UQ%s!VQ)v$sQ)|$yQ*d%^Q*{%nQ-h(pS/Z*e*hQ/r*zQ/s*}Q/t+OS0S+j2sQ2f.hQ2k.oQ3U/QQ3`/]Q3j/fY3w0U0V0]0b5fQ5X2hQ5[2lQ5q3VQ5w3_[6U3v3y3}4P4Q7SQ6x5VQ7Z5rQ7`5xW7f6V6[6^6`Q7x6yQ7{6}Q8U7[U8X7g7l7nQ8c7|Q8j8VS8k8Z8_Q8r8dQ8w8mQ9P8sQ9S8yQ9W9QR9[9XQ$gmQ&i!jU)e$h$i$jQ+Z&UU+{&j&k&lQ-`(kS.Z)f)gQ/z+]Q0R+jS0g+|+}Q1q-dQ2Z.[Q3t0QS3z0W0]Q4V0hQ4r1uS6Y3{4QQ7i6ZQ8[7kR8n8^S#ua;^R({$PU$Oa$P;^R-q(yQ#taS&z!w)aQ'O!yQ'i#dQ(^#vQ(f#yQ)P$TQ)Q$UQ)U$YQ+v&gQ,Y9wQ,Z9zQ,[9}Q,t'}Q,}(WQ-O(YQ-P(ZQ-X(bQ-^(hQ-o(wQ-p(xd-|)].R.{2T3Q4}5k6z7W8TQ.P)_Q.o*OQ.q*RQ0e+yQ0n:UQ0o:XQ0p:[Q0q,_Q1U9rQ1h-YQ1i-ZQ1m-]Q1}-wQ2W.TQ2l.pQ2n.sQ3O.}Q4Y:aQ4Z:dQ4_9yQ4`9|Q4a:PQ4f1aQ4m1kQ4q1sQ4w1yQ4y2QQ5O2XQ5Z2jQ5n3SQ6c:^Q6d:WQ6e:ZQ6m4lQ6q4uQ7Y5pQ7o:cQ7p:fQ7q6iQ8`:jQ8p9dQ8z:lQ8|9xQ8}9{Q9O:OQ9T:VQ9U:YQ9V:]Q9Y:bQ9Z:eQ9]:kQ:v;^Q;W;iQ;X;jQ;Y;kQ;Z;lQ;];nQ;p;tQ;q;uR;r;vlgOSj}!n$]%c%f%g%i*o*t/g/jS!pU%eQ%n!SQ%t!WQ'V!|Q'v#kS*h%[%_Q*l%`Q*z%mQ+W&SQ+u&fQ,r'wQ.O)^Q/b*kQ0d+xQ1[,mQ1{-uQ2V.SQ2}.|Q3b/_Q3c/`Q3e/aQ3g/cQ3n/lQ4d1XQ5Y2iQ5m3RQ5|3fQ6O3hQ6P3iQ7X5oR7b5}!vZOSUj}!S!n!|$]%[%_%`%c%e%f%g%i%m&S&f)^*k*o*t+x-u.S.|/_/`/a/c/g/j/l2i3R3f3h3i5o5}Q!_RQ!oTQ$akS%w!]%zQ%}!`Q&y!vQ'Q!zQ'W#PQ'X#QQ'Y#RQ'Z#SQ'[#TQ']#UQ'^#VQ'_#WQ'`#XQ'a#YQ'b#ZQ'd#]Q'g#bQ'k#eW'u#k'w,m1XQ)p$nS+R%x+TS+^&W/{Q+g&_Q,O&pQ,^&}Q,d'RQ,g9^Q,i9`Q,w(RQ-x)VQ/v+XQ/y+[Q0i,PQ0s,bQ0w9cQ0x9eQ0y9fQ0z9gQ0{9hQ0|9iQ0}9jQ1O9kQ1P9lQ1Q9mQ1R9nQ1S9oQ1T,hQ1W9sQ1]9pQ2O-zQ2[.]Q3s:QQ3v0TQ4W0jQ4[0tQ4]:RQ4b:TQ4c:_Q5`2qQ6S3qQ6V3xQ6b:`Q6f:gQ6g:hQ7g6WQ7z6{Q8Z7jQ8m8]Q8y8oQ9_!WR:|;aR!aRR&Y!bS&U!b+`S+]&V&^R0Q+fR'P!yR'S!zT!tU$ZS!sU$ZU$xrs*mS&s!r!uQ,T&tQ,W&wQ.l)zS0k,S,UR4X0l`!dR!]!`$u%x&`)x+hh!qUrs!r!u$Z&t&w)z,S,U0lQ/d*mQ/w+YQ3p/oT:s&W)yT!gR$uS!fR$uS%y!]&`S&O!`)xS+S%x+hT+_&W)yT&]!b$vQ#i^R'{#nT'q#i'rR1Z,lT(a#v(cR(i#yQ-})]Q2U.RQ2|.{Q4{2TQ5l3QQ6t4}Q7U5kQ7y6zQ8S7WR8i8TlhOSj}!n$]%c%f%g%i*o*t/g/jQ%]yR*d%YV$yrs*mR.u*TR*c%WQ$qpR)u$rR)k$lT%az%dT%bz%dT/i*t/j",nodeNames:"\u26A0 extends ArithOp ArithOp InterpolationStart LineComment BlockComment Script ExportDeclaration export Star as VariableName String from ; default FunctionDeclaration async function VariableDefinition TypeParamList TypeDefinition ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Interpolation null super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression await yield delete LogicOp BitOp ParenthesizedExpression ClassExpression class extends ClassBody MethodDeclaration Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression PrivatePropertyName BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody MethodDeclaration AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement",maxTerm:332,context:Za,nodeProps:[["closedBy",4,"InterpolationEnd",40,"]",51,"}",66,")",132,"JSXSelfCloseEndTag JSXEndTag",146,"JSXEndTag"],["group",-26,8,15,17,58,184,188,191,192,194,197,200,211,213,219,221,223,225,228,234,240,242,244,246,248,250,251,"Statement",-30,12,13,24,27,28,41,43,44,45,47,52,60,68,74,75,91,92,101,103,119,122,124,125,126,127,129,130,148,149,151,"Expression",-22,23,25,29,32,34,152,154,156,157,159,160,161,163,164,165,167,168,169,178,180,182,183,"Type",-3,79,85,90,"ClassItem"],["openedBy",30,"InterpolationStart",46,"[",50,"{",65,"(",131,"JSXStartTag",141,"JSXStartTag JSXStartCloseTag"]],propSources:[qa],skippedNodes:[0,5,6],repeatNodeCount:28,tokenData:"!C}~R!`OX%TXY%cYZ'RZ[%c[]%T]^'R^p%Tpq%cqr'crs(kst0htu2`uv4pvw5ewx6cxyk|}?O}!O>k!O!P?`!P!QCl!Q!R!0[!R![!1q![!]!7s!]!^!8V!^!_!8g!_!`!9d!`!a!:[!a!b!U#R#S2`#S#T!>i#T#o2`#o#p!>y#p#q!?O#q#r!?f#r#s!?x#s$f%T$f$g%c$g#BY2`#BY#BZ!@Y#BZ$IS2`$IS$I_!@Y$I_$I|2`$I|$I}!Bq$I}$JO!Bq$JO$JT2`$JT$JU!@Y$JU$KV2`$KV$KW!@Y$KW&FU2`&FU&FV!@Y&FV?HT2`?HT?HU!@Y?HU~2`W%YR$UWO!^%T!_#o%T#p~%T7Z%jg$UW'Y7ROX%TXY%cYZ%TZ[%c[p%Tpq%cq!^%T!_#o%T#p$f%T$f$g%c$g#BY%T#BY#BZ%c#BZ$IS%T$IS$I_%c$I_$JT%T$JT$JU%c$JU$KV%T$KV$KW%c$KW&FU%T&FU&FV%c&FV?HT%T?HT?HU%c?HU~%T7Z'YR$UW'Z7RO!^%T!_#o%T#p~%T$T'jS$UW!j#{O!^%T!_!`'v!`#o%T#p~%T$O'}S#e#v$UWO!^%T!_!`(Z!`#o%T#p~%T$O(bR#e#v$UWO!^%T!_#o%T#p~%T)X(rZ$UW]#eOY(kYZ)eZr(krs*rs!^(k!^!_+U!_#O(k#O#P-b#P#o(k#o#p+U#p~(k&r)jV$UWOr)ers*Ps!^)e!^!_*a!_#o)e#o#p*a#p~)e&r*WR$P&j$UWO!^%T!_#o%T#p~%T&j*dROr*ars*ms~*a&j*rO$P&j)X*{R$P&j$UW]#eO!^%T!_#o%T#p~%T)P+ZV]#eOY+UYZ*aZr+Urs+ps#O+U#O#P+w#P~+U)P+wO$P&j]#e)P+zROr+Urs,Ts~+U)P,[U$P&j]#eOY,nZr,nrs-Vs#O,n#O#P-[#P~,n#e,sU]#eOY,nZr,nrs-Vs#O,n#O#P-[#P~,n#e-[O]#e#e-_PO~,n)X-gV$UWOr(krs-|s!^(k!^!_+U!_#o(k#o#p+U#p~(k)X.VZ$P&j$UW]#eOY.xYZ%TZr.xrs/rs!^.x!^!_,n!_#O.x#O#P0S#P#o.x#o#p,n#p~.x#m/PZ$UW]#eOY.xYZ%TZr.xrs/rs!^.x!^!_,n!_#O.x#O#P0S#P#o.x#o#p,n#p~.x#m/yR$UW]#eO!^%T!_#o%T#p~%T#m0XT$UWO!^.x!^!_,n!_#o.x#o#p,n#p~.x3]0mZ$UWOt%Ttu1`u!^%T!_!c%T!c!}1`!}#R%T#R#S1`#S#T%T#T#o1`#p$g%T$g~1`3]1g]$UW'o3TOt%Ttu1`u!Q%T!Q![1`![!^%T!_!c%T!c!}1`!}#R%T#R#S1`#S#T%T#T#o1`#p$g%T$g~1`7Z2k_$UW#zS']$y'g3SOt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$g%T$g~2`[3q_$UW#zSOt%Ttu3ju}%T}!O3j!O!Q%T!Q![3j![!^%T!_!c%T!c!}3j!}#R%T#R#S3j#S#T%T#T#o3j#p$g%T$g~3j$O4wS#^#v$UWO!^%T!_!`5T!`#o%T#p~%T$O5[R$UW#o#vO!^%T!_#o%T#p~%T5b5lU'x5Y$UWOv%Tvw6Ow!^%T!_!`5T!`#o%T#p~%T$O6VS$UW#i#vO!^%T!_!`5T!`#o%T#p~%T)X6jZ$UW]#eOY6cYZ7]Zw6cwx*rx!^6c!^!_8T!_#O6c#O#P:T#P#o6c#o#p8T#p~6c&r7bV$UWOw7]wx*Px!^7]!^!_7w!_#o7]#o#p7w#p~7]&j7zROw7wwx*mx~7w)P8YV]#eOY8TYZ7wZw8Twx+px#O8T#O#P8o#P~8T)P8rROw8Twx8{x~8T)P9SU$P&j]#eOY9fZw9fwx-Vx#O9f#O#P9}#P~9f#e9kU]#eOY9fZw9fwx-Vx#O9f#O#P9}#P~9f#e:QPO~9f)X:YV$UWOw6cwx:ox!^6c!^!_8T!_#o6c#o#p8T#p~6c)X:xZ$P&j$UW]#eOY;kYZ%TZw;kwx/rx!^;k!^!_9f!_#O;k#O#PW{!^%T!_!`5T!`#o%T#p~%T$O>_S#[#v$UWO!^%T!_!`5T!`#o%T#p~%T%w>rSj%o$UWO!^%T!_!`5T!`#o%T#p~%T&i?VR!R&a$UWO!^%T!_#o%T#p~%T7Z?gVu5^$UWO!O%T!O!P?|!P!Q%T!Q![@r![!^%T!_#o%T#p~%T!{@RT$UWO!O%T!O!P@b!P!^%T!_#o%T#p~%T!{@iR!Q!s$UWO!^%T!_#o%T#p~%T!{@yZ$UWk!sO!Q%T!Q![@r![!^%T!_!g%T!g!hAl!h#R%T#R#S@r#S#X%T#X#YAl#Y#o%T#p~%T!{AqZ$UWO{%T{|Bd|}%T}!OBd!O!Q%T!Q![CO![!^%T!_#R%T#R#SCO#S#o%T#p~%T!{BiV$UWO!Q%T!Q![CO![!^%T!_#R%T#R#SCO#S#o%T#p~%T!{CVV$UWk!sO!Q%T!Q![CO![!^%T!_#R%T#R#SCO#S#o%T#p~%T7ZCs`$UW#]#vOYDuYZ%TZzDuz{Jl{!PDu!P!Q!-e!Q!^Du!^!_Fx!_!`!.^!`!a!/]!a!}Du!}#OHq#O#PJQ#P#oDu#o#pFx#p~DuXD|[$UW}POYDuYZ%TZ!PDu!P!QEr!Q!^Du!^!_Fx!_!}Du!}#OHq#O#PJQ#P#oDu#o#pFx#p~DuXEy_$UW}PO!^%T!_#Z%T#Z#[Er#[#]%T#]#^Er#^#a%T#a#bEr#b#g%T#g#hEr#h#i%T#i#jEr#j#m%T#m#nEr#n#o%T#p~%TPF}V}POYFxZ!PFx!P!QGd!Q!}Fx!}#OG{#O#PHh#P~FxPGiU}P#Z#[Gd#]#^Gd#a#bGd#g#hGd#i#jGd#m#nGdPHOTOYG{Z#OG{#O#PH_#P#QFx#Q~G{PHbQOYG{Z~G{PHkQOYFxZ~FxXHvY$UWOYHqYZ%TZ!^Hq!^!_G{!_#OHq#O#PIf#P#QDu#Q#oHq#o#pG{#p~HqXIkV$UWOYHqYZ%TZ!^Hq!^!_G{!_#oHq#o#pG{#p~HqXJVV$UWOYDuYZ%TZ!^Du!^!_Fx!_#oDu#o#pFx#p~Du7ZJs^$UW}POYJlYZKoZzJlz{NQ{!PJl!P!Q!,R!Q!^Jl!^!_!!]!_!}Jl!}#O!'|#O#P!+a#P#oJl#o#p!!]#p~Jl7ZKtV$UWOzKoz{LZ{!^Ko!^!_M]!_#oKo#o#pM]#p~Ko7ZL`X$UWOzKoz{LZ{!PKo!P!QL{!Q!^Ko!^!_M]!_#oKo#o#pM]#p~Ko7ZMSR$UWU7RO!^%T!_#o%T#p~%T7RM`ROzM]z{Mi{~M]7RMlTOzM]z{Mi{!PM]!P!QM{!Q~M]7RNQOU7R7ZNX^$UW}POYJlYZKoZzJlz{NQ{!PJl!P!Q! T!Q!^Jl!^!_!!]!_!}Jl!}#O!'|#O#P!+a#P#oJl#o#p!!]#p~Jl7Z! ^_$UWU7R}PO!^%T!_#Z%T#Z#[Er#[#]%T#]#^Er#^#a%T#a#bEr#b#g%T#g#hEr#h#i%T#i#jEr#j#m%T#m#nEr#n#o%T#p~%T7R!!bY}POY!!]YZM]Zz!!]z{!#Q{!P!!]!P!Q!&x!Q!}!!]!}#O!$`#O#P!&f#P~!!]7R!#VY}POY!!]YZM]Zz!!]z{!#Q{!P!!]!P!Q!#u!Q!}!!]!}#O!$`#O#P!&f#P~!!]7R!#|UU7R}P#Z#[Gd#]#^Gd#a#bGd#g#hGd#i#jGd#m#nGd7R!$cWOY!$`YZM]Zz!$`z{!${{#O!$`#O#P!&S#P#Q!!]#Q~!$`7R!%OYOY!$`YZM]Zz!$`z{!${{!P!$`!P!Q!%n!Q#O!$`#O#P!&S#P#Q!!]#Q~!$`7R!%sTU7ROYG{Z#OG{#O#PH_#P#QFx#Q~G{7R!&VTOY!$`YZM]Zz!$`z{!${{~!$`7R!&iTOY!!]YZM]Zz!!]z{!#Q{~!!]7R!&}_}POzM]z{Mi{#ZM]#Z#[!&x#[#]M]#]#^!&x#^#aM]#a#b!&x#b#gM]#g#h!&x#h#iM]#i#j!&x#j#mM]#m#n!&x#n~M]7Z!(R[$UWOY!'|YZKoZz!'|z{!(w{!^!'|!^!_!$`!_#O!'|#O#P!*o#P#QJl#Q#o!'|#o#p!$`#p~!'|7Z!(|^$UWOY!'|YZKoZz!'|z{!(w{!P!'|!P!Q!)x!Q!^!'|!^!_!$`!_#O!'|#O#P!*o#P#QJl#Q#o!'|#o#p!$`#p~!'|7Z!*PY$UWU7ROYHqYZ%TZ!^Hq!^!_G{!_#OHq#O#PIf#P#QDu#Q#oHq#o#pG{#p~Hq7Z!*tX$UWOY!'|YZKoZz!'|z{!(w{!^!'|!^!_!$`!_#o!'|#o#p!$`#p~!'|7Z!+fX$UWOYJlYZKoZzJlz{NQ{!^Jl!^!_!!]!_#oJl#o#p!!]#p~Jl7Z!,Yc$UW}POzKoz{LZ{!^Ko!^!_M]!_#ZKo#Z#[!,R#[#]Ko#]#^!,R#^#aKo#a#b!,R#b#gKo#g#h!,R#h#iKo#i#j!,R#j#mKo#m#n!,R#n#oKo#o#pM]#p~Ko7Z!-lV$UWT7ROY!-eYZ%TZ!^!-e!^!_!.R!_#o!-e#o#p!.R#p~!-e7R!.WQT7ROY!.RZ~!.R$P!.g[$UW#o#v}POYDuYZ%TZ!PDu!P!QEr!Q!^Du!^!_Fx!_!}Du!}#OHq#O#PJQ#P#oDu#o#pFx#p~Du]!/f[#wS$UW}POYDuYZ%TZ!PDu!P!QEr!Q!^Du!^!_Fx!_!}Du!}#OHq#O#PJQ#P#oDu#o#pFx#p~Du!{!0cd$UWk!sO!O%T!O!P@r!P!Q%T!Q![!1q![!^%T!_!g%T!g!hAl!h#R%T#R#S!1q#S#U%T#U#V!3X#V#X%T#X#YAl#Y#b%T#b#c!2w#c#d!4m#d#l%T#l#m!5{#m#o%T#p~%T!{!1x_$UWk!sO!O%T!O!P@r!P!Q%T!Q![!1q![!^%T!_!g%T!g!hAl!h#R%T#R#S!1q#S#X%T#X#YAl#Y#b%T#b#c!2w#c#o%T#p~%T!{!3OR$UWk!sO!^%T!_#o%T#p~%T!{!3^W$UWO!Q%T!Q!R!3v!R!S!3v!S!^%T!_#R%T#R#S!3v#S#o%T#p~%T!{!3}Y$UWk!sO!Q%T!Q!R!3v!R!S!3v!S!^%T!_#R%T#R#S!3v#S#b%T#b#c!2w#c#o%T#p~%T!{!4rV$UWO!Q%T!Q!Y!5X!Y!^%T!_#R%T#R#S!5X#S#o%T#p~%T!{!5`X$UWk!sO!Q%T!Q!Y!5X!Y!^%T!_#R%T#R#S!5X#S#b%T#b#c!2w#c#o%T#p~%T!{!6QZ$UWO!Q%T!Q![!6s![!^%T!_!c%T!c!i!6s!i#R%T#R#S!6s#S#T%T#T#Z!6s#Z#o%T#p~%T!{!6z]$UWk!sO!Q%T!Q![!6s![!^%T!_!c%T!c!i!6s!i#R%T#R#S!6s#S#T%T#T#Z!6s#Z#b%T#b#c!2w#c#o%T#p~%T$u!7|R!]V$UW#m$fO!^%T!_#o%T#p~%T!q!8^R_!i$UWO!^%T!_#o%T#p~%T5w!8rR'bd!a/n#x&s'|P!P!Q!8{!^!_!9Q!_!`!9_W!9QO$WW#v!9VP#`#v!_!`!9Y#v!9_O#o#v#v!9dO#a#v$u!9kT!{$m$UWO!^%T!_!`'v!`!a!9z!a#o%T#p~%T$P!:RR#W#w$UWO!^%T!_#o%T#p~%T%V!:gT'a!R#a#v$RS$UWO!^%T!_!`!:v!`!a!;W!a#o%T#p~%T$O!:}R#a#v$UWO!^%T!_#o%T#p~%T$O!;_T#`#v$UWO!^%T!_!`5T!`!a!;n!a#o%T#p~%T$O!;uS#`#v$UWO!^%T!_!`5T!`#o%T#p~%T*a!]S#g#v$UWO!^%T!_!`5T!`#o%T#p~%T$a!>pR$UW'f$XO!^%T!_#o%T#p~%T~!?OO!T~5b!?VT'w5Y$UWO!^%T!_!`5T!`#o%T#p#q!=P#q~%T6X!?oR!S5}nQ$UWO!^%T!_#o%T#p~%TX!@PR!kP$UWO!^%T!_#o%T#p~%T7Z!@gr$UW'Y7R#zS']$y'g3SOX%TXY%cYZ%TZ[%c[p%Tpq%cqt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$f%T$f$g%c$g#BY2`#BY#BZ!@Y#BZ$IS2`$IS$I_!@Y$I_$JT2`$JT$JU!@Y$JU$KV2`$KV$KW!@Y$KW&FU2`&FU&FV!@Y&FV?HT2`?HT?HU!@Y?HU~2`7Z!CO_$UW'Z7R#zS']$y'g3SOt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$g%T$g~2`",tokenizers:[va,ja,wa,_a,0,1,2,3,4,5,6,7,8,9,Wa],topRules:{Script:[0,7]},dialects:{jsx:12107,ts:12109},dynamicPrecedences:{149:1,176:1},specialized:[{term:289,get:t=>za[t]||-1},{term:299,get:t=>Ga[t]||-1},{term:63,get:t=>Ca[t]||-1}],tokenPrec:12130}),Ya=[m("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),m("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),m("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),m("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),m("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),m(`try { \${} } catch (\${error}) { \${} diff --git a/ui/dist/assets/FilterAutocompleteInput.7ac53d63.js b/ui/dist/assets/FilterAutocompleteInput.9df887af.js similarity index 98% rename from ui/dist/assets/FilterAutocompleteInput.7ac53d63.js rename to ui/dist/assets/FilterAutocompleteInput.9df887af.js index efc6080b..bd5bf20f 100644 --- a/ui/dist/assets/FilterAutocompleteInput.7ac53d63.js +++ b/ui/dist/assets/FilterAutocompleteInput.9df887af.js @@ -1 +1 @@ -import{S as z,i as Q,s as X,e as Y,f as Z,g as j,y as _,o as $,G as ee,H as te,I as ne,J as ie,K as oe,C as L,L as re}from"./index.b371ee76.js";import{C as E,E as w,a as C,h as se,b as le,c as ae,d as ce,e as ue,s as fe,f as de,g as ge,i as he,r as pe,j as ye,k as me,l as be,m as ke,n as xe,o as we,p as Ce,q as Se,t as G,S as qe}from"./index.90bde420.js";function Ke(t){P(t,"start");var i={},e=t.languageData||{},d=!1;for(var g in t)if(g!=e&&t.hasOwnProperty(g))for(var p=i[g]=[],r=t[g],o=0;o2&&r.token&&typeof r.token!="string"){e.pending=[];for(var u=2;u-1)return null;var g=e.indent.length-1,p=t[e.state];e:for(;;){for(var r=0;re(12,g=n));const p=ne();let{id:r=""}=i,{value:o=""}=i,{disabled:l=!1}=i,{placeholder:u=""}=i,{baseCollection:y=new ie}=i,{singleLine:S=!1}=i,{extraAutocompleteKeys:I=[]}=i,{disableRequestKeys:k=!1}=i,{disableIndirectCollectionsKeys:q=!1}=i,f,b,A=new E,F=new E,O=new E,B=new E;function v(){f==null||f.focus()}function J(n){let s=n.slice();return L.pushOrReplaceByKey(s,y,"id"),s}function M(){b==null||b.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0}))}function W(){if(!r)return;const n=document.querySelectorAll('[for="'+r+'"]');for(let s of n)s.removeEventListener("click",v)}function D(){if(!r)return;W();const n=document.querySelectorAll('[for="'+r+'"]');for(let s of n)s.addEventListener("click",v)}function R(n,s="",a=0){let m=d.find(c=>c.name==n||c.id==n);if(!m||a>=4)return[];let h=[s+"id",s+"created",s+"updated"];for(const c of m.schema){const x=s+c.name;if(c.type==="relation"&&c.options.collectionId){const K=R(c.options.collectionId,x+".",a+1);K.length?h=h.concat(K):h.push(x)}else h.push(x)}return h}function H(n=!0,s=!0){let a=[].concat(I);const m=R(y.name);for(const h of m)a.push(h);if(n&&(a.push("@request.method"),a.push("@request.query."),a.push("@request.data."),a.push("@request.user.id"),a.push("@request.user.email"),a.push("@request.user.verified"),a.push("@request.user.created"),a.push("@request.user.updated")),n||s)for(const h of d){let c="";if(h.name==="profiles"){if(!n)continue;c="@request.user.profile."}else{if(!s)continue;c="@collection."+h.name+"."}const x=R(h.name,c);for(const K of x)a.push(K)}return a.sort(function(h,c){return c.length-h.length}),a}function N(n){let s=n.matchBefore(/[\@\w\.]*/);if(s.from==s.to&&!n.explicit)return null;let a=[{label:"false"},{label:"true"},{label:"@now"}];q||a.push({label:"@collection.*",apply:"@collection."});const m=["@request.user.profile.id","@request.user.profile.userId","@request.user.profile.created","@request.user.profile.updated"],h=H(!k,!k&&s.text.startsWith("@c"));for(const c of h)m.includes(c)||a.push({label:c.endsWith(".")?c+"*":c,apply:c});return{from:s.from,options:a}}function T(){const n=[{regex:L.escapeRegExp("@now"),token:"keyword"}],s=H(!k,!q);for(const a of s){let m;a.endsWith(".")?m=L.escapeRegExp(a)+"\\w+[\\w.]*":m=L.escapeRegExp(a),n.push({regex:m,token:"keyword"})}return n}function U(){return qe.define(Ke({start:[{regex:/true|false|null/,token:"atom"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0}].concat(T())}))}oe(()=>{const n={key:"Enter",run:s=>{S&&p("submit",o)}};return D(),e(11,f=new w({parent:b,state:C.create({doc:o,extensions:[se(),le(),ae(),ce(),ue(),C.allowMultipleSelections.of(!0),fe(de,{fallback:!0}),ge(),he(),pe(),ye(),me.of([n,...be,...ke,...xe,...we,...Ce]),w.lineWrapping,Se({override:[N],icons:!1}),B.of(G(u)),F.of(w.editable.of(!0)),O.of(C.readOnly.of(!1)),A.of(U()),C.transactionFilter.of(s=>S&&s.newDoc.lines>1?[]:s),w.updateListener.of(s=>{!s.docChanged||l||(e(1,o=s.state.doc.toString()),M())})]})})),()=>{W(),f==null||f.destroy()}});function V(n){re[n?"unshift":"push"](()=>{b=n,e(0,b)})}return t.$$set=n=>{"id"in n&&e(2,r=n.id),"value"in n&&e(1,o=n.value),"disabled"in n&&e(3,l=n.disabled),"placeholder"in n&&e(4,u=n.placeholder),"baseCollection"in n&&e(5,y=n.baseCollection),"singleLine"in n&&e(6,S=n.singleLine),"extraAutocompleteKeys"in n&&e(7,I=n.extraAutocompleteKeys),"disableRequestKeys"in n&&e(8,k=n.disableRequestKeys),"disableIndirectCollectionsKeys"in n&&e(9,q=n.disableIndirectCollectionsKeys)},t.$$.update=()=>{t.$$.dirty&4096&&(d=J(g)),t.$$.dirty&4&&r&&D(),t.$$.dirty&2080&&f&&(y==null?void 0:y.schema)&&f.dispatch({effects:[A.reconfigure(U())]}),t.$$.dirty&2056&&f&&typeof l<"u"&&(f.dispatch({effects:[F.reconfigure(w.editable.of(!l)),O.reconfigure(C.readOnly.of(l))]}),M()),t.$$.dirty&2050&&f&&o!=f.state.doc.toString()&&f.dispatch({changes:{from:0,to:f.state.doc.length,insert:o}}),t.$$.dirty&2064&&f&&typeof u<"u"&&f.dispatch({effects:[B.reconfigure(G(u))]})},[b,o,r,l,u,y,S,I,k,q,v,f,g,V]}class Be extends z{constructor(i){super(),Q(this,i,Ae,_e,X,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableIndirectCollectionsKeys:9,focus:10})}get focus(){return this.$$.ctx[10]}}export{Be as default}; +import{S as z,i as Q,s as X,e as Y,f as Z,g as j,y as _,o as $,G as ee,H as te,I as ne,J as ie,K as oe,C as L,L as re}from"./index.f4f9f1ef.js";import{C as E,E as w,a as C,h as se,b as le,c as ae,d as ce,e as ue,s as fe,f as de,g as ge,i as he,r as pe,j as ye,k as me,l as be,m as ke,n as xe,o as we,p as Ce,q as Se,t as G,S as qe}from"./index.afc1faa1.js";function Ke(t){P(t,"start");var i={},e=t.languageData||{},d=!1;for(var g in t)if(g!=e&&t.hasOwnProperty(g))for(var p=i[g]=[],r=t[g],o=0;o2&&r.token&&typeof r.token!="string"){e.pending=[];for(var u=2;u-1)return null;var g=e.indent.length-1,p=t[e.state];e:for(;;){for(var r=0;re(12,g=n));const p=ne();let{id:r=""}=i,{value:o=""}=i,{disabled:l=!1}=i,{placeholder:u=""}=i,{baseCollection:y=new ie}=i,{singleLine:S=!1}=i,{extraAutocompleteKeys:I=[]}=i,{disableRequestKeys:k=!1}=i,{disableIndirectCollectionsKeys:q=!1}=i,f,b,A=new E,F=new E,O=new E,B=new E;function v(){f==null||f.focus()}function J(n){let s=n.slice();return L.pushOrReplaceByKey(s,y,"id"),s}function M(){b==null||b.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0}))}function W(){if(!r)return;const n=document.querySelectorAll('[for="'+r+'"]');for(let s of n)s.removeEventListener("click",v)}function D(){if(!r)return;W();const n=document.querySelectorAll('[for="'+r+'"]');for(let s of n)s.addEventListener("click",v)}function R(n,s="",a=0){let m=d.find(c=>c.name==n||c.id==n);if(!m||a>=4)return[];let h=[s+"id",s+"created",s+"updated"];for(const c of m.schema){const x=s+c.name;if(c.type==="relation"&&c.options.collectionId){const K=R(c.options.collectionId,x+".",a+1);K.length?h=h.concat(K):h.push(x)}else h.push(x)}return h}function H(n=!0,s=!0){let a=[].concat(I);const m=R(y.name);for(const h of m)a.push(h);if(n&&(a.push("@request.method"),a.push("@request.query."),a.push("@request.data."),a.push("@request.user.id"),a.push("@request.user.email"),a.push("@request.user.verified"),a.push("@request.user.created"),a.push("@request.user.updated")),n||s)for(const h of d){let c="";if(h.name==="profiles"){if(!n)continue;c="@request.user.profile."}else{if(!s)continue;c="@collection."+h.name+"."}const x=R(h.name,c);for(const K of x)a.push(K)}return a.sort(function(h,c){return c.length-h.length}),a}function N(n){let s=n.matchBefore(/[\@\w\.]*/);if(s.from==s.to&&!n.explicit)return null;let a=[{label:"false"},{label:"true"},{label:"@now"}];q||a.push({label:"@collection.*",apply:"@collection."});const m=["@request.user.profile.id","@request.user.profile.userId","@request.user.profile.created","@request.user.profile.updated"],h=H(!k,!k&&s.text.startsWith("@c"));for(const c of h)m.includes(c)||a.push({label:c.endsWith(".")?c+"*":c,apply:c});return{from:s.from,options:a}}function T(){const n=[{regex:L.escapeRegExp("@now"),token:"keyword"}],s=H(!k,!q);for(const a of s){let m;a.endsWith(".")?m=L.escapeRegExp(a)+"\\w+[\\w.]*":m=L.escapeRegExp(a),n.push({regex:m,token:"keyword"})}return n}function U(){return qe.define(Ke({start:[{regex:/true|false|null/,token:"atom"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0}].concat(T())}))}oe(()=>{const n={key:"Enter",run:s=>{S&&p("submit",o)}};return D(),e(11,f=new w({parent:b,state:C.create({doc:o,extensions:[se(),le(),ae(),ce(),ue(),C.allowMultipleSelections.of(!0),fe(de,{fallback:!0}),ge(),he(),pe(),ye(),me.of([n,...be,...ke,...xe,...we,...Ce]),w.lineWrapping,Se({override:[N],icons:!1}),B.of(G(u)),F.of(w.editable.of(!0)),O.of(C.readOnly.of(!1)),A.of(U()),C.transactionFilter.of(s=>S&&s.newDoc.lines>1?[]:s),w.updateListener.of(s=>{!s.docChanged||l||(e(1,o=s.state.doc.toString()),M())})]})})),()=>{W(),f==null||f.destroy()}});function V(n){re[n?"unshift":"push"](()=>{b=n,e(0,b)})}return t.$$set=n=>{"id"in n&&e(2,r=n.id),"value"in n&&e(1,o=n.value),"disabled"in n&&e(3,l=n.disabled),"placeholder"in n&&e(4,u=n.placeholder),"baseCollection"in n&&e(5,y=n.baseCollection),"singleLine"in n&&e(6,S=n.singleLine),"extraAutocompleteKeys"in n&&e(7,I=n.extraAutocompleteKeys),"disableRequestKeys"in n&&e(8,k=n.disableRequestKeys),"disableIndirectCollectionsKeys"in n&&e(9,q=n.disableIndirectCollectionsKeys)},t.$$.update=()=>{t.$$.dirty&4096&&(d=J(g)),t.$$.dirty&4&&r&&D(),t.$$.dirty&2080&&f&&(y==null?void 0:y.schema)&&f.dispatch({effects:[A.reconfigure(U())]}),t.$$.dirty&2056&&f&&typeof l<"u"&&(f.dispatch({effects:[F.reconfigure(w.editable.of(!l)),O.reconfigure(C.readOnly.of(l))]}),M()),t.$$.dirty&2050&&f&&o!=f.state.doc.toString()&&f.dispatch({changes:{from:0,to:f.state.doc.length,insert:o}}),t.$$.dirty&2064&&f&&typeof u<"u"&&f.dispatch({effects:[B.reconfigure(G(u))]})},[b,o,r,l,u,y,S,I,k,q,v,f,g,V]}class Be extends z{constructor(i){super(),Q(this,i,Ae,_e,X,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableIndirectCollectionsKeys:9,focus:10})}get focus(){return this.$$.ctx[10]}}export{Be as default}; diff --git a/ui/dist/assets/PageAdminConfirmPasswordReset.2c620106.js b/ui/dist/assets/PageAdminConfirmPasswordReset.cafba9d3.js similarity index 98% rename from ui/dist/assets/PageAdminConfirmPasswordReset.2c620106.js rename to ui/dist/assets/PageAdminConfirmPasswordReset.cafba9d3.js index 4f4bc3ae..613bff71 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset.2c620106.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset.cafba9d3.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as A,m as B,t as H,a as N,d as T,C as M,q as J,e as c,w as q,b as k,f as u,r as L,g as b,h as _,u as h,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as S}from"./index.b371ee76.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,C,v,P,F,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password +import{S as E,i as G,s as I,F as K,c as A,m as B,t as H,a as N,d as T,C as M,q as J,e as c,w as q,b as k,f as u,r as L,g as b,h as _,u as h,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as S}from"./index.f4f9f1ef.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,C,v,P,F,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password `),m&&m.c(),t=k(),A(r.$$.fragment),p=k(),A(d.$$.fragment),n=k(),i=c("button"),g=c("span"),g.textContent="Set new password",R=k(),C=c("div"),v=c("a"),v.textContent="Back to login",u(s,"class","m-b-xs"),u(o,"class","content txt-center m-b-sm"),u(g,"class","txt"),u(i,"type","submit"),u(i,"class","btn btn-lg btn-block"),i.disabled=f[2],L(i,"btn-loading",f[2]),u(e,"class","m-b-base"),u(v,"href","/login"),u(v,"class","link-hint"),u(C,"class","content txt-center")},m(a,$){b(a,e,$),_(e,o),_(o,s),_(s,l),m&&m.m(s,null),_(e,t),B(r,e,null),_(e,p),B(d,e,null),_(e,n),_(e,i),_(i,g),b(a,R,$),b(a,C,$),_(C,v),P=!0,F||(j=[h(e,"submit",O(f[4])),Q(U.call(null,v))],F=!0)},p(a,$){a[3]?m?m.p(a,$):(m=y(a),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const z={};$&769&&(z.$$scope={dirty:$,ctx:a}),r.$set(z);const D={};$&770&&(D.$$scope={dirty:$,ctx:a}),d.$set(D),(!P||$&4)&&(i.disabled=a[2]),$&4&&L(i,"btn-loading",a[2])},i(a){P||(H(r.$$.fragment,a),H(d.$$.fragment,a),P=!0)},o(a){N(r.$$.fragment,a),N(d.$$.fragment,a),P=!1},d(a){a&&w(e),m&&m.d(),T(r),T(d),a&&w(R),a&&w(C),F=!1,V(j)}}}function se(f){let e,o;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:f}}}),{c(){A(e.$$.fragment)},m(s,l){B(e,s,l),o=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){o||(H(e.$$.fragment,s),o=!0)},o(s){N(e.$$.fragment,s),o=!1},d(s){T(e,s)}}}function le(f,e,o){let s,{params:l}=e,t="",r="",p=!1;async function d(){if(!p){o(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,r),X("Successfully set a new admin password."),Y("/")}catch(g){W.errorResponseHandler(g)}o(2,p=!1)}}function n(){t=this.value,o(0,t)}function i(){r=this.value,o(1,r)}return f.$$set=g=>{"params"in g&&o(5,l=g.params)},f.$$.update=()=>{f.$$.dirty&32&&o(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,r,p,s,d,l,n,i]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageAdminRequestPasswordReset.97c6613b.js b/ui/dist/assets/PageAdminRequestPasswordReset.ee61a059.js similarity index 98% rename from ui/dist/assets/PageAdminRequestPasswordReset.97c6613b.js rename to ui/dist/assets/PageAdminRequestPasswordReset.ee61a059.js index 907c225e..018349bb 100644 --- a/ui/dist/assets/PageAdminRequestPasswordReset.97c6613b.js +++ b/ui/dist/assets/PageAdminRequestPasswordReset.ee61a059.js @@ -1,2 +1,2 @@ -import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as E,v as I,w as h,x as J,y as P,z as R}from"./index.b371ee76.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`

Forgotten admin password

+import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as E,v as I,w as h,x as J,y as P,z as R}from"./index.f4f9f1ef.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`

Forgotten admin password

Enter the email associated with your account and we\u2019ll send you a recovery link:

`,n=g(),H(l.$$.fragment),t=g(),o=_("button"),f=_("i"),m=g(),i=_("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(f,"class","ri-mail-send-line"),p(i,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=c[1],F(o,"btn-loading",c[1]),p(e,"class","m-b-base")},m(r,$){k(r,e,$),d(e,s),d(e,n),L(l,e,null),d(e,t),d(e,o),d(o,f),d(o,m),d(o,i),a=!0,b||(u=E(e,"submit",I(c[3])),b=!0)},p(r,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:r}),l.$set(q),(!a||$&2)&&(o.disabled=r[1]),$&2&&F(o,"btn-loading",r[1])},i(r){a||(w(l.$$.fragment,r),a=!0)},o(r){y(l.$$.fragment,r),a=!1},d(r){r&&v(e),S(l),b=!1,u()}}}function O(c){let e,s,n,l,t,o,f,m,i;return{c(){e=_("div"),s=_("div"),s.innerHTML='',n=g(),l=_("div"),t=_("p"),o=h("Check "),f=_("strong"),m=h(c[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(f,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){k(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,f),d(f,m),d(t,i)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&v(e)}}}function Q(c){let e,s,n,l,t,o,f,m;return{c(){e=_("label"),s=h("Email"),l=g(),t=_("input"),p(e,"for",n=c[5]),p(t,"type","email"),p(t,"id",o=c[5]),t.required=!0,t.autofocus=!0},m(i,a){k(i,e,a),d(e,s),k(i,l,a),k(i,t,a),R(t,c[0]),t.focus(),f||(m=E(t,"input",c[4]),f=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&o!==(o=i[5])&&p(t,"id",o),a&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&v(e),i&&v(l),i&&v(t),f=!1,m()}}}function U(c){let e,s,n,l,t,o,f,m;const i=[O,K],a=[];function b(u,r){return u[2]?0:1}return e=b(c),s=a[e]=i[e](c),{c(){s.c(),n=g(),l=_("div"),t=_("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(u,r){a[e].m(u,r),k(u,n,r),k(u,l,r),d(l,t),o=!0,f||(m=A(B.call(null,t)),f=!0)},p(u,r){let $=e;e=b(u),e===$?a[e].p(u,r):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(u,r):(s=a[e]=i[e](u),s.c()),w(s,1),s.m(n.parentNode,n))},i(u){o||(w(s),o=!0)},o(u){y(s),o=!1},d(u){a[e].d(u),u&&v(n),u&&v(l),f=!1,m()}}}function V(c){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:c}}}),{c(){H(e.$$.fragment)},m(n,l){L(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){S(e,n)}}}function W(c,e,s){let n="",l=!1,t=!1;async function o(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.errorResponseHandler(m)}s(1,l=!1)}}function f(){n=this.value,s(0,n)}return[n,l,t,o,f]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; diff --git a/ui/dist/assets/PageUserConfirmEmailChange.cbdf8995.js b/ui/dist/assets/PageUserConfirmEmailChange.a1d6c3eb.js similarity index 98% rename from ui/dist/assets/PageUserConfirmEmailChange.cbdf8995.js rename to ui/dist/assets/PageUserConfirmEmailChange.a1d6c3eb.js index 7feb172f..800b6ee7 100644 --- a/ui/dist/assets/PageUserConfirmEmailChange.cbdf8995.js +++ b/ui/dist/assets/PageUserConfirmEmailChange.a1d6c3eb.js @@ -1,4 +1,4 @@ -import{S as M,i as N,s as R,F as U,c as L,m as z,t as $,a as v,d as J,C as W,E as Y,g as _,k as j,n as A,o as b,p as F,q as B,e as m,w as y,b as C,f as d,r as H,h as k,u as E,v as D,y as h,x as G,z as S}from"./index.b371ee76.js";function I(r){let e,s,t,l,n,o,c,a,i,u,g,q,p=r[3]&&T(r);return o=new B({props:{class:"form-field required",name:"password",$$slots:{default:[O,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),s=m("div"),t=m("h4"),l=y(`Type your password to confirm changing your email address +import{S as M,i as N,s as R,F as U,c as L,m as z,t as $,a as v,d as J,C as W,E as Y,g as _,k as j,n as A,o as b,p as F,q as B,e as m,w as y,b as C,f as d,r as H,h as k,u as E,v as D,y as h,x as G,z as S}from"./index.f4f9f1ef.js";function I(r){let e,s,t,l,n,o,c,a,i,u,g,q,p=r[3]&&T(r);return o=new B({props:{class:"form-field required",name:"password",$$slots:{default:[O,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),s=m("div"),t=m("h4"),l=y(`Type your password to confirm changing your email address `),p&&p.c(),n=C(),L(o.$$.fragment),c=C(),a=m("button"),i=m("span"),i.textContent="Confirm new email",d(t,"class","m-b-xs"),d(s,"class","content txt-center m-b-sm"),d(i,"class","txt"),d(a,"type","submit"),d(a,"class","btn btn-lg btn-block"),a.disabled=r[1],H(a,"btn-loading",r[1])},m(f,w){_(f,e,w),k(e,s),k(s,t),k(t,l),p&&p.m(t,null),k(e,n),z(o,e,null),k(e,c),k(e,a),k(a,i),u=!0,g||(q=E(e,"submit",D(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=T(f),p.c(),p.m(t,null)):p&&(p.d(1),p=null);const P={};w&769&&(P.$$scope={dirty:w,ctx:f}),o.$set(P),(!u||w&2)&&(a.disabled=f[1]),w&2&&H(a,"btn-loading",f[1])},i(f){u||($(o.$$.fragment,f),u=!0)},o(f){v(o.$$.fragment,f),u=!1},d(f){f&&b(e),p&&p.d(),J(o),g=!1,q()}}}function K(r){let e,s,t,l,n;return{c(){e=m("div"),e.innerHTML=`

Successfully changed the user email address.

You can now sign in with your new email address.

`,s=C(),t=m("button"),t.textContent="Close",d(e,"class","alert alert-success"),d(t,"type","button"),d(t,"class","btn btn-secondary btn-block")},m(o,c){_(o,e,c),_(o,s,c),_(o,t,c),l||(n=E(t,"click",r[6]),l=!0)},p:h,i:h,o:h,d(o){o&&b(e),o&&b(s),o&&b(t),l=!1,n()}}}function T(r){let e,s,t;return{c(){e=y("to "),s=m("strong"),t=y(r[3]),d(s,"class","txt-nowrap")},m(l,n){_(l,e,n),_(l,s,n),k(s,t)},p(l,n){n&8&&G(t,l[3])},d(l){l&&b(e),l&&b(s)}}}function O(r){let e,s,t,l,n,o,c,a;return{c(){e=m("label"),s=y("Password"),l=C(),n=m("input"),d(e,"for",t=r[8]),d(n,"type","password"),d(n,"id",o=r[8]),n.required=!0,n.autofocus=!0},m(i,u){_(i,e,u),k(e,s),_(i,l,u),_(i,n,u),S(n,r[0]),n.focus(),c||(a=E(n,"input",r[7]),c=!0)},p(i,u){u&256&&t!==(t=i[8])&&d(e,"for",t),u&256&&o!==(o=i[8])&&d(n,"id",o),u&1&&n.value!==i[0]&&S(n,i[0])},d(i){i&&b(e),i&&b(l),i&&b(n),c=!1,a()}}}function Q(r){let e,s,t,l;const n=[K,I],o=[];function c(a,i){return a[2]?0:1}return e=c(r),s=o[e]=n[e](r),{c(){s.c(),t=Y()},m(a,i){o[e].m(a,i),_(a,t,i),l=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(j(),v(o[u],1,1,()=>{o[u]=null}),A(),s=o[e],s?s.p(a,i):(s=o[e]=n[e](a),s.c()),$(s,1),s.m(t.parentNode,t))},i(a){l||($(s),l=!0)},o(a){v(s),l=!1},d(a){o[e].d(a),a&&b(t)}}}function V(r){let e,s;return e=new U({props:{nobranding:!0,$$slots:{default:[Q]},$$scope:{ctx:r}}}),{c(){L(e.$$.fragment)},m(t,l){z(e,t,l),s=!0},p(t,[l]){const n={};l&527&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||($(e.$$.fragment,t),s=!0)},o(t){v(e.$$.fragment,t),s=!1},d(t){J(e,t)}}}function X(r,e,s){let t,{params:l}=e,n="",o=!1,c=!1;async function a(){if(!o){s(1,o=!0);try{await F.users.confirmEmailChange(l==null?void 0:l.token,n),s(2,c=!0)}catch(g){F.errorResponseHandler(g)}s(1,o=!1)}}const i=()=>window.close();function u(){n=this.value,s(0,n)}return r.$$set=g=>{"params"in g&&s(5,l=g.params)},r.$$.update=()=>{r.$$.dirty&32&&s(3,t=W.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[n,o,c,t,a,l,i,u]}class x extends M{constructor(e){super(),N(this,e,X,V,R,{params:5})}}export{x as default}; diff --git a/ui/dist/assets/PageUserConfirmPasswordReset.911e38e1.js b/ui/dist/assets/PageUserConfirmPasswordReset.bea4e34d.js similarity index 98% rename from ui/dist/assets/PageUserConfirmPasswordReset.911e38e1.js rename to ui/dist/assets/PageUserConfirmPasswordReset.bea4e34d.js index 4d93f458..a2fa7db0 100644 --- a/ui/dist/assets/PageUserConfirmPasswordReset.911e38e1.js +++ b/ui/dist/assets/PageUserConfirmPasswordReset.bea4e34d.js @@ -1,4 +1,4 @@ -import{S as W,i as Y,s as j,F as A,c as F,m as H,t as P,a as q,d as N,C as B,E as D,g as _,k as G,n as I,o as m,p as E,q as J,e as b,w as y,b as C,f as c,r as M,h as w,u as R,v as K,y as S,x as O,z as h}from"./index.b371ee76.js";function Q(i){let e,l,t,n,s,o,p,u,r,a,v,g,k,L,d=i[4]&&U(i);return o=new J({props:{class:"form-field required",name:"password",$$slots:{default:[X,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),u=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Z,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),{c(){e=b("form"),l=b("div"),t=b("h4"),n=y(`Reset your user password +import{S as W,i as Y,s as j,F as A,c as F,m as H,t as P,a as q,d as N,C as B,E as D,g as _,k as G,n as I,o as m,p as E,q as J,e as b,w as y,b as C,f as c,r as M,h as w,u as R,v as K,y as S,x as O,z as h}from"./index.f4f9f1ef.js";function Q(i){let e,l,t,n,s,o,p,u,r,a,v,g,k,L,d=i[4]&&U(i);return o=new J({props:{class:"form-field required",name:"password",$$slots:{default:[X,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),u=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Z,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),{c(){e=b("form"),l=b("div"),t=b("h4"),n=y(`Reset your user password `),d&&d.c(),s=C(),F(o.$$.fragment),p=C(),F(u.$$.fragment),r=C(),a=b("button"),v=b("span"),v.textContent="Set new password",c(t,"class","m-b-xs"),c(l,"class","content txt-center m-b-sm"),c(v,"class","txt"),c(a,"type","submit"),c(a,"class","btn btn-lg btn-block"),a.disabled=i[2],M(a,"btn-loading",i[2])},m(f,$){_(f,e,$),w(e,l),w(l,t),w(t,n),d&&d.m(t,null),w(e,s),H(o,e,null),w(e,p),H(u,e,null),w(e,r),w(e,a),w(a,v),g=!0,k||(L=R(e,"submit",K(i[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=U(f),d.c(),d.m(t,null)):d&&(d.d(1),d=null);const T={};$&3073&&(T.$$scope={dirty:$,ctx:f}),o.$set(T);const z={};$&3074&&(z.$$scope={dirty:$,ctx:f}),u.$set(z),(!g||$&4)&&(a.disabled=f[2]),$&4&&M(a,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(u.$$.fragment,f),g=!0)},o(f){q(o.$$.fragment,f),q(u.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),N(o),N(u),k=!1,L()}}}function V(i){let e,l,t,n,s;return{c(){e=b("div"),e.innerHTML=`

Successfully changed the user password.

You can now sign in with your new password.

`,l=C(),t=b("button"),t.textContent="Close",c(e,"class","alert alert-success"),c(t,"type","button"),c(t,"class","btn btn-secondary btn-block")},m(o,p){_(o,e,p),_(o,l,p),_(o,t,p),n||(s=R(t,"click",i[7]),n=!0)},p:S,i:S,o:S,d(o){o&&m(e),o&&m(l),o&&m(t),n=!1,s()}}}function U(i){let e,l,t;return{c(){e=y("for "),l=b("strong"),t=y(i[4])},m(n,s){_(n,e,s),_(n,l,s),w(l,t)},p(n,s){s&16&&O(t,n[4])},d(n){n&&m(e),n&&m(l)}}}function X(i){let e,l,t,n,s,o,p,u;return{c(){e=b("label"),l=y("New password"),n=C(),s=b("input"),c(e,"for",t=i[10]),c(s,"type","password"),c(s,"id",o=i[10]),s.required=!0,s.autofocus=!0},m(r,a){_(r,e,a),w(e,l),_(r,n,a),_(r,s,a),h(s,i[0]),s.focus(),p||(u=R(s,"input",i[8]),p=!0)},p(r,a){a&1024&&t!==(t=r[10])&&c(e,"for",t),a&1024&&o!==(o=r[10])&&c(s,"id",o),a&1&&s.value!==r[0]&&h(s,r[0])},d(r){r&&m(e),r&&m(n),r&&m(s),p=!1,u()}}}function Z(i){let e,l,t,n,s,o,p,u;return{c(){e=b("label"),l=y("New password confirm"),n=C(),s=b("input"),c(e,"for",t=i[10]),c(s,"type","password"),c(s,"id",o=i[10]),s.required=!0},m(r,a){_(r,e,a),w(e,l),_(r,n,a),_(r,s,a),h(s,i[1]),p||(u=R(s,"input",i[9]),p=!0)},p(r,a){a&1024&&t!==(t=r[10])&&c(e,"for",t),a&1024&&o!==(o=r[10])&&c(s,"id",o),a&2&&s.value!==r[1]&&h(s,r[1])},d(r){r&&m(e),r&&m(n),r&&m(s),p=!1,u()}}}function x(i){let e,l,t,n;const s=[V,Q],o=[];function p(u,r){return u[3]?0:1}return e=p(i),l=o[e]=s[e](i),{c(){l.c(),t=D()},m(u,r){o[e].m(u,r),_(u,t,r),n=!0},p(u,r){let a=e;e=p(u),e===a?o[e].p(u,r):(G(),q(o[a],1,1,()=>{o[a]=null}),I(),l=o[e],l?l.p(u,r):(l=o[e]=s[e](u),l.c()),P(l,1),l.m(t.parentNode,t))},i(u){n||(P(l),n=!0)},o(u){q(l),n=!1},d(u){o[e].d(u),u&&m(t)}}}function ee(i){let e,l;return e=new A({props:{nobranding:!0,$$slots:{default:[x]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},m(t,n){H(e,t,n),l=!0},p(t,[n]){const s={};n&2079&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(P(e.$$.fragment,t),l=!0)},o(t){q(e.$$.fragment,t),l=!1},d(t){N(e,t)}}}function te(i,e,l){let t,{params:n}=e,s="",o="",p=!1,u=!1;async function r(){if(!p){l(2,p=!0);try{await E.users.confirmPasswordReset(n==null?void 0:n.token,s,o),l(3,u=!0)}catch(k){E.errorResponseHandler(k)}l(2,p=!1)}}const a=()=>window.close();function v(){s=this.value,l(0,s)}function g(){o=this.value,l(1,o)}return i.$$set=k=>{"params"in k&&l(6,n=k.params)},i.$$.update=()=>{i.$$.dirty&64&&l(4,t=B.getJWTPayload(n==null?void 0:n.token).email||"")},[s,o,p,u,t,r,n,a,v,g]}class le extends W{constructor(e){super(),Y(this,e,te,ee,j,{params:6})}}export{le as default}; diff --git a/ui/dist/assets/PageUserConfirmVerification.6bd0a15b.js b/ui/dist/assets/PageUserConfirmVerification.31e1b34e.js similarity index 97% rename from ui/dist/assets/PageUserConfirmVerification.6bd0a15b.js rename to ui/dist/assets/PageUserConfirmVerification.31e1b34e.js index 044b852f..f3f9888b 100644 --- a/ui/dist/assets/PageUserConfirmVerification.6bd0a15b.js +++ b/ui/dist/assets/PageUserConfirmVerification.31e1b34e.js @@ -1,3 +1,3 @@ -import{S as k,i as v,s as y,F as w,c as x,m as C,t as g,a as $,d as L,p as H,E as M,g as r,o as a,e as u,b as m,f,u as _,y as p}from"./index.b371ee76.js";function P(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`
+import{S as k,i as v,s as y,F as w,c as x,m as C,t as g,a as $,d as L,p as H,E as M,g as r,o as a,e as u,b as m,f,u as _,y as p}from"./index.f4f9f1ef.js";function P(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`

Invalid or expired verification token.

`,s=m(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-danger"),f(e,"type","button"),f(e,"class","btn btn-secondary btn-block")},m(l,c){r(l,t,c),r(l,s,c),r(l,e,c),n||(i=_(e,"click",o[4]),n=!0)},p,d(l){l&&a(t),l&&a(s),l&&a(e),n=!1,i()}}}function S(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`

Successfully verified email address.

`,s=m(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-success"),f(e,"type","button"),f(e,"class","btn btn-secondary btn-block")},m(l,c){r(l,t,c),r(l,s,c),r(l,e,c),n||(i=_(e,"click",o[3]),n=!0)},p,d(l){l&&a(t),l&&a(s),l&&a(e),n=!1,i()}}}function T(o){let t;return{c(){t=u("div"),t.innerHTML='
Please wait...
',f(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function F(o){let t;function s(i,l){return i[1]?T:i[0]?S:P}let e=s(o),n=e(o);return{c(){n.c(),t=M()},m(i,l){n.m(i,l),r(i,t,l)},p(i,l){e===(e=s(i))&&n?n.p(i,l):(n.d(1),n=e(i),n&&(n.c(),n.m(t.parentNode,t)))},d(i){n.d(i),i&&a(t)}}}function V(o){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[F]},$$scope:{ctx:o}}}),{c(){x(t.$$.fragment)},m(e,n){C(t,e,n),s=!0},p(e,[n]){const i={};n&67&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){s||(g(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(o,t,s){let{params:e}=t,n=!1,i=!1;l();async function l(){s(1,i=!0);try{await H.users.confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch(d){console.warn(d),s(0,n=!1)}s(1,i=!1)}const c=()=>window.close(),b=()=>window.close();return o.$$set=d=>{"params"in d&&s(2,e=d.params)},[n,i,e,c,b]}class I extends k{constructor(t){super(),v(this,t,q,V,y,{params:2})}}export{I as default}; diff --git a/ui/dist/assets/index.90bde420.js b/ui/dist/assets/index.afc1faa1.js similarity index 65% rename from ui/dist/assets/index.90bde420.js rename to ui/dist/assets/index.afc1faa1.js index c11f9aec..1674fb41 100644 --- a/ui/dist/assets/index.90bde420.js +++ b/ui/dist/assets/index.afc1faa1.js @@ -1,12 +1,12 @@ -class I{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),Fe.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),Fe.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new ti(this),r=new ti(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new ti(this,e)}iterRange(e,t=this.length){return new Qo(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Zo(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?I.empty:e.length<=32?new G(e):Fe.from(G.split(e,[]))}}class G extends I{constructor(e,t=Ih(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Nh(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new G(gr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Vi(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new G(l,o.length+r.length));else{let a=l.length>>1;i.push(new G(l.slice(0,a)),new G(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof G))return super.replace(e,t,i);let s=Vi(this.text,Vi(i.text,gr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new G(s,r):Fe.from(G.split(s,[]),r)}sliceString(e,t=this.length,i=` -`){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new G(i,s)),i=[],s=-1);return s>-1&&t.push(new G(i,s)),t}}class Fe extends I{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if(i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new Fe(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` -`){let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Fe))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new G(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof Fe)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof G&&a&&(p=c[c.length-1])instanceof G&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new G(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:Fe.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Fe(l,t)}}I.empty=new G([""],0);function Ih(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Vi(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof G?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof G?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(s instanceof G){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof G?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Qo{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ti(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Zo{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=function(){return this.iter()},ti.prototype[Symbol.iterator]=Qo.prototype[Symbol.iterator]=Zo.prototype[Symbol.iterator]=function(){return this});class Nh{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Ot="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return Ot[e-1]<=n;return!1}function mr(n){return n>=127462&&n<=127487}const yr=8205;function Se(n,e,t=!0,i=!0){return(t?el:Fh)(n,e,i)}function el(n,e,t){if(e==n.length)return e;e&&tl(n.charCodeAt(e))&&il(n.charCodeAt(e-1))&&e--;let i=te(n,e);for(e+=xe(i);e=0&&mr(te(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Fh(n,e,t){for(;e>0;){let i=el(n,e-2,t);if(i=56320&&n<57344}function il(n){return n>=55296&&n<56320}function te(n,e){let t=n.charCodeAt(e);if(!il(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return tl(i)?(t-55296<<10)+(i-56320)+65536:t}function Vs(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function xe(n){return n<65536?1:2}const Jn=/\r\n?|\n/;var oe=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(oe||(oe={}));class qe{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=oe.Simple&&h>=e&&(i==oe.TrackDel&&se||i==oe.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new qe(e)}static create(e){return new qe(e)}}class Y extends qe{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Xn(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return Yn(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&et(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?I.of(d.split(i||Jn)):d:I.empty,g=p.length;if(f==u&&g==0)return;fo&&re(s,f-o,-1),re(s,u-f,g),et(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new Y(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function et(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function Yn(n,e,t,i=!1){let s=[],r=i?[]:null,o=new oi(n),l=new oi(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);re(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class oi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?I.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?I.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class dt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new dt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return m.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return m.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return m.range(e.anchor,e.head)}static create(e,t,i){return new dt(e,t,i)}}class m{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:m.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new m(e.ranges.map(t=>dt.fromJSON(t)),e.main)}static single(e,t=e){return new m([m.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0))}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?m.range(a,l):m.range(l,a))}}return new m(e,t)}}function sl(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Fs=0;class D{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=Fs++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new D(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Hs),!!e.static,e.enables)}of(e){return new Fi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Fi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Fi(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Hs(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Fi{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=Fs++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||_n(f,c)){let d=i(f);if(l?!br(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d=i(f),p=u.config.address[r];if(p!=null){let g=ji(u,p);if(this.dependencies.every(y=>y instanceof D?u.facet(y)===f.facet(y):y instanceof de?u.field(y,!1)==f.field(y,!1):!0)||(l?br(d,g,s):s(d,g)))return f.values[o]=g,0}return f.values[o]=d,1}}}}function br(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(wr).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,wr.of({field:this,create:e})]}get extension(){return this}}const ut={lowest:4,low:3,default:2,high:1,highest:0};function Ut(n){return e=>new rl(e,n)}const kt={highest:Ut(ut.highest),high:Ut(ut.high),default:Ut(ut.default),low:Ut(ut.low),lowest:Ut(ut.lowest)};class rl{constructor(e,t){this.inner=e,this.prec=t}}class un{of(e){return new Qn(this,e)}reconfigure(e){return un.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Qn{constructor(e,t){this.compartment=e,this.inner=t}}class $i{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Wh(e,t,o))u instanceof de?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=c&&c[u]||[];if(d.every(y=>y.type==0))if(l[p.id]=a.length<<1|1,Hs(g,d))a.push(i.facet(p));else{let y=p.combine(d.map(b=>b.value));a.push(i&&p.compare(y,i.facet(p))?i.facet(p):y)}else{for(let y of d)y.type==0?(l[y.id]=a.length<<1|1,a.push(y.value)):(l[y.id]=h.length<<1,h.push(b=>y.dynamicSlot(b)));l[p.id]=h.length<<1,h.push(y=>Hh(y,p,d))}}let f=h.map(u=>u(l));return new $i(e,o,f,l,a,r)}}function Wh(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof Qn&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof Qn){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof rl)r(o.inner,o.prec);else if(o instanceof de)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Fi)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,ut.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,ut.default),i.reduce((o,l)=>o.concat(l))}function ii(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function ji(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const ol=D.define(),ll=D.define({combine:n=>n.some(e=>e),static:!0}),al=D.define({combine:n=>n.length?n[0]:void 0,static:!0}),hl=D.define(),cl=D.define(),fl=D.define(),ul=D.define({combine:n=>n.length?n[0]:!1});class St{constructor(e,t){this.type=e,this.value=t}static define(){return new zh}}class zh{of(e){return new St(this,e)}}class qh{constructor(e){this.map=e}of(e){return new L(this,e)}}class L{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new L(this.type,t)}is(e){return this.type==e}static define(e={}){return new qh(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}L.reconfigure=L.define();L.appendConfig=L.define();class _{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&sl(i,t.newLength),r.some(l=>l.type==_.time)||(this.annotations=r.concat(_.time.of(Date.now())))}static create(e,t,i,s,r,o){return new _(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(_.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}_.time=St.define();_.userEvent=St.define();_.addToHistory=St.define();_.remote=St.define();function $h(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof _?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof _?n=r[0]:n=pl(e,Tt(r),!1)}return n}function Uh(n){let e=n.startState,t=e.facet(fl),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=dl(n,Zn(e,r,n.changes.newLength),!0))}return i==n?n:_.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const Kh=[];function Tt(n){return n==null?Kh:Array.isArray(n)?n:[n]}var ae=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(ae||(ae={}));const Gh=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let es;try{es=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Jh(n){if(es)return es.test(n);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||Gh.test(t)))return!0}return!1}function Xh(n){return e=>{if(!/\S/.test(e))return ae.Space;if(Jh(e))return ae.Word;for(let t=0;t-1)return ae.Word;return ae.Other}}class N{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(L.reconfigure)?(t=null,i=o.value):o.is(L.appendConfig)&&(t=null,i=Tt(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=$i.resolve(i,s,this),r=new N(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new N(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:m.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Tt(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return N.create({doc:e.doc,selection:m.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=$i.resolve(e.extensions||[],new Map),i=e.doc instanceof I?e.doc:I.of((e.doc||"").split(t.staticFacet(N.lineSeparator)||Jn)),s=e.selection?e.selection instanceof m?e.selection:m.single(e.selection.anchor,e.selection.head):m.single(0);return sl(s,i.length),t.staticFacet(ll)||(s=s.asSingle()),new N(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(N.tabSize)}get lineBreak(){return this.facet(N.lineSeparator)||` -`}get readOnly(){return this.facet(ul)}phrase(e,...t){for(let i of this.facet(N.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(ol))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return Xh(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=Se(t,o,!1);if(r(t.slice(a,o))!=ae.Word)break;o=a}for(;ln.length?n[0]:4});N.lineSeparator=al;N.readOnly=ul;N.phrases=D.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});N.languageData=ol;N.changeFilter=hl;N.transactionFilter=cl;N.transactionExtender=fl;un.reconfigure=L.define();function qt(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class mt{eq(e){return this==e}range(e,t=e){return li.create(e,t,this)}}mt.prototype.startSide=mt.prototype.endSide=0;mt.prototype.point=!1;mt.prototype.mapMode=oe.TrackDel;class li{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new li(e,t,i)}}function ts(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Ws{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Ws(s,r,i,l):null,pos:o}}}class ${constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new $(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(ts)),this.isEmpty)return t.length?$.of(t):this;let l=new gl(this,null,-1).goto(0),a=0,h=[],c=new yt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return ai.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ai.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=xr(o,l,i),h=new Kt(o,a,r),c=new Kt(l,a,r);i.iterGaps((f,u,d)=>kr(h,f,c,u,d,s)),i.empty&&i.length==0&&kr(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=xr(r,o),a=new Kt(r,l,0).goto(i),h=new Kt(o,l,0).goto(i);for(;;){if(a.to!=h.to||!is(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new Kt(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point?(s.point(l,h,o.point,o.activeForPoint(o.to),a,o.pointRank),a=o.openEnd(h)+(o.to>h?1:0)):h>l&&(s.span(l,h,o.active,a),a=o.openEnd(h)),o.to>i)break;l=o.to,o.next()}return a}static of(e,t=!1){let i=new yt;for(let s of e instanceof li?[e]:t?Yh(e):e)i.add(s.from,s.to,s.value);return i.finish()}}$.empty=new $([],[],null,-1);function Yh(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(ts);e=i}return n}$.empty.nextLayer=$.empty;class yt{constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}finishChunk(e){this.chunks.push(new Ws(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new yt)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner($.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=$.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function xr(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new gl(o,t,i,r));return s.length==1?s[0]:new ai(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)On(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)On(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),On(this.heap,0)}}}function On(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class Kt{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ai.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ki(this.active,e),ki(this.activeTo,e),ki(this.activeRank,e),this.minActive=Sr(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&ki(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(i),this.cursor.frome&&s++,this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function kr(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let h=n.to+a-t.to||n.endSide-t.endSide,c=h<0?n.to+a:t.to,f=Math.min(c,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&is(n.activeForPoint(n.to+a),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!is(n.active,t.active)&&r.compareRange(l,f,n.active,t.active),c>o)break;l=c,h<=0&&n.next(),h>=0&&t.next()}}function is(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Sr(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=Se(n,s)}return i===!0?-1:n.length}const ss="\u037C",vr=typeof Symbol>"u"?"__"+ss:Symbol.for(ss),rs=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Cr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ot{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(y=>g.replace(/&/,y))).reduce((g,y)=>g.concat(y)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=Cr[vr]||1;return Cr[vr]=e+1,ss+e.toString(36)}static mount(e,t){(e[rs]||new _h(e)).mount(Array.isArray(t)?t:[t])}}let vi=null;class _h{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if(vi)return e.adoptedStyleSheets=[vi.sheet].concat(e.adoptedStyleSheets),e[rs]=vi;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),vi=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[rs]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ar=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent);typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent);var Qh=typeof navigator<"u"&&/Mac/.test(navigator.platform),Zh=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ec=Qh||Ar&&+Ar[1]<57;for(var ie=0;ie<10;ie++)lt[48+ie]=lt[96+ie]=String(ie);for(var ie=1;ie<=24;ie++)lt[ie+111]="F"+ie;for(var ie=65;ie<=90;ie++)lt[ie]=String.fromCharCode(ie+32),Rt[ie]=String.fromCharCode(ie);for(var Tn in lt)Rt.hasOwnProperty(Tn)||(Rt[Tn]=lt[Tn]);function tc(n){var e=ec&&(n.ctrlKey||n.altKey||n.metaKey)||Zh&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Rt:lt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Ui(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Lt(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function ic(){let n=document.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function Hi(n,e){if(!e.anchorNode)return!1;try{return Lt(n,e.anchorNode)}catch{return!1}}function hi(n){return n.nodeType==3?Et(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Ki(n,e,t,i){return t?Mr(n,e,t,i,-1)||Mr(n,e,t,i,1):!1}function Gi(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Mr(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:ci(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=Gi(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?ci(n):0}else return!1}}function ci(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const ml={left:0,right:0,top:0,bottom:0};function dn(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function nc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function sc(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView;for(let c=n;c;)if(c.nodeType==1){let f,u=c==a.body;if(u)f=nc(h);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.parentNode;continue}let g=c.getBoundingClientRect();f={left:g.left,right:g.left+c.clientWidth,top:g.top,bottom:g.top+c.clientHeight}}let d=0,p=0;if(s=="nearest")e.top0&&e.bottom>f.bottom+p&&(p=e.bottom-f.bottom+p+o)):e.bottom>f.bottom&&(p=e.bottom-f.bottom+o,t<0&&e.top-p0&&e.right>f.right+d&&(d=e.right-f.right+d+r)):e.right>f.right&&(d=e.right-f.right+r,t<0&&e.leftt)return f.domBoundsAround(e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.dirty|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),t.dirty&1)return;t.dirty|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=zs){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function xl(n,e,t,i,s,r,o,l,a){let{children:h}=n,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,a))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(t2);var A={mac:Pr||/Mac/.test(ke.platform),windows:/Win/.test(ke.platform),linux:/Linux|X11/.test(ke.platform),ie:pn,ie_version:Sl?os.documentMode||6:as?+as[1]:ls?+ls[1]:0,gecko:Tr,gecko_version:Tr?+(/Firefox\/(\d+)/.exec(ke.userAgent)||[0,0])[1]:0,chrome:!!Bn,chrome_version:Bn?+Bn[1]:0,ios:Pr,android:/Android\b/.test(ke.userAgent),webkit:Br,safari:vl,webkit_version:Br?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:os.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const ac=256;class at extends z{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return i&&(!(i instanceof at)||this.length-(t-e)+i.length>ac)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new at(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ne(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return hs(this.dom,e,t)}}class $e extends z{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(bl(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}sync(e){this.dom?this.dirty&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e)}merge(e,t,i,s,r,o){return i&&(!(i instanceof $e&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new $e(this.mark,t,o)}domAtPos(e){return Ml(this.dom,this.children,e)}coordsAt(e,t){return Ol(this,e,t)}}function hs(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?A.chrome||A.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return A.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?dn(a,o<0):a||null}class tt extends z{constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}static create(e,t,i){return new(e.customView||tt)(e,t,i)}split(e){let t=tt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(){(!this.dom||!this.widget.updateDOM(this.dom))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof tt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0?i.length-1:0;s=i[r],!(e>0?r==0:r==i.length-1||s.top0?-1:1);return e==0&&t>0||e==this.length&&t<=0?s:dn(s,e==0)}get isEditable(){return!1}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Cl extends tt{domAtPos(e){let{topView:t,text:i}=this.widget;return t?cs(e,0,t,i,(s,r)=>s.domAtPos(r),s=>new ne(i,Math.min(s,i.nodeValue.length))):new ne(i,Math.min(e,i.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(e,t){let{topView:i,text:s}=this.widget;return i?Al(e,t,i,s):Math.min(t,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(e,t){let{topView:i,text:s}=this.widget;return i?cs(e,t,i,s,(r,o,l)=>r.coordsAt(o,l),(r,o)=>hs(s,r,o)):hs(s,e,t)}destroy(){var e;super.destroy(),(e=this.widget.topView)===null||e===void 0||e.destroy()}get isEditable(){return!0}}function cs(n,e,t,i,s,r){if(t instanceof $e){for(let o of t.children){let l=Lt(o.dom,i),a=l?i.nodeValue.length:o.length;if(n0?-1:1);return i&&i.topt.top?{left:t.left,right:t.right,top:i.top,bottom:i.bottom}:t}get overrideDOMText(){return I.empty}}at.prototype.children=tt.prototype.children=It.prototype.children=zs;function hc(n,e){let t=n.parent,i=t?t.children.indexOf(n):-1;for(;t&&i>=0;)if(e<0?i>0:is&&t0;i--){let s=e[i-1].dom;if(s.parentNode==n)return ne.after(s)}return new ne(n,0)}function Dl(n,e,t){let i,{children:s}=n;t>0&&e instanceof $e&&s.length&&(i=s[s.length-1])instanceof $e&&i.mark.eq(e.mark)?Dl(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Ol(n,e,t){for(let r=0,o=0;o0?a>=e:a>e)&&(e0)){let c=0;if(a==r){if(l.getSide()<=0)continue;c=t=-l.getSide()}let f=l.coordsAt(Math.max(0,e-r),t);return c&&f?dn(f,t<0):f}r=a}let i=n.dom.lastChild;if(!i)return n.dom.getBoundingClientRect();let s=hi(i);return s[s.length-1]||null}function fs(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}function qs(n,e){if(n==e)return!0;if(!n||!e)return!1;let t=Object.keys(n),i=Object.keys(e);if(t.length!=i.length)return!1;for(let s of t)if(i.indexOf(s)==-1||n[s]!==e[s])return!1;return!0}function us(n,e,t){let i=null;if(e)for(let s in e)t&&s in t||n.removeAttribute(i=s);if(t)for(let s in t)e&&e[s]==t[s]||n.setAttribute(i=s,t[s]);return!!i}class ht{eq(e){return!1}updateDOM(e){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}ignoreEvent(e){return!0}get customView(){return null}destroy(e){}}var W=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(W||(W={}));class T extends mt{constructor(e,t,i,s){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return new gn(e)}static widget(e){let t=e.side||0,i=!!e.block;return t+=i?t>0?3e8:-4e8:t>0?1e8:-1e8,new bt(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Tl(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new bt(e,i,s,t,e.widget||null,!0)}static line(e){return new yi(e)}static set(e,t=!1){return $.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}T.none=$.empty;class gn extends T{constructor(e){let{start:t,end:i}=Tl(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){return this==e||e instanceof gn&&this.tagName==e.tagName&&this.class==e.class&&qs(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}gn.prototype.point=!1;class yi extends T{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof yi&&qs(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}yi.prototype.mapMode=oe.TrackBefore;yi.prototype.point=!0;class bt extends T{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?oe.TrackBefore:oe.TrackAfter:oe.TrackDel}get type(){return this.startSide=5}eq(e){return e instanceof bt&&cc(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}bt.prototype.point=!0;function Tl(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t!=null?t:e,end:i!=null?i:e}}function cc(n,e){return n==e||!!(n&&e&&n.compare(e))}function ds(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class he extends z{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof he))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),kl(this,e,t,i?i.children:[],r,o),!0}split(e){let t=new he;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:s}=this.childPos(e);s&&(t.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){!this.dom||(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){qs(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Dl(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=fs(t,this.attrs||{})),i&&(this.attrs=fs({class:i},this.attrs||{}))}domAtPos(e){return Ml(this.dom,this.children,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.dirty|=6)}sync(e){var t;this.dom?this.dirty&4&&(bl(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(us(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e);let i=this.dom.lastChild;for(;i&&z.get(i)instanceof $e;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((t=z.get(i))===null||t===void 0?void 0:t.isEditable)==!1&&(!A.ios||!this.children.some(s=>s instanceof at))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0;for(let t of this.children){if(!(t instanceof at)||/[^ -~]/.test(t.text))return null;let i=hi(t.dom);if(i.length!=1)return null;e+=i[0].width}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}:null}coordsAt(e,t){return Ol(this,e,t)}become(e){return!1}get type(){return W.Text}static find(e,t){for(let i=0,s=0;i=t){if(r instanceof he)return r;if(o>t)break}s=o+r.breakAfter}return null}}class gt extends z{constructor(e,t,i){super(),this.widget=e,this.length=t,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof gt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer([]),this.curLine=null,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(0,i)),this.getLine().append(Ci(new at(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof bt){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof bt)if(i.block){let{type:a}=i;a==W.WidgetAfter&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new gt(i.widget||new Rr("div"),l,a))}else{let a=tt.create(i.widget||new Rr("span"),l,i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),c=!a.isEditable&&(en.some(e=>e)});class Ji{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new Ji(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const Lr=L.define({map:(n,e)=>n.map(e)});function Re(n,e,t){let i=n.facet(Ll);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const mn=D.define({combine:n=>n.length?n[0]:!0});let fc=0;const Yt=D.define();class ce{constructor(e,t,i,s){this.id=e,this.create=t,this.domEventHandlers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:i,provide:s,decorations:r}=t||{};return new ce(fc++,e,i,o=>{let l=[Yt.of(o)];return r&&l.push(fi.of(a=>{let h=a.plugin(o);return h?r(h):T.none})),s&&l.push(s(o)),l})}static fromClass(e,t){return ce.define(i=>new e(i),t)}}class Pn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Re(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Re(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Re(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Nl=D.define(),Vl=D.define(),fi=D.define(),Fl=D.define(),Hl=D.define(),_t=D.define();class Je{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Je(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!a)return i;new Je(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class Xi{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Y.empty(this.startState.doc.length);for(let o of i)this.changes=this.changes.compose(o.changes);let s=[];this.changes.iterChangedRanges((o,l,a,h)=>s.push(new Je(o,l,a,h))),this.changedRanges=s;let r=e.hasFocus;r!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=r,this.flags|=1)}static create(e,t,i){return new Xi(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var J=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(J||(J={}));const gs=J.LTR,uc=J.RTL;function Wl(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}const q=[];function yc(n,e){let t=n.length,i=e==gs?1:2,s=e==gs?2:1;if(!n||i==1&&!mc.test(n))return zl(t);for(let o=0,l=i,a=i;o=0;u-=3)if(Le[u+1]==-c){let d=Le[u+2],p=d&2?i:d&4?d&1?s:i:0;p&&(q[o]=q[Le[u]]=p),l=u;break}}else{if(Le.length==189)break;Le[l++]=o,Le[l++]=h,Le[l++]=a}else if((f=q[o])==2||f==1){let u=f==i;a=u?0:1;for(let d=l-3;d>=0;d-=3){let p=Le[d+2];if(p&2)break;if(u)Le[d+2]|=2;else{if(p&4)break;Le[d+2]|=4}}}for(let o=0;ol;){let c=h,f=q[--h]!=2;for(;h>l&&f==(q[h-1]!=2);)h--;r.push(new Bt(h,c,f?2:1))}else r.push(new Bt(l,o,0))}else for(let o=0;o1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=z.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+Math.min(t,i.offset))}}function Er(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}class Ir{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Nr extends z{constructor(e){super(),this.view=e,this.compositionDeco=T.none,this.decorations=[],this.dynamicDecorationMap=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new he],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Je(0,0,0,e.state.doc.length)],0)}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:o,toA:l})=>lthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=T.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=xc(this.view,e.changes)),(A.ie||A.chrome)&&!this.compositionDeco.size&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,s=this.updateDeco(),r=Cc(i,s,e.changes);return t=Je.extendWithRanges(t,r),this.dirty==0&&t.length==0?!1:(this.updateInner(t,e.startState.doc.length),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let r=A.chrome||A.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(r),this.dirty=0,r&&(r.written||i.selectionRange.focusNode!=r.node)&&(this.forceSelection=!0),this.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to=0?e[s]:null;if(!r)break;let{fromA:o,toA:l,fromB:a,toB:h}=r,{content:c,breakAtStart:f,openStart:u,openEnd:d}=$s.build(this.view.state.doc,a,h,this.decorations,this.dynamicDecorationMap),{i:p,off:g}=i.findPos(l,1),{i:y,off:b}=i.findPos(o,-1);xl(this,y,b,p,g,c,f,u,d)}}updateSelection(e=!1,t=!1){if((e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange(),!(t||this.mayControlSelection())||A.ios&&this.view.inputState.rapidCompositionStart)return;let i=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,r=this.domAtPos(s.anchor),o=s.empty?r:this.domAtPos(s.head);if(A.gecko&&s.empty&&wc(r)){let a=document.createTextNode("");this.view.observer.ignore(()=>r.node.insertBefore(a,r.node.childNodes[r.offset]||null)),r=o=new ne(a,0),i=!0}let l=this.view.observer.selectionRange;(i||!l.focusNode||!Ki(r.node,r.offset,l.anchorNode,l.anchorOffset)||!Ki(o.node,o.offset,l.focusNode,l.focusOffset))&&(this.view.observer.ignore(()=>{A.android&&A.chrome&&this.dom.contains(l.focusNode)&&Ac(l.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let a=Ui(this.view.root);if(a)if(s.empty){if(A.gecko){let h=Sc(r.node,r.offset);if(h&&h!=3){let c=Ul(r.node,r.offset,h==1?1:-1);c&&(r=new ne(c,h==1?0:c.nodeValue.length))}}a.collapse(r.node,r.offset),s.bidiLevel!=null&&l.cursorBidiLevel!=null&&(l.cursorBidiLevel=s.bidiLevel)}else if(a.extend)a.collapse(r.node,r.offset),a.extend(o.node,o.offset);else{let h=document.createRange();s.anchor>s.head&&([r,o]=[o,r]),h.setEnd(o.node,o.offset),h.setStart(r.node,r.offset),a.removeAllRanges(),a.addRange(h)}}),this.view.observer.setSelectionRange(r,o)),this.impreciseAnchor=r.precise?null:new ne(l.anchorNode,l.anchorOffset),this.impreciseHead=o.precise?null:new ne(l.focusNode,l.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let e=this.view.state.selection.main,t=Ui(this.view.root);if(!t||!e.empty||!e.assoc||!t.modify)return;let i=he.find(this,e.head);if(!i)return;let s=i.posAtStart;if(e.head==s||e.head==s+i.length)return;let r=this.coordsAt(e.head,-1),o=this.coordsAt(e.head,1);if(!r||!o||r.bottom>o.top)return;let l=this.domAtPos(e.head+e.assoc);t.collapse(l.node,l.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}mayControlSelection(){let e=this.view.root.activeElement;return e==this.dom||Hi(this.dom,this.view.observer.selectionRange)&&!(e&&this.dom.contains(e))}nearest(e){for(let t=e;t;){let i=z.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;to||e==o&&r.type!=W.WidgetBefore&&r.type!=W.WidgetAfter&&(!s||t==2||this.children[s-1].breakAfter||this.children[s-1].type==W.WidgetBefore&&t>-2))return r.coordsAt(e-o,t);i=o}}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==J.LTR;for(let h=0,c=0;cs)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,g=p?hi(p):[];if(g.length){let y=g[g.length-1],b=a?y.right-d.left:d.right-y.left;b>l&&(l=b,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?J.RTL:J.LTR}measureTextSize(){for(let s of this.children)if(s instanceof he){let r=s.measureTextSize();if(r)return r}let e=document.createElement("div"),t,i;return e.className="cm-line",e.style.width="99999px",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=hi(e.firstChild)[0];t=e.getBoundingClientRect().height,i=s?s.width/27:7,e.remove()}),{lineHeight:t,charWidth:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new wl(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=t.lineBlockAt(o).bottom-t.lineBlockAt(i).top;e.push(T.replace({widget:new Vr(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return T.set(e)}updateDeco(){let e=this.view.state.facet(fi).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=0,o=0,l=0,a=0;for(let c of this.view.state.facet(Hl).map(f=>f(this.view)))if(c){let{left:f,right:u,top:d,bottom:p}=c;f!=null&&(r=Math.max(r,f)),u!=null&&(o=Math.max(o,u)),d!=null&&(l=Math.max(l,d)),p!=null&&(a=Math.max(a,p))}let h={left:i.left-r,top:i.top-l,right:i.right+o,bottom:i.bottom+a};sc(this.view.scrollDOM,h,t.head0&&t<=0)n=n.childNodes[e-1],e=ci(n);else if(n.nodeType==1&&e=0)n=n.childNodes[e],e=0;else return null}}function Sc(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e0;){let h=Se(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;ln?e.left-n:Math.max(0,n-e.right)}function Oc(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Rn(n,e){return n.tope.top+1}function Fr(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function ys(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let g=hi(p);for(let y=0;yv||o==v&&r>S)&&(i=p,s=b,r=S,o=v,l=!S||(S>0?y0)),S==0?t>b.bottom&&(!c||c.bottomb.top)&&(h=p,f=b):c&&Rn(c,b)?c=Hr(c,b.bottom):f&&Rn(f,b)&&(f=Fr(f,b.top))}}if(c&&c.bottom>=t?(i=a,s=c):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return Wr(i,u,t);if(l&&i.contentEditable!="false")return ys(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function Wr(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((A.chrome||A.gecko)&&Et(n,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function Kl(n,{x:e,y:t},i,s=-1){var r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:h}=n.viewState,c=t-l;if(c<0)return 0;if(c>h)return n.state.doc.length;for(let b=n.defaultLineHeight/2,S=!1;a=n.elementAtHeight(c),a.type!=W.Text;)for(;c=s>0?a.bottom+b:a.top-b,!(c>=0&&c<=h);){if(S)return i?null:0;S=!0,s=-s}t=l+c;let f=a.from;if(fn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:i?null:zr(n,o,a,e,t);let u=n.dom.ownerDocument,d=n.root.elementFromPoint?n.root:u,p=d.elementFromPoint(e,t);p&&!n.contentDOM.contains(p)&&(p=null),p||(e=Math.max(o.left+1,Math.min(o.right-1,e)),p=d.elementFromPoint(e,t),p&&!n.contentDOM.contains(p)&&(p=null));let g,y=-1;if(p&&((r=n.docView.nearest(p))===null||r===void 0?void 0:r.isEditable)!=!1){if(u.caretPositionFromPoint){let b=u.caretPositionFromPoint(e,t);b&&({offsetNode:g,offset:y}=b)}else if(u.caretRangeFromPoint){let b=u.caretRangeFromPoint(e,t);b&&({startContainer:g,startOffset:y}=b,(!n.contentDOM.contains(g)||A.safari&&Tc(g,y,e)||A.chrome&&Bc(g,y,e))&&(g=void 0))}}if(!g||!n.docView.dom.contains(g)){let b=he.find(n.docView,f);if(!b)return c>a.top+a.height/2?a.to:a.from;({node:g,offset:y}=ys(b.dom,e,t))}return n.docView.posFromDOM(g,y)}function zr(n,e,t,i,s){let r=Math.round((i-e.left)*n.defaultCharacterWidth);n.lineWrapping&&t.height>n.defaultLineHeight*1.5&&(r+=Math.floor((s-t.top)/n.defaultLineHeight)*n.viewState.heightOracle.lineLength);let o=n.state.sliceDoc(t.from,t.to);return t.from+ns(o,r,n.state.tabSize)}function Tc(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Et(n,i-1,i).getBoundingClientRect().left>t}function Bc(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Et(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Pc(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=!i||!n.lineWrapping?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let a=n.dom.getBoundingClientRect(),h=n.textDirectionAt(s.from),c=n.posAtCoords({x:t==(h==J.LTR)?a.right-1:a.left+1,y:(r.top+r.bottom)/2});if(c!=null)return m.cursor(c,t?-1:1)}let o=he.find(n.docView,e.head),l=o?t?o.posAtEnd:o.posAtStart:t?s.to:s.from;return m.cursor(l,t?-1:1)}function qr(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=bc(s,r,o,l,t),c=ql;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c=` -`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=m.cursor(t?s.from:s.to)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function Rc(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==ae.Space&&(s=o),s==o}}function Lc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return m.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i!=null?i:n.defaultLineHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Kl(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?gs))return m.cursor(g,e.assoc,void 0,o)}}function Ln(n,e,t){let i=n.state.facet(Fl).map(s=>s(n));for(;;){let s=!1;for(let r of i)r.between(t.from-1,t.from+1,(o,l,a)=>{t.from>o&&t.fromt.from?m.cursor(o,1):m.cursor(l,-1),s=!0)});if(!s)return t}}class Ec{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;for(let t in Q){let i=Q[t];e.contentDOM.addEventListener(t,s=>{!$r(e,s)||this.ignoreDuringComposition(s)||t=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(t,e,s)?s.preventDefault():i(e,s))},bs[t]),this.registeredEvents.push(t)}A.chrome&&A.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,A.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{!$r(e,l)||this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Re(t.state,o)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Re(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()s.keyCode==t.keyCode))&&!(t.ctrlKey||t.altKey||t.metaKey)&&!t.synthetic?(this.pendingIOSKey=i,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,ni(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:A.safari&&!A.ios&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229||e.type=="compositionend"&&!A.ios}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const Gl=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Jl=[16,17,18,20,91,92,224,225];class Ic{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.lastEvent=t;let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(N.allowMultipleSelections)&&Nc(e,t),this.dragMove=Vc(e,t),this.dragging=Fc(e,t)&&js(t)==1?null:!1,this.dragging===!1&&(t.preventDefault(),this.select(t))}move(e){if(e.buttons==0)return this.destroy();this.dragging===!1&&this.select(this.lastEvent=e)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}select(e){let t=this.style.get(e,this.extend,this.multiple);(this.mustSelect||!t.eq(this.view.state.selection)||t.main.assoc!=this.view.state.selection.main.assoc)&&this.view.dispatch({selection:t,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Nc(n,e){let t=n.state.facet(Bl);return t.length?t[0](e):A.mac?e.metaKey:e.ctrlKey}function Vc(n,e){let t=n.state.facet(Pl);return t.length?t[0](e):A.mac?!e.altKey:!e.ctrlKey}function Fc(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Ui(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function $r(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=z.get(t))&&i.ignoreEvent(e))return!1;return!0}const Q=Object.create(null),bs=Object.create(null),Xl=A.ie&&A.ie_version<15||A.ios&&A.webkit_version<604;function Hc(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),Yl(n,t.value)},50)}function Yl(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(ws!=null&&t.selection.ranges.every(a=>a.empty)&&ws==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:m.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:m.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Q.keydown=(n,e)=>{n.inputState.setSelectionOrigin("select"),e.keyCode==27?n.inputState.lastEscPress=Date.now():Jl.indexOf(e.keyCode)<0&&(n.inputState.lastEscPress=0)};Q.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Q.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};bs.touchstart=bs.touchmove={passive:!0};Q.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3&&js(e)==1)return;let t=null;for(let i of n.state.facet(Rl))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=qc(n,e)),t){let i=n.root.activeElement!=n.contentDOM;i&&n.observer.ignore(()=>yl(n.contentDOM)),n.inputState.startMouseSelection(new Ic(n,e,t,i))}};function jr(n,e,t,i){if(i==1)return m.cursor(e,t);if(i==2)return Mc(n.state,e,t);{let s=he.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return ln>=e.top&&n<=e.bottom,Ur=(n,e,t)=>_l(e,t)&&n>=t.left&&n<=t.right;function Wc(n,e,t,i){let s=he.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&Ur(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&Ur(t,i,l)?1:o&&_l(i,o)?-1:1}function Kr(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Wc(n,t,e.clientX,e.clientY)}}const zc=A.ie&&A.ie_version<=11;let Gr=null,Jr=0,Xr=0;function js(n){if(!zc)return n.detail;let e=Gr,t=Xr;return Gr=n,Xr=Date.now(),Jr=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Jr+1)%3:1}function qc(n,e){let t=Kr(n,e),i=js(e),s=n.state.selection,r=t,o=e;return{update(l){l.docChanged&&(t&&(t.pos=l.changes.mapPos(t.pos)),s=s.map(l.changes),o=null)},get(l,a,h){let c;if(o&&l.clientX==o.clientX&&l.clientY==o.clientY?c=r:(c=r=Kr(n,l),o=l),!c||!t)return s;let f=jr(n,c.pos,c.bias,i);if(t.pos!=c.pos&&!a){let u=jr(n,t.pos,t.bias,i),d=Math.min(u.from,f.from),p=Math.max(u.to,f.to);f=d1&&s.ranges.some(u=>u.eq(f))?$c(s,f):h?s.addRange(f):m.create([f])}}}function $c(n,e){for(let t=0;;t++)if(n.ranges[t].eq(e))return m.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}Q.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove")};function Yr(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&r.dragMove?{from:r.dragging.from,to:r.dragging.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}Q.drop=(n,e)=>{if(!e.dataTransfer)return;if(n.state.readOnly)return e.preventDefault();let t=e.dataTransfer.files;if(t&&t.length){e.preventDefault();let i=Array(t.length),s=0,r=()=>{++s==t.length&&Yr(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}}else Yr(n,e,e.dataTransfer.getData("Text"),!0)};Q.paste=(n,e)=>{if(n.state.readOnly)return e.preventDefault();n.observer.flush();let t=Xl?null:e.clipboardData;t?(Yl(n,t.getData("text/plain")),e.preventDefault()):Hc(n)};function jc(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function Uc(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let ws=null;Q.copy=Q.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=Uc(n.state);if(!t&&!s)return;ws=s?t:null;let r=Xl?null:e.clipboardData;r?(e.preventDefault(),r.clearData(),r.setData("text/plain",t)):jc(n,t),e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})};function Ql(n){setTimeout(()=>{n.hasFocus!=n.inputState.notifiedFocused&&n.update([])},10)}Q.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),Ql(n)};Q.blur=n=>{n.observer.clearSelectionRange(),Ql(n)};function Zl(n,e){if(n.docView.compositionDeco.size){n.inputState.rapidCompositionStart=e;try{n.update([])}finally{n.inputState.rapidCompositionStart=!1}}}Q.compositionstart=Q.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0,n.docView.compositionDeco.size&&(n.observer.flush(),Zl(n,!0)))};Q.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionFirstChange=null,setTimeout(()=>{n.inputState.composing<0&&Zl(n,!1)},50)};Q.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Q.beforeinput=(n,e)=>{var t;let i;if(A.chrome&&A.android&&(i=Gl.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}};const _r=["pre-wrap","normal","pre-line","break-spaces"];class Kc{constructor(){this.doc=I.empty,this.lineWrapping=!1,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength)),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return _r.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.lineLength=s,l){this.heightSamples={};for(let a=0;a0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Wi&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return ye.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this;for(let o=s.length-1;o>=0;o--){let{fromA:l,toA:a,fromB:h,toB:c}=s[o],f=r.lineAt(l,H.ByPosNoHeight,t,0,0),u=f.to>=a?f:r.lineAt(a,H.ByPosNoHeight,t,0,0);for(c+=u.to-a,a=u.to;o>0&&f.from<=s[o-1].toA;)l=s[o-1].fromA,h=s[o-1].fromB,o--,lr*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class we extends ea{constructor(e,t){super(e,t,W.Text),this.collapsed=0,this.widgetHeight=0}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof we||s instanceof ee&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof ee?s=new we(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):ye.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ee extends ye{constructor(e){super(e,0)}lines(e,t){let i=e.lineAt(t).number,s=e.lineAt(t+this.length).number;return{firstLine:i,lastLine:s,lineHeight:this.height/(s-i+1)}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,lineHeight:l}=this.lines(t,s),a=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:h,length:c}=t.line(r+a);return new nt(h,c,i+l*a,l,W.Text)}lineAt(e,t,i,s,r){if(t==H.ByHeight)return this.blockAt(e,i,s,r);if(t==H.ByPosNoHeight){let{from:f,to:u}=i.lineAt(e);return new nt(f,u-f,0,0,W.Text)}let{firstLine:o,lineHeight:l}=this.lines(i,r),{from:a,length:h,number:c}=i.lineAt(e);return new nt(a,h,s+l*(c-o),l,W.Text)}forEachLine(e,t,i,s,r,o){let{firstLine:l,lineHeight:a}=this.lines(i,r);for(let h=Math.max(e,r),c=Math.min(r+this.length,t);h<=c;){let f=i.lineAt(h);h==e&&(s+=a*(f.number-l)),o(new nt(f.from,f.length,s,a,W.Text)),s+=a,h=f.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof ee?i[i.length-1]=new ee(r.length+s):i.push(null,new ee(s-1))}if(e>0){let r=i[0];r instanceof ee?i[0]=new ee(e+r.length):i.unshift(new ee(e-1),null)}return ye.of(i)}decomposeLeft(e,t){t.push(new ee(e-1),null)}decomposeRight(e,t){t.push(null,new ee(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1,h=e.heightChanged;for(s.from>t&&o.push(new ee(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let f=e.doc.lineAt(l).length;o.length&&o.push(null);let u=s.heights[s.index++];a==-1?a=u:Math.abs(u-a)>=Wi&&(a=-2);let d=new we(f,u);d.outdated=!1,o.push(d),l+=f+1}l<=r&&o.push(null,new ee(r-l).updateHeight(e,l));let c=ye.of(o);return e.heightChanged=h||a<0||Math.abs(c.height-this.height)>=Wi||Math.abs(a-this.lines(e.doc,t).lineHeight)>=Wi,c}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Jc extends ye{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return h;let c=t==H.ByPosNoHeight?H.ByPosNoHeight:H.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,H.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&Qr(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?ye.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Qr(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof ee&&(i=n[e+1])instanceof ee&&n.splice(e-1,3,new ee(t.length+1+i.length))}const Xc=5;class Us{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof we?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new we(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=Xc)&&this.addLineDeco(s,r)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new we(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new ee(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof we)return e;let t=new we(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine(),e.type==W.WidgetAfter&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=W.WidgetBefore&&(this.covering=e)}addLineDeco(e,t){let i=this.ensureLine();i.length+=t,i.collapsed+=t,i.widgetHeight=Math.max(i.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof we)&&!this.isCovered?this.nodes.push(new we(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&c.overflow!="visible"){let f=h.getBoundingClientRect();i=Math.max(i,f.left),s=Math.min(s,f.right),r=Math.max(r,f.top),o=a==n.parentNode?f.bottom:Math.min(o,f.bottom)}a=c.position=="absolute"||c.position=="fixed"?h.offsetParent:h.parentNode}else if(a.nodeType==11)a=a.host;else break;return{left:i-t.left,right:Math.max(i,s)-t.left,top:r-(t.top+e),bottom:Math.max(r,o)-(t.top+e)}}function Zc(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class En{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof t!="function"),this.heightMap=ye.empty().applyChanges(this.stateDeco,I.empty,this.heightOracle.setDoc(e.doc),[new Je(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=T.set(this.lineGaps.map(t=>t.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Ai(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?io:new sf(this.heightOracle.doc,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:Qt(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(fi).filter(h=>typeof h!="function");let s=e.changedRanges,r=Je.extendWithRanges(s,Yc(i,this.stateDeco,e?e.changes:Y.empty(this.state.doc.length))),o=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2);let l=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let a=!e.changes.empty||e.flags&2||l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,this.updateForViewport(),a&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?J.RTL:J.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=o||this.mustMeasureContent||this.contentDOMHeight!=t.clientHeight;this.contentDOMHeight=t.clientHeight,this.mustMeasureContent=!1;let a=0,h=0,c=parseInt(i.paddingTop)||0,f=parseInt(i.paddingBottom)||0;(this.paddingTop!=c||this.paddingBottom!=f)&&(this.paddingTop=c,this.paddingBottom=f,a|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,a|=8);let u=(this.printing?Zc:Qc)(t,this.paddingTop),d=u.top-this.pixelViewport.top,p=u.bottom-this.pixelViewport.bottom;this.pixelViewport=u;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(l=!0)),!this.inView)return 0;let y=t.clientWidth;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=y,this.editorHeight=e.scrollDOM.clientHeight,a|=8),l){let S=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(S)&&(o=!0),o||s.lineWrapping&&Math.abs(y-this.contentDOMWidth)>s.charWidth){let{lineHeight:v,charWidth:k}=e.docView.measureTextSize();o=s.refresh(r,v,k,y/k,S),o&&(e.docView.minWidth=0,a|=8)}d>0&&p>0?h=Math.max(d,p):d<0&&p<0&&(h=Math.min(d,p)),s.heightChanged=!1;for(let v of this.viewports){let k=v.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(v);this.heightMap=this.heightMap.updateHeight(s,0,o,new Gc(v.from,k))}s.heightChanged&&(a|=2)}let b=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(this.viewport=this.getViewport(h,this.scrollTarget)),this.updateForViewport(),(a&2||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps)),a|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),a}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.state.doc,{visibleTop:o,visibleBottom:l}=this,a=new Ai(s.lineAt(o-i*1e3,H.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,H.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,H.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&ri.from&&l.push({from:i.from,to:r}),o=i.from&&a.from<=i.to&&to(l,a.from-10,a.from+10),!a.empty&&a.to>=i.from&&a.to<=i.to&&to(l,a.to-10,a.to+10);for(let{from:h,to:c}of l)c-h>1e3&&t.push(nf(e,f=>f.from>=i.from&&f.to<=i.to&&Math.abs(f.from-h)<1e3&&Math.abs(f.to-c)<1e3)||new En(h,c,this.gapSize(i,h,c,s)))}return t}gapSize(e,t,i,s){let r=eo(s,i)-eo(s,t);return this.heightOracle.lineWrapping?e.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(e){En.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=T.set(e.map(t=>t.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];$.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Qt(this.heightMap.lineAt(e,H.ByPos,this.state.doc,0,0),this.scaler)}lineBlockAtHeight(e){return Qt(this.heightMap.lineAt(this.scaler.fromDOM(e),H.ByHeight,this.state.doc,0,0),this.scaler)}elementAtHeight(e){return Qt(this.heightMap.blockAt(this.scaler.fromDOM(e),this.state.doc,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ai{constructor(e,t){this.from=e,this.to=t}}function tf(n,e,t){let i=[],s=n,r=0;return $.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function eo(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function to(n,e,t){for(let i=0;ie){let r=[];s.fromt&&r.push({from:t,to:s.to}),n.splice(i,1,...r),i+=r.length-1}}}function nf(n,e){for(let t of n)if(e(t))return t}const io={toDOM(n){return n},fromDOM(n){return n},scale:1};class sf{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,H.ByPos,e,0,0).top,c=t.lineAt(a,H.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=tQt(s,e)):n.type)}const Di=D.define({combine:n=>n.join(" ")}),xs=D.define({combine:n=>n.indexOf(!0)>-1}),ks=ot.newName(),ta=ot.newName(),ia=ot.newName(),na={"&light":"."+ta,"&dark":"."+ia};function Ss(n,e,t){return new ot(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const rf=Ss("."+ks,{"&.cm-editor":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},na),of={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},In=A.ie&&A.ie_version<=11;class lf{constructor(e,t,i){this.view=e,this.onChange=t,this.onScrollChanged=i,this.active=!1,this.selectionRange=new rc,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.scrollTargets=[],this.intersection=null,this.resize=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(s=>{for(let r of s)this.queue.push(r);(A.ie&&A.ie_version<=11||A.ios&&e.composing)&&s.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),In&&(this.onCharData=s=>{this.queue.push({target:s.target,type:"characterData",oldValue:s.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resize=new ResizeObserver(()=>{this.view.docView.lastUpdate{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),s.length>0&&s[s.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(s=>{s.length>0&&s[s.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:t}=this,i=this.selectionRange;if(t.state.facet(mn)?t.root.activeElement!=this.dom:!Hi(t.dom,i))return;let s=i.anchorNode&&t.docView.nearest(i.anchorNode);s&&s.ignoreEvent(e)||((A.ie&&A.ie_version<=11||A.android&&A.chrome)&&!t.state.selection.main.empty&&i.focusNode&&Ki(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1))}readSelectionRange(){let{view:e}=this,t=A.safari&&e.root.nodeType==11&&ic()==this.dom&&af(this.view)||Ui(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=Hi(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let i=this.delayedAndroidKey;this.delayedAndroidKey=null,this.delayedFlush=-1,this.flush()||ni(this.dom,i.key,i.keyCode)}),(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t})}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=window.setTimeout(()=>{this.delayedFlush=-1,this.flush()},20))}forceFlush(){this.delayedFlush>=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1),this.flush()}processRecords(){let e=this.queue;for(let r of this.observer.takeRecords())e.push(r);e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);!o||(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return;e&&this.readSelectionRange();let{from:t,to:i,typeOver:s}=this.processRecords(),r=this.selectionChanged&&Hi(this.dom,this.selectionRange);if(t<0&&!r)return;this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=this.view.state,l=this.onChange(t,i,s);return this.view.state==o&&this.view.update([]),l}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.dirty|=4),e.type=="childList"){let i=no(t,e.previousSibling||e.target.previousSibling,-1),s=no(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resize)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout)}}function no(n,e,t){for(;e;){let i=z.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function af(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),document.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return Ki(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}function hf(n,e,t,i){let s,r,o=n.state.selection.main;if(e>-1){let l=n.docView.domBoundsAround(e,t,0);if(!l||n.state.readOnly)return!1;let{from:a,to:h}=l,c=n.docView.impreciseHead||n.docView.impreciseAnchor?[]:ff(n),f=new $l(c,n.state);f.readRange(l.startDOM,l.endDOM);let u=o.from,d=null;(n.inputState.lastKeyCode===8&&n.inputState.lastKeyTime>Date.now()-100||A.android&&f.text.length=o.from&&s.to<=o.to&&(s.from!=o.from||s.to!=o.to)&&o.to-o.from-(s.to-s.from)<=4?s={from:o.from,to:o.to,insert:n.state.doc.slice(o.from,s.from).append(s.insert).append(n.state.doc.slice(s.to,o.to))}:(A.mac||A.android)&&s&&s.from==s.to&&s.from==o.head-1&&s.insert.toString()=="."&&(s={from:o.from,to:o.to,insert:I.of([" "])}),s){let l=n.state;if(A.ios&&n.inputState.flushIOSKey(n)||A.android&&(s.from==o.from&&s.to==o.to&&s.insert.length==1&&s.insert.lines==2&&ni(n.contentDOM,"Enter",13)||s.from==o.from-1&&s.to==o.to&&s.insert.length==0&&ni(n.contentDOM,"Backspace",8)||s.from==o.from&&s.to==o.to+1&&s.insert.length==0&&ni(n.contentDOM,"Delete",46)))return!0;let a=s.insert.toString();if(n.state.facet(El).some(f=>f(n,s.from,s.to,a)))return!0;n.inputState.composing>=0&&n.inputState.composing++;let h;if(s.from>=o.from&&s.to<=o.to&&s.to-s.from>=(o.to-o.from)/3&&(!r||r.main.empty&&r.main.from==s.from+s.insert.length)&&n.inputState.composing<0){let f=o.froms.to?l.sliceDoc(s.to,o.to):"";h=l.replaceSelection(n.state.toText(f+s.insert.sliceString(0,void 0,n.state.lineBreak)+u))}else{let f=l.changes(s),u=r&&!l.selection.main.eq(r.main)&&r.main.to<=f.newLength?r.main:void 0;if(l.selection.ranges.length>1&&n.inputState.composing>=0&&s.to<=o.to&&s.to>=o.to-10){let d=n.state.sliceDoc(s.from,s.to),p=jl(n)||n.state.doc.lineAt(o.head),g=o.to-s.to,y=o.to-o.from;h=l.changeByRange(b=>{if(b.from==o.from&&b.to==o.to)return{changes:f,range:u||b.map(f)};let S=b.to-g,v=S-d.length;if(b.to-b.from!=y||n.state.sliceDoc(v,S)!=d||p&&b.to>=p.from&&b.from<=p.to)return{range:b};let k=l.changes({from:v,to:S,insert:s.insert}),C=b.to-o.to;return{changes:k,range:u?m.range(Math.max(0,u.anchor+C),Math.max(0,u.head+C)):b.map(k)}})}else h={changes:f,selection:u&&l.selection.replaceRange(u)}}let c="input.type";return n.composing&&(c+=".compose",n.inputState.compositionFirstChange&&(c+=".start",n.inputState.compositionFirstChange=!1)),n.dispatch(h,{scrollIntoView:!0,userEvent:c}),!0}else if(r&&!r.main.eq(o)){let l=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(l=!0),a=n.inputState.lastSelectionOrigin),n.dispatch({selection:r,scrollIntoView:l,userEvent:a}),!0}else return!1}function cf(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}return o=o?r-t:0,l=r+(l-o),o=r):l=l?r-t:0,o=r+(o-l),l=r),{from:r,toA:o,toB:l}}function ff(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new Ir(t,i)),(s!=t||r!=i)&&e.push(new Ir(s,r))),e}function uf(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?m.single(t+e,i+e):null}class O{constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this._root=e.root||oc(e.parent)||document,this.viewState=new Zr(e.state||N.create(e)),this.plugins=this.state.facet(Yt).map(t=>new Pn(t));for(let t of this.plugins)t.update(this);this.observer=new lf(this,(t,i,s)=>hf(this,t,i,s),t=>{this.inputState.runScrollHandlers(this,t),this.observer.intersecting&&this.measure()}),this.inputState=new Ec(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new Nr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}dispatch(...e){this._dispatch(e.length==1&&e[0]instanceof _?e[0]:this.state.update(...e))}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let l of e){if(l.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=l.state}if(this.destroyed){this.viewState.state=r;return}if(this.observer.clear(),r.facet(N.phrases)!=this.state.facet(N.phrases))return this.setState(r);s=Xi.create(this,r,e);let o=this.viewState.scrollTarget;try{this.updateState=2;for(let l of e){if(o&&(o=o.map(l.changes)),l.scrollIntoView){let{main:a}=l.state.selection;o=new Ji(a.empty?a:m.cursor(a.head,a.head>a.anchor?-1:1))}for(let a of l.effects)a.is(Lr)&&(o=a.value)}this.viewState.update(s,o),this.bidiCache=Yi.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(_t)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(l=>l.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Di)!=s.state.facet(Di)&&(this.viewState.mustMeasureContent=!0),(t||i||o||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let l of this.state.facet(ps))l(s)}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Zr(e),this.plugins=e.facet(Yt).map(i=>new Pn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new Nr(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Yt),i=e.state.facet(Yt);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Pn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,{scrollHeight:i,scrollTop:s,clientHeight:r}=this.scrollDOM,o=s>i-r-4?i:s;try{for(let l=0;;l++){this.updateState=1;let a=this.viewport,h=this.viewState.lineBlockAtHeight(o),c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];c&4||([this.measureRequests,f]=[f,this.measureRequests]);let u=f.map(y=>{try{return y.read(this)}catch(b){return Re(this.state,b),so}}),d=Xi.create(this,this.state,[]),p=!1,g=!1;d.flags|=c,t?t.flags|=c:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),p=this.docView.update(d));for(let y=0;y1||y<-1)&&(this.scrollDOM.scrollTop+=y,g=!0)}if(p&&this.docView.updateSelection(!0),this.viewport.from==a.from&&this.viewport.to==a.to&&!g&&this.measureRequests.length==0)break}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(ps))l(t)}get themeClasses(){return ks+" "+(this.state.facet(xs)?ia:ta)+" "+this.state.facet(Di)}updateAttrs(){let e=ro(this,Nl,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(mn)?"true":"false",class:"cm-content",style:`${A.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),ro(this,Vl,t);let i=this.observer.ignore(()=>{let s=us(this.contentDOM,this.contentAttrs,t),r=us(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(O.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(_t),ot.mount(this.root,this.styleModules.concat(rf).reverse())}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame(()=>this.measure())),e){if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Ln(this,e,qr(this,e,t,i))}moveByGroup(e,t){return Ln(this,e,qr(this,e,t,i=>Rc(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return Pc(this,e,t,i)}moveVertically(e,t,i){return Ln(this,e,Lc(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Kl(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[Bt.find(r,e-s.from,-1,t)];return dn(i,o.dir==J.LTR==t>0)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Il)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>df)return zl(e.length);let t=this.textDirectionAt(e.from);for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t)return s.order;let i=yc(e.text,t);return this.bidiCache.push(new Yi(e.from,e.to,t,i)),i}get hasFocus(){var e;return(document.hasFocus()||A.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{yl(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Lr.of(new Ji(typeof e=="number"?m.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return ce.define(()=>({}),{eventHandlers:e})}static theme(e,t){let i=ot.newName(),s=[Di.of(i),_t.of(Ss(`.${i}`,e))];return t&&t.dark&&s.push(xs.of(!0)),s}static baseTheme(e){return kt.lowest(_t.of(Ss("."+ks,e,na)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&z.get(i)||z.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}O.styleModule=_t;O.inputHandler=El;O.perLineTextDirection=Il;O.exceptionSink=Ll;O.updateListener=ps;O.editable=mn;O.mouseSelectionStyle=Rl;O.dragMovesSelection=Pl;O.clickAddsSelectionRange=Bl;O.decorations=fi;O.atomicRanges=Fl;O.scrollMargins=Hl;O.darkTheme=xs;O.contentAttributes=Vl;O.editorAttributes=Nl;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=L.define();const df=4096,so={};class Yi{constructor(e,t,i,s){this.from=e,this.to=t,this.dir=i,this.order=s}static update(e,t){if(t.empty)return e;let i=[],s=e.length?e[e.length-1].dir:J.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&fs(o,t)}return t}const pf=A.mac?"mac":A.windows?"win":A.linux?"linux":"key";function gf(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}function yf(n,e,t){return ra(sa(n.state),e,n,t)}let Ze=null;const bf=4e3;function wf(n,e=pf){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h)=>{let c=t[o]||(t[o]=Object.create(null)),f=l.split(/ (?!$)/).map(p=>gf(p,e));for(let p=1;p{let b=Ze={view:y,prefix:g,scope:o};return setTimeout(()=>{Ze==b&&(Ze=null)},bf),!0}]})}let u=f.join(" ");s(u,!1);let d=c[u]||(c[u]={preventDefault:!1,commands:[]});d.commands.push(a),h&&(d.preventDefault=!0)};for(let o of n){let l=o[e]||o.key;if(!!l)for(let a of o.scope?o.scope.split(" "):["editor"])r(a,l,o.run,o.preventDefault),o.shift&&r(a,"Shift-"+l,o.shift,o.preventDefault)}return t}function ra(n,e,t,i){let s=tc(e),r=te(s,0),o=xe(r)==s.length&&s!=" ",l="",a=!1;Ze&&Ze.view==t&&Ze.scope==i&&(l=Ze.prefix+" ",(a=Jl.indexOf(e.keyCode)<0)&&(Ze=null));let h=u=>{if(u){for(let d of u.commands)if(d(t))return!0;u.preventDefault&&(a=!0)}return!1},c=n[i],f;if(c){if(h(c[l+Oi(s,e,!o)]))return!0;if(o&&(e.shiftKey||e.altKey||e.metaKey||r>127)&&(f=lt[e.keyCode])&&f!=s){if(h(c[l+Oi(f,e,!0)]))return!0;if(e.shiftKey&&Rt[e.keyCode]!=f&&h(c[l+Oi(Rt[e.keyCode],e,!1)]))return!0}else if(o&&e.shiftKey&&h(c[l+Oi(s,e,!0)]))return!0}return a}const oa=!A.ios,Zt=D.define({combine(n){return qt(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Zp(n={}){return[Zt.of(n),xf,kf]}class la{constructor(e,t,i,s,r){this.left=e,this.top=t,this.width=i,this.height=s,this.className=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}const xf=ce.fromClass(class{constructor(n){this.view=n,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=n.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=n.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),n.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){this.cursorLayer.style.animationDuration=this.view.state.facet(Zt).cursorBlinkRate+"ms"}update(n){let e=n.startState.facet(Zt)!=n.state.facet(Zt);(e||n.selectionSet||n.geometryChanged||n.viewportChanged)&&this.view.requestMeasure(this.measureReq),n.transactions.some(t=>t.scrollIntoView)&&(this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),e&&this.setBlinkRate()}readPos(){let{state:n}=this.view,e=n.facet(Zt),t=n.selection.ranges.map(s=>s.empty?[]:Sf(this.view,s)).reduce((s,r)=>s.concat(r)),i=[];for(let s of n.selection.ranges){let r=s==n.selection.main;if(s.empty?!r||oa:e.drawRangeCursor){let o=vf(this.view,s,r);o&&i.push(o)}}return{rangePieces:t,cursors:i}}drawSel({rangePieces:n,cursors:e}){if(n.length!=this.rangePieces.length||n.some((t,i)=>!t.eq(this.rangePieces[i]))){this.selectionLayer.textContent="";for(let t of n)this.selectionLayer.appendChild(t.draw());this.rangePieces=n}if(e.length!=this.cursors.length||e.some((t,i)=>!t.eq(this.cursors[i]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent="";for(const i of e)this.cursorLayer.appendChild(i.draw())}else e.forEach((i,s)=>i.adjust(t[s]));this.cursors=e}}destroy(){this.selectionLayer.remove(),this.cursorLayer.remove()}}),aa={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};oa&&(aa[".cm-line"].caretColor="transparent !important");const kf=kt.highest(O.theme(aa));function ha(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==J.LTR?e.left:e.right-n.scrollDOM.clientWidth)-n.scrollDOM.scrollLeft,top:e.top-n.scrollDOM.scrollTop}}function lo(n,e,t){let i=m.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:W.Text}}function ao(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==W.Text))return i}return t}function Sf(n,e){if(e.to<=n.viewport.from||e.from>=n.viewport.to)return[];let t=Math.max(e.from,n.viewport.from),i=Math.min(e.to,n.viewport.to),s=n.textDirection==J.LTR,r=n.contentDOM,o=r.getBoundingClientRect(),l=ha(n),a=window.getComputedStyle(r.firstChild),h=o.left+parseInt(a.paddingLeft)+Math.min(0,parseInt(a.textIndent)),c=o.right-parseInt(a.paddingRight),f=ao(n,t),u=ao(n,i),d=f.type==W.Text?f:null,p=u.type==W.Text?u:null;if(n.lineWrapping&&(d&&(d=lo(n,t,d)),p&&(p=lo(n,i,p))),d&&p&&d.from==p.from)return y(b(e.from,e.to,d));{let v=d?b(e.from,null,d):S(f,!1),k=p?b(null,e.to,p):S(u,!0),C=[];return(d||f).to<(p||u).from-1?C.push(g(h,v.bottom,c,k.top)):v.bottomP&&U.from=be)break;Z>X&&E(Math.max(Be,X),v==null&&Be<=P,Math.min(Z,be),k==null&&Z>=V,le.dir)}if(X=se.to+1,X>=be)break}return j.length==0&&E(P,v==null,V,k==null,n.textDirection),{top:M,bottom:B,horizontal:j}}function S(v,k){let C=o.top+(k?v.top:v.bottom);return{top:C,bottom:C,horizontal:[]}}}function vf(n,e,t){let i=n.coordsAtPos(e.head,e.assoc||1);if(!i)return null;let s=ha(n);return new la(i.left-s.left,i.top-s.top,-1,i.bottom-i.top,t?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}const ca=L.define({map(n,e){return n==null?null:e.mapPos(n)}}),ei=de.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(ca)?i.value:t,n)}}),Cf=ce.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(ei);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(ei)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let n=this.view.state.field(ei),e=n!=null&&this.view.coordsAtPos(n);if(!e)return null;let t=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-t.left+this.view.scrollDOM.scrollLeft,top:e.top-t.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(n){this.cursor&&(n?(this.cursor.style.left=n.left+"px",this.cursor.style.top=n.top+"px",this.cursor.style.height=n.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(ei)!=n&&this.view.dispatch({effects:ca.of(n)})}},{eventHandlers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function eg(){return[ei,Cf]}function ho(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function Af(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class Mf{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(i){let l=typeof i=="function"?i:()=>i;this.addMatch=(a,h,c,f)=>f(c,c+a[0].length,l(a,h,c))}else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new yt,i=t.add.bind(t);for(let{from:s,to:r}of Af(e,this.maxLength))ho(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(b.range(g,y));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(y,e,g,p));t=t.update({filterFrom:c,filterTo:f,filter:(g,y)=>gf,add:u})}}return t}}const vs=/x/.unicode!=null?"gu":"g",Df=new RegExp(`[\0-\b --\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,vs),Of={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Nn=null;function Tf(){var n;if(Nn==null&&typeof document<"u"&&document.body){let e=document.body.style;Nn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Nn||!1}const zi=D.define({combine(n){let e=qt(n,{render:null,specialChars:Df,addSpecialChars:null});return(e.replaceTabs=!Tf())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,vs)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,vs)),e}});function tg(n={}){return[zi.of(n),Bf()]}let co=null;function Bf(){return co||(co=ce.fromClass(class{constructor(n){this.view=n,this.decorations=T.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(zi)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Mf({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=te(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=mi(o.text,l,i-o.from);return T.replace({widget:new Ef((l-a%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=T.replace({widget:new Lf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(zi);n.startState.facet(zi)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Pf="\u2022";function Rf(n){return n>=32?Pf:n==10?"\u2424":String.fromCharCode(9216+n)}class Lf extends ht{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Rf(this.code),i=e.state.phrase("Control character")+" "+(Of[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Ef extends ht{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class If extends ht{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function ig(n){return ce.fromClass(class{constructor(e){this.view=e,this.placeholder=T.set([T.widget({widget:new If(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?T.none:this.placeholder}},{decorations:e=>e.decorations})}const Cs=2e3;function Nf(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Cs||t.off>Cs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(m.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=ns(h.text,o,n.tabSize,!0);if(c>-1){let f=ns(h.text,l,n.tabSize);r.push(m.range(h.from+c,h.from+f))}}}return r}function Vf(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function fo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Cs?-1:s==i.length?Vf(n,e.clientX):mi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function Ff(n,e){let t=fo(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=fo(n,s);if(!l)return i;let a=Nf(n.state,t,l);return a.length?o?m.create(a.concat(i.ranges)):m.create(a):i}}:null}function ng(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?Ff(t,i):null)}const Vn="-10000px";class Hf{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){let t=e.state.facet(this.facet),i=t.filter(r=>r);if(t===this.input){for(let r of this.tooltipViews)r.update&&r.update(e);return!1}let s=[];for(let r=0;r{var e,t,i;return{position:A.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Wf}}}),fa=ce.fromClass(class{constructor(n){var e;this.view=n,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let t=n.state.facet(Fn);this.position=t.position,this.parent=t.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new Hf(n,ua,i=>this.createTooltip(i)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(i=>{Date.now()>this.lastTransaction-50&&i.length>0&&i[i.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),(e=n.dom.ownerDocument.defaultView)===null||e===void 0||e.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Fn);if(i.position!=this.position){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Vn,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;(n=this.view.dom.ownerDocument.defaultView)===null||n===void 0||n.removeEventListener("resize",this.measureSoon);for(let{dom:t}of this.manager.tooltipViews)t.remove();(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect();return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(Fn).tooltipSpace(this.view)}}writeMeasure(n){let{editor:e,space:t}=n,i=[];for(let s=0;s=Math.min(e.bottom,t.bottom)||a.rightMath.min(e.right,t.right)+.1){l.style.top=Vn;continue}let c=r.arrow?o.dom.querySelector(".cm-tooltip-arrow"):null,f=c?7:0,u=h.right-h.left,d=h.bottom-h.top,p=o.offset||qf,g=this.view.textDirection==J.LTR,y=h.width>t.right-t.left?g?t.left:t.right-h.width:g?Math.min(a.left-(c?14:0)+p.x,t.right-u):Math.max(t.left,a.left-u+(c?14:0)-p.x),b=!!r.above;!r.strictSide&&(b?a.top-(h.bottom-h.top)-p.yt.bottom)&&b==t.bottom-a.bottom>a.top-t.top&&(b=!b);let S=b?a.top-d-f-p.y:a.bottom+f+p.y,v=y+u;if(o.overlap!==!0)for(let k of i)k.lefty&&k.topS&&(S=b?k.top-d-2-f:k.bottom+f+2);this.position=="absolute"?(l.style.top=S-n.parent.top+"px",l.style.left=y-n.parent.left+"px"):(l.style.top=S+"px",l.style.left=y+"px"),c&&(c.style.left=`${a.left+(g?p.x:-p.x)-(y+14-7)}px`),o.overlap!==!0&&i.push({left:y,top:S,right:v,bottom:S+d}),l.classList.toggle("cm-tooltip-above",b),l.classList.toggle("cm-tooltip-below",!b),o.positioned&&o.positioned()}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Vn}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),zf=O.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:`${7}px`,width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:`${7}px solid transparent`,borderRight:`${7}px solid transparent`},".cm-tooltip-above &":{bottom:`-${7}px`,"&:before":{borderTop:`${7}px solid #bbb`},"&:after":{borderTop:`${7}px solid #f5f5f5`,bottom:"1px"}},".cm-tooltip-below &":{top:`-${7}px`,"&:before":{borderBottom:`${7}px solid #bbb`},"&:after":{borderBottom:`${7}px solid #f5f5f5`,top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),qf={x:0,y:0},ua=D.define({enables:[fa,zf]});function $f(n,e){let t=n.plugin(fa);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const uo=D.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function _i(n,e){let t=n.plugin(da),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const da=ce.fromClass(class{constructor(n){this.input=n.state.facet(Qi),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(uo);this.top=new Ti(n,!0,e.topContainer),this.bottom=new Ti(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(uo);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ti(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ti(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Qi);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>O.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Ti{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=po(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=po(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function po(n){let e=n.nextSibling;return n.remove(),e}const Qi=D.define({enables:da});class wt extends mt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}wt.prototype.elementClass="";wt.prototype.toDOM=void 0;wt.prototype.mapMode=oe.TrackBefore;wt.prototype.startSide=wt.prototype.endSide=-1;wt.prototype.point=!0;const jf=D.define(),Uf=new class extends wt{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Kf=jf.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges)if(i.empty){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(Uf.range(s)))}return $.of(e)});function sg(){return Kf}const Gf=1024;let Jf=0;class Ae{constructor(e,t){this.from=e,this.to=t}}class R{constructor(e={}){this.id=Jf++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=fe.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}R.closedBy=new R({deserialize:n=>n.split(" ")});R.openedBy=new R({deserialize:n=>n.split(" ")});R.group=new R({deserialize:n=>n.split(" ")});R.contextHash=new R({perNode:!0});R.lookAhead=new R({perNode:!0});R.mounted=new R({perNode:!0});class Xf{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}}const Yf=Object.create(null);class fe{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):Yf,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new fe(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(R.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(R.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}fe.none=new fe("",Object.create(null),0,8);class Gs{constructor(e){this.types=e;for(let t=0;t=s&&(o.type.isAnonymous||t(o)!==!1)){if(o.firstChild())continue;l=!0}for(;l&&i&&!o.type.isAnonymous&&i(o),!o.nextSibling();){if(!o.parent())return;l=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Ys(fe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new F(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new F(fe.none,t,i,s)))}static build(e){return Qf(e)}}F.empty=new F(fe.none,[],[],0);class Js{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Js(this.buffer,this.index)}}class vt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return fe.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i,s){let r=this.buffer,o=new Uint16Array(t-e);for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function ga(n,e){let t=n.childBefore(e);for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(n=t,t=i.prevSibling):t=i}return n}function Nt(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(!!pa(s,i,f,f+c.length)){if(c instanceof vt){if(r&K.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new He(new _f(o,c,e,f),null,u)}else if(r&K.IncludeAnonymous||!c.type.isAnonymous||Xs(c)){let u;if(!(r&K.IgnoreMounts)&&c.props&&(u=c.prop(R.mounted))&&!u.overlay)return new Oe(u.tree,f,e,o);let d=new Oe(c,f,e,o);return r&K.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&K.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&K.IgnoreOverlays)&&(s=this._tree.prop(R.mounted))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new Oe(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new ui(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return Nt(this,e,t,!1)}resolveInner(e,t=0){return Nt(this,e,t,!0)}enterUnfinishedNodesBefore(e){return ga(this,e)}getChild(e,t=null,i=null){let s=Zi(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return Zi(this,e,t,i)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return en(this,e)}}function Zi(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function en(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class _f{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class He{constructor(e,t,i){this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new He(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&K.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new He(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new He(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new He(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new ui(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1],l=i.buffer[this.index+2];e.push(i.slice(s,r,o,l)),t.push(0)}return new F(this.type,e,t,this.to-this.from)}resolve(e,t=0){return Nt(this,e,t,!1)}resolveInner(e,t=0){return Nt(this,e,t,!0)}enterUnfinishedNodesBefore(e){return ga(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let s=Zi(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return Zi(this,e,t,i)}get node(){return this}matchContext(e){return en(this,e)}}class ui{constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Oe)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}get name(){return this.type.name}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Oe?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&K.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&K.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&K.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&K.IncludeAnonymous||l instanceof vt||!l.type.isAnonymous||Xs(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}}for(let s=i;s=0;r--){if(r<0)return en(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function Xs(n){return n.children.some(e=>e instanceof vt||!e.type.isAnonymous||Xs(e))}function Qf(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=Gf,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new Js(t,t.length):t,a=i.types,h=0,c=0;function f(k,C,M,B,j){let{id:E,start:P,end:V,size:U}=l,X=c;for(;U<0;)if(l.next(),U==-1){let Z=r[E];M.push(Z),B.push(P-k);return}else if(U==-3){h=E;return}else if(U==-4){c=E;return}else throw new RangeError(`Unrecognized record size: ${U}`);let be=a[E],se,le,Be=P-k;if(V-P<=s&&(le=g(l.pos-C,j))){let Z=new Uint16Array(le.size-le.skip),Pe=l.pos-le.size,Ge=Z.length;for(;l.pos>Pe;)Ge=y(le.start,Z,Ge);se=new vt(Z,V-le.start,i),Be=le.start-k}else{let Z=l.pos-U;l.next();let Pe=[],Ge=[],ct=E>=o?E:-1,Ct=0,xi=V;for(;l.pos>Z;)ct>=0&&l.id==ct&&l.size>=0?(l.end<=xi-s&&(d(Pe,Ge,P,Ct,l.end,xi,ct,X),Ct=Pe.length,xi=l.end),l.next()):f(P,Z,Pe,Ge,ct);if(ct>=0&&Ct>0&&Ct-1&&Ct>0){let pr=u(be);se=Ys(be,Pe,Ge,0,Pe.length,0,V-P,pr,pr)}else se=p(be,Pe,Ge,V-P,X-V)}M.push(se),B.push(Be)}function u(k){return(C,M,B)=>{let j=0,E=C.length-1,P,V;if(E>=0&&(P=C[E])instanceof F){if(!E&&P.type==k&&P.length==B)return P;(V=P.prop(R.lookAhead))&&(j=M[E]+P.length+V)}return p(k,C,M,B,j)}}function d(k,C,M,B,j,E,P,V){let U=[],X=[];for(;k.length>B;)U.push(k.pop()),X.push(C.pop()+M-j);k.push(p(i.types[P],U,X,E-j,V-E)),C.push(j-M)}function p(k,C,M,B,j=0,E){if(h){let P=[R.contextHash,h];E=E?[P].concat(E):[P]}if(j>25){let P=[R.lookAhead,j];E=E?[P].concat(E):[P]}return new F(k,C,M,B,E)}function g(k,C){let M=l.fork(),B=0,j=0,E=0,P=M.end-s,V={size:0,start:0,skip:0};e:for(let U=M.pos-k;M.pos>U;){let X=M.size;if(M.id==C&&X>=0){V.size=B,V.start=j,V.skip=E,E+=4,B+=4,M.next();continue}let be=M.pos-X;if(X<0||be=o?4:0,le=M.start;for(M.next();M.pos>be;){if(M.size<0)if(M.size==-3)se+=4;else break e;else M.id>=o&&(se+=4);M.next()}j=le,B+=X,E+=se}return(C<0||B==k)&&(V.size=B,V.start=j,V.skip=E),V.size>4?V:void 0}function y(k,C,M){let{id:B,start:j,end:E,size:P}=l;if(l.next(),P>=0&&B4){let U=l.pos-(P-4);for(;l.pos>U;)M=y(k,C,M)}C[--M]=V,C[--M]=E-k,C[--M]=j-k,C[--M]=B}else P==-3?h=B:P==-4&&(c=B);return M}let b=[],S=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,b,S,-1);let v=(e=n.length)!==null&&e!==void 0?e:b.length?S[0]+b[0].length:0;return new F(a[n.topID],b.reverse(),S.reverse(),v)}const mo=new WeakMap;function qi(n,e){if(!n.isAnonymous||e instanceof vt||e.type!=n)return 1;let t=mo.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof F)){t=1;break}t+=qi(n,i)}mo.set(e,t)}return t}function Ys(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;M+=B}if(v==k+1){if(M>c){let B=p[k];d(B.children,B.positions,0,B.children.length,g[k]+S);continue}f.push(p[k])}else{let B=g[v-1]+p[v-1].length-C;f.push(Ys(n,p,g,k,v,C,B,null,a))}u.push(C+S-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class rg{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof He?this.setBuffer(e.context.buffer,e.index,t):e instanceof Oe&&this.map.set(e.tree,t)}get(e){return e instanceof He?this.getBuffer(e.context.buffer,e.index):e instanceof Oe?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Xe{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new Xe(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Xe(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew Ae(s.from,s.to)):[new Ae(0,0)]:[new Ae(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class Zf{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function og(n){return(e,t,i,s)=>new tu(e,n,t,i,s)}class yo{constructor(e,t,i,s,r){this.parser=e,this.parse=t,this.overlay=i,this.target=s,this.ranges=r}}class eu{constructor(e,t,i,s,r,o,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const As=new R({perNode:!0});class tu{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new F(i.type,i.children,i.positions,i.length,i.propValues.concat([[As,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[R.mounted.id]=new Xf(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tc.frag.from<=s.from&&c.frag.to>=s.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=s.from&&u<=s.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=iu(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&s.fromnew Ae(f.from-s.from,f.to-s.from)):null,s.tree,c)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else t&&(a=t.predicate(s))&&(a===!0&&(a=new Ae(s.from,s.to)),a.fromnew Ae(c.from-t.start,c.to-t.start)),t.target,h)),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function iu(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function bo(n,e,t,i,s,r){if(e=e.to);i++);let o=s.children[i],l=o.buffer;function a(h,c,f,u,d){let p=h;for(;l[p+2]+r<=e.from;)p=l[p+3];let g=[],y=[];bo(o,h,p,g,y,u);let b=l[p+1],S=l[p+2],v=b+r==e.from&&S+r==e.to&&l[p]==e.type.id;return g.push(v?e.toTree():a(p+4,l[p+3],o.set.types[l[p]],b,S-b)),y.push(b-u),bo(o,l[p+3],c,g,y,u),new F(f,g,y,d)}s.children[i]=a(0,l.length,fe.none,0,o.length);for(let h=0;h<=t;h++)n.childAfter(e.from)}class wo{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(K.IncludeAnonymous|K.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,K.IgnoreOverlays|K.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof F)t=t.children[0];else break}return!1}}class su{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(As))!==null&&t!==void 0?t:i.to,this.inner=new wo(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(As))!==null&&e!==void 0?e:t.to,this.inner=new wo(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(R.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function xo(n,e){let t=null,i=e;for(let s=1,r=0;s=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new Ae(l,a.to))):a.to>l?t[r--]=new Ae(l,a.to):t.splice(r--,1))}}return i}function ru(n,e,t,i){let s=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew Ae(u.from+i,u.to+i)),f=ru(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,g=p?h:f[u].from;if(g>d&&t.push(new Xe(d,g,s.tree,-o,r.from>=d,r.to<=g)),p)break;d=f[u].to}}else t.push(new Xe(a,h,s.tree,-o,r.from>=o,r.to<=l))}return t}let ou=0;class Ve{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=ou++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new Ve([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new tn;return t=>t.modified.indexOf(e)>-1?t:tn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let lu=0;class tn{constructor(){this.instances=[],this.id=lu++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&au(t,l.modified));if(i)return i;let s=[],r=new Ve(s,e,t);for(let l of t)l.instances.push(r);let o=ya(t);for(let l of e.set)for(let a of o)s.push(tn.get(l,a));return r}}function au(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function ya(n){let e=[n];for(let t=0;t0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new cu(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return ba.add(e)}const ba=new R;class cu{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function fu(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function uu(n,e,t,i=0,s=n.length){let r=new du(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class du{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=o.prop(ba),f=!1;for(;c;){if(!c.context||e.matchContext(c.context)){let d=fu(r,c.tags);d&&(h&&(h+=" "),h+=d,c.mode==1?s+=(s?" ":"")+d:c.mode==0&&(f=!0));break}c=c.next}if(this.startSpan(e.from,h),f)return;let u=e.tree&&e.tree.prop(R.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(y=>!y.scope||y.scope(u.tree.type)),g=e.firstChild();for(let y=0,b=l;;y++){let S=y=v||!e.nextSibling())););if(!S||v>i)break;b=S.to+l,b>t&&(this.highlightRange(d.cursor(),Math.max(t,S.from+l),Math.min(i,b),s,p),this.startSpan(b,h))}g&&e.parent()}else if(e.firstChild()){do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}const w=Ve.define,Pi=w(),_e=w(),So=w(_e),vo=w(_e),Qe=w(),Ri=w(Qe),Hn=w(Qe),Ne=w(),ft=w(Ne),Ee=w(),Ie=w(),Ms=w(),Gt=w(Ms),Li=w(),x={comment:Pi,lineComment:w(Pi),blockComment:w(Pi),docComment:w(Pi),name:_e,variableName:w(_e),typeName:So,tagName:w(So),propertyName:vo,attributeName:w(vo),className:w(_e),labelName:w(_e),namespace:w(_e),macroName:w(_e),literal:Qe,string:Ri,docString:w(Ri),character:w(Ri),attributeValue:w(Ri),number:Hn,integer:w(Hn),float:w(Hn),bool:w(Qe),regexp:w(Qe),escape:w(Qe),color:w(Qe),url:w(Qe),keyword:Ee,self:w(Ee),null:w(Ee),atom:w(Ee),unit:w(Ee),modifier:w(Ee),operatorKeyword:w(Ee),controlKeyword:w(Ee),definitionKeyword:w(Ee),moduleKeyword:w(Ee),operator:Ie,derefOperator:w(Ie),arithmeticOperator:w(Ie),logicOperator:w(Ie),bitwiseOperator:w(Ie),compareOperator:w(Ie),updateOperator:w(Ie),definitionOperator:w(Ie),typeOperator:w(Ie),controlOperator:w(Ie),punctuation:Ms,separator:w(Ms),bracket:Gt,angleBracket:w(Gt),squareBracket:w(Gt),paren:w(Gt),brace:w(Gt),content:Ne,heading:ft,heading1:w(ft),heading2:w(ft),heading3:w(ft),heading4:w(ft),heading5:w(ft),heading6:w(ft),contentSeparator:w(Ne),list:w(Ne),quote:w(Ne),emphasis:w(Ne),strong:w(Ne),link:w(Ne),monospace:w(Ne),strikethrough:w(Ne),inserted:w(),deleted:w(),changed:w(),invalid:w(),meta:Li,documentMeta:w(Li),annotation:w(Li),processingInstruction:w(Li),definition:Ve.defineModifier(),constant:Ve.defineModifier(),function:Ve.defineModifier(),standard:Ve.defineModifier(),local:Ve.defineModifier(),special:Ve.defineModifier()};wa([{tag:x.link,class:"tok-link"},{tag:x.heading,class:"tok-heading"},{tag:x.emphasis,class:"tok-emphasis"},{tag:x.strong,class:"tok-strong"},{tag:x.keyword,class:"tok-keyword"},{tag:x.atom,class:"tok-atom"},{tag:x.bool,class:"tok-bool"},{tag:x.url,class:"tok-url"},{tag:x.labelName,class:"tok-labelName"},{tag:x.inserted,class:"tok-inserted"},{tag:x.deleted,class:"tok-deleted"},{tag:x.literal,class:"tok-literal"},{tag:x.string,class:"tok-string"},{tag:x.number,class:"tok-number"},{tag:[x.regexp,x.escape,x.special(x.string)],class:"tok-string2"},{tag:x.variableName,class:"tok-variableName"},{tag:x.local(x.variableName),class:"tok-variableName tok-local"},{tag:x.definition(x.variableName),class:"tok-variableName tok-definition"},{tag:x.special(x.variableName),class:"tok-variableName2"},{tag:x.definition(x.propertyName),class:"tok-propertyName tok-definition"},{tag:x.typeName,class:"tok-typeName"},{tag:x.namespace,class:"tok-namespace"},{tag:x.className,class:"tok-className"},{tag:x.macroName,class:"tok-macroName"},{tag:x.propertyName,class:"tok-propertyName"},{tag:x.operator,class:"tok-operator"},{tag:x.comment,class:"tok-comment"},{tag:x.meta,class:"tok-meta"},{tag:x.invalid,class:"tok-invalid"},{tag:x.punctuation,class:"tok-punctuation"}]);var Wn;const Vt=new R;function xa(n){return D.define({combine:n?e=>e.concat(n):void 0})}class Me{constructor(e,t,i=[]){this.data=e,N.prototype.hasOwnProperty("tree")||Object.defineProperty(N.prototype,"tree",{get(){return ue(this)}}),this.parser=t,this.extension=[Wt.of(this),N.languageData.of((s,r,o)=>s.facet(Co(s,r,o)))].concat(i)}isActiveAt(e,t,i=-1){return Co(e,t,i)==this.data}findRegions(e){let t=e.facet(Wt);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(Vt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(R.mounted);if(l){if(l.tree.prop(Vt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}))}configure(e){return new Ds(this.data,this.parser.configure(e))}get allowsNesting(){return this.parser.hasWrappers()}}function ue(n){let e=n.field(Me.state,!1);return e?e.tree:F.empty}class pu{constructor(e,t=e.length){this.doc=e,this.length=t,this.cursorPos=0,this.string="",this.cursor=e.iter()}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Jt=null;class Ft{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Ft(e,t,[],F.empty,0,i,[],null)}startParse(){return this.parser.startParse(new pu(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=F.empty&&this.isDone(t!=null?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Xe.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Jt;Jt=this;try{return e()}finally{Jt=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Ao(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Xe.applyChanges(i,a),s=F.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Ao(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends ma{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=Jt;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new F(fe.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Jt}}function Ao(n,e,t){return Xe.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ht{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Ht(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Ft.create(e.facet(Wt).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Ht(i)}}Me.state=de.define({create:Ht.init,update(n,e){for(let t of e.effects)if(t.is(Me.setState))return t.value;return e.startState.facet(Wt)!=e.state.facet(Wt)?Ht.init(e.state):n.apply(e)}});let ka=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(ka=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const zn=typeof navigator<"u"&&((Wn=navigator.scheduling)===null||Wn===void 0?void 0:Wn.isInputPending)?()=>navigator.scheduling.isInputPending():null,gu=ce.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Me.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Me.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=ka(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>zn&&zn()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Me.setState.of(new Ht(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Re(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Wt=D.define({combine(n){return n.length?n[0]:null},enables:[Me.state,gu]});class ag{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Sa=D.define(),yn=D.define({combine:n=>{if(!n.length)return" ";if(!/^(?: +|\t+)$/.test(n[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return n[0]}});function xt(n){let e=n.facet(yn);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function nn(n,e){let t="",i=n.tabSize;if(n.facet(yn).charCodeAt(0)==9)for(;e>=i;)t+=" ",e-=i;for(let s=0;s=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return mi(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const mu=new R;function yu(n,e,t){return Ca(e.resolveInner(t).enterUnfinishedNodesBefore(t),t,n)}function bu(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function wu(n){let e=n.type.prop(mu);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(R.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>Aa(o,!0,1,void 0,r&&!bu(o)?s.from:void 0)}return n.parent==null?xu:null}function Ca(n,e,t){for(;n;n=n.parent){let i=wu(n);if(i)return i(_s.create(t,e,n))}return null}function xu(){return 0}class _s extends bn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.node=i}static create(e,t,i){return new _s(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(ku(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?Ca(e,this.pos,this.base):0}}function ku(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Su(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.fromAa(i,e,t,n)}function Aa(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?Su(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const cg=n=>n.baseIndent;function fg({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const ug=new R;function dg(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(Vt)==o.data:o?l=>l==o:void 0,this.style=wa(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new ot(i):null,this.themeType=t.themeType}static define(e,t){return new wn(e,t||{})}}const Os=D.define(),Ma=D.define({combine(n){return n.length?[n[0]]:null}});function qn(n){let e=n.facet(Os);return e.length?e:n.facet(Ma)}function pg(n,e){let t=[Cu],i;return n instanceof wn&&(n.module&&t.push(O.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Ma.of(n)):i?t.push(Os.computeN([O.darkTheme],s=>s.facet(O.darkTheme)==(i=="dark")?[n]:[])):t.push(Os.of(n)),t}class vu{constructor(e){this.markCache=Object.create(null),this.tree=ue(e.state),this.decorations=this.buildDeco(e,qn(e.state))}update(e){let t=ue(e.state),i=qn(e.state),s=i!=qn(e.startState);t.length{i.add(o,l,this.markCache[a]||(this.markCache[a]=T.mark({class:a})))},s,r);return i.finish()}}const Cu=kt.high(ce.fromClass(vu,{decorations:n=>n.decorations})),gg=wn.define([{tag:x.meta,color:"#7a757a"},{tag:x.link,textDecoration:"underline"},{tag:x.heading,textDecoration:"underline",fontWeight:"bold"},{tag:x.emphasis,fontStyle:"italic"},{tag:x.strong,fontWeight:"bold"},{tag:x.strikethrough,textDecoration:"line-through"},{tag:x.keyword,color:"#708"},{tag:[x.atom,x.bool,x.url,x.contentSeparator,x.labelName],color:"#219"},{tag:[x.literal,x.inserted],color:"#164"},{tag:[x.string,x.deleted],color:"#a11"},{tag:[x.regexp,x.escape,x.special(x.string)],color:"#e40"},{tag:x.definition(x.variableName),color:"#00f"},{tag:x.local(x.variableName),color:"#30a"},{tag:[x.typeName,x.namespace],color:"#085"},{tag:x.className,color:"#167"},{tag:[x.special(x.variableName),x.macroName],color:"#256"},{tag:x.definition(x.propertyName),color:"#00c"},{tag:x.comment,color:"#940"},{tag:x.invalid,color:"#f00"}]),Au=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Da=1e4,Oa="()[]{}",Ta=D.define({combine(n){return qt(n,{afterCursor:!0,brackets:Oa,maxScanDistance:Da,renderMatch:Ou})}}),Mu=T.mark({class:"cm-matchingBracket"}),Du=T.mark({class:"cm-nonmatchingBracket"});function Ou(n){let e=[],t=n.matched?Mu:Du;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const Tu=de.define({create(){return T.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Ta);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=We(e.state,s.head,-1,i)||s.head>0&&We(e.state,s.head-1,1,i)||i.afterCursor&&(We(e.state,s.head,1,i)||s.headO.decorations.from(n)}),Bu=[Tu,Au];function mg(n={}){return[Ta.of(n),Bu]}function Ts(n,e,t){let i=n.prop(e<0?R.openedBy:R.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function We(n,e,t,i={}){let s=i.maxScanDistance||Da,r=i.brackets||Oa,o=ue(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=Ts(a.type,t,r);if(h&&a.from=i.to){if(a==0&&s.indexOf(h.type.name)>-1&&h.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let g=t>0?0:d.length-1,y=t>0?d.length:-1;g!=y;g+=t){let b=o.indexOf(d[g]);if(!(b<0||i.resolveInner(p+g,1).type!=s))if(b%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+g,to:p+g+1},matched:b>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function Mo(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Lu(n){return{token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||Eu,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||Zs}}function Eu(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}class Pa extends Me{constructor(e){let t=xa(e.languageData),i=Lu(e),s,r=new class extends ma{createParse(o,l,a){return new Nu(s,o,l,a)}};super(t,r,[Sa.of((o,l)=>this.getIndent(o,l))]),this.topNode=Hu(t),s=this,this.streamParser=i,this.stateAfter=new R({perNode:!0}),this.tokenTable=e.tokenTable?new Ia(i.tokenTable):Fu}static define(e){return new Pa(e)}getIndent(e,t){let i=ue(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r=Qs(this,i,0,s.from,t),o,l;if(r?(l=r.state,o=r.pos+1):(l=this.streamParser.startState(e.unit),o=0),t-o>1e4)return null;for(;o=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof F&&a=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&Qs(n,s.tree,0-s.offset,t,o),a;if(l&&(a=Ra(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?xt(i):4),tree:F.empty}}class Nu{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=Ft.get(),o=s[0].from,{state:l,tree:a}=Iu(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` +class I{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),We.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),We.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new ii(this),r=new ii(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new ii(this,e)}iterRange(e,t=this.length){return new Jo(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Xo(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?I.empty:e.length<=32?new G(e):We.from(G.split(e,[]))}}class G extends I{constructor(e,t=Ph(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Lh(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new G(gr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Fi(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new G(l,o.length+r.length));else{let a=l.length>>1;i.push(new G(l.slice(0,a)),new G(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof G))return super.replace(e,t,i);let s=Fi(this.text,Fi(i.text,gr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new G(s,r):We.from(G.split(s,[]),r)}sliceString(e,t=this.length,i=` +`){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new G(i,s)),i=[],s=-1);return s>-1&&t.push(new G(i,s)),t}}class We extends I{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if(i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new We(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` +`){let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof We))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new G(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof We)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof G&&a&&(p=c[c.length-1])instanceof G&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new G(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:We.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new We(l,t)}}I.empty=new G([""],0);function Ph(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Fi(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof G?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof G?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(s instanceof G){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof G?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Jo{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ii(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Xo{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=function(){return this.iter()},ii.prototype[Symbol.iterator]=Jo.prototype[Symbol.iterator]=Xo.prototype[Symbol.iterator]=function(){return this});class Lh{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Tt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return Tt[e-1]<=n;return!1}function mr(n){return n>=127462&&n<=127487}const yr=8205;function ve(n,e,t=!0,i=!0){return(t?Yo:Eh)(n,e,i)}function Yo(n,e,t){if(e==n.length)return e;e&&_o(n.charCodeAt(e))&&Qo(n.charCodeAt(e-1))&&e--;let i=te(n,e);for(e+=ke(i);e=0&&mr(te(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Eh(n,e,t){for(;e>0;){let i=Yo(n,e-2,t);if(i=56320&&n<57344}function Qo(n){return n>=55296&&n<56320}function te(n,e){let t=n.charCodeAt(e);if(!Qo(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return _o(i)?(t-55296<<10)+(i-56320)+65536:t}function Vs(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function ke(n){return n<65536?1:2}const Jn=/\r\n?|\n/;var oe=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(oe||(oe={}));class je{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=oe.Simple&&h>=e&&(i==oe.TrackDel&&se||i==oe.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new je(e)}static create(e){return new je(e)}}class Y extends je{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Xn(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return Yn(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&et(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?I.of(d.split(i||Jn)):d:I.empty,g=p.length;if(f==u&&g==0)return;fo&&re(s,f-o,-1),re(s,u-f,g),et(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new Y(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function et(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function Yn(n,e,t,i=!1){let s=[],r=i?[]:null,o=new li(n),l=new li(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);re(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class li{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?I.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?I.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class pt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new pt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return m.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return m.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return m.range(e.anchor,e.head)}static create(e,t,i){return new pt(e,t,i)}}class m{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:m.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new m(e.ranges.map(t=>pt.fromJSON(t)),e.main)}static single(e,t=e){return new m([m.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0))}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?m.range(a,l):m.range(l,a))}}return new m(e,t)}}function el(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Fs=0;class D{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=Fs++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new D(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Hs),!!e.static,e.enables)}of(e){return new Hi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Hi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Hi(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Hs(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Hi{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=Fs++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||_n(f,c)){let d=i(f);if(l?!br(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d=i(f),p=u.config.address[r];if(p!=null){let g=Ui(u,p);if(this.dependencies.every(y=>y instanceof D?u.facet(y)===f.facet(y):y instanceof pe?u.field(y,!1)==f.field(y,!1):!0)||(l?br(d,g,s):s(d,g)))return f.values[o]=g,0}return f.values[o]=d,1}}}}function br(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(wr).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,wr.of({field:this,create:e})]}get extension(){return this}}const dt={lowest:4,low:3,default:2,high:1,highest:0};function Kt(n){return e=>new tl(e,n)}const St={highest:Kt(dt.highest),high:Kt(dt.high),default:Kt(dt.default),low:Kt(dt.low),lowest:Kt(dt.lowest)};class tl{constructor(e,t){this.inner=e,this.prec=t}}class dn{of(e){return new Qn(this,e)}reconfigure(e){return dn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Qn{constructor(e,t){this.compartment=e,this.inner=t}}class ji{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Nh(e,t,o))u instanceof pe?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=c&&c[u]||[];if(d.every(y=>y.type==0))if(l[p.id]=a.length<<1|1,Hs(g,d))a.push(i.facet(p));else{let y=p.combine(d.map(b=>b.value));a.push(i&&p.compare(y,i.facet(p))?i.facet(p):y)}else{for(let y of d)y.type==0?(l[y.id]=a.length<<1|1,a.push(y.value)):(l[y.id]=h.length<<1,h.push(b=>y.dynamicSlot(b)));l[p.id]=h.length<<1,h.push(y=>Ih(y,p,d))}}let f=h.map(u=>u(l));return new ji(e,o,f,l,a,r)}}function Nh(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof Qn&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof Qn){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof tl)r(o.inner,o.prec);else if(o instanceof pe)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Hi)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,dt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,dt.default),i.reduce((o,l)=>o.concat(l))}function ni(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function Ui(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const il=D.define(),nl=D.define({combine:n=>n.some(e=>e),static:!0}),sl=D.define({combine:n=>n.length?n[0]:void 0,static:!0}),rl=D.define(),ol=D.define(),ll=D.define(),al=D.define({combine:n=>n.length?n[0]:!1});class vt{constructor(e,t){this.type=e,this.value=t}static define(){return new Vh}}class Vh{of(e){return new vt(this,e)}}class Fh{constructor(e){this.map=e}of(e){return new R(this,e)}}class R{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new R(this.type,t)}is(e){return this.type==e}static define(e={}){return new Fh(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}R.reconfigure=R.define();R.appendConfig=R.define();class _{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&el(i,t.newLength),r.some(l=>l.type==_.time)||(this.annotations=r.concat(_.time.of(Date.now())))}static create(e,t,i,s,r,o){return new _(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(_.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}_.time=vt.define();_.userEvent=vt.define();_.addToHistory=vt.define();_.remote=vt.define();function Hh(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof _?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof _?n=r[0]:n=cl(e,Bt(r),!1)}return n}function zh(n){let e=n.startState,t=e.facet(ll),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=hl(n,Zn(e,r,n.changes.newLength),!0))}return i==n?n:_.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const qh=[];function Bt(n){return n==null?qh:Array.isArray(n)?n:[n]}var he=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(he||(he={}));const $h=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let es;try{es=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function jh(n){if(es)return es.test(n);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||$h.test(t)))return!0}return!1}function Uh(n){return e=>{if(!/\S/.test(e))return he.Space;if(jh(e))return he.Word;for(let t=0;t-1)return he.Word;return he.Other}}class N{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(R.reconfigure)?(t=null,i=o.value):o.is(R.appendConfig)&&(t=null,i=Bt(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=ji.resolve(i,s,this),r=new N(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new N(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:m.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Bt(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return N.create({doc:e.doc,selection:m.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=ji.resolve(e.extensions||[],new Map),i=e.doc instanceof I?e.doc:I.of((e.doc||"").split(t.staticFacet(N.lineSeparator)||Jn)),s=e.selection?e.selection instanceof m?e.selection:m.single(e.selection.anchor,e.selection.head):m.single(0);return el(s,i.length),t.staticFacet(nl)||(s=s.asSingle()),new N(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(N.tabSize)}get lineBreak(){return this.facet(N.lineSeparator)||` +`}get readOnly(){return this.facet(al)}phrase(e,...t){for(let i of this.facet(N.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(il))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return Uh(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=ve(t,o,!1);if(r(t.slice(a,o))!=he.Word)break;o=a}for(;ln.length?n[0]:4});N.lineSeparator=sl;N.readOnly=al;N.phrases=D.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});N.languageData=il;N.changeFilter=rl;N.transactionFilter=ol;N.transactionExtender=ll;dn.reconfigure=R.define();function $t(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class yt{eq(e){return this==e}range(e,t=e){return ai.create(e,t,this)}}yt.prototype.startSide=yt.prototype.endSide=0;yt.prototype.point=!1;yt.prototype.mapMode=oe.TrackDel;class ai{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new ai(e,t,i)}}function ts(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Ws{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Ws(s,r,i,l):null,pos:o}}}class ${constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new $(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(ts)),this.isEmpty)return t.length?$.of(t):this;let l=new fl(this,null,-1).goto(0),a=0,h=[],c=new bt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return hi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return hi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=xr(o,l,i),h=new Gt(o,a,r),c=new Gt(l,a,r);i.iterGaps((f,u,d)=>kr(h,f,c,u,d,s)),i.empty&&i.length==0&&kr(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=xr(r,o),a=new Gt(r,l,0).goto(i),h=new Gt(o,l,0).goto(i);for(;;){if(a.to!=h.to||!is(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new Gt(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point?(s.point(l,h,o.point,o.activeForPoint(o.to),a,o.pointRank),a=o.openEnd(h)+(o.to>h?1:0)):h>l&&(s.span(l,h,o.active,a),a=o.openEnd(h)),o.to>i)break;l=o.to,o.next()}return a}static of(e,t=!1){let i=new bt;for(let s of e instanceof ai?[e]:t?Kh(e):e)i.add(s.from,s.to,s.value);return i.finish()}}$.empty=new $([],[],null,-1);function Kh(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(ts);e=i}return n}$.empty.nextLayer=$.empty;class bt{constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}finishChunk(e){this.chunks.push(new Ws(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new bt)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner($.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=$.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function xr(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new fl(o,t,i,r));return s.length==1?s[0]:new hi(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)On(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)On(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),On(this.heap,0)}}}function On(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class Gt{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=hi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Si(this.active,e),Si(this.activeTo,e),Si(this.activeRank,e),this.minActive=Sr(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&Si(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(i),this.cursor.frome&&s++,this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function kr(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let h=n.to+a-t.to||n.endSide-t.endSide,c=h<0?n.to+a:t.to,f=Math.min(c,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&is(n.activeForPoint(n.to+a),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!is(n.active,t.active)&&r.compareRange(l,f,n.active,t.active),c>o)break;l=c,h<=0&&n.next(),h>=0&&t.next()}}function is(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Sr(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=ve(n,s)}return i===!0?-1:n.length}const ss="\u037C",vr=typeof Symbol>"u"?"__"+ss:Symbol.for(ss),rs=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Cr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ot{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(y=>g.replace(/&/,y))).reduce((g,y)=>g.concat(y)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=Cr[vr]||1;return Cr[vr]=e+1,ss+e.toString(36)}static mount(e,t){(e[rs]||new Gh(e)).mount(Array.isArray(t)?t:[t])}}let Ci=null;class Gh{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if(Ci)return e.adoptedStyleSheets=[Ci.sheet].concat(e.adoptedStyleSheets),e[rs]=Ci;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),Ci=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[rs]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ar=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent);typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent);var Jh=typeof navigator<"u"&&/Mac/.test(navigator.platform),Xh=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Yh=Jh||Ar&&+Ar[1]<57;for(var ie=0;ie<10;ie++)lt[48+ie]=lt[96+ie]=String(ie);for(var ie=1;ie<=24;ie++)lt[ie+111]="F"+ie;for(var ie=65;ie<=90;ie++)lt[ie]=String.fromCharCode(ie+32),Rt[ie]=String.fromCharCode(ie);for(var Tn in lt)Rt.hasOwnProperty(Tn)||(Rt[Tn]=lt[Tn]);function _h(n){var e=Yh&&(n.ctrlKey||n.altKey||n.metaKey)||Xh&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Rt:lt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Ki(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Et(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function Qh(){let n=document.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function Wi(n,e){if(!e.anchorNode)return!1;try{return Et(n,e.anchorNode)}catch{return!1}}function ci(n){return n.nodeType==3?It(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Gi(n,e,t,i){return t?Mr(n,e,t,i,-1)||Mr(n,e,t,i,1):!1}function Ji(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Mr(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:fi(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=Ji(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?fi(n):0}else return!1}}function fi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const ul={left:0,right:0,top:0,bottom:0};function pn(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function Zh(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function ec(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView;for(let c=n;c;)if(c.nodeType==1){let f,u=c==a.body;if(u)f=Zh(h);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.parentNode;continue}let g=c.getBoundingClientRect();f={left:g.left,right:g.left+c.clientWidth,top:g.top,bottom:g.top+c.clientHeight}}let d=0,p=0;if(s=="nearest")e.top0&&e.bottom>f.bottom+p&&(p=e.bottom-f.bottom+p+o)):e.bottom>f.bottom&&(p=e.bottom-f.bottom+o,t<0&&e.top-p0&&e.right>f.right+d&&(d=e.right-f.right+d+r)):e.right>f.right&&(d=e.right-f.right+r,t<0&&e.leftt)return f.domBoundsAround(e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.dirty|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),t.dirty&1)return;t.dirty|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=zs){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function ml(n,e,t,i,s,r,o,l,a){let{children:h}=n,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,a))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(t2);var A={mac:Pr||/Mac/.test(Se.platform),windows:/Win/.test(Se.platform),linux:/Linux|X11/.test(Se.platform),ie:gn,ie_version:bl?os.documentMode||6:as?+as[1]:ls?+ls[1]:0,gecko:Tr,gecko_version:Tr?+(/Firefox\/(\d+)/.exec(Se.userAgent)||[0,0])[1]:0,chrome:!!Bn,chrome_version:Bn?+Bn[1]:0,ios:Pr,android:/Android\b/.test(Se.userAgent),webkit:Br,safari:wl,webkit_version:Br?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:os.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const sc=256;class at extends z{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return i&&(!(i instanceof at)||this.length-(t-e)+i.length>sc)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new at(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ne(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return hs(this.dom,e,t)}}class Ue extends z{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(pl(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}sync(e){this.dom?this.dirty&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e)}merge(e,t,i,s,r,o){return i&&(!(i instanceof Ue&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Ue(this.mark,t,o)}domAtPos(e){return Sl(this.dom,this.children,e)}coordsAt(e,t){return Cl(this,e,t)}}function hs(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?A.chrome||A.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return A.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?pn(a,o<0):a||null}class tt extends z{constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}static create(e,t,i){return new(e.customView||tt)(e,t,i)}split(e){let t=tt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(){(!this.dom||!this.widget.updateDOM(this.dom))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof tt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0?i.length-1:0;s=i[r],!(e>0?r==0:r==i.length-1||s.top0?-1:1);return e==0&&t>0||e==this.length&&t<=0?s:pn(s,e==0)}get isEditable(){return!1}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class xl extends tt{domAtPos(e){let{topView:t,text:i}=this.widget;return t?cs(e,0,t,i,(s,r)=>s.domAtPos(r),s=>new ne(i,Math.min(s,i.nodeValue.length))):new ne(i,Math.min(e,i.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(e,t){let{topView:i,text:s}=this.widget;return i?kl(e,t,i,s):Math.min(t,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(e,t){let{topView:i,text:s}=this.widget;return i?cs(e,t,i,s,(r,o,l)=>r.coordsAt(o,l),(r,o)=>hs(s,r,o)):hs(s,e,t)}destroy(){var e;super.destroy(),(e=this.widget.topView)===null||e===void 0||e.destroy()}get isEditable(){return!0}}function cs(n,e,t,i,s,r){if(t instanceof Ue){for(let o of t.children){let l=Et(o.dom,i),a=l?i.nodeValue.length:o.length;if(n0?-1:1);return i&&i.topt.top?{left:t.left,right:t.right,top:i.top,bottom:i.bottom}:t}get overrideDOMText(){return I.empty}}at.prototype.children=tt.prototype.children=Nt.prototype.children=zs;function rc(n,e){let t=n.parent,i=t?t.children.indexOf(n):-1;for(;t&&i>=0;)if(e<0?i>0:is&&t0;i--){let s=e[i-1].dom;if(s.parentNode==n)return ne.after(s)}return new ne(n,0)}function vl(n,e,t){let i,{children:s}=n;t>0&&e instanceof Ue&&s.length&&(i=s[s.length-1])instanceof Ue&&i.mark.eq(e.mark)?vl(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Cl(n,e,t){for(let r=0,o=0;o0?a>=e:a>e)&&(e0)){let c=0;if(a==r){if(l.getSide()<=0)continue;c=t=-l.getSide()}let f=l.coordsAt(Math.max(0,e-r),t);return c&&f?pn(f,t<0):f}r=a}let i=n.dom.lastChild;if(!i)return n.dom.getBoundingClientRect();let s=ci(i);return s[s.length-1]||null}function fs(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}function qs(n,e){if(n==e)return!0;if(!n||!e)return!1;let t=Object.keys(n),i=Object.keys(e);if(t.length!=i.length)return!1;for(let s of t)if(i.indexOf(s)==-1||n[s]!==e[s])return!1;return!0}function us(n,e,t){let i=null;if(e)for(let s in e)t&&s in t||n.removeAttribute(i=s);if(t)for(let s in t)e&&e[s]==t[s]||n.setAttribute(i=s,t[s]);return!!i}class ht{eq(e){return!1}updateDOM(e){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}ignoreEvent(e){return!0}get customView(){return null}destroy(e){}}var W=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(W||(W={}));class T extends yt{constructor(e,t,i,s){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return new mn(e)}static widget(e){let t=e.side||0,i=!!e.block;return t+=i?t>0?3e8:-4e8:t>0?1e8:-1e8,new wt(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Al(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new wt(e,i,s,t,e.widget||null,!0)}static line(e){return new bi(e)}static set(e,t=!1){return $.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}T.none=$.empty;class mn extends T{constructor(e){let{start:t,end:i}=Al(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){return this==e||e instanceof mn&&this.tagName==e.tagName&&this.class==e.class&&qs(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}mn.prototype.point=!1;class bi extends T{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof bi&&qs(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}bi.prototype.mapMode=oe.TrackBefore;bi.prototype.point=!0;class wt extends T{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?oe.TrackBefore:oe.TrackAfter:oe.TrackDel}get type(){return this.startSide=5}eq(e){return e instanceof wt&&oc(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}wt.prototype.point=!0;function Al(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t!=null?t:e,end:i!=null?i:e}}function oc(n,e){return n==e||!!(n&&e&&n.compare(e))}function ds(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class ce extends z{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof ce))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),yl(this,e,t,i?i.children:[],r,o),!0}split(e){let t=new ce;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:s}=this.childPos(e);s&&(t.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){!this.dom||(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){qs(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){vl(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=fs(t,this.attrs||{})),i&&(this.attrs=fs({class:i},this.attrs||{}))}domAtPos(e){return Sl(this.dom,this.children,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.dirty|=6)}sync(e){var t;this.dom?this.dirty&4&&(pl(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(us(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e);let i=this.dom.lastChild;for(;i&&z.get(i)instanceof Ue;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((t=z.get(i))===null||t===void 0?void 0:t.isEditable)==!1&&(!A.ios||!this.children.some(s=>s instanceof at))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0;for(let t of this.children){if(!(t instanceof at)||/[^ -~]/.test(t.text))return null;let i=ci(t.dom);if(i.length!=1)return null;e+=i[0].width}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}:null}coordsAt(e,t){return Cl(this,e,t)}become(e){return!1}get type(){return W.Text}static find(e,t){for(let i=0,s=0;i=t){if(r instanceof ce)return r;if(o>t)break}s=o+r.breakAfter}return null}}class mt extends z{constructor(e,t,i){super(),this.widget=e,this.length=t,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof mt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer([]),this.curLine=null,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(0,i)),this.getLine().append(Ai(new at(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof wt){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof wt)if(i.block){let{type:a}=i;a==W.WidgetAfter&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new mt(i.widget||new Lr("div"),l,a))}else{let a=tt.create(i.widget||new Lr("span"),l,i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),c=!a.isEditable&&(en.some(e=>e)});class Xi{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new Xi(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const Rr=R.define({map:(n,e)=>n.map(e)});function Re(n,e,t){let i=n.facet(Tl);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const yn=D.define({combine:n=>n.length?n[0]:!0});let lc=0;const _t=D.define();class fe{constructor(e,t,i,s){this.id=e,this.create=t,this.domEventHandlers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:i,provide:s,decorations:r}=t||{};return new fe(lc++,e,i,o=>{let l=[_t.of(o)];return r&&l.push(ui.of(a=>{let h=a.plugin(o);return h?r(h):T.none})),s&&l.push(s(o)),l})}static fromClass(e,t){return fe.define(i=>new e(i),t)}}class Pn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Re(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Re(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Re(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Ll=D.define(),Rl=D.define(),ui=D.define(),El=D.define(),Il=D.define(),Qt=D.define();class Xe{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Xe(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!a)return i;new Xe(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class Yi{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Y.empty(this.startState.doc.length);for(let o of i)this.changes=this.changes.compose(o.changes);let s=[];this.changes.iterChangedRanges((o,l,a,h)=>s.push(new Xe(o,l,a,h))),this.changedRanges=s;let r=e.hasFocus;r!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=r,this.flags|=1)}static create(e,t,i){return new Yi(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var J=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(J||(J={}));const gs=J.LTR,ac=J.RTL;function Nl(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}const q=[];function dc(n,e){let t=n.length,i=e==gs?1:2,s=e==gs?2:1;if(!n||i==1&&!uc.test(n))return Vl(t);for(let o=0,l=i,a=i;o=0;u-=3)if(Ie[u+1]==-c){let d=Ie[u+2],p=d&2?i:d&4?d&1?s:i:0;p&&(q[o]=q[Ie[u]]=p),l=u;break}}else{if(Ie.length==189)break;Ie[l++]=o,Ie[l++]=h,Ie[l++]=a}else if((f=q[o])==2||f==1){let u=f==i;a=u?0:1;for(let d=l-3;d>=0;d-=3){let p=Ie[d+2];if(p&2)break;if(u)Ie[d+2]|=2;else{if(p&4)break;Ie[d+2]|=4}}}for(let o=0;ol;){let c=h,f=q[--h]!=2;for(;h>l&&f==(q[h-1]!=2);)h--;r.push(new Pt(h,c,f?2:1))}else r.push(new Pt(l,o,0))}else for(let o=0;o1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=z.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+Math.min(t,i.offset))}}function Er(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}class Ir{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Nr extends z{constructor(e){super(),this.view=e,this.compositionDeco=T.none,this.decorations=[],this.dynamicDecorationMap=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new ce],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Xe(0,0,0,e.state.doc.length)],0)}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:o,toA:l})=>lthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=T.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=mc(this.view,e.changes)),(A.ie||A.chrome)&&!this.compositionDeco.size&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,s=this.updateDeco(),r=xc(i,s,e.changes);return t=Xe.extendWithRanges(t,r),this.dirty==0&&t.length==0?!1:(this.updateInner(t,e.startState.doc.length),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let r=A.chrome||A.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(r),this.dirty=0,r&&(r.written||i.selectionRange.focusNode!=r.node)&&(this.forceSelection=!0),this.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to=0?e[s]:null;if(!r)break;let{fromA:o,toA:l,fromB:a,toB:h}=r,{content:c,breakAtStart:f,openStart:u,openEnd:d}=$s.build(this.view.state.doc,a,h,this.decorations,this.dynamicDecorationMap),{i:p,off:g}=i.findPos(l,1),{i:y,off:b}=i.findPos(o,-1);ml(this,y,b,p,g,c,f,u,d)}}updateSelection(e=!1,t=!1){if((e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange(),!(t||this.mayControlSelection())||A.ios&&this.view.inputState.rapidCompositionStart)return;let i=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,r=this.domAtPos(s.anchor),o=s.empty?r:this.domAtPos(s.head);if(A.gecko&&s.empty&&gc(r)){let a=document.createTextNode("");this.view.observer.ignore(()=>r.node.insertBefore(a,r.node.childNodes[r.offset]||null)),r=o=new ne(a,0),i=!0}let l=this.view.observer.selectionRange;(i||!l.focusNode||!Gi(r.node,r.offset,l.anchorNode,l.anchorOffset)||!Gi(o.node,o.offset,l.focusNode,l.focusOffset))&&(this.view.observer.ignore(()=>{A.android&&A.chrome&&this.dom.contains(l.focusNode)&&kc(l.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let a=Ki(this.view.root);if(a)if(s.empty){if(A.gecko){let h=bc(r.node,r.offset);if(h&&h!=3){let c=zl(r.node,r.offset,h==1?1:-1);c&&(r=new ne(c,h==1?0:c.nodeValue.length))}}a.collapse(r.node,r.offset),s.bidiLevel!=null&&l.cursorBidiLevel!=null&&(l.cursorBidiLevel=s.bidiLevel)}else if(a.extend)a.collapse(r.node,r.offset),a.extend(o.node,o.offset);else{let h=document.createRange();s.anchor>s.head&&([r,o]=[o,r]),h.setEnd(o.node,o.offset),h.setStart(r.node,r.offset),a.removeAllRanges(),a.addRange(h)}}),this.view.observer.setSelectionRange(r,o)),this.impreciseAnchor=r.precise?null:new ne(l.anchorNode,l.anchorOffset),this.impreciseHead=o.precise?null:new ne(l.focusNode,l.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let e=this.view.state.selection.main,t=Ki(this.view.root);if(!t||!e.empty||!e.assoc||!t.modify)return;let i=ce.find(this,e.head);if(!i)return;let s=i.posAtStart;if(e.head==s||e.head==s+i.length)return;let r=this.coordsAt(e.head,-1),o=this.coordsAt(e.head,1);if(!r||!o||r.bottom>o.top)return;let l=this.domAtPos(e.head+e.assoc);t.collapse(l.node,l.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}mayControlSelection(){let e=this.view.root.activeElement;return e==this.dom||Wi(this.dom,this.view.observer.selectionRange)&&!(e&&this.dom.contains(e))}nearest(e){for(let t=e;t;){let i=z.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;to||e==o&&r.type!=W.WidgetBefore&&r.type!=W.WidgetAfter&&(!s||t==2||this.children[s-1].breakAfter||this.children[s-1].type==W.WidgetBefore&&t>-2))return r.coordsAt(e-o,t);i=o}}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==J.LTR;for(let h=0,c=0;cs)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,g=p?ci(p):[];if(g.length){let y=g[g.length-1],b=a?y.right-d.left:d.right-y.left;b>l&&(l=b,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?J.RTL:J.LTR}measureTextSize(){for(let s of this.children)if(s instanceof ce){let r=s.measureTextSize();if(r)return r}let e=document.createElement("div"),t,i;return e.className="cm-line",e.style.width="99999px",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=ci(e.firstChild)[0];t=e.getBoundingClientRect().height,i=s?s.width/27:7,e.remove()}),{lineHeight:t,charWidth:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new gl(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=t.lineBlockAt(o).bottom-t.lineBlockAt(i).top;e.push(T.replace({widget:new Vr(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return T.set(e)}updateDeco(){let e=this.view.state.facet(ui).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=0,o=0,l=0,a=0;for(let c of this.view.state.facet(Il).map(f=>f(this.view)))if(c){let{left:f,right:u,top:d,bottom:p}=c;f!=null&&(r=Math.max(r,f)),u!=null&&(o=Math.max(o,u)),d!=null&&(l=Math.max(l,d)),p!=null&&(a=Math.max(a,p))}let h={left:i.left-r,top:i.top-l,right:i.right+o,bottom:i.bottom+a};ec(this.view.scrollDOM,h,t.head0&&t<=0)n=n.childNodes[e-1],e=fi(n);else if(n.nodeType==1&&e=0)n=n.childNodes[e],e=0;else return null}}function bc(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e0;){let h=ve(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;ln?e.left-n:Math.max(0,n-e.right)}function Cc(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Ln(n,e){return n.tope.top+1}function Fr(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function ys(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let g=ci(p);for(let y=0;yv||o==v&&r>S)&&(i=p,s=b,r=S,o=v,l=!S||(S>0?y0)),S==0?t>b.bottom&&(!c||c.bottomb.top)&&(h=p,f=b):c&&Ln(c,b)?c=Hr(c,b.bottom):f&&Ln(f,b)&&(f=Fr(f,b.top))}}if(c&&c.bottom>=t?(i=a,s=c):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return Wr(i,u,t);if(l&&i.contentEditable!="false")return ys(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function Wr(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((A.chrome||A.gecko)&&It(n,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function ql(n,{x:e,y:t},i,s=-1){var r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:h}=n.viewState,c=t-l;if(c<0)return 0;if(c>h)return n.state.doc.length;for(let b=n.defaultLineHeight/2,S=!1;a=n.elementAtHeight(c),a.type!=W.Text;)for(;c=s>0?a.bottom+b:a.top-b,!(c>=0&&c<=h);){if(S)return i?null:0;S=!0,s=-s}t=l+c;let f=a.from;if(fn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:i?null:zr(n,o,a,e,t);let u=n.dom.ownerDocument,d=n.root.elementFromPoint?n.root:u,p=d.elementFromPoint(e,t);p&&!n.contentDOM.contains(p)&&(p=null),p||(e=Math.max(o.left+1,Math.min(o.right-1,e)),p=d.elementFromPoint(e,t),p&&!n.contentDOM.contains(p)&&(p=null));let g,y=-1;if(p&&((r=n.docView.nearest(p))===null||r===void 0?void 0:r.isEditable)!=!1){if(u.caretPositionFromPoint){let b=u.caretPositionFromPoint(e,t);b&&({offsetNode:g,offset:y}=b)}else if(u.caretRangeFromPoint){let b=u.caretRangeFromPoint(e,t);b&&({startContainer:g,startOffset:y}=b,(!n.contentDOM.contains(g)||A.safari&&Ac(g,y,e)||A.chrome&&Mc(g,y,e))&&(g=void 0))}}if(!g||!n.docView.dom.contains(g)){let b=ce.find(n.docView,f);if(!b)return c>a.top+a.height/2?a.to:a.from;({node:g,offset:y}=ys(b.dom,e,t))}return n.docView.posFromDOM(g,y)}function zr(n,e,t,i,s){let r=Math.round((i-e.left)*n.defaultCharacterWidth);n.lineWrapping&&t.height>n.defaultLineHeight*1.5&&(r+=Math.floor((s-t.top)/n.defaultLineHeight)*n.viewState.heightOracle.lineLength);let o=n.state.sliceDoc(t.from,t.to);return t.from+ns(o,r,n.state.tabSize)}function Ac(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return It(n,i-1,i).getBoundingClientRect().left>t}function Mc(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():It(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Dc(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=!i||!n.lineWrapping?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let a=n.dom.getBoundingClientRect(),h=n.textDirectionAt(s.from),c=n.posAtCoords({x:t==(h==J.LTR)?a.right-1:a.left+1,y:(r.top+r.bottom)/2});if(c!=null)return m.cursor(c,t?-1:1)}let o=ce.find(n.docView,e.head),l=o?t?o.posAtEnd:o.posAtStart:t?s.to:s.from;return m.cursor(l,t?-1:1)}function qr(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=pc(s,r,o,l,t),c=Fl;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c=` +`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=m.cursor(t?s.from:s.to)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function Oc(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==he.Space&&(s=o),s==o}}function Tc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return m.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i!=null?i:n.defaultLineHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=ql(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?gs))return m.cursor(g,e.assoc,void 0,o)}}function Rn(n,e,t){let i=n.state.facet(El).map(s=>s(n));for(;;){let s=!1;for(let r of i)r.between(t.from-1,t.from+1,(o,l,a)=>{t.from>o&&t.fromt.from?m.cursor(o,1):m.cursor(l,-1),s=!0)});if(!s)return t}}class Bc{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;for(let t in Q){let i=Q[t];e.contentDOM.addEventListener(t,s=>{!$r(e,s)||this.ignoreDuringComposition(s)||t=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(t,e,s)?s.preventDefault():i(e,s))},bs[t]),this.registeredEvents.push(t)}A.chrome&&A.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,A.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{!$r(e,l)||this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Re(t.state,o)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Re(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()s.keyCode==t.keyCode))&&!(t.ctrlKey||t.altKey||t.metaKey)&&!t.synthetic?(this.pendingIOSKey=i,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,si(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:A.safari&&!A.ios&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229||e.type=="compositionend"&&!A.ios}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const $l=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],jl=[16,17,18,20,91,92,224,225];class Pc{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.lastEvent=t;let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(N.allowMultipleSelections)&&Lc(e,t),this.dragMove=Rc(e,t),this.dragging=Ec(e,t)&&js(t)==1?null:!1,this.dragging===!1&&(t.preventDefault(),this.select(t))}move(e){if(e.buttons==0)return this.destroy();this.dragging===!1&&this.select(this.lastEvent=e)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}select(e){let t=this.style.get(e,this.extend,this.multiple);(this.mustSelect||!t.eq(this.view.state.selection)||t.main.assoc!=this.view.state.selection.main.assoc)&&this.view.dispatch({selection:t,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Lc(n,e){let t=n.state.facet(Ml);return t.length?t[0](e):A.mac?e.metaKey:e.ctrlKey}function Rc(n,e){let t=n.state.facet(Dl);return t.length?t[0](e):A.mac?!e.altKey:!e.ctrlKey}function Ec(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Ki(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function $r(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=z.get(t))&&i.ignoreEvent(e))return!1;return!0}const Q=Object.create(null),bs=Object.create(null),Ul=A.ie&&A.ie_version<15||A.ios&&A.webkit_version<604;function Ic(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),Kl(n,t.value)},50)}function Kl(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(ws!=null&&t.selection.ranges.every(a=>a.empty)&&ws==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:m.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:m.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Q.keydown=(n,e)=>{n.inputState.setSelectionOrigin("select"),e.keyCode==27?n.inputState.lastEscPress=Date.now():jl.indexOf(e.keyCode)<0&&(n.inputState.lastEscPress=0)};Q.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Q.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};bs.touchstart=bs.touchmove={passive:!0};Q.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3&&js(e)==1)return;let t=null;for(let i of n.state.facet(Ol))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=Fc(n,e)),t){let i=n.root.activeElement!=n.contentDOM;i&&n.observer.ignore(()=>dl(n.contentDOM)),n.inputState.startMouseSelection(new Pc(n,e,t,i))}};function jr(n,e,t,i){if(i==1)return m.cursor(e,t);if(i==2)return Sc(n.state,e,t);{let s=ce.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return ln>=e.top&&n<=e.bottom,Ur=(n,e,t)=>Gl(e,t)&&n>=t.left&&n<=t.right;function Nc(n,e,t,i){let s=ce.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&Ur(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&Ur(t,i,l)?1:o&&Gl(i,o)?-1:1}function Kr(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Nc(n,t,e.clientX,e.clientY)}}const Vc=A.ie&&A.ie_version<=11;let Gr=null,Jr=0,Xr=0;function js(n){if(!Vc)return n.detail;let e=Gr,t=Xr;return Gr=n,Xr=Date.now(),Jr=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Jr+1)%3:1}function Fc(n,e){let t=Kr(n,e),i=js(e),s=n.state.selection,r=t,o=e;return{update(l){l.docChanged&&(t&&(t.pos=l.changes.mapPos(t.pos)),s=s.map(l.changes),o=null)},get(l,a,h){let c;if(o&&l.clientX==o.clientX&&l.clientY==o.clientY?c=r:(c=r=Kr(n,l),o=l),!c||!t)return s;let f=jr(n,c.pos,c.bias,i);if(t.pos!=c.pos&&!a){let u=jr(n,t.pos,t.bias,i),d=Math.min(u.from,f.from),p=Math.max(u.to,f.to);f=d1&&s.ranges.some(u=>u.eq(f))?Hc(s,f):h?s.addRange(f):m.create([f])}}}function Hc(n,e){for(let t=0;;t++)if(n.ranges[t].eq(e))return m.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}Q.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove")};function Yr(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&r.dragMove?{from:r.dragging.from,to:r.dragging.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}Q.drop=(n,e)=>{if(!e.dataTransfer)return;if(n.state.readOnly)return e.preventDefault();let t=e.dataTransfer.files;if(t&&t.length){e.preventDefault();let i=Array(t.length),s=0,r=()=>{++s==t.length&&Yr(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}}else Yr(n,e,e.dataTransfer.getData("Text"),!0)};Q.paste=(n,e)=>{if(n.state.readOnly)return e.preventDefault();n.observer.flush();let t=Ul?null:e.clipboardData;t?(Kl(n,t.getData("text/plain")),e.preventDefault()):Ic(n)};function Wc(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function zc(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let ws=null;Q.copy=Q.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=zc(n.state);if(!t&&!s)return;ws=s?t:null;let r=Ul?null:e.clipboardData;r?(e.preventDefault(),r.clearData(),r.setData("text/plain",t)):Wc(n,t),e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})};function Jl(n){setTimeout(()=>{n.hasFocus!=n.inputState.notifiedFocused&&n.update([])},10)}Q.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),Jl(n)};Q.blur=n=>{n.observer.clearSelectionRange(),Jl(n)};function Xl(n,e){if(n.docView.compositionDeco.size){n.inputState.rapidCompositionStart=e;try{n.update([])}finally{n.inputState.rapidCompositionStart=!1}}}Q.compositionstart=Q.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0,n.docView.compositionDeco.size&&(n.observer.flush(),Xl(n,!0)))};Q.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionFirstChange=null,setTimeout(()=>{n.inputState.composing<0&&Xl(n,!1)},50)};Q.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Q.beforeinput=(n,e)=>{var t;let i;if(A.chrome&&A.android&&(i=$l.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}};const _r=["pre-wrap","normal","pre-line","break-spaces"];class qc{constructor(){this.doc=I.empty,this.lineWrapping=!1,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength)),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return _r.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.lineLength=s,l){this.heightSamples={};for(let a=0;a0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>zi&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return be.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this;for(let o=s.length-1;o>=0;o--){let{fromA:l,toA:a,fromB:h,toB:c}=s[o],f=r.lineAt(l,H.ByPosNoHeight,t,0,0),u=f.to>=a?f:r.lineAt(a,H.ByPosNoHeight,t,0,0);for(c+=u.to-a,a=u.to;o>0&&f.from<=s[o-1].toA;)l=s[o-1].fromA,h=s[o-1].fromB,o--,lr*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class xe extends Yl{constructor(e,t){super(e,t,W.Text),this.collapsed=0,this.widgetHeight=0}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof xe||s instanceof ee&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof ee?s=new xe(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):be.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ee extends be{constructor(e){super(e,0)}lines(e,t){let i=e.lineAt(t).number,s=e.lineAt(t+this.length).number;return{firstLine:i,lastLine:s,lineHeight:this.height/(s-i+1)}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,lineHeight:l}=this.lines(t,s),a=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:h,length:c}=t.line(r+a);return new nt(h,c,i+l*a,l,W.Text)}lineAt(e,t,i,s,r){if(t==H.ByHeight)return this.blockAt(e,i,s,r);if(t==H.ByPosNoHeight){let{from:f,to:u}=i.lineAt(e);return new nt(f,u-f,0,0,W.Text)}let{firstLine:o,lineHeight:l}=this.lines(i,r),{from:a,length:h,number:c}=i.lineAt(e);return new nt(a,h,s+l*(c-o),l,W.Text)}forEachLine(e,t,i,s,r,o){let{firstLine:l,lineHeight:a}=this.lines(i,r);for(let h=Math.max(e,r),c=Math.min(r+this.length,t);h<=c;){let f=i.lineAt(h);h==e&&(s+=a*(f.number-l)),o(new nt(f.from,f.length,s,a,W.Text)),s+=a,h=f.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof ee?i[i.length-1]=new ee(r.length+s):i.push(null,new ee(s-1))}if(e>0){let r=i[0];r instanceof ee?i[0]=new ee(e+r.length):i.unshift(new ee(e-1),null)}return be.of(i)}decomposeLeft(e,t){t.push(new ee(e-1),null)}decomposeRight(e,t){t.push(null,new ee(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1,h=e.heightChanged;for(s.from>t&&o.push(new ee(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let f=e.doc.lineAt(l).length;o.length&&o.push(null);let u=s.heights[s.index++];a==-1?a=u:Math.abs(u-a)>=zi&&(a=-2);let d=new xe(f,u);d.outdated=!1,o.push(d),l+=f+1}l<=r&&o.push(null,new ee(r-l).updateHeight(e,l));let c=be.of(o);return e.heightChanged=h||a<0||Math.abs(c.height-this.height)>=zi||Math.abs(a-this.lines(e.doc,t).lineHeight)>=zi,c}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class jc extends be{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return h;let c=t==H.ByPosNoHeight?H.ByPosNoHeight:H.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,H.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&Qr(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?be.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Qr(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof ee&&(i=n[e+1])instanceof ee&&n.splice(e-1,3,new ee(t.length+1+i.length))}const Uc=5;class Us{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof xe?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new xe(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=Uc)&&this.addLineDeco(s,r)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new xe(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new ee(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof xe)return e;let t=new xe(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine(),e.type==W.WidgetAfter&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=W.WidgetBefore&&(this.covering=e)}addLineDeco(e,t){let i=this.ensureLine();i.length+=t,i.collapsed+=t,i.widgetHeight=Math.max(i.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof xe)&&!this.isCovered?this.nodes.push(new xe(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&c.overflow!="visible"){let f=h.getBoundingClientRect();i=Math.max(i,f.left),s=Math.min(s,f.right),r=Math.max(r,f.top),o=a==n.parentNode?f.bottom:Math.min(o,f.bottom)}a=c.position=="absolute"||c.position=="fixed"?h.offsetParent:h.parentNode}else if(a.nodeType==11)a=a.host;else break;return{left:i-t.left,right:Math.max(i,s)-t.left,top:r-(t.top+e),bottom:Math.max(r,o)-(t.top+e)}}function Xc(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class En{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof t!="function"),this.heightMap=be.empty().applyChanges(this.stateDeco,I.empty,this.heightOracle.setDoc(e.doc),[new Xe(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=T.set(this.lineGaps.map(t=>t.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Mi(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?io:new Zc(this.heightOracle.doc,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:Zt(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(ui).filter(h=>typeof h!="function");let s=e.changedRanges,r=Xe.extendWithRanges(s,Kc(i,this.stateDeco,e?e.changes:Y.empty(this.state.doc.length))),o=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2);let l=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let a=!e.changes.empty||e.flags&2||l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,this.updateForViewport(),a&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?J.RTL:J.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=o||this.mustMeasureContent||this.contentDOMHeight!=t.clientHeight;this.contentDOMHeight=t.clientHeight,this.mustMeasureContent=!1;let a=0,h=0,c=parseInt(i.paddingTop)||0,f=parseInt(i.paddingBottom)||0;(this.paddingTop!=c||this.paddingBottom!=f)&&(this.paddingTop=c,this.paddingBottom=f,a|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,a|=8);let u=(this.printing?Xc:Jc)(t,this.paddingTop),d=u.top-this.pixelViewport.top,p=u.bottom-this.pixelViewport.bottom;this.pixelViewport=u;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(l=!0)),!this.inView)return 0;let y=t.clientWidth;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=y,this.editorHeight=e.scrollDOM.clientHeight,a|=8),l){let S=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(S)&&(o=!0),o||s.lineWrapping&&Math.abs(y-this.contentDOMWidth)>s.charWidth){let{lineHeight:v,charWidth:k}=e.docView.measureTextSize();o=s.refresh(r,v,k,y/k,S),o&&(e.docView.minWidth=0,a|=8)}d>0&&p>0?h=Math.max(d,p):d<0&&p<0&&(h=Math.min(d,p)),s.heightChanged=!1;for(let v of this.viewports){let k=v.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(v);this.heightMap=this.heightMap.updateHeight(s,0,o,new $c(v.from,k))}s.heightChanged&&(a|=2)}let b=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(this.viewport=this.getViewport(h,this.scrollTarget)),this.updateForViewport(),(a&2||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps)),a|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),a}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.state.doc,{visibleTop:o,visibleBottom:l}=this,a=new Mi(s.lineAt(o-i*1e3,H.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,H.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,H.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&ri.from&&l.push({from:i.from,to:r}),o=i.from&&a.from<=i.to&&to(l,a.from-10,a.from+10),!a.empty&&a.to>=i.from&&a.to<=i.to&&to(l,a.to-10,a.to+10);for(let{from:h,to:c}of l)c-h>1e3&&t.push(Qc(e,f=>f.from>=i.from&&f.to<=i.to&&Math.abs(f.from-h)<1e3&&Math.abs(f.to-c)<1e3)||new En(h,c,this.gapSize(i,h,c,s)))}return t}gapSize(e,t,i,s){let r=eo(s,i)-eo(s,t);return this.heightOracle.lineWrapping?e.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(e){En.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=T.set(e.map(t=>t.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];$.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Zt(this.heightMap.lineAt(e,H.ByPos,this.state.doc,0,0),this.scaler)}lineBlockAtHeight(e){return Zt(this.heightMap.lineAt(this.scaler.fromDOM(e),H.ByHeight,this.state.doc,0,0),this.scaler)}elementAtHeight(e){return Zt(this.heightMap.blockAt(this.scaler.fromDOM(e),this.state.doc,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Mi{constructor(e,t){this.from=e,this.to=t}}function _c(n,e,t){let i=[],s=n,r=0;return $.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function eo(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function to(n,e,t){for(let i=0;ie){let r=[];s.fromt&&r.push({from:t,to:s.to}),n.splice(i,1,...r),i+=r.length-1}}}function Qc(n,e){for(let t of n)if(e(t))return t}const io={toDOM(n){return n},fromDOM(n){return n},scale:1};class Zc{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,H.ByPos,e,0,0).top,c=t.lineAt(a,H.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=tZt(s,e)):n.type)}const Oi=D.define({combine:n=>n.join(" ")}),xs=D.define({combine:n=>n.indexOf(!0)>-1}),ks=ot.newName(),_l=ot.newName(),Ql=ot.newName(),Zl={"&light":"."+_l,"&dark":"."+Ql};function Ss(n,e,t){return new ot(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const ef=Ss("."+ks,{"&.cm-editor":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Zl),tf={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},In=A.ie&&A.ie_version<=11;class nf{constructor(e,t,i){this.view=e,this.onChange=t,this.onScrollChanged=i,this.active=!1,this.selectionRange=new tc,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.scrollTargets=[],this.intersection=null,this.resize=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(s=>{for(let r of s)this.queue.push(r);(A.ie&&A.ie_version<=11||A.ios&&e.composing)&&s.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),In&&(this.onCharData=s=>{this.queue.push({target:s.target,type:"characterData",oldValue:s.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resize=new ResizeObserver(()=>{this.view.docView.lastUpdate{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),s.length>0&&s[s.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(s=>{s.length>0&&s[s.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:t}=this,i=this.selectionRange;if(t.state.facet(yn)?t.root.activeElement!=this.dom:!Wi(t.dom,i))return;let s=i.anchorNode&&t.docView.nearest(i.anchorNode);s&&s.ignoreEvent(e)||((A.ie&&A.ie_version<=11||A.android&&A.chrome)&&!t.state.selection.main.empty&&i.focusNode&&Gi(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1))}readSelectionRange(){let{view:e}=this,t=A.safari&&e.root.nodeType==11&&Qh()==this.dom&&sf(this.view)||Ki(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=Wi(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let i=this.delayedAndroidKey;this.delayedAndroidKey=null,this.delayedFlush=-1,this.flush()||si(this.dom,i.key,i.keyCode)}),(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t})}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=window.setTimeout(()=>{this.delayedFlush=-1,this.flush()},20))}forceFlush(){this.delayedFlush>=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1),this.flush()}processRecords(){let e=this.queue;for(let r of this.observer.takeRecords())e.push(r);e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);!o||(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return;e&&this.readSelectionRange();let{from:t,to:i,typeOver:s}=this.processRecords(),r=this.selectionChanged&&Wi(this.dom,this.selectionRange);if(t<0&&!r)return;this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=this.view.state,l=this.onChange(t,i,s);return this.view.state==o&&this.view.update([]),l}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.dirty|=4),e.type=="childList"){let i=no(t,e.previousSibling||e.target.previousSibling,-1),s=no(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resize)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout)}}function no(n,e,t){for(;e;){let i=z.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function sf(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),document.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return Gi(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}function rf(n,e,t,i){let s,r,o=n.state.selection.main;if(e>-1){let l=n.docView.domBoundsAround(e,t,0);if(!l||n.state.readOnly)return!1;let{from:a,to:h}=l,c=n.docView.impreciseHead||n.docView.impreciseAnchor?[]:lf(n),f=new Hl(c,n.state);f.readRange(l.startDOM,l.endDOM);let u=o.from,d=null;(n.inputState.lastKeyCode===8&&n.inputState.lastKeyTime>Date.now()-100||A.android&&f.text.length=o.from&&s.to<=o.to&&(s.from!=o.from||s.to!=o.to)&&o.to-o.from-(s.to-s.from)<=4?s={from:o.from,to:o.to,insert:n.state.doc.slice(o.from,s.from).append(s.insert).append(n.state.doc.slice(s.to,o.to))}:(A.mac||A.android)&&s&&s.from==s.to&&s.from==o.head-1&&s.insert.toString()=="."&&(s={from:o.from,to:o.to,insert:I.of([" "])}),s){let l=n.state;if(A.ios&&n.inputState.flushIOSKey(n)||A.android&&(s.from==o.from&&s.to==o.to&&s.insert.length==1&&s.insert.lines==2&&si(n.contentDOM,"Enter",13)||s.from==o.from-1&&s.to==o.to&&s.insert.length==0&&si(n.contentDOM,"Backspace",8)||s.from==o.from&&s.to==o.to+1&&s.insert.length==0&&si(n.contentDOM,"Delete",46)))return!0;let a=s.insert.toString();if(n.state.facet(Bl).some(f=>f(n,s.from,s.to,a)))return!0;n.inputState.composing>=0&&n.inputState.composing++;let h;if(s.from>=o.from&&s.to<=o.to&&s.to-s.from>=(o.to-o.from)/3&&(!r||r.main.empty&&r.main.from==s.from+s.insert.length)&&n.inputState.composing<0){let f=o.froms.to?l.sliceDoc(s.to,o.to):"";h=l.replaceSelection(n.state.toText(f+s.insert.sliceString(0,void 0,n.state.lineBreak)+u))}else{let f=l.changes(s),u=r&&!l.selection.main.eq(r.main)&&r.main.to<=f.newLength?r.main:void 0;if(l.selection.ranges.length>1&&n.inputState.composing>=0&&s.to<=o.to&&s.to>=o.to-10){let d=n.state.sliceDoc(s.from,s.to),p=Wl(n)||n.state.doc.lineAt(o.head),g=o.to-s.to,y=o.to-o.from;h=l.changeByRange(b=>{if(b.from==o.from&&b.to==o.to)return{changes:f,range:u||b.map(f)};let S=b.to-g,v=S-d.length;if(b.to-b.from!=y||n.state.sliceDoc(v,S)!=d||p&&b.to>=p.from&&b.from<=p.to)return{range:b};let k=l.changes({from:v,to:S,insert:s.insert}),C=b.to-o.to;return{changes:k,range:u?m.range(Math.max(0,u.anchor+C),Math.max(0,u.head+C)):b.map(k)}})}else h={changes:f,selection:u&&l.selection.replaceRange(u)}}let c="input.type";return n.composing&&(c+=".compose",n.inputState.compositionFirstChange&&(c+=".start",n.inputState.compositionFirstChange=!1)),n.dispatch(h,{scrollIntoView:!0,userEvent:c}),!0}else if(r&&!r.main.eq(o)){let l=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(l=!0),a=n.inputState.lastSelectionOrigin),n.dispatch({selection:r,scrollIntoView:l,userEvent:a}),!0}else return!1}function of(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}return o=o?r-t:0,l=r+(l-o),o=r):l=l?r-t:0,o=r+(o-l),l=r),{from:r,toA:o,toB:l}}function lf(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new Ir(t,i)),(s!=t||r!=i)&&e.push(new Ir(s,r))),e}function af(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?m.single(t+e,i+e):null}class O{constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this._root=e.root||ic(e.parent)||document,this.viewState=new Zr(e.state||N.create(e)),this.plugins=this.state.facet(_t).map(t=>new Pn(t));for(let t of this.plugins)t.update(this);this.observer=new nf(this,(t,i,s)=>rf(this,t,i,s),t=>{this.inputState.runScrollHandlers(this,t),this.observer.intersecting&&this.measure()}),this.inputState=new Bc(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new Nr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}dispatch(...e){this._dispatch(e.length==1&&e[0]instanceof _?e[0]:this.state.update(...e))}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let l of e){if(l.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=l.state}if(this.destroyed){this.viewState.state=r;return}if(this.observer.clear(),r.facet(N.phrases)!=this.state.facet(N.phrases))return this.setState(r);s=Yi.create(this,r,e);let o=this.viewState.scrollTarget;try{this.updateState=2;for(let l of e){if(o&&(o=o.map(l.changes)),l.scrollIntoView){let{main:a}=l.state.selection;o=new Xi(a.empty?a:m.cursor(a.head,a.head>a.anchor?-1:1))}for(let a of l.effects)a.is(Rr)&&(o=a.value)}this.viewState.update(s,o),this.bidiCache=_i.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Qt)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(l=>l.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Oi)!=s.state.facet(Oi)&&(this.viewState.mustMeasureContent=!0),(t||i||o||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let l of this.state.facet(ps))l(s)}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Zr(e),this.plugins=e.facet(_t).map(i=>new Pn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new Nr(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(_t),i=e.state.facet(_t);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Pn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,{scrollHeight:i,scrollTop:s,clientHeight:r}=this.scrollDOM,o=s>i-r-4?i:s;try{for(let l=0;;l++){this.updateState=1;let a=this.viewport,h=this.viewState.lineBlockAtHeight(o),c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];c&4||([this.measureRequests,f]=[f,this.measureRequests]);let u=f.map(y=>{try{return y.read(this)}catch(b){return Re(this.state,b),so}}),d=Yi.create(this,this.state,[]),p=!1,g=!1;d.flags|=c,t?t.flags|=c:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),p=this.docView.update(d));for(let y=0;y1||y<-1)&&(this.scrollDOM.scrollTop+=y,g=!0)}if(p&&this.docView.updateSelection(!0),this.viewport.from==a.from&&this.viewport.to==a.to&&!g&&this.measureRequests.length==0)break}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(ps))l(t)}get themeClasses(){return ks+" "+(this.state.facet(xs)?Ql:_l)+" "+this.state.facet(Oi)}updateAttrs(){let e=ro(this,Ll,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(yn)?"true":"false",class:"cm-content",style:`${A.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),ro(this,Rl,t);let i=this.observer.ignore(()=>{let s=us(this.contentDOM,this.contentAttrs,t),r=us(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(O.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Qt),ot.mount(this.root,this.styleModules.concat(ef).reverse())}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame(()=>this.measure())),e){if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Rn(this,e,qr(this,e,t,i))}moveByGroup(e,t){return Rn(this,e,qr(this,e,t,i=>Oc(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return Dc(this,e,t,i)}moveVertically(e,t,i){return Rn(this,e,Tc(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),ql(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[Pt.find(r,e-s.from,-1,t)];return pn(i,o.dir==J.LTR==t>0)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Pl)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>hf)return Vl(e.length);let t=this.textDirectionAt(e.from);for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t)return s.order;let i=dc(e.text,t);return this.bidiCache.push(new _i(e.from,e.to,t,i)),i}get hasFocus(){var e;return(document.hasFocus()||A.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{dl(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Rr.of(new Xi(typeof e=="number"?m.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return fe.define(()=>({}),{eventHandlers:e})}static theme(e,t){let i=ot.newName(),s=[Oi.of(i),Qt.of(Ss(`.${i}`,e))];return t&&t.dark&&s.push(xs.of(!0)),s}static baseTheme(e){return St.lowest(Qt.of(Ss("."+ks,e,Zl)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&z.get(i)||z.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}O.styleModule=Qt;O.inputHandler=Bl;O.perLineTextDirection=Pl;O.exceptionSink=Tl;O.updateListener=ps;O.editable=yn;O.mouseSelectionStyle=Ol;O.dragMovesSelection=Dl;O.clickAddsSelectionRange=Ml;O.decorations=ui;O.atomicRanges=El;O.scrollMargins=Il;O.darkTheme=xs;O.contentAttributes=Rl;O.editorAttributes=Ll;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=R.define();const hf=4096,so={};class _i{constructor(e,t,i,s){this.from=e,this.to=t,this.dir=i,this.order=s}static update(e,t){if(t.empty)return e;let i=[],s=e.length?e[e.length-1].dir:J.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&fs(o,t)}return t}const cf=A.mac?"mac":A.windows?"win":A.linux?"linux":"key";function ff(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}function df(n,e,t){return ta(ea(n.state),e,n,t)}let Ze=null;const pf=4e3;function gf(n,e=cf){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h)=>{let c=t[o]||(t[o]=Object.create(null)),f=l.split(/ (?!$)/).map(p=>ff(p,e));for(let p=1;p{let b=Ze={view:y,prefix:g,scope:o};return setTimeout(()=>{Ze==b&&(Ze=null)},pf),!0}]})}let u=f.join(" ");s(u,!1);let d=c[u]||(c[u]={preventDefault:!1,commands:[]});d.commands.push(a),h&&(d.preventDefault=!0)};for(let o of n){let l=o[e]||o.key;if(!!l)for(let a of o.scope?o.scope.split(" "):["editor"])r(a,l,o.run,o.preventDefault),o.shift&&r(a,"Shift-"+l,o.shift,o.preventDefault)}return t}function ta(n,e,t,i){let s=_h(e),r=te(s,0),o=ke(r)==s.length&&s!=" ",l="",a=!1;Ze&&Ze.view==t&&Ze.scope==i&&(l=Ze.prefix+" ",(a=jl.indexOf(e.keyCode)<0)&&(Ze=null));let h=u=>{if(u){for(let d of u.commands)if(d(t))return!0;u.preventDefault&&(a=!0)}return!1},c=n[i],f;if(c){if(h(c[l+Ti(s,e,!o)]))return!0;if(o&&(e.shiftKey||e.altKey||e.metaKey||r>127)&&(f=lt[e.keyCode])&&f!=s){if(h(c[l+Ti(f,e,!0)]))return!0;if(e.shiftKey&&Rt[e.keyCode]!=f&&h(c[l+Ti(Rt[e.keyCode],e,!1)]))return!0}else if(o&&e.shiftKey&&h(c[l+Ti(s,e,!0)]))return!0}return a}const ia=!A.ios,ei=D.define({combine(n){return $t(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function ng(n={}){return[ei.of(n),mf,yf]}class na{constructor(e,t,i,s,r){this.left=e,this.top=t,this.width=i,this.height=s,this.className=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}const mf=fe.fromClass(class{constructor(n){this.view=n,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=n.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=n.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),n.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){this.cursorLayer.style.animationDuration=this.view.state.facet(ei).cursorBlinkRate+"ms"}update(n){let e=n.startState.facet(ei)!=n.state.facet(ei);(e||n.selectionSet||n.geometryChanged||n.viewportChanged)&&this.view.requestMeasure(this.measureReq),n.transactions.some(t=>t.scrollIntoView)&&(this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),e&&this.setBlinkRate()}readPos(){let{state:n}=this.view,e=n.facet(ei),t=n.selection.ranges.map(s=>s.empty?[]:bf(this.view,s)).reduce((s,r)=>s.concat(r)),i=[];for(let s of n.selection.ranges){let r=s==n.selection.main;if(s.empty?!r||ia:e.drawRangeCursor){let o=wf(this.view,s,r);o&&i.push(o)}}return{rangePieces:t,cursors:i}}drawSel({rangePieces:n,cursors:e}){if(n.length!=this.rangePieces.length||n.some((t,i)=>!t.eq(this.rangePieces[i]))){this.selectionLayer.textContent="";for(let t of n)this.selectionLayer.appendChild(t.draw());this.rangePieces=n}if(e.length!=this.cursors.length||e.some((t,i)=>!t.eq(this.cursors[i]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent="";for(const i of e)this.cursorLayer.appendChild(i.draw())}else e.forEach((i,s)=>i.adjust(t[s]));this.cursors=e}}destroy(){this.selectionLayer.remove(),this.cursorLayer.remove()}}),sa={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};ia&&(sa[".cm-line"].caretColor="transparent !important");const yf=St.highest(O.theme(sa));function ra(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==J.LTR?e.left:e.right-n.scrollDOM.clientWidth)-n.scrollDOM.scrollLeft,top:e.top-n.scrollDOM.scrollTop}}function lo(n,e,t){let i=m.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:W.Text}}function ao(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==W.Text))return i}return t}function bf(n,e){if(e.to<=n.viewport.from||e.from>=n.viewport.to)return[];let t=Math.max(e.from,n.viewport.from),i=Math.min(e.to,n.viewport.to),s=n.textDirection==J.LTR,r=n.contentDOM,o=r.getBoundingClientRect(),l=ra(n),a=window.getComputedStyle(r.firstChild),h=o.left+parseInt(a.paddingLeft)+Math.min(0,parseInt(a.textIndent)),c=o.right-parseInt(a.paddingRight),f=ao(n,t),u=ao(n,i),d=f.type==W.Text?f:null,p=u.type==W.Text?u:null;if(n.lineWrapping&&(d&&(d=lo(n,t,d)),p&&(p=lo(n,i,p))),d&&p&&d.from==p.from)return y(b(e.from,e.to,d));{let v=d?b(e.from,null,d):S(f,!1),k=p?b(null,e.to,p):S(u,!0),C=[];return(d||f).to<(p||u).from-1?C.push(g(h,v.bottom,c,k.top)):v.bottomP&&U.from=we)break;Z>X&&E(Math.max(Pe,X),v==null&&Pe<=P,Math.min(Z,we),k==null&&Z>=V,ae.dir)}if(X=se.to+1,X>=we)break}return j.length==0&&E(P,v==null,V,k==null,n.textDirection),{top:M,bottom:B,horizontal:j}}function S(v,k){let C=o.top+(k?v.top:v.bottom);return{top:C,bottom:C,horizontal:[]}}}function wf(n,e,t){let i=n.coordsAtPos(e.head,e.assoc||1);if(!i)return null;let s=ra(n);return new na(i.left-s.left,i.top-s.top,-1,i.bottom-i.top,t?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}const oa=R.define({map(n,e){return n==null?null:e.mapPos(n)}}),ti=pe.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(oa)?i.value:t,n)}}),xf=fe.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(ti);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(ti)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let n=this.view.state.field(ti),e=n!=null&&this.view.coordsAtPos(n);if(!e)return null;let t=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-t.left+this.view.scrollDOM.scrollLeft,top:e.top-t.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(n){this.cursor&&(n?(this.cursor.style.left=n.left+"px",this.cursor.style.top=n.top+"px",this.cursor.style.height=n.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(ti)!=n&&this.view.dispatch({effects:oa.of(n)})}},{eventHandlers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function sg(){return[ti,xf]}function ho(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function kf(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class Sf{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(i){let l=typeof i=="function"?i:()=>i;this.addMatch=(a,h,c,f)=>f(c,c+a[0].length,l(a,h,c))}else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new bt,i=t.add.bind(t);for(let{from:s,to:r}of kf(e,this.maxLength))ho(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(b.range(g,y));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(y,e,g,p));t=t.update({filterFrom:c,filterTo:f,filter:(g,y)=>gf,add:u})}}return t}}const vs=/x/.unicode!=null?"gu":"g",vf=new RegExp(`[\0-\b +-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,vs),Cf={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Nn=null;function Af(){var n;if(Nn==null&&typeof document<"u"&&document.body){let e=document.body.style;Nn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Nn||!1}const qi=D.define({combine(n){let e=$t(n,{render:null,specialChars:vf,addSpecialChars:null});return(e.replaceTabs=!Af())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,vs)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,vs)),e}});function rg(n={}){return[qi.of(n),Mf()]}let co=null;function Mf(){return co||(co=fe.fromClass(class{constructor(n){this.view=n,this.decorations=T.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(qi)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Sf({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=te(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=yi(o.text,l,i-o.from);return T.replace({widget:new Bf((l-a%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=T.replace({widget:new Tf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(qi);n.startState.facet(qi)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Df="\u2022";function Of(n){return n>=32?Df:n==10?"\u2424":String.fromCharCode(9216+n)}class Tf extends ht{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Of(this.code),i=e.state.phrase("Control character")+" "+(Cf[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Bf extends ht{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class Pf extends ht{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function og(n){return fe.fromClass(class{constructor(e){this.view=e,this.placeholder=T.set([T.widget({widget:new Pf(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?T.none:this.placeholder}},{decorations:e=>e.decorations})}const Cs=2e3;function Lf(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Cs||t.off>Cs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(m.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=ns(h.text,o,n.tabSize,!0);if(c>-1){let f=ns(h.text,l,n.tabSize);r.push(m.range(h.from+c,h.from+f))}}}return r}function Rf(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function fo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Cs?-1:s==i.length?Rf(n,e.clientX):yi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function Ef(n,e){let t=fo(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=fo(n,s);if(!l)return i;let a=Lf(n.state,t,l);return a.length?o?m.create(a.concat(i.ranges)):m.create(a):i}}:null}function lg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?Ef(t,i):null)}const Vn="-10000px";class If{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){let t=e.state.facet(this.facet),i=t.filter(r=>r);if(t===this.input){for(let r of this.tooltipViews)r.update&&r.update(e);return!1}let s=[];for(let r=0;r{var e,t,i;return{position:A.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Nf}}}),la=fe.fromClass(class{constructor(n){var e;this.view=n,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let t=n.state.facet(Fn);this.position=t.position,this.parent=t.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new If(n,aa,i=>this.createTooltip(i)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(i=>{Date.now()>this.lastTransaction-50&&i.length>0&&i[i.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),(e=n.dom.ownerDocument.defaultView)===null||e===void 0||e.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Fn);if(i.position!=this.position){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Vn,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;(n=this.view.dom.ownerDocument.defaultView)===null||n===void 0||n.removeEventListener("resize",this.measureSoon);for(let{dom:t}of this.manager.tooltipViews)t.remove();(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect();return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(Fn).tooltipSpace(this.view)}}writeMeasure(n){let{editor:e,space:t}=n,i=[];for(let s=0;s=Math.min(e.bottom,t.bottom)||a.rightMath.min(e.right,t.right)+.1){l.style.top=Vn;continue}let c=r.arrow?o.dom.querySelector(".cm-tooltip-arrow"):null,f=c?7:0,u=h.right-h.left,d=h.bottom-h.top,p=o.offset||Ff,g=this.view.textDirection==J.LTR,y=h.width>t.right-t.left?g?t.left:t.right-h.width:g?Math.min(a.left-(c?14:0)+p.x,t.right-u):Math.max(t.left,a.left-u+(c?14:0)-p.x),b=!!r.above;!r.strictSide&&(b?a.top-(h.bottom-h.top)-p.yt.bottom)&&b==t.bottom-a.bottom>a.top-t.top&&(b=!b);let S=b?a.top-d-f-p.y:a.bottom+f+p.y,v=y+u;if(o.overlap!==!0)for(let k of i)k.lefty&&k.topS&&(S=b?k.top-d-2-f:k.bottom+f+2);this.position=="absolute"?(l.style.top=S-n.parent.top+"px",l.style.left=y-n.parent.left+"px"):(l.style.top=S+"px",l.style.left=y+"px"),c&&(c.style.left=`${a.left+(g?p.x:-p.x)-(y+14-7)}px`),o.overlap!==!0&&i.push({left:y,top:S,right:v,bottom:S+d}),l.classList.toggle("cm-tooltip-above",b),l.classList.toggle("cm-tooltip-below",!b),o.positioned&&o.positioned()}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Vn}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),Vf=O.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:`${7}px`,width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:`${7}px solid transparent`,borderRight:`${7}px solid transparent`},".cm-tooltip-above &":{bottom:`-${7}px`,"&:before":{borderTop:`${7}px solid #bbb`},"&:after":{borderTop:`${7}px solid #f5f5f5`,bottom:"1px"}},".cm-tooltip-below &":{top:`-${7}px`,"&:before":{borderBottom:`${7}px solid #bbb`},"&:after":{borderBottom:`${7}px solid #f5f5f5`,top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Ff={x:0,y:0},aa=D.define({enables:[la,Vf]});function Hf(n,e){let t=n.plugin(la);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const uo=D.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Qi(n,e){let t=n.plugin(ha),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const ha=fe.fromClass(class{constructor(n){this.input=n.state.facet(Zi),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(uo);this.top=new Bi(n,!0,e.topContainer),this.bottom=new Bi(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(uo);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Bi(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Bi(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Zi);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>O.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Bi{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=po(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=po(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function po(n){let e=n.nextSibling;return n.remove(),e}const Zi=D.define({enables:ha});class xt extends yt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}xt.prototype.elementClass="";xt.prototype.toDOM=void 0;xt.prototype.mapMode=oe.TrackBefore;xt.prototype.startSide=xt.prototype.endSide=-1;xt.prototype.point=!0;const Wf=D.define(),zf=new class extends xt{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},qf=Wf.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges)if(i.empty){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(zf.range(s)))}return $.of(e)});function ag(){return qf}const $f=1024;let jf=0;class Me{constructor(e,t){this.from=e,this.to=t}}class L{constructor(e={}){this.id=jf++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ue.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:n=>n.split(" ")});L.openedBy=new L({deserialize:n=>n.split(" ")});L.group=new L({deserialize:n=>n.split(" ")});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class Uf{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}}const Kf=Object.create(null);class ue{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):Kf,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ue(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(L.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(L.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}ue.none=new ue("",Object.create(null),0,8);class Gs{constructor(e){this.types=e;for(let t=0;t=s&&(o.type.isAnonymous||t(o)!==!1)){if(o.firstChild())continue;l=!0}for(;l&&i&&!o.type.isAnonymous&&i(o),!o.nextSibling();){if(!o.parent())return;l=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Ys(ue.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new F(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new F(ue.none,t,i,s)))}static build(e){return Jf(e)}}F.empty=new F(ue.none,[],[],0);class Js{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Js(this.buffer,this.index)}}class Ct{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ue.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i,s){let r=this.buffer,o=new Uint16Array(t-e);for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function fa(n,e){let t=n.childBefore(e);for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(n=t,t=i.prevSibling):t=i}return n}function Vt(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(!!ca(s,i,f,f+c.length)){if(c instanceof Ct){if(r&K.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new ze(new Gf(o,c,e,f),null,u)}else if(r&K.IncludeAnonymous||!c.type.isAnonymous||Xs(c)){let u;if(!(r&K.IgnoreMounts)&&c.props&&(u=c.prop(L.mounted))&&!u.overlay)return new Te(u.tree,f,e,o);let d=new Te(c,f,e,o);return r&K.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&K.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&K.IgnoreOverlays)&&(s=this._tree.prop(L.mounted))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new Te(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new di(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return Vt(this,e,t,!1)}resolveInner(e,t=0){return Vt(this,e,t,!0)}enterUnfinishedNodesBefore(e){return fa(this,e)}getChild(e,t=null,i=null){let s=en(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return en(this,e,t,i)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return tn(this,e)}}function en(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function tn(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Gf{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class ze{constructor(e,t,i){this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new ze(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&K.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new ze(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ze(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ze(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new di(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1],l=i.buffer[this.index+2];e.push(i.slice(s,r,o,l)),t.push(0)}return new F(this.type,e,t,this.to-this.from)}resolve(e,t=0){return Vt(this,e,t,!1)}resolveInner(e,t=0){return Vt(this,e,t,!0)}enterUnfinishedNodesBefore(e){return fa(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let s=en(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return en(this,e,t,i)}get node(){return this}matchContext(e){return tn(this,e)}}class di{constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Te)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}get name(){return this.type.name}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Te?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&K.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&K.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&K.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&K.IncludeAnonymous||l instanceof Ct||!l.type.isAnonymous||Xs(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}}for(let s=i;s=0;r--){if(r<0)return tn(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function Xs(n){return n.children.some(e=>e instanceof Ct||!e.type.isAnonymous||Xs(e))}function Jf(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=$f,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new Js(t,t.length):t,a=i.types,h=0,c=0;function f(k,C,M,B,j){let{id:E,start:P,end:V,size:U}=l,X=c;for(;U<0;)if(l.next(),U==-1){let Z=r[E];M.push(Z),B.push(P-k);return}else if(U==-3){h=E;return}else if(U==-4){c=E;return}else throw new RangeError(`Unrecognized record size: ${U}`);let we=a[E],se,ae,Pe=P-k;if(V-P<=s&&(ae=g(l.pos-C,j))){let Z=new Uint16Array(ae.size-ae.skip),Le=l.pos-ae.size,Je=Z.length;for(;l.pos>Le;)Je=y(ae.start,Z,Je);se=new Ct(Z,V-ae.start,i),Pe=ae.start-k}else{let Z=l.pos-U;l.next();let Le=[],Je=[],ft=E>=o?E:-1,At=0,ki=V;for(;l.pos>Z;)ft>=0&&l.id==ft&&l.size>=0?(l.end<=ki-s&&(d(Le,Je,P,At,l.end,ki,ft,X),At=Le.length,ki=l.end),l.next()):f(P,Z,Le,Je,ft);if(ft>=0&&At>0&&At-1&&At>0){let pr=u(we);se=Ys(we,Le,Je,0,Le.length,0,V-P,pr,pr)}else se=p(we,Le,Je,V-P,X-V)}M.push(se),B.push(Pe)}function u(k){return(C,M,B)=>{let j=0,E=C.length-1,P,V;if(E>=0&&(P=C[E])instanceof F){if(!E&&P.type==k&&P.length==B)return P;(V=P.prop(L.lookAhead))&&(j=M[E]+P.length+V)}return p(k,C,M,B,j)}}function d(k,C,M,B,j,E,P,V){let U=[],X=[];for(;k.length>B;)U.push(k.pop()),X.push(C.pop()+M-j);k.push(p(i.types[P],U,X,E-j,V-E)),C.push(j-M)}function p(k,C,M,B,j=0,E){if(h){let P=[L.contextHash,h];E=E?[P].concat(E):[P]}if(j>25){let P=[L.lookAhead,j];E=E?[P].concat(E):[P]}return new F(k,C,M,B,E)}function g(k,C){let M=l.fork(),B=0,j=0,E=0,P=M.end-s,V={size:0,start:0,skip:0};e:for(let U=M.pos-k;M.pos>U;){let X=M.size;if(M.id==C&&X>=0){V.size=B,V.start=j,V.skip=E,E+=4,B+=4,M.next();continue}let we=M.pos-X;if(X<0||we=o?4:0,ae=M.start;for(M.next();M.pos>we;){if(M.size<0)if(M.size==-3)se+=4;else break e;else M.id>=o&&(se+=4);M.next()}j=ae,B+=X,E+=se}return(C<0||B==k)&&(V.size=B,V.start=j,V.skip=E),V.size>4?V:void 0}function y(k,C,M){let{id:B,start:j,end:E,size:P}=l;if(l.next(),P>=0&&B4){let U=l.pos-(P-4);for(;l.pos>U;)M=y(k,C,M)}C[--M]=V,C[--M]=E-k,C[--M]=j-k,C[--M]=B}else P==-3?h=B:P==-4&&(c=B);return M}let b=[],S=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,b,S,-1);let v=(e=n.length)!==null&&e!==void 0?e:b.length?S[0]+b[0].length:0;return new F(a[n.topID],b.reverse(),S.reverse(),v)}const mo=new WeakMap;function $i(n,e){if(!n.isAnonymous||e instanceof Ct||e.type!=n)return 1;let t=mo.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof F)){t=1;break}t+=$i(n,i)}mo.set(e,t)}return t}function Ys(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;M+=B}if(v==k+1){if(M>c){let B=p[k];d(B.children,B.positions,0,B.children.length,g[k]+S);continue}f.push(p[k])}else{let B=g[v-1]+p[v-1].length-C;f.push(Ys(n,p,g,k,v,C,B,null,a))}u.push(C+S-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class hg{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof ze?this.setBuffer(e.context.buffer,e.index,t):e instanceof Te&&this.map.set(e.tree,t)}get(e){return e instanceof ze?this.getBuffer(e.context.buffer,e.index):e instanceof Te?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ye{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new Ye(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Ye(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew Me(s.from,s.to)):[new Me(0,0)]:[new Me(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class Xf{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function cg(n){return(e,t,i,s)=>new _f(e,n,t,i,s)}class yo{constructor(e,t,i,s,r){this.parser=e,this.parse=t,this.overlay=i,this.target=s,this.ranges=r}}class Yf{constructor(e,t,i,s,r,o,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const As=new L({perNode:!0});class _f{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new F(i.type,i.children,i.positions,i.length,i.propValues.concat([[As,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[L.mounted.id]=new Uf(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tc.frag.from<=s.from&&c.frag.to>=s.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=s.from&&u<=s.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=Qf(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&s.fromnew Me(f.from-s.from,f.to-s.from)):null,s.tree,c)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else t&&(a=t.predicate(s))&&(a===!0&&(a=new Me(s.from,s.to)),a.fromnew Me(c.from-t.start,c.to-t.start)),t.target,h)),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function Qf(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function bo(n,e,t,i,s,r){if(e=e.to);i++);let o=s.children[i],l=o.buffer;function a(h,c,f,u,d){let p=h;for(;l[p+2]+r<=e.from;)p=l[p+3];let g=[],y=[];bo(o,h,p,g,y,u);let b=l[p+1],S=l[p+2],v=b+r==e.from&&S+r==e.to&&l[p]==e.type.id;return g.push(v?e.toTree():a(p+4,l[p+3],o.set.types[l[p]],b,S-b)),y.push(b-u),bo(o,l[p+3],c,g,y,u),new F(f,g,y,d)}s.children[i]=a(0,l.length,ue.none,0,o.length);for(let h=0;h<=t;h++)n.childAfter(e.from)}class wo{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(K.IncludeAnonymous|K.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,K.IgnoreOverlays|K.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof F)t=t.children[0];else break}return!1}}class eu{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(As))!==null&&t!==void 0?t:i.to,this.inner=new wo(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(As))!==null&&e!==void 0?e:t.to,this.inner=new wo(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(L.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function xo(n,e){let t=null,i=e;for(let s=1,r=0;s=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new Me(l,a.to))):a.to>l?t[r--]=new Me(l,a.to):t.splice(r--,1))}}return i}function tu(n,e,t,i){let s=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew Me(u.from+i,u.to+i)),f=tu(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,g=p?h:f[u].from;if(g>d&&t.push(new Ye(d,g,s.tree,-o,r.from>=d,r.to<=g)),p)break;d=f[u].to}}else t.push(new Ye(a,h,s.tree,-o,r.from>=o,r.to<=l))}return t}let iu=0;class He{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=iu++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new He([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new nn;return t=>t.modified.indexOf(e)>-1?t:nn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let nu=0;class nn{constructor(){this.instances=[],this.id=nu++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&su(t,l.modified));if(i)return i;let s=[],r=new He(s,e,t);for(let l of t)l.instances.push(r);let o=da(t);for(let l of e.set)for(let a of o)s.push(nn.get(l,a));return r}}function su(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function da(n){let e=[n];for(let t=0;t0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new ou(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return pa.add(e)}const pa=new L;class ou{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function lu(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function au(n,e,t,i=0,s=n.length){let r=new hu(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class hu{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=o.prop(pa),f=!1;for(;c;){if(!c.context||e.matchContext(c.context)){let d=lu(r,c.tags);d&&(h&&(h+=" "),h+=d,c.mode==1?s+=(s?" ":"")+d:c.mode==0&&(f=!0));break}c=c.next}if(this.startSpan(e.from,h),f)return;let u=e.tree&&e.tree.prop(L.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(y=>!y.scope||y.scope(u.tree.type)),g=e.firstChild();for(let y=0,b=l;;y++){let S=y=v||!e.nextSibling())););if(!S||v>i)break;b=S.to+l,b>t&&(this.highlightRange(d.cursor(),Math.max(t,S.from+l),Math.min(i,b),s,p),this.startSpan(b,h))}g&&e.parent()}else if(e.firstChild()){do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}const w=He.define,Li=w(),_e=w(),So=w(_e),vo=w(_e),Qe=w(),Ri=w(Qe),Hn=w(Qe),Fe=w(),ut=w(Fe),Ne=w(),Ve=w(),Ms=w(),Jt=w(Ms),Ei=w(),x={comment:Li,lineComment:w(Li),blockComment:w(Li),docComment:w(Li),name:_e,variableName:w(_e),typeName:So,tagName:w(So),propertyName:vo,attributeName:w(vo),className:w(_e),labelName:w(_e),namespace:w(_e),macroName:w(_e),literal:Qe,string:Ri,docString:w(Ri),character:w(Ri),attributeValue:w(Ri),number:Hn,integer:w(Hn),float:w(Hn),bool:w(Qe),regexp:w(Qe),escape:w(Qe),color:w(Qe),url:w(Qe),keyword:Ne,self:w(Ne),null:w(Ne),atom:w(Ne),unit:w(Ne),modifier:w(Ne),operatorKeyword:w(Ne),controlKeyword:w(Ne),definitionKeyword:w(Ne),moduleKeyword:w(Ne),operator:Ve,derefOperator:w(Ve),arithmeticOperator:w(Ve),logicOperator:w(Ve),bitwiseOperator:w(Ve),compareOperator:w(Ve),updateOperator:w(Ve),definitionOperator:w(Ve),typeOperator:w(Ve),controlOperator:w(Ve),punctuation:Ms,separator:w(Ms),bracket:Jt,angleBracket:w(Jt),squareBracket:w(Jt),paren:w(Jt),brace:w(Jt),content:Fe,heading:ut,heading1:w(ut),heading2:w(ut),heading3:w(ut),heading4:w(ut),heading5:w(ut),heading6:w(ut),contentSeparator:w(Fe),list:w(Fe),quote:w(Fe),emphasis:w(Fe),strong:w(Fe),link:w(Fe),monospace:w(Fe),strikethrough:w(Fe),inserted:w(),deleted:w(),changed:w(),invalid:w(),meta:Ei,documentMeta:w(Ei),annotation:w(Ei),processingInstruction:w(Ei),definition:He.defineModifier(),constant:He.defineModifier(),function:He.defineModifier(),standard:He.defineModifier(),local:He.defineModifier(),special:He.defineModifier()};ga([{tag:x.link,class:"tok-link"},{tag:x.heading,class:"tok-heading"},{tag:x.emphasis,class:"tok-emphasis"},{tag:x.strong,class:"tok-strong"},{tag:x.keyword,class:"tok-keyword"},{tag:x.atom,class:"tok-atom"},{tag:x.bool,class:"tok-bool"},{tag:x.url,class:"tok-url"},{tag:x.labelName,class:"tok-labelName"},{tag:x.inserted,class:"tok-inserted"},{tag:x.deleted,class:"tok-deleted"},{tag:x.literal,class:"tok-literal"},{tag:x.string,class:"tok-string"},{tag:x.number,class:"tok-number"},{tag:[x.regexp,x.escape,x.special(x.string)],class:"tok-string2"},{tag:x.variableName,class:"tok-variableName"},{tag:x.local(x.variableName),class:"tok-variableName tok-local"},{tag:x.definition(x.variableName),class:"tok-variableName tok-definition"},{tag:x.special(x.variableName),class:"tok-variableName2"},{tag:x.definition(x.propertyName),class:"tok-propertyName tok-definition"},{tag:x.typeName,class:"tok-typeName"},{tag:x.namespace,class:"tok-namespace"},{tag:x.className,class:"tok-className"},{tag:x.macroName,class:"tok-macroName"},{tag:x.propertyName,class:"tok-propertyName"},{tag:x.operator,class:"tok-operator"},{tag:x.comment,class:"tok-comment"},{tag:x.meta,class:"tok-meta"},{tag:x.invalid,class:"tok-invalid"},{tag:x.punctuation,class:"tok-punctuation"}]);var Wn;const Ft=new L;function ma(n){return D.define({combine:n?e=>e.concat(n):void 0})}class De{constructor(e,t,i=[]){this.data=e,N.prototype.hasOwnProperty("tree")||Object.defineProperty(N.prototype,"tree",{get(){return de(this)}}),this.parser=t,this.extension=[zt.of(this),N.languageData.of((s,r,o)=>s.facet(Co(s,r,o)))].concat(i)}isActiveAt(e,t,i=-1){return Co(e,t,i)==this.data}findRegions(e){let t=e.facet(zt);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(Ft)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(Ft)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}))}configure(e){return new Ds(this.data,this.parser.configure(e))}get allowsNesting(){return this.parser.hasWrappers()}}function de(n){let e=n.field(De.state,!1);return e?e.tree:F.empty}class cu{constructor(e,t=e.length){this.doc=e,this.length=t,this.cursorPos=0,this.string="",this.cursor=e.iter()}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Xt=null;class Ht{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Ht(e,t,[],F.empty,0,i,[],null)}startParse(){return this.parser.startParse(new cu(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=F.empty&&this.isDone(t!=null?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Ye.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Xt;Xt=this;try{return e()}finally{Xt=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Ao(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Ye.applyChanges(i,a),s=F.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Ao(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends ua{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=Xt;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new F(ue.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Xt}}function Ao(n,e,t){return Ye.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Wt{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Wt(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Ht.create(e.facet(zt).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Wt(i)}}De.state=pe.define({create:Wt.init,update(n,e){for(let t of e.effects)if(t.is(De.setState))return t.value;return e.startState.facet(zt)!=e.state.facet(zt)?Wt.init(e.state):n.apply(e)}});let ya=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(ya=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const zn=typeof navigator<"u"&&((Wn=navigator.scheduling)===null||Wn===void 0?void 0:Wn.isInputPending)?()=>navigator.scheduling.isInputPending():null,fu=fe.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(De.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(De.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=ya(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>zn&&zn()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:De.setState.of(new Wt(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Re(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),zt=D.define({combine(n){return n.length?n[0]:null},enables:[De.state,fu]});class ug{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const ba=D.define(),bn=D.define({combine:n=>{if(!n.length)return" ";if(!/^(?: +|\t+)$/.test(n[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return n[0]}});function kt(n){let e=n.facet(bn);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function sn(n,e){let t="",i=n.tabSize;if(n.facet(bn).charCodeAt(0)==9)for(;e>=i;)t+=" ",e-=i;for(let s=0;s=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return yi(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const uu=new L;function du(n,e,t){return xa(e.resolveInner(t).enterUnfinishedNodesBefore(t),t,n)}function pu(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function gu(n){let e=n.type.prop(uu);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(L.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>ka(o,!0,1,void 0,r&&!pu(o)?s.from:void 0)}return n.parent==null?mu:null}function xa(n,e,t){for(;n;n=n.parent){let i=gu(n);if(i)return i(_s.create(t,e,n))}return null}function mu(){return 0}class _s extends wn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.node=i}static create(e,t,i){return new _s(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(yu(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?xa(e,this.pos,this.base):0}}function yu(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function bu(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.fromka(i,e,t,n)}function ka(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?bu(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const pg=n=>n.baseIndent;function gg({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const mg=new L;function yg(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(Ft)==o.data:o?l=>l==o:void 0,this.style=ga(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new ot(i):null,this.themeType=t.themeType}static define(e,t){return new xn(e,t||{})}}const Os=D.define(),Sa=D.define({combine(n){return n.length?[n[0]]:null}});function qn(n){let e=n.facet(Os);return e.length?e:n.facet(Sa)}function bg(n,e){let t=[xu],i;return n instanceof xn&&(n.module&&t.push(O.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Sa.of(n)):i?t.push(Os.computeN([O.darkTheme],s=>s.facet(O.darkTheme)==(i=="dark")?[n]:[])):t.push(Os.of(n)),t}class wu{constructor(e){this.markCache=Object.create(null),this.tree=de(e.state),this.decorations=this.buildDeco(e,qn(e.state))}update(e){let t=de(e.state),i=qn(e.state),s=i!=qn(e.startState);t.length{i.add(o,l,this.markCache[a]||(this.markCache[a]=T.mark({class:a})))},s,r);return i.finish()}}const xu=St.high(fe.fromClass(wu,{decorations:n=>n.decorations})),wg=xn.define([{tag:x.meta,color:"#7a757a"},{tag:x.link,textDecoration:"underline"},{tag:x.heading,textDecoration:"underline",fontWeight:"bold"},{tag:x.emphasis,fontStyle:"italic"},{tag:x.strong,fontWeight:"bold"},{tag:x.strikethrough,textDecoration:"line-through"},{tag:x.keyword,color:"#708"},{tag:[x.atom,x.bool,x.url,x.contentSeparator,x.labelName],color:"#219"},{tag:[x.literal,x.inserted],color:"#164"},{tag:[x.string,x.deleted],color:"#a11"},{tag:[x.regexp,x.escape,x.special(x.string)],color:"#e40"},{tag:x.definition(x.variableName),color:"#00f"},{tag:x.local(x.variableName),color:"#30a"},{tag:[x.typeName,x.namespace],color:"#085"},{tag:x.className,color:"#167"},{tag:[x.special(x.variableName),x.macroName],color:"#256"},{tag:x.definition(x.propertyName),color:"#00c"},{tag:x.comment,color:"#940"},{tag:x.invalid,color:"#f00"}]),ku=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),va=1e4,Ca="()[]{}",Aa=D.define({combine(n){return $t(n,{afterCursor:!0,brackets:Ca,maxScanDistance:va,renderMatch:Cu})}}),Su=T.mark({class:"cm-matchingBracket"}),vu=T.mark({class:"cm-nonmatchingBracket"});function Cu(n){let e=[],t=n.matched?Su:vu;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const Au=pe.define({create(){return T.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Aa);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=qe(e.state,s.head,-1,i)||s.head>0&&qe(e.state,s.head-1,1,i)||i.afterCursor&&(qe(e.state,s.head,1,i)||s.headO.decorations.from(n)}),Mu=[Au,ku];function xg(n={}){return[Aa.of(n),Mu]}function Ts(n,e,t){let i=n.prop(e<0?L.openedBy:L.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function qe(n,e,t,i={}){let s=i.maxScanDistance||va,r=i.brackets||Ca,o=de(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=Ts(a.type,t,r);if(h&&a.from=i.to){if(a==0&&s.indexOf(h.type.name)>-1&&h.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let g=t>0?0:d.length-1,y=t>0?d.length:-1;g!=y;g+=t){let b=o.indexOf(d[g]);if(!(b<0||i.resolveInner(p+g,1).type!=s))if(b%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+g,to:p+g+1},matched:b>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function Mo(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Tu(n){return{token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||Bu,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||Zs}}function Bu(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}class Da extends De{constructor(e){let t=ma(e.languageData),i=Tu(e),s,r=new class extends ua{createParse(o,l,a){return new Lu(s,o,l,a)}};super(t,r,[ba.of((o,l)=>this.getIndent(o,l))]),this.topNode=Iu(t),s=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=e.tokenTable?new Pa(i.tokenTable):Eu}static define(e){return new Da(e)}getIndent(e,t){let i=de(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r=Qs(this,i,0,s.from,t),o,l;if(r?(l=r.state,o=r.pos+1):(l=this.streamParser.startState(e.unit),o=0),t-o>1e4)return null;for(;o=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof F&&a=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&Qs(n,s.tree,0-s.offset,t,o),a;if(l&&(a=Oa(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?kt(i):4),tree:F.empty}}class Lu{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=Ht.get(),o=s[0].from,{state:l,tree:a}=Pu(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` `&&(t="");else{let i=t.indexOf(` -`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;t+=this.ranges[++this.rangeIndex].from-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new Ba(t,e?e.state.tabSize:4,e?xt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=La(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const Zs=Object.create(null),di=[fe.none],Vu=new Gs(di),Do=[],Ea=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Ea[n]=Na(Zs,e);class Ia{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Ea)}resolve(e){return e?this.table[e]||(this.table[e]=Na(this.extra,e)):0}}const Fu=new Ia(Zs);function $n(n,e){Do.indexOf(n)>-1||(Do.push(n),console.warn(e))}function Na(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||x[r];o?typeof o=="function"?t?t=o(t):$n(r,`Modifier ${r} used at start of tag`):t?$n(r,`Tag ${r} used as modifier`):t=o:$n(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=fe.define({id:di.length,name:i,props:[hu({[i]:t})]});return di.push(s),s.id}function Hu(n){let e=fe.define({id:di.length,name:"Document",props:[Vt.add(()=>n)]});return di.push(e),e}const Wu=n=>{let e=tr(n.state);return e.line?zu(n):e.block?$u(n):!1};function er(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const zu=er(Ku,0),qu=er(Va,0),$u=er((n,e)=>Va(n,e,Uu(e)),0);function tr(n,e=n.selection.main.head){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Xt=50;function ju(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Xt,i),o=n.sliceDoc(s,s+Xt),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*Xt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Xt),f=n.sliceDoc(s-Xt,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Uu(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from,to:s.to})}return e}function Va(n,e,t=e.selection.ranges){let i=t.map(r=>tr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>ju(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>c.from)){s=c.from;let f=tr(e,h).line;if(!f)continue;let u=/^\s*/.exec(c.text)[0].length,d=u==c.length,p=c.text.slice(u,u+f.length)==f?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const Bs=St.define(),Gu=St.define(),Ju=D.define(),Fa=D.define({combine(n){return qt(n,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}});function Xu(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const Ha=de.define({create(){return ze.empty},update(n,e){let t=e.state.facet(Fa),i=e.annotation(Bs);if(i){let a=e.docChanged?m.single(Xu(e.changes)):void 0,h=me.fromTransaction(e,a),c=i.side,f=c==0?n.undone:n.done;return h?f=sn(f,f.length,t.minDepth,h):f=qa(f,e.startState.selection),new ze(c==0?i.rest:f,c==0?f:i.rest)}let s=e.annotation(Gu);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(_.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=me.fromTransaction(e),o=e.annotation(_.time),l=e.annotation(_.userEvent);return r?n=n.addChanges(r,o,l,t.newGroupDelay,t.minDepth):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new ze(n.done.map(me.fromJSON),n.undone.map(me.fromJSON))}});function yg(n={}){return[Ha,Fa.of(n),O.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Wa:e.inputType=="historyRedo"?Ps:null;return i?(e.preventDefault(),i(t)):!1}})]}function xn(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(Ha,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const Wa=xn(0,!1),Ps=xn(1,!1),Yu=xn(0,!0),_u=xn(1,!0);class me{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new me(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new me(e.changes&&Y.fromJSON(e.changes),[],e.mapped&&qe.fromJSON(e.mapped),e.startSelection&&m.fromJSON(e.startSelection),e.selectionsAfter.map(m.fromJSON))}static fromTransaction(e,t){let i=De;for(let s of e.startState.facet(Ju)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new me(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,De)}static selection(e){return new me(void 0,De,void 0,void 0,e)}}function sn(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function Qu(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function Zu(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function za(n,e){return n.length?e.length?n.concat(e):n:e}const De=[],ed=200;function qa(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-ed));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),sn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[me.selection([e])]}function td(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function jn(n,e){if(!n.length)return n;let t=n.length,i=De;for(;t;){let s=id(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[me.selection(i)]:De}function id(n,e,t){let i=za(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):De,t);if(!n.changes)return me.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new me(s,L.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const nd=/^(input\.type|delete)($|\.)/;class ze{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new ze(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||nd.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):kn(t,e))}function Te(n){return n.textDirectionAt(n.state.selection.main.head)==J.LTR}const ja=n=>$a(n,!Te(n)),Ua=n=>$a(n,Te(n));function Ka(n,e){return Ye(n,t=>t.empty?n.moveByGroup(t,e):kn(t,e))}const sd=n=>Ka(n,!Te(n)),rd=n=>Ka(n,Te(n));function od(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Sn(n,e,t){let i=ue(n).resolveInner(e.head),s=t?R.closedBy:R.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;od(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?We(n,i.from,1):We(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,m.cursor(l,t?-1:1)}const ld=n=>Ye(n,e=>Sn(n.state,e,!Te(n))),ad=n=>Ye(n,e=>Sn(n.state,e,Te(n)));function Ga(n,e){return Ye(n,t=>{if(!t.empty)return kn(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const Ja=n=>Ga(n,!1),Xa=n=>Ga(n,!0);function Ya(n){return Math.max(n.defaultLineHeight,Math.min(n.dom.clientHeight,innerHeight)-5)}function _a(n,e){let{state:t}=n,i=$t(t.selection,l=>l.empty?n.moveVertically(l,e,Ya(n)):kn(l,e));if(i.eq(t.selection))return!1;let s=n.coordsAtPos(t.selection.main.head),r=n.scrollDOM.getBoundingClientRect(),o;return s&&s.top>r.top&&s.bottom_a(n,!1),Rs=n=>_a(n,!0);function vn(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=m.cursor(i.from+r))}return s}const To=n=>Ye(n,e=>vn(n,e,!0)),Bo=n=>Ye(n,e=>vn(n,e,!1)),hd=n=>Ye(n,e=>m.cursor(n.lineBlockAt(e.head).from,1)),cd=n=>Ye(n,e=>m.cursor(n.lineBlockAt(e.head).to,-1));function fd(n,e,t){let i=!1,s=$t(n.selection,r=>{let o=We(n,r.head,-1)||We(n,r.head,1)||r.head>0&&We(n,r.head-1,1)||r.headfd(n,e,!1);function Ke(n,e){let t=$t(n.state.selection,i=>{let s=e(i);return m.range(i.anchor,s.head,s.goalColumn)});return t.eq(n.state.selection)?!1:(n.dispatch(Ue(n.state,t)),!0)}function Qa(n,e){return Ke(n,t=>n.moveByChar(t,e))}const Za=n=>Qa(n,!Te(n)),eh=n=>Qa(n,Te(n));function th(n,e){return Ke(n,t=>n.moveByGroup(t,e))}const dd=n=>th(n,!Te(n)),pd=n=>th(n,Te(n)),gd=n=>Ke(n,e=>Sn(n.state,e,!Te(n))),md=n=>Ke(n,e=>Sn(n.state,e,Te(n)));function ih(n,e){return Ke(n,t=>n.moveVertically(t,e))}const nh=n=>ih(n,!1),sh=n=>ih(n,!0);function rh(n,e){return Ke(n,t=>n.moveVertically(t,e,Ya(n)))}const Po=n=>rh(n,!1),Ro=n=>rh(n,!0),Lo=n=>Ke(n,e=>vn(n,e,!0)),Eo=n=>Ke(n,e=>vn(n,e,!1)),yd=n=>Ke(n,e=>m.cursor(n.lineBlockAt(e.head).from)),bd=n=>Ke(n,e=>m.cursor(n.lineBlockAt(e.head).to)),Io=({state:n,dispatch:e})=>(e(Ue(n,{anchor:0})),!0),No=({state:n,dispatch:e})=>(e(Ue(n,{anchor:n.doc.length})),!0),Vo=({state:n,dispatch:e})=>(e(Ue(n,{anchor:n.selection.main.anchor,head:0})),!0),Fo=({state:n,dispatch:e})=>(e(Ue(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),wd=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),xd=({state:n,dispatch:e})=>{let t=Mn(n).map(({from:i,to:s})=>m.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:m.create(t),userEvent:"select"})),!0},kd=({state:n,dispatch:e})=>{let t=$t(n.selection,i=>{var s;let r=ue(n).resolveInner(i.head,1);for(;!(r.from=i.to||r.to>i.to&&r.from<=i.from||!(!((s=r.parent)===null||s===void 0)&&s.parent));)r=r.parent;return m.range(r.to,r.from)});return e(Ue(n,t)),!0},Sd=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=m.create([t.main]):t.main.empty||(i=m.create([m.cursor(t.main.head)])),i?(e(Ue(n,i)),!0):!1};function Cn({state:n,dispatch:e},t){if(n.readOnly)return!1;let i="delete.selection",s=n.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=t(o);ao&&(i="delete.forward"),o=Math.min(o,a),l=Math.max(l,a)}return o==l?{range:r}:{changes:{from:o,to:l},range:m.cursor(o)}});return s.changes.empty?!1:(e(n.update(s,{scrollIntoView:!0,userEvent:i,effects:i=="delete.selection"?O.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function An(n,e,t){if(n instanceof O)for(let i of n.state.facet(O.atomicRanges).map(s=>s(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const oh=(n,e)=>Cn(n,t=>{let{state:i}=n,s=i.doc.lineAt(t),r,o;if(!e&&t>s.from&&toh(n,!1),lh=n=>oh(n,!0),ah=(n,e)=>Cn(n,t=>{let i=t,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=Se(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t)&&(l=c),i=a}return An(n,i,e)}),hh=n=>ah(n,!1),vd=n=>ah(n,!0),ch=n=>Cn(n,e=>{let t=n.lineBlockAt(e).to;return An(n,eCn(n,e=>{let t=n.lineBlockAt(e).from;return An(n,e>t?t:Math.max(0,e-1),!1)}),Ad=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:I.of(["",""])},range:m.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},Md=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:Se(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:Se(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:m.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Mn(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function fh(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of Mn(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(m.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(m.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:m.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Dd=({state:n,dispatch:e})=>fh(n,e,!1),Od=({state:n,dispatch:e})=>fh(n,e,!0);function uh(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Mn(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Td=({state:n,dispatch:e})=>uh(n,e,!1),Bd=({state:n,dispatch:e})=>uh(n,e,!0),Pd=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Mn(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Rd(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ue(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(R.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from?{from:i.to,to:s.from}:null}const Ld=dh(!1),Ed=dh(!0);function dh(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&Rd(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new bn(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=va(h,r);for(c==null&&(c=/^\s*/.exec(e.doc.lineAt(r).text)[0].length);ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:m.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const Id=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new bn(n,{overrideIndentation:r=>{let o=t[r];return o==null?-1:o}}),s=ir(n,(r,o,l)=>{let a=va(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=nn(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(ir(n,(t,i)=>{i.push({from:t.from,insert:n.facet(yn)})}),{userEvent:"input.indent"})),!0),Vd=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(ir(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=mi(s,n.tabSize),o=0,l=nn(n,Math.max(0,r-xt(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),wg=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ld,shift:gd},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:ad,shift:md},{key:"Alt-ArrowUp",run:Dd},{key:"Shift-Alt-ArrowUp",run:Td},{key:"Alt-ArrowDown",run:Od},{key:"Shift-Alt-ArrowDown",run:Bd},{key:"Escape",run:Sd},{key:"Mod-Enter",run:Ed},{key:"Alt-l",mac:"Ctrl-l",run:xd},{key:"Mod-i",run:kd,preventDefault:!0},{key:"Mod-[",run:Vd},{key:"Mod-]",run:Nd},{key:"Mod-Alt-\\",run:Id},{key:"Shift-Mod-k",run:Pd},{key:"Shift-Mod-\\",run:ud},{key:"Mod-/",run:Wu},{key:"Alt-A",run:qu}].concat(Hd);function pe(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class zt{constructor(e,t,i=0,s=e.length,r){this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?o=>r(Ho(o)):Ho,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return te(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Vs(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=xe(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o);if(a)return this.value=a,this;if(r==s.length-1)break;o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=rn(this.text,s+(i==s?1:0)),i==this.curLine.length&&this.nextLine(),ithis.value.to)return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new Pt(t,e.sliceString(t,i));return Un.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t&&this.flat.tothis.flat.text.length-10&&(t=null),t){let i=this.flat.from+t.index,s=i+t[0].length;return this.value={from:i,to:s,match:t},this.matchPos=rn(this.text,s+(i==s?1:0)),this}else{if(this.flat.to==this.to)return this.done=!0,this;this.flat=Pt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}}typeof Symbol<"u"&&(mh.prototype[Symbol.iterator]=yh.prototype[Symbol.iterator]=function(){return this});function Wd(n){try{return new RegExp(n,nr),!0}catch{return!1}}function rn(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function Es(n){let e=pe("input",{class:"cm-textfield",name:"line"}),t=pe("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:on.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},pe("label",n.state.phrase("Go to line"),": ",e)," ",pe("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!s)return;let{state:r}=n,o=r.doc.lineAt(r.selection.main.head),[,l,a,h,c]=s,f=h?+h.slice(1):0,u=a?+a:o.number;if(a&&c){let p=u/100;l&&(p=p*(l=="-"?-1:1)+o.number/r.doc.lines),u=Math.round(r.doc.lines*p)}else a&&l&&(u=u*(l=="-"?-1:1)+o.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u)));n.dispatch({effects:on.of(!1),selection:m.cursor(d.from+Math.max(0,Math.min(f,d.length))),scrollIntoView:!0}),n.focus()}return{dom:t}}const on=L.define(),Wo=de.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(on)&&(n=t.value);return n},provide:n=>Qi.from(n,e=>e?Es:null)}),zd=n=>{let e=_i(n,Es);if(!e){let t=[on.of(!0)];n.state.field(Wo,!1)==null&&t.push(L.appendConfig.of([Wo,qd])),n.dispatch({effects:t}),e=_i(n,Es)}return e&&e.dom.querySelector("input").focus(),!0},qd=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),$d={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},bh=D.define({combine(n){return qt(n,$d,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function xg(n){let e=[Jd,Gd];return n&&e.push(bh.of(n)),e}const jd=T.mark({class:"cm-selectionMatch"}),Ud=T.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function zo(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=ae.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=ae.Word)}function Kd(n,e,t,i){return n(e.sliceDoc(t,t+1))==ae.Word&&n(e.sliceDoc(i-1,i))==ae.Word}const Gd=ce.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(bh),{state:t}=n,i=t.selection;if(i.ranges.length>1)return T.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return T.none;let a=t.wordAt(s.head);if(!a)return T.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return T.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(zo(o,t,s.from,s.to)&&Kd(o,t,s.from,s.to)))return T.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return T.none}let l=[];for(let a of n.visibleRanges){let h=new zt(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||zo(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(Ud.range(c,f)):(c>=s.to||f<=s.from)&&l.push(jd.range(c,f)),l.length>e.maxMatches))return T.none}}return T.set(l)}},{decorations:n=>n.decorations}),Jd=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Xd=({state:n,dispatch:e})=>{let{selection:t}=n,i=m.create(t.ranges.map(s=>n.wordAt(s.head)||m.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function Yd(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new zt(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new zt(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const _d=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return Xd({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=Yd(n,i);return s?(e(n.update({selection:n.selection.addRange(m.range(s.from,s.to),!1),effects:O.scrollIntoView(s.to)})),!0):!1},sr=D.define({combine(n){var e;return{top:n.reduce((t,i)=>t!=null?t:i.top,void 0)||!1,caseSensitive:n.reduce((t,i)=>t!=null?t:i.caseSensitive,void 0)||!1,literal:n.reduce((t,i)=>t!=null?t:i.literal,void 0)||!1,createPanel:((e=n.find(t=>t.createPanel))===null||e===void 0?void 0:e.createPanel)||(t=>new op(t))}}});class wh{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Wd(this.search)),this.unquoted=this.literal?this.search:this.search.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp}create(){return this.regexp?new Zd(this):new Qd(this)}getCursor(e,t=0,i=e.length){return this.regexp?Dt(this,e,t,i):Mt(this,e,t,i)}}class xh{constructor(e){this.spec=e}}function Mt(n,e,t,i){return new zt(e,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase())}class Qd extends xh{constructor(e){super(e)}nextMatch(e,t,i){let s=Mt(this.spec,e,i,e.length).nextOverlapping();return s.done&&(s=Mt(this.spec,e,0,t).nextOverlapping()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=Mt(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let i=Mt(this.spec,e,0,e.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Mt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Dt(n,e,t,i){return new mh(e,n.search,n.caseSensitive?void 0:{ignoreCase:!0},t,i)}class Zd extends xh{nextMatch(e,t,i){let s=Dt(this.spec,e,i,e.length).next();return s.done&&(s=Dt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Dt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Dt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const pi=L.define(),rr=L.define(),st=de.define({create(n){return new Kn(Is(n).create(),null)},update(n,e){for(let t of e.effects)t.is(pi)?n=new Kn(t.value.create(),n.panel):t.is(rr)&&(n=new Kn(n.query,t.value?or:null));return n},provide:n=>Qi.from(n,e=>e.panel)});class Kn{constructor(e,t){this.query=e,this.panel=t}}const ep=T.mark({class:"cm-searchMatch"}),tp=T.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ip=ce.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(st))}update(n){let e=n.state.field(st);(e!=n.startState.field(st)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return T.none;let{view:t}=this,i=new yt;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state.doc,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?tp:ep)})}return i.finish()}},{decorations:n=>n.decorations});function bi(n){return e=>{let t=e.state.field(st,!1);return t&&t.query.spec.valid?n(e,t):kh(e)}}const ln=bi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state.doc,t,t);return i?(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:lr(n,i),userEvent:"select.search"}),!0):!1}),an=bi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t.doc,i,i);return s?(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:lr(n,s),userEvent:"select.search"}),!0):!1}),np=bi((n,{query:e})=>{let t=e.matchAll(n.state.doc,1e3);return!t||!t.length?!1:(n.dispatch({selection:m.create(t.map(i=>m.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),sp=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new zt(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(m.range(l.value.from,l.value.to))}return e(n.update({selection:m.create(r,o),userEvent:"select.search.matches"})),!0},qo=bi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t.doc,i,i);if(!r)return!1;let o=[],l,a,h=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t.doc,r.from,r.to),h.push(O.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l={anchor:r.from-c,head:r.to-c},h.push(lr(n,r))}return n.dispatch({changes:o,selection:l,scrollIntoView:!!l,effects:h,userEvent:"input.replace"}),!0}),rp=bi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state.doc,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:O.announce.of(i),userEvent:"input.replace.all"}),!0});function or(n){return n.state.facet(sr).createPanel(n)}function Is(n,e){var t,i,s;let r=n.selection.main,o=r.empty||r.to>r.from+100?"":n.sliceDoc(r.from,r.to);if(e&&!o)return e;let l=n.facet(sr);return new wh({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:l.literal)?o:o.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:l.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:l.literal})}const kh=n=>{let e=n.state.field(st,!1);if(e&&e.panel){let t=_i(n,or);if(!t)return!1;let i=t.dom.querySelector("[main-field]");if(i&&i!=n.root.activeElement){let s=Is(n.state,e.query.spec);s.valid&&n.dispatch({effects:pi.of(s)}),i.focus(),i.select()}}else n.dispatch({effects:[rr.of(!0),e?pi.of(Is(n.state,e.query.spec)):L.appendConfig.of(ap)]});return!0},Sh=n=>{let e=n.state.field(st,!1);if(!e||!e.panel)return!1;let t=_i(n,or);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:rr.of(!1)}),!0},kg=[{key:"Mod-f",run:kh,scope:"editor search-panel"},{key:"F3",run:ln,shift:an,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:ln,shift:an,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Sh,scope:"editor search-panel"},{key:"Mod-Shift-l",run:sp},{key:"Alt-g",run:zd},{key:"Mod-d",run:_d,preventDefault:!0}];class op{constructor(e){this.view=e;let t=this.query=e.state.field(st).query.spec;this.commit=this.commit.bind(this),this.searchField=pe("input",{value:t.search,placeholder:ve(e,"Find"),"aria-label":ve(e,"Find"),class:"cm-textfield",name:"search","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=pe("input",{value:t.replace,placeholder:ve(e,"Replace"),"aria-label":ve(e,"Replace"),class:"cm-textfield",name:"replace",onchange:this.commit,onkeyup:this.commit}),this.caseField=pe("input",{type:"checkbox",name:"case",checked:t.caseSensitive,onchange:this.commit}),this.reField=pe("input",{type:"checkbox",name:"re",checked:t.regexp,onchange:this.commit});function i(s,r,o){return pe("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=pe("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>ln(e),[ve(e,"next")]),i("prev",()=>an(e),[ve(e,"previous")]),i("select",()=>np(e),[ve(e,"all")]),pe("label",null,[this.caseField,ve(e,"match case")]),pe("label",null,[this.reField,ve(e,"regexp")]),...e.state.readOnly?[]:[pe("br"),this.replaceField,i("replace",()=>qo(e),[ve(e,"replace")]),i("replaceAll",()=>rp(e),[ve(e,"replace all")]),pe("button",{name:"close",onclick:()=>Sh(e),"aria-label":ve(e,"close"),type:"button"},["\xD7"])]])}commit(){let e=new wh({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:pi.of(e)}))}keydown(e){yf(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?an:ln)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),qo(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(pi)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(sr).top}}function ve(n,e){return n.state.phrase(e)}const Ei=30,Ii=/[\s\.,:;?!]/;function lr(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Ei),o=Math.min(s,t+Ei),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-Ei;a--)if(!Ii.test(l[a-1])&&Ii.test(l[a])){l=l.slice(0,a);break}}return O.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const lp=O.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ap=[st,kt.lowest(ip),lp];class vh{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ue(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Ch(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function $o(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function hp(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:hp(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function Sg(n,e){return t=>{for(let i=ue(t.state).resolveInner(t.pos,-1);i;i=i.parent)if(n.indexOf(i.name)>-1)return null;return e(t)}}class jo{constructor(e,t,i){this.completion=e,this.source=t,this.match=i}}function rt(n){return n.selection.main.head}function Ch(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}function fp(n,e,t,i){return Object.assign(Object.assign({},n.changeByRange(s=>{if(s==n.selection.main)return{changes:{from:t,to:i,insert:e},range:m.cursor(t+e.length)};let r=i-t;return!s.empty||r&&n.sliceDoc(s.from-r,s.from)!=n.sliceDoc(t,i)?{range:s}:{changes:{from:s.from-r,to:s.from,insert:e},range:m.cursor(s.from-r+e.length)}})),{userEvent:"input.complete"})}function Ah(n,e){const t=e.completion.apply||e.completion.label;let i=e.source;typeof t=="string"?n.dispatch(fp(n.state,t,i.from,i.to)):t(n,e.completion,i.from,i.to)}const Uo=new WeakMap;function up(n){if(!Array.isArray(n))return n;let e=Uo.get(n);return e||Uo.set(n,e=cp(n)),e}class dp{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let t=0;t=48&&C<=57||C>=97&&C<=122?2:C>=65&&C<=90?1:0:(M=Vs(C))!=M.toLowerCase()?1:M!=M.toUpperCase()?2:0;(!S||B==1&&y||k==0&&B!=0)&&(t[f]==C||i[f]==C&&(u=!0)?o[f++]=S:o.length&&(b=!1)),k=B,S+=xe(C)}return f==a&&o[0]==0&&b?this.result(-100+(u?-200:0),o,e):d==a&&p==0?[-200-e.length,0,g]:l>-1?[-700-e.length,l,l+this.pattern.length]:d==a?[-200+-700-e.length,p,g]:f==a?this.result(-100+(u?-200:0)+-700+(b?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[e-i.length],r=1;for(let o of t){let l=o+(this.astral?xe(te(i,o)):1);r>1&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return s}}const je=D.define({combine(n){return qt(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],compareCompletions:(e,t)=>e.label.localeCompare(t.label)},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,optionClass:(e,t)=>i=>pp(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function pp(n,e){return n?e?n+" "+e:n:e}function gp(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let{label:o}=t,l=0;for(let a=1;al&&r.appendChild(document.createTextNode(o.slice(l,h)));let f=r.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,c))),f.className="cm-completionMatchedText",l=c}return lt.position-i.position).map(t=>t.render)}function Ko(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class mp{constructor(e,t){this.view=e,this.stateField=t,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:l=>this.positionInfo(l),key:this};let i=e.state.field(t),{options:s,selected:r}=i.open,o=e.state.facet(je);this.optionContent=gp(o),this.optionClass=o.optionClass,this.range=Ko(s.length,r,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.dom.addEventListener("mousedown",l=>{for(let a=l.target,h;a&&a!=this.dom;a=a.parentNode)if(a.nodeName=="LI"&&(h=/-(\d+)$/.exec(a.id))&&+h[1]{this.info&&this.view.requestMeasure(this.placeInfo)})}mount(){this.updateSel()}update(e){e.state.field(this.stateField)!=e.startState.field(this.stateField)&&this.updateSel()}positioned(){this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected=this.range.to)&&(this.range=Ko(t.options.length,t.selected,this.view.state.facet(je).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})),this.updateSelectedOption(t.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o)}).catch(o=>Re(this.view.state,o,"completion info")):this.addInfoPane(r)}}addInfoPane(e){let t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&bp(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect();if(s.top>Math.min(innerHeight,t.bottom)-10||s.bottomnew mp(e,n)}function bp(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect();i.topt.bottom&&(n.scrollTop+=i.bottom-t.bottom)}function Go(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function wp(n,e){let t=[],i=0;for(let l of n)if(l.hasResult())if(l.result.filter===!1){let a=l.result.getMatch;for(let h of l.result.options){let c=[1e9-i++];if(a)for(let f of a(h))c.push(f);t.push(new jo(h,l,c))}}else{let a=new dp(e.sliceDoc(l.from,l.to)),h;for(let c of l.result.options)(h=a.match(c.label))&&(c.boost!=null&&(h[0]+=c.boost),t.push(new jo(c,l,h)))}let s=[],r=null,o=e.facet(je).compareCompletions;for(let l of t.sort((a,h)=>h.match[0]-a.match[0]||o(a.completion,h.completion)))!r||r.label!=l.completion.label||r.detail!=l.completion.detail||r.type!=null&&l.completion.type!=null&&r.type!=l.completion.type||r.apply!=l.completion.apply?s.push(l):Go(l.completion)>Go(r)&&(s[s.length-1]=l),r=l.completion;return s}class si{constructor(e,t,i,s,r){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new si(this.options,Jo(t,e),this.tooltip,this.timestamp,e)}static build(e,t,i,s,r){let o=wp(e,t);if(!o.length)return null;let l=t.facet(je).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(a,h.from):a,1e8),create:yp(Ce),above:r.aboveCursor},s?s.timestamp:Date.now(),l)}map(e){return new si(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}class hn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new hn(Sp,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(je),r=(i.override||t.languageDataAt("autocomplete",rt(t)).map(up)).map(l=>(this.active.find(h=>h.source==l)||new ge(l,this.active.some(h=>h.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!xp(r,this.active)?si.build(r,t,this.id,this.open,i):this.open&&e.docChanged?this.open.map(e.changes):this.open;!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new ge(l.source,0):l));for(let l of e.effects)l.is(Dh)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new hn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:kp}}function xp(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const Sp=[];function Ns(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class ge{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Ns(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new ge(s.source,0));for(let r of e.effects)if(r.is(ar))s=new ge(s.source,1,r.value?rt(e.state):-1);else if(r.is(cn))s=new ge(s.source,0);else if(r.is(Mh))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new ge(this.source,1)}handleChange(e){return e.changes.touchesRange(rt(e.startState))?new ge(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new ge(this.source,this.state,e.mapPos(this.explicitPos))}}class ri extends ge{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=rt(e.state);if((this.explicitPos<0?l<=r:lo||t=="delete"&&rt(e.startState)==this.from)return new ge(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return vp(this.result.validFor,e.state,r,o)?new ri(this.source,a,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new vh(e.state,l,a>=0)))?new ri(this.source,a,h,h.from,(s=h.to)!==null&&s!==void 0?s:rt(e.state)):new ge(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new ge(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new ri(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function vp(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):Ch(n,!0).test(s)}const ar=L.define(),cn=L.define(),Mh=L.define({map(n,e){return n.map(t=>t.map(e))}}),Dh=L.define(),Ce=de.define({create(){return hn.start()},update(n,e){return n.update(e)},provide:n=>[ua.from(n,e=>e.tooltip),O.contentAttributes.from(n,e=>e.attrs)]}),Oh=75;function Ni(n,e="option"){return t=>{let i=t.state.field(Ce,!1);if(!i||!i.open||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Dh.of(l)}),!0}}const Cp=n=>{let e=n.state.field(Ce,!1);return n.state.readOnly||!e||!e.open||Date.now()-e.open.timestampn.state.field(Ce,!1)?(n.dispatch({effects:ar.of(!0)}),!0):!1,Mp=n=>{let e=n.state.field(Ce,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:cn.of(null)}),!0)};class Dp{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Xo=50,Op=50,Tp=1e3,Bp=ce.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Ce).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Ce);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Ce)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Ns(i));for(let i=0;iOp&&Date.now()-s.time>Tp){for(let r of s.context.abortListeners)try{r()}catch(o){Re(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),Xo):-1,this.composing!=0)for(let i of n.transactions)Ns(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Ce);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=rt(e),i=new vh(e,t,n.explicitPos==t),s=new Dp(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:cn.of(null)}),Re(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),Xo))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(je);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new ge(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:Mh.of(e)})}},{eventHandlers:{blur(){let n=this.view.state.field(Ce,!1);n&&n.tooltip&&this.view.state.facet(je).closeOnBlur&&this.view.dispatch({effects:cn.of(null)})},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ar.of(!1)}),20),this.composing=0}}}),Th=O.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Pp{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class hr{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,oe.TrackDel),i=e.mapPos(this.to,1,oe.TrackDel);return t==null||i==null?null:new hr(this.field,t,i)}}class cr{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;fnew hr(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1;for(let c=0;c=h&&f.field++}s.push(new Pp(h,i.length,r.index,r.index+a.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}for(let l;l=/([$#])\\{/.exec(o);){o=o.slice(0,l.index)+l[1]+"{"+o.slice(l.index+l[0].length);for(let a of s)a.line==i.length&&a.from>l.index&&(a.from--,a.to--)}i.push(o)}return new cr(i,s)}}let Rp=T.widget({widget:new class extends ht{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),Lp=T.mark({class:"cm-snippetField"});class jt{constructor(e,t){this.ranges=e,this.active=t,this.deco=T.set(e.map(i=>(i.from==i.to?Rp:Lp).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new jt(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const wi=L.define({map(n,e){return n&&n.map(e)}}),Ep=L.define(),gi=de.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(wi))return t.value;if(t.is(Ep)&&n)return new jt(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>O.decorations.from(n,e=>e?e.deco:T.none)});function fr(n,e){return m.create(n.filter(t=>t.field==e).map(t=>m.range(t.from,t.to)))}function Ip(n){let e=cr.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),a={changes:{from:s,to:r,insert:I.of(o)},scrollIntoView:!0};if(l.length&&(a.selection=fr(l,0)),l.length>1){let h=new jt(l,0),c=a.effects=[wi.of(h)];t.state.field(gi,!1)===void 0&&c.push(L.appendConfig.of([gi,Wp,zp,Th]))}t.dispatch(t.state.update(a))}}function Bh(n){return({state:e,dispatch:t})=>{let i=e.field(gi,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:fr(i.ranges,s),effects:wi.of(r?null:new jt(i.ranges,s))})),!0}}const Np=({state:n,dispatch:e})=>n.field(gi,!1)?(e(n.update({effects:wi.of(null)})),!0):!1,Vp=Bh(1),Fp=Bh(-1),Hp=[{key:"Tab",run:Vp,shift:Fp},{key:"Escape",run:Np}],Yo=D.define({combine(n){return n.length?n[0]:Hp}}),Wp=kt.highest(Ks.compute([Yo],n=>n.facet(Yo)));function vg(n,e){return Object.assign(Object.assign({},e),{apply:Ip(n)})}const zp=O.domEventHandlers({mousedown(n,e){let t=e.state.field(gi,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:fr(t.ranges,s.field),effects:wi.of(t.ranges.some(r=>r.field>s.field)?new jt(t.ranges,s.field):null)}),!0)}}),fn={brackets:["(","[","{","'",'"'],before:")]}:;>"},pt=L.define({map(n,e){let t=e.mapPos(n,-1,oe.TrackAfter);return t==null?void 0:t}}),ur=L.define({map(n,e){return e.mapPos(n)}}),dr=new class extends mt{};dr.startSide=1;dr.endSide=-1;const Ph=de.define({create(){return $.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=$.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(pt)?n=n.update({add:[dr.range(t.value,t.value+1)]}):t.is(ur)&&(n=n.update({filter:i=>i!=t.value}));return n}});function Cg(){return[$p,Ph]}const Gn="()[]{}<>";function Rh(n){for(let e=0;e{if((qp?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&xe(te(i,0))==1||e!=s.from||t!=s.to)return!1;let r=Up(n.state,i);return r?(n.dispatch(r),!0):!1}),jp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Lh(n,n.selection.main.head).brackets||fn.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=Kp(n.doc,o.head);for(let a of i)if(a==l&&Dn(n.doc,o.head)==Rh(te(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:m.cursor(o.head-a.length),userEvent:"delete.backward"}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0})),!s},Ag=[{key:"Backspace",run:jp}];function Up(n,e){let t=Lh(n,n.selection.main.head),i=t.brackets||fn.brackets;for(let s of i){let r=Rh(te(s,0));if(e==s)return r==s?Xp(n,s,i.indexOf(s+s+s)>-1):Gp(n,s,r,t.before||fn.before);if(e==r&&Eh(n,n.selection.main.from))return Jp(n,s,r)}return null}function Eh(n,e){let t=!1;return n.field(Ph).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Dn(n,e){let t=n.sliceString(e,e+2);return t.slice(0,xe(te(t,0)))}function Kp(n,e){let t=n.sliceString(e-2,e);return xe(te(t,0))==t.length?t:t.slice(1)}function Gp(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:pt.of(o.to+e.length),range:m.range(o.anchor+e.length,o.head+e.length)};let l=Dn(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:pt.of(o.head+e.length),range:m.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Jp(n,e,t){let i=null,s=n.selection.ranges.map(r=>r.empty&&Dn(n.doc,r.head)==t?m.cursor(r.head+t.length):i=r);return i?null:n.update({selection:m.create(s,n.selection.mainIndex),scrollIntoView:!0,effects:n.selection.ranges.map(({from:r})=>ur.of(r))})}function Xp(n,e,t){let i=null,s=n.changeByRange(r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:e,from:r.to}],effects:pt.of(r.to+e.length),range:m.range(r.anchor+e.length,r.head+e.length)};let o=r.head,l=Dn(n.doc,o);if(l==e){if(_o(n,o))return{changes:{insert:e+e,from:o},effects:pt.of(o+e.length),range:m.cursor(o+e.length)};if(Eh(n,o)){let a=t&&n.sliceDoc(o,o+e.length*3)==e+e+e;return{range:m.cursor(o+e.length*(a?3:1)),effects:ur.of(o)}}}else{if(t&&n.sliceDoc(o-2*e.length,o)==e+e&&_o(n,o-2*e.length))return{changes:{insert:e+e+e+e,from:o},effects:pt.of(o+e.length),range:m.cursor(o+e.length)};if(n.charCategorizer(o)(l)!=ae.Word){let a=n.sliceDoc(o-1,o);if(a!=e&&n.charCategorizer(o)(a)!=ae.Word&&!Yp(n,o,e))return{changes:{insert:e+e,from:o},effects:pt.of(o+e.length),range:m.cursor(o+e.length)}}}return{range:i=r}});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function _o(n,e){let t=ue(n).resolveInner(e+1);return t.parent&&t.from==e}function Yp(n,e,t){let i=ue(n).resolveInner(e,-1);for(let s=0;s<5;s++){if(n.sliceDoc(i.from,i.from+t.length)==t){let o=i.firstChild;for(;o&&o.from==i.from&&o.to-o.from>t.length;){if(n.sliceDoc(o.to-t.length,o.to)==t)return!1;o=o.firstChild}return!0}let r=i.to==e&&i.parent;if(!r)break;i=r}return!1}function Mg(n={}){return[Ce,je.of(n),Bp,Qp,Th]}const _p=[{key:"Ctrl-Space",run:Ap},{key:"Escape",run:Mp},{key:"ArrowDown",run:Ni(!0)},{key:"ArrowUp",run:Ni(!1)},{key:"PageDown",run:Ni(!0,"page")},{key:"PageUp",run:Ni(!1,"page")},{key:"Enter",run:Cp}],Qp=kt.highest(Ks.computeN([je],n=>n.facet(je).defaultKeymap?[_p]:[]));export{fg as A,ug as B,un as C,Gf as D,O as E,dg as F,ag as G,ue as H,K as I,Sg as J,cp as K,Ds as L,m as M,Gs as N,cg as O,ma as P,hg as Q,vg as R,Pa as S,F as T,rg as U,N as a,tg as b,yg as c,Zp as d,eg as e,gg as f,mg as g,sg as h,Cg as i,xg as j,Ks as k,Ag as l,wg as m,kg as n,bg as o,_p as p,Mg as q,ng as r,pg as s,ig as t,fe as u,R as v,hu as w,x,og as y,mu as z}; +`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;t+=this.ranges[++this.rangeIndex].from-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new Ma(t,e?e.state.tabSize:4,e?kt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Ta(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const Zs=Object.create(null),pi=[ue.none],Ru=new Gs(pi),Do=[],Ba=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Ba[n]=La(Zs,e);class Pa{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Ba)}resolve(e){return e?this.table[e]||(this.table[e]=La(this.extra,e)):0}}const Eu=new Pa(Zs);function $n(n,e){Do.indexOf(n)>-1||(Do.push(n),console.warn(e))}function La(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||x[r];o?typeof o=="function"?t?t=o(t):$n(r,`Modifier ${r} used at start of tag`):t?$n(r,`Tag ${r} used as modifier`):t=o:$n(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=ue.define({id:pi.length,name:i,props:[ru({[i]:t})]});return pi.push(s),s.id}function Iu(n){let e=ue.define({id:pi.length,name:"Document",props:[Ft.add(()=>n)]});return pi.push(e),e}const Nu=n=>{let e=tr(n.state);return e.line?Vu(n):e.block?Hu(n):!1};function er(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const Vu=er(qu,0),Fu=er(Ra,0),Hu=er((n,e)=>Ra(n,e,zu(e)),0);function tr(n,e=n.selection.main.head){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Yt=50;function Wu(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Yt,i),o=n.sliceDoc(s,s+Yt),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*Yt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Yt),f=n.sliceDoc(s-Yt,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function zu(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from,to:s.to})}return e}function Ra(n,e,t=e.selection.ranges){let i=t.map(r=>tr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>Wu(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>c.from)){s=c.from;let f=tr(e,h).line;if(!f)continue;let u=/^\s*/.exec(c.text)[0].length,d=u==c.length,p=c.text.slice(u,u+f.length)==f?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const Bs=vt.define(),$u=vt.define(),ju=D.define(),Ea=D.define({combine(n){return $t(n,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}});function Uu(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const Ia=pe.define({create(){return $e.empty},update(n,e){let t=e.state.facet(Ea),i=e.annotation(Bs);if(i){let a=e.docChanged?m.single(Uu(e.changes)):void 0,h=ye.fromTransaction(e,a),c=i.side,f=c==0?n.undone:n.done;return h?f=rn(f,f.length,t.minDepth,h):f=Fa(f,e.startState.selection),new $e(c==0?i.rest:f,c==0?f:i.rest)}let s=e.annotation($u);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(_.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=ye.fromTransaction(e),o=e.annotation(_.time),l=e.annotation(_.userEvent);return r?n=n.addChanges(r,o,l,t.newGroupDelay,t.minDepth):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new $e(n.done.map(ye.fromJSON),n.undone.map(ye.fromJSON))}});function kg(n={}){return[Ia,Ea.of(n),O.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Na:e.inputType=="historyRedo"?Ps:null;return i?(e.preventDefault(),i(t)):!1}})]}function kn(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(Ia,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const Na=kn(0,!1),Ps=kn(1,!1),Ku=kn(0,!0),Gu=kn(1,!0);class ye{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new ye(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new ye(e.changes&&Y.fromJSON(e.changes),[],e.mapped&&je.fromJSON(e.mapped),e.startSelection&&m.fromJSON(e.startSelection),e.selectionsAfter.map(m.fromJSON))}static fromTransaction(e,t){let i=Oe;for(let s of e.startState.facet(ju)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new ye(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Oe)}static selection(e){return new ye(void 0,Oe,void 0,void 0,e)}}function rn(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function Ju(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function Xu(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Va(n,e){return n.length?e.length?n.concat(e):n:e}const Oe=[],Yu=200;function Fa(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Yu));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),rn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[ye.selection([e])]}function _u(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function jn(n,e){if(!n.length)return n;let t=n.length,i=Oe;for(;t;){let s=Qu(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[ye.selection(i)]:Oe}function Qu(n,e,t){let i=Va(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Oe,t);if(!n.changes)return ye.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new ye(s,R.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const Zu=/^(input\.type|delete)($|\.)/;class $e{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new $e(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||Zu.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Sn(t,e))}function le(n){return n.textDirectionAt(n.state.selection.main.head)==J.LTR}const Wa=n=>Ha(n,!le(n)),za=n=>Ha(n,le(n));function qa(n,e){return Ee(n,t=>t.empty?n.moveByGroup(t,e):Sn(t,e))}const ed=n=>qa(n,!le(n)),td=n=>qa(n,le(n));function id(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function vn(n,e,t){let i=de(n).resolveInner(e.head),s=t?L.closedBy:L.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;id(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?qe(n,i.from,1):qe(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,m.cursor(l,t?-1:1)}const nd=n=>Ee(n,e=>vn(n.state,e,!le(n))),sd=n=>Ee(n,e=>vn(n.state,e,le(n)));function $a(n,e){return Ee(n,t=>{if(!t.empty)return Sn(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const ja=n=>$a(n,!1),Ua=n=>$a(n,!0);function Ka(n){return Math.max(n.defaultLineHeight,Math.min(n.dom.clientHeight,innerHeight)-5)}function Ga(n,e){let{state:t}=n,i=jt(t.selection,l=>l.empty?n.moveVertically(l,e,Ka(n)):Sn(l,e));if(i.eq(t.selection))return!1;let s=n.coordsAtPos(t.selection.main.head),r=n.scrollDOM.getBoundingClientRect(),o;return s&&s.top>r.top&&s.bottomGa(n,!1),Ls=n=>Ga(n,!0);function ct(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=m.cursor(i.from+r))}return s}const rd=n=>Ee(n,e=>ct(n,e,!0)),od=n=>Ee(n,e=>ct(n,e,!1)),ld=n=>Ee(n,e=>ct(n,e,!le(n))),ad=n=>Ee(n,e=>ct(n,e,le(n))),hd=n=>Ee(n,e=>m.cursor(n.lineBlockAt(e.head).from,1)),cd=n=>Ee(n,e=>m.cursor(n.lineBlockAt(e.head).to,-1));function fd(n,e,t){let i=!1,s=jt(n.selection,r=>{let o=qe(n,r.head,-1)||qe(n,r.head,1)||r.head>0&&qe(n,r.head-1,1)||r.headfd(n,e,!1);function Be(n,e){let t=jt(n.state.selection,i=>{let s=e(i);return m.range(i.anchor,s.head,s.goalColumn)});return t.eq(n.state.selection)?!1:(n.dispatch(Ge(n.state,t)),!0)}function Ja(n,e){return Be(n,t=>n.moveByChar(t,e))}const Xa=n=>Ja(n,!le(n)),Ya=n=>Ja(n,le(n));function _a(n,e){return Be(n,t=>n.moveByGroup(t,e))}const dd=n=>_a(n,!le(n)),pd=n=>_a(n,le(n)),gd=n=>Be(n,e=>vn(n.state,e,!le(n))),md=n=>Be(n,e=>vn(n.state,e,le(n)));function Qa(n,e){return Be(n,t=>n.moveVertically(t,e))}const Za=n=>Qa(n,!1),eh=n=>Qa(n,!0);function th(n,e){return Be(n,t=>n.moveVertically(t,e,Ka(n)))}const To=n=>th(n,!1),Bo=n=>th(n,!0),yd=n=>Be(n,e=>ct(n,e,!0)),bd=n=>Be(n,e=>ct(n,e,!1)),wd=n=>Be(n,e=>ct(n,e,!le(n))),xd=n=>Be(n,e=>ct(n,e,le(n))),kd=n=>Be(n,e=>m.cursor(n.lineBlockAt(e.head).from)),Sd=n=>Be(n,e=>m.cursor(n.lineBlockAt(e.head).to)),Po=({state:n,dispatch:e})=>(e(Ge(n,{anchor:0})),!0),Lo=({state:n,dispatch:e})=>(e(Ge(n,{anchor:n.doc.length})),!0),Ro=({state:n,dispatch:e})=>(e(Ge(n,{anchor:n.selection.main.anchor,head:0})),!0),Eo=({state:n,dispatch:e})=>(e(Ge(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),vd=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),Cd=({state:n,dispatch:e})=>{let t=Mn(n).map(({from:i,to:s})=>m.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:m.create(t),userEvent:"select"})),!0},Ad=({state:n,dispatch:e})=>{let t=jt(n.selection,i=>{var s;let r=de(n).resolveInner(i.head,1);for(;!(r.from=i.to||r.to>i.to&&r.from<=i.from||!(!((s=r.parent)===null||s===void 0)&&s.parent));)r=r.parent;return m.range(r.to,r.from)});return e(Ge(n,t)),!0},Md=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=m.create([t.main]):t.main.empty||(i=m.create([m.cursor(t.main.head)])),i?(e(Ge(n,i)),!0):!1};function Cn({state:n,dispatch:e},t){if(n.readOnly)return!1;let i="delete.selection",s=n.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=t(o);ao&&(i="delete.forward"),o=Math.min(o,a),l=Math.max(l,a)}return o==l?{range:r}:{changes:{from:o,to:l},range:m.cursor(o)}});return s.changes.empty?!1:(e(n.update(s,{scrollIntoView:!0,userEvent:i,effects:i=="delete.selection"?O.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function An(n,e,t){if(n instanceof O)for(let i of n.state.facet(O.atomicRanges).map(s=>s(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const ih=(n,e)=>Cn(n,t=>{let{state:i}=n,s=i.doc.lineAt(t),r,o;if(!e&&t>s.from&&tih(n,!1),nh=n=>ih(n,!0),sh=(n,e)=>Cn(n,t=>{let i=t,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=ve(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t)&&(l=c),i=a}return An(n,i,e)}),rh=n=>sh(n,!1),Dd=n=>sh(n,!0),oh=n=>Cn(n,e=>{let t=n.lineBlockAt(e).to;return An(n,eCn(n,e=>{let t=n.lineBlockAt(e).from;return An(n,e>t?t:Math.max(0,e-1),!1)}),Td=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:I.of(["",""])},range:m.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},Bd=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:ve(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:ve(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:m.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Mn(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function lh(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of Mn(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(m.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(m.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:m.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Pd=({state:n,dispatch:e})=>lh(n,e,!1),Ld=({state:n,dispatch:e})=>lh(n,e,!0);function ah(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Mn(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Rd=({state:n,dispatch:e})=>ah(n,e,!1),Ed=({state:n,dispatch:e})=>ah(n,e,!0),Id=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Mn(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Nd(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=de(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(L.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from?{from:i.to,to:s.from}:null}const Vd=hh(!1),Fd=hh(!0);function hh(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&Nd(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new wn(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=wa(h,r);for(c==null&&(c=/^\s*/.exec(e.doc.lineAt(r).text)[0].length);ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:m.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const Hd=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new wn(n,{overrideIndentation:r=>{let o=t[r];return o==null?-1:o}}),s=ir(n,(r,o,l)=>{let a=wa(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=sn(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(ir(n,(t,i)=>{i.push({from:t.from,insert:n.facet(bn)})}),{userEvent:"input.indent"})),!0),zd=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(ir(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=yi(s,n.tabSize),o=0,l=sn(n,Math.max(0,r-kt(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),vg=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:nd,shift:gd},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:sd,shift:md},{key:"Alt-ArrowUp",run:Pd},{key:"Shift-Alt-ArrowUp",run:Rd},{key:"Alt-ArrowDown",run:Ld},{key:"Shift-Alt-ArrowDown",run:Ed},{key:"Escape",run:Md},{key:"Mod-Enter",run:Fd},{key:"Alt-l",mac:"Ctrl-l",run:Cd},{key:"Mod-i",run:Ad,preventDefault:!0},{key:"Mod-[",run:zd},{key:"Mod-]",run:Wd},{key:"Mod-Alt-\\",run:Hd},{key:"Shift-Mod-k",run:Id},{key:"Shift-Mod-\\",run:ud},{key:"Mod-/",run:Nu},{key:"Alt-A",run:Fu}].concat($d);function ge(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class qt{constructor(e,t,i=0,s=e.length,r){this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?o=>r(Io(o)):Io,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return te(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Vs(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=ke(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o);if(a)return this.value=a,this;if(r==s.length-1)break;o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=on(this.text,s+(i==s?1:0)),i==this.curLine.length&&this.nextLine(),ithis.value.to)return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new Lt(t,e.sliceString(t,i));return Un.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t&&this.flat.tothis.flat.text.length-10&&(t=null),t){let i=this.flat.from+t.index,s=i+t[0].length;return this.value={from:i,to:s,match:t},this.matchPos=on(this.text,s+(i==s?1:0)),this}else{if(this.flat.to==this.to)return this.done=!0,this;this.flat=Lt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}}typeof Symbol<"u"&&(uh.prototype[Symbol.iterator]=dh.prototype[Symbol.iterator]=function(){return this});function jd(n){try{return new RegExp(n,nr),!0}catch{return!1}}function on(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function Es(n){let e=ge("input",{class:"cm-textfield",name:"line"}),t=ge("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:ln.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},ge("label",n.state.phrase("Go to line"),": ",e)," ",ge("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!s)return;let{state:r}=n,o=r.doc.lineAt(r.selection.main.head),[,l,a,h,c]=s,f=h?+h.slice(1):0,u=a?+a:o.number;if(a&&c){let p=u/100;l&&(p=p*(l=="-"?-1:1)+o.number/r.doc.lines),u=Math.round(r.doc.lines*p)}else a&&l&&(u=u*(l=="-"?-1:1)+o.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u)));n.dispatch({effects:ln.of(!1),selection:m.cursor(d.from+Math.max(0,Math.min(f,d.length))),scrollIntoView:!0}),n.focus()}return{dom:t}}const ln=R.define(),No=pe.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(ln)&&(n=t.value);return n},provide:n=>Zi.from(n,e=>e?Es:null)}),Ud=n=>{let e=Qi(n,Es);if(!e){let t=[ln.of(!0)];n.state.field(No,!1)==null&&t.push(R.appendConfig.of([No,Kd])),n.dispatch({effects:t}),e=Qi(n,Es)}return e&&e.dom.querySelector("input").focus(),!0},Kd=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Gd={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ph=D.define({combine(n){return $t(n,Gd,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Cg(n){let e=[Qd,_d];return n&&e.push(ph.of(n)),e}const Jd=T.mark({class:"cm-selectionMatch"}),Xd=T.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Vo(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=he.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=he.Word)}function Yd(n,e,t,i){return n(e.sliceDoc(t,t+1))==he.Word&&n(e.sliceDoc(i-1,i))==he.Word}const _d=fe.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(ph),{state:t}=n,i=t.selection;if(i.ranges.length>1)return T.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return T.none;let a=t.wordAt(s.head);if(!a)return T.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return T.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Vo(o,t,s.from,s.to)&&Yd(o,t,s.from,s.to)))return T.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return T.none}let l=[];for(let a of n.visibleRanges){let h=new qt(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Vo(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(Xd.range(c,f)):(c>=s.to||f<=s.from)&&l.push(Jd.range(c,f)),l.length>e.maxMatches))return T.none}}return T.set(l)}},{decorations:n=>n.decorations}),Qd=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Zd=({state:n,dispatch:e})=>{let{selection:t}=n,i=m.create(t.ranges.map(s=>n.wordAt(s.head)||m.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function ep(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new qt(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new qt(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const tp=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return Zd({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=ep(n,i);return s?(e(n.update({selection:n.selection.addRange(m.range(s.from,s.to),!1),effects:O.scrollIntoView(s.to)})),!0):!1},sr=D.define({combine(n){var e;return{top:n.reduce((t,i)=>t!=null?t:i.top,void 0)||!1,caseSensitive:n.reduce((t,i)=>t!=null?t:i.caseSensitive,void 0)||!1,literal:n.reduce((t,i)=>t!=null?t:i.literal,void 0)||!1,createPanel:((e=n.find(t=>t.createPanel))===null||e===void 0?void 0:e.createPanel)||(t=>new cp(t))}}});class gh{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||jd(this.search)),this.unquoted=this.literal?this.search:this.search.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp}create(){return this.regexp?new np(this):new ip(this)}getCursor(e,t=0,i=e.length){return this.regexp?Ot(this,e,t,i):Dt(this,e,t,i)}}class mh{constructor(e){this.spec=e}}function Dt(n,e,t,i){return new qt(e,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase())}class ip extends mh{constructor(e){super(e)}nextMatch(e,t,i){let s=Dt(this.spec,e,i,e.length).nextOverlapping();return s.done&&(s=Dt(this.spec,e,0,t).nextOverlapping()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=Dt(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let i=Dt(this.spec,e,0,e.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Dt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Ot(n,e,t,i){return new uh(e,n.search,n.caseSensitive?void 0:{ignoreCase:!0},t,i)}class np extends mh{nextMatch(e,t,i){let s=Ot(this.spec,e,i,e.length).next();return s.done&&(s=Ot(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Ot(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Ot(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const gi=R.define(),rr=R.define(),st=pe.define({create(n){return new Kn(Is(n).create(),null)},update(n,e){for(let t of e.effects)t.is(gi)?n=new Kn(t.value.create(),n.panel):t.is(rr)&&(n=new Kn(n.query,t.value?or:null));return n},provide:n=>Zi.from(n,e=>e.panel)});class Kn{constructor(e,t){this.query=e,this.panel=t}}const sp=T.mark({class:"cm-searchMatch"}),rp=T.mark({class:"cm-searchMatch cm-searchMatch-selected"}),op=fe.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(st))}update(n){let e=n.state.field(st);(e!=n.startState.field(st)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return T.none;let{view:t}=this,i=new bt;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state.doc,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?rp:sp)})}return i.finish()}},{decorations:n=>n.decorations});function wi(n){return e=>{let t=e.state.field(st,!1);return t&&t.query.spec.valid?n(e,t):yh(e)}}const an=wi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state.doc,t,t);return i?(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:lr(n,i),userEvent:"select.search"}),!0):!1}),hn=wi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t.doc,i,i);return s?(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:lr(n,s),userEvent:"select.search"}),!0):!1}),lp=wi((n,{query:e})=>{let t=e.matchAll(n.state.doc,1e3);return!t||!t.length?!1:(n.dispatch({selection:m.create(t.map(i=>m.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),ap=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new qt(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(m.range(l.value.from,l.value.to))}return e(n.update({selection:m.create(r,o),userEvent:"select.search.matches"})),!0},Fo=wi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t.doc,i,i);if(!r)return!1;let o=[],l,a,h=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t.doc,r.from,r.to),h.push(O.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l={anchor:r.from-c,head:r.to-c},h.push(lr(n,r))}return n.dispatch({changes:o,selection:l,scrollIntoView:!!l,effects:h,userEvent:"input.replace"}),!0}),hp=wi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state.doc,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:O.announce.of(i),userEvent:"input.replace.all"}),!0});function or(n){return n.state.facet(sr).createPanel(n)}function Is(n,e){var t,i,s;let r=n.selection.main,o=r.empty||r.to>r.from+100?"":n.sliceDoc(r.from,r.to);if(e&&!o)return e;let l=n.facet(sr);return new gh({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:l.literal)?o:o.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:l.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:l.literal})}const yh=n=>{let e=n.state.field(st,!1);if(e&&e.panel){let t=Qi(n,or);if(!t)return!1;let i=t.dom.querySelector("[main-field]");if(i&&i!=n.root.activeElement){let s=Is(n.state,e.query.spec);s.valid&&n.dispatch({effects:gi.of(s)}),i.focus(),i.select()}}else n.dispatch({effects:[rr.of(!0),e?gi.of(Is(n.state,e.query.spec)):R.appendConfig.of(up)]});return!0},bh=n=>{let e=n.state.field(st,!1);if(!e||!e.panel)return!1;let t=Qi(n,or);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:rr.of(!1)}),!0},Ag=[{key:"Mod-f",run:yh,scope:"editor search-panel"},{key:"F3",run:an,shift:hn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:an,shift:hn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:bh,scope:"editor search-panel"},{key:"Mod-Shift-l",run:ap},{key:"Alt-g",run:Ud},{key:"Mod-d",run:tp,preventDefault:!0}];class cp{constructor(e){this.view=e;let t=this.query=e.state.field(st).query.spec;this.commit=this.commit.bind(this),this.searchField=ge("input",{value:t.search,placeholder:Ce(e,"Find"),"aria-label":Ce(e,"Find"),class:"cm-textfield",name:"search","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ge("input",{value:t.replace,placeholder:Ce(e,"Replace"),"aria-label":Ce(e,"Replace"),class:"cm-textfield",name:"replace",onchange:this.commit,onkeyup:this.commit}),this.caseField=ge("input",{type:"checkbox",name:"case",checked:t.caseSensitive,onchange:this.commit}),this.reField=ge("input",{type:"checkbox",name:"re",checked:t.regexp,onchange:this.commit});function i(s,r,o){return ge("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=ge("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>an(e),[Ce(e,"next")]),i("prev",()=>hn(e),[Ce(e,"previous")]),i("select",()=>lp(e),[Ce(e,"all")]),ge("label",null,[this.caseField,Ce(e,"match case")]),ge("label",null,[this.reField,Ce(e,"regexp")]),...e.state.readOnly?[]:[ge("br"),this.replaceField,i("replace",()=>Fo(e),[Ce(e,"replace")]),i("replaceAll",()=>hp(e),[Ce(e,"replace all")]),ge("button",{name:"close",onclick:()=>bh(e),"aria-label":Ce(e,"close"),type:"button"},["\xD7"])]])}commit(){let e=new gh({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:gi.of(e)}))}keydown(e){df(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?hn:an)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Fo(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(gi)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(sr).top}}function Ce(n,e){return n.state.phrase(e)}const Ii=30,Ni=/[\s\.,:;?!]/;function lr(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Ii),o=Math.min(s,t+Ii),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-Ii;a--)if(!Ni.test(l[a-1])&&Ni.test(l[a])){l=l.slice(0,a);break}}return O.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const fp=O.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),up=[st,St.lowest(op),fp];class wh{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=de(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(xh(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Ho(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function dp(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:dp(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function Mg(n,e){return t=>{for(let i=de(t.state).resolveInner(t.pos,-1);i;i=i.parent)if(n.indexOf(i.name)>-1)return null;return e(t)}}class Wo{constructor(e,t,i){this.completion=e,this.source=t,this.match=i}}function rt(n){return n.selection.main.head}function xh(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}function gp(n,e,t,i){return Object.assign(Object.assign({},n.changeByRange(s=>{if(s==n.selection.main)return{changes:{from:t,to:i,insert:e},range:m.cursor(t+e.length)};let r=i-t;return!s.empty||r&&n.sliceDoc(s.from-r,s.from)!=n.sliceDoc(t,i)?{range:s}:{changes:{from:s.from-r,to:s.from,insert:e},range:m.cursor(s.from-r+e.length)}})),{userEvent:"input.complete"})}function kh(n,e){const t=e.completion.apply||e.completion.label;let i=e.source;typeof t=="string"?n.dispatch(gp(n.state,t,i.from,i.to)):t(n,e.completion,i.from,i.to)}const zo=new WeakMap;function mp(n){if(!Array.isArray(n))return n;let e=zo.get(n);return e||zo.set(n,e=pp(n)),e}class yp{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let t=0;t=48&&C<=57||C>=97&&C<=122?2:C>=65&&C<=90?1:0:(M=Vs(C))!=M.toLowerCase()?1:M!=M.toUpperCase()?2:0;(!S||B==1&&y||k==0&&B!=0)&&(t[f]==C||i[f]==C&&(u=!0)?o[f++]=S:o.length&&(b=!1)),k=B,S+=ke(C)}return f==a&&o[0]==0&&b?this.result(-100+(u?-200:0),o,e):d==a&&p==0?[-200-e.length,0,g]:l>-1?[-700-e.length,l,l+this.pattern.length]:d==a?[-200+-700-e.length,p,g]:f==a?this.result(-100+(u?-200:0)+-700+(b?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[e-i.length],r=1;for(let o of t){let l=o+(this.astral?ke(te(i,o)):1);r>1&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return s}}const Ke=D.define({combine(n){return $t(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],compareCompletions:(e,t)=>e.label.localeCompare(t.label)},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,optionClass:(e,t)=>i=>bp(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function bp(n,e){return n?e?n+" "+e:n:e}function wp(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let{label:o}=t,l=0;for(let a=1;al&&r.appendChild(document.createTextNode(o.slice(l,h)));let f=r.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,c))),f.className="cm-completionMatchedText",l=c}return lt.position-i.position).map(t=>t.render)}function qo(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class xp{constructor(e,t){this.view=e,this.stateField=t,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:l=>this.positionInfo(l),key:this};let i=e.state.field(t),{options:s,selected:r}=i.open,o=e.state.facet(Ke);this.optionContent=wp(o),this.optionClass=o.optionClass,this.range=qo(s.length,r,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.dom.addEventListener("mousedown",l=>{for(let a=l.target,h;a&&a!=this.dom;a=a.parentNode)if(a.nodeName=="LI"&&(h=/-(\d+)$/.exec(a.id))&&+h[1]{this.info&&this.view.requestMeasure(this.placeInfo)})}mount(){this.updateSel()}update(e){e.state.field(this.stateField)!=e.startState.field(this.stateField)&&this.updateSel()}positioned(){this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected=this.range.to)&&(this.range=qo(t.options.length,t.selected,this.view.state.facet(Ke).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})),this.updateSelectedOption(t.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o)}).catch(o=>Re(this.view.state,o,"completion info")):this.addInfoPane(r)}}addInfoPane(e){let t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&Sp(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect();if(s.top>Math.min(innerHeight,t.bottom)-10||s.bottomnew xp(e,n)}function Sp(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect();i.topt.bottom&&(n.scrollTop+=i.bottom-t.bottom)}function $o(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function vp(n,e){let t=[],i=0;for(let l of n)if(l.hasResult())if(l.result.filter===!1){let a=l.result.getMatch;for(let h of l.result.options){let c=[1e9-i++];if(a)for(let f of a(h))c.push(f);t.push(new Wo(h,l,c))}}else{let a=new yp(e.sliceDoc(l.from,l.to)),h;for(let c of l.result.options)(h=a.match(c.label))&&(c.boost!=null&&(h[0]+=c.boost),t.push(new Wo(c,l,h)))}let s=[],r=null,o=e.facet(Ke).compareCompletions;for(let l of t.sort((a,h)=>h.match[0]-a.match[0]||o(a.completion,h.completion)))!r||r.label!=l.completion.label||r.detail!=l.completion.detail||r.type!=null&&l.completion.type!=null&&r.type!=l.completion.type||r.apply!=l.completion.apply?s.push(l):$o(l.completion)>$o(r)&&(s[s.length-1]=l),r=l.completion;return s}class ri{constructor(e,t,i,s,r){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new ri(this.options,jo(t,e),this.tooltip,this.timestamp,e)}static build(e,t,i,s,r){let o=vp(e,t);if(!o.length)return null;let l=t.facet(Ke).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(a,h.from):a,1e8),create:kp(Ae),above:r.aboveCursor},s?s.timestamp:Date.now(),l)}map(e){return new ri(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}class cn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new cn(Mp,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Ke),r=(i.override||t.languageDataAt("autocomplete",rt(t)).map(mp)).map(l=>(this.active.find(h=>h.source==l)||new me(l,this.active.some(h=>h.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!Cp(r,this.active)?ri.build(r,t,this.id,this.open,i):this.open&&e.docChanged?this.open.map(e.changes):this.open;!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new me(l.source,0):l));for(let l of e.effects)l.is(vh)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new cn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Ap}}function Cp(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const Mp=[];function Ns(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class me{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Ns(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new me(s.source,0));for(let r of e.effects)if(r.is(ar))s=new me(s.source,1,r.value?rt(e.state):-1);else if(r.is(fn))s=new me(s.source,0);else if(r.is(Sh))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new me(this.source,1)}handleChange(e){return e.changes.touchesRange(rt(e.startState))?new me(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new me(this.source,this.state,e.mapPos(this.explicitPos))}}class oi extends me{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=rt(e.state);if((this.explicitPos<0?l<=r:lo||t=="delete"&&rt(e.startState)==this.from)return new me(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return Dp(this.result.validFor,e.state,r,o)?new oi(this.source,a,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new wh(e.state,l,a>=0)))?new oi(this.source,a,h,h.from,(s=h.to)!==null&&s!==void 0?s:rt(e.state)):new me(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new me(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new oi(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function Dp(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):xh(n,!0).test(s)}const ar=R.define(),fn=R.define(),Sh=R.define({map(n,e){return n.map(t=>t.map(e))}}),vh=R.define(),Ae=pe.define({create(){return cn.start()},update(n,e){return n.update(e)},provide:n=>[aa.from(n,e=>e.tooltip),O.contentAttributes.from(n,e=>e.attrs)]}),Ch=75;function Vi(n,e="option"){return t=>{let i=t.state.field(Ae,!1);if(!i||!i.open||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:vh.of(l)}),!0}}const Op=n=>{let e=n.state.field(Ae,!1);return n.state.readOnly||!e||!e.open||Date.now()-e.open.timestampn.state.field(Ae,!1)?(n.dispatch({effects:ar.of(!0)}),!0):!1,Bp=n=>{let e=n.state.field(Ae,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:fn.of(null)}),!0)};class Pp{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Uo=50,Lp=50,Rp=1e3,Ep=fe.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Ae).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Ae);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Ae)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Ns(i));for(let i=0;iLp&&Date.now()-s.time>Rp){for(let r of s.context.abortListeners)try{r()}catch(o){Re(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),Uo):-1,this.composing!=0)for(let i of n.transactions)Ns(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Ae);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=rt(e),i=new wh(e,t,n.explicitPos==t),s=new Pp(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:fn.of(null)}),Re(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),Uo))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Ke);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new me(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:Sh.of(e)})}},{eventHandlers:{blur(){let n=this.view.state.field(Ae,!1);n&&n.tooltip&&this.view.state.facet(Ke).closeOnBlur&&this.view.dispatch({effects:fn.of(null)})},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ar.of(!1)}),20),this.composing=0}}}),Ah=O.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Ip{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class hr{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,oe.TrackDel),i=e.mapPos(this.to,1,oe.TrackDel);return t==null||i==null?null:new hr(this.field,t,i)}}class cr{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;fnew hr(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1;for(let c=0;c=h&&f.field++}s.push(new Ip(h,i.length,r.index,r.index+a.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}for(let l;l=/([$#])\\{/.exec(o);){o=o.slice(0,l.index)+l[1]+"{"+o.slice(l.index+l[0].length);for(let a of s)a.line==i.length&&a.from>l.index&&(a.from--,a.to--)}i.push(o)}return new cr(i,s)}}let Np=T.widget({widget:new class extends ht{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),Vp=T.mark({class:"cm-snippetField"});class Ut{constructor(e,t){this.ranges=e,this.active=t,this.deco=T.set(e.map(i=>(i.from==i.to?Np:Vp).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new Ut(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const xi=R.define({map(n,e){return n&&n.map(e)}}),Fp=R.define(),mi=pe.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(xi))return t.value;if(t.is(Fp)&&n)return new Ut(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>O.decorations.from(n,e=>e?e.deco:T.none)});function fr(n,e){return m.create(n.filter(t=>t.field==e).map(t=>m.range(t.from,t.to)))}function Hp(n){let e=cr.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),a={changes:{from:s,to:r,insert:I.of(o)},scrollIntoView:!0};if(l.length&&(a.selection=fr(l,0)),l.length>1){let h=new Ut(l,0),c=a.effects=[xi.of(h)];t.state.field(mi,!1)===void 0&&c.push(R.appendConfig.of([mi,jp,Up,Ah]))}t.dispatch(t.state.update(a))}}function Mh(n){return({state:e,dispatch:t})=>{let i=e.field(mi,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:fr(i.ranges,s),effects:xi.of(r?null:new Ut(i.ranges,s))})),!0}}const Wp=({state:n,dispatch:e})=>n.field(mi,!1)?(e(n.update({effects:xi.of(null)})),!0):!1,zp=Mh(1),qp=Mh(-1),$p=[{key:"Tab",run:zp,shift:qp},{key:"Escape",run:Wp}],Ko=D.define({combine(n){return n.length?n[0]:$p}}),jp=St.highest(Ks.compute([Ko],n=>n.facet(Ko)));function Dg(n,e){return Object.assign(Object.assign({},e),{apply:Hp(n)})}const Up=O.domEventHandlers({mousedown(n,e){let t=e.state.field(mi,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:fr(t.ranges,s.field),effects:xi.of(t.ranges.some(r=>r.field>s.field)?new Ut(t.ranges,s.field):null)}),!0)}}),un={brackets:["(","[","{","'",'"'],before:")]}:;>"},gt=R.define({map(n,e){let t=e.mapPos(n,-1,oe.TrackAfter);return t==null?void 0:t}}),ur=R.define({map(n,e){return e.mapPos(n)}}),dr=new class extends yt{};dr.startSide=1;dr.endSide=-1;const Dh=pe.define({create(){return $.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=$.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(gt)?n=n.update({add:[dr.range(t.value,t.value+1)]}):t.is(ur)&&(n=n.update({filter:i=>i!=t.value}));return n}});function Og(){return[Gp,Dh]}const Gn="()[]{}<>";function Oh(n){for(let e=0;e{if((Kp?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&ke(te(i,0))==1||e!=s.from||t!=s.to)return!1;let r=Xp(n.state,i);return r?(n.dispatch(r),!0):!1}),Jp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Th(n,n.selection.main.head).brackets||un.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=Yp(n.doc,o.head);for(let a of i)if(a==l&&Dn(n.doc,o.head)==Oh(te(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:m.cursor(o.head-a.length),userEvent:"delete.backward"}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0})),!s},Tg=[{key:"Backspace",run:Jp}];function Xp(n,e){let t=Th(n,n.selection.main.head),i=t.brackets||un.brackets;for(let s of i){let r=Oh(te(s,0));if(e==s)return r==s?Zp(n,s,i.indexOf(s+s+s)>-1):_p(n,s,r,t.before||un.before);if(e==r&&Bh(n,n.selection.main.from))return Qp(n,s,r)}return null}function Bh(n,e){let t=!1;return n.field(Dh).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Dn(n,e){let t=n.sliceString(e,e+2);return t.slice(0,ke(te(t,0)))}function Yp(n,e){let t=n.sliceString(e-2,e);return ke(te(t,0))==t.length?t:t.slice(1)}function _p(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:gt.of(o.to+e.length),range:m.range(o.anchor+e.length,o.head+e.length)};let l=Dn(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:gt.of(o.head+e.length),range:m.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Qp(n,e,t){let i=null,s=n.selection.ranges.map(r=>r.empty&&Dn(n.doc,r.head)==t?m.cursor(r.head+t.length):i=r);return i?null:n.update({selection:m.create(s,n.selection.mainIndex),scrollIntoView:!0,effects:n.selection.ranges.map(({from:r})=>ur.of(r))})}function Zp(n,e,t){let i=null,s=n.changeByRange(r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:e,from:r.to}],effects:gt.of(r.to+e.length),range:m.range(r.anchor+e.length,r.head+e.length)};let o=r.head,l=Dn(n.doc,o);if(l==e){if(Go(n,o))return{changes:{insert:e+e,from:o},effects:gt.of(o+e.length),range:m.cursor(o+e.length)};if(Bh(n,o)){let a=t&&n.sliceDoc(o,o+e.length*3)==e+e+e;return{range:m.cursor(o+e.length*(a?3:1)),effects:ur.of(o)}}}else{if(t&&n.sliceDoc(o-2*e.length,o)==e+e&&Go(n,o-2*e.length))return{changes:{insert:e+e+e+e,from:o},effects:gt.of(o+e.length),range:m.cursor(o+e.length)};if(n.charCategorizer(o)(l)!=he.Word){let a=n.sliceDoc(o-1,o);if(a!=e&&n.charCategorizer(o)(a)!=he.Word&&!eg(n,o,e))return{changes:{insert:e+e,from:o},effects:gt.of(o+e.length),range:m.cursor(o+e.length)}}}return{range:i=r}});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Go(n,e){let t=de(n).resolveInner(e+1);return t.parent&&t.from==e}function eg(n,e,t){let i=de(n).resolveInner(e,-1);for(let s=0;s<5;s++){if(n.sliceDoc(i.from,i.from+t.length)==t){let o=i.firstChild;for(;o&&o.from==i.from&&o.to-o.from>t.length;){if(n.sliceDoc(o.to-t.length,o.to)==t)return!1;o=o.firstChild}return!0}let r=i.to==e&&i.parent;if(!r)break;i=r}return!1}function Bg(n={}){return[Ae,Ke.of(n),Ep,ig,Ah]}const tg=[{key:"Ctrl-Space",run:Tp},{key:"Escape",run:Bp},{key:"ArrowDown",run:Vi(!0)},{key:"ArrowUp",run:Vi(!1)},{key:"PageDown",run:Vi(!0,"page")},{key:"PageUp",run:Vi(!1,"page")},{key:"Enter",run:Op}],ig=St.highest(Ks.computeN([Ke],n=>n.facet(Ke).defaultKeymap?[tg]:[]));export{gg as A,mg as B,dn as C,$f as D,O as E,yg as F,ug as G,de as H,K as I,Mg as J,pp as K,Ds as L,m as M,Gs as N,pg as O,ua as P,dg as Q,Dg as R,Da as S,F as T,hg as U,N as a,rg as b,kg as c,ng as d,sg as e,wg as f,xg as g,ag as h,Og as i,Cg as j,Ks as k,Tg as l,vg as m,Ag as n,Sg as o,tg as p,Bg as q,lg as r,bg as s,og as t,ue as u,L as v,ru as w,x,cg as y,uu as z}; diff --git a/ui/dist/assets/index.b371ee76.js b/ui/dist/assets/index.f4f9f1ef.js similarity index 73% rename from ui/dist/assets/index.b371ee76.js rename to ui/dist/assets/index.f4f9f1ef.js index d0c85a0c..f82904b8 100644 --- a/ui/dist/assets/index.b371ee76.js +++ b/ui/dist/assets/index.f4f9f1ef.js @@ -1,55 +1,55 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function oe(){}const gl=n=>n;function ft(n,e){for(const t in e)n[t]=e[t];return n}function pm(n){return n()}function Ga(){return Object.create(null)}function Ge(n){n.forEach(pm)}function Kn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ll;function xn(n,e){return Ll||(Ll=document.createElement("a")),Ll.href=e,n===Ll.href}function W_(n){return Object.keys(n).length===0}function hm(n,...e){if(n==null)return oe;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function _t(n,e,t){n.$$.on_destroy.push(hm(e,t))}function wn(n,e,t,i){if(n){const s=mm(n,e,t,i);return n[0](s)}}function mm(n,e,t,i){return n[1]&&i?ft(t.ctx.slice(),n[1](i(e))):t.ctx}function $n(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ra=gm?n=>requestAnimationFrame(n):oe;const bs=new Set;function _m(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&ra(_m)}function Io(n){let e;return bs.size===0&&ra(_m),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function m(n,e){n.appendChild(e)}function bm(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Y_(n){const e=_("style");return K_(bm(n),e),e.sheet}function K_(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function xt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Kt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function ei(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function vm(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function di(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function At(n){return n===""?null:+n}function J_(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Me(n,e){n.value=e==null?"":e}function Qa(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ie(n,e,t){n.classList[t?"add":"remove"](e)}function ym(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}const ao=new Map;let uo=0;function Z_(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function G_(n,e){const t={stylesheet:Y_(e),rules:{}};return ao.set(n,t),t}function ol(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function oe(){}const gl=n=>n;function at(n,e){for(const t in e)n[t]=e[t];return n}function pm(n){return n()}function Ga(){return Object.create(null)}function Ge(n){n.forEach(pm)}function Kn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ll;function xn(n,e){return Ll||(Ll=document.createElement("a")),Ll.href=e,n===Ll.href}function W_(n){return Object.keys(n).length===0}function hm(n,...e){if(n==null)return oe;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function bt(n,e,t){n.$$.on_destroy.push(hm(e,t))}function wn(n,e,t,i){if(n){const s=mm(n,e,t,i);return n[0](s)}}function mm(n,e,t,i){return n[1]&&i?at(t.ctx.slice(),n[1](i(e))):t.ctx}function $n(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ra=gm?n=>requestAnimationFrame(n):oe;const bs=new Set;function _m(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&ra(_m)}function Io(n){let e;return bs.size===0&&ra(_m),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function m(n,e){n.appendChild(e)}function bm(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Y_(n){const e=_("style");return K_(bm(n),e),e.sheet}function K_(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function Qt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Yt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function ei(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function vm(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function di(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function Pt(n){return n===""?null:+n}function J_(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Te(n,e){n.value=e==null?"":e}function Qa(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ie(n,e,t){n.classList[t?"add":"remove"](e)}function ym(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}const ao=new Map;let uo=0;function Z_(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function G_(n,e){const t={stylesheet:Y_(e),rules:{}};return ao.set(n,t),t}function ol(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ `;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}} `}const f=u+`100% {${o(t,1-t)}} -}`,c=`__svelte_${Z_(f)}_${r}`,d=bm(n),{stylesheet:h,rules:g}=ao.get(d)||G_(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,uo+=1,c}function rl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),uo-=s,uo||X_())}function X_(){ra(()=>{uo||(ao.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),ao.clear())})}function Q_(n,e,t,i){if(!e)return oe;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return oe;const{delay:l=0,duration:o=300,easing:r=gl,start:a=Lo()+l,end:u=a+o,tick:f=oe,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function v(){c&&(g=ol(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&rl(n,g),d=!1}return Io(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const C=y-a,S=0+1*r(C/o);f(S,1-S)}return!0}),v(),f(0,1),b}function x_(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,km(n,s)}}function km(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let al;function Xs(n){al=n}function Fo(){if(!al)throw new Error("Function called outside component initialization");return al}function Jn(n){Fo().$$.on_mount.push(n)}function eb(n){Fo().$$.after_update.push(n)}function tb(n){Fo().$$.on_destroy.push(n)}function on(){const n=Fo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=ym(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function rt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ys=[],de=[],no=[],Or=[],wm=Promise.resolve();let Er=!1;function $m(){Er||(Er=!0,wm.then(Sm))}function ii(){return $m(),wm}function Tt(n){no.push(n)}function He(n){Or.push(n)}const xo=new Set;let Il=0;function Sm(){const n=al;do{for(;Il{Is=null})),Is}function ts(n,e,t){n.dispatchEvent(ym(`${e?"intro":"outro"}${t}`))}const io=new Set;let ai;function Ae(){ai={r:0,c:[],p:ai}}function Pe(){ai.r||Ge(ai.c),ai=ai.p}function A(n,e){n&&n.i&&(io.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),ai.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ua={duration:0};function Cm(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&rl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=gl,tick:g=oe,css:v}=i||ua;v&&(l=ol(n,0,1,d,c,h,v,r++)),g(0,1);const b=Lo()+c,y=b+d;o&&o.abort(),s=!0,Tt(()=>ts(n,!0,"start")),o=Io(C=>{if(s){if(C>=y)return g(1,0),ts(n,!0,"end"),a(),s=!1;if(C>=b){const S=h((C-b)/d);g(S,1-S)}}return s})}let f=!1;return{start(){f||(f=!0,rl(n),Kn(i)?(i=i(),aa().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Mm(n,e,t){let i=e(n,t),s=!0,l;const o=ai;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=gl,tick:c=oe,css:d}=i||ua;d&&(l=ol(n,1,0,u,a,f,d));const h=Lo()+a,g=h+u;Tt(()=>ts(n,!1,"start")),Io(v=>{if(s){if(v>=g)return c(0,1),ts(n,!1,"end"),--o.r||Ge(o.c),!1;if(v>=h){const b=f((v-h)/u);c(1-b,b)}}return s})}return Kn(i)?aa().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&rl(n,l),s=!1)}}}function ot(n,e,t,i){let s=e(n,t),l=i?0:1,o=null,r=null,a=null;function u(){a&&rl(n,a)}function f(d,h){const g=d.b-l;return h*=Math.abs(g),{a:l,b:d.b,d:g,duration:h,start:d.start,end:d.start+h,group:d.group}}function c(d){const{delay:h=0,duration:g=300,easing:v=gl,tick:b=oe,css:y}=s||ua,C={start:Lo()+h,b:d};d||(C.group=ai,ai.r+=1),o||r?r=C:(y&&(u(),a=ol(n,l,d,g,h,v,y)),d&&b(0,1),o=f(C,g),Tt(()=>ts(n,d,"start")),Io(S=>{if(r&&S>r.start&&(o=f(r,g),r=null,ts(n,o.b,"start"),y&&(u(),a=ol(n,l,o.b,o.duration,0,v,s.css))),o){if(S>=o.end)b(l=o.b,1-l),ts(n,o.b,"end"),r||(o.b?u():--o.group.r||Ge(o.group.c)),o=null;else if(S>=o.start){const $=S-o.start;l=o.a+o.d*v($/o.duration),b(l,1-l)}}return!!(o||r)}))}return{run(d){Kn(s)?aa().then(()=>{s=s(),c(d)}):c(d)},end(){u(),o=r=null}}}function Mn(n,e){n.d(1),e.delete(n.key)}function Gt(n,e){P(n,1,1,()=>{e.delete(n.key)})}function ib(n,e){n.f(),Gt(n,e)}function vt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=l.length,g=d;const v={};for(;g--;)v[n[g].key]=g;const b=[],y=new Map,C=new Map;for(g=h;g--;){const D=c(s,l,g),E=t(D);let O=o.get(E);O?i&&O.p(D,e):(O=u(E,D),O.c()),y.set(E,b[g]=O),E in v&&C.set(E,Math.abs(g-v[E]))}const S=new Set,$=new Set;function M(D){A(D,1),D.m(r,f),o.set(D.key,D),f=D.first,h--}for(;d&&h;){const D=b[h-1],E=n[d-1],O=D.key,L=E.key;D===E?(f=D.first,d--,h--):y.has(L)?!o.has(O)||S.has(O)?M(D):$.has(L)?d--:C.get(O)>C.get(L)?($.add(O),M(D)):(S.add(L),d--):(a(E,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;h;)M(b[h-1]);return b}function pn(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function si(n){return typeof n=="object"&&n!==null?n:{}}function Ie(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function V(n){n&&n.c()}function j(n,e,t,i){const{fragment:s,on_mount:l,on_destroy:o,after_update:r}=n.$$;s&&s.m(e,t),i||Tt(()=>{const a=l.map(pm).filter(Kn);o?o.push(...a):Ge(a),n.$$.on_mount=[]}),r.forEach(Tt)}function q(n,e){const t=n.$$;t.fragment!==null&&(Ge(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function sb(n,e){n.$$.dirty[0]===-1&&(Ys.push(n),$m(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const g=h.length?h[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&sb(n,c)),d}):[],u.update(),f=!0,Ge(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=J_(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),j(n,e.target,e.anchor,e.customElement),Sm()}Xs(a)}class Ee{$destroy(){q(this,1),this.$destroy=oe}$on(e,t){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!W_(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function en(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t{i.delete(u),i.size===0&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function Dm(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return Tm(t,o=>{let r=!1;const a=[];let u=0,f=oe;const c=()=>{if(u)return;f();const h=e(i?a[0]:a,o);l?o(h):f=Kn(h)?h:oe},d=s.map((h,g)=>hm(h,v=>{a[g]=v,u&=~(1<{u|=1<{q(f,1)}),Pe()}l?(e=new l(o()),e.$on("routeEvent",r[7]),V(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function ob(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r){let a={};for(let u=0;u{q(f,1)}),Pe()}l?(e=new l(o()),e.$on("routeEvent",r[6]),V(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function rb(n){let e,t,i,s;const l=[ob,lb],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(Ae(),P(o[f],1,1,()=>{o[f]=null}),Pe(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function xa(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const No=Tm(null,function(e){e(xa());const t=()=>{e(xa())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Dm(No,n=>n.location);const Ro=Dm(No,n=>n.querystring),eu=li(void 0);async function Si(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await ii();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function mn(n,e){if(e=nu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return tu(n,e),{update(t){t=nu(t),tu(n,t)}}}function ab(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function tu(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||ub(i.currentTarget.getAttribute("href"))})}function nu(n){return n&&typeof n=="string"?{href:n}:n||{}}function ub(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function fb(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(M,D){if(!D||typeof D!="function"&&(typeof D!="object"||D._sveltesparouter!==!0))throw Error("Invalid component object");if(!M||typeof M=="string"&&(M.length<1||M.charAt(0)!="/"&&M.charAt(0)!="*")||typeof M=="object"&&!(M instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:E,keys:O}=Om(M);this.path=M,typeof D=="object"&&D._sveltesparouter===!0?(this.component=D.component,this.conditions=D.conditions||[],this.userData=D.userData,this.props=D.props||{}):(this.component=()=>Promise.resolve(D),this.conditions=[],this.props={}),this._pattern=E,this._keys=O}match(M){if(s){if(typeof s=="string")if(M.startsWith(s))M=M.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const L=M.match(s);if(L&&L[0])M=M.substr(L[0].length)||"/";else return null}}const D=this._pattern.exec(M);if(D===null)return null;if(this._keys===!1)return D;const E={};let O=0;for(;O{r.push(new o(M,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,u=null,f={};const c=on();async function d($,M){await ii(),c($,M)}let h=null,g=null;l&&(g=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?h=$.state:h=null},window.addEventListener("popstate",g),eb(()=>{ab(h)}));let v=null,b=null;const y=No.subscribe(async $=>{v=$;let M=0;for(;M{eu.set(u)});return}t(0,a=null),b=null,eu.set(void 0)});tb(()=>{y(),g&&window.removeEventListener("popstate",g)});function C($){rt.call(this,n,$)}function S($){rt.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,s=$.prefix),"restoreScrollState"in $&&t(5,l=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,C,S]}class cb extends Ee{constructor(e){super(),Oe(this,e,fb,rb,De,{routes:3,prefix:4,restoreScrollState:5})}}const so=[];let Em;function Am(n){const e=n.pattern.test(Em);iu(n,n.className,e),iu(n,n.inactiveClassName,!e)}function iu(n,e,t){(e||"").split(" ").forEach(i=>{!i||(n.node.classList.remove(i),t&&n.node.classList.add(i))})}No.subscribe(n=>{Em=n.location+(n.querystring?"?"+n.querystring:""),so.map(Am)});function jn(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?Om(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return so.push(i),Am(i),{destroy(){so.splice(so.indexOf(i),1)}}}const db="modulepreload",pb=function(n,e){return new URL(n,e).href},su={},Ai=function(e,t,i){return!t||t.length===0?e():Promise.all(t.map(s=>{if(s=pb(s,i),s in su)return;su[s]=!0;const l=s.endsWith(".css"),o=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${o}`))return;const r=document.createElement("link");if(r.rel=l?"stylesheet":db,l||(r.as="script",r.crossOrigin=""),r.href=s,document.head.appendChild(r),l)return new Promise((a,u)=>{r.addEventListener("load",a),r.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e())};var Ar=function(n,e){return Ar=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},Ar(n,e)};function ln(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}Ar(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Pr=function(){return Pr=Object.assign||function(n){for(var e,t=1,i=arguments.length;t0&&s[s.length-1])||f[0]!==6&&f[0]!==2)){o=0;continue}if(f[0]===3&&(!s||f[1]>s[0]&&f[1]0&&(!i.exp||i.exp-t>Date.now()/1e3))},n}(),mb=function(){function n(){this.baseToken="",this.baseModel={},this._onChangeCallbacks=[]}return Object.defineProperty(n.prototype,"token",{get:function(){return this.baseToken},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.baseModel},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isValid",{get:function(){return!hb.isExpired(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this.baseToken=e,this.baseModel=t,this.triggerChange()},n.prototype.clear=function(){this.baseToken="",this.baseModel={},this.triggerChange()},n.prototype.onChange=function(e){var t=this;return this._onChangeCallbacks.push(e),function(){for(var i=t._onChangeCallbacks.length-1;i>=0;i--)if(t._onChangeCallbacks[i]==e)return delete t._onChangeCallbacks[i],void t._onChangeCallbacks.splice(i,1)}},n.prototype.triggerChange=function(){for(var e=0,t=this._onChangeCallbacks;e0?n:1,this.perPage=e>=0?e:0,this.totalItems=t>=0?t:0,this.totalPages=i>=0?i:0,this.items=s||[]},Fm=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype._getFullList=function(t,i,s){var l=this;i===void 0&&(i=100),s===void 0&&(s={});var o=[],r=function(a){return ns(l,void 0,void 0,function(){return is(this,function(u){return[2,this._getList(t,a,i,s).then(function(f){var c=f,d=c.items,h=c.totalItems;return o=o.concat(d),d.length&&h>o.length?r(a+1):o})]})})};return r(1)},e.prototype._getList=function(t,i,s,l){var o=this;return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),l=Object.assign({page:i,perPage:s},l),this.client.send(t,{method:"GET",params:l}).then(function(r){var a=[];if(r!=null&&r.items){r.items=r.items||[];for(var u=0,f=r.items;u=400)throw new lu({url:$.url,status:$.status,data:M});return[2,M]}})})}).catch(function($){throw new lu($)})]})})},n.prototype.buildUrl=function(e){var t=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return e&&(t+=e.startsWith("/")?e.substring(1):e),t},n.prototype.serializeQueryParams=function(e){var t=[];for(var i in e)if(e[i]!==null){var s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(var o=0,r=s;o"u"}function ss(n){return typeof n=="number"}function jo(n){return typeof n=="number"&&n%1===0}function Db(n){return typeof n=="string"}function Ob(n){return Object.prototype.toString.call(n)==="[object Date]"}function ng(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Eb(n){return Array.isArray(n)?n:[n]}function ou(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function Ab(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ss(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ki(n,e,t){return jo(n)&&n>=e&&n<=t}function Pb(n,e){return n-e*Math.floor(n/e)}function Jt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ei(n){if(!(mt(n)||n===null||n===""))return parseInt(n,10)}function Ui(n){if(!(mt(n)||n===null||n===""))return parseFloat(n)}function da(n){if(!(mt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function pa(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function bl(n){return n%4===0&&(n%100!==0||n%400===0)}function Qs(n){return bl(n)?366:365}function po(n,e){const t=Pb(e-1,12)+1,i=n+(e-t)/12;return t===2?bl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function ha(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function ho(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Fr(n){return n>99?n:n>60?1900+n:2e3+n}function ig(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function qo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function sg(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Vn(`Invalid unit value ${n}`);return e}function mo(n,e){const t={};for(const i in n)if(Ss(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=sg(s)}return t}function xs(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Jt(t,2)}:${Jt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Jt(t,2)}${Jt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Vo(n){return Ab(n,["hour","minute","second","millisecond"])}const lg=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Lb=["January","February","March","April","May","June","July","August","September","October","November","December"],og=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ib=["J","F","M","A","M","J","J","A","S","O","N","D"];function rg(n){switch(n){case"narrow":return[...Ib];case"short":return[...og];case"long":return[...Lb];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ag=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ug=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Fb=["M","T","W","T","F","S","S"];function fg(n){switch(n){case"narrow":return[...Fb];case"short":return[...ug];case"long":return[...ag];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const cg=["AM","PM"],Nb=["Before Christ","Anno Domini"],Rb=["BC","AD"],Hb=["B","A"];function dg(n){switch(n){case"narrow":return[...Hb];case"short":return[...Rb];case"long":return[...Nb];default:return null}}function jb(n){return cg[n.hour<12?0:1]}function qb(n,e){return fg(e)[n.weekday-1]}function Vb(n,e){return rg(e)[n.month-1]}function zb(n,e){return dg(e)[n.year<0?0:1]}function Bb(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function ru(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Ub={D:Ir,DD:Rm,DDD:Hm,DDDD:jm,t:qm,tt:Vm,ttt:zm,tttt:Bm,T:Um,TT:Wm,TTT:Ym,TTTT:Km,f:Jm,ff:Gm,fff:Qm,ffff:eg,F:Zm,FF:Xm,FFF:xm,FFFF:tg};class kn{static create(e,t={}){return new kn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return Ub[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Jt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(h,g)=>this.loc.extract(e,h,g),o=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",r=()=>i?jb(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,g)=>i?Vb(e,h):l(g?{month:h}:{month:h,day:"numeric"},"month"),u=(h,g)=>i?qb(e,h):l(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const g=kn.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(e,g):h},c=h=>i?zb(e,h):l({era:h},"era"),d=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(h)}};return ru(kn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=kn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return ru(l,s(r))}}class Xn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class vl{get type(){throw new Di}get name(){throw new Di}get ianaName(){return this.name}get isUniversal(){throw new Di}offsetName(e,t){throw new Di}formatOffset(e,t){throw new Di}offset(e){throw new Di}equals(e){throw new Di}get isValid(){throw new Di}}let er=null;class ma extends vl{static get instance(){return er===null&&(er=new ma),er}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return ig(e,t,i)}formatOffset(e,t){return xs(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let lo={};function Wb(n){return lo[n]||(lo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),lo[n]}const Yb={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Kb(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function Jb(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?g:1e3+g,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let tr=null;class gn extends vl{static get utcInstance(){return tr===null&&(tr=new gn(0)),tr}static instance(e){return e===0?gn.utcInstance:new gn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new gn(qo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${xs(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${xs(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return xs(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Zb extends vl{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Pi(n,e){if(mt(n)||n===null)return e;if(n instanceof vl)return n;if(Db(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?gn.utcInstance:gn.parseSpecifier(t)||wi.create(n)}else return ss(n)?gn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new Zb(n)}let au=()=>Date.now(),uu="system",fu=null,cu=null,du=null,pu;class Qt{static get now(){return au}static set now(e){au=e}static set defaultZone(e){uu=e}static get defaultZone(){return Pi(uu,ma.instance)}static get defaultLocale(){return fu}static set defaultLocale(e){fu=e}static get defaultNumberingSystem(){return cu}static set defaultNumberingSystem(e){cu=e}static get defaultOutputCalendar(){return du}static set defaultOutputCalendar(e){du=e}static get throwOnInvalid(){return pu}static set throwOnInvalid(e){pu=e}static resetCaches(){Ht.resetCache(),wi.resetCache()}}let hu={};function Gb(n,e={}){const t=JSON.stringify([n,e]);let i=hu[t];return i||(i=new Intl.ListFormat(n,e),hu[t]=i),i}let Nr={};function Rr(n,e={}){const t=JSON.stringify([n,e]);let i=Nr[t];return i||(i=new Intl.DateTimeFormat(n,e),Nr[t]=i),i}let Hr={};function Xb(n,e={}){const t=JSON.stringify([n,e]);let i=Hr[t];return i||(i=new Intl.NumberFormat(n,e),Hr[t]=i),i}let jr={};function Qb(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=jr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),jr[s]=l),l}let Js=null;function xb(){return Js||(Js=new Intl.DateTimeFormat().resolvedOptions().locale,Js)}function e0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Rr(n).resolvedOptions()}catch{t=Rr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function t0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function n0(n){const e=[];for(let t=1;t<=12;t++){const i=Qe.utc(2016,t,1);e.push(n(i))}return e}function i0(n){const e=[];for(let t=1;t<=7;t++){const i=Qe.utc(2016,11,13+t);e.push(n(i))}return e}function Nl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function s0(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class l0{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=Xb(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):pa(e,3);return Jt(t,this.padTo)}}}class o0{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&wi.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:Qe.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Rr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class r0{constructor(e,t,i){this.opts={style:"long",...i},!t&&ng()&&(this.rtf=Qb(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Bb(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Ht{static fromOpts(e){return Ht.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Qt.defaultLocale,o=l||(s?"en-US":xb()),r=t||Qt.defaultNumberingSystem,a=i||Qt.defaultOutputCalendar;return new Ht(o,r,a,l)}static resetCache(){Js=null,Nr={},Hr={},jr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Ht.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=e0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=t0(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=s0(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Ht.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Nl(this,e,i,rg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=n0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Nl(this,e,i,fg,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=i0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Nl(this,void 0,e,()=>cg,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Qe.utc(2016,11,13,9),Qe.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Nl(this,e,t,dg,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[Qe.utc(-40,1,1),Qe.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new l0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new o0(e,this.intl,t)}relFormatter(e={}){return new r0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Gb(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Os(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Es(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function As(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function pg(...n){return(e,t)=>{const i={};let s;for(s=0;sh!==void 0&&(g||h&&f)?-h:h;return[{years:d(Ui(t)),months:d(Ui(i)),weeks:d(Ui(s)),days:d(Ui(l)),hours:d(Ui(o)),minutes:d(Ui(r)),seconds:d(Ui(a),a==="-0"),milliseconds:d(da(u),c)}]}const y0={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ba(n,e,t,i,s,l,o){const r={year:e.length===2?Fr(Ei(e)):Ei(e),month:og.indexOf(t)+1,day:Ei(i),hour:Ei(s),minute:Ei(l)};return o&&(r.second=Ei(o)),n&&(r.weekday=n.length>3?ag.indexOf(n)+1:ug.indexOf(n)+1),r}const k0=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function w0(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=ba(e,s,i,t,l,o,r);let h;return a?h=y0[a]:u?h=0:h=qo(f,c),[d,new gn(h)]}function $0(n){return n.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const S0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,C0=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,M0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function mu(n){const[,e,t,i,s,l,o,r]=n;return[ba(e,s,i,t,l,o,r),gn.utcInstance]}function T0(n){const[,e,t,i,s,l,o,r]=n;return[ba(e,r,t,i,s,l,o),gn.utcInstance]}const D0=Os(u0,_a),O0=Os(f0,_a),E0=Os(c0,_a),A0=Os(mg),_g=Es(g0,Ps,yl,kl),P0=Es(d0,Ps,yl,kl),L0=Es(p0,Ps,yl,kl),I0=Es(Ps,yl,kl);function F0(n){return As(n,[D0,_g],[O0,P0],[E0,L0],[A0,I0])}function N0(n){return As($0(n),[k0,w0])}function R0(n){return As(n,[S0,mu],[C0,mu],[M0,T0])}function H0(n){return As(n,[b0,v0])}const j0=Es(Ps);function q0(n){return As(n,[_0,j0])}const V0=Os(h0,m0),z0=Os(gg),B0=Es(Ps,yl,kl);function U0(n){return As(n,[V0,_g],[z0,B0])}const W0="Invalid Duration",bg={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Y0={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...bg},Fn=146097/400,hs=146097/4800,K0={years:{quarters:4,months:12,weeks:Fn/7,days:Fn,hours:Fn*24,minutes:Fn*24*60,seconds:Fn*24*60*60,milliseconds:Fn*24*60*60*1e3},quarters:{months:3,weeks:Fn/28,days:Fn/4,hours:Fn*24/4,minutes:Fn*24*60/4,seconds:Fn*24*60*60/4,milliseconds:Fn*24*60*60*1e3/4},months:{weeks:hs/7,days:hs,hours:hs*24,minutes:hs*24*60,seconds:hs*24*60*60,milliseconds:hs*24*60*60*1e3},...bg},Gi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],J0=Gi.slice(0).reverse();function Wi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new kt(i)}function Z0(n){return n<0?Math.floor(n):Math.ceil(n)}function vg(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?Z0(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function G0(n,e){J0.reduce((t,i)=>mt(e[i])?t:(t&&vg(n,e,t,e,i),i),null)}class kt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Ht.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?K0:Y0,this.isLuxonDuration=!0}static fromMillis(e,t){return kt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Vn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new kt({values:mo(e,kt.normalizeUnit),loc:Ht.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(ss(e))return kt.fromMillis(e);if(kt.isDuration(e))return e;if(typeof e=="object")return kt.fromObject(e);throw new Vn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=H0(e);return i?kt.fromObject(i,t):kt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=q0(e);return i?kt.fromObject(i,t):kt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Vn("need to specify a reason the Duration is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Qt.throwOnInvalid)throw new Cb(i);return new kt({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Nm(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?kn.create(this.loc,i).formatDurationFromString(this,e):W0}toHuman(e={}){const t=Gi.map(i=>{const s=this.values[i];return mt(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=pa(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=kt.fromDurationLike(e),i={};for(const s of Gi)(Ss(t.values,s)||Ss(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Wi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=kt.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=sg(e(this.values[i],i));return Wi(this,{values:t},!0)}get(e){return this[kt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...mo(e,kt.normalizeUnit)};return Wi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Wi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return G0(this.matrix,e),Wi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>kt.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Gi)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;ss(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)Gi.indexOf(u)>Gi.indexOf(o)&&vg(this.matrix,s,u,t,o)}else ss(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return Wi(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Wi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of Gi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Fs="Invalid Interval";function X0(n,e){return!n||!n.isValid?Vt.invalid("missing or invalid start"):!e||!e.isValid?Vt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Vt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Hs).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Vt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=kt.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Vt.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Vt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Vt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(Vt.fromDateTimes(t,a.time)),t=null);return Vt.merge(s)}difference(...e){return Vt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Fs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Fs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Fs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Fs}toFormat(e,{separator:t=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Fs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):kt.invalid(this.invalidReason)}mapEndpoints(e){return Vt.fromDateTimes(e(this.s),e(this.e))}}class Rl{static hasDST(e=Qt.defaultZone){const t=Qe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return wi.isValidZone(e)}static normalizeZone(e){return Pi(e,Qt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Ht.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Ht.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Ht.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Ht.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ht.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Ht.create(t,null,"gregory").eras(e)}static features(){return{relative:ng()}}}function gu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(kt.fromMillis(i).as("days"))}function Q0(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=gu(r,a);return(u-u%7)/7}],["days",gu]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function x0(n,e,t,i){let[s,l,o,r]=Q0(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?kt.fromMillis(a,i).shiftTo(...u).plus(f):f}const va={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},_u={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},e1=va.hanidec.replace(/[\[|\]]/g,"").split("");function t1(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Zn({numberingSystem:n},e=""){return new RegExp(`${va[n||"latn"]}${e}`)}const n1="missing Intl.DateTimeFormat.formatToParts support";function St(n,e=t=>t){return{regex:n,deser:([t])=>e(t1(t))}}const i1=String.fromCharCode(160),yg=`[ ${i1}]`,kg=new RegExp(yg,"g");function s1(n){return n.replace(/\./g,"\\.?").replace(kg,yg)}function bu(n){return n.replace(/\./g,"").replace(kg," ").toLowerCase()}function Gn(n,e){return n===null?null:{regex:RegExp(n.map(s1).join("|")),deser:([t])=>n.findIndex(i=>bu(t)===bu(i))+e}}function vu(n,e){return{regex:n,deser:([,t,i])=>qo(t,i),groups:e}}function nr(n){return{regex:n,deser:([e])=>e}}function l1(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o1(n,e){const t=Zn(e),i=Zn(e,"{2}"),s=Zn(e,"{3}"),l=Zn(e,"{4}"),o=Zn(e,"{6}"),r=Zn(e,"{1,2}"),a=Zn(e,"{1,3}"),u=Zn(e,"{1,6}"),f=Zn(e,"{1,9}"),c=Zn(e,"{2,4}"),d=Zn(e,"{4,6}"),h=b=>({regex:RegExp(l1(b.val)),deser:([y])=>y,literal:!0}),v=(b=>{if(n.literal)return h(b);switch(b.val){case"G":return Gn(e.eras("short",!1),0);case"GG":return Gn(e.eras("long",!1),0);case"y":return St(u);case"yy":return St(c,Fr);case"yyyy":return St(l);case"yyyyy":return St(d);case"yyyyyy":return St(o);case"M":return St(r);case"MM":return St(i);case"MMM":return Gn(e.months("short",!0,!1),1);case"MMMM":return Gn(e.months("long",!0,!1),1);case"L":return St(r);case"LL":return St(i);case"LLL":return Gn(e.months("short",!1,!1),1);case"LLLL":return Gn(e.months("long",!1,!1),1);case"d":return St(r);case"dd":return St(i);case"o":return St(a);case"ooo":return St(s);case"HH":return St(i);case"H":return St(r);case"hh":return St(i);case"h":return St(r);case"mm":return St(i);case"m":return St(r);case"q":return St(r);case"qq":return St(i);case"s":return St(r);case"ss":return St(i);case"S":return St(a);case"SSS":return St(s);case"u":return nr(f);case"uu":return nr(r);case"uuu":return St(t);case"a":return Gn(e.meridiems(),0);case"kkkk":return St(l);case"kk":return St(c,Fr);case"W":return St(r);case"WW":return St(i);case"E":case"c":return St(t);case"EEE":return Gn(e.weekdays("short",!1,!1),1);case"EEEE":return Gn(e.weekdays("long",!1,!1),1);case"ccc":return Gn(e.weekdays("short",!0,!1),1);case"cccc":return Gn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return vu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return vu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return nr(/[a-z_+-/]{1,256}?/i);default:return h(b)}})(n)||{invalidReason:n1};return v.token=n,v}const r1={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function a1(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=r1[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function u1(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function f1(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Ss(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function c1(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return mt(n.z)||(t=wi.create(n.z)),mt(n.Z)||(t||(t=new gn(n.Z)),i=n.Z),mt(n.q)||(n.M=(n.q-1)*3+1),mt(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),mt(n.u)||(n.S=da(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let ir=null;function d1(){return ir||(ir=Qe.fromMillis(1555555555555)),ir}function p1(n,e){if(n.literal)return n;const t=kn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=kn.create(e,t).formatDateTimeParts(d1()).map(o=>a1(o,e,t));return l.includes(void 0)?n:l}function h1(n,e){return Array.prototype.concat(...n.map(t=>p1(t,e)))}function wg(n,e,t){const i=h1(kn.parseFormat(t),n),s=i.map(o=>o1(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=u1(s),a=RegExp(o,"i"),[u,f]=f1(e,a,r),[c,d,h]=f?c1(f):[null,null,void 0];if(Ss(f,"a")&&Ss(f,"H"))throw new Ks("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:h}}}function m1(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=wg(n,e,t);return[i,s,l,o]}const $g=[0,31,59,90,120,151,181,212,243,273,304,334],Sg=[0,31,60,91,121,152,182,213,244,274,305,335];function Bn(n,e){return new Xn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Cg(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function Mg(n,e,t){return t+(bl(n)?Sg:$g)[e-1]}function Tg(n,e){const t=bl(n)?Sg:$g,i=t.findIndex(l=>lho(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Vo(n)}}function yu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Cg(e,1,4),l=Qs(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=Qs(r)):o>l?(r=e+1,o-=Qs(e)):r=e;const{month:a,day:u}=Tg(r,o);return{year:r,month:a,day:u,...Vo(n)}}function sr(n){const{year:e,month:t,day:i}=n,s=Mg(e,t,i);return{year:e,ordinal:s,...Vo(n)}}function ku(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Tg(e,t);return{year:e,month:i,day:s,...Vo(n)}}function g1(n){const e=jo(n.weekYear),t=ki(n.weekNumber,1,ho(n.weekYear)),i=ki(n.weekday,1,7);return e?t?i?!1:Bn("weekday",n.weekday):Bn("week",n.week):Bn("weekYear",n.weekYear)}function _1(n){const e=jo(n.year),t=ki(n.ordinal,1,Qs(n.year));return e?t?!1:Bn("ordinal",n.ordinal):Bn("year",n.year)}function Dg(n){const e=jo(n.year),t=ki(n.month,1,12),i=ki(n.day,1,po(n.year,n.month));return e?t?i?!1:Bn("day",n.day):Bn("month",n.month):Bn("year",n.year)}function Og(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ki(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ki(t,0,59),r=ki(i,0,59),a=ki(s,0,999);return l?o?r?a?!1:Bn("millisecond",s):Bn("second",i):Bn("minute",t):Bn("hour",e)}const lr="Invalid DateTime",wu=864e13;function Hl(n){return new Xn("unsupported zone",`the zone "${n.name}" is not supported`)}function or(n){return n.weekData===null&&(n.weekData=qr(n.c)),n.weekData}function Ns(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Qe({...t,...e,old:t})}function Eg(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function $u(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function oo(n,e,t){return Eg(ha(n),e,t)}function Su(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,po(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=kt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=ha(l);let[a,u]=Eg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Rs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=Qe.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return Qe.invalid(new Xn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function jl(n,e,t=!0){return n.isValid?kn.create(Ht.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function rr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Jt(n.c.year,t?6:4),e?(i+="-",i+=Jt(n.c.month),i+="-",i+=Jt(n.c.day)):(i+=Jt(n.c.month),i+=Jt(n.c.day)),i}function Cu(n,e,t,i,s,l){let o=Jt(n.c.hour);return e?(o+=":",o+=Jt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Jt(n.c.minute),(n.c.second!==0||!t)&&(o+=Jt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Jt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Jt(Math.trunc(-n.o/60)),o+=":",o+=Jt(Math.trunc(-n.o%60))):(o+="+",o+=Jt(Math.trunc(n.o/60)),o+=":",o+=Jt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const Ag={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},b1={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},v1={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Pg=["year","month","day","hour","minute","second","millisecond"],y1=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],k1=["year","ordinal","hour","minute","second","millisecond"];function Mu(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Nm(n);return e}function Tu(n,e){const t=Pi(e.zone,Qt.defaultZone),i=Ht.fromObject(e),s=Qt.now();let l,o;if(mt(n.year))l=s;else{for(const u of Pg)mt(n[u])&&(n[u]=Ag[u]);const r=Dg(n)||Og(n);if(r)return Qe.invalid(r);const a=t.offset(s);[l,o]=oo(n,a,t)}return new Qe({ts:l,zone:t,loc:i,o})}function Du(n,e,t){const i=mt(t.round)?!0:t.round,s=(o,r)=>(o=pa(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Ou(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class Qe{constructor(e){const t=e.zone||Qt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Xn("invalid input"):null)||(t.isValid?null:Hl(t));this.ts=mt(e.ts)?Qt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=$u(this.ts,r),i=Number.isNaN(s.year)?new Xn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Ht.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Qe({})}static local(){const[e,t]=Ou(arguments),[i,s,l,o,r,a,u]=t;return Tu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Ou(arguments),[i,s,l,o,r,a,u]=t;return e.zone=gn.utcInstance,Tu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=Ob(e)?e.valueOf():NaN;if(Number.isNaN(i))return Qe.invalid("invalid input");const s=Pi(t.zone,Qt.defaultZone);return s.isValid?new Qe({ts:i,zone:s,loc:Ht.fromObject(t)}):Qe.invalid(Hl(s))}static fromMillis(e,t={}){if(ss(e))return e<-wu||e>wu?Qe.invalid("Timestamp out of range"):new Qe({ts:e,zone:Pi(t.zone,Qt.defaultZone),loc:Ht.fromObject(t)});throw new Vn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(ss(e))return new Qe({ts:e*1e3,zone:Pi(t.zone,Qt.defaultZone),loc:Ht.fromObject(t)});throw new Vn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Pi(t.zone,Qt.defaultZone);if(!i.isValid)return Qe.invalid(Hl(i));const s=Qt.now(),l=mt(t.specificOffset)?i.offset(s):t.specificOffset,o=mo(e,Mu),r=!mt(o.ordinal),a=!mt(o.year),u=!mt(o.month)||!mt(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=Ht.fromObject(t);if((f||r)&&c)throw new Ks("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Ks("Can't mix ordinal dates with month/day");const h=c||o.weekday&&!f;let g,v,b=$u(s,l);h?(g=y1,v=b1,b=qr(b)):r?(g=k1,v=v1,b=sr(b)):(g=Pg,v=Ag);let y=!1;for(const O of g){const L=o[O];mt(L)?y?o[O]=v[O]:o[O]=b[O]:y=!0}const C=h?g1(o):r?_1(o):Dg(o),S=C||Og(o);if(S)return Qe.invalid(S);const $=h?yu(o):r?ku(o):o,[M,D]=oo($,l,i),E=new Qe({ts:M,zone:i,o:D,loc:d});return o.weekday&&f&&e.weekday!==E.weekday?Qe.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${E.toISO()}`):E}static fromISO(e,t={}){const[i,s]=F0(e);return Rs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=N0(e);return Rs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=R0(e);return Rs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(mt(e)||mt(t))throw new Vn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Ht.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=m1(o,e,t);return f?Qe.invalid(f):Rs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Qe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=U0(e);return Rs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Vn("need to specify a reason the DateTime is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Qt.throwOnInvalid)throw new $b(i);return new Qe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?or(this).weekYear:NaN}get weekNumber(){return this.isValid?or(this).weekNumber:NaN}get weekday(){return this.isValid?or(this).weekday:NaN}get ordinal(){return this.isValid?sr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Rl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Rl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Rl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Rl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return bl(this.year)}get daysInMonth(){return po(this.year,this.month)}get daysInYear(){return this.isValid?Qs(this.year):NaN}get weeksInWeekYear(){return this.isValid?ho(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=kn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(gn.instance(e),t)}toLocal(){return this.setZone(Qt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Pi(e,Qt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=oo(o,l,e)}return Ns(this,{ts:s,zone:e})}else return Qe.invalid(Hl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Ns(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=mo(e,Mu),i=!mt(t.weekYear)||!mt(t.weekNumber)||!mt(t.weekday),s=!mt(t.ordinal),l=!mt(t.year),o=!mt(t.month)||!mt(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Ks("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Ks("Can't mix ordinal dates with month/day");let u;i?u=yu({...qr(this.c),...t}):mt(t.ordinal)?(u={...this.toObject(),...t},mt(t.day)&&(u.day=Math.min(po(u.year,u.month),u.day))):u=ku({...sr(this.c),...t});const[f,c]=oo(u,this.o,this.zone);return Ns(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=kt.fromDurationLike(e);return Ns(this,Su(this,t))}minus(e){if(!this.isValid)return this;const t=kt.fromDurationLike(e).negate();return Ns(this,Su(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=kt.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?kn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):lr}toLocaleString(e=Ir,t={}){return this.isValid?kn.create(this.loc.clone(t),e).formatDateTime(this):lr}toLocaleParts(e={}){return this.isValid?kn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=rr(this,o);return r+="T",r+=Cu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?rr(this,e==="extended"):null}toISOWeekDate(){return jl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+Cu(this,o==="extended",t,e,i,l):null}toRFC2822(){return jl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return jl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?rr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),jl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():lr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return kt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=Eb(t).map(kt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=x0(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Qe.now(),e,t)}until(e){return this.isValid?Vt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Qe.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Qe.isDateTime))throw new Vn("max requires all arguments be DateTimes");return ou(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Ht.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return wg(o,e,t)}static fromStringExplain(e,t,i={}){return Qe.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Ir}static get DATE_MED(){return Rm}static get DATE_MED_WITH_WEEKDAY(){return Mb}static get DATE_FULL(){return Hm}static get DATE_HUGE(){return jm}static get TIME_SIMPLE(){return qm}static get TIME_WITH_SECONDS(){return Vm}static get TIME_WITH_SHORT_OFFSET(){return zm}static get TIME_WITH_LONG_OFFSET(){return Bm}static get TIME_24_SIMPLE(){return Um}static get TIME_24_WITH_SECONDS(){return Wm}static get TIME_24_WITH_SHORT_OFFSET(){return Ym}static get TIME_24_WITH_LONG_OFFSET(){return Km}static get DATETIME_SHORT(){return Jm}static get DATETIME_SHORT_WITH_SECONDS(){return Zm}static get DATETIME_MED(){return Gm}static get DATETIME_MED_WITH_SECONDS(){return Xm}static get DATETIME_MED_WITH_WEEKDAY(){return Tb}static get DATETIME_FULL(){return Qm}static get DATETIME_FULL_WITH_SECONDS(){return xm}static get DATETIME_HUGE(){return eg}static get DATETIME_HUGE_WITH_SECONDS(){return tg}}function Hs(n){if(Qe.isDateTime(n))return n;if(n&&n.valueOf&&ss(n.valueOf()))return Qe.fromJSDate(n);if(n&&typeof n=="object")return Qe.fromObject(n);throw new Vn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}class W{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01T00:00:00Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||W.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||e.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return W.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!W.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e:(t||!W.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){W.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=W.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!W.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(!W.isObject(e)&&!Array.isArray(e)){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!W.isObject(l)&&!Array.isArray(l)||!W.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!W.isObject(s)&&!Array.isArray(s)||!W.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):W.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||W.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||W.isObject(e)&&Object.keys(e).length>0)&&W.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s{console.warn("Failed to copy.",i)})}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2)),s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("download",t+".json"),s.click(),s.remove()}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return/\.jpg|\.jpeg|\.png|\.svg|\.gif|\.webp|\.avif$/.test(e)}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(W.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)W.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):W.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static dummyCollectionRecord(e){var s,l,o,r,a;const t=(e==null?void 0:e.schema)||[],i={"@collectionId":e==null?void 0:e.id,"@collectionName":e==null?void 0:e.name,id:"RECORD_ID",created:"2022-01-01 01:00:00",updated:"2022-01-01 23:59:59"};for(const u of t){let f=null;u.type==="number"?f=123:u.type==="date"?f="2022-01-01 10:00:00":u.type==="bool"?f=!0:u.type==="email"?f="test@example.com":u.type==="url"?f="https://example.com":u.type==="json"?f="JSON (array/object)":u.type==="file"?(f="filename.jpg",((s=u.options)==null?void 0:s.maxSelect)>1&&(f=[f])):u.type==="select"?(f=(o=(l=u.options)==null?void 0:l.values)==null?void 0:o[0],((r=u.options)==null?void 0:r.maxSelect)>1&&(f=[f])):u.type==="relation"||u.type==="user"?(f="RELATION_RECORD_ID",((a=u.options)==null?void 0:a.maxSelect)>1&&(f=[f])):f="test",i[u.name]=f}return i}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e=e||{},e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":case"user":return((t=e.options)==null?void 0:t.maxSelect)>1?"Array":"String";default:return"String"}}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!W.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!W.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=W.isObject(u)&&W.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}}const ya=li([]);function Lg(n,e=4e3){return ka(n,"info",e)}function cn(n,e=3e3){return ka(n,"success",e)}function go(n,e=4500){return ka(n,"error",e)}function ka(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Ig(i)},t)};ya.update(s=>(Fg(s,i.message),W.pushOrReplaceByKey(s,i,"message"),s))}function Ig(n){ya.update(e=>(Fg(e,n),e))}function Fg(n,e){let t;typeof e=="string"?t=W.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),W.removeByKey(n,"message",t.message))}const qi=li({});function hi(n){qi.set(n||{})}function wa(n){qi.update(e=>(W.deleteByPath(e,n),e))}const $a=li({});function Vr(n){$a.set(n||{})}ca.prototype.logout=function(n=!0){this.authStore.clear(),n&&Si("/login")};ca.prototype.errorResponseHandler=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&go(l)}if(W.isEmpty(s.data)||hi(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Si("/")};class w1 extends Lm{save(e,t){super.save(e,t),t instanceof $s&&Vr(t)}clear(){super.clear(),Vr(null)}}const ye=new ca("../","en-US",new w1("pb_admin_auth"));ye.authStore.model instanceof $s&&Vr(ye.authStore.model);function $1(n){let e,t,i,s,l,o,r,a;const u=n[3].default,f=wn(u,n,n[2],null);return{c(){e=_("div"),t=_("main"),f&&f.c(),i=T(),s=_("footer"),l=_("a"),o=_("span"),o.textContent="PocketBase v0.5.0",p(t,"class","page-content"),p(o,"class","txt"),p(l,"href","https://github.com/pocketbase/pocketbase/releases"),p(l,"class","inline-flex flex-gap-5"),p(l,"target","_blank"),p(l,"rel","noopener"),p(l,"title","Releases"),p(s,"class","page-footer"),p(e,"class",r="page-wrapper "+n[1]),ie(e,"center-content",n[0])},m(c,d){w(c,e,d),m(e,t),f&&f.m(t,null),m(e,i),m(e,s),m(s,l),m(l,o),a=!0},p(c,[d]){f&&f.p&&(!a||d&4)&&Sn(f,u,c,c[2],a?$n(u,c[2],d,null):Cn(c[2]),null),(!a||d&2&&r!==(r="page-wrapper "+c[1]))&&p(e,"class",r),d&3&&ie(e,"center-content",c[0])},i(c){a||(A(f,c),a=!0)},o(c){P(f,c),a=!1},d(c){c&&k(e),f&&f.d(c)}}}function S1(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class On extends Ee{constructor(e){super(),Oe(this,e,S1,$1,De,{center:0,class:1})}}function Eu(n){let e,t,i;return{c(){e=_("div"),e.innerHTML=``,t=T(),i=_("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function C1(n){let e,t,i,s=!n[0]&&Eu();const l=n[1].default,o=wn(l,n,n[2],null);return{c(){e=_("div"),s&&s.c(),t=T(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),m(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Eu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Sn(o,l,r,r[2],i?$n(l,r[2],a,null):Cn(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function M1(n){let e,t;return e=new On({props:{class:"full-page",center:!0,$$slots:{default:[C1]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function T1(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class Ng extends Ee{constructor(e){super(),Oe(this,e,T1,M1,De,{nobranding:0})}}function Au(n,e,t){const i=n.slice();return i[11]=e[t],i}const D1=n=>({}),Pu=n=>({uniqueId:n[3]});function O1(n){let e=(n[11]||_o)+"",t;return{c(){t=F(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||_o)+"")&&ue(t,e)},d(i){i&&k(t)}}}function E1(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||_o)+"",i;return{c(){e=_("pre"),i=F(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||_o)+"")&&ue(i,t)},d(o){o&&k(e)}}}function Lu(n){let e,t;function i(o,r){return typeof o[11]=="object"?E1:O1}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=T(),p(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),m(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&k(e),l.d()}}}function A1(n){let e,t,i,s,l;const o=n[7].default,r=wn(o,n,n[6],Pu);let a=n[2],u=[];for(let f=0;ft(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+W.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){wa(r)}Jn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){rt.call(this,n,g)}function h(g){de[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=W.toArray(W.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,h]}class Re extends Ee{constructor(e){super(),Oe(this,e,P1,A1,De,{name:4,class:0})}}function L1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Email"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0]),l.focus(),r||(a=G(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&Me(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function I1(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("Password"),s=T(),l=_("input"),r=T(),a=_("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Me(l,n[1]),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&Me(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function F1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Password confirm"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[2]),r||(a=G(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&Me(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function N1(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new Re({props:{class:"form-field required",name:"email",$$slots:{default:[L1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"password",$$slots:{default:[I1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new Re({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[F1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="

Create your first admin account in order to continue

",i=T(),V(s.$$.fragment),l=T(),V(o.$$.fragment),r=T(),V(a.$$.fragment),u=T(),f=_("button"),f.innerHTML=`Create and login - `,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),ie(f,"btn-disabled",n[3]),ie(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),j(s,e,null),m(e,l),j(o,e,null),m(e,r),j(a,e,null),m(e,u),m(e,f),c=!0,d||(h=G(e,"submit",Kt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const C={};v&1540&&(C.$$scope={dirty:v,ctx:g}),a.$set(C),v&8&&ie(f,"btn-disabled",g[3]),v&8&&ie(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){P(s.$$.fragment,g),P(o.$$.fragment,g),P(a.$$.fragment,g),c=!1},d(g){g&&k(e),q(s),q(o),q(a),d=!1,h()}}}function R1(n,e,t){const i=on();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ye.admins.create({email:s,password:l,passwordConfirm:o}),await ye.admins.authViaEmail(s,l),i("submit")}catch(d){ye.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class H1 extends Ee{constructor(e){super(),Oe(this,e,R1,N1,De,{})}}function Iu(n){let e,t;return e=new Ng({props:{$$slots:{default:[j1]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function j1(n){let e,t;return e=new H1({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p:oe,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function q1(n){let e,t,i=n[0]&&Iu(n);return{c(){i&&i.c(),e=Ke()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Iu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Ae(),P(i,1,1,()=>{i=null}),Pe())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function V1(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ye.logout(!1),t(0,i=!0);return}ye.authStore.isValid?Si("/collections"):ye.logout()}return[i,async()=>{t(0,i=!1),await ii(),window.location.search=""}]}class z1 extends Ee{constructor(e){super(),Oe(this,e,V1,q1,De,{})}}const Rt=li(""),bo=li("");function zo(n){const e=n-1;return e*e*e+1}function vo(n,{delay:e=0,duration:t=400,easing:i=gl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Un(n,{delay:e=0,duration:t=400,easing:i=zo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o);return{delay:e,duration:t,easing:i,css:(c,d)=>` +}`,c=`__svelte_${Z_(f)}_${r}`,d=bm(n),{stylesheet:h,rules:g}=ao.get(d)||G_(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,uo+=1,c}function rl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),uo-=s,uo||X_())}function X_(){ra(()=>{uo||(ao.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),ao.clear())})}function Q_(n,e,t,i){if(!e)return oe;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return oe;const{delay:l=0,duration:o=300,easing:r=gl,start:a=Lo()+l,end:u=a+o,tick:f=oe,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function v(){c&&(g=ol(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&rl(n,g),d=!1}return Io(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const C=y-a,S=0+1*r(C/o);f(S,1-S)}return!0}),v(),f(0,1),b}function x_(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,km(n,s)}}function km(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let al;function Xs(n){al=n}function Fo(){if(!al)throw new Error("Function called outside component initialization");return al}function Jn(n){Fo().$$.on_mount.push(n)}function eb(n){Fo().$$.after_update.push(n)}function tb(n){Fo().$$.on_destroy.push(n)}function on(){const n=Fo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=ym(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function st(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ys=[],pe=[],no=[],Or=[],wm=Promise.resolve();let Er=!1;function $m(){Er||(Er=!0,wm.then(Sm))}function ii(){return $m(),wm}function Tt(n){no.push(n)}function He(n){Or.push(n)}const xo=new Set;let Il=0;function Sm(){const n=al;do{for(;Il{Is=null})),Is}function ts(n,e,t){n.dispatchEvent(ym(`${e?"intro":"outro"}${t}`))}const io=new Set;let ai;function Pe(){ai={r:0,c:[],p:ai}}function Le(){ai.r||Ge(ai.c),ai=ai.p}function A(n,e){n&&n.i&&(io.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),ai.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ua={duration:0};function Cm(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&rl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=gl,tick:g=oe,css:v}=i||ua;v&&(l=ol(n,0,1,d,c,h,v,r++)),g(0,1);const b=Lo()+c,y=b+d;o&&o.abort(),s=!0,Tt(()=>ts(n,!0,"start")),o=Io(C=>{if(s){if(C>=y)return g(1,0),ts(n,!0,"end"),a(),s=!1;if(C>=b){const S=h((C-b)/d);g(S,1-S)}}return s})}let f=!1;return{start(){f||(f=!0,rl(n),Kn(i)?(i=i(),aa().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Mm(n,e,t){let i=e(n,t),s=!0,l;const o=ai;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=gl,tick:c=oe,css:d}=i||ua;d&&(l=ol(n,1,0,u,a,f,d));const h=Lo()+a,g=h+u;Tt(()=>ts(n,!1,"start")),Io(v=>{if(s){if(v>=g)return c(0,1),ts(n,!1,"end"),--o.r||Ge(o.c),!1;if(v>=h){const b=f((v-h)/u);c(1-b,b)}}return s})}return Kn(i)?aa().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&rl(n,l),s=!1)}}}function it(n,e,t,i){let s=e(n,t),l=i?0:1,o=null,r=null,a=null;function u(){a&&rl(n,a)}function f(d,h){const g=d.b-l;return h*=Math.abs(g),{a:l,b:d.b,d:g,duration:h,start:d.start,end:d.start+h,group:d.group}}function c(d){const{delay:h=0,duration:g=300,easing:v=gl,tick:b=oe,css:y}=s||ua,C={start:Lo()+h,b:d};d||(C.group=ai,ai.r+=1),o||r?r=C:(y&&(u(),a=ol(n,l,d,g,h,v,y)),d&&b(0,1),o=f(C,g),Tt(()=>ts(n,d,"start")),Io(S=>{if(r&&S>r.start&&(o=f(r,g),r=null,ts(n,o.b,"start"),y&&(u(),a=ol(n,l,o.b,o.duration,0,v,s.css))),o){if(S>=o.end)b(l=o.b,1-l),ts(n,o.b,"end"),r||(o.b?u():--o.group.r||Ge(o.group.c)),o=null;else if(S>=o.start){const $=S-o.start;l=o.a+o.d*v($/o.duration),b(l,1-l)}}return!!(o||r)}))}return{run(d){Kn(s)?aa().then(()=>{s=s(),c(d)}):c(d)},end(){u(),o=r=null}}}function Mn(n,e){n.d(1),e.delete(n.key)}function Zt(n,e){P(n,1,1,()=>{e.delete(n.key)})}function ib(n,e){n.f(),Zt(n,e)}function yt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=l.length,g=d;const v={};for(;g--;)v[n[g].key]=g;const b=[],y=new Map,C=new Map;for(g=h;g--;){const D=c(s,l,g),E=t(D);let O=o.get(E);O?i&&O.p(D,e):(O=u(E,D),O.c()),y.set(E,b[g]=O),E in v&&C.set(E,Math.abs(g-v[E]))}const S=new Set,$=new Set;function M(D){A(D,1),D.m(r,f),o.set(D.key,D),f=D.first,h--}for(;d&&h;){const D=b[h-1],E=n[d-1],O=D.key,L=E.key;D===E?(f=D.first,d--,h--):y.has(L)?!o.has(O)||S.has(O)?M(D):$.has(L)?d--:C.get(O)>C.get(L)?($.add(O),M(D)):(S.add(L),d--):(a(E,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;h;)M(b[h-1]);return b}function pn(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function si(n){return typeof n=="object"&&n!==null?n:{}}function Fe(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function V(n){n&&n.c()}function j(n,e,t,i){const{fragment:s,on_mount:l,on_destroy:o,after_update:r}=n.$$;s&&s.m(e,t),i||Tt(()=>{const a=l.map(pm).filter(Kn);o?o.push(...a):Ge(a),n.$$.on_mount=[]}),r.forEach(Tt)}function q(n,e){const t=n.$$;t.fragment!==null&&(Ge(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function sb(n,e){n.$$.dirty[0]===-1&&(Ys.push(n),$m(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const g=h.length?h[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&sb(n,c)),d}):[],u.update(),f=!0,Ge(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=J_(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),j(n,e.target,e.anchor,e.customElement),Sm()}Xs(a)}class Ee{$destroy(){q(this,1),this.$destroy=oe}$on(e,t){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!W_(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function en(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t{i.delete(u),i.size===0&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function Dm(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return Tm(t,o=>{let r=!1;const a=[];let u=0,f=oe;const c=()=>{if(u)return;f();const h=e(i?a[0]:a,o);l?o(h):f=Kn(h)?h:oe},d=s.map((h,g)=>hm(h,v=>{a[g]=v,u&=~(1<{u|=1<{q(f,1)}),Le()}l?(e=new l(o()),e.$on("routeEvent",r[7]),V(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function ob(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r){let a={};for(let u=0;u{q(f,1)}),Le()}l?(e=new l(o()),e.$on("routeEvent",r[6]),V(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function rb(n){let e,t,i,s;const l=[ob,lb],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(Pe(),P(o[f],1,1,()=>{o[f]=null}),Le(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function xa(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const No=Tm(null,function(e){e(xa());const t=()=>{e(xa())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Dm(No,n=>n.location);const Ro=Dm(No,n=>n.querystring),eu=li(void 0);async function Si(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await ii();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function mn(n,e){if(e=nu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with
tags');return tu(n,e),{update(t){t=nu(t),tu(n,t)}}}function ab(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function tu(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||ub(i.currentTarget.getAttribute("href"))})}function nu(n){return n&&typeof n=="string"?{href:n}:n||{}}function ub(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function fb(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(M,D){if(!D||typeof D!="function"&&(typeof D!="object"||D._sveltesparouter!==!0))throw Error("Invalid component object");if(!M||typeof M=="string"&&(M.length<1||M.charAt(0)!="/"&&M.charAt(0)!="*")||typeof M=="object"&&!(M instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:E,keys:O}=Om(M);this.path=M,typeof D=="object"&&D._sveltesparouter===!0?(this.component=D.component,this.conditions=D.conditions||[],this.userData=D.userData,this.props=D.props||{}):(this.component=()=>Promise.resolve(D),this.conditions=[],this.props={}),this._pattern=E,this._keys=O}match(M){if(s){if(typeof s=="string")if(M.startsWith(s))M=M.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const L=M.match(s);if(L&&L[0])M=M.substr(L[0].length)||"/";else return null}}const D=this._pattern.exec(M);if(D===null)return null;if(this._keys===!1)return D;const E={};let O=0;for(;O{r.push(new o(M,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,u=null,f={};const c=on();async function d($,M){await ii(),c($,M)}let h=null,g=null;l&&(g=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?h=$.state:h=null},window.addEventListener("popstate",g),eb(()=>{ab(h)}));let v=null,b=null;const y=No.subscribe(async $=>{v=$;let M=0;for(;M{eu.set(u)});return}t(0,a=null),b=null,eu.set(void 0)});tb(()=>{y(),g&&window.removeEventListener("popstate",g)});function C($){st.call(this,n,$)}function S($){st.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,s=$.prefix),"restoreScrollState"in $&&t(5,l=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,C,S]}class cb extends Ee{constructor(e){super(),Oe(this,e,fb,rb,De,{routes:3,prefix:4,restoreScrollState:5})}}const so=[];let Em;function Am(n){const e=n.pattern.test(Em);iu(n,n.className,e),iu(n,n.inactiveClassName,!e)}function iu(n,e,t){(e||"").split(" ").forEach(i=>{!i||(n.node.classList.remove(i),t&&n.node.classList.add(i))})}No.subscribe(n=>{Em=n.location+(n.querystring?"?"+n.querystring:""),so.map(Am)});function jn(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?Om(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return so.push(i),Am(i),{destroy(){so.splice(so.indexOf(i),1)}}}const db="modulepreload",pb=function(n,e){return new URL(n,e).href},su={},Ai=function(e,t,i){return!t||t.length===0?e():Promise.all(t.map(s=>{if(s=pb(s,i),s in su)return;su[s]=!0;const l=s.endsWith(".css"),o=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${o}`))return;const r=document.createElement("link");if(r.rel=l?"stylesheet":db,l||(r.as="script",r.crossOrigin=""),r.href=s,document.head.appendChild(r),l)return new Promise((a,u)=>{r.addEventListener("load",a),r.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e())};var Ar=function(n,e){return Ar=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},Ar(n,e)};function ln(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}Ar(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Pr=function(){return Pr=Object.assign||function(n){for(var e,t=1,i=arguments.length;t0&&s[s.length-1])||f[0]!==6&&f[0]!==2)){o=0;continue}if(f[0]===3&&(!s||f[1]>s[0]&&f[1]0&&(!i.exp||i.exp-t>Date.now()/1e3))},n}(),mb=function(){function n(){this.baseToken="",this.baseModel={},this._onChangeCallbacks=[]}return Object.defineProperty(n.prototype,"token",{get:function(){return this.baseToken},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.baseModel},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isValid",{get:function(){return!hb.isExpired(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this.baseToken=e,this.baseModel=t,this.triggerChange()},n.prototype.clear=function(){this.baseToken="",this.baseModel={},this.triggerChange()},n.prototype.onChange=function(e){var t=this;return this._onChangeCallbacks.push(e),function(){for(var i=t._onChangeCallbacks.length-1;i>=0;i--)if(t._onChangeCallbacks[i]==e)return delete t._onChangeCallbacks[i],void t._onChangeCallbacks.splice(i,1)}},n.prototype.triggerChange=function(){for(var e=0,t=this._onChangeCallbacks;e0?n:1,this.perPage=e>=0?e:0,this.totalItems=t>=0?t:0,this.totalPages=i>=0?i:0,this.items=s||[]},Fm=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype._getFullList=function(t,i,s){var l=this;i===void 0&&(i=100),s===void 0&&(s={});var o=[],r=function(a){return ns(l,void 0,void 0,function(){return is(this,function(u){return[2,this._getList(t,a,i,s).then(function(f){var c=f,d=c.items,h=c.totalItems;return o=o.concat(d),d.length&&h>o.length?r(a+1):o})]})})};return r(1)},e.prototype._getList=function(t,i,s,l){var o=this;return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),l=Object.assign({page:i,perPage:s},l),this.client.send(t,{method:"GET",params:l}).then(function(r){var a=[];if(r!=null&&r.items){r.items=r.items||[];for(var u=0,f=r.items;u=400)throw new lu({url:$.url,status:$.status,data:M});return[2,M]}})})}).catch(function($){throw new lu($)})]})})},n.prototype.buildUrl=function(e){var t=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return e&&(t+=e.startsWith("/")?e.substring(1):e),t},n.prototype.serializeQueryParams=function(e){var t=[];for(var i in e)if(e[i]!==null){var s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(var o=0,r=s;o"u"}function ss(n){return typeof n=="number"}function jo(n){return typeof n=="number"&&n%1===0}function Db(n){return typeof n=="string"}function Ob(n){return Object.prototype.toString.call(n)==="[object Date]"}function ng(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Eb(n){return Array.isArray(n)?n:[n]}function ou(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function Ab(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ss(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ki(n,e,t){return jo(n)&&n>=e&&n<=t}function Pb(n,e){return n-e*Math.floor(n/e)}function Kt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ei(n){if(!(gt(n)||n===null||n===""))return parseInt(n,10)}function Ui(n){if(!(gt(n)||n===null||n===""))return parseFloat(n)}function da(n){if(!(gt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function pa(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function bl(n){return n%4===0&&(n%100!==0||n%400===0)}function Qs(n){return bl(n)?366:365}function po(n,e){const t=Pb(e-1,12)+1,i=n+(e-t)/12;return t===2?bl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function ha(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function ho(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Fr(n){return n>99?n:n>60?1900+n:2e3+n}function ig(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function qo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function sg(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Vn(`Invalid unit value ${n}`);return e}function mo(n,e){const t={};for(const i in n)if(Ss(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=sg(s)}return t}function xs(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Kt(t,2)}:${Kt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Kt(t,2)}${Kt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Vo(n){return Ab(n,["hour","minute","second","millisecond"])}const lg=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Lb=["January","February","March","April","May","June","July","August","September","October","November","December"],og=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ib=["J","F","M","A","M","J","J","A","S","O","N","D"];function rg(n){switch(n){case"narrow":return[...Ib];case"short":return[...og];case"long":return[...Lb];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ag=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ug=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Fb=["M","T","W","T","F","S","S"];function fg(n){switch(n){case"narrow":return[...Fb];case"short":return[...ug];case"long":return[...ag];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const cg=["AM","PM"],Nb=["Before Christ","Anno Domini"],Rb=["BC","AD"],Hb=["B","A"];function dg(n){switch(n){case"narrow":return[...Hb];case"short":return[...Rb];case"long":return[...Nb];default:return null}}function jb(n){return cg[n.hour<12?0:1]}function qb(n,e){return fg(e)[n.weekday-1]}function Vb(n,e){return rg(e)[n.month-1]}function zb(n,e){return dg(e)[n.year<0?0:1]}function Bb(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function ru(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Ub={D:Ir,DD:Rm,DDD:Hm,DDDD:jm,t:qm,tt:Vm,ttt:zm,tttt:Bm,T:Um,TT:Wm,TTT:Ym,TTTT:Km,f:Jm,ff:Gm,fff:Qm,ffff:eg,F:Zm,FF:Xm,FFF:xm,FFFF:tg};class kn{static create(e,t={}){return new kn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return Ub[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Kt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(h,g)=>this.loc.extract(e,h,g),o=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",r=()=>i?jb(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,g)=>i?Vb(e,h):l(g?{month:h}:{month:h,day:"numeric"},"month"),u=(h,g)=>i?qb(e,h):l(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const g=kn.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(e,g):h},c=h=>i?zb(e,h):l({era:h},"era"),d=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(h)}};return ru(kn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=kn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return ru(l,s(r))}}class Xn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class vl{get type(){throw new Di}get name(){throw new Di}get ianaName(){return this.name}get isUniversal(){throw new Di}offsetName(e,t){throw new Di}formatOffset(e,t){throw new Di}offset(e){throw new Di}equals(e){throw new Di}get isValid(){throw new Di}}let er=null;class ma extends vl{static get instance(){return er===null&&(er=new ma),er}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return ig(e,t,i)}formatOffset(e,t){return xs(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let lo={};function Wb(n){return lo[n]||(lo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),lo[n]}const Yb={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Kb(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function Jb(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?g:1e3+g,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let tr=null;class gn extends vl{static get utcInstance(){return tr===null&&(tr=new gn(0)),tr}static instance(e){return e===0?gn.utcInstance:new gn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new gn(qo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${xs(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${xs(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return xs(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Zb extends vl{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Pi(n,e){if(gt(n)||n===null)return e;if(n instanceof vl)return n;if(Db(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?gn.utcInstance:gn.parseSpecifier(t)||wi.create(n)}else return ss(n)?gn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new Zb(n)}let au=()=>Date.now(),uu="system",fu=null,cu=null,du=null,pu;class Xt{static get now(){return au}static set now(e){au=e}static set defaultZone(e){uu=e}static get defaultZone(){return Pi(uu,ma.instance)}static get defaultLocale(){return fu}static set defaultLocale(e){fu=e}static get defaultNumberingSystem(){return cu}static set defaultNumberingSystem(e){cu=e}static get defaultOutputCalendar(){return du}static set defaultOutputCalendar(e){du=e}static get throwOnInvalid(){return pu}static set throwOnInvalid(e){pu=e}static resetCaches(){Rt.resetCache(),wi.resetCache()}}let hu={};function Gb(n,e={}){const t=JSON.stringify([n,e]);let i=hu[t];return i||(i=new Intl.ListFormat(n,e),hu[t]=i),i}let Nr={};function Rr(n,e={}){const t=JSON.stringify([n,e]);let i=Nr[t];return i||(i=new Intl.DateTimeFormat(n,e),Nr[t]=i),i}let Hr={};function Xb(n,e={}){const t=JSON.stringify([n,e]);let i=Hr[t];return i||(i=new Intl.NumberFormat(n,e),Hr[t]=i),i}let jr={};function Qb(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=jr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),jr[s]=l),l}let Js=null;function xb(){return Js||(Js=new Intl.DateTimeFormat().resolvedOptions().locale,Js)}function e0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Rr(n).resolvedOptions()}catch{t=Rr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function t0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function n0(n){const e=[];for(let t=1;t<=12;t++){const i=Qe.utc(2016,t,1);e.push(n(i))}return e}function i0(n){const e=[];for(let t=1;t<=7;t++){const i=Qe.utc(2016,11,13+t);e.push(n(i))}return e}function Nl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function s0(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class l0{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=Xb(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):pa(e,3);return Kt(t,this.padTo)}}}class o0{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&wi.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:Qe.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Rr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class r0{constructor(e,t,i){this.opts={style:"long",...i},!t&&ng()&&(this.rtf=Qb(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Bb(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Rt{static fromOpts(e){return Rt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Xt.defaultLocale,o=l||(s?"en-US":xb()),r=t||Xt.defaultNumberingSystem,a=i||Xt.defaultOutputCalendar;return new Rt(o,r,a,l)}static resetCache(){Js=null,Nr={},Hr={},jr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Rt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=e0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=t0(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=s0(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Rt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Nl(this,e,i,rg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=n0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Nl(this,e,i,fg,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=i0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Nl(this,void 0,e,()=>cg,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Qe.utc(2016,11,13,9),Qe.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Nl(this,e,t,dg,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[Qe.utc(-40,1,1),Qe.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new l0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new o0(e,this.intl,t)}relFormatter(e={}){return new r0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Gb(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Os(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Es(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function As(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function pg(...n){return(e,t)=>{const i={};let s;for(s=0;sh!==void 0&&(g||h&&f)?-h:h;return[{years:d(Ui(t)),months:d(Ui(i)),weeks:d(Ui(s)),days:d(Ui(l)),hours:d(Ui(o)),minutes:d(Ui(r)),seconds:d(Ui(a),a==="-0"),milliseconds:d(da(u),c)}]}const y0={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ba(n,e,t,i,s,l,o){const r={year:e.length===2?Fr(Ei(e)):Ei(e),month:og.indexOf(t)+1,day:Ei(i),hour:Ei(s),minute:Ei(l)};return o&&(r.second=Ei(o)),n&&(r.weekday=n.length>3?ag.indexOf(n)+1:ug.indexOf(n)+1),r}const k0=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function w0(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=ba(e,s,i,t,l,o,r);let h;return a?h=y0[a]:u?h=0:h=qo(f,c),[d,new gn(h)]}function $0(n){return n.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const S0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,C0=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,M0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function mu(n){const[,e,t,i,s,l,o,r]=n;return[ba(e,s,i,t,l,o,r),gn.utcInstance]}function T0(n){const[,e,t,i,s,l,o,r]=n;return[ba(e,r,t,i,s,l,o),gn.utcInstance]}const D0=Os(u0,_a),O0=Os(f0,_a),E0=Os(c0,_a),A0=Os(mg),_g=Es(g0,Ps,yl,kl),P0=Es(d0,Ps,yl,kl),L0=Es(p0,Ps,yl,kl),I0=Es(Ps,yl,kl);function F0(n){return As(n,[D0,_g],[O0,P0],[E0,L0],[A0,I0])}function N0(n){return As($0(n),[k0,w0])}function R0(n){return As(n,[S0,mu],[C0,mu],[M0,T0])}function H0(n){return As(n,[b0,v0])}const j0=Es(Ps);function q0(n){return As(n,[_0,j0])}const V0=Os(h0,m0),z0=Os(gg),B0=Es(Ps,yl,kl);function U0(n){return As(n,[V0,_g],[z0,B0])}const W0="Invalid Duration",bg={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Y0={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...bg},Fn=146097/400,hs=146097/4800,K0={years:{quarters:4,months:12,weeks:Fn/7,days:Fn,hours:Fn*24,minutes:Fn*24*60,seconds:Fn*24*60*60,milliseconds:Fn*24*60*60*1e3},quarters:{months:3,weeks:Fn/28,days:Fn/4,hours:Fn*24/4,minutes:Fn*24*60/4,seconds:Fn*24*60*60/4,milliseconds:Fn*24*60*60*1e3/4},months:{weeks:hs/7,days:hs,hours:hs*24,minutes:hs*24*60,seconds:hs*24*60*60,milliseconds:hs*24*60*60*1e3},...bg},Gi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],J0=Gi.slice(0).reverse();function Wi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new kt(i)}function Z0(n){return n<0?Math.floor(n):Math.ceil(n)}function vg(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?Z0(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function G0(n,e){J0.reduce((t,i)=>gt(e[i])?t:(t&&vg(n,e,t,e,i),i),null)}class kt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Rt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?K0:Y0,this.isLuxonDuration=!0}static fromMillis(e,t){return kt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Vn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new kt({values:mo(e,kt.normalizeUnit),loc:Rt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(ss(e))return kt.fromMillis(e);if(kt.isDuration(e))return e;if(typeof e=="object")return kt.fromObject(e);throw new Vn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=H0(e);return i?kt.fromObject(i,t):kt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=q0(e);return i?kt.fromObject(i,t):kt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Vn("need to specify a reason the Duration is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Xt.throwOnInvalid)throw new Cb(i);return new kt({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Nm(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?kn.create(this.loc,i).formatDurationFromString(this,e):W0}toHuman(e={}){const t=Gi.map(i=>{const s=this.values[i];return gt(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=pa(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=kt.fromDurationLike(e),i={};for(const s of Gi)(Ss(t.values,s)||Ss(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Wi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=kt.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=sg(e(this.values[i],i));return Wi(this,{values:t},!0)}get(e){return this[kt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...mo(e,kt.normalizeUnit)};return Wi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Wi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return G0(this.matrix,e),Wi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>kt.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Gi)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;ss(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)Gi.indexOf(u)>Gi.indexOf(o)&&vg(this.matrix,s,u,t,o)}else ss(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return Wi(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Wi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of Gi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Fs="Invalid Interval";function X0(n,e){return!n||!n.isValid?qt.invalid("missing or invalid start"):!e||!e.isValid?qt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?qt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Hs).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(qt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=kt.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(qt.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:qt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return qt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(qt.fromDateTimes(t,a.time)),t=null);return qt.merge(s)}difference(...e){return qt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Fs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Fs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Fs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Fs}toFormat(e,{separator:t=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Fs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):kt.invalid(this.invalidReason)}mapEndpoints(e){return qt.fromDateTimes(e(this.s),e(this.e))}}class Rl{static hasDST(e=Xt.defaultZone){const t=Qe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return wi.isValidZone(e)}static normalizeZone(e){return Pi(e,Xt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Rt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Rt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Rt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Rt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Rt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Rt.create(t,null,"gregory").eras(e)}static features(){return{relative:ng()}}}function gu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(kt.fromMillis(i).as("days"))}function Q0(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=gu(r,a);return(u-u%7)/7}],["days",gu]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function x0(n,e,t,i){let[s,l,o,r]=Q0(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?kt.fromMillis(a,i).shiftTo(...u).plus(f):f}const va={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},_u={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},e1=va.hanidec.replace(/[\[|\]]/g,"").split("");function t1(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Zn({numberingSystem:n},e=""){return new RegExp(`${va[n||"latn"]}${e}`)}const n1="missing Intl.DateTimeFormat.formatToParts support";function $t(n,e=t=>t){return{regex:n,deser:([t])=>e(t1(t))}}const i1=String.fromCharCode(160),yg=`[ ${i1}]`,kg=new RegExp(yg,"g");function s1(n){return n.replace(/\./g,"\\.?").replace(kg,yg)}function bu(n){return n.replace(/\./g,"").replace(kg," ").toLowerCase()}function Gn(n,e){return n===null?null:{regex:RegExp(n.map(s1).join("|")),deser:([t])=>n.findIndex(i=>bu(t)===bu(i))+e}}function vu(n,e){return{regex:n,deser:([,t,i])=>qo(t,i),groups:e}}function nr(n){return{regex:n,deser:([e])=>e}}function l1(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o1(n,e){const t=Zn(e),i=Zn(e,"{2}"),s=Zn(e,"{3}"),l=Zn(e,"{4}"),o=Zn(e,"{6}"),r=Zn(e,"{1,2}"),a=Zn(e,"{1,3}"),u=Zn(e,"{1,6}"),f=Zn(e,"{1,9}"),c=Zn(e,"{2,4}"),d=Zn(e,"{4,6}"),h=b=>({regex:RegExp(l1(b.val)),deser:([y])=>y,literal:!0}),v=(b=>{if(n.literal)return h(b);switch(b.val){case"G":return Gn(e.eras("short",!1),0);case"GG":return Gn(e.eras("long",!1),0);case"y":return $t(u);case"yy":return $t(c,Fr);case"yyyy":return $t(l);case"yyyyy":return $t(d);case"yyyyyy":return $t(o);case"M":return $t(r);case"MM":return $t(i);case"MMM":return Gn(e.months("short",!0,!1),1);case"MMMM":return Gn(e.months("long",!0,!1),1);case"L":return $t(r);case"LL":return $t(i);case"LLL":return Gn(e.months("short",!1,!1),1);case"LLLL":return Gn(e.months("long",!1,!1),1);case"d":return $t(r);case"dd":return $t(i);case"o":return $t(a);case"ooo":return $t(s);case"HH":return $t(i);case"H":return $t(r);case"hh":return $t(i);case"h":return $t(r);case"mm":return $t(i);case"m":return $t(r);case"q":return $t(r);case"qq":return $t(i);case"s":return $t(r);case"ss":return $t(i);case"S":return $t(a);case"SSS":return $t(s);case"u":return nr(f);case"uu":return nr(r);case"uuu":return $t(t);case"a":return Gn(e.meridiems(),0);case"kkkk":return $t(l);case"kk":return $t(c,Fr);case"W":return $t(r);case"WW":return $t(i);case"E":case"c":return $t(t);case"EEE":return Gn(e.weekdays("short",!1,!1),1);case"EEEE":return Gn(e.weekdays("long",!1,!1),1);case"ccc":return Gn(e.weekdays("short",!0,!1),1);case"cccc":return Gn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return vu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return vu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return nr(/[a-z_+-/]{1,256}?/i);default:return h(b)}})(n)||{invalidReason:n1};return v.token=n,v}const r1={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function a1(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=r1[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function u1(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function f1(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Ss(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function c1(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return gt(n.z)||(t=wi.create(n.z)),gt(n.Z)||(t||(t=new gn(n.Z)),i=n.Z),gt(n.q)||(n.M=(n.q-1)*3+1),gt(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),gt(n.u)||(n.S=da(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let ir=null;function d1(){return ir||(ir=Qe.fromMillis(1555555555555)),ir}function p1(n,e){if(n.literal)return n;const t=kn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=kn.create(e,t).formatDateTimeParts(d1()).map(o=>a1(o,e,t));return l.includes(void 0)?n:l}function h1(n,e){return Array.prototype.concat(...n.map(t=>p1(t,e)))}function wg(n,e,t){const i=h1(kn.parseFormat(t),n),s=i.map(o=>o1(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=u1(s),a=RegExp(o,"i"),[u,f]=f1(e,a,r),[c,d,h]=f?c1(f):[null,null,void 0];if(Ss(f,"a")&&Ss(f,"H"))throw new Ks("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:h}}}function m1(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=wg(n,e,t);return[i,s,l,o]}const $g=[0,31,59,90,120,151,181,212,243,273,304,334],Sg=[0,31,60,91,121,152,182,213,244,274,305,335];function Bn(n,e){return new Xn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Cg(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function Mg(n,e,t){return t+(bl(n)?Sg:$g)[e-1]}function Tg(n,e){const t=bl(n)?Sg:$g,i=t.findIndex(l=>lho(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Vo(n)}}function yu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Cg(e,1,4),l=Qs(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=Qs(r)):o>l?(r=e+1,o-=Qs(e)):r=e;const{month:a,day:u}=Tg(r,o);return{year:r,month:a,day:u,...Vo(n)}}function sr(n){const{year:e,month:t,day:i}=n,s=Mg(e,t,i);return{year:e,ordinal:s,...Vo(n)}}function ku(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Tg(e,t);return{year:e,month:i,day:s,...Vo(n)}}function g1(n){const e=jo(n.weekYear),t=ki(n.weekNumber,1,ho(n.weekYear)),i=ki(n.weekday,1,7);return e?t?i?!1:Bn("weekday",n.weekday):Bn("week",n.week):Bn("weekYear",n.weekYear)}function _1(n){const e=jo(n.year),t=ki(n.ordinal,1,Qs(n.year));return e?t?!1:Bn("ordinal",n.ordinal):Bn("year",n.year)}function Dg(n){const e=jo(n.year),t=ki(n.month,1,12),i=ki(n.day,1,po(n.year,n.month));return e?t?i?!1:Bn("day",n.day):Bn("month",n.month):Bn("year",n.year)}function Og(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ki(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ki(t,0,59),r=ki(i,0,59),a=ki(s,0,999);return l?o?r?a?!1:Bn("millisecond",s):Bn("second",i):Bn("minute",t):Bn("hour",e)}const lr="Invalid DateTime",wu=864e13;function Hl(n){return new Xn("unsupported zone",`the zone "${n.name}" is not supported`)}function or(n){return n.weekData===null&&(n.weekData=qr(n.c)),n.weekData}function Ns(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Qe({...t,...e,old:t})}function Eg(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function $u(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function oo(n,e,t){return Eg(ha(n),e,t)}function Su(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,po(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=kt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=ha(l);let[a,u]=Eg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Rs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=Qe.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return Qe.invalid(new Xn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function jl(n,e,t=!0){return n.isValid?kn.create(Rt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function rr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Kt(n.c.year,t?6:4),e?(i+="-",i+=Kt(n.c.month),i+="-",i+=Kt(n.c.day)):(i+=Kt(n.c.month),i+=Kt(n.c.day)),i}function Cu(n,e,t,i,s,l){let o=Kt(n.c.hour);return e?(o+=":",o+=Kt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Kt(n.c.minute),(n.c.second!==0||!t)&&(o+=Kt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Kt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Kt(Math.trunc(-n.o/60)),o+=":",o+=Kt(Math.trunc(-n.o%60))):(o+="+",o+=Kt(Math.trunc(n.o/60)),o+=":",o+=Kt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const Ag={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},b1={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},v1={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Pg=["year","month","day","hour","minute","second","millisecond"],y1=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],k1=["year","ordinal","hour","minute","second","millisecond"];function Mu(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Nm(n);return e}function Tu(n,e){const t=Pi(e.zone,Xt.defaultZone),i=Rt.fromObject(e),s=Xt.now();let l,o;if(gt(n.year))l=s;else{for(const u of Pg)gt(n[u])&&(n[u]=Ag[u]);const r=Dg(n)||Og(n);if(r)return Qe.invalid(r);const a=t.offset(s);[l,o]=oo(n,a,t)}return new Qe({ts:l,zone:t,loc:i,o})}function Du(n,e,t){const i=gt(t.round)?!0:t.round,s=(o,r)=>(o=pa(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Ou(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class Qe{constructor(e){const t=e.zone||Xt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Xn("invalid input"):null)||(t.isValid?null:Hl(t));this.ts=gt(e.ts)?Xt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=$u(this.ts,r),i=Number.isNaN(s.year)?new Xn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Rt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Qe({})}static local(){const[e,t]=Ou(arguments),[i,s,l,o,r,a,u]=t;return Tu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Ou(arguments),[i,s,l,o,r,a,u]=t;return e.zone=gn.utcInstance,Tu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=Ob(e)?e.valueOf():NaN;if(Number.isNaN(i))return Qe.invalid("invalid input");const s=Pi(t.zone,Xt.defaultZone);return s.isValid?new Qe({ts:i,zone:s,loc:Rt.fromObject(t)}):Qe.invalid(Hl(s))}static fromMillis(e,t={}){if(ss(e))return e<-wu||e>wu?Qe.invalid("Timestamp out of range"):new Qe({ts:e,zone:Pi(t.zone,Xt.defaultZone),loc:Rt.fromObject(t)});throw new Vn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(ss(e))return new Qe({ts:e*1e3,zone:Pi(t.zone,Xt.defaultZone),loc:Rt.fromObject(t)});throw new Vn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Pi(t.zone,Xt.defaultZone);if(!i.isValid)return Qe.invalid(Hl(i));const s=Xt.now(),l=gt(t.specificOffset)?i.offset(s):t.specificOffset,o=mo(e,Mu),r=!gt(o.ordinal),a=!gt(o.year),u=!gt(o.month)||!gt(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=Rt.fromObject(t);if((f||r)&&c)throw new Ks("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Ks("Can't mix ordinal dates with month/day");const h=c||o.weekday&&!f;let g,v,b=$u(s,l);h?(g=y1,v=b1,b=qr(b)):r?(g=k1,v=v1,b=sr(b)):(g=Pg,v=Ag);let y=!1;for(const O of g){const L=o[O];gt(L)?y?o[O]=v[O]:o[O]=b[O]:y=!0}const C=h?g1(o):r?_1(o):Dg(o),S=C||Og(o);if(S)return Qe.invalid(S);const $=h?yu(o):r?ku(o):o,[M,D]=oo($,l,i),E=new Qe({ts:M,zone:i,o:D,loc:d});return o.weekday&&f&&e.weekday!==E.weekday?Qe.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${E.toISO()}`):E}static fromISO(e,t={}){const[i,s]=F0(e);return Rs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=N0(e);return Rs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=R0(e);return Rs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(gt(e)||gt(t))throw new Vn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Rt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=m1(o,e,t);return f?Qe.invalid(f):Rs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Qe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=U0(e);return Rs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Vn("need to specify a reason the DateTime is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Xt.throwOnInvalid)throw new $b(i);return new Qe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?or(this).weekYear:NaN}get weekNumber(){return this.isValid?or(this).weekNumber:NaN}get weekday(){return this.isValid?or(this).weekday:NaN}get ordinal(){return this.isValid?sr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Rl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Rl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Rl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Rl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return bl(this.year)}get daysInMonth(){return po(this.year,this.month)}get daysInYear(){return this.isValid?Qs(this.year):NaN}get weeksInWeekYear(){return this.isValid?ho(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=kn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(gn.instance(e),t)}toLocal(){return this.setZone(Xt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Pi(e,Xt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=oo(o,l,e)}return Ns(this,{ts:s,zone:e})}else return Qe.invalid(Hl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Ns(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=mo(e,Mu),i=!gt(t.weekYear)||!gt(t.weekNumber)||!gt(t.weekday),s=!gt(t.ordinal),l=!gt(t.year),o=!gt(t.month)||!gt(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Ks("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Ks("Can't mix ordinal dates with month/day");let u;i?u=yu({...qr(this.c),...t}):gt(t.ordinal)?(u={...this.toObject(),...t},gt(t.day)&&(u.day=Math.min(po(u.year,u.month),u.day))):u=ku({...sr(this.c),...t});const[f,c]=oo(u,this.o,this.zone);return Ns(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=kt.fromDurationLike(e);return Ns(this,Su(this,t))}minus(e){if(!this.isValid)return this;const t=kt.fromDurationLike(e).negate();return Ns(this,Su(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=kt.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?kn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):lr}toLocaleString(e=Ir,t={}){return this.isValid?kn.create(this.loc.clone(t),e).formatDateTime(this):lr}toLocaleParts(e={}){return this.isValid?kn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=rr(this,o);return r+="T",r+=Cu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?rr(this,e==="extended"):null}toISOWeekDate(){return jl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+Cu(this,o==="extended",t,e,i,l):null}toRFC2822(){return jl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return jl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?rr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),jl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():lr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return kt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=Eb(t).map(kt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=x0(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Qe.now(),e,t)}until(e){return this.isValid?qt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Qe.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Qe.isDateTime))throw new Vn("max requires all arguments be DateTimes");return ou(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Rt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return wg(o,e,t)}static fromStringExplain(e,t,i={}){return Qe.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Ir}static get DATE_MED(){return Rm}static get DATE_MED_WITH_WEEKDAY(){return Mb}static get DATE_FULL(){return Hm}static get DATE_HUGE(){return jm}static get TIME_SIMPLE(){return qm}static get TIME_WITH_SECONDS(){return Vm}static get TIME_WITH_SHORT_OFFSET(){return zm}static get TIME_WITH_LONG_OFFSET(){return Bm}static get TIME_24_SIMPLE(){return Um}static get TIME_24_WITH_SECONDS(){return Wm}static get TIME_24_WITH_SHORT_OFFSET(){return Ym}static get TIME_24_WITH_LONG_OFFSET(){return Km}static get DATETIME_SHORT(){return Jm}static get DATETIME_SHORT_WITH_SECONDS(){return Zm}static get DATETIME_MED(){return Gm}static get DATETIME_MED_WITH_SECONDS(){return Xm}static get DATETIME_MED_WITH_WEEKDAY(){return Tb}static get DATETIME_FULL(){return Qm}static get DATETIME_FULL_WITH_SECONDS(){return xm}static get DATETIME_HUGE(){return eg}static get DATETIME_HUGE_WITH_SECONDS(){return tg}}function Hs(n){if(Qe.isDateTime(n))return n;if(n&&n.valueOf&&ss(n.valueOf()))return Qe.fromJSDate(n);if(n&&typeof n=="object")return Qe.fromObject(n);throw new Vn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}class W{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01T00:00:00Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||W.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||e.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return W.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!W.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e:(t||!W.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){W.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=W.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!W.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(!W.isObject(e)&&!Array.isArray(e)){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!W.isObject(l)&&!Array.isArray(l)||!W.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!W.isObject(s)&&!Array.isArray(s)||!W.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):W.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||W.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||W.isObject(e)&&Object.keys(e).length>0)&&W.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s{console.warn("Failed to copy.",i)})}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2)),s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("download",t+".json"),s.click(),s.remove()}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return/\.jpg|\.jpeg|\.png|\.svg|\.gif|\.webp|\.avif$/.test(e)}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(W.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)W.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):W.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static dummyCollectionRecord(e){var s,l,o,r,a;const t=(e==null?void 0:e.schema)||[],i={"@collectionId":e==null?void 0:e.id,"@collectionName":e==null?void 0:e.name,id:"RECORD_ID",created:"2022-01-01 01:00:00",updated:"2022-01-01 23:59:59"};for(const u of t){let f=null;u.type==="number"?f=123:u.type==="date"?f="2022-01-01 10:00:00":u.type==="bool"?f=!0:u.type==="email"?f="test@example.com":u.type==="url"?f="https://example.com":u.type==="json"?f="JSON (array/object)":u.type==="file"?(f="filename.jpg",((s=u.options)==null?void 0:s.maxSelect)>1&&(f=[f])):u.type==="select"?(f=(o=(l=u.options)==null?void 0:l.values)==null?void 0:o[0],((r=u.options)==null?void 0:r.maxSelect)>1&&(f=[f])):u.type==="relation"||u.type==="user"?(f="RELATION_RECORD_ID",((a=u.options)==null?void 0:a.maxSelect)>1&&(f=[f])):f="test",i[u.name]=f}return i}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e=e||{},e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":case"user":return((t=e.options)==null?void 0:t.maxSelect)>1?"Array":"String";default:return"String"}}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!W.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!W.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=W.isObject(u)&&W.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}}const ya=li([]);function Lg(n,e=4e3){return ka(n,"info",e)}function cn(n,e=3e3){return ka(n,"success",e)}function go(n,e=4500){return ka(n,"error",e)}function ka(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Ig(i)},t)};ya.update(s=>(Fg(s,i.message),W.pushOrReplaceByKey(s,i,"message"),s))}function Ig(n){ya.update(e=>(Fg(e,n),e))}function Fg(n,e){let t;typeof e=="string"?t=W.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),W.removeByKey(n,"message",t.message))}const qi=li({});function hi(n){qi.set(n||{})}function wa(n){qi.update(e=>(W.deleteByPath(e,n),e))}const $a=li({});function Vr(n){$a.set(n||{})}ca.prototype.logout=function(n=!0){this.authStore.clear(),n&&Si("/login")};ca.prototype.errorResponseHandler=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&go(l)}if(W.isEmpty(s.data)||hi(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Si("/")};class w1 extends Lm{save(e,t){super.save(e,t),t instanceof $s&&Vr(t)}clear(){super.clear(),Vr(null)}}const we=new ca("../","en-US",new w1("pb_admin_auth"));we.authStore.model instanceof $s&&Vr(we.authStore.model);function $1(n){let e,t,i,s,l,o,r,a;const u=n[3].default,f=wn(u,n,n[2],null);return{c(){e=_("div"),t=_("main"),f&&f.c(),i=T(),s=_("footer"),l=_("a"),o=_("span"),o.textContent="PocketBase v0.5.0",p(t,"class","page-content"),p(o,"class","txt"),p(l,"href","https://github.com/pocketbase/pocketbase/releases"),p(l,"class","inline-flex flex-gap-5"),p(l,"target","_blank"),p(l,"rel","noopener"),p(l,"title","Releases"),p(s,"class","page-footer"),p(e,"class",r="page-wrapper "+n[1]),ie(e,"center-content",n[0])},m(c,d){w(c,e,d),m(e,t),f&&f.m(t,null),m(e,i),m(e,s),m(s,l),m(l,o),a=!0},p(c,[d]){f&&f.p&&(!a||d&4)&&Sn(f,u,c,c[2],a?$n(u,c[2],d,null):Cn(c[2]),null),(!a||d&2&&r!==(r="page-wrapper "+c[1]))&&p(e,"class",r),d&3&&ie(e,"center-content",c[0])},i(c){a||(A(f,c),a=!0)},o(c){P(f,c),a=!1},d(c){c&&k(e),f&&f.d(c)}}}function S1(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class On extends Ee{constructor(e){super(),Oe(this,e,S1,$1,De,{center:0,class:1})}}function Eu(n){let e,t,i;return{c(){e=_("div"),e.innerHTML=``,t=T(),i=_("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function C1(n){let e,t,i,s=!n[0]&&Eu();const l=n[1].default,o=wn(l,n,n[2],null);return{c(){e=_("div"),s&&s.c(),t=T(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),m(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Eu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Sn(o,l,r,r[2],i?$n(l,r[2],a,null):Cn(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function M1(n){let e,t;return e=new On({props:{class:"full-page",center:!0,$$slots:{default:[C1]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function T1(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class Ng extends Ee{constructor(e){super(),Oe(this,e,T1,M1,De,{nobranding:0})}}function Au(n,e,t){const i=n.slice();return i[11]=e[t],i}const D1=n=>({}),Pu=n=>({uniqueId:n[3]});function O1(n){let e=(n[11]||_o)+"",t;return{c(){t=F(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||_o)+"")&&ue(t,e)},d(i){i&&k(t)}}}function E1(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||_o)+"",i;return{c(){e=_("pre"),i=F(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||_o)+"")&&ue(i,t)},d(o){o&&k(e)}}}function Lu(n){let e,t;function i(o,r){return typeof o[11]=="object"?E1:O1}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=T(),p(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),m(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&k(e),l.d()}}}function A1(n){let e,t,i,s,l;const o=n[7].default,r=wn(o,n,n[6],Pu);let a=n[2],u=[];for(let f=0;ft(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+W.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){wa(r)}Jn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){st.call(this,n,g)}function h(g){pe[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=W.toArray(W.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,h]}class Re extends Ee{constructor(e){super(),Oe(this,e,P1,A1,De,{name:4,class:0})}}function L1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Email"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0]),l.focus(),r||(a=G(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&Te(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function I1(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("Password"),s=T(),l=_("input"),r=T(),a=_("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Te(l,n[1]),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&Te(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function F1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Password confirm"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[2]),r||(a=G(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&Te(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function N1(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new Re({props:{class:"form-field required",name:"email",$$slots:{default:[L1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"password",$$slots:{default:[I1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new Re({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[F1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="

Create your first admin account in order to continue

",i=T(),V(s.$$.fragment),l=T(),V(o.$$.fragment),r=T(),V(a.$$.fragment),u=T(),f=_("button"),f.innerHTML=`Create and login + `,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),ie(f,"btn-disabled",n[3]),ie(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),j(s,e,null),m(e,l),j(o,e,null),m(e,r),j(a,e,null),m(e,u),m(e,f),c=!0,d||(h=G(e,"submit",Yt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const C={};v&1540&&(C.$$scope={dirty:v,ctx:g}),a.$set(C),v&8&&ie(f,"btn-disabled",g[3]),v&8&&ie(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){P(s.$$.fragment,g),P(o.$$.fragment,g),P(a.$$.fragment,g),c=!1},d(g){g&&k(e),q(s),q(o),q(a),d=!1,h()}}}function R1(n,e,t){const i=on();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await we.admins.create({email:s,password:l,passwordConfirm:o}),await we.admins.authViaEmail(s,l),i("submit")}catch(d){we.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class H1 extends Ee{constructor(e){super(),Oe(this,e,R1,N1,De,{})}}function Iu(n){let e,t;return e=new Ng({props:{$$slots:{default:[j1]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function j1(n){let e,t;return e=new H1({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p:oe,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function q1(n){let e,t,i=n[0]&&Iu(n);return{c(){i&&i.c(),e=Ke()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Iu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Pe(),P(i,1,1,()=>{i=null}),Le())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function V1(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){we.logout(!1),t(0,i=!0);return}we.authStore.isValid?Si("/collections"):we.logout()}return[i,async()=>{t(0,i=!1),await ii(),window.location.search=""}]}class z1 extends Ee{constructor(e){super(),Oe(this,e,V1,q1,De,{})}}const Ft=li(""),bo=li("");function zo(n){const e=n-1;return e*e*e+1}function vo(n,{delay:e=0,duration:t=400,easing:i=gl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Un(n,{delay:e=0,duration:t=400,easing:i=zo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px); opacity: ${a-f*d}`}}function tn(n,{delay:e=0,duration:t=400,easing:i=zo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*o}px;padding-top: ${h*r}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function Tn(n,{delay:e=0,duration:t=400,easing:i=zo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-u*d}); opacity: ${r-f*d} - `}}function B1(n){let e,t,i,s;return{c(){e=_("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Me(e,n[7]),i||(s=G(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&Me(e,l[7])},i:oe,o:oe,d(l){l&&k(e),n[13](null),i=!1,s()}}}function U1(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=new o(r(n)),de.push(()=>Ie(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=Ke()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],He(()=>t=!1)),o!==(o=a[4])){if(e){Ae();const c=e;P(c.$$.fragment,1,0,()=>{q(c,1)}),Pe()}o?(e=new o(r(a)),de.push(()=>Ie(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&q(e,a)}}}function Fu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Nu();return{c(){r&&r.c(),e=T(),t=_("button"),t.innerHTML='Clear',p(t,"type","button"),p(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=G(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Nu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(Ae(),P(r,1,1,()=>{r=null}),Pe())},i(a){s||(A(r),a&&Tt(()=>{i||(i=ot(t,Un,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=ot(t,Un,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Nu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=ot(e,Un,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=ot(e,Un,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function W1(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[U1,B1],h=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=h[o]=d[o](n);let v=(n[0].length||n[7].length)&&Fu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=T(),r.c(),a=T(),v&&v.c(),p(s,"class","ri-search-line"),p(i,"for",n[8]),p(i,"class","m-l-10 txt-xl"),p(t,"class","searchbar"),p(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),h[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[G(t,"submit",Kt(n[10])),G(e,"click",ei(n[11]))],f=!0)},p(b,[y]){let C=o;o=g(b),o===C?h[o].p(b,y):(Ae(),P(h[C],1,1,()=>{h[C]=null}),Pe(),r=h[o],r?r.p(b,y):(r=h[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Fu(b),v.c(),A(v,1),v.m(t,null)):v&&(Ae(),P(v,1,1,()=>{v=null}),Pe())},i(b){u||(A(r),A(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&k(e),h[o].d(),v&&v.d(),f=!1,Ge(c)}}}function Y1(n,e,t){const i=on(),s="search_"+W.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new fn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Ai(()=>import("./FilterAutocompleteInput.7ac53d63.js"),["FilterAutocompleteInput.7ac53d63.js","index.90bde420.js"],import.meta.url)).default),t(5,f=!1))}Jn(()=>{v()});function b(M){rt.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function C(M){de[M?"unshift":"push"](()=>{c=M,t(6,c)})}function S(){d=this.value,t(7,d),t(0,l)}const $=()=>{h(!1),g()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,g,b,y,C,S,$]}class Bo extends Ee{constructor(e){super(),Oe(this,e,Y1,W1,De,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let zr,Yi;const Br="app-tooltip";function Ru(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ni(){return Yi=Yi||document.querySelector("."+Br),Yi||(Yi=document.createElement("div"),Yi.classList.add(Br),document.body.appendChild(Yi)),Yi}function Rg(n,e){let t=Ni();if(!t.classList.contains("active")||!(e!=null&&e.text)){Ur();return}t.textContent=e.text,t.className=Br+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Ur(){clearTimeout(zr),Ni().classList.remove("active"),Ni().activeNode=void 0}function K1(n,e){Ni().activeNode=n,clearTimeout(zr),zr=setTimeout(()=>{Ni().classList.add("active"),Rg(n,e)},isNaN(e.delay)?200:e.delay)}function wt(n,e){let t=Ru(e);function i(){K1(n,t)}function s(){Ur()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&W.isFocusable(n))&&n.addEventListener("click",s),Ni(),{update(l){var o,r;t=Ru(l),(r=(o=Ni())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Rg(n,t)},destroy(){var l,o;(o=(l=Ni())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Ur(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function J1(n){let e,t,i,s;return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-secondary btn-circle svelte-b7gb6q"),ie(e,"refreshing",n[1])},m(l,o){w(l,e,o),i||(s=[Ye(t=wt.call(null,e,n[0])),G(e,"click",n[2])],i=!0)},p(l,[o]){t&&Kn(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&ie(e,"refreshing",l[1])},i:oe,o:oe,d(l){l&&k(e),i=!1,Ge(s)}}}function Z1(n,e,t){const i=on();let{tooltip:s={text:"Refresh",position:"right"}}=e,l=null;function o(){i("refresh");const r=s;t(0,s=null),clearTimeout(l),t(1,l=setTimeout(()=>{t(1,l=null),t(0,s=r)},200))}return Jn(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class Uo extends Ee{constructor(e){super(),Oe(this,e,Z1,J1,De,{tooltip:0})}}function G1(n){let e,t,i,s,l;const o=n[6].default,r=wn(o,n,n[5],null);return{c(){e=_("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"class",t="col-sort "+n[1]),ie(e,"col-sort-disabled",n[3]),ie(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ie(e,"sort-desc",n[0]==="-"+n[2]),ie(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[G(e,"click",n[7]),G(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Sn(r,o,a,a[5],i?$n(o,a[5],u,null):Cn(a[5]),null),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),u&10&&ie(e,"col-sort-disabled",a[3]),u&7&&ie(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),u&7&&ie(e,"sort-desc",a[0]==="-"+a[2]),u&7&&ie(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){P(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,Ge(l)}}}function X1(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class sn extends Ee{constructor(e){super(),Oe(this,e,X1,G1,De,{class:1,name:2,sort:0,disable:3})}}function Q1(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function x1(n){let e,t=W.formatToUTCDate(n[0])+"",i,s,l,o,r;return{c(){e=_("span"),i=F(t),s=F(" UTC"),p(e,"class","txt")},m(a,u){w(a,e,u),m(e,i),m(e,s),o||(r=Ye(l=wt.call(null,e,W.formatToLocalDate(n[0])+" Local")),o=!0)},p(a,u){u&1&&t!==(t=W.formatToUTCDate(a[0])+"")&&ue(i,t),l&&Kn(l.update)&&u&1&&l.update.call(null,W.formatToLocalDate(a[0])+" Local")},d(a){a&&k(e),o=!1,r()}}}function ev(n){let e;function t(l,o){return l[0]?x1:Q1}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function tv(n,e,t){let{date:i=""}=e;return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i]}class $i extends Ee{constructor(e){super(),Oe(this,e,tv,ev,De,{date:0})}}function Hu(n,e,t){const i=n.slice();return i[21]=e[t],i}function nv(n){let e;return{c(){e=_("div"),e.innerHTML=` + `}}function B1(n){let e,t,i,s;return{c(){e=_("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Te(e,n[7]),i||(s=G(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&Te(e,l[7])},i:oe,o:oe,d(l){l&&k(e),n[13](null),i=!1,s()}}}function U1(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=new o(r(n)),pe.push(()=>Fe(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=Ke()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],He(()=>t=!1)),o!==(o=a[4])){if(e){Pe();const c=e;P(c.$$.fragment,1,0,()=>{q(c,1)}),Le()}o?(e=new o(r(a)),pe.push(()=>Fe(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&q(e,a)}}}function Fu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Nu();return{c(){r&&r.c(),e=T(),t=_("button"),t.innerHTML='Clear',p(t,"type","button"),p(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=G(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Nu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(Pe(),P(r,1,1,()=>{r=null}),Le())},i(a){s||(A(r),a&&Tt(()=>{i||(i=it(t,Un,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=it(t,Un,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Nu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=it(e,Un,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=it(e,Un,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function W1(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[U1,B1],h=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=h[o]=d[o](n);let v=(n[0].length||n[7].length)&&Fu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=T(),r.c(),a=T(),v&&v.c(),p(s,"class","ri-search-line"),p(i,"for",n[8]),p(i,"class","m-l-10 txt-xl"),p(t,"class","searchbar"),p(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),h[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[G(t,"submit",Yt(n[10])),G(e,"click",ei(n[11]))],f=!0)},p(b,[y]){let C=o;o=g(b),o===C?h[o].p(b,y):(Pe(),P(h[C],1,1,()=>{h[C]=null}),Le(),r=h[o],r?r.p(b,y):(r=h[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Fu(b),v.c(),A(v,1),v.m(t,null)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},i(b){u||(A(r),A(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&k(e),h[o].d(),v&&v.d(),f=!1,Ge(c)}}}function Y1(n,e,t){const i=on(),s="search_"+W.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new fn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Ai(()=>import("./FilterAutocompleteInput.9df887af.js"),["FilterAutocompleteInput.9df887af.js","index.afc1faa1.js"],import.meta.url)).default),t(5,f=!1))}Jn(()=>{v()});function b(M){st.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function C(M){pe[M?"unshift":"push"](()=>{c=M,t(6,c)})}function S(){d=this.value,t(7,d),t(0,l)}const $=()=>{h(!1),g()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,g,b,y,C,S,$]}class Bo extends Ee{constructor(e){super(),Oe(this,e,Y1,W1,De,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let zr,Yi;const Br="app-tooltip";function Ru(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ni(){return Yi=Yi||document.querySelector("."+Br),Yi||(Yi=document.createElement("div"),Yi.classList.add(Br),document.body.appendChild(Yi)),Yi}function Rg(n,e){let t=Ni();if(!t.classList.contains("active")||!(e!=null&&e.text)){Ur();return}t.textContent=e.text,t.className=Br+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Ur(){clearTimeout(zr),Ni().classList.remove("active"),Ni().activeNode=void 0}function K1(n,e){Ni().activeNode=n,clearTimeout(zr),zr=setTimeout(()=>{Ni().classList.add("active"),Rg(n,e)},isNaN(e.delay)?200:e.delay)}function wt(n,e){let t=Ru(e);function i(){K1(n,t)}function s(){Ur()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&W.isFocusable(n))&&n.addEventListener("click",s),Ni(),{update(l){var o,r;t=Ru(l),(r=(o=Ni())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Rg(n,t)},destroy(){var l,o;(o=(l=Ni())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Ur(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function J1(n){let e,t,i,s;return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-secondary btn-circle svelte-b7gb6q"),ie(e,"refreshing",n[1])},m(l,o){w(l,e,o),i||(s=[Ye(t=wt.call(null,e,n[0])),G(e,"click",n[2])],i=!0)},p(l,[o]){t&&Kn(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&ie(e,"refreshing",l[1])},i:oe,o:oe,d(l){l&&k(e),i=!1,Ge(s)}}}function Z1(n,e,t){const i=on();let{tooltip:s={text:"Refresh",position:"right"}}=e,l=null;function o(){i("refresh");const r=s;t(0,s=null),clearTimeout(l),t(1,l=setTimeout(()=>{t(1,l=null),t(0,s=r)},200))}return Jn(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class Uo extends Ee{constructor(e){super(),Oe(this,e,Z1,J1,De,{tooltip:0})}}function G1(n){let e,t,i,s,l;const o=n[6].default,r=wn(o,n,n[5],null);return{c(){e=_("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"class",t="col-sort "+n[1]),ie(e,"col-sort-disabled",n[3]),ie(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ie(e,"sort-desc",n[0]==="-"+n[2]),ie(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[G(e,"click",n[7]),G(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Sn(r,o,a,a[5],i?$n(o,a[5],u,null):Cn(a[5]),null),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),u&10&&ie(e,"col-sort-disabled",a[3]),u&7&&ie(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),u&7&&ie(e,"sort-desc",a[0]==="-"+a[2]),u&7&&ie(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){P(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,Ge(l)}}}function X1(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class sn extends Ee{constructor(e){super(),Oe(this,e,X1,G1,De,{class:1,name:2,sort:0,disable:3})}}function Q1(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function x1(n){let e,t=W.formatToUTCDate(n[0])+"",i,s,l,o,r;return{c(){e=_("span"),i=F(t),s=F(" UTC"),p(e,"class","txt")},m(a,u){w(a,e,u),m(e,i),m(e,s),o||(r=Ye(l=wt.call(null,e,W.formatToLocalDate(n[0])+" Local")),o=!0)},p(a,u){u&1&&t!==(t=W.formatToUTCDate(a[0])+"")&&ue(i,t),l&&Kn(l.update)&&u&1&&l.update.call(null,W.formatToLocalDate(a[0])+" Local")},d(a){a&&k(e),o=!1,r()}}}function ev(n){let e;function t(l,o){return l[0]?x1:Q1}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function tv(n,e,t){let{date:i=""}=e;return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i]}class $i extends Ee{constructor(e){super(),Oe(this,e,tv,ev,De,{date:0})}}function Hu(n,e,t){const i=n.slice();return i[21]=e[t],i}function nv(n){let e;return{c(){e=_("div"),e.innerHTML=` method`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function iv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="url",p(t,"class",W.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function sv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="referer",p(t,"class",W.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function lv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="status",p(t,"class",W.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function ov(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function ju(n){let e;function t(l,o){return l[6]?av:rv}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function rv(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&qu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=qu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function av(n){let e;return{c(){e=_("tr"),e.innerHTML=` - `},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function qu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Vu(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zu(n,e){var X,re,ve;let t,i,s,l=((X=e[21].method)==null?void 0:X.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,g,v,b,y,C=(e[21].referer||"N/A")+"",S,$,M,D,E,O=e[21].status+"",L,I,N,B,U,ee,K,se,Y,te,J=(((re=e[21].meta)==null?void 0:re.errorMessage)||((ve=e[21].meta)==null?void 0:ve.errorData))&&Vu();B=new $i({props:{date:e[21].created}});function ge(){return e[16](e[21])}function _e(...H){return e[17](e[21],...H)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=F(l),a=T(),u=_("td"),f=_("span"),d=F(c),g=T(),J&&J.c(),v=T(),b=_("td"),y=_("span"),S=F(C),M=T(),D=_("td"),E=_("span"),L=F(O),I=T(),N=_("td"),V(B.$$.fragment),U=T(),ee=_("td"),ee.innerHTML='',K=T(),p(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[21].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",$=e[21].referer),ie(y,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(E,"class","label"),ie(E,"label-danger",e[21].status>=400),p(D,"class","col-type-number col-field-status"),p(N,"class","col-type-date col-field-created"),p(ee,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(H,pe){w(H,t,pe),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),J&&J.m(u,null),m(t,v),m(t,b),m(b,y),m(y,S),m(t,M),m(t,D),m(D,E),m(E,L),m(t,I),m(t,N),j(B,N,null),m(t,U),m(t,ee),m(t,K),se=!0,Y||(te=[G(t,"click",ge),G(t,"keydown",_e)],Y=!0)},p(H,pe){var Q,$e,je;e=H,(!se||pe&8)&&l!==(l=((Q=e[21].method)==null?void 0:Q.toUpperCase())+"")&&ue(o,l),(!se||pe&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!se||pe&8)&&c!==(c=e[21].url+"")&&ue(d,c),(!se||pe&8&&h!==(h=e[21].url))&&p(f,"title",h),(($e=e[21].meta)==null?void 0:$e.errorMessage)||((je=e[21].meta)==null?void 0:je.errorData)?J||(J=Vu(),J.c(),J.m(u,null)):J&&(J.d(1),J=null),(!se||pe&8)&&C!==(C=(e[21].referer||"N/A")+"")&&ue(S,C),(!se||pe&8&&$!==($=e[21].referer))&&p(y,"title",$),pe&8&&ie(y,"txt-hint",!e[21].referer),(!se||pe&8)&&O!==(O=e[21].status+"")&&ue(L,O),pe&8&&ie(E,"label-danger",e[21].status>=400);const x={};pe&8&&(x.date=e[21].created),B.$set(x)},i(H){se||(A(B.$$.fragment,H),se=!0)},o(H){P(B.$$.fragment,H),se=!1},d(H){H&&k(t),J&&J.d(),q(B),Y=!1,Ge(te)}}}function Bu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&ue(s,i),a&16&&ue(o,r[4])},d(r){r&&k(e)}}}function Uu(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ie(t,"btn-loading",n[6]),ie(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=G(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c&64&&ie(t,"btn-loading",f[6]),c&64&&ie(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function uv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E=[],O=new Map,L,I,N,B;function U(Q){n[11](Q)}let ee={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[nv]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),l=new sn({props:ee}),de.push(()=>Ie(l,"sort",U));function K(Q){n[12](Q)}let se={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[iv]},$$scope:{ctx:n}};n[1]!==void 0&&(se.sort=n[1]),a=new sn({props:se}),de.push(()=>Ie(a,"sort",K));function Y(Q){n[13](Q)}let te={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[sv]},$$scope:{ctx:n}};n[1]!==void 0&&(te.sort=n[1]),c=new sn({props:te}),de.push(()=>Ie(c,"sort",Y));function J(Q){n[14](Q)}let ge={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[lv]},$$scope:{ctx:n}};n[1]!==void 0&&(ge.sort=n[1]),g=new sn({props:ge}),de.push(()=>Ie(g,"sort",J));function _e(Q){n[15](Q)}let X={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[ov]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),y=new sn({props:X}),de.push(()=>Ie(y,"sort",_e));let re=n[3];const ve=Q=>Q[21].id;for(let Q=0;Qo=!1)),l.$set(je);const Be={};$e&16777216&&(Be.$$scope={dirty:$e,ctx:Q}),!u&&$e&2&&(u=!0,Be.sort=Q[1],He(()=>u=!1)),a.$set(Be);const Z={};$e&16777216&&(Z.$$scope={dirty:$e,ctx:Q}),!d&&$e&2&&(d=!0,Z.sort=Q[1],He(()=>d=!1)),c.$set(Z);const me={};$e&16777216&&(me.$$scope={dirty:$e,ctx:Q}),!v&&$e&2&&(v=!0,me.sort=Q[1],He(()=>v=!1)),g.$set(me);const ce={};$e&16777216&&(ce.$$scope={dirty:$e,ctx:Q}),!C&&$e&2&&(C=!0,ce.sort=Q[1],He(()=>C=!1)),y.$set(ce),$e&841&&(re=Q[3],Ae(),E=vt(E,$e,ve,1,Q,re,O,D,Gt,zu,null,Hu),Pe(),!re.length&&H?H.p(Q,$e):re.length?H&&(H.d(1),H=null):(H=ju(Q),H.c(),H.m(D,null))),$e&64&&ie(t,"table-loading",Q[6]),Q[3].length?pe?pe.p(Q,$e):(pe=Bu(Q),pe.c(),pe.m(I.parentNode,I)):pe&&(pe.d(1),pe=null),Q[3].length&&Q[7]?x?x.p(Q,$e):(x=Uu(Q),x.c(),x.m(N.parentNode,N)):x&&(x.d(1),x=null)},i(Q){if(!B){A(l.$$.fragment,Q),A(a.$$.fragment,Q),A(c.$$.fragment,Q),A(g.$$.fragment,Q),A(y.$$.fragment,Q);for(let $e=0;$e{O<=1&&g(),t(6,d=!1),t(3,u=u.concat(L.items)),t(5,f=L.page),t(4,c=L.totalItems),s("load",u)}).catch(L=>{L!=null&&L.isAbort||(t(6,d=!1),console.warn(L),g(),ye.errorResponseHandler(L,!1))})}function g(){t(3,u=[]),t(5,f=1),t(4,c=0)}function v(O){a=O,t(1,a)}function b(O){a=O,t(1,a)}function y(O){a=O,t(1,a)}function C(O){a=O,t(1,a)}function S(O){a=O,t(1,a)}const $=O=>s("select",O),M=(O,L)=>{L.code==="Enter"&&(L.preventDefault(),s("select",O))},D=()=>t(0,o=""),E=()=>h(f+1);return n.$$set=O=>{"filter"in O&&t(0,o=O.filter),"presets"in O&&t(10,r=O.presets),"sort"in O&&t(1,a=O.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(g(),h(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,h,u,c,f,d,i,s,l,r,v,b,y,C,S,$,M,D,E]}class cv extends Ee{constructor(e){super(),Oe(this,e,fv,uv,De,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*! + `},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function qu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Vu(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zu(n,e){var X,ae,ve;let t,i,s,l=((X=e[21].method)==null?void 0:X.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,g,v,b,y,C=(e[21].referer||"N/A")+"",S,$,M,D,E,O=e[21].status+"",L,I,N,B,U,ee,K,se,Y,te,J=(((ae=e[21].meta)==null?void 0:ae.errorMessage)||((ve=e[21].meta)==null?void 0:ve.errorData))&&Vu();B=new $i({props:{date:e[21].created}});function _e(){return e[16](e[21])}function be(...H){return e[17](e[21],...H)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=F(l),a=T(),u=_("td"),f=_("span"),d=F(c),g=T(),J&&J.c(),v=T(),b=_("td"),y=_("span"),S=F(C),M=T(),D=_("td"),E=_("span"),L=F(O),I=T(),N=_("td"),V(B.$$.fragment),U=T(),ee=_("td"),ee.innerHTML='',K=T(),p(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[21].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",$=e[21].referer),ie(y,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(E,"class","label"),ie(E,"label-danger",e[21].status>=400),p(D,"class","col-type-number col-field-status"),p(N,"class","col-type-date col-field-created"),p(ee,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(H,me){w(H,t,me),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),J&&J.m(u,null),m(t,v),m(t,b),m(b,y),m(y,S),m(t,M),m(t,D),m(D,E),m(E,L),m(t,I),m(t,N),j(B,N,null),m(t,U),m(t,ee),m(t,K),se=!0,Y||(te=[G(t,"click",_e),G(t,"keydown",be)],Y=!0)},p(H,me){var Q,Se,je;e=H,(!se||me&8)&&l!==(l=((Q=e[21].method)==null?void 0:Q.toUpperCase())+"")&&ue(o,l),(!se||me&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!se||me&8)&&c!==(c=e[21].url+"")&&ue(d,c),(!se||me&8&&h!==(h=e[21].url))&&p(f,"title",h),((Se=e[21].meta)==null?void 0:Se.errorMessage)||((je=e[21].meta)==null?void 0:je.errorData)?J||(J=Vu(),J.c(),J.m(u,null)):J&&(J.d(1),J=null),(!se||me&8)&&C!==(C=(e[21].referer||"N/A")+"")&&ue(S,C),(!se||me&8&&$!==($=e[21].referer))&&p(y,"title",$),me&8&&ie(y,"txt-hint",!e[21].referer),(!se||me&8)&&O!==(O=e[21].status+"")&&ue(L,O),me&8&&ie(E,"label-danger",e[21].status>=400);const x={};me&8&&(x.date=e[21].created),B.$set(x)},i(H){se||(A(B.$$.fragment,H),se=!0)},o(H){P(B.$$.fragment,H),se=!1},d(H){H&&k(t),J&&J.d(),q(B),Y=!1,Ge(te)}}}function Bu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&ue(s,i),a&16&&ue(o,r[4])},d(r){r&&k(e)}}}function Uu(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ie(t,"btn-loading",n[6]),ie(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=G(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c&64&&ie(t,"btn-loading",f[6]),c&64&&ie(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function uv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E=[],O=new Map,L,I,N,B;function U(Q){n[11](Q)}let ee={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[nv]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),l=new sn({props:ee}),pe.push(()=>Fe(l,"sort",U));function K(Q){n[12](Q)}let se={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[iv]},$$scope:{ctx:n}};n[1]!==void 0&&(se.sort=n[1]),a=new sn({props:se}),pe.push(()=>Fe(a,"sort",K));function Y(Q){n[13](Q)}let te={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[sv]},$$scope:{ctx:n}};n[1]!==void 0&&(te.sort=n[1]),c=new sn({props:te}),pe.push(()=>Fe(c,"sort",Y));function J(Q){n[14](Q)}let _e={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[lv]},$$scope:{ctx:n}};n[1]!==void 0&&(_e.sort=n[1]),g=new sn({props:_e}),pe.push(()=>Fe(g,"sort",J));function be(Q){n[15](Q)}let X={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[ov]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),y=new sn({props:X}),pe.push(()=>Fe(y,"sort",be));let ae=n[3];const ve=Q=>Q[21].id;for(let Q=0;Qo=!1)),l.$set(je);const Ue={};Se&16777216&&(Ue.$$scope={dirty:Se,ctx:Q}),!u&&Se&2&&(u=!0,Ue.sort=Q[1],He(()=>u=!1)),a.$set(Ue);const Z={};Se&16777216&&(Z.$$scope={dirty:Se,ctx:Q}),!d&&Se&2&&(d=!0,Z.sort=Q[1],He(()=>d=!1)),c.$set(Z);const ge={};Se&16777216&&(ge.$$scope={dirty:Se,ctx:Q}),!v&&Se&2&&(v=!0,ge.sort=Q[1],He(()=>v=!1)),g.$set(ge);const ce={};Se&16777216&&(ce.$$scope={dirty:Se,ctx:Q}),!C&&Se&2&&(C=!0,ce.sort=Q[1],He(()=>C=!1)),y.$set(ce),Se&841&&(ae=Q[3],Pe(),E=yt(E,Se,ve,1,Q,ae,O,D,Zt,zu,null,Hu),Le(),!ae.length&&H?H.p(Q,Se):ae.length?H&&(H.d(1),H=null):(H=ju(Q),H.c(),H.m(D,null))),Se&64&&ie(t,"table-loading",Q[6]),Q[3].length?me?me.p(Q,Se):(me=Bu(Q),me.c(),me.m(I.parentNode,I)):me&&(me.d(1),me=null),Q[3].length&&Q[7]?x?x.p(Q,Se):(x=Uu(Q),x.c(),x.m(N.parentNode,N)):x&&(x.d(1),x=null)},i(Q){if(!B){A(l.$$.fragment,Q),A(a.$$.fragment,Q),A(c.$$.fragment,Q),A(g.$$.fragment,Q),A(y.$$.fragment,Q);for(let Se=0;Se{O<=1&&g(),t(6,d=!1),t(3,u=u.concat(L.items)),t(5,f=L.page),t(4,c=L.totalItems),s("load",u)}).catch(L=>{L!=null&&L.isAbort||(t(6,d=!1),console.warn(L),g(),we.errorResponseHandler(L,!1))})}function g(){t(3,u=[]),t(5,f=1),t(4,c=0)}function v(O){a=O,t(1,a)}function b(O){a=O,t(1,a)}function y(O){a=O,t(1,a)}function C(O){a=O,t(1,a)}function S(O){a=O,t(1,a)}const $=O=>s("select",O),M=(O,L)=>{L.code==="Enter"&&(L.preventDefault(),s("select",O))},D=()=>t(0,o=""),E=()=>h(f+1);return n.$$set=O=>{"filter"in O&&t(0,o=O.filter),"presets"in O&&t(10,r=O.presets),"sort"in O&&t(1,a=O.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(g(),h(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,h,u,c,f,d,i,s,l,r,v,b,y,C,S,$,M,D,E]}class cv extends Ee{constructor(e){super(),Oe(this,e,fv,uv,De,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*! * Chart.js v3.9.1 * https://www.chartjs.org * (c) 2022 Chart.js Contributors * Released under the MIT License - */function _i(){}const dv=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function Ft(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Yt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Rn(n,e){return Yt(n)?n:e}function gt(n,e){return typeof n>"u"?e:n}const pv=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Hg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function zt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Dt(n,e,t,i){let s,l,o;if(Ft(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;sn,x:n=>n.x,y:n=>n.y};function Hi(n,e){return(Wu[e]||(Wu[e]=gv(e)))(n)}function gv(n){const e=_v(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function _v(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Sa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Wn=n=>typeof n<"u",ji=n=>typeof n=="function",Yu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function bv(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Wt=Math.PI,Et=2*Wt,vv=Et+Wt,wo=Number.POSITIVE_INFINITY,yv=Wt/180,Bt=Wt/2,js=Wt/4,Ku=Wt*2/3,zn=Math.log10,fi=Math.sign;function Ju(n){const e=Math.round(n);n=tl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(zn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function kv(n){const e=[],t=Math.sqrt(n);let i;for(i=1;is-l).pop(),e}function Cs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function tl(n,e,t){return Math.abs(n-e)=n}function qg(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ma(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const es=(n,e,t,i)=>Ma(n,t,i?s=>n[s][e]<=t:s=>n[s][e]Ma(n,t,i=>n[i][e]>=t);function Mv(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+Sa(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function Gu(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(zg.forEach(l=>{delete n[l]}),delete n._chartjs)}function Bg(n){const e=new Set;let t,i;for(t=0,i=n.length;t"u"?function(n){return n()}:window.requestAnimationFrame}();function Wg(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,Ug.call(window,()=>{s=!1,n.apply(e,l)}))}}function Dv(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const Ov=n=>n==="start"?"left":n==="end"?"right":"center",Xu=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function Yg(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(s=un(Math.min(es(r,o.axis,u).lo,t?i:es(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=un(Math.max(es(r,o.axis,f,!0).hi+1,t?0:es(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function Kg(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const ql=n=>n===0||n===1,Qu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Et/t)),xu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Et/t)+1,nl={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Bt)+1,easeOutSine:n=>Math.sin(n*Bt),easeInOutSine:n=>-.5*(Math.cos(Wt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>ql(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>ql(n)?n:Qu(n,.075,.3),easeOutElastic:n=>ql(n)?n:xu(n,.075,.3),easeInOutElastic(n){return ql(n)?n:n<.5?.5*Qu(n*2,.1125,.45):.5+.5*xu(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-nl.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?nl.easeInBounce(n*2)*.5:nl.easeOutBounce(n*2-1)*.5+.5};/*! + */function _i(){}const dv=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function It(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Wt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Rn(n,e){return Wt(n)?n:e}function _t(n,e){return typeof n>"u"?e:n}const pv=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Hg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Vt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Et(n,e,t,i){let s,l,o;if(It(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;sn,x:n=>n.x,y:n=>n.y};function Hi(n,e){return(Wu[e]||(Wu[e]=gv(e)))(n)}function gv(n){const e=_v(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function _v(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Sa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Wn=n=>typeof n<"u",ji=n=>typeof n=="function",Yu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function bv(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ut=Math.PI,At=2*Ut,vv=At+Ut,wo=Number.POSITIVE_INFINITY,yv=Ut/180,zt=Ut/2,js=Ut/4,Ku=Ut*2/3,zn=Math.log10,fi=Math.sign;function Ju(n){const e=Math.round(n);n=tl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(zn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function kv(n){const e=[],t=Math.sqrt(n);let i;for(i=1;is-l).pop(),e}function Cs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function tl(n,e,t){return Math.abs(n-e)=n}function qg(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ma(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const es=(n,e,t,i)=>Ma(n,t,i?s=>n[s][e]<=t:s=>n[s][e]Ma(n,t,i=>n[i][e]>=t);function Mv(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+Sa(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function Gu(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(zg.forEach(l=>{delete n[l]}),delete n._chartjs)}function Bg(n){const e=new Set;let t,i;for(t=0,i=n.length;t"u"?function(n){return n()}:window.requestAnimationFrame}();function Wg(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,Ug.call(window,()=>{s=!1,n.apply(e,l)}))}}function Dv(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const Ov=n=>n==="start"?"left":n==="end"?"right":"center",Xu=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function Yg(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(s=un(Math.min(es(r,o.axis,u).lo,t?i:es(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=un(Math.max(es(r,o.axis,f,!0).hi+1,t?0:es(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function Kg(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const ql=n=>n===0||n===1,Qu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*At/t)),xu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*At/t)+1,nl={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*zt)+1,easeOutSine:n=>Math.sin(n*zt),easeInOutSine:n=>-.5*(Math.cos(Ut*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>ql(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>ql(n)?n:Qu(n,.075,.3),easeOutElastic:n=>ql(n)?n:xu(n,.075,.3),easeInOutElastic(n){return ql(n)?n:n<.5?.5*Qu(n*2,.1125,.45):.5+.5*xu(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-nl.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?nl.easeInBounce(n*2)*.5:nl.easeOutBounce(n*2-1)*.5+.5};/*! * @kurkle/color v0.2.1 * https://github.com/kurkle/color#readme * (c) 2022 Jukka Kurkela * Released under the MIT License - */function wl(n){return n+.5|0}const Ii=(n,e,t)=>Math.max(Math.min(n,t),e);function Zs(n){return Ii(wl(n*2.55),0,255)}function Ri(n){return Ii(wl(n*255),0,255)}function yi(n){return Ii(wl(n/2.55)/100,0,1)}function ef(n){return Ii(wl(n*100),0,100)}const Nn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Yr=[..."0123456789ABCDEF"],Ev=n=>Yr[n&15],Av=n=>Yr[(n&240)>>4]+Yr[n&15],Vl=n=>(n&240)>>4===(n&15),Pv=n=>Vl(n.r)&&Vl(n.g)&&Vl(n.b)&&Vl(n.a);function Lv(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Nn[n[1]]*17,g:255&Nn[n[2]]*17,b:255&Nn[n[3]]*17,a:e===5?Nn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Nn[n[1]]<<4|Nn[n[2]],g:Nn[n[3]]<<4|Nn[n[4]],b:Nn[n[5]]<<4|Nn[n[6]],a:e===9?Nn[n[7]]<<4|Nn[n[8]]:255})),t}const Iv=(n,e)=>n<255?e(n):"";function Fv(n){var e=Pv(n)?Ev:Av;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Iv(n.a,e):void 0}const Nv=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Jg(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function Rv(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function Hv(n,e,t){const i=Jg(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function jv(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=jv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Da(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ri)}function Oa(n,e,t){return Da(Jg,n,e,t)}function qv(n,e,t){return Da(Hv,n,e,t)}function Vv(n,e,t){return Da(Rv,n,e,t)}function Zg(n){return(n%360+360)%360}function zv(n){const e=Nv.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Zs(+e[5]):Ri(+e[5]));const s=Zg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=qv(s,l,o):e[1]==="hsv"?i=Vv(s,l,o):i=Oa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function Bv(n,e){var t=Ta(n);t[0]=Zg(t[0]+e),t=Oa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function Uv(n){if(!n)return;const e=Ta(n),t=e[0],i=ef(e[1]),s=ef(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${yi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const tf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},nf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Wv(){const n={},e=Object.keys(nf),t=Object.keys(tf);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let zl;function Yv(n){zl||(zl=Wv(),zl.transparent=[0,0,0,0]);const e=zl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Kv=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Jv(n){const e=Kv.exec(n);let t=255,i,s,l;if(!!e){if(e[7]!==i){const o=+e[7];t=e[8]?Zs(o):Ii(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Zs(i):Ii(i,0,255)),s=255&(e[4]?Zs(s):Ii(s,0,255)),l=255&(e[6]?Zs(l):Ii(l,0,255)),{r:i,g:s,b:l,a:t}}}function Zv(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${yi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ar=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ms=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Gv(n,e,t){const i=ms(yi(n.r)),s=ms(yi(n.g)),l=ms(yi(n.b));return{r:Ri(ar(i+t*(ms(yi(e.r))-i))),g:Ri(ar(s+t*(ms(yi(e.g))-s))),b:Ri(ar(l+t*(ms(yi(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Bl(n,e,t){if(n){let i=Ta(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Oa(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Gg(n,e){return n&&Object.assign(e||{},n)}function sf(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Ri(n[3]))):(e=Gg(n,{r:0,g:0,b:0,a:1}),e.a=Ri(e.a)),e}function Xv(n){return n.charAt(0)==="r"?Jv(n):zv(n)}class $o{constructor(e){if(e instanceof $o)return e;const t=typeof e;let i;t==="object"?i=sf(e):t==="string"&&(i=Lv(e)||Yv(e)||Xv(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Gg(this._rgb);return e&&(e.a=yi(e.a)),e}set rgb(e){this._rgb=sf(e)}rgbString(){return this._valid?Zv(this._rgb):void 0}hexString(){return this._valid?Fv(this._rgb):void 0}hslString(){return this._valid?Uv(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=Gv(this._rgb,e._rgb,t)),this}clone(){return new $o(this.rgb)}alpha(e){return this._rgb.a=Ri(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=wl(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Bl(this._rgb,2,e),this}darken(e){return Bl(this._rgb,2,-e),this}saturate(e){return Bl(this._rgb,1,e),this}desaturate(e){return Bl(this._rgb,1,-e),this}rotate(e){return Bv(this._rgb,e),this}}function Xg(n){return new $o(n)}function Qg(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function lf(n){return Qg(n)?n:Xg(n)}function ur(n){return Qg(n)?n:Xg(n).saturate(.5).darken(.1).hexString()}const rs=Object.create(null),Kr=Object.create(null);function il(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;it.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>ur(i.backgroundColor),this.hoverBorderColor=(t,i)=>ur(i.borderColor),this.hoverColor=(t,i)=>ur(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return fr(this,e,t)}get(e){return il(this,e)}describe(e,t){return fr(Kr,e,t)}override(e,t){return fr(rs,e,t)}route(e,t,i,s){const l=il(this,e),o=il(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return pt(a)?Object.assign({},u,a):gt(a,u)},set(a){this[r]=a}}})}}var bt=new Qv({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function xv(n){return!n||Mt(n.size)||Mt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function So(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function ey(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function dl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,sy(n,l),a=0;a+n||0;function Pa(n,e){const t={},i=pt(e),s=i?Object.keys(e):e,l=pt(n)?i?o=>gt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=uy(l(o));return t}function xg(n){return Pa(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ys(n){return Pa(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Yn(n){const e=xg(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ln(n,e){n=n||{},e=e||bt.font;let t=gt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=gt(n.style,e.style);i&&!(""+i).match(ry)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:gt(n.family,e.family),lineHeight:ay(gt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:gt(n.weight,e.weight),string:""};return s.string=xv(s),s}function Ul(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Vi(n,e){return Object.assign(Object.create(n),e)}function La(n,e=[""],t=n,i,s=()=>n[0]){Wn(i)||(i=i_("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>La([o,...n],e,t,i)};return new Proxy(l,{deleteProperty(o,r){return delete o[r],delete o._keys,delete n[0][r],!0},get(o,r){return t_(o,r,()=>by(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return af(o).includes(r)},ownKeys(o){return af(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Ms(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:e_(n,i),setContext:l=>Ms(n,l,t,i),override:l=>Ms(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return t_(l,o,()=>dy(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function e_(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:ji(t)?t:()=>t,isIndexable:ji(i)?i:()=>i}}const cy=(n,e)=>n?n+Sa(e):e,Ia=(n,e)=>pt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function t_(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function dy(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return ji(r)&&o.isScriptable(e)&&(r=py(e,r,n,t)),Ft(r)&&r.length&&(r=hy(e,r,n,o.isIndexable)),Ia(e,r)&&(r=Ms(r,s,l&&l[e],o)),r}function py(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);return r.add(n),e=e(l,o||i),r.delete(n),Ia(n,e)&&(e=Fa(s._scopes,s,n,e)),e}function hy(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Wn(l.index)&&i(n))e=e[l.index%e.length];else if(pt(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Fa(u,s,n,f);e.push(Ms(c,l,o&&o[n],r))}}return e}function n_(n,e,t){return ji(n)?n(e,t):n}const my=(n,e)=>n===!0?e:typeof n=="string"?Hi(e,n):void 0;function gy(n,e,t,i,s){for(const l of e){const o=my(t,l);if(o){n.add(o);const r=n_(o._fallback,t,s);if(Wn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Wn(i)&&t!==i)return null}return!1}function Fa(n,e,t,i){const s=e._rootScopes,l=n_(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=rf(r,o,t,l||t,i);return a===null||Wn(l)&&l!==t&&(a=rf(r,o,l,a,i),a===null)?!1:La(Array.from(r),[""],s,l,()=>_y(e,t,i))}function rf(n,e,t,i,s){for(;t;)t=gy(n,e,t,i,s);return t}function _y(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return Ft(s)&&pt(t)?t:s}function by(n,e,t,i){let s;for(const l of e)if(s=i_(cy(l,n),t),Wn(s))return Ia(n,s)?Fa(t,i,n,s):s}function i_(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Wn(i))return i}}function af(n){let e=n._keys;return e||(e=n._keys=vy(n._scopes)),e}function vy(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function s_(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,u,f;for(r=0,a=i;ren==="x"?"y":"x";function ky(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Wr(l,s),a=Wr(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function wy(n,e,t){const i=n.length;let s,l,o,r,a,u=Ts(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")Sy(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;lwindow.getComputedStyle(n,null);function Ty(n,e){return Wo(n).getPropertyValue(e)}const Dy=["top","right","bottom","left"];function ls(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=Dy[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Oy=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Ey(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(Oy(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function Xi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Wo(t),l=s.boxSizing==="border-box",o=ls(s,"padding"),r=ls(s,"border","width"),{x:a,y:u,box:f}=Ey(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:h,height:g}=e;return l&&(h-=o.width+r.width,g-=o.height+r.height),{x:Math.round((a-c)/h*t.width/i),y:Math.round((u-d)/g*t.height/i)}}function Ay(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Na(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Wo(l),a=ls(r,"border","width"),u=ls(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=To(r.maxWidth,l,"clientWidth"),s=To(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||wo,maxHeight:s||wo}}const cr=n=>Math.round(n*10)/10;function Py(n,e,t,i){const s=Wo(n),l=ls(s,"margin"),o=To(s.maxWidth,n,"clientWidth")||wo,r=To(s.maxHeight,n,"clientHeight")||wo,a=Ay(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=ls(s,"border","width"),d=ls(s,"padding");u-=d.width+c.width,f-=d.height+c.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=cr(Math.min(u,o,a.maxWidth)),f=cr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=cr(u/2)),{width:u,height:f}}function uf(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Ly=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function ff(n,e){const t=Ty(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Qi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Iy(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Fy(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Qi(n,s,t),r=Qi(s,l,t),a=Qi(l,e,t),u=Qi(o,r,t),f=Qi(r,a,t);return Qi(u,f,t)}const cf=new Map;function Ny(n,e){e=e||{};const t=n+JSON.stringify(e);let i=cf.get(t);return i||(i=new Intl.NumberFormat(n,e),cf.set(t,i)),i}function $l(n,e,t){return Ny(e,t).format(n)}const Ry=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Hy=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function dr(n,e,t){return n?Ry(e,t):Hy()}function jy(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function qy(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function r_(n){return n==="angle"?{between:fl,compare:$v,normalize:Pn}:{between:cl,compare:(e,t)=>e-t,normalize:e=>e}}function df({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function Vy(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=r_(i),a=e.length;let{start:u,end:f,loop:c}=n,d,h;if(c){for(u+=a,f+=a,d=0,h=a;da(s,S,y)&&r(s,S)!==0,M=()=>r(l,y)===0||a(l,S,y),D=()=>v||$(),E=()=>!v||M();for(let O=f,L=f;O<=c;++O)C=e[O%o],!C.skip&&(y=u(C[i]),y!==S&&(v=a(y,s,l),b===null&&D()&&(b=r(y,s)===0?O:L),b!==null&&E()&&(g.push(df({start:b,end:O,loop:d,count:o,style:h})),b=null),L=O,S=y));return b!==null&&g.push(df({start:b,end:c,loop:d,count:o,style:h})),g}function u_(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function By(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function Uy(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=zy(t,s,l,i);if(i===!0)return pf(n,[{start:o,end:r,loop:l}],t,e);const a=rMath.max(Math.min(n,t),e);function Zs(n){return Ii(wl(n*2.55),0,255)}function Ri(n){return Ii(wl(n*255),0,255)}function yi(n){return Ii(wl(n/2.55)/100,0,1)}function ef(n){return Ii(wl(n*100),0,100)}const Nn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Yr=[..."0123456789ABCDEF"],Ev=n=>Yr[n&15],Av=n=>Yr[(n&240)>>4]+Yr[n&15],Vl=n=>(n&240)>>4===(n&15),Pv=n=>Vl(n.r)&&Vl(n.g)&&Vl(n.b)&&Vl(n.a);function Lv(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Nn[n[1]]*17,g:255&Nn[n[2]]*17,b:255&Nn[n[3]]*17,a:e===5?Nn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Nn[n[1]]<<4|Nn[n[2]],g:Nn[n[3]]<<4|Nn[n[4]],b:Nn[n[5]]<<4|Nn[n[6]],a:e===9?Nn[n[7]]<<4|Nn[n[8]]:255})),t}const Iv=(n,e)=>n<255?e(n):"";function Fv(n){var e=Pv(n)?Ev:Av;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Iv(n.a,e):void 0}const Nv=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Jg(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function Rv(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function Hv(n,e,t){const i=Jg(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function jv(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=jv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Da(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ri)}function Oa(n,e,t){return Da(Jg,n,e,t)}function qv(n,e,t){return Da(Hv,n,e,t)}function Vv(n,e,t){return Da(Rv,n,e,t)}function Zg(n){return(n%360+360)%360}function zv(n){const e=Nv.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Zs(+e[5]):Ri(+e[5]));const s=Zg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=qv(s,l,o):e[1]==="hsv"?i=Vv(s,l,o):i=Oa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function Bv(n,e){var t=Ta(n);t[0]=Zg(t[0]+e),t=Oa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function Uv(n){if(!n)return;const e=Ta(n),t=e[0],i=ef(e[1]),s=ef(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${yi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const tf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},nf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Wv(){const n={},e=Object.keys(nf),t=Object.keys(tf);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let zl;function Yv(n){zl||(zl=Wv(),zl.transparent=[0,0,0,0]);const e=zl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Kv=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Jv(n){const e=Kv.exec(n);let t=255,i,s,l;if(!!e){if(e[7]!==i){const o=+e[7];t=e[8]?Zs(o):Ii(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Zs(i):Ii(i,0,255)),s=255&(e[4]?Zs(s):Ii(s,0,255)),l=255&(e[6]?Zs(l):Ii(l,0,255)),{r:i,g:s,b:l,a:t}}}function Zv(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${yi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ar=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ms=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Gv(n,e,t){const i=ms(yi(n.r)),s=ms(yi(n.g)),l=ms(yi(n.b));return{r:Ri(ar(i+t*(ms(yi(e.r))-i))),g:Ri(ar(s+t*(ms(yi(e.g))-s))),b:Ri(ar(l+t*(ms(yi(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Bl(n,e,t){if(n){let i=Ta(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Oa(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Gg(n,e){return n&&Object.assign(e||{},n)}function sf(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Ri(n[3]))):(e=Gg(n,{r:0,g:0,b:0,a:1}),e.a=Ri(e.a)),e}function Xv(n){return n.charAt(0)==="r"?Jv(n):zv(n)}class $o{constructor(e){if(e instanceof $o)return e;const t=typeof e;let i;t==="object"?i=sf(e):t==="string"&&(i=Lv(e)||Yv(e)||Xv(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Gg(this._rgb);return e&&(e.a=yi(e.a)),e}set rgb(e){this._rgb=sf(e)}rgbString(){return this._valid?Zv(this._rgb):void 0}hexString(){return this._valid?Fv(this._rgb):void 0}hslString(){return this._valid?Uv(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=Gv(this._rgb,e._rgb,t)),this}clone(){return new $o(this.rgb)}alpha(e){return this._rgb.a=Ri(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=wl(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Bl(this._rgb,2,e),this}darken(e){return Bl(this._rgb,2,-e),this}saturate(e){return Bl(this._rgb,1,e),this}desaturate(e){return Bl(this._rgb,1,-e),this}rotate(e){return Bv(this._rgb,e),this}}function Xg(n){return new $o(n)}function Qg(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function lf(n){return Qg(n)?n:Xg(n)}function ur(n){return Qg(n)?n:Xg(n).saturate(.5).darken(.1).hexString()}const rs=Object.create(null),Kr=Object.create(null);function il(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;it.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>ur(i.backgroundColor),this.hoverBorderColor=(t,i)=>ur(i.borderColor),this.hoverColor=(t,i)=>ur(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return fr(this,e,t)}get(e){return il(this,e)}describe(e,t){return fr(Kr,e,t)}override(e,t){return fr(rs,e,t)}route(e,t,i,s){const l=il(this,e),o=il(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return pt(a)?Object.assign({},u,a):_t(a,u)},set(a){this[r]=a}}})}}var vt=new Qv({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function xv(n){return!n||Mt(n.size)||Mt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function So(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function ey(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function dl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,sy(n,l),a=0;a+n||0;function Pa(n,e){const t={},i=pt(e),s=i?Object.keys(e):e,l=pt(n)?i?o=>_t(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=uy(l(o));return t}function xg(n){return Pa(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ys(n){return Pa(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Yn(n){const e=xg(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ln(n,e){n=n||{},e=e||vt.font;let t=_t(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=_t(n.style,e.style);i&&!(""+i).match(ry)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:_t(n.family,e.family),lineHeight:ay(_t(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:_t(n.weight,e.weight),string:""};return s.string=xv(s),s}function Ul(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Vi(n,e){return Object.assign(Object.create(n),e)}function La(n,e=[""],t=n,i,s=()=>n[0]){Wn(i)||(i=i_("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>La([o,...n],e,t,i)};return new Proxy(l,{deleteProperty(o,r){return delete o[r],delete o._keys,delete n[0][r],!0},get(o,r){return t_(o,r,()=>by(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return af(o).includes(r)},ownKeys(o){return af(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Ms(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:e_(n,i),setContext:l=>Ms(n,l,t,i),override:l=>Ms(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return t_(l,o,()=>dy(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function e_(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:ji(t)?t:()=>t,isIndexable:ji(i)?i:()=>i}}const cy=(n,e)=>n?n+Sa(e):e,Ia=(n,e)=>pt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function t_(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function dy(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return ji(r)&&o.isScriptable(e)&&(r=py(e,r,n,t)),It(r)&&r.length&&(r=hy(e,r,n,o.isIndexable)),Ia(e,r)&&(r=Ms(r,s,l&&l[e],o)),r}function py(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);return r.add(n),e=e(l,o||i),r.delete(n),Ia(n,e)&&(e=Fa(s._scopes,s,n,e)),e}function hy(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Wn(l.index)&&i(n))e=e[l.index%e.length];else if(pt(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Fa(u,s,n,f);e.push(Ms(c,l,o&&o[n],r))}}return e}function n_(n,e,t){return ji(n)?n(e,t):n}const my=(n,e)=>n===!0?e:typeof n=="string"?Hi(e,n):void 0;function gy(n,e,t,i,s){for(const l of e){const o=my(t,l);if(o){n.add(o);const r=n_(o._fallback,t,s);if(Wn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Wn(i)&&t!==i)return null}return!1}function Fa(n,e,t,i){const s=e._rootScopes,l=n_(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=rf(r,o,t,l||t,i);return a===null||Wn(l)&&l!==t&&(a=rf(r,o,l,a,i),a===null)?!1:La(Array.from(r),[""],s,l,()=>_y(e,t,i))}function rf(n,e,t,i,s){for(;t;)t=gy(n,e,t,i,s);return t}function _y(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return It(s)&&pt(t)?t:s}function by(n,e,t,i){let s;for(const l of e)if(s=i_(cy(l,n),t),Wn(s))return Ia(n,s)?Fa(t,i,n,s):s}function i_(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Wn(i))return i}}function af(n){let e=n._keys;return e||(e=n._keys=vy(n._scopes)),e}function vy(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function s_(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,u,f;for(r=0,a=i;ren==="x"?"y":"x";function ky(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Wr(l,s),a=Wr(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function wy(n,e,t){const i=n.length;let s,l,o,r,a,u=Ts(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")Sy(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;lwindow.getComputedStyle(n,null);function Ty(n,e){return Wo(n).getPropertyValue(e)}const Dy=["top","right","bottom","left"];function ls(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=Dy[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Oy=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Ey(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(Oy(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function Xi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Wo(t),l=s.boxSizing==="border-box",o=ls(s,"padding"),r=ls(s,"border","width"),{x:a,y:u,box:f}=Ey(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:h,height:g}=e;return l&&(h-=o.width+r.width,g-=o.height+r.height),{x:Math.round((a-c)/h*t.width/i),y:Math.round((u-d)/g*t.height/i)}}function Ay(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Na(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Wo(l),a=ls(r,"border","width"),u=ls(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=To(r.maxWidth,l,"clientWidth"),s=To(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||wo,maxHeight:s||wo}}const cr=n=>Math.round(n*10)/10;function Py(n,e,t,i){const s=Wo(n),l=ls(s,"margin"),o=To(s.maxWidth,n,"clientWidth")||wo,r=To(s.maxHeight,n,"clientHeight")||wo,a=Ay(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=ls(s,"border","width"),d=ls(s,"padding");u-=d.width+c.width,f-=d.height+c.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=cr(Math.min(u,o,a.maxWidth)),f=cr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=cr(u/2)),{width:u,height:f}}function uf(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Ly=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function ff(n,e){const t=Ty(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Qi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Iy(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Fy(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Qi(n,s,t),r=Qi(s,l,t),a=Qi(l,e,t),u=Qi(o,r,t),f=Qi(r,a,t);return Qi(u,f,t)}const cf=new Map;function Ny(n,e){e=e||{};const t=n+JSON.stringify(e);let i=cf.get(t);return i||(i=new Intl.NumberFormat(n,e),cf.set(t,i)),i}function $l(n,e,t){return Ny(e,t).format(n)}const Ry=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Hy=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function dr(n,e,t){return n?Ry(e,t):Hy()}function jy(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function qy(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function r_(n){return n==="angle"?{between:fl,compare:$v,normalize:Pn}:{between:cl,compare:(e,t)=>e-t,normalize:e=>e}}function df({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function Vy(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=r_(i),a=e.length;let{start:u,end:f,loop:c}=n,d,h;if(c){for(u+=a,f+=a,d=0,h=a;da(s,S,y)&&r(s,S)!==0,M=()=>r(l,y)===0||a(l,S,y),D=()=>v||$(),E=()=>!v||M();for(let O=f,L=f;O<=c;++O)C=e[O%o],!C.skip&&(y=u(C[i]),y!==S&&(v=a(y,s,l),b===null&&D()&&(b=r(y,s)===0?O:L),b!==null&&E()&&(g.push(df({start:b,end:O,loop:d,count:o,style:h})),b=null),L=O,S=y));return b!==null&&g.push(df({start:b,end:c,loop:d,count:o,style:h})),g}function u_(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function By(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function Uy(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=zy(t,s,l,i);if(i===!0)return pf(n,[{start:o,end:r,loop:l}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Ug.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);!t||(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var bi=new Ky;const mf="transparent",Jy={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=lf(n||mf),s=i.valid&&lf(e||mf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Zy{constructor(e,t,i,s){const l=t[i];s=Ul([e.to,s,l,e.from]);const o=Ul([e.from,l,s]);this._active=!0,this._fn=e.fn||Jy[e.type||typeof o],this._easing=nl[e.easing]||nl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Ul([e.to,t,s,e.from]),this._from=Ul([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;sn!=="onProgress"&&n!=="onComplete"&&n!=="fn"});bt.set("animations",{colors:{type:"color",properties:Xy},numbers:{type:"number",properties:Gy}});bt.describe("animations",{_fallback:"animation"});bt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class f_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!pt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!pt(s))return;const l={};for(const o of Qy)l[o]=s[o];(Ft(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=ek(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&xy(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new Zy(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return bi.add(this._chart,i),!0}}function xy(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function yf(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,u=o.axis,f=sk(l,o,i),c=e.length;let d;for(let h=0;ht[i].axis===e).shift()}function rk(n,e){return Vi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function ak(n,e,t){return Vi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function qs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(!!i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const hr=n=>n==="reset"||n==="none",kf=(n,e)=>e?n:Object.assign({},n),uk=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:c_(t,!0),values:null};class oi{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=bf(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&qs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,h,g)=>c==="x"?d:c==="r"?g:h,l=t.xAxisID=gt(i.xAxisID,pr(e,"x")),o=t.yAxisID=gt(i.yAxisID,pr(e,"y")),r=t.rAxisID=gt(i.rAxisID,pr(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Gu(this._data,this),e._stacked&&qs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(pt(t))this._data=ik(t);else if(i!==t){if(i){Gu(i,this);const s=this._cachedMeta;qs(s),s._parsed=[]}t&&Object.isExtensible(t)&&Tv(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const l=t._stacked;t._stacked=bf(t.vScale,t),t.stack!==i.stack&&(s=!0,qs(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&yf(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{Ft(s[e])?d=this.parseArrayData(i,s,e,t):pt(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const h=()=>c[r]===null||u&&c[r]v||c=0;--d)if(!g()){this.updateRangeFromParsed(u,e,h,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s),v=u.resolveNamedOptions(d,h,g,c);return v.$shared&&(v.$shared=a,l[o]=Object.freeze(kf(v,a))),v}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new f_(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}getSharedOptions(e){if(!!e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||hr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){hr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!hr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;rs-l))}return n._cache.$bar}function ck(n){const e=n.iScale,t=fk(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Wn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s0?s[n-1]:null,r=nMath.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:s,end:l,min:o,max:r}}function d_(n,e,t,i){return Ft(n)?hk(n,e,t,i):e[t.axis]=t.parse(n,i),e}function wf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u=t?1:-1)}function gk(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(Mt(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,c=r.axis;for(let d=t;dfl(S,r,a,!0)?1:Math.max($,$*t,M,M*t),g=(S,$,M)=>fl(S,r,a,!0)?-1:Math.min($,$*t,M,M*t),v=h(0,u,c),b=h(Bt,f,d),y=g(Wt,u,c),C=g(Wt+Bt,f,d);i=(v-y)/2,s=(b-C)/2,l=-(v+y)/2,o=-(b+C)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Sl extends oi{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let l=a=>+i[a];if(pt(i[e])){const{key:a="value"}=this._parsing;l=u=>+Hi(i[u],a)}let o,r;for(o=e,r=e+t;o0&&!isNaN(e)?Et*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=$l(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;sn!=="spacing",_indexable:n=>n!=="spacing"};Sl.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return Ft(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Yo extends oi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=Yg(t,s,o);this._drawStart=r,this._drawCount=a,Kg(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,h=r.axis,{spanGaps:g,segment:v}=this.options,b=Cs(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let C=t>0&&this.getParsed(t-1);for(let S=t;S0&&Math.abs(M[d]-C[d])>b,v&&(D.parsed=M,D.raw=u.data[S]),c&&(D.options=f||this.resolveDataElementOptions(S,$.active?"active":s)),y||this.updateElement($,S,D,s),C=M}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Yo.id="line";Yo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Yo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class ja extends oi{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=$l(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return s_.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(lt.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,c=u.yCenter,d=u.getIndexAngle(0)-.5*Wt;let h=d,g;const v=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Qn(this.resolveDataElementOptions(e,t).angle||i):0}}ja.id="polarArea";ja.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};ja.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class p_ extends Sl{}p_.id="pie";p_.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class qa extends oi{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return s_.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}}Ci.defaults={};Ci.defaultRoutes=void 0;const h_={values(n){return Ft(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=kk(n,t)}const o=zn(Math.abs(l)),r=Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),$l(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(zn(n)));return i===1||i===2||i===5?h_.numeric.call(this,n,e,t):""}};function kk(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Ko={formatters:h_};bt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ko.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});bt.route("scale.ticks","color","","color");bt.route("scale.grid","color","","borderColor");bt.route("scale.grid","borderColor","","borderColor");bt.route("scale.title","color","","color");bt.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});bt.describe("scales",{_fallback:"scale"});bt.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function wk(n,e){const t=n.options.ticks,i=t.maxTicksLimit||$k(n),s=t.major.enabled?Ck(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return Mk(e,a,s,l/i),a;const u=Sk(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Yl(e,a,u,Mt(d)?0:o-d,o),f=0,c=l-1;fs)return a}return Math.max(s,1)}function Ck(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Cf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Mf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function Ek(n,e){Dt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:Rn(t,Rn(i,t)),max:Rn(i,Rn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){zt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=fy(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,h=un(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:h/(i-1),c+6>r&&(r=h/(i-(e.offset?.5:1)),a=this.maxHeight-Vs(e.grid)-t.padding-Tf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=Ca(Math.min(Math.asin(un((f.highest.height+6)/r,-1,1)),Math.asin(un(a/u,-1,1))-Math.asin(un(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){zt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){zt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Tf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Vs(l)+a):(e.height=this.maxHeight,e.width=Vs(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),h=i.padding*2,g=Qn(this.labelRotation),v=Math.cos(g),b=Math.sin(g);if(r){const y=i.mirror?0:b*c.width+v*d.height;e.height=Math.min(this.maxHeight,e.height+y+h)}else{const y=i.mirror?0:v*c.width+b*d.height;e.width=Math.min(this.maxWidth,e.width+y+h)}this._calculatePadding(u,f,b,v)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;a?u?(d=s*e.width,h=i*t.height):(d=i*e.height,h=s*t.width):l==="start"?h=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((h-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){zt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:l[E]||0,height:o[E]||0});return{first:D(0),last:D(t-1),widest:D($),highest:D(M),widths:l,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return Sv(this._alignToPixels?Ki(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),c=Vs(l),d=[],h=l.setContext(this.getContext()),g=h.drawBorder?h.borderWidth:0,v=g/2,b=function(K){return Ki(i,K,g)};let y,C,S,$,M,D,E,O,L,I,N,B;if(o==="top")y=b(this.bottom),D=this.bottom-c,O=y-v,I=b(e.top)+v,B=e.bottom;else if(o==="bottom")y=b(this.top),I=e.top,B=b(e.bottom)-v,D=y+v,O=this.top+c;else if(o==="left")y=b(this.right),M=this.right-c,E=y-v,L=b(e.left)+v,N=e.right;else if(o==="right")y=b(this.left),L=e.left,N=b(e.right)-v,M=y+v,E=this.left+c;else if(t==="x"){if(o==="center")y=b((e.top+e.bottom)/2+.5);else if(pt(o)){const K=Object.keys(o)[0],se=o[K];y=b(this.chart.scales[K].getPixelForValue(se))}I=e.top,B=e.bottom,D=y+v,O=D+c}else if(t==="y"){if(o==="center")y=b((e.left+e.right)/2);else if(pt(o)){const K=Object.keys(o)[0],se=o[K];y=b(this.chart.scales[K].getPixelForValue(se))}M=y-v,E=M-c,L=e.left,N=e.right}const U=gt(s.ticks.maxTicksLimit,f),ee=Math.max(1,Math.ceil(f/U));for(C=0;Cl.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");bt.route(l,s,a,r)})}function Rk(n){return"id"in n&&"defaults"in n}class Hk{constructor(){this.controllers=new Kl(oi,"datasets",!0),this.elements=new Kl(Ci,"elements"),this.plugins=new Kl(Object,"plugins"),this.scales=new Kl(us,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):Dt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Sa(e);zt(i["before"+s],[],i),t[e](i),zt(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t0&&this.getParsed(t-1);for(let $=t;$0&&Math.abs(D[h]-S[h])>y,b&&(E.parsed=D,E.raw=u.data[$]),d&&(E.options=c||this.resolveDataElementOptions($,M.active?"active":s)),C||this.updateElement(M,$,E,s),S=D}this.updateSharedOptions(c,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}Va.id="scatter";Va.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Va.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Ji(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Zr{constructor(e){this.options=e||{}}init(e){}formats(){return Ji()}parse(e,t){return Ji()}format(e,t){return Ji()}add(e,t,i){return Ji()}diff(e,t,i){return Ji()}startOf(e,t,i){return Ji()}endOf(e,t){return Ji()}}Zr.override=function(n){Object.assign(Zr.prototype,n)};var m_={_date:Zr};function jk(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const a=r._reversePixels?Cv:es;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(l,e,t-f),d=a(l,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Cl(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var Bk={evaluateInteractionItems:Cl,modes:{index(n,e,t,i){const s=Xi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?gr(n,s,l,i,o):_r(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=Xi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?gr(n,s,l,i,o):_r(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function Of(n,e){return n.filter(t=>g_.indexOf(t.pos)===-1&&t.box.axis===e)}function Bs(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function Uk(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Bs(zs(e,"left"),!0),s=Bs(zs(e,"right")),l=Bs(zs(e,"top"),!0),o=Bs(zs(e,"bottom")),r=Of(e,"x"),a=Of(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:zs(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Ef(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function __(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function Jk(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!pt(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&__(o,l.getPadding());const r=Math.max(0,e.outerWidth-Ef(o,n,"left","right")),a=Math.max(0,e.outerHeight-Ef(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function Zk(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function Gk(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function Gs(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof v.beforeLayout=="function"&&v.beforeLayout()});const f=a.reduce((v,b)=>b.box.options&&b.box.options.display===!1?v:v+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);__(d,Yn(i));const h=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),g=Yk(a.concat(u),c);Gs(r.fullSize,h,c,g),Gs(a,h,c,g),Gs(u,h,c,g)&&Gs(a,h,c,g),Zk(h),Af(r.leftAndTop,h,c,g),h.x+=h.w,h.y+=h.h,Af(r.rightAndBottom,h,c,g),n.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Dt(r.chartArea,v=>{const b=v.box;Object.assign(b,n.chartArea),b.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class b_{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class Xk extends b_{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ro="$chartjs",Qk={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Pf=n=>n===null||n==="";function xk(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ro]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Pf(s)){const l=ff(n,"width");l!==void 0&&(n.width=l)}if(Pf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=ff(n,"height");l!==void 0&&(n.height=l)}return n}const v_=Ly?{passive:!0}:!1;function e2(n,e,t){n.addEventListener(e,t,v_)}function t2(n,e,t){n.canvas.removeEventListener(e,t,v_)}function n2(n,e){const t=Qk[n.type]||n.type,{x:i,y:s}=Xi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Do(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function i2(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Do(r.addedNodes,i),o=o&&!Do(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function s2(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Do(r.removedNodes,i),o=o&&!Do(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const pl=new Map;let Lf=0;function y_(){const n=window.devicePixelRatio;n!==Lf&&(Lf=n,pl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function l2(n,e){pl.size||window.addEventListener("resize",y_),pl.set(n,e)}function o2(n){pl.delete(n),pl.size||window.removeEventListener("resize",y_)}function r2(n,e,t){const i=n.canvas,s=i&&Na(i);if(!s)return;const l=Wg((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),l2(n,l),o}function br(n,e,t){t&&t.disconnect(),e==="resize"&&o2(n)}function a2(n,e,t){const i=n.canvas,s=Wg(l=>{n.ctx!==null&&t(n2(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return e2(i,e,s),s}class u2 extends b_{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(xk(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[ro])return!1;const i=t[ro].initial;["height","width"].forEach(l=>{const o=i[l];Mt(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[ro],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:i2,detach:s2,resize:r2}[t]||a2;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:br,detach:br,resize:br}[t]||t2)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return Py(e,t,i,s)}isAttached(e){const t=Na(e);return!!(t&&t.isConnected)}}function f2(n){return!o_()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Xk:u2}class c2{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(zt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){Mt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=gt(i.options&&i.options.plugins,{}),l=d2(i);return s===!1&&!t?[]:h2(e,l,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(l,o)=>l.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function d2(n){const e={},t=[],i=Object.keys(ui.plugins.items);for(let l=0;l{const a=i[r];if(!pt(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const u=Xr(r,a),f=_2(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=el(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||Gr(a,e),c=(rs[a]||{}).scales||{};Object.keys(c).forEach(d=>{const h=g2(d,u),g=r[h+"AxisID"]||l[h]||h;o[g]=o[g]||Object.create(null),el(o[g],[{axis:h},i[g],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];el(a,[bt.scales[a.type],bt.scale])}),o}function k_(n){const e=n.options||(n.options={});e.plugins=gt(e.plugins,{}),e.scales=v2(n,e)}function w_(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function y2(n){return n=n||{},n.data=w_(n.data),k_(n),n}const If=new Map,$_=new Set;function Gl(n,e){let t=If.get(n);return t||(t=e(),If.set(n,t),$_.add(t)),t}const Us=(n,e,t)=>{const i=Hi(e,t);i!==void 0&&n.add(i)};class k2{constructor(e){this._config=y2(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=w_(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),k_(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Gl(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Gl(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Gl(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Gl(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Us(a,e,c))),f.forEach(c=>Us(a,s,c)),f.forEach(c=>Us(a,rs[l]||{},c)),f.forEach(c=>Us(a,bt,c)),f.forEach(c=>Us(a,Kr,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),$_.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,rs[t]||{},bt.datasets[t]||{},{type:t},bt,Kr]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Ff(this._resolverCache,e,s);let a=o;if($2(o,t)){l.$shared=!1,i=ji(i)?i():i;const u=this.createResolver(e,i,r);a=Ms(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Ff(this._resolverCache,e,i);return pt(t)?Ms(l,t,void 0,s):l}}function Ff(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:La(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const w2=n=>pt(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||ji(n[t]),!1);function $2(n,e){const{isScriptable:t,isIndexable:i}=e_(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(ji(r)||w2(r))||o&&Ft(r))return!0}return!1}var S2="3.9.1";const C2=["top","bottom","left","right","chartArea"];function Nf(n,e){return n==="top"||n==="bottom"||C2.indexOf(n)===-1&&e==="x"}function Rf(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Hf(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),zt(t&&t.onComplete,[n],e)}function M2(n){const e=n.chart,t=e.options.animation;zt(t&&t.onProgress,[n],e)}function S_(n){return o_()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Oo={},C_=n=>{const e=S_(n);return Object.values(Oo).filter(t=>t.canvas===e).pop()};function T2(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function D2(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Eo{constructor(e,t){const i=this.config=new k2(t),s=S_(e),l=C_(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||f2(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=dv(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new c2,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Dv(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Oo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}bi.listen(this,"complete",Hf),bi.listen(this,"progress",M2),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return Mt(e)?t&&l?l:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():uf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return of(this.canvas,this.ctx),this}stop(){return bi.stop(this),this}resize(e,t){bi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,uf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),zt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};Dt(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=Xr(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),Dt(l,o=>{const r=o.options,a=r.id,u=Xr(a,r),f=gt(r.type,o.dtype);(r.position===void 0||Nf(r.position,u)!==Nf(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=ui.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),Dt(s,(o,r)=>{o||delete i[r]}),Dt(i,o=>{Zl.configure(this,o,o.options),Zl.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Rf("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){Dt(this.scales,e=>{Zl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Yu(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;T2(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Zl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],Dt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ea(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&Aa(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return dl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=Bk.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Vi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);Wn(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),bi.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};Dt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){Dt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},Dt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!yo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=bv(e),u=D2(e,this._lastEvent,i,a);i&&(this._lastEvent=null,zt(l.onHover,[e,r,this],this),a&&zt(l.onClick,[e,r,this],this));const f=!yo(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const jf=()=>Dt(Eo.instances,n=>n._plugins.invalidate()),Oi=!0;Object.defineProperties(Eo,{defaults:{enumerable:Oi,value:bt},instances:{enumerable:Oi,value:Oo},overrides:{enumerable:Oi,value:rs},registry:{enumerable:Oi,value:ui},version:{enumerable:Oi,value:S2},getChart:{enumerable:Oi,value:C_},register:{enumerable:Oi,value:(...n)=>{ui.add(...n),jf()}},unregister:{enumerable:Oi,value:(...n)=>{ui.remove(...n),jf()}}});function M_(n,e,t){const{startAngle:i,pixelMargin:s,x:l,y:o,outerRadius:r,innerRadius:a}=e;let u=s/r;n.beginPath(),n.arc(l,o,r,i-u,t+u),a>s?(u=s/a,n.arc(l,o,a,t+u,i-u,!0)):n.arc(l,o,s,t+Bt,i-Bt),n.closePath(),n.clip()}function O2(n){return Pa(n,["outerStart","outerEnd","innerStart","innerEnd"])}function E2(n,e,t,i){const s=O2(n.options.borderRadius),l=(t-e)/2,o=Math.min(l,i*e/2),r=a=>{const u=(t-Math.min(l,a))*i/2;return un(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:un(s.innerStart,0,o),innerEnd:un(s.innerEnd,0,o)}}function gs(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function Qr(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let h=0;const g=s-a;if(i){const K=f>0?f-i:0,se=c>0?c-i:0,Y=(K+se)/2,te=Y!==0?g*Y/(Y+i):g;h=(g-te)/2}const v=Math.max(.001,g*c-t/Wt)/c,b=(g-v)/2,y=a+b+h,C=s-b-h,{outerStart:S,outerEnd:$,innerStart:M,innerEnd:D}=E2(e,d,c,C-y),E=c-S,O=c-$,L=y+S/E,I=C-$/O,N=d+M,B=d+D,U=y+M/N,ee=C-D/B;if(n.beginPath(),l){if(n.arc(o,r,c,L,I),$>0){const Y=gs(O,I,o,r);n.arc(Y.x,Y.y,$,I,C+Bt)}const K=gs(B,C,o,r);if(n.lineTo(K.x,K.y),D>0){const Y=gs(B,ee,o,r);n.arc(Y.x,Y.y,D,C+Bt,ee+Math.PI)}if(n.arc(o,r,d,C-D/d,y+M/d,!0),M>0){const Y=gs(N,U,o,r);n.arc(Y.x,Y.y,M,U+Math.PI,y-Bt)}const se=gs(E,y,o,r);if(n.lineTo(se.x,se.y),S>0){const Y=gs(E,L,o,r);n.arc(Y.x,Y.y,S,y-Bt,L)}}else{n.moveTo(o,r);const K=Math.cos(L)*c+o,se=Math.sin(L)*c+r;n.lineTo(K,se);const Y=Math.cos(I)*c+o,te=Math.sin(I)*c+r;n.lineTo(Y,te)}n.closePath()}function A2(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){Qr(n,e,t,i,o+Et,s);for(let u=0;u=Et||fl(l,r,a),v=cl(o,u+d,f+d);return g&&v}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,c=(o+r+u+a)/2;return{x:t+Math.cos(f)*c,y:i+Math.sin(f)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>Et?Math.floor(i/Et):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*r,Math.sin(u)*r),this.circumference>=Wt&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=A2(e,this,r,l,o);L2(e,this,r,l,a,o),e.restore()}}za.id="arc";za.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};za.defaultRoutes={backgroundColor:"backgroundColor"};function T_(n,e,t=e){n.lineCap=gt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(gt(t.borderDash,e.borderDash)),n.lineDashOffset=gt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=gt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=gt(t.borderWidth,e.borderWidth),n.strokeStyle=gt(t.borderColor,e.borderColor)}function I2(n,e,t){n.lineTo(t.x,t.y)}function F2(n){return n.stepped?ny:n.tension||n.cubicInterpolationMode==="monotone"?iy:I2}function D_(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-$:$))%l,S=()=>{v!==b&&(n.lineTo(f,b),n.lineTo(f,v),n.lineTo(f,y))};for(a&&(h=s[C(0)],n.moveTo(h.x,h.y)),d=0;d<=r;++d){if(h=s[C(d)],h.skip)continue;const $=h.x,M=h.y,D=$|0;D===g?(Mb&&(b=M),f=(c*f+$)/++c):(S(),n.lineTo($,M),g=D,c=0,v=b=M),y=M}S()}function xr(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?R2:N2}function H2(n){return n.stepped?Iy:n.tension||n.cubicInterpolationMode==="monotone"?Fy:Qi}function j2(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),T_(n,e.options),n.stroke(s)}function q2(n,e,t,i){const{segments:s,options:l}=e,o=xr(e);for(const r of s)T_(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const V2=typeof Path2D=="function";function z2(n,e,t,i){V2&&!e.options.segment?j2(n,e,t,i):q2(n,e,t,i)}class zi extends Ci{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;My(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Uy(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],l=this.points,o=u_(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=H2(i);let u,f;for(u=0,f=o.length;un!=="borderDash"&&n!=="fill"};function qf(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=Ua(o,r,s);const a=s[o],u=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:u.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:u.y}))}),l}function Ua(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Vf(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function E_(n,e){let t=[],i=!1;return Ft(n)?(i=!0,t=n):t=Z2(n,e),t.length?new zi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function zf(n){return n&&n.fill!==!1}function G2(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!Yt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function X2(n,e,t){const i=tw(n);if(pt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Yt(s)&&Math.floor(s)===s?Q2(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Q2(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function x2(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:pt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function ew(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:pt(n)?i=n.value:i=e.getBaseValue(),i}function tw(n){const e=n.options,t=e.fill;let i=gt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function nw(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=iw(e,t);r.push(E_({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;!r||(r.line.updateControlPoints(l,r.axis),i&&r.fill&&kr(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;zf(l)&&kr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!zf(i)||t.drawTime!=="beforeDatasetDraw"||kr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const sl={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;er({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Ug.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);!t||(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var bi=new Ky;const mf="transparent",Jy={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=lf(n||mf),s=i.valid&&lf(e||mf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Zy{constructor(e,t,i,s){const l=t[i];s=Ul([e.to,s,l,e.from]);const o=Ul([e.from,l,s]);this._active=!0,this._fn=e.fn||Jy[e.type||typeof o],this._easing=nl[e.easing]||nl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Ul([e.to,t,s,e.from]),this._from=Ul([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;sn!=="onProgress"&&n!=="onComplete"&&n!=="fn"});vt.set("animations",{colors:{type:"color",properties:Xy},numbers:{type:"number",properties:Gy}});vt.describe("animations",{_fallback:"animation"});vt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class f_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!pt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!pt(s))return;const l={};for(const o of Qy)l[o]=s[o];(It(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=ek(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&xy(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new Zy(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return bi.add(this._chart,i),!0}}function xy(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function yf(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,u=o.axis,f=sk(l,o,i),c=e.length;let d;for(let h=0;ht[i].axis===e).shift()}function rk(n,e){return Vi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function ak(n,e,t){return Vi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function qs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(!!i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const hr=n=>n==="reset"||n==="none",kf=(n,e)=>e?n:Object.assign({},n),uk=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:c_(t,!0),values:null};class oi{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=bf(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&qs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,h,g)=>c==="x"?d:c==="r"?g:h,l=t.xAxisID=_t(i.xAxisID,pr(e,"x")),o=t.yAxisID=_t(i.yAxisID,pr(e,"y")),r=t.rAxisID=_t(i.rAxisID,pr(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Gu(this._data,this),e._stacked&&qs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(pt(t))this._data=ik(t);else if(i!==t){if(i){Gu(i,this);const s=this._cachedMeta;qs(s),s._parsed=[]}t&&Object.isExtensible(t)&&Tv(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const l=t._stacked;t._stacked=bf(t.vScale,t),t.stack!==i.stack&&(s=!0,qs(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&yf(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{It(s[e])?d=this.parseArrayData(i,s,e,t):pt(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const h=()=>c[r]===null||u&&c[r]v||c=0;--d)if(!g()){this.updateRangeFromParsed(u,e,h,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s),v=u.resolveNamedOptions(d,h,g,c);return v.$shared&&(v.$shared=a,l[o]=Object.freeze(kf(v,a))),v}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new f_(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}getSharedOptions(e){if(!!e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||hr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){hr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!hr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;rs-l))}return n._cache.$bar}function ck(n){const e=n.iScale,t=fk(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Wn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s0?s[n-1]:null,r=nMath.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:s,end:l,min:o,max:r}}function d_(n,e,t,i){return It(n)?hk(n,e,t,i):e[t.axis]=t.parse(n,i),e}function wf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u=t?1:-1)}function gk(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(Mt(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,c=r.axis;for(let d=t;dfl(S,r,a,!0)?1:Math.max($,$*t,M,M*t),g=(S,$,M)=>fl(S,r,a,!0)?-1:Math.min($,$*t,M,M*t),v=h(0,u,c),b=h(zt,f,d),y=g(Ut,u,c),C=g(Ut+zt,f,d);i=(v-y)/2,s=(b-C)/2,l=-(v+y)/2,o=-(b+C)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Sl extends oi{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let l=a=>+i[a];if(pt(i[e])){const{key:a="value"}=this._parsing;l=u=>+Hi(i[u],a)}let o,r;for(o=e,r=e+t;o0&&!isNaN(e)?At*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=$l(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;sn!=="spacing",_indexable:n=>n!=="spacing"};Sl.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return It(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Yo extends oi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=Yg(t,s,o);this._drawStart=r,this._drawCount=a,Kg(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,h=r.axis,{spanGaps:g,segment:v}=this.options,b=Cs(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let C=t>0&&this.getParsed(t-1);for(let S=t;S0&&Math.abs(M[d]-C[d])>b,v&&(D.parsed=M,D.raw=u.data[S]),c&&(D.options=f||this.resolveDataElementOptions(S,$.active?"active":s)),y||this.updateElement($,S,D,s),C=M}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Yo.id="line";Yo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Yo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class ja extends oi{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=$l(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return s_.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(lt.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,c=u.yCenter,d=u.getIndexAngle(0)-.5*Ut;let h=d,g;const v=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Qn(this.resolveDataElementOptions(e,t).angle||i):0}}ja.id="polarArea";ja.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};ja.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class p_ extends Sl{}p_.id="pie";p_.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class qa extends oi{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return s_.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}}Ci.defaults={};Ci.defaultRoutes=void 0;const h_={values(n){return It(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=kk(n,t)}const o=zn(Math.abs(l)),r=Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),$l(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(zn(n)));return i===1||i===2||i===5?h_.numeric.call(this,n,e,t):""}};function kk(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Ko={formatters:h_};vt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ko.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});vt.route("scale.ticks","color","","color");vt.route("scale.grid","color","","borderColor");vt.route("scale.grid","borderColor","","borderColor");vt.route("scale.title","color","","color");vt.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});vt.describe("scales",{_fallback:"scale"});vt.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function wk(n,e){const t=n.options.ticks,i=t.maxTicksLimit||$k(n),s=t.major.enabled?Ck(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return Mk(e,a,s,l/i),a;const u=Sk(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Yl(e,a,u,Mt(d)?0:o-d,o),f=0,c=l-1;fs)return a}return Math.max(s,1)}function Ck(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Cf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Mf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function Ek(n,e){Et(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:Rn(t,Rn(i,t)),max:Rn(i,Rn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Vt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=fy(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,h=un(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:h/(i-1),c+6>r&&(r=h/(i-(e.offset?.5:1)),a=this.maxHeight-Vs(e.grid)-t.padding-Tf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=Ca(Math.min(Math.asin(un((f.highest.height+6)/r,-1,1)),Math.asin(un(a/u,-1,1))-Math.asin(un(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){Vt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Vt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Tf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Vs(l)+a):(e.height=this.maxHeight,e.width=Vs(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),h=i.padding*2,g=Qn(this.labelRotation),v=Math.cos(g),b=Math.sin(g);if(r){const y=i.mirror?0:b*c.width+v*d.height;e.height=Math.min(this.maxHeight,e.height+y+h)}else{const y=i.mirror?0:v*c.width+b*d.height;e.width=Math.min(this.maxWidth,e.width+y+h)}this._calculatePadding(u,f,b,v)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;a?u?(d=s*e.width,h=i*t.height):(d=i*e.height,h=s*t.width):l==="start"?h=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((h-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Vt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:l[E]||0,height:o[E]||0});return{first:D(0),last:D(t-1),widest:D($),highest:D(M),widths:l,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return Sv(this._alignToPixels?Ki(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),c=Vs(l),d=[],h=l.setContext(this.getContext()),g=h.drawBorder?h.borderWidth:0,v=g/2,b=function(K){return Ki(i,K,g)};let y,C,S,$,M,D,E,O,L,I,N,B;if(o==="top")y=b(this.bottom),D=this.bottom-c,O=y-v,I=b(e.top)+v,B=e.bottom;else if(o==="bottom")y=b(this.top),I=e.top,B=b(e.bottom)-v,D=y+v,O=this.top+c;else if(o==="left")y=b(this.right),M=this.right-c,E=y-v,L=b(e.left)+v,N=e.right;else if(o==="right")y=b(this.left),L=e.left,N=b(e.right)-v,M=y+v,E=this.left+c;else if(t==="x"){if(o==="center")y=b((e.top+e.bottom)/2+.5);else if(pt(o)){const K=Object.keys(o)[0],se=o[K];y=b(this.chart.scales[K].getPixelForValue(se))}I=e.top,B=e.bottom,D=y+v,O=D+c}else if(t==="y"){if(o==="center")y=b((e.left+e.right)/2);else if(pt(o)){const K=Object.keys(o)[0],se=o[K];y=b(this.chart.scales[K].getPixelForValue(se))}M=y-v,E=M-c,L=e.left,N=e.right}const U=_t(s.ticks.maxTicksLimit,f),ee=Math.max(1,Math.ceil(f/U));for(C=0;Cl.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");vt.route(l,s,a,r)})}function Rk(n){return"id"in n&&"defaults"in n}class Hk{constructor(){this.controllers=new Kl(oi,"datasets",!0),this.elements=new Kl(Ci,"elements"),this.plugins=new Kl(Object,"plugins"),this.scales=new Kl(us,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):Et(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Sa(e);Vt(i["before"+s],[],i),t[e](i),Vt(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t0&&this.getParsed(t-1);for(let $=t;$0&&Math.abs(D[h]-S[h])>y,b&&(E.parsed=D,E.raw=u.data[$]),d&&(E.options=c||this.resolveDataElementOptions($,M.active?"active":s)),C||this.updateElement(M,$,E,s),S=D}this.updateSharedOptions(c,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}Va.id="scatter";Va.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Va.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Ji(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Zr{constructor(e){this.options=e||{}}init(e){}formats(){return Ji()}parse(e,t){return Ji()}format(e,t){return Ji()}add(e,t,i){return Ji()}diff(e,t,i){return Ji()}startOf(e,t,i){return Ji()}endOf(e,t){return Ji()}}Zr.override=function(n){Object.assign(Zr.prototype,n)};var m_={_date:Zr};function jk(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const a=r._reversePixels?Cv:es;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(l,e,t-f),d=a(l,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Cl(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var Bk={evaluateInteractionItems:Cl,modes:{index(n,e,t,i){const s=Xi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?gr(n,s,l,i,o):_r(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=Xi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?gr(n,s,l,i,o):_r(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function Of(n,e){return n.filter(t=>g_.indexOf(t.pos)===-1&&t.box.axis===e)}function Bs(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function Uk(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Bs(zs(e,"left"),!0),s=Bs(zs(e,"right")),l=Bs(zs(e,"top"),!0),o=Bs(zs(e,"bottom")),r=Of(e,"x"),a=Of(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:zs(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Ef(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function __(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function Jk(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!pt(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&__(o,l.getPadding());const r=Math.max(0,e.outerWidth-Ef(o,n,"left","right")),a=Math.max(0,e.outerHeight-Ef(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function Zk(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function Gk(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function Gs(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof v.beforeLayout=="function"&&v.beforeLayout()});const f=a.reduce((v,b)=>b.box.options&&b.box.options.display===!1?v:v+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);__(d,Yn(i));const h=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),g=Yk(a.concat(u),c);Gs(r.fullSize,h,c,g),Gs(a,h,c,g),Gs(u,h,c,g)&&Gs(a,h,c,g),Zk(h),Af(r.leftAndTop,h,c,g),h.x+=h.w,h.y+=h.h,Af(r.rightAndBottom,h,c,g),n.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Et(r.chartArea,v=>{const b=v.box;Object.assign(b,n.chartArea),b.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class b_{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class Xk extends b_{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ro="$chartjs",Qk={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Pf=n=>n===null||n==="";function xk(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ro]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Pf(s)){const l=ff(n,"width");l!==void 0&&(n.width=l)}if(Pf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=ff(n,"height");l!==void 0&&(n.height=l)}return n}const v_=Ly?{passive:!0}:!1;function e2(n,e,t){n.addEventListener(e,t,v_)}function t2(n,e,t){n.canvas.removeEventListener(e,t,v_)}function n2(n,e){const t=Qk[n.type]||n.type,{x:i,y:s}=Xi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Do(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function i2(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Do(r.addedNodes,i),o=o&&!Do(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function s2(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Do(r.removedNodes,i),o=o&&!Do(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const pl=new Map;let Lf=0;function y_(){const n=window.devicePixelRatio;n!==Lf&&(Lf=n,pl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function l2(n,e){pl.size||window.addEventListener("resize",y_),pl.set(n,e)}function o2(n){pl.delete(n),pl.size||window.removeEventListener("resize",y_)}function r2(n,e,t){const i=n.canvas,s=i&&Na(i);if(!s)return;const l=Wg((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),l2(n,l),o}function br(n,e,t){t&&t.disconnect(),e==="resize"&&o2(n)}function a2(n,e,t){const i=n.canvas,s=Wg(l=>{n.ctx!==null&&t(n2(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return e2(i,e,s),s}class u2 extends b_{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(xk(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[ro])return!1;const i=t[ro].initial;["height","width"].forEach(l=>{const o=i[l];Mt(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[ro],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:i2,detach:s2,resize:r2}[t]||a2;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:br,detach:br,resize:br}[t]||t2)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return Py(e,t,i,s)}isAttached(e){const t=Na(e);return!!(t&&t.isConnected)}}function f2(n){return!o_()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Xk:u2}class c2{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(Vt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){Mt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=_t(i.options&&i.options.plugins,{}),l=d2(i);return s===!1&&!t?[]:h2(e,l,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(l,o)=>l.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function d2(n){const e={},t=[],i=Object.keys(ui.plugins.items);for(let l=0;l{const a=i[r];if(!pt(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const u=Xr(r,a),f=_2(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=el(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||Gr(a,e),c=(rs[a]||{}).scales||{};Object.keys(c).forEach(d=>{const h=g2(d,u),g=r[h+"AxisID"]||l[h]||h;o[g]=o[g]||Object.create(null),el(o[g],[{axis:h},i[g],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];el(a,[vt.scales[a.type],vt.scale])}),o}function k_(n){const e=n.options||(n.options={});e.plugins=_t(e.plugins,{}),e.scales=v2(n,e)}function w_(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function y2(n){return n=n||{},n.data=w_(n.data),k_(n),n}const If=new Map,$_=new Set;function Gl(n,e){let t=If.get(n);return t||(t=e(),If.set(n,t),$_.add(t)),t}const Us=(n,e,t)=>{const i=Hi(e,t);i!==void 0&&n.add(i)};class k2{constructor(e){this._config=y2(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=w_(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),k_(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Gl(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Gl(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Gl(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Gl(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Us(a,e,c))),f.forEach(c=>Us(a,s,c)),f.forEach(c=>Us(a,rs[l]||{},c)),f.forEach(c=>Us(a,vt,c)),f.forEach(c=>Us(a,Kr,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),$_.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,rs[t]||{},vt.datasets[t]||{},{type:t},vt,Kr]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Ff(this._resolverCache,e,s);let a=o;if($2(o,t)){l.$shared=!1,i=ji(i)?i():i;const u=this.createResolver(e,i,r);a=Ms(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Ff(this._resolverCache,e,i);return pt(t)?Ms(l,t,void 0,s):l}}function Ff(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:La(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const w2=n=>pt(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||ji(n[t]),!1);function $2(n,e){const{isScriptable:t,isIndexable:i}=e_(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(ji(r)||w2(r))||o&&It(r))return!0}return!1}var S2="3.9.1";const C2=["top","bottom","left","right","chartArea"];function Nf(n,e){return n==="top"||n==="bottom"||C2.indexOf(n)===-1&&e==="x"}function Rf(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Hf(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Vt(t&&t.onComplete,[n],e)}function M2(n){const e=n.chart,t=e.options.animation;Vt(t&&t.onProgress,[n],e)}function S_(n){return o_()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Oo={},C_=n=>{const e=S_(n);return Object.values(Oo).filter(t=>t.canvas===e).pop()};function T2(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function D2(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Eo{constructor(e,t){const i=this.config=new k2(t),s=S_(e),l=C_(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||f2(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=dv(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new c2,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Dv(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Oo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}bi.listen(this,"complete",Hf),bi.listen(this,"progress",M2),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return Mt(e)?t&&l?l:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():uf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return of(this.canvas,this.ctx),this}stop(){return bi.stop(this),this}resize(e,t){bi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,uf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Vt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};Et(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=Xr(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),Et(l,o=>{const r=o.options,a=r.id,u=Xr(a,r),f=_t(r.type,o.dtype);(r.position===void 0||Nf(r.position,u)!==Nf(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=ui.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),Et(s,(o,r)=>{o||delete i[r]}),Et(i,o=>{Zl.configure(this,o,o.options),Zl.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Rf("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){Et(this.scales,e=>{Zl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Yu(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;T2(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Zl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],Et(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ea(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&Aa(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return dl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=Bk.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Vi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);Wn(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),bi.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};Et(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){Et(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},Et(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!yo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=bv(e),u=D2(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Vt(l.onHover,[e,r,this],this),a&&Vt(l.onClick,[e,r,this],this));const f=!yo(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const jf=()=>Et(Eo.instances,n=>n._plugins.invalidate()),Oi=!0;Object.defineProperties(Eo,{defaults:{enumerable:Oi,value:vt},instances:{enumerable:Oi,value:Oo},overrides:{enumerable:Oi,value:rs},registry:{enumerable:Oi,value:ui},version:{enumerable:Oi,value:S2},getChart:{enumerable:Oi,value:C_},register:{enumerable:Oi,value:(...n)=>{ui.add(...n),jf()}},unregister:{enumerable:Oi,value:(...n)=>{ui.remove(...n),jf()}}});function M_(n,e,t){const{startAngle:i,pixelMargin:s,x:l,y:o,outerRadius:r,innerRadius:a}=e;let u=s/r;n.beginPath(),n.arc(l,o,r,i-u,t+u),a>s?(u=s/a,n.arc(l,o,a,t+u,i-u,!0)):n.arc(l,o,s,t+zt,i-zt),n.closePath(),n.clip()}function O2(n){return Pa(n,["outerStart","outerEnd","innerStart","innerEnd"])}function E2(n,e,t,i){const s=O2(n.options.borderRadius),l=(t-e)/2,o=Math.min(l,i*e/2),r=a=>{const u=(t-Math.min(l,a))*i/2;return un(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:un(s.innerStart,0,o),innerEnd:un(s.innerEnd,0,o)}}function gs(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function Qr(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let h=0;const g=s-a;if(i){const K=f>0?f-i:0,se=c>0?c-i:0,Y=(K+se)/2,te=Y!==0?g*Y/(Y+i):g;h=(g-te)/2}const v=Math.max(.001,g*c-t/Ut)/c,b=(g-v)/2,y=a+b+h,C=s-b-h,{outerStart:S,outerEnd:$,innerStart:M,innerEnd:D}=E2(e,d,c,C-y),E=c-S,O=c-$,L=y+S/E,I=C-$/O,N=d+M,B=d+D,U=y+M/N,ee=C-D/B;if(n.beginPath(),l){if(n.arc(o,r,c,L,I),$>0){const Y=gs(O,I,o,r);n.arc(Y.x,Y.y,$,I,C+zt)}const K=gs(B,C,o,r);if(n.lineTo(K.x,K.y),D>0){const Y=gs(B,ee,o,r);n.arc(Y.x,Y.y,D,C+zt,ee+Math.PI)}if(n.arc(o,r,d,C-D/d,y+M/d,!0),M>0){const Y=gs(N,U,o,r);n.arc(Y.x,Y.y,M,U+Math.PI,y-zt)}const se=gs(E,y,o,r);if(n.lineTo(se.x,se.y),S>0){const Y=gs(E,L,o,r);n.arc(Y.x,Y.y,S,y-zt,L)}}else{n.moveTo(o,r);const K=Math.cos(L)*c+o,se=Math.sin(L)*c+r;n.lineTo(K,se);const Y=Math.cos(I)*c+o,te=Math.sin(I)*c+r;n.lineTo(Y,te)}n.closePath()}function A2(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){Qr(n,e,t,i,o+At,s);for(let u=0;u=At||fl(l,r,a),v=cl(o,u+d,f+d);return g&&v}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,c=(o+r+u+a)/2;return{x:t+Math.cos(f)*c,y:i+Math.sin(f)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>At?Math.floor(i/At):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*r,Math.sin(u)*r),this.circumference>=Ut&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=A2(e,this,r,l,o);L2(e,this,r,l,a,o),e.restore()}}za.id="arc";za.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};za.defaultRoutes={backgroundColor:"backgroundColor"};function T_(n,e,t=e){n.lineCap=_t(t.borderCapStyle,e.borderCapStyle),n.setLineDash(_t(t.borderDash,e.borderDash)),n.lineDashOffset=_t(t.borderDashOffset,e.borderDashOffset),n.lineJoin=_t(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=_t(t.borderWidth,e.borderWidth),n.strokeStyle=_t(t.borderColor,e.borderColor)}function I2(n,e,t){n.lineTo(t.x,t.y)}function F2(n){return n.stepped?ny:n.tension||n.cubicInterpolationMode==="monotone"?iy:I2}function D_(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-$:$))%l,S=()=>{v!==b&&(n.lineTo(f,b),n.lineTo(f,v),n.lineTo(f,y))};for(a&&(h=s[C(0)],n.moveTo(h.x,h.y)),d=0;d<=r;++d){if(h=s[C(d)],h.skip)continue;const $=h.x,M=h.y,D=$|0;D===g?(Mb&&(b=M),f=(c*f+$)/++c):(S(),n.lineTo($,M),g=D,c=0,v=b=M),y=M}S()}function xr(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?R2:N2}function H2(n){return n.stepped?Iy:n.tension||n.cubicInterpolationMode==="monotone"?Fy:Qi}function j2(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),T_(n,e.options),n.stroke(s)}function q2(n,e,t,i){const{segments:s,options:l}=e,o=xr(e);for(const r of s)T_(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const V2=typeof Path2D=="function";function z2(n,e,t,i){V2&&!e.options.segment?j2(n,e,t,i):q2(n,e,t,i)}class zi extends Ci{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;My(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Uy(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],l=this.points,o=u_(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=H2(i);let u,f;for(u=0,f=o.length;un!=="borderDash"&&n!=="fill"};function qf(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=Ua(o,r,s);const a=s[o],u=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:u.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:u.y}))}),l}function Ua(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Vf(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function E_(n,e){let t=[],i=!1;return It(n)?(i=!0,t=n):t=Z2(n,e),t.length?new zi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function zf(n){return n&&n.fill!==!1}function G2(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!Wt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function X2(n,e,t){const i=tw(n);if(pt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Wt(s)&&Math.floor(s)===s?Q2(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Q2(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function x2(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:pt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function ew(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:pt(n)?i=n.value:i=e.getBaseValue(),i}function tw(n){const e=n.options,t=e.fill;let i=_t(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function nw(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=iw(e,t);r.push(E_({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;!r||(r.line.updateControlPoints(l,r.axis),i&&r.fill&&kr(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;zf(l)&&kr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!zf(i)||t.drawTime!=="beforeDatasetDraw"||kr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const sl={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e-1?n.split(` -`):n}function hw(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function Yf(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Ln(e.bodyFont),u=Ln(e.titleFont),f=Ln(e.footerFont),c=l.length,d=s.length,h=i.length,g=Yn(e.padding);let v=g.height,b=0,y=i.reduce(($,M)=>$+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=h*$+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let C=0;const S=function($){b=Math.max(b,t.measureText($).width+C)};return t.save(),t.font=u.string,Dt(n.title,S),t.font=a.string,Dt(n.beforeBody.concat(n.afterBody),S),C=e.displayColors?o+2+e.boxPadding:0,Dt(i,$=>{Dt($.before,S),Dt($.lines,S),Dt($.after,S)}),C=0,t.font=f.string,Dt(n.footer,S),t.restore(),b+=g.width,{width:b,height:v}}function mw(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function gw(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function _w(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),gw(u,n,e,t)&&(u="center"),u}function Kf(n,e,t){const i=t.yAlign||e.yAlign||mw(n,t);return{xAlign:t.xAlign||e.xAlign||_w(n,e,t,i),yAlign:i}}function bw(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function vw(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Jf(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=ys(o);let g=bw(e,r);const v=vw(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,h)+s),{x:un(g,0,i.width-e.width),y:un(v,0,i.height-e.height)}}function Xl(n,e,t){const i=Yn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Zf(n){return ri([],vi(n))}function yw(n,e,t){return Vi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Gf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ta extends Ci{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new f_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=yw(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=ri(r,vi(s)),r=ri(r,vi(l)),r=ri(r,vi(o)),r}getBeforeBody(e,t){return Zf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Dt(e,l=>{const o={before:[],lines:[],after:[]},r=Gf(i,l);ri(o.before,vi(r.beforeLabel.call(this,l))),ri(o.lines,r.label.call(this,l)),ri(o.after,vi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return Zf(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=ri(r,vi(s)),r=ri(r,vi(l)),r=ri(r,vi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),Dt(r,f=>{const c=Gf(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=sl[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=Yf(this,i),u=Object.assign({},r,a),f=Kf(this.chart,i,u),c=Jf(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=ys(r),{x:d,y:h}=e,{width:g,height:v}=t;let b,y,C,S,$,M;return l==="center"?($=h+v/2,s==="left"?(b=d,y=b-o,S=$+o,M=$-o):(b=d+g,y=b+o,S=$-o,M=$+o),C=b):(s==="left"?y=d+Math.max(a,f)+o:s==="right"?y=d+g-Math.max(u,c)-o:y=this.caretX,l==="top"?(S=h,$=S-o,b=y-o,C=y+o):(S=h+v,$=S+o,b=y+o,C=y-o),M=S),{x1:b,x2:y,x3:C,y1:S,y2:$,y3:M}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=dr(i.rtl,this.x,this.width);for(e.x=Xl(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Ln(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Mo(e,{x:b,y:v,w:u,h:a,radius:C}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Mo(e,{x:y,y:v+1,w:u-2,h:a-2,radius:C}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,v,u,a),e.strokeRect(b,v,u,a),e.fillStyle=o.backgroundColor,e.fillRect(y,v+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=Ln(i.bodyFont);let d=c.lineHeight,h=0;const g=dr(i.rtl,this.x,this.width),v=function(O){t.fillText(O,g.x(e.x+h),e.y+d/2),e.y+=d+l},b=g.textAlign(o);let y,C,S,$,M,D,E;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Xl(this,b,i),t.fillStyle=i.bodyColor,Dt(this.beforeBody,v),h=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,$=0,D=s.length;$0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=sl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Yf(this,e),a=Object.assign({},o,this._size),u=Kf(t,e,a),f=Jf(e,a,u,t);(s._to!==f.x||l._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Yn(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(l,e,s,t),jy(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),qy(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!yo(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!yo(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=sl[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ta.positioners=sl;var kw={id:"tooltip",_element:ta,positioners:sl,afterInit(n,e,t){t&&(n.tooltip=new ta({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",t)===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:_i,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndexn!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const ww=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function $w(n,e,t,i){const s=n.indexOf(e);if(s===-1)return ww(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const Sw=(n,e)=>n===null?null:un(Math.round(n),0,e);class na extends us{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(Mt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:$w(i,e,gt(t,e),this._addedLabels),Sw(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}na.id="category";na.defaults={ticks:{callback:na.prototype.getLabelForValue}};function Cw(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,h=l||1,g=f-1,{min:v,max:b}=e,y=!Mt(o),C=!Mt(r),S=!Mt(u),$=(b-v)/(c+1);let M=Ju((b-v)/g/h)*h,D,E,O,L;if(M<1e-14&&!y&&!C)return[{value:v},{value:b}];L=Math.ceil(b/M)-Math.floor(v/M),L>g&&(M=Ju(L*M/g/h)*h),Mt(a)||(D=Math.pow(10,a),M=Math.ceil(M*D)/D),s==="ticks"?(E=Math.floor(v/M)*M,O=Math.ceil(b/M)*M):(E=v,O=b),y&&C&&l&&wv((r-o)/l,M/1e3)?(L=Math.round(Math.min((r-o)/M,f)),M=(r-o)/L,E=o,O=r):S?(E=y?o:E,O=C?r:O,L=u-1,M=(O-E)/L):(L=(O-E)/M,tl(L,Math.round(L),M/1e3)?L=Math.round(L):L=Math.ceil(L));const I=Math.max(Zu(M),Zu(E));D=Math.pow(10,Mt(a)?I:a),E=Math.round(E*D)/D,O=Math.round(O*D)/D;let N=0;for(y&&(d&&E!==o?(t.push({value:o}),Es=t?s:a,r=a=>l=i?l:a;if(e){const a=fi(s),u=fi(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=1;(l>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(l*.05)),r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},l=this._range||this,o=Cw(s,l);return e.bounds==="ticks"&&qg(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return $l(e,this.chart.options.locale,this.options.ticks.format)}}class Wa extends Ao{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Yt(e)?e:0,this.max=Yt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Qn(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Wa.id="linear";Wa.defaults={ticks:{callback:Ko.formatters.numeric}};function Qf(n){return n/Math.pow(10,Math.floor(zn(n)))===1}function Mw(n,e){const t=Math.floor(zn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Rn(n.min,Math.pow(10,Math.floor(zn(e.min)))),o=Math.floor(zn(l)),r=Math.floor(l/Math.pow(10,o)),a=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:l,major:Qf(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Yt(e)?Math.max(0,e):null,this.max=Yt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const l=a=>i=e?i:a,o=a=>s=t?s:a,r=(a,u)=>Math.pow(10,Math.floor(zn(a))+u);i===s&&(i<=0?(l(1),o(10)):(l(r(i,-1)),o(r(s,1)))),i<=0&&l(r(s,-1)),s<=0&&o(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&l(r(i,-1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=Mw(t,this);return e.bounds==="ticks"&&qg(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":$l(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=zn(e),this._valueRange=zn(this.max)-zn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(zn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}P_.id="logarithmic";P_.defaults={ticks:{callback:Ko.formatters.logarithmic,major:{enabled:!0}}};function ia(n){const e=n.ticks;if(e.display&&n.display){const t=Yn(e.backdropPadding);return gt(e.font&&e.font.size,bt.font.size)+t.height}return 0}function Tw(n,e,t){return t=Ft(t)?t:[t],{w:ey(n,e.string,t),h:t.length*e.lineHeight}}function xf(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:ns?{start:e-t,end:e}:{start:e,end:e+t}}function Dw(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],l=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?Wt/l:0;for(let a=0;ae.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.starte.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function Ew(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=ia(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Wt/s:0;for(let u=0;u270||t<90)&&(n-=e),n}function Iw(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const l=i.setContext(n.getPointLabelContext(s)),o=Ln(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:h}=n._pointLabelItems[s],{backdropColor:g}=l;if(!Mt(g)){const v=ys(l.borderRadius),b=Yn(l.backdropPadding);t.fillStyle=g;const y=f-b.left,C=c-b.top,S=d-f+b.width,$=h-c+b.height;Object.values(v).some(M=>M!==0)?(t.beginPath(),Mo(t,{x:y,y:C,w:S,h:$,radius:v}),t.fill()):t.fillRect(y,C,S,$)}Co(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function L_(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,Et);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o{const s=zt(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?Dw(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=Et/(this._pointLabels.length||1),i=this.options.startAngle||0;return Pn(e*t+Qn(i))}getDistanceFromCenterForValue(e){if(Mt(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(Mt(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const c=s.setContext(this.getContext(f-1));Fw(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:c}=u;!c||!f||(e.lineWidth=c,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=Ln(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Yn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}Co(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Zo.id="radialLinear";Zo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ko.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Zo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Zo.descriptors={angleLines:{_fallback:"grid"}};const Go={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},yn=Object.keys(Go);function Rw(n,e){return n-e}function ec(n,e){if(Mt(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Yt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Cs(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function tc(n,e,t,i){const s=yn.length;for(let l=yn.indexOf(n);l=yn.indexOf(t);l--){const o=yn[l];if(Go[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return yn[t?yn.indexOf(t):0]}function jw(n){for(let e=yn.indexOf(n)+1,t=yn.length;e=e?t[i]:t[s];n[l]=!0}}function qw(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function ic(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=un(t,0,o),i=un(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,l=s.time,o=l.unit||tc(l.minUnit,t,i,this._getLabelCapacity(t)),r=gt(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Cs(a)||a===!0,f={};let c=t,d,h;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,h=0;dv-b).map(v=>+v)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],c=i[t],d=a&&f&&c&&c.major,h=this._adapter.format(e,s||(d?f:u)),g=l.ticks.callback;return g?zt(g,[h,t,i],this):h}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=es(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=es(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const u=o-l;return u?r+(a-r)*(e-l)/u:r}class I_ extends Ml{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Ql(t,this.min),this._tableRange=Ql(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;o$+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=h*$+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let C=0;const S=function($){b=Math.max(b,t.measureText($).width+C)};return t.save(),t.font=u.string,Et(n.title,S),t.font=a.string,Et(n.beforeBody.concat(n.afterBody),S),C=e.displayColors?o+2+e.boxPadding:0,Et(i,$=>{Et($.before,S),Et($.lines,S),Et($.after,S)}),C=0,t.font=f.string,Et(n.footer,S),t.restore(),b+=g.width,{width:b,height:v}}function mw(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function gw(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function _w(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),gw(u,n,e,t)&&(u="center"),u}function Kf(n,e,t){const i=t.yAlign||e.yAlign||mw(n,t);return{xAlign:t.xAlign||e.xAlign||_w(n,e,t,i),yAlign:i}}function bw(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function vw(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Jf(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=ys(o);let g=bw(e,r);const v=vw(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,h)+s),{x:un(g,0,i.width-e.width),y:un(v,0,i.height-e.height)}}function Xl(n,e,t){const i=Yn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Zf(n){return ri([],vi(n))}function yw(n,e,t){return Vi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Gf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ta extends Ci{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new f_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=yw(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=ri(r,vi(s)),r=ri(r,vi(l)),r=ri(r,vi(o)),r}getBeforeBody(e,t){return Zf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Et(e,l=>{const o={before:[],lines:[],after:[]},r=Gf(i,l);ri(o.before,vi(r.beforeLabel.call(this,l))),ri(o.lines,r.label.call(this,l)),ri(o.after,vi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return Zf(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=ri(r,vi(s)),r=ri(r,vi(l)),r=ri(r,vi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),Et(r,f=>{const c=Gf(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=sl[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=Yf(this,i),u=Object.assign({},r,a),f=Kf(this.chart,i,u),c=Jf(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=ys(r),{x:d,y:h}=e,{width:g,height:v}=t;let b,y,C,S,$,M;return l==="center"?($=h+v/2,s==="left"?(b=d,y=b-o,S=$+o,M=$-o):(b=d+g,y=b+o,S=$-o,M=$+o),C=b):(s==="left"?y=d+Math.max(a,f)+o:s==="right"?y=d+g-Math.max(u,c)-o:y=this.caretX,l==="top"?(S=h,$=S-o,b=y-o,C=y+o):(S=h+v,$=S+o,b=y+o,C=y-o),M=S),{x1:b,x2:y,x3:C,y1:S,y2:$,y3:M}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=dr(i.rtl,this.x,this.width);for(e.x=Xl(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Ln(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Mo(e,{x:b,y:v,w:u,h:a,radius:C}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Mo(e,{x:y,y:v+1,w:u-2,h:a-2,radius:C}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,v,u,a),e.strokeRect(b,v,u,a),e.fillStyle=o.backgroundColor,e.fillRect(y,v+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=Ln(i.bodyFont);let d=c.lineHeight,h=0;const g=dr(i.rtl,this.x,this.width),v=function(O){t.fillText(O,g.x(e.x+h),e.y+d/2),e.y+=d+l},b=g.textAlign(o);let y,C,S,$,M,D,E;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Xl(this,b,i),t.fillStyle=i.bodyColor,Et(this.beforeBody,v),h=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,$=0,D=s.length;$0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=sl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Yf(this,e),a=Object.assign({},o,this._size),u=Kf(t,e,a),f=Jf(e,a,u,t);(s._to!==f.x||l._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Yn(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(l,e,s,t),jy(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),qy(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!yo(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!yo(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=sl[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ta.positioners=sl;var kw={id:"tooltip",_element:ta,positioners:sl,afterInit(n,e,t){t&&(n.tooltip=new ta({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",t)===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:_i,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndexn!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const ww=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function $w(n,e,t,i){const s=n.indexOf(e);if(s===-1)return ww(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const Sw=(n,e)=>n===null?null:un(Math.round(n),0,e);class na extends us{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(Mt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:$w(i,e,_t(t,e),this._addedLabels),Sw(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}na.id="category";na.defaults={ticks:{callback:na.prototype.getLabelForValue}};function Cw(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,h=l||1,g=f-1,{min:v,max:b}=e,y=!Mt(o),C=!Mt(r),S=!Mt(u),$=(b-v)/(c+1);let M=Ju((b-v)/g/h)*h,D,E,O,L;if(M<1e-14&&!y&&!C)return[{value:v},{value:b}];L=Math.ceil(b/M)-Math.floor(v/M),L>g&&(M=Ju(L*M/g/h)*h),Mt(a)||(D=Math.pow(10,a),M=Math.ceil(M*D)/D),s==="ticks"?(E=Math.floor(v/M)*M,O=Math.ceil(b/M)*M):(E=v,O=b),y&&C&&l&&wv((r-o)/l,M/1e3)?(L=Math.round(Math.min((r-o)/M,f)),M=(r-o)/L,E=o,O=r):S?(E=y?o:E,O=C?r:O,L=u-1,M=(O-E)/L):(L=(O-E)/M,tl(L,Math.round(L),M/1e3)?L=Math.round(L):L=Math.ceil(L));const I=Math.max(Zu(M),Zu(E));D=Math.pow(10,Mt(a)?I:a),E=Math.round(E*D)/D,O=Math.round(O*D)/D;let N=0;for(y&&(d&&E!==o?(t.push({value:o}),Es=t?s:a,r=a=>l=i?l:a;if(e){const a=fi(s),u=fi(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=1;(l>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(l*.05)),r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},l=this._range||this,o=Cw(s,l);return e.bounds==="ticks"&&qg(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return $l(e,this.chart.options.locale,this.options.ticks.format)}}class Wa extends Ao{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Wt(e)?e:0,this.max=Wt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Qn(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Wa.id="linear";Wa.defaults={ticks:{callback:Ko.formatters.numeric}};function Qf(n){return n/Math.pow(10,Math.floor(zn(n)))===1}function Mw(n,e){const t=Math.floor(zn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Rn(n.min,Math.pow(10,Math.floor(zn(e.min)))),o=Math.floor(zn(l)),r=Math.floor(l/Math.pow(10,o)),a=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:l,major:Qf(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Wt(e)?Math.max(0,e):null,this.max=Wt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const l=a=>i=e?i:a,o=a=>s=t?s:a,r=(a,u)=>Math.pow(10,Math.floor(zn(a))+u);i===s&&(i<=0?(l(1),o(10)):(l(r(i,-1)),o(r(s,1)))),i<=0&&l(r(s,-1)),s<=0&&o(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&l(r(i,-1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=Mw(t,this);return e.bounds==="ticks"&&qg(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":$l(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=zn(e),this._valueRange=zn(this.max)-zn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(zn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}P_.id="logarithmic";P_.defaults={ticks:{callback:Ko.formatters.logarithmic,major:{enabled:!0}}};function ia(n){const e=n.ticks;if(e.display&&n.display){const t=Yn(e.backdropPadding);return _t(e.font&&e.font.size,vt.font.size)+t.height}return 0}function Tw(n,e,t){return t=It(t)?t:[t],{w:ey(n,e.string,t),h:t.length*e.lineHeight}}function xf(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:ns?{start:e-t,end:e}:{start:e,end:e+t}}function Dw(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],l=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?Ut/l:0;for(let a=0;ae.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.starte.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function Ew(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=ia(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Ut/s:0;for(let u=0;u270||t<90)&&(n-=e),n}function Iw(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const l=i.setContext(n.getPointLabelContext(s)),o=Ln(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:h}=n._pointLabelItems[s],{backdropColor:g}=l;if(!Mt(g)){const v=ys(l.borderRadius),b=Yn(l.backdropPadding);t.fillStyle=g;const y=f-b.left,C=c-b.top,S=d-f+b.width,$=h-c+b.height;Object.values(v).some(M=>M!==0)?(t.beginPath(),Mo(t,{x:y,y:C,w:S,h:$,radius:v}),t.fill()):t.fillRect(y,C,S,$)}Co(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function L_(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,At);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o{const s=Vt(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?Dw(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=At/(this._pointLabels.length||1),i=this.options.startAngle||0;return Pn(e*t+Qn(i))}getDistanceFromCenterForValue(e){if(Mt(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(Mt(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const c=s.setContext(this.getContext(f-1));Fw(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:c}=u;!c||!f||(e.lineWidth=c,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=Ln(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Yn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}Co(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Zo.id="radialLinear";Zo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ko.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Zo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Zo.descriptors={angleLines:{_fallback:"grid"}};const Go={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},yn=Object.keys(Go);function Rw(n,e){return n-e}function ec(n,e){if(Mt(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Wt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Cs(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function tc(n,e,t,i){const s=yn.length;for(let l=yn.indexOf(n);l=yn.indexOf(t);l--){const o=yn[l];if(Go[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return yn[t?yn.indexOf(t):0]}function jw(n){for(let e=yn.indexOf(n)+1,t=yn.length;e=e?t[i]:t[s];n[l]=!0}}function qw(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function ic(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=un(t,0,o),i=un(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,l=s.time,o=l.unit||tc(l.minUnit,t,i,this._getLabelCapacity(t)),r=_t(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Cs(a)||a===!0,f={};let c=t,d,h;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,h=0;dv-b).map(v=>+v)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],c=i[t],d=a&&f&&c&&c.major,h=this._adapter.format(e,s||(d?f:u)),g=l.ticks.callback;return g?Vt(g,[h,t,i],this):h}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=es(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=es(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const u=o-l;return u?r+(a-r)*(e-l)/u:r}class I_ extends Ml{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Ql(t,this.min),this._tableRange=Ql(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;o{t||(t=ot(e,Tn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=ot(e,Tn,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function zw(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=F(n[1]),t=T(),s=F(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&ue(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&ue(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function Bw(n){let e;return{c(){e=F("Loading...")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Uw(n){let e,t,i,s,l,o=n[2]&&sc();function r(f,c){return f[2]?Bw:zw}let a=r(n),u=a(n);return{c(){e=_("div"),o&&o.c(),t=T(),i=_("canvas"),s=T(),l=_("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Qa(i,"height","250px"),Qa(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ie(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=sc(),o.c(),A(o,1),o.m(e,t)):o&&(Ae(),P(o,1,1,()=>{o=null}),Pe()),c&4&&ie(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){P(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function Ww(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),ye.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:W.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ye.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Jn(()=>(Eo.register(zi,Jo,Yo,Wa,Ml,pw,kw),t(6,o=new Eo(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){de[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class Yw extends Ee{constructor(e){super(),Oe(this,e,Ww,Uw,De,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var lc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},F_={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** + */const Vw={datetime:Qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Qe.TIME_WITH_SECONDS,minute:Qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};m_._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return Vw},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Qe.fromFormat(n,e,t):n=Qe.fromISO(n,t):n instanceof Date?n=Qe.fromJSDate(n,t):i==="object"&&!(n instanceof Qe)&&(n=Qe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function sc(n){let e,t,i;return{c(){e=_("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=it(e,Tn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=it(e,Tn,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function zw(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=F(n[1]),t=T(),s=F(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&ue(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&ue(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function Bw(n){let e;return{c(){e=F("Loading...")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Uw(n){let e,t,i,s,l,o=n[2]&&sc();function r(f,c){return f[2]?Bw:zw}let a=r(n),u=a(n);return{c(){e=_("div"),o&&o.c(),t=T(),i=_("canvas"),s=T(),l=_("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Qa(i,"height","250px"),Qa(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ie(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=sc(),o.c(),A(o,1),o.m(e,t)):o&&(Pe(),P(o,1,1,()=>{o=null}),Le()),c&4&&ie(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){P(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function Ww(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),we.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:W.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),we.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Jn(()=>(Eo.register(zi,Jo,Yo,Wa,Ml,pw,kw),t(6,o=new Eo(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){pe[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class Yw extends Ee{constructor(e){super(),Oe(this,e,Ww,Uw,De,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var lc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},F_={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** * Prism: Lightweight, robust, elegant syntax highlighting * * @license MIT * @author Lea Verou * @namespace * @public - */var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function C(S){return S instanceof a?new a(S.type,C(S.content),S.alias):Array.isArray(S)?S.map(C):S.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var C=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(C){var S=document.getElementsByTagName("script");for(var $ in S)if(S[$].src==C)return S[$]}return null}},isActive:function(C,S,$){for(var M="no-"+S;C;){var D=C.classList;if(D.contains(S))return!0;if(D.contains(M))return!1;C=C.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(C,S){var $=r.util.clone(r.languages[C]);for(var M in S)$[M]=S[M];return $},insertBefore:function(C,S,$,M){M=M||r.languages;var D=M[C],E={};for(var O in D)if(D.hasOwnProperty(O)){if(O==S)for(var L in $)$.hasOwnProperty(L)&&(E[L]=$[L]);$.hasOwnProperty(O)||(E[O]=D[O])}var I=M[C];return M[C]=E,r.languages.DFS(r.languages,function(N,B){B===I&&N!=C&&(this[N]=E)}),E},DFS:function C(S,$,M,D){D=D||{};var E=r.util.objId;for(var O in S)if(S.hasOwnProperty(O)){$.call(S,O,S[O],M||O);var L=S[O],I=r.util.type(L);I==="Object"&&!D[E(L)]?(D[E(L)]=!0,C(L,$,null,D)):I==="Array"&&!D[E(L)]&&(D[E(L)]=!0,C(L,$,O,D))}}},plugins:{},highlightAll:function(C,S){r.highlightAllUnder(document,C,S)},highlightAllUnder:function(C,S,$){var M={callback:$,container:C,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var D=0,E;E=M.elements[D++];)r.highlightElement(E,S===!0,M.callback)},highlightElement:function(C,S,$){var M=r.util.getLanguage(C),D=r.languages[M];r.util.setLanguage(C,M);var E=C.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,M);var O=C.textContent,L={element:C,language:M,grammar:D,code:O};function I(B){L.highlightedCode=B,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),$&&$.call(L.element)}if(r.hooks.run("before-sanity-check",L),E=L.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),$&&$.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){I(r.util.encode(L.code));return}if(S&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(B){I(B.data)},N.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else I(r.highlight(L.code,L.grammar,L.language))},highlight:function(C,S,$){var M={code:C,grammar:S,language:$};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(C,S){var $=S.rest;if($){for(var M in $)S[M]=$[M];delete S.rest}var D=new c;return d(D,D.head,C),f(C,D,S,D.head,0),g(D)},hooks:{all:{},add:function(C,S){var $=r.hooks.all;$[C]=$[C]||[],$[C].push(S)},run:function(C,S){var $=r.hooks.all[C];if(!(!$||!$.length))for(var M=0,D;D=$[M++];)D(S)}},Token:a};i.Prism=r;function a(C,S,$,M){this.type=C,this.content=S,this.alias=$,this.length=(M||"").length|0}a.stringify=function C(S,$){if(typeof S=="string")return S;if(Array.isArray(S)){var M="";return S.forEach(function(I){M+=C(I,$)}),M}var D={type:S.type,content:C(S.content,$),tag:"span",classes:["token",S.type],attributes:{},language:$},E=S.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(D.classes,E):D.classes.push(E)),r.hooks.run("wrap",D);var O="";for(var L in D.attributes)O+=" "+L+'="'+(D.attributes[L]||"").replace(/"/g,""")+'"';return"<"+D.tag+' class="'+D.classes.join(" ")+'"'+O+">"+D.content+""};function u(C,S,$,M){C.lastIndex=S;var D=C.exec($);if(D&&M&&D[1]){var E=D[1].length;D.index+=E,D[0]=D[0].slice(E)}return D}function f(C,S,$,M,D,E){for(var O in $)if(!(!$.hasOwnProperty(O)||!$[O])){var L=$[O];L=Array.isArray(L)?L:[L];for(var I=0;I=E.reach);J+=te.value.length,te=te.next){var ge=te.value;if(S.length>C.length)return;if(!(ge instanceof a)){var _e=1,X;if(ee){if(X=u(Y,J,C,U),!X||X.index>=C.length)break;var pe=X.index,re=X.index+X[0].length,ve=J;for(ve+=te.value.length;pe>=ve;)te=te.next,ve+=te.value.length;if(ve-=te.value.length,J=ve,te.value instanceof a)continue;for(var H=te;H!==S.tail&&(veE.reach&&(E.reach=je);var Be=te.prev;Q&&(Be=d(S,Be,Q),J+=Q.length),h(S,Be,_e);var Z=new a(O,B?r.tokenize(x,B):x,K,x);if(te=d(S,Be,Z),$e&&d(S,te,$e),_e>1){var me={cause:O+","+I,reach:je};f(C,S,$,te.prev,J,me),E&&me.reach>E.reach&&(E.reach=me.reach)}}}}}}function c(){var C={value:null,prev:null,next:null},S={value:null,prev:C,next:null};C.next=S,this.head=C,this.tail=S,this.length=0}function d(C,S,$){var M=S.next,D={value:$,prev:S,next:M};return S.next=D,M.prev=D,C.length++,D}function h(C,S,$){for(var M=S.next,D=0;D<$&&M!==C.tail;D++)M=M.next;S.next=M,M.prev=S,C.length-=D}function g(C){for(var S=[],$=C.head.next;$!==C.tail;)S.push($.value),$=$.next;return S}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function(C){var S=JSON.parse(C.data),$=S.language,M=S.code,D=S.immediateClose;i.postMessage(r.highlight(M,r.languages[$],$)),D&&i.close()},!1)),r;var v=r.util.currentScript();v&&(r.filename=v.src,v.hasAttribute("data-manual")&&(r.manual=!0));function b(){r.manual||r.highlightAll()}if(!r.manual){var y=document.readyState;y==="loading"||y==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",b):window.requestAnimationFrame?window.requestAnimationFrame(b):window.setTimeout(b,16)}return r}(e);n.exports&&(n.exports=t),typeof lc<"u"&&(lc.Prism=t),t.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var l=i.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading\u2026",s=function(v,b){return"\u2716 Error "+v+" while fetching file: "+b},l="\u2716 Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(v,b,y){var C=new XMLHttpRequest;C.open("GET",v,!0),C.onreadystatechange=function(){C.readyState==4&&(C.status<400&&C.responseText?b(C.responseText):C.status>=400?y(s(C.status,C.statusText)):y(l))},C.send(null)}function h(v){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(b){var y=Number(b[1]),C=b[2],S=b[3];return C?S?[y,Number(S)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(v){v.selector+=", "+c}),t.hooks.add("before-sanity-check",function(v){var b=v.element;if(b.matches(c)){v.code="",b.setAttribute(r,a);var y=b.appendChild(document.createElement("CODE"));y.textContent=i;var C=b.getAttribute("data-src"),S=v.language;if(S==="none"){var $=(/\.(\w+)$/.exec(C)||[,"none"])[1];S=o[$]||$}t.util.setLanguage(y,S),t.util.setLanguage(b,S);var M=t.plugins.autoloader;M&&M.loadLanguages(S),d(C,function(D){b.setAttribute(r,u);var E=h(b.getAttribute("data-range"));if(E){var O=D.split(/\r\n?|\n/g),L=E[0],I=E[1]==null?O.length:E[1];L<0&&(L+=O.length),L=Math.max(0,Math.min(L-1,O.length)),I<0&&(I+=O.length),I=Math.max(0,Math.min(I,O.length)),D=O.slice(L,I).join(` + */var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function C(S){return S instanceof a?new a(S.type,C(S.content),S.alias):Array.isArray(S)?S.map(C):S.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var C=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(C){var S=document.getElementsByTagName("script");for(var $ in S)if(S[$].src==C)return S[$]}return null}},isActive:function(C,S,$){for(var M="no-"+S;C;){var D=C.classList;if(D.contains(S))return!0;if(D.contains(M))return!1;C=C.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(C,S){var $=r.util.clone(r.languages[C]);for(var M in S)$[M]=S[M];return $},insertBefore:function(C,S,$,M){M=M||r.languages;var D=M[C],E={};for(var O in D)if(D.hasOwnProperty(O)){if(O==S)for(var L in $)$.hasOwnProperty(L)&&(E[L]=$[L]);$.hasOwnProperty(O)||(E[O]=D[O])}var I=M[C];return M[C]=E,r.languages.DFS(r.languages,function(N,B){B===I&&N!=C&&(this[N]=E)}),E},DFS:function C(S,$,M,D){D=D||{};var E=r.util.objId;for(var O in S)if(S.hasOwnProperty(O)){$.call(S,O,S[O],M||O);var L=S[O],I=r.util.type(L);I==="Object"&&!D[E(L)]?(D[E(L)]=!0,C(L,$,null,D)):I==="Array"&&!D[E(L)]&&(D[E(L)]=!0,C(L,$,O,D))}}},plugins:{},highlightAll:function(C,S){r.highlightAllUnder(document,C,S)},highlightAllUnder:function(C,S,$){var M={callback:$,container:C,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var D=0,E;E=M.elements[D++];)r.highlightElement(E,S===!0,M.callback)},highlightElement:function(C,S,$){var M=r.util.getLanguage(C),D=r.languages[M];r.util.setLanguage(C,M);var E=C.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,M);var O=C.textContent,L={element:C,language:M,grammar:D,code:O};function I(B){L.highlightedCode=B,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),$&&$.call(L.element)}if(r.hooks.run("before-sanity-check",L),E=L.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),$&&$.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){I(r.util.encode(L.code));return}if(S&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(B){I(B.data)},N.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else I(r.highlight(L.code,L.grammar,L.language))},highlight:function(C,S,$){var M={code:C,grammar:S,language:$};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(C,S){var $=S.rest;if($){for(var M in $)S[M]=$[M];delete S.rest}var D=new c;return d(D,D.head,C),f(C,D,S,D.head,0),g(D)},hooks:{all:{},add:function(C,S){var $=r.hooks.all;$[C]=$[C]||[],$[C].push(S)},run:function(C,S){var $=r.hooks.all[C];if(!(!$||!$.length))for(var M=0,D;D=$[M++];)D(S)}},Token:a};i.Prism=r;function a(C,S,$,M){this.type=C,this.content=S,this.alias=$,this.length=(M||"").length|0}a.stringify=function C(S,$){if(typeof S=="string")return S;if(Array.isArray(S)){var M="";return S.forEach(function(I){M+=C(I,$)}),M}var D={type:S.type,content:C(S.content,$),tag:"span",classes:["token",S.type],attributes:{},language:$},E=S.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(D.classes,E):D.classes.push(E)),r.hooks.run("wrap",D);var O="";for(var L in D.attributes)O+=" "+L+'="'+(D.attributes[L]||"").replace(/"/g,""")+'"';return"<"+D.tag+' class="'+D.classes.join(" ")+'"'+O+">"+D.content+""};function u(C,S,$,M){C.lastIndex=S;var D=C.exec($);if(D&&M&&D[1]){var E=D[1].length;D.index+=E,D[0]=D[0].slice(E)}return D}function f(C,S,$,M,D,E){for(var O in $)if(!(!$.hasOwnProperty(O)||!$[O])){var L=$[O];L=Array.isArray(L)?L:[L];for(var I=0;I=E.reach);J+=te.value.length,te=te.next){var _e=te.value;if(S.length>C.length)return;if(!(_e instanceof a)){var be=1,X;if(ee){if(X=u(Y,J,C,U),!X||X.index>=C.length)break;var me=X.index,ae=X.index+X[0].length,ve=J;for(ve+=te.value.length;me>=ve;)te=te.next,ve+=te.value.length;if(ve-=te.value.length,J=ve,te.value instanceof a)continue;for(var H=te;H!==S.tail&&(veE.reach&&(E.reach=je);var Ue=te.prev;Q&&(Ue=d(S,Ue,Q),J+=Q.length),h(S,Ue,be);var Z=new a(O,B?r.tokenize(x,B):x,K,x);if(te=d(S,Ue,Z),Se&&d(S,te,Se),be>1){var ge={cause:O+","+I,reach:je};f(C,S,$,te.prev,J,ge),E&&ge.reach>E.reach&&(E.reach=ge.reach)}}}}}}function c(){var C={value:null,prev:null,next:null},S={value:null,prev:C,next:null};C.next=S,this.head=C,this.tail=S,this.length=0}function d(C,S,$){var M=S.next,D={value:$,prev:S,next:M};return S.next=D,M.prev=D,C.length++,D}function h(C,S,$){for(var M=S.next,D=0;D<$&&M!==C.tail;D++)M=M.next;S.next=M,M.prev=S,C.length-=D}function g(C){for(var S=[],$=C.head.next;$!==C.tail;)S.push($.value),$=$.next;return S}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function(C){var S=JSON.parse(C.data),$=S.language,M=S.code,D=S.immediateClose;i.postMessage(r.highlight(M,r.languages[$],$)),D&&i.close()},!1)),r;var v=r.util.currentScript();v&&(r.filename=v.src,v.hasAttribute("data-manual")&&(r.manual=!0));function b(){r.manual||r.highlightAll()}if(!r.manual){var y=document.readyState;y==="loading"||y==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",b):window.requestAnimationFrame?window.requestAnimationFrame(b):window.setTimeout(b,16)}return r}(e);n.exports&&(n.exports=t),typeof lc<"u"&&(lc.Prism=t),t.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var l=i.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading\u2026",s=function(v,b){return"\u2716 Error "+v+" while fetching file: "+b},l="\u2716 Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(v,b,y){var C=new XMLHttpRequest;C.open("GET",v,!0),C.onreadystatechange=function(){C.readyState==4&&(C.status<400&&C.responseText?b(C.responseText):C.status>=400?y(s(C.status,C.statusText)):y(l))},C.send(null)}function h(v){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(b){var y=Number(b[1]),C=b[2],S=b[3];return C?S?[y,Number(S)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(v){v.selector+=", "+c}),t.hooks.add("before-sanity-check",function(v){var b=v.element;if(b.matches(c)){v.code="",b.setAttribute(r,a);var y=b.appendChild(document.createElement("CODE"));y.textContent=i;var C=b.getAttribute("data-src"),S=v.language;if(S==="none"){var $=(/\.(\w+)$/.exec(C)||[,"none"])[1];S=o[$]||$}t.util.setLanguage(y,S),t.util.setLanguage(b,S);var M=t.plugins.autoloader;M&&M.loadLanguages(S),d(C,function(D){b.setAttribute(r,u);var E=h(b.getAttribute("data-range"));if(E){var O=D.split(/\r\n?|\n/g),L=E[0],I=E[1]==null?O.length:E[1];L<0&&(L+=O.length),L=Math.max(0,Math.min(L-1,O.length)),I<0&&(I+=O.length),I=Math.max(0,Math.min(I,O.length)),D=O.slice(L,I).join(` `),b.hasAttribute("data-start")||b.setAttribute("data-start",String(L+1))}y.textContent=D,t.highlightElement(y)},function(D){b.setAttribute(r,f),y.textContent=D})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),C=0,S;S=y[C++];)t.highlightElement(S)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(F_);const Ws=F_.exports;var Kw={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(l,o){for(var r in o)o.hasOwnProperty(r)&&(l[r]=o[r]);return l};function t(l){this.defaults=e({},l)}function i(l){return l.replace(/-(\w)/g,function(o,r){return r.toUpperCase()})}function s(l){for(var o=0,r=0;ro&&(u[c]=` `+u[c],f=d)}r[a]=u.join("")}return r.join(` -`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(l){var o=Prism.plugins.NormalizeWhitespace;if(!(l.settings&&l.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(l.element,"whitespace-normalization",!0)){if((!l.element||!l.element.parentNode)&&l.code){l.code=o.normalize(l.code,l.settings);return}var r=l.element.parentNode;if(!(!l.code||!r||r.nodeName.toLowerCase()!=="pre")){for(var a=r.childNodes,u="",f="",c=!1,d=0;d>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function Jw(n){let e,t,i;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-1ua9m3i"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-1ua9m3i")},m(s,l){w(s,e,l),m(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-1ua9m3i")&&p(e,"class",i)},i:oe,o:oe,d(s){s&&k(e)}}}function Zw(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Ws.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Ws.highlight(a,Ws.languages[l]||Ws.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Ws<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class _n extends Ee{constructor(e){super(),Oe(this,e,Zw,Jw,De,{class:0,content:2,language:3})}}const Gw=n=>({}),oc=n=>({}),Xw=n=>({}),rc=n=>({});function ac(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S=n[4]&&!n[2]&&uc(n);const $=n[18].header,M=wn($,n,n[17],rc);let D=n[4]&&n[2]&&fc(n);const E=n[18].default,O=wn(E,n,n[17],null),L=n[18].footer,I=wn(L,n,n[17],oc);return{c(){e=_("div"),t=_("div"),s=T(),l=_("div"),o=_("div"),S&&S.c(),r=T(),M&&M.c(),a=T(),D&&D.c(),u=T(),f=_("div"),O&&O.c(),c=T(),d=_("div"),I&&I.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),ie(l,"popup",n[2]),p(e,"class","overlay-panel-container"),ie(e,"padded",n[2]),ie(e,"active",n[0])},m(N,B){w(N,e,B),m(e,t),m(e,s),m(e,l),m(l,o),S&&S.m(o,null),m(o,r),M&&M.m(o,null),m(o,a),D&&D.m(o,null),m(l,u),m(l,f),O&&O.m(f,null),n[20](f),m(l,c),m(l,d),I&&I.m(d,null),b=!0,y||(C=[G(t,"click",Kt(n[19])),G(f,"scroll",n[21])],y=!0)},p(N,B){n=N,n[4]&&!n[2]?S?S.p(n,B):(S=uc(n),S.c(),S.m(o,r)):S&&(S.d(1),S=null),M&&M.p&&(!b||B&131072)&&Sn(M,$,n,n[17],b?$n($,n[17],B,Xw):Cn(n[17]),rc),n[4]&&n[2]?D?D.p(n,B):(D=fc(n),D.c(),D.m(o,null)):D&&(D.d(1),D=null),O&&O.p&&(!b||B&131072)&&Sn(O,E,n,n[17],b?$n(E,n[17],B,null):Cn(n[17]),null),I&&I.p&&(!b||B&131072)&&Sn(I,L,n,n[17],b?$n(L,n[17],B,Gw):Cn(n[17]),oc),(!b||B&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),B&262&&ie(l,"popup",n[2]),B&4&&ie(e,"padded",n[2]),B&1&&ie(e,"active",n[0])},i(N){b||(Tt(()=>{i||(i=ot(t,vo,{duration:_s,opacity:0},!0)),i.run(1)}),A(M,N),A(O,N),A(I,N),Tt(()=>{v&&v.end(1),g=Cm(l,Un,n[2]?{duration:_s,y:-10}:{duration:_s,x:50}),g.start()}),b=!0)},o(N){i||(i=ot(t,vo,{duration:_s,opacity:0},!1)),i.run(0),P(M,N),P(O,N),P(I,N),g&&g.invalidate(),v=Mm(l,Un,n[2]?{duration:_s,y:10}:{duration:_s,x:50}),b=!1},d(N){N&&k(e),N&&i&&i.end(),S&&S.d(),M&&M.d(N),D&&D.d(),O&&O.d(N),n[20](null),I&&I.d(N),N&&v&&v.end(),y=!1,Ge(C)}}}function uc(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=G(e,"click",Kt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function fc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=G(e,"click",Kt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Qw(n){let e,t,i,s,l=n[0]&&ac(n);return{c(){e=_("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper")},m(o,r){w(o,e,r),l&&l.m(e,null),n[22](e),t=!0,i||(s=[G(window,"resize",n[10]),G(window,"keydown",n[9])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=ac(o),l.c(),A(l,1),l.m(e,null)):l&&(Ae(),P(l,1,1,()=>{l=null}),Pe())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&k(e),l&&l.d(),n[22](null),i=!1,Ge(s)}}}let Zi;function N_(){return Zi=Zi||document.querySelector(".overlays"),Zi||(Zi=document.createElement("div"),Zi.classList.add("overlays"),document.body.appendChild(Zi)),Zi}let _s=150;function cc(){return 1e3+N_().querySelectorAll(".overlay-panel-container.active").length}function xw(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const h=on();let g,v,b,y,C="";function S(){typeof c=="function"&&c()===!1||t(0,o=!0)}function $(){typeof d=="function"&&d()===!1||t(0,o=!1)}function M(){return o}async function D(K){K?(b=document.activeElement,g==null||g.focus(),h("show")):(clearTimeout(y),b==null||b.focus(),h("hide")),await ii(),E()}function E(){!g||(o?t(6,g.style.zIndex=cc(),g):t(6,g.style="",g))}function O(K){o&&f&&K.code=="Escape"&&!W.isInput(K.target)&&g&&g.style.zIndex==cc()&&(K.preventDefault(),$())}function L(K){o&&I(v)}function I(K,se){se&&t(8,C=""),K&&(y||(y=setTimeout(()=>{if(clearTimeout(y),y=null,!K)return;if(K.scrollHeight-K.offsetHeight>0)t(8,C="scrollable");else{t(8,C="");return}K.scrollTop==0?t(8,C+=" scroll-top-reached"):K.scrollTop+K.offsetHeight==K.scrollHeight&&t(8,C+=" scroll-bottom-reached")},100)))}Jn(()=>(N_().appendChild(g),()=>{var K;clearTimeout(y),(K=g==null?void 0:g.classList)==null||K.add("hidden")}));const N=()=>a?$():!0;function B(K){de[K?"unshift":"push"](()=>{v=K,t(7,v)})}const U=K=>I(K.target);function ee(K){de[K?"unshift":"push"](()=>{g=K,t(6,g)})}return n.$$set=K=>{"class"in K&&t(1,l=K.class),"active"in K&&t(0,o=K.active),"popup"in K&&t(2,r=K.popup),"overlayClose"in K&&t(3,a=K.overlayClose),"btnClose"in K&&t(4,u=K.btnClose),"escClose"in K&&t(12,f=K.escClose),"beforeOpen"in K&&t(13,c=K.beforeOpen),"beforeHide"in K&&t(14,d=K.beforeHide),"$$scope"in K&&t(17,s=K.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&D(o),n.$$.dirty&128&&I(v,!0),n.$$.dirty&64&&g&&E()},[o,l,r,a,u,$,g,v,C,O,L,I,f,c,d,S,M,s,i,N,B,U,ee]}class mi extends Ee{constructor(e){super(),Oe(this,e,xw,Qw,De,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16})}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function e$(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function t$(n){let e,t=n[2].referer+"",i,s;return{c(){e=_("a"),i=F(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),m(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&ue(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&k(e)}}}function n$(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function i$(n){let e,t;return e=new _n({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.content=JSON.stringify(i[2].meta,null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function s$(n){var Lt;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,h,g,v=n[2].status+"",b,y,C,S,$,M,D=((Lt=n[2].method)==null?void 0:Lt.toUpperCase())+"",E,O,L,I,N,B,U=n[2].auth+"",ee,K,se,Y,te,J,ge=n[2].url+"",_e,X,re,ve,H,pe,x,Q,$e,je,Be,Z=n[2].ip+"",me,ce,we,Ze,tt,We,it=n[2].userAgent+"",Ce,ze,Xe,st,dt,be,Fe,nt,ct,yt,at,Ot,$t,jt,Nt,Je;function Se(lt,R){return lt[2].referer?t$:e$}let Ue=Se(n),et=Ue(n);const ut=[i$,n$],Pt=[];function It(lt,R){return R&4&&(Fe=null),Fe==null&&(Fe=!W.isEmpty(lt[2].meta)),Fe?0:1}return nt=It(n,-1),ct=Pt[nt]=ut[nt](n),Nt=new $i({props:{date:n[2].created}}),{c(){e=_("table"),t=_("tbody"),i=_("tr"),s=_("td"),s.textContent="ID",l=T(),o=_("td"),a=F(r),u=T(),f=_("tr"),c=_("td"),c.textContent="Status",d=T(),h=_("td"),g=_("span"),b=F(v),y=T(),C=_("tr"),S=_("td"),S.textContent="Method",$=T(),M=_("td"),E=F(D),O=T(),L=_("tr"),I=_("td"),I.textContent="Auth",N=T(),B=_("td"),ee=F(U),K=T(),se=_("tr"),Y=_("td"),Y.textContent="URL",te=T(),J=_("td"),_e=F(ge),X=T(),re=_("tr"),ve=_("td"),ve.textContent="Referer",H=T(),pe=_("td"),et.c(),x=T(),Q=_("tr"),$e=_("td"),$e.textContent="IP",je=T(),Be=_("td"),me=F(Z),ce=T(),we=_("tr"),Ze=_("td"),Ze.textContent="UserAgent",tt=T(),We=_("td"),Ce=F(it),ze=T(),Xe=_("tr"),st=_("td"),st.textContent="Meta",dt=T(),be=_("td"),ct.c(),yt=T(),at=_("tr"),Ot=_("td"),Ot.textContent="Created",$t=T(),jt=_("td"),V(Nt.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(g,"class","label"),ie(g,"label-danger",n[2].status>=400),p(S,"class","min-width txt-hint txt-bold"),p(I,"class","min-width txt-hint txt-bold"),p(Y,"class","min-width txt-hint txt-bold"),p(ve,"class","min-width txt-hint txt-bold"),p($e,"class","min-width txt-hint txt-bold"),p(Ze,"class","min-width txt-hint txt-bold"),p(st,"class","min-width txt-hint txt-bold"),p(Ot,"class","min-width txt-hint txt-bold"),p(e,"class","table-compact table-border")},m(lt,R){w(lt,e,R),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,a),m(t,u),m(t,f),m(f,c),m(f,d),m(f,h),m(h,g),m(g,b),m(t,y),m(t,C),m(C,S),m(C,$),m(C,M),m(M,E),m(t,O),m(t,L),m(L,I),m(L,N),m(L,B),m(B,ee),m(t,K),m(t,se),m(se,Y),m(se,te),m(se,J),m(J,_e),m(t,X),m(t,re),m(re,ve),m(re,H),m(re,pe),et.m(pe,null),m(t,x),m(t,Q),m(Q,$e),m(Q,je),m(Q,Be),m(Be,me),m(t,ce),m(t,we),m(we,Ze),m(we,tt),m(we,We),m(We,Ce),m(t,ze),m(t,Xe),m(Xe,st),m(Xe,dt),m(Xe,be),Pt[nt].m(be,null),m(t,yt),m(t,at),m(at,Ot),m(at,$t),m(at,jt),j(Nt,jt,null),Je=!0},p(lt,R){var ae;(!Je||R&4)&&r!==(r=lt[2].id+"")&&ue(a,r),(!Je||R&4)&&v!==(v=lt[2].status+"")&&ue(b,v),R&4&&ie(g,"label-danger",lt[2].status>=400),(!Je||R&4)&&D!==(D=((ae=lt[2].method)==null?void 0:ae.toUpperCase())+"")&&ue(E,D),(!Je||R&4)&&U!==(U=lt[2].auth+"")&&ue(ee,U),(!Je||R&4)&&ge!==(ge=lt[2].url+"")&&ue(_e,ge),Ue===(Ue=Se(lt))&&et?et.p(lt,R):(et.d(1),et=Ue(lt),et&&(et.c(),et.m(pe,null))),(!Je||R&4)&&Z!==(Z=lt[2].ip+"")&&ue(me,Z),(!Je||R&4)&&it!==(it=lt[2].userAgent+"")&&ue(Ce,it);let z=nt;nt=It(lt,R),nt===z?Pt[nt].p(lt,R):(Ae(),P(Pt[z],1,1,()=>{Pt[z]=null}),Pe(),ct=Pt[nt],ct?ct.p(lt,R):(ct=Pt[nt]=ut[nt](lt),ct.c()),A(ct,1),ct.m(be,null));const ne={};R&4&&(ne.date=lt[2].created),Nt.$set(ne)},i(lt){Je||(A(ct),A(Nt.$$.fragment,lt),Je=!0)},o(lt){P(ct),P(Nt.$$.fragment,lt),Je=!1},d(lt){lt&&k(e),et.d(),Pt[nt].d(),q(Nt)}}}function l$(n){let e;return{c(){e=_("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function o$(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Close',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[4]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function r$(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[o$],header:[l$],default:[s$]},$$scope:{ctx:n}};return e=new mi({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[5](null),q(e,s)}}}function a$(n,e,t){let i,s=new Lr;function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){de[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){rt.call(this,n,c)}function f(c){rt.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class u$ extends Ee{constructor(e){super(),Oe(this,e,a$,r$,De,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function f$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[0],w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[8]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&1&&(e.checked=u[0]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function dc(n){let e,t,i;function s(o){n[10](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new Yw({props:l}),de.push(()=>Ie(e,"filter",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function pc(n){let e,t,i;function s(o){n[11](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new cv({props:l}),de.push(()=>Ie(e,"filter",s)),e.$on("select",n[12]),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function c$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C=n[3],S,$=n[3],M,D;r=new Uo({}),r.$on("refresh",n[7]),d=new Re({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[f$,({uniqueId:L})=>({14:L}),({uniqueId:L})=>L?16384:0]},$$scope:{ctx:n}}}),g=new Bo({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","ip","referer","status","auth","userAgent"]}}),g.$on("submit",n[9]);let E=dc(n),O=pc(n);return{c(){e=_("div"),t=_("header"),i=_("nav"),s=_("div"),l=F(n[5]),o=T(),V(r.$$.fragment),a=T(),u=_("div"),f=T(),c=_("div"),V(d.$$.fragment),h=T(),V(g.$$.fragment),v=T(),b=_("div"),y=T(),E.c(),S=T(),O.c(),M=Ke(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(b,"class","clearfix m-b-xs"),p(e,"class","page-header-wrapper m-b-0")},m(L,I){w(L,e,I),m(e,t),m(t,i),m(i,s),m(s,l),m(t,o),j(r,t,null),m(t,a),m(t,u),m(t,f),m(t,c),j(d,c,null),m(e,h),j(g,e,null),m(e,v),m(e,b),m(e,y),E.m(e,null),w(L,S,I),O.m(L,I),w(L,M,I),D=!0},p(L,I){(!D||I&32)&&ue(l,L[5]);const N={};I&49153&&(N.$$scope={dirty:I,ctx:L}),d.$set(N);const B={};I&4&&(B.value=L[2]),g.$set(B),I&8&&De(C,C=L[3])?(Ae(),P(E,1,1,oe),Pe(),E=dc(L),E.c(),A(E,1),E.m(e,null)):E.p(L,I),I&8&&De($,$=L[3])?(Ae(),P(O,1,1,oe),Pe(),O=pc(L),O.c(),A(O,1),O.m(M.parentNode,M)):O.p(L,I)},i(L){D||(A(r.$$.fragment,L),A(d.$$.fragment,L),A(g.$$.fragment,L),A(E),A(O),D=!0)},o(L){P(r.$$.fragment,L),P(d.$$.fragment,L),P(g.$$.fragment,L),P(E),P(O),D=!1},d(L){L&&k(e),q(r),q(d),q(g),E.d(L),L&&k(S),L&&k(M),O.d(L)}}}function d$(n){let e,t,i,s;e=new On({props:{$$slots:{default:[c$]},$$scope:{ctx:n}}});let l={};return i=new u$({props:l}),n[13](i),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(o,r){j(e,o,r),w(o,t,r),j(i,o,r),s=!0},p(o,[r]){const a={};r&32831&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){q(e,o),o&&k(t),n[13](null),q(i,o)}}}const hc="includeAdminLogs";function p$(n,e,t){var y;let i,s;_t(n,Rt,C=>t(5,s=C)),dn(Rt,s="Request logs",s);let l,o="",r=((y=window.localStorage)==null?void 0:y.getItem(hc))<<0,a=1;function u(){t(3,a++,a)}const f=()=>u();function c(){r=this.checked,t(0,r)}const d=C=>t(2,o=C.detail);function h(C){o=C,t(2,o)}function g(C){o=C,t(2,o)}const v=C=>l==null?void 0:l.show(C==null?void 0:C.detail);function b(C){de[C?"unshift":"push"](()=>{l=C,t(1,l)})}return n.$$.update=()=>{n.$$.dirty&1&&t(4,i=r?"":'auth!="admin"'),n.$$.dirty&1&&typeof r<"u"&&window.localStorage&&window.localStorage.setItem(hc,r<<0)},[r,l,o,a,i,s,u,f,c,d,h,g,v,b]}class h$ extends Ee{constructor(e){super(),Oe(this,e,p$,d$,De,{})}}const Ds=li([]),ci=li({}),sa=li(!1);function m$(n){ci.update(e=>W.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Ds.update(e=>(W.pushOrReplaceByKey(e,n,"id"),e))}function g$(n){Ds.update(e=>(W.removeByKey(e,"id",n.id),ci.update(t=>t.id===n.id?e.find(i=>i.name!="profiles")||{}:t),e))}async function _$(n=null){return sa.set(!0),ci.set({}),Ds.set([]),ye.collections.getFullList(200,{sort:"+created"}).then(e=>{Ds.set(e);const t=n&&W.findByKey(e,"id",n);if(t)ci.set(t);else if(e.length){const i=e.find(s=>s.name!="profiles");i&&ci.set(i)}}).catch(e=>{ye.errorResponseHandler(e)}).finally(()=>{sa.set(!1)})}const Ya=li({});function pi(n,e,t){Ya.set({text:n,yesCallback:e,noCallback:t})}function R_(){Ya.set({})}function mc(n){let e,t,i,s;const l=n[13].default,o=wn(l,n,n[12],null);return{c(){e=_("div"),o&&o.c(),p(e,"class",n[1]),ie(e,"active",n[0])},m(r,a){w(r,e,a),o&&o.m(e,null),s=!0},p(r,a){o&&o.p&&(!s||a&4096)&&Sn(o,l,r,r[12],s?$n(l,r[12],a,null):Cn(r[12]),null),(!s||a&2)&&p(e,"class",r[1]),a&3&&ie(e,"active",r[0])},i(r){s||(A(o,r),r&&Tt(()=>{i&&i.end(1),t=Cm(e,Un,{duration:150,y:-5}),t.start()}),s=!0)},o(r){P(o,r),t&&t.invalidate(),r&&(i=Mm(e,Un,{duration:150,y:2})),s=!1},d(r){r&&k(e),o&&o.d(r),r&&i&&i.end()}}}function b$(n){let e,t,i,s,l=n[0]&&mc(n);return{c(){e=_("div"),l&&l.c(),p(e,"class","toggler-container")},m(o,r){w(o,e,r),l&&l.m(e,null),n[14](e),t=!0,i||(s=[G(window,"click",n[3]),G(window,"keydown",n[4]),G(window,"focusin",n[5])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=mc(o),l.c(),A(l,1),l.m(e,null)):l&&(Ae(),P(l,1,1,()=>{l=null}),Pe())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&k(e),l&&l.d(),n[14](null),i=!1,Ge(s)}}}function v$(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{closableClass:a="closable"}=e,{class:u=""}=e,f;const c=on();function d(){t(0,o=!1)}function h(){t(0,o=!0)}function g(){o?d():h()}function v(D){return!f||D.classList.contains(a)||(l==null?void 0:l.contains(D))&&!f.contains(D)||f.contains(D)&&D.closest&&D.closest("."+a)}function b(D){(!o||v(D.target))&&(D.preventDefault(),g())}function y(D){(D.code==="Enter"||D.code==="Space")&&(!o||v(D.target))&&(D.preventDefault(),D.stopPropagation(),g())}function C(D){o&&!(f!=null&&f.contains(D.target))&&!(l!=null&&l.contains(D.target))&&d()}function S(D){o&&r&&D.code=="Escape"&&(D.preventDefault(),d())}function $(D){return C(D)}Jn(()=>(t(6,l=l||f.parentNode),l.addEventListener("click",b),l.addEventListener("keydown",y),()=>{l.removeEventListener("click",b),l.removeEventListener("keydown",y)}));function M(D){de[D?"unshift":"push"](()=>{f=D,t(2,f)})}return n.$$set=D=>{"trigger"in D&&t(6,l=D.trigger),"active"in D&&t(0,o=D.active),"escClose"in D&&t(7,r=D.escClose),"closableClass"in D&&t(8,a=D.closableClass),"class"in D&&t(1,u=D.class),"$$scope"in D&&t(12,s=D.$$scope)},n.$$.update=()=>{var D,E;n.$$.dirty&65&&(o?((D=l==null?void 0:l.classList)==null||D.add("active"),c("show")):((E=l==null?void 0:l.classList)==null||E.remove("active"),c("hide")))},[o,u,f,C,S,$,l,r,a,d,h,g,s,i,M]}class Mi extends Ee{constructor(e){super(),Oe(this,e,v$,b$,De,{trigger:6,active:0,escClose:7,closableClass:8,class:1,hide:9,show:10,toggle:11})}get hide(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}get toggle(){return this.$$.ctx[11]}}const y$=n=>({active:n&1}),gc=n=>({active:n[0]});function _c(n){let e,t,i;const s=n[12].default,l=wn(s,n,n[11],null);return{c(){e=_("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&2048)&&Sn(l,s,o,o[11],i?$n(s,o[11],r,null):Cn(o[11]),null)},i(o){i||(A(l,o),o&&Tt(()=>{t||(t=ot(e,tn,{duration:150},!0)),t.run(1)}),i=!0)},o(o){P(l,o),o&&(t||(t=ot(e,tn,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function k$(n){let e,t,i,s,l,o,r,a;const u=n[12].header,f=wn(u,n,n[11],gc);let c=n[0]&&_c(n);return{c(){e=_("div"),t=_("header"),f&&f.c(),i=T(),c&&c.c(),p(t,"class","accordion-header"),ie(t,"interactive",n[2]),p(e,"tabindex",s=n[2]?0:-1),p(e,"class",l="accordion "+n[1]),ie(e,"active",n[0])},m(d,h){w(d,e,h),m(e,t),f&&f.m(t,null),m(e,i),c&&c.m(e,null),n[14](e),o=!0,r||(a=[G(t,"click",Kt(n[13])),G(e,"keydown",vm(n[5]))],r=!0)},p(d,[h]){f&&f.p&&(!o||h&2049)&&Sn(f,u,d,d[11],o?$n(u,d[11],h,y$):Cn(d[11]),gc),h&4&&ie(t,"interactive",d[2]),d[0]?c?(c.p(d,h),h&1&&A(c,1)):(c=_c(d),c.c(),A(c,1),c.m(e,null)):c&&(Ae(),P(c,1,1,()=>{c=null}),Pe()),(!o||h&4&&s!==(s=d[2]?0:-1))&&p(e,"tabindex",s),(!o||h&2&&l!==(l="accordion "+d[1]))&&p(e,"class",l),h&3&&ie(e,"active",d[0])},i(d){o||(A(f,d),A(c),o=!0)},o(d){P(f,d),P(c),o=!1},d(d){d&&k(e),f&&f.d(d),c&&c.d(),n[14](null),r=!1,Ge(a)}}}function w$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=on();let o,r,{class:a=""}=e,{active:u=!1}=e,{interactive:f=!0}=e,{single:c=!1}=e;function d(){v(),t(0,u=!0),l("expand")}function h(){t(0,u=!1),clearTimeout(r),l("collapse")}function g(){l("toggle"),u?h():d()}function v(){if(c&&o.parentElement){const S=o.parentElement.querySelectorAll(".accordion.active .accordion-header.interactive");for(const $ of S)$.click()}}function b(S){!f||(S.code==="Enter"||S.code==="Space")&&(S.preventDefault(),g())}Jn(()=>()=>clearTimeout(r));const y=()=>f&&g();function C(S){de[S?"unshift":"push"](()=>{o=S,t(4,o)})}return n.$$set=S=>{"class"in S&&t(1,a=S.class),"active"in S&&t(0,u=S.active),"interactive"in S&&t(2,f=S.interactive),"single"in S&&t(6,c=S.single),"$$scope"in S&&t(11,s=S.$$scope)},n.$$.update=()=>{n.$$.dirty&1041&&u&&(clearTimeout(r),t(10,r=setTimeout(()=>{o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},250)))},[u,a,f,g,o,b,c,d,h,v,r,s,i,y,C]}class Xo extends Ee{constructor(e){super(),Oe(this,e,w$,k$,De,{class:1,active:0,interactive:2,single:6,expand:7,collapse:8,toggle:3,collapseSiblings:9})}get expand(){return this.$$.ctx[7]}get collapse(){return this.$$.ctx[8]}get toggle(){return this.$$.ctx[3]}get collapseSiblings(){return this.$$.ctx[9]}}const $$=n=>({}),bc=n=>({});function vc(n,e,t){const i=n.slice();return i[45]=e[t],i}const S$=n=>({}),yc=n=>({});function kc(n,e,t){const i=n.slice();return i[45]=e[t],i}function wc(n){let e,t;return{c(){e=_("div"),t=F(n[2]),p(e,"class","txt-placeholder")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s[0]&4&&ue(t,i[2])},d(i){i&&k(e)}}}function C$(n){let e,t=n[45]+"",i;return{c(){e=_("span"),i=F(t),p(e,"class","txt")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&1&&t!==(t=s[45]+"")&&ue(i,t)},i:oe,o:oe,d(s){s&&k(e)}}}function M$(n){let e,t,i;const s=[{item:n[45]},n[8]];var l=n[7];function o(r){let a={};for(let u=0;u{q(f,1)}),Pe()}l?(e=new l(o()),V(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function $c(n){let e,t,i;function s(){return n[33](n[45])}return{c(){e=_("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Ye(wt.call(null,e,"Clear")),G(e,"click",ei(Kt(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function Sc(n){let e,t,i,s,l,o;const r=[M$,C$],a=[];function u(c,d){return c[7]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[6])&&$c(n);return{c(){e=_("div"),i.c(),s=T(),f&&f.c(),l=T(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),m(e,s),f&&f.m(e,null),m(e,l),o=!0},p(c,d){let h=t;t=u(c),t===h?a[t].p(c,d):(Ae(),P(a[h],1,1,()=>{a[h]=null}),Pe(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[6]?f?f.p(c,d):(f=$c(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){P(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function Cc(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[17],$$slots:{default:[O$]},$$scope:{ctx:n}};return e=new Mi({props:i}),n[38](e),e.$on("show",n[23]),e.$on("hide",n[39]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&131072&&(o.trigger=s[17]),l[0]&806410|l[1]&1024&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[38](null),q(e,s)}}}function Mc(n){let e,t,i,s,l,o,r,a,u=n[14].length&&Tc(n);return{c(){e=_("div"),t=_("label"),i=_("div"),i.innerHTML='',s=T(),l=_("input"),o=T(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(t,s),m(t,l),Me(l,n[14]),m(t,o),u&&u.m(t,null),l.focus(),r||(a=G(l,"input",n[35]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&16384&&l.value!==f[14]&&Me(l,f[14]),f[14].length?u?u.p(f,c):(u=Tc(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function Tc(n){let e,t,i,s;return{c(){e=_("div"),t=_("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-secondary clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),m(e,t),i||(s=G(t,"click",ei(Kt(n[20]))),i=!0)},p:oe,d(l){l&&k(e),i=!1,s()}}}function Dc(n){let e,t=n[1]&&Oc(n);return{c(){t&&t.c(),e=Ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=Oc(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function Oc(n){let e,t;return{c(){e=_("div"),t=F(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s[0]&2&&ue(t,i[1])},d(i){i&&k(e)}}}function T$(n){let e=n[45]+"",t;return{c(){t=F(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&524288&&e!==(e=i[45]+"")&&ue(t,e)},i:oe,o:oe,d(i){i&&k(t)}}}function D$(n){let e,t,i;const s=[{item:n[45]},n[10]];var l=n[9];function o(r){let a={};for(let u=0;u{q(f,1)}),Pe()}l?(e=new l(o()),V(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function Ec(n){let e,t,i,s,l,o,r;const a=[D$,T$],u=[];function f(h,g){return h[9]?0:1}t=f(n),i=u[t]=a[t](n);function c(...h){return n[36](n[45],...h)}function d(...h){return n[37](n[45],...h)}return{c(){e=_("div"),i.c(),s=T(),p(e,"tabindex","0"),p(e,"class","dropdown-item option closable"),ie(e,"selected",n[18](n[45]))},m(h,g){w(h,e,g),u[t].m(e,null),m(e,s),l=!0,o||(r=[G(e,"click",c),G(e,"keydown",d)],o=!0)},p(h,g){n=h;let v=t;t=f(n),t===v?u[t].p(n,g):(Ae(),P(u[v],1,1,()=>{u[v]=null}),Pe(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),g[0]&786432&&ie(e,"selected",n[18](n[45]))},i(h){l||(A(i),l=!0)},o(h){P(i),l=!1},d(h){h&&k(e),u[t].d(),o=!1,Ge(r)}}}function O$(n){let e,t,i,s,l,o=n[11]&&Mc(n);const r=n[32].beforeOptions,a=wn(r,n,n[41],yc);let u=n[19],f=[];for(let v=0;vP(f[v],1,1,()=>{f[v]=null});let d=null;u.length||(d=Dc(n));const h=n[32].afterOptions,g=wn(h,n,n[41],bc);return{c(){o&&o.c(),e=T(),a&&a.c(),t=T(),i=_("div");for(let v=0;vP(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=wc(n));let c=!n[5]&&Cc(n);return{c(){e=_("div"),t=_("div");for(let d=0;d{c=null}),Pe()):c?(c.p(d,h),h[0]&32&&A(c,1)):(c=Cc(d),c.c(),A(c,1),c.m(e,null)),(!o||h[0]&4096&&l!==(l="select "+d[12]))&&p(e,"class",l),h[0]&4112&&ie(e,"multiple",d[4]),h[0]&4128&&ie(e,"disabled",d[5])},i(d){if(!o){for(let h=0;hce(we,me))||[]}function ge(Z,me){Z.preventDefault(),v&&d?U(me):B(me)}function _e(Z,me){(Z.code==="Enter"||Z.code==="Space")&&ge(Z,me)}function X(){te(),setTimeout(()=>{const Z=L==null?void 0:L.querySelector(".dropdown-item.option.selected");Z&&(Z.focus(),Z.scrollIntoView({block:"nearest"}))},0)}function re(Z){Z.stopPropagation(),!h&&(E==null||E.toggle())}Jn(()=>{const Z=document.querySelectorAll(`label[for="${r}"]`);for(const me of Z)me.addEventListener("click",re);return()=>{for(const me of Z)me.removeEventListener("click",re)}});const ve=Z=>N(Z);function H(Z){de[Z?"unshift":"push"](()=>{I=Z,t(17,I)})}function pe(){O=this.value,t(14,O)}const x=(Z,me)=>ge(me,Z),Q=(Z,me)=>_e(me,Z);function $e(Z){de[Z?"unshift":"push"](()=>{E=Z,t(15,E)})}function je(Z){rt.call(this,n,Z)}function Be(Z){de[Z?"unshift":"push"](()=>{L=Z,t(16,L)})}return n.$$set=Z=>{"id"in Z&&t(24,r=Z.id),"noOptionsText"in Z&&t(1,a=Z.noOptionsText),"selectPlaceholder"in Z&&t(2,u=Z.selectPlaceholder),"searchPlaceholder"in Z&&t(3,f=Z.searchPlaceholder),"items"in Z&&t(25,c=Z.items),"multiple"in Z&&t(4,d=Z.multiple),"disabled"in Z&&t(5,h=Z.disabled),"selected"in Z&&t(0,g=Z.selected),"toggle"in Z&&t(6,v=Z.toggle),"labelComponent"in Z&&t(7,b=Z.labelComponent),"labelComponentProps"in Z&&t(8,y=Z.labelComponentProps),"optionComponent"in Z&&t(9,C=Z.optionComponent),"optionComponentProps"in Z&&t(10,S=Z.optionComponentProps),"searchable"in Z&&t(11,$=Z.searchable),"searchFunc"in Z&&t(26,M=Z.searchFunc),"class"in Z&&t(12,D=Z.class),"$$scope"in Z&&t(41,o=Z.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&c&&(Y(),te()),n.$$.dirty[0]&33570816&&t(19,i=J(c,O)),n.$$.dirty[0]&1&&t(18,s=function(Z){let me=W.toArray(g);return W.inArray(me,Z)})},[g,a,u,f,d,h,v,b,y,C,S,$,D,N,O,E,L,I,s,i,te,ge,_e,X,r,c,M,B,U,ee,K,se,l,ve,H,pe,x,Q,$e,je,Be,o]}class H_ extends Ee{constructor(e){super(),Oe(this,e,P$,E$,De,{id:24,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:25,multiple:4,disabled:5,selected:0,toggle:6,labelComponent:7,labelComponentProps:8,optionComponent:9,optionComponentProps:10,searchable:11,searchFunc:26,class:12,deselectItem:13,selectItem:27,toggleItem:28,reset:29,showDropdown:30,hideDropdown:31},null,[-1,-1])}get deselectItem(){return this.$$.ctx[13]}get selectItem(){return this.$$.ctx[27]}get toggleItem(){return this.$$.ctx[28]}get reset(){return this.$$.ctx[29]}get showDropdown(){return this.$$.ctx[30]}get hideDropdown(){return this.$$.ctx[31]}}function Ac(n){let e,t;return{c(){e=_("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function L$(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&Ac(n);return{c(){l&&l.c(),e=T(),t=_("span"),s=F(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),m(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=Ac(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&ue(s,i)},i:oe,o:oe,d(o){l&&l.d(o),o&&k(e),o&&k(t)}}}function I$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Pc extends Ee{constructor(e){super(),Oe(this,e,I$,L$,De,{item:0})}}const F$=n=>({}),Lc=n=>({});function N$(n){let e;const t=n[8].afterOptions,i=wn(t,n,n[12],Lc);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Sn(i,t,s,s[12],e?$n(t,s[12],l,F$):Cn(s[12]),Lc)},i(s){e||(A(i,s),e=!0)},o(s){P(i,s),e=!1},d(s){i&&i.d(s)}}}function R$(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[N$]},$$scope:{ctx:n}};for(let r=0;rIe(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){V(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&62?pn(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&si(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],He(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function H$(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Ut(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Pc}=e,{optionComponent:c=Pc}=e,{selectionKey:d="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function g(S){S=W.toArray(S,!0);let $=[];for(let M of r)W.inArray(S,M[d])&&$.push(M);S.length&&!$.length||t(0,u=a?$:$[0])}async function v(S){let $=W.toArray(S,!0).map(M=>M[d]);!r.length||t(6,h=a?$:$[0])}function b(S){u=S,t(0,u)}function y(S){rt.call(this,n,S)}function C(S){rt.call(this,n,S)}return n.$$set=S=>{e=ft(ft({},e),ni(S)),t(5,s=Ut(e,i)),"items"in S&&t(1,r=S.items),"multiple"in S&&t(2,a=S.multiple),"selected"in S&&t(0,u=S.selected),"labelComponent"in S&&t(3,f=S.labelComponent),"optionComponent"in S&&t(4,c=S.optionComponent),"selectionKey"in S&&t(7,d=S.selectionKey),"keyOfSelected"in S&&t(6,h=S.keyOfSelected),"$$scope"in S&&t(12,o=S.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(h),n.$$.dirty&1&&v(u)},[u,r,a,f,c,s,h,d,l,b,y,C,o]}class fs extends Ee{constructor(e){super(),Oe(this,e,H$,R$,De,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function j$(n){let e,t,i;const s=[{class:"field-type-select "+n[1]},{searchable:!0},{items:n[2]},n[3]];function l(r){n[4](r)}let o={};for(let r=0;rIe(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&14?pn(s,[a&2&&{class:"field-type-select "+r[1]},s[1],a&4&&{items:r[2]},a&8&&si(r[3])]):{};!t&&a&1&&(t=!0,u.keyOfSelected=r[0],He(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function q$(n,e,t){const i=["value","class"];let s=Ut(e,i),{value:l="text"}=e,{class:o=""}=e;const r=[{label:"Text",value:"text",icon:W.getFieldTypeIcon("text")},{label:"Number",value:"number",icon:W.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:W.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:W.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:W.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:W.getFieldTypeIcon("date")},{label:"Multiple choices",value:"select",icon:W.getFieldTypeIcon("select")},{label:"JSON",value:"json",icon:W.getFieldTypeIcon("json")},{label:"File",value:"file",icon:W.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:W.getFieldTypeIcon("relation")},{label:"User",value:"user",icon:W.getFieldTypeIcon("user")}];function a(u){l=u,t(0,l)}return n.$$set=u=>{e=ft(ft({},e),ni(u)),t(3,s=Ut(e,i)),"value"in u&&t(0,l=u.value),"class"in u&&t(1,o=u.class)},[l,o,r,s,a]}class V$ extends Ee{constructor(e){super(),Oe(this,e,q$,j$,De,{value:0,class:1})}}function z$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Min length"),s=T(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].min),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&At(l.value)!==u[0].min&&Me(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function B$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=F("Max length"),s=T(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min",r=n[0].min||0)},m(f,c){w(f,e,c),m(e,t),w(f,s,c),w(f,l,c),Me(l,n[0].max),a||(u=G(l,"input",n[3]),a=!0)},p(f,c){c&32&&i!==(i=f[5])&&p(e,"for",i),c&32&&o!==(o=f[5])&&p(l,"id",o),c&1&&r!==(r=f[0].min||0)&&p(l,"min",r),c&1&&At(l.value)!==f[0].max&&Me(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function U$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("Regex pattern"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML="Valid Go regular expression, eg. ^\\w+$.",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Me(l,n[0].pattern),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[4]),u=!0)},p(c,d){d&32&&i!==(i=c[5])&&p(e,"for",i),d&32&&o!==(o=c[5])&&p(l,"id",o),d&1&&l.value!==c[0].pattern&&Me(l,c[0].pattern)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function W$(n){let e,t,i,s,l,o,r,a,u,f;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[z$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[B$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[U$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){w(c,e,d),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),f=!0},p(c,[d]){const h={};d&2&&(h.name="schema."+c[1]+".options.min"),d&97&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&2&&(g.name="schema."+c[1]+".options.max"),d&97&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const v={};d&2&&(v.name="schema."+c[1]+".options.pattern"),d&97&&(v.$$scope={dirty:d,ctx:c}),u.$set(v)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&k(e),q(i),q(o),q(u)}}}function Y$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=At(this.value),t(0,s)}function o(){s.max=At(this.value),t(0,s)}function r(){s.pattern=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"options"in a&&t(0,s=a.options)},[s,i,l,o,r]}class K$ extends Ee{constructor(e){super(),Oe(this,e,Y$,W$,De,{key:1,options:0})}}function J$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Min"),s=T(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].min),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&At(l.value)!==u[0].min&&Me(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Z$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=F("Max"),s=T(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"min",r=n[0].min)},m(f,c){w(f,e,c),m(e,t),w(f,s,c),w(f,l,c),Me(l,n[0].max),a||(u=G(l,"input",n[3]),a=!0)},p(f,c){c&16&&i!==(i=f[4])&&p(e,"for",i),c&16&&o!==(o=f[4])&&p(l,"id",o),c&1&&r!==(r=f[0].min)&&p(l,"min",r),c&1&&At(l.value)!==f[0].max&&Me(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function G$(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[J$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[Z$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function X$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=At(this.value),t(0,s)}function o(){s.max=At(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class Q$ extends Ee{constructor(e){super(),Oe(this,e,X$,G$,De,{key:1,options:0})}}function x$(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class eS extends Ee{constructor(e){super(),Oe(this,e,x$,null,De,{key:0,options:1})}}function tS(n){let e,t,i,s,l=[{type:t=n[3].type||"text"},{value:n[2]},n[3]],o={};for(let r=0;r{t(0,o=W.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=ft(ft({},e),ni(u)),t(3,l=Ut(e,s)),"value"in u&&t(0,o=u.value),"separator"in u&&t(1,r=u.separator)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=(o||[]).join(", "))},[o,r,i,l,a]}class cs extends Ee{constructor(e){super(),Oe(this,e,nS,tS,De,{value:0,separator:1})}}function iS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[2](b)}let v={id:n[4],disabled:!W.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),r=new cs({props:v}),de.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(wt.call(null,s,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&p(e,"for",l);const C={};y&16&&(C.id=b[4]),y&1&&(C.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,C.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function sS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new cs({props:v}),de.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(wt.call(null,s,{text:`List of domains that are ONLY allowed. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const C={};y&16&&(C.id=b[4]+".options.onlyDomains"),y&1&&(C.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,C.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function lS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[iS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[sS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function oS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class j_ extends Ee{constructor(e){super(),Oe(this,e,oS,lS,De,{key:1,options:0})}}function rS(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new j_({props:r}),de.push(()=>Ie(e,"key",l)),de.push(()=>Ie(e,"options",o)),{c(){V(e.$$.fragment)},m(a,u){j(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],He(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],He(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){q(e,a)}}}function aS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class uS extends Ee{constructor(e){super(),Oe(this,e,aS,rS,De,{key:0,options:1})}}var wr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ks={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},hl={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},bn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Hn=function(n){return n===!0?1:0};function Ic(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var $r=function(n){return n instanceof Array?n:[n]};function hn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function Ct(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function xl(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function q_(n,e){if(e(n))return n;if(n.parentNode)return q_(n.parentNode,e)}function eo(n,e){var t=Ct("div","numInputWrapper"),i=Ct("input","numInput "+n),s=Ct("span","arrowUp"),l=Ct("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function En(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Sr=function(){},Po=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},fS={D:Sr,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Hn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Sr,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Sr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},xi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ll={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ll.w(n,e,t)]},F:function(n,e,t){return Po(ll.n(n,e,t)-1,!1,e)},G:function(n,e,t){return bn(ll.h(n,e,t))},H:function(n){return bn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Hn(n.getHours()>11)]},M:function(n,e){return Po(n.getMonth(),!0,e)},S:function(n){return bn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return bn(n.getFullYear(),4)},d:function(n){return bn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return bn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return bn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},V_=function(n){var e=n.config,t=e===void 0?ks:e,i=n.l10n,s=i===void 0?hl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,h){return ll[c]&&h[d-1]!=="\\"?ll[c](r,f,t):c!=="\\"?c:""}).join("")}},la=function(n){var e=n.config,t=e===void 0?ks:e,i=n.l10n,s=i===void 0?hl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||ks).dateFormat,h=String(l).trim();if(h==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(h)||/GMT$/.test(h))f=new Date(l);else{for(var g=void 0,v=[],b=0,y=0,C="";bMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Mr(t.config);z.setHours(ne.hours,ne.minutes,ne.seconds,z.getMilliseconds()),t.selectedDates=[z],t.latestSelectedDateObj=z}R!==void 0&&R.type!=="blur"&<(R);var ae=t._input.value;c(),It(),t._input.value!==ae&&t._debouncedChange()}function u(R,z){return R%12+12*Hn(z===t.l10n.amPM[1])}function f(R){switch(R%24){case 0:case 12:return 12;default:return R%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var R=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,z=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(R=u(R,t.amPM.textContent));var ae=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&An(t.latestSelectedDateObj,t.config.minDate,!0)===0,Le=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&An(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var le=Cr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),ke=Cr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Te=Cr(R,z,ne);if(Te>ke&&Te=12)]),t.secondElement!==void 0&&(t.secondElement.value=bn(ne)))}function g(R){var z=En(R),ne=parseInt(z.value)+(R.delta||0);(ne/1e3>1||R.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&x(ne)}function v(R,z,ne,ae){if(z instanceof Array)return z.forEach(function(Le){return v(R,Le,ne,ae)});if(R instanceof Array)return R.forEach(function(Le){return v(Le,z,ne,ae)});R.addEventListener(z,ne,ae),t._handlers.push({remove:function(){return R.removeEventListener(z,ne,ae)}})}function b(){Je("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(ae){return v(ae,"click",t[ne])})}),t.isMobile){jt();return}var R=Ic(me,50);if(t._debouncedChange=Ic(b,hS),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&v(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Z(En(ne))}),v(t._input,"keydown",Be),t.calendarContainer!==void 0&&v(t.calendarContainer,"keydown",Be),!t.config.inline&&!t.config.static&&v(window,"resize",R),window.ontouchstart!==void 0?v(window.document,"touchstart",pe):v(window.document,"mousedown",pe),v(window.document,"focus",pe,{capture:!0}),t.config.clickOpens===!0&&(v(t._input,"focus",t.open),v(t._input,"click",t.open)),t.daysContainer!==void 0&&(v(t.monthNav,"click",Lt),v(t.monthNav,["keyup","increment"],g),v(t.daysContainer,"click",dt)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var z=function(ne){return En(ne).select()};v(t.timeContainer,["increment"],a),v(t.timeContainer,"blur",a,{capture:!0}),v(t.timeContainer,"click",S),v([t.hourElement,t.minuteElement],["focus","click"],z),t.secondElement!==void 0&&v(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&v(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&v(t._input,"blur",je)}function C(R,z){var ne=R!==void 0?t.parseDate(R):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(R);var Le=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Le&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var le=Ct("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(le,t.element),le.appendChild(t.element),t.altInput&&le.appendChild(t.altInput),le.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function D(R,z,ne,ae){var Le=Q(z,!0),le=Ct("span",R,z.getDate().toString());return le.dateObj=z,le.$i=ae,le.setAttribute("aria-label",t.formatDate(z,t.config.ariaDateFormat)),R.indexOf("hidden")===-1&&An(z,t.now)===0&&(t.todayDateElem=le,le.classList.add("today"),le.setAttribute("aria-current","date")),Le?(le.tabIndex=-1,Ue(z)&&(le.classList.add("selected"),t.selectedDateElem=le,t.config.mode==="range"&&(hn(le,"startRange",t.selectedDates[0]&&An(z,t.selectedDates[0],!0)===0),hn(le,"endRange",t.selectedDates[1]&&An(z,t.selectedDates[1],!0)===0),R==="nextMonthDay"&&le.classList.add("inRange")))):le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&et(z)&&!Ue(z)&&le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&R!=="prevMonthDay"&&ae%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(z)+""),Je("onDayCreate",le),le}function E(R){R.focus(),t.config.mode==="range"&&Z(R)}function O(R){for(var z=R>0?0:t.config.showMonths-1,ne=R>0?t.config.showMonths:-1,ae=z;ae!=ne;ae+=R)for(var Le=t.daysContainer.children[ae],le=R>0?0:Le.children.length-1,ke=R>0?Le.children.length:-1,Te=le;Te!=ke;Te+=R){var fe=Le.children[Te];if(fe.className.indexOf("hidden")===-1&&Q(fe.dateObj))return fe}}function L(R,z){for(var ne=R.className.indexOf("Month")===-1?R.dateObj.getMonth():t.currentMonth,ae=z>0?t.config.showMonths:-1,Le=z>0?1:-1,le=ne-t.currentMonth;le!=ae;le+=Le)for(var ke=t.daysContainer.children[le],Te=ne-t.currentMonth===le?R.$i+z:z<0?ke.children.length-1:0,fe=ke.children.length,he=Te;he>=0&&he0?fe:-1);he+=Le){var Ne=ke.children[he];if(Ne.className.indexOf("hidden")===-1&&Q(Ne.dateObj)&&Math.abs(R.$i-he)>=Math.abs(z))return E(Ne)}t.changeMonth(Le),I(O(Le),0)}function I(R,z){var ne=l(),ae=$e(ne||document.body),Le=R!==void 0?R:ae?ne:t.selectedDateElem!==void 0&&$e(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&$e(t.todayDateElem)?t.todayDateElem:O(z>0?1:-1);Le===void 0?t._input.focus():ae?L(Le,z):E(Le)}function N(R,z){for(var ne=(new Date(R,z,1).getDay()-t.l10n.firstDayOfWeek+7)%7,ae=t.utils.getDaysInMonth((z-1+12)%12,R),Le=t.utils.getDaysInMonth(z,R),le=window.document.createDocumentFragment(),ke=t.config.showMonths>1,Te=ke?"prevMonthDay hidden":"prevMonthDay",fe=ke?"nextMonthDay hidden":"nextMonthDay",he=ae+1-ne,Ne=0;he<=ae;he++,Ne++)le.appendChild(D("flatpickr-day "+Te,new Date(R,z-1,he),he,Ne));for(he=1;he<=Le;he++,Ne++)le.appendChild(D("flatpickr-day",new Date(R,z,he),he,Ne));for(var ht=Le+1;ht<=42-ne&&(t.config.showMonths===1||Ne%7!==0);ht++,Ne++)le.appendChild(D("flatpickr-day "+fe,new Date(R,z+1,ht%Le),ht,Ne));var rn=Ct("div","dayContainer");return rn.appendChild(le),rn}function B(){if(t.daysContainer!==void 0){xl(t.daysContainer),t.weekNumbers&&xl(t.weekNumbers);for(var R=document.createDocumentFragment(),z=0;z1||t.config.monthSelectorType!=="dropdown")){var R=function(ae){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&aet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var z=0;z<12;z++)if(!!R(z)){var ne=Ct("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,z).getMonth().toString(),ne.textContent=Po(z,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===z&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function ee(){var R=Ct("div","flatpickr-month"),z=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=Ct("span","cur-month"):(t.monthsDropdownContainer=Ct("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),v(t.monthsDropdownContainer,"change",function(ke){var Te=En(ke),fe=parseInt(Te.value,10);t.changeMonth(fe-t.currentMonth),Je("onMonthChange")}),U(),ne=t.monthsDropdownContainer);var ae=eo("cur-year",{tabindex:"-1"}),Le=ae.getElementsByTagName("input")[0];Le.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Le.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Le.setAttribute("max",t.config.maxDate.getFullYear().toString()),Le.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var le=Ct("div","flatpickr-current-month");return le.appendChild(ne),le.appendChild(ae),z.appendChild(le),R.appendChild(z),{container:R,yearElement:Le,monthElement:ne}}function K(){xl(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var R=t.config.showMonths;R--;){var z=ee();t.yearElements.push(z.yearElement),t.monthElements.push(z.monthElement),t.monthNav.appendChild(z.container)}t.monthNav.appendChild(t.nextMonthNav)}function se(){return t.monthNav=Ct("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=Ct("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=Ct("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,K(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(R){t.__hidePrevMonthArrow!==R&&(hn(t.prevMonthNav,"flatpickr-disabled",R),t.__hidePrevMonthArrow=R)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(R){t.__hideNextMonthArrow!==R&&(hn(t.nextMonthNav,"flatpickr-disabled",R),t.__hideNextMonthArrow=R)}}),t.currentYearElement=t.yearElements[0],ut(),t.monthNav}function Y(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var R=Mr(t.config);t.timeContainer=Ct("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var z=Ct("span","flatpickr-time-separator",":"),ne=eo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var ae=eo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=ae.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=bn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?R.hours:f(R.hours)),t.minuteElement.value=bn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():R.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(z),t.timeContainer.appendChild(ae),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Le=eo("flatpickr-second");t.secondElement=Le.getElementsByTagName("input")[0],t.secondElement.value=bn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():R.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(Ct("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Le)}return t.config.time_24hr||(t.amPM=Ct("span","flatpickr-am-pm",t.l10n.amPM[Hn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function te(){t.weekdayContainer?xl(t.weekdayContainer):t.weekdayContainer=Ct("div","flatpickr-weekdays");for(var R=t.config.showMonths;R--;){var z=Ct("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(z)}return J(),t.weekdayContainer}function J(){if(!!t.weekdayContainer){var R=t.l10n.firstDayOfWeek,z=Fc(t.l10n.weekdays.shorthand);R>0&&R>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function Jw(n){let e,t,i;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-1ua9m3i"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-1ua9m3i")},m(s,l){w(s,e,l),m(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-1ua9m3i")&&p(e,"class",i)},i:oe,o:oe,d(s){s&&k(e)}}}function Zw(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Ws.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Ws.highlight(a,Ws.languages[l]||Ws.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Ws<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class _n extends Ee{constructor(e){super(),Oe(this,e,Zw,Jw,De,{class:0,content:2,language:3})}}const Gw=n=>({}),oc=n=>({}),Xw=n=>({}),rc=n=>({});function ac(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S=n[4]&&!n[2]&&uc(n);const $=n[18].header,M=wn($,n,n[17],rc);let D=n[4]&&n[2]&&fc(n);const E=n[18].default,O=wn(E,n,n[17],null),L=n[18].footer,I=wn(L,n,n[17],oc);return{c(){e=_("div"),t=_("div"),s=T(),l=_("div"),o=_("div"),S&&S.c(),r=T(),M&&M.c(),a=T(),D&&D.c(),u=T(),f=_("div"),O&&O.c(),c=T(),d=_("div"),I&&I.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),ie(l,"popup",n[2]),p(e,"class","overlay-panel-container"),ie(e,"padded",n[2]),ie(e,"active",n[0])},m(N,B){w(N,e,B),m(e,t),m(e,s),m(e,l),m(l,o),S&&S.m(o,null),m(o,r),M&&M.m(o,null),m(o,a),D&&D.m(o,null),m(l,u),m(l,f),O&&O.m(f,null),n[20](f),m(l,c),m(l,d),I&&I.m(d,null),b=!0,y||(C=[G(t,"click",Yt(n[19])),G(f,"scroll",n[21])],y=!0)},p(N,B){n=N,n[4]&&!n[2]?S?S.p(n,B):(S=uc(n),S.c(),S.m(o,r)):S&&(S.d(1),S=null),M&&M.p&&(!b||B&131072)&&Sn(M,$,n,n[17],b?$n($,n[17],B,Xw):Cn(n[17]),rc),n[4]&&n[2]?D?D.p(n,B):(D=fc(n),D.c(),D.m(o,null)):D&&(D.d(1),D=null),O&&O.p&&(!b||B&131072)&&Sn(O,E,n,n[17],b?$n(E,n[17],B,null):Cn(n[17]),null),I&&I.p&&(!b||B&131072)&&Sn(I,L,n,n[17],b?$n(L,n[17],B,Gw):Cn(n[17]),oc),(!b||B&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),B&262&&ie(l,"popup",n[2]),B&4&&ie(e,"padded",n[2]),B&1&&ie(e,"active",n[0])},i(N){b||(Tt(()=>{i||(i=it(t,vo,{duration:_s,opacity:0},!0)),i.run(1)}),A(M,N),A(O,N),A(I,N),Tt(()=>{v&&v.end(1),g=Cm(l,Un,n[2]?{duration:_s,y:-10}:{duration:_s,x:50}),g.start()}),b=!0)},o(N){i||(i=it(t,vo,{duration:_s,opacity:0},!1)),i.run(0),P(M,N),P(O,N),P(I,N),g&&g.invalidate(),v=Mm(l,Un,n[2]?{duration:_s,y:10}:{duration:_s,x:50}),b=!1},d(N){N&&k(e),N&&i&&i.end(),S&&S.d(),M&&M.d(N),D&&D.d(),O&&O.d(N),n[20](null),I&&I.d(N),N&&v&&v.end(),y=!1,Ge(C)}}}function uc(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=G(e,"click",Yt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function fc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=G(e,"click",Yt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Qw(n){let e,t,i,s,l=n[0]&&ac(n);return{c(){e=_("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper")},m(o,r){w(o,e,r),l&&l.m(e,null),n[22](e),t=!0,i||(s=[G(window,"resize",n[10]),G(window,"keydown",n[9])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=ac(o),l.c(),A(l,1),l.m(e,null)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&k(e),l&&l.d(),n[22](null),i=!1,Ge(s)}}}let Zi;function N_(){return Zi=Zi||document.querySelector(".overlays"),Zi||(Zi=document.createElement("div"),Zi.classList.add("overlays"),document.body.appendChild(Zi)),Zi}let _s=150;function cc(){return 1e3+N_().querySelectorAll(".overlay-panel-container.active").length}function xw(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const h=on();let g,v,b,y,C="";function S(){typeof c=="function"&&c()===!1||t(0,o=!0)}function $(){typeof d=="function"&&d()===!1||t(0,o=!1)}function M(){return o}async function D(K){K?(b=document.activeElement,g==null||g.focus(),h("show")):(clearTimeout(y),b==null||b.focus(),h("hide")),await ii(),E()}function E(){!g||(o?t(6,g.style.zIndex=cc(),g):t(6,g.style="",g))}function O(K){o&&f&&K.code=="Escape"&&!W.isInput(K.target)&&g&&g.style.zIndex==cc()&&(K.preventDefault(),$())}function L(K){o&&I(v)}function I(K,se){se&&t(8,C=""),K&&(y||(y=setTimeout(()=>{if(clearTimeout(y),y=null,!K)return;if(K.scrollHeight-K.offsetHeight>0)t(8,C="scrollable");else{t(8,C="");return}K.scrollTop==0?t(8,C+=" scroll-top-reached"):K.scrollTop+K.offsetHeight==K.scrollHeight&&t(8,C+=" scroll-bottom-reached")},100)))}Jn(()=>(N_().appendChild(g),()=>{var K;clearTimeout(y),(K=g==null?void 0:g.classList)==null||K.add("hidden")}));const N=()=>a?$():!0;function B(K){pe[K?"unshift":"push"](()=>{v=K,t(7,v)})}const U=K=>I(K.target);function ee(K){pe[K?"unshift":"push"](()=>{g=K,t(6,g)})}return n.$$set=K=>{"class"in K&&t(1,l=K.class),"active"in K&&t(0,o=K.active),"popup"in K&&t(2,r=K.popup),"overlayClose"in K&&t(3,a=K.overlayClose),"btnClose"in K&&t(4,u=K.btnClose),"escClose"in K&&t(12,f=K.escClose),"beforeOpen"in K&&t(13,c=K.beforeOpen),"beforeHide"in K&&t(14,d=K.beforeHide),"$$scope"in K&&t(17,s=K.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&D(o),n.$$.dirty&128&&I(v,!0),n.$$.dirty&64&&g&&E()},[o,l,r,a,u,$,g,v,C,O,L,I,f,c,d,S,M,s,i,N,B,U,ee]}class mi extends Ee{constructor(e){super(),Oe(this,e,xw,Qw,De,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16})}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function e$(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function t$(n){let e,t=n[2].referer+"",i,s;return{c(){e=_("a"),i=F(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),m(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&ue(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&k(e)}}}function n$(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function i$(n){let e,t;return e=new _n({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.content=JSON.stringify(i[2].meta,null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function s$(n){var le;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,h,g,v=n[2].status+"",b,y,C,S,$,M,D=((le=n[2].method)==null?void 0:le.toUpperCase())+"",E,O,L,I,N,B,U=n[2].auth+"",ee,K,se,Y,te,J,_e=n[2].url+"",be,X,ae,ve,H,me,x,Q,Se,je,Ue,Z=n[2].remoteIp+"",ge,ce,$e,Ze,et,We,tt=n[2].userIp+"",Me,ze,Xe,nt,ut,ye,Ne=n[2].userAgent+"",ct,Dt,dt,lt,Lt,mt,Nt,Ot,Je,Ce,Be,ot,rt,Ht,Ct,ft;function xt(de,ke){return de[2].referer?t$:e$}let R=xt(n),z=R(n);const ne=[i$,n$],re=[];function Ae(de,ke){return ke&4&&(Nt=null),Nt==null&&(Nt=!W.isEmpty(de[2].meta)),Nt?0:1}return Ot=Ae(n,-1),Je=re[Ot]=ne[Ot](n),Ct=new $i({props:{date:n[2].created}}),{c(){e=_("table"),t=_("tbody"),i=_("tr"),s=_("td"),s.textContent="ID",l=T(),o=_("td"),a=F(r),u=T(),f=_("tr"),c=_("td"),c.textContent="Status",d=T(),h=_("td"),g=_("span"),b=F(v),y=T(),C=_("tr"),S=_("td"),S.textContent="Method",$=T(),M=_("td"),E=F(D),O=T(),L=_("tr"),I=_("td"),I.textContent="Auth",N=T(),B=_("td"),ee=F(U),K=T(),se=_("tr"),Y=_("td"),Y.textContent="URL",te=T(),J=_("td"),be=F(_e),X=T(),ae=_("tr"),ve=_("td"),ve.textContent="Referer",H=T(),me=_("td"),z.c(),x=T(),Q=_("tr"),Se=_("td"),Se.textContent="Remote IP",je=T(),Ue=_("td"),ge=F(Z),ce=T(),$e=_("tr"),Ze=_("td"),Ze.textContent="User IP",et=T(),We=_("td"),Me=F(tt),ze=T(),Xe=_("tr"),nt=_("td"),nt.textContent="UserAgent",ut=T(),ye=_("td"),ct=F(Ne),Dt=T(),dt=_("tr"),lt=_("td"),lt.textContent="Meta",Lt=T(),mt=_("td"),Je.c(),Ce=T(),Be=_("tr"),ot=_("td"),ot.textContent="Created",rt=T(),Ht=_("td"),V(Ct.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(g,"class","label"),ie(g,"label-danger",n[2].status>=400),p(S,"class","min-width txt-hint txt-bold"),p(I,"class","min-width txt-hint txt-bold"),p(Y,"class","min-width txt-hint txt-bold"),p(ve,"class","min-width txt-hint txt-bold"),p(Se,"class","min-width txt-hint txt-bold"),p(Ze,"class","min-width txt-hint txt-bold"),p(nt,"class","min-width txt-hint txt-bold"),p(lt,"class","min-width txt-hint txt-bold"),p(ot,"class","min-width txt-hint txt-bold"),p(e,"class","table-compact table-border")},m(de,ke){w(de,e,ke),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,a),m(t,u),m(t,f),m(f,c),m(f,d),m(f,h),m(h,g),m(g,b),m(t,y),m(t,C),m(C,S),m(C,$),m(C,M),m(M,E),m(t,O),m(t,L),m(L,I),m(L,N),m(L,B),m(B,ee),m(t,K),m(t,se),m(se,Y),m(se,te),m(se,J),m(J,be),m(t,X),m(t,ae),m(ae,ve),m(ae,H),m(ae,me),z.m(me,null),m(t,x),m(t,Q),m(Q,Se),m(Q,je),m(Q,Ue),m(Ue,ge),m(t,ce),m(t,$e),m($e,Ze),m($e,et),m($e,We),m(We,Me),m(t,ze),m(t,Xe),m(Xe,nt),m(Xe,ut),m(Xe,ye),m(ye,ct),m(t,Dt),m(t,dt),m(dt,lt),m(dt,Lt),m(dt,mt),re[Ot].m(mt,null),m(t,Ce),m(t,Be),m(Be,ot),m(Be,rt),m(Be,Ht),j(Ct,Ht,null),ft=!0},p(de,ke){var Ie;(!ft||ke&4)&&r!==(r=de[2].id+"")&&ue(a,r),(!ft||ke&4)&&v!==(v=de[2].status+"")&&ue(b,v),ke&4&&ie(g,"label-danger",de[2].status>=400),(!ft||ke&4)&&D!==(D=((Ie=de[2].method)==null?void 0:Ie.toUpperCase())+"")&&ue(E,D),(!ft||ke&4)&&U!==(U=de[2].auth+"")&&ue(ee,U),(!ft||ke&4)&&_e!==(_e=de[2].url+"")&&ue(be,_e),R===(R=xt(de))&&z?z.p(de,ke):(z.d(1),z=R(de),z&&(z.c(),z.m(me,null))),(!ft||ke&4)&&Z!==(Z=de[2].remoteIp+"")&&ue(ge,Z),(!ft||ke&4)&&tt!==(tt=de[2].userIp+"")&&ue(Me,tt),(!ft||ke&4)&&Ne!==(Ne=de[2].userAgent+"")&&ue(ct,Ne);let fe=Ot;Ot=Ae(de,ke),Ot===fe?re[Ot].p(de,ke):(Pe(),P(re[fe],1,1,()=>{re[fe]=null}),Le(),Je=re[Ot],Je?Je.p(de,ke):(Je=re[Ot]=ne[Ot](de),Je.c()),A(Je,1),Je.m(mt,null));const he={};ke&4&&(he.date=de[2].created),Ct.$set(he)},i(de){ft||(A(Je),A(Ct.$$.fragment,de),ft=!0)},o(de){P(Je),P(Ct.$$.fragment,de),ft=!1},d(de){de&&k(e),z.d(),re[Ot].d(),q(Ct)}}}function l$(n){let e;return{c(){e=_("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function o$(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Close',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[4]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function r$(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[o$],header:[l$],default:[s$]},$$scope:{ctx:n}};return e=new mi({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[5](null),q(e,s)}}}function a$(n,e,t){let i,s=new Lr;function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){pe[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){st.call(this,n,c)}function f(c){st.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class u$ extends Ee{constructor(e){super(),Oe(this,e,a$,r$,De,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function f$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[0],w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[8]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&1&&(e.checked=u[0]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function dc(n){let e,t,i;function s(o){n[10](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new Yw({props:l}),pe.push(()=>Fe(e,"filter",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function pc(n){let e,t,i;function s(o){n[11](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new cv({props:l}),pe.push(()=>Fe(e,"filter",s)),e.$on("select",n[12]),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function c$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C=n[3],S,$=n[3],M,D;r=new Uo({}),r.$on("refresh",n[7]),d=new Re({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[f$,({uniqueId:L})=>({14:L}),({uniqueId:L})=>L?16384:0]},$$scope:{ctx:n}}}),g=new Bo({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","remoteIp","userIp","referer","status","auth","userAgent"]}}),g.$on("submit",n[9]);let E=dc(n),O=pc(n);return{c(){e=_("div"),t=_("header"),i=_("nav"),s=_("div"),l=F(n[5]),o=T(),V(r.$$.fragment),a=T(),u=_("div"),f=T(),c=_("div"),V(d.$$.fragment),h=T(),V(g.$$.fragment),v=T(),b=_("div"),y=T(),E.c(),S=T(),O.c(),M=Ke(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(b,"class","clearfix m-b-xs"),p(e,"class","page-header-wrapper m-b-0")},m(L,I){w(L,e,I),m(e,t),m(t,i),m(i,s),m(s,l),m(t,o),j(r,t,null),m(t,a),m(t,u),m(t,f),m(t,c),j(d,c,null),m(e,h),j(g,e,null),m(e,v),m(e,b),m(e,y),E.m(e,null),w(L,S,I),O.m(L,I),w(L,M,I),D=!0},p(L,I){(!D||I&32)&&ue(l,L[5]);const N={};I&49153&&(N.$$scope={dirty:I,ctx:L}),d.$set(N);const B={};I&4&&(B.value=L[2]),g.$set(B),I&8&&De(C,C=L[3])?(Pe(),P(E,1,1,oe),Le(),E=dc(L),E.c(),A(E,1),E.m(e,null)):E.p(L,I),I&8&&De($,$=L[3])?(Pe(),P(O,1,1,oe),Le(),O=pc(L),O.c(),A(O,1),O.m(M.parentNode,M)):O.p(L,I)},i(L){D||(A(r.$$.fragment,L),A(d.$$.fragment,L),A(g.$$.fragment,L),A(E),A(O),D=!0)},o(L){P(r.$$.fragment,L),P(d.$$.fragment,L),P(g.$$.fragment,L),P(E),P(O),D=!1},d(L){L&&k(e),q(r),q(d),q(g),E.d(L),L&&k(S),L&&k(M),O.d(L)}}}function d$(n){let e,t,i,s;e=new On({props:{$$slots:{default:[c$]},$$scope:{ctx:n}}});let l={};return i=new u$({props:l}),n[13](i),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(o,r){j(e,o,r),w(o,t,r),j(i,o,r),s=!0},p(o,[r]){const a={};r&32831&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){q(e,o),o&&k(t),n[13](null),q(i,o)}}}const hc="includeAdminLogs";function p$(n,e,t){var y;let i,s;bt(n,Ft,C=>t(5,s=C)),dn(Ft,s="Request logs",s);let l,o="",r=((y=window.localStorage)==null?void 0:y.getItem(hc))<<0,a=1;function u(){t(3,a++,a)}const f=()=>u();function c(){r=this.checked,t(0,r)}const d=C=>t(2,o=C.detail);function h(C){o=C,t(2,o)}function g(C){o=C,t(2,o)}const v=C=>l==null?void 0:l.show(C==null?void 0:C.detail);function b(C){pe[C?"unshift":"push"](()=>{l=C,t(1,l)})}return n.$$.update=()=>{n.$$.dirty&1&&t(4,i=r?"":'auth!="admin"'),n.$$.dirty&1&&typeof r<"u"&&window.localStorage&&window.localStorage.setItem(hc,r<<0)},[r,l,o,a,i,s,u,f,c,d,h,g,v,b]}class h$ extends Ee{constructor(e){super(),Oe(this,e,p$,d$,De,{})}}const Ds=li([]),ci=li({}),sa=li(!1);function m$(n){ci.update(e=>W.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Ds.update(e=>(W.pushOrReplaceByKey(e,n,"id"),e))}function g$(n){Ds.update(e=>(W.removeByKey(e,"id",n.id),ci.update(t=>t.id===n.id?e.find(i=>i.name!="profiles")||{}:t),e))}async function _$(n=null){return sa.set(!0),ci.set({}),Ds.set([]),we.collections.getFullList(200,{sort:"+created"}).then(e=>{Ds.set(e);const t=n&&W.findByKey(e,"id",n);if(t)ci.set(t);else if(e.length){const i=e.find(s=>s.name!="profiles");i&&ci.set(i)}}).catch(e=>{we.errorResponseHandler(e)}).finally(()=>{sa.set(!1)})}const Ya=li({});function pi(n,e,t){Ya.set({text:n,yesCallback:e,noCallback:t})}function R_(){Ya.set({})}function mc(n){let e,t,i,s;const l=n[13].default,o=wn(l,n,n[12],null);return{c(){e=_("div"),o&&o.c(),p(e,"class",n[1]),ie(e,"active",n[0])},m(r,a){w(r,e,a),o&&o.m(e,null),s=!0},p(r,a){o&&o.p&&(!s||a&4096)&&Sn(o,l,r,r[12],s?$n(l,r[12],a,null):Cn(r[12]),null),(!s||a&2)&&p(e,"class",r[1]),a&3&&ie(e,"active",r[0])},i(r){s||(A(o,r),r&&Tt(()=>{i&&i.end(1),t=Cm(e,Un,{duration:150,y:-5}),t.start()}),s=!0)},o(r){P(o,r),t&&t.invalidate(),r&&(i=Mm(e,Un,{duration:150,y:2})),s=!1},d(r){r&&k(e),o&&o.d(r),r&&i&&i.end()}}}function b$(n){let e,t,i,s,l=n[0]&&mc(n);return{c(){e=_("div"),l&&l.c(),p(e,"class","toggler-container")},m(o,r){w(o,e,r),l&&l.m(e,null),n[14](e),t=!0,i||(s=[G(window,"click",n[3]),G(window,"keydown",n[4]),G(window,"focusin",n[5])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=mc(o),l.c(),A(l,1),l.m(e,null)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&k(e),l&&l.d(),n[14](null),i=!1,Ge(s)}}}function v$(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{closableClass:a="closable"}=e,{class:u=""}=e,f;const c=on();function d(){t(0,o=!1)}function h(){t(0,o=!0)}function g(){o?d():h()}function v(D){return!f||D.classList.contains(a)||(l==null?void 0:l.contains(D))&&!f.contains(D)||f.contains(D)&&D.closest&&D.closest("."+a)}function b(D){(!o||v(D.target))&&(D.preventDefault(),g())}function y(D){(D.code==="Enter"||D.code==="Space")&&(!o||v(D.target))&&(D.preventDefault(),D.stopPropagation(),g())}function C(D){o&&!(f!=null&&f.contains(D.target))&&!(l!=null&&l.contains(D.target))&&d()}function S(D){o&&r&&D.code=="Escape"&&(D.preventDefault(),d())}function $(D){return C(D)}Jn(()=>(t(6,l=l||f.parentNode),l.addEventListener("click",b),l.addEventListener("keydown",y),()=>{l.removeEventListener("click",b),l.removeEventListener("keydown",y)}));function M(D){pe[D?"unshift":"push"](()=>{f=D,t(2,f)})}return n.$$set=D=>{"trigger"in D&&t(6,l=D.trigger),"active"in D&&t(0,o=D.active),"escClose"in D&&t(7,r=D.escClose),"closableClass"in D&&t(8,a=D.closableClass),"class"in D&&t(1,u=D.class),"$$scope"in D&&t(12,s=D.$$scope)},n.$$.update=()=>{var D,E;n.$$.dirty&65&&(o?((D=l==null?void 0:l.classList)==null||D.add("active"),c("show")):((E=l==null?void 0:l.classList)==null||E.remove("active"),c("hide")))},[o,u,f,C,S,$,l,r,a,d,h,g,s,i,M]}class Mi extends Ee{constructor(e){super(),Oe(this,e,v$,b$,De,{trigger:6,active:0,escClose:7,closableClass:8,class:1,hide:9,show:10,toggle:11})}get hide(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}get toggle(){return this.$$.ctx[11]}}const y$=n=>({active:n&1}),gc=n=>({active:n[0]});function _c(n){let e,t,i;const s=n[12].default,l=wn(s,n,n[11],null);return{c(){e=_("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&2048)&&Sn(l,s,o,o[11],i?$n(s,o[11],r,null):Cn(o[11]),null)},i(o){i||(A(l,o),o&&Tt(()=>{t||(t=it(e,tn,{duration:150},!0)),t.run(1)}),i=!0)},o(o){P(l,o),o&&(t||(t=it(e,tn,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function k$(n){let e,t,i,s,l,o,r,a;const u=n[12].header,f=wn(u,n,n[11],gc);let c=n[0]&&_c(n);return{c(){e=_("div"),t=_("header"),f&&f.c(),i=T(),c&&c.c(),p(t,"class","accordion-header"),ie(t,"interactive",n[2]),p(e,"tabindex",s=n[2]?0:-1),p(e,"class",l="accordion "+n[1]),ie(e,"active",n[0])},m(d,h){w(d,e,h),m(e,t),f&&f.m(t,null),m(e,i),c&&c.m(e,null),n[14](e),o=!0,r||(a=[G(t,"click",Yt(n[13])),G(e,"keydown",vm(n[5]))],r=!0)},p(d,[h]){f&&f.p&&(!o||h&2049)&&Sn(f,u,d,d[11],o?$n(u,d[11],h,y$):Cn(d[11]),gc),h&4&&ie(t,"interactive",d[2]),d[0]?c?(c.p(d,h),h&1&&A(c,1)):(c=_c(d),c.c(),A(c,1),c.m(e,null)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le()),(!o||h&4&&s!==(s=d[2]?0:-1))&&p(e,"tabindex",s),(!o||h&2&&l!==(l="accordion "+d[1]))&&p(e,"class",l),h&3&&ie(e,"active",d[0])},i(d){o||(A(f,d),A(c),o=!0)},o(d){P(f,d),P(c),o=!1},d(d){d&&k(e),f&&f.d(d),c&&c.d(),n[14](null),r=!1,Ge(a)}}}function w$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=on();let o,r,{class:a=""}=e,{active:u=!1}=e,{interactive:f=!0}=e,{single:c=!1}=e;function d(){v(),t(0,u=!0),l("expand")}function h(){t(0,u=!1),clearTimeout(r),l("collapse")}function g(){l("toggle"),u?h():d()}function v(){if(c&&o.parentElement){const S=o.parentElement.querySelectorAll(".accordion.active .accordion-header.interactive");for(const $ of S)$.click()}}function b(S){!f||(S.code==="Enter"||S.code==="Space")&&(S.preventDefault(),g())}Jn(()=>()=>clearTimeout(r));const y=()=>f&&g();function C(S){pe[S?"unshift":"push"](()=>{o=S,t(4,o)})}return n.$$set=S=>{"class"in S&&t(1,a=S.class),"active"in S&&t(0,u=S.active),"interactive"in S&&t(2,f=S.interactive),"single"in S&&t(6,c=S.single),"$$scope"in S&&t(11,s=S.$$scope)},n.$$.update=()=>{n.$$.dirty&1041&&u&&(clearTimeout(r),t(10,r=setTimeout(()=>{o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},250)))},[u,a,f,g,o,b,c,d,h,v,r,s,i,y,C]}class Xo extends Ee{constructor(e){super(),Oe(this,e,w$,k$,De,{class:1,active:0,interactive:2,single:6,expand:7,collapse:8,toggle:3,collapseSiblings:9})}get expand(){return this.$$.ctx[7]}get collapse(){return this.$$.ctx[8]}get toggle(){return this.$$.ctx[3]}get collapseSiblings(){return this.$$.ctx[9]}}const $$=n=>({}),bc=n=>({});function vc(n,e,t){const i=n.slice();return i[45]=e[t],i}const S$=n=>({}),yc=n=>({});function kc(n,e,t){const i=n.slice();return i[45]=e[t],i}function wc(n){let e,t;return{c(){e=_("div"),t=F(n[2]),p(e,"class","txt-placeholder")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s[0]&4&&ue(t,i[2])},d(i){i&&k(e)}}}function C$(n){let e,t=n[45]+"",i;return{c(){e=_("span"),i=F(t),p(e,"class","txt")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&1&&t!==(t=s[45]+"")&&ue(i,t)},i:oe,o:oe,d(s){s&&k(e)}}}function M$(n){let e,t,i;const s=[{item:n[45]},n[8]];var l=n[7];function o(r){let a={};for(let u=0;u{q(f,1)}),Le()}l?(e=new l(o()),V(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function $c(n){let e,t,i;function s(){return n[33](n[45])}return{c(){e=_("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Ye(wt.call(null,e,"Clear")),G(e,"click",ei(Yt(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function Sc(n){let e,t,i,s,l,o;const r=[M$,C$],a=[];function u(c,d){return c[7]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[6])&&$c(n);return{c(){e=_("div"),i.c(),s=T(),f&&f.c(),l=T(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),m(e,s),f&&f.m(e,null),m(e,l),o=!0},p(c,d){let h=t;t=u(c),t===h?a[t].p(c,d):(Pe(),P(a[h],1,1,()=>{a[h]=null}),Le(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[6]?f?f.p(c,d):(f=$c(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){P(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function Cc(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[17],$$slots:{default:[O$]},$$scope:{ctx:n}};return e=new Mi({props:i}),n[38](e),e.$on("show",n[23]),e.$on("hide",n[39]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&131072&&(o.trigger=s[17]),l[0]&806410|l[1]&1024&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[38](null),q(e,s)}}}function Mc(n){let e,t,i,s,l,o,r,a,u=n[14].length&&Tc(n);return{c(){e=_("div"),t=_("label"),i=_("div"),i.innerHTML='',s=T(),l=_("input"),o=T(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(t,s),m(t,l),Te(l,n[14]),m(t,o),u&&u.m(t,null),l.focus(),r||(a=G(l,"input",n[35]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&16384&&l.value!==f[14]&&Te(l,f[14]),f[14].length?u?u.p(f,c):(u=Tc(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function Tc(n){let e,t,i,s;return{c(){e=_("div"),t=_("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-secondary clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),m(e,t),i||(s=G(t,"click",ei(Yt(n[20]))),i=!0)},p:oe,d(l){l&&k(e),i=!1,s()}}}function Dc(n){let e,t=n[1]&&Oc(n);return{c(){t&&t.c(),e=Ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=Oc(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function Oc(n){let e,t;return{c(){e=_("div"),t=F(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s[0]&2&&ue(t,i[1])},d(i){i&&k(e)}}}function T$(n){let e=n[45]+"",t;return{c(){t=F(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&524288&&e!==(e=i[45]+"")&&ue(t,e)},i:oe,o:oe,d(i){i&&k(t)}}}function D$(n){let e,t,i;const s=[{item:n[45]},n[10]];var l=n[9];function o(r){let a={};for(let u=0;u{q(f,1)}),Le()}l?(e=new l(o()),V(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function Ec(n){let e,t,i,s,l,o,r;const a=[D$,T$],u=[];function f(h,g){return h[9]?0:1}t=f(n),i=u[t]=a[t](n);function c(...h){return n[36](n[45],...h)}function d(...h){return n[37](n[45],...h)}return{c(){e=_("div"),i.c(),s=T(),p(e,"tabindex","0"),p(e,"class","dropdown-item option closable"),ie(e,"selected",n[18](n[45]))},m(h,g){w(h,e,g),u[t].m(e,null),m(e,s),l=!0,o||(r=[G(e,"click",c),G(e,"keydown",d)],o=!0)},p(h,g){n=h;let v=t;t=f(n),t===v?u[t].p(n,g):(Pe(),P(u[v],1,1,()=>{u[v]=null}),Le(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),g[0]&786432&&ie(e,"selected",n[18](n[45]))},i(h){l||(A(i),l=!0)},o(h){P(i),l=!1},d(h){h&&k(e),u[t].d(),o=!1,Ge(r)}}}function O$(n){let e,t,i,s,l,o=n[11]&&Mc(n);const r=n[32].beforeOptions,a=wn(r,n,n[41],yc);let u=n[19],f=[];for(let v=0;vP(f[v],1,1,()=>{f[v]=null});let d=null;u.length||(d=Dc(n));const h=n[32].afterOptions,g=wn(h,n,n[41],bc);return{c(){o&&o.c(),e=T(),a&&a.c(),t=T(),i=_("div");for(let v=0;vP(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=wc(n));let c=!n[5]&&Cc(n);return{c(){e=_("div"),t=_("div");for(let d=0;d{c=null}),Le()):c?(c.p(d,h),h[0]&32&&A(c,1)):(c=Cc(d),c.c(),A(c,1),c.m(e,null)),(!o||h[0]&4096&&l!==(l="select "+d[12]))&&p(e,"class",l),h[0]&4112&&ie(e,"multiple",d[4]),h[0]&4128&&ie(e,"disabled",d[5])},i(d){if(!o){for(let h=0;hce($e,ge))||[]}function _e(Z,ge){Z.preventDefault(),v&&d?U(ge):B(ge)}function be(Z,ge){(Z.code==="Enter"||Z.code==="Space")&&_e(Z,ge)}function X(){te(),setTimeout(()=>{const Z=L==null?void 0:L.querySelector(".dropdown-item.option.selected");Z&&(Z.focus(),Z.scrollIntoView({block:"nearest"}))},0)}function ae(Z){Z.stopPropagation(),!h&&(E==null||E.toggle())}Jn(()=>{const Z=document.querySelectorAll(`label[for="${r}"]`);for(const ge of Z)ge.addEventListener("click",ae);return()=>{for(const ge of Z)ge.removeEventListener("click",ae)}});const ve=Z=>N(Z);function H(Z){pe[Z?"unshift":"push"](()=>{I=Z,t(17,I)})}function me(){O=this.value,t(14,O)}const x=(Z,ge)=>_e(ge,Z),Q=(Z,ge)=>be(ge,Z);function Se(Z){pe[Z?"unshift":"push"](()=>{E=Z,t(15,E)})}function je(Z){st.call(this,n,Z)}function Ue(Z){pe[Z?"unshift":"push"](()=>{L=Z,t(16,L)})}return n.$$set=Z=>{"id"in Z&&t(24,r=Z.id),"noOptionsText"in Z&&t(1,a=Z.noOptionsText),"selectPlaceholder"in Z&&t(2,u=Z.selectPlaceholder),"searchPlaceholder"in Z&&t(3,f=Z.searchPlaceholder),"items"in Z&&t(25,c=Z.items),"multiple"in Z&&t(4,d=Z.multiple),"disabled"in Z&&t(5,h=Z.disabled),"selected"in Z&&t(0,g=Z.selected),"toggle"in Z&&t(6,v=Z.toggle),"labelComponent"in Z&&t(7,b=Z.labelComponent),"labelComponentProps"in Z&&t(8,y=Z.labelComponentProps),"optionComponent"in Z&&t(9,C=Z.optionComponent),"optionComponentProps"in Z&&t(10,S=Z.optionComponentProps),"searchable"in Z&&t(11,$=Z.searchable),"searchFunc"in Z&&t(26,M=Z.searchFunc),"class"in Z&&t(12,D=Z.class),"$$scope"in Z&&t(41,o=Z.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&c&&(Y(),te()),n.$$.dirty[0]&33570816&&t(19,i=J(c,O)),n.$$.dirty[0]&1&&t(18,s=function(Z){let ge=W.toArray(g);return W.inArray(ge,Z)})},[g,a,u,f,d,h,v,b,y,C,S,$,D,N,O,E,L,I,s,i,te,_e,be,X,r,c,M,B,U,ee,K,se,l,ve,H,me,x,Q,Se,je,Ue,o]}class H_ extends Ee{constructor(e){super(),Oe(this,e,P$,E$,De,{id:24,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:25,multiple:4,disabled:5,selected:0,toggle:6,labelComponent:7,labelComponentProps:8,optionComponent:9,optionComponentProps:10,searchable:11,searchFunc:26,class:12,deselectItem:13,selectItem:27,toggleItem:28,reset:29,showDropdown:30,hideDropdown:31},null,[-1,-1])}get deselectItem(){return this.$$.ctx[13]}get selectItem(){return this.$$.ctx[27]}get toggleItem(){return this.$$.ctx[28]}get reset(){return this.$$.ctx[29]}get showDropdown(){return this.$$.ctx[30]}get hideDropdown(){return this.$$.ctx[31]}}function Ac(n){let e,t;return{c(){e=_("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function L$(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&Ac(n);return{c(){l&&l.c(),e=T(),t=_("span"),s=F(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),m(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=Ac(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&ue(s,i)},i:oe,o:oe,d(o){l&&l.d(o),o&&k(e),o&&k(t)}}}function I$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Pc extends Ee{constructor(e){super(),Oe(this,e,I$,L$,De,{item:0})}}const F$=n=>({}),Lc=n=>({});function N$(n){let e;const t=n[8].afterOptions,i=wn(t,n,n[12],Lc);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Sn(i,t,s,s[12],e?$n(t,s[12],l,F$):Cn(s[12]),Lc)},i(s){e||(A(i,s),e=!0)},o(s){P(i,s),e=!1},d(s){i&&i.d(s)}}}function R$(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[N$]},$$scope:{ctx:n}};for(let r=0;rFe(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){V(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&62?pn(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&si(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],He(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function H$(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Bt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Pc}=e,{optionComponent:c=Pc}=e,{selectionKey:d="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function g(S){S=W.toArray(S,!0);let $=[];for(let M of r)W.inArray(S,M[d])&&$.push(M);S.length&&!$.length||t(0,u=a?$:$[0])}async function v(S){let $=W.toArray(S,!0).map(M=>M[d]);!r.length||t(6,h=a?$:$[0])}function b(S){u=S,t(0,u)}function y(S){st.call(this,n,S)}function C(S){st.call(this,n,S)}return n.$$set=S=>{e=at(at({},e),ni(S)),t(5,s=Bt(e,i)),"items"in S&&t(1,r=S.items),"multiple"in S&&t(2,a=S.multiple),"selected"in S&&t(0,u=S.selected),"labelComponent"in S&&t(3,f=S.labelComponent),"optionComponent"in S&&t(4,c=S.optionComponent),"selectionKey"in S&&t(7,d=S.selectionKey),"keyOfSelected"in S&&t(6,h=S.keyOfSelected),"$$scope"in S&&t(12,o=S.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(h),n.$$.dirty&1&&v(u)},[u,r,a,f,c,s,h,d,l,b,y,C,o]}class fs extends Ee{constructor(e){super(),Oe(this,e,H$,R$,De,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function j$(n){let e,t,i;const s=[{class:"field-type-select "+n[1]},{searchable:!0},{items:n[2]},n[3]];function l(r){n[4](r)}let o={};for(let r=0;rFe(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&14?pn(s,[a&2&&{class:"field-type-select "+r[1]},s[1],a&4&&{items:r[2]},a&8&&si(r[3])]):{};!t&&a&1&&(t=!0,u.keyOfSelected=r[0],He(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function q$(n,e,t){const i=["value","class"];let s=Bt(e,i),{value:l="text"}=e,{class:o=""}=e;const r=[{label:"Text",value:"text",icon:W.getFieldTypeIcon("text")},{label:"Number",value:"number",icon:W.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:W.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:W.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:W.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:W.getFieldTypeIcon("date")},{label:"Multiple choices",value:"select",icon:W.getFieldTypeIcon("select")},{label:"JSON",value:"json",icon:W.getFieldTypeIcon("json")},{label:"File",value:"file",icon:W.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:W.getFieldTypeIcon("relation")},{label:"User",value:"user",icon:W.getFieldTypeIcon("user")}];function a(u){l=u,t(0,l)}return n.$$set=u=>{e=at(at({},e),ni(u)),t(3,s=Bt(e,i)),"value"in u&&t(0,l=u.value),"class"in u&&t(1,o=u.class)},[l,o,r,s,a]}class V$ extends Ee{constructor(e){super(),Oe(this,e,q$,j$,De,{value:0,class:1})}}function z$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Min length"),s=T(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].min),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].min&&Te(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function B$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=F("Max length"),s=T(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min",r=n[0].min||0)},m(f,c){w(f,e,c),m(e,t),w(f,s,c),w(f,l,c),Te(l,n[0].max),a||(u=G(l,"input",n[3]),a=!0)},p(f,c){c&32&&i!==(i=f[5])&&p(e,"for",i),c&32&&o!==(o=f[5])&&p(l,"id",o),c&1&&r!==(r=f[0].min||0)&&p(l,"min",r),c&1&&Pt(l.value)!==f[0].max&&Te(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function U$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("Regex pattern"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML="Valid Go regular expression, eg. ^\\w+$.",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Te(l,n[0].pattern),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[4]),u=!0)},p(c,d){d&32&&i!==(i=c[5])&&p(e,"for",i),d&32&&o!==(o=c[5])&&p(l,"id",o),d&1&&l.value!==c[0].pattern&&Te(l,c[0].pattern)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function W$(n){let e,t,i,s,l,o,r,a,u,f;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[z$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[B$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[U$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){w(c,e,d),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),f=!0},p(c,[d]){const h={};d&2&&(h.name="schema."+c[1]+".options.min"),d&97&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&2&&(g.name="schema."+c[1]+".options.max"),d&97&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const v={};d&2&&(v.name="schema."+c[1]+".options.pattern"),d&97&&(v.$$scope={dirty:d,ctx:c}),u.$set(v)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&k(e),q(i),q(o),q(u)}}}function Y$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=Pt(this.value),t(0,s)}function o(){s.max=Pt(this.value),t(0,s)}function r(){s.pattern=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"options"in a&&t(0,s=a.options)},[s,i,l,o,r]}class K$ extends Ee{constructor(e){super(),Oe(this,e,Y$,W$,De,{key:1,options:0})}}function J$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Min"),s=T(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].min),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].min&&Te(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Z$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=F("Max"),s=T(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"min",r=n[0].min)},m(f,c){w(f,e,c),m(e,t),w(f,s,c),w(f,l,c),Te(l,n[0].max),a||(u=G(l,"input",n[3]),a=!0)},p(f,c){c&16&&i!==(i=f[4])&&p(e,"for",i),c&16&&o!==(o=f[4])&&p(l,"id",o),c&1&&r!==(r=f[0].min)&&p(l,"min",r),c&1&&Pt(l.value)!==f[0].max&&Te(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function G$(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[J$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[Z$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function X$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=Pt(this.value),t(0,s)}function o(){s.max=Pt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class Q$ extends Ee{constructor(e){super(),Oe(this,e,X$,G$,De,{key:1,options:0})}}function x$(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class eS extends Ee{constructor(e){super(),Oe(this,e,x$,null,De,{key:0,options:1})}}function tS(n){let e,t,i,s,l=[{type:t=n[3].type||"text"},{value:n[2]},n[3]],o={};for(let r=0;r{t(0,o=W.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=at(at({},e),ni(u)),t(3,l=Bt(e,s)),"value"in u&&t(0,o=u.value),"separator"in u&&t(1,r=u.separator)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=(o||[]).join(", "))},[o,r,i,l,a]}class cs extends Ee{constructor(e){super(),Oe(this,e,nS,tS,De,{value:0,separator:1})}}function iS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[2](b)}let v={id:n[4],disabled:!W.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),r=new cs({props:v}),pe.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(wt.call(null,s,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&p(e,"for",l);const C={};y&16&&(C.id=b[4]),y&1&&(C.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,C.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function sS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new cs({props:v}),pe.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(wt.call(null,s,{text:`List of domains that are ONLY allowed. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const C={};y&16&&(C.id=b[4]+".options.onlyDomains"),y&1&&(C.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,C.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function lS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[iS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[sS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function oS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class j_ extends Ee{constructor(e){super(),Oe(this,e,oS,lS,De,{key:1,options:0})}}function rS(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new j_({props:r}),pe.push(()=>Fe(e,"key",l)),pe.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(a,u){j(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],He(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],He(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){q(e,a)}}}function aS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class uS extends Ee{constructor(e){super(),Oe(this,e,aS,rS,De,{key:0,options:1})}}var wr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ks={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},hl={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},bn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Hn=function(n){return n===!0?1:0};function Ic(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var $r=function(n){return n instanceof Array?n:[n]};function hn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function St(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function xl(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function q_(n,e){if(e(n))return n;if(n.parentNode)return q_(n.parentNode,e)}function eo(n,e){var t=St("div","numInputWrapper"),i=St("input","numInput "+n),s=St("span","arrowUp"),l=St("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function En(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Sr=function(){},Po=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},fS={D:Sr,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Hn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Sr,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Sr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},xi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ll={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ll.w(n,e,t)]},F:function(n,e,t){return Po(ll.n(n,e,t)-1,!1,e)},G:function(n,e,t){return bn(ll.h(n,e,t))},H:function(n){return bn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Hn(n.getHours()>11)]},M:function(n,e){return Po(n.getMonth(),!0,e)},S:function(n){return bn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return bn(n.getFullYear(),4)},d:function(n){return bn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return bn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return bn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},V_=function(n){var e=n.config,t=e===void 0?ks:e,i=n.l10n,s=i===void 0?hl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,h){return ll[c]&&h[d-1]!=="\\"?ll[c](r,f,t):c!=="\\"?c:""}).join("")}},la=function(n){var e=n.config,t=e===void 0?ks:e,i=n.l10n,s=i===void 0?hl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||ks).dateFormat,h=String(l).trim();if(h==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(h)||/GMT$/.test(h))f=new Date(l);else{for(var g=void 0,v=[],b=0,y=0,C="";bMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Mr(t.config);z.setHours(ne.hours,ne.minutes,ne.seconds,z.getMilliseconds()),t.selectedDates=[z],t.latestSelectedDateObj=z}R!==void 0&&R.type!=="blur"&&xt(R);var re=t._input.value;c(),Ct(),t._input.value!==re&&t._debouncedChange()}function u(R,z){return R%12+12*Hn(z===t.l10n.amPM[1])}function f(R){switch(R%24){case 0:case 12:return 12;default:return R%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var R=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,z=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(R=u(R,t.amPM.textContent));var re=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&An(t.latestSelectedDateObj,t.config.minDate,!0)===0,Ae=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&An(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var le=Cr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),de=Cr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),ke=Cr(R,z,ne);if(ke>de&&ke=12)]),t.secondElement!==void 0&&(t.secondElement.value=bn(ne)))}function g(R){var z=En(R),ne=parseInt(z.value)+(R.delta||0);(ne/1e3>1||R.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&x(ne)}function v(R,z,ne,re){if(z instanceof Array)return z.forEach(function(Ae){return v(R,Ae,ne,re)});if(R instanceof Array)return R.forEach(function(Ae){return v(Ae,z,ne,re)});R.addEventListener(z,ne,re),t._handlers.push({remove:function(){return R.removeEventListener(z,ne,re)}})}function b(){Je("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(re){return v(re,"click",t[ne])})}),t.isMobile){Nt();return}var R=Ic(ge,50);if(t._debouncedChange=Ic(b,hS),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&v(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Z(En(ne))}),v(t._input,"keydown",Ue),t.calendarContainer!==void 0&&v(t.calendarContainer,"keydown",Ue),!t.config.inline&&!t.config.static&&v(window,"resize",R),window.ontouchstart!==void 0?v(window.document,"touchstart",me):v(window.document,"mousedown",me),v(window.document,"focus",me,{capture:!0}),t.config.clickOpens===!0&&(v(t._input,"focus",t.open),v(t._input,"click",t.open)),t.daysContainer!==void 0&&(v(t.monthNav,"click",ft),v(t.monthNav,["keyup","increment"],g),v(t.daysContainer,"click",ut)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var z=function(ne){return En(ne).select()};v(t.timeContainer,["increment"],a),v(t.timeContainer,"blur",a,{capture:!0}),v(t.timeContainer,"click",S),v([t.hourElement,t.minuteElement],["focus","click"],z),t.secondElement!==void 0&&v(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&v(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&v(t._input,"blur",je)}function C(R,z){var ne=R!==void 0?t.parseDate(R):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(R);var Ae=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Ae&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var le=St("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(le,t.element),le.appendChild(t.element),t.altInput&&le.appendChild(t.altInput),le.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function D(R,z,ne,re){var Ae=Q(z,!0),le=St("span",R,z.getDate().toString());return le.dateObj=z,le.$i=re,le.setAttribute("aria-label",t.formatDate(z,t.config.ariaDateFormat)),R.indexOf("hidden")===-1&&An(z,t.now)===0&&(t.todayDateElem=le,le.classList.add("today"),le.setAttribute("aria-current","date")),Ae?(le.tabIndex=-1,Be(z)&&(le.classList.add("selected"),t.selectedDateElem=le,t.config.mode==="range"&&(hn(le,"startRange",t.selectedDates[0]&&An(z,t.selectedDates[0],!0)===0),hn(le,"endRange",t.selectedDates[1]&&An(z,t.selectedDates[1],!0)===0),R==="nextMonthDay"&&le.classList.add("inRange")))):le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&ot(z)&&!Be(z)&&le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&R!=="prevMonthDay"&&re%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(z)+""),Je("onDayCreate",le),le}function E(R){R.focus(),t.config.mode==="range"&&Z(R)}function O(R){for(var z=R>0?0:t.config.showMonths-1,ne=R>0?t.config.showMonths:-1,re=z;re!=ne;re+=R)for(var Ae=t.daysContainer.children[re],le=R>0?0:Ae.children.length-1,de=R>0?Ae.children.length:-1,ke=le;ke!=de;ke+=R){var fe=Ae.children[ke];if(fe.className.indexOf("hidden")===-1&&Q(fe.dateObj))return fe}}function L(R,z){for(var ne=R.className.indexOf("Month")===-1?R.dateObj.getMonth():t.currentMonth,re=z>0?t.config.showMonths:-1,Ae=z>0?1:-1,le=ne-t.currentMonth;le!=re;le+=Ae)for(var de=t.daysContainer.children[le],ke=ne-t.currentMonth===le?R.$i+z:z<0?de.children.length-1:0,fe=de.children.length,he=ke;he>=0&&he0?fe:-1);he+=Ae){var Ie=de.children[he];if(Ie.className.indexOf("hidden")===-1&&Q(Ie.dateObj)&&Math.abs(R.$i-he)>=Math.abs(z))return E(Ie)}t.changeMonth(Ae),I(O(Ae),0)}function I(R,z){var ne=l(),re=Se(ne||document.body),Ae=R!==void 0?R:re?ne:t.selectedDateElem!==void 0&&Se(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Se(t.todayDateElem)?t.todayDateElem:O(z>0?1:-1);Ae===void 0?t._input.focus():re?L(Ae,z):E(Ae)}function N(R,z){for(var ne=(new Date(R,z,1).getDay()-t.l10n.firstDayOfWeek+7)%7,re=t.utils.getDaysInMonth((z-1+12)%12,R),Ae=t.utils.getDaysInMonth(z,R),le=window.document.createDocumentFragment(),de=t.config.showMonths>1,ke=de?"prevMonthDay hidden":"prevMonthDay",fe=de?"nextMonthDay hidden":"nextMonthDay",he=re+1-ne,Ie=0;he<=re;he++,Ie++)le.appendChild(D("flatpickr-day "+ke,new Date(R,z-1,he),he,Ie));for(he=1;he<=Ae;he++,Ie++)le.appendChild(D("flatpickr-day",new Date(R,z,he),he,Ie));for(var ht=Ae+1;ht<=42-ne&&(t.config.showMonths===1||Ie%7!==0);ht++,Ie++)le.appendChild(D("flatpickr-day "+fe,new Date(R,z+1,ht%Ae),ht,Ie));var rn=St("div","dayContainer");return rn.appendChild(le),rn}function B(){if(t.daysContainer!==void 0){xl(t.daysContainer),t.weekNumbers&&xl(t.weekNumbers);for(var R=document.createDocumentFragment(),z=0;z1||t.config.monthSelectorType!=="dropdown")){var R=function(re){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&ret.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var z=0;z<12;z++)if(!!R(z)){var ne=St("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,z).getMonth().toString(),ne.textContent=Po(z,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===z&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function ee(){var R=St("div","flatpickr-month"),z=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=St("span","cur-month"):(t.monthsDropdownContainer=St("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),v(t.monthsDropdownContainer,"change",function(de){var ke=En(de),fe=parseInt(ke.value,10);t.changeMonth(fe-t.currentMonth),Je("onMonthChange")}),U(),ne=t.monthsDropdownContainer);var re=eo("cur-year",{tabindex:"-1"}),Ae=re.getElementsByTagName("input")[0];Ae.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Ae.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Ae.setAttribute("max",t.config.maxDate.getFullYear().toString()),Ae.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var le=St("div","flatpickr-current-month");return le.appendChild(ne),le.appendChild(re),z.appendChild(le),R.appendChild(z),{container:R,yearElement:Ae,monthElement:ne}}function K(){xl(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var R=t.config.showMonths;R--;){var z=ee();t.yearElements.push(z.yearElement),t.monthElements.push(z.monthElement),t.monthNav.appendChild(z.container)}t.monthNav.appendChild(t.nextMonthNav)}function se(){return t.monthNav=St("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=St("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=St("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,K(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(R){t.__hidePrevMonthArrow!==R&&(hn(t.prevMonthNav,"flatpickr-disabled",R),t.__hidePrevMonthArrow=R)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(R){t.__hideNextMonthArrow!==R&&(hn(t.nextMonthNav,"flatpickr-disabled",R),t.__hideNextMonthArrow=R)}}),t.currentYearElement=t.yearElements[0],rt(),t.monthNav}function Y(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var R=Mr(t.config);t.timeContainer=St("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var z=St("span","flatpickr-time-separator",":"),ne=eo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var re=eo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=re.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=bn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?R.hours:f(R.hours)),t.minuteElement.value=bn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():R.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(z),t.timeContainer.appendChild(re),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Ae=eo("flatpickr-second");t.secondElement=Ae.getElementsByTagName("input")[0],t.secondElement.value=bn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():R.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(St("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Ae)}return t.config.time_24hr||(t.amPM=St("span","flatpickr-am-pm",t.l10n.amPM[Hn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function te(){t.weekdayContainer?xl(t.weekdayContainer):t.weekdayContainer=St("div","flatpickr-weekdays");for(var R=t.config.showMonths;R--;){var z=St("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(z)}return J(),t.weekdayContainer}function J(){if(!!t.weekdayContainer){var R=t.l10n.firstDayOfWeek,z=Fc(t.l10n.weekdays.shorthand);R>0&&R `+z.join("")+` - `}}function ge(){t.calendarContainer.classList.add("hasWeeks");var R=Ct("div","flatpickr-weekwrapper");R.appendChild(Ct("span","flatpickr-weekday",t.l10n.weekAbbreviation));var z=Ct("div","flatpickr-weeks");return R.appendChild(z),{weekWrapper:R,weekNumbers:z}}function _e(R,z){z===void 0&&(z=!0);var ne=z?R:R-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Je("onYearChange"),U()),B(),Je("onMonthChange"),ut())}function X(R,z){if(R===void 0&&(R=!0),z===void 0&&(z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Mr(t.config),ae=ne.hours,Le=ne.minutes,le=ne.seconds;h(ae,Le,le)}t.redraw(),R&&Je("onChange")}function re(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Je("onClose")}function ve(){t.config!==void 0&&Je("onDestroy");for(var R=t._handlers.length;R--;)t._handlers[R].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var z=t.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function H(R){return t.calendarContainer.contains(R)}function pe(R){if(t.isOpen&&!t.config.inline){var z=En(R),ne=H(z),ae=z===t.input||z===t.altInput||t.element.contains(z)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Le=!ae&&!ne&&!H(R.relatedTarget),le=!t.config.ignoredFocusElements.some(function(ke){return ke.contains(z)});Le&&le&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function x(R){if(!(!R||t.config.minDate&&Rt.config.maxDate.getFullYear())){var z=R,ne=t.currentYear!==z;t.currentYear=z||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),Je("onYearChange"),U())}}function Q(R,z){var ne;z===void 0&&(z=!0);var ae=t.parseDate(R,void 0,z);if(t.config.minDate&&ae&&An(ae,t.config.minDate,z!==void 0?z:!t.minDateHasTime)<0||t.config.maxDate&&ae&&An(ae,t.config.maxDate,z!==void 0?z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ae===void 0)return!1;for(var Le=!!t.config.enable,le=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,ke=0,Te=void 0;ke=Te.from.getTime()&&ae.getTime()<=Te.to.getTime())return Le}return!Le}function $e(R){return t.daysContainer!==void 0?R.className.indexOf("hidden")===-1&&R.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(R):!1}function je(R){var z=R.target===t._input,ne=t._input.value.trimEnd()!==Pt();z&&ne&&!(R.relatedTarget&&H(R.relatedTarget))&&t.setDate(t._input.value,!0,R.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Be(R){var z=En(R),ne=t.config.wrap?n.contains(z):z===t._input,ae=t.config.allowInput,Le=t.isOpen&&(!ae||!ne),le=t.config.inline&&ne&&!ae;if(R.keyCode===13&&ne){if(ae)return t.setDate(t._input.value,!0,z===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),z.blur();t.open()}else if(H(z)||Le||le){var ke=!!t.timeContainer&&t.timeContainer.contains(z);switch(R.keyCode){case 13:ke?(R.preventDefault(),a(),st()):dt(R);break;case 27:R.preventDefault(),st();break;case 8:case 46:ne&&!t.config.allowInput&&(R.preventDefault(),t.clear());break;case 37:case 39:if(!ke&&!ne){R.preventDefault();var Te=l();if(t.daysContainer!==void 0&&(ae===!1||Te&&$e(Te))){var fe=R.keyCode===39?1:-1;R.ctrlKey?(R.stopPropagation(),_e(fe),I(O(1),0)):I(void 0,fe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:R.preventDefault();var he=R.keyCode===40?1:-1;t.daysContainer&&z.$i!==void 0||z===t.input||z===t.altInput?R.ctrlKey?(R.stopPropagation(),x(t.currentYear-he),I(O(1),0)):ke||I(void 0,he*7):z===t.currentYearElement?x(t.currentYear-he):t.config.enableTime&&(!ke&&t.hourElement&&t.hourElement.focus(),a(R),t._debouncedChange());break;case 9:if(ke){var Ne=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(qt){return qt}),ht=Ne.indexOf(z);if(ht!==-1){var rn=Ne[ht+(R.shiftKey?-1:1)];R.preventDefault(),(rn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(z)&&R.shiftKey&&(R.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&z===t.amPM)switch(R.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),It();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),It();break}(ne||H(z))&&Je("onKeyDown",R)}function Z(R,z){if(z===void 0&&(z="flatpickr-day"),!(t.selectedDates.length!==1||R&&(!R.classList.contains(z)||R.classList.contains("flatpickr-disabled")))){for(var ne=R?R.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ae=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Le=Math.min(ne,t.selectedDates[0].getTime()),le=Math.max(ne,t.selectedDates[0].getTime()),ke=!1,Te=0,fe=0,he=Le;heLe&&heTe)?Te=he:he>ae&&(!fe||he ."+z));Ne.forEach(function(ht){var rn=ht.dateObj,qt=rn.getTime(),Ti=Te>0&&qt0&&qt>fe;if(Ti){ht.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(gi){ht.classList.remove(gi)});return}else if(ke&&!Ti)return;["startRange","inRange","endRange","notAllowed"].forEach(function(gi){ht.classList.remove(gi)}),R!==void 0&&(R.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),aene&&qt===ae&&ht.classList.add("endRange"),qt>=Te&&(fe===0||qt<=fe)&&cS(qt,ae,ne)&&ht.classList.add("inRange"))})}}function me(){t.isOpen&&!t.config.static&&!t.config.inline&&it()}function ce(R,z){if(z===void 0&&(z=t._positionElement),t.isMobile===!0){if(R){R.preventDefault();var ne=En(R);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Je("onOpen");return}else if(t._input.disabled||t.config.inline)return;var ae=t.isOpen;t.isOpen=!0,ae||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Je("onOpen"),it(z)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(R===void 0||!t.timeContainer.contains(R.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function we(R){return function(z){var ne=t.config["_"+R+"Date"]=t.parseDate(z,t.config.dateFormat),ae=t.config["_"+(R==="min"?"max":"min")+"Date"];ne!==void 0&&(t[R==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Le){return Q(Le)}),!t.selectedDates.length&&R==="min"&&d(ne),It()),t.daysContainer&&(Xe(),ne!==void 0?t.currentYearElement[R]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(R),t.currentYearElement.disabled=!!ae&&ne!==void 0&&ae.getFullYear()===ne.getFullYear())}}function Ze(){var R=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],z=an(an({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=z.parseDate,t.config.formatDate=z.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ne){t.config._enable=yt(Ne)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ne){t.config._disable=yt(Ne)}});var ae=z.mode==="time";if(!z.dateFormat&&(z.enableTime||ae)){var Le=Zt.defaultConfig.dateFormat||ks.dateFormat;ne.dateFormat=z.noCalendar||ae?"H:i"+(z.enableSeconds?":S":""):Le+" H:i"+(z.enableSeconds?":S":"")}if(z.altInput&&(z.enableTime||ae)&&!z.altFormat){var le=Zt.defaultConfig.altFormat||ks.altFormat;ne.altFormat=z.noCalendar||ae?"h:i"+(z.enableSeconds?":S K":" K"):le+(" h:i"+(z.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:we("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:we("max")});var ke=function(Ne){return function(ht){t.config[Ne==="min"?"_minTime":"_maxTime"]=t.parseDate(ht,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:ke("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:ke("max")}),z.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,z);for(var Te=0;Te-1?t.config[he]=$r(fe[he]).map(o).concat(t.config[he]):typeof z[he]>"u"&&(t.config[he]=fe[he])}z.altInputClass||(t.config.altInputClass=tt().className+" "+t.config.altInputClass),Je("onParseConfig")}function tt(){return t.config.wrap?n.querySelector("[data-input]"):n}function We(){typeof t.config.locale!="object"&&typeof Zt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=an(an({},Zt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Zt.l10ns[t.config.locale]:void 0),xi.D="("+t.l10n.weekdays.shorthand.join("|")+")",xi.l="("+t.l10n.weekdays.longhand.join("|")+")",xi.M="("+t.l10n.months.shorthand.join("|")+")",xi.F="("+t.l10n.months.longhand.join("|")+")",xi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var R=an(an({},e),JSON.parse(JSON.stringify(n.dataset||{})));R.time_24hr===void 0&&Zt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=V_(t),t.parseDate=la({config:t.config,l10n:t.l10n})}function it(R){if(typeof t.config.position=="function")return void t.config.position(t,R);if(t.calendarContainer!==void 0){Je("onPreCalendarPosition");var z=R||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(Al,Pl){return Al+Pl.offsetHeight},0),ae=t.calendarContainer.offsetWidth,Le=t.config.position.split(" "),le=Le[0],ke=Le.length>1?Le[1]:null,Te=z.getBoundingClientRect(),fe=window.innerHeight-Te.bottom,he=le==="above"||le!=="below"&&fene,Ne=window.pageYOffset+Te.top+(he?-ne-2:z.offsetHeight+2);if(hn(t.calendarContainer,"arrowTop",!he),hn(t.calendarContainer,"arrowBottom",he),!t.config.inline){var ht=window.pageXOffset+Te.left,rn=!1,qt=!1;ke==="center"?(ht-=(ae-Te.width)/2,rn=!0):ke==="right"&&(ht-=ae-Te.width,qt=!0),hn(t.calendarContainer,"arrowLeft",!rn&&!qt),hn(t.calendarContainer,"arrowCenter",rn),hn(t.calendarContainer,"arrowRight",qt);var Ti=window.document.body.offsetWidth-(window.pageXOffset+Te.right),gi=ht+ae>window.document.body.offsetWidth,Tl=Ti+ae>window.document.body.offsetWidth;if(hn(t.calendarContainer,"rightMost",gi),!t.config.static)if(t.calendarContainer.style.top=Ne+"px",!gi)t.calendarContainer.style.left=ht+"px",t.calendarContainer.style.right="auto";else if(!Tl)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Ti+"px";else{var ds=Ce();if(ds===void 0)return;var Dl=window.document.body.offsetWidth,qe=Math.max(0,Dl/2-ae/2),xe=".flatpickr-calendar.centerMost:before",Xt=".flatpickr-calendar.centerMost:after",Ol=ds.cssRules.length,El="{left:"+Te.left+"px;right:auto;}";hn(t.calendarContainer,"rightMost",!1),hn(t.calendarContainer,"centerMost",!0),ds.insertRule(xe+","+Xt+El,Ol),t.calendarContainer.style.left=qe+"px",t.calendarContainer.style.right="auto"}}}}function Ce(){for(var R=null,z=0;zt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=ae,t.config.mode==="single")t.selectedDates=[Le];else if(t.config.mode==="multiple"){var ke=Ue(Le);ke?t.selectedDates.splice(parseInt(ke),1):t.selectedDates.push(Le)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Le,t.selectedDates.push(Le),An(Le,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ne,ht){return Ne.getTime()-ht.getTime()}));if(c(),le){var Te=t.currentYear!==Le.getFullYear();t.currentYear=Le.getFullYear(),t.currentMonth=Le.getMonth(),Te&&(Je("onYearChange"),U()),Je("onMonthChange")}if(ut(),B(),It(),!le&&t.config.mode!=="range"&&t.config.showMonths===1?E(ae):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var fe=t.config.mode==="single"&&!t.config.enableTime,he=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(fe||he)&&st()}b()}}var be={locale:[We,J],showMonths:[K,r,te],minDate:[C],maxDate:[C],positionElement:[$t],clickOpens:[function(){t.config.clickOpens===!0?(v(t._input,"focus",t.open),v(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Fe(R,z){if(R!==null&&typeof R=="object"){Object.assign(t.config,R);for(var ne in R)be[ne]!==void 0&&be[ne].forEach(function(ae){return ae()})}else t.config[R]=z,be[R]!==void 0?be[R].forEach(function(ae){return ae()}):wr.indexOf(R)>-1&&(t.config[R]=$r(z));t.redraw(),It(!0)}function nt(R,z){var ne=[];if(R instanceof Array)ne=R.map(function(ae){return t.parseDate(ae,z)});else if(R instanceof Date||typeof R=="number")ne=[t.parseDate(R,z)];else if(typeof R=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(R,z)];break;case"multiple":ne=R.split(t.config.conjunction).map(function(ae){return t.parseDate(ae,z)});break;case"range":ne=R.split(t.l10n.rangeSeparator).map(function(ae){return t.parseDate(ae,z)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(R)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(ae){return ae instanceof Date&&Q(ae,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(ae,Le){return ae.getTime()-Le.getTime()})}function ct(R,z,ne){if(z===void 0&&(z=!1),ne===void 0&&(ne=t.config.dateFormat),R!==0&&!R||R instanceof Array&&R.length===0)return t.clear(z);nt(R,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),C(void 0,z),d(),t.selectedDates.length===0&&t.clear(!1),It(z),z&&Je("onChange")}function yt(R){return R.slice().map(function(z){return typeof z=="string"||typeof z=="number"||z instanceof Date?t.parseDate(z,void 0,!0):z&&typeof z=="object"&&z.from&&z.to?{from:t.parseDate(z.from,void 0),to:t.parseDate(z.to,void 0)}:z}).filter(function(z){return z})}function at(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var R=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);R&&nt(R,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Ot(){if(t.input=tt(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=Ct(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),$t()}function $t(){t._positionElement=t.config.positionElement||t._input}function jt(){var R=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=Ct("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=R,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=R==="datetime-local"?"Y-m-d\\TH:i:S":R==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}v(t.mobileInput,"change",function(z){t.setDate(En(z).value,!1,t.mobileFormatStr),Je("onChange"),Je("onClose")})}function Nt(R){if(t.isOpen===!0)return t.close();t.open(R)}function Je(R,z){if(t.config!==void 0){var ne=t.config[R];if(ne!==void 0&&ne.length>0)for(var ae=0;ne[ae]&&ae=0&&An(R,t.selectedDates[1])<=0}function ut(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(R,z){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+z),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[z].textContent=Po(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),R.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function Pt(R){var z=R||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,z)}).filter(function(ne,ae,Le){return t.config.mode!=="range"||t.config.enableTime||Le.indexOf(ne)===ae}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function It(R){R===void 0&&(R=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Pt(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Pt(t.config.altFormat)),R!==!1&&Je("onValueUpdate")}function Lt(R){var z=En(R),ne=t.prevMonthNav.contains(z),ae=t.nextMonthNav.contains(z);ne||ae?_e(ne?-1:1):t.yearElements.indexOf(z)>=0?z.select():z.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):z.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function lt(R){R.preventDefault();var z=R.type==="keydown",ne=En(R),ae=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Hn(t.amPM.textContent===t.l10n.amPM[0])]);var Le=parseFloat(ae.getAttribute("min")),le=parseFloat(ae.getAttribute("max")),ke=parseFloat(ae.getAttribute("step")),Te=parseInt(ae.value,10),fe=R.delta||(z?R.which===38?1:-1:0),he=Te+ke*fe;if(typeof ae.value<"u"&&ae.value.length===2){var Ne=ae===t.hourElement,ht=ae===t.minuteElement;hele&&(he=ae===t.hourElement?he-le-Hn(!t.amPM):Le,ht&&$(void 0,1,t.hourElement)),t.amPM&&Ne&&(ke===1?he+Te===23:Math.abs(he-Te)>ke)&&(t.amPM.textContent=t.l10n.amPM[Hn(t.amPM.textContent===t.l10n.amPM[0])]),ae.value=bn(he)}}return s(),t}function ws(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;s{const $=f||g,M=y(d);return M.onReady.push(()=>{t(8,h=!0)}),t(3,v=Zt($,Object.assign(M,f?{wrap:!0}:{}))),()=>{v.destroy()}});const b=on();function y($={}){$=Object.assign({},$);for(const M of r){const D=(E,O,L)=>{b(bS(M),[E,O,L])};M in $?(Array.isArray($[M])||($[M]=[$[M]]),$[M].push(D)):$[M]=[D]}return $.onChange&&!$.onChange.includes(C)&&$.onChange.push(C),$}function C($,M,D){var O,L;const E=(L=(O=D==null?void 0:D.config)==null?void 0:O.mode)!=null?L:"single";t(2,a=E==="single"?$[0]:$),t(4,u=M)}function S($){de[$?"unshift":"push"](()=>{g=$,t(0,g)})}return n.$$set=$=>{e=ft(ft({},e),ni($)),t(1,s=Ut(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,u=$.formattedValue),"element"in $&&t(5,f=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,g=$.input),"flatpickr"in $&&t(3,v=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&v&&h&&v.setDate(a,!1,c),n.$$.dirty&392&&v&&h)for(const[$,M]of Object.entries(y(d)))v.set($,M)},[g,s,a,v,u,f,c,d,h,o,l,S]}class Ka extends Ee{constructor(e){super(),Oe(this,e,vS,_S,De,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function yS(n){let e,t,i,s,l,o,r;function a(f){n[2](f)}let u={id:n[4],options:W.defaultFlatpickrOptions(),value:n[0].min};return n[0].min!==void 0&&(u.formattedValue=n[0].min),l=new Ka({props:u}),de.push(()=>Ie(l,"formattedValue",a)),{c(){e=_("label"),t=F("Min date (UTC)"),s=T(),V(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].min),!o&&c&1&&(o=!0,d.formattedValue=f[0].min,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function kS(n){let e,t,i,s,l,o,r;function a(f){n[3](f)}let u={id:n[4],options:W.defaultFlatpickrOptions(),value:n[0].max};return n[0].max!==void 0&&(u.formattedValue=n[0].max),l=new Ka({props:u}),de.push(()=>Ie(l,"formattedValue",a)),{c(){e=_("label"),t=F("Max date (UTC)"),s=T(),V(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].max),!o&&c&1&&(o=!0,d.formattedValue=f[0].max,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function wS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[yS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[kS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function $S(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.min,r)&&(s.min=r,t(0,s))}function o(r){n.$$.not_equal(s.max,r)&&(s.max=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class SS extends Ee{constructor(e){super(),Oe(this,e,$S,wS,De,{key:1,options:0})}}function CS(n){let e,t,i,s,l,o,r,a,u;function f(d){n[2](d)}let c={id:n[4],placeholder:"eg. optionA, optionB",required:!0};return n[0].values!==void 0&&(c.value=n[0].values),l=new cs({props:c}),de.push(()=>Ie(l,"value",f)),{c(){e=_("label"),t=F("Choices"),s=T(),V(l.$$.fragment),r=T(),a=_("div"),a.textContent="Use comma as separator.",p(e,"for",i=n[4]),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,s,h),j(l,d,h),w(d,r,h),w(d,a,h),u=!0},p(d,h){(!u||h&16&&i!==(i=d[4]))&&p(e,"for",i);const g={};h&16&&(g.id=d[4]),!o&&h&1&&(o=!0,g.value=d[0].values,He(()=>o=!1)),l.$set(g)},i(d){u||(A(l.$$.fragment,d),u=!0)},o(d){P(l.$$.fragment,d),u=!1},d(d){d&&k(e),d&&k(s),q(l,d),d&&k(r),d&&k(a)}}}function MS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max select"),s=T(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&At(l.value)!==u[0].maxSelect&&Me(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function TS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.values",$$slots:{default:[CS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[MS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.values"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.maxSelect"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function DS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.values,r)&&(s.values=r,t(0,s))}function o(){s.maxSelect=At(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s={maxSelect:1,values:[]})},[s,i,l,o]}class OS extends Ee{constructor(e){super(),Oe(this,e,DS,TS,De,{key:1,options:0})}}function ES(n,e,t){return["",{}]}class AS extends Ee{constructor(e){super(),Oe(this,e,ES,null,De,{key:0,options:1})}get key(){return this.$$.ctx[0]}get options(){return this.$$.ctx[1]}}function PS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max file size (bytes)"),s=T(),l=_("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].maxSize),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(l,"id",o),f&1&&At(l.value)!==u[0].maxSize&&Me(l,u[0].maxSize)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function LS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max files"),s=T(),l=_("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"step","1"),p(l,"min",""),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(l,"id",o),f&1&&At(l.value)!==u[0].maxSelect&&Me(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function IS(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("div"),e.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',t=T(),i=_("div"),i.innerHTML='Images (jpg, png, svg, gif)',s=T(),l=_("div"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=T(),r=_("div"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"tabindex","0"),p(e,"class","dropdown-item closable"),p(i,"tabindex","0"),p(i,"class","dropdown-item closable"),p(l,"tabindex","0"),p(l,"class","dropdown-item closable"),p(r,"tabindex","0"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[G(e,"click",n[5]),G(i,"click",n[6]),G(l,"click",n[7]),G(r,"click",n[8])],a=!0)},p:oe,d(f){f&&k(e),f&&k(t),f&&k(i),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,Ge(u)}}}function FS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M;function D(O){n[4](O)}let E={id:n[10],placeholder:"eg. image/png, application/pdf..."};return n[0].mimeTypes!==void 0&&(E.value=n[0].mimeTypes),r=new cs({props:E}),de.push(()=>Ie(r,"value",D)),C=new Mi({props:{class:"dropdown dropdown-sm dropdown-nowrap",$$slots:{default:[IS]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Mime types",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=T(),h=_("button"),g=_("span"),g.textContent="Choose presets",v=T(),b=_("i"),y=T(),V(C.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,L){w(O,e,L),m(e,t),m(e,i),m(e,s),w(O,o,L),j(r,O,L),w(O,u,L),w(O,f,L),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),j(C,h,null),S=!0,$||(M=Ye(wt.call(null,s,{text:`Allow files ONLY with the listed mime types. + `}}function _e(){t.calendarContainer.classList.add("hasWeeks");var R=St("div","flatpickr-weekwrapper");R.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var z=St("div","flatpickr-weeks");return R.appendChild(z),{weekWrapper:R,weekNumbers:z}}function be(R,z){z===void 0&&(z=!0);var ne=z?R:R-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Je("onYearChange"),U()),B(),Je("onMonthChange"),rt())}function X(R,z){if(R===void 0&&(R=!0),z===void 0&&(z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Mr(t.config),re=ne.hours,Ae=ne.minutes,le=ne.seconds;h(re,Ae,le)}t.redraw(),R&&Je("onChange")}function ae(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Je("onClose")}function ve(){t.config!==void 0&&Je("onDestroy");for(var R=t._handlers.length;R--;)t._handlers[R].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var z=t.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function H(R){return t.calendarContainer.contains(R)}function me(R){if(t.isOpen&&!t.config.inline){var z=En(R),ne=H(z),re=z===t.input||z===t.altInput||t.element.contains(z)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Ae=!re&&!ne&&!H(R.relatedTarget),le=!t.config.ignoredFocusElements.some(function(de){return de.contains(z)});Ae&&le&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function x(R){if(!(!R||t.config.minDate&&Rt.config.maxDate.getFullYear())){var z=R,ne=t.currentYear!==z;t.currentYear=z||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),Je("onYearChange"),U())}}function Q(R,z){var ne;z===void 0&&(z=!0);var re=t.parseDate(R,void 0,z);if(t.config.minDate&&re&&An(re,t.config.minDate,z!==void 0?z:!t.minDateHasTime)<0||t.config.maxDate&&re&&An(re,t.config.maxDate,z!==void 0?z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(re===void 0)return!1;for(var Ae=!!t.config.enable,le=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,de=0,ke=void 0;de=ke.from.getTime()&&re.getTime()<=ke.to.getTime())return Ae}return!Ae}function Se(R){return t.daysContainer!==void 0?R.className.indexOf("hidden")===-1&&R.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(R):!1}function je(R){var z=R.target===t._input,ne=t._input.value.trimEnd()!==Ht();z&&ne&&!(R.relatedTarget&&H(R.relatedTarget))&&t.setDate(t._input.value,!0,R.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ue(R){var z=En(R),ne=t.config.wrap?n.contains(z):z===t._input,re=t.config.allowInput,Ae=t.isOpen&&(!re||!ne),le=t.config.inline&&ne&&!re;if(R.keyCode===13&&ne){if(re)return t.setDate(t._input.value,!0,z===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),z.blur();t.open()}else if(H(z)||Ae||le){var de=!!t.timeContainer&&t.timeContainer.contains(z);switch(R.keyCode){case 13:de?(R.preventDefault(),a(),nt()):ut(R);break;case 27:R.preventDefault(),nt();break;case 8:case 46:ne&&!t.config.allowInput&&(R.preventDefault(),t.clear());break;case 37:case 39:if(!de&&!ne){R.preventDefault();var ke=l();if(t.daysContainer!==void 0&&(re===!1||ke&&Se(ke))){var fe=R.keyCode===39?1:-1;R.ctrlKey?(R.stopPropagation(),be(fe),I(O(1),0)):I(void 0,fe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:R.preventDefault();var he=R.keyCode===40?1:-1;t.daysContainer&&z.$i!==void 0||z===t.input||z===t.altInput?R.ctrlKey?(R.stopPropagation(),x(t.currentYear-he),I(O(1),0)):de||I(void 0,he*7):z===t.currentYearElement?x(t.currentYear-he):t.config.enableTime&&(!de&&t.hourElement&&t.hourElement.focus(),a(R),t._debouncedChange());break;case 9:if(de){var Ie=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(jt){return jt}),ht=Ie.indexOf(z);if(ht!==-1){var rn=Ie[ht+(R.shiftKey?-1:1)];R.preventDefault(),(rn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(z)&&R.shiftKey&&(R.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&z===t.amPM)switch(R.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Ct();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Ct();break}(ne||H(z))&&Je("onKeyDown",R)}function Z(R,z){if(z===void 0&&(z="flatpickr-day"),!(t.selectedDates.length!==1||R&&(!R.classList.contains(z)||R.classList.contains("flatpickr-disabled")))){for(var ne=R?R.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),re=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Ae=Math.min(ne,t.selectedDates[0].getTime()),le=Math.max(ne,t.selectedDates[0].getTime()),de=!1,ke=0,fe=0,he=Ae;heAe&&heke)?ke=he:he>re&&(!fe||he ."+z));Ie.forEach(function(ht){var rn=ht.dateObj,jt=rn.getTime(),Ti=ke>0&&jt0&&jt>fe;if(Ti){ht.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(gi){ht.classList.remove(gi)});return}else if(de&&!Ti)return;["startRange","inRange","endRange","notAllowed"].forEach(function(gi){ht.classList.remove(gi)}),R!==void 0&&(R.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),rene&&jt===re&&ht.classList.add("endRange"),jt>=ke&&(fe===0||jt<=fe)&&cS(jt,re,ne)&&ht.classList.add("inRange"))})}}function ge(){t.isOpen&&!t.config.static&&!t.config.inline&&tt()}function ce(R,z){if(z===void 0&&(z=t._positionElement),t.isMobile===!0){if(R){R.preventDefault();var ne=En(R);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Je("onOpen");return}else if(t._input.disabled||t.config.inline)return;var re=t.isOpen;t.isOpen=!0,re||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Je("onOpen"),tt(z)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(R===void 0||!t.timeContainer.contains(R.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function $e(R){return function(z){var ne=t.config["_"+R+"Date"]=t.parseDate(z,t.config.dateFormat),re=t.config["_"+(R==="min"?"max":"min")+"Date"];ne!==void 0&&(t[R==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Ae){return Q(Ae)}),!t.selectedDates.length&&R==="min"&&d(ne),Ct()),t.daysContainer&&(Xe(),ne!==void 0?t.currentYearElement[R]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(R),t.currentYearElement.disabled=!!re&&ne!==void 0&&re.getFullYear()===ne.getFullYear())}}function Ze(){var R=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],z=an(an({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=z.parseDate,t.config.formatDate=z.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ie){t.config._enable=dt(Ie)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ie){t.config._disable=dt(Ie)}});var re=z.mode==="time";if(!z.dateFormat&&(z.enableTime||re)){var Ae=Jt.defaultConfig.dateFormat||ks.dateFormat;ne.dateFormat=z.noCalendar||re?"H:i"+(z.enableSeconds?":S":""):Ae+" H:i"+(z.enableSeconds?":S":"")}if(z.altInput&&(z.enableTime||re)&&!z.altFormat){var le=Jt.defaultConfig.altFormat||ks.altFormat;ne.altFormat=z.noCalendar||re?"h:i"+(z.enableSeconds?":S K":" K"):le+(" h:i"+(z.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:$e("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:$e("max")});var de=function(Ie){return function(ht){t.config[Ie==="min"?"_minTime":"_maxTime"]=t.parseDate(ht,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:de("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:de("max")}),z.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,z);for(var ke=0;ke-1?t.config[he]=$r(fe[he]).map(o).concat(t.config[he]):typeof z[he]>"u"&&(t.config[he]=fe[he])}z.altInputClass||(t.config.altInputClass=et().className+" "+t.config.altInputClass),Je("onParseConfig")}function et(){return t.config.wrap?n.querySelector("[data-input]"):n}function We(){typeof t.config.locale!="object"&&typeof Jt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=an(an({},Jt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Jt.l10ns[t.config.locale]:void 0),xi.D="("+t.l10n.weekdays.shorthand.join("|")+")",xi.l="("+t.l10n.weekdays.longhand.join("|")+")",xi.M="("+t.l10n.months.shorthand.join("|")+")",xi.F="("+t.l10n.months.longhand.join("|")+")",xi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var R=an(an({},e),JSON.parse(JSON.stringify(n.dataset||{})));R.time_24hr===void 0&&Jt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=V_(t),t.parseDate=la({config:t.config,l10n:t.l10n})}function tt(R){if(typeof t.config.position=="function")return void t.config.position(t,R);if(t.calendarContainer!==void 0){Je("onPreCalendarPosition");var z=R||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(Al,Pl){return Al+Pl.offsetHeight},0),re=t.calendarContainer.offsetWidth,Ae=t.config.position.split(" "),le=Ae[0],de=Ae.length>1?Ae[1]:null,ke=z.getBoundingClientRect(),fe=window.innerHeight-ke.bottom,he=le==="above"||le!=="below"&&fene,Ie=window.pageYOffset+ke.top+(he?-ne-2:z.offsetHeight+2);if(hn(t.calendarContainer,"arrowTop",!he),hn(t.calendarContainer,"arrowBottom",he),!t.config.inline){var ht=window.pageXOffset+ke.left,rn=!1,jt=!1;de==="center"?(ht-=(re-ke.width)/2,rn=!0):de==="right"&&(ht-=re-ke.width,jt=!0),hn(t.calendarContainer,"arrowLeft",!rn&&!jt),hn(t.calendarContainer,"arrowCenter",rn),hn(t.calendarContainer,"arrowRight",jt);var Ti=window.document.body.offsetWidth-(window.pageXOffset+ke.right),gi=ht+re>window.document.body.offsetWidth,Tl=Ti+re>window.document.body.offsetWidth;if(hn(t.calendarContainer,"rightMost",gi),!t.config.static)if(t.calendarContainer.style.top=Ie+"px",!gi)t.calendarContainer.style.left=ht+"px",t.calendarContainer.style.right="auto";else if(!Tl)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Ti+"px";else{var ds=Me();if(ds===void 0)return;var Dl=window.document.body.offsetWidth,qe=Math.max(0,Dl/2-re/2),xe=".flatpickr-calendar.centerMost:before",Gt=".flatpickr-calendar.centerMost:after",Ol=ds.cssRules.length,El="{left:"+ke.left+"px;right:auto;}";hn(t.calendarContainer,"rightMost",!1),hn(t.calendarContainer,"centerMost",!0),ds.insertRule(xe+","+Gt+El,Ol),t.calendarContainer.style.left=qe+"px",t.calendarContainer.style.right="auto"}}}}function Me(){for(var R=null,z=0;zt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=re,t.config.mode==="single")t.selectedDates=[Ae];else if(t.config.mode==="multiple"){var de=Be(Ae);de?t.selectedDates.splice(parseInt(de),1):t.selectedDates.push(Ae)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Ae,t.selectedDates.push(Ae),An(Ae,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ie,ht){return Ie.getTime()-ht.getTime()}));if(c(),le){var ke=t.currentYear!==Ae.getFullYear();t.currentYear=Ae.getFullYear(),t.currentMonth=Ae.getMonth(),ke&&(Je("onYearChange"),U()),Je("onMonthChange")}if(rt(),B(),Ct(),!le&&t.config.mode!=="range"&&t.config.showMonths===1?E(re):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var fe=t.config.mode==="single"&&!t.config.enableTime,he=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(fe||he)&&nt()}b()}}var ye={locale:[We,J],showMonths:[K,r,te],minDate:[C],maxDate:[C],positionElement:[mt],clickOpens:[function(){t.config.clickOpens===!0?(v(t._input,"focus",t.open),v(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ne(R,z){if(R!==null&&typeof R=="object"){Object.assign(t.config,R);for(var ne in R)ye[ne]!==void 0&&ye[ne].forEach(function(re){return re()})}else t.config[R]=z,ye[R]!==void 0?ye[R].forEach(function(re){return re()}):wr.indexOf(R)>-1&&(t.config[R]=$r(z));t.redraw(),Ct(!0)}function ct(R,z){var ne=[];if(R instanceof Array)ne=R.map(function(re){return t.parseDate(re,z)});else if(R instanceof Date||typeof R=="number")ne=[t.parseDate(R,z)];else if(typeof R=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(R,z)];break;case"multiple":ne=R.split(t.config.conjunction).map(function(re){return t.parseDate(re,z)});break;case"range":ne=R.split(t.l10n.rangeSeparator).map(function(re){return t.parseDate(re,z)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(R)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(re){return re instanceof Date&&Q(re,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(re,Ae){return re.getTime()-Ae.getTime()})}function Dt(R,z,ne){if(z===void 0&&(z=!1),ne===void 0&&(ne=t.config.dateFormat),R!==0&&!R||R instanceof Array&&R.length===0)return t.clear(z);ct(R,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),C(void 0,z),d(),t.selectedDates.length===0&&t.clear(!1),Ct(z),z&&Je("onChange")}function dt(R){return R.slice().map(function(z){return typeof z=="string"||typeof z=="number"||z instanceof Date?t.parseDate(z,void 0,!0):z&&typeof z=="object"&&z.from&&z.to?{from:t.parseDate(z.from,void 0),to:t.parseDate(z.to,void 0)}:z}).filter(function(z){return z})}function lt(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var R=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);R&&ct(R,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Lt(){if(t.input=et(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=St(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),mt()}function mt(){t._positionElement=t.config.positionElement||t._input}function Nt(){var R=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=St("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=R,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=R==="datetime-local"?"Y-m-d\\TH:i:S":R==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}v(t.mobileInput,"change",function(z){t.setDate(En(z).value,!1,t.mobileFormatStr),Je("onChange"),Je("onClose")})}function Ot(R){if(t.isOpen===!0)return t.close();t.open(R)}function Je(R,z){if(t.config!==void 0){var ne=t.config[R];if(ne!==void 0&&ne.length>0)for(var re=0;ne[re]&&re=0&&An(R,t.selectedDates[1])<=0}function rt(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(R,z){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+z),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[z].textContent=Po(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),R.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function Ht(R){var z=R||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,z)}).filter(function(ne,re,Ae){return t.config.mode!=="range"||t.config.enableTime||Ae.indexOf(ne)===re}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Ct(R){R===void 0&&(R=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Ht(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Ht(t.config.altFormat)),R!==!1&&Je("onValueUpdate")}function ft(R){var z=En(R),ne=t.prevMonthNav.contains(z),re=t.nextMonthNav.contains(z);ne||re?be(ne?-1:1):t.yearElements.indexOf(z)>=0?z.select():z.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):z.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function xt(R){R.preventDefault();var z=R.type==="keydown",ne=En(R),re=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Hn(t.amPM.textContent===t.l10n.amPM[0])]);var Ae=parseFloat(re.getAttribute("min")),le=parseFloat(re.getAttribute("max")),de=parseFloat(re.getAttribute("step")),ke=parseInt(re.value,10),fe=R.delta||(z?R.which===38?1:-1:0),he=ke+de*fe;if(typeof re.value<"u"&&re.value.length===2){var Ie=re===t.hourElement,ht=re===t.minuteElement;hele&&(he=re===t.hourElement?he-le-Hn(!t.amPM):Ae,ht&&$(void 0,1,t.hourElement)),t.amPM&&Ie&&(de===1?he+ke===23:Math.abs(he-ke)>de)&&(t.amPM.textContent=t.l10n.amPM[Hn(t.amPM.textContent===t.l10n.amPM[0])]),re.value=bn(he)}}return s(),t}function ws(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;s{const $=f||g,M=y(d);return M.onReady.push(()=>{t(8,h=!0)}),t(3,v=Jt($,Object.assign(M,f?{wrap:!0}:{}))),()=>{v.destroy()}});const b=on();function y($={}){$=Object.assign({},$);for(const M of r){const D=(E,O,L)=>{b(bS(M),[E,O,L])};M in $?(Array.isArray($[M])||($[M]=[$[M]]),$[M].push(D)):$[M]=[D]}return $.onChange&&!$.onChange.includes(C)&&$.onChange.push(C),$}function C($,M,D){var O,L;const E=(L=(O=D==null?void 0:D.config)==null?void 0:O.mode)!=null?L:"single";t(2,a=E==="single"?$[0]:$),t(4,u=M)}function S($){pe[$?"unshift":"push"](()=>{g=$,t(0,g)})}return n.$$set=$=>{e=at(at({},e),ni($)),t(1,s=Bt(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,u=$.formattedValue),"element"in $&&t(5,f=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,g=$.input),"flatpickr"in $&&t(3,v=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&v&&h&&v.setDate(a,!1,c),n.$$.dirty&392&&v&&h)for(const[$,M]of Object.entries(y(d)))v.set($,M)},[g,s,a,v,u,f,c,d,h,o,l,S]}class Ka extends Ee{constructor(e){super(),Oe(this,e,vS,_S,De,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function yS(n){let e,t,i,s,l,o,r;function a(f){n[2](f)}let u={id:n[4],options:W.defaultFlatpickrOptions(),value:n[0].min};return n[0].min!==void 0&&(u.formattedValue=n[0].min),l=new Ka({props:u}),pe.push(()=>Fe(l,"formattedValue",a)),{c(){e=_("label"),t=F("Min date (UTC)"),s=T(),V(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].min),!o&&c&1&&(o=!0,d.formattedValue=f[0].min,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function kS(n){let e,t,i,s,l,o,r;function a(f){n[3](f)}let u={id:n[4],options:W.defaultFlatpickrOptions(),value:n[0].max};return n[0].max!==void 0&&(u.formattedValue=n[0].max),l=new Ka({props:u}),pe.push(()=>Fe(l,"formattedValue",a)),{c(){e=_("label"),t=F("Max date (UTC)"),s=T(),V(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].max),!o&&c&1&&(o=!0,d.formattedValue=f[0].max,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function wS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[yS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[kS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function $S(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.min,r)&&(s.min=r,t(0,s))}function o(r){n.$$.not_equal(s.max,r)&&(s.max=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class SS extends Ee{constructor(e){super(),Oe(this,e,$S,wS,De,{key:1,options:0})}}function CS(n){let e,t,i,s,l,o,r,a,u;function f(d){n[2](d)}let c={id:n[4],placeholder:"eg. optionA, optionB",required:!0};return n[0].values!==void 0&&(c.value=n[0].values),l=new cs({props:c}),pe.push(()=>Fe(l,"value",f)),{c(){e=_("label"),t=F("Choices"),s=T(),V(l.$$.fragment),r=T(),a=_("div"),a.textContent="Use comma as separator.",p(e,"for",i=n[4]),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,s,h),j(l,d,h),w(d,r,h),w(d,a,h),u=!0},p(d,h){(!u||h&16&&i!==(i=d[4]))&&p(e,"for",i);const g={};h&16&&(g.id=d[4]),!o&&h&1&&(o=!0,g.value=d[0].values,He(()=>o=!1)),l.$set(g)},i(d){u||(A(l.$$.fragment,d),u=!0)},o(d){P(l.$$.fragment,d),u=!1},d(d){d&&k(e),d&&k(s),q(l,d),d&&k(r),d&&k(a)}}}function MS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max select"),s=T(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSelect&&Te(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function TS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.values",$$slots:{default:[CS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[MS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.values"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.maxSelect"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function DS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.values,r)&&(s.values=r,t(0,s))}function o(){s.maxSelect=Pt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s={maxSelect:1,values:[]})},[s,i,l,o]}class OS extends Ee{constructor(e){super(),Oe(this,e,DS,TS,De,{key:1,options:0})}}function ES(n,e,t){return["",{}]}class AS extends Ee{constructor(e){super(),Oe(this,e,ES,null,De,{key:0,options:1})}get key(){return this.$$.ctx[0]}get options(){return this.$$.ctx[1]}}function PS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max file size (bytes)"),s=T(),l=_("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].maxSize),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSize&&Te(l,u[0].maxSize)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function LS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max files"),s=T(),l=_("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"step","1"),p(l,"min",""),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSelect&&Te(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function IS(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("div"),e.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',t=T(),i=_("div"),i.innerHTML='Images (jpg, png, svg, gif)',s=T(),l=_("div"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=T(),r=_("div"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"tabindex","0"),p(e,"class","dropdown-item closable"),p(i,"tabindex","0"),p(i,"class","dropdown-item closable"),p(l,"tabindex","0"),p(l,"class","dropdown-item closable"),p(r,"tabindex","0"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[G(e,"click",n[5]),G(i,"click",n[6]),G(l,"click",n[7]),G(r,"click",n[8])],a=!0)},p:oe,d(f){f&&k(e),f&&k(t),f&&k(i),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,Ge(u)}}}function FS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M;function D(O){n[4](O)}let E={id:n[10],placeholder:"eg. image/png, application/pdf..."};return n[0].mimeTypes!==void 0&&(E.value=n[0].mimeTypes),r=new cs({props:E}),pe.push(()=>Fe(r,"value",D)),C=new Mi({props:{class:"dropdown dropdown-sm dropdown-nowrap",$$slots:{default:[IS]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Mime types",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=T(),h=_("button"),g=_("span"),g.textContent="Choose presets",v=T(),b=_("i"),y=T(),V(C.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,L){w(O,e,L),m(e,t),m(e,i),m(e,s),w(O,o,L),j(r,O,L),w(O,u,L),w(O,f,L),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),j(C,h,null),S=!0,$||(M=Ye(wt.call(null,s,{text:`Allow files ONLY with the listed mime types. Leave empty for no restriction.`,position:"top"})),$=!0)},p(O,L){(!S||L&1024&&l!==(l=O[10]))&&p(e,"for",l);const I={};L&1024&&(I.id=O[10]),!a&&L&1&&(a=!0,I.value=O[0].mimeTypes,He(()=>a=!1)),r.$set(I);const N={};L&2049&&(N.$$scope={dirty:L,ctx:O}),C.$set(N)},i(O){S||(A(r.$$.fragment,O),A(C.$$.fragment,O),S=!0)},o(O){P(r.$$.fragment,O),P(C.$$.fragment,O),S=!1},d(O){O&&k(e),O&&k(o),q(r,O),O&&k(u),O&&k(f),q(C),$=!1,M()}}}function NS(n){let e;return{c(){e=_("ul"),e.innerHTML=`
  • WxH (eg. 100x50) - crop to WxH viewbox (from center)
  • WxHt @@ -61,37 +61,37 @@
  • 0xH (eg. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 - (eg. 100x0) - resize to W width preserving the aspect ratio
  • `,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function RS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M;function D(O){n[9](O)}let E={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(E.value=n[0].thumbs),r=new cs({props:E}),de.push(()=>Ie(r,"value",D)),C=new Mi({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[NS]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=T(),h=_("button"),g=_("span"),g.textContent="Supported formats",v=T(),b=_("i"),y=T(),V(C.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,L){w(O,e,L),m(e,t),m(e,i),m(e,s),w(O,o,L),j(r,O,L),w(O,u,L),w(O,f,L),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),j(C,h,null),S=!0,$||(M=Ye(wt.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(O,L){(!S||L&1024&&l!==(l=O[10]))&&p(e,"for",l);const I={};L&1024&&(I.id=O[10]),!a&&L&1&&(a=!0,I.value=O[0].thumbs,He(()=>a=!1)),r.$set(I);const N={};L&2048&&(N.$$scope={dirty:L,ctx:O}),C.$set(N)},i(O){S||(A(r.$$.fragment,O),A(C.$$.fragment,O),S=!0)},o(O){P(r.$$.fragment,O),P(C.$$.fragment,O),S=!1},d(O){O&&k(e),O&&k(o),q(r,O),O&&k(u),O&&k(f),q(C),$=!1,M()}}}function HS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[PS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[LS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[FS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[RS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(g,v){w(g,e,v),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),m(e,f),m(e,c),j(d,c,null),h=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const C={};v&2&&(C.name="schema."+g[1]+".options.mimeTypes"),v&3073&&(C.$$scope={dirty:v,ctx:g}),u.$set(C);const S={};v&2&&(S.name="schema."+g[1]+".options.thumbs"),v&3073&&(S.$$scope={dirty:v,ctx:g}),d.$set(S)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){P(i.$$.fragment,g),P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),h=!1},d(g){g&&k(e),q(i),q(o),q(u),q(d)}}}function jS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=At(this.value),t(0,s)}function o(){s.maxSelect=At(this.value),t(0,s)}function r(h){n.$$.not_equal(s.mimeTypes,h)&&(s.mimeTypes=h,t(0,s))}const a=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},c=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function d(h){n.$$.not_equal(s.thumbs,h)&&(s.thumbs=h,t(0,s))}return n.$$set=h=>{"key"in h&&t(1,i=h.key),"options"in h&&t(0,s=h.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,o,r,a,u,f,c,d]}class qS extends Ee{constructor(e){super(),Oe(this,e,jS,HS,De,{key:1,options:0})}}function VS(n){let e,t,i,s,l,o,r;function a(f){n[5](f)}let u={searchable:n[3].length>5,selectPlaceholder:n[2]?"Loading...":"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3]};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new fs({props:u}),de.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("Collection"),s=T(),V(l.$$.fragment),p(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&8&&(d.searchable=f[3].length>5),c&4&&(d.selectPlaceholder=f[2]?"Loading...":"Select collection"),c&8&&(d.items=f[3]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function zS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max select"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].maxSelect),r||(a=G(l,"input",n[6]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&At(l.value)!==u[0].maxSelect&&Me(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function BS(n){let e,t,i,s,l,o,r;function a(f){n[7](f)}let u={id:n[9],items:n[4]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new fs({props:u}),de.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("Delete record on relation delete"),s=T(),V(l.$$.fragment),p(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&512&&(d.id=f[9]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function US(n){let e,t,i,s,l,o,r,a,u,f;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[VS,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[zS,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[BS,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){w(c,e,d),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),f=!0},p(c,[d]){const h={};d&2&&(h.name="schema."+c[1]+".options.collectionId"),d&1549&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&2&&(g.name="schema."+c[1]+".options.maxSelect"),d&1537&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const v={};d&2&&(v.name="schema."+c[1]+".options.cascadeDelete"),d&1537&&(v.$$scope={dirty:d,ctx:c}),u.$set(v)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&k(e),q(i),q(o),q(u)}}}function WS(n,e,t){let{key:i=""}=e,{options:s={}}=e;const l=[{label:"False",value:!1},{label:"True",value:!0}];let o=!1,r=[];a();function a(){t(2,o=!0),ye.collections.getFullList(200,{sort:"-created"}).then(d=>{t(3,r=d)}).catch(d=>{ye.errorResponseHandler(d)}).finally(()=>{t(2,o=!1)})}function u(d){n.$$.not_equal(s.collectionId,d)&&(s.collectionId=d,t(0,s))}function f(){s.maxSelect=At(this.value),t(0,s)}function c(d){n.$$.not_equal(s.cascadeDelete,d)&&(s.cascadeDelete=d,t(0,s))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,s=d.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s={maxSelect:1,collectionId:null,cascadeDelete:!1})},[s,i,o,r,l,u,f,c]}class YS extends Ee{constructor(e){super(),Oe(this,e,WS,US,De,{key:1,options:0})}}function KS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max select"),s=T(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&At(l.value)!==u[0].maxSelect&&Me(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function JS(n){let e,t,i,s,l,o,r;function a(f){n[4](f)}let u={id:n[5],items:n[2]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new fs({props:u}),de.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("Delete record on user delete"),s=T(),V(l.$$.fragment),p(e,"for",i=n[5])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&32&&i!==(i=f[5]))&&p(e,"for",i);const d={};c&32&&(d.id=f[5]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function ZS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[KS,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[JS,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.maxSelect"),u&97&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.cascadeDelete"),u&97&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function GS(n,e,t){const i=[{label:"False",value:!1},{label:"True",value:!0}];let{key:s=""}=e,{options:l={}}=e;function o(){l.maxSelect=At(this.value),t(0,l)}function r(a){n.$$.not_equal(l.cascadeDelete,a)&&(l.cascadeDelete=a,t(0,l))}return n.$$set=a=>{"key"in a&&t(1,s=a.key),"options"in a&&t(0,l=a.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(l)&&t(0,l={maxSelect:1,cascadeDelete:!1})},[l,s,i,o,r]}class XS extends Ee{constructor(e){super(),Oe(this,e,GS,ZS,De,{key:1,options:0})}}function QS(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[38],disabled:n[0].id};return n[0].type!==void 0&&(u.value=n[0].type),l=new V$({props:u}),de.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=F("Type"),s=T(),V(l.$$.fragment),p(e,"for",i=n[38])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c[1]&128&&i!==(i=f[38]))&&p(e,"for",i);const d={};c[1]&128&&(d.id=f[38]),c[0]&1&&(d.disabled=f[0].id),!o&&c[0]&1&&(o=!0,d.value=f[0].type,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function Nc(n){let e,t,i;return{c(){e=_("span"),e.textContent="Duplicated or invalid name",p(e,"class","txt invalid-name-note svelte-1tpxlm5")},m(s,l){w(s,e,l),i=!0},i(s){i||(Tt(()=>{t||(t=ot(e,Un,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=ot(e,Un,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function xS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g=!n[5]&&Nc();return{c(){e=_("label"),t=_("span"),t.textContent="Name",i=T(),g&&g.c(),l=T(),o=_("input"),p(t,"class","txt"),p(e,"for",s=n[38]),p(o,"type","text"),p(o,"id",r=n[38]),o.required=!0,o.disabled=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,o.value=f=n[0].name},m(v,b){w(v,e,b),m(e,t),m(e,i),g&&g.m(e,null),w(v,l,b),w(v,o,b),c=!0,n[0].id||o.focus(),d||(h=G(o,"input",n[17]),d=!0)},p(v,b){v[5]?g&&(Ae(),P(g,1,1,()=>{g=null}),Pe()):g?b[0]&32&&A(g,1):(g=Nc(),g.c(),A(g,1),g.m(e,null)),(!c||b[1]&128&&s!==(s=v[38]))&&p(e,"for",s),(!c||b[1]&128&&r!==(r=v[38]))&&p(o,"id",r),(!c||b[0]&1&&a!==(a=v[0].id&&v[0].system))&&(o.disabled=a),(!c||b[0]&1&&u!==(u=!v[0].id))&&(o.autofocus=u),(!c||b[0]&1&&f!==(f=v[0].name)&&o.value!==f)&&(o.value=f)},i(v){c||(A(g),c=!0)},o(v){P(g),c=!1},d(v){v&&k(e),g&&g.d(),v&&k(l),v&&k(o),d=!1,h()}}}function e3(n){let e,t,i;function s(o){n[28](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new XS({props:l}),de.push(()=>Ie(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function t3(n){let e,t,i;function s(o){n[27](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new YS({props:l}),de.push(()=>Ie(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function n3(n){let e,t,i;function s(o){n[26](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new qS({props:l}),de.push(()=>Ie(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function i3(n){let e,t,i;function s(o){n[25](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new AS({props:l}),de.push(()=>Ie(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function s3(n){let e,t,i;function s(o){n[24](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new OS({props:l}),de.push(()=>Ie(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function l3(n){let e,t,i;function s(o){n[23](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new SS({props:l}),de.push(()=>Ie(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function o3(n){let e,t,i;function s(o){n[22](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new uS({props:l}),de.push(()=>Ie(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function r3(n){let e,t,i;function s(o){n[21](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new j_({props:l}),de.push(()=>Ie(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function a3(n){let e,t,i;function s(o){n[20](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new eS({props:l}),de.push(()=>Ie(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function u3(n){let e,t,i;function s(o){n[19](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new Q$({props:l}),de.push(()=>Ie(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function f3(n){let e,t,i;function s(o){n[18](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new K$({props:l}),de.push(()=>Ie(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function c3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Required"),p(e,"type","checkbox"),p(e,"id",t=n[38]),p(s,"for",o=n[38])},m(u,f){w(u,e,f),e.checked=n[0].required,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[29]),r=!0)},p(u,f){f[1]&128&&t!==(t=u[38])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].required),f[1]&128&&o!==(o=u[38])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Rc(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[d3,({uniqueId:i})=>({38:i}),({uniqueId:i})=>[0,i?128:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&384&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function d3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[38]),p(s,"for",o=n[38])},m(u,f){w(u,e,f),e.checked=n[0].unique,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[30]),r=!0)},p(u,f){f[1]&128&&t!==(t=u[38])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&128&&o!==(o=u[38])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Hc(n){let e,t,i,s,l,o,r,a,u,f;a=new Mi({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[p3]},$$scope:{ctx:n}}});let c=n[8]&&jc(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),l=_("button"),o=_("i"),r=T(),V(a.$$.fragment),u=T(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"class","btn btn-circle btn-sm btn-secondary"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),j(a,l,null),m(s,u),c&&c.m(s,null),f=!0},p(d,h){const g={};h[1]&256&&(g.$$scope={dirty:h,ctx:d}),a.$set(g),d[8]?c?c.p(d,h):(c=jc(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(A(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&k(e),q(a),c&&c.d()}}}function p3(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[9]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function jc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Done',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[3])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function h3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D;s=new Re({props:{class:"form-field required "+(n[0].id?"disabled":""),name:"schema."+n[1]+".type",$$slots:{default:[QS,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}}),r=new Re({props:{class:` + (eg. 100x0) - resize to W width preserving the aspect ratio`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function RS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M;function D(O){n[9](O)}let E={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(E.value=n[0].thumbs),r=new cs({props:E}),pe.push(()=>Fe(r,"value",D)),C=new Mi({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[NS]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=T(),h=_("button"),g=_("span"),g.textContent="Supported formats",v=T(),b=_("i"),y=T(),V(C.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,L){w(O,e,L),m(e,t),m(e,i),m(e,s),w(O,o,L),j(r,O,L),w(O,u,L),w(O,f,L),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),j(C,h,null),S=!0,$||(M=Ye(wt.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(O,L){(!S||L&1024&&l!==(l=O[10]))&&p(e,"for",l);const I={};L&1024&&(I.id=O[10]),!a&&L&1&&(a=!0,I.value=O[0].thumbs,He(()=>a=!1)),r.$set(I);const N={};L&2048&&(N.$$scope={dirty:L,ctx:O}),C.$set(N)},i(O){S||(A(r.$$.fragment,O),A(C.$$.fragment,O),S=!0)},o(O){P(r.$$.fragment,O),P(C.$$.fragment,O),S=!1},d(O){O&&k(e),O&&k(o),q(r,O),O&&k(u),O&&k(f),q(C),$=!1,M()}}}function HS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[PS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[LS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[FS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[RS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(g,v){w(g,e,v),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),m(e,f),m(e,c),j(d,c,null),h=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const C={};v&2&&(C.name="schema."+g[1]+".options.mimeTypes"),v&3073&&(C.$$scope={dirty:v,ctx:g}),u.$set(C);const S={};v&2&&(S.name="schema."+g[1]+".options.thumbs"),v&3073&&(S.$$scope={dirty:v,ctx:g}),d.$set(S)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){P(i.$$.fragment,g),P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),h=!1},d(g){g&&k(e),q(i),q(o),q(u),q(d)}}}function jS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Pt(this.value),t(0,s)}function o(){s.maxSelect=Pt(this.value),t(0,s)}function r(h){n.$$.not_equal(s.mimeTypes,h)&&(s.mimeTypes=h,t(0,s))}const a=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},c=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function d(h){n.$$.not_equal(s.thumbs,h)&&(s.thumbs=h,t(0,s))}return n.$$set=h=>{"key"in h&&t(1,i=h.key),"options"in h&&t(0,s=h.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,o,r,a,u,f,c,d]}class qS extends Ee{constructor(e){super(),Oe(this,e,jS,HS,De,{key:1,options:0})}}function VS(n){let e,t,i,s,l,o,r;function a(f){n[5](f)}let u={searchable:n[3].length>5,selectPlaceholder:n[2]?"Loading...":"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3]};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new fs({props:u}),pe.push(()=>Fe(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("Collection"),s=T(),V(l.$$.fragment),p(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&8&&(d.searchable=f[3].length>5),c&4&&(d.selectPlaceholder=f[2]?"Loading...":"Select collection"),c&8&&(d.items=f[3]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function zS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max select"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].maxSelect),r||(a=G(l,"input",n[6]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSelect&&Te(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function BS(n){let e,t,i,s,l,o,r;function a(f){n[7](f)}let u={id:n[9],items:n[4]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new fs({props:u}),pe.push(()=>Fe(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("Delete record on relation delete"),s=T(),V(l.$$.fragment),p(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&512&&(d.id=f[9]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function US(n){let e,t,i,s,l,o,r,a,u,f;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[VS,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[zS,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[BS,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){w(c,e,d),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),f=!0},p(c,[d]){const h={};d&2&&(h.name="schema."+c[1]+".options.collectionId"),d&1549&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&2&&(g.name="schema."+c[1]+".options.maxSelect"),d&1537&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const v={};d&2&&(v.name="schema."+c[1]+".options.cascadeDelete"),d&1537&&(v.$$scope={dirty:d,ctx:c}),u.$set(v)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&k(e),q(i),q(o),q(u)}}}function WS(n,e,t){let{key:i=""}=e,{options:s={}}=e;const l=[{label:"False",value:!1},{label:"True",value:!0}];let o=!1,r=[];a();function a(){t(2,o=!0),we.collections.getFullList(200,{sort:"-created"}).then(d=>{t(3,r=d)}).catch(d=>{we.errorResponseHandler(d)}).finally(()=>{t(2,o=!1)})}function u(d){n.$$.not_equal(s.collectionId,d)&&(s.collectionId=d,t(0,s))}function f(){s.maxSelect=Pt(this.value),t(0,s)}function c(d){n.$$.not_equal(s.cascadeDelete,d)&&(s.cascadeDelete=d,t(0,s))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,s=d.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s={maxSelect:1,collectionId:null,cascadeDelete:!1})},[s,i,o,r,l,u,f,c]}class YS extends Ee{constructor(e){super(),Oe(this,e,WS,US,De,{key:1,options:0})}}function KS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max select"),s=T(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSelect&&Te(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function JS(n){let e,t,i,s,l,o,r;function a(f){n[4](f)}let u={id:n[5],items:n[2]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new fs({props:u}),pe.push(()=>Fe(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("Delete record on user delete"),s=T(),V(l.$$.fragment),p(e,"for",i=n[5])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&32&&i!==(i=f[5]))&&p(e,"for",i);const d={};c&32&&(d.id=f[5]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function ZS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[KS,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[JS,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.maxSelect"),u&97&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.cascadeDelete"),u&97&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function GS(n,e,t){const i=[{label:"False",value:!1},{label:"True",value:!0}];let{key:s=""}=e,{options:l={}}=e;function o(){l.maxSelect=Pt(this.value),t(0,l)}function r(a){n.$$.not_equal(l.cascadeDelete,a)&&(l.cascadeDelete=a,t(0,l))}return n.$$set=a=>{"key"in a&&t(1,s=a.key),"options"in a&&t(0,l=a.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(l)&&t(0,l={maxSelect:1,cascadeDelete:!1})},[l,s,i,o,r]}class XS extends Ee{constructor(e){super(),Oe(this,e,GS,ZS,De,{key:1,options:0})}}function QS(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[38],disabled:n[0].id};return n[0].type!==void 0&&(u.value=n[0].type),l=new V$({props:u}),pe.push(()=>Fe(l,"value",a)),{c(){e=_("label"),t=F("Type"),s=T(),V(l.$$.fragment),p(e,"for",i=n[38])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c[1]&128&&i!==(i=f[38]))&&p(e,"for",i);const d={};c[1]&128&&(d.id=f[38]),c[0]&1&&(d.disabled=f[0].id),!o&&c[0]&1&&(o=!0,d.value=f[0].type,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function Nc(n){let e,t,i;return{c(){e=_("span"),e.textContent="Duplicated or invalid name",p(e,"class","txt invalid-name-note svelte-1tpxlm5")},m(s,l){w(s,e,l),i=!0},i(s){i||(Tt(()=>{t||(t=it(e,Un,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=it(e,Un,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function xS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g=!n[5]&&Nc();return{c(){e=_("label"),t=_("span"),t.textContent="Name",i=T(),g&&g.c(),l=T(),o=_("input"),p(t,"class","txt"),p(e,"for",s=n[38]),p(o,"type","text"),p(o,"id",r=n[38]),o.required=!0,o.disabled=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,o.value=f=n[0].name},m(v,b){w(v,e,b),m(e,t),m(e,i),g&&g.m(e,null),w(v,l,b),w(v,o,b),c=!0,n[0].id||o.focus(),d||(h=G(o,"input",n[17]),d=!0)},p(v,b){v[5]?g&&(Pe(),P(g,1,1,()=>{g=null}),Le()):g?b[0]&32&&A(g,1):(g=Nc(),g.c(),A(g,1),g.m(e,null)),(!c||b[1]&128&&s!==(s=v[38]))&&p(e,"for",s),(!c||b[1]&128&&r!==(r=v[38]))&&p(o,"id",r),(!c||b[0]&1&&a!==(a=v[0].id&&v[0].system))&&(o.disabled=a),(!c||b[0]&1&&u!==(u=!v[0].id))&&(o.autofocus=u),(!c||b[0]&1&&f!==(f=v[0].name)&&o.value!==f)&&(o.value=f)},i(v){c||(A(g),c=!0)},o(v){P(g),c=!1},d(v){v&&k(e),g&&g.d(),v&&k(l),v&&k(o),d=!1,h()}}}function e3(n){let e,t,i;function s(o){n[28](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new XS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function t3(n){let e,t,i;function s(o){n[27](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new YS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function n3(n){let e,t,i;function s(o){n[26](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new qS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function i3(n){let e,t,i;function s(o){n[25](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new AS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function s3(n){let e,t,i;function s(o){n[24](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new OS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function l3(n){let e,t,i;function s(o){n[23](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new SS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function o3(n){let e,t,i;function s(o){n[22](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new uS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function r3(n){let e,t,i;function s(o){n[21](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new j_({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function a3(n){let e,t,i;function s(o){n[20](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new eS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function u3(n){let e,t,i;function s(o){n[19](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new Q$({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function f3(n){let e,t,i;function s(o){n[18](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new K$({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function c3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Required"),p(e,"type","checkbox"),p(e,"id",t=n[38]),p(s,"for",o=n[38])},m(u,f){w(u,e,f),e.checked=n[0].required,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[29]),r=!0)},p(u,f){f[1]&128&&t!==(t=u[38])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].required),f[1]&128&&o!==(o=u[38])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Rc(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[d3,({uniqueId:i})=>({38:i}),({uniqueId:i})=>[0,i?128:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&384&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function d3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[38]),p(s,"for",o=n[38])},m(u,f){w(u,e,f),e.checked=n[0].unique,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[30]),r=!0)},p(u,f){f[1]&128&&t!==(t=u[38])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&128&&o!==(o=u[38])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Hc(n){let e,t,i,s,l,o,r,a,u,f;a=new Mi({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[p3]},$$scope:{ctx:n}}});let c=n[8]&&jc(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),l=_("button"),o=_("i"),r=T(),V(a.$$.fragment),u=T(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"class","btn btn-circle btn-sm btn-secondary"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),j(a,l,null),m(s,u),c&&c.m(s,null),f=!0},p(d,h){const g={};h[1]&256&&(g.$$scope={dirty:h,ctx:d}),a.$set(g),d[8]?c?c.p(d,h):(c=jc(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(A(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&k(e),q(a),c&&c.d()}}}function p3(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[9]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function jc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Done',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[3])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function h3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D;s=new Re({props:{class:"form-field required "+(n[0].id?"disabled":""),name:"schema."+n[1]+".type",$$slots:{default:[QS,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}}),r=new Re({props:{class:` form-field required `+(n[5]?"":"invalid")+` `+(n[0].id&&n[0].system?"disabled":"")+` - `,name:"schema."+n[1]+".name",$$slots:{default:[xS,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});const E=[f3,u3,a3,r3,o3,l3,s3,i3,n3,t3,e3],O=[];function L(B,U){return B[0].type==="text"?0:B[0].type==="number"?1:B[0].type==="bool"?2:B[0].type==="email"?3:B[0].type==="url"?4:B[0].type==="date"?5:B[0].type==="select"?6:B[0].type==="json"?7:B[0].type==="file"?8:B[0].type==="relation"?9:B[0].type==="user"?10:-1}~(f=L(n))&&(c=O[f]=E[f](n)),g=new Re({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[c3,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});let I=n[0].type!=="file"&&Rc(n),N=!n[0].toDelete&&Hc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),V(s.$$.fragment),l=T(),o=_("div"),V(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),h=_("div"),V(g.$$.fragment),v=T(),b=_("div"),I&&I.c(),y=T(),N&&N.c(),C=T(),S=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(S,"type","submit"),p(S,"class","hidden"),p(S,"tabindex","-1"),p(e,"class","field-form")},m(B,U){w(B,e,U),m(e,t),m(t,i),j(s,i,null),m(t,l),m(t,o),j(r,o,null),m(t,a),m(t,u),~f&&O[f].m(u,null),m(t,d),m(t,h),j(g,h,null),m(t,v),m(t,b),I&&I.m(b,null),m(t,y),N&&N.m(t,null),m(e,C),m(e,S),$=!0,M||(D=G(e,"submit",Kt(n[31])),M=!0)},p(B,U){const ee={};U[0]&1&&(ee.class="form-field required "+(B[0].id?"disabled":"")),U[0]&2&&(ee.name="schema."+B[1]+".type"),U[0]&1|U[1]&384&&(ee.$$scope={dirty:U,ctx:B}),s.$set(ee);const K={};U[0]&33&&(K.class=` + `,name:"schema."+n[1]+".name",$$slots:{default:[xS,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});const E=[f3,u3,a3,r3,o3,l3,s3,i3,n3,t3,e3],O=[];function L(B,U){return B[0].type==="text"?0:B[0].type==="number"?1:B[0].type==="bool"?2:B[0].type==="email"?3:B[0].type==="url"?4:B[0].type==="date"?5:B[0].type==="select"?6:B[0].type==="json"?7:B[0].type==="file"?8:B[0].type==="relation"?9:B[0].type==="user"?10:-1}~(f=L(n))&&(c=O[f]=E[f](n)),g=new Re({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[c3,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});let I=n[0].type!=="file"&&Rc(n),N=!n[0].toDelete&&Hc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),V(s.$$.fragment),l=T(),o=_("div"),V(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),h=_("div"),V(g.$$.fragment),v=T(),b=_("div"),I&&I.c(),y=T(),N&&N.c(),C=T(),S=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(S,"type","submit"),p(S,"class","hidden"),p(S,"tabindex","-1"),p(e,"class","field-form")},m(B,U){w(B,e,U),m(e,t),m(t,i),j(s,i,null),m(t,l),m(t,o),j(r,o,null),m(t,a),m(t,u),~f&&O[f].m(u,null),m(t,d),m(t,h),j(g,h,null),m(t,v),m(t,b),I&&I.m(b,null),m(t,y),N&&N.m(t,null),m(e,C),m(e,S),$=!0,M||(D=G(e,"submit",Yt(n[31])),M=!0)},p(B,U){const ee={};U[0]&1&&(ee.class="form-field required "+(B[0].id?"disabled":"")),U[0]&2&&(ee.name="schema."+B[1]+".type"),U[0]&1|U[1]&384&&(ee.$$scope={dirty:U,ctx:B}),s.$set(ee);const K={};U[0]&33&&(K.class=` form-field required `+(B[5]?"":"invalid")+` `+(B[0].id&&B[0].system?"disabled":"")+` - `),U[0]&2&&(K.name="schema."+B[1]+".name"),U[0]&33|U[1]&384&&(K.$$scope={dirty:U,ctx:B}),r.$set(K);let se=f;f=L(B),f===se?~f&&O[f].p(B,U):(c&&(Ae(),P(O[se],1,1,()=>{O[se]=null}),Pe()),~f?(c=O[f],c?c.p(B,U):(c=O[f]=E[f](B),c.c()),A(c,1),c.m(u,null)):c=null);const Y={};U[0]&1|U[1]&384&&(Y.$$scope={dirty:U,ctx:B}),g.$set(Y),B[0].type!=="file"?I?(I.p(B,U),U[0]&1&&A(I,1)):(I=Rc(B),I.c(),A(I,1),I.m(b,null)):I&&(Ae(),P(I,1,1,()=>{I=null}),Pe()),B[0].toDelete?N&&(Ae(),P(N,1,1,()=>{N=null}),Pe()):N?(N.p(B,U),U[0]&1&&A(N,1)):(N=Hc(B),N.c(),A(N,1),N.m(t,null))},i(B){$||(A(s.$$.fragment,B),A(r.$$.fragment,B),A(c),A(g.$$.fragment,B),A(I),A(N),$=!0)},o(B){P(s.$$.fragment,B),P(r.$$.fragment,B),P(c),P(g.$$.fragment,B),P(I),P(N),$=!1},d(B){B&&k(e),q(s),q(r),~f&&O[f].d(),q(g),I&&I.d(),N&&N.d(),M=!1,D()}}}function qc(n){let e,t,i,s,l=n[0].system&&Vc(),o=!n[0].id&&zc(n),r=n[0].required&&Bc(),a=n[0].unique&&Uc();return{c(){e=_("div"),l&&l.c(),t=T(),o&&o.c(),i=T(),r&&r.c(),s=T(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){w(u,e,f),l&&l.m(e,null),m(e,t),o&&o.m(e,null),m(e,i),r&&r.m(e,null),m(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Vc(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=zc(u),o.c(),o.m(e,i)),u[0].required?r||(r=Bc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=Uc(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Vc(n){let e;return{c(){e=_("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zc(n){let e;return{c(){e=_("span"),e.textContent="New",p(e,"class","label"),ie(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&ie(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function Bc(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Uc(n){let e;return{c(){e=_("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wc(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(wt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=ot(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=ot(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Yc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[15])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function m3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,g,v,b,y=!n[0].toDelete&&qc(n),C=n[7]&&!n[0].system&&Wc(),S=n[0].toDelete&&Yc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=T(),o=_("strong"),a=F(r),f=T(),y&&y.c(),c=T(),d=_("div"),h=T(),C&&C.c(),g=T(),S&&S.c(),v=Ke(),p(i,"class",s=Xa(W.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),ie(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m($,M){w($,e,M),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w($,f,M),y&&y.m($,M),w($,c,M),w($,d,M),w($,h,M),C&&C.m($,M),w($,g,M),S&&S.m($,M),w($,v,M),b=!0},p($,M){(!b||M[0]&1&&s!==(s=Xa(W.getFieldTypeIcon($[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||M[0]&1)&&r!==(r=($[0].name||"-")+"")&&ue(a,r),(!b||M[0]&1&&u!==(u=$[0].name))&&p(o,"title",u),M[0]&1&&ie(o,"txt-strikethrough",$[0].toDelete),$[0].toDelete?y&&(y.d(1),y=null):y?y.p($,M):(y=qc($),y.c(),y.m(c.parentNode,c)),$[7]&&!$[0].system?C?M[0]&129&&A(C,1):(C=Wc(),C.c(),A(C,1),C.m(g.parentNode,g)):C&&(Ae(),P(C,1,1,()=>{C=null}),Pe()),$[0].toDelete?S?S.p($,M):(S=Yc($),S.c(),S.m(v.parentNode,v)):S&&(S.d(1),S=null)},i($){b||(A(C),b=!0)},o($){P(C),b=!1},d($){$&&k(e),$&&k(f),y&&y.d($),$&&k(c),$&&k(d),$&&k(h),C&&C.d($),$&&k(g),S&&S.d($),$&&k(v)}}}function g3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion",$$slots:{header:[m3],default:[h3]},$$scope:{ctx:n}};return e=new Xo({props:i}),n[32](e),e.$on("expand",n[33]),e.$on("collapse",n[34]),e.$on("toggle",n[35]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&256&&(o.interactive=s[8]),l[0]&5&&(o.class=s[2]||s[0].toDelete||s[0].system?"field-accordion disabled":"field-accordion"),l[0]&483|l[1]&256&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[32](null),q(e,s)}}}function _3(n,e,t){let i,s,l,o,r;_t(n,qi,H=>t(14,r=H));const a=on();let{key:u="0"}=e,{field:f=new Dn}=e,{disabled:c=!1}=e,{excludeNames:d=[]}=e,h,g=f.type;function v(){h==null||h.expand()}function b(){h==null||h.collapse()}function y(){f.id?t(0,f.toDelete=!0,f):(b(),a("remove"))}function C(H){if(H=(""+H).toLowerCase(),!H)return!1;for(const pe of d)if(pe.toLowerCase()===H)return!1;return!0}function S(H){return W.slugify(H)}Jn(()=>{f.id||v()});const $=()=>{t(0,f.toDelete=!1,f)};function M(H){n.$$.not_equal(f.type,H)&&(f.type=H,t(0,f),t(13,g),t(4,h))}const D=H=>{t(0,f.name=S(H.target.value),f),H.target.value=f.name};function E(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function O(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function L(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function I(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function N(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function B(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function U(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function ee(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function K(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function se(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function Y(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function te(){f.required=this.checked,t(0,f),t(13,g),t(4,h)}function J(){f.unique=this.checked,t(0,f),t(13,g),t(4,h)}const ge=()=>{i&&b()};function _e(H){de[H?"unshift":"push"](()=>{h=H,t(4,h)})}function X(H){rt.call(this,n,H)}function re(H){rt.call(this,n,H)}function ve(H){rt.call(this,n,H)}return n.$$set=H=>{"key"in H&&t(1,u=H.key),"field"in H&&t(0,f=H.field),"disabled"in H&&t(2,c=H.disabled),"excludeNames"in H&&t(11,d=H.excludeNames)},n.$$.update=()=>{n.$$.dirty[0]&8193&&g!=f.type&&(t(13,g=f.type),t(0,f.options={},f),t(0,f.unique=!1,f)),n.$$.dirty[0]&17&&f.toDelete&&(h&&b(),f.originalName&&f.name!==f.originalName&&t(0,f.name=f.originalName,f)),n.$$.dirty[0]&1&&!f.originalName&&f.name&&t(0,f.originalName=f.name,f),n.$$.dirty[0]&1&&typeof f.toDelete>"u"&&t(0,f.toDelete=!1,f),n.$$.dirty[0]&1&&f.required&&t(0,f.nullable=!1,f),n.$$.dirty[0]&1&&t(6,i=!W.isEmpty(f.name)&&f.type),n.$$.dirty[0]&80&&(i||h&&v()),n.$$.dirty[0]&69&&t(8,s=!c&&!f.system&&!f.toDelete&&i),n.$$.dirty[0]&1&&t(5,l=C(f.name)),n.$$.dirty[0]&16418&&t(7,o=!l||!W.isEmpty(W.getNestedVal(r,`schema.${u}`)))},[f,u,c,b,h,l,i,o,s,y,S,d,v,g,r,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,ge,_e,X,re,ve]}class b3 extends Ee{constructor(e){super(),Oe(this,e,_3,g3,De,{key:1,field:0,disabled:2,excludeNames:11,expand:12,collapse:3},null,[-1,-1])}get expand(){return this.$$.ctx[12]}get collapse(){return this.$$.ctx[3]}}function Kc(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Jc(n,e){let t,i,s,l;function o(u){e[5](u,e[9],e[10],e[11])}function r(){return e[6](e[11])}let a={key:e[11],excludeNames:e[1].concat(e[4](e[9]))};return e[9]!==void 0&&(a.field=e[9]),i=new b3({props:a}),de.push(()=>Ie(i,"field",o)),i.$on("remove",r),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(u,f){w(u,t,f),j(i,u,f),l=!0},p(u,f){e=u;const c={};f&1&&(c.key=e[11]),f&1&&(c.excludeNames=e[1].concat(e[4](e[9]))),!s&&f&1&&(s=!0,c.field=e[9],He(()=>s=!1)),i.$set(c)},i(u){l||(A(i.$$.fragment,u),l=!0)},o(u){P(i.$$.fragment,u),l=!1},d(u){u&&k(t),q(i,u)}}}function v3(n){let e,t=[],i=new Map,s,l,o,r,a,u,f,c,d,h,g,v=n[0].schema;const b=y=>y[11];for(let y=0;yh.name===d)}function u(d){let h=[];if(d.toDelete)return h;for(let g of s.schema)g===d||g.toDelete||h.push(g.name);return h}function f(d,h,g,v){g[v]=d,t(0,s)}const c=d=>l(d);return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof(s==null?void 0:s.schema)>"u"&&(t(0,s=s||{}),t(0,s.schema=[],s))},[s,i,l,o,u,f,c]}class k3 extends Ee{constructor(e){super(),Oe(this,e,y3,v3,De,{collection:0})}}function Zc(n,e,t){const i=n.slice();return i[13]=e[t][0],i[14]=e[t][1],i[15]=e,i[16]=t,i}function Gc(n,e,t){const i=n.slice();return i[18]=e[t],i}function Xc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I,N,B,U,ee,K=n[0].schema,se=[];for(let Y=0;Y@request filter:",y=T(),C=_("div"),C.innerHTML=`@request.method + `),U[0]&2&&(K.name="schema."+B[1]+".name"),U[0]&33|U[1]&384&&(K.$$scope={dirty:U,ctx:B}),r.$set(K);let se=f;f=L(B),f===se?~f&&O[f].p(B,U):(c&&(Pe(),P(O[se],1,1,()=>{O[se]=null}),Le()),~f?(c=O[f],c?c.p(B,U):(c=O[f]=E[f](B),c.c()),A(c,1),c.m(u,null)):c=null);const Y={};U[0]&1|U[1]&384&&(Y.$$scope={dirty:U,ctx:B}),g.$set(Y),B[0].type!=="file"?I?(I.p(B,U),U[0]&1&&A(I,1)):(I=Rc(B),I.c(),A(I,1),I.m(b,null)):I&&(Pe(),P(I,1,1,()=>{I=null}),Le()),B[0].toDelete?N&&(Pe(),P(N,1,1,()=>{N=null}),Le()):N?(N.p(B,U),U[0]&1&&A(N,1)):(N=Hc(B),N.c(),A(N,1),N.m(t,null))},i(B){$||(A(s.$$.fragment,B),A(r.$$.fragment,B),A(c),A(g.$$.fragment,B),A(I),A(N),$=!0)},o(B){P(s.$$.fragment,B),P(r.$$.fragment,B),P(c),P(g.$$.fragment,B),P(I),P(N),$=!1},d(B){B&&k(e),q(s),q(r),~f&&O[f].d(),q(g),I&&I.d(),N&&N.d(),M=!1,D()}}}function qc(n){let e,t,i,s,l=n[0].system&&Vc(),o=!n[0].id&&zc(n),r=n[0].required&&Bc(),a=n[0].unique&&Uc();return{c(){e=_("div"),l&&l.c(),t=T(),o&&o.c(),i=T(),r&&r.c(),s=T(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){w(u,e,f),l&&l.m(e,null),m(e,t),o&&o.m(e,null),m(e,i),r&&r.m(e,null),m(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Vc(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=zc(u),o.c(),o.m(e,i)),u[0].required?r||(r=Bc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=Uc(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Vc(n){let e;return{c(){e=_("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zc(n){let e;return{c(){e=_("span"),e.textContent="New",p(e,"class","label"),ie(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&ie(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function Bc(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Uc(n){let e;return{c(){e=_("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wc(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(wt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Yc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[15])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function m3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,g,v,b,y=!n[0].toDelete&&qc(n),C=n[7]&&!n[0].system&&Wc(),S=n[0].toDelete&&Yc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=T(),o=_("strong"),a=F(r),f=T(),y&&y.c(),c=T(),d=_("div"),h=T(),C&&C.c(),g=T(),S&&S.c(),v=Ke(),p(i,"class",s=Xa(W.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),ie(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m($,M){w($,e,M),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w($,f,M),y&&y.m($,M),w($,c,M),w($,d,M),w($,h,M),C&&C.m($,M),w($,g,M),S&&S.m($,M),w($,v,M),b=!0},p($,M){(!b||M[0]&1&&s!==(s=Xa(W.getFieldTypeIcon($[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||M[0]&1)&&r!==(r=($[0].name||"-")+"")&&ue(a,r),(!b||M[0]&1&&u!==(u=$[0].name))&&p(o,"title",u),M[0]&1&&ie(o,"txt-strikethrough",$[0].toDelete),$[0].toDelete?y&&(y.d(1),y=null):y?y.p($,M):(y=qc($),y.c(),y.m(c.parentNode,c)),$[7]&&!$[0].system?C?M[0]&129&&A(C,1):(C=Wc(),C.c(),A(C,1),C.m(g.parentNode,g)):C&&(Pe(),P(C,1,1,()=>{C=null}),Le()),$[0].toDelete?S?S.p($,M):(S=Yc($),S.c(),S.m(v.parentNode,v)):S&&(S.d(1),S=null)},i($){b||(A(C),b=!0)},o($){P(C),b=!1},d($){$&&k(e),$&&k(f),y&&y.d($),$&&k(c),$&&k(d),$&&k(h),C&&C.d($),$&&k(g),S&&S.d($),$&&k(v)}}}function g3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion",$$slots:{header:[m3],default:[h3]},$$scope:{ctx:n}};return e=new Xo({props:i}),n[32](e),e.$on("expand",n[33]),e.$on("collapse",n[34]),e.$on("toggle",n[35]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&256&&(o.interactive=s[8]),l[0]&5&&(o.class=s[2]||s[0].toDelete||s[0].system?"field-accordion disabled":"field-accordion"),l[0]&483|l[1]&256&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[32](null),q(e,s)}}}function _3(n,e,t){let i,s,l,o,r;bt(n,qi,H=>t(14,r=H));const a=on();let{key:u="0"}=e,{field:f=new Dn}=e,{disabled:c=!1}=e,{excludeNames:d=[]}=e,h,g=f.type;function v(){h==null||h.expand()}function b(){h==null||h.collapse()}function y(){f.id?t(0,f.toDelete=!0,f):(b(),a("remove"))}function C(H){if(H=(""+H).toLowerCase(),!H)return!1;for(const me of d)if(me.toLowerCase()===H)return!1;return!0}function S(H){return W.slugify(H)}Jn(()=>{f.id||v()});const $=()=>{t(0,f.toDelete=!1,f)};function M(H){n.$$.not_equal(f.type,H)&&(f.type=H,t(0,f),t(13,g),t(4,h))}const D=H=>{t(0,f.name=S(H.target.value),f),H.target.value=f.name};function E(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function O(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function L(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function I(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function N(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function B(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function U(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function ee(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function K(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function se(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function Y(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function te(){f.required=this.checked,t(0,f),t(13,g),t(4,h)}function J(){f.unique=this.checked,t(0,f),t(13,g),t(4,h)}const _e=()=>{i&&b()};function be(H){pe[H?"unshift":"push"](()=>{h=H,t(4,h)})}function X(H){st.call(this,n,H)}function ae(H){st.call(this,n,H)}function ve(H){st.call(this,n,H)}return n.$$set=H=>{"key"in H&&t(1,u=H.key),"field"in H&&t(0,f=H.field),"disabled"in H&&t(2,c=H.disabled),"excludeNames"in H&&t(11,d=H.excludeNames)},n.$$.update=()=>{n.$$.dirty[0]&8193&&g!=f.type&&(t(13,g=f.type),t(0,f.options={},f),t(0,f.unique=!1,f)),n.$$.dirty[0]&17&&f.toDelete&&(h&&b(),f.originalName&&f.name!==f.originalName&&t(0,f.name=f.originalName,f)),n.$$.dirty[0]&1&&!f.originalName&&f.name&&t(0,f.originalName=f.name,f),n.$$.dirty[0]&1&&typeof f.toDelete>"u"&&t(0,f.toDelete=!1,f),n.$$.dirty[0]&1&&f.required&&t(0,f.nullable=!1,f),n.$$.dirty[0]&1&&t(6,i=!W.isEmpty(f.name)&&f.type),n.$$.dirty[0]&80&&(i||h&&v()),n.$$.dirty[0]&69&&t(8,s=!c&&!f.system&&!f.toDelete&&i),n.$$.dirty[0]&1&&t(5,l=C(f.name)),n.$$.dirty[0]&16418&&t(7,o=!l||!W.isEmpty(W.getNestedVal(r,`schema.${u}`)))},[f,u,c,b,h,l,i,o,s,y,S,d,v,g,r,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve]}class b3 extends Ee{constructor(e){super(),Oe(this,e,_3,g3,De,{key:1,field:0,disabled:2,excludeNames:11,expand:12,collapse:3},null,[-1,-1])}get expand(){return this.$$.ctx[12]}get collapse(){return this.$$.ctx[3]}}function Kc(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Jc(n,e){let t,i,s,l;function o(u){e[5](u,e[9],e[10],e[11])}function r(){return e[6](e[11])}let a={key:e[11],excludeNames:e[1].concat(e[4](e[9]))};return e[9]!==void 0&&(a.field=e[9]),i=new b3({props:a}),pe.push(()=>Fe(i,"field",o)),i.$on("remove",r),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(u,f){w(u,t,f),j(i,u,f),l=!0},p(u,f){e=u;const c={};f&1&&(c.key=e[11]),f&1&&(c.excludeNames=e[1].concat(e[4](e[9]))),!s&&f&1&&(s=!0,c.field=e[9],He(()=>s=!1)),i.$set(c)},i(u){l||(A(i.$$.fragment,u),l=!0)},o(u){P(i.$$.fragment,u),l=!1},d(u){u&&k(t),q(i,u)}}}function v3(n){let e,t=[],i=new Map,s,l,o,r,a,u,f,c,d,h,g,v=n[0].schema;const b=y=>y[11];for(let y=0;yh.name===d)}function u(d){let h=[];if(d.toDelete)return h;for(let g of s.schema)g===d||g.toDelete||h.push(g.name);return h}function f(d,h,g,v){g[v]=d,t(0,s)}const c=d=>l(d);return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof(s==null?void 0:s.schema)>"u"&&(t(0,s=s||{}),t(0,s.schema=[],s))},[s,i,l,o,u,f,c]}class k3 extends Ee{constructor(e){super(),Oe(this,e,y3,v3,De,{collection:0})}}function Zc(n,e,t){const i=n.slice();return i[13]=e[t][0],i[14]=e[t][1],i[15]=e,i[16]=t,i}function Gc(n,e,t){const i=n.slice();return i[18]=e[t],i}function Xc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I,N,B,U,ee,K=n[0].schema,se=[];for(let Y=0;Y@request filter:",y=T(),C=_("div"),C.innerHTML=`@request.method @request.query.* @request.data.* @request.user.*`,S=T(),$=_("hr"),M=T(),D=_("p"),D.innerHTML="You could also add constraints and query other collections using the @collection filter:",E=T(),O=_("div"),O.innerHTML="@collection.ANY_COLLECTION_NAME.*",L=T(),I=_("hr"),N=T(),B=_("p"),B.innerHTML=`Example rule:
    - @request.user.id!="" && created>"2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(C,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(D,"class","m-b-0"),p(O,"class","inline-flex flex-gap-5"),p(I,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(Y,te){w(Y,e,te),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(o,d);for(let J=0;J{U||(U=ot(e,tn,{duration:150},!0)),U.run(1)}),ee=!0)},o(Y){Y&&(U||(U=ot(e,tn,{duration:150},!1)),U.run(0)),ee=!1},d(Y){Y&&k(e),xt(se,Y),Y&&U&&U.end()}}}function w3(n){let e,t=n[18].name+"",i;return{c(){e=_("code"),i=F(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[18].name+"")&&ue(i,t)},d(s){s&&k(e)}}}function $3(n){let e,t=n[18].name+"",i,s;return{c(){e=_("code"),i=F(t),s=F(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[18].name+"")&&ue(i,t)},d(l){l&&k(e)}}}function Qc(n){let e;function t(l,o){return l[18].type==="relation"||l[18].type==="user"?$3:w3}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function S3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[13];for(let r=0;r',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function M3(n){let e,t,i;function s(){return n[9](n[13])}return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(wt.call(null,e,"Lock and set to Admins only")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function T3(n){let e,t,i;function s(){return n[8](n[13])}return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(wt.call(null,e,"Unlock and set custom rule")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function D3(n){let e;return{c(){e=F("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function O3(n){let e;return{c(){e=F("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function E3(n){let e,t=n[14]+"",i,s,l=Li(n[0][n[13]])?"Admins only":"Custom rule",o,r,a,u,f=n[13],c,d,h,g,v;const b=()=>n[10](u,f),y=()=>n[10](null,f);function C(O){n[11](O,n[13])}var S=n[4];function $(O){let L={id:O[17],baseCollection:O[0],disabled:Li(O[0][O[13]])};return O[0][O[13]]!==void 0&&(L.value=O[0][O[13]]),{props:L}}S&&(u=new S($(n)),b(),de.push(()=>Ie(u,"value",C)));function M(O,L){return L&1&&(g=null),g==null&&(g=!!Li(O[0][O[13]])),g?O3:D3}let D=M(n,-1),E=D(n);return{c(){e=_("label"),i=F(t),s=F(" - "),o=F(l),a=T(),u&&V(u.$$.fragment),d=T(),h=_("div"),E.c(),p(e,"for",r=n[17]),p(h,"class","help-block")},m(O,L){w(O,e,L),m(e,i),m(e,s),m(e,o),w(O,a,L),u&&j(u,O,L),w(O,d,L),w(O,h,L),E.m(h,null),v=!0},p(O,L){n=O,(!v||L&1)&&l!==(l=Li(n[0][n[13]])?"Admins only":"Custom rule")&&ue(o,l),(!v||L&131072&&r!==(r=n[17]))&&p(e,"for",r),f!==n[13]&&(y(),f=n[13],b());const I={};if(L&131072&&(I.id=n[17]),L&1&&(I.baseCollection=n[0]),L&1&&(I.disabled=Li(n[0][n[13]])),!c&&L&65&&(c=!0,I.value=n[0][n[13]],He(()=>c=!1)),S!==(S=n[4])){if(u){Ae();const N=u;P(N.$$.fragment,1,0,()=>{q(N,1)}),Pe()}S?(u=new S($(n)),b(),de.push(()=>Ie(u,"value",C)),V(u.$$.fragment),A(u.$$.fragment,1),j(u,d.parentNode,d)):u=null}else S&&u.$set(I);D!==(D=M(n,L))&&(E.d(1),E=D(n),E&&(E.c(),E.m(h,null)))},i(O){v||(u&&A(u.$$.fragment,O),v=!0)},o(O){u&&P(u.$$.fragment,O),v=!1},d(O){O&&k(e),O&&k(a),y(),u&&q(u,O),O&&k(d),O&&k(h),E.d()}}}function xc(n,e){let t,i,s,l,o,r,a,u;function f(h,g){return g&1&&(l=null),l==null&&(l=!!Li(h[0][h[13]])),l?T3:M3}let c=f(e,-1),d=c(e);return r=new Re({props:{class:"form-field rule-field m-0 "+(Li(e[0][e[13]])?"disabled":""),name:e[13],$$slots:{default:[E3,({uniqueId:h})=>({17:h}),({uniqueId:h})=>h?131072:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=_("hr"),i=T(),s=_("div"),d.c(),o=T(),V(r.$$.fragment),a=T(),p(t,"class","m-t-sm m-b-sm"),p(s,"class","rule-block svelte-fjxz7k"),this.first=t},m(h,g){w(h,t,g),w(h,i,g),w(h,s,g),d.m(s,null),m(s,o),j(r,s,null),m(s,a),u=!0},p(h,g){e=h,c===(c=f(e,g))&&d?d.p(e,g):(d.d(1),d=c(e),d&&(d.c(),d.m(s,o)));const v={};g&1&&(v.class="form-field rule-field m-0 "+(Li(e[0][e[13]])?"disabled":"")),g&2228249&&(v.$$scope={dirty:g,ctx:e}),r.$set(v)},i(h){u||(A(r.$$.fragment,h),u=!0)},o(h){P(r.$$.fragment,h),u=!1},d(h){h&&k(t),h&&k(i),h&&k(s),d.d(),q(r)}}}function A3(n){let e,t,i,s,l,o=n[2]?"Hide available fields":"Show available fields",r,a,u,f,c,d,h,g,v,b=n[2]&&Xc(n);const y=[C3,S3],C=[];function S($,M){return $[5]?0:1}return f=S(n),c=C[f]=y[f](n),{c(){e=_("div"),t=_("div"),i=_("p"),i.innerHTML=`All rules follow the + @request.user.id!="" && created>"2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(C,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(D,"class","m-b-0"),p(O,"class","inline-flex flex-gap-5"),p(I,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(Y,te){w(Y,e,te),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(o,d);for(let J=0;J{U||(U=it(e,tn,{duration:150},!0)),U.run(1)}),ee=!0)},o(Y){Y&&(U||(U=it(e,tn,{duration:150},!1)),U.run(0)),ee=!1},d(Y){Y&&k(e),Qt(se,Y),Y&&U&&U.end()}}}function w3(n){let e,t=n[18].name+"",i;return{c(){e=_("code"),i=F(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[18].name+"")&&ue(i,t)},d(s){s&&k(e)}}}function $3(n){let e,t=n[18].name+"",i,s;return{c(){e=_("code"),i=F(t),s=F(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[18].name+"")&&ue(i,t)},d(l){l&&k(e)}}}function Qc(n){let e;function t(l,o){return l[18].type==="relation"||l[18].type==="user"?$3:w3}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function S3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[13];for(let r=0;r',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function M3(n){let e,t,i;function s(){return n[9](n[13])}return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(wt.call(null,e,"Lock and set to Admins only")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function T3(n){let e,t,i;function s(){return n[8](n[13])}return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(wt.call(null,e,"Unlock and set custom rule")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function D3(n){let e;return{c(){e=F("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function O3(n){let e;return{c(){e=F("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function E3(n){let e,t=n[14]+"",i,s,l=Li(n[0][n[13]])?"Admins only":"Custom rule",o,r,a,u,f=n[13],c,d,h,g,v;const b=()=>n[10](u,f),y=()=>n[10](null,f);function C(O){n[11](O,n[13])}var S=n[4];function $(O){let L={id:O[17],baseCollection:O[0],disabled:Li(O[0][O[13]])};return O[0][O[13]]!==void 0&&(L.value=O[0][O[13]]),{props:L}}S&&(u=new S($(n)),b(),pe.push(()=>Fe(u,"value",C)));function M(O,L){return L&1&&(g=null),g==null&&(g=!!Li(O[0][O[13]])),g?O3:D3}let D=M(n,-1),E=D(n);return{c(){e=_("label"),i=F(t),s=F(" - "),o=F(l),a=T(),u&&V(u.$$.fragment),d=T(),h=_("div"),E.c(),p(e,"for",r=n[17]),p(h,"class","help-block")},m(O,L){w(O,e,L),m(e,i),m(e,s),m(e,o),w(O,a,L),u&&j(u,O,L),w(O,d,L),w(O,h,L),E.m(h,null),v=!0},p(O,L){n=O,(!v||L&1)&&l!==(l=Li(n[0][n[13]])?"Admins only":"Custom rule")&&ue(o,l),(!v||L&131072&&r!==(r=n[17]))&&p(e,"for",r),f!==n[13]&&(y(),f=n[13],b());const I={};if(L&131072&&(I.id=n[17]),L&1&&(I.baseCollection=n[0]),L&1&&(I.disabled=Li(n[0][n[13]])),!c&&L&65&&(c=!0,I.value=n[0][n[13]],He(()=>c=!1)),S!==(S=n[4])){if(u){Pe();const N=u;P(N.$$.fragment,1,0,()=>{q(N,1)}),Le()}S?(u=new S($(n)),b(),pe.push(()=>Fe(u,"value",C)),V(u.$$.fragment),A(u.$$.fragment,1),j(u,d.parentNode,d)):u=null}else S&&u.$set(I);D!==(D=M(n,L))&&(E.d(1),E=D(n),E&&(E.c(),E.m(h,null)))},i(O){v||(u&&A(u.$$.fragment,O),v=!0)},o(O){u&&P(u.$$.fragment,O),v=!1},d(O){O&&k(e),O&&k(a),y(),u&&q(u,O),O&&k(d),O&&k(h),E.d()}}}function xc(n,e){let t,i,s,l,o,r,a,u;function f(h,g){return g&1&&(l=null),l==null&&(l=!!Li(h[0][h[13]])),l?T3:M3}let c=f(e,-1),d=c(e);return r=new Re({props:{class:"form-field rule-field m-0 "+(Li(e[0][e[13]])?"disabled":""),name:e[13],$$slots:{default:[E3,({uniqueId:h})=>({17:h}),({uniqueId:h})=>h?131072:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=_("hr"),i=T(),s=_("div"),d.c(),o=T(),V(r.$$.fragment),a=T(),p(t,"class","m-t-sm m-b-sm"),p(s,"class","rule-block svelte-fjxz7k"),this.first=t},m(h,g){w(h,t,g),w(h,i,g),w(h,s,g),d.m(s,null),m(s,o),j(r,s,null),m(s,a),u=!0},p(h,g){e=h,c===(c=f(e,g))&&d?d.p(e,g):(d.d(1),d=c(e),d&&(d.c(),d.m(s,o)));const v={};g&1&&(v.class="form-field rule-field m-0 "+(Li(e[0][e[13]])?"disabled":"")),g&2228249&&(v.$$scope={dirty:g,ctx:e}),r.$set(v)},i(h){u||(A(r.$$.fragment,h),u=!0)},o(h){P(r.$$.fragment,h),u=!1},d(h){h&&k(t),h&&k(i),h&&k(s),d.d(),q(r)}}}function A3(n){let e,t,i,s,l,o=n[2]?"Hide available fields":"Show available fields",r,a,u,f,c,d,h,g,v,b=n[2]&&Xc(n);const y=[C3,S3],C=[];function S($,M){return $[5]?0:1}return f=S(n),c=C[f]=y[f](n),{c(){e=_("div"),t=_("div"),i=_("p"),i.innerHTML=`All rules follow the
    PocketBase filter syntax and operators - .`,s=T(),l=_("span"),r=F(o),a=T(),b&&b.c(),u=T(),c.c(),d=Ke(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m($,M){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w($,u,M),C[f].m($,M),w($,d,M),h=!0,g||(v=G(l,"click",n[7]),g=!0)},p($,[M]){(!h||M&4)&&o!==(o=$[2]?"Hide available fields":"Show available fields")&&ue(r,o),$[2]?b?(b.p($,M),M&4&&A(b,1)):(b=Xc($),b.c(),A(b,1),b.m(e,null)):b&&(Ae(),P(b,1,1,()=>{b=null}),Pe());let D=f;f=S($),f===D?C[f].p($,M):(Ae(),P(C[D],1,1,()=>{C[D]=null}),Pe(),c=C[f],c?c.p($,M):(c=C[f]=y[f]($),c.c()),A(c,1),c.m(d.parentNode,d))},i($){h||(A(b),A(c),h=!0)},o($){P(b),P(c),h=!1},d($){$&&k(e),b&&b.d(),$&&k(u),C[f].d($),$&&k(d),g=!1,v()}}}function Li(n){return n===null}function P3(n,e,t){let{collection:i=new fn}=e,s={},l=!1,o={},r,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,r=(await Ai(()=>import("./FilterAutocompleteInput.7ac53d63.js"),["FilterAutocompleteInput.7ac53d63.js","index.90bde420.js"],import.meta.url)).default)}catch(b){console.warn(b),t(4,r=null)}t(5,a=!1)}Jn(()=>{f()});const c=()=>t(2,l=!l),d=async b=>{var y;t(0,i[b]=s[b]||"",i),await ii(),(y=o[b])==null||y.focus()},h=b=>{t(1,s[b]=i[b],s),t(0,i[b]=null,i)};function g(b,y){de[b?"unshift":"push"](()=>{o[y]=b,t(3,o)})}function v(b,y){n.$$.not_equal(i[y],b)&&(i[y]=b,t(0,i))}return n.$$set=b=>{"collection"in b&&t(0,i=b.collection)},[i,s,l,o,r,a,u,c,d,h,g,v]}class L3 extends Ee{constructor(e){super(),Oe(this,e,P3,A3,De,{collection:0})}}function ed(n,e,t){const i=n.slice();return i[14]=e[t],i}function td(n,e,t){const i=n.slice();return i[14]=e[t],i}function nd(n){let e;return{c(){e=_("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function id(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=F(`Renamed collection + .`,s=T(),l=_("span"),r=F(o),a=T(),b&&b.c(),u=T(),c.c(),d=Ke(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m($,M){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w($,u,M),C[f].m($,M),w($,d,M),h=!0,g||(v=G(l,"click",n[7]),g=!0)},p($,[M]){(!h||M&4)&&o!==(o=$[2]?"Hide available fields":"Show available fields")&&ue(r,o),$[2]?b?(b.p($,M),M&4&&A(b,1)):(b=Xc($),b.c(),A(b,1),b.m(e,null)):b&&(Pe(),P(b,1,1,()=>{b=null}),Le());let D=f;f=S($),f===D?C[f].p($,M):(Pe(),P(C[D],1,1,()=>{C[D]=null}),Le(),c=C[f],c?c.p($,M):(c=C[f]=y[f]($),c.c()),A(c,1),c.m(d.parentNode,d))},i($){h||(A(b),A(c),h=!0)},o($){P(b),P(c),h=!1},d($){$&&k(e),b&&b.d(),$&&k(u),C[f].d($),$&&k(d),g=!1,v()}}}function Li(n){return n===null}function P3(n,e,t){let{collection:i=new fn}=e,s={},l=!1,o={},r,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,r=(await Ai(()=>import("./FilterAutocompleteInput.9df887af.js"),["FilterAutocompleteInput.9df887af.js","index.afc1faa1.js"],import.meta.url)).default)}catch(b){console.warn(b),t(4,r=null)}t(5,a=!1)}Jn(()=>{f()});const c=()=>t(2,l=!l),d=async b=>{var y;t(0,i[b]=s[b]||"",i),await ii(),(y=o[b])==null||y.focus()},h=b=>{t(1,s[b]=i[b],s),t(0,i[b]=null,i)};function g(b,y){pe[b?"unshift":"push"](()=>{o[y]=b,t(3,o)})}function v(b,y){n.$$.not_equal(i[y],b)&&(i[y]=b,t(0,i))}return n.$$set=b=>{"collection"in b&&t(0,i=b.collection)},[i,s,l,o,r,a,u,c,d,h,g,v]}class L3 extends Ee{constructor(e){super(),Oe(this,e,P3,A3,De,{collection:0})}}function ed(n,e,t){const i=n.slice();return i[14]=e[t],i}function td(n,e,t){const i=n.slice();return i[14]=e[t],i}function nd(n){let e;return{c(){e=_("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function id(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=F(`Renamed collection `),s=_("strong"),o=F(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=F(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&2&&l!==(l=h[1].originalName+"")&&ue(o,l),g&2&&c!==(c=h[1].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function sd(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=F(`Renamed field `),s=_("strong"),o=F(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=F(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&16&&l!==(l=h[14].originalName+"")&&ue(o,l),g&16&&c!==(c=h[14].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function ld(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=F("Removed field "),i=_("span"),l=F(s),o=T(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){w(r,e,a),m(e,t),m(e,i),m(i,l),m(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&ue(l,s)},d(r){r&&k(e)}}}function I3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&nd(),g=n[5]&&id(n),v=n[4],b=[];for(let S=0;S',i=T(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to - update it manually!`,o=T(),h&&h.c(),r=T(),a=_("h6"),a.textContent="Changes:",u=T(),f=_("ul"),g&&g.c(),c=T();for(let S=0;SCancel',t=T(),i=_("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[G(e,"click",n[8]),G(i,"click",n[9])],s=!0)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Ge(l)}}}function R3(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[N3],header:[F3],default:[I3]},$$scope:{ctx:n}};return e=new mi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),q(e,s)}}}function H3(n,e,t){let i,s,l;const o=on();let r,a;async function u(y){t(1,a=y),await ii(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function g(y){de[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){rt.call(this,n,y)}function b(y){rt.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,g,v,b]}class j3 extends Ee{constructor(e){super(),Oe(this,e,H3,R3,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function od(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new L3({props:o}),de.push(()=>Ie(t,"collection",l)),{c(){e=_("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],He(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&k(e),q(t)}}}function q3(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new k3({props:a}),de.push(()=>Ie(i,"collection",r));let u=n[9]===ml&&od(n);return{c(){e=_("div"),t=_("div"),V(i.$$.fragment),l=T(),u&&u.c(),p(t,"class","tab-item"),ie(t,"active",n[9]===os),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),j(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],He(()=>s=!1)),i.$set(d),c[0]&512&&ie(t,"active",f[9]===os),f[9]===ml?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=od(f),u.c(),A(u,1),u.m(e,null)):u&&(Ae(),P(u,1,1,()=>{u=null}),Pe())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){P(i.$$.fragment,f),P(u),o=!1},d(f){f&&k(e),q(i),u&&u.d()}}}function rd(n){let e,t,i,s,l,o,r;return o=new Mi({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[V3]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=T(),i=_("button"),s=_("i"),l=T(),V(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-secondary flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),m(i,s),m(i,l),j(o,i,null),r=!0},p(a,u){const f={};u[1]&256&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&k(e),a&&k(t),a&&k(i),q(o)}}}function V3(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=` - Delete`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[20]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function ad(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function z3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&ad();return{c(){e=_("label"),t=F("Name"),s=T(),l=_("input"),u=T(),h&&h.c(),f=Ke(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),h&&h.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=G(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&p(e,"for",i),v[1]&128&&o!==(o=g[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=ad(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),h&&h.d(g),g&&k(f),c=!1,d()}}}function ud(n){let e,t,i,s,l,o;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Ye(t=wt.call(null,e,n[12])),l=!0)},p(r,a){t&&Kn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=ot(e,Tn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=ot(e,Tn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function fd(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(wt.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=ot(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=ot(e,Tn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function B3(n){var N,B,U,ee,K,se;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,g,v=!W.isEmpty((N=n[4])==null?void 0:N.schema),b,y,C,S,$=!W.isEmpty((B=n[4])==null?void 0:B.listRule)||!W.isEmpty((U=n[4])==null?void 0:U.viewRule)||!W.isEmpty((ee=n[4])==null?void 0:ee.createRule)||!W.isEmpty((K=n[4])==null?void 0:K.updateRule)||!W.isEmpty((se=n[4])==null?void 0:se.deleteRule),M,D,E,O=!n[2].isNew&&!n[2].system&&rd(n);r=new Re({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[z3,({uniqueId:Y})=>({38:Y}),({uniqueId:Y})=>[0,Y?128:0]]},$$scope:{ctx:n}}});let L=v&&ud(n),I=$&&fd();return{c(){e=_("h4"),i=F(t),s=T(),O&&O.c(),l=T(),o=_("form"),V(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=T(),L&&L.c(),b=T(),y=_("button"),C=_("span"),C.textContent="API Rules",S=T(),I&&I.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ie(d,"active",n[9]===os),p(C,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ie(y,"active",n[9]===ml),p(c,"class","tabs-header stretched")},m(Y,te){w(Y,e,te),m(e,i),w(Y,s,te),O&&O.m(Y,te),w(Y,l,te),w(Y,o,te),j(r,o,null),m(o,a),m(o,u),w(Y,f,te),w(Y,c,te),m(c,d),m(d,h),m(d,g),L&&L.m(d,null),m(c,b),m(c,y),m(y,C),m(y,S),I&&I.m(y,null),M=!0,D||(E=[G(o,"submit",Kt(n[22])),G(d,"click",n[23]),G(y,"click",n[24])],D=!0)},p(Y,te){var ge,_e,X,re,ve,H;(!M||te[0]&4)&&t!==(t=Y[2].isNew?"New collection":"Edit collection")&&ue(i,t),!Y[2].isNew&&!Y[2].system?O?(O.p(Y,te),te[0]&4&&A(O,1)):(O=rd(Y),O.c(),A(O,1),O.m(l.parentNode,l)):O&&(Ae(),P(O,1,1,()=>{O=null}),Pe());const J={};te[0]&2048&&(J.class="form-field required m-b-0 "+(Y[11]?"disabled":"")),te[0]&2052|te[1]&384&&(J.$$scope={dirty:te,ctx:Y}),r.$set(J),te[0]&16&&(v=!W.isEmpty((ge=Y[4])==null?void 0:ge.schema)),v?L?(L.p(Y,te),te[0]&16&&A(L,1)):(L=ud(Y),L.c(),A(L,1),L.m(d,null)):L&&(Ae(),P(L,1,1,()=>{L=null}),Pe()),te[0]&512&&ie(d,"active",Y[9]===os),te[0]&16&&($=!W.isEmpty((_e=Y[4])==null?void 0:_e.listRule)||!W.isEmpty((X=Y[4])==null?void 0:X.viewRule)||!W.isEmpty((re=Y[4])==null?void 0:re.createRule)||!W.isEmpty((ve=Y[4])==null?void 0:ve.updateRule)||!W.isEmpty((H=Y[4])==null?void 0:H.deleteRule)),$?I?te[0]&16&&A(I,1):(I=fd(),I.c(),A(I,1),I.m(y,null)):I&&(Ae(),P(I,1,1,()=>{I=null}),Pe()),te[0]&512&&ie(y,"active",Y[9]===ml)},i(Y){M||(A(O),A(r.$$.fragment,Y),A(L),A(I),M=!0)},o(Y){P(O),P(r.$$.fragment,Y),P(L),P(I),M=!1},d(Y){Y&&k(e),Y&&k(s),O&&O.d(Y),Y&&k(l),Y&&k(o),q(r),Y&&k(f),Y&&k(c),L&&L.d(),I&&I.d(),D=!1,Ge(E)}}}function U3(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=F(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],ie(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=[G(e,"click",n[18]),G(s,"click",n[19])],u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&1152&&a!==(a=!c[10]||c[7])&&(s.disabled=a),d[0]&128&&ie(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Ge(f)}}}function W3(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header compact-header collection-panel",beforeHide:n[27],$$slots:{footer:[U3],header:[B3],default:[q3]},$$scope:{ctx:n}};e=new mi({props:l}),n[28](e),e.$on("hide",n[29]),e.$on("show",n[30]);let o={};return i=new j3({props:o}),n[31](i),i.$on("confirm",n[32]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(i,r,a),s=!0},p(r,a){const u={};a[0]&264&&(u.beforeHide=r[27]),a[0]&7828|a[1]&256&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[28](null),q(e,r),r&&k(t),n[31](null),q(i,r)}}}const os="fields",ml="api_rules";function Tr(n){return JSON.stringify(n)}function Y3(n,e,t){let i,s,l,o,r,a;_t(n,ci,H=>t(34,r=H)),_t(n,qi,H=>t(4,a=H));const u=on();let f,c,d=null,h=new fn,g=!1,v=!1,b=os,y=Tr(h);function C(H){t(9,b=H)}function S(H){return M(H),t(8,v=!0),C(os),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}async function M(H){hi({}),typeof H<"u"?(d=H,t(2,h=H==null?void 0:H.clone())):(d=null,t(2,h=new fn)),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await ii(),t(17,y=Tr(h))}function D(){if(h.isNew)return E();c==null||c.show(h)}function E(){if(g)return;t(7,g=!0);const H=O();let pe;h.isNew?pe=ye.collections.create(H):pe=ye.collections.update(h.id,H),pe.then(x=>{t(8,v=!1),$(),cn(h.isNew?"Successfully created collection.":"Successfully updated collection."),m$(x),h.isNew&&dn(ci,r=x,r),u("save",x)}).catch(x=>{ye.errorResponseHandler(x)}).finally(()=>{t(7,g=!1)})}function O(){const H=h.export();H.schema=H.schema.slice(0);for(let pe=H.schema.length-1;pe>=0;pe--)H.schema[pe].toDelete&&H.schema.splice(pe,1);return H}function L(){!(d!=null&&d.id)||pi(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>ye.collections.delete(d==null?void 0:d.id).then(()=>{$(),cn(`Successfully deleted collection "${d==null?void 0:d.name}".`),u("delete",d),g$(d)}).catch(H=>{ye.errorResponseHandler(H)}))}const I=()=>$(),N=()=>D(),B=()=>L(),U=H=>{t(2,h.name=W.slugify(H.target.value),h),H.target.value=h.name},ee=()=>{o&&D()},K=()=>C(os),se=()=>C(ml);function Y(H){h=H,t(2,h)}function te(H){h=H,t(2,h)}const J=()=>l&&v?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,v=!1),$()}),!1):!0;function ge(H){de[H?"unshift":"push"](()=>{f=H,t(5,f)})}function _e(H){rt.call(this,n,H)}function X(H){rt.call(this,n,H)}function re(H){de[H?"unshift":"push"](()=>{c=H,t(6,c)})}const ve=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&16&&t(12,i=typeof W.getNestedVal(a,"schema.message",null)=="string"?W.getNestedVal(a,"schema.message"):"Has errors"),n.$$.dirty[0]&4&&t(11,s=!h.isNew&&h.system),n.$$.dirty[0]&131076&&t(3,l=y!=Tr(h)),n.$$.dirty[0]&12&&t(10,o=h.isNew||l)},[C,$,h,l,a,f,c,g,v,b,o,s,i,D,E,L,S,y,I,N,B,U,ee,K,se,Y,te,J,ge,_e,X,re,ve]}class Ja extends Ee{constructor(e){super(),Oe(this,e,Y3,W3,De,{changeTab:0,show:16,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[16]}get hide(){return this.$$.ctx[1]}}function cd(n,e,t){const i=n.slice();return i[13]=e[t],i}function dd(n){let e,t=n[1].length&&pd();return{c(){t&&t.c(),e=Ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1].length?t||(t=pd(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function pd(n){let e;return{c(){e=_("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function K3(n){let e;return{c(){e=_("i"),p(e,"class","ri-folder-2-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function J3(n){let e;return{c(){e=_("i"),p(e,"class","ri-folder-open-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function hd(n,e){let t,i,s,l=e[13].name+"",o,r,a,u;function f(g,v){var b;return((b=g[5])==null?void 0:b.id)===g[13].id?J3:K3}let c=f(e),d=c(e);function h(){return e[10](e[13])}return{key:n,first:null,c(){var g;t=_("div"),d.c(),i=T(),s=_("span"),o=F(l),r=T(),p(s,"class","txt"),p(t,"tabindex","0"),p(t,"class","sidebar-list-item"),ie(t,"active",((g=e[5])==null?void 0:g.id)===e[13].id),this.first=t},m(g,v){w(g,t,v),d.m(t,null),m(t,i),m(t,s),m(s,o),m(t,r),a||(u=G(t,"click",h),a=!0)},p(g,v){var b;e=g,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i))),v&8&&l!==(l=e[13].name+"")&&ue(o,l),v&40&&ie(t,"active",((b=e[5])==null?void 0:b.id)===e[13].id)},d(g){g&&k(t),d.d(),a=!1,u()}}}function Z3(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,g,v,b,y,C,S,$,M,D=n[3];const E=I=>I[13].id;for(let I=0;I',o=T(),r=_("input"),a=T(),u=_("hr"),f=T(),c=_("div");for(let I=0;I - New collection`,y=T(),V(C.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ie(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),ie(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),p(b,"type","button"),p(b,"class","btn btn-block btn-outline"),p(v,"class","sidebar-footer"),p(e,"class","page-sidebar collection-sidebar")},m(I,N){w(I,e,N),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Me(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let B=0;Bt(5,o=b)),_t(n,Ds,b=>t(7,r=b));let a,u="";function f(b){dn(ci,o=b,o)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const h=b=>f(b),g=()=>a==null?void 0:a.show();function v(b){de[b?"unshift":"push"](()=>{a=b,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=u.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=u!==""),n.$$.dirty&131&&t(3,l=r.filter(b=>b.name!="profiles"&&(b.id==u||b.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[u,i,a,l,s,o,f,r,c,d,h,g,v]}class X3 extends Ee{constructor(e){super(),Oe(this,e,G3,Z3,De,{})}}function Q3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,ge,_e,X,re,ve,H,pe,x,Q,$e,je,Be,Z,me,ce,we,Ze;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format + update it manually!`,o=T(),h&&h.c(),r=T(),a=_("h6"),a.textContent="Changes:",u=T(),f=_("ul"),g&&g.c(),c=T();for(let S=0;SCancel',t=T(),i=_("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[G(e,"click",n[8]),G(i,"click",n[9])],s=!0)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Ge(l)}}}function R3(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[N3],header:[F3],default:[I3]},$$scope:{ctx:n}};return e=new mi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),q(e,s)}}}function H3(n,e,t){let i,s,l;const o=on();let r,a;async function u(y){t(1,a=y),await ii(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function g(y){pe[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){st.call(this,n,y)}function b(y){st.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,g,v,b]}class j3 extends Ee{constructor(e){super(),Oe(this,e,H3,R3,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function od(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new L3({props:o}),pe.push(()=>Fe(t,"collection",l)),{c(){e=_("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],He(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&k(e),q(t)}}}function q3(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new k3({props:a}),pe.push(()=>Fe(i,"collection",r));let u=n[9]===ml&&od(n);return{c(){e=_("div"),t=_("div"),V(i.$$.fragment),l=T(),u&&u.c(),p(t,"class","tab-item"),ie(t,"active",n[9]===os),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),j(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],He(()=>s=!1)),i.$set(d),c[0]&512&&ie(t,"active",f[9]===os),f[9]===ml?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=od(f),u.c(),A(u,1),u.m(e,null)):u&&(Pe(),P(u,1,1,()=>{u=null}),Le())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){P(i.$$.fragment,f),P(u),o=!1},d(f){f&&k(e),q(i),u&&u.d()}}}function rd(n){let e,t,i,s,l,o,r;return o=new Mi({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[V3]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=T(),i=_("button"),s=_("i"),l=T(),V(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-secondary flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),m(i,s),m(i,l),j(o,i,null),r=!0},p(a,u){const f={};u[1]&256&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&k(e),a&&k(t),a&&k(i),q(o)}}}function V3(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=` + Delete`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[20]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function ad(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function z3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&ad();return{c(){e=_("label"),t=F("Name"),s=T(),l=_("input"),u=T(),h&&h.c(),f=Ke(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),h&&h.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=G(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&p(e,"for",i),v[1]&128&&o!==(o=g[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=ad(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),h&&h.d(g),g&&k(f),c=!1,d()}}}function ud(n){let e,t,i,s,l,o;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Ye(t=wt.call(null,e,n[12])),l=!0)},p(r,a){t&&Kn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=it(e,Tn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=it(e,Tn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function fd(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(wt.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function B3(n){var N,B,U,ee,K,se;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,g,v=!W.isEmpty((N=n[4])==null?void 0:N.schema),b,y,C,S,$=!W.isEmpty((B=n[4])==null?void 0:B.listRule)||!W.isEmpty((U=n[4])==null?void 0:U.viewRule)||!W.isEmpty((ee=n[4])==null?void 0:ee.createRule)||!W.isEmpty((K=n[4])==null?void 0:K.updateRule)||!W.isEmpty((se=n[4])==null?void 0:se.deleteRule),M,D,E,O=!n[2].isNew&&!n[2].system&&rd(n);r=new Re({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[z3,({uniqueId:Y})=>({38:Y}),({uniqueId:Y})=>[0,Y?128:0]]},$$scope:{ctx:n}}});let L=v&&ud(n),I=$&&fd();return{c(){e=_("h4"),i=F(t),s=T(),O&&O.c(),l=T(),o=_("form"),V(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=T(),L&&L.c(),b=T(),y=_("button"),C=_("span"),C.textContent="API Rules",S=T(),I&&I.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ie(d,"active",n[9]===os),p(C,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ie(y,"active",n[9]===ml),p(c,"class","tabs-header stretched")},m(Y,te){w(Y,e,te),m(e,i),w(Y,s,te),O&&O.m(Y,te),w(Y,l,te),w(Y,o,te),j(r,o,null),m(o,a),m(o,u),w(Y,f,te),w(Y,c,te),m(c,d),m(d,h),m(d,g),L&&L.m(d,null),m(c,b),m(c,y),m(y,C),m(y,S),I&&I.m(y,null),M=!0,D||(E=[G(o,"submit",Yt(n[22])),G(d,"click",n[23]),G(y,"click",n[24])],D=!0)},p(Y,te){var _e,be,X,ae,ve,H;(!M||te[0]&4)&&t!==(t=Y[2].isNew?"New collection":"Edit collection")&&ue(i,t),!Y[2].isNew&&!Y[2].system?O?(O.p(Y,te),te[0]&4&&A(O,1)):(O=rd(Y),O.c(),A(O,1),O.m(l.parentNode,l)):O&&(Pe(),P(O,1,1,()=>{O=null}),Le());const J={};te[0]&2048&&(J.class="form-field required m-b-0 "+(Y[11]?"disabled":"")),te[0]&2052|te[1]&384&&(J.$$scope={dirty:te,ctx:Y}),r.$set(J),te[0]&16&&(v=!W.isEmpty((_e=Y[4])==null?void 0:_e.schema)),v?L?(L.p(Y,te),te[0]&16&&A(L,1)):(L=ud(Y),L.c(),A(L,1),L.m(d,null)):L&&(Pe(),P(L,1,1,()=>{L=null}),Le()),te[0]&512&&ie(d,"active",Y[9]===os),te[0]&16&&($=!W.isEmpty((be=Y[4])==null?void 0:be.listRule)||!W.isEmpty((X=Y[4])==null?void 0:X.viewRule)||!W.isEmpty((ae=Y[4])==null?void 0:ae.createRule)||!W.isEmpty((ve=Y[4])==null?void 0:ve.updateRule)||!W.isEmpty((H=Y[4])==null?void 0:H.deleteRule)),$?I?te[0]&16&&A(I,1):(I=fd(),I.c(),A(I,1),I.m(y,null)):I&&(Pe(),P(I,1,1,()=>{I=null}),Le()),te[0]&512&&ie(y,"active",Y[9]===ml)},i(Y){M||(A(O),A(r.$$.fragment,Y),A(L),A(I),M=!0)},o(Y){P(O),P(r.$$.fragment,Y),P(L),P(I),M=!1},d(Y){Y&&k(e),Y&&k(s),O&&O.d(Y),Y&&k(l),Y&&k(o),q(r),Y&&k(f),Y&&k(c),L&&L.d(),I&&I.d(),D=!1,Ge(E)}}}function U3(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=F(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],ie(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=[G(e,"click",n[18]),G(s,"click",n[19])],u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&1152&&a!==(a=!c[10]||c[7])&&(s.disabled=a),d[0]&128&&ie(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Ge(f)}}}function W3(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header compact-header collection-panel",beforeHide:n[27],$$slots:{footer:[U3],header:[B3],default:[q3]},$$scope:{ctx:n}};e=new mi({props:l}),n[28](e),e.$on("hide",n[29]),e.$on("show",n[30]);let o={};return i=new j3({props:o}),n[31](i),i.$on("confirm",n[32]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(i,r,a),s=!0},p(r,a){const u={};a[0]&264&&(u.beforeHide=r[27]),a[0]&7828|a[1]&256&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[28](null),q(e,r),r&&k(t),n[31](null),q(i,r)}}}const os="fields",ml="api_rules";function Tr(n){return JSON.stringify(n)}function Y3(n,e,t){let i,s,l,o,r,a;bt(n,ci,H=>t(34,r=H)),bt(n,qi,H=>t(4,a=H));const u=on();let f,c,d=null,h=new fn,g=!1,v=!1,b=os,y=Tr(h);function C(H){t(9,b=H)}function S(H){return M(H),t(8,v=!0),C(os),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}async function M(H){hi({}),typeof H<"u"?(d=H,t(2,h=H==null?void 0:H.clone())):(d=null,t(2,h=new fn)),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await ii(),t(17,y=Tr(h))}function D(){if(h.isNew)return E();c==null||c.show(h)}function E(){if(g)return;t(7,g=!0);const H=O();let me;h.isNew?me=we.collections.create(H):me=we.collections.update(h.id,H),me.then(x=>{t(8,v=!1),$(),cn(h.isNew?"Successfully created collection.":"Successfully updated collection."),m$(x),h.isNew&&dn(ci,r=x,r),u("save",x)}).catch(x=>{we.errorResponseHandler(x)}).finally(()=>{t(7,g=!1)})}function O(){const H=h.export();H.schema=H.schema.slice(0);for(let me=H.schema.length-1;me>=0;me--)H.schema[me].toDelete&&H.schema.splice(me,1);return H}function L(){!(d!=null&&d.id)||pi(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>we.collections.delete(d==null?void 0:d.id).then(()=>{$(),cn(`Successfully deleted collection "${d==null?void 0:d.name}".`),u("delete",d),g$(d)}).catch(H=>{we.errorResponseHandler(H)}))}const I=()=>$(),N=()=>D(),B=()=>L(),U=H=>{t(2,h.name=W.slugify(H.target.value),h),H.target.value=h.name},ee=()=>{o&&D()},K=()=>C(os),se=()=>C(ml);function Y(H){h=H,t(2,h)}function te(H){h=H,t(2,h)}const J=()=>l&&v?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,v=!1),$()}),!1):!0;function _e(H){pe[H?"unshift":"push"](()=>{f=H,t(5,f)})}function be(H){st.call(this,n,H)}function X(H){st.call(this,n,H)}function ae(H){pe[H?"unshift":"push"](()=>{c=H,t(6,c)})}const ve=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&16&&t(12,i=typeof W.getNestedVal(a,"schema.message",null)=="string"?W.getNestedVal(a,"schema.message"):"Has errors"),n.$$.dirty[0]&4&&t(11,s=!h.isNew&&h.system),n.$$.dirty[0]&131076&&t(3,l=y!=Tr(h)),n.$$.dirty[0]&12&&t(10,o=h.isNew||l)},[C,$,h,l,a,f,c,g,v,b,o,s,i,D,E,L,S,y,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve]}class Ja extends Ee{constructor(e){super(),Oe(this,e,Y3,W3,De,{changeTab:0,show:16,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[16]}get hide(){return this.$$.ctx[1]}}function cd(n,e,t){const i=n.slice();return i[13]=e[t],i}function dd(n){let e,t=n[1].length&&pd();return{c(){t&&t.c(),e=Ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1].length?t||(t=pd(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function pd(n){let e;return{c(){e=_("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function K3(n){let e;return{c(){e=_("i"),p(e,"class","ri-folder-2-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function J3(n){let e;return{c(){e=_("i"),p(e,"class","ri-folder-open-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function hd(n,e){let t,i,s,l=e[13].name+"",o,r,a,u;function f(g,v){var b;return((b=g[5])==null?void 0:b.id)===g[13].id?J3:K3}let c=f(e),d=c(e);function h(){return e[10](e[13])}return{key:n,first:null,c(){var g;t=_("div"),d.c(),i=T(),s=_("span"),o=F(l),r=T(),p(s,"class","txt"),p(t,"tabindex","0"),p(t,"class","sidebar-list-item"),ie(t,"active",((g=e[5])==null?void 0:g.id)===e[13].id),this.first=t},m(g,v){w(g,t,v),d.m(t,null),m(t,i),m(t,s),m(s,o),m(t,r),a||(u=G(t,"click",h),a=!0)},p(g,v){var b;e=g,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i))),v&8&&l!==(l=e[13].name+"")&&ue(o,l),v&40&&ie(t,"active",((b=e[5])==null?void 0:b.id)===e[13].id)},d(g){g&&k(t),d.d(),a=!1,u()}}}function Z3(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,g,v,b,y,C,S,$,M,D=n[3];const E=I=>I[13].id;for(let I=0;I',o=T(),r=_("input"),a=T(),u=_("hr"),f=T(),c=_("div");for(let I=0;I + New collection`,y=T(),V(C.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ie(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),ie(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),p(b,"type","button"),p(b,"class","btn btn-block btn-outline"),p(v,"class","sidebar-footer"),p(e,"class","page-sidebar collection-sidebar")},m(I,N){w(I,e,N),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Te(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let B=0;Bt(5,o=b)),bt(n,Ds,b=>t(7,r=b));let a,u="";function f(b){dn(ci,o=b,o)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const h=b=>f(b),g=()=>a==null?void 0:a.show();function v(b){pe[b?"unshift":"push"](()=>{a=b,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=u.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=u!==""),n.$$.dirty&131&&t(3,l=r.filter(b=>b.name!="profiles"&&(b.id==u||b.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[u,i,a,l,s,o,f,r,c,d,h,g,v]}class X3 extends Ee{constructor(e){super(),Oe(this,e,G3,Z3,De,{})}}function Q3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve,H,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,t=T(),i=_("ul"),s=_("li"),s.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,l=T(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=F(` - is one of: - `),u=_("br"),f=T(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",g=T(),v=_("span"),v.textContent="Equal",b=T(),y=_("li"),C=_("code"),C.textContent="!=",S=T(),$=_("span"),$.textContent="NOT equal",M=T(),D=_("li"),E=_("code"),E.textContent=">",O=T(),L=_("span"),L.textContent="Greater than",I=T(),N=_("li"),B=_("code"),B.textContent=">=",U=T(),ee=_("span"),ee.textContent="Greater than or equal",K=T(),se=_("li"),Y=_("code"),Y.textContent="<",te=T(),J=_("span"),J.textContent="Less than or equal",ge=T(),_e=_("li"),X=_("code"),X.textContent="<=",re=T(),ve=_("span"),ve.textContent="Less than or equal",H=T(),pe=_("li"),x=_("code"),x.textContent="~",Q=T(),$e=_("span"),$e.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard - match)`,je=T(),Be=_("li"),Z=_("code"),Z.textContent="!~",me=T(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for - wildcard match)`,we=T(),Ze=_("p"),Ze.innerHTML=`To group and combine several expressions you could use brackets - (...), && (AND) and || (OR) tokens.`,p(r,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p(C,"class","filter-op svelte-1w7s5nw"),p($,"class","txt-hint"),p(E,"class","filter-op svelte-1w7s5nw"),p(L,"class","txt-hint"),p(B,"class","filter-op svelte-1w7s5nw"),p(ee,"class","txt-hint"),p(Y,"class","filter-op svelte-1w7s5nw"),p(J,"class","txt-hint"),p(X,"class","filter-op svelte-1w7s5nw"),p(ve,"class","txt-hint"),p(x,"class","filter-op svelte-1w7s5nw"),p($e,"class","txt-hint"),p(Z,"class","filter-op svelte-1w7s5nw"),p(ce,"class","txt-hint")},m(tt,We){w(tt,e,We),w(tt,t,We),w(tt,i,We),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(c,d),m(d,h),m(d,g),m(d,v),m(c,b),m(c,y),m(y,C),m(y,S),m(y,$),m(c,M),m(c,D),m(D,E),m(D,O),m(D,L),m(c,I),m(c,N),m(N,B),m(N,U),m(N,ee),m(c,K),m(c,se),m(se,Y),m(se,te),m(se,J),m(c,ge),m(c,_e),m(_e,X),m(_e,re),m(_e,ve),m(c,H),m(c,pe),m(pe,x),m(pe,Q),m(pe,$e),m(c,je),m(c,Be),m(Be,Z),m(Be,me),m(Be,ce),w(tt,we,We),w(tt,Ze,We)},p:oe,i:oe,o:oe,d(tt){tt&&k(e),tt&&k(t),tt&&k(i),tt&&k(we),tt&&k(Ze)}}}class x3 extends Ee{constructor(e){super(),Oe(this,e,null,Q3,De,{})}}function md(n,e,t){const i=n.slice();return i[5]=e[t],i}function gd(n,e,t){const i=n.slice();return i[5]=e[t],i}function _d(n,e){let t,i,s=e[5].title+"",l,o,r,a;function u(){return e[4](e[5])}return{key:n,first:null,c(){t=_("button"),i=_("div"),l=F(s),o=T(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ie(t,"active",e[0]===e[5].language),this.first=t},m(f,c){w(f,t,c),m(t,i),m(i,l),m(t,o),r||(a=G(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&ue(l,s),c&3&&ie(t,"active",e[0]===e[5].language)},d(f){f&&k(t),r=!1,a()}}}function bd(n,e){let t,i,s,l;return i=new _n({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item svelte-1maocj6"),ie(t,"active",e[0]===e[5].language),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&2&&(a.language=e[5].language),r&2&&(a.content=e[5].content),i.$set(a),r&3&&ie(t,"active",e[0]===e[5].language)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function eC(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f=n[1];const c=g=>g[5].language;for(let g=0;gg[5].language;for(let g=0;gt(0,o=a.language);return n.$$set=a=>{"js"in a&&t(2,s=a.js),"dart"in a&&t(3,l=a.dart)},n.$$.update=()=>{n.$$.dirty&1&&o&&localStorage.setItem(vd,o),n.$$.dirty&12&&t(1,i=[{title:"JavaScript",language:"javascript",content:s},{title:"Dart",language:"dart",content:l}])},[o,i,s,l,r]}class Ls extends Ee{constructor(e){super(),Oe(this,e,tC,eC,De,{js:2,dart:3})}}function yd(n,e,t){const i=n.slice();return i[6]=e[t],i}function kd(n,e,t){const i=n.slice();return i[6]=e[t],i}function wd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $d(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("div"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Sd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function nC(n){var gi,Tl,ds,Dl;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,ge,_e,X,re,ve,H,pe,x,Q,$e,je,Be,Z,me,ce,we,Ze,tt,We,it,Ce,ze,Xe,st,dt,be,Fe,nt,ct,yt,at,Ot,$t,jt,Nt,Je,Se,Ue,et,ut,Pt,It,Lt,lt,R,z,ne,ae=[],Le=new Map,le,ke,Te=[],fe=new Map,he,Ne=n[1]&&wd();E=new Ls({props:{js:` + `),u=_("br"),f=T(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",g=T(),v=_("span"),v.textContent="Equal",b=T(),y=_("li"),C=_("code"),C.textContent="!=",S=T(),$=_("span"),$.textContent="NOT equal",M=T(),D=_("li"),E=_("code"),E.textContent=">",O=T(),L=_("span"),L.textContent="Greater than",I=T(),N=_("li"),B=_("code"),B.textContent=">=",U=T(),ee=_("span"),ee.textContent="Greater than or equal",K=T(),se=_("li"),Y=_("code"),Y.textContent="<",te=T(),J=_("span"),J.textContent="Less than or equal",_e=T(),be=_("li"),X=_("code"),X.textContent="<=",ae=T(),ve=_("span"),ve.textContent="Less than or equal",H=T(),me=_("li"),x=_("code"),x.textContent="~",Q=T(),Se=_("span"),Se.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard + match)`,je=T(),Ue=_("li"),Z=_("code"),Z.textContent="!~",ge=T(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for + wildcard match)`,$e=T(),Ze=_("p"),Ze.innerHTML=`To group and combine several expressions you could use brackets + (...), && (AND) and || (OR) tokens.`,p(r,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p(C,"class","filter-op svelte-1w7s5nw"),p($,"class","txt-hint"),p(E,"class","filter-op svelte-1w7s5nw"),p(L,"class","txt-hint"),p(B,"class","filter-op svelte-1w7s5nw"),p(ee,"class","txt-hint"),p(Y,"class","filter-op svelte-1w7s5nw"),p(J,"class","txt-hint"),p(X,"class","filter-op svelte-1w7s5nw"),p(ve,"class","txt-hint"),p(x,"class","filter-op svelte-1w7s5nw"),p(Se,"class","txt-hint"),p(Z,"class","filter-op svelte-1w7s5nw"),p(ce,"class","txt-hint")},m(et,We){w(et,e,We),w(et,t,We),w(et,i,We),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(c,d),m(d,h),m(d,g),m(d,v),m(c,b),m(c,y),m(y,C),m(y,S),m(y,$),m(c,M),m(c,D),m(D,E),m(D,O),m(D,L),m(c,I),m(c,N),m(N,B),m(N,U),m(N,ee),m(c,K),m(c,se),m(se,Y),m(se,te),m(se,J),m(c,_e),m(c,be),m(be,X),m(be,ae),m(be,ve),m(c,H),m(c,me),m(me,x),m(me,Q),m(me,Se),m(c,je),m(c,Ue),m(Ue,Z),m(Ue,ge),m(Ue,ce),w(et,$e,We),w(et,Ze,We)},p:oe,i:oe,o:oe,d(et){et&&k(e),et&&k(t),et&&k(i),et&&k($e),et&&k(Ze)}}}class x3 extends Ee{constructor(e){super(),Oe(this,e,null,Q3,De,{})}}function md(n,e,t){const i=n.slice();return i[5]=e[t],i}function gd(n,e,t){const i=n.slice();return i[5]=e[t],i}function _d(n,e){let t,i,s=e[5].title+"",l,o,r,a;function u(){return e[4](e[5])}return{key:n,first:null,c(){t=_("button"),i=_("div"),l=F(s),o=T(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ie(t,"active",e[0]===e[5].language),this.first=t},m(f,c){w(f,t,c),m(t,i),m(i,l),m(t,o),r||(a=G(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&ue(l,s),c&3&&ie(t,"active",e[0]===e[5].language)},d(f){f&&k(t),r=!1,a()}}}function bd(n,e){let t,i,s,l;return i=new _n({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item svelte-1maocj6"),ie(t,"active",e[0]===e[5].language),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&2&&(a.language=e[5].language),r&2&&(a.content=e[5].content),i.$set(a),r&3&&ie(t,"active",e[0]===e[5].language)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function eC(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f=n[1];const c=g=>g[5].language;for(let g=0;gg[5].language;for(let g=0;gt(0,o=a.language);return n.$$set=a=>{"js"in a&&t(2,s=a.js),"dart"in a&&t(3,l=a.dart)},n.$$.update=()=>{n.$$.dirty&1&&o&&localStorage.setItem(vd,o),n.$$.dirty&12&&t(1,i=[{title:"JavaScript",language:"javascript",content:s},{title:"Dart",language:"dart",content:l}])},[o,i,s,l,r]}class Ls extends Ee{constructor(e){super(),Oe(this,e,tC,eC,De,{js:2,dart:3})}}function yd(n,e,t){const i=n.slice();return i[6]=e[t],i}function kd(n,e,t){const i=n.slice();return i[6]=e[t],i}function wd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $d(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("div"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Sd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function nC(n){var gi,Tl,ds,Dl;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve,H,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze,et,We,tt,Me,ze,Xe,nt,ut,ye,Ne,ct,Dt,dt,lt,Lt,mt,Nt,Ot,Je,Ce,Be,ot,rt,Ht,Ct,ft,xt,R,z,ne,re=[],Ae=new Map,le,de,ke=[],fe=new Map,he,Ie=n[1]&&wd();E=new Ls({props:{js:` import PocketBase from 'pocketbase'; const client = new PocketBase('${n[3]}'); @@ -129,24 +129,24 @@ ?sort=-created,id `}}),ze=new _n({props:{content:` ?filter=(id='abc' && created>'2022-01-01') - `}}),st=new x3({}),$t=new _n({props:{content:` + `}}),nt=new x3({}),mt=new _n({props:{content:` ?expand=rel1,rel2.subrel21.subrel22 - `}});let ht=n[4];const rn=qe=>qe[6].code;for(let qe=0;qeqe[6].code;for(let qe=0;qeParam + `}});let ht=n[4];const rn=qe=>qe[6].code;for(let qe=0;qeqe[6].code;for(let qe=0;qeParam Type Description`,U=T(),ee=_("tbody"),K=_("tr"),K.innerHTML=`page Number The page (aka. offset) of the paginated list (default to 1).`,se=T(),Y=_("tr"),Y.innerHTML=`perPage Number - Specify the max returned records per page (default to 30).`,te=T(),J=_("tr"),ge=_("td"),ge.textContent="sort",_e=T(),X=_("td"),X.innerHTML='String',re=T(),ve=_("td"),H=F("Specify the records order attribute(s). "),pe=_("br"),x=F(` - Add `),Q=_("code"),Q.textContent="-",$e=F(" / "),je=_("code"),je.textContent="+",Be=F(` (default) in front of the attribute for DESC / ASC order. + Specify the max returned records per page (default to 30).`,te=T(),J=_("tr"),_e=_("td"),_e.textContent="sort",be=T(),X=_("td"),X.innerHTML='String',ae=T(),ve=_("td"),H=F("Specify the records order attribute(s). "),me=_("br"),x=F(` + Add `),Q=_("code"),Q.textContent="-",Se=F(" / "),je=_("code"),je.textContent="+",Ue=F(` (default) in front of the attribute for DESC / ASC order. Ex.: - `),V(Z.$$.fragment),me=T(),ce=_("tr"),we=_("td"),we.textContent="filter",Ze=T(),tt=_("td"),tt.innerHTML='String',We=T(),it=_("td"),Ce=F(`Filter the returned records. Ex.: - `),V(ze.$$.fragment),Xe=T(),V(st.$$.fragment),dt=T(),be=_("tr"),Fe=_("td"),Fe.textContent="expand",nt=T(),ct=_("td"),ct.innerHTML='String',yt=T(),at=_("td"),Ot=F(`Auto expand record relations. Ex.: - `),V($t.$$.fragment),jt=F(` - Supports up to 6-levels depth nested relations expansion. `),Nt=_("br"),Je=F(` + `),V(Z.$$.fragment),ge=T(),ce=_("tr"),$e=_("td"),$e.textContent="filter",Ze=T(),et=_("td"),et.innerHTML='String',We=T(),tt=_("td"),Me=F(`Filter the returned records. Ex.: + `),V(ze.$$.fragment),Xe=T(),V(nt.$$.fragment),ut=T(),ye=_("tr"),Ne=_("td"),Ne.textContent="expand",ct=T(),Dt=_("td"),Dt.innerHTML='String',dt=T(),lt=_("td"),Lt=F(`Auto expand record relations. Ex.: + `),V(mt.$$.fragment),Nt=F(` + Supports up to 6-levels depth nested relations expansion. `),Ot=_("br"),Je=F(` The expanded relations will be appended to each individual record under the - `),Se=_("code"),Se.textContent="@expand",Ue=F(" property (eg. "),et=_("code"),et.textContent='"@expand": {"rel1": {...}, ...}',ut=F(`). Only the - relations that the user has permissions to `),Pt=_("strong"),Pt.textContent="view",It=F(" will be expanded."),Lt=T(),lt=_("div"),lt.textContent="Responses",R=T(),z=_("div"),ne=_("div");for(let qe=0;qet(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.listRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[W.dummyCollectionRecord(l),W.dummyCollectionRecord(l)]},null,2)}),r.push({code:400,body:` + `),E.$set(Gt),xe&20&&(ht=qe[4],re=yt(re,xe,rn,1,qe,ht,Ae,ne,Mn,$d,null,kd)),xe&20&&(jt=qe[4],Pe(),ke=yt(ke,xe,Ti,1,qe,jt,fe,de,Zt,Sd,null,yd),Le())},i(qe){if(!he){A(E.$$.fragment,qe),A(Z.$$.fragment,qe),A(ze.$$.fragment,qe),A(nt.$$.fragment,qe),A(mt.$$.fragment,qe);for(let xe=0;xet(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.listRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[W.dummyCollectionRecord(l),W.dummyCollectionRecord(l)]},null,2)}),r.push({code:400,body:` { "code": 400, "message": "Something went wrong while processing your request. Invalid filter.", @@ -197,14 +197,14 @@ "message": "The requested resource wasn't found.", "data": {} } - `}))},t(3,s=W.getApiExampleUrl(ye.baseUrl)),[l,i,o,s,r,a]}class sC extends Ee{constructor(e){super(),Oe(this,e,iC,nC,De,{collection:0})}}function Cd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Md(n,e,t){const i=n.slice();return i[6]=e[t],i}function Td(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Dd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Od(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function lC(n){var Nt,Je;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,ge,_e,X,re,ve,H,pe,x,Q,$e,je,Be,Z,me,ce,we,Ze,tt,We,it,Ce,ze,Xe=[],st=new Map,dt,be,Fe=[],nt=new Map,ct,yt=n[1]&&Td();O=new Ls({props:{js:` + `}))},t(3,s=W.getApiExampleUrl(we.baseUrl)),[l,i,o,s,r,a]}class sC extends Ee{constructor(e){super(),Oe(this,e,iC,nC,De,{collection:0})}}function Cd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Md(n,e,t){const i=n.slice();return i[6]=e[t],i}function Td(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Dd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Od(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function lC(n){var Ot,Je;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve,H,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze,et,We,tt,Me,ze,Xe=[],nt=new Map,ut,ye,Ne=[],ct=new Map,Dt,dt=n[1]&&Td();O=new Ls({props:{js:` import PocketBase from 'pocketbase'; const client = new PocketBase('${n[3]}'); ... - const record = await client.records.getOne('${(Nt=n[0])==null?void 0:Nt.name}', 'RECORD_ID', { + const record = await client.records.getOne('${(Ot=n[0])==null?void 0:Ot.name}', 'RECORD_ID', { expand: 'some_relation' }); `,dart:` @@ -219,39 +219,39 @@ }); `}}),x=new _n({props:{content:` ?expand=rel1,rel2.subrel21.subrel22 - `}});let at=n[4];const Ot=Se=>Se[6].code;for(let Se=0;SeSe[6].code;for(let Se=0;Se<$t.length;Se+=1){let Ue=Cd(n,$t,Se),et=jt(Ue);nt.set(et,Fe[Se]=Od(et,Ue))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=T(),yt&&yt.c(),h=T(),g=_("div"),v=_("p"),b=F("Fetch a single "),y=_("strong"),S=F(C),$=F(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",E=T(),V(O.$$.fragment),L=T(),I=_("div"),I.textContent="Path Parameters",N=T(),B=_("table"),B.innerHTML=`Param + `}});let lt=n[4];const Lt=Ce=>Ce[6].code;for(let Ce=0;CeCe[6].code;for(let Ce=0;CeParam Type Description id String ID of the record to view.`,U=T(),ee=_("div"),ee.textContent="Query parameters",K=T(),se=_("table"),Y=_("thead"),Y.innerHTML=`Param Type - Description`,te=T(),J=_("tbody"),ge=_("tr"),_e=_("td"),_e.textContent="expand",X=T(),re=_("td"),re.innerHTML='String',ve=T(),H=_("td"),pe=F(`Auto expand record relations. Ex.: + Description`,te=T(),J=_("tbody"),_e=_("tr"),be=_("td"),be.textContent="expand",X=T(),ae=_("td"),ae.innerHTML='String',ve=T(),H=_("td"),me=F(`Auto expand record relations. Ex.: `),V(x.$$.fragment),Q=F(` - Supports up to 6-levels depth nested relations expansion. `),$e=_("br"),je=F(` + Supports up to 6-levels depth nested relations expansion. `),Se=_("br"),je=F(` The expanded relations will be appended to the record under the - `),Be=_("code"),Be.textContent="@expand",Z=F(" property (eg. "),me=_("code"),me.textContent='"@expand": {"rel1": {...}, ...}',ce=F(`). Only the - relations that the user has permissions to `),we=_("strong"),we.textContent="view",Ze=F(" will be expanded."),tt=T(),We=_("div"),We.textContent="Responses",it=T(),Ce=_("div"),ze=_("div");for(let Se=0;Set(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.viewRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)}),i&&r.push({code:403,body:` + `),O.$set(ot),Be&20&&(lt=Ce[4],Xe=yt(Xe,Be,Lt,1,Ce,lt,nt,ze,Mn,Dd,null,Md)),Be&20&&(mt=Ce[4],Pe(),Ne=yt(Ne,Be,Nt,1,Ce,mt,ct,ye,Zt,Od,null,Cd),Le())},i(Ce){if(!Dt){A(O.$$.fragment,Ce),A(x.$$.fragment,Ce);for(let Be=0;Bet(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.viewRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)}),i&&r.push({code:403,body:` { "code": 403, "message": "Only admins can access this action.", @@ -263,8 +263,8 @@ "message": "The requested resource wasn't found.", "data": {} } - `}))},t(3,s=W.getApiExampleUrl(ye.baseUrl)),[l,i,o,s,r,a]}class rC extends Ee{constructor(e){super(),Oe(this,e,oC,lC,De,{collection:0})}}function Ed(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[6]=e[t],i}function Pd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Ld(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function aC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function uC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function cC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function dC(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(` - Set to `),s=_("code"),s.textContent="null",l=F(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function pC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function hC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function mC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function gC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function _C(n){let e;return{c(){e=F("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Id(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=W.getFieldValueType(e[11])+"",h,g,v,b;function y(E,O){return E[11].required?uC:aC}let C=y(e),S=C(e);function $(E,O){if(E[11].type==="text")return _C;if(E[11].type==="number")return gC;if(E[11].type==="json")return mC;if(E[11].type==="email")return hC;if(E[11].type==="url")return pC;if(E[11].type==="file")return dC;if(E[11].type==="relation")return cC;if(E[11].type==="user")return fC}let M=$(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=T(),o=_("span"),a=F(r),u=T(),f=_("td"),c=_("span"),h=F(d),g=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(E,O){w(E,t,O),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(E,O){e=E,C!==(C=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),O&1&&r!==(r=e[11].name+"")&&ue(a,r),O&1&&d!==(d=W.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(E){E&&k(t),S.d(),D&&D.d()}}}function Fd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Nd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ie(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function bC(n){var ne,ae,Le;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,ge,_e=[],X=new Map,re,ve,H,pe,x,Q,$e,je,Be,Z,me,ce,we,Ze,tt,We,it,Ce,ze,Xe,st,dt,be,Fe,nt,ct,yt,at,Ot,$t=[],jt=new Map,Nt,Je,Se=[],Ue=new Map,et,ut=n[4]&&Ld();N=new Ls({props:{js:` + `}))},t(3,s=W.getApiExampleUrl(we.baseUrl)),[l,i,o,s,r,a]}class rC extends Ee{constructor(e){super(),Oe(this,e,oC,lC,De,{collection:0})}}function Ed(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[6]=e[t],i}function Pd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Ld(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function aC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function uC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function cC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function dC(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(` + Set to `),s=_("code"),s.textContent="null",l=F(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function pC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function hC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function mC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function gC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function _C(n){let e;return{c(){e=F("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Id(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=W.getFieldValueType(e[11])+"",h,g,v,b;function y(E,O){return E[11].required?uC:aC}let C=y(e),S=C(e);function $(E,O){if(E[11].type==="text")return _C;if(E[11].type==="number")return gC;if(E[11].type==="json")return mC;if(E[11].type==="email")return hC;if(E[11].type==="url")return pC;if(E[11].type==="file")return dC;if(E[11].type==="relation")return cC;if(E[11].type==="user")return fC}let M=$(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=T(),o=_("span"),a=F(r),u=T(),f=_("td"),c=_("span"),h=F(d),g=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(E,O){w(E,t,O),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(E,O){e=E,C!==(C=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),O&1&&r!==(r=e[11].name+"")&&ue(a,r),O&1&&d!==(d=W.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(E){E&&k(t),S.d(),D&&D.d()}}}function Fd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Nd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ie(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function bC(n){var ne,re,Ae;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be=[],X=new Map,ae,ve,H,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze,et,We,tt,Me,ze,Xe,nt,ut,ye,Ne,ct,Dt,dt,lt,Lt,mt=[],Nt=new Map,Ot,Je,Ce=[],Be=new Map,ot,rt=n[4]&&Ld();N=new Ls({props:{js:` import PocketBase from 'pocketbase'; const client = new PocketBase('${n[3]}'); @@ -283,10 +283,10 @@ final body = { ... }; - final record = await client.records.create('${(ae=n[0])==null?void 0:ae.name}', body: body); - `}});let Pt=(Le=n[0])==null?void 0:Le.schema;const It=le=>le[11].name;for(let le=0;lele[11].name;for(let le=0;lele[6].code;for(let le=0;lele[6].code;for(let le=0;leapplication/json or + `}});let ft=n[2];const xt=le=>le[6].code;for(let le=0;lele[6].code;for(let le=0;leapplication/json or multipart/form-data.`,D=T(),E=_("p"),E.innerHTML="File upload is supported only via multipart/form-data.",O=T(),L=_("div"),L.textContent="Client SDKs example",I=T(),V(N.$$.fragment),B=T(),U=_("div"),U.textContent="Body Parameters",ee=T(),K=_("table"),se=_("thead"),se.innerHTML=`Param Type Description`,Y=T(),te=_("tbody"),J=_("tr"),J.innerHTML=`
    Optional @@ -294,14 +294,14 @@ String 15 characters string to store as record ID.
    - If not set, it will be auto generated.`,ge=T();for(let le=0;le<_e.length;le+=1)_e[le].c();re=T(),ve=_("div"),ve.textContent="Query parameters",H=T(),pe=_("table"),x=_("thead"),x.innerHTML=`Param + If not set, it will be auto generated.`,_e=T();for(let le=0;leParam Type - Description`,Q=T(),$e=_("tbody"),je=_("tr"),Be=_("td"),Be.textContent="expand",Z=T(),me=_("td"),me.innerHTML='String',ce=T(),we=_("td"),Ze=F(`Auto expand relations when returning the created record. Ex.: - `),V(tt.$$.fragment),We=F(` - Supports up to 6-levels depth nested relations expansion. `),it=_("br"),Ce=F(` + Description`,Q=T(),Se=_("tbody"),je=_("tr"),Ue=_("td"),Ue.textContent="expand",Z=T(),ge=_("td"),ge.innerHTML='String',ce=T(),$e=_("td"),Ze=F(`Auto expand relations when returning the created record. Ex.: + `),V(et.$$.fragment),We=F(` + Supports up to 6-levels depth nested relations expansion. `),tt=_("br"),Me=F(` The expanded relations will be appended to the record under the - `),ze=_("code"),ze.textContent="@expand",Xe=F(" property (eg. "),st=_("code"),st.textContent='"@expand": {"rel1": {...}, ...}',dt=F(`). Only the - relations that the user has permissions to `),be=_("strong"),be.textContent="view",Fe=F(" will be expanded."),nt=T(),ct=_("div"),ct.textContent="Responses",yt=T(),at=_("div"),Ot=_("div");for(let le=0;le<$t.length;le+=1)$t[le].c();Nt=T(),Je=_("div");for(let le=0;le{ ... }; final record = await client.records.create('${(he=le[0])==null?void 0:he.name}', body: body); - `),N.$set(Te),ke&1&&(Pt=(Ne=le[0])==null?void 0:Ne.schema,_e=vt(_e,ke,It,1,le,Pt,X,te,Mn,Id,null,Pd)),ke&6&&(Lt=le[2],$t=vt($t,ke,lt,1,le,Lt,jt,Ot,Mn,Fd,null,Ad)),ke&6&&(R=le[2],Ae(),Se=vt(Se,ke,z,1,le,R,Ue,Je,Gt,Nd,null,Ed),Pe())},i(le){if(!et){A(N.$$.fragment,le),A(tt.$$.fragment,le);for(let ke=0;ket(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.createRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)},{code:400,body:` + `),N.$set(ke),de&1&&(Ht=(Ie=le[0])==null?void 0:Ie.schema,be=yt(be,de,Ct,1,le,Ht,X,te,Mn,Id,null,Pd)),de&6&&(ft=le[2],mt=yt(mt,de,xt,1,le,ft,Nt,Lt,Mn,Fd,null,Ad)),de&6&&(R=le[2],Pe(),Ce=yt(Ce,de,z,1,le,R,Be,Je,Zt,Nd,null,Ed),Le())},i(le){if(!ot){A(N.$$.fragment,le),A(et.$$.fragment,le);for(let de=0;det(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.createRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)},{code:400,body:` { "code": 400, "message": "Failed to create record.", @@ -338,8 +338,8 @@ "message": "You are not allowed to perform this request.", "data": {} } - `}])},t(3,s=W.getApiExampleUrl(ye.baseUrl)),[l,o,r,s,i,a]}class yC extends Ee{constructor(e){super(),Oe(this,e,vC,bC,De,{collection:0})}}function Rd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Hd(n,e,t){const i=n.slice();return i[6]=e[t],i}function jd(n,e,t){const i=n.slice();return i[11]=e[t],i}function qd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function wC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $C(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function SC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function CC(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(` - Set to `),s=_("code"),s.textContent="null",l=F(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function MC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function TC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function DC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function OC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function EC(n){let e;return{c(){e=F("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Vd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=W.getFieldValueType(e[11])+"",h,g,v,b;function y(E,O){return E[11].required?wC:kC}let C=y(e),S=C(e);function $(E,O){if(E[11].type==="text")return EC;if(E[11].type==="number")return OC;if(E[11].type==="json")return DC;if(E[11].type==="email")return TC;if(E[11].type==="url")return MC;if(E[11].type==="file")return CC;if(E[11].type==="relation")return SC;if(E[11].type==="user")return $C}let M=$(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=T(),o=_("span"),a=F(r),u=T(),f=_("td"),c=_("span"),h=F(d),g=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(E,O){w(E,t,O),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(E,O){e=E,C!==(C=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),O&1&&r!==(r=e[11].name+"")&&ue(a,r),O&1&&d!==(d=W.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(E){E&&k(t),S.d(),D&&D.d()}}}function zd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Bd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ie(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function AC(n){var le,ke,Te;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,ge,_e,X,re,ve=[],H=new Map,pe,x,Q,$e,je,Be,Z,me,ce,we,Ze,tt,We,it,Ce,ze,Xe,st,dt,be,Fe,nt,ct,yt,at,Ot,$t,jt,Nt,Je=[],Se=new Map,Ue,et,ut=[],Pt=new Map,It,Lt=n[4]&&qd();B=new Ls({props:{js:` + `}])},t(3,s=W.getApiExampleUrl(we.baseUrl)),[l,o,r,s,i,a]}class yC extends Ee{constructor(e){super(),Oe(this,e,vC,bC,De,{collection:0})}}function Rd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Hd(n,e,t){const i=n.slice();return i[6]=e[t],i}function jd(n,e,t){const i=n.slice();return i[11]=e[t],i}function qd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function wC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $C(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function SC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function CC(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(` + Set to `),s=_("code"),s.textContent="null",l=F(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function MC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function TC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function DC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function OC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function EC(n){let e;return{c(){e=F("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Vd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=W.getFieldValueType(e[11])+"",h,g,v,b;function y(E,O){return E[11].required?wC:kC}let C=y(e),S=C(e);function $(E,O){if(E[11].type==="text")return EC;if(E[11].type==="number")return OC;if(E[11].type==="json")return DC;if(E[11].type==="email")return TC;if(E[11].type==="url")return MC;if(E[11].type==="file")return CC;if(E[11].type==="relation")return SC;if(E[11].type==="user")return $C}let M=$(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=T(),o=_("span"),a=F(r),u=T(),f=_("td"),c=_("span"),h=F(d),g=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(E,O){w(E,t,O),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(E,O){e=E,C!==(C=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),O&1&&r!==(r=e[11].name+"")&&ue(a,r),O&1&&d!==(d=W.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(E){E&&k(t),S.d(),D&&D.d()}}}function zd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Bd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ie(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function AC(n){var le,de,ke;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve=[],H=new Map,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze,et,We,tt,Me,ze,Xe,nt,ut,ye,Ne,ct,Dt,dt,lt,Lt,mt,Nt,Ot,Je=[],Ce=new Map,Be,ot,rt=[],Ht=new Map,Ct,ft=n[4]&&qd();B=new Ls({props:{js:` import PocketBase from 'pocketbase'; const client = new PocketBase('${n[3]}'); @@ -358,25 +358,25 @@ final body = { ... }; - final record = await client.records.update('${(ke=n[0])==null?void 0:ke.name}', 'RECORD_ID', body: body); - `}});let lt=(Te=n[0])==null?void 0:Te.schema;const R=fe=>fe[11].name;for(let fe=0;fefe[11].name;for(let fe=0;fefe[6].code;for(let fe=0;fefe[6].code;for(let fe=0;feapplication/json or + `}});let z=n[2];const ne=fe=>fe[6].code;for(let fe=0;fefe[6].code;for(let fe=0;feapplication/json or multipart/form-data.`,E=T(),O=_("p"),O.innerHTML="File upload is supported only via multipart/form-data.",L=T(),I=_("div"),I.textContent="Client SDKs example",N=T(),V(B.$$.fragment),U=T(),ee=_("div"),ee.textContent="Path parameters",K=T(),se=_("table"),se.innerHTML=`Param Type Description id String - ID of the record to update.`,Y=T(),te=_("div"),te.textContent="Body Parameters",J=T(),ge=_("table"),_e=_("thead"),_e.innerHTML=`Param + ID of the record to update.`,Y=T(),te=_("div"),te.textContent="Body Parameters",J=T(),_e=_("table"),be=_("thead"),be.innerHTML=`Param Type - Description`,X=T(),re=_("tbody");for(let fe=0;feParam + Description`,X=T(),ae=_("tbody");for(let fe=0;feParam Type - Description`,Be=T(),Z=_("tbody"),me=_("tr"),ce=_("td"),ce.textContent="expand",we=T(),Ze=_("td"),Ze.innerHTML='String',tt=T(),We=_("td"),it=F(`Auto expand relations when returning the updated record. Ex.: - `),V(Ce.$$.fragment),ze=F(` - Supports up to 6-levels depth nested relations expansion. `),Xe=_("br"),st=F(` + Description`,Ue=T(),Z=_("tbody"),ge=_("tr"),ce=_("td"),ce.textContent="expand",$e=T(),Ze=_("td"),Ze.innerHTML='String',et=T(),We=_("td"),tt=F(`Auto expand relations when returning the updated record. Ex.: + `),V(Me.$$.fragment),ze=F(` + Supports up to 6-levels depth nested relations expansion. `),Xe=_("br"),nt=F(` The expanded relations will be appended to the record under the - `),dt=_("code"),dt.textContent="@expand",be=F(" property (eg. "),Fe=_("code"),Fe.textContent='"@expand": {"rel1": {...}, ...}',nt=F(`). Only the - relations that the user has permissions to `),ct=_("strong"),ct.textContent="view",yt=F(" will be expanded."),at=T(),Ot=_("div"),Ot.textContent="Responses",$t=T(),jt=_("div"),Nt=_("div");for(let fe=0;fe{ ... }; final record = await client.records.update('${(rn=fe[0])==null?void 0:rn.name}', 'RECORD_ID', body: body); - `),B.$set(Ne),he&1&&(lt=(qt=fe[0])==null?void 0:qt.schema,ve=vt(ve,he,R,1,fe,lt,H,re,Mn,Vd,null,jd)),he&6&&(z=fe[2],Je=vt(Je,he,ne,1,fe,z,Se,Nt,Mn,zd,null,Hd)),he&6&&(ae=fe[2],Ae(),ut=vt(ut,he,Le,1,fe,ae,Pt,et,Gt,Bd,null,Rd),Pe())},i(fe){if(!It){A(B.$$.fragment,fe),A(Ce.$$.fragment,fe);for(let he=0;het(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.updateRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)},{code:400,body:` + `),B.$set(Ie),he&1&&(xt=(jt=fe[0])==null?void 0:jt.schema,ve=yt(ve,he,R,1,fe,xt,H,ae,Mn,Vd,null,jd)),he&6&&(z=fe[2],Je=yt(Je,he,ne,1,fe,z,Ce,Ot,Mn,zd,null,Hd)),he&6&&(re=fe[2],Pe(),rt=yt(rt,he,Ae,1,fe,re,Ht,ot,Zt,Bd,null,Rd),Le())},i(fe){if(!Ct){A(B.$$.fragment,fe),A(Me.$$.fragment,fe);for(let he=0;het(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.updateRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)},{code:400,body:` { "code": 400, "message": "Failed to update record.", @@ -419,7 +419,7 @@ "message": "The requested resource wasn't found.", "data": {} } - `}])},t(3,s=W.getApiExampleUrl(ye.baseUrl)),[l,o,r,s,i,a]}class LC extends Ee{constructor(e){super(),Oe(this,e,PC,AC,De,{collection:0})}}function Ud(n,e,t){const i=n.slice();return i[6]=e[t],i}function Wd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Yd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Kd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Jd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function IC(n){var je,Be;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te=[],J=new Map,ge,_e,X=[],re=new Map,ve,H=n[1]&&Yd();O=new Ls({props:{js:` + `}])},t(3,s=W.getApiExampleUrl(we.baseUrl)),[l,o,r,s,i,a]}class LC extends Ee{constructor(e){super(),Oe(this,e,PC,AC,De,{collection:0})}}function Ud(n,e,t){const i=n.slice();return i[6]=e[t],i}function Wd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Yd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Kd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Jd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function IC(n){var je,Ue;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te=[],J=new Map,_e,be,X=[],ae=new Map,ve,H=n[1]&&Yd();O=new Ls({props:{js:` import PocketBase from 'pocketbase'; const client = new PocketBase('${n[3]}'); @@ -434,21 +434,21 @@ ... - await client.records.delete('${(Be=n[0])==null?void 0:Be.name}', 'RECORD_ID'); - `}});let pe=n[4];const x=Z=>Z[6].code;for(let Z=0;ZZ[6].code;for(let Z=0;ZParam + await client.records.delete('${(Ue=n[0])==null?void 0:Ue.name}', 'RECORD_ID'); + `}});let me=n[4];const x=Z=>Z[6].code;for(let Z=0;ZZ[6].code;for(let Z=0;ZParam Type Description id String - ID of the record to delete.`,U=T(),ee=_("div"),ee.textContent="Responses",K=T(),se=_("div"),Y=_("div");for(let Z=0;ZID of the record to delete.`,U=T(),ee=_("div"),ee.textContent="Responses",K=T(),se=_("div"),Y=_("div");for(let Z=0;Zt(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.deleteRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:204,body:` + `),O.$set(ce),ge&20&&(me=Z[4],te=yt(te,ge,x,1,Z,me,J,Y,Mn,Kd,null,Wd)),ge&20&&(Q=Z[4],Pe(),X=yt(X,ge,Se,1,Z,Q,ae,be,Zt,Jd,null,Ud),Le())},i(Z){if(!ve){A(O.$$.fragment,Z);for(let ge=0;get(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.deleteRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:204,body:` null `}),r.push({code:400,body:` { @@ -476,7 +476,7 @@ "message": "The requested resource wasn't found.", "data": {} } - `}))},t(3,s=W.getApiExampleUrl(ye.baseUrl)),[l,i,o,s,r,a]}class NC extends Ee{constructor(e){super(),Oe(this,e,FC,IC,De,{collection:0})}}function RC(n){var h,g,v,b,y,C,S,$;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new Ls({props:{js:` + `}))},t(3,s=W.getApiExampleUrl(we.baseUrl)),[l,i,o,s,r,a]}class NC extends Ee{constructor(e){super(),Oe(this,e,FC,IC,De,{collection:0})}}function RC(n){var h,g,v,b,y,C,S,$;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new Ls({props:{js:` import PocketBase from 'pocketbase'; const client = new PocketBase('${n[1]}'); @@ -583,22 +583,22 @@ client.realtime.unsubscribe() // remove all subscriptions client.realtime.unsubscribe('${(K=M[0])==null?void 0:K.name}') // remove only the collection subscription client.realtime.unsubscribe('${(se=M[0])==null?void 0:se.name}/RECORD_ID') // remove only the record subscription - `),r.$set(E);const O={};D&1&&(O.content=JSON.stringify({action:"create",record:W.dummyCollectionRecord(M[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(O)},i(M){d||(A(r.$$.fragment,M),A(c.$$.fragment,M),d=!0)},o(M){P(r.$$.fragment,M),P(c.$$.fragment,M),d=!1},d(M){M&&k(e),M&&k(t),M&&k(i),M&&k(s),M&&k(l),M&&k(o),q(r,M),M&&k(a),M&&k(u),M&&k(f),q(c,M)}}}function HC(n,e,t){let i,{collection:s=new fn}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=W.getApiExampleUrl(ye.baseUrl)),[s,i]}class jC extends Ee{constructor(e){super(),Oe(this,e,HC,RC,De,{collection:0})}}function Zd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Gd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Xd(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&V(t.$$.fragment),i=T(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&j(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Ae();const f=t;P(f.$$.fragment,1,0,()=>{q(f,1)}),Pe()}l?(t=new l(o(r)),V(t.$$.fragment),A(t.$$.fragment,1),j(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&P(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&q(t)}}}function Qd(n,e){let t,i,s,l=e[4]===e[14].id&&Xd(e);return{key:n,first:null,c(){t=Ke(),l&&l.c(),i=Ke(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&A(l,1)):(l=Xd(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Ae(),P(l,1,1,()=>{l=null}),Pe())},i(o){s||(A(l),s=!0)},o(o){P(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function qC(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;rd[14].id;for(let d=0;dClose',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[8]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function BC(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[zC],header:[VC],default:[qC]},$$scope:{ctx:n}};return e=new mi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),q(e,s)}}}function UC(n,e,t){const i=[{id:"list",label:"List",component:sC},{id:"view",label:"View",component:rC},{id:"create",label:"Create",component:yC},{id:"update",label:"Update",component:LC},{id:"delete",label:"Delete",component:NC},{id:"realtime",label:"Realtime",component:jC}];let s,l=new fn,o=i[0].id;function r(y){return t(3,l=y),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(y){t(4,o=y)}function f(y,C){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),u(C))}const c=()=>a(),d=y=>u(y.id),h=(y,C)=>f(C,y.id);function g(y){de[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){rt.call(this,n,y)}function b(y){rt.call(this,n,y)}return[a,u,s,l,o,i,f,r,c,d,h,g,v,b]}class WC extends Ee{constructor(e){super(),Oe(this,e,UC,BC,De,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function YC(n){let e,t,i,s=[n[3]],l={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight+2,o)+"px",r))},0)}function f(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)){h.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Jn(()=>(u(),()=>clearTimeout(a)));function c(h){de[h?"unshift":"push"](()=>{r=h,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=ft(ft({},e),ni(h)),t(3,s=Ut(e,i)),"value"in h&&t(0,l=h.value),"maxHeight"in h&&t(4,o=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class JC extends Ee{constructor(e){super(),Oe(this,e,KC,YC,De,{value:0,maxHeight:4})}}function ZC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(v){n[2](v)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new JC({props:g}),de.push(()=>Ie(f,"value",h)),{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),j(f,v,b),d=!0},p(v,b){(!d||b&2&&i!==(i=W.getFieldTypeIcon(v[1].type)))&&p(t,"class",i),(!d||b&2)&&o!==(o=v[1].name+"")&&ue(r,o),(!d||b&8&&a!==(a=v[3]))&&p(e,"for",a);const y={};b&8&&(y.id=v[3]),b&2&&(y.required=v[1].required),!c&&b&1&&(c=!0,y.value=v[0],He(()=>c=!1)),f.$set(y)},i(v){d||(A(f.$$.fragment,v),d=!0)},o(v){P(f.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(u),q(f,v)}}}function GC(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[ZC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function XC(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class QC extends Ee{constructor(e){super(),Oe(this,e,XC,GC,De,{field:1,value:0})}}function xC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,v,b;return{c(){var y,C;e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("input"),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",h=(y=n[1].options)==null?void 0:y.min),p(f,"max",g=(C=n[1].options)==null?void 0:C.max),p(f,"step","any")},m(y,C){w(y,e,C),m(e,t),m(e,s),m(e,l),m(l,r),w(y,u,C),w(y,f,C),Me(f,n[0]),v||(b=G(f,"input",n[2]),v=!0)},p(y,C){var S,$;C&2&&i!==(i=W.getFieldTypeIcon(y[1].type))&&p(t,"class",i),C&2&&o!==(o=y[1].name+"")&&ue(r,o),C&8&&a!==(a=y[3])&&p(e,"for",a),C&8&&c!==(c=y[3])&&p(f,"id",c),C&2&&d!==(d=y[1].required)&&(f.required=d),C&2&&h!==(h=(S=y[1].options)==null?void 0:S.min)&&p(f,"min",h),C&2&&g!==(g=($=y[1].options)==null?void 0:$.max)&&p(f,"max",g),C&1&&At(f.value)!==y[0]&&Me(f,y[0])},d(y){y&&k(e),y&&k(u),y&&k(f),v=!1,b()}}}function e4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[xC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function t4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(){s=At(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class n4 extends Ee{constructor(e){super(),Oe(this,e,t4,e4,De,{field:1,value:0})}}function i4(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=_("input"),i=T(),s=_("label"),o=F(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,s,c),m(s,o),a||(u=G(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&ue(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&k(e),f&&k(i),f&&k(s),a=!1,u()}}}function s4(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[i4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function l4(n,e,t){let{field:i=new Dn}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class o4 extends Ee{constructor(e){super(),Oe(this,e,l4,s4,De,{field:1,value:0})}}function r4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("input"),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Me(f,n[0]),h||(g=G(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=W.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&f.value!==v[0]&&Me(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,g()}}}function a4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[r4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function u4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class f4 extends Ee{constructor(e){super(),Oe(this,e,u4,a4,De,{field:1,value:0})}}function c4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("input"),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Me(f,n[0]),h||(g=G(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=W.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Me(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,g()}}}function d4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[c4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function p4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class h4 extends Ee{constructor(e){super(),Oe(this,e,p4,d4,De,{field:1,value:0})}}function m4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h;function g(b){n[2](b)}let v={id:n[3],options:W.defaultFlatpickrOptions(),value:n[0]};return n[0]!==void 0&&(v.formattedValue=n[0]),c=new Ka({props:v}),de.push(()=>Ie(c,"formattedValue",g)),{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),a=F(" (UTC)"),f=T(),V(c.$$.fragment),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",u=n[3])},m(b,y){w(b,e,y),m(e,t),m(e,s),m(e,l),m(l,r),m(l,a),w(b,f,y),j(c,b,y),h=!0},p(b,y){(!h||y&2&&i!==(i=W.getFieldTypeIcon(b[1].type)))&&p(t,"class",i),(!h||y&2)&&o!==(o=b[1].name+"")&&ue(r,o),(!h||y&8&&u!==(u=b[3]))&&p(e,"for",u);const C={};y&8&&(C.id=b[3]),y&1&&(C.value=b[0]),!d&&y&1&&(d=!0,C.formattedValue=b[0],He(()=>d=!1)),c.$set(C)},i(b){h||(A(c.$$.fragment,b),h=!0)},o(b){P(c.$$.fragment,b),h=!1},d(b){b&&k(e),b&&k(f),q(c,b)}}}function g4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[m4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function _4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class b4 extends Ee{constructor(e){super(),Oe(this,e,_4,g4,De,{field:1,value:0})}}function ep(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=F("Select up to "),s=F(i),l=F(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&ue(s,i)},d(o){o&&k(e)}}}function v4(n){var C,S,$;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function v(M){n[3](M)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],items:(C=n[1].options)==null?void 0:C.values,searchable:((S=n[1].options)==null?void 0:S.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new H_({props:b}),de.push(()=>Ie(f,"selected",v));let y=(($=n[1].options)==null?void 0:$.maxSelect)>1&&ep(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),d=T(),y&&y.c(),h=Ke(),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(M,D){w(M,e,D),m(e,t),m(e,s),m(e,l),m(l,r),w(M,u,D),j(f,M,D),w(M,d,D),y&&y.m(M,D),w(M,h,D),g=!0},p(M,D){var O,L,I;(!g||D&2&&i!==(i=W.getFieldTypeIcon(M[1].type)))&&p(t,"class",i),(!g||D&2)&&o!==(o=M[1].name+"")&&ue(r,o),(!g||D&16&&a!==(a=M[4]))&&p(e,"for",a);const E={};D&16&&(E.id=M[4]),D&6&&(E.toggle=!M[1].required||M[2]),D&4&&(E.multiple=M[2]),D&2&&(E.items=(O=M[1].options)==null?void 0:O.values),D&2&&(E.searchable=((L=M[1].options)==null?void 0:L.values)>5),!c&&D&1&&(c=!0,E.selected=M[0],He(()=>c=!1)),f.$set(E),((I=M[1].options)==null?void 0:I.maxSelect)>1?y?y.p(M,D):(y=ep(M),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(M){g||(A(f.$$.fragment,M),g=!0)},o(M){P(f.$$.fragment,M),g=!1},d(M){M&&k(e),M&&k(u),q(f,M),M&&k(d),y&&y.d(M),M&&k(h)}}}function y4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[v4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function k4(n,e,t){let i,{field:s=new Dn}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class w4 extends Ee{constructor(e){super(),Oe(this,e,k4,y4,De,{field:1,value:0})}}function $4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("textarea"),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"class","txt-mono")},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Me(f,n[0]),h||(g=G(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=W.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Me(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,g()}}}function S4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[$4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function C4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&typeof s!="string"&&s!==null&&t(0,s=JSON.stringify(s,null,2))},[s,i,l]}class M4 extends Ee{constructor(e){super(),Oe(this,e,C4,S4,De,{field:1,value:0})}}function T4(n){let e,t;return{c(){e=_("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function D4(n){let e,t,i;return{c(){e=_("img"),xn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!xn(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&k(e)}}}function O4(n){let e;function t(l,o){return l[2]?D4:T4}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function E4(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),W.hasImageExtension(s==null?void 0:s.name)&&W.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{console.warn("Unable to generate thumb: ",r)})}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class A4 extends Ee{constructor(e){super(),Oe(this,e,E4,O4,De,{file:0,size:1})}}function P4(n){let e,t,i;return{c(){e=_("img"),xn(e.src,t=n[2])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&4&&!xn(e.src,t=s[2])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&k(e)}}}function L4(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=G(e,"click",Kt(n[0])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function I4(n){let e,t=n[2].substring(n[2].lastIndexOf("/")+1)+"",i,s,l,o,r,a,u;return{c(){e=_("a"),i=F(t),s=T(),l=_("div"),o=T(),r=_("button"),r.textContent="Close",p(e,"href",n[2]),p(e,"title","Download"),p(e,"class","link-hint txt-ellipsis"),p(l,"class","flex-fill"),p(r,"type","button"),p(r,"class","btn btn-secondary")},m(f,c){w(f,e,c),m(e,i),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=G(r,"click",n[0]),a=!0)},p(f,c){c&4&&t!==(t=f[2].substring(f[2].lastIndexOf("/")+1)+"")&&ue(i,t),c&4&&p(e,"href",f[2])},d(f){f&&k(e),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,u()}}}function F4(n){let e,t,i={class:"image-preview",btnClose:!1,popup:!0,$$slots:{footer:[I4],header:[L4],default:[P4]},$$scope:{ctx:n}};return e=new mi({props:i}),n[4](e),e.$on("show",n[5]),e.$on("hide",n[6]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&132&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[4](null),q(e,s)}}}function N4(n,e,t){let i,s="";function l(f){f!==""&&(t(2,s=f),i==null||i.show())}function o(){return i==null?void 0:i.hide()}function r(f){de[f?"unshift":"push"](()=>{i=f,t(1,i)})}function a(f){rt.call(this,n,f)}function u(f){rt.call(this,n,f)}return[o,i,s,l,r,a,u]}class R4 extends Ee{constructor(e){super(),Oe(this,e,N4,F4,De,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function H4(n){let e;return{c(){e=_("i"),p(e,"class","ri-file-line")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function j4(n){let e,t,i,s,l;return{c(){e=_("img"),xn(e.src,t=n[4])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),ie(e,"link-fade",n[2])},m(o,r){w(o,e,r),s||(l=[G(e,"click",n[7]),G(e,"error",n[5])],s=!0)},p(o,r){r&16&&!xn(e.src,t=o[4])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i),r&4&&ie(e,"link-fade",o[2])},d(o){o&&k(e),s=!1,Ge(l)}}}function q4(n){let e,t,i;function s(a,u){return a[2]?j4:H4}let l=s(n),o=l(n),r={};return t=new R4({props:r}),n[8](t),{c(){o.c(),e=T(),V(t.$$.fragment)},m(a,u){o.m(a,u),w(a,e,u),j(t,a,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)));const f={};t.$set(f)},i(a){i||(A(t.$$.fragment,a),i=!0)},o(a){P(t.$$.fragment,a),i=!1},d(a){o.d(a),a&&k(e),n[8](null),q(t,a)}}}function V4(n,e,t){let i,{record:s}=e,{filename:l}=e,o,r="",a="";function u(){t(4,r="")}const f=d=>{d.stopPropagation(),o==null||o.show(a)};function c(d){de[d?"unshift":"push"](()=>{o=d,t(3,o)})}return n.$$set=d=>{"record"in d&&t(6,s=d.record),"filename"in d&&t(0,l=d.filename)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=W.hasImageExtension(l)),n.$$.dirty&69&&i&&t(1,a=ye.records.getFileUrl(s,`${l}`)),n.$$.dirty&2&&t(4,r=a?a+"?thumb=100x100":"")},[l,a,i,o,r,u,s,f,c]}class z_ extends Ee{constructor(e){super(),Oe(this,e,V4,q4,De,{record:6,filename:0})}}function tp(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function np(n,e,t){const i=n.slice();return i[25]=e[t],i[24]=t,i}function z4(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-secondary btn-sm btn-circle btn-remove txt-hint")},m(l,o){w(l,e,o),t||(i=[Ye(wt.call(null,e,"Remove file")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function B4(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=_("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(l,o){w(l,e,o),t||(i=G(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function ip(n,e){let t,i,s,l,o,r=e[25]+"",a,u,f,c,d,h,g;s=new z_({props:{record:e[2],filename:e[25]}});function v(C,S){return S&18&&(c=null),c==null&&(c=!!C[1].includes(C[24])),c?B4:z4}let b=v(e,-1),y=b(e);return{key:n,first:null,c(){t=_("div"),i=_("figure"),V(s.$$.fragment),l=T(),o=_("a"),a=F(r),f=T(),y.c(),p(i,"class","thumb"),ie(i,"fade",e[1].includes(e[24])),p(o,"href",u=ye.records.getFileUrl(e[2],e[25])),p(o,"class","filename link-hint"),p(o,"target","_blank"),p(o,"rel","noopener"),ie(o,"txt-strikethrough",e[1].includes(e[24])),p(t,"class","list-item"),this.first=t},m(C,S){w(C,t,S),m(t,i),j(s,i,null),m(t,l),m(t,o),m(o,a),m(t,f),y.m(t,null),d=!0,h||(g=Ye(wt.call(null,o,{position:"right",text:"Download"})),h=!0)},p(C,S){e=C;const $={};S&4&&($.record=e[2]),S&16&&($.filename=e[25]),s.$set($),S&18&&ie(i,"fade",e[1].includes(e[24])),(!d||S&16)&&r!==(r=e[25]+"")&&ue(a,r),(!d||S&20&&u!==(u=ye.records.getFileUrl(e[2],e[25])))&&p(o,"href",u),S&18&&ie(o,"txt-strikethrough",e[1].includes(e[24])),b===(b=v(e,S))&&y?y.p(e,S):(y.d(1),y=b(e),y&&(y.c(),y.m(t,null)))},i(C){d||(A(s.$$.fragment,C),d=!0)},o(C){P(s.$$.fragment,C),d=!1},d(C){C&&k(t),q(s),y.d(),h=!1,g()}}}function sp(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,h,g,v,b;i=new A4({props:{file:n[22]}});function y(){return n[15](n[24])}return{c(){e=_("div"),t=_("figure"),V(i.$$.fragment),s=T(),l=_("div"),o=_("small"),o.textContent="New",r=T(),a=_("span"),f=F(u),d=T(),h=_("button"),h.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename"),p(l,"title",c=n[22].name),p(h,"type","button"),p(h,"class","btn btn-secondary btn-sm btn-circle btn-remove"),p(e,"class","list-item")},m(C,S){w(C,e,S),m(e,t),j(i,t,null),m(e,s),m(e,l),m(l,o),m(l,r),m(l,a),m(a,f),m(e,d),m(e,h),g=!0,v||(b=[Ye(wt.call(null,h,"Remove file")),G(h,"click",y)],v=!0)},p(C,S){n=C;const $={};S&1&&($.file=n[22]),i.$set($),(!g||S&1)&&u!==(u=n[22].name+"")&&ue(f,u),(!g||S&1&&c!==(c=n[22].name))&&p(l,"title",c)},i(C){g||(A(i.$$.fragment,C),g=!0)},o(C){P(i.$$.fragment,C),g=!1},d(C){C&&k(e),q(i),v=!1,Ge(b)}}}function lp(n){let e,t,i,s,l,o;return{c(){e=_("div"),t=_("input"),i=T(),s=_("button"),s.innerHTML=` - Upload new file`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),m(e,t),n[16](t),m(e,i),m(e,s),l||(o=[G(t,"change",n[17]),G(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,Ge(o)}}}function U4(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,g,v,b=n[4];const y=D=>D[25];for(let D=0;DP(S[D],1,1,()=>{S[D]=null});let M=!n[8]&&lp(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("div");for(let D=0;D({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function Y4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Dn}=e,c,d;function h(O){W.removeByValue(u,O),t(1,u)}function g(O){W.pushUnique(u,O),t(1,u)}function v(O){W.isEmpty(a[O])||a.splice(O,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=O=>h(O),C=O=>g(O),S=O=>v(O);function $(O){de[O?"unshift":"push"](()=>{c=O,t(6,c)})}const M=()=>{for(let O of c.files)a.push(O);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function E(O){de[O?"unshift":"push"](()=>{d=O,t(7,d)})}return n.$$set=O=>{"record"in O&&t(2,o=O.record),"value"in O&&t(12,r=O.value),"uploadedFiles"in O&&t(0,a=O.uploadedFiles),"deletedFileIndexes"in O&&t(1,u=O.deletedFileIndexes),"field"in O&&t(3,f=O.field)},n.$$.update=()=>{var O,L;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=W.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=W.toArray(u))),n.$$.dirty&8&&t(5,i=((O=f.options)==null?void 0:O.maxSelect)>1),n.$$.dirty&4128&&W.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=W.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((L=f.options)==null?void 0:L.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,h,g,v,r,y,C,S,$,M,D,E]}class K4 extends Ee{constructor(e){super(),Oe(this,e,Y4,W4,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function op(n){let e,t;return{c(){e=_("small"),t=F(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1])},d(i){i&&k(e)}}}function J4(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f,c=n[1]!==""&&n[1]!==n[0].id&&op(n);return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=F(o),a=T(),c&&c.c(),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(s,"class","content svelte-1gjwqyd")},m(d,h){w(d,e,h),w(d,i,h),w(d,s,h),m(s,l),m(l,r),m(s,a),c&&c.m(s,null),u||(f=Ye(t=wt.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[h]){t&&Kn(t.update)&&h&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),h&1&&o!==(o=d[0].id+"")&&ue(r,o),d[1]!==""&&d[1]!==d[0].id?c?c.p(d,h):(c=op(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i:oe,o:oe,d(d){d&&k(e),d&&k(i),d&&k(s),c&&c.d(),u=!1,f()}}}function Z4(n,e,t){let i;const s=["id","created","updated","@collectionId","@collectionName"];let{item:l={}}=e;function o(r){r=r||{};const a=["name","title","label","key","email","heading","content",...Object.keys(r)];for(const u of a)if(typeof r[u]=="string"&&!W.isEmpty(r[u])&&!s.includes(u))return u+": "+r[u];return""}return n.$$set=r=>{"item"in r&&t(0,l=r.item)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=o(l))},[l,i]}class G4 extends Ee{constructor(e){super(),Oe(this,e,Z4,J4,De,{item:0})}}function rp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Load more',p(e,"type","button"),p(e,"class","btn btn-block btn-sm"),ie(e,"btn-loading",n[6]),ie(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[14])),t=!0)},p(s,l){l&64&&ie(e,"btn-loading",s[6]),l&64&&ie(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function X4(n){let e,t=n[7]&&rp(n);return{c(){t&&t.c(),e=Ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=rp(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function Q4(n){let e,t,i,s;const l=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:n[4]},{optionComponent:n[4]},{multiple:n[2]},{class:"records-select block-options"},n[10]];function o(u){n[15](u)}function r(u){n[16](u)}let a={$$slots:{afterOptions:[X4]},$$scope:{ctx:n}};for(let u=0;uIe(e,"keyOfSelected",o)),de.push(()=>Ie(e,"selected",r)),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){V(e.$$.fragment)},m(u,f){j(e,u,f),s=!0},p(u,[f]){const c=f&1340?pn(l,[f&264&&{selectPlaceholder:u[8]?"Loading...":u[3]},f&32&&{items:u[5]},f&32&&{searchable:u[5].length>5},l[3],f&16&&{labelComponent:u[4]},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&si(u[10])]):{};f&4194496&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],He(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],He(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){q(e,u)}}}function x4(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent","collectionId"];let o=Ut(e,l);const r="select_"+W.randomString(5);let{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{keyOfSelected:f=a?[]:void 0}=e,{selectPlaceholder:c="- Select -"}=e,{optionComponent:d=G4}=e,{collectionId:h}=e,g=[],v=1,b=0,y=!1,C=!1;S();async function S(){const I=W.toArray(f);if(!(!h||!I.length)){t(13,C=!0);try{const N=[];for(const B of I)N.push(`id="${B}"`);t(0,u=await ye.records.getFullList(h,200,{sort:"-created",filter:N.join("||"),$cancelKey:r+"loadSelected"})),t(5,g=W.filterDuplicatesByKey(g.concat(u)))}catch(N){ye.errorResponseHandler(N)}t(13,C=!1)}}async function $(I=!1){if(!!h){t(6,y=!0);try{const N=I?1:v+1,B=await ye.records.getList(h,N,200,{sort:"-created",$cancelKey:r+"loadList"});I&&t(5,g=[]),t(5,g=W.filterDuplicatesByKey(g.concat(B.items))),v=B.page,t(12,b=B.totalItems)}catch(N){ye.errorResponseHandler(N)}t(6,y=!1)}}const M=()=>$();function D(I){f=I,t(1,f)}function E(I){u=I,t(0,u)}function O(I){rt.call(this,n,I)}function L(I){rt.call(this,n,I)}return n.$$set=I=>{e=ft(ft({},e),ni(I)),t(10,o=Ut(e,l)),"multiple"in I&&t(2,a=I.multiple),"selected"in I&&t(0,u=I.selected),"keyOfSelected"in I&&t(1,f=I.keyOfSelected),"selectPlaceholder"in I&&t(3,c=I.selectPlaceholder),"optionComponent"in I&&t(4,d=I.optionComponent),"collectionId"in I&&t(11,h=I.collectionId)},n.$$.update=()=>{n.$$.dirty&2048&&h&&$(!0),n.$$.dirty&8256&&t(8,i=y||C),n.$$.dirty&4128&&t(7,s=b>g.length)},[u,f,a,c,d,g,y,s,i,$,o,h,b,C,M,D,E,O,L]}class eM extends Ee{constructor(e){super(),Oe(this,e,x4,Q4,De,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4,collectionId:11})}}function ap(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=F("Select up to "),s=F(i),l=F(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&ue(s,i)},d(o){o&&k(e)}}}function tM(n){var C,S;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function v($){n[3]($)}let b={toggle:!0,id:n[4],multiple:n[2],collectionId:(C=n[1].options)==null?void 0:C.collectionId};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new eM({props:b}),de.push(()=>Ie(f,"keyOfSelected",v));let y=((S=n[1].options)==null?void 0:S.maxSelect)>1&&ap(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),d=T(),y&&y.c(),h=Ke(),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m($,M){w($,e,M),m(e,t),m(e,s),m(e,l),m(l,r),w($,u,M),j(f,$,M),w($,d,M),y&&y.m($,M),w($,h,M),g=!0},p($,M){var E,O;(!g||M&2&&i!==(i=W.getFieldTypeIcon($[1].type)))&&p(t,"class",i),(!g||M&2)&&o!==(o=$[1].name+"")&&ue(r,o),(!g||M&16&&a!==(a=$[4]))&&p(e,"for",a);const D={};M&16&&(D.id=$[4]),M&4&&(D.multiple=$[2]),M&2&&(D.collectionId=(E=$[1].options)==null?void 0:E.collectionId),!c&&M&1&&(c=!0,D.keyOfSelected=$[0],He(()=>c=!1)),f.$set(D),((O=$[1].options)==null?void 0:O.maxSelect)>1?y?y.p($,M):(y=ap($),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i($){g||(A(f.$$.fragment,$),g=!0)},o($){P(f.$$.fragment,$),g=!1},d($){$&&k(e),$&&k(u),q(f,$),$&&k(d),y&&y.d($),$&&k(h)}}}function nM(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[tM,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function iM(n,e,t){let i,{field:s=new Dn}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(s.options.maxSelect-1))},[l,s,i,o]}class sM extends Ee{constructor(e){super(),Oe(this,e,iM,nM,De,{field:1,value:0})}}function lM(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f=n[0].email+"",c,d,h;return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=F(o),a=T(),u=_("small"),c=F(f),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(u,"class","block txt-hint txt-ellipsis"),p(s,"class","content")},m(g,v){w(g,e,v),w(g,i,v),w(g,s,v),m(s,l),m(l,r),m(s,a),m(s,u),m(u,c),d||(h=Ye(t=wt.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),d=!0)},p(g,[v]){t&&Kn(t.update)&&v&1&&t.update.call(null,{text:JSON.stringify(g[0],null,2),position:"left",class:"code"}),v&1&&o!==(o=g[0].id+"")&&ue(r,o),v&1&&f!==(f=g[0].email+"")&&ue(c,f)},i:oe,o:oe,d(g){g&&k(e),g&&k(i),g&&k(s),d=!1,h()}}}function oM(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class oa extends Ee{constructor(e){super(),Oe(this,e,oM,lM,De,{item:0})}}function up(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Load more',p(e,"type","button"),p(e,"class","btn btn-block btn-sm"),ie(e,"btn-loading",n[6]),ie(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[13])),t=!0)},p(s,l){l&64&&ie(e,"btn-loading",s[6]),l&64&&ie(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function rM(n){let e,t=n[7]&&up(n);return{c(){t&&t.c(),e=Ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=up(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function aM(n){let e,t,i,s;const l=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:oa},{optionComponent:n[4]},{multiple:n[2]},{class:"users-select block-options"},n[10]];function o(u){n[14](u)}function r(u){n[15](u)}let a={$$slots:{afterOptions:[rM]},$$scope:{ctx:n}};for(let u=0;uIe(e,"keyOfSelected",o)),de.push(()=>Ie(e,"selected",r)),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){V(e.$$.fragment)},m(u,f){j(e,u,f),s=!0},p(u,[f]){const c=f&1340?pn(l,[f&264&&{selectPlaceholder:u[8]?"Loading...":u[3]},f&32&&{items:u[5]},f&32&&{searchable:u[5].length>5},l[3],f&0&&{labelComponent:oa},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&si(u[10])]):{};f&2097344&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],He(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],He(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){q(e,u)}}}function uM(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent"];let o=Ut(e,l);const r="select_"+W.randomString(5);let{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{keyOfSelected:f=a?[]:void 0}=e,{selectPlaceholder:c="- Select -"}=e,{optionComponent:d=oa}=e,h=[],g=1,v=0,b=!1,y=!1;S(!0),C();async function C(){const L=W.toArray(f);if(!!L.length){t(12,y=!0);try{const I=[];for(const N of L)I.push(`id="${N}"`);t(0,u=await ye.users.getFullList(100,{sort:"-created",filter:I.join("||"),$cancelKey:r+"loadSelected"})),t(5,h=W.filterDuplicatesByKey(h.concat(u)))}catch(I){ye.errorResponseHandler(I)}t(12,y=!1)}}async function S(L=!1){t(6,b=!0);try{const I=L?1:g+1,N=await ye.users.getList(I,200,{sort:"-created",$cancelKey:r+"loadList"});L&&t(5,h=[]),t(5,h=W.filterDuplicatesByKey(h.concat(N.items))),g=N.page,t(11,v=N.totalItems)}catch(I){ye.errorResponseHandler(I)}t(6,b=!1)}const $=()=>S();function M(L){f=L,t(1,f)}function D(L){u=L,t(0,u)}function E(L){rt.call(this,n,L)}function O(L){rt.call(this,n,L)}return n.$$set=L=>{e=ft(ft({},e),ni(L)),t(10,o=Ut(e,l)),"multiple"in L&&t(2,a=L.multiple),"selected"in L&&t(0,u=L.selected),"keyOfSelected"in L&&t(1,f=L.keyOfSelected),"selectPlaceholder"in L&&t(3,c=L.selectPlaceholder),"optionComponent"in L&&t(4,d=L.optionComponent)},n.$$.update=()=>{n.$$.dirty&4160&&t(8,i=b||y),n.$$.dirty&2080&&t(7,s=v>h.length)},[u,f,a,c,d,h,b,s,i,S,o,v,y,$,M,D,E,O]}class fM extends Ee{constructor(e){super(),Oe(this,e,uM,aM,De,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4})}}function fp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=F("Select up to "),s=F(i),l=F(" users."),p(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&ue(s,i)},d(o){o&&k(e)}}}function cM(n){var C;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function v(S){n[4](S)}let b={toggle:!0,id:n[5],multiple:n[2],disabled:n[3]};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new fM({props:b}),de.push(()=>Ie(f,"keyOfSelected",v));let y=((C=n[1].options)==null?void 0:C.maxSelect)>1&&fp(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),d=T(),y&&y.c(),h=Ke(),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[5])},m(S,$){w(S,e,$),m(e,t),m(e,s),m(e,l),m(l,r),w(S,u,$),j(f,S,$),w(S,d,$),y&&y.m(S,$),w(S,h,$),g=!0},p(S,$){var D;(!g||$&2&&i!==(i=W.getFieldTypeIcon(S[1].type)))&&p(t,"class",i),(!g||$&2)&&o!==(o=S[1].name+"")&&ue(r,o),(!g||$&32&&a!==(a=S[5]))&&p(e,"for",a);const M={};$&32&&(M.id=S[5]),$&4&&(M.multiple=S[2]),$&8&&(M.disabled=S[3]),!c&&$&1&&(c=!0,M.keyOfSelected=S[0],He(()=>c=!1)),f.$set(M),((D=S[1].options)==null?void 0:D.maxSelect)>1?y?y.p(S,$):(y=fp(S),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(S){g||(A(f.$$.fragment,S),g=!0)},o(S){P(f.$$.fragment,S),g=!1},d(S){S&&k(e),S&&k(u),q(f,S),S&&k(d),y&&y.d(S),S&&k(h)}}}function dM(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":"")+" "+(n[3]?"disabled":""),name:n[1].name,$$slots:{default:[cM,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&10&&(l.class="form-field "+(i[1].required?"required":"")+" "+(i[3]?"disabled":"")),s&2&&(l.name=i[1].name),s&111&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function pM(n,e,t){let i,s,{field:l=new Dn}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(2,s),t(1,l)}return n.$$set=a=>{"field"in a&&t(1,l=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{var a;n.$$.dirty&2&&t(2,s=((a=l.options)==null?void 0:a.maxSelect)>1),n.$$.dirty&7&&s&&Array.isArray(o)&&o.length>l.options.maxSelect&&t(0,o=o.slice(l.options.maxSelect-1)),n.$$.dirty&3&&t(3,i=!W.isEmpty(o)&&l.system)},[o,l,s,i,r]}class hM extends Ee{constructor(e){super(),Oe(this,e,pM,dM,De,{field:1,value:0})}}function cp(n,e,t){const i=n.slice();return i[40]=e[t],i[41]=e,i[42]=t,i}function dp(n){let e,t;return e=new Re({props:{class:"form-field disabled",name:"id",$$slots:{default:[mM,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&4|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function mM(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="id",l=T(),o=_("span"),a=T(),u=_("input"),p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[43]),p(u,"type","text"),p(u,"id",f=n[43]),u.value=c=n[2].id,u.disabled=!0},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),w(d,a,h),w(d,u,h)},p(d,h){h[1]&4096&&r!==(r=d[43])&&p(e,"for",r),h[1]&4096&&f!==(f=d[43])&&p(u,"id",f),h[0]&4&&c!==(c=d[2].id)&&u.value!==c&&(u.value=c)},d(d){d&&k(e),d&&k(a),d&&k(u)}}}function pp(n){let e;return{c(){e=_("div"),e.innerHTML=`
    No custom fields to be set
    - `,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function gM(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new hM({props:l}),de.push(()=>Ie(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function _M(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new sM({props:l}),de.push(()=>Ie(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function bM(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new K4({props:u}),de.push(()=>Ie(e,"value",o)),de.push(()=>Ie(e,"uploadedFiles",r)),de.push(()=>Ie(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){j(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],He(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],He(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],He(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){q(e,f)}}}function vM(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new M4({props:l}),de.push(()=>Ie(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function yM(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new w4({props:l}),de.push(()=>Ie(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function kM(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new b4({props:l}),de.push(()=>Ie(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function wM(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new h4({props:l}),de.push(()=>Ie(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function $M(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new f4({props:l}),de.push(()=>Ie(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function SM(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new o4({props:l}),de.push(()=>Ie(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function CM(n){let e,t,i;function s(o){n[20](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new n4({props:l}),de.push(()=>Ie(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function MM(n){let e,t,i;function s(o){n[19](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new QC({props:l}),de.push(()=>Ie(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function hp(n,e){let t,i,s,l,o;const r=[MM,CM,SM,$M,wM,kM,yM,vM,bM,_M,gM],a=[];function u(f,c){return f[40].type==="text"?0:f[40].type==="number"?1:f[40].type==="bool"?2:f[40].type==="email"?3:f[40].type==="url"?4:f[40].type==="date"?5:f[40].type==="select"?6:f[40].type==="json"?7:f[40].type==="file"?8:f[40].type==="relation"?9:f[40].type==="user"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=Ke(),s&&s.c(),l=Ke(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(Ae(),P(a[d],1,1,()=>{a[d]=null}),Pe()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){P(s),o=!1},d(f){f&&k(t),~i&&a[i].d(f),f&&k(l)}}}function TM(n){var d;let e,t,i=[],s=new Map,l,o,r,a=!n[2].isNew&&dp(n),u=((d=n[0])==null?void 0:d.schema)||[];const f=h=>h[40].name;for(let h=0;h{a=null}),Pe()):a?(a.p(h,g),g[0]&4&&A(a,1)):(a=dp(h),a.c(),A(a,1),a.m(e,t)),g[0]&29&&(u=((v=h[0])==null?void 0:v.schema)||[],Ae(),i=vt(i,g,f,1,h,u,s,e,Gt,hp,null,cp),Pe(),!u.length&&c?c.p(h,g):u.length?c&&(c.d(1),c=null):(c=pp(),c.c(),c.m(e,null)))},i(h){if(!l){A(a);for(let g=0;g - Delete`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function OM(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[10]&&mp(n);return{c(){e=_("h4"),i=F(t),s=T(),o=F(l),r=F(" record"),a=T(),c&&c.c(),u=Ke()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ue(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&ue(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&A(c,1)):(c=mp(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Ae(),P(c,1,1,()=>{c=null}),Pe())},i(d){f||(A(c),f=!0)},o(d){P(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function EM(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=F(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],ie(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=G(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&ie(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function AM(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[EM],header:[OM],default:[TM]},$$scope:{ctx:n}};return e=new mi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[33](null),q(e,s)}}}function gp(n){return JSON.stringify(n)}function PM(n,e,t){let i,s,l,o;const r=on(),a="record_"+W.randomString(5);let{collection:u}=e,f,c=null,d=new fo,h=!1,g=!1,v={},b={},y="";function C(x){return $(x),t(8,g=!0),f==null?void 0:f.show()}function S(){return f==null?void 0:f.hide()}async function $(x){hi({}),c=x||{},t(2,d=x!=null&&x.clone?x.clone():new fo),t(3,v={}),t(4,b={}),await ii(),t(15,y=gp(d))}function M(){if(h||!l)return;t(7,h=!0);const x=E();let Q;d.isNew?Q=ye.records.create(u==null?void 0:u.id,x):Q=ye.records.update(u==null?void 0:u.id,d.id,x),Q.then(async $e=>{cn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),S(),r("save",$e)}).catch($e=>{ye.errorResponseHandler($e)}).finally(()=>{t(7,h=!1)})}function D(){!(c!=null&&c.id)||pi("Do you really want to delete the selected record?",()=>ye.records.delete(c["@collectionId"],c.id).then(()=>{S(),cn("Successfully deleted record."),r("delete",c)}).catch(x=>{ye.errorResponseHandler(x)}))}function E(){const x=(d==null?void 0:d.export())||{},Q=new FormData,$e={};for(const je of(u==null?void 0:u.schema)||[])$e[je.name]=je;for(const je in x)!$e[je]||(typeof x[je]>"u"&&(x[je]=null),W.addValueToFormData(Q,je,x[je]));for(const je in v){const Be=W.toArray(v[je]);for(const Z of Be)Q.append(je,Z)}for(const je in b){const Be=W.toArray(b[je]);for(const Z of Be)Q.append(je+"."+Z,"")}return Q}const O=()=>S(),L=()=>D();function I(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function N(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function B(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function U(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function ee(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function K(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function se(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function Y(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function te(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function J(x,Q){n.$$.not_equal(v[Q.name],x)&&(v[Q.name]=x,t(3,v))}function ge(x,Q){n.$$.not_equal(b[Q.name],x)&&(b[Q.name]=x,t(4,b))}function _e(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function X(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}const re=()=>s&&g?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,g=!1),S()}),!1):!0;function ve(x){de[x?"unshift":"push"](()=>{f=x,t(6,f)})}function H(x){rt.call(this,n,x)}function pe(x){rt.call(this,n,x)}return n.$$set=x=>{"collection"in x&&t(0,u=x.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=W.hasNonEmptyProps(v)||W.hasNonEmptyProps(b)),n.$$.dirty[0]&98308&&t(5,s=i||y!=gp(d)),n.$$.dirty[0]&36&&t(9,l=d.isNew||s),n.$$.dirty[0]&1&&t(10,o=(u==null?void 0:u.name)!=="profiles")},[u,S,d,v,b,s,f,h,g,l,o,a,M,D,C,y,i,O,L,I,N,B,U,ee,K,se,Y,te,J,ge,_e,X,re,ve,H,pe]}class B_ extends Ee{constructor(e){super(),Oe(this,e,PM,AM,De,{collection:0,show:14,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[1]}}function LM(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function IM(n){let e,t;return{c(){e=_("span"),t=F(n[1]),p(e,"class","label txt-base txt-mono"),p(e,"title",n[0])},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1]),s&1&&p(e,"title",i[0])},d(i){i&&k(e)}}}function FM(n){let e;function t(l,o){return l[0]?IM:LM}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function NM(n,e,t){let{id:i=""}=e,s=i;return n.$$set=l=>{"id"in l&&t(0,i=l.id)},n.$$.update=()=>{n.$$.dirty&1&&typeof i=="string"&&i.length>27&&t(1,s=i.substring(0,5)+"..."+i.substring(i.length-10))},[i,s]}class Qo extends Ee{constructor(e){super(),Oe(this,e,NM,FM,De,{id:0})}}function _p(n,e,t){const i=n.slice();return i[8]=e[t],i}function bp(n,e,t){const i=n.slice();return i[3]=e[t],i}function vp(n,e,t){const i=n.slice();return i[3]=e[t],i}function RM(n){let e,t=n[0][n[1].name]+"",i,s;return{c(){e=_("span"),i=F(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[0][n[1].name])},m(l,o){w(l,e,o),m(e,i)},p(l,o){o&3&&t!==(t=l[0][l[1].name]+"")&&ue(i,t),o&3&&s!==(s=l[0][l[1].name])&&p(e,"title",s)},i:oe,o:oe,d(l){l&&k(e)}}}function HM(n){let e,t,i=W.toArray(n[0][n[1].name]),s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){e=_("div");for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){e=_("div");for(let o=0;o{a[d]=null}),Pe(),s=a[i],s?s.p(f,c):(s=a[i]=r[i](f),s.c()),A(s,1),s.m(e,null)),(!o||c&2&&l!==(l="col-type-"+f[1].type+" col-field-"+f[1].name))&&p(e,"class",l)},i(f){o||(A(s),o=!0)},o(f){P(s),o=!1},d(f){f&&k(e),a[i].d()}}}function KM(n,e,t){let{record:i}=e,{field:s}=e;function l(o){rt.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record),"field"in o&&t(1,s=o.field)},[i,s,l]}class U_ extends Ee{constructor(e){super(),Oe(this,e,KM,YM,De,{record:0,field:1})}}function $p(n,e,t){const i=n.slice();return i[35]=e[t],i}function Sp(n,e,t){const i=n.slice();return i[38]=e[t],i}function Cp(n,e,t){const i=n.slice();return i[38]=e[t],i}function JM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function ZM(n){let e,t,i,s,l,o=n[38].name+"",r;return{c(){e=_("div"),t=_("i"),s=T(),l=_("span"),r=F(o),p(t,"class",i=W.getFieldTypeIcon(n[38].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(l,r)},p(a,u){u[0]&2048&&i!==(i=W.getFieldTypeIcon(a[38].type))&&p(t,"class",i),u[0]&2048&&o!==(o=a[38].name+"")&&ue(r,o)},d(a){a&&k(e)}}}function Mp(n,e){let t,i,s,l;function o(a){e[22](a)}let r={class:"col-type-"+e[38].type+" col-field-"+e[38].name,name:e[38].name,$$slots:{default:[ZM]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new sn({props:r}),de.push(()=>Ie(i,"sort",o)),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&2048&&(f.class="col-type-"+e[38].type+" col-field-"+e[38].name),u[0]&2048&&(f.name=e[38].name),u[0]&2048|u[1]&4096&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],He(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&k(t),q(i,a)}}}function GM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function XM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Tp(n){let e;function t(l,o){return l[8]?xM:QM}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function QM(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Dp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No records found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Dp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function xM(n){let e;return{c(){e=_("tr"),e.innerHTML=` - `},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Dp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[28]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Op(n,e){let t,i,s;return i=new U_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),q(i,l)}}}function Ep(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,C,S,$,M,D,E,O,L,I,N,B;function U(){return e[25](e[35])}h=new Qo({props:{id:e[35].id}});let ee=e[11];const K=te=>te[38].name;for(let te=0;te',L=T(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],p(u,"for",f="checkbox_"+e[35].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p(C,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(O,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(te,J){w(te,t,J),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),j(h,d,null),m(t,g);for(let ge=0;geReset',c=T(),d=_("div"),h=T(),g=_("button"),g.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ie(f,"btn-disabled",n[9]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-secondary btn-danger"),ie(g,"btn-loading",n[9]),ie(g,"btn-disabled",n[9]),p(e,"class","bulkbar")},m(S,$){w(S,e,$),m(e,t),m(t,i),m(t,s),m(s,l),m(t,o),m(t,a),m(e,u),m(e,f),m(e,c),m(e,d),m(e,h),m(e,g),b=!0,y||(C=[G(f,"click",n[30]),G(g,"click",n[31])],y=!0)},p(S,$){(!b||$[0]&64)&&ue(l,S[6]),(!b||$[0]&64)&&r!==(r=S[6]===1?"record":"records")&&ue(a,r),$[0]&512&&ie(f,"btn-disabled",S[9]),$[0]&512&&ie(g,"btn-loading",S[9]),$[0]&512&&ie(g,"btn-disabled",S[9])},i(S){b||(S&&Tt(()=>{v||(v=ot(e,Un,{duration:150,y:5},!0)),v.run(1)}),b=!0)},o(S){S&&(v||(v=ot(e,Un,{duration:150,y:5},!1)),v.run(0)),b=!1},d(S){S&&k(e),S&&v&&v.end(),y=!1,Ge(C)}}}function eT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,C,S,$,M,D,E,O,L,I,N=[],B=new Map,U,ee,K,se,Y,te,J;function ge(ce){n[21](ce)}let _e={class:"col-type-text col-field-id",name:"id",$$slots:{default:[JM]},$$scope:{ctx:n}};n[0]!==void 0&&(_e.sort=n[0]),d=new sn({props:_e}),de.push(()=>Ie(d,"sort",ge));let X=n[11];const re=ce=>ce[38].name;for(let ce=0;ceIe(C,"sort",ve));function pe(ce){n[24](ce)}let x={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[XM]},$$scope:{ctx:n}};n[0]!==void 0&&(x.sort=n[0]),M=new sn({props:x}),de.push(()=>Ie(M,"sort",pe));let Q=n[3];const $e=ce=>ce[35].id;for(let ce=0;ceh=!1)),d.$set(Ze),we[0]&2049&&(X=ce[11],Ae(),v=vt(v,we,re,1,ce,X,b,s,Gt,Mp,y,Cp),Pe());const tt={};we[1]&4096&&(tt.$$scope={dirty:we,ctx:ce}),!S&&we[0]&1&&(S=!0,tt.sort=ce[0],He(()=>S=!1)),C.$set(tt);const We={};we[1]&4096&&(We.$$scope={dirty:we,ctx:ce}),!D&&we[0]&1&&(D=!0,We.sort=ce[0],He(()=>D=!1)),M.$set(We),we[0]&76074&&(Q=ce[3],Ae(),N=vt(N,we,$e,1,ce,Q,B,I,Gt,Ep,null,$p),Pe(),!Q.length&&je?je.p(ce,we):Q.length?je&&(je.d(1),je=null):(je=Tp(ce),je.c(),je.m(I,null))),we[0]&256&&ie(t,"table-loading",ce[8]),ce[3].length?Be?Be.p(ce,we):(Be=Ap(ce),Be.c(),Be.m(ee.parentNode,ee)):Be&&(Be.d(1),Be=null),ce[3].length&&ce[12]?Z?Z.p(ce,we):(Z=Pp(ce),Z.c(),Z.m(K.parentNode,K)):Z&&(Z.d(1),Z=null),ce[6]?me?(me.p(ce,we),we[0]&64&&A(me,1)):(me=Lp(ce),me.c(),A(me,1),me.m(se.parentNode,se)):me&&(Ae(),P(me,1,1,()=>{me=null}),Pe())},i(ce){if(!Y){A(d.$$.fragment,ce);for(let we=0;we{t(8,v=!1),t(3,c=c.concat(re.items)),t(7,d=re.page),t(4,h=re.totalItems),r("load",c)}).catch(re=>{re!=null&&re.isAbort||(t(8,v=!1),console.warn(re),C(),ye.errorResponseHandler(re,!1))})}function C(){t(3,c=[]),t(7,d=1),t(4,h=0),t(5,g={})}function S(){o?$():M()}function $(){t(5,g={})}function M(){for(const X of c)t(5,g[X.id]=X,g);t(5,g)}function D(X){g[X.id]?delete g[X.id]:t(5,g[X.id]=X,g),t(5,g)}function E(){pi(`Do you really want to delete the selected ${l===1?"record":"records"}?`,O)}async function O(){if(b||!l)return;let X=[];for(const re of Object.keys(g))X.push(ye.records.delete(a==null?void 0:a.id,re));return t(9,b=!0),Promise.all(X).then(()=>{cn(`Successfully deleted the selected ${l===1?"record":"records"}.`),$()}).catch(re=>{ye.errorResponseHandler(re)}).finally(()=>(t(9,b=!1),y()))}function L(X){rt.call(this,n,X)}const I=()=>S();function N(X){u=X,t(0,u)}function B(X){u=X,t(0,u)}function U(X){u=X,t(0,u)}function ee(X){u=X,t(0,u)}const K=X=>D(X),se=X=>r("select",X),Y=(X,re)=>{re.code==="Enter"&&(re.preventDefault(),r("select",X))},te=()=>t(1,f=""),J=()=>y(d+1),ge=()=>$(),_e=()=>E();return n.$$set=X=>{"collection"in X&&t(18,a=X.collection),"sort"in X&&t(0,u=X.sort),"filter"in X&&t(1,f=X.filter)},n.$$.update=()=>{n.$$.dirty[0]&262147&&a&&a.id&&u!==-1&&f!==-1&&(C(),y(1)),n.$$.dirty[0]&24&&t(12,i=h>c.length),n.$$.dirty[0]&262144&&t(11,s=(a==null?void 0:a.schema)||[]),n.$$.dirty[0]&32&&t(6,l=Object.keys(g).length),n.$$.dirty[0]&72&&t(10,o=c.length&&l===c.length)},[u,f,y,c,h,g,l,d,v,b,o,s,i,r,S,$,D,E,a,L,I,N,B,U,ee,K,se,Y,te,J,ge,_e]}class nT extends Ee{constructor(e){super(),Oe(this,e,tT,eT,De,{collection:18,sort:0,filter:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}function iT(n){let e,t,i,s;return e=new X3({}),i=new On({props:{$$slots:{default:[oT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o&1073741951&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function sT(n){let e,t;return e=new On({props:{center:!0,$$slots:{default:[rT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&1073741832&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function lT(n){let e,t;return e=new On({props:{center:!0,$$slots:{default:[aT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&1073741824&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function oT(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I;d=new Uo({}),d.$on("refresh",n[13]),S=new Bo({props:{value:n[0],autocompleteCollection:n[2]}}),S.$on("submit",n[16]);function N(ee){n[18](ee)}function B(ee){n[19](ee)}let U={collection:n[2]};return n[0]!==void 0&&(U.filter=n[0]),n[1]!==void 0&&(U.sort=n[1]),M=new nT({props:U}),n[17](M),de.push(()=>Ie(M,"filter",N)),de.push(()=>Ie(M,"sort",B)),M.$on("select",n[20]),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Collections",s=T(),l=_("div"),r=F(o),a=T(),u=_("div"),f=_("button"),f.innerHTML='',c=T(),V(d.$$.fragment),h=T(),g=_("div"),v=_("button"),v.innerHTML=` + `),r.$set(E);const O={};D&1&&(O.content=JSON.stringify({action:"create",record:W.dummyCollectionRecord(M[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(O)},i(M){d||(A(r.$$.fragment,M),A(c.$$.fragment,M),d=!0)},o(M){P(r.$$.fragment,M),P(c.$$.fragment,M),d=!1},d(M){M&&k(e),M&&k(t),M&&k(i),M&&k(s),M&&k(l),M&&k(o),q(r,M),M&&k(a),M&&k(u),M&&k(f),q(c,M)}}}function HC(n,e,t){let i,{collection:s=new fn}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=W.getApiExampleUrl(we.baseUrl)),[s,i]}class jC extends Ee{constructor(e){super(),Oe(this,e,HC,RC,De,{collection:0})}}function Zd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Gd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Xd(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&V(t.$$.fragment),i=T(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&j(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Pe();const f=t;P(f.$$.fragment,1,0,()=>{q(f,1)}),Le()}l?(t=new l(o(r)),V(t.$$.fragment),A(t.$$.fragment,1),j(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&P(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&q(t)}}}function Qd(n,e){let t,i,s,l=e[4]===e[14].id&&Xd(e);return{key:n,first:null,c(){t=Ke(),l&&l.c(),i=Ke(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&A(l,1)):(l=Xd(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){s||(A(l),s=!0)},o(o){P(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function qC(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;rd[14].id;for(let d=0;dClose',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[8]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function BC(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[zC],header:[VC],default:[qC]},$$scope:{ctx:n}};return e=new mi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),q(e,s)}}}function UC(n,e,t){const i=[{id:"list",label:"List",component:sC},{id:"view",label:"View",component:rC},{id:"create",label:"Create",component:yC},{id:"update",label:"Update",component:LC},{id:"delete",label:"Delete",component:NC},{id:"realtime",label:"Realtime",component:jC}];let s,l=new fn,o=i[0].id;function r(y){return t(3,l=y),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(y){t(4,o=y)}function f(y,C){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),u(C))}const c=()=>a(),d=y=>u(y.id),h=(y,C)=>f(C,y.id);function g(y){pe[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){st.call(this,n,y)}function b(y){st.call(this,n,y)}return[a,u,s,l,o,i,f,r,c,d,h,g,v,b]}class WC extends Ee{constructor(e){super(),Oe(this,e,UC,BC,De,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function YC(n){let e,t,i,s=[n[3]],l={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight+2,o)+"px",r))},0)}function f(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)){h.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Jn(()=>(u(),()=>clearTimeout(a)));function c(h){pe[h?"unshift":"push"](()=>{r=h,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=at(at({},e),ni(h)),t(3,s=Bt(e,i)),"value"in h&&t(0,l=h.value),"maxHeight"in h&&t(4,o=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class JC extends Ee{constructor(e){super(),Oe(this,e,KC,YC,De,{value:0,maxHeight:4})}}function ZC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(v){n[2](v)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new JC({props:g}),pe.push(()=>Fe(f,"value",h)),{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),j(f,v,b),d=!0},p(v,b){(!d||b&2&&i!==(i=W.getFieldTypeIcon(v[1].type)))&&p(t,"class",i),(!d||b&2)&&o!==(o=v[1].name+"")&&ue(r,o),(!d||b&8&&a!==(a=v[3]))&&p(e,"for",a);const y={};b&8&&(y.id=v[3]),b&2&&(y.required=v[1].required),!c&&b&1&&(c=!0,y.value=v[0],He(()=>c=!1)),f.$set(y)},i(v){d||(A(f.$$.fragment,v),d=!0)},o(v){P(f.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(u),q(f,v)}}}function GC(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[ZC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function XC(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class QC extends Ee{constructor(e){super(),Oe(this,e,XC,GC,De,{field:1,value:0})}}function xC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,v,b;return{c(){var y,C;e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("input"),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",h=(y=n[1].options)==null?void 0:y.min),p(f,"max",g=(C=n[1].options)==null?void 0:C.max),p(f,"step","any")},m(y,C){w(y,e,C),m(e,t),m(e,s),m(e,l),m(l,r),w(y,u,C),w(y,f,C),Te(f,n[0]),v||(b=G(f,"input",n[2]),v=!0)},p(y,C){var S,$;C&2&&i!==(i=W.getFieldTypeIcon(y[1].type))&&p(t,"class",i),C&2&&o!==(o=y[1].name+"")&&ue(r,o),C&8&&a!==(a=y[3])&&p(e,"for",a),C&8&&c!==(c=y[3])&&p(f,"id",c),C&2&&d!==(d=y[1].required)&&(f.required=d),C&2&&h!==(h=(S=y[1].options)==null?void 0:S.min)&&p(f,"min",h),C&2&&g!==(g=($=y[1].options)==null?void 0:$.max)&&p(f,"max",g),C&1&&Pt(f.value)!==y[0]&&Te(f,y[0])},d(y){y&&k(e),y&&k(u),y&&k(f),v=!1,b()}}}function e4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[xC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function t4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(){s=Pt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class n4 extends Ee{constructor(e){super(),Oe(this,e,t4,e4,De,{field:1,value:0})}}function i4(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=_("input"),i=T(),s=_("label"),o=F(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,s,c),m(s,o),a||(u=G(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&ue(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&k(e),f&&k(i),f&&k(s),a=!1,u()}}}function s4(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[i4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function l4(n,e,t){let{field:i=new Dn}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class o4 extends Ee{constructor(e){super(),Oe(this,e,l4,s4,De,{field:1,value:0})}}function r4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("input"),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Te(f,n[0]),h||(g=G(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=W.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&f.value!==v[0]&&Te(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,g()}}}function a4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[r4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function u4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class f4 extends Ee{constructor(e){super(),Oe(this,e,u4,a4,De,{field:1,value:0})}}function c4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("input"),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Te(f,n[0]),h||(g=G(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=W.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Te(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,g()}}}function d4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[c4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function p4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class h4 extends Ee{constructor(e){super(),Oe(this,e,p4,d4,De,{field:1,value:0})}}function m4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h;function g(b){n[2](b)}let v={id:n[3],options:W.defaultFlatpickrOptions(),value:n[0]};return n[0]!==void 0&&(v.formattedValue=n[0]),c=new Ka({props:v}),pe.push(()=>Fe(c,"formattedValue",g)),{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),a=F(" (UTC)"),f=T(),V(c.$$.fragment),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",u=n[3])},m(b,y){w(b,e,y),m(e,t),m(e,s),m(e,l),m(l,r),m(l,a),w(b,f,y),j(c,b,y),h=!0},p(b,y){(!h||y&2&&i!==(i=W.getFieldTypeIcon(b[1].type)))&&p(t,"class",i),(!h||y&2)&&o!==(o=b[1].name+"")&&ue(r,o),(!h||y&8&&u!==(u=b[3]))&&p(e,"for",u);const C={};y&8&&(C.id=b[3]),y&1&&(C.value=b[0]),!d&&y&1&&(d=!0,C.formattedValue=b[0],He(()=>d=!1)),c.$set(C)},i(b){h||(A(c.$$.fragment,b),h=!0)},o(b){P(c.$$.fragment,b),h=!1},d(b){b&&k(e),b&&k(f),q(c,b)}}}function g4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[m4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function _4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class b4 extends Ee{constructor(e){super(),Oe(this,e,_4,g4,De,{field:1,value:0})}}function ep(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=F("Select up to "),s=F(i),l=F(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&ue(s,i)},d(o){o&&k(e)}}}function v4(n){var C,S,$;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function v(M){n[3](M)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],items:(C=n[1].options)==null?void 0:C.values,searchable:((S=n[1].options)==null?void 0:S.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new H_({props:b}),pe.push(()=>Fe(f,"selected",v));let y=(($=n[1].options)==null?void 0:$.maxSelect)>1&&ep(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),d=T(),y&&y.c(),h=Ke(),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(M,D){w(M,e,D),m(e,t),m(e,s),m(e,l),m(l,r),w(M,u,D),j(f,M,D),w(M,d,D),y&&y.m(M,D),w(M,h,D),g=!0},p(M,D){var O,L,I;(!g||D&2&&i!==(i=W.getFieldTypeIcon(M[1].type)))&&p(t,"class",i),(!g||D&2)&&o!==(o=M[1].name+"")&&ue(r,o),(!g||D&16&&a!==(a=M[4]))&&p(e,"for",a);const E={};D&16&&(E.id=M[4]),D&6&&(E.toggle=!M[1].required||M[2]),D&4&&(E.multiple=M[2]),D&2&&(E.items=(O=M[1].options)==null?void 0:O.values),D&2&&(E.searchable=((L=M[1].options)==null?void 0:L.values)>5),!c&&D&1&&(c=!0,E.selected=M[0],He(()=>c=!1)),f.$set(E),((I=M[1].options)==null?void 0:I.maxSelect)>1?y?y.p(M,D):(y=ep(M),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(M){g||(A(f.$$.fragment,M),g=!0)},o(M){P(f.$$.fragment,M),g=!1},d(M){M&&k(e),M&&k(u),q(f,M),M&&k(d),y&&y.d(M),M&&k(h)}}}function y4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[v4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function k4(n,e,t){let i,{field:s=new Dn}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class w4 extends Ee{constructor(e){super(),Oe(this,e,k4,y4,De,{field:1,value:0})}}function $4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("textarea"),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"class","txt-mono")},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Te(f,n[0]),h||(g=G(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=W.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Te(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,g()}}}function S4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[$4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function C4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&typeof s!="string"&&s!==null&&t(0,s=JSON.stringify(s,null,2))},[s,i,l]}class M4 extends Ee{constructor(e){super(),Oe(this,e,C4,S4,De,{field:1,value:0})}}function T4(n){let e,t;return{c(){e=_("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function D4(n){let e,t,i;return{c(){e=_("img"),xn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!xn(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&k(e)}}}function O4(n){let e;function t(l,o){return l[2]?D4:T4}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function E4(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),W.hasImageExtension(s==null?void 0:s.name)&&W.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{console.warn("Unable to generate thumb: ",r)})}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class A4 extends Ee{constructor(e){super(),Oe(this,e,E4,O4,De,{file:0,size:1})}}function P4(n){let e,t,i;return{c(){e=_("img"),xn(e.src,t=n[2])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&4&&!xn(e.src,t=s[2])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&k(e)}}}function L4(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=G(e,"click",Yt(n[0])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function I4(n){let e,t=n[2].substring(n[2].lastIndexOf("/")+1)+"",i,s,l,o,r,a,u;return{c(){e=_("a"),i=F(t),s=T(),l=_("div"),o=T(),r=_("button"),r.textContent="Close",p(e,"href",n[2]),p(e,"title","Download"),p(e,"class","link-hint txt-ellipsis"),p(l,"class","flex-fill"),p(r,"type","button"),p(r,"class","btn btn-secondary")},m(f,c){w(f,e,c),m(e,i),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=G(r,"click",n[0]),a=!0)},p(f,c){c&4&&t!==(t=f[2].substring(f[2].lastIndexOf("/")+1)+"")&&ue(i,t),c&4&&p(e,"href",f[2])},d(f){f&&k(e),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,u()}}}function F4(n){let e,t,i={class:"image-preview",btnClose:!1,popup:!0,$$slots:{footer:[I4],header:[L4],default:[P4]},$$scope:{ctx:n}};return e=new mi({props:i}),n[4](e),e.$on("show",n[5]),e.$on("hide",n[6]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&132&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[4](null),q(e,s)}}}function N4(n,e,t){let i,s="";function l(f){f!==""&&(t(2,s=f),i==null||i.show())}function o(){return i==null?void 0:i.hide()}function r(f){pe[f?"unshift":"push"](()=>{i=f,t(1,i)})}function a(f){st.call(this,n,f)}function u(f){st.call(this,n,f)}return[o,i,s,l,r,a,u]}class R4 extends Ee{constructor(e){super(),Oe(this,e,N4,F4,De,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function H4(n){let e;return{c(){e=_("i"),p(e,"class","ri-file-line")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function j4(n){let e,t,i,s,l;return{c(){e=_("img"),xn(e.src,t=n[4])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),ie(e,"link-fade",n[2])},m(o,r){w(o,e,r),s||(l=[G(e,"click",n[7]),G(e,"error",n[5])],s=!0)},p(o,r){r&16&&!xn(e.src,t=o[4])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i),r&4&&ie(e,"link-fade",o[2])},d(o){o&&k(e),s=!1,Ge(l)}}}function q4(n){let e,t,i;function s(a,u){return a[2]?j4:H4}let l=s(n),o=l(n),r={};return t=new R4({props:r}),n[8](t),{c(){o.c(),e=T(),V(t.$$.fragment)},m(a,u){o.m(a,u),w(a,e,u),j(t,a,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)));const f={};t.$set(f)},i(a){i||(A(t.$$.fragment,a),i=!0)},o(a){P(t.$$.fragment,a),i=!1},d(a){o.d(a),a&&k(e),n[8](null),q(t,a)}}}function V4(n,e,t){let i,{record:s}=e,{filename:l}=e,o,r="",a="";function u(){t(4,r="")}const f=d=>{d.stopPropagation(),o==null||o.show(a)};function c(d){pe[d?"unshift":"push"](()=>{o=d,t(3,o)})}return n.$$set=d=>{"record"in d&&t(6,s=d.record),"filename"in d&&t(0,l=d.filename)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=W.hasImageExtension(l)),n.$$.dirty&69&&i&&t(1,a=we.records.getFileUrl(s,`${l}`)),n.$$.dirty&2&&t(4,r=a?a+"?thumb=100x100":"")},[l,a,i,o,r,u,s,f,c]}class z_ extends Ee{constructor(e){super(),Oe(this,e,V4,q4,De,{record:6,filename:0})}}function tp(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function np(n,e,t){const i=n.slice();return i[25]=e[t],i[24]=t,i}function z4(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-secondary btn-sm btn-circle btn-remove txt-hint")},m(l,o){w(l,e,o),t||(i=[Ye(wt.call(null,e,"Remove file")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function B4(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=_("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(l,o){w(l,e,o),t||(i=G(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function ip(n,e){let t,i,s,l,o,r=e[25]+"",a,u,f,c,d,h,g;s=new z_({props:{record:e[2],filename:e[25]}});function v(C,S){return S&18&&(c=null),c==null&&(c=!!C[1].includes(C[24])),c?B4:z4}let b=v(e,-1),y=b(e);return{key:n,first:null,c(){t=_("div"),i=_("figure"),V(s.$$.fragment),l=T(),o=_("a"),a=F(r),f=T(),y.c(),p(i,"class","thumb"),ie(i,"fade",e[1].includes(e[24])),p(o,"href",u=we.records.getFileUrl(e[2],e[25])),p(o,"class","filename link-hint"),p(o,"target","_blank"),p(o,"rel","noopener"),ie(o,"txt-strikethrough",e[1].includes(e[24])),p(t,"class","list-item"),this.first=t},m(C,S){w(C,t,S),m(t,i),j(s,i,null),m(t,l),m(t,o),m(o,a),m(t,f),y.m(t,null),d=!0,h||(g=Ye(wt.call(null,o,{position:"right",text:"Download"})),h=!0)},p(C,S){e=C;const $={};S&4&&($.record=e[2]),S&16&&($.filename=e[25]),s.$set($),S&18&&ie(i,"fade",e[1].includes(e[24])),(!d||S&16)&&r!==(r=e[25]+"")&&ue(a,r),(!d||S&20&&u!==(u=we.records.getFileUrl(e[2],e[25])))&&p(o,"href",u),S&18&&ie(o,"txt-strikethrough",e[1].includes(e[24])),b===(b=v(e,S))&&y?y.p(e,S):(y.d(1),y=b(e),y&&(y.c(),y.m(t,null)))},i(C){d||(A(s.$$.fragment,C),d=!0)},o(C){P(s.$$.fragment,C),d=!1},d(C){C&&k(t),q(s),y.d(),h=!1,g()}}}function sp(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,h,g,v,b;i=new A4({props:{file:n[22]}});function y(){return n[15](n[24])}return{c(){e=_("div"),t=_("figure"),V(i.$$.fragment),s=T(),l=_("div"),o=_("small"),o.textContent="New",r=T(),a=_("span"),f=F(u),d=T(),h=_("button"),h.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename"),p(l,"title",c=n[22].name),p(h,"type","button"),p(h,"class","btn btn-secondary btn-sm btn-circle btn-remove"),p(e,"class","list-item")},m(C,S){w(C,e,S),m(e,t),j(i,t,null),m(e,s),m(e,l),m(l,o),m(l,r),m(l,a),m(a,f),m(e,d),m(e,h),g=!0,v||(b=[Ye(wt.call(null,h,"Remove file")),G(h,"click",y)],v=!0)},p(C,S){n=C;const $={};S&1&&($.file=n[22]),i.$set($),(!g||S&1)&&u!==(u=n[22].name+"")&&ue(f,u),(!g||S&1&&c!==(c=n[22].name))&&p(l,"title",c)},i(C){g||(A(i.$$.fragment,C),g=!0)},o(C){P(i.$$.fragment,C),g=!1},d(C){C&&k(e),q(i),v=!1,Ge(b)}}}function lp(n){let e,t,i,s,l,o;return{c(){e=_("div"),t=_("input"),i=T(),s=_("button"),s.innerHTML=` + Upload new file`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),m(e,t),n[16](t),m(e,i),m(e,s),l||(o=[G(t,"change",n[17]),G(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,Ge(o)}}}function U4(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,g,v,b=n[4];const y=D=>D[25];for(let D=0;DP(S[D],1,1,()=>{S[D]=null});let M=!n[8]&&lp(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("div");for(let D=0;D({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function Y4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Dn}=e,c,d;function h(O){W.removeByValue(u,O),t(1,u)}function g(O){W.pushUnique(u,O),t(1,u)}function v(O){W.isEmpty(a[O])||a.splice(O,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=O=>h(O),C=O=>g(O),S=O=>v(O);function $(O){pe[O?"unshift":"push"](()=>{c=O,t(6,c)})}const M=()=>{for(let O of c.files)a.push(O);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function E(O){pe[O?"unshift":"push"](()=>{d=O,t(7,d)})}return n.$$set=O=>{"record"in O&&t(2,o=O.record),"value"in O&&t(12,r=O.value),"uploadedFiles"in O&&t(0,a=O.uploadedFiles),"deletedFileIndexes"in O&&t(1,u=O.deletedFileIndexes),"field"in O&&t(3,f=O.field)},n.$$.update=()=>{var O,L;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=W.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=W.toArray(u))),n.$$.dirty&8&&t(5,i=((O=f.options)==null?void 0:O.maxSelect)>1),n.$$.dirty&4128&&W.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=W.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((L=f.options)==null?void 0:L.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,h,g,v,r,y,C,S,$,M,D,E]}class K4 extends Ee{constructor(e){super(),Oe(this,e,Y4,W4,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function op(n){let e,t;return{c(){e=_("small"),t=F(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1])},d(i){i&&k(e)}}}function J4(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f,c=n[1]!==""&&n[1]!==n[0].id&&op(n);return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=F(o),a=T(),c&&c.c(),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(s,"class","content svelte-1gjwqyd")},m(d,h){w(d,e,h),w(d,i,h),w(d,s,h),m(s,l),m(l,r),m(s,a),c&&c.m(s,null),u||(f=Ye(t=wt.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[h]){t&&Kn(t.update)&&h&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),h&1&&o!==(o=d[0].id+"")&&ue(r,o),d[1]!==""&&d[1]!==d[0].id?c?c.p(d,h):(c=op(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i:oe,o:oe,d(d){d&&k(e),d&&k(i),d&&k(s),c&&c.d(),u=!1,f()}}}function Z4(n,e,t){let i;const s=["id","created","updated","@collectionId","@collectionName"];let{item:l={}}=e;function o(r){r=r||{};const a=["name","title","label","key","email","heading","content",...Object.keys(r)];for(const u of a)if(typeof r[u]=="string"&&!W.isEmpty(r[u])&&!s.includes(u))return u+": "+r[u];return""}return n.$$set=r=>{"item"in r&&t(0,l=r.item)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=o(l))},[l,i]}class G4 extends Ee{constructor(e){super(),Oe(this,e,Z4,J4,De,{item:0})}}function rp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Load more',p(e,"type","button"),p(e,"class","btn btn-block btn-sm"),ie(e,"btn-loading",n[6]),ie(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[14])),t=!0)},p(s,l){l&64&&ie(e,"btn-loading",s[6]),l&64&&ie(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function X4(n){let e,t=n[7]&&rp(n);return{c(){t&&t.c(),e=Ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=rp(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function Q4(n){let e,t,i,s;const l=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:n[4]},{optionComponent:n[4]},{multiple:n[2]},{class:"records-select block-options"},n[10]];function o(u){n[15](u)}function r(u){n[16](u)}let a={$$slots:{afterOptions:[X4]},$$scope:{ctx:n}};for(let u=0;uFe(e,"keyOfSelected",o)),pe.push(()=>Fe(e,"selected",r)),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){V(e.$$.fragment)},m(u,f){j(e,u,f),s=!0},p(u,[f]){const c=f&1340?pn(l,[f&264&&{selectPlaceholder:u[8]?"Loading...":u[3]},f&32&&{items:u[5]},f&32&&{searchable:u[5].length>5},l[3],f&16&&{labelComponent:u[4]},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&si(u[10])]):{};f&4194496&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],He(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],He(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){q(e,u)}}}function x4(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent","collectionId"];let o=Bt(e,l);const r="select_"+W.randomString(5);let{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{keyOfSelected:f=a?[]:void 0}=e,{selectPlaceholder:c="- Select -"}=e,{optionComponent:d=G4}=e,{collectionId:h}=e,g=[],v=1,b=0,y=!1,C=!1;S();async function S(){const I=W.toArray(f);if(!(!h||!I.length)){t(13,C=!0);try{const N=[];for(const B of I)N.push(`id="${B}"`);t(0,u=await we.records.getFullList(h,200,{sort:"-created",filter:N.join("||"),$cancelKey:r+"loadSelected"})),t(5,g=W.filterDuplicatesByKey(g.concat(u)))}catch(N){we.errorResponseHandler(N)}t(13,C=!1)}}async function $(I=!1){if(!!h){t(6,y=!0);try{const N=I?1:v+1,B=await we.records.getList(h,N,200,{sort:"-created",$cancelKey:r+"loadList"});I&&t(5,g=[]),t(5,g=W.filterDuplicatesByKey(g.concat(B.items))),v=B.page,t(12,b=B.totalItems)}catch(N){we.errorResponseHandler(N)}t(6,y=!1)}}const M=()=>$();function D(I){f=I,t(1,f)}function E(I){u=I,t(0,u)}function O(I){st.call(this,n,I)}function L(I){st.call(this,n,I)}return n.$$set=I=>{e=at(at({},e),ni(I)),t(10,o=Bt(e,l)),"multiple"in I&&t(2,a=I.multiple),"selected"in I&&t(0,u=I.selected),"keyOfSelected"in I&&t(1,f=I.keyOfSelected),"selectPlaceholder"in I&&t(3,c=I.selectPlaceholder),"optionComponent"in I&&t(4,d=I.optionComponent),"collectionId"in I&&t(11,h=I.collectionId)},n.$$.update=()=>{n.$$.dirty&2048&&h&&$(!0),n.$$.dirty&8256&&t(8,i=y||C),n.$$.dirty&4128&&t(7,s=b>g.length)},[u,f,a,c,d,g,y,s,i,$,o,h,b,C,M,D,E,O,L]}class eM extends Ee{constructor(e){super(),Oe(this,e,x4,Q4,De,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4,collectionId:11})}}function ap(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=F("Select up to "),s=F(i),l=F(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&ue(s,i)},d(o){o&&k(e)}}}function tM(n){var C,S;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function v($){n[3]($)}let b={toggle:!0,id:n[4],multiple:n[2],collectionId:(C=n[1].options)==null?void 0:C.collectionId};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new eM({props:b}),pe.push(()=>Fe(f,"keyOfSelected",v));let y=((S=n[1].options)==null?void 0:S.maxSelect)>1&&ap(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),d=T(),y&&y.c(),h=Ke(),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m($,M){w($,e,M),m(e,t),m(e,s),m(e,l),m(l,r),w($,u,M),j(f,$,M),w($,d,M),y&&y.m($,M),w($,h,M),g=!0},p($,M){var E,O;(!g||M&2&&i!==(i=W.getFieldTypeIcon($[1].type)))&&p(t,"class",i),(!g||M&2)&&o!==(o=$[1].name+"")&&ue(r,o),(!g||M&16&&a!==(a=$[4]))&&p(e,"for",a);const D={};M&16&&(D.id=$[4]),M&4&&(D.multiple=$[2]),M&2&&(D.collectionId=(E=$[1].options)==null?void 0:E.collectionId),!c&&M&1&&(c=!0,D.keyOfSelected=$[0],He(()=>c=!1)),f.$set(D),((O=$[1].options)==null?void 0:O.maxSelect)>1?y?y.p($,M):(y=ap($),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i($){g||(A(f.$$.fragment,$),g=!0)},o($){P(f.$$.fragment,$),g=!1},d($){$&&k(e),$&&k(u),q(f,$),$&&k(d),y&&y.d($),$&&k(h)}}}function nM(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[tM,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function iM(n,e,t){let i,{field:s=new Dn}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(s.options.maxSelect-1))},[l,s,i,o]}class sM extends Ee{constructor(e){super(),Oe(this,e,iM,nM,De,{field:1,value:0})}}function lM(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f=n[0].email+"",c,d,h;return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=F(o),a=T(),u=_("small"),c=F(f),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(u,"class","block txt-hint txt-ellipsis"),p(s,"class","content")},m(g,v){w(g,e,v),w(g,i,v),w(g,s,v),m(s,l),m(l,r),m(s,a),m(s,u),m(u,c),d||(h=Ye(t=wt.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),d=!0)},p(g,[v]){t&&Kn(t.update)&&v&1&&t.update.call(null,{text:JSON.stringify(g[0],null,2),position:"left",class:"code"}),v&1&&o!==(o=g[0].id+"")&&ue(r,o),v&1&&f!==(f=g[0].email+"")&&ue(c,f)},i:oe,o:oe,d(g){g&&k(e),g&&k(i),g&&k(s),d=!1,h()}}}function oM(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class oa extends Ee{constructor(e){super(),Oe(this,e,oM,lM,De,{item:0})}}function up(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Load more',p(e,"type","button"),p(e,"class","btn btn-block btn-sm"),ie(e,"btn-loading",n[6]),ie(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[13])),t=!0)},p(s,l){l&64&&ie(e,"btn-loading",s[6]),l&64&&ie(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function rM(n){let e,t=n[7]&&up(n);return{c(){t&&t.c(),e=Ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=up(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function aM(n){let e,t,i,s;const l=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:oa},{optionComponent:n[4]},{multiple:n[2]},{class:"users-select block-options"},n[10]];function o(u){n[14](u)}function r(u){n[15](u)}let a={$$slots:{afterOptions:[rM]},$$scope:{ctx:n}};for(let u=0;uFe(e,"keyOfSelected",o)),pe.push(()=>Fe(e,"selected",r)),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){V(e.$$.fragment)},m(u,f){j(e,u,f),s=!0},p(u,[f]){const c=f&1340?pn(l,[f&264&&{selectPlaceholder:u[8]?"Loading...":u[3]},f&32&&{items:u[5]},f&32&&{searchable:u[5].length>5},l[3],f&0&&{labelComponent:oa},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&si(u[10])]):{};f&2097344&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],He(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],He(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){q(e,u)}}}function uM(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent"];let o=Bt(e,l);const r="select_"+W.randomString(5);let{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{keyOfSelected:f=a?[]:void 0}=e,{selectPlaceholder:c="- Select -"}=e,{optionComponent:d=oa}=e,h=[],g=1,v=0,b=!1,y=!1;S(!0),C();async function C(){const L=W.toArray(f);if(!!L.length){t(12,y=!0);try{const I=[];for(const N of L)I.push(`id="${N}"`);t(0,u=await we.users.getFullList(100,{sort:"-created",filter:I.join("||"),$cancelKey:r+"loadSelected"})),t(5,h=W.filterDuplicatesByKey(h.concat(u)))}catch(I){we.errorResponseHandler(I)}t(12,y=!1)}}async function S(L=!1){t(6,b=!0);try{const I=L?1:g+1,N=await we.users.getList(I,200,{sort:"-created",$cancelKey:r+"loadList"});L&&t(5,h=[]),t(5,h=W.filterDuplicatesByKey(h.concat(N.items))),g=N.page,t(11,v=N.totalItems)}catch(I){we.errorResponseHandler(I)}t(6,b=!1)}const $=()=>S();function M(L){f=L,t(1,f)}function D(L){u=L,t(0,u)}function E(L){st.call(this,n,L)}function O(L){st.call(this,n,L)}return n.$$set=L=>{e=at(at({},e),ni(L)),t(10,o=Bt(e,l)),"multiple"in L&&t(2,a=L.multiple),"selected"in L&&t(0,u=L.selected),"keyOfSelected"in L&&t(1,f=L.keyOfSelected),"selectPlaceholder"in L&&t(3,c=L.selectPlaceholder),"optionComponent"in L&&t(4,d=L.optionComponent)},n.$$.update=()=>{n.$$.dirty&4160&&t(8,i=b||y),n.$$.dirty&2080&&t(7,s=v>h.length)},[u,f,a,c,d,h,b,s,i,S,o,v,y,$,M,D,E,O]}class fM extends Ee{constructor(e){super(),Oe(this,e,uM,aM,De,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4})}}function fp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=F("Select up to "),s=F(i),l=F(" users."),p(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&ue(s,i)},d(o){o&&k(e)}}}function cM(n){var C;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function v(S){n[4](S)}let b={toggle:!0,id:n[5],multiple:n[2],disabled:n[3]};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new fM({props:b}),pe.push(()=>Fe(f,"keyOfSelected",v));let y=((C=n[1].options)==null?void 0:C.maxSelect)>1&&fp(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),d=T(),y&&y.c(),h=Ke(),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[5])},m(S,$){w(S,e,$),m(e,t),m(e,s),m(e,l),m(l,r),w(S,u,$),j(f,S,$),w(S,d,$),y&&y.m(S,$),w(S,h,$),g=!0},p(S,$){var D;(!g||$&2&&i!==(i=W.getFieldTypeIcon(S[1].type)))&&p(t,"class",i),(!g||$&2)&&o!==(o=S[1].name+"")&&ue(r,o),(!g||$&32&&a!==(a=S[5]))&&p(e,"for",a);const M={};$&32&&(M.id=S[5]),$&4&&(M.multiple=S[2]),$&8&&(M.disabled=S[3]),!c&&$&1&&(c=!0,M.keyOfSelected=S[0],He(()=>c=!1)),f.$set(M),((D=S[1].options)==null?void 0:D.maxSelect)>1?y?y.p(S,$):(y=fp(S),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(S){g||(A(f.$$.fragment,S),g=!0)},o(S){P(f.$$.fragment,S),g=!1},d(S){S&&k(e),S&&k(u),q(f,S),S&&k(d),y&&y.d(S),S&&k(h)}}}function dM(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":"")+" "+(n[3]?"disabled":""),name:n[1].name,$$slots:{default:[cM,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&10&&(l.class="form-field "+(i[1].required?"required":"")+" "+(i[3]?"disabled":"")),s&2&&(l.name=i[1].name),s&111&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function pM(n,e,t){let i,s,{field:l=new Dn}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(2,s),t(1,l)}return n.$$set=a=>{"field"in a&&t(1,l=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{var a;n.$$.dirty&2&&t(2,s=((a=l.options)==null?void 0:a.maxSelect)>1),n.$$.dirty&7&&s&&Array.isArray(o)&&o.length>l.options.maxSelect&&t(0,o=o.slice(l.options.maxSelect-1)),n.$$.dirty&3&&t(3,i=!W.isEmpty(o)&&l.system)},[o,l,s,i,r]}class hM extends Ee{constructor(e){super(),Oe(this,e,pM,dM,De,{field:1,value:0})}}function cp(n,e,t){const i=n.slice();return i[40]=e[t],i[41]=e,i[42]=t,i}function dp(n){let e,t;return e=new Re({props:{class:"form-field disabled",name:"id",$$slots:{default:[mM,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&4|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function mM(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="id",l=T(),o=_("span"),a=T(),u=_("input"),p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[43]),p(u,"type","text"),p(u,"id",f=n[43]),u.value=c=n[2].id,u.disabled=!0},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),w(d,a,h),w(d,u,h)},p(d,h){h[1]&4096&&r!==(r=d[43])&&p(e,"for",r),h[1]&4096&&f!==(f=d[43])&&p(u,"id",f),h[0]&4&&c!==(c=d[2].id)&&u.value!==c&&(u.value=c)},d(d){d&&k(e),d&&k(a),d&&k(u)}}}function pp(n){let e;return{c(){e=_("div"),e.innerHTML=`
    No custom fields to be set
    + `,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function gM(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new hM({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function _M(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new sM({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function bM(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new K4({props:u}),pe.push(()=>Fe(e,"value",o)),pe.push(()=>Fe(e,"uploadedFiles",r)),pe.push(()=>Fe(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){j(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],He(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],He(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],He(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){q(e,f)}}}function vM(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new M4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function yM(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new w4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function kM(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new b4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function wM(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new h4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function $M(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new f4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function SM(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new o4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function CM(n){let e,t,i;function s(o){n[20](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new n4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function MM(n){let e,t,i;function s(o){n[19](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new QC({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function hp(n,e){let t,i,s,l,o;const r=[MM,CM,SM,$M,wM,kM,yM,vM,bM,_M,gM],a=[];function u(f,c){return f[40].type==="text"?0:f[40].type==="number"?1:f[40].type==="bool"?2:f[40].type==="email"?3:f[40].type==="url"?4:f[40].type==="date"?5:f[40].type==="select"?6:f[40].type==="json"?7:f[40].type==="file"?8:f[40].type==="relation"?9:f[40].type==="user"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=Ke(),s&&s.c(),l=Ke(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(Pe(),P(a[d],1,1,()=>{a[d]=null}),Le()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){P(s),o=!1},d(f){f&&k(t),~i&&a[i].d(f),f&&k(l)}}}function TM(n){var d;let e,t,i=[],s=new Map,l,o,r,a=!n[2].isNew&&dp(n),u=((d=n[0])==null?void 0:d.schema)||[];const f=h=>h[40].name;for(let h=0;h{a=null}),Le()):a?(a.p(h,g),g[0]&4&&A(a,1)):(a=dp(h),a.c(),A(a,1),a.m(e,t)),g[0]&29&&(u=((v=h[0])==null?void 0:v.schema)||[],Pe(),i=yt(i,g,f,1,h,u,s,e,Zt,hp,null,cp),Le(),!u.length&&c?c.p(h,g):u.length?c&&(c.d(1),c=null):(c=pp(),c.c(),c.m(e,null)))},i(h){if(!l){A(a);for(let g=0;g + Delete`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function OM(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[10]&&mp(n);return{c(){e=_("h4"),i=F(t),s=T(),o=F(l),r=F(" record"),a=T(),c&&c.c(),u=Ke()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ue(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&ue(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&A(c,1)):(c=mp(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},i(d){f||(A(c),f=!0)},o(d){P(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function EM(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=F(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],ie(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=G(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&ie(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function AM(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[EM],header:[OM],default:[TM]},$$scope:{ctx:n}};return e=new mi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[33](null),q(e,s)}}}function gp(n){return JSON.stringify(n)}function PM(n,e,t){let i,s,l,o;const r=on(),a="record_"+W.randomString(5);let{collection:u}=e,f,c=null,d=new fo,h=!1,g=!1,v={},b={},y="";function C(x){return $(x),t(8,g=!0),f==null?void 0:f.show()}function S(){return f==null?void 0:f.hide()}async function $(x){hi({}),c=x||{},t(2,d=x!=null&&x.clone?x.clone():new fo),t(3,v={}),t(4,b={}),await ii(),t(15,y=gp(d))}function M(){if(h||!l)return;t(7,h=!0);const x=E();let Q;d.isNew?Q=we.records.create(u==null?void 0:u.id,x):Q=we.records.update(u==null?void 0:u.id,d.id,x),Q.then(async Se=>{cn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),S(),r("save",Se)}).catch(Se=>{we.errorResponseHandler(Se)}).finally(()=>{t(7,h=!1)})}function D(){!(c!=null&&c.id)||pi("Do you really want to delete the selected record?",()=>we.records.delete(c["@collectionId"],c.id).then(()=>{S(),cn("Successfully deleted record."),r("delete",c)}).catch(x=>{we.errorResponseHandler(x)}))}function E(){const x=(d==null?void 0:d.export())||{},Q=new FormData,Se={};for(const je of(u==null?void 0:u.schema)||[])Se[je.name]=je;for(const je in x)!Se[je]||(typeof x[je]>"u"&&(x[je]=null),W.addValueToFormData(Q,je,x[je]));for(const je in v){const Ue=W.toArray(v[je]);for(const Z of Ue)Q.append(je,Z)}for(const je in b){const Ue=W.toArray(b[je]);for(const Z of Ue)Q.append(je+"."+Z,"")}return Q}const O=()=>S(),L=()=>D();function I(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function N(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function B(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function U(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function ee(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function K(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function se(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function Y(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function te(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function J(x,Q){n.$$.not_equal(v[Q.name],x)&&(v[Q.name]=x,t(3,v))}function _e(x,Q){n.$$.not_equal(b[Q.name],x)&&(b[Q.name]=x,t(4,b))}function be(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function X(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}const ae=()=>s&&g?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,g=!1),S()}),!1):!0;function ve(x){pe[x?"unshift":"push"](()=>{f=x,t(6,f)})}function H(x){st.call(this,n,x)}function me(x){st.call(this,n,x)}return n.$$set=x=>{"collection"in x&&t(0,u=x.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=W.hasNonEmptyProps(v)||W.hasNonEmptyProps(b)),n.$$.dirty[0]&98308&&t(5,s=i||y!=gp(d)),n.$$.dirty[0]&36&&t(9,l=d.isNew||s),n.$$.dirty[0]&1&&t(10,o=(u==null?void 0:u.name)!=="profiles")},[u,S,d,v,b,s,f,h,g,l,o,a,M,D,C,y,i,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve,H,me]}class B_ extends Ee{constructor(e){super(),Oe(this,e,PM,AM,De,{collection:0,show:14,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[1]}}function LM(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function IM(n){let e,t;return{c(){e=_("span"),t=F(n[1]),p(e,"class","label txt-base txt-mono"),p(e,"title",n[0])},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1]),s&1&&p(e,"title",i[0])},d(i){i&&k(e)}}}function FM(n){let e;function t(l,o){return l[0]?IM:LM}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function NM(n,e,t){let{id:i=""}=e,s=i;return n.$$set=l=>{"id"in l&&t(0,i=l.id)},n.$$.update=()=>{n.$$.dirty&1&&typeof i=="string"&&i.length>27&&t(1,s=i.substring(0,5)+"..."+i.substring(i.length-10))},[i,s]}class Qo extends Ee{constructor(e){super(),Oe(this,e,NM,FM,De,{id:0})}}function _p(n,e,t){const i=n.slice();return i[8]=e[t],i}function bp(n,e,t){const i=n.slice();return i[3]=e[t],i}function vp(n,e,t){const i=n.slice();return i[3]=e[t],i}function RM(n){let e,t=n[0][n[1].name]+"",i,s;return{c(){e=_("span"),i=F(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[0][n[1].name])},m(l,o){w(l,e,o),m(e,i)},p(l,o){o&3&&t!==(t=l[0][l[1].name]+"")&&ue(i,t),o&3&&s!==(s=l[0][l[1].name])&&p(e,"title",s)},i:oe,o:oe,d(l){l&&k(e)}}}function HM(n){let e,t,i=W.toArray(n[0][n[1].name]),s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){e=_("div");for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){e=_("div");for(let o=0;o{a[d]=null}),Le(),s=a[i],s?s.p(f,c):(s=a[i]=r[i](f),s.c()),A(s,1),s.m(e,null)),(!o||c&2&&l!==(l="col-type-"+f[1].type+" col-field-"+f[1].name))&&p(e,"class",l)},i(f){o||(A(s),o=!0)},o(f){P(s),o=!1},d(f){f&&k(e),a[i].d()}}}function KM(n,e,t){let{record:i}=e,{field:s}=e;function l(o){st.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record),"field"in o&&t(1,s=o.field)},[i,s,l]}class U_ extends Ee{constructor(e){super(),Oe(this,e,KM,YM,De,{record:0,field:1})}}function $p(n,e,t){const i=n.slice();return i[35]=e[t],i}function Sp(n,e,t){const i=n.slice();return i[38]=e[t],i}function Cp(n,e,t){const i=n.slice();return i[38]=e[t],i}function JM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function ZM(n){let e,t,i,s,l,o=n[38].name+"",r;return{c(){e=_("div"),t=_("i"),s=T(),l=_("span"),r=F(o),p(t,"class",i=W.getFieldTypeIcon(n[38].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(l,r)},p(a,u){u[0]&2048&&i!==(i=W.getFieldTypeIcon(a[38].type))&&p(t,"class",i),u[0]&2048&&o!==(o=a[38].name+"")&&ue(r,o)},d(a){a&&k(e)}}}function Mp(n,e){let t,i,s,l;function o(a){e[22](a)}let r={class:"col-type-"+e[38].type+" col-field-"+e[38].name,name:e[38].name,$$slots:{default:[ZM]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new sn({props:r}),pe.push(()=>Fe(i,"sort",o)),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&2048&&(f.class="col-type-"+e[38].type+" col-field-"+e[38].name),u[0]&2048&&(f.name=e[38].name),u[0]&2048|u[1]&4096&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],He(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&k(t),q(i,a)}}}function GM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function XM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Tp(n){let e;function t(l,o){return l[8]?xM:QM}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function QM(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Dp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No records found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Dp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function xM(n){let e;return{c(){e=_("tr"),e.innerHTML=` + `},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Dp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[28]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Op(n,e){let t,i,s;return i=new U_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),q(i,l)}}}function Ep(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,C,S,$,M,D,E,O,L,I,N,B;function U(){return e[25](e[35])}h=new Qo({props:{id:e[35].id}});let ee=e[11];const K=te=>te[38].name;for(let te=0;te',L=T(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],p(u,"for",f="checkbox_"+e[35].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p(C,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(O,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(te,J){w(te,t,J),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),j(h,d,null),m(t,g);for(let _e=0;_eReset',c=T(),d=_("div"),h=T(),g=_("button"),g.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ie(f,"btn-disabled",n[9]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-secondary btn-danger"),ie(g,"btn-loading",n[9]),ie(g,"btn-disabled",n[9]),p(e,"class","bulkbar")},m(S,$){w(S,e,$),m(e,t),m(t,i),m(t,s),m(s,l),m(t,o),m(t,a),m(e,u),m(e,f),m(e,c),m(e,d),m(e,h),m(e,g),b=!0,y||(C=[G(f,"click",n[30]),G(g,"click",n[31])],y=!0)},p(S,$){(!b||$[0]&64)&&ue(l,S[6]),(!b||$[0]&64)&&r!==(r=S[6]===1?"record":"records")&&ue(a,r),$[0]&512&&ie(f,"btn-disabled",S[9]),$[0]&512&&ie(g,"btn-loading",S[9]),$[0]&512&&ie(g,"btn-disabled",S[9])},i(S){b||(S&&Tt(()=>{v||(v=it(e,Un,{duration:150,y:5},!0)),v.run(1)}),b=!0)},o(S){S&&(v||(v=it(e,Un,{duration:150,y:5},!1)),v.run(0)),b=!1},d(S){S&&k(e),S&&v&&v.end(),y=!1,Ge(C)}}}function eT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,C,S,$,M,D,E,O,L,I,N=[],B=new Map,U,ee,K,se,Y,te,J;function _e(ce){n[21](ce)}let be={class:"col-type-text col-field-id",name:"id",$$slots:{default:[JM]},$$scope:{ctx:n}};n[0]!==void 0&&(be.sort=n[0]),d=new sn({props:be}),pe.push(()=>Fe(d,"sort",_e));let X=n[11];const ae=ce=>ce[38].name;for(let ce=0;ceFe(C,"sort",ve));function me(ce){n[24](ce)}let x={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[XM]},$$scope:{ctx:n}};n[0]!==void 0&&(x.sort=n[0]),M=new sn({props:x}),pe.push(()=>Fe(M,"sort",me));let Q=n[3];const Se=ce=>ce[35].id;for(let ce=0;ceh=!1)),d.$set(Ze),$e[0]&2049&&(X=ce[11],Pe(),v=yt(v,$e,ae,1,ce,X,b,s,Zt,Mp,y,Cp),Le());const et={};$e[1]&4096&&(et.$$scope={dirty:$e,ctx:ce}),!S&&$e[0]&1&&(S=!0,et.sort=ce[0],He(()=>S=!1)),C.$set(et);const We={};$e[1]&4096&&(We.$$scope={dirty:$e,ctx:ce}),!D&&$e[0]&1&&(D=!0,We.sort=ce[0],He(()=>D=!1)),M.$set(We),$e[0]&76074&&(Q=ce[3],Pe(),N=yt(N,$e,Se,1,ce,Q,B,I,Zt,Ep,null,$p),Le(),!Q.length&&je?je.p(ce,$e):Q.length?je&&(je.d(1),je=null):(je=Tp(ce),je.c(),je.m(I,null))),$e[0]&256&&ie(t,"table-loading",ce[8]),ce[3].length?Ue?Ue.p(ce,$e):(Ue=Ap(ce),Ue.c(),Ue.m(ee.parentNode,ee)):Ue&&(Ue.d(1),Ue=null),ce[3].length&&ce[12]?Z?Z.p(ce,$e):(Z=Pp(ce),Z.c(),Z.m(K.parentNode,K)):Z&&(Z.d(1),Z=null),ce[6]?ge?(ge.p(ce,$e),$e[0]&64&&A(ge,1)):(ge=Lp(ce),ge.c(),A(ge,1),ge.m(se.parentNode,se)):ge&&(Pe(),P(ge,1,1,()=>{ge=null}),Le())},i(ce){if(!Y){A(d.$$.fragment,ce);for(let $e=0;$e{t(8,v=!1),t(3,c=c.concat(ae.items)),t(7,d=ae.page),t(4,h=ae.totalItems),r("load",c)}).catch(ae=>{ae!=null&&ae.isAbort||(t(8,v=!1),console.warn(ae),C(),we.errorResponseHandler(ae,!1))})}function C(){t(3,c=[]),t(7,d=1),t(4,h=0),t(5,g={})}function S(){o?$():M()}function $(){t(5,g={})}function M(){for(const X of c)t(5,g[X.id]=X,g);t(5,g)}function D(X){g[X.id]?delete g[X.id]:t(5,g[X.id]=X,g),t(5,g)}function E(){pi(`Do you really want to delete the selected ${l===1?"record":"records"}?`,O)}async function O(){if(b||!l)return;let X=[];for(const ae of Object.keys(g))X.push(we.records.delete(a==null?void 0:a.id,ae));return t(9,b=!0),Promise.all(X).then(()=>{cn(`Successfully deleted the selected ${l===1?"record":"records"}.`),$()}).catch(ae=>{we.errorResponseHandler(ae)}).finally(()=>(t(9,b=!1),y()))}function L(X){st.call(this,n,X)}const I=()=>S();function N(X){u=X,t(0,u)}function B(X){u=X,t(0,u)}function U(X){u=X,t(0,u)}function ee(X){u=X,t(0,u)}const K=X=>D(X),se=X=>r("select",X),Y=(X,ae)=>{ae.code==="Enter"&&(ae.preventDefault(),r("select",X))},te=()=>t(1,f=""),J=()=>y(d+1),_e=()=>$(),be=()=>E();return n.$$set=X=>{"collection"in X&&t(18,a=X.collection),"sort"in X&&t(0,u=X.sort),"filter"in X&&t(1,f=X.filter)},n.$$.update=()=>{n.$$.dirty[0]&262147&&a&&a.id&&u!==-1&&f!==-1&&(C(),y(1)),n.$$.dirty[0]&24&&t(12,i=h>c.length),n.$$.dirty[0]&262144&&t(11,s=(a==null?void 0:a.schema)||[]),n.$$.dirty[0]&32&&t(6,l=Object.keys(g).length),n.$$.dirty[0]&72&&t(10,o=c.length&&l===c.length)},[u,f,y,c,h,g,l,d,v,b,o,s,i,r,S,$,D,E,a,L,I,N,B,U,ee,K,se,Y,te,J,_e,be]}class nT extends Ee{constructor(e){super(),Oe(this,e,tT,eT,De,{collection:18,sort:0,filter:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}function iT(n){let e,t,i,s;return e=new X3({}),i=new On({props:{$$slots:{default:[oT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o&1073741951&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function sT(n){let e,t;return e=new On({props:{center:!0,$$slots:{default:[rT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&1073741832&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function lT(n){let e,t;return e=new On({props:{center:!0,$$slots:{default:[aT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&1073741824&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function oT(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I;d=new Uo({}),d.$on("refresh",n[13]),S=new Bo({props:{value:n[0],autocompleteCollection:n[2]}}),S.$on("submit",n[16]);function N(ee){n[18](ee)}function B(ee){n[19](ee)}let U={collection:n[2]};return n[0]!==void 0&&(U.filter=n[0]),n[1]!==void 0&&(U.sort=n[1]),M=new nT({props:U}),n[17](M),pe.push(()=>Fe(M,"filter",N)),pe.push(()=>Fe(M,"sort",B)),M.$on("select",n[20]),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Collections",s=T(),l=_("div"),r=F(o),a=T(),u=_("div"),f=_("button"),f.innerHTML='',c=T(),V(d.$$.fragment),h=T(),g=_("div"),v=_("button"),v.innerHTML=` API Preview`,b=T(),y=_("button"),y.innerHTML=` New record`,C=T(),V(S.$$.fragment),$=T(),V(M.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"type","button"),p(f,"class","btn btn-secondary btn-circle"),p(u,"class","inline-flex gap-5"),p(v,"type","button"),p(v,"class","btn btn-outline"),p(y,"type","button"),p(y,"class","btn btn-expanded"),p(g,"class","btns-group"),p(e,"class","page-header")},m(ee,K){w(ee,e,K),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),m(e,u),m(u,f),m(u,c),j(d,u,null),m(e,h),m(e,g),m(g,v),m(g,b),m(g,y),w(ee,C,K),j(S,ee,K),w(ee,$,K),j(M,ee,K),O=!0,L||(I=[Ye(wt.call(null,f,{text:"Edit collection",position:"right"})),G(f,"click",n[12]),G(v,"click",n[14]),G(y,"click",n[15])],L=!0)},p(ee,K){(!O||K&4)&&o!==(o=ee[2].name+"")&&ue(r,o);const se={};K&1&&(se.value=ee[0]),K&4&&(se.autocompleteCollection=ee[2]),S.$set(se);const Y={};K&4&&(Y.collection=ee[2]),!D&&K&1&&(D=!0,Y.filter=ee[0],He(()=>D=!1)),!E&&K&2&&(E=!0,Y.sort=ee[1],He(()=>E=!1)),M.$set(Y)},i(ee){O||(A(d.$$.fragment,ee),A(S.$$.fragment,ee),A(M.$$.fragment,ee),O=!0)},o(ee){P(d.$$.fragment,ee),P(S.$$.fragment,ee),P(M.$$.fragment,ee),O=!1},d(ee){ee&&k(e),q(d),ee&&k(C),q(S,ee),ee&&k($),n[17](null),q(M,ee),L=!1,Ge(I)}}}function rT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='',i=T(),s=_("h1"),s.textContent="Create your first collection to add records!",l=T(),o=_("button"),o.innerHTML=` Create new collection`,p(t,"class","icon"),p(s,"class","m-b-10"),p(o,"type","button"),p(o,"class","btn btn-expanded-lg btn-lg"),p(e,"class","placeholder-section m-b-base")},m(u,f){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=G(o,"click",n[11]),r=!0)},p:oe,d(u){u&&k(e),r=!1,a()}}}function aT(n){let e;return{c(){e=_("div"),e.innerHTML=` -

    Loading collections...

    `,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function uT(n){let e,t,i,s,l,o,r,a,u;const f=[lT,sT,iT],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new Ja({props:h}),n[21](s);let g={};o=new WC({props:g}),n[22](o);let v={collection:n[2]};return a=new B_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),V(s.$$.fragment),l=T(),V(o.$$.fragment),r=T(),V(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),j(s,b,y),w(b,l,y),j(o,b,y),w(b,r,y),j(a,b,y),u=!0},p(b,[y]){let C=e;e=d(b),e===C?c[e].p(b,y):(Ae(),P(c[C],1,1,()=>{c[C]=null}),Pe(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const S={};s.$set(S);const $={};o.$set($);const M={};y&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[21](null),q(s,b),b&&k(l),n[22](null),q(o,b),b&&k(r),n[23](null),q(a,b)}}}function fT(n,e,t){let i,s,l,o,r,a;_t(n,ci,Y=>t(2,s=Y)),_t(n,Ds,Y=>t(10,l=Y)),_t(n,Ro,Y=>t(26,o=Y)),_t(n,Rt,Y=>t(27,r=Y)),_t(n,sa,Y=>t(8,a=Y)),dn(Rt,r="Collections",r);const u=new URLSearchParams(o);let f,c,d,h,g=u.get("filter")||"",v=u.get("sort")||"-created",b=u.get("collectionId")||"";function y(){t(9,b=s.id),t(1,v="-created"),t(0,g="")}_$(b);const C=()=>f==null?void 0:f.show(),S=()=>f==null?void 0:f.show(s),$=()=>h==null?void 0:h.load(),M=()=>c==null?void 0:c.show(s),D=()=>d==null?void 0:d.show(),E=Y=>t(0,g=Y.detail);function O(Y){de[Y?"unshift":"push"](()=>{h=Y,t(6,h)})}function L(Y){g=Y,t(0,g)}function I(Y){v=Y,t(1,v)}const N=Y=>d==null?void 0:d.show(Y==null?void 0:Y.detail);function B(Y){de[Y?"unshift":"push"](()=>{f=Y,t(3,f)})}function U(Y){de[Y?"unshift":"push"](()=>{c=Y,t(4,c)})}function ee(Y){de[Y?"unshift":"push"](()=>{d=Y,t(5,d)})}const K=()=>h==null?void 0:h.load(),se=()=>h==null?void 0:h.load();return n.$$.update=()=>{if(n.$$.dirty&1024&&t(7,i=l.filter(Y=>Y.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&b!=s.id&&y(),n.$$.dirty&7&&(v||g||(s==null?void 0:s.id))){const Y=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:v}).toString();Si("/collections?"+Y)}},[g,v,s,f,c,d,h,i,a,b,l,C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se]}class cT extends Ee{constructor(e){super(),Oe(this,e,fT,uT,De,{})}}function Ip(n){let e,t;return e=new Re({props:{class:"form-field disabled",name:"id",$$slots:{default:[dT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function dT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","text"),p(r,"id",a=n[31]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&p(e,"for",l),c[1]&1&&a!==(a=f[31])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function Fp(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='',p(e,"class","form-field-addon txt-success")},m(s,l){w(s,e,l),t||(i=Ye(wt.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function pT(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Fp();return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),d&&d.c(),r=T(),a=_("input"),p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",u=n[31]),a.required=!0},m(h,g){w(h,e,g),m(e,t),m(e,i),m(e,s),w(h,o,g),d&&d.m(h,g),w(h,r,g),w(h,a,g),Me(a,n[2]),f||(c=G(a,"input",n[19]),f=!0)},p(h,g){g[1]&1&&l!==(l=h[31])&&p(e,"for",l),h[1].verified?d||(d=Fp(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[1]&1&&u!==(u=h[31])&&p(a,"id",u),g[0]&4&&a.value!==h[2]&&Me(a,h[2])},d(h){h&&k(e),h&&k(o),d&&d.d(h),h&&k(r),h&&k(a),f=!1,c()}}}function Np(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle",$$slots:{default:[hT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&8|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function hT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[20]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&8&&(e.checked=u[3]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Rp(n){let e,t,i,s,l,o,r,a,u;return s=new Re({props:{class:"form-field required",name:"password",$$slots:{default:[mT,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new Re({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[gT,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),V(s.$$.fragment),l=T(),o=_("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),j(s,i,null),m(t,l),m(t,o),j(r,o,null),u=!0},p(f,c){const d={};c[0]&128|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&256|c[1]&3&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Tt(()=>{a||(a=ot(t,tn,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=ot(t,tn,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),q(s),q(r),f&&a&&a.end()}}}function mT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password",o=T(),r=_("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[31]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Me(r,n[7]),u||(f=G(r,"input",n[21]),u=!0)},p(c,d){d[1]&1&&l!==(l=c[31])&&p(e,"for",l),d[1]&1&&a!==(a=c[31])&&p(r,"id",a),d[0]&128&&r.value!==c[7]&&Me(r,c[7])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function gT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password confirm",o=T(),r=_("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[31]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Me(r,n[8]),u||(f=G(r,"input",n[22]),u=!0)},p(c,d){d[1]&1&&l!==(l=c[31])&&p(e,"for",l),d[1]&1&&a!==(a=c[31])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&Me(r,c[8])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function Hp(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle",$$slots:{default:[_T,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&512|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function _T(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Send verification email"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[9],w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[23]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&512&&(e.checked=u[9]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function bT(n){let e,t,i,s,l,o,r,a,u,f=!n[1].isNew&&Ip(n);i=new Re({props:{class:"form-field required",name:"email",$$slots:{default:[pT,({uniqueId:g})=>({31:g}),({uniqueId:g})=>[0,g?1:0]]},$$scope:{ctx:n}}});let c=!n[1].isNew&&Np(n),d=(n[1].isNew||n[3])&&Rp(n),h=n[1].isNew&&Hp(n);return{c(){e=_("form"),f&&f.c(),t=T(),V(i.$$.fragment),s=T(),c&&c.c(),l=T(),d&&d.c(),o=T(),h&&h.c(),p(e,"id",n[11]),p(e,"class","grid"),p(e,"autocomplete","off")},m(g,v){w(g,e,v),f&&f.m(e,null),m(e,t),j(i,e,null),m(e,s),c&&c.m(e,null),m(e,l),d&&d.m(e,null),m(e,o),h&&h.m(e,null),r=!0,a||(u=G(e,"submit",Kt(n[12])),a=!0)},p(g,v){g[1].isNew?f&&(Ae(),P(f,1,1,()=>{f=null}),Pe()):f?(f.p(g,v),v[0]&2&&A(f,1)):(f=Ip(g),f.c(),A(f,1),f.m(e,t));const b={};v[0]&6|v[1]&3&&(b.$$scope={dirty:v,ctx:g}),i.$set(b),g[1].isNew?c&&(Ae(),P(c,1,1,()=>{c=null}),Pe()):c?(c.p(g,v),v[0]&2&&A(c,1)):(c=Np(g),c.c(),A(c,1),c.m(e,l)),g[1].isNew||g[3]?d?(d.p(g,v),v[0]&10&&A(d,1)):(d=Rp(g),d.c(),A(d,1),d.m(e,o)):d&&(Ae(),P(d,1,1,()=>{d=null}),Pe()),g[1].isNew?h?(h.p(g,v),v[0]&2&&A(h,1)):(h=Hp(g),h.c(),A(h,1),h.m(e,null)):h&&(Ae(),P(h,1,1,()=>{h=null}),Pe())},i(g){r||(A(f),A(i.$$.fragment,g),A(c),A(d),A(h),r=!0)},o(g){P(f),P(i.$$.fragment,g),P(c),P(d),P(h),r=!1},d(g){g&&k(e),f&&f.d(),q(i),c&&c.d(),d&&d.d(),h&&h.d(),a=!1,u()}}}function vT(n){let e,t=n[1].isNew?"New user":"Edit user",i;return{c(){e=_("h4"),i=F(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].isNew?"New user":"Edit user")&&ue(i,t)},d(s){s&&k(e)}}}function jp(n){let e,t,i,s,l,o,r,a,u;return o=new Mi({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[yT]},$$scope:{ctx:n}}}),{c(){e=_("button"),t=_("span"),i=T(),s=_("i"),l=T(),V(o.$$.fragment),r=T(),a=_("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),m(e,l),j(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[0]&2|c[1]&2&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&k(e),q(o),f&&k(r),f&&k(a)}}}function qp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=` +

    Loading collections...

    `,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function uT(n){let e,t,i,s,l,o,r,a,u;const f=[lT,sT,iT],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new Ja({props:h}),n[21](s);let g={};o=new WC({props:g}),n[22](o);let v={collection:n[2]};return a=new B_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),V(s.$$.fragment),l=T(),V(o.$$.fragment),r=T(),V(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),j(s,b,y),w(b,l,y),j(o,b,y),w(b,r,y),j(a,b,y),u=!0},p(b,[y]){let C=e;e=d(b),e===C?c[e].p(b,y):(Pe(),P(c[C],1,1,()=>{c[C]=null}),Le(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const S={};s.$set(S);const $={};o.$set($);const M={};y&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[21](null),q(s,b),b&&k(l),n[22](null),q(o,b),b&&k(r),n[23](null),q(a,b)}}}function fT(n,e,t){let i,s,l,o,r,a;bt(n,ci,Y=>t(2,s=Y)),bt(n,Ds,Y=>t(10,l=Y)),bt(n,Ro,Y=>t(26,o=Y)),bt(n,Ft,Y=>t(27,r=Y)),bt(n,sa,Y=>t(8,a=Y)),dn(Ft,r="Collections",r);const u=new URLSearchParams(o);let f,c,d,h,g=u.get("filter")||"",v=u.get("sort")||"-created",b=u.get("collectionId")||"";function y(){t(9,b=s.id),t(1,v="-created"),t(0,g="")}_$(b);const C=()=>f==null?void 0:f.show(),S=()=>f==null?void 0:f.show(s),$=()=>h==null?void 0:h.load(),M=()=>c==null?void 0:c.show(s),D=()=>d==null?void 0:d.show(),E=Y=>t(0,g=Y.detail);function O(Y){pe[Y?"unshift":"push"](()=>{h=Y,t(6,h)})}function L(Y){g=Y,t(0,g)}function I(Y){v=Y,t(1,v)}const N=Y=>d==null?void 0:d.show(Y==null?void 0:Y.detail);function B(Y){pe[Y?"unshift":"push"](()=>{f=Y,t(3,f)})}function U(Y){pe[Y?"unshift":"push"](()=>{c=Y,t(4,c)})}function ee(Y){pe[Y?"unshift":"push"](()=>{d=Y,t(5,d)})}const K=()=>h==null?void 0:h.load(),se=()=>h==null?void 0:h.load();return n.$$.update=()=>{if(n.$$.dirty&1024&&t(7,i=l.filter(Y=>Y.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&b!=s.id&&y(),n.$$.dirty&7&&(v||g||(s==null?void 0:s.id))){const Y=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:v}).toString();Si("/collections?"+Y)}},[g,v,s,f,c,d,h,i,a,b,l,C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se]}class cT extends Ee{constructor(e){super(),Oe(this,e,fT,uT,De,{})}}function Ip(n){let e,t;return e=new Re({props:{class:"form-field disabled",name:"id",$$slots:{default:[dT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function dT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","text"),p(r,"id",a=n[31]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&p(e,"for",l),c[1]&1&&a!==(a=f[31])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function Fp(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='',p(e,"class","form-field-addon txt-success")},m(s,l){w(s,e,l),t||(i=Ye(wt.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function pT(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Fp();return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),d&&d.c(),r=T(),a=_("input"),p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",u=n[31]),a.required=!0},m(h,g){w(h,e,g),m(e,t),m(e,i),m(e,s),w(h,o,g),d&&d.m(h,g),w(h,r,g),w(h,a,g),Te(a,n[2]),f||(c=G(a,"input",n[19]),f=!0)},p(h,g){g[1]&1&&l!==(l=h[31])&&p(e,"for",l),h[1].verified?d||(d=Fp(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[1]&1&&u!==(u=h[31])&&p(a,"id",u),g[0]&4&&a.value!==h[2]&&Te(a,h[2])},d(h){h&&k(e),h&&k(o),d&&d.d(h),h&&k(r),h&&k(a),f=!1,c()}}}function Np(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle",$$slots:{default:[hT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&8|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function hT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[20]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&8&&(e.checked=u[3]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Rp(n){let e,t,i,s,l,o,r,a,u;return s=new Re({props:{class:"form-field required",name:"password",$$slots:{default:[mT,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new Re({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[gT,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),V(s.$$.fragment),l=T(),o=_("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),j(s,i,null),m(t,l),m(t,o),j(r,o,null),u=!0},p(f,c){const d={};c[0]&128|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&256|c[1]&3&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Tt(()=>{a||(a=it(t,tn,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=it(t,tn,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),q(s),q(r),f&&a&&a.end()}}}function mT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password",o=T(),r=_("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[31]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Te(r,n[7]),u||(f=G(r,"input",n[21]),u=!0)},p(c,d){d[1]&1&&l!==(l=c[31])&&p(e,"for",l),d[1]&1&&a!==(a=c[31])&&p(r,"id",a),d[0]&128&&r.value!==c[7]&&Te(r,c[7])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function gT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password confirm",o=T(),r=_("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[31]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Te(r,n[8]),u||(f=G(r,"input",n[22]),u=!0)},p(c,d){d[1]&1&&l!==(l=c[31])&&p(e,"for",l),d[1]&1&&a!==(a=c[31])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&Te(r,c[8])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function Hp(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle",$$slots:{default:[_T,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&512|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function _T(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Send verification email"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[9],w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[23]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&512&&(e.checked=u[9]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function bT(n){let e,t,i,s,l,o,r,a,u,f=!n[1].isNew&&Ip(n);i=new Re({props:{class:"form-field required",name:"email",$$slots:{default:[pT,({uniqueId:g})=>({31:g}),({uniqueId:g})=>[0,g?1:0]]},$$scope:{ctx:n}}});let c=!n[1].isNew&&Np(n),d=(n[1].isNew||n[3])&&Rp(n),h=n[1].isNew&&Hp(n);return{c(){e=_("form"),f&&f.c(),t=T(),V(i.$$.fragment),s=T(),c&&c.c(),l=T(),d&&d.c(),o=T(),h&&h.c(),p(e,"id",n[11]),p(e,"class","grid"),p(e,"autocomplete","off")},m(g,v){w(g,e,v),f&&f.m(e,null),m(e,t),j(i,e,null),m(e,s),c&&c.m(e,null),m(e,l),d&&d.m(e,null),m(e,o),h&&h.m(e,null),r=!0,a||(u=G(e,"submit",Yt(n[12])),a=!0)},p(g,v){g[1].isNew?f&&(Pe(),P(f,1,1,()=>{f=null}),Le()):f?(f.p(g,v),v[0]&2&&A(f,1)):(f=Ip(g),f.c(),A(f,1),f.m(e,t));const b={};v[0]&6|v[1]&3&&(b.$$scope={dirty:v,ctx:g}),i.$set(b),g[1].isNew?c&&(Pe(),P(c,1,1,()=>{c=null}),Le()):c?(c.p(g,v),v[0]&2&&A(c,1)):(c=Np(g),c.c(),A(c,1),c.m(e,l)),g[1].isNew||g[3]?d?(d.p(g,v),v[0]&10&&A(d,1)):(d=Rp(g),d.c(),A(d,1),d.m(e,o)):d&&(Pe(),P(d,1,1,()=>{d=null}),Le()),g[1].isNew?h?(h.p(g,v),v[0]&2&&A(h,1)):(h=Hp(g),h.c(),A(h,1),h.m(e,null)):h&&(Pe(),P(h,1,1,()=>{h=null}),Le())},i(g){r||(A(f),A(i.$$.fragment,g),A(c),A(d),A(h),r=!0)},o(g){P(f),P(i.$$.fragment,g),P(c),P(d),P(h),r=!1},d(g){g&&k(e),f&&f.d(),q(i),c&&c.d(),d&&d.d(),h&&h.d(),a=!1,u()}}}function vT(n){let e,t=n[1].isNew?"New user":"Edit user",i;return{c(){e=_("h4"),i=F(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].isNew?"New user":"Edit user")&&ue(i,t)},d(s){s&&k(e)}}}function jp(n){let e,t,i,s,l,o,r,a,u;return o=new Mi({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[yT]},$$scope:{ctx:n}}}),{c(){e=_("button"),t=_("span"),i=T(),s=_("i"),l=T(),V(o.$$.fragment),r=T(),a=_("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),m(e,l),j(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[0]&2|c[1]&2&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&k(e),q(o),f&&k(r),f&&k(a)}}}function qp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=` Send verification email`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[16]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function yT(n){let e,t,i,s,l=!n[1].verified&&qp(n);return{c(){l&&l.c(),e=T(),t=_("button"),t.innerHTML=` - Delete`,p(t,"type","button"),p(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=G(t,"click",n[17]),i=!0)},p(o,r){o[1].verified?l&&(l.d(1),l=null):l?l.p(o,r):(l=qp(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function kT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&jp(n);return{c(){h&&h.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=F(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],ie(l,"btn-loading",n[5])},m(g,v){h&&h.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=G(t,"click",n[18]),c=!0)},p(g,v){g[1].isNew?h&&(Ae(),P(h,1,1,()=>{h=null}),Pe()):h?(h.p(g,v),v[0]&2&&A(h,1)):(h=jp(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=g[5]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&ie(l,"btn-loading",g[5])},i(g){f||(A(h),f=!0)},o(g){P(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function wT(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[kT],header:[vT],default:[bT]},$$scope:{ctx:n}};return e=new mi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1088&&(o.beforeHide=s[24]),l[0]&1966|l[1]&2&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[25](null),q(e,s)}}}function $T(n,e,t){let i;const s=on(),l="user_"+W.randomString(5);let o,r=new co,a=!1,u=!1,f="",c="",d="",h=!1,g=!0;function v(te){return y(te),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(te){hi({}),t(1,r=te!=null&&te.clone?te.clone():new co),C()}function C(){t(3,h=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function S(){if(a||!i)return;t(5,a=!0);const te={email:f};(r.isNew||h)&&(te.password=c,te.passwordConfirm=d);let J;r.isNew?J=ye.users.create(te):J=ye.users.update(r.id,te),J.then(async ge=>{g&&M(!1),t(6,u=!1),b(),cn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",ge)}).catch(ge=>{ye.errorResponseHandler(ge)}).finally(()=>{t(5,a=!1)})}function $(){!(r!=null&&r.id)||pi("Do you really want to delete the selected user?",()=>ye.users.delete(r.id).then(()=>{t(6,u=!1),b(),cn("Successfully deleted user."),s("delete",r)}).catch(te=>{ye.errorResponseHandler(te)}))}function M(te=!0){return ye.users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),te&&cn(`Successfully sent verification email to ${r.email}.`)}).catch(J=>{ye.errorResponseHandler(J)})}const D=()=>M(),E=()=>$(),O=()=>b();function L(){f=this.value,t(2,f)}function I(){h=this.checked,t(3,h)}function N(){c=this.value,t(7,c)}function B(){d=this.value,t(8,d)}function U(){g=this.checked,t(9,g)}const ee=()=>i&&u?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function K(te){de[te?"unshift":"push"](()=>{o=te,t(4,o)})}function se(te){rt.call(this,n,te)}function Y(te){rt.call(this,n,te)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||h||f!==r.email)},[b,r,f,h,o,a,u,c,d,g,i,l,S,$,M,v,D,E,O,L,I,N,B,U,ee,K,se,Y]}class ST extends Ee{constructor(e){super(),Oe(this,e,$T,wT,De,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Vp(n,e,t){const i=n.slice();return i[40]=e[t],i}function zp(n,e,t){const i=n.slice();return i[43]=e[t],i}function Bp(n,e,t){const i=n.slice();return i[43]=e[t],i}function CT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I=[],N=new Map,B,U,ee,K,se,Y,te,J,ge,_e,X=[],re=new Map,ve,H,pe,x,Q,$e;a=new Uo({}),a.$on("refresh",n[17]),g=new Bo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),g.$on("submit",n[19]);function je(be){n[20](be)}let Be={class:"col-type-text col-field-id",name:"id",$$slots:{default:[TT]},$$scope:{ctx:n}};n[4]!==void 0&&(Be.sort=n[4]),$=new sn({props:Be}),de.push(()=>Ie($,"sort",je));function Z(be){n[21](be)}let me={class:"col-type-email col-field-email",name:"email",$$slots:{default:[DT]},$$scope:{ctx:n}};n[4]!==void 0&&(me.sort=n[4]),E=new sn({props:me}),de.push(()=>Ie(E,"sort",Z));let ce=n[12];const we=be=>be[43].name;for(let be=0;beIe(U,"sort",Ze));function We(be){n[23](be)}let it={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[ET]},$$scope:{ctx:n}};n[4]!==void 0&&(it.sort=n[4]),se=new sn({props:it}),de.push(()=>Ie(se,"sort",We));let Ce=n[1];const ze=be=>be[40].id;for(let be=0;be',r=T(),V(a.$$.fragment),u=T(),f=_("div"),c=T(),d=_("button"),d.innerHTML=` - New user`,h=T(),V(g.$$.fragment),v=T(),b=_("div"),y=_("table"),C=_("thead"),S=_("tr"),V($.$$.fragment),D=T(),V(E.$$.fragment),L=T();for(let be=0;beM=!1)),$.$set(ct);const yt={};Fe[1]&131072&&(yt.$$scope={dirty:Fe,ctx:be}),!O&&Fe[0]&16&&(O=!0,yt.sort=be[4],He(()=>O=!1)),E.$set(yt),Fe[0]&4096&&(ce=be[12],I=vt(I,Fe,we,1,be,ce,N,S,Mn,Up,B,Bp));const at={};Fe[1]&131072&&(at.$$scope={dirty:Fe,ctx:be}),!ee&&Fe[0]&16&&(ee=!0,at.sort=be[4],He(()=>ee=!1)),U.$set(at);const Ot={};Fe[1]&131072&&(Ot.$$scope={dirty:Fe,ctx:be}),!Y&&Fe[0]&16&&(Y=!0,Ot.sort=be[4],He(()=>Y=!1)),se.$set(Ot),Fe[0]&5450&&(Ce=be[1],Ae(),X=vt(X,Fe,ze,1,be,Ce,re,_e,Gt,Jp,null,Vp),Pe(),!Ce.length&&Xe?Xe.p(be,Fe):Ce.length?Xe&&(Xe.d(1),Xe=null):(Xe=Wp(be),Xe.c(),Xe.m(_e,null))),Fe[0]&1024&&ie(y,"table-loading",be[10]),be[1].length?st?st.p(be,Fe):(st=Zp(be),st.c(),st.m(H.parentNode,H)):st&&(st.d(1),st=null),be[1].length&&be[13]?dt?dt.p(be,Fe):(dt=Gp(be),dt.c(),dt.m(pe.parentNode,pe)):dt&&(dt.d(1),dt=null)},i(be){if(!x){A(a.$$.fragment,be),A(g.$$.fragment,be),A($.$$.fragment,be),A(E.$$.fragment,be),A(U.$$.fragment,be),A(se.$$.fragment,be);for(let Fe=0;Fe + Delete`,p(t,"type","button"),p(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=G(t,"click",n[17]),i=!0)},p(o,r){o[1].verified?l&&(l.d(1),l=null):l?l.p(o,r):(l=qp(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function kT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&jp(n);return{c(){h&&h.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=F(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],ie(l,"btn-loading",n[5])},m(g,v){h&&h.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=G(t,"click",n[18]),c=!0)},p(g,v){g[1].isNew?h&&(Pe(),P(h,1,1,()=>{h=null}),Le()):h?(h.p(g,v),v[0]&2&&A(h,1)):(h=jp(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=g[5]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&ie(l,"btn-loading",g[5])},i(g){f||(A(h),f=!0)},o(g){P(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function wT(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[kT],header:[vT],default:[bT]},$$scope:{ctx:n}};return e=new mi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1088&&(o.beforeHide=s[24]),l[0]&1966|l[1]&2&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[25](null),q(e,s)}}}function $T(n,e,t){let i;const s=on(),l="user_"+W.randomString(5);let o,r=new co,a=!1,u=!1,f="",c="",d="",h=!1,g=!0;function v(te){return y(te),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(te){hi({}),t(1,r=te!=null&&te.clone?te.clone():new co),C()}function C(){t(3,h=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function S(){if(a||!i)return;t(5,a=!0);const te={email:f};(r.isNew||h)&&(te.password=c,te.passwordConfirm=d);let J;r.isNew?J=we.users.create(te):J=we.users.update(r.id,te),J.then(async _e=>{g&&M(!1),t(6,u=!1),b(),cn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",_e)}).catch(_e=>{we.errorResponseHandler(_e)}).finally(()=>{t(5,a=!1)})}function $(){!(r!=null&&r.id)||pi("Do you really want to delete the selected user?",()=>we.users.delete(r.id).then(()=>{t(6,u=!1),b(),cn("Successfully deleted user."),s("delete",r)}).catch(te=>{we.errorResponseHandler(te)}))}function M(te=!0){return we.users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),te&&cn(`Successfully sent verification email to ${r.email}.`)}).catch(J=>{we.errorResponseHandler(J)})}const D=()=>M(),E=()=>$(),O=()=>b();function L(){f=this.value,t(2,f)}function I(){h=this.checked,t(3,h)}function N(){c=this.value,t(7,c)}function B(){d=this.value,t(8,d)}function U(){g=this.checked,t(9,g)}const ee=()=>i&&u?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function K(te){pe[te?"unshift":"push"](()=>{o=te,t(4,o)})}function se(te){st.call(this,n,te)}function Y(te){st.call(this,n,te)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||h||f!==r.email)},[b,r,f,h,o,a,u,c,d,g,i,l,S,$,M,v,D,E,O,L,I,N,B,U,ee,K,se,Y]}class ST extends Ee{constructor(e){super(),Oe(this,e,$T,wT,De,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Vp(n,e,t){const i=n.slice();return i[40]=e[t],i}function zp(n,e,t){const i=n.slice();return i[43]=e[t],i}function Bp(n,e,t){const i=n.slice();return i[43]=e[t],i}function CT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I=[],N=new Map,B,U,ee,K,se,Y,te,J,_e,be,X=[],ae=new Map,ve,H,me,x,Q,Se;a=new Uo({}),a.$on("refresh",n[17]),g=new Bo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),g.$on("submit",n[19]);function je(ye){n[20](ye)}let Ue={class:"col-type-text col-field-id",name:"id",$$slots:{default:[TT]},$$scope:{ctx:n}};n[4]!==void 0&&(Ue.sort=n[4]),$=new sn({props:Ue}),pe.push(()=>Fe($,"sort",je));function Z(ye){n[21](ye)}let ge={class:"col-type-email col-field-email",name:"email",$$slots:{default:[DT]},$$scope:{ctx:n}};n[4]!==void 0&&(ge.sort=n[4]),E=new sn({props:ge}),pe.push(()=>Fe(E,"sort",Z));let ce=n[12];const $e=ye=>ye[43].name;for(let ye=0;yeFe(U,"sort",Ze));function We(ye){n[23](ye)}let tt={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[ET]},$$scope:{ctx:n}};n[4]!==void 0&&(tt.sort=n[4]),se=new sn({props:tt}),pe.push(()=>Fe(se,"sort",We));let Me=n[1];const ze=ye=>ye[40].id;for(let ye=0;ye',r=T(),V(a.$$.fragment),u=T(),f=_("div"),c=T(),d=_("button"),d.innerHTML=` + New user`,h=T(),V(g.$$.fragment),v=T(),b=_("div"),y=_("table"),C=_("thead"),S=_("tr"),V($.$$.fragment),D=T(),V(E.$$.fragment),L=T();for(let ye=0;yeM=!1)),$.$set(Dt);const dt={};Ne[1]&131072&&(dt.$$scope={dirty:Ne,ctx:ye}),!O&&Ne[0]&16&&(O=!0,dt.sort=ye[4],He(()=>O=!1)),E.$set(dt),Ne[0]&4096&&(ce=ye[12],I=yt(I,Ne,$e,1,ye,ce,N,S,Mn,Up,B,Bp));const lt={};Ne[1]&131072&&(lt.$$scope={dirty:Ne,ctx:ye}),!ee&&Ne[0]&16&&(ee=!0,lt.sort=ye[4],He(()=>ee=!1)),U.$set(lt);const Lt={};Ne[1]&131072&&(Lt.$$scope={dirty:Ne,ctx:ye}),!Y&&Ne[0]&16&&(Y=!0,Lt.sort=ye[4],He(()=>Y=!1)),se.$set(Lt),Ne[0]&5450&&(Me=ye[1],Pe(),X=yt(X,Ne,ze,1,ye,Me,ae,be,Zt,Jp,null,Vp),Le(),!Me.length&&Xe?Xe.p(ye,Ne):Me.length?Xe&&(Xe.d(1),Xe=null):(Xe=Wp(ye),Xe.c(),Xe.m(be,null))),Ne[0]&1024&&ie(y,"table-loading",ye[10]),ye[1].length?nt?nt.p(ye,Ne):(nt=Zp(ye),nt.c(),nt.m(H.parentNode,H)):nt&&(nt.d(1),nt=null),ye[1].length&&ye[13]?ut?ut.p(ye,Ne):(ut=Gp(ye),ut.c(),ut.m(me.parentNode,me)):ut&&(ut.d(1),ut=null)},i(ye){if(!x){A(a.$$.fragment,ye),A(g.$$.fragment,ye),A($.$$.fragment,ye),A(E.$$.fragment,ye),A(U.$$.fragment,ye),A(se.$$.fragment,ye);for(let Ne=0;Ne

    Loading users...

    `,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function TT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function DT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Up(n,e){let t,i,s,l,o,r,a,u=e[43].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=T(),r=_("span"),a=F("profile."),f=F(u),p(s,"class",l=W.getFieldTypeIcon(e[43].type)),p(r,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[43].type+" col-field-"+e[43].name),p(t,"name",d=e[43].name),this.first=t},m(h,g){w(h,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(h,g){e=h,g[0]&4096&&l!==(l=W.getFieldTypeIcon(e[43].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[43].name+"")&&ue(f,u),g[0]&4096&&c!==(c="col-type-"+e[43].type+" col-field-"+e[43].name)&&p(t,"class",c),g[0]&4096&&d!==(d=e[43].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function OT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function ET(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Wp(n){let e;function t(l,o){return l[10]?PT:AT}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function AT(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&Yp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=Yp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function PT(n){let e;return{c(){e=_("tr"),e.innerHTML=` - `},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Yp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[26]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Kp(n,e){let t,i,s;return i=new U_({props:{field:e[43],record:e[40].profile||{}}}),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[43]),o[0]&2&&(r.record=e[40].profile||{}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),q(i,l)}}}function Jp(n,e){let t,i,s,l,o,r,a,u=e[40].email+"",f,c,d,h,g=e[40].verified?"Verified":"Unverified",v,b,y=[],C=new Map,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y;s=new Qo({props:{id:e[40].id}});let te=e[12];const J=X=>X[43].name;for(let X=0;X