From f808ba58f933bf1a86277cb7e37617e29fe5152f Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Sat, 30 Nov 2024 13:59:12 -0600 Subject: [PATCH] --allow-empty --- fp/.obsidian/core-plugins.json | 51 +- fp/.obsidian/graph.json | 2 +- fp/.obsidian/workspace.json | 67 +- fp/Language/Typeclasses.md | 120 +- lum/lum/.obsidian/app.json | 10 +- lum/lum/.obsidian/appearance.json | 4 +- lum/lum/.obsidian/community-plugins.json | 3 + lum/lum/.obsidian/core-plugins.json | 50 +- .../.obsidian/plugins/obsidian-charts/main.js | 213 + .../plugins/obsidian-charts/manifest.json | 11 + .../plugins/obsidian-charts/styles.css | 30 + lum/lum/.obsidian/workspace.json | 57 +- lum/lum/EIR.md | 3 + lum/lum/eng/roadmap/Roadmap(s).md | 51 + lum/lum/meeting notes/11-20-2024.md | 9 + .../meeting notes/arliss 1-1/10-01-2024.md | 178 + orion/.obsidian/app.json | 4 + orion/.obsidian/appearance.json | 8 + orion/.obsidian/community-plugins.json | 3 + orion/.obsidian/core-plugins.json | 30 + orion/.obsidian/graph.json | 22 + .../plugins/obsidian-kanban/data.json | 3 + .../.obsidian/plugins/obsidian-kanban/main.js | 153 + .../plugins/obsidian-kanban/manifest.json | 11 + .../plugins/obsidian-kanban/styles.css | 1 + orion/.obsidian/themes/Atom/manifest.json | 6 + orion/.obsidian/themes/Atom/theme.css | 339 + .../.obsidian/themes/Blue Topaz/manifest.json | 7 + orion/.obsidian/themes/Blue Topaz/theme.css | 29701 ++++++++++++++++ .../themes/Obsidian Nord/manifest.json | 7 + .../.obsidian/themes/Obsidian Nord/theme.css | 525 + orion/.obsidian/workspace.json | 190 + orion/Movie.md | 3 + orion/board.md | 61 + 34 files changed, 31851 insertions(+), 82 deletions(-) create mode 100644 lum/lum/.obsidian/community-plugins.json create mode 100644 lum/lum/.obsidian/plugins/obsidian-charts/main.js create mode 100644 lum/lum/.obsidian/plugins/obsidian-charts/manifest.json create mode 100644 lum/lum/.obsidian/plugins/obsidian-charts/styles.css create mode 100644 lum/lum/EIR.md create mode 100644 lum/lum/eng/roadmap/Roadmap(s).md create mode 100644 lum/lum/meeting notes/11-20-2024.md create mode 100644 lum/lum/meeting notes/arliss 1-1/10-01-2024.md create mode 100644 orion/.obsidian/app.json create mode 100644 orion/.obsidian/appearance.json create mode 100644 orion/.obsidian/community-plugins.json create mode 100644 orion/.obsidian/core-plugins.json create mode 100644 orion/.obsidian/graph.json create mode 100644 orion/.obsidian/plugins/obsidian-kanban/data.json create mode 100644 orion/.obsidian/plugins/obsidian-kanban/main.js create mode 100644 orion/.obsidian/plugins/obsidian-kanban/manifest.json create mode 100644 orion/.obsidian/plugins/obsidian-kanban/styles.css create mode 100644 orion/.obsidian/themes/Atom/manifest.json create mode 100644 orion/.obsidian/themes/Atom/theme.css create mode 100644 orion/.obsidian/themes/Blue Topaz/manifest.json create mode 100644 orion/.obsidian/themes/Blue Topaz/theme.css create mode 100644 orion/.obsidian/themes/Obsidian Nord/manifest.json create mode 100644 orion/.obsidian/themes/Obsidian Nord/theme.css create mode 100644 orion/.obsidian/workspace.json create mode 100644 orion/Movie.md create mode 100644 orion/board.md diff --git a/fp/.obsidian/core-plugins.json b/fp/.obsidian/core-plugins.json index 5ecd624..2d3ffbd 100644 --- a/fp/.obsidian/core-plugins.json +++ b/fp/.obsidian/core-plugins.json @@ -1,21 +1,30 @@ -[ - "file-explorer", - "global-search", - "switcher", - "graph", - "backlink", - "canvas", - "outgoing-link", - "tag-pane", - "page-preview", - "daily-notes", - "templates", - "note-composer", - "command-palette", - "editor-status", - "bookmarks", - "outline", - "word-count", - "file-recovery", - "publish" -] \ No newline at end of file +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "properties": false, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": true, + "sync": false +} \ No newline at end of file diff --git a/fp/.obsidian/graph.json b/fp/.obsidian/graph.json index 9e9cd95..c7c802e 100644 --- a/fp/.obsidian/graph.json +++ b/fp/.obsidian/graph.json @@ -17,6 +17,6 @@ "repelStrength": 10, "linkStrength": 1, "linkDistance": 250, - "scale": 0.36924895020525084, + "scale": 0.7983846258042356, "close": true } \ No newline at end of file diff --git a/fp/.obsidian/workspace.json b/fp/.obsidian/workspace.json index 031017d..9ac4d34 100644 --- a/fp/.obsidian/workspace.json +++ b/fp/.obsidian/workspace.json @@ -13,13 +13,28 @@ "state": { "type": "markdown", "state": { - "file": "Language/Data Structures/type.md", - "mode": "preview", + "file": "Language/Typeclasses.md", + "mode": "source", "source": true - } + }, + "icon": "lucide-file", + "title": "Typeclasses" + } + }, + { + "id": "f250ca3735f72269", + "type": "leaf", + "state": { + "type": "release-notes", + "state": { + "currentVersion": "1.7.6" + }, + "icon": "lucide-file", + "title": "Release Notes 1.7.6" } } - ] + ], + "currentTab": 1 } ], "direction": "vertical" @@ -39,7 +54,9 @@ "type": "file-explorer", "state": { "sortOrder": "alphabetical" - } + }, + "icon": "lucide-folder-closed", + "title": "Files" } }, { @@ -54,7 +71,9 @@ "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical" - } + }, + "icon": "lucide-search", + "title": "Search" } }, { @@ -62,7 +81,9 @@ "type": "leaf", "state": { "type": "bookmarks", - "state": {} + "state": {}, + "icon": "lucide-bookmark", + "title": "Bookmarks" } } ] @@ -85,7 +106,7 @@ "state": { "type": "backlink", "state": { - "file": "Language/Data Structures/type.md", + "file": "Language/Typeclasses.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -93,7 +114,9 @@ "searchQuery": "", "backlinkCollapsed": false, "unlinkedCollapsed": true - } + }, + "icon": "links-coming-in", + "title": "Backlinks for Typeclasses" } }, { @@ -102,10 +125,12 @@ "state": { "type": "outgoing-link", "state": { - "file": "Language/Data Structures/type.md", + "file": "Language/Typeclasses.md", "linksCollapsed": false, "unlinkedCollapsed": true - } + }, + "icon": "links-going-out", + "title": "Outgoing links from Typeclasses" } }, { @@ -116,7 +141,9 @@ "state": { "sortOrder": "frequency", "useHierarchy": true - } + }, + "icon": "lucide-tags", + "title": "Tags" } }, { @@ -125,8 +152,10 @@ "state": { "type": "outline", "state": { - "file": "Language/Data Structures/type.md" - } + "file": "Language/Typeclasses.md" + }, + "icon": "lucide-list", + "title": "Outline of Typeclasses" } } ] @@ -148,11 +177,14 @@ "publish:Publish changes...": false } }, - "active": "6465d16034124b8f", + "active": "f250ca3735f72269", "lastOpenFiles": [ + "Language/Type Signature.md", + "Language/Typeclasses.md", "Language/Data Structures/data.md", - "Language/Data Structures/Records.md", "Language/Data Structures/newtype.md", + "Language/Data Structures/Records.md", + "Language/Data Structures/type.md", "Monads/Identity.md", "Monads/Untitled", "Data/Void.md", @@ -174,13 +206,10 @@ "Classes/Foldable.md", "Classes/Hashable.md", "Classes/Enum/Enum.md", - "Classes/Enum/BoundedEnum.md", "Classes/Enum", "Language/Generics", - "Language/Functions/Defining/Guard Clause.md", "Examples/Chess Engine", "Examples", - "Language/Functions/Defining/Pattern Matching.md", "Monads/Transformers", "Classes/Collapsing", "Classes/Bind", diff --git a/fp/Language/Typeclasses.md b/fp/Language/Typeclasses.md index 9ac5365..d34ceb6 100644 --- a/fp/Language/Typeclasses.md +++ b/fp/Language/Typeclasses.md @@ -1,2 +1,118 @@ -# What -# Why \ No newline at end of file +Typeclasses define shared behavior in an abstract way, allowing us to use the same function on different types. We can use typeclass constraints to specify that a type parameter can be any type that implements the class. + +> [!note] +> Typeclasses are very similar to interfaces in other languages, but with some differences. + +# Defining a Typeclass +Class definitions have several components: +- Class constraints +- Class name +- Type parameters +- Functional dependencies +- List of functions + +## Class constraints +```haskell +class Y a <= X a +``` +In order for the implementation of `X` for `a` to be valid, `a` must also implement `Y`. + +## Class name +```haskell +class X a b c +class Y a <= X a +class X +``` +Are all valid definitions of a class named `X`. + +## Type parameters +```haskell +class X a +``` +Classes can have zero, one, or more type parameters. A single type parameter is likely the most common, which signifies "the interface `X` for some `a`." + +Still common, but less so, are multiple type parameters: +```haskell +class X a b c +``` + +Here the interface applies to "any combination of a, b, and c." + +## Functional dependencies +Functional dependencies allow us to embed "implies"-ness to the class definition, for example in: +```haskell +class X a b | a -> b +``` +We're saying that if we're calling a function in `X` and we know `a` then we also know `b`. There can't be multiple implementations for the same type `a` and different `b`s. + +We could also say "if we know either a or b, we know the other" +```haskell +class X a b | a -> b, b -> a +``` + +"if we know a and b, then we know c" +```haskell +class X a b c | a b -> c +``` + +"if we know a or b, then we know c" +```haskell +class X a b c | a -> c, b -> c +``` + +These most often are used in classes with [[Row Types]] as parameters. + +This type class is invalid: +```haskell +class X a where + addFoo :: Record a -> Record (foo :: Unit | a) + +instance X () where + addFoo {} = {foo: unit} +``` + +```text +[ERROR 1/1 InvalidInstanceHead] + + v + 1 instance X () where + 2 addFoo {} = {foo: unit} + ^ + + Type class instance head is invalid due to use of type + () + All types appearing in instance declarations must be of the form T a_1 .. a_n, where each type a_i is of the same form, unless the type is fully determined by other type class arguments via functional dependencies. + in type class instance + X () +``` + +This happens because a row type like `()` is structural and not strictly _unique_ in the same way normal types are. + +This is where [[RowList]] comes in, adding the ability to declare type classes on normal types, which translate to row types: + +```haskell +import Prim.RowList as RowList + +class (RowToList a rl) <= X a rl where + addFoo :: Record a -> Record (foo :: Unit | a) + +instance (RowToList a rl) => X a RowList.Nil where + addFoo {} = {foo: unit} +``` + +Now our typeclass is valid for all rows whose RowList representation is `RowList.Nil`. (In this specific case this can only be empty row `()`) + +If we added the functional dependency `rl -> a`, then we can actually use row types in the instance: + +```haskell +import Prim.RowList as RowList + +class (RowToList a rl) <= X a rl | rl -> a where + addFoo :: Record a -> Record (foo :: Unit | a) + +instance X () RowList.Nil where + addFoo {} = {foo: unit} +``` + +Because we've told the type system how to unambiguously choose the correct class instance for a given row type. + diff --git a/lum/lum/.obsidian/app.json b/lum/lum/.obsidian/app.json index e609a07..233ad97 100644 --- a/lum/lum/.obsidian/app.json +++ b/lum/lum/.obsidian/app.json @@ -1,3 +1,11 @@ { - "promptDelete": false + "promptDelete": false, + "livePreview": false, + "pdfExportSettings": { + "includeName": true, + "pageSize": "Letter", + "landscape": false, + "margin": "0", + "downscalePercent": 100 + } } \ No newline at end of file diff --git a/lum/lum/.obsidian/appearance.json b/lum/lum/.obsidian/appearance.json index 9e26dfe..4be7969 100644 --- a/lum/lum/.obsidian/appearance.json +++ b/lum/lum/.obsidian/appearance.json @@ -1 +1,3 @@ -{} \ No newline at end of file +{ + "theme": "obsidian" +} \ No newline at end of file diff --git a/lum/lum/.obsidian/community-plugins.json b/lum/lum/.obsidian/community-plugins.json new file mode 100644 index 0000000..8a47943 --- /dev/null +++ b/lum/lum/.obsidian/community-plugins.json @@ -0,0 +1,3 @@ +[ + "obsidian-charts" +] \ No newline at end of file diff --git a/lum/lum/.obsidian/core-plugins.json b/lum/lum/.obsidian/core-plugins.json index 9405bfd..436f43c 100644 --- a/lum/lum/.obsidian/core-plugins.json +++ b/lum/lum/.obsidian/core-plugins.json @@ -1,20 +1,30 @@ -[ - "file-explorer", - "global-search", - "switcher", - "graph", - "backlink", - "canvas", - "outgoing-link", - "tag-pane", - "page-preview", - "daily-notes", - "templates", - "note-composer", - "command-palette", - "editor-status", - "bookmarks", - "outline", - "word-count", - "file-recovery" -] \ No newline at end of file +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "properties": false, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": false +} \ No newline at end of file diff --git a/lum/lum/.obsidian/plugins/obsidian-charts/main.js b/lum/lum/.obsidian/plugins/obsidian-charts/main.js new file mode 100644 index 0000000..ac61f02 --- /dev/null +++ b/lum/lum/.obsidian/plugins/obsidian-charts/main.js @@ -0,0 +1,213 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source visit the plugins github repository (https://github.com/phibr0/obsidian-dictionary) +*/ + +var ob=Object.create;var Hi=Object.defineProperty,ab=Object.defineProperties,lb=Object.getOwnPropertyDescriptor,cb=Object.getOwnPropertyDescriptors,hb=Object.getOwnPropertyNames,Us=Object.getOwnPropertySymbols,ub=Object.getPrototypeOf,Yo=Object.prototype.hasOwnProperty,Vc=Object.prototype.propertyIsEnumerable;var Yc=(n,t,e)=>t in n?Hi(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Nn=(n,t)=>{for(var e in t||(t={}))Yo.call(t,e)&&Yc(n,e,t[e]);if(Us)for(var e of Us(t))Vc.call(t,e)&&Yc(n,e,t[e]);return n},_i=(n,t)=>ab(n,cb(t)),Xc=n=>Hi(n,"__esModule",{value:!0});var qc=(n,t)=>{var e={};for(var i in n)Yo.call(n,i)&&t.indexOf(i)<0&&(e[i]=n[i]);if(n!=null&&Us)for(var i of Us(n))t.indexOf(i)<0&&Vc.call(n,i)&&(e[i]=n[i]);return e};var Xo=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),fb=(n,t)=>{Xc(n);for(var e in t)Hi(n,e,{get:t[e],enumerable:!0})},db=(n,t,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of hb(t))!Yo.call(n,i)&&i!=="default"&&Hi(n,i,{get:()=>t[i],enumerable:!(e=lb(t,i))||e.enumerable});return n},ze=n=>db(Xc(Hi(n!=null?ob(ub(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var Ku=Xo((qa,Ga)=>{(function(n,t){typeof qa=="object"&&typeof Ga!="undefined"?Ga.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.chroma=t())})(qa,function(){"use strict";for(var n=function(u,d,b){return d===void 0&&(d=0),b===void 0&&(b=1),ub?b:u},t=n,e=function(u){u._clipped=!1,u._unclipped=u.slice(0);for(var d=0;d<=3;d++)d<3?((u[d]<0||u[d]>255)&&(u._clipped=!0),u[d]=t(u[d],0,255)):d===3&&(u[d]=t(u[d],0,1));return u},i={},s=0,r=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];s=3?Array.prototype.slice.call(u):l(u[0])=="object"&&d?d.split("").filter(function(b){return u[0][b]!==void 0}).map(function(b){return u[0][b]}):u[0]},h=a,f=function(u){if(u.length<2)return null;var d=u.length-1;return h(u[d])=="string"?u[d].toLowerCase():null},g=Math.PI,p={clip_rgb:e,limit:n,type:a,unpack:c,last:f,PI:g,TWOPI:g*2,PITHIRD:g/3,DEG2RAD:g/180,RAD2DEG:180/g},m={format:{},autodetect:[]},y=p.last,S=p.clip_rgb,M=p.type,C=m,F=function(){for(var d=[],b=arguments.length;b--;)d[b]=arguments[b];var _=this;if(M(d[0])==="object"&&d[0].constructor&&d[0].constructor===this.constructor)return d[0];var P=y(d),T=!1;if(!P){T=!0,C.sorted||(C.autodetect=C.autodetect.sort(function(B,q){return q.p-B.p}),C.sorted=!0);for(var w=0,A=C.autodetect;w4?u[4]:1;return T===1?[0,0,0,w]:[b>=1?0:255*(1-b)*(1-T),_>=1?0:255*(1-_)*(1-T),P>=1?0:255*(1-P)*(1-T),w]},Pt=rt,zt=$,et=D,Et=m,St=p.unpack,re=p.type,ye=it;et.prototype.cmyk=function(){return ye(this._rgb)},zt.cmyk=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(et,[null].concat(u,["cmyk"])))},Et.format.cmyk=Pt,Et.autodetect.push({p:2,test:function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];if(u=St(u,"cmyk"),re(u)==="array"&&u.length===4)return"cmyk"}});var ot=p.unpack,Lt=p.last,Bt=function(u){return Math.round(u*100)/100},Ut=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=ot(u,"hsla"),_=Lt(u)||"lsa";return b[0]=Bt(b[0]||0),b[1]=Bt(b[1]*100)+"%",b[2]=Bt(b[2]*100)+"%",_==="hsla"||b.length>3&&b[3]<1?(b[3]=b.length>3?b[3]:1,_="hsla"):b.length=3,_+"("+b.join(",")+")"},Qt=Ut,k=p.unpack,v=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];u=k(u,"rgba");var b=u[0],_=u[1],P=u[2];b/=255,_/=255,P/=255;var T=Math.min(b,_,P),w=Math.max(b,_,P),A=(w+T)/2,L,j;return w===T?(L=0,j=Number.NaN):L=A<.5?(w-T)/(w+T):(w-T)/(2-w-T),b==w?j=(_-P)/(w-T):_==w?j=2+(P-b)/(w-T):P==w&&(j=4+(b-_)/(w-T)),j*=60,j<0&&(j+=360),u.length>3&&u[3]!==void 0?[j,L,A,u[3]]:[j,L,A]},x=v,R=p.unpack,E=p.last,O=Qt,Z=x,V=Math.round,J=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=R(u,"rgba"),_=E(u)||"rgb";return _.substr(0,3)=="hsl"?O(Z(b),_):(b[0]=V(b[0]),b[1]=V(b[1]),b[2]=V(b[2]),(_==="rgba"||b.length>3&&b[3]<1)&&(b[3]=b.length>3?b[3]:1,_="rgba"),_+"("+b.slice(0,_==="rgb"?3:4).join(",")+")")},tt=J,xt=p.unpack,Ht=Math.round,Ot=function(){for(var u,d=[],b=arguments.length;b--;)d[b]=arguments[b];d=xt(d,"hsl");var _=d[0],P=d[1],T=d[2],w,A,L;if(P===0)w=A=L=T*255;else{var j=[0,0,0],B=[0,0,0],q=T<.5?T*(1+P):T+P-T*P,H=2*T-q,Q=_/360;j[0]=Q+1/3,j[1]=Q,j[2]=Q-1/3;for(var K=0;K<3;K++)j[K]<0&&(j[K]+=1),j[K]>1&&(j[K]-=1),6*j[K]<1?B[K]=H+(q-H)*6*j[K]:2*j[K]<1?B[K]=q:3*j[K]<2?B[K]=H+(q-H)*(2/3-j[K])*6:B[K]=H;u=[Ht(B[0]*255),Ht(B[1]*255),Ht(B[2]*255)],w=u[0],A=u[1],L=u[2]}return d.length>3?[w,A,L,d[3]]:[w,A,L,1]},Yt=Ot,Xt=Yt,ue=m,ke=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,xe=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,Rn=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,un=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Ln=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,je=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,$i=Math.round,Fn=function(u){u=u.toLowerCase().trim();var d;if(ue.format.named)try{return ue.format.named(u)}catch(K){}if(d=u.match(ke)){for(var b=d.slice(1,4),_=0;_<3;_++)b[_]=+b[_];return b[3]=1,b}if(d=u.match(xe)){for(var P=d.slice(1,5),T=0;T<4;T++)P[T]=+P[T];return P}if(d=u.match(Rn)){for(var w=d.slice(1,4),A=0;A<3;A++)w[A]=$i(w[A]*2.55);return w[3]=1,w}if(d=u.match(un)){for(var L=d.slice(1,5),j=0;j<3;j++)L[j]=$i(L[j]*2.55);return L[3]=+L[3],L}if(d=u.match(Ln)){var B=d.slice(1,4);B[1]*=.01,B[2]*=.01;var q=Xt(B);return q[3]=1,q}if(d=u.match(je)){var H=d.slice(1,4);H[1]*=.01,H[2]*=.01;var Q=Xt(H);return Q[3]=+d[4],Q}};Fn.test=function(u){return ke.test(u)||xe.test(u)||Rn.test(u)||un.test(u)||Ln.test(u)||je.test(u)};var oi=Fn,$s=$,ji=D,ai=m,qe=p.type,In=tt,$n=oi;ji.prototype.css=function(u){return In(this._rgb,u)},$s.css=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(ji,[null].concat(u,["css"])))},ai.format.css=$n,ai.autodetect.push({p:5,test:function(u){for(var d=[],b=arguments.length-1;b-- >0;)d[b]=arguments[b+1];if(!d.length&&qe(u)==="string"&&$n.test(u))return"css"}});var li=D,js=$,fn=m,ce=p.unpack;fn.format.gl=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=ce(u,"rgba");return b[0]*=255,b[1]*=255,b[2]*=255,b},js.gl=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(li,[null].concat(u,["gl"])))},li.prototype.gl=function(){var u=this._rgb;return[u[0]/255,u[1]/255,u[2]/255,u[3]]};var bt=p.unpack,te=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=bt(u,"rgb"),_=b[0],P=b[1],T=b[2],w=Math.min(_,P,T),A=Math.max(_,P,T),L=A-w,j=L*100/255,B=w/(255-L)*100,q;return L===0?q=Number.NaN:(_===A&&(q=(P-T)/L),P===A&&(q=2+(T-_)/L),T===A&&(q=4+(_-P)/L),q*=60,q<0&&(q+=360)),[q,j,B]},dn=te,pe=p.unpack,zs=Math.floor,vd=function(){for(var u,d,b,_,P,T,w=[],A=arguments.length;A--;)w[A]=arguments[A];w=pe(w,"hcg");var L=w[0],j=w[1],B=w[2],q,H,Q;B=B*255;var K=j*255;if(j===0)q=H=Q=B;else{L===360&&(L=0),L>360&&(L-=360),L<0&&(L+=360),L/=60;var ct=zs(L),mt=L-ct,_t=B*(1-j),Mt=_t+K*(1-mt),oe=_t+K*mt,ne=_t+K;switch(ct){case 0:u=[ne,oe,_t],q=u[0],H=u[1],Q=u[2];break;case 1:d=[Mt,ne,_t],q=d[0],H=d[1],Q=d[2];break;case 2:b=[_t,ne,oe],q=b[0],H=b[1],Q=b[2];break;case 3:_=[_t,Mt,ne],q=_[0],H=_[1],Q=_[2];break;case 4:P=[oe,_t,ne],q=P[0],H=P[1],Q=P[2];break;case 5:T=[ne,_t,Mt],q=T[0],H=T[1],Q=T[2];break}}return[q,H,Q,w.length>3?w[3]:1]},_d=vd,yd=p.unpack,xd=p.type,wd=$,Al=D,Rl=m,kd=dn;Al.prototype.hcg=function(){return kd(this._rgb)},wd.hcg=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(Al,[null].concat(u,["hcg"])))},Rl.format.hcg=_d,Rl.autodetect.push({p:1,test:function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];if(u=yd(u,"hcg"),xd(u)==="array"&&u.length===3)return"hcg"}});var Sd=p.unpack,Md=p.last,Bs=Math.round,Cd=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=Sd(u,"rgba"),_=b[0],P=b[1],T=b[2],w=b[3],A=Md(u)||"auto";w===void 0&&(w=1),A==="auto"&&(A=w<1?"rgba":"rgb"),_=Bs(_),P=Bs(P),T=Bs(T);var L=_<<16|P<<8|T,j="000000"+L.toString(16);j=j.substr(j.length-6);var B="0"+Bs(w*255).toString(16);switch(B=B.substr(B.length-2),A.toLowerCase()){case"rgba":return"#"+j+B;case"argb":return"#"+B+j;default:return"#"+j}},Ll=Cd,Pd=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Td=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Dd=function(u){if(u.match(Pd)){(u.length===4||u.length===7)&&(u=u.substr(1)),u.length===3&&(u=u.split(""),u=u[0]+u[0]+u[1]+u[1]+u[2]+u[2]);var d=parseInt(u,16),b=d>>16,_=d>>8&255,P=d&255;return[b,_,P,1]}if(u.match(Td)){(u.length===5||u.length===9)&&(u=u.substr(1)),u.length===4&&(u=u.split(""),u=u[0]+u[0]+u[1]+u[1]+u[2]+u[2]+u[3]+u[3]);var T=parseInt(u,16),w=T>>24&255,A=T>>16&255,L=T>>8&255,j=Math.round((T&255)/255*100)/100;return[w,A,L,j]}throw new Error("unknown hex color: "+u)},Fl=Dd,Ed=$,Il=D,Od=p.type,$l=m,Ad=Ll;Il.prototype.hex=function(u){return Ad(this._rgb,u)},Ed.hex=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(Il,[null].concat(u,["hex"])))},$l.format.hex=Fl,$l.autodetect.push({p:4,test:function(u){for(var d=[],b=arguments.length-1;b-- >0;)d[b]=arguments[b+1];if(!d.length&&Od(u)==="string"&&[3,4,5,6,7,8,9].indexOf(u.length)>=0)return"hex"}});var Rd=p.unpack,jl=p.TWOPI,Ld=Math.min,Fd=Math.sqrt,Id=Math.acos,$d=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=Rd(u,"rgb"),_=b[0],P=b[1],T=b[2];_/=255,P/=255,T/=255;var w,A=Ld(_,P,T),L=(_+P+T)/3,j=L>0?1-A/L:0;return j===0?w=NaN:(w=(_-P+(_-T))/2,w/=Fd((_-P)*(_-P)+(_-T)*(P-T)),w=Id(w),T>P&&(w=jl-w),w/=jl),[w*360,j,L]},jd=$d,zd=p.unpack,vo=p.limit,ci=p.TWOPI,_o=p.PITHIRD,hi=Math.cos,Bd=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];u=zd(u,"hsi");var b=u[0],_=u[1],P=u[2],T,w,A;return isNaN(b)&&(b=0),isNaN(_)&&(_=0),b>360&&(b-=360),b<0&&(b+=360),b/=360,b<1/3?(A=(1-_)/3,T=(1+_*hi(ci*b)/hi(_o-ci*b))/3,w=1-(A+T)):b<2/3?(b-=1/3,T=(1-_)/3,w=(1+_*hi(ci*b)/hi(_o-ci*b))/3,A=1-(T+w)):(b-=2/3,w=(1-_)/3,A=(1+_*hi(ci*b)/hi(_o-ci*b))/3,T=1-(w+A)),T=vo(P*T*3),w=vo(P*w*3),A=vo(P*A*3),[T*255,w*255,A*255,u.length>3?u[3]:1]},Nd=Bd,Hd=p.unpack,Wd=p.type,Vd=$,zl=D,Bl=m,Yd=jd;zl.prototype.hsi=function(){return Yd(this._rgb)},Vd.hsi=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(zl,[null].concat(u,["hsi"])))},Bl.format.hsi=Nd,Bl.autodetect.push({p:2,test:function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];if(u=Hd(u,"hsi"),Wd(u)==="array"&&u.length===3)return"hsi"}});var Xd=p.unpack,qd=p.type,Gd=$,Nl=D,Hl=m,Ud=x;Nl.prototype.hsl=function(){return Ud(this._rgb)},Gd.hsl=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(Nl,[null].concat(u,["hsl"])))},Hl.format.hsl=Yt,Hl.autodetect.push({p:2,test:function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];if(u=Xd(u,"hsl"),qd(u)==="array"&&u.length===3)return"hsl"}});var Kd=p.unpack,Zd=Math.min,Jd=Math.max,Qd=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];u=Kd(u,"rgb");var b=u[0],_=u[1],P=u[2],T=Zd(b,_,P),w=Jd(b,_,P),A=w-T,L,j,B;return B=w/255,w===0?(L=Number.NaN,j=0):(j=A/w,b===w&&(L=(_-P)/A),_===w&&(L=2+(P-b)/A),P===w&&(L=4+(b-_)/A),L*=60,L<0&&(L+=360)),[L,j,B]},tp=Qd,ep=p.unpack,np=Math.floor,ip=function(){for(var u,d,b,_,P,T,w=[],A=arguments.length;A--;)w[A]=arguments[A];w=ep(w,"hsv");var L=w[0],j=w[1],B=w[2],q,H,Q;if(B*=255,j===0)q=H=Q=B;else{L===360&&(L=0),L>360&&(L-=360),L<0&&(L+=360),L/=60;var K=np(L),ct=L-K,mt=B*(1-j),_t=B*(1-j*ct),Mt=B*(1-j*(1-ct));switch(K){case 0:u=[B,Mt,mt],q=u[0],H=u[1],Q=u[2];break;case 1:d=[_t,B,mt],q=d[0],H=d[1],Q=d[2];break;case 2:b=[mt,B,Mt],q=b[0],H=b[1],Q=b[2];break;case 3:_=[mt,_t,B],q=_[0],H=_[1],Q=_[2];break;case 4:P=[Mt,mt,B],q=P[0],H=P[1],Q=P[2];break;case 5:T=[B,mt,_t],q=T[0],H=T[1],Q=T[2];break}}return[q,H,Q,w.length>3?w[3]:1]},sp=ip,rp=p.unpack,op=p.type,ap=$,Wl=D,Vl=m,lp=tp;Wl.prototype.hsv=function(){return lp(this._rgb)},ap.hsv=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(Wl,[null].concat(u,["hsv"])))},Vl.format.hsv=sp,Vl.autodetect.push({p:2,test:function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];if(u=rp(u,"hsv"),op(u)==="array"&&u.length===3)return"hsv"}});var Ns={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},ui=Ns,cp=p.unpack,Yl=Math.pow,hp=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=cp(u,"rgb"),_=b[0],P=b[1],T=b[2],w=up(_,P,T),A=w[0],L=w[1],j=w[2],B=116*L-16;return[B<0?0:B,500*(A-L),200*(L-j)]},yo=function(u){return(u/=255)<=.04045?u/12.92:Yl((u+.055)/1.055,2.4)},xo=function(u){return u>ui.t3?Yl(u,1/3):u/ui.t2+ui.t0},up=function(u,d,b){u=yo(u),d=yo(d),b=yo(b);var _=xo((.4124564*u+.3575761*d+.1804375*b)/ui.Xn),P=xo((.2126729*u+.7151522*d+.072175*b)/ui.Yn),T=xo((.0193339*u+.119192*d+.9503041*b)/ui.Zn);return[_,P,T]},Xl=hp,fi=Ns,fp=p.unpack,dp=Math.pow,pp=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];u=fp(u,"lab");var b=u[0],_=u[1],P=u[2],T,w,A,L,j,B;return w=(b+16)/116,T=isNaN(_)?w:w+_/500,A=isNaN(P)?w:w-P/200,w=fi.Yn*ko(w),T=fi.Xn*ko(T),A=fi.Zn*ko(A),L=wo(3.2404542*T-1.5371385*w-.4985314*A),j=wo(-.969266*T+1.8760108*w+.041556*A),B=wo(.0556434*T-.2040259*w+1.0572252*A),[L,j,B,u.length>3?u[3]:1]},wo=function(u){return 255*(u<=.00304?12.92*u:1.055*dp(u,1/2.4)-.055)},ko=function(u){return u>fi.t1?u*u*u:fi.t2*(u-fi.t0)},ql=pp,gp=p.unpack,mp=p.type,bp=$,Gl=D,Ul=m,vp=Xl;Gl.prototype.lab=function(){return vp(this._rgb)},bp.lab=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(Gl,[null].concat(u,["lab"])))},Ul.format.lab=ql,Ul.autodetect.push({p:2,test:function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];if(u=gp(u,"lab"),mp(u)==="array"&&u.length===3)return"lab"}});var _p=p.unpack,yp=p.RAD2DEG,xp=Math.sqrt,wp=Math.atan2,kp=Math.round,Sp=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=_p(u,"lab"),_=b[0],P=b[1],T=b[2],w=xp(P*P+T*T),A=(wp(T,P)*yp+360)%360;return kp(w*1e4)===0&&(A=Number.NaN),[_,w,A]},Kl=Sp,Mp=p.unpack,Cp=Xl,Pp=Kl,Tp=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=Mp(u,"rgb"),_=b[0],P=b[1],T=b[2],w=Cp(_,P,T),A=w[0],L=w[1],j=w[2];return Pp(A,L,j)},Dp=Tp,Ep=p.unpack,Op=p.DEG2RAD,Ap=Math.sin,Rp=Math.cos,Lp=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=Ep(u,"lch"),_=b[0],P=b[1],T=b[2];return isNaN(T)&&(T=0),T=T*Op,[_,Rp(T)*P,Ap(T)*P]},Zl=Lp,Fp=p.unpack,Ip=Zl,$p=ql,jp=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];u=Fp(u,"lch");var b=u[0],_=u[1],P=u[2],T=Ip(b,_,P),w=T[0],A=T[1],L=T[2],j=$p(w,A,L),B=j[0],q=j[1],H=j[2];return[B,q,H,u.length>3?u[3]:1]},Jl=jp,zp=p.unpack,Bp=Jl,Np=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=zp(u,"hcl").reverse();return Bp.apply(void 0,b)},Hp=Np,Wp=p.unpack,Vp=p.type,Ql=$,Hs=D,So=m,tc=Dp;Hs.prototype.lch=function(){return tc(this._rgb)},Hs.prototype.hcl=function(){return tc(this._rgb).reverse()},Ql.lch=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(Hs,[null].concat(u,["lch"])))},Ql.hcl=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(Hs,[null].concat(u,["hcl"])))},So.format.lch=Jl,So.format.hcl=Hp,["lch","hcl"].forEach(function(u){return So.autodetect.push({p:2,test:function(){for(var d=[],b=arguments.length;b--;)d[b]=arguments[b];if(d=Wp(d,u),Vp(d)==="array"&&d.length===3)return u}})});var Yp={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},ec=Yp,Xp=D,nc=m,qp=p.type,zi=ec,Gp=Fl,Up=Ll;Xp.prototype.name=function(){for(var u=Up(this._rgb,"rgb"),d=0,b=Object.keys(zi);d0;)d[b]=arguments[b+1];if(!d.length&&qp(u)==="string"&&zi[u.toLowerCase()])return"named"}});var Kp=p.unpack,Zp=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=Kp(u,"rgb"),_=b[0],P=b[1],T=b[2];return(_<<16)+(P<<8)+T},Jp=Zp,Qp=p.type,tg=function(u){if(Qp(u)=="number"&&u>=0&&u<=16777215){var d=u>>16,b=u>>8&255,_=u&255;return[d,b,_,1]}throw new Error("unknown num color: "+u)},eg=tg,ng=$,ic=D,sc=m,ig=p.type,sg=Jp;ic.prototype.num=function(){return sg(this._rgb)},ng.num=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(ic,[null].concat(u,["num"])))},sc.format.num=eg,sc.autodetect.push({p:5,test:function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];if(u.length===1&&ig(u[0])==="number"&&u[0]>=0&&u[0]<=16777215)return"num"}});var rg=$,Mo=D,rc=m,oc=p.unpack,ac=p.type,lc=Math.round;Mo.prototype.rgb=function(u){return u===void 0&&(u=!0),u===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(lc)},Mo.prototype.rgba=function(u){return u===void 0&&(u=!0),this._rgb.slice(0,4).map(function(d,b){return b<3?u===!1?d:lc(d):d})},rg.rgb=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(Mo,[null].concat(u,["rgb"])))},rc.format.rgb=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=oc(u,"rgba");return b[3]===void 0&&(b[3]=1),b},rc.autodetect.push({p:3,test:function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];if(u=oc(u,"rgba"),ac(u)==="array"&&(u.length===3||u.length===4&&ac(u[3])=="number"&&u[3]>=0&&u[3]<=1))return"rgb"}});var Ws=Math.log,og=function(u){var d=u/100,b,_,P;return d<66?(b=255,_=d<6?0:-155.25485562709179-.44596950469579133*(_=d-2)+104.49216199393888*Ws(_),P=d<20?0:-254.76935184120902+.8274096064007395*(P=d-10)+115.67994401066147*Ws(P)):(b=351.97690566805693+.114206453784165*(b=d-55)-40.25366309332127*Ws(b),_=325.4494125711974+.07943456536662342*(_=d-50)-28.0852963507957*Ws(_),P=255),[b,_,P,1]},cc=og,ag=cc,lg=p.unpack,cg=Math.round,hg=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];for(var b=lg(u,"rgb"),_=b[0],P=b[2],T=1e3,w=4e4,A=.4,L;w-T>A;){L=(w+T)*.5;var j=ag(L);j[2]/j[0]>=P/_?w=L:T=L}return cg(L)},ug=hg,Co=$,Vs=D,Po=m,fg=ug;Vs.prototype.temp=Vs.prototype.kelvin=Vs.prototype.temperature=function(){return fg(this._rgb)},Co.temp=Co.kelvin=Co.temperature=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(Vs,[null].concat(u,["temp"])))},Po.format.temp=Po.format.kelvin=Po.format.temperature=cc;var dg=p.unpack,To=Math.cbrt,pg=Math.pow,gg=Math.sign,mg=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=dg(u,"rgb"),_=b[0],P=b[1],T=b[2],w=[Do(_/255),Do(P/255),Do(T/255)],A=w[0],L=w[1],j=w[2],B=To(.4122214708*A+.5363325363*L+.0514459929*j),q=To(.2119034982*A+.6806995451*L+.1073969566*j),H=To(.0883024619*A+.2817188376*L+.6299787005*j);return[.2104542553*B+.793617785*q-.0040720468*H,1.9779984951*B-2.428592205*q+.4505937099*H,.0259040371*B+.7827717662*q-.808675766*H]},hc=mg;function Do(u){var d=Math.abs(u);return d<.04045?u/12.92:(gg(u)||1)*pg((d+.055)/1.055,2.4)}var bg=p.unpack,Ys=Math.pow,vg=Math.sign,_g=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];u=bg(u,"lab");var b=u[0],_=u[1],P=u[2],T=Ys(b+.3963377774*_+.2158037573*P,3),w=Ys(b-.1055613458*_-.0638541728*P,3),A=Ys(b-.0894841775*_-1.291485548*P,3);return[255*Eo(4.0767416621*T-3.3077115913*w+.2309699292*A),255*Eo(-1.2684380046*T+2.6097574011*w-.3413193965*A),255*Eo(-.0041960863*T-.7034186147*w+1.707614701*A),u.length>3?u[3]:1]},uc=_g;function Eo(u){var d=Math.abs(u);return d>.0031308?(vg(u)||1)*(1.055*Ys(d,1/2.4)-.055):u*12.92}var yg=p.unpack,xg=p.type,wg=$,fc=D,dc=m,kg=hc;fc.prototype.oklab=function(){return kg(this._rgb)},wg.oklab=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(fc,[null].concat(u,["oklab"])))},dc.format.oklab=uc,dc.autodetect.push({p:3,test:function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];if(u=yg(u,"oklab"),xg(u)==="array"&&u.length===3)return"oklab"}});var Sg=p.unpack,Mg=hc,Cg=Kl,Pg=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var b=Sg(u,"rgb"),_=b[0],P=b[1],T=b[2],w=Mg(_,P,T),A=w[0],L=w[1],j=w[2];return Cg(A,L,j)},Tg=Pg,Dg=p.unpack,Eg=Zl,Og=uc,Ag=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];u=Dg(u,"lch");var b=u[0],_=u[1],P=u[2],T=Eg(b,_,P),w=T[0],A=T[1],L=T[2],j=Og(w,A,L),B=j[0],q=j[1],H=j[2];return[B,q,H,u.length>3?u[3]:1]},Rg=Ag,Lg=p.unpack,Fg=p.type,Ig=$,pc=D,gc=m,$g=Tg;pc.prototype.oklch=function(){return $g(this._rgb)},Ig.oklch=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];return new(Function.prototype.bind.apply(pc,[null].concat(u,["oklch"])))},gc.format.oklch=Rg,gc.autodetect.push({p:3,test:function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];if(u=Lg(u,"oklch"),Fg(u)==="array"&&u.length===3)return"oklch"}});var mc=D,jg=p.type;mc.prototype.alpha=function(u,d){return d===void 0&&(d=!1),u!==void 0&&jg(u)==="number"?d?(this._rgb[3]=u,this):new mc([this._rgb[0],this._rgb[1],this._rgb[2],u],"rgb"):this._rgb[3]};var zg=D;zg.prototype.clipped=function(){return this._rgb._clipped||!1};var jn=D,Bg=Ns;jn.prototype.darken=function(u){u===void 0&&(u=1);var d=this,b=d.lab();return b[0]-=Bg.Kn*u,new jn(b,"lab").alpha(d.alpha(),!0)},jn.prototype.brighten=function(u){return u===void 0&&(u=1),this.darken(-u)},jn.prototype.darker=jn.prototype.darken,jn.prototype.brighter=jn.prototype.brighten;var Ng=D;Ng.prototype.get=function(u){var d=u.split("."),b=d[0],_=d[1],P=this[b]();if(_){var T=b.indexOf(_)-(b.substr(0,2)==="ok"?2:0);if(T>-1)return P[T];throw new Error("unknown channel "+_+" in mode "+b)}else return P};var di=D,Hg=p.type,Wg=Math.pow,Vg=1e-7,Yg=20;di.prototype.luminance=function(u){if(u!==void 0&&Hg(u)==="number"){if(u===0)return new di([0,0,0,this._rgb[3]],"rgb");if(u===1)return new di([255,255,255,this._rgb[3]],"rgb");var d=this.luminance(),b="rgb",_=Yg,P=function(w,A){var L=w.interpolate(A,.5,b),j=L.luminance();return Math.abs(u-j)u?P(w,L):P(L,A)},T=(d>u?P(new di([0,0,0]),this):P(this,new di([255,255,255]))).rgb();return new di(T.concat([this._rgb[3]]))}return Xg.apply(void 0,this._rgb.slice(0,3))};var Xg=function(u,d,b){return u=Oo(u),d=Oo(d),b=Oo(b),.2126*u+.7152*d+.0722*b},Oo=function(u){return u/=255,u<=.03928?u/12.92:Wg((u+.055)/1.055,2.4)},we={},bc=D,vc=p.type,Xs=we,_c=function(u,d,b){b===void 0&&(b=.5);for(var _=[],P=arguments.length-3;P-- >0;)_[P]=arguments[P+3];var T=_[0]||"lrgb";if(!Xs[T]&&!_.length&&(T=Object.keys(Xs)[0]),!Xs[T])throw new Error("interpolation mode "+T+" is not defined");return vc(u)!=="object"&&(u=new bc(u)),vc(d)!=="object"&&(d=new bc(d)),Xs[T](u,d,b).alpha(u.alpha()+b*(d.alpha()-u.alpha()))},yc=D,qg=_c;yc.prototype.mix=yc.prototype.interpolate=function(u,d){d===void 0&&(d=.5);for(var b=[],_=arguments.length-2;_-- >0;)b[_]=arguments[_+2];return qg.apply(void 0,[this,u,d].concat(b))};var xc=D;xc.prototype.premultiply=function(u){u===void 0&&(u=!1);var d=this._rgb,b=d[3];return u?(this._rgb=[d[0]*b,d[1]*b,d[2]*b,b],this):new xc([d[0]*b,d[1]*b,d[2]*b,b],"rgb")};var Ao=D,Gg=Ns;Ao.prototype.saturate=function(u){u===void 0&&(u=1);var d=this,b=d.lch();return b[1]+=Gg.Kn*u,b[1]<0&&(b[1]=0),new Ao(b,"lch").alpha(d.alpha(),!0)},Ao.prototype.desaturate=function(u){return u===void 0&&(u=1),this.saturate(-u)};var wc=D,kc=p.type;wc.prototype.set=function(u,d,b){b===void 0&&(b=!1);var _=u.split("."),P=_[0],T=_[1],w=this[P]();if(T){var A=P.indexOf(T)-(P.substr(0,2)==="ok"?2:0);if(A>-1){if(kc(d)=="string")switch(d.charAt(0)){case"+":w[A]+=+d;break;case"-":w[A]+=+d;break;case"*":w[A]*=+d.substr(1);break;case"/":w[A]/=+d.substr(1);break;default:w[A]=+d}else if(kc(d)==="number")w[A]=d;else throw new Error("unsupported value for Color.set");var L=new wc(w,P);return b?(this._rgb=L._rgb,this):L}throw new Error("unknown channel "+T+" in mode "+P)}else return w};var Ug=D,Kg=function(u,d,b){var _=u._rgb,P=d._rgb;return new Ug(_[0]+b*(P[0]-_[0]),_[1]+b*(P[1]-_[1]),_[2]+b*(P[2]-_[2]),"rgb")};we.rgb=Kg;var Zg=D,Ro=Math.sqrt,pi=Math.pow,Jg=function(u,d,b){var _=u._rgb,P=_[0],T=_[1],w=_[2],A=d._rgb,L=A[0],j=A[1],B=A[2];return new Zg(Ro(pi(P,2)*(1-b)+pi(L,2)*b),Ro(pi(T,2)*(1-b)+pi(j,2)*b),Ro(pi(w,2)*(1-b)+pi(B,2)*b),"rgb")};we.lrgb=Jg;var Qg=D,tm=function(u,d,b){var _=u.lab(),P=d.lab();return new Qg(_[0]+b*(P[0]-_[0]),_[1]+b*(P[1]-_[1]),_[2]+b*(P[2]-_[2]),"lab")};we.lab=tm;var Sc=D,gi=function(u,d,b,_){var P,T,w,A;_==="hsl"?(w=u.hsl(),A=d.hsl()):_==="hsv"?(w=u.hsv(),A=d.hsv()):_==="hcg"?(w=u.hcg(),A=d.hcg()):_==="hsi"?(w=u.hsi(),A=d.hsi()):_==="lch"||_==="hcl"?(_="hcl",w=u.hcl(),A=d.hcl()):_==="oklch"&&(w=u.oklch().reverse(),A=d.oklch().reverse());var L,j,B,q,H,Q;(_.substr(0,1)==="h"||_==="oklch")&&(P=w,L=P[0],B=P[1],H=P[2],T=A,j=T[0],q=T[1],Q=T[2]);var K,ct,mt,_t;return!isNaN(L)&&!isNaN(j)?(j>L&&j-L>180?_t=j-(L+360):j180?_t=j+360-L:_t=j-L,ct=L+b*_t):isNaN(L)?isNaN(j)?ct=Number.NaN:(ct=j,(H==1||H==0)&&_!="hsv"&&(K=q)):(ct=L,(Q==1||Q==0)&&_!="hsv"&&(K=B)),K===void 0&&(K=B+b*(q-B)),mt=H+b*(Q-H),_==="oklch"?new Sc([mt,K,ct],_):new Sc([ct,K,mt],_)},em=gi,Mc=function(u,d,b){return em(u,d,b,"lch")};we.lch=Mc,we.hcl=Mc;var nm=D,im=function(u,d,b){var _=u.num(),P=d.num();return new nm(_+b*(P-_),"num")};we.num=im;var sm=gi,rm=function(u,d,b){return sm(u,d,b,"hcg")};we.hcg=rm;var om=gi,am=function(u,d,b){return om(u,d,b,"hsi")};we.hsi=am;var lm=gi,cm=function(u,d,b){return lm(u,d,b,"hsl")};we.hsl=cm;var hm=gi,um=function(u,d,b){return hm(u,d,b,"hsv")};we.hsv=um;var fm=D,dm=function(u,d,b){var _=u.oklab(),P=d.oklab();return new fm(_[0]+b*(P[0]-_[0]),_[1]+b*(P[1]-_[1]),_[2]+b*(P[2]-_[2]),"oklab")};we.oklab=dm;var pm=gi,gm=function(u,d,b){return pm(u,d,b,"oklch")};we.oklch=gm;var Lo=D,mm=p.clip_rgb,Fo=Math.pow,Io=Math.sqrt,$o=Math.PI,Cc=Math.cos,Pc=Math.sin,bm=Math.atan2,vm=function(u,d,b){d===void 0&&(d="lrgb"),b===void 0&&(b=null);var _=u.length;b||(b=Array.from(new Array(_)).map(function(){return 1}));var P=_/b.reduce(function(ct,mt){return ct+mt});if(b.forEach(function(ct,mt){b[mt]*=P}),u=u.map(function(ct){return new Lo(ct)}),d==="lrgb")return _m(u,b);for(var T=u.shift(),w=T.get(d),A=[],L=0,j=0,B=0;B=360;)K-=360;w[Q]=K}else w[Q]=w[Q]/A[Q];return H/=_,new Lo(w,d).alpha(H>.99999?1:H,!0)},_m=function(u,d){for(var b=u.length,_=[0,0,0,0],P=0;P.9999999&&(_[3]=1),new Lo(mm(_))},Pe=$,mi=p.type,ym=Math.pow,jo=function(u){var d="rgb",b=Pe("#ccc"),_=0,P=[0,1],T=[],w=[0,0],A=!1,L=[],j=!1,B=0,q=1,H=!1,Q={},K=!0,ct=1,mt=function(W){if(W=W||["#fff","#000"],W&&mi(W)==="string"&&Pe.brewer&&Pe.brewer[W.toLowerCase()]&&(W=Pe.brewer[W.toLowerCase()]),mi(W)==="array"){W.length===1&&(W=[W[0],W[0]]),W=W.slice(0);for(var st=0;st=A[dt];)dt++;return dt-1}return 0},Mt=function(W){return W},oe=function(W){return W},ne=function(W,st){var dt,ht;if(st==null&&(st=!1),isNaN(W)||W===null)return b;if(st)ht=W;else if(A&&A.length>2){var ae=_t(W);ht=ae/(A.length-2)}else q!==B?ht=(W-B)/(q-B):ht=1;ht=oe(ht),st||(ht=Mt(ht)),ct!==1&&(ht=ym(ht,ct)),ht=w[0]+ht*(1-w[0]-w[1]),ht=Math.min(1,Math.max(0,ht));var $t=Math.floor(ht*1e4);if(K&&Q[$t])dt=Q[$t];else{if(mi(L)==="array")for(var yt=0;yt=Tt&&yt===T.length-1){dt=L[yt];break}if(ht>Tt&&ht2){var yt=W.map(function(Dt,At){return At/(W.length-1)}),Tt=W.map(function(Dt){return(Dt-B)/(q-B)});Tt.every(function(Dt,At){return yt[At]===Dt})||(oe=function(Dt){if(Dt<=0||Dt>=1)return Dt;for(var At=0;Dt>=Tt[At+1];)At++;var De=(Dt-Tt[At])/(Tt[At+1]-Tt[At]),mn=yt[At]+De*(yt[At+1]-yt[At]);return mn})}}return P=[B,q],vt},vt.mode=function(W){return arguments.length?(d=W,ge(),vt):d},vt.range=function(W,st){return mt(W),vt},vt.out=function(W){return j=W,vt},vt.spread=function(W){return arguments.length?(_=W,vt):_},vt.correctLightness=function(W){return W==null&&(W=!0),H=W,ge(),H?Mt=function(st){for(var dt=ne(0,!0).lab()[0],ht=ne(1,!0).lab()[0],ae=dt>ht,$t=ne(st,!0).lab()[0],yt=dt+(ht-dt)*st,Tt=$t-yt,Dt=0,At=1,De=20;Math.abs(Tt)>.01&&De-- >0;)(function(){return ae&&(Tt*=-1),Tt<0?(Dt=st,st+=(At-st)*.5):(At=st,st+=(Dt-st)*.5),$t=ne(st,!0).lab()[0],Tt=$t-yt})();return st}:Mt=function(st){return st},vt},vt.padding=function(W){return W!=null?(mi(W)==="number"&&(W=[W,W]),w=W,vt):w},vt.colors=function(W,st){arguments.length<2&&(st="hex");var dt=[];if(arguments.length===0)dt=L.slice(0);else if(W===1)dt=[vt(.5)];else if(W>1){var ht=P[0],ae=P[1]-ht;dt=xm(0,W,!1).map(function(At){return vt(ht+At/(W-1)*ae)})}else{u=[];var $t=[];if(A&&A.length>2)for(var yt=1,Tt=A.length,Dt=1<=Tt;Dt?ytTt;Dt?yt++:yt--)$t.push((A[yt-1]+A[yt])*.5);else $t=P;dt=$t.map(function(At){return vt(At)})}return Pe[st]&&(dt=dt.map(function(At){return At[st]()})),dt},vt.cache=function(W){return W!=null?(K=W,vt):K},vt.gamma=function(W){return W!=null?(ct=W,vt):ct},vt.nodata=function(W){return W!=null?(b=Pe(W),vt):b},vt};function xm(u,d,b){for(var _=[],P=uT;P?w++:w--)_.push(w);return _}var Bi=D,wm=jo,km=function(u){for(var d=[1,1],b=1;b=5){var j,B,q;j=u.map(function(H){return H.lab()}),q=u.length-1,B=km(q),P=function(H){var Q=1-H,K=[0,1,2].map(function(ct){return j.reduce(function(mt,_t,Mt){return mt+B[Mt]*Math.pow(Q,q-Mt)*Math.pow(H,Mt)*_t[ct]},0)});return new Bi(K,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return P},Mm=function(u){var d=Sm(u);return d.scale=function(){return wm(d)},d},zo=$,Te=function(u,d,b){if(!Te[b])throw new Error("unknown blend mode "+b);return Te[b](u,d)},pn=function(u){return function(d,b){var _=zo(b).rgb(),P=zo(d).rgb();return zo.rgb(u(_,P))}},gn=function(u){return function(d,b){var _=[];return _[0]=u(d[0],b[0]),_[1]=u(d[1],b[1]),_[2]=u(d[2],b[2]),_}},Cm=function(u){return u},Pm=function(u,d){return u*d/255},Tm=function(u,d){return u>d?d:u},Dm=function(u,d){return u>d?u:d},Em=function(u,d){return 255*(1-(1-u/255)*(1-d/255))},Om=function(u,d){return d<128?2*u*d/255:255*(1-2*(1-u/255)*(1-d/255))},Am=function(u,d){return 255*(1-(1-d/255)/(u/255))},Rm=function(u,d){return u===255?255:(u=255*(d/255)/(1-u/255),u>255?255:u)};Te.normal=pn(gn(Cm)),Te.multiply=pn(gn(Pm)),Te.screen=pn(gn(Em)),Te.overlay=pn(gn(Om)),Te.darken=pn(gn(Tm)),Te.lighten=pn(gn(Dm)),Te.dodge=pn(gn(Rm)),Te.burn=pn(gn(Am));for(var Lm=Te,Bo=p.type,Fm=p.clip_rgb,Im=p.TWOPI,$m=Math.pow,jm=Math.sin,zm=Math.cos,Tc=$,Bm=function(u,d,b,_,P){u===void 0&&(u=300),d===void 0&&(d=-1.5),b===void 0&&(b=1),_===void 0&&(_=1),P===void 0&&(P=[0,1]);var T=0,w;Bo(P)==="array"?w=P[1]-P[0]:(w=0,P=[P,P]);var A=function(L){var j=Im*((u+120)/360+d*L),B=$m(P[0]+w*L,_),q=T!==0?b[0]+L*T:b,H=q*B*(1-B)/2,Q=zm(j),K=jm(j),ct=B+H*(-.14861*Q+1.78277*K),mt=B+H*(-.29227*Q-.90649*K),_t=B+H*(1.97294*Q);return Tc(Fm([ct*255,mt*255,_t*255,1]))};return A.start=function(L){return L==null?u:(u=L,A)},A.rotations=function(L){return L==null?d:(d=L,A)},A.gamma=function(L){return L==null?_:(_=L,A)},A.hue=function(L){return L==null?b:(b=L,Bo(b)==="array"?(T=b[1]-b[0],T===0&&(b=b[1])):T=0,A)},A.lightness=function(L){return L==null?P:(Bo(L)==="array"?(P=L,w=L[1]-L[0]):(P=[L,L],w=0),A)},A.scale=function(){return Tc.scale(A)},A.hue(b),A},Nm=D,Hm="0123456789abcdef",Wm=Math.floor,Vm=Math.random,Ym=function(){for(var u="#",d=0;d<6;d++)u+=Hm.charAt(Wm(Vm()*16));return new Nm(u,"hex")},No=a,Dc=Math.log,Xm=Math.pow,qm=Math.floor,Gm=Math.abs,Ec=function(u,d){d===void 0&&(d=null);var b={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return No(u)==="object"&&(u=Object.values(u)),u.forEach(function(_){d&&No(_)==="object"&&(_=_[d]),_!=null&&!isNaN(_)&&(b.values.push(_),b.sum+=_,_b.max&&(b.max=_),b.count+=1)}),b.domain=[b.min,b.max],b.limits=function(_,P){return Oc(b,_,P)},b},Oc=function(u,d,b){d===void 0&&(d="equal"),b===void 0&&(b=7),No(u)=="array"&&(u=Ec(u));var _=u.min,P=u.max,T=u.values.sort(function(Wo,Vo){return Wo-Vo});if(b===1)return[_,P];var w=[];if(d.substr(0,1)==="c"&&(w.push(_),w.push(P)),d.substr(0,1)==="e"){w.push(_);for(var A=1;A 0");var L=Math.LOG10E*Dc(_),j=Math.LOG10E*Dc(P);w.push(_);for(var B=1;B200&&(oe=!1)}for(var bn={},bi=0;bi_?(b+.05)/(_+.05):(_+.05)/(b+.05)},Lc=D,Ge=Math.sqrt,Kt=Math.pow,Km=Math.min,Zm=Math.max,Fc=Math.atan2,Ic=Math.abs,qs=Math.cos,$c=Math.sin,Jm=Math.exp,jc=Math.PI,Qm=function(u,d,b,_,P){b===void 0&&(b=1),_===void 0&&(_=1),P===void 0&&(P=1);var T=function(Bn){return 360*Bn/(2*jc)},w=function(Bn){return 2*jc*Bn/360};u=new Lc(u),d=new Lc(d);var A=Array.from(u.lab()),L=A[0],j=A[1],B=A[2],q=Array.from(d.lab()),H=q[0],Q=q[1],K=q[2],ct=(L+H)/2,mt=Ge(Kt(j,2)+Kt(B,2)),_t=Ge(Kt(Q,2)+Kt(K,2)),Mt=(mt+_t)/2,oe=.5*(1-Ge(Kt(Mt,7)/(Kt(Mt,7)+Kt(25,7)))),ne=j*(1+oe),ge=Q*(1+oe),vt=Ge(Kt(ne,2)+Kt(B,2)),W=Ge(Kt(ge,2)+Kt(K,2)),st=(vt+W)/2,dt=T(Fc(B,ne)),ht=T(Fc(K,ge)),ae=dt>=0?dt:dt+360,$t=ht>=0?ht:ht+360,yt=Ic(ae-$t)>180?(ae+$t+360)/2:(ae+$t)/2,Tt=1-.17*qs(w(yt-30))+.24*qs(w(2*yt))+.32*qs(w(3*yt+6))-.2*qs(w(4*yt-63)),Dt=$t-ae;Dt=Ic(Dt)<=180?Dt:$t<=ae?Dt+360:Dt-360,Dt=2*Ge(vt*W)*$c(w(Dt)/2);var At=H-L,De=W-vt,mn=1+.015*Kt(ct-50,2)/Ge(20+Kt(ct-50,2)),bn=1+.045*st,bi=1+.015*st*Tt,vi=30*Jm(-Kt((yt-275)/25,2)),Ue=2*Ge(Kt(st,7)/(Kt(st,7)+Kt(25,7))),zn=-Ue*$c(2*w(vi)),Ni=Ge(Kt(At/(b*mn),2)+Kt(De/(_*bn),2)+Kt(Dt/(P*bi),2)+zn*(De/(_*bn))*(Dt/(P*bi)));return Zm(0,Km(100,Ni))},zc=D,tb=function(u,d,b){b===void 0&&(b="lab"),u=new zc(u),d=new zc(d);var _=u.get(b),P=d.get(b),T=0;for(var w in _){var A=(_[w]||0)-(P[w]||0);T+=A*A}return Math.sqrt(T)},eb=D,nb=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];try{return new(Function.prototype.bind.apply(eb,[null].concat(u))),!0}catch(b){return!1}},Bc=$,Nc=jo,ib={cool:function(){return Nc([Bc.hsl(180,1,.9),Bc.hsl(250,.7,.4)])},hot:function(){return Nc(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Gs={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Ho=0,Hc=Object.keys(Gs);Ho{(function(n,t){typeof qr=="object"&&typeof Qu!="undefined"?t(qr):typeof define=="function"&&define.amd?define("@ts-stack/markdown",["exports"],t):(n=typeof globalThis!="undefined"?globalThis:n||self,t((n["ts-stack"]=n["ts-stack"]||{},n["ts-stack"].markdown={})))})(qr,function(n){"use strict";var t=function(){function k(v,x){x===void 0&&(x=""),this.source=v.source,this.flags=x}return k.prototype.setGroup=function(v,x){var R=typeof x=="string"?x:x.source;return R=R.replace(/(^|[^\[])\^/g,"$1"),this.source=this.source.replace(v,R),this},k.prototype.getRegexp=function(){return new RegExp(this.source,this.flags)},k}();var e=/[&<>"']/,i=/[&<>"']/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},r=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g;function a(k,v){if(v){if(e.test(k))return k.replace(i,function(x){return s[x]})}else if(r.test(k))return k.replace(o,function(x){return s[x]});return k}function l(k){return k.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(v,x){return x=x.toLowerCase(),x==="colon"?":":x.charAt(0)==="#"?x.charAt(1)==="x"?String.fromCharCode(parseInt(x.substring(2),16)):String.fromCharCode(+x.substring(1)):""})}n.TokenType=void 0,function(k){k[k.space=1]="space",k[k.text=2]="text",k[k.paragraph=3]="paragraph",k[k.heading=4]="heading",k[k.listStart=5]="listStart",k[k.listEnd=6]="listEnd",k[k.looseItemStart=7]="looseItemStart",k[k.looseItemEnd=8]="looseItemEnd",k[k.listItemStart=9]="listItemStart",k[k.listItemEnd=10]="listItemEnd",k[k.blockquoteStart=11]="blockquoteStart",k[k.blockquoteEnd=12]="blockquoteEnd",k[k.code=13]="code",k[k.table=14]="table",k[k.html=15]="html",k[k.hr=16]="hr"}(n.TokenType||(n.TokenType={}));var c=function(){function k(){this.gfm=!0,this.tables=!0,this.breaks=!1,this.pedantic=!1,this.sanitize=!1,this.mangle=!0,this.smartLists=!1,this.silent=!1,this.langPrefix="lang-",this.smartypants=!1,this.headerPrefix="",this.xhtml=!1,this.escape=a,this.unescape=l}return k}();var h=function(k,v){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,R){x.__proto__=R}||function(x,R){for(var E in R)Object.prototype.hasOwnProperty.call(R,E)&&(x[E]=R[E])},h(k,v)};function f(k,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");h(k,v);function x(){this.constructor=k}k.prototype=v===null?Object.create(v):(x.prototype=v.prototype,new x)}var g=function(){return g=Object.assign||function(v){for(var x,R=1,E=arguments.length;R=0;V--)(Z=k[V])&&(O=(E<3?Z(O):E>3?Z(v,x,O):Z(v,x))||O);return E>3&&O&&Object.defineProperty(v,x,O),O}function y(k,v){return function(x,R){v(x,R,k)}}function S(k,v){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(k,v)}function M(k,v,x,R){function E(O){return O instanceof x?O:new x(function(Z){Z(O)})}return new(x||(x=Promise))(function(O,Z){function V(xt){try{tt(R.next(xt))}catch(Ht){Z(Ht)}}function J(xt){try{tt(R.throw(xt))}catch(Ht){Z(Ht)}}function tt(xt){xt.done?O(xt.value):E(xt.value).then(V,J)}tt((R=R.apply(k,v||[])).next())})}function C(k,v){var x={label:0,sent:function(){if(O[0]&1)throw O[1];return O[1]},trys:[],ops:[]},R,E,O,Z;return Z={next:V(0),throw:V(1),return:V(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function V(tt){return function(xt){return J([tt,xt])}}function J(tt){if(R)throw new TypeError("Generator is already executing.");for(;x;)try{if(R=1,E&&(O=tt[0]&2?E.return:tt[0]?E.throw||((O=E.return)&&O.call(E),0):E.next)&&!(O=O.call(E,tt[1])).done)return O;switch(E=0,O&&(tt=[tt[0]&2,O.value]),tt[0]){case 0:case 1:O=tt;break;case 4:return x.label++,{value:tt[1],done:!1};case 5:x.label++,E=tt[1],tt=[0];continue;case 7:tt=x.ops.pop(),x.trys.pop();continue;default:if(O=x.trys,!(O=O.length>0&&O[O.length-1])&&(tt[0]===6||tt[0]===2)){x=0;continue}if(tt[0]===3&&(!O||tt[1]>O[0]&&tt[1]=k.length&&(k=void 0),{value:k&&k[R++],done:!k}}};throw new TypeError(v?"Object is not iterable.":"Symbol.iterator is not defined.")}function $(k,v){var x=typeof Symbol=="function"&&k[Symbol.iterator];if(!x)return k;var R=x.call(k),E,O=[],Z;try{for(;(v===void 0||v-- >0)&&!(E=R.next()).done;)O.push(E.value)}catch(V){Z={error:V}}finally{try{E&&!E.done&&(x=R.return)&&x.call(R)}finally{if(Z)throw Z.error}}return O}function N(){for(var k=[],v=0;v1||V(Ot,Yt)})})}function V(Ot,Yt){try{J(R[Ot](Yt))}catch(Xt){Ht(O[0][3],Xt)}}function J(Ot){Ot.value instanceof it?Promise.resolve(Ot.value.v).then(tt,xt):Ht(O[0][2],Ot)}function tt(Ot){V("next",Ot)}function xt(Ot){V("throw",Ot)}function Ht(Ot,Yt){Ot(Yt),O.shift(),O.length&&V(O[0][0],O[0][1])}}function rt(k){var v,x;return v={},R("next"),R("throw",function(E){throw E}),R("return"),v[Symbol.iterator]=function(){return this},v;function R(E,O){v[E]=k[E]?function(Z){return(x=!x)?{value:it(k[E](Z)),done:E==="return"}:O?O(Z):Z}:O}}function Pt(k){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var v=k[Symbol.asyncIterator],x;return v?v.call(k):(k=typeof I=="function"?I(k):k[Symbol.iterator](),x={},R("next"),R("throw"),R("return"),x[Symbol.asyncIterator]=function(){return this},x);function R(O){x[O]=k[O]&&function(Z){return new Promise(function(V,J){Z=k[O](Z),E(V,J,Z.done,Z.value)})}}function E(O,Z,V,J){Promise.resolve(J).then(function(tt){O({value:tt,done:V})},Z)}}function zt(k,v){return Object.defineProperty?Object.defineProperty(k,"raw",{value:v}):k.raw=v,k}var et=Object.create?function(k,v){Object.defineProperty(k,"default",{enumerable:!0,value:v})}:function(k,v){k.default=v};function Et(k){if(k&&k.__esModule)return k;var v={};if(k!=null)for(var x in k)x!=="default"&&Object.prototype.hasOwnProperty.call(k,x)&&F(v,k,x);return et(v,k),v}function St(k){return k&&k.__esModule?k:{default:k}}function re(k,v){if(!v.has(k))throw new TypeError("attempted to get private field on non-instance");return v.get(k)}function ye(k,v,x){if(!v.has(k))throw new TypeError("attempted to set private field on non-instance");return v.set(k,x),x}var ot=function(){function k(v){this.options=v||Ut.options}return k.prototype.code=function(v,x,R,E){if(this.options.highlight){var O=this.options.highlight(v,x);O!=null&&O!==v&&(R=!0,v=O)}var Z=R?v:this.options.escape(v,!0);if(!x)return` +
`+Z+`
+
+`;var V=this.options.langPrefix+this.options.escape(x,!0);return` +
'+Z+`
+
+`},k.prototype.blockquote=function(v){return`
+`+v+`
+`},k.prototype.html=function(v){return v},k.prototype.heading=function(v,x,R){var E=this.options.headerPrefix+R.toLowerCase().replace(/[^\w]+/g,"-");return"'+v+" +`},k.prototype.hr=function(){return this.options.xhtml?`
+`:`
+`},k.prototype.list=function(v,x){var R=x?"ol":"ul";return` +<`+R+`> +`+v+" +`},k.prototype.listitem=function(v){return"
  • "+v+`
  • +`},k.prototype.paragraph=function(v){return"

    "+v+`

    +`},k.prototype.table=function(v,x){return` + + +`+v+` + +`+x+` +
    +`},k.prototype.tablerow=function(v){return` +`+v+` +`},k.prototype.tablecell=function(v,x){var R=x.header?"th":"td",E=x.align?"<"+R+' style="text-align:'+x.align+'">':"<"+R+">";return E+v+" +`},k.prototype.strong=function(v){return""+v+""},k.prototype.em=function(v){return""+v+""},k.prototype.codespan=function(v){return""+v+""},k.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},k.prototype.del=function(v){return""+v+""},k.prototype.link=function(v,x,R){if(this.options.sanitize){var E=void 0;try{E=decodeURIComponent(this.options.unescape(v)).replace(/[^\w:]/g,"").toLowerCase()}catch(Z){return R}if(E.indexOf("javascript:")===0||E.indexOf("vbscript:")===0||E.indexOf("data:")===0)return R}var O='",O},k.prototype.image=function(v,x,R){var E=''+R+'":">",E},k.prototype.text=function(v){return v},k}();var Lt=function(){function k(v,x,R,E){if(R===void 0&&(R=Ut.options),this.staticThis=v,this.links=x,this.options=R,this.renderer=E||this.options.renderer||new ot(this.options),!this.links)throw new Error("InlineLexer requires 'links' parameter.");this.setRules()}return k.output=function(v,x,R){var E=new this(this,x,R);return E.output(v)},k.getRulesBase=function(){if(this.rulesBase)return this.rulesBase;var v={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ <>]+(@|:\/)[^ <>]+)>/,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/};return v.link=new t(v.link).setGroup("inside",v._inside).setGroup("href",v._href).getRegexp(),v.reflink=new t(v.reflink).setGroup("inside",v._inside).getRegexp(),this.rulesBase=v},k.getRulesPedantic=function(){return this.rulesPedantic?this.rulesPedantic:this.rulesPedantic=Object.assign(Object.assign({},this.getRulesBase()),{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/})},k.getRulesGfm=function(){if(this.rulesGfm)return this.rulesGfm;var v=this.getRulesBase(),x=new t(v.escape).setGroup("])","~|])").getRegexp(),R=new t(v.text).setGroup("]|","~]|").setGroup("|","|https?://|").getRegexp();return this.rulesGfm=Object.assign(Object.assign({},v),{escape:x,url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:R})},k.getRulesBreaks=function(){if(this.rulesBreaks)return this.rulesBreaks;var v=this.getRulesGfm(),x=this.getRulesGfm();return this.rulesBreaks=Object.assign(Object.assign({},x),{br:new t(v.br).setGroup("{2,}","*").getRegexp(),text:new t(x.text).setGroup("{2,}","*").getRegexp()})},k.prototype.setRules=function(){this.options.gfm?this.options.breaks?this.rules=this.staticThis.getRulesBreaks():this.rules=this.staticThis.getRulesGfm():this.options.pedantic?this.rules=this.staticThis.getRulesPedantic():this.rules=this.staticThis.getRulesBase(),this.hasRulesGfm=this.rules.url!==void 0},k.prototype.output=function(v){v=v;for(var x,R="";v;){if(x=this.rules.escape.exec(v)){v=v.substring(x[0].length),R+=x[1];continue}if(x=this.rules.autolink.exec(v)){var E=void 0,O=void 0;v=v.substring(x[0].length),x[2]==="@"?(E=this.options.escape(x[1].charAt(6)===":"?this.mangle(x[1].substring(7)):this.mangle(x[1])),O=this.mangle("mailto:")+E):(E=this.options.escape(x[1]),O=E),R+=this.renderer.link(O,null,E);continue}if(!this.inLink&&this.hasRulesGfm&&(x=this.rules.url.exec(v))){var E=void 0,O=void 0;v=v.substring(x[0].length),E=this.options.escape(x[1]),O=E,R+=this.renderer.link(O,null,E);continue}if(x=this.rules.tag.exec(v)){!this.inLink&&/^/i.test(x[0])&&(this.inLink=!1),v=v.substring(x[0].length),R+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(x[0]):this.options.escape(x[0]):x[0];continue}if(x=this.rules.link.exec(v)){v=v.substring(x[0].length),this.inLink=!0,R+=this.outputLink(x,{href:x[2],title:x[3]}),this.inLink=!1;continue}if((x=this.rules.reflink.exec(v))||(x=this.rules.nolink.exec(v))){v=v.substring(x[0].length);var Z=(x[2]||x[1]).replace(/\s+/g," "),V=this.links[Z.toLowerCase()];if(!V||!V.href){R+=x[0].charAt(0),v=x[0].substring(1)+v;continue}this.inLink=!0,R+=this.outputLink(x,V),this.inLink=!1;continue}if(x=this.rules.strong.exec(v)){v=v.substring(x[0].length),R+=this.renderer.strong(this.output(x[2]||x[1]));continue}if(x=this.rules.em.exec(v)){v=v.substring(x[0].length),R+=this.renderer.em(this.output(x[2]||x[1]));continue}if(x=this.rules.code.exec(v)){v=v.substring(x[0].length),R+=this.renderer.codespan(this.options.escape(x[2].trim(),!0));continue}if(x=this.rules.br.exec(v)){v=v.substring(x[0].length),R+=this.renderer.br();continue}if(this.hasRulesGfm&&(x=this.rules.del.exec(v))){v=v.substring(x[0].length),R+=this.renderer.del(this.output(x[1]));continue}if(x=this.rules.text.exec(v)){v=v.substring(x[0].length),R+=this.renderer.text(this.options.escape(this.smartypants(x[0])));continue}if(v)throw new Error("Infinite loop on byte: "+v.charCodeAt(0))}return R},k.prototype.outputLink=function(v,x){var R=this.options.escape(x.href),E=x.title?this.options.escape(x.title):null;return v[0].charAt(0)!=="!"?this.renderer.link(R,E,this.output(v[1])):this.renderer.image(R,E,this.options.escape(v[1]))},k.prototype.smartypants=function(v){return this.options.smartypants?v.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026"):v},k.prototype.mangle=function(v){if(!this.options.mangle)return v;for(var x="",R=v.length,E=0;E.5&&(O="x"+v.charCodeAt(E).toString(16)),x+="&#"+O+";"}return x},k}();Lt.rulesBase=null,Lt.rulesPedantic=null,Lt.rulesGfm=null,Lt.rulesBreaks=null;var Bt=function(){function k(v){this.simpleRenderers=[],this.line=0,this.tokens=[],this.token=null,this.options=v||Ut.options,this.renderer=this.options.renderer||new ot(this.options)}return k.parse=function(v,x,R){var E=new this(R);return E.parse(x,v)},k.prototype.parse=function(v,x){this.inlineLexer=new Lt(Lt,v,this.options,this.renderer),this.tokens=x.reverse();for(var R="";this.next();)R+=this.tok();return R},k.prototype.debug=function(v,x){this.inlineLexer=new Lt(Lt,v,this.options,this.renderer),this.tokens=x.reverse();for(var R="";this.next();){var E=this.tok();this.token.line=this.line+=E.split(` +`).length-1,R+=E}return R},k.prototype.next=function(){return this.token=this.tokens.pop()},k.prototype.getNextElement=function(){return this.tokens[this.tokens.length-1]},k.prototype.parseText=function(){for(var v=this.token.text,x;(x=this.getNextElement())&&x.type==n.TokenType.text;)v+=` +`+this.next().text;return this.inlineLexer.output(v)},k.prototype.tok=function(){var v,x;switch(this.token.type){case n.TokenType.space:return"";case n.TokenType.paragraph:return this.renderer.paragraph(this.inlineLexer.output(this.token.text));case n.TokenType.text:return this.options.isNoP?this.parseText():this.renderer.paragraph(this.parseText());case n.TokenType.heading:return this.renderer.heading(this.inlineLexer.output(this.token.text),this.token.depth,this.token.text);case n.TokenType.listStart:{for(var R="",E=this.token.ordered;this.next().type!=n.TokenType.listEnd;)R+=this.tok();return this.renderer.list(R,E)}case n.TokenType.listItemStart:{for(var R="";this.next().type!=n.TokenType.listItemEnd;)R+=this.token.type==n.TokenType.text?this.parseText():this.tok();return this.renderer.listitem(R)}case n.TokenType.looseItemStart:{for(var R="";this.next().type!=n.TokenType.listItemEnd;)R+=this.tok();return this.renderer.listitem(R)}case n.TokenType.code:return this.renderer.code(this.token.text,this.token.lang,this.token.escaped,this.token.meta);case n.TokenType.table:{var O="",R="",Z=void 0;Z="";for(var V=0;VAn error occured:

    "+this.options.escape(v.message+"",!0)+"
    ";throw v},k}();Ut.options=new c,Ut.simpleRenderers=[];var Qt=function(){function k(v,x){this.staticThis=v,this.links={},this.tokens=[],this.options=x||Ut.options,this.setRules()}return k.lex=function(v,x,R,E){var O=new this(this,x);return O.getTokens(v,R,E)},k.getRulesBase=function(){if(this.rulesBase)return this.rulesBase;var v={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/,bullet:/(?:[*+-]|\d+\.)/,item:/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/};v.item=new t(v.item,"gm").setGroup(/bull/g,v.bullet).getRegexp(),v.list=new t(v.list).setGroup(/bull/g,v.bullet).setGroup("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))").setGroup("def","\\n+(?="+v.def.source+")").getRegexp();var x="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";return v.html=new t(v.html).setGroup("comment",//).setGroup("closed",/<(tag)[\s\S]+?<\/\1>/).setGroup("closing",/])*?>/).setGroup(/tag/g,x).getRegexp(),v.paragraph=new t(v.paragraph).setGroup("hr",v.hr).setGroup("heading",v.heading).setGroup("lheading",v.lheading).setGroup("blockquote",v.blockquote).setGroup("tag","<"+x).setGroup("def",v.def).getRegexp(),this.rulesBase=v},k.getRulesGfm=function(){if(this.rulesGfm)return this.rulesGfm;var v=this.getRulesBase(),x=Object.assign(Object.assign({},v),{fences:/^ *(`{3,}|~{3,})[ \.]*((\S+)? *[^\n]*)\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),R=x.fences.source.replace("\\1","\\2"),E=v.list.source.replace("\\1","\\3");return x.paragraph=new t(v.paragraph).setGroup("(?!","(?!"+R+"|"+E+"|").getRegexp(),this.rulesGfm=x},k.getRulesTable=function(){return this.rulesTables?this.rulesTables:this.rulesTables=Object.assign(Object.assign({},this.getRulesGfm()),{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/})},k.prototype.setRules=function(){this.options.gfm?this.options.tables?this.rules=this.staticThis.getRulesTable():this.rules=this.staticThis.getRulesGfm():this.rules=this.staticThis.getRulesBase(),this.hasRulesGfm=this.rules.fences!==void 0,this.hasRulesTables=this.rules.table!==void 0},k.prototype.getTokens=function(v,x,R){var E=v,O;t:for(;E;){if((O=this.rules.newline.exec(E))&&(E=E.substring(O[0].length),O[0].length>1&&this.tokens.push({type:n.TokenType.space})),O=this.rules.code.exec(E)){E=E.substring(O[0].length);var Z=O[0].replace(/^ {4}/gm,"");this.tokens.push({type:n.TokenType.code,text:this.options.pedantic?Z:Z.replace(/\n+$/,"")});continue}if(this.hasRulesGfm&&(O=this.rules.fences.exec(E))){E=E.substring(O[0].length),this.tokens.push({type:n.TokenType.code,meta:O[2],lang:O[3],text:O[4]||""});continue}if(O=this.rules.heading.exec(E)){E=E.substring(O[0].length),this.tokens.push({type:n.TokenType.heading,depth:O[1].length,text:O[2]});continue}if(x&&this.hasRulesTables&&(O=this.rules.nptable.exec(E))){E=E.substring(O[0].length);for(var V={type:n.TokenType.table,header:O[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:O[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:[]},J=0;J ?/gm,"");this.getTokens(xt),this.tokens.push({type:n.TokenType.blockquoteEnd});continue}if(O=this.rules.list.exec(E)){E=E.substring(O[0].length);var Ht=O[2];this.tokens.push({type:n.TokenType.listStart,ordered:Ht.length>1});for(var xt=O[0].match(this.rules.item),Ot=xt.length,Yt=!1,Xt=void 0,ue=void 0,ke=void 0,J=0;J1&&ue.length>1)&&(E=xt.slice(J+1).join(` +`)+E,J=Ot-1)),ke=Yt||/\n\n(?!\s*$)/.test(V),J!==Ot-1&&(Yt=V.charAt(V.length-1)===` +`,ke||(ke=Yt)),this.tokens.push({type:ke?n.TokenType.looseItemStart:n.TokenType.listItemStart}),this.getTokens(V,!1,R),this.tokens.push({type:n.TokenType.listItemEnd})}this.tokens.push({type:n.TokenType.listEnd});continue}if(O=this.rules.html.exec(E)){E=E.substring(O[0].length);var xe=O[1],Rn=xe==="pre"||xe==="script"||xe==="style";this.tokens.push({type:this.options.sanitize?n.TokenType.paragraph:n.TokenType.html,pre:!this.options.sanitizer&&Rn,text:O[0]});continue}if(x&&(O=this.rules.def.exec(E))){E=E.substring(O[0].length),this.links[O[1].toLowerCase()]={href:O[2],title:O[3]};continue}if(x&&this.hasRulesTables&&(O=this.rules.table.exec(E))){E=E.substring(O[0].length);for(var V={type:n.TokenType.table,header:O[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:O[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:[]},J=0;J0?n.TokenType.paragraph:n.TokenType.text,text:O[1]});continue}if(O=this.rules.text.exec(E)){E=E.substring(O[0].length),this.tokens.push({type:n.TokenType.text,text:O[0]});continue}if(E)throw new Error("Infinite loop on byte: "+E.charCodeAt(0)+(", near text '"+E.slice(0,30)+"...'"))}return{tokens:this.tokens,links:this.links}},k}();Qt.simpleRules=[],Qt.rulesBase=null,Qt.rulesGfm=null,Qt.rulesTables=null,n.BlockLexer=Qt,n.ExtendRegexp=t,n.InlineLexer=Lt,n.Marked=Ut,n.MarkedOptions=c,n.Parser=Bt,n.Renderer=ot,n.escape=a,n.unescape=l,Object.defineProperty(n,"__esModule",{value:!0})})});var ef=Xo(Ei=>{"use strict";var Dy=Ei&&Ei.__extends||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var r in s)s.hasOwnProperty(r)&&(i[r]=s[r])},n(t,e)};return function(t,e){n(t,e);function i(){this.constructor=t}t.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}();Object.defineProperty(Ei,"__esModule",{value:!0});Ei.Extractor=void 0;var Ua=tf(),Ey=function(n){Dy(t,n);function t(e,i){var s=n.call(this)||this;return s.lowercaseKeys=i??!1,s.reset(e),s}return Object.defineProperty(t.prototype,"tables",{get:function(){return this.extractedTables},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"objects",{get:function(){var e=this;return this.extractedTables.map(function(i){return t.tableToObject(i,e.lowercaseKeys)})},enumerable:!1,configurable:!0}),t.prototype.reset=function(e){e===void 0&&(e="rows"),this.mode=e,this.currentRow=[],this.currentTable=[],this.extractedTables=[]},t.prototype.table=function(e,i){return this.extractedTables.push(this.mode==="rows"?this.currentTable:t.transposeTable(this.currentTable)),this.currentTable=[],n.prototype.table.call(this,e,i)},t.prototype.tablerow=function(e){return this.currentTable.push(this.currentRow),this.currentRow=[],n.prototype.tablerow.call(this,e)},t.prototype.tablecell=function(e,i){return this.currentRow.push(e),n.prototype.tablecell.call(this,e,i)},t.transposeTable=function(e){for(var i=[],s=e.length,r=e[0].length,o=0;o0?r[0]:null},t.extractAllObjects=function(e,i,s){var r=t.createExtractor(e,i,s);return r.objects},t.extractTable=function(e,i,s){var r=t.extractAllTables(e,i,s);return r.length>0?r[0]:null},t.extractAllTables=function(e,i,s){var r=t.createExtractor(e,i,s);return r.tables},t.extract=function(e,i,s){var r=t.createExtractor(e,i,s);return r.objects.length>0?JSON.stringify(r.objects[0]):null},t.extractAll=function(e,i,s){var r=t.createExtractor(e,i,s);return r.objects.map(function(o){return JSON.stringify(o)})},t}(Ua.Renderer);Ei.Extractor=Ey});fb(exports,{default:()=>Ol});var $e=ze(require("obsidian"));function Ee(){}var qo=function(){let n=0;return function(){return n++}}();function ut(n){return n===null||typeof n=="undefined"}function pt(n){if(Array.isArray&&Array.isArray(n))return!0;let t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function at(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}var jt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function me(n,t){return jt(n)?n:t}function nt(n,t){return typeof n=="undefined"?t:n}var Go=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/t,Ks=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function wt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Ct(n,t,e,i){let s,r,o;if(pt(n))if(r=n.length,i)for(s=r-1;s>=0;s--)t.call(e,n[s],s);else for(s=0;sn,x:n=>n.x,y:n=>n.y};function Be(n,t){return(Zc[t]||(Zc[t]=pb(t)))(n)}function pb(n){let t=Jc(n);return e=>{for(let i of t){if(i==="")break;e=e&&e[i]}return e}}function Jc(n){let t=n.split("."),e=[],i="";for(let s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Vi(n){return n.charAt(0).toUpperCase()+n.slice(1)}var Nt=n=>typeof n!="undefined",le=n=>typeof n=="function",Zs=(n,t)=>{if(n.size!==t.size)return!1;for(let e of n)if(!t.has(e))return!1;return!0};function Uo(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}var gt=Math.PI,kt=2*gt,Qc=kt+gt,Yi=Number.POSITIVE_INFINITY,Xi=gt/180,Rt=gt/2,Se=gt/4,xi=gt*2/3,be=Math.log10,Me=Math.sign;function Js(n){let t=Math.round(n);n=Vn(n,t,n/1e3)?t:n;let e=Math.pow(10,Math.floor(be(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Ko(n){let t=[],e=Math.sqrt(n),i;for(i=1;is-r).pop(),t}function Oe(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Vn(n,t,e){return Math.abs(n-t)=n}function Qs(n,t,e){let i,s,r;for(i=0,s=n.length;il&&c=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function qi(n,t,e){e=e||(o=>n[o]1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}var Re=(n,t,e,i)=>qi(n,e,i?s=>n[s][t]<=e:s=>n[s][t]qi(n,e,i=>n[i][t]>=e);function ta(n,t,e){let i=0,s=n.length;for(;ii&&n[s-1]>e;)s--;return i>0||s{let i="_onData"+Vi(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){let o=s.apply(this,r);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function nr(n,t){let e=n._chartjs;if(!e)return;let i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(eh.forEach(r=>{delete n[r]}),delete n._chartjs)}function ir(n){let t=new Set,e,i;for(e=0,i=n.length;eArray.prototype.slice.call(o)),s=!1,r=[];return function(...o){r=i(o),s||(s=!0,sr.call(window,()=>{s=!1,n.apply(t,r)}))}}function na(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}var Gi=n=>n==="start"?"left":n==="end"?"right":"center",ie=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,ia=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function or(n,t,e){let i=t.length,s=0,r=i;if(n._sorted){let{iScale:o,_parsed:a}=n,l=o.axis,{min:c,max:h,minDefined:f,maxDefined:g}=o.getUserBounds();f&&(s=Zt(Math.min(Re(a,o.axis,c).lo,e?i:Re(t,l,o.getPixelForValue(c)).lo),0,i-1)),g?r=Zt(Math.max(Re(a,o.axis,h,!0).hi+1,e?0:Re(t,l,o.getPixelForValue(h),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function ar(n){let{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;let r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}var lr=n=>n===0||n===1,nh=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*kt/e)),ih=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*kt/e)+1,qn={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*Rt)+1,easeOutSine:n=>Math.sin(n*Rt),easeInOutSine:n=>-.5*(Math.cos(gt*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=>lr(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=>lr(n)?n:nh(n,.075,.3),easeOutElastic:n=>lr(n)?n:ih(n,.075,.3),easeInOutElastic(n){let t=.1125,e=.45;return lr(n)?n:n<.5?.5*nh(n*2,t,e):.5+.5*ih(n*2-1,t,e)},easeInBack(n){let t=1.70158;return n*n*((t+1)*n-t)},easeOutBack(n){let t=1.70158;return(n-=1)*n*((t+1)*n+t)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-qn.easeOutBounce(1-n),easeOutBounce(n){let t=7.5625,e=2.75;return n<1/e?t*n*n:n<2/e?t*(n-=1.5/e)*n+.75:n<2.5/e?t*(n-=2.25/e)*n+.9375:t*(n-=2.625/e)*n+.984375},easeInOutBounce:n=>n<.5?qn.easeInBounce(n*2)*.5:qn.easeOutBounce(n*2-1)*.5+.5};function Ui(n){return n+.5|0}var vn=(n,t,e)=>Math.max(Math.min(n,e),t);function Ki(n){return vn(Ui(n*2.55),0,255)}function _n(n){return vn(Ui(n*255),0,255)}function Ze(n){return vn(Ui(n/2.55)/100,0,1)}function sh(n){return vn(Ui(n*100),0,100)}var Ce={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},sa=[..."0123456789ABCDEF"],gb=n=>sa[n&15],mb=n=>sa[(n&240)>>4]+sa[n&15],cr=n=>(n&240)>>4==(n&15),bb=n=>cr(n.r)&&cr(n.g)&&cr(n.b)&&cr(n.a);function vb(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Ce[n[1]]*17,g:255&Ce[n[2]]*17,b:255&Ce[n[3]]*17,a:t===5?Ce[n[4]]*17:255}:(t===7||t===9)&&(e={r:Ce[n[1]]<<4|Ce[n[2]],g:Ce[n[3]]<<4|Ce[n[4]],b:Ce[n[5]]<<4|Ce[n[6]],a:t===9?Ce[n[7]]<<4|Ce[n[8]]:255})),e}var _b=(n,t)=>n<255?t(n):"";function yb(n){var t=bb(n)?gb:mb;return n?"#"+t(n.r)+t(n.g)+t(n.b)+_b(n.a,t):void 0}var xb=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function rh(n,t,e){let i=t*Math.min(e,1-e),s=(r,o=(r+n/30)%12)=>e-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function wb(n,t,e){let i=(s,r=(s+n/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function kb(n,t,e){let i=rh(n,1,.5),s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function Sb(n,t,e,i,s){return n===s?(t-e)/i+(t.5?h/(2-r-o):h/(r+o),l=Sb(e,i,s,h,r),l=l*60+.5),[l|0,c||0,a]}function oa(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(_n)}function aa(n,t,e){return oa(rh,n,t,e)}function Mb(n,t,e){return oa(kb,n,t,e)}function Cb(n,t,e){return oa(wb,n,t,e)}function oh(n){return(n%360+360)%360}function Pb(n){let t=xb.exec(n),e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Ki(+t[5]):_n(+t[5]));let s=oh(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=Mb(s,r,o):t[1]==="hsv"?i=Cb(s,r,o):i=aa(s,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Tb(n,t){var e=ra(n);e[0]=oh(e[0]+t),e=aa(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Db(n){if(!n)return;let t=ra(n),e=t[0],i=sh(t[1]),s=sh(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Ze(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}var ah={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"},lh={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 Eb(){let n={},t=Object.keys(lh),e=Object.keys(ah),i,s,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return n}var hr;function Ob(n){hr||(hr=Eb(),hr.transparent=[0,0,0,0]);let t=hr[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Ab=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Rb(n){let t=Ab.exec(n),e=255,i,s,r;if(!!t){if(t[7]!==i){let o=+t[7];e=t[8]?Ki(o):vn(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Ki(i):vn(i,0,255)),s=255&(t[4]?Ki(s):vn(s,0,255)),r=255&(t[6]?Ki(r):vn(r,0,255)),{r:i,g:s,b:r,a:e}}}function Lb(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ze(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}var la=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,wi=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Fb(n,t,e){let i=wi(Ze(n.r)),s=wi(Ze(n.g)),r=wi(Ze(n.b));return{r:_n(la(i+e*(wi(Ze(t.r))-i))),g:_n(la(s+e*(wi(Ze(t.g))-s))),b:_n(la(r+e*(wi(Ze(t.b))-r))),a:n.a+e*(t.a-n.a)}}function ur(n,t,e){if(n){let i=ra(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=aa(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function ch(n,t){return n&&Object.assign(t||{},n)}function hh(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=_n(n[3]))):(t=ch(n,{r:0,g:0,b:0,a:1}),t.a=_n(t.a)),t}function Ib(n){return n.charAt(0)==="r"?Rb(n):Pb(n)}var Zi=class{constructor(t){if(t instanceof Zi)return t;let e=typeof t,i;e==="object"?i=hh(t):e==="string"&&(i=vb(t)||Ob(t)||Ib(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ch(this._rgb);return t&&(t.a=Ze(t.a)),t}set rgb(t){this._rgb=hh(t)}rgbString(){return this._valid?Lb(this._rgb):void 0}hexString(){return this._valid?yb(this._rgb):void 0}hslString(){return this._valid?Db(this._rgb):void 0}mix(t,e){if(t){let i=this.rgb,s=t.rgb,r,o=e===r?.5:e,a=2*o-1,l=i.a-s.a,c=((a*l==-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Fb(this._rgb,t._rgb,e)),this}clone(){return new Zi(this.rgb)}alpha(t){return this._rgb.a=_n(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=Ui(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ur(this._rgb,2,t),this}darken(t){return ur(this._rgb,2,-t),this}saturate(t){return ur(this._rgb,1,t),this}desaturate(t){return ur(this._rgb,1,-t),this}rotate(t){return Tb(this._rgb,t),this}};function uh(n){return new Zi(n)}function ca(n){if(n&&typeof n=="object"){let t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Je(n){return ca(n)?n:uh(n)}function Gn(n){return ca(n)?n:uh(n).saturate(.5).darken(.1).hexString()}var yn=Object.create(null),fr=Object.create(null);function Ji(n,t){if(!t)return n;let e=t.split(".");for(let i=0,s=e.length;ie.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=(e,i)=>Gn(i.backgroundColor),this.hoverBorderColor=(e,i)=>Gn(i.borderColor),this.hoverColor=(e,i)=>Gn(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(t)}set(t,e){return ha(this,t,e)}get(t){return Ji(this,t)}describe(t,e){return ha(fr,t,e)}override(t,e){return ha(yn,t,e)}route(t,e,i,s){let r=Ji(this,t),o=Ji(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){let l=this[a],c=o[s];return at(l)?Object.assign({},c,l):nt(l,c)},set(l){this[a]=l}}})}},ft=new fh({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function dh(n){return!n||ut(n.size)||ut(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ki(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function ua(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let o=0,a=e.length,l,c,h,f,g;for(l=0;le.length){for(l=0;l0&&n.stroke()}}function Un(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.xt.top-e&&n.y0&&r.strokeColor!=="",l,c;for(n.save(),n.font=s.string,$b(n,r),l=0;l+n||0;function ts(n,t){let e={},i=at(t),s=i?Object.keys(t):t,r=at(n)?i?o=>nt(n[o],n[t[o]]):o=>n[o]:()=>n;for(let o of s)e[o]=Nb(r(o));return e}function gr(n){return ts(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Le(n){return ts(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Vt(n){let t=gr(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Ft(n,t){n=n||{},t=t||ft.font;let e=nt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=nt(n.style,t.style);i&&!(""+i).match(Bb)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");let s={family:nt(n.family,t.family),lineHeight:ph(nt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:nt(n.weight,t.weight),string:""};return s.string=dh(s),s}function Kn(n,t,e,i){let s=!0,r,o,a;for(r=0,o=n.length;re&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function Ne(n,t){return Object.assign(Object.create(n),t)}function es(n,t=[""],e=n,i,s=()=>n[0]){Nt(i)||(i=vh("_fallback",n));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:e,_fallback:i,_getTarget:s,override:o=>es([o,...n],t,e,i)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete n[0][a],!0},get(o,a){return gh(o,a,()=>Ub(a,t,n,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,a){return _h(o).includes(a)},ownKeys(o){return _h(o)},set(o,a,l){let c=o._storage||(o._storage=s());return o[a]=c[a]=l,delete o._keys,!0}})}function kn(n,t,e,i){let s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:mr(n,i),setContext:r=>kn(n,r,e,i),override:r=>kn(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete n[o],!0},get(r,o,a){return gh(r,o,()=>Wb(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(r,o,a){return n[o]=a,delete r[o],!0}})}function mr(n,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:le(e)?e:()=>e,isIndexable:le(i)?i:()=>i}}var Hb=(n,t)=>n?n+Vi(t):t,ga=(n,t)=>at(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function gh(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];let i=e();return n[t]=i,i}function Wb(n,t,e){let{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n,a=i[t];return le(a)&&o.isScriptable(t)&&(a=Vb(t,a,n,e)),pt(a)&&a.length&&(a=Yb(t,a,n,o.isIndexable)),ga(t,a)&&(a=kn(a,s,r&&r[t],o)),a}function Vb(n,t,e,i){let{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);return a.add(n),t=t(r,o||i),a.delete(n),ga(n,t)&&(t=ma(s._scopes,s,n,t)),t}function Yb(n,t,e,i){let{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(Nt(r.index)&&i(n))t=t[r.index%t.length];else if(at(t[0])){let l=t,c=s._scopes.filter(h=>h!==l);t=[];for(let h of l){let f=ma(c,s,n,h);t.push(kn(f,r,o&&o[n],a))}}return t}function mh(n,t,e){return le(n)?n(t,e):n}var Xb=(n,t)=>n===!0?t:typeof n=="string"?Be(t,n):void 0;function qb(n,t,e,i,s){for(let r of t){let o=Xb(e,r);if(o){n.add(o);let a=mh(o._fallback,e,s);if(Nt(a)&&a!==e&&a!==i)return a}else if(o===!1&&Nt(i)&&e!==i)return null}return!1}function ma(n,t,e,i){let s=t._rootScopes,r=mh(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=bh(a,o,e,r||e,i);return l===null||Nt(r)&&r!==e&&(l=bh(a,o,r,l,i),l===null)?!1:es(Array.from(a),[""],s,r,()=>Gb(t,e,i))}function bh(n,t,e,i,s){for(;e;)e=qb(n,t,e,i,s);return e}function Gb(n,t,e){let i=n._getTarget();t in i||(i[t]={});let s=i[t];return pt(s)&&at(e)?e:s}function Ub(n,t,e,i){let s;for(let r of t)if(s=vh(Hb(r,n),e),Nt(s))return ga(n,s)?ma(e,i,n,s):s}function vh(n,t){for(let e of t){if(!e)continue;let i=e[n];if(Nt(i))return i}}function _h(n){let t=n._keys;return t||(t=n._keys=Kb(n._scopes)),t}function Kb(n){let t=new Set;for(let e of n)for(let i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function br(n,t,e,i){let{iScale:s}=n,{key:r="r"}=this._parsing,o=new Array(i),a,l,c,h;for(a=0,l=i;atn==="x"?"y":"x";function xh(n,t,e,i){let s=n.skip?t:n,r=t,o=e.skip?t:e,a=Ke(r,s),l=Ke(o,r),c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let f=i*c,g=i*h;return{previous:{x:r.x-f*(o.x-s.x),y:r.y-f*(o.y-s.y)},next:{x:r.x+g*(o.x-s.x),y:r.y+g*(o.y-s.y)}}}function Jb(n,t,e){let i=n.length,s,r,o,a,l,c=Si(n,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")wh(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,o=n.length;rwindow.getComputedStyle(n,null);function kh(n,t){return xr(n).getPropertyValue(t)}var e0=["top","right","bottom","left"];function Zn(n,t,e){let i={};e=e?"-"+e:"";for(let s=0;s<4;s++){let r=e0[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var n0=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function i0(n,t){let e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i,o=!1,a,l;if(n0(s,r,n.target))a=s,l=r;else{let c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function nn(n,t){if("native"in n)return n;let{canvas:e,currentDevicePixelRatio:i}=t,s=xr(e),r=s.boxSizing==="border-box",o=Zn(s,"padding"),a=Zn(s,"border","width"),{x:l,y:c,box:h}=i0(n,e),f=o.left+(h&&a.left),g=o.top+(h&&a.top),{width:p,height:m}=t;return r&&(p-=o.width+a.width,m-=o.height+a.height),{x:Math.round((l-f)/p*e.width/i),y:Math.round((c-g)/m*e.height/i)}}function s0(n,t,e){let i,s;if(t===void 0||e===void 0){let r=ns(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{let o=r.getBoundingClientRect(),a=xr(r),l=Zn(a,"border","width"),c=Zn(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=yr(a.maxWidth,r,"clientWidth"),s=yr(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||Yi,maxHeight:s||Yi}}var va=n=>Math.round(n*10)/10;function _a(n,t,e,i){let s=xr(n),r=Zn(s,"margin"),o=yr(s.maxWidth,n,"clientWidth")||Yi,a=yr(s.maxHeight,n,"clientHeight")||Yi,l=s0(n,t,e),{width:c,height:h}=l;if(s.boxSizing==="content-box"){let f=Zn(s,"border","width"),g=Zn(s,"padding");c-=g.width+f.width,h-=g.height+f.height}return c=Math.max(0,c-r.width),h=Math.max(0,i?Math.floor(c/i):h-r.height),c=va(Math.min(c,o,l.maxWidth)),h=va(Math.min(h,a,l.maxHeight)),c&&!h&&(h=va(c/2)),{width:c,height:h}}function wr(n,t,e){let i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=s/i,n.width=r/i;let o=n.canvas;return o.style&&(e||!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!==r?(n.currentDevicePixelRatio=i,o.height=s,o.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}var ya=function(){let n=!1;try{let t={get passive(){return n=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){}return n}();function kr(n,t){let e=kh(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function sn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function xa(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function wa(n,t,e,i){let s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=sn(n,s,e),a=sn(s,r,e),l=sn(r,t,e),c=sn(o,a,e),h=sn(a,l,e);return sn(c,h,e)}var Sh=new Map;function r0(n,t){t=t||{};let e=n+JSON.stringify(t),i=Sh.get(e);return i||(i=new Intl.NumberFormat(n,t),Sh.set(e,i)),i}function Jn(n,t,e){return r0(t,e).format(n)}var o0=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},a0=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Sn(n,t,e){return n?o0(t,e):a0()}function Sr(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function Mr(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Mh(n){return n==="angle"?{between:Xn,compare:th,normalize:fe}:{between:Ae,compare:(t,e)=>t-e,normalize:t=>t}}function Ch({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e==0,style:s}}function l0(n,t,e){let{property:i,start:s,end:r}=e,{between:o,normalize:a}=Mh(i),l=t.length,{start:c,end:h,loop:f}=n,g,p;if(f){for(c+=l,h+=l,g=0,p=l;gl(s,F,M)&&a(s,F)!==0,I=()=>a(r,M)===0||l(r,F,M),$=()=>y||D(),N=()=>!y||I();for(let G=h,U=h;G<=f;++G)C=t[G%o],!C.skip&&(M=c(C[i]),M!==F&&(y=l(M,s,r),S===null&&$()&&(S=a(M,s)===0?G:U),S!==null&&N()&&(m.push(Ch({start:S,end:G,loop:g,count:o,style:p})),S=null),U=G,F=M));return S!==null&&m.push(Ch({start:S,end:f,loop:g,count:o,style:p})),m}function Pr(n,t){let e=[],i=n.segments;for(let s=0;ss&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function h0(n,t,e,i){let s=n.length,r=[],o=t,a=n[t],l;for(l=t+1;l<=e;++l){let c=n[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function ka(n,t){let e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];let r=!!n._loop,{start:o,end:a}=c0(e,s,r,i);if(i===!0)return Ph(n,[{start:o,end:a,loop:r}],e,t);let l=aa({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=sr.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;let r=i.items,o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);!e||(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},rn=new Dh,Eh="transparent",d0={boolean(n,t,e){return e>.5?t:n},color(n,t,e){let i=Je(n||Eh),s=i.valid&&Je(t||Eh);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}},Oh=class{constructor(t,e,i,s){let r=e[i];s=Kn([t.to,s,r,t.from]);let o=Kn([t.from,r,s]);this._active=!0,this._fn=t.fn||d0[t.type||typeof o],this._easing=qn[t.easing]||qn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Kn([t.to,e,s,t.from]),this._from=Kn([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to,l;if(this._active=r!==a&&(o||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let s=0;sn!=="onProgress"&&n!=="onComplete"&&n!=="fn"});ft.set("animations",{colors:{type:"color",properties:g0},numbers:{type:"number",properties:p0}});ft.describe("animations",{_fallback:"animation"});ft.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}}}});var is=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!at(t))return;let e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{let s=t[i];if(!at(s))return;let r={};for(let o of m0)r[o]=s[o];(pt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!e.has(o))&&e.set(o,r)})})}_animateOptions(t,e){let i=e.options,s=v0(t,i);if(!s)return[];let r=this._createAnimations(s,i);return i.$shared&&b0(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){let i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now(),l;for(l=o.length-1;l>=0;--l){let c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}let h=e[c],f=r[c],g=i.get(c);if(f)if(g&&f.active()){f.update(g,h,a);continue}else f.cancel();if(!g||!g.duration){t[c]=h;continue}r[c]=f=new Oh(g,t,c,h),s.push(f)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return rn.add(this._chart,i),!0}};function b0(n,t){let e=[],i=Object.keys(t);for(let s=0;s0||!e&&r<0)return s.index}return null}function $h(n,t){let{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,h=w0(r,o,i),f=t.length,g;for(let p=0;pe[i].axis===t).shift()}function M0(n,t){return Ne(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function C0(n,t,e){return Ne(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ss(n,t){let e=n.controller.index,i=n.vScale&&n.vScale.axis;if(!!i){t=t||n._parsed;for(let s of t){let r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e]}}}var Ma=n=>n==="reset"||n==="none",jh=(n,t)=>t?n:Object.assign({},n),P0=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Rh(e,!0),values:null},ve=class{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Fh(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&ss(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(f,g,p,m)=>f==="x"?g:f==="r"?m:p,r=e.xAxisID=nt(i.xAxisID,Sa(t,"x")),o=e.yAxisID=nt(i.yAxisID,Sa(t,"y")),a=e.rAxisID=nt(i.rAxisID,Sa(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),h=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&nr(this._data,this),t._stacked&&ss(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(at(e))this._data=x0(e);else if(i!==e){if(i){nr(i,this);let s=this._cachedMeta;ss(s),s._parsed=[]}e&&Object.isExtensible(e)&&ea(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let r=e._stacked;e._stacked=Fh(e.vScale,e),e.stack!==i.stack&&(s=!0,ss(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&$h(this,e._parsed)}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis,l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],h,f,g;if(this._parsing===!1)i._parsed=s,i._sorted=!0,g=s;else{pt(s[t])?g=this.parseArrayData(i,s,t,e):at(s[t])?g=this.parseObjectData(i,s,t,e):g=this.parsePrimitiveData(i,s,t,e);let p=()=>f[a]===null||c&&f[a]y||f=0;--g)if(!m()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){let e=this._cachedMeta._parsed,i=[],s,r,o;for(s=0,r=e.length;s=0&&tthis.getContext(i,s),y=c.resolveNamedOptions(g,p,m,f);return y.$shared&&(y.$shared=l,r[o]=Object.freeze(jh(y,l))),y}_resolveAnimations(t,e,i){let s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){let h=this.chart.config,f=h.datasetAnimationScopeKeys(this._type,e),g=h.getOptionScopes(this.getDataset(),f);l=h.createResolver(g,this.getContext(t,i,e))}let c=new is(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(!!t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ma(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,s){Ma(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ma(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;let r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let s=i.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;as-r))}return n._cache.$bar}function D0(n){let t=n.iScale,e=T0(t,n.type),i=t._length,s,r,o,a,l=()=>{o===32767||o===-32768||(Nt(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=e.length;s0?s[n-1]:null,a=nMath.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function zh(n,t,e,i){return pt(n)?A0(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Bh(n,t,e,i){let s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[],c,h,f,g;for(c=e,h=e+i;c=e?1:-1)}function L0(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{let c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(ut(h)||isNaN(h))return!0};for(let l of s)if(!(e!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){let s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){let t=this.options,e=this._cachedMeta,i=e.iScale,s=[],r,o;for(r=0,o=e.data.length;r=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,{xScale:i,yScale:s}=e,r=this.getParsed(t),o=i.getLabelForValue(r.x),a=s.getLabelForValue(r.y),l=r._custom;return{label:e.label,value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){let r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=o.axis,f=a.axis;for(let g=e;gXn(F,a,l,!0)?1:Math.max(D,D*e,I,I*e),m=(F,D,I)=>Xn(F,a,l,!0)?-1:Math.min(D,D*e,I,I*e),y=p(0,c,f),S=p(Rt,h,g),M=m(gt,c,f),C=m(gt+Rt,h,g);i=(y-M)/2,s=(S-C)/2,r=-(y+M)/2,o=-(S+C)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}var Qn=class extends ve{constructor(t,e){super(t,e);this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(at(i[t])){let{key:l="value"}=this._parsing;r=c=>+Be(i[c],l)}let o,a;for(o=t,a=t+e;o0&&!isNaN(t)?kt*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Jn(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0,i=this.chart,s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;sn!=="spacing",_indexable:n=>n!=="spacing"};Qn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){let t=n.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=n.legend.options;return t.labels.map((i,s)=>{let o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let t=n.label,e=": "+n.formattedValue;return pt(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};var as=class extends ve{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled,{start:a,count:l}=or(e,s,o);this._drawStart=a,this._drawCount=l,ar(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){let r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s),g=o.axis,p=a.axis,{spanGaps:m,segment:y}=this.options,S=Oe(m)?m:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none",C=e>0&&this.getParsed(e-1);for(let F=e;F0&&Math.abs(I[g]-C[g])>S,y&&($.parsed=I,$.raw=c.data[F]),f&&($.options=h||this.resolveDataElementOptions(F,D.active?"active":s)),M||this.updateElement(D,F,$,s),C=I}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};as.id="line";as.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};as.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var ls=class extends ve{constructor(t,e){super(t,e);this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Jn(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return br.bind(this)(t,e,i,s)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{let r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(re.max&&(e.max=r))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){let r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,f=c.yCenter,g=c.getIndexAngle(0)-.5*gt,p=g,m,y=360/this.countVisibleElements();for(m=0;m{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Wt(this.resolveDataElementOptions(t,e).angle||i):0}};ls.id="polarArea";ls.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};ls.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){let t=n.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=n.legend.options;return t.labels.map((i,s)=>{let o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,t,e){e.chart.toggleDataVisibility(t.index),e.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}}};var Tr=class extends Qn{};Tr.id="pie";Tr.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var cs=class extends ve{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return br.bind(this)(t,e,i,s)}update(t){let e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){let o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);let a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){let r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}};qt.defaults={};qt.defaultRoutes=void 0;var Wh={values(n){return pt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";let i=this.chart.options.locale,s,r=n;if(e.length>1){let c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=z0(n,e)}let o=be(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Jn(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";let i=n/Math.pow(10,Math.floor(be(n)));return i===1||i===2||i===5?Wh.numeric.call(this,n,t,e):""}};function z0(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Dr={formatters:Wh};ft.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,t)=>t.lineWidth,tickColor:(n,t)=>t.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:Dr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});ft.route("scale.ticks","color","","color");ft.route("scale.grid","color","","borderColor");ft.route("scale.grid","borderColor","","borderColor");ft.route("scale.title","color","","color");ft.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});ft.describe("scales",{_fallback:"scale"});ft.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function B0(n,t){let e=n.options.ticks,i=e.maxTicksLimit||N0(n),s=e.major.enabled?W0(t):[],r=s.length,o=s[0],a=s[r-1],l=[];if(r>i)return V0(t,l,s,r/i),l;let c=H0(s,t,i);if(r>0){let h,f,g=r>1?Math.round((a-o)/(r-1)):null;for(Er(t,l,c,ut(g)?0:o-g,o),h=0,f=r-1;hs)return l}return Math.max(s,1)}function W0(n){let t=[],e,i;for(e=0,i=n.length;en==="left"?"right":n==="right"?"left":n,Vh=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e;function Yh(n,t){let e=[],i=n.length/t,s=n.length,r=0;for(;ro+a)))return l}function G0(n,t){Ct(n,e=>{let i=e.gc,s=i.length/2,r;if(s>t){for(r=0;ri?i:e,i=s&&e>i?e:i,{min:me(e,me(i,e)),max:me(i,me(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){wt(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,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=pa(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let h=this._getLabelSizes(),f=h.widest.width,g=h.highest.height,p=Zt(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/i:p/(i-1),f+6>a&&(a=p/(i-(t.offset?.5:1)),l=this.maxHeight-hs(t.grid)-e.padding-Xh(t.title,this.chart.options.font),c=Math.sqrt(f*f+g*g),o=Yn(Math.min(Math.asin(Zt((h.highest.height+6)/a,-1,1)),Math.asin(Zt(l/c,-1,1))-Math.asin(Zt(g/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){wt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){wt(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let l=Xh(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=hs(r)+l):(t.height=this.maxHeight,t.width=hs(r)+l),i.display&&this.ticks.length){let{first:c,last:h,widest:f,highest:g}=this._getLabelSizes(),p=i.padding*2,m=Wt(this.labelRotation),y=Math.cos(m),S=Math.sin(m);if(a){let M=i.mirror?0:S*f.width+y*g.height;t.height=Math.min(this.maxHeight,t.height+M+p)}else{let M=i.mirror?0:y*f.width+S*g.height;t.width=Math.min(this.maxWidth,t.width+M+p)}this._calculatePadding(c,h,S,y)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){let{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1),g=0,p=0;l?c?(g=s*t.width,p=i*e.height):(g=i*t.height,p=s*e.width):r==="start"?p=e.width:r==="end"?g=t.width:r!=="inner"&&(g=t.width/2,p=e.width/2),this.paddingLeft=Math.max((g-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((p-f+o)*this.width/(this.width-f),0)}else{let h=e.height/2,f=t.height/2;r==="start"?(h=0,f=t.height):r==="end"&&(h=e.height,f=0),this.paddingTop=h+o,this.paddingBottom=f+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(){wt(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e({width:r[N]||0,height:o[N]||0});return{first:$(0),last:$(e-1),widest:$(D),highest:$(I),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return Jo(this._alignToPixels?Qe(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){let e=this.axis,i=this.chart,s=this.options,{grid:r,position:o}=s,a=r.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),f=hs(r),g=[],p=r.setContext(this.getContext()),m=p.drawBorder?p.borderWidth:0,y=m/2,S=function(et){return Qe(i,et,m)},M,C,F,D,I,$,N,G,U,it,lt,rt;if(o==="top")M=S(this.bottom),$=this.bottom-f,G=M-y,it=S(t.top)+y,rt=t.bottom;else if(o==="bottom")M=S(this.top),it=t.top,rt=S(t.bottom)-y,$=M+y,G=this.top+f;else if(o==="left")M=S(this.right),I=this.right-f,N=M-y,U=S(t.left)+y,lt=t.right;else if(o==="right")M=S(this.left),U=t.left,lt=S(t.right)-y,I=M+y,N=this.left+f;else if(e==="x"){if(o==="center")M=S((t.top+t.bottom)/2+.5);else if(at(o)){let et=Object.keys(o)[0],Et=o[et];M=S(this.chart.scales[et].getPixelForValue(Et))}it=t.top,rt=t.bottom,$=M+y,G=$+f}else if(e==="y"){if(o==="center")M=S((t.left+t.right)/2);else if(at(o)){let et=Object.keys(o)[0],Et=o[et];M=S(this.chart.scales[et].getPixelForValue(Et))}I=M-y,N=I-f,U=t.left,lt=t.right}let Pt=nt(s.ticks.maxTicksLimit,h),zt=Math.max(1,Math.ceil(h/Pt));for(C=0;Cr.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),r,o,a=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=s.length;r{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],r,o;for(r=0,o=e.length;r{let i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");ft.route(r,s,l,a)})}function ev(n){return"id"in n&&"defaults"in n}var qh=class{constructor(){this.controllers=new us(ve,"datasets",!0),this.elements=new us(qt,"elements"),this.plugins=new us(Object,"plugins"),this.scales=new us(Mn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{let r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Ct(s,o=>{let a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){let s=Vi(t);wt(i["before"+s],[],i),e[t](i),wt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let D=e;D0&&Math.abs($[p]-F[p])>M,S&&(N.parsed=$,N.raw=c.data[D]),g&&(N.options=f||this.resolveDataElementOptions(D,I.active?"active":s)),C||this.updateElement(I,D,N,s),F=$}this.updateSharedOptions(f,s,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}let i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;let r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}};fs.id="scatter";fs.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};fs.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var nv=Object.freeze({__proto__:null,BarController:rs,BubbleController:os,DoughnutController:Qn,LineController:as,PolarAreaController:ls,PieController:Tr,RadarController:cs,ScatterController:fs});function ti(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Or=class{constructor(t){this.options=t||{}}init(t){}formats(){return ti()}parse(t,e){return ti()}format(t,e){return ti()}add(t,e,i){return ti()}diff(t,e,i){return ti()}startOf(t,e,i){return ti()}endOf(t,e){return ti()}};Or.override=function(n){Object.assign(Or.prototype,n)};var Pa={_date:Or};function iv(n,t,e,i){let{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){let l=a._reversePixels?Qo:Re;if(i){if(s._sharedOptions){let c=r[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){let f=l(r,t,e-h),g=l(r,t,e+h);return{lo:f.lo,hi:g.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function ds(n,t,e,i,s){let r=n.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a{l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var av={evaluateInteractionItems:ds,modes:{index(n,t,e,i){let s=nn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Ta(n,s,r,i,o):Da(n,s,r,!1,i,o),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{let h=a[0].index,f=c.data[h];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:h})}),l):[]},dataset(n,t,e,i){let s=nn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1,a=e.intersect?Ta(n,s,r,i,o):Da(n,s,r,!1,i,o);if(a.length>0){let l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function Kh(n,t){return n.filter(e=>Uh.indexOf(e.pos)===-1&&e.box.axis===t)}function gs(n,t){return n.sort((e,i)=>{let s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function lv(n){let t=[],e,i,s,r,o,a;for(e=0,i=(n||[]).length;ec.box.fullSize),!0),i=gs(ps(t,"left"),!0),s=gs(ps(t,"right")),r=gs(ps(t,"top"),!0),o=gs(ps(t,"bottom")),a=Kh(t,"x"),l=Kh(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ps(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function Zh(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Jh(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function fv(n,t,e,i){let{pos:s,box:r}=e,o=n.maxPadding;if(!at(s)){e.size&&(n[s]-=e.size);let f=i[e.stack]||{size:0,count:1};f.size=Math.max(f.size,e.horizontal?r.height:r.width),e.size=f.size/f.count,n[s]+=e.size}r.getPadding&&Jh(o,r.getPadding());let a=Math.max(0,t.outerWidth-Zh(o,n,"left","right")),l=Math.max(0,t.outerHeight-Zh(o,n,"top","bottom")),c=a!==n.w,h=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function dv(n){let t=n.maxPadding;function e(i){let s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function pv(n,t){let e=t.maxPadding;function i(s){let r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(n?["left","right"]:["top","bottom"])}function ms(n,t,e,i){let s=[],r,o,a,l,c,h;for(r=0,o=n.length,c=0;r{typeof y.beforeLayout=="function"&&y.beforeLayout()});let h=l.reduce((y,S)=>S.box.options&&S.box.options.display===!1?y:y+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),g=Object.assign({},s);Jh(g,Vt(i));let p=Object.assign({maxPadding:g,w:r,h:o,x:s.left,y:s.top},s),m=hv(l.concat(c),f);ms(a.fullSize,p,f,m),ms(l,p,f,m),ms(c,p,f,m)&&ms(l,p,f,m),dv(p),Qh(a.leftAndTop,p,f,m),p.x+=p.w,p.y+=p.h,Qh(a.rightAndBottom,p,f,m),n.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Ct(a.chartArea,y=>{let S=y.box;Object.assign(S,n.chartArea),S.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},Ea=class{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}},tu=class extends Ea{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},Rr="$chartjs",gv={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},eu=n=>n===null||n==="";function mv(n,t){let e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[Rr]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",eu(s)){let r=kr(n,"width");r!==void 0&&(n.width=r)}if(eu(i))if(n.style.height==="")n.height=n.width/(t||2);else{let r=kr(n,"height");r!==void 0&&(n.height=r)}return n}var nu=ya?{passive:!0}:!1;function bv(n,t,e){n.addEventListener(t,e,nu)}function vv(n,t,e){n.canvas.removeEventListener(t,e,nu)}function _v(n,t){let e=gv[n.type]||n.type,{x:i,y:s}=nn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Lr(n,t){for(let e of n)if(e===t||e.contains(t))return!0}function yv(n,t,e){let i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||Lr(a.addedNodes,i),o=o&&!Lr(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function xv(n,t,e){let i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||Lr(a.removedNodes,i),o=o&&!Lr(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}var bs=new Map,iu=0;function su(){let n=window.devicePixelRatio;n!==iu&&(iu=n,bs.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function wv(n,t){bs.size||window.addEventListener("resize",su),bs.set(n,t)}function kv(n){bs.delete(n),bs.size||window.removeEventListener("resize",su)}function Sv(n,t,e){let i=n.canvas,s=i&&ns(i);if(!s)return;let r=rr((a,l)=>{let c=s.clientWidth;e(a,l),c{let l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||r(c,h)});return o.observe(s),wv(n,r),o}function Oa(n,t,e){e&&e.disconnect(),t==="resize"&&kv(n)}function Mv(n,t,e){let i=n.canvas,s=rr(r=>{n.ctx!==null&&e(_v(r,n))},n,r=>{let o=r[0];return[o,o.offsetX,o.offsetY]});return bv(i,t,s),s}var ru=class extends Ea{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(mv(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[Rr])return!1;let i=e[Rr].initial;["height","width"].forEach(r=>{let o=i[r];ut(o)?e.removeAttribute(r):e.setAttribute(r,o)});let s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[Rr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let s=t.$proxies||(t.$proxies={}),o={attach:yv,detach:xv,resize:Sv}[e]||Mv;s[e]=o(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Oa,detach:Oa,resize:Oa}[e]||vv)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return _a(t,e,i,s)}isAttached(t){let e=ns(t);return!!(e&&e.isConnected)}};function Cv(n){return!_r()||typeof OffscreenCanvas!="undefined"&&n instanceof OffscreenCanvas?tu:ru}var ou=class{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(let r of t){let o=r.plugin,a=o[i],l=[e,s,r.options];if(wt(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){ut(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,s=nt(i.options&&i.options.plugins,{}),r=Pv(i);return s===!1&&!e?[]:Dv(t,r,s,e)}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}};function Pv(n){let t={},e=[],i=Object.keys(He.plugins.items);for(let r=0;r{let l=i[a];if(!at(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let c=Ra(a,l),h=Av(c,s),f=e.scales||{};r[c]=r[c]||a,o[a]=Wn(Object.create(null),[{axis:c},l,f[c],f[h]])}),n.data.datasets.forEach(a=>{let l=a.type||n.type,c=a.indexAxis||Aa(l,t),f=(yn[l]||{}).scales||{};Object.keys(f).forEach(g=>{let p=Ov(g,c),m=a[p+"AxisID"]||r[p]||p;o[m]=o[m]||Object.create(null),Wn(o[m],[{axis:p},i[m],f[g]])})}),Object.keys(o).forEach(a=>{let l=o[a];Wn(l,[ft.scales[l.type],ft.scale])}),o}function au(n){let t=n.options||(n.options={});t.plugins=nt(t.plugins,{}),t.scales=Lv(n,t)}function lu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Fv(n){return n=n||{},n.data=lu(n.data),au(n),n}var cu=new Map,hu=new Set;function Fr(n,t){let e=cu.get(n);return e||(e=t(),cu.set(n,e),hu.add(e)),e}var vs=(n,t,e)=>{let i=Be(t,e);i!==void 0&&n.add(i)},uu=class{constructor(t){this._config=Fv(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=lu(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),au(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Fr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Fr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Fr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return Fr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){let{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;let l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(f=>vs(l,t,f))),h.forEach(f=>vs(l,s,f)),h.forEach(f=>vs(l,yn[r]||{},f)),h.forEach(f=>vs(l,ft,f)),h.forEach(f=>vs(l,fr,f))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),hu.has(e)&&o.set(e,c),c}chartOptionScopes(){let{options:t,type:e}=this;return[t,yn[e]||{},ft.datasets[e]||{},{type:e},ft,fr]}resolveNamedOptions(t,e,i,s=[""]){let r={$shared:!0},{resolver:o,subPrefixes:a}=fu(this._resolverCache,t,s),l=o;if($v(o,e)){r.$shared=!1,i=le(i)?i():i;let c=this.createResolver(t,i,a);l=kn(o,i,c)}for(let c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){let{resolver:r}=fu(this._resolverCache,t,i);return at(e)?kn(r,e,void 0,s):r}};function fu(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));let s=e.join(),r=i.get(s);return r||(r={resolver:es(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}var Iv=n=>at(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||le(n[e]),!1);function $v(n,t){let{isScriptable:e,isIndexable:i}=mr(n);for(let s of t){let r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(le(a)||Iv(a))||o&&pt(a))return!0}return!1}var jv="3.9.1",zv=["top","bottom","left","right","chartArea"];function du(n,t){return n==="top"||n==="bottom"||zv.indexOf(n)===-1&&t==="x"}function pu(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function gu(n){let t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),wt(e&&e.onComplete,[n],t)}function Bv(n){let t=n.chart,e=t.options.animation;wt(e&&e.onProgress,[n],t)}function mu(n){return _r()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}var Ir={},bu=n=>{let t=mu(n);return Object.values(Ir).filter(e=>e.canvas===t).pop()};function Nv(n,t,e){let i=Object.keys(n);for(let s of i){let r=+s;if(r>=t){let o=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=o)}}}function Hv(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}var se=class{constructor(t,e){let i=this.config=new uu(e),s=mu(t),r=bu(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Cv(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=qo(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,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 ou,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=na(f=>this.update(f),o.resizeDelay||0),this._dataChanges=[],Ir[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}rn.listen(this,"complete",gu),rn.listen(this,"progress",Bv),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return ut(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():wr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return dr(this.canvas,this.ctx),this}stop(){return rn.stop(this),this}resize(t,e){rn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,!!wr(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),wt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let e=this.options.scales||{};Ct(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{}),r=[];e&&(r=r.concat(Object.keys(e).map(o=>{let a=e[o],l=Ra(o,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),Ct(r,o=>{let a=o.options,l=a.id,c=Ra(l,a),h=nt(a.type,o.dtype);(a.position===void 0||du(a.position,c)!==du(o.dposition))&&(a.position=o.dposition),s[l]=!0;let f=null;if(l in i&&i[l].type===h)f=i[l];else{let g=He.getScale(h);f=new g({id:l,type:h,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(a,t)}),Ct(s,(o,a)=>{o||delete i[a]}),Ct(i,o=>{he.configure(this,o,o.options),he.addBox(this,o)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;se.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],e=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(pu("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ct(this.scales,t=>{he.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Zs(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:r}of e){let o=i==="_removeElements"?-r:r;Nv(t,s,o)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;he.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Ct(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,s=!i.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&xn(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&wn(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Un(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){let r=av.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ne(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);Nt(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),rn.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Ct(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)},o,a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){Ct(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Ct(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let s=i?"set":"remove",r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{let a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!yi(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){let s=this.options.hover,r=(l,c)=>l.filter(h=>!c.some(f=>h.datasetIndex===f.datasetIndex&&h.index===f.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;let r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){let{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,i,o),l=Uo(t),c=Hv(t,this._lastEvent,i,l);i&&(this._lastEvent=null,wt(r.onHover,[t,a,this],this),l&&wt(r.onClick,[t,a,this],this));let h=!yi(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},vu=()=>Ct(se.instances,n=>n._plugins.invalidate()),Cn=!0;Object.defineProperties(se,{defaults:{enumerable:Cn,value:ft},instances:{enumerable:Cn,value:Ir},overrides:{enumerable:Cn,value:yn},registry:{enumerable:Cn,value:He},version:{enumerable:Cn,value:jv},getChart:{enumerable:Cn,value:bu},register:{enumerable:Cn,value:(...n)=>{He.add(...n),vu()}},unregister:{enumerable:Cn,value:(...n)=>{He.remove(...n),vu()}}});function _u(n,t,e){let{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t,c=s/a;n.beginPath(),n.arc(r,o,a,i-c,e+c),l>s?(c=s/l,n.arc(r,o,l,e+c,i-c,!0)):n.arc(r,o,s,e+Rt,i-Rt),n.closePath(),n.clip()}function Wv(n){return ts(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Vv(n,t,e,i){let s=Wv(n.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{let c=(e-Math.min(r,l))*i/2;return Zt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Zt(s.innerStart,0,o),innerEnd:Zt(s.innerEnd,0,o)}}function Mi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function La(n,t,e,i,s,r){let{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,f=Math.max(t.outerRadius+i+e-c,0),g=h>0?h+i+e+c:0,p=0,m=s-l;if(i){let et=h>0?h-i:0,Et=f>0?f-i:0,St=(et+Et)/2,re=St!==0?m*St/(St+i):m;p=(m-re)/2}let y=Math.max(.001,m*f-e/gt)/f,S=(m-y)/2,M=l+S+p,C=s-S-p,{outerStart:F,outerEnd:D,innerStart:I,innerEnd:$}=Vv(t,g,f,C-M),N=f-F,G=f-D,U=M+F/N,it=C-D/G,lt=g+I,rt=g+$,Pt=M+I/lt,zt=C-$/rt;if(n.beginPath(),r){if(n.arc(o,a,f,U,it),D>0){let St=Mi(G,it,o,a);n.arc(St.x,St.y,D,it,C+Rt)}let et=Mi(rt,C,o,a);if(n.lineTo(et.x,et.y),$>0){let St=Mi(rt,zt,o,a);n.arc(St.x,St.y,$,C+Rt,zt+Math.PI)}if(n.arc(o,a,g,C-$/g,M+I/g,!0),I>0){let St=Mi(lt,Pt,o,a);n.arc(St.x,St.y,I,Pt+Math.PI,M-Rt)}let Et=Mi(N,M,o,a);if(n.lineTo(Et.x,Et.y),F>0){let St=Mi(N,U,o,a);n.arc(St.x,St.y,F,M-Rt,U)}}else{n.moveTo(o,a);let et=Math.cos(U)*f+o,Et=Math.sin(U)*f+a;n.lineTo(et,Et);let St=Math.cos(it)*f+o,re=Math.sin(it)*f+a;n.lineTo(St,re)}n.closePath()}function Yv(n,t,e,i,s){let{fullCircles:r,startAngle:o,circumference:a}=t,l=t.endAngle;if(r){La(n,t,e,i,o+kt,s);for(let c=0;c=kt||Xn(r,a,l),y=Ae(o,c+g,h+g);return m&&y}getCenterPoint(t){let{x:e,y:i,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(s+r)/2,f=(o+a+c+l)/2;return{x:e+Math.cos(h)*f,y:i+Math.sin(h)*f}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,s=(e.offset||0)/2,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>kt?Math.floor(i/kt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;let c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=gt&&(a=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;let l=Yv(t,this,a,r,o);qv(t,this,a,r,l,o),t.restore()}};_s.id="arc";_s.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};_s.defaultRoutes={backgroundColor:"backgroundColor"};function yu(n,t,e=t){n.lineCap=nt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(nt(e.borderDash,t.borderDash)),n.lineDashOffset=nt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=nt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=nt(e.borderWidth,t.borderWidth),n.strokeStyle=nt(e.borderColor,t.borderColor)}function Gv(n,t,e){n.lineTo(e.x,e.y)}function Uv(n){return n.stepped?fa:n.tension||n.cubicInterpolationMode==="monotone"?da:Gv}function xu(n,t,e={}){let i=n.length,{start:s=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),h=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-D:D))%r,F=()=>{y!==S&&(n.lineTo(h,S),n.lineTo(h,y),n.lineTo(h,M))};for(l&&(p=s[C(0)],n.moveTo(p.x,p.y)),g=0;g<=a;++g){if(p=s[C(g)],p.skip)continue;let D=p.x,I=p.y,$=D|0;$===m?(IS&&(S=I),h=(f*h+D)/++f):(F(),n.lineTo(D,I),m=$,f=0,y=S=I),M=I}F()}function Fa(n){let t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Zv:Kv}function Jv(n){return n.stepped?xa:n.tension||n.cubicInterpolationMode==="monotone"?wa:sn}function Qv(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),yu(n,t.options),n.stroke(s)}function t_(n,t,e,i){let{segments:s,options:r}=t,o=Fa(t);for(let a of s)yu(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}var e_=typeof Path2D=="function";function n_(n,t,e,i){e_&&!t.options.segment?Qv(n,t,e,i):t_(n,t,e,i)}var on=class extends qt{constructor(t){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,t&&Object.assign(this,t)}updateControlPoints(t,e){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;ba(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=ka(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i=this.options,s=t[e],r=this.points,o=Pr(this,{property:e,start:s,end:s});if(!o.length)return;let a=[],l=Jv(i),c,h;for(c=0,h=o.length;cn!=="borderDash"&&n!=="fill"};function wu(n,t,e,i){let s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)=e)return n.slice(t,t+e);let o=[],a=(e-2)/(r-2),l=0,c=t+e-1,h=t,f,g,p,m,y;for(o[l++]=n[h],f=0;fp&&(p=m,g=n[C],y=C);o[l++]=g,h=y}return o[l++]=n[c],o}function h_(n,t,e,i){let s=0,r=0,o,a,l,c,h,f,g,p,m,y,S=[],M=t+e-1,C=n[t].x,D=n[M].x-C;for(o=t;oy&&(y=c,g=o),s=(r*s+a.x)/++r;else{let $=o-1;if(!ut(f)&&!ut(g)){let N=Math.min(f,g),G=Math.max(f,g);N!==p&&N!==$&&S.push({...n[N],x:s}),G!==p&&G!==$&&S.push({...n[G],x:s})}o>0&&$!==p&&S.push(n[$]),S.push(a),h=I,r=0,m=y=c,f=g=p=o}}return S}function Su(n){if(n._decimated){let t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{value:t})}}function Mu(n){n.data.datasets.forEach(t=>{Su(t)})}function u_(n,t){let e=t.length,i=0,s,{iScale:r}=n,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Zt(Re(t,r.axis,o).lo,0,e-1)),c?s=Zt(Re(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var f_={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Mu(n);return}let i=n.width;n.data.datasets.forEach((s,r)=>{let{_data:o,indexAxis:a}=s,l=n.getDatasetMeta(r),c=o||s.data;if(Kn([a,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let h=n.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:f,count:g}=u_(l,c),p=e.threshold||4*i;if(g<=p){Su(s);return}ut(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let m;switch(e.algorithm){case"lttb":m=c_(c,f,g,i,e);break;case"min-max":m=h_(c,f,g,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=m})},destroy(n){Mu(n)}};function d_(n,t,e){let i=n.segments,s=n.points,r=t.points,o=[];for(let a of i){let{start:l,end:c}=a;c=za(l,c,s);let h=ja(e,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:h,start:s[l],end:s[c]});continue}let f=Pr(t,h);for(let g of f){let p=ja(e,r[g.start],r[g.end],g.loop),m=Cr(a,s,p);for(let y of m)o.push({source:y,target:g,start:{[e]:Cu(h,p,"start",Math.max)},end:{[e]:Cu(h,p,"end",Math.min)}})}}return o}function ja(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=fe(s),r=fe(r)),{property:n,start:s,end:r}}function p_(n,t){let{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=za(o,a,s);let l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function za(n,t,e){for(;t>n;t--){let i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Cu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Pu(n,t){let e=[],i=!1;return pt(n)?(i=!0,e=n):e=p_(n,t),e.length?new on({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Tu(n){return n&&n.fill!==!1}function g_(n,t,e){let s=n[t].fill,r=[t],o;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!jt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function m_(n,t,e){let i=y_(n);if(at(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return jt(s)&&Math.floor(s)===s?b_(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function b_(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function v_(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:at(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function __(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:at(n)?i=n.value:i=t.getBaseValue(),i}function y_(n){let t=n.options,e=t.fill,i=nt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function x_(n){let{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=w_(t,e);a.push(Pu({x:null,y:t.bottom},i));for(let l=0;l=0;--o){let a=s[o].$filler;!a||(a.line.updateControlPoints(r,a.axis),i&&a.fill&&Na(n.ctx,a,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;let i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){let r=i[s].$filler;Tu(r)&&Na(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){let i=t.meta.$filler;!Tu(i)||e.drawTime!=="beforeDatasetDraw"||Na(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Au=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},R_=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index,Ha=class extends qt{constructor(t){super();this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=wt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,s=Ft(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Au(i,r),c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(o,r,a,l)+10):(h=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){let{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a,f=t;r.textAlign="left",r.textBaseline="middle";let g=-1,p=-h;return this.legendItems.forEach((m,y)=>{let S=i+e/2+r.measureText(m.text).width;(y===0||c[c.length-1]+S+2*a>o)&&(f+=h,c[c.length-(y>0?0:1)]=0,p+=h,g++),l[y]={left:0,top:p,row:g,width:S,height:s},c[c.length-1]+=S+a}),f}_fitCols(t,e,i,s){let{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=o-t,f=a,g=0,p=0,m=0,y=0;return this.legendItems.forEach((S,M)=>{let C=i+e/2+r.measureText(S.text).width;M>0&&p+s+2*a>h&&(f+=g+a,c.push({width:g,height:p}),m+=g+a,y++,g=p=0),l[M]={left:m,top:p,col:y,width:C,height:s},g=Math.max(g,C),p+=s+a}),f+=g,c.push({width:g,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Sn(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=ie(i,this.left+s,this.right-this.lineWidths[a]);for(let c of e)a!==c.row&&(a=c.row,l=ie(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=ie(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of e)c.col!==a&&(a=c.col,l=ie(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;xn(t,this),this._draw(),wn(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=ft.color,l=Sn(t.rtl,this.left,this.width),c=Ft(o.font),{color:h,padding:f}=o,g=c.size,p=g/2,m;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:y,boxHeight:S,itemHeight:M}=Au(o,g),C=function(N,G,U){if(isNaN(y)||y<=0||isNaN(S)||S<0)return;s.save();let it=nt(U.lineWidth,1);if(s.fillStyle=nt(U.fillStyle,a),s.lineCap=nt(U.lineCap,"butt"),s.lineDashOffset=nt(U.lineDashOffset,0),s.lineJoin=nt(U.lineJoin,"miter"),s.lineWidth=it,s.strokeStyle=nt(U.strokeStyle,a),s.setLineDash(nt(U.lineDash,[])),o.usePointStyle){let lt={radius:S*Math.SQRT2/2,pointStyle:U.pointStyle,rotation:U.rotation,borderWidth:it},rt=l.xPlus(N,y/2),Pt=G+p;pr(s,lt,rt,Pt,o.pointStyleWidth&&y)}else{let lt=G+Math.max((g-S)/2,0),rt=l.leftForLtr(N,y),Pt=Le(U.borderRadius);s.beginPath(),Object.values(Pt).some(zt=>zt!==0)?en(s,{x:rt,y:lt,w:y,h:S,radius:Pt}):s.rect(rt,lt,y,S),s.fill(),it!==0&&s.stroke()}s.restore()},F=function(N,G,U){tn(s,U.text,N,G+M/2,c,{strikethrough:U.hidden,textAlign:l.textAlign(U.textAlign)})},D=this.isHorizontal(),I=this._computeTitleHeight();D?m={x:ie(r,this.left+f,this.right-i[0]),y:this.top+f+I,line:0}:m={x:this.left+f,y:ie(r,this.top+I+f,this.bottom-e[0].height),line:0},Sr(this.ctx,t.textDirection);let $=M+f;this.legendItems.forEach((N,G)=>{s.strokeStyle=N.fontColor||h,s.fillStyle=N.fontColor||h;let U=s.measureText(N.text).width,it=l.textAlign(N.textAlign||(N.textAlign=o.textAlign)),lt=y+p+U,rt=m.x,Pt=m.y;l.setWidth(this.width),D?G>0&&rt+lt+f>this.right&&(Pt=m.y+=$,m.line++,rt=m.x=ie(r,this.left+f,this.right-i[m.line])):G>0&&Pt+$>this.bottom&&(rt=m.x=rt+e[m.line].width+f,m.line++,Pt=m.y=ie(r,this.top+I+f,this.bottom-e[m.line].height));let zt=l.x(rt);C(zt,Pt,N),rt=ia(it,rt+y+p,D?rt+lt:this.right,t.rtl),F(l.x(rt),Pt,N),D?m.x+=lt+f:m.y+=$}),Mr(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,i=Ft(e.font),s=Vt(e.padding);if(!e.display)return;let r=Sn(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=s.top+l,h,f=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),h=this.top+c,f=ie(t.align,f,this.right-g);else{let m=this.columnSizes.reduce((y,S)=>Math.max(y,S.height),0);h=c+ie(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}let p=ie(a,f,f+g);o.textAlign=r.textAlign(Gi(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,tn(o,e.text,p,h,i)}_computeTitleHeight(){let t=this.options.title,e=Ft(t.font),i=Vt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Ae(t,this.left,this.right)&&Ae(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;in.chart.options.color,boxWidth:40,padding:10,generateLabels(n){let t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r}}=n.legend.options;return n._getSortedDatasetMetas().map(o=>{let a=o.controller.getStyle(e?0:void 0),l=Vt(a.borderWidth);return{text:t[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:s||a.textAlign,borderRadius:0,datasetIndex:o.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}},$r=class extends qt{constructor(t){super();this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;let s=pt(i.text)?i.text.length:1;this._padding=Vt(i.padding);let r=s*Ft(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:i,bottom:s,right:r,options:o}=this,a=o.align,l=0,c,h,f;return this.isHorizontal()?(h=ie(a,i,r),f=e+t,c=r-i):(o.position==="left"?(h=i+t,f=ie(a,s,e),l=gt*-.5):(h=r-t,f=ie(a,e,s),l=gt*.5),c=s-e),{titleX:h,titleY:f,maxWidth:c,rotation:l}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let i=Ft(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);tn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Gi(e.align),textBaseline:"middle",translation:[o,a]})}};function I_(n,t){let e=new $r({ctx:n.ctx,options:t,chart:n});he.configure(n,e,t),he.addBox(n,e),n.titleBlock=e}var $_={id:"title",_element:$r,start(n,t,e){I_(n,e)},stop(n){let t=n.titleBlock;he.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){let i=n.titleBlock;he.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},jr=new WeakMap,j_={id:"subtitle",start(n,t,e){let i=new $r({ctx:n.ctx,options:e,chart:n});he.configure(n,i,e),he.addBox(n,i),jr.set(n,i)},stop(n){he.removeBox(n,jr.get(n)),jr.delete(n)},beforeUpdate(n,t,e){let i=jr.get(n);he.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},ws={average(n){if(!n.length)return!1;let t,e,i=0,s=0,r=0;for(t=0,e=n.length;t-1?n.split(` +`):n}function z_(n,t){let{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Ru(n,t){let e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=Ft(t.bodyFont),c=Ft(t.titleFont),h=Ft(t.footerFont),f=r.length,g=s.length,p=i.length,m=Vt(t.padding),y=m.height,S=0,M=i.reduce((D,I)=>D+I.before.length+I.lines.length+I.after.length,0);if(M+=n.beforeBody.length+n.afterBody.length,f&&(y+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),M){let D=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=p*D+(M-p)*l.lineHeight+(M-1)*t.bodySpacing}g&&(y+=t.footerMarginTop+g*h.lineHeight+(g-1)*t.footerSpacing);let C=0,F=function(D){S=Math.max(S,e.measureText(D).width+C)};return e.save(),e.font=c.string,Ct(n.title,F),e.font=l.string,Ct(n.beforeBody.concat(n.afterBody),F),C=t.displayColors?o+2+t.boxPadding:0,Ct(i,D=>{Ct(D.before,F),Ct(D.lines,F),Ct(D.after,F)}),C=0,e.font=h.string,Ct(n.footer,F),e.restore(),S+=m.width,{width:S,height:y}}function B_(n,t){let{y:e,height:i}=t;return en.height-i/2?"bottom":"center"}function N_(n,t,e,i){let{x:s,width:r}=i,o=e.caretSize+e.caretPadding;if(n==="left"&&s+r+o>t.width||n==="right"&&s-r-o<0)return!0}function H_(n,t,e,i){let{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=n,c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),N_(c,n,t,e)&&(c="center"),c}function Lu(n,t,e){let i=e.yAlign||t.yAlign||B_(n,e);return{xAlign:e.xAlign||t.xAlign||H_(n,t,e,i),yAlign:i}}function W_(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function V_(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Fu(n,t,e,i){let{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:h,topRight:f,bottomLeft:g,bottomRight:p}=Le(o),m=W_(t,a),y=V_(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(h,g)+s:a==="right"&&(m+=Math.max(f,p)+s),{x:Zt(m,0,i.width-t.width),y:Zt(y,0,i.height-t.height)}}function zr(n,t,e){let i=Vt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Iu(n){return We([],an(n))}function Y_(n,t,e){return Ne(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function $u(n,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}var Br=class extends qt{constructor(t){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=t.chart||t._chart,this._chart=this.chart,this.options=t.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(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new is(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Y_(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),r=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]),a=[];return a=We(a,an(s)),a=We(a,an(r)),a=We(a,an(o)),a}getBeforeBody(t,e){return Iu(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){let{callbacks:i}=e,s=[];return Ct(t,r=>{let o={before:[],lines:[],after:[]},a=$u(i,r);We(o.before,an(a.beforeLabel.call(this,r))),We(o.lines,a.label.call(this,r)),We(o.after,an(a.afterLabel.call(this,r))),s.push(o)}),s}getAfterBody(t,e){return Iu(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){let{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),r=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]),a=[];return a=We(a,an(s)),a=We(a,an(r)),a=We(a,an(o)),a}_createItems(t){let e=this._active,i=this.chart.data,s=[],r=[],o=[],a=[],l,c;for(l=0,c=e.length;lt.filter(h,f,g,i))),t.itemSort&&(a=a.sort((h,f)=>t.itemSort(h,f,i))),Ct(a,h=>{let f=$u(t.callbacks,h);s.push(f.labelColor.call(this,h)),r.push(f.labelPointStyle.call(this,h)),o.push(f.labelTextColor.call(this,h))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){let i=this.options.setContext(this.getContext()),s=this._active,r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{let a=ws[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);let l=this._size=Ru(this,i),c=Object.assign({},a,l),h=Lu(this.chart,i,c),f=Fu(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,r={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){let r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){let{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:f}=Le(a),{x:g,y:p}=t,{width:m,height:y}=e,S,M,C,F,D,I;return r==="center"?(D=p+y/2,s==="left"?(S=g,M=S-o,F=D+o,I=D-o):(S=g+m,M=S+o,F=D-o,I=D+o),C=S):(s==="left"?M=g+Math.max(l,h)+o:s==="right"?M=g+m-Math.max(c,f)-o:M=this.caretX,r==="top"?(F=p,D=F-o,S=M-o,C=M+o):(F=p+y,D=F+o,S=M+o,C=M-o),I=F),{x1:S,x2:M,x3:C,y1:F,y2:D,y3:I}}drawTitle(t,e,i){let s=this.title,r=s.length,o,a,l;if(r){let c=Sn(i.rtl,this.x,this.width);for(t.x=zr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=Ft(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;lF!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,en(t,{x:S,y,w:c,h:l,radius:C}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),en(t,{x:M,y:y+1,w:c-2,h:l-2,radius:C}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(S,y,c,l),t.strokeRect(S,y,c,l),t.fillStyle=o.backgroundColor,t.fillRect(M,y+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,f=Ft(i.bodyFont),g=f.lineHeight,p=0,m=Sn(i.rtl,this.x,this.width),y=function(G){e.fillText(G,m.x(t.x+p),t.y+g/2),t.y+=g+r},S=m.textAlign(o),M,C,F,D,I,$,N;for(e.textAlign=o,e.textBaseline="middle",e.font=f.string,t.x=zr(this,S,i),e.fillStyle=i.bodyColor,Ct(this.beforeBody,y),p=a&&S!=="right"?o==="center"?c/2+h:c+2+h:0,D=0,$=s.length;D<$;++D){for(M=s[D],C=this.labelTextColors[D],e.fillStyle=C,Ct(M.before,y),F=M.lines,a&&F.length&&(this._drawColorBox(e,t,D,m,i),g=Math.max(f.lineHeight,l)),I=0,N=F.length;I0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){let o=ws[t.position].call(this,this._active,this._eventPosition);if(!o)return;let a=this._size=Ru(this,t),l=Object.assign({},o,this._size),c=Lu(e,t,l),h=Fu(t,l,c,e);(s._to!==h.x||r._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let o=Vt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),Sr(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Mr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,s=t.map(({datasetIndex:a,index:l})=>{let c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!yi(i,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!yi(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){let r=this.options;if(t.type==="mouseout")return[];if(!s)return e;let o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){let{caretX:i,caretY:s,options:r}=this,o=ws[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}};Br.positioners=ws;var X_={id:"tooltip",_element:Br,positioners:ws,afterInit(n,t,e){e&&(n.tooltip=new Br({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){let t=n.tooltip;if(t&&t._willRender()){let e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",e)===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){let e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.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,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.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:Ee,title(n){if(n.length>0){let t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndexn!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},q_=Object.freeze({__proto__:null,Decimation:f_,Filler:A_,Legend:F_,SubTitle:j_,Title:$_,Tooltip:X_}),G_=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function U_(n,t,e,i){let s=n.indexOf(t);if(s===-1)return G_(n,t,e,i);let r=n.lastIndexOf(t);return s!==r?e:s}var K_=(n,t)=>n===null?null:Zt(Math.round(n),0,t),ks=class extends Mn{constructor(t){super(t);this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let i=this.getLabels();for(let{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(ut(t))return null;let i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:U_(i,t,nt(e,t),this._addedLabels),K_(e,i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let t=this.min,e=this.max,i=this.options.offset,s=[],r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){let e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};ks.id="category";ks.defaults={ticks:{callback:ks.prototype.getLabelForValue}};function Z_(n,t){let e=[],i=1e-14,{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:h,maxDigits:f,includeBounds:g}=n,p=r||1,m=h-1,{min:y,max:S}=t,M=!ut(o),C=!ut(a),F=!ut(c),D=(S-y)/(f+1),I=Js((S-y)/m/p)*p,$,N,G,U;if(Im&&(I=Js(U*I/m/p)*p),ut(l)||($=Math.pow(10,l),I=Math.ceil(I*$)/$),s==="ticks"?(N=Math.floor(y/I)*I,G=Math.ceil(S/I)*I):(N=y,G=S),M&&C&&r&&Zo((a-o)/r,I/1e3)?(U=Math.round(Math.min((a-o)/I,h)),I=(a-o)/U,N=o,G=a):F?(N=M?o:N,G=C?a:G,U=c-1,I=(G-N)/U):(U=(G-N)/I,Vn(U,Math.round(U),I/1e3)?U=Math.round(U):U=Math.ceil(U));let it=Math.max(tr(I),tr(N));$=Math.pow(10,ut(l)?it:l),N=Math.round(N*$)/$,G=Math.round(G*$)/$;let lt=0;for(M&&(g&&N!==o?(e.push({value:o}),Ns=e?s:l,a=l=>r=i?r:l;if(t){let l=Me(s),c=Me(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:e,stepSize:i}=t,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(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=Z_(s,r);return t.bounds==="ticks"&&Qs(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Jn(t,this.chart.options.locale,this.options.ticks.format)}},Nr=class extends Ss{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=jt(t)?t:0,this.max=jt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=Wt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};Nr.id="linear";Nr.defaults={ticks:{callback:Dr.formatters.numeric}};function zu(n){return n/Math.pow(10,Math.floor(be(n)))===1}function J_(n,t){let e=Math.floor(be(t.max)),i=Math.ceil(t.max/Math.pow(10,e)),s=[],r=me(n.min,Math.pow(10,Math.floor(be(t.min)))),o=Math.floor(be(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:r,major:zu(r)}),++a,a===10&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l;while(o0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=jt(t)?Math.max(0,t):null,this.max=jt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,s=this.max,r=l=>i=t?i:l,o=l=>s=e?s:l,a=(l,c)=>Math.pow(10,Math.floor(be(l))+c);i===s&&(i<=0?(r(1),o(10)):(r(a(i,-1)),o(a(s,1)))),i<=0&&r(a(s,-1)),s<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=s}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=J_(e,this);return t.bounds==="ticks"&&Qs(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Jn(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=be(t),this._valueRange=be(this.max)-be(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(be(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};Hr.id="logarithmic";Hr.defaults={ticks:{callback:Dr.formatters.logarithmic,major:{enabled:!0}}};function Wa(n){let t=n.ticks;if(t.display&&n.display){let e=Vt(t.backdropPadding);return nt(t.font&&t.font.size,ft.font.size)+e.height}return 0}function Q_(n,t,e){return e=pt(e)?e:[e],{w:ua(n,t.string,e),h:e.length*t.lineHeight}}function Bu(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:ns?{start:t-e,end:t}:{start:t,end:t+e}}function ty(n){let t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?gt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,n.b=Math.max(n.b,t.b+l))}function ny(n,t,e){let i=[],s=n._pointLabels.length,r=n.options,o=Wa(r)/2,a=n.drawingArea,l=r.pointLabels.centerPointLabels?gt/s:0;for(let c=0;c270||e<90)&&(n-=t),n}function oy(n,t){let{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){let r=i.setContext(n.getPointLabelContext(s)),o=Ft(r.font),{x:a,y:l,textAlign:c,left:h,top:f,right:g,bottom:p}=n._pointLabelItems[s],{backdropColor:m}=r;if(!ut(m)){let y=Le(r.borderRadius),S=Vt(r.backdropPadding);e.fillStyle=m;let M=h-S.left,C=f-S.top,F=g-h+S.width,D=p-f+S.height;Object.values(y).some(I=>I!==0)?(e.beginPath(),en(e,{x:M,y:C,w:F,h:D,radius:y}),e.fill()):e.fillRect(M,C,F,D)}tn(e,n._pointLabels[s],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function Nu(n,t,e,i){let{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,kt);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{let s=wt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?ty(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){let e=kt/(this._pointLabels.length||1),i=this.options.startAngle||0;return fe(t*e+Wt(i))}getDistanceFromCenterForValue(t){if(ut(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(ut(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);let f=s.setContext(this.getContext(h-1));ay(this,f,a,r)}}),i.display){for(t.save(),o=r-1;o>=0;o--){let c=i.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:f}=c;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;let s=this.getIndexAngle(0),r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;let c=i.setContext(this.getContext(l)),h=Ft(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let f=Vt(c.backdropPadding);t.fillRect(-o/2-f.left,-r-h.size/2-f.top,o+f.width,h.size+f.height)}tn(t,a.label,0,-r,h,{color:c.color})}),t.restore()}drawTitle(){}};Ci.id="radialLinear";Ci.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Dr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Ci.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Ci.descriptors={angleLines:{_fallback:"grid"}};var Wr={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}},_e=Object.keys(Wr);function cy(n,t){return n-t}function Hu(n,t){if(ut(t))return null;let e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts,o=t;return typeof i=="function"&&(o=i(o)),jt(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(Oe(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function Wu(n,t,e,i){let s=_e.length;for(let r=_e.indexOf(n);r=_e.indexOf(e);r--){let o=_e[r];if(Wr[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return _e[e?_e.indexOf(e):0]}function uy(n){for(let t=_e.indexOf(n)+1,e=_e.length;t=t?e[i]:e[s];n[r]=!0}}function fy(n,t,e,i){let s=n._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value,a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function Yu(n,t,e){let i=[],s={},r=t.length,o,a;for(o=0;o+t.value))}initOffsets(t){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);let o=t.length<3?.5:.25;e=Zt(e,0,o),i=Zt(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){let t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||Wu(r.minUnit,e,i,this._getLabelCapacity(e)),a=nt(r.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Oe(l)||l===!0,h={},f=e,g,p;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);let m=s.ticks.source==="data"&&this.getDataTimestamps();for(g=f,p=0;gy-S).map(y=>+y)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){let r=this.options,o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],h=l&&o[l],f=i[e],g=l&&h&&f&&f.major,p=this._adapter.format(t,s||(g?h:c)),m=r.ticks.callback;return m?wt(m,[p,e,i],this):p}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Re(n,"pos",t)),{pos:r,time:a}=n[i],{pos:o,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Re(n,"time",t)),{time:r,pos:a}=n[i],{time:o,pos:l}=n[s]);let c=o-r;return c?a+(l-a)*(t-r)/c:a}var Yr=class extends Pi{constructor(t){super(t);this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Vr(e,this.min),this._tableRange=Vr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:e,max:i}=this,s=[],r=[],o,a,l,c,h;for(o=0,a=t.length;o=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;on!==void 0;function gy(n,t){let e=new Set(t.map(o=>o.to)),i=new Set(t.map(o=>o.from)),s=new Set([...n.keys()]),r=0;for(;s.size;){let o=my([...s],e);for(let a of o){let l=n.get(a);Tn(l.x)||(l.x=r),s.delete(a)}s.size&&(e.clear(),t.filter(a=>s.has(a.from)).forEach(a=>e.add(a.to)),r++)}return[...n.keys()].filter(o=>!i.has(o)).forEach(o=>{let a=n.get(o);a.column||(a.x=r)}),r}function my(n,t){let e=n.filter(i=>!t.has(i));return e.length?e:n.slice(0,1)}var by=(n,t)=>n.x!==t.x?n.x-t.x:n.y-t.y,Xr=-1;function vy(){return Xr=Xr<100?Xr+1:0,Xr}function Ya(n,t,e=vy()){let i=0;for(let s of n)s.node._visited!==e&&(s.node._visited=e,i+=s.node[t].length+Ya(s.node[t],t,e));return i}var qu=n=>(t,e)=>Ya(t.node[n],n)-Ya(e.node[n],n)||t.node[n].length-e.node[n].length;function Xa(n,t){n.from.sort(qu("from"));for(let e of n.from){let i=e.node;Tn(i.y)||(i.y=t,Xa(i,t)),t=Math.max(i.y+i.out,t)}return t}function ei(n,t){n.to.sort(qu("to"));for(let e of n.to){let i=e.node;Tn(i.y)||(i.y=t,ei(i,t)),t=Math.max(i.y+i.in,t)}return t}function Ms(n,t){return Tn(n.y)?n.y:(n.y=t,t)}function _y(n,t){let e=n.filter(h=>h.x===0),i=n.filter(h=>h.x===t),s=e.filter(h=>!Tn(h.y)),r=i.filter(h=>!Tn(h.y)),o=n.filter(h=>h.x>0&&h.xMath.max(h,f.y+f.out||0),0),l=i.reduce((h,f)=>Math.max(h,f.y+f.in||0),0),c=0;return a>=l?(s.forEach(h=>{a=Ms(h,a),a=Math.max(a+h.out,ei(h,a))}),r.forEach(h=>{l=Ms(h,l),l=Math.max(l+h.in,ei(h,l))})):(r.forEach(h=>{l=Ms(h,l),l=Math.max(l+h.in,ei(h,l))}),s.forEach(h=>{a=Ms(h,a),a=Math.max(a+h.out,ei(h,a))})),o.forEach(h=>{let f=n.filter(g=>g.x===h.x&&Tn(g.y)).reduce((g,p)=>Math.max(g,p.y+Math.max(p.in,p.out)),0);f=Ms(h,f),f=Math.max(f+h.in,Xa(h,f)),f=Math.max(f+h.out,ei(h,f)),c=Math.max(c,f)}),Math.max(a,l,c)}function yy(n,t){n.sort((o,a)=>Math.max(a.in,a.out)-Math.max(o.in,o.out));let e=n[0];e.y=0;let i=Xa(e,0),s=ei(e,0),r=_y(n,t);return Math.max(i,s,r)}function xy(n,t){let e=0,i=0;for(let s=0;s<=t;s++){let r=i,o=n.filter(a=>a.x===s).sort((a,l)=>a.priority-l.priority);i=o[0].to.filter(a=>a.node.x>s+1).reduce((a,l)=>a+l.flow,0)||0;for(let a of o)a.y=r,r+=Math.max(a.out,a.in);e=Math.max(r,e)}return e}function wy(n,t){let e=1,i=0,s=0,r=0,o=[];n.sort(by);for(let a of n){if(a.y){if(a.x===0)o.push(a.y);else{for(i!==a.x&&(i=a.x,s=0),e=s+1;ea.y);e++);s=e}a.y+=e*t,e++}r=Math.max(r,a.y+Math.max(a.in,a.out))}return r}function ky(n,t){n.forEach(e=>{let i=Math[t](e.in||e.out,e.out||e.in),s=il.node.y+l.node.out/2-(c.node.y+c.node.out/2)).forEach((l,c)=>{s?l.addY=c*(i-l.flow)/(a-1):(l.addY=o,o+=l.flow)}),o=0,a=e.to.length,e.to.sort((l,c)=>l.node.y+l.node.in/2-(c.node.y+c.node.in/2)).forEach((l,c)=>{r?l.addY=c*(i-l.flow)/(a-1):(l.addY=o,o+=l.flow)})})}function Sy(n,t,e,i){let s=[...n.values()],r=gy(n,t),a=(e?xy(s,r):yy(s,r))*.03,l=wy(s,a);return ky(s,i),{maxX:r,maxY:l}}function My(n){let t=new Map;for(let i=0;is.flow-i.flow;return[...t.values()].forEach(i=>{i.from=i.from.sort(e),i.from.forEach(s=>{s.node=t.get(s.key)}),i.to=i.to.sort(e),i.to.forEach(s=>{s.node=t.get(s.key)})}),t}function Gu(n,t,e){for(let i of n)if(i.key===t&&i.index===e)return i.addY;return 0}var Ti=class extends ve{parseObjectData(t,e,i,s){let{from:r="from",to:o="to",flow:a="flow"}=this.options.parsing,l=e.map(({[r]:C,[o]:F,[a]:D})=>({from:C,to:F,flow:D})),{xScale:c,yScale:h}=t,f=[],g=this._nodes=My(l),{column:p,priority:m,size:y}=this.getDataset();if(m)for(let C of g.values())C.key in m&&(C.priority=m[C.key]);if(p)for(let C of g.values())C.key in p&&(C.column=!0,C.x=p[C.key]);let{maxX:S,maxY:M}=Sy(g,l,!!m,Va(y));this._maxX=S,this._maxY=M;for(let C=0,F=l.length;C1){let g=c-h*l/2+f;for(let p=0;pn.type==="data"?(n.parsed._custom.x-n.parsed.x)*200:void 0,delay:n=>n.type==="data"?n.parsed.x*500+n.dataIndex*20:void 0},colors:{type:"color",properties:["colorFrom","colorTo"]}},transitions:{hide:{animations:{colors:{type:"color",properties:["colorFrom","colorTo"],to:"transparent"}}},show:{animations:{colors:{type:"color",properties:["colorFrom","colorTo"],from:"transparent"}}}}};Ti.overrides={interaction:{mode:"nearest",intersect:!0},datasets:{clip:!1,parsing:!0},plugins:{tooltip:{callbacks:{title(){return""},label(n){let t=n.dataset.data[n.dataIndex];return t.from+" -> "+t.to+": "+t.flow}}},legend:{display:!1}},scales:{x:{type:"linear",bounds:"data",display:!1,min:0,offset:!1},y:{type:"linear",bounds:"data",display:!1,min:0,reverse:!0,offset:!1}},layout:{padding:{top:3,left:3,right:13,bottom:3}}};var Uu=(n,t,e,i)=>n({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)});function Cy(n,{x:t,x2:e,options:i}){let s;i.colorMode==="from"?s=Je(i.colorFrom).alpha(.5).rgbString():i.colorMode==="to"?s=Je(i.colorTo).alpha(.5).rgbString():(s=n.createLinearGradient(t,0,e,0),s.addColorStop(0,Je(i.colorFrom).alpha(.5).rgbString()),s.addColorStop(1,Je(i.colorTo).alpha(.5).rgbString())),n.fillStyle=s,n.strokeStyle=s,n.lineWidth=.5}var Cs=class extends qt{constructor(t){super();this.options=void 0,this.x=void 0,this.y=void 0,this.x2=void 0,this.y2=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(t){let e=this,{x:i,x2:s,y:r,y2:o,height:a,progress:l}=e,{cp1:c,cp2:h}=Uu(i,r,s,o);l!==0&&(t.save(),l<1&&(t.beginPath(),t.rect(i,Math.min(r,o),(s-i)*l+1,Math.abs(o-r)+a+1),t.clip()),Cy(t,e),t.beginPath(),t.moveTo(i,r),t.bezierCurveTo(c.x,c.y,h.x,h.y,s,o),t.lineTo(s,o+a),t.bezierCurveTo(h.x,h.y+a,c.x,c.y+a,i,r+a),t.lineTo(i,r),t.stroke(),t.closePath(),t.fill(),t.restore())}inRange(t,e,i){let{x:s,y:r,x2:o,y2:a,height:l}=this.getProps(["x","y","x2","y2","height"],i);if(to)return!1;let{cp1:c,cp2:h}=Uu(s,r,o,a),f=(t-s)/(o-s),g={x:s,y:r},p={x:o,y:a},m=Di(g,c,f),y=Di(c,h,f),S=Di(h,p,f),M=Di(m,y,f),C=Di(y,S,f),F=Di(M,C,f).y;return e>=F&&e<=F+l}inXRange(t,e){let{x:i,x2:s}=this.getProps(["x","x2"],e);return t>=i&&t<=s}inYRange(t,e){let{y:i,y2:s,height:r}=this.getProps(["y","y2","height"],e),o=Math.min(i,s),a=Math.max(i,s)+r;return t>=o&&t<=a}getCenterPoint(t){let{x:e,y:i,x2:s,y2:r,height:o}=this.getProps(["x","y","x2","y2","height"],t);return{x:(e+s)/2,y:(i+r+o)/2}}tooltipPosition(t){return this.getCenterPoint(t)}getRange(t){return t==="x"?this.width/2:this.height/2}};Cs.id="flow";Cs.defaults={colorFrom:"red",colorTo:"green",colorMode:"gradient",hoverColorFrom:(n,t)=>Gn(t.colorFrom),hoverColorTo:(n,t)=>Gn(t.colorTo)};var Fe=ze(require("obsidian"));var Py={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};Pa._date.override(typeof Fe.moment=="function"?{_id:"moment",formats:function(){return Py},parse:function(n,t){return typeof n=="string"&&typeof t=="string"?n=(0,Fe.moment)(n,t):n instanceof Fe.moment||(n=(0,Fe.moment)(n)),n.isValid()?n.valueOf():null},format:function(n,t){return(0,Fe.moment)(n).format(t)},add:function(n,t,e){return(0,Fe.moment)(n).add(t,e).valueOf()},diff:function(n,t,e){return(0,Fe.moment)(n).diff((0,Fe.moment)(t),e)},startOf:function(n,t,e){return n=(0,Fe.moment)(n),t==="isoWeek"?(e=Math.trunc(Math.min(Math.max(0,e),6)),n.isoWeekday(e).startOf("day").valueOf()):n.startOf(t).valueOf()},endOf:function(n,t){return(0,Fe.moment)(n).endOf(t).valueOf()}}:{});var Qr=ze(require("obsidian"));var Zu=ze(Ku());function ln(n,t=.25){if(typeof t!="number")throw"Provided alpha value is not a number";return n.map(e=>(0,Zu.default)(e.trim()).alpha(t).hex())}function cn(n,t){var i,s;let e=t.createDiv({cls:"chart-error"});e.createEl("b",{text:"Couldn't render Chart:"}),e.createEl("pre").createEl("code",{text:(s=(i=n.toString)==null?void 0:i.call(n))!=null?s:n}),e.createEl("hr"),e.createEl("span").innerHTML="You might also want to look for further Errors in the Console: Press CTRL + SHIFT + I to open it."}function Ty(n){for(var t=window.atob(n),e=t.length,i=new Uint8Array(e),s=0;s` - title: ${r.dataTitle} + data: [${r.data}]`).join(` +`)} +width: 80% +beginAtZero: true +\`\`\``;n.replaceSelection(s)}function Za(n,t,e){let i;try{i=sf.Extractor.extractObject(n,t,!1)}catch(o){throw new nf.Notice("Table malformed"),o}let s=Object.keys(Object.values(i)[0]),r=Object.keys(i).map(o=>({dataTitle:o,data:Object.values(i[o])}));return e&&(r=r.filter(o=>e.contains(o.dataTitle))),{labels:s,dataFields:r}}var rf={modes:{point(n,t){return Gr(n,t,{intersect:!0})},nearest(n,t,e){return Ry(n,t,e)},x(n,t,e){return Gr(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return Gr(n,t,{intersect:e.intersect,axis:"y"})}}};function Ja(n,t,e){return(rf.modes[e.mode]||rf.modes.nearest)(n,t,e)}function Oy(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function Ay(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function Gr(n,t,e){return n.visibleElements.filter(i=>e.intersect?i.inRange(t.x,t.y):Oy(i,t,e.axis))}function Ry(n,t,e){let i=Number.POSITIVE_INFINITY;return Gr(n,t,e).reduce((s,r)=>{let o=r.getCenterPoint(),a=Ay(t,o,e.axis),l=Ke(t,a);return ls._index-r._index).slice(0,1)}var Ly=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,ni=.001,Ur=(n,t,e)=>Math.min(e,Math.max(t,n));function Fy(n,t,e){for(let i of Object.keys(n))n[i]=Ur(n[i],t,e);return n}function Iy(n,t,e,i){if(!n||!t||e<=0)return!1;let s=i/2;return Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+s,2)}function of(n,{x:t,y:e,x2:i,y2:s},r,o){let a=o/2,l=n.x>=t-a-ni&&n.x<=i+a+ni,c=n.y>=e-a-ni&&n.y<=s+a+ni;return r==="x"?l:(r==="y"||l)&&c}function Oi(n,t){let{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function $y(n,t,e,i=!0){let s=e.split("."),r=0;for(let o of t.split(".")){let a=s[r++];if(parseInt(o,10)typeof n=="string"&&n.endsWith("%"),lf=n=>parseFloat(n)/100,cf=n=>Ur(lf(n),0,1);function Qa(n,t){return t==="start"?0:t==="end"?n:af(t)?cf(t)*n:n/2}function Dn(n,t,e=!0){return typeof t=="number"?t:af(t)?(e?cf(t):lf(t))*n:n}function jy(n,t){let{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function tl(n,t="center"){return at(n)?{x:nt(n.x,t),y:nt(n.y,t)}:(n=nt(n,t),{x:n,y:n})}function hf(n){return n&&(Nt(n.xValue)||Nt(n.yValue))}function Ps(n,t,e,i=!1){let s=e.init;if(s){if(s===!0)return ff(t,i)}else return;return zy(t,i,wt(s,[{chart:n,properties:t,options:e}]))}function uf(n,t,e){let i=!1;return t.forEach(s=>{le(n[s])?(i=!0,e[s]=n[s]):Nt(e[s])&&delete e[s]}),i}function ff({centerX:n,centerY:t},e){return e?{centerX:n,centerY:t,radius:0,width:0,height:0}:{x:n,y:t,x2:n,y2:t,width:0,height:0}}function zy(n,t,e){if(e===!0)return ff(n,t);if(at(e))return e}var el=new Map,By=n=>isNaN(n)||n<=0,Ny=n=>n.reduce(function(t,e){return t+=e.string,t},"");function Kr(n){if(n&&typeof n=="object"){let t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function nl(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Wt(i)),n.translate(-t,-e))}function En(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle,n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle,n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Ai(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function il(n,t){let e=t.content;if(Kr(e))return{width:Dn(e.width,t.width),height:Dn(e.height,t.height)};let i=t.font,s=pt(i)?i.map(l=>Ft(l)):[Ft(i)],r=t.textStrokeWidth,o=pt(e)?e:[e],a=o.join()+Ny(s)+r+(n._measureText?"-spriting":"");return el.has(a)||el.set(a,Xy(n,o,s,r)),el.get(a)}function df(n,t,e){let{x:i,y:s,width:r,height:o}=t;n.save(),Ai(n,e);let a=En(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),en(n,{x:i,y:s,w:r,h:o,radius:Fy(Le(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function Hy(n,t,e){let i=e.content;if(Kr(i)){n.save(),n.globalAlpha=Uy(e.opacity,i.style.opacity),n.drawImage(i,t.x,t.y,t.width,t.height),n.restore();return}let s=pt(i)?i:[i],r=e.font,o=pt(r)?r.map(f=>Ft(f)):[Ft(r)],a=e.color,l=pt(a)?a:[a],c=jy(t,e),h=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,Wy(n,e)&&qy(n,{x:c,y:h},s,o),Gy(n,{x:c,y:h},s,{fonts:o,colors:l}),n.restore()}function Wy(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function Vy(n,t,e,i){let{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation,l=(a||0)*Xi;if(Kr(o)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(o,-o.width/2,-o.height/2,o.width,o.height),n.restore();return}By(s)||Yy(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function Yy(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:o}){let a,l,c,h;switch(n.beginPath(),r){default:n.arc(t,e,i,0,kt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=xi,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=xi,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),n.closePath();break;case"rectRounded":h=i*.516,c=i-h,a=Math.cos(o+Se)*c,l=Math.sin(o+Se)*c,n.arc(t-a,e-l,h,o-gt,o-Rt),n.arc(t+l,e-a,h,o-Rt,o),n.arc(t+a,e+l,h,o,o+Rt),n.arc(t-l,e+a,h,o+Rt,o+gt),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=Se;case"rectRot":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+l,e-a),n.lineTo(t+a,e+l),n.lineTo(t-l,e+a),n.closePath();break;case"crossRot":o+=Se;case"cross":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"star":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a),o+=Se,a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"line":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(o)*i,e+Math.sin(o)*i);break}n.fill()}function Xy(n,t,e,i){n.save();let s=t.length,r=0,o=i;for(let a=0;ao.axis&&o.axis===s);return r.length?r[0].id:s}function gf(n,t){if(n){let e=n.options.reverse,i=Ri(n,t.min,e?t.end:t.start),s=Ri(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function mf(n,t){let{chartArea:e,scales:i}=n,s=i[ii(i,t,"xScaleID")],r=i[ii(i,t,"yScaleID")],o=e.width/2,a=e.height/2;return s&&(o=Ri(s,t.xValue,s.left+s.width/2)),r&&(a=Ri(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function sl(n,t){let e=n.scales,i=e[ii(e,t,"xScaleID")],s=e[ii(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea,c=_f(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;let h=_f(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=h.start,l=h.end,{x:r,y:a,x2:o,y2:l,width:o-r,height:l-a,centerX:r+(o-r)/2,centerY:a+(l-a)/2}}function bf(n,t){if(!hf(t)){let e=sl(n,t),i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);let s=i*2,r=e.centerX+t.xAdjust,o=e.centerY+t.yAdjust;return{x:r-i,y:o-i,x2:r+i,y2:o+i,centerX:r,centerY:o,width:s,height:s,radius:i}}return Zy(n,t)}function Ky(n,t){let{scales:e,chartArea:i}=n,s=e[t.scaleID],r={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?Jy(s,r,t):Qy(e,r,t),r}function vf(n,t,e){let i=sl(n,t);return i.initProperties=Ps(n,i,t,e),i.elements=[{type:"label",optionScope:"label",properties:nx(n,i,t),initProperties:i.initProperties}],i}function Zy(n,t){let e=mf(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function _f(n,t){let e=gf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function Jy(n,t,e){let i=Ri(n,e.value,NaN),s=Ri(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function Qy(n,t,e){for(let i of Object.keys(pf)){let s=n[ii(n,e,i)];if(s){let{min:r,max:o,start:a,end:l,startProp:c,endProp:h}=pf[i],f=gf(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=f.start,t[h]=f.end}}}function tx({properties:n,options:t},e,i,s){let{x:r,x2:o,width:a}=n;return yf({start:r,end:o,size:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function ex({properties:n,options:t},e,i,s){let{y:r,y2:o,height:a}=n;return yf({start:r,end:o,size:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function yf(n,t){let{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:o,end:a},adjust:l}=t,c=i-s-e-o-a-t.size;return e+s/2+l+Qa(c,r)}function nx(n,t,e){let i=e.label;i.backgroundColor="transparent",i.callout.display=!1;let s=tl(i.position),r=Vt(i.padding),o=il(n.ctx,i),a=tx({properties:t,options:e},o,s,r),l=ex({properties:t,options:e},o,s,r),c=o.width+r.width,h=o.height+r.height;return{x:a,y:l,x2:a+c,y2:l+h,width:c,height:h,centerX:a+c/2,centerY:l+h/2,rotation:i.rotation}}function si(n,t,e){let i=Math.cos(e),s=Math.sin(e),r=t.x,o=t.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}var rl=["enter","leave"],ol=rl.concat("click");function ix(n,t,e){t.listened=uf(e,ol,t.listeners),t.moveListened=!1,t._getElements=Ja,rl.forEach(i=>{le(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&le(i.click)&&(t.listened=!0),t.moveListened||rl.forEach(s=>{le(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function sx(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return rx(n,t,e);case"click":return ox(n,t,e)}}function rx(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Ja(n,t,e.interaction):i=[];let s=n.hovered;n.hovered=i;let r={state:n,event:t},o=xf(r,"leave",s,i);return xf(r,"enter",i,s)||o}function xf({state:n,event:t},e,i,s){let r;for(let o of i)s.indexOf(o)<0&&(r=wf(o.options[e]||n.listeners[e],o,t)||r);return r}function ox(n,t,e){let i=n.listeners,s=Ja(n,t,e.interaction),r;for(let o of s)r=wf(o.options.click||i.click,o,t)||r;return r}function wf(n,t,e){return wt(n,[t.$context,e])===!0}var Zr=["afterDraw","beforeDraw"];function ax(n,t,e){let i=t.visibleElements;t.hooked=uf(e,Zr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||Zr.forEach(r=>{le(s.options[r])&&(t.hooked=!0)})})}function kf(n,t,e){if(n.hooked){let i=t.options[e]||n.hooks[e];return wt(i,[t.$context])}}function lx(n,t,e){let i=dx(n.scales,t,e),s=Sf(t,i,"min","suggestedMin");s=Sf(t,i,"max","suggestedMax")||s,s&&le(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function cx(n,t){for(let e of n)ux(e,t)}function Sf(n,t,e,i){if(jt(t[e])&&!hx(n.options,e,i)){let s=n[e]!==t[e];return n[e]=t[e],s}}function hx(n,t,e){return Nt(n[t])||Nt(n[e])}function ux(n,t){for(let e of["scaleID","xScaleID","yScaleID"]){let i=ii(t,n,e);i&&!t[i]&&fx(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function fx(n,t){if(t==="scaleID")return!0;let e=t.charAt(0);for(let i of["Min","Max","Value"])if(Nt(n[e+i]))return!0;return!1}function dx(n,t,e){let i=t.axis,s=t.id,r=i+"ScaleID",o={min:nt(t.min,Number.NEGATIVE_INFINITY),max:nt(t.max,Number.POSITIVE_INFINITY)};for(let a of e)a.scaleID===s?Mf(a,t,["value","endValue"],o):ii(n,a,r)===s&&Mf(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Mf(n,t,e,i){for(let s of e){let r=n[s];if(Nt(r)){let o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}var ri=class extends qt{inRange(t,e,i,s){let{x:r,y:o}=si({x:t,y:e},this.getCenterPoint(s),Wt(-this.options.rotation));return of({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options.borderWidth)}getCenterPoint(t){return Oi(this,t)}draw(t){t.save(),nl(t,this.getCenterPoint(),this.options.rotation),df(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return vf(t,e)}};ri.id="boxAnnotation";ri.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};ri.defaultRoutes={borderColor:"color",backgroundColor:"color"};ri.descriptors={label:{_fallback:!0}};var Cf=["left","bottom","top","right"],Li=class extends qt{inRange(t,e,i,s){let{x:r,y:o}=si({x:t,y:e},this.getCenterPoint(s),Wt(-this.rotation));return of({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options.borderWidth)}getCenterPoint(t){return Oi(this,t)}draw(t){let e=this.options,i=!Nt(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),nl(t,this.getCenterPoint(),this.rotation),gx(t,this),df(t,this,e),Hy(t,wx(this),e),t.restore())}resolveElementProperties(t,e){let i;if(hf(e))i=mf(t,e);else{let{centerX:a,centerY:l}=sl(t,e);i={x:a,y:l}}let s=Vt(e.padding),r=il(t.ctx,e),o=px(i,r,e,s);return{initProperties:Ps(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}};Li.id="labelAnnotation";Li.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};Li.defaultRoutes={borderColor:"color"};function px(n,t,e,i){let s=t.width+i.width+e.borderWidth,r=t.height+i.height+e.borderWidth,o=tl(e.position,"center"),a=Pf(n.x,s,e.xAdjust,o.x),l=Pf(n.y,r,e.yAdjust,o.y);return{x:a,y:l,x2:a+s,y2:l+r,width:s,height:r,centerX:a+s/2,centerY:l+r/2}}function Pf(n,t,e=0,i){return n-Qa(t,i)+e}function gx(n,t){let{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&yx(t,r);if(!o||kx(t,r,o))return;if(n.save(),n.beginPath(),!En(n,r))return n.restore();let{separatorStart:l,separatorEnd:c}=mx(t,o),{sideStart:h,sideEnd:f}=vx(t,o,l);(r.margin>0||s.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(h.x,h.y),n.lineTo(f.x,f.y);let g=si({x:e,y:i},t.getCenterPoint(),Wt(-t.rotation));n.lineTo(g.x,g.y),n.stroke(),n.restore()}function mx(n,t){let{x:e,y:i,x2:s,y2:r}=n,o=bx(n,t),a,l;return t==="left"||t==="right"?(a={x:e+o,y:i},l={x:a.x,y:r}):(a={x:e,y:i+o},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function bx(n,t){let{width:e,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return t==="right"?e+r:t==="bottom"?i+r:-r}function vx(n,t,e){let{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=_x(t,o.callout),c,h;return t==="left"||t==="right"?(c={x:e.x,y:i+Dn(r,a)},h={x:c.x+l,y:c.y}):(c={x:e.x+Dn(s,a),y:e.y},h={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:h}}function _x(n,t){let e=t.side;return n==="left"||n==="top"?-e:e}function yx(n,t){let e=t.position;return Cf.includes(e)?e:xx(n,t)}function xx(n,t){let{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:h,centerY:f,rotation:g}=n,p={x:h,y:f},m=t.start,y=Dn(o,m),S=Dn(a,m),M=[e,e+y,e+y,s],C=[i+S,r,i,r],F=[];for(let D=0;D<4;D++){let I=si({x:M[D],y:C[D]},p,Wt(g));F.push({position:Cf[D],distance:Ke(I,{x:l,y:c})})}return F.sort((D,I)=>D.distance-I.distance)[0].position}function wx({x:n,y:t,width:e,height:i,options:s}){let r=s.borderWidth/2,o=Vt(s.padding);return{x:n+o.left+r,y:t+o.top+r,width:e-o.left-o.right-s.borderWidth,height:i-o.top-o.bottom-s.borderWidth}}function kx(n,t,e){let{pointX:i,pointY:s}=n,r=t.margin,o=i,a=s;return e==="left"?o+=r:e==="right"?o-=r:e==="top"?a+=r:e==="bottom"&&(a-=r),n.inRange(o,a)}var al=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),ll=(n,t,e)=>al(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Tf=(n,t,e)=>al(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Ts=n=>n*n,Sx=(n,t,{x:e,y:i,x2:s,y2:r},o)=>o==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},Df=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,cl=(n,t,e,i)=>({x:Df(n.x,t.x,e.x,i),y:Df(n.y,t.y,e.y,i)}),Ef=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Of=(n,t,e,i)=>-Math.atan2(Ef(n.x,t.x,e.x,i),Ef(n.y,t.y,e.y,i))+.5*gt,Fi=class extends qt{inRange(t,e,i,s){let r=this.options.borderWidth/2;if(i!=="x"&&i!=="y"){let o={mouseX:t,mouseY:e},{path:a,ctx:l}=this;if(a){En(l,this.options);let{chart:h}=this.$context,f=t*h.currentDevicePixelRatio,g=e*h.currentDevicePixelRatio,p=l.isPointInStroke(a,f,g)||hl(this,o,s);return l.restore(),p}let c=Ts(r);return Tx(this,o,c,s)||hl(this,o,s)}return Mx(this,{mouseX:t,mouseY:e},i,{hBorderWidth:r,useFinalPosition:s})}getCenterPoint(t){return Oi(this,t)}draw(t){let{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!En(t,a))return t.restore();Ai(t,a);let l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(a.curve&&o)return Ix(t,this,o,l),t.restore();let{startOpts:c,endOpts:h,startAdjust:f,endAdjust:g}=If(this),p=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(p),t.beginPath(),t.moveTo(0+f,0),t.lineTo(l-g,0),t.shadowColor=a.borderShadowColor,t.stroke(),ul(t,0,f,c),ul(t,l,-g,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){let i=Ky(t,e),{x:s,y:r,x2:o,y2:a}=i,l=Cx(i,t.chartArea),c=l?Px({x:s,y:r},{x:o,y:a},t.chartArea):{x:s,y:r,x2:o,y2:a,width:Math.abs(o-s),height:Math.abs(a-r)};if(c.centerX=(o+s)/2,c.centerY=(a+r)/2,c.initProperties=Ps(t,c,e),e.curve){let f={x:c.x,y:c.y},g={x:c.x2,y:c.y2};c.cp=Fx(c,e,Ke(f,g))}let h=Dx(t,c,e.label);return h._visible=l,c.elements=[{type:"label",optionScope:"label",properties:h,initProperties:c.initProperties}],c}};Fi.id="lineAnnotation";var Af={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};Fi.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Af),fill:!1,length:12,start:Object.assign({},Af),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},Li.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Fi.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}};Fi.defaultRoutes={borderColor:"color"};function Mx(n,{mouseX:t,mouseY:e},i,{hBorderWidth:s,useFinalPosition:r}){let o=Sx(t,e,n.getProps(["x","y","x2","y2"],r),i);return o.value>=o.start-s&&o.value<=o.end+s||hl(n,{mouseX:t,mouseY:e},r,i)}function Cx({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:o,left:a}){return!(nr&&e>r||to&&i>o)}function Rf({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return ns&&(t=Tf(s,{x:n,y:t},e),n=s),tr&&(n=ll(r,{x:n,y:t},e),t=r),{x:n,y:t}}function Px(n,t,e){let{x:i,y:s}=Rf(n,t,e),{x:r,y:o}=Rf(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function Tx(n,{mouseX:t,mouseY:e},i=ni,s){let{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,h=l-o,f=Ts(c)+Ts(h),g=f===0?-1:((t-r)*c+(e-o)*h)/f,p,m;return g<0?(p=r,m=o):g>1?(p=a,m=l):(p=r+g*c,m=o+g*h),Ts(t-p)+Ts(e-m)<=i}function hl(n,{mouseX:t,mouseY:e},i,s){let r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function Dx(n,t,e){let i=e.borderWidth,s=Vt(e.padding),r=il(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return Ox(t,e,{width:o,height:a,padding:s},n.chartArea)}function Ex(n){let{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>gt/2?r-gt:r0&&(s.w/2+r.left-i.x)/o,c=a>0&&(s.h/2+r.top-i.y)/a;return Ur(Math.max(l,c),0,.25)}function Lx(n,t){let{x:e,x2:i,y:s,y2:r}=n,o=Math.min(s,r)-t.top,a=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(a,c),y:Math.min(o,l),dx:a<=c?1:-1,dy:o<=l?1:-1}}function Ff(n,t){let{size:e,min:i,max:s,padding:r}=t,o=e/2;return e>s-i?(s+i)/2:(i>=n-r-o&&(n=i+r+o),s<=n+r+o&&(n=s-r-o),n)}function If(n){let t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:$f(n,e),endAdjust:$f(n,i)}}function $f(n,t){if(!t||!t.display)return 0;let{length:e,width:i}=t,s=n.options.borderWidth/2,r={x:e,y:i+s};return Math.abs(ll(0,r,{x:0,y:s}))}function ul(n,t,e,i){if(!i||!i.display)return;let{length:s,width:r,fill:o,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Ai(n,i),En(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),o===!0?(n.fillStyle=a||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function Fx(n,t,e){let{x:i,y:s,x2:r,y2:o,centerX:a,centerY:l}=n,c=Math.atan2(o-s,r-i),h=tl(t.controlPoint,0),f={x:a+Dn(e,h.x,!1),y:l+Dn(e,h.y,!1)};return si(f,{x:a,y:l},c)}function jf(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),ul(n,0,-s,r),n.restore())}function Ix(n,t,e,i){let{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:h,startAdjust:f,endAdjust:g}=If(t),p={x:s,y:r},m={x:o,y:a},y=Of(p,e,m,0),S=Of(p,e,m,1)-gt,M=cl(p,e,m,f/i),C=cl(p,e,m,1-g/i),F=new Path2D;n.beginPath(),F.moveTo(M.x,M.y),F.quadraticCurveTo(e.x,e.y,C.x,C.y),n.shadowColor=l.borderShadowColor,n.stroke(F),t.path=F,t.ctx=n,jf(n,M,{angle:y,adjust:f},c),jf(n,C,{angle:S,adjust:g},h)}var Ii=class extends qt{inRange(t,e,i,s){let r=this.options.rotation,o=this.options.borderWidth;if(i!=="x"&&i!=="y")return $x({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,o);let{x:a,y:l,x2:c,y2:h}=this.getProps(["x","y","x2","y2"],s),f=o/2,g=i==="y"?{start:l,end:h}:{start:a,end:c},p=si({x:t,y:e},this.getCenterPoint(s),Wt(-r));return p[i]>=g.start-f-ni&&p[i]<=g.end+f+ni}getCenterPoint(t){return Oi(this,t)}draw(t){let{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),nl(t,this.getCenterPoint(),o.rotation),Ai(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;let a=En(t,o);t.ellipse(s,r,i/2,e/2,gt/2,0,2*gt),t.fill(),a&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return vf(t,e,!0)}};Ii.id="ellipseAnnotation";Ii.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},ri.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Ii.defaultRoutes={borderColor:"color",backgroundColor:"color"};Ii.descriptors={label:{_fallback:!0}};function $x(n,t,e,i){let{width:s,height:r,centerX:o,centerY:a}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;let h=Wt(e||0),f=i/2||0,g=Math.cos(h),p=Math.sin(h),m=Math.pow(g*(n.x-o)+p*(n.y-a),2),y=Math.pow(p*(n.x-o)-g*(n.y-a),2);return m/Math.pow(l+f,2)+y/Math.pow(c+f,2)<=1.0001}var Ds=class extends qt{inRange(t,e,i,s){let{x:r,y:o,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),h=this.options.borderWidth;if(i!=="x"&&i!=="y")return Iy({x:t,y:e},this.getCenterPoint(s),c/2,h);let f=h/2,g=i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t};return g.value>=g.start-f&&g.value<=g.end+f}getCenterPoint(t){return Oi(this,t)}draw(t){let e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Ai(t,e);let s=En(t,e);Vy(t,this,this.centerX,this.centerY),s&&!Kr(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){let i=bf(t,e);return i.initProperties=Ps(t,i,e,!0),i}};Ds.id="pointAnnotation";Ds.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};Ds.defaultRoutes={borderColor:"color",backgroundColor:"color"};var Es=class extends qt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&zx(this.elements,t,e,s);let r=si({x:t,y:e},this.getCenterPoint(s),Wt(-this.options.rotation)),o=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...o),l=Math.max(...o);return r[i]>=a&&r[i]<=l}getCenterPoint(t){return Oi(this,t)}draw(t){let{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ai(t,i);let s=En(t,i),r=!0;for(let o of e)r?(t.moveTo(o.x,o.y),r=!1):t.lineTo(o.x,o.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){let i=bf(t,e),{sides:s,rotation:r}=e,o=[],a=2*gt/s,l=r*Xi;for(let c=0;ce!=r.bY>e&&t<(r.bX-a.bX)*(e-a.bY)/(r.bY-a.bY)+a.bX&&(s=!s),r=a}return s}var On={box:ri,ellipse:Ii,label:Li,line:Fi,point:Ds,polygon:Es};Object.keys(On).forEach(n=>{ft.describe(`elements.${On[n].id}`,{_fallback:"plugins.annotation.common"})});var Bx={update:Object.assign},Nx=ol.concat(Zr),zf=(n,t)=>at(t)?pl(n,t):n,fl=n=>n==="color"||n==="font";function dl(n="line"){return On[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function Hx(n,t,e,i){let s=Vx(n,e.animations,i),r=t.annotations,o=qx(t.elements,r);for(let a=0;azf(o,s)):e[i]=zf(r,s)}return e}function Xx(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function qx(n,t){let e=t.length,i=n.length;if(ie&&n.splice(e,i-e);return n}var Gx="2.2.1",An=new Map,Ux=ol.concat(Zr),Hf={id:"annotation",version:Gx,beforeRegister(){$y("chart.js","3.7",se.version)},afterRegister(){se.register(On)},afterUnregister(){se.unregister(On)},beforeInit(n){An.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){let i=An.get(n),s=i.annotations=[],r=e.annotations;at(r)?Object.keys(r).forEach(o=>{let a=r[o];at(a)&&(a.id=o,s.push(a))}):pt(r)&&s.push(...r),cx(s,n.scales)},afterDataLimits(n,t){let e=An.get(n);lx(n,t.scale,e.annotations.filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){let i=An.get(n);ix(n,i,e),Hx(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),ax(n,i,e)},beforeDatasetsDraw(n,t,e){Jr(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Jr(n,"afterDatasetsDraw",e.clip)},beforeDraw(n,t,e){Jr(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Jr(n,"afterDraw",e.clip)},beforeEvent(n,t,e){let i=An.get(n);sx(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){An.delete(n)},_getState(n){return An.get(n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!Ux.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${On[dl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:fl,_fallback:!0},_indexable:fl}},additionalOptionScopes:[""]};function Jr(n,t,e){let{ctx:i,chartArea:s}=n,r=An.get(n);e&&xn(i,s);let o=Kx(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(let a of o)Zx(i,s,r,a);e&&wn(i)}function Kx(n,t){let e=[];for(let i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(let s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function Zx(n,t,e,i){let s=i.element;i.main?(kf(e,s,"beforeDraw"),s.draw(n,t),kf(e,s,"afterDraw")):s.draw(n,t)}se.register(...Xu,Hf,Ti,Cs);var to=class{constructor(t){this.plugin=t}async datasetPrep(t,e,i=!1){var h,f,g;let s=[];if(!t.id){let p=[];if(this.plugin.settings.themeable||i){let m=1;for(;;){let y=getComputedStyle(e).getPropertyValue(`--chart-color-${m}`);if(y)p.push(y),m++;else break}}for(let m=0;t.series.length>m;m++){let c=t.series[m],{title:y}=c,S=qc(c,["title"]),M=Nn({label:y!=null?y:"",backgroundColor:t.labelColors?p.length?ln(p,t.transparency):ln(this.plugin.settings.colors,t.transparency):p.length?ln(p,t.transparency)[m]:ln(this.plugin.settings.colors,t.transparency)[m],borderColor:t.labelColors?p.length?p:this.plugin.settings.colors:p.length?p[m]:this.plugin.settings.colors[m],borderWidth:1,fill:t.fill?t.stacked?m==0?"origin":"-1":!0:!1,tension:(h=t.tension)!=null?h:0},S);t.type==="sankey"&&(M.colorFrom&&(M.colorFrom=C=>{var F,D;return(D=(F=t.series[m].colorFrom[C.dataset.data[C.dataIndex].from])!=null?F:p[m])!=null?D:"green"}),M.colorTo&&(M.colorTo=C=>{var F,D;return(D=(F=t.series[m].colorTo[C.dataset.data[C.dataIndex].to])!=null?F:p[m])!=null?D:"green"})),s.push(M)}}let r=t.time?{type:"time",time:{unit:t.time}}:null,o=t.labels,a=getComputedStyle(e).getPropertyValue("--background-modifier-border"),l;return se.defaults.color=t.textColor||getComputedStyle(e).getPropertyValue("--text-muted"),se.defaults.font.family=getComputedStyle(e).getPropertyValue("--mermaid-font"),se.defaults.plugins=_i(Nn({},se.defaults.plugins),{legend:_i(Nn({},se.defaults.plugins.legend),{display:(f=t.legend)!=null?f:!0,position:(g=t.legendPosition)!=null?g:"top"})}),se.defaults.layout.padding=t.padding,t.type=="radar"||t.type=="polarArea"?l={type:t.type,data:{labels:o,datasets:s},options:{animation:{duration:0},scales:{r:_i(Nn({},r),{grid:{color:a},beginAtZero:t.beginAtZero,max:t.rMax,min:t.rMin,ticks:{backdropColor:a}})}}}:t.type=="bar"||t.type=="line"?l={type:t.type,data:{labels:o,datasets:s},options:{animation:{duration:0},indexAxis:t.indexAxis,spanGaps:t.spanGaps,scales:{y:{min:t.yMin,max:t.yMax,reverse:t.yReverse,ticks:{display:t.yTickDisplay,padding:t.yTickPadding},display:t.yDisplay,stacked:t.stacked,beginAtZero:t.beginAtZero,grid:{color:a},title:{display:t.yTitle,text:t.yTitle}},x:_i(Nn({},r),{min:t.xMin,max:t.xMax,reverse:t.xReverse,ticks:{display:t.xTickDisplay,padding:t.xTickPadding},display:t.xDisplay,stacked:t.stacked,grid:{color:a},title:{display:t.xTitle,text:t.xTitle}})}}}:t.type==="sankey"?(s=s.map(p=>_i(Nn({},p),{data:p.data.map(m=>Array.isArray(m)&&m.length===3?{from:m[0],flow:m[1],to:m[2]}:m)})),l={type:t.type,data:{labels:o,datasets:s},options:{animation:{duration:0}}}):l={type:t.type,data:{labels:o,datasets:s},options:{animation:{duration:0},spanGaps:t.spanGaps}},{chartOptions:l,width:t.width}}async imageRenderer(t,e){let i=l=>new Promise(c=>setTimeout(c,l)),s=document.createElement("canvas"),r=s.getContext("2d"),o=await this.datasetPrep(await(0,Qr.parseYaml)(t.replace("```chart","").replace("```","").replace(/\t/g," ")),document.body);new se(r,o.chartOptions),document.body.append(s),await i(250);let a=s.toDataURL(e.format,e.quality);return document.body.removeChild(s),a.substring(a.indexOf(",")+1)}renderRaw(t,e){var s;let i=e.createEl("canvas");if(t.chartOptions)try{let r=new se(i.getContext("2d"),t.chartOptions);return i.parentElement.style.width=(s=t.width)!=null?s:"100%",i.parentElement.style.margin="auto",r}catch(r){return cn(r,e),null}else try{return new se(i.getContext("2d"),t)}catch(r){return cn(r,e),null}}async renderFromYaml(t,e,i){this.plugin.app.workspace.onLayoutReady(()=>i.addChild(new Wf(t,e,this,i.sourcePath)))}},Wf=class extends Qr.MarkdownRenderChild{constructor(t,e,i,s){super(e);this.el=e,this.data=t,this.renderer=i,this.ownPath=s,this.changeHandler=this.changeHandler.bind(this),this.reload=this.reload.bind(this)}async onload(){var t,e,i,s;try{let r=await this.renderer.datasetPrep(this.data,this.el),o={};if(this.data.id){let a=[];if(this.renderer.plugin.settings.themeable){let g=1;for(;;){let p=getComputedStyle(this.el).getPropertyValue(`--chart-color-${g}`);if(p)a.push(p),g++;else break}}o.datasets=[];let l;this.data.file&&(l=this.renderer.plugin.app.metadataCache.getFirstLinkpathDest(this.data.file,this.renderer.plugin.app.workspace.getActiveFile().path));let c=(t=this.renderer.plugin.app.metadataCache.getFileCache(l!=null?l:this.renderer.plugin.app.vault.getAbstractFileByPath(this.ownPath)).sections.find(g=>g.id===this.data.id))==null?void 0:t.position;if(!c)throw"Invalid id and/or file";let h=(await this.renderer.plugin.app.vault.cachedRead(this.data.file?l:this.renderer.plugin.app.vault.getAbstractFileByPath(this.ownPath))).substring(c.start.offset,c.end.offset),f;try{f=Za(h,(e=this.data.layout)!=null?e:"columns",this.data.select)}catch(g){throw"There is no table at that id and/or file"}o.labels=f.labels;for(let g=0;f.dataFields.length>g;g++)o.datasets.push({label:(i=f.dataFields[g].dataTitle)!=null?i:"",data:f.dataFields[g].data,backgroundColor:this.data.labelColors?a.length?ln(a,this.data.transparency):ln(this.renderer.plugin.settings.colors,this.data.transparency):a.length?ln(a,this.data.transparency)[g]:ln(this.renderer.plugin.settings.colors,this.data.transparency)[g],borderColor:this.data.labelColors?a.length?a:this.renderer.plugin.settings.colors:a.length?a[g]:this.renderer.plugin.settings.colors[g],borderWidth:1,fill:this.data.fill?this.data.stacked?g==0?"origin":"-1":!0:!1,tension:(s=this.data.tension)!=null?s:0});r.chartOptions.data.labels=o.labels,r.chartOptions.data.datasets=o.datasets}this.chart=this.renderer.renderRaw(r,this.containerEl)}catch(r){cn(r,this.el)}this.data.id&&this.renderer.plugin.app.metadataCache.on("changed",this.changeHandler),this.renderer.plugin.app.workspace.on("css-change",this.reload)}changeHandler(t){(this.data.file?t.basename===this.data.file:t.path===this.ownPath)&&this.reload()}reload(){this.onunload(),this.onload()}onunload(){this.renderer.plugin.app.metadataCache.off("changed",this.changeHandler),this.renderer.plugin.app.workspace.off("css-change",this.reload),this.el.empty(),this.chart&&this.chart.destroy(),this.chart=null}};var eo={colors:["rgba(255, 99, 132, 1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)","rgba(153, 102, 255, 1)","rgba(255, 159, 64, 1)"],contextMenu:!0,imageSettings:{format:"image/png",quality:.92},themeable:!1};var Ye=ze(require("obsidian"));var gl=function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")},ml=function(){function n(t,e){for(var i=0;i1&&arguments[1]!==void 0?arguments[1]:1,e=t>0?n.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):n.toString();return e||"0"}var Qx=function(){function n(t,e,i,s){gl(this,n);var r=this;function o(l){if(l.startsWith("hsl")){var c=l.match(/([\-\d\.e]+)/g).map(Number),h=no(c,4),f=h[0],g=h[1],p=h[2],m=h[3];m===void 0&&(m=1),f/=360,g/=100,p/=100,r.hsla=[f,g,p,m]}else if(l.startsWith("rgb")){var y=l.match(/([\-\d\.e]+)/g).map(Number),S=no(y,4),M=S[0],C=S[1],F=S[2],D=S[3];D===void 0&&(D=1),r.rgba=[M,C,F,D]}else l.startsWith("#")?r.rgba=n.hexToRgb(l):r.rgba=n.nameToRgb(l)||n.hexToRgb(l)}if(t!==void 0)if(Array.isArray(t))this.rgba=t;else if(i===void 0){var a=t&&""+t;a&&o(a.toLowerCase())}else this.rgba=[t,e,i,s===void 0?1:s]}return ml(n,[{key:"printRGB",value:function(e){var i=e?this.rgba:this.rgba.slice(0,3),s=i.map(function(r,o){return Vf(r,o===3?3:0)});return e?"rgba("+s+")":"rgb("+s+")"}},{key:"printHSL",value:function(e){var i=[360,100,100,1],s=["","%","%",""],r=e?this.hsla:this.hsla.slice(0,3),o=r.map(function(a,l){return Vf(a*i[l],l===3?3:1)+s[l]});return e?"hsla("+o+")":"hsl("+o+")"}},{key:"printHex",value:function(e){var i=this.hex;return e?i:i.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=n.hslToRgb(this._hsla)},set:function(e){e.length===3&&(e[3]=1),this._rgba=e,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=n.rgbToHsl(this._rgba)},set:function(e){e.length===3&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var e=this.rgba,i=e.map(function(s,r){return r<3?s.toString(16):Math.round(s*255).toString(16)});return"#"+i.map(function(s){return s.padStart(2,"0")}).join("")},set:function(e){this.rgba=n.hexToRgb(e)}}],[{key:"hexToRgb",value:function(e){var i=(e.startsWith("#")?e.slice(1):e).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!i.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+e);var s=i.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(r){return parseInt(r,16)});return s[3]=s[3]/255,s}},{key:"nameToRgb",value:function(e){var i=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),s=Jx[i];return s===void 0?s:n.hexToRgb(s.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(e){var i=no(e,4),s=i[0],r=i[1],o=i[2],a=i[3];s/=255,r/=255,o/=255;var l=Math.max(s,r,o),c=Math.min(s,r,o),h=void 0,f=void 0,g=(l+c)/2;if(l===c)h=f=0;else{var p=l-c;switch(f=g>.5?p/(2-l-c):p/(l+c),l){case s:h=(r-o)/p+(r1&&(C-=1),C<1/6?S+(M-S)*6*C:C<1/2?M:C<2/3?S+(M-S)*(2/3-C)*6:S},g=o<.5?o*(1+r):o+r-o*r,p=2*o-g;l=f(p,g,s+1/3),c=f(p,g,s),h=f(p,g,s-1/3)}var m=[l*255,c*255,h*255].map(Math.round);return m[3]=a,m}}]),n}(),t1=function(){function n(){gl(this,n),this._events=[]}return ml(n,[{key:"add",value:function(e,i,s){e.addEventListener(i,s,!1),this._events.push({target:e,type:i,handler:s})}},{key:"remove",value:function(e,i,s){this._events=this._events.filter(function(r){var o=!0;return e&&e!==r.target&&(o=!1),i&&i!==r.type&&(o=!1),s&&s!==r.handler&&(o=!1),o&&n._doRemove(r.target,r.type,r.handler),!o})}},{key:"destroy",value:function(){this._events.forEach(function(e){return n._doRemove(e.target,e.type,e.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(e,i,s){e.removeEventListener(i,s,!1)}}]),n}();function e1(n){var t=document.createElement("div");return t.innerHTML=n,t.firstElementChild}function bl(n,t,e){var i=!1;function s(l,c,h){return Math.max(c,Math.min(l,h))}function r(l,c,h){if(h&&(i=!0),!!i){l.preventDefault();var f=t.getBoundingClientRect(),g=f.width,p=f.height,m=c.clientX,y=c.clientY,S=s(m-f.left,0,g),M=s(y-f.top,0,p);e(S/g,M/p)}}function o(l,c){var h=l.buttons===void 0?l.which:l.buttons;h===1?r(l,l,c):i=!1}function a(l,c){l.touches.length===1?r(l,l.touches[0],c):i=!1}n.add(t,"mousedown",function(l){o(l,!0)}),n.add(t,"touchstart",function(l){a(l,!0)}),n.add(window,"mousemove",o),n.add(t,"touchmove",a),n.add(window,"mouseup",function(l){i=!1}),n.add(t,"touchend",function(l){i=!1}),n.add(t,"touchcancel",function(l){i=!1})}var n1=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em, + linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`,i1=360,Yf="keydown",io="mousedown",vl="focusin";function Ve(n,t){return(t||document).querySelector(n)}function Xf(n){n.preventDefault(),n.stopPropagation()}function _l(n,t,e,i,s){n.add(t,Yf,function(r){e.indexOf(r.key)>=0&&(s&&Xf(r),i(r))})}var yl=function(){function n(t){gl(this,n),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new t1,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}return ml(n,[{key:"setOptions",value:function(e){var i=this;if(!e)return;var s=this.settings;function r(c,h,f){for(var g in c)f&&f.indexOf(g)>=0||(h[g]=c[g])}if(e instanceof HTMLElement)s.parent=e;else{s.parent&&e.parent&&s.parent!==e.parent&&(this._events.remove(s.parent),this._popupInited=!1),r(e,s),e.onChange&&(this.onChange=e.onChange),e.onDone&&(this.onDone=e.onDone),e.onOpen&&(this.onOpen=e.onOpen),e.onClose&&(this.onClose=e.onClose);var o=e.color||e.colour;o&&this._setColor(o)}var a=s.parent;if(a&&s.popup&&!this._popupInited){var l=function(h){return i.openHandler(h)};this._events.add(a,"click",l),_l(this._events,a,[" ","Spacebar","Enter"],l),this._popupInited=!0}else e.parent&&!s.popup&&this.show()}},{key:"openHandler",value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents="none";var i=e&&e.type===Yf?this._domEdit:this.domElement;setTimeout(function(){return i.focus()},100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(e){var i=e&&e.type,s=!1;if(!e)s=!0;else if(i===io||i===vl){var r=(this.__containedEvent||0)+100;e.timeStamp>r&&(s=!0)}else Xf(e),s=!0;s&&this.hide()&&(this.settings.parent.style.pointerEvents="",i!==io&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(e,i){this.closeHandler(),this.setOptions(e),i&&this.openHandler()}},{key:"setColor",value:function(e,i){this._setColor(e,{silent:i})}},{key:"_setColor",value:function(e,i){if(typeof e=="string"&&(e=e.trim()),!!e){i=i||{};var s=void 0;try{s=new Qx(e)}catch(o){if(i.failSilently)return;throw o}if(!this.settings.alpha){var r=s.hsla;r[3]=1,s.hsla=r}this.colour=this.color=s,this._setHSLA(null,null,null,null,i)}}},{key:"setColour",value:function(e,i){this.setColor(e,i)}},{key:"show",value:function(){var e=this.settings.parent;if(!e)return!1;if(this.domElement){var i=this._toggleDOM(!0);return this._setPosition(),i}var s=this.settings.template||'
    ',r=e1(s);return this.domElement=r,this._domH=Ve(".picker_hue",r),this._domSL=Ve(".picker_sl",r),this._domA=Ve(".picker_alpha",r),this._domEdit=Ve(".picker_editor input",r),this._domSample=Ve(".picker_sample",r),this._domOkay=Ve(".picker_done button",r),this._domCancel=Ve(".picker_cancel button",r),r.classList.add("layout_"+this.settings.layout),this.settings.alpha||r.classList.add("no_alpha"),this.settings.editor||r.classList.add("no_editor"),this.settings.cancelButton||r.classList.add("no_cancel"),this._ifPopup(function(){return r.classList.add("popup")}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var e=this,i=this,s=this.domElement,r=this._events;function o(c,h,f){r.add(c,h,f)}o(s,"click",function(c){return c.preventDefault()}),bl(r,this._domH,function(c,h){return i._setHSLA(c)}),bl(r,this._domSL,function(c,h){return i._setHSLA(null,c,1-h)}),this.settings.alpha&&bl(r,this._domA,function(c,h){return i._setHSLA(null,null,null,1-h)});var a=this._domEdit;o(a,"input",function(c){i._setColor(this.value,{fromEditor:!0,failSilently:!0})}),o(a,"focus",function(c){var h=this;h.selectionStart===h.selectionEnd&&h.select()}),this._ifPopup(function(){var c=function(g){return e.closeHandler(g)};o(window,io,c),o(window,vl,c),_l(r,s,["Esc","Escape"],c);var h=function(g){e.__containedEvent=g.timeStamp};o(s,io,h),o(s,vl,h),o(e._domCancel,"click",c)});var l=function(h){e._ifPopup(function(){return e.closeHandler(h)}),e.onDone&&e.onDone(e.colour)};o(this._domOkay,"click",l),_l(r,s,["Enter"],l)}},{key:"_setPosition",value:function(){var e=this.settings.parent,i=this.domElement;e!==i.parentNode&&e.appendChild(i),this._ifPopup(function(s){getComputedStyle(e).position==="static"&&(e.style.position="relative");var r=s===!0?"popup_right":"popup_"+s;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(o){o===r?i.classList.add(o):i.classList.remove(o)}),i.classList.add(r)})}},{key:"_setHSLA",value:function(e,i,s,r,o){o=o||{};var a=this.colour,l=a.hsla;[e,i,s,r].forEach(function(c,h){(c||c===0)&&(l[h]=c)}),a.hsla=l,this._updateUI(o),this.onChange&&!o.silent&&this.onChange(a)}},{key:"_updateUI",value:function(e){if(!this.domElement)return;e=e||{};var i=this.colour,s=i.hsla,r="hsl("+s[0]*i1+", 100%, 50%)",o=i.hslString,a=i.hslaString,l=this._domH,c=this._domSL,h=this._domA,f=Ve(".picker_selector",l),g=Ve(".picker_selector",c),p=Ve(".picker_selector",h);function m($,N,G){N.style.left=G*100+"%"}function y($,N,G){N.style.top=G*100+"%"}m(l,f,s[0]),this._domSL.style.backgroundColor=this._domH.style.color=r,m(c,g,s[1]),y(c,g,1-s[2]),c.style.color=o,y(h,p,1-s[3]);var S=o,M=S.replace("hsl","hsla").replace(")",", 0)"),C="linear-gradient("+[S,M]+")";if(this._domA.style.background=C+", "+n1,!e.fromEditor){var F=this.settings.editorFormat,D=this.settings.alpha,I=void 0;switch(F){case"rgb":I=i.printRGB(D);break;case"hsl":I=i.printHSL(D);break;default:I=i.printHex(D)}this._domEdit.value=I}this._domSample.style.color=a}},{key:"_ifPopup",value:function(e,i){this.settings.parent&&this.settings.popup?e&&e(this.settings.popup):i&&i()}},{key:"_toggleDOM",value:function(e){var i=this.domElement;if(!i)return!1;var s=e?"":"none",r=i.style.display!==s;return r&&(i.style.display=s),r}}]),n}();so=document.createElement("style"),so.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(so),yl.StyleElement=so;var so;var xl=class extends Ye.PluginSettingTab{constructor(t,e){super(t,e);this.plugin=e}isColor(t){var e=new Option().style;return e.color=t,e.color==t}display(){let{containerEl:t,plugin:e}=this;t.empty(),t.createEl("h2",{text:"Settings - Charts"}),t.createEl("h3",{text:"General"}),new Ye.Setting(t).setName("Show Button in Context Menu").setDesc("If enabled, you will se a Button in your Editor Context Menu to open the Chart Creator.").addToggle(r=>{r.setValue(this.plugin.settings.contextMenu).onChange(async o=>{e.settings.contextMenu=o,await e.saveSettings()})}),new Ye.Setting(t).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development:").addButton(r=>{r.buttonEl.outerHTML='
    '}),t.createEl("h3",{text:"Colors",attr:{style:"margin-bottom: 0"}});let i=t.createEl("p",{cls:"setting-item-description"});i.append("Set the Colors for your Charts. This will set the border Color and the inner Color will be the same, but with less opacity. This ensures better compatibility with Dark and Light Mode. ","You can use any ",i.createEl("a",{href:"https://www.w3schools.com/cssref/css_colors.asp",text:"valid CSS Color."})),new Ye.Setting(t).setName("Enable Theme Colors").setDesc("If your Obsidian Theme (or snippet) provides Colors you can use them instead.").addToggle(r=>{r.setValue(e.settings.themeable).onChange(async o=>{e.settings.themeable=o,await e.saveSettings(),this.display()})}),e.settings.themeable||(e.settings.colors.forEach((r,o)=>{let a=document.createDocumentFragment();a.createSpan({text:"\u25CF",attr:{style:`color: ${r}`}}),a.appendText(` Color #${o+1}`),new Ye.Setting(t).setName(a).setDesc("This will be the border Color used in the Charts you create.").addButton(l=>{l.setButtonText("Change Color"),new yl({parent:l.buttonEl,onDone:async c=>{this.plugin.settings.colors[o]=c.hex,await this.plugin.saveSettings(),this.display()},popup:"left",color:r,alpha:!1})}).addExtraButton(l=>{l.setIcon("trash").setTooltip("Remove").onClick(async()=>{this.plugin.settings.colors.remove(r),await this.plugin.saveSettings(),this.display()}),this.plugin.settings.colors.length===1&&l.setDisabled(!0)}).addExtraButton(l=>{l.setIcon("reset").setTooltip("Reset to default").onClick(async()=>{var c;this.plugin.settings.colors[o]=(c=eo.colors[o])!=null?c:"#ffffff",await this.plugin.saveSettings(),this.display()})})}),new Ye.Setting(t).addButton(r=>{r.setButtonText("Add Color").onClick(async()=>{this.plugin.settings.colors.push("#ffffff"),await this.plugin.saveSettings(),this.display()})})),t.createEl("h3",{text:"Chart to Image Converter"});let s=t.createEl("details");s.createEl("summary",{text:"How to use"}),s.createEl("img",{attr:{src:"https://media.discordapp.net/attachments/855181471643861002/897811615037136966/charttoimage.gif"}}),new Ye.Setting(t).setName("Image Format").setDesc("The Format to be used, when generating a Image from a Chart.").addDropdown(r=>{r.addOptions({"image/jpeg":"jpeg","image/png":"png","image/webp":"webp"}),r.setValue(e.settings.imageSettings.format),r.onChange(async o=>{e.settings.imageSettings.format=o,await e.saveSettings()})}),new Ye.Setting(t).setName("Image Quality").setDesc("If using a lossy format, set the Image Quality.").addSlider(r=>{r.setDynamicTooltip().setLimits(.01,1,.01).setValue(e.settings.imageSettings.quality).onChange(async o=>{e.settings.imageSettings.quality=o,await e.saveSettings()})})}};var pd=ze(require("obsidian"));function wl(){}function s1(n,t){for(let e in t)n[e]=t[e];return n}function kl(n){return n()}function qf(){return Object.create(null)}function hn(n){n.forEach(kl)}function Gf(n){return typeof n=="function"}function ro(n,t){return n!=n?t==t:n!==t||n&&typeof n=="object"||typeof n=="function"}function Uf(n){return Object.keys(n).length===0}function Kf(n,t,e,i){if(n){let s=Zf(n,t,e,i);return n[0](s)}}function Zf(n,t,e,i){return n[1]&&i?s1(e.ctx.slice(),n[1](i(t))):e.ctx}function Jf(n,t,e,i){if(n[2]&&i){let s=n[2](i(e));if(t.dirty===void 0)return s;if(typeof s=="object"){let r=[],o=Math.max(t.dirty.length,s.length);for(let a=0;a32){let t=[],e=n.ctx.length/32;for(let i=0;in.removeEventListener(t,e,i)}function X(n,t,e){e==null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}function Ml(n){return n===""?null:+n}function c1(n){return Array.from(n.childNodes)}function id(n,t){t=""+t,n.wholeText!==t&&(n.data=t)}function de(n,t){n.value=t??""}function Gt(n,t,e,i){e===null?n.style.removeProperty(t):n.style.setProperty(t,e,i?"important":"")}function Cl(n,t){for(let e=0;e{let s=n.$$.callbacks[t];if(s){let r=h1(t,e,{cancelable:i});return s.slice().forEach(o=>{o.call(n,r)}),!r.defaultPrevented}return!0}}var Rs=[];var lo=[],co=[],rd=[],f1=Promise.resolve(),Tl=!1;function d1(){Tl||(Tl=!0,f1.then(od))}function Ls(n){co.push(n)}var Dl=new Set,ho=0;function od(){let n=Os;do{for(;ho{uo.delete(n),i&&(e&&n.d(1),i())}),n.o(t)}else i&&i()}var vw=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;var _w=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]);function ad(n){n&&n.c()}function El(n,t,e,i){let{fragment:s,on_mount:r,on_destroy:o,after_update:a}=n.$$;s&&s.m(t,e),i||Ls(()=>{let l=r.map(kl).filter(Gf);o?o.push(...l):hn(l),n.$$.on_mount=[]}),a.forEach(Ls)}function po(n,t){let e=n.$$;e.fragment!==null&&(hn(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function m1(n,t){n.$$.dirty[0]===-1&&(Rs.push(n),d1(),n.$$.dirty.fill(0)),n.$$.dirty[t/31|0]|=1<{let m=p.length?p[0]:g;return c.ctx&&s(c.ctx[f],c.ctx[f]=m)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](m),h&&m1(n,f)),g}):[],c.update(),h=!0,hn(c.before_update),c.fragment=i?i(c.ctx):!1,t.target){if(t.hydrate){r1();let f=c1(t.target);c.fragment&&c.fragment.l(f),f.forEach(Ie)}else c.fragment&&c.fragment.c();t.intro&&Fs(n.$$.fragment),El(n,t.target,t.anchor,t.customElement),o1(),od()}As(l)}var b1;typeof HTMLElement=="function"&&(b1=class extends HTMLElement{constructor(){super();this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:n}=this.$$;this.$$.on_disconnect=n.map(kl).filter(Gf);for(let t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(n,t,e){this[n]=e}disconnectedCallback(){hn(this.$$.on_disconnect)}$destroy(){po(this,1),this.$destroy=wl}$on(n,t){let e=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return e.push(t),()=>{let i=e.indexOf(t);i!==-1&&e.splice(i,1)}}$set(n){this.$$set&&!Uf(n)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}});var Is=class{$destroy(){po(this,1),this.$destroy=wl}$on(t,e){let i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(e),()=>{let s=i.indexOf(e);s!==-1&&i.splice(s,1)}}$set(t){this.$$set&&!Uf(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}};var mo=ze(require("obsidian"));function v1(n){oo(n,"svelte-1lboqqp","h3.svelte-1lboqqp{margin:0}button.svelte-1lboqqp{display:flex;justify-content:space-between;width:100%;border:none;margin:0;padding:1em 0.5em}button.svelte-1lboqqp{fill:currentColor}svg.svelte-1lboqqp{height:0.7em;width:0.7em}")}function _1(n){let t,e,i,s,r,o,a,l,c,h,f,g,p,m,y=n[3].default,S=Kf(y,n,n[2],null);return{c(){t=Y("div"),e=Y("h3"),i=Y("button"),s=Sl(n[0]),r=It(),o=ao("svg"),a=ao("path"),l=ao("path"),c=It(),h=Y("div"),S&&S.c(),X(a,"class","vert"),X(a,"d","M10 1V19"),X(a,"stroke","black"),X(a,"stroke-width","2"),X(l,"d","M1 10L19 10"),X(l,"stroke","black"),X(l,"stroke-width","2"),X(o,"viewBox","0 0 20 20"),X(o,"fill","none"),X(o,"class","svelte-1lboqqp"),X(i,"aria-expanded",n[1]),X(i,"class","svelte-1lboqqp"),X(e,"class","svelte-1lboqqp"),X(h,"class","contents"),h.hidden=f=!n[1],X(t,"class","collapsible")},m(M,C){Xe(M,t,C),z(t,e),z(e,i),z(i,s),z(i,r),z(i,o),z(o,a),z(o,l),z(t,c),z(t,h),S&&S.m(h,null),g=!0,p||(m=Jt(i,"click",n[4]),p=!0)},p(M,[C]){(!g||C&1)&&id(s,M[0]),(!g||C&2)&&X(i,"aria-expanded",M[1]),S&&S.p&&(!g||C&4)&&Qf(S,y,M,M[2],g?Jf(y,M[2],C,null):td(M[2]),null),(!g||C&2&&f!==(f=!M[1]))&&(h.hidden=f)},i(M){g||(Fs(S,M),g=!0)},o(M){fo(S,M),g=!1},d(M){M&&Ie(t),S&&S.d(M),p=!1,m()}}}function y1(n,t,e){let{$$slots:i={},$$scope:s}=t,{headerText:r}=t,o=!1,a=()=>e(1,o=!o);return n.$$set=l=>{"headerText"in l&&e(0,r=l.headerText),"$$scope"in l&&e(2,s=l.$$scope)},[r,o,s,i,a]}var ld=class extends Is{constructor(t){super();go(this,t,y1,_1,ro,{headerText:0},v1)}},cd=ld;function x1(n){oo(n,"svelte-1tlkntj",".addMoreButtonContainer.svelte-1tlkntj{display:flex;justify-content:flex-end;margin-top:0.4rem}.subDesc.svelte-1tlkntj{font-size:smaller;opacity:0.5;margin:0}.desc.svelte-1tlkntj{padding-right:1em}.mainDesc.svelte-1tlkntj{margin:0}table.svelte-1tlkntj{margin:auto}.controlElement.svelte-1tlkntj{text-align:center}.chart-modal.svelte-1tlkntj{overflow-y:auto}.modalColumn.svelte-1tlkntj{display:flex;gap:2em}.chartPreview.svelte-1tlkntj{width:30vw;display:flex;justify-content:center;align-items:center}")}function hd(n,t,e){let i=n.slice();return i[33]=t[e],i[34]=t,i[35]=e,i}function ud(n){let t,e,i,s,r,o,a,l,c,h,f;function g(){n[23].call(r,n[34],n[35])}function p(){n[24].call(c,n[34],n[35])}return{c(){t=Y("tr"),e=Y("td"),e.innerHTML=`

    Y Axis

    +

    Set Data Fields (Comma seperated)

    `,i=It(),s=Y("td"),r=Y("input"),o=It(),a=Y("br"),l=It(),c=Y("input"),X(e,"class","desc svelte-1tlkntj"),X(r,"type","text"),X(r,"placeholder","Name"),X(c,"type","text"),X(c,"placeholder","1, -2, 11, 5"),Gt(c,"margin-top","3px"),X(s,"class","controlElement svelte-1tlkntj")},m(m,y){Xe(m,t,y),z(t,e),z(t,i),z(t,s),z(s,r),de(r,n[33].dataTitle),z(s,o),z(s,a),z(s,l),z(s,c),de(c,n[33].data),h||(f=[Jt(r,"input",g),Jt(c,"input",p)],h=!0)},p(m,y){n=m,y[0]&1024&&r.value!==n[33].dataTitle&&de(r,n[33].dataTitle),y[0]&1024&&c.value!==n[33].data&&de(c,n[33].data)},d(m){m&&Ie(t),h=!1,hn(f)}}}function w1(n){let t,e,i,s,r,o,a,l,c,h,f,g,p,m,y,S,M,C,F,D,I;return{c(){t=Y("hr"),e=It(),i=Y("table"),s=Y("tr"),r=Y("td"),r.innerHTML=`

    Line of Best Fit

    +

    Create a line of best fit

    `,o=Y("td"),a=Y("input"),l=It(),c=Y("tr"),h=Y("td"),h.innerHTML=`

    Best Fit Line ID

    +

    The line ID used to create the line of best fit

    `,f=Y("td"),g=Y("input"),p=Y("br"),m=It(),y=Y("tr"),S=Y("td"),S.innerHTML=`

    Line of Best Fit Title

    +

    The title for the line of best fit

    `,M=Y("td"),C=Y("input"),F=Y("br"),X(r,"class","desc svelte-1tlkntj"),X(a,"type","checkbox"),X(a,"class","task-list-item-checkbox"),Gt(a,"width","16px"),Gt(a,"height","16px"),X(o,"class","controlElement svelte-1tlkntj"),X(h,"class","desc svelte-1tlkntj"),X(g,"type","text"),X(g,"placeholder","0"),Gt(g,"width","26px"),Gt(g,"height","32px"),X(f,"class","controlElement svelte-1tlkntj"),X(S,"class","desc svelte-1tlkntj"),X(C,"type","text"),X(C,"placeholder","Line of Best Fit"),Gt(C,"width","96px"),Gt(C,"height","32px"),X(M,"class","controlElement svelte-1tlkntj"),Gt(i,"width","100%"),X(i,"class","svelte-1tlkntj")},m($,N){Xe($,t,N),Xe($,e,N),Xe($,i,N),z(i,s),z(s,r),z(s,o),z(o,a),a.checked=n[6],z(i,l),z(i,c),z(c,h),z(c,f),z(f,g),de(g,n[8]),z(f,p),z(i,m),z(i,y),z(y,S),z(y,M),z(M,C),de(C,n[7]),z(M,F),D||(I=[Jt(a,"change",n[26]),Jt(g,"input",n[27]),Jt(C,"input",n[28])],D=!0)},p($,N){N[0]&64&&(a.checked=$[6]),N[0]&256&&g.value!==$[8]&&de(g,$[8]),N[0]&128&&C.value!==$[7]&&de(C,$[7])},d($){$&&Ie(t),$&&Ie(e),$&&Ie(i),D=!1,hn(I)}}}function k1(n){let t,e,i,s,r,o,a,l,c,h,f,g,p,m,y,S,M,C,F,D,I,$,N,G,U,it,lt,rt,Pt,zt,et,Et,St,re,ye,ot,Lt,Bt,Ut,Qt,k,v,x,R,E,O,Z,V,J,tt,xt,Ht,Ot,Yt,Xt,ue,ke,xe,Rn,un,Ln,je,$i,Fn,oi,$s,ji,ai,qe,In,$n,li,js,fn=n[10],ce=[];for(let bt=0;btChart Type

    +

    Choose a Chart Type

    `,c=Y("td"),h=Y("select"),f=Y("option"),f.textContent="Bar",g=Y("option"),g.textContent="Line",p=Y("option"),p.textContent="Pie",m=Y("option"),m.textContent="Doughnut",y=Y("option"),y.textContent="Radar",S=Y("option"),S.textContent="Polar Area",M=It(),C=Y("tr"),F=Y("td"),F.innerHTML=`

    Smoothness

    +

    Changes the smoothness of the Chart

    `,D=Y("td"),I=Y("input"),$=It(),N=Y("tr"),G=Y("td"),G.innerHTML=`

    Width

    +

    Changes the horizontal width

    `,U=Y("td"),it=Y("input"),lt=It(),rt=Y("tr"),Pt=Y("td"),Pt.innerHTML=`

    Fill

    +

    Fill the underside of the Chart

    `,zt=Y("td"),et=Y("input"),Et=It(),St=Y("tr"),re=Y("td"),re.innerHTML=`

    Distinct Colors

    +

    Use distinct Colors for each Label

    `,ye=Y("td"),ot=Y("input"),Lt=It(),Bt=Y("tr"),Ut=Y("td"),Ut.innerHTML=`

    Start at Zero

    +

    Don't cut the graph at the bottom

    `,Qt=Y("td"),k=Y("input"),v=It(),x=Y("hr"),R=It(),E=Y("table"),O=Y("tr"),Z=Y("td"),Z.innerHTML=`

    X Axis

    +

    Set Labels (Comma seperated)

    `,V=It(),J=Y("td"),tt=Y("input"),xt=Y("br"),Ht=It(),Ot=Y("hr"),Yt=It(),Xt=Y("table");for(let bt=0;btn[16].call(h)),X(c,"class","controlElement svelte-1tlkntj"),X(F,"class","desc svelte-1tlkntj"),X(I,"type","range"),X(I,"min","0"),X(I,"max","100"),X(I,"class","slider"),X(D,"class","controlElement svelte-1tlkntj"),X(G,"class","desc svelte-1tlkntj"),X(it,"type","range"),X(it,"min","20"),X(it,"max","100"),X(it,"class","slider"),X(U,"class","controlElement svelte-1tlkntj"),X(Pt,"class","desc svelte-1tlkntj"),X(et,"type","checkbox"),X(et,"class","task-list-item-checkbox"),Gt(et,"width","16px"),Gt(et,"height","16px"),X(zt,"class","controlElement svelte-1tlkntj"),X(re,"class","desc svelte-1tlkntj"),X(ot,"type","checkbox"),X(ot,"class","task-list-item-checkbox"),Gt(ot,"width","16px"),Gt(ot,"height","16px"),X(ye,"class","controlElement svelte-1tlkntj"),X(Ut,"class","desc svelte-1tlkntj"),X(k,"type","checkbox"),X(k,"class","task-list-item-checkbox"),Gt(k,"width","16px"),Gt(k,"height","16px"),X(Qt,"class","controlElement svelte-1tlkntj"),Gt(o,"width","100%"),X(o,"class","svelte-1tlkntj"),X(Z,"class","desc svelte-1tlkntj"),X(tt,"type","text"),X(tt,"placeholder","Monday, Tuesday, ..."),X(J,"class","controlElement svelte-1tlkntj"),Gt(E,"width","100%"),X(E,"class","svelte-1tlkntj"),X(ke,"class","addMoreButtonContainer svelte-1tlkntj"),Gt(Xt,"width","100%"),X(Xt,"class","svelte-1tlkntj"),X(oi,"id","preview"),X(Fn,"class","chartPreview svelte-1tlkntj"),X(s,"class","modalColumn svelte-1tlkntj"),X(t,"class","chart-modal svelte-1tlkntj"),X(In,"class","mod-cta"),Gt(qe,"display","flex"),Gt(qe,"justify-content","center"),Gt(qe,"align-items","center")},m(bt,te){Xe(bt,t,te),z(t,e),z(t,i),z(t,s),z(s,r),z(r,o),z(o,a),z(a,l),z(a,c),z(c,h),z(h,f),z(h,g),z(h,p),z(h,m),z(h,y),z(h,S),Cl(h,n[0]),z(o,M),z(o,C),z(C,F),z(C,D),z(D,I),de(I,n[1]),z(o,$),z(o,N),z(N,G),z(N,U),z(U,it),de(it,n[2]),z(o,lt),z(o,rt),z(rt,Pt),z(rt,zt),z(zt,et),et.checked=n[3],z(o,Et),z(o,St),z(St,re),z(St,ye),z(ye,ot),ot.checked=n[4],z(o,Lt),z(o,Bt),z(Bt,Ut),z(Bt,Qt),z(Qt,k),k.checked=n[5],z(r,v),z(r,x),z(r,R),z(r,E),z(E,O),z(O,Z),z(O,V),z(O,J),z(J,tt),de(tt,n[9]),z(J,xt),z(r,Ht),z(r,Ot),z(r,Yt),z(r,Xt);for(let dn=0;dn{var Bt;a&&a.destroy(),(Bt=F.lastElementChild)===null||Bt===void 0||Bt.remove(),a=s.renderRaw(await s.datasetPrep((0,mo.parseYaml)(ot),Lt),Lt)},500,!0);function I(){let ot=i.getDoc(),Lt=ot.getCursor();a.destroy(),ot.replaceRange("```chart\n"+C+"\n```",Lt),r("close")}function $(){o=sd(this),e(0,o)}function N(){l=Ml(this.value),e(1,l)}function G(){c=Ml(this.value),e(2,c)}function U(){h=this.checked,e(3,h)}function it(){f=this.checked,e(4,f)}function lt(){g=this.checked,e(5,g)}function rt(){S=this.value,e(9,S)}function Pt(ot,Lt){ot[Lt].dataTitle=this.value,e(10,M)}function zt(ot,Lt){ot[Lt].data=this.value,e(10,M)}let et=()=>e(10,M=[...M,{data:"",dataTitle:""}]);function Et(){p=this.checked,e(6,p)}function St(){y=this.value,e(8,y)}function re(){m=this.value,e(7,m)}function ye(ot){lo[ot?"unshift":"push"](()=>{F=ot,e(11,F)})}return n.$$set=ot=>{"editor"in ot&&e(13,i=ot.editor),"renderer"in ot&&e(14,s=ot.renderer)},n.$$.update=()=>{if(n.$$.dirty[0]&2047){t:e(15,C=`type: ${o} +labels: [${S}] +series: +${M.map(ot=>` - title: ${ot.dataTitle} + data: [${ot.data}]`).join(` +`)} +tension: ${l/100} +width: ${c}% +labelColors: ${f} +fill: ${h} +beginAtZero: ${g} +bestFit: ${p} +bestFitTitle: ${m} +bestFitNumber: ${y}`)}if(n.$$.dirty[0]&34816){t:if(F)try{D(C,F)}catch(ot){cn(ot,F)}}},[o,l,c,h,f,g,p,m,y,S,M,F,I,i,s,C,$,N,G,U,it,lt,rt,Pt,zt,et,Et,St,re,ye]}var fd=class extends Is{constructor(t){super();go(this,t,S1,k1,ro,{editor:13,renderer:14},x1,[-1,-1])}},dd=fd;var bo=class extends pd.Modal{constructor(t,e,i,s){super(t);this.settings=i,this.view=e,this.renderer=s}onOpen(){let{contentEl:t,view:e,settings:i,renderer:s}=this;t.empty(),new dd({target:t,props:{editor:e.editor,renderer:s}}).$on("close",()=>this.close())}onClose(){let{contentEl:t}=this;t.empty()}};var gd=ze(require("obsidian")),md={chart:''},bd=()=>{Object.keys(md).forEach(n=>{(0,gd.addIcon)(n,md[n])})};var Ol=class extends $e.Plugin{constructor(){super(...arguments);this.postprocessor=async(t,e,i)=>{let s;try{s=await(0,$e.parseYaml)(t.replace(/ /g," "))}catch(a){cn(a,e);return}if(!s.id&&(!s||!s.type||!s.labels||!s.series)){cn("Missing type, labels or series",e);return}if(s.bestFit===!0&&s.type==="line"){if(s.bestFitNumber!=null)var r=s.series[Number(s.bestFitNumber)].data;else var r=s.series[0].data;let a=s.labels,l=0,c=0,h=0,f=0;for(let y=0;y{let e=this.app.workspace.activeLeaf;return e.view instanceof $e.MarkdownView?(t||new bo(this.app,e.view,this.settings,this.renderer).open(),!0):!1}}),this.addCommand({id:"chart-from-table-column",name:"Create Chart from Table (Column oriented Layout)",editorCheckCallback:(t,e,i)=>{let s=e.getSelection();return i instanceof $e.MarkdownView&&s.split(` +`).length>=3&&s.split("|").length>=2?(t||Ka(e,"columns"),!0):!1}}),this.addCommand({id:"chart-from-table-row",name:"Create Chart from Table (Row oriented Layout)",editorCheckCallback:(t,e,i)=>i instanceof $e.MarkdownView&&e.getSelection().split(` +`).length>=3&&e.getSelection().split("|").length>=2?(t||Ka(e,"rows"),!0):!1}),this.addCommand({id:"chart-to-svg",name:"Create Image from Chart",editorCheckCallback:(t,e,i)=>i instanceof $e.MarkdownView&&e.getSelection().startsWith("```chart")&&e.getSelection().endsWith("```")?(t||(new $e.Notice("Rendering Chart..."),Ju(e,this.app,this.renderer,i.file,this.settings)),!0):!1}),this.registerMarkdownCodeBlockProcessor("chart",this.postprocessor),this.registerMarkdownCodeBlockProcessor("advanced-chart",async(t,e)=>this.renderer.renderRaw(await JSON.parse(t),e)),this.registerEvent(this.app.workspace.on("editor-menu",(t,e,i)=>{i&&this.settings.contextMenu&&t.addItem(s=>{s.setTitle("Insert Chart").setIcon("chart").onClick(r=>{new bo(this.app,i,this.settings,this.renderer).open()})})}))}onunload(){console.log("unloading plugin: Charts")}}; +/* + * @license + * + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + * + * Copyright (c) 2018-2021, Костя Третяк. (MIT Licensed) + * https://github.com/ts-stack/markdown + */ +/*! + * chartjs-adapter-moment v1.0.0 + * https://www.chartjs.org + * (c) 2021 chartjs-adapter-moment Contributors + * Released under the MIT license + */ +/*! + * @kurkle/color v0.2.1 + * https://github.com/kurkle/color#readme + * (c) 2022 Jukka Kurkela + * Released under the MIT License + */ +/*! + * Chart.js v3.9.1 + * https://www.chartjs.org + * (c) 2022 Chart.js Contributors + * Released under the MIT License + */ +/*! + * chartjs-chart-sankey v0.12.0 + * https://github.com/kurkle/chartjs-chart-sankey#readme + * (c) 2022 Jukka Kurkela + * Released under the MIT license + */ +/*! + * vanilla-picker v2.12.1 + * https://vanilla-picker.js.org + * + * Copyright 2017-2021 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate) + * Released under the ISC license. + */ +/*! +* chartjs-plugin-annotation v2.2.1 +* https://www.chartjs.org/chartjs-plugin-annotation/index + * (c) 2023 chartjs-plugin-annotation Contributors + * Released under the MIT License + */ +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ +/** + * @license + * + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + * + * Copyright (c) 2018-2021, Костя Третяк. (MIT Licensed) + * https://github.com/ts-stack/markdown + */ +/** + * @license + * + * Copyright (c) 2018-2021, Костя Третяк. (MIT Licensed) + * https://github.com/ts-stack/markdown + */ +/** + * chroma.js - JavaScript library for color conversions + * + * Copyright (c) 2011-2019, Gregor Aisch + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name Gregor Aisch may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ------------------------------------------------------- + * + * chroma.js includes colors from colorbrewer2.org, which are released under + * the following license: + * + * Copyright (c) 2002 Cynthia Brewer, Mark Harrower, + * and The Pennsylvania State University. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the License. + * + * ------------------------------------------------------ + * + * Named colors are taken from X11 Color Names. + * http://www.w3.org/TR/css3-color/#svg-color + * + * @preserve + */ diff --git a/lum/lum/.obsidian/plugins/obsidian-charts/manifest.json b/lum/lum/.obsidian/plugins/obsidian-charts/manifest.json new file mode 100644 index 0000000..c656c74 --- /dev/null +++ b/lum/lum/.obsidian/plugins/obsidian-charts/manifest.json @@ -0,0 +1,11 @@ +{ + "id": "obsidian-charts", + "name": "Charts", + "version": "3.9.0", + "minAppVersion": "0.12.7", + "description": "This Plugin lets you create Charts within Obsidian", + "author": "phibr0", + "authorUrl": "https://github.com/phibr0", + "isDesktopOnly": false, + "fundingUrl": "https://ko-fi.com/phibr0" +} diff --git a/lum/lum/.obsidian/plugins/obsidian-charts/styles.css b/lum/lum/.obsidian/plugins/obsidian-charts/styles.css new file mode 100644 index 0000000..ae9c32b --- /dev/null +++ b/lum/lum/.obsidian/plugins/obsidian-charts/styles.css @@ -0,0 +1,30 @@ +.picker_wrapper.popup, +.picker_wrapper.popup .picker_arrow::before, +.picker_wrapper.popup .picker_arrow::after, +.picker_editor > input { + background-color: var(--background-primary); +} + +.picker_editor > input { + color: var(--text-normal); +} + +div.chart-error { + padding: 1rem; + border-radius: 1rem; + background-color: var(--background-secondary); +} + +div.chart-error pre > code { + color: crimson !important; +} + +.print .block-language-chart { + /* Hardcoded with for printed Charts, see #41 */ + width: 500px !important; +} + +a[href="https://ko-fi.com/phibr0"] > img +{ + height: 3em; +} diff --git a/lum/lum/.obsidian/workspace.json b/lum/lum/.obsidian/workspace.json index 2d9d0c3..0224d9d 100644 --- a/lum/lum/.obsidian/workspace.json +++ b/lum/lum/.obsidian/workspace.json @@ -4,19 +4,21 @@ "type": "split", "children": [ { - "id": "d1222fc030931cbe", + "id": "5d8de7ceb84b0f1c", "type": "tabs", "children": [ { - "id": "fddaf66e771021a1", + "id": "697408e6b34d8353", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "eng/systems/fly/analytics db.md", + "file": "meeting notes/11-20-2024.md", "mode": "source", - "source": false - } + "source": true + }, + "icon": "lucide-file", + "title": "11-20-2024" } } ] @@ -39,7 +41,9 @@ "type": "file-explorer", "state": { "sortOrder": "alphabetical" - } + }, + "icon": "lucide-folder-closed", + "title": "Files" } }, { @@ -54,7 +58,9 @@ "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical" - } + }, + "icon": "lucide-search", + "title": "Search" } }, { @@ -62,7 +68,9 @@ "type": "leaf", "state": { "type": "bookmarks", - "state": {} + "state": {}, + "icon": "lucide-bookmark", + "title": "Bookmarks" } } ] @@ -85,7 +93,7 @@ "state": { "type": "backlink", "state": { - "file": "eng/systems/fly/analytics db.md", + "file": "eng/roadmap/Roadmap(s).md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -93,7 +101,9 @@ "searchQuery": "", "backlinkCollapsed": false, "unlinkedCollapsed": true - } + }, + "icon": "links-coming-in", + "title": "Backlinks for Roadmap(s)" } }, { @@ -102,10 +112,12 @@ "state": { "type": "outgoing-link", "state": { - "file": "eng/systems/fly/analytics db.md", + "file": "eng/roadmap/Roadmap(s).md", "linksCollapsed": false, "unlinkedCollapsed": true - } + }, + "icon": "links-going-out", + "title": "Outgoing links from Roadmap(s)" } }, { @@ -116,7 +128,9 @@ "state": { "sortOrder": "frequency", "useHierarchy": true - } + }, + "icon": "lucide-tags", + "title": "Tags" } }, { @@ -125,8 +139,10 @@ "state": { "type": "outline", "state": { - "file": "eng/systems/fly/analytics db.md" - } + "file": "eng/roadmap/Roadmap(s).md" + }, + "icon": "lucide-list", + "title": "Outline of Roadmap(s)" } } ] @@ -146,11 +162,18 @@ "command-palette:Open command palette": false } }, - "active": "9e7c192b9f83e80b", + "active": "697408e6b34d8353", "lastOpenFiles": [ + "eng/roadmap/Roadmap(s).md", + "meeting notes/11-20-2024.md", + "meeting notes/arliss 1-1/10-01-2024.md", + "eng/roadmap", + "EIR.md", + "eng/systems/fly/analytics db.md", + "meeting notes/arliss 1-1", + "meeting notes", "eng/code", "eng/fly.md", - "eng/systems/fly/analytics db.md", "eng/systems/fly/metabase.md", "eng/systems/fly/db.md", "eng/systems/fly/ui.md", diff --git a/lum/lum/EIR.md b/lum/lum/EIR.md new file mode 100644 index 0000000..b29ee62 --- /dev/null +++ b/lum/lum/EIR.md @@ -0,0 +1,3 @@ +An [**entrepreneur in residence**](https://en.wikipedia.org/wiki/Entrepreneur_in_residence), or **executive in residence** (**EIR**), is a position commonly held by successful [entrepreneurs](https://en.wikipedia.org/wiki/Entrepreneurship "Entrepreneurship") in [venture capital](https://en.wikipedia.org/wiki/Venture_capital "Venture capital") firms, [private equity](https://en.wikipedia.org/wiki/Private_equity "Private equity") firms, [startup accelerators](https://en.wikipedia.org/wiki/Startup_accelerator "Startup accelerator"), [law firms](https://en.wikipedia.org/wiki/Law_firm "Law firm") or [business schools](https://en.wikipedia.org/wiki/Business_school "Business school"). Typically, the EIR has led or currently leads a [small, early-stage, emerging company](https://en.wikipedia.org/wiki/Start-up_company "Start-up company") with perceived high-growth potential or has demonstrated significant growth in terms of employees, annual revenue, or both. + +[Institutional fund](https://en.wikipedia.org/wiki/Investment_management "Investment management") may provide an entrepreneur in residence, or executive in residence, with the necessary [working capital](https://en.wikipedia.org/wiki/Working_capital "Working capital") to facilitate expansion, new-product development, or the restructuring of a company's operations, management, or ownership. \ No newline at end of file diff --git a/lum/lum/eng/roadmap/Roadmap(s).md b/lum/lum/eng/roadmap/Roadmap(s).md new file mode 100644 index 0000000..dd265f5 --- /dev/null +++ b/lum/lum/eng/roadmap/Roadmap(s).md @@ -0,0 +1,51 @@ +```mermaid +gantt + title MVP0 + dateFormat MM-DD-YYYY + axisFormat %m/%d + tickInterval 1week + Scaffold Codebase :scaffold, 07-20-2024, 4d + Wireframing, branding :branding, after scaffold, 4d + User signup / login :login_work, after branding, 08-05-2024 + Signup / Login Flow :milestone, login, 08-05-2024, 0d + CI/CD :after login, 1d + Research spike - AI prompting, model choice, hosting :prompting, after login, 5d + Database :db, after prompting, 8d + REST API (minimal) :api, after db, 8d + AI :ai, after api, 5d + Frontend :frontend, after ai, 5d + Foundry PDF :foundry, after frontend, 5d + Testing :testing, after foundry, 5d + FOUNDRY Report :milestone, after testing, 0d +``` + +```mermaid +gantt + title IDEA (MVP1) + dateFormat MM-DD-YYYY + axisFormat %m/%d + tickInterval 1week + Idea Dashboard :dash, 11-01-2024, 1w + Realtime Assessment Updates :real, after dash, 4d + Milestones :mile, after real, 5d + Mock Interviews :mock, after mile, 5d + Metrics :metric, after mock, 5d + MVP1 :milestone, after metric, 0d +``` + +```mermaid +gantt + title Full Platform + dateFormat MM-DD-YYYY + axisFormat %m/%d + tickInterval 2week + MVP0 :mvp0, 07-20-2024, 09-20-2024 + CORE Protocol REST API :api, 09-20-2024, 10-10-2024 + Marketing / Landing Page :mkt, 10-10-2024, 11-01-2024 + IDEA :mvp1, 11-01-2024, 11-30-2024 + LAUNCH :launch, after mvp1, 6w + section LAUNCH + Milestone Tracking :lnc-mile, after mvp1, 1w + Metrics Integrations :lnc-metric, after lnc-mile, 1w + Metric Insights :lnc-insight, after lnc-metric, 2w +``` diff --git a/lum/lum/meeting notes/11-20-2024.md b/lum/lum/meeting notes/11-20-2024.md new file mode 100644 index 0000000..21bcb03 --- /dev/null +++ b/lum/lum/meeting notes/11-20-2024.md @@ -0,0 +1,9 @@ +# analytics +#analytics +- xgs.ai +- arliss saw old team spend a long time on integrations & insights + +my thoughts: +- want to keep partnerships lean when reasonable +- actionable insights ultimately comes down to 2 parts: **understand** then **recommend** + - napkin example: LLM with knowledgebase or something that can ask and ingest historical analytics \ No newline at end of file diff --git a/lum/lum/meeting notes/arliss 1-1/10-01-2024.md b/lum/lum/meeting notes/arliss 1-1/10-01-2024.md new file mode 100644 index 0000000..62b57b0 --- /dev/null +++ b/lum/lum/meeting notes/arliss 1-1/10-01-2024.md @@ -0,0 +1,178 @@ +# Background +1. Jasmine (VC relations) intro email, some questions +2. Recently pivoted to focus on selling, revenue more than a raise +3. MVP0 (business report document) recently made available, working on assisting kolbe w marketing site + +# To Cover +- coworking +- kolbe +- catching up +- feedback +## Jasmine +> What is the advantage of targeting young, underrepresented first-time founders as [[EIR]]s? +- They need more support than experience entrepreneurs +- They are more open to better terms of engagement for us +- Different worldview than traditional entrepreneurs +- Stand to gain the most from a "experienced co-founder / gap filler" platform + +> What kind of experience or characteristics will they need bring to the table before being hired as an EIR? **Are they knowledge workers itching to start a new venture after feeling the crippling slow nature of a larger corporation?** +- high ability to problem solve, tactics +- don't need to have strong entrepreneurial experience +- need support, capital +- willing to expend high effort to seek out opportunities +- highly motivated towards personal / professional achievement +- reasonably forward-thinking, analytical +- primed / eager to build something + +```chart +type: radar +labels: + - entrepreneurial experience + - problem-solving / tactical + - motivation towards achievement + - network + - analytical + - forward-thinking + - risk-taking + - self-esteem + - locus of control + - effort to seek out opportunity + - need for support / capital +series: + - title: 'Active College Founder' + data: + - 0 # entrepreneurial experience + - 3 # problem-solving / tactical + - 5 # motivation towards achievement + - 2 # networker + - 3 # analytical + - 4 # forward-thinking + - 3 # risk-taking + - 3 # self-esteem + - 3 # locus of control + - 5 # effort to seek out opportunity + - 5 # need for support / capital + - title: 'Knowledge Worker fed up w/ corporate' + data: + - 1 # entrepreneurial experience + - 5 # problem-solving / tactical + - 3 # motivation towards achievement + - 4 # networker + - 5 # analytical + - 3 # forward-thinking + - 2 # risk-taking + - 4 # self-esteem + - 4 # locus of control + - 4 # effort to seek out opportunity + - 5 # need for support / capital + - title: 'MBA' + data: + - 2 # entrepreneurial experience + - 4 # problem-solving / tactical + - 3 # motivation towards achievement + - 5 # networker + - 3 # analytical + - 4 # forward-thinking + - 5 # risk-taking + - 5 # self-esteem + - 5 # locus of control + - 4 # effort to seek out opportunity + - 3 # need for support / capital +width: 80% +``` + +```chart +type: radar +labels: + - entrepreneurial experience + - problem-solving / tactical + - motivation towards achievement + - network + - analytical + - forward-thinking + - risk-taking + - self-esteem + - locus of control + - effort to seek out opportunity + - need for support / capital +series: + - title: 'Startup biz founder w/ 1 seed-stage exit' + data: + - 4 # entrepreneurial experience + - 4 # problem-solving / tactical + - 3 # motivation towards achievement + - 5 # networker + - 4 # analytical + - 5 # forward-thinking + - 5 # risk-taking + - 5 # self-esteem + - 4 # locus of control + - 4 # effort to seek out opportunity + - 2 # need for support / capital + - title: 'Startup biz founder w/ several series A+ exits' + data: + - 5 # entrepreneurial experience + - 5 # problem-solving / tactical + - 4 # motivation towards achievement + - 5 # networker + - 4 # analytical + - 5 # forward-thinking + - 3 # risk-taking + - 4 # self-esteem + - 4 # locus of control + - 4 # effort to seek out opportunity + - 1 # need for support / capital + - title: 'Sundar Pichai' + data: + - 5 # entrepreneurial experience + - 5 # problem-solving / tactical + - 5 # motivation towards achievement + - 5 # networker + - 5 # analytical + - 5 # forward-thinking + - 1 # risk-taking + - 5 # self-esteem + - 5 # locus of control + - 5 # effort to seek out opportunity + - 0 # need for support / capital +width: 80% +``` + + + +> How does this founder type fit well within your early-stage venture studio model? +I feel like this is addressed by the above? + +> Will they have full-time jobs they'll need to quit? Are you raising enough cash to support a livable salary for them in Chicago? +It depends on: +* the maturity of the idea / venture +* the founder +* resources required to prove demand, viability + +|their venture is...|they need to...|then we would...|then they would...| +|--|--|--|--| +|idea, low scale, low cost, high value|prove demand|invest a small amount of capital|build it, then quit their job| +|idea, med scale, med cost, high value|prove valid + demand + feasible|invest a small amount of capital|next phase of planning, then build| + +> Is supporting young, underrepresented founders your new mission for the fund? +Yes as a mission statement but not as an uncompromising position + +> Most importantly, you all will be first-time founders leading other first-time founders. As an experienced investor who knows how difficult it is to build and successfully launch a venture-backed business, this venture studio is starting to feel a bit like the blind leading the blind. Why should I trust your inexperienced EIRs? +By giving them access to a network of mentors, community of other founders and an intelligence platform that fills the role of an experienced cofounder, we can take small calculated bets on people who have a high-value path to success. These are the people that are the next generation of founders; people that are ignored by venture firms but have a great untapped capacity to build great things with the right guidance. + +Is selling robot eyes leading the blind? + +## Coworking +- Tuesdays @ 1871 +## Uncertainty +- maximizing our exposure outward (?) +- focused execution +## Kolbe +- it hurt kolbe that i didnt go to the party +## "Burnout" +- CORE marketing video +- week or two to work on creative ideas +## Feedback +- +## Catching Up +- \ No newline at end of file diff --git a/orion/.obsidian/app.json b/orion/.obsidian/app.json new file mode 100644 index 0000000..84e50e3 --- /dev/null +++ b/orion/.obsidian/app.json @@ -0,0 +1,4 @@ +{ + "livePreview": false, + "promptDelete": false +} \ No newline at end of file diff --git a/orion/.obsidian/appearance.json b/orion/.obsidian/appearance.json new file mode 100644 index 0000000..58c7e3a --- /dev/null +++ b/orion/.obsidian/appearance.json @@ -0,0 +1,8 @@ +{ + "accentColor": "#b44676", + "cssTheme": "Obsidian Nord", + "theme": "obsidian", + "interfaceFontFamily": "Iosevka Aile", + "textFontFamily": "Iosevka Aile", + "monospaceFontFamily": "Iosevka Term" +} \ No newline at end of file diff --git a/orion/.obsidian/community-plugins.json b/orion/.obsidian/community-plugins.json new file mode 100644 index 0000000..57c5bad --- /dev/null +++ b/orion/.obsidian/community-plugins.json @@ -0,0 +1,3 @@ +[ + "obsidian-kanban" +] \ No newline at end of file diff --git a/orion/.obsidian/core-plugins.json b/orion/.obsidian/core-plugins.json new file mode 100644 index 0000000..436f43c --- /dev/null +++ b/orion/.obsidian/core-plugins.json @@ -0,0 +1,30 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "properties": false, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": false +} \ No newline at end of file diff --git a/orion/.obsidian/graph.json b/orion/.obsidian/graph.json new file mode 100644 index 0000000..42a46ec --- /dev/null +++ b/orion/.obsidian/graph.json @@ -0,0 +1,22 @@ +{ + "collapse-filter": true, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": false, + "showOrphans": true, + "collapse-color-groups": true, + "colorGroups": [], + "collapse-display": true, + "showArrow": false, + "textFadeMultiplier": 0, + "nodeSizeMultiplier": 1, + "lineSizeMultiplier": 1, + "collapse-forces": true, + "centerStrength": 0.518713248970312, + "repelStrength": 10, + "linkStrength": 1, + "linkDistance": 250, + "scale": 1, + "close": true +} \ No newline at end of file diff --git a/orion/.obsidian/plugins/obsidian-kanban/data.json b/orion/.obsidian/plugins/obsidian-kanban/data.json new file mode 100644 index 0000000..74f3fa4 --- /dev/null +++ b/orion/.obsidian/plugins/obsidian-kanban/data.json @@ -0,0 +1,3 @@ +{ + "tag-colors": [] +} \ No newline at end of file diff --git a/orion/.obsidian/plugins/obsidian-kanban/main.js b/orion/.obsidian/plugins/obsidian-kanban/main.js new file mode 100644 index 0000000..9090d50 --- /dev/null +++ b/orion/.obsidian/plugins/obsidian-kanban/main.js @@ -0,0 +1,153 @@ +var sF=Object.create;var Vs=Object.defineProperty;var lF=Object.getOwnPropertyDescriptor;var uF=Object.getOwnPropertyNames;var cF=Object.getPrototypeOf,dF=Object.prototype.hasOwnProperty;var fF=(e,t,r)=>t in e?Vs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var hF=(e,t)=>()=>(e&&(t=e(e=0)),t);var wn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Rf=(e,t)=>{for(var r in t)Vs(e,r,{get:t[r],enumerable:!0})},av=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of uF(t))!dF.call(e,i)&&i!==r&&Vs(e,i,{get:()=>t[i],enumerable:!(n=lF(t,i))||n.enumerable});return e};var Ct=(e,t,r)=>(r=e!=null?sF(cF(e)):{},av(t||!e||!e.__esModule?Vs(r,"default",{value:e,enumerable:!0}):r,e)),ov=e=>av(Vs({},"__esModule",{value:!0}),e);var ur=(e,t,r)=>(fF(e,typeof t!="symbol"?t+"":t,r),r);var ln=wn((hi,Zv)=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});function Qr(e){return typeof e=="object"&&!("toString"in e)?Object.prototype.toString.call(e).slice(8,-1):e}var eI=typeof process=="object"&&!0;function Vr(e,t){if(!e)throw eI?new Error("Invariant failed"):new Error(t())}hi.invariant=Vr;var nh=Object.prototype.hasOwnProperty,tI=Array.prototype.splice,nI=Object.prototype.toString;function Ua(e){return nI.call(e).slice(8,-1)}var bu=Object.assign||function(e,t){return rh(t).forEach(function(r){nh.call(t,r)&&(e[r]=t[r])}),e},rh=typeof Object.getOwnPropertySymbols=="function"?function(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.keys(e)};function sa(e){return Array.isArray(e)?bu(e.constructor(e.length),e):Ua(e)==="Map"?new Map(e):Ua(e)==="Set"?new Set(e):e&&typeof e=="object"?bu(Object.create(Object.getPrototypeOf(e)),e):e}var Gv=function(){function e(){this.commands=bu({},rI),this.update=this.update.bind(this),this.update.extend=this.extend=this.extend.bind(this),this.update.isEquals=function(t,r){return t===r},this.update.newContext=function(){return new e().update}}return Object.defineProperty(e.prototype,"isEquals",{get:function(){return this.update.isEquals},set:function(t){this.update.isEquals=t},enumerable:!0,configurable:!0}),e.prototype.extend=function(t,r){this.commands[t]=r},e.prototype.update=function(t,r){var n=this,i=typeof r=="function"?{$apply:r}:r;Array.isArray(t)&&Array.isArray(i)||Vr(!Array.isArray(i),function(){return"update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."}),Vr(typeof i=="object"&&i!==null,function(){return"update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the "+("following commands: "+Object.keys(n.commands).join(", ")+".")});var a=t;return rh(i).forEach(function(o){if(nh.call(n.commands,o)){var s=t===a;a=n.commands[o](i[o],a,i,t),s&&n.isEquals(a,t)&&(a=t)}else{var u=Ua(t)==="Map"?n.update(t.get(o),i[o]):n.update(t[o],i[o]),l=Ua(a)==="Map"?a.get(o):a[o];(!n.isEquals(u,l)||typeof u=="undefined"&&!nh.call(t,o))&&(a===t&&(a=sa(t)),Ua(a)==="Map"?a.set(o,u):a[o]=u)}}),a},e}();hi.Context=Gv;var rI={$push:function(e,t,r){return jv(t,r,"$push"),e.length?t.concat(e):t},$unshift:function(e,t,r){return jv(t,r,"$unshift"),e.length?e.concat(t):t},$splice:function(e,t,r,n){return iI(t,r),e.forEach(function(i){Jv(i),t===n&&i.length&&(t=sa(n)),tI.apply(t,i)}),t},$set:function(e,t,r){return oI(r),e},$toggle:function(e,t){zs(e,"$toggle");var r=e.length?sa(t):t;return e.forEach(function(n){r[n]=!t[n]}),r},$unset:function(e,t,r,n){return zs(e,"$unset"),e.forEach(function(i){Object.hasOwnProperty.call(t,i)&&(t===n&&(t=sa(n)),delete t[i])}),t},$add:function(e,t,r,n){return qv(t,"$add"),zs(e,"$add"),Ua(t)==="Map"?e.forEach(function(i){var a=i[0],o=i[1];t===n&&t.get(a)!==o&&(t=sa(n)),t.set(a,o)}):e.forEach(function(i){t===n&&!t.has(i)&&(t=sa(n)),t.add(i)}),t},$remove:function(e,t,r,n){return qv(t,"$remove"),zs(e,"$remove"),e.forEach(function(i){t===n&&t.has(i)&&(t=sa(n)),t.delete(i)}),t},$merge:function(e,t,r,n){return sI(t,e),rh(e).forEach(function(i){e[i]!==t[i]&&(t===n&&(t=sa(n)),t[i]=e[i])}),t},$apply:function(e,t){return aI(e),e(t)}},ih=new Gv;hi.isEquals=ih.update.isEquals;hi.extend=ih.extend;hi.default=ih.update;hi.default.default=Zv.exports=bu(hi.default,hi);function jv(e,t,r){Vr(Array.isArray(e),function(){return"update(): expected target of "+Qr(r)+" to be an array; got "+Qr(e)+"."}),zs(t[r],r)}function zs(e,t){Vr(Array.isArray(e),function(){return"update(): expected spec of "+Qr(t)+" to be an array; got "+Qr(e)+". Did you forget to wrap your parameter in an array?"})}function iI(e,t){Vr(Array.isArray(e),function(){return"Expected $splice target to be an array; got "+Qr(e)}),Jv(t.$splice)}function Jv(e){Vr(Array.isArray(e),function(){return"update(): expected spec of $splice to be an array of arrays; got "+Qr(e)+". Did you forget to wrap your parameters in an array?"})}function aI(e){Vr(typeof e=="function",function(){return"update(): expected spec of $apply to be a function; got "+Qr(e)+"."})}function oI(e){Vr(Object.keys(e).length===1,function(){return"Cannot have more than one key in an object with $set"})}function sI(e,t){Vr(t&&typeof t=="object",function(){return"update(): $merge expects a spec of type 'object'; got "+Qr(t)}),Vr(e&&typeof e=="object",function(){return"update(): $merge expects a target of type 'object'; got "+Qr(e)})}function qv(e,t){var r=Ua(e);Vr(r==="Map"||r==="Set",function(){return"update(): "+Qr(t)+" expects a target of type Set or Map; got "+Qr(r)})}});var tw=wn((JB,ew)=>{"use strict";var lI=function(t){return uI(t)&&!cI(t)};function uI(e){return!!e&&typeof e=="object"}function cI(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||hI(e)}var dI=typeof Symbol=="function"&&Symbol.for,fI=dI?Symbol.for("react.element"):60103;function hI(e){return e.$$typeof===fI}function mI(e){return Array.isArray(e)?[]:{}}function Ks(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Mo(mI(e),e,t):e}function pI(e,t,r){return e.concat(t).map(function(n){return Ks(n,r)})}function gI(e,t){if(!t.customMerge)return Mo;var r=t.customMerge(e);return typeof r=="function"?r:Mo}function yI(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Qv(e){return Object.keys(e).concat(yI(e))}function Xv(e,t){try{return t in e}catch(r){return!1}}function vI(e,t){return Xv(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function wI(e,t,r){var n={};return r.isMergeableObject(e)&&Qv(e).forEach(function(i){n[i]=Ks(e[i],r)}),Qv(t).forEach(function(i){vI(e,i)||(Xv(e,i)&&r.isMergeableObject(t[i])?n[i]=gI(i,r)(e[i],t[i],r):n[i]=Ks(t[i],r))}),n}function Mo(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||pI,r.isMergeableObject=r.isMergeableObject||lI,r.cloneUnlessOtherwiseSpecified=Ks;var n=Array.isArray(t),i=Array.isArray(e),a=n===i;return a?n?r.arrayMerge(e,t,r):wI(e,t,r):Ks(t,r)}Mo.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,i){return Mo(n,i,r)},{})};var bI=Mo;ew.exports=bI});var Db=wn((FU,Ch)=>{"use strict";var JA=Object.prototype.hasOwnProperty,cr="~";function al(){}Object.create&&(al.prototype=Object.create(null),new al().__proto__||(cr=!1));function ZA(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function bb(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var a=new ZA(r,n||e,i),o=cr?cr+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],a]:e._events[o].push(a):(e._events[o]=a,e._eventsCount++),e}function Ru(e,t){--e._eventsCount===0?e._events=new al:delete e._events[t]}function Xn(){this._events=new al,this._eventsCount=0}Xn.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)JA.call(r,n)&&t.push(cr?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};Xn.prototype.listeners=function(t){var r=cr?cr+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=new Array(a);i{"use strict";"use restrict";var Ih=32;dn.INT_BITS=Ih;dn.INT_MAX=2147483647;dn.INT_MIN=-1<0)-(e<0)};dn.abs=function(e){var t=e>>Ih-1;return(e^t)-t};dn.min=function(e,t){return t^(e^t)&-(e65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,t|=r,t|e>>1};dn.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0};dn.popCount=function(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24};function Fb(e){var t=32;return e&=-e,e&&t--,e&65535&&(t-=16),e&16711935&&(t-=8),e&252645135&&(t-=4),e&858993459&&(t-=2),e&1431655765&&(t-=1),t}dn.countTrailingZeros=Fb;dn.nextPow2=function(e){return e+=e===0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1};dn.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)};dn.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,27030>>>e&1};var ll=new Array(256);(function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=r&1,--i;e[t]=n<>>8&255]<<16|ll[e>>>16&255]<<8|ll[e>>>24&255]};dn.interleave2=function(e,t){return e&=65535,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t&=65535,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1};dn.deinterleave2=function(e,t){return e=e>>>t&1431655765,e=(e|e>>>1)&858993459,e=(e|e>>>2)&252645135,e=(e|e>>>4)&16711935,e=(e|e>>>16)&65535,e<<16>>16};dn.interleave3=function(e,t,r){return e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,e|=t<<1,r&=1023,r=(r|r<<16)&4278190335,r=(r|r<<8)&251719695,r=(r|r<<4)&3272356035,r=(r|r<<2)&1227133513,e|r<<2};dn.deinterleave3=function(e,t){return e=e>>>t&1227133513,e=(e|e>>>2)&3272356035,e=(e|e>>>4)&251719695,e=(e|e>>>8)&4278190335,e=(e|e>>>16)&1023,e<<22>>22};dn.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>Fb(e)+1}});var Ob=wn((lW,Ab)=>{"use strict";function Ib(e,t,r){var n=e[r]|0;if(n<=0)return[];var i=new Array(n),a;if(r===e.length-1)for(a=0;a0)return tO(e|0,t);break;case"object":if(typeof e.length=="number")return Ib(e,t,0);break}return[]}Ab.exports=nO});var eD={};Rf(eD,{Buffer:()=>fe,INSPECT_MAX_BYTES:()=>$b,SlowBuffer:()=>mO,isBuffer:()=>Qb,kMaxLength:()=>uO});function Hb(){Oh=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");a=e[s-2]==="="?2:e[s-1]==="="?1:0,o=new rO(s*3/4-a),n=a>0?s-4:s;var u=0;for(t=0,r=0;t>16&255,o[u++]=i>>8&255,o[u++]=i&255;return a===2?(i=Wr[e.charCodeAt(t)]<<2|Wr[e.charCodeAt(t+1)]>>4,o[u++]=i&255):a===1&&(i=Wr[e.charCodeAt(t)]<<10|Wr[e.charCodeAt(t+1)]<<4|Wr[e.charCodeAt(t+2)]>>2,o[u++]=i>>8&255,o[u++]=i&255),o}function aO(e){return wi[e>>18&63]+wi[e>>12&63]+wi[e>>6&63]+wi[e&63]}function oO(e,t,r){for(var n,i=[],a=t;au?u:s+o));return n===1?(t=e[r-1],i+=wi[t>>2],i+=wi[t<<4&63],i+="=="):n===2&&(t=(e[r-2]<<8)+e[r-1],i+=wi[t>>10],i+=wi[t>>4&63],i+=wi[t<<2&63],i+="="),a.push(i),a.join("")}function Ku(e,t,r,n,i){var a,o,s=i*8-n-1,u=(1<>1,c=-7,d=r?i-1:0,m=r?-1:1,h=e[t+d];for(d+=m,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=a*256+e[t+d],d+=m,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=o*256+e[t+d],d+=m,c-=8);if(a===0)a=1-l;else{if(a===u)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-l}return(h?-1:1)*o*Math.pow(2,a-n)}function Bb(e,t,r,n,i,a){var o,s,u,l=a*8-i-1,c=(1<>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,g=n?1:-1,y=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+d>=1?t+=m/u:t+=m*Math.pow(2,1-d),t*u>=2&&(o++,u/=2),o+d>=c?(s=0,o=c):o+d>=1?(s=(t*u-1)*Math.pow(2,i),o=o+d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=s&255,h+=g,s/=256,i-=8);for(o=o<0;e[r+h]=o&255,h+=g,o/=256,l-=8);e[r+h-g]|=y*128}function Yu(){return fe.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Wi(e,t){if(Yu()=Yu())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Yu().toString(16)+" bytes");return e|0}function mO(e){return+e!=e&&(e=0),fe.alloc(+e)}function bi(e){return!!(e!=null&&e._isBuffer)}function Yb(e,t){if(bi(e))return e.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var r=e.length;if(r===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return zu(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Zb(e).length;default:if(n)return zu(e).length;t=(""+t).toLowerCase(),n=!0}}function pO(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return xO(this,t,r);case"utf8":case"utf-8":return jb(this,t,r);case"ascii":return EO(this,t,r);case"latin1":case"binary":return kO(this,t,r);case"base64":return DO(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return CO(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function Ga(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function zb(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=fe.from(t,n)),bi(t))return t.length===0?-1:Nb(e,t,r,n,i);if(typeof t=="number")return t=t&255,fe.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Nb(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Nb(e,t,r,n,i){var a=1,o=e.length,s=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,r/=2}function u(h,g){return a===1?h[g]:h.readUInt16BE(g*a)}var l;if(i){var c=-1;for(l=r;lo&&(r=o-s),l=r;l>=0;l--){for(var d=!0,m=0;mi&&(n=i)):n=i;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(i+s<=r){var u,l,c,d;switch(s){case 1:a<128&&(o=a);break;case 2:u=e[i+1],(u&192)===128&&(d=(a&31)<<6|u&63,d>127&&(o=d));break;case 3:u=e[i+1],l=e[i+2],(u&192)===128&&(l&192)===128&&(d=(a&15)<<12|(u&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],(u&192)===128&&(l&192)===128&&(c&192)===128&&(d=(a&15)<<18|(u&63)<<12|(l&63)<<6|c&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return SO(n)}function SO(e){var t=e.length;if(t<=Rb)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function gr(e,t,r,n,i,a){if(!bi(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function ju(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>(n?i:1-i)*8}function qu(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}function qb(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Gb(e,t,r,n,i){return i||qb(e,t,r,4),Bb(e,t,r,n,23,4),r+4}function Jb(e,t,r,n,i){return i||qb(e,t,r,8),Bb(e,t,r,n,52,8),r+8}function MO(e){if(e=TO(e).replace(_O,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function TO(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function FO(e){return e<16?"0"+e.toString(16):e.toString(16)}function zu(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function IO(e){for(var t=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function Zb(e){return iO(MO(e))}function Gu(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function OO(e){return e!==e}function Qb(e){return e!=null&&(!!e._isBuffer||Xb(e)||LO(e))}function Xb(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function LO(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&Xb(e.slice(0,0))}var wi,Wr,rO,Oh,sO,Vb,$b,Pb,lO,uO,Rb,_O,tD=hF(()=>{wi=[],Wr=[],rO=typeof Uint8Array!="undefined"?Uint8Array:Array,Oh=!1;sO={}.toString,Vb=Array.isArray||function(e){return sO.call(e)=="[object Array]"};$b=50,Pb=window;fe.TYPED_ARRAY_SUPPORT=Pb.TYPED_ARRAY_SUPPORT!==void 0?Pb.TYPED_ARRAY_SUPPORT:!0;lO=Yu(),uO=lO;fe.poolSize=8192;fe._augment=function(e){return e.__proto__=fe.prototype,e};fe.from=function(e,t,r){return Ub(null,e,t,r)};fe.TYPED_ARRAY_SUPPORT&&(fe.prototype.__proto__=Uint8Array.prototype,fe.__proto__=Uint8Array);fe.alloc=function(e,t,r){return cO(null,e,t,r)};fe.allocUnsafe=function(e){return Lh(null,e)};fe.allocUnsafeSlow=function(e){return Lh(null,e)};fe.isBuffer=Qb;fe.compare=function(t,r){if(!bi(t)||!bi(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,i=r.length,a=0,o=Math.min(n,i);a0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""};fe.prototype.compare=function(t,r,n,i,a){if(!bi(t))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),r<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;for(var o=a-i,s=n-r,u=Math.min(o,s),l=this.slice(i,a),c=t.slice(r,n),d=0;da)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return gO(this,t,r,n);case"utf8":case"utf-8":return yO(this,t,r,n);case"ascii":return Kb(this,t,r,n);case"latin1":case"binary":return vO(this,t,r,n);case"base64":return wO(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bO(this,t,r,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};fe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Rb=4096;fe.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r0&&(a*=256);)i+=this[t+--r]*a;return i};fe.prototype.readUInt8=function(t,r){return r||Pn(t,1,this.length),this[t]};fe.prototype.readUInt16LE=function(t,r){return r||Pn(t,2,this.length),this[t]|this[t+1]<<8};fe.prototype.readUInt16BE=function(t,r){return r||Pn(t,2,this.length),this[t]<<8|this[t+1]};fe.prototype.readUInt32LE=function(t,r){return r||Pn(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};fe.prototype.readUInt32BE=function(t,r){return r||Pn(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};fe.prototype.readIntLE=function(t,r,n){t=t|0,r=r|0,n||Pn(t,r,this.length);for(var i=this[t],a=1,o=0;++o=a&&(i-=Math.pow(2,8*r)),i};fe.prototype.readIntBE=function(t,r,n){t=t|0,r=r|0,n||Pn(t,r,this.length);for(var i=r,a=1,o=this[t+--i];i>0&&(a*=256);)o+=this[t+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*r)),o};fe.prototype.readInt8=function(t,r){return r||Pn(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};fe.prototype.readInt16LE=function(t,r){r||Pn(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};fe.prototype.readInt16BE=function(t,r){r||Pn(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};fe.prototype.readInt32LE=function(t,r){return r||Pn(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};fe.prototype.readInt32BE=function(t,r){return r||Pn(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};fe.prototype.readFloatLE=function(t,r){return r||Pn(t,4,this.length),Ku(this,t,!0,23,4)};fe.prototype.readFloatBE=function(t,r){return r||Pn(t,4,this.length),Ku(this,t,!1,23,4)};fe.prototype.readDoubleLE=function(t,r){return r||Pn(t,8,this.length),Ku(this,t,!0,52,8)};fe.prototype.readDoubleBE=function(t,r){return r||Pn(t,8,this.length),Ku(this,t,!1,52,8)};fe.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;gr(this,t,r,n,a,0)}var o=1,s=0;for(this[r]=t&255;++s=0&&(s*=256);)this[r+o]=t/s&255;return r+n};fe.prototype.writeUInt8=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,1,255,0),fe.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=t&255,r+1};fe.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,2,65535,0),fe.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):ju(this,t,r,!0),r+2};fe.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,2,65535,0),fe.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):ju(this,t,r,!1),r+2};fe.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,4,4294967295,0),fe.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255):qu(this,t,r,!0),r+4};fe.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,4,4294967295,0),fe.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):qu(this,t,r,!1),r+4};fe.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r|0,!i){var a=Math.pow(2,8*n-1);gr(this,t,r,n,a-1,-a)}var o=0,s=1,u=0;for(this[r]=t&255;++o>0)-u&255;return r+n};fe.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r|0,!i){var a=Math.pow(2,8*n-1);gr(this,t,r,n,a-1,-a)}var o=n-1,s=1,u=0;for(this[r+o]=t&255;--o>=0&&(s*=256);)t<0&&u===0&&this[r+o+1]!==0&&(u=1),this[r+o]=(t/s>>0)-u&255;return r+n};fe.prototype.writeInt8=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,1,127,-128),fe.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=t&255,r+1};fe.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,2,32767,-32768),fe.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):ju(this,t,r,!0),r+2};fe.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,2,32767,-32768),fe.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):ju(this,t,r,!1),r+2};fe.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,4,2147483647,-2147483648),fe.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):qu(this,t,r,!0),r+4};fe.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),fe.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):qu(this,t,r,!1),r+4};fe.prototype.writeFloatLE=function(t,r,n){return Gb(this,t,r,!0,n)};fe.prototype.writeFloatBE=function(t,r,n){return Gb(this,t,r,!1,n)};fe.prototype.writeDoubleLE=function(t,r,n){return Jb(this,t,r,!0,n)};fe.prototype.writeDoubleBE=function(t,r,n){return Jb(this,t,r,!1,n)};fe.prototype.copy=function(t,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r=0;--o)t[o+r]=this[o+n];else if(a<1e3||!fe.TYPED_ARRAY_SUPPORT)for(o=0;o>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var o;if(typeof t=="number")for(o=r;o{var Ja=(tD(),ov(eD));if(Ja&&Ja.default){Ju.exports=Ja.default;for(let e in Ja)Ju.exports[e]=Ja[e]}else Ja&&(Ju.exports=Ja)});var Xu=wn(bt=>{"use strict";var pa=Wu(),Wn=Ob(),rD=nD().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:Wn([32,0]),UINT16:Wn([32,0]),UINT32:Wn([32,0]),BIGUINT64:Wn([32,0]),INT8:Wn([32,0]),INT16:Wn([32,0]),INT32:Wn([32,0]),BIGINT64:Wn([32,0]),FLOAT:Wn([32,0]),DOUBLE:Wn([32,0]),DATA:Wn([32,0]),UINT8C:Wn([32,0]),BUFFER:Wn([32,0])});var PO=typeof Uint8ClampedArray!="undefined",NO=typeof BigUint64Array!="undefined",RO=typeof BigInt64Array!="undefined",Sn=window.__TYPEDARRAY_POOL;Sn.UINT8C||(Sn.UINT8C=Wn([32,0]));Sn.BIGUINT64||(Sn.BIGUINT64=Wn([32,0]));Sn.BIGINT64||(Sn.BIGINT64=Wn([32,0]));Sn.BUFFER||(Sn.BUFFER=Wn([32,0]));var Zu=Sn.DATA,Qu=Sn.BUFFER;bt.free=function(t){if(rD.isBuffer(t))Qu[pa.log2(t.length)].push(t);else{if(Object.prototype.toString.call(t)!=="[object ArrayBuffer]"&&(t=t.buffer),!t)return;var r=t.length||t.byteLength,n=pa.log2(r)|0;Zu[n].push(t)}};function iD(e){if(e){var t=e.length||e.byteLength,r=pa.log2(t);Zu[r].push(e)}}function HO(e){iD(e.buffer)}bt.freeUint8=bt.freeUint16=bt.freeUint32=bt.freeBigUint64=bt.freeInt8=bt.freeInt16=bt.freeInt32=bt.freeBigInt64=bt.freeFloat32=bt.freeFloat=bt.freeFloat64=bt.freeDouble=bt.freeUint8Clamped=bt.freeDataView=HO;bt.freeArrayBuffer=iD;bt.freeBuffer=function(t){Qu[pa.log2(t.length)].push(t)};bt.malloc=function(t,r){if(r===void 0||r==="arraybuffer")return yr(t);switch(r){case"uint8":return Nh(t);case"uint16":return aD(t);case"uint32":return oD(t);case"int8":return sD(t);case"int16":return lD(t);case"int32":return uD(t);case"float":case"float32":return cD(t);case"double":case"float64":return dD(t);case"uint8_clamped":return fD(t);case"bigint64":return mD(t);case"biguint64":return hD(t);case"buffer":return gD(t);case"data":case"dataview":return pD(t);default:return null}return null};function yr(t){var t=pa.nextPow2(t),r=pa.log2(t),n=Zu[r];return n.length>0?n.pop():new ArrayBuffer(t)}bt.mallocArrayBuffer=yr;function Nh(e){return new Uint8Array(yr(e),0,e)}bt.mallocUint8=Nh;function aD(e){return new Uint16Array(yr(2*e),0,e)}bt.mallocUint16=aD;function oD(e){return new Uint32Array(yr(4*e),0,e)}bt.mallocUint32=oD;function sD(e){return new Int8Array(yr(e),0,e)}bt.mallocInt8=sD;function lD(e){return new Int16Array(yr(2*e),0,e)}bt.mallocInt16=lD;function uD(e){return new Int32Array(yr(4*e),0,e)}bt.mallocInt32=uD;function cD(e){return new Float32Array(yr(4*e),0,e)}bt.mallocFloat32=bt.mallocFloat=cD;function dD(e){return new Float64Array(yr(8*e),0,e)}bt.mallocFloat64=bt.mallocDouble=dD;function fD(e){return PO?new Uint8ClampedArray(yr(e),0,e):Nh(e)}bt.mallocUint8Clamped=fD;function hD(e){return NO?new BigUint64Array(yr(8*e),0,e):null}bt.mallocBigUint64=hD;function mD(e){return RO?new BigInt64Array(yr(8*e),0,e):null}bt.mallocBigInt64=mD;function pD(e){return new DataView(yr(e),0,e)}bt.mallocDataView=pD;function gD(e){e=pa.nextPow2(e);var t=pa.log2(e),r=Qu[t];return r.length>0?r.pop():new rD(e)}bt.mallocBuffer=gD;bt.clearCache=function(){for(var t=0;t<32;++t)Sn.UINT8[t].length=0,Sn.UINT16[t].length=0,Sn.UINT32[t].length=0,Sn.INT8[t].length=0,Sn.INT16[t].length=0,Sn.INT32[t].length=0,Sn.FLOAT[t].length=0,Sn.DOUBLE[t].length=0,Sn.BIGUINT64[t].length=0,Sn.BIGINT64[t].length=0,Sn.UINT8C[t].length=0,Zu[t].length=0,Qu[t].length=0}});var DD=wn((dW,bD)=>{"use strict";bD.exports=BO;var tc=32;function BO(e,t){t<=4*tc?nc(0,t-1,e):rc(0,t-1,e)}function nc(e,t,r){for(var n=2*(e+1),i=e+1;i<=t;++i){for(var a=r[n++],o=r[n++],s=i,u=n-2;s-- >e;){var l=r[u-2],c=r[u-1];if(lr[t+1]:!0}function ec(e,t,r,n){e*=2;var i=n[e];return i>1,s=o-n,u=o+n,l=i,c=s,d=o,m=u,h=a,g=e+1,y=t-1,v=0;Yi(l,c,r)&&(v=l,l=c,c=v),Yi(m,h,r)&&(v=m,m=h,h=v),Yi(l,d,r)&&(v=l,l=d,d=v),Yi(c,d,r)&&(v=c,c=d,d=v),Yi(l,m,r)&&(v=l,l=m,m=v),Yi(d,m,r)&&(v=d,d=m,m=v),Yi(c,h,r)&&(v=c,c=h,h=v),Yi(c,d,r)&&(v=c,c=d,d=v),Yi(m,h,r)&&(v=m,m=h,h=v);for(var D=r[2*c],I=r[2*c+1],C=r[2*m],x=r[2*m+1],O=2*l,A=2*d,P=2*h,B=2*i,G=2*o,J=2*a,Q=0;Q<2;++Q){var oe=r[O+Q],te=r[A+Q],re=r[P+Q];r[B+Q]=oe,r[G+Q]=te,r[J+Q]=re}vD(s,e,r),vD(u,t,r);for(var ne=g;ne<=y;++ne)if(ec(ne,D,I,r))ne!==g&&yD(ne,g,r),++g;else if(!ec(ne,C,x,r))for(;;)if(ec(y,C,x,r)){ec(y,D,I,r)?(VO(ne,g,y,r),++g,--y):(yD(ne,y,r),--y);break}else{if(--y{"use strict";SD.exports={init:UO,sweepBipartite:WO,sweepComplete:YO,scanBipartite:zO,scanComplete:KO};var En=Xu(),$O=Wu(),ic=DD(),Fr=1<<28,Qa=1024,Yn=En.mallocInt32(Qa),zi=En.mallocInt32(Qa),Ki=En.mallocInt32(Qa),Za=En.mallocInt32(Qa),Uo=En.mallocInt32(Qa),ul=En.mallocInt32(Qa),dt=En.mallocDouble(Qa*8);function UO(e){var t=$O.nextPow2(e);Yn.length>>1;ic(dt,I);for(var C=0,x=0,g=0;g=Fr)O=O-Fr|0,Wo(Ki,Za,x--,O);else if(O>=0)Wo(Yn,zi,C--,O);else if(O<=-Fr){O=-O-Fr|0;for(var A=0;A>>1;ic(dt,I);for(var C=0,x=0,O=0,g=0;g>1===dt[2*g+3]>>1&&(P=2,g+=1),A<0){for(var B=-(A>>1)-1,G=0;G>1)-1;P===0?Wo(Yn,zi,C--,B):P===1?Wo(Ki,Za,x--,B):P===2&&Wo(Uo,ul,O--,B)}}}function zO(e,t,r,n,i,a,o,s,u,l,c,d){var m=0,h=2*e,g=t,y=t+e,v=1,D=1;n?D=Fr:v=Fr;for(var I=i;I>>1;ic(dt,A);for(var P=0,I=0;I=Fr?(G=!n,C-=Fr):(G=!!n,C-=1),G)Yo(Yn,zi,P++,C);else{var J=d[C],Q=h*C,oe=c[Q+t+1],te=c[Q+t+1+e];e:for(var re=0;re>>1;ic(dt,C);for(var x=0,y=0;y=Fr)Yn[x++]=v-Fr;else{v-=1;var A=c[v],P=m*v,B=l[P+t+1],G=l[P+t+1+e];e:for(var J=0;J=0;--J)if(Yn[J]===v){for(var re=J+1;re{"use strict";var Xa="d",jo="ax",ED="vv",Hh="fp",cl="es",ac="rs",Uh="re",dl="rb",kD="ri",zo="rp",oc="bs",Wh="be",fl="bb",xD="bi",Ko="bp",Bh="rv",Vh="Q",$h=[Xa,jo,ED,ac,Uh,dl,kD,oc,Wh,fl,xD];function jO(e,t,r){var n="bruteForce"+(e?"Red":"Blue")+(t?"Flip":"")+(r?"Full":""),i=["function ",n,"(",$h.join(),"){","var ",cl,"=2*",Xa,";"],a="for(var i="+ac+","+zo+"="+cl+"*"+ac+";i<"+Uh+";++i,"+zo+"+="+cl+"){var x0="+dl+"["+jo+"+"+zo+"],x1="+dl+"["+jo+"+"+zo+"+"+Xa+"],xi="+kD+"[i];",o="for(var j="+oc+","+Ko+"="+cl+"*"+oc+";j<"+Wh+";++j,"+Ko+"+="+cl+"){var y0="+fl+"["+jo+"+"+Ko+"],"+(r?"y1="+fl+"["+jo+"+"+Ko+"+"+Xa+"],":"")+"yi="+xD+"[j];";return e?i.push(a,Vh,":",o):i.push(o,Vh,":",a),r?i.push("if(y1"+Wh+"-"+oc+"){"),e?(a(!0,!1),i.push("}else{"),a(!1,!1)):(i.push("if("+Hh+"){"),a(!0,!0),i.push("}else{"),a(!0,!1),i.push("}}else{if("+Hh+"){"),a(!1,!0),i.push("}else{"),a(!1,!1),i.push("}")),i.push("}}return "+t);var o=r.join("")+i.join(""),s=new Function(o);return s()}Yh.partial=CD(!1);Yh.full=CD(!0)});var zh=wn((mW,MD)=>{"use strict";MD.exports=GO;var qO="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m";function GO(e,t){var r="abcdef".split("").concat(t),n=[];return e.indexOf("lo")>=0&&n.push("lo=e[k+n]"),e.indexOf("hi")>=0&&n.push("hi=e[k+o]"),r.push(qO.replace("_",n.join()).replace("$",e)),Function.apply(void 0,r)}});var ID=wn((pW,FD)=>{"use strict";FD.exports=XO;var JO=zh(),TD=JO("lor&&i[d+t]>l;--c,d-=o){for(var m=d,h=d+o,g=0;g>>1,l=2*e,c=u,d=i[l*u+t];o=v?(c=y,d=v):g>=I?(c=h,d=g):(c=D,d=I):v>=I?(c=y,d=v):I>=g?(c=h,d=g):(c=D,d=I);for(var O=l*(s-1),A=l*c,C=0;C{"use strict";RD.exports=fL;var qo=Xu(),Kh=Wu(),PD=_D(),eL=PD.partial,tL=PD.full,ga=Rh(),nL=ID(),Go=zh(),AD=128,rL=1<<22,iL=1<<22,aL=Go("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),OD=Go("lo===p0",["p0"]),oL=Go("lo0;){l-=1;var m=l*jh,h=dr[m],g=dr[m+1],y=dr[m+2],v=dr[m+3],D=dr[m+4],I=dr[m+5],C=l*qh,x=eo[C],O=eo[C+1],A=I&1,P=!!(I&16),B=i,G=a,J=s,Q=u;if(A&&(B=s,G=u,J=i,Q=a),!(I&2&&(y=oL(e,h,g,y,B,G,O),g>=y))&&!(I&4&&(g=sL(e,h,g,y,B,G,x),g>=y))){var oe=y-g,te=D-v;if(P){if(e*oe*(oe+te){"use strict";$D.exports=yL;var ya=Xu(),sc=Rh(),hL=HD();function mL(e,t){for(var r=0;r>>1;if(!(o<=0)){var s,u=ya.mallocDouble(2*o*i),l=ya.mallocInt32(i);if(i=BD(e,o,u,l),i>0){if(o===1&&n)sc.init(i),s=sc.sweepComplete(o,r,0,i,u,l,0,i,u,l);else{var c=ya.mallocDouble(2*o*a),d=ya.mallocInt32(a);a=BD(t,o,c,d),a>0&&(sc.init(i+a),o===1?s=sc.sweepBipartite(o,r,0,i,u,l,0,a,c,d):s=hL(o,r,n,i,u,l,a,c,d),ya.free(c),ya.free(d))}ya.free(u),ya.free(l)}return s}}}var hl;function VD(e,t){hl.push([e,t])}function pL(e){return hl=[],lc(e,e,VD,!0),hl}function gL(e,t){return hl=[],lc(e,t,VD,!1),hl}function yL(e,t,r){var n;switch(arguments.length){case 1:return pL(e);case 2:return typeof t=="function"?lc(e,e,t,!0):gL(e,t);case 3:return lc(e,t,r,!1);default:throw new Error("box-intersect: Invalid arguments")}}});var o0=wn(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});var on=require("obsidian"),Zh="YYYY-MM-DD",Qh="gggg-[W]ww",jD="YYYY-MM",qD="YYYY-[Q]Q",GD="YYYY";function pl(e){var r,n;let t=window.app.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r[e])==null?void 0:n.enabled)}function gl(){var e,t,r,n;try{let{internalPlugins:i,plugins:a}=window.app;if(pl("daily")){let{format:l,folder:c,template:d}=((t=(e=a.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.daily)||{};return{format:l||Zh,folder:(c==null?void 0:c.trim())||"",template:(d==null?void 0:d.trim())||""}}let{folder:o,format:s,template:u}=((n=(r=i.getPluginById("daily-notes"))==null?void 0:r.instance)==null?void 0:n.options)||{};return{format:s||Zh,folder:(o==null?void 0:o.trim())||"",template:(u==null?void 0:u.trim())||""}}catch(i){console.info("No custom daily note settings found!",i)}}function yl(){var e,t,r,n,i,a,o;try{let s=window.app.plugins,u=(e=s.getPlugin("calendar"))==null?void 0:e.options,l=(r=(t=s.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:r.weekly;if(pl("weekly"))return{format:l.format||Qh,folder:((n=l.folder)==null?void 0:n.trim())||"",template:((i=l.template)==null?void 0:i.trim())||""};let c=u||{};return{format:c.weeklyNoteFormat||Qh,folder:((a=c.weeklyNoteFolder)==null?void 0:a.trim())||"",template:((o=c.weeklyNoteTemplate)==null?void 0:o.trim())||""}}catch(s){console.info("No custom weekly note settings found!",s)}}function vl(){var t,r,n,i;let e=window.app.plugins;try{let a=pl("monthly")&&((r=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:r.monthly)||{};return{format:a.format||jD,folder:((n=a.folder)==null?void 0:n.trim())||"",template:((i=a.template)==null?void 0:i.trim())||""}}catch(a){console.info("No custom monthly note settings found!",a)}}function wl(){var t,r,n,i;let e=window.app.plugins;try{let a=pl("quarterly")&&((r=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:r.quarterly)||{};return{format:a.format||qD,folder:((n=a.folder)==null?void 0:n.trim())||"",template:((i=a.template)==null?void 0:i.trim())||""}}catch(a){console.info("No custom quarterly note settings found!",a)}}function bl(){var t,r,n,i;let e=window.app.plugins;try{let a=pl("yearly")&&((r=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:r.yearly)||{};return{format:a.format||GD,folder:((n=a.folder)==null?void 0:n.trim())||"",template:((i=a.template)==null?void 0:i.trim())||""}}catch(a){console.info("No custom yearly note settings found!",a)}}function JD(...e){let t=[];for(let n=0,i=e.length;n{let I=n(),C=e.clone().set({hour:I.get("hour"),minute:I.get("minute"),second:I.get("second")});return g&&C.add(parseInt(y,10),v),D?C.format(D.substring(1).trim()):C.format(a)}).replace(/{{\s*yesterday\s*}}/gi,e.clone().subtract(1,"day").format(a)).replace(/{{\s*tomorrow\s*}}/gi,e.clone().add(1,"d").format(a)));return t.foldManager.save(d,u),d}catch(d){console.error(`Failed to create file: '${c}'`,d),new on.Notice("Unable to create new file.")}}function AL(e,t){var r;return(r=t[ni(e,"day")])!=null?r:null}function OL(){let{vault:e}=window.app,{folder:t}=gl(),r=e.getAbstractFileByPath(on.normalizePath(t));if(!r)throw new Xh("Failed to find daily notes folder");let n={};return on.Vault.recurseChildren(r,i=>{if(i instanceof on.TFile){let a=Zo(i,"day");if(a){let o=ni(a,"day");n[o]=i}}}),n}var em=class extends Error{};function LL(){let{moment:e}=window,t=e.localeData()._week.dow,r=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)r.push(r.shift()),t--;return r}function PL(e){return LL().indexOf(e.toLowerCase())}async function e0(e){let{vault:t}=window.app,{template:r,format:n,folder:i}=yl(),[a,o]=await Jo(r),s=e.format(n),u=await Dl(i,s);try{let l=await t.create(u,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(c,d,m,h,g,y)=>{let v=window.moment(),D=e.clone().set({hour:v.get("hour"),minute:v.get("minute"),second:v.get("second")});return m&&D.add(parseInt(h,10),g),y?D.format(y.substring(1).trim()):D.format(n)}).replace(/{{\s*title\s*}}/gi,s).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(c,d,m)=>{let h=PL(d);return e.weekday(h).format(m.trim())}));return window.app.foldManager.save(l,o),l}catch(l){console.error(`Failed to create file: '${u}'`,l),new on.Notice("Unable to create new file.")}}function NL(e,t){var r;return(r=t[ni(e,"week")])!=null?r:null}function RL(){let e={};if(!n0())return e;let{vault:t}=window.app,{folder:r}=yl(),n=t.getAbstractFileByPath(on.normalizePath(r));if(!n)throw new em("Failed to find weekly notes folder");return on.Vault.recurseChildren(n,i=>{if(i instanceof on.TFile){let a=Zo(i,"week");if(a){let o=ni(a,"week");e[o]=i}}}),e}var tm=class extends Error{};async function t0(e){let{vault:t}=window.app,{template:r,format:n,folder:i}=vl(),[a,o]=await Jo(r),s=e.format(n),u=await Dl(i,s);try{let l=await t.create(u,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(c,d,m,h,g,y)=>{let v=window.moment(),D=e.clone().set({hour:v.get("hour"),minute:v.get("minute"),second:v.get("second")});return m&&D.add(parseInt(h,10),g),y?D.format(y.substring(1).trim()):D.format(n)}).replace(/{{\s*date\s*}}/gi,s).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,s));return window.app.foldManager.save(l,o),l}catch(l){console.error(`Failed to create file: '${u}'`,l),new on.Notice("Unable to create new file.")}}function HL(e,t){var r;return(r=t[ni(e,"month")])!=null?r:null}function BL(){let e={};if(!r0())return e;let{vault:t}=window.app,{folder:r}=vl(),n=t.getAbstractFileByPath(on.normalizePath(r));if(!n)throw new tm("Failed to find monthly notes folder");return on.Vault.recurseChildren(n,i=>{if(i instanceof on.TFile){let a=Zo(i,"month");if(a){let o=ni(a,"month");e[o]=i}}}),e}var nm=class extends Error{};async function VL(e){let{vault:t}=window.app,{template:r,format:n,folder:i}=wl(),[a,o]=await Jo(r),s=e.format(n),u=await Dl(i,s);try{let l=await t.create(u,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(c,d,m,h,g,y)=>{let v=window.moment(),D=e.clone().set({hour:v.get("hour"),minute:v.get("minute"),second:v.get("second")});return m&&D.add(parseInt(h,10),g),y?D.format(y.substring(1).trim()):D.format(n)}).replace(/{{\s*date\s*}}/gi,s).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,s));return window.app.foldManager.save(l,o),l}catch(l){console.error(`Failed to create file: '${u}'`,l),new on.Notice("Unable to create new file.")}}function $L(e,t){var r;return(r=t[ni(e,"quarter")])!=null?r:null}function UL(){let e={};if(!i0())return e;let{vault:t}=window.app,{folder:r}=wl(),n=t.getAbstractFileByPath(on.normalizePath(r));if(!n)throw new nm("Failed to find quarterly notes folder");return on.Vault.recurseChildren(n,i=>{if(i instanceof on.TFile){let a=Zo(i,"quarter");if(a){let o=ni(a,"quarter");e[o]=i}}}),e}var rm=class extends Error{};async function WL(e){let{vault:t}=window.app,{template:r,format:n,folder:i}=bl(),[a,o]=await Jo(r),s=e.format(n),u=await Dl(i,s);try{let l=await t.create(u,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(c,d,m,h,g,y)=>{let v=window.moment(),D=e.clone().set({hour:v.get("hour"),minute:v.get("minute"),second:v.get("second")});return m&&D.add(parseInt(h,10),g),y?D.format(y.substring(1).trim()):D.format(n)}).replace(/{{\s*date\s*}}/gi,s).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,s));return window.app.foldManager.save(l,o),l}catch(l){console.error(`Failed to create file: '${u}'`,l),new on.Notice("Unable to create new file.")}}function YL(e,t){var r;return(r=t[ni(e,"year")])!=null?r:null}function zL(){let e={};if(!a0())return e;let{vault:t}=window.app,{folder:r}=bl(),n=t.getAbstractFileByPath(on.normalizePath(r));if(!n)throw new rm("Failed to find yearly notes folder");return on.Vault.recurseChildren(n,i=>{if(i instanceof on.TFile){let a=Zo(i,"year");if(a){let o=ni(a,"year");e[o]=i}}}),e}function KL(){var n,i;let{app:e}=window,t=e.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let r=e.plugins.getPlugin("periodic-notes");return r&&((i=(n=r.settings)==null?void 0:n.daily)==null?void 0:i.enabled)}function n0(){var r,n;let{app:e}=window;if(e.plugins.getPlugin("calendar"))return!0;let t=e.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r.weekly)==null?void 0:n.enabled)}function r0(){var r,n;let{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r.monthly)==null?void 0:n.enabled)}function i0(){var r,n;let{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r.quarterly)==null?void 0:n.enabled)}function a0(){var r,n;let{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r.yearly)==null?void 0:n.enabled)}function jL(e){let t={day:gl,week:yl,month:vl,quarter:wl,year:bl}[e];return t()}function qL(e,t){return{day:XD,month:t0,week:e0}[e](t)}gt.DEFAULT_DAILY_NOTE_FORMAT=Zh;gt.DEFAULT_MONTHLY_NOTE_FORMAT=jD;gt.DEFAULT_QUARTERLY_NOTE_FORMAT=qD;gt.DEFAULT_WEEKLY_NOTE_FORMAT=Qh;gt.DEFAULT_YEARLY_NOTE_FORMAT=GD;gt.appHasDailyNotesPluginLoaded=KL;gt.appHasMonthlyNotesPluginLoaded=r0;gt.appHasQuarterlyNotesPluginLoaded=i0;gt.appHasWeeklyNotesPluginLoaded=n0;gt.appHasYearlyNotesPluginLoaded=a0;gt.createDailyNote=XD;gt.createMonthlyNote=t0;gt.createPeriodicNote=qL;gt.createQuarterlyNote=VL;gt.createWeeklyNote=e0;gt.createYearlyNote=WL;gt.getAllDailyNotes=OL;gt.getAllMonthlyNotes=BL;gt.getAllQuarterlyNotes=UL;gt.getAllWeeklyNotes=RL;gt.getAllYearlyNotes=zL;gt.getDailyNote=AL;gt.getDailyNoteSettings=gl;gt.getDateFromFile=Zo;gt.getDateFromPath=IL;gt.getDateUID=ni;gt.getMonthlyNote=HL;gt.getMonthlyNoteSettings=vl;gt.getPeriodicNoteSettings=jL;gt.getQuarterlyNote=$L;gt.getQuarterlyNoteSettings=wl;gt.getTemplateInfo=Jo;gt.getWeeklyNote=NL;gt.getWeeklyNoteSettings=yl;gt.getYearlyNote=YL;gt.getYearlyNoteSettings=bl});var Ic=wn(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});require("obsidian");var qi=class extends Error{},fm=class extends qi{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}},hm=class extends qi{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}},mm=class extends qi{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}},ro=class extends qi{},yc=class extends qi{constructor(t){super(`Invalid unit ${t}`)}},vr=class extends qi{},Di=class extends qi{constructor(){super("Zone is an abstract class")}},_e="numeric",oi="short",Or="long",vc={year:_e,month:_e,day:_e},H0={year:_e,month:oi,day:_e},GL={year:_e,month:oi,day:_e,weekday:oi},B0={year:_e,month:Or,day:_e},V0={year:_e,month:Or,day:_e,weekday:Or},$0={hour:_e,minute:_e},U0={hour:_e,minute:_e,second:_e},W0={hour:_e,minute:_e,second:_e,timeZoneName:oi},Y0={hour:_e,minute:_e,second:_e,timeZoneName:Or},z0={hour:_e,minute:_e,hourCycle:"h23"},K0={hour:_e,minute:_e,second:_e,hourCycle:"h23"},j0={hour:_e,minute:_e,second:_e,hourCycle:"h23",timeZoneName:oi},q0={hour:_e,minute:_e,second:_e,hourCycle:"h23",timeZoneName:Or},G0={year:_e,month:_e,day:_e,hour:_e,minute:_e},J0={year:_e,month:_e,day:_e,hour:_e,minute:_e,second:_e},Z0={year:_e,month:oi,day:_e,hour:_e,minute:_e},Q0={year:_e,month:oi,day:_e,hour:_e,minute:_e,second:_e},JL={year:_e,month:oi,day:_e,weekday:oi,hour:_e,minute:_e},X0={year:_e,month:Or,day:_e,hour:_e,minute:_e,timeZoneName:oi},eS={year:_e,month:Or,day:_e,hour:_e,minute:_e,second:_e,timeZoneName:oi},tS={year:_e,month:Or,day:_e,weekday:Or,hour:_e,minute:_e,timeZoneName:Or},nS={year:_e,month:Or,day:_e,weekday:Or,hour:_e,minute:_e,second:_e,timeZoneName:Or},oo=class{get type(){throw new Di}get name(){throw new Di}get ianaName(){return this.name}get isUniversal(){throw new Di}offsetName(t,r){throw new Di}formatOffset(t,r){throw new Di}offset(t){throw new Di}equals(t){throw new Di}get isValid(){throw new Di}},im=null,wc=class e extends oo{static get instance(){return im===null&&(im=new e),im}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:r,locale:n}){return iS(t,r,n)}formatOffset(t,r){return _l(this.offset(t),r)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}},pc={};function ZL(e){return pc[e]||(pc[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),pc[e]}var QL={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function XL(e,t){let r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,i,a,o,s,u,l,c]=n;return[o,i,a,s,u,l,c]}function e2(e,t){let r=e.formatToParts(t),n=[];for(let i=0;i=0?g:1e3+g,(m-h)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},s0={};function t2(e,t={}){let r=JSON.stringify([e,t]),n=s0[r];return n||(n=new Intl.ListFormat(e,t),s0[r]=n),n}var pm={};function gm(e,t={}){let r=JSON.stringify([e,t]),n=pm[r];return n||(n=new Intl.DateTimeFormat(e,t),pm[r]=n),n}var ym={};function n2(e,t={}){let r=JSON.stringify([e,t]),n=ym[r];return n||(n=new Intl.NumberFormat(e,t),ym[r]=n),n}var vm={};function r2(e,t={}){let{base:r,...n}=t,i=JSON.stringify([e,n]),a=vm[i];return a||(a=new Intl.RelativeTimeFormat(e,t),vm[i]=a),a}var xl=null;function i2(){return xl||(xl=new Intl.DateTimeFormat().resolvedOptions().locale,xl)}function a2(e){let t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));let r=e.indexOf("-u-");if(r===-1)return[e];{let n,i;try{n=gm(e).resolvedOptions(),i=e}catch(s){let u=e.substring(0,r);n=gm(u).resolvedOptions(),i=u}let{numberingSystem:a,calendar:o}=n;return[i,a,o]}}function o2(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}function s2(e){let t=[];for(let r=1;r<=12;r++){let n=mt.utc(2009,r,1);t.push(e(n))}return t}function l2(e){let t=[];for(let r=1;r<=7;r++){let n=mt.utc(2016,11,13+r);t.push(e(n))}return t}function cc(e,t,r,n){let i=e.listingMode();return i==="error"?null:i==="en"?r(t):n(t)}function u2(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}var wm=class{constructor(t,r,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:i,floor:a,...o}=n;if(!r||Object.keys(o).length>0){let s={useGrouping:!1,...n};n.padTo>0&&(s.minimumIntegerDigits=n.padTo),this.inf=n2(t,s)}}format(t){if(this.inf){let r=this.floor?Math.floor(t):t;return this.inf.format(r)}else{let r=this.floor?Math.floor(t):Om(t,3);return Tn(r,this.padTo)}}},bm=class{constructor(t,r,n){this.opts=n,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){let o=-1*(t.offset/60),s=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&Da.create(s).valid?(i=s,this.dt=t):(i="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);let a={...this.opts};a.timeZone=a.timeZone||i,this.dtf=gm(r,a)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(r=>{if(r.type==="timeZoneName"){let n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:n}}else return r}):t}resolvedOptions(){return this.dtf.resolvedOptions()}},Dm=class{constructor(t,r,n){this.opts={style:"long",...n},!r&&rS()&&(this.rtf=r2(t,n))}format(t,r){return this.rtf?this.rtf.format(t,r):x2(r,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,r){return this.rtf?this.rtf.formatToParts(t,r):[]}},mn=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,r,n,i=!1){let a=t||hn.defaultLocale,o=a||(i?"en-US":i2()),s=r||hn.defaultNumberingSystem,u=n||hn.defaultOutputCalendar;return new e(o,s,u,a)}static resetCache(){xl=null,pm={},ym={},vm={}}static fromObject({locale:t,numberingSystem:r,outputCalendar:n}={}){return e.create(t,r,n)}constructor(t,r,n,i){let[a,o,s]=a2(t);this.locale=a,this.numberingSystem=r||o||null,this.outputCalendar=n||s||null,this.intl=o2(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=u2(this)),this.fastNumbersCached}listingMode(){let t=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&r?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,r=!1){return cc(this,t,sS,()=>{let n=r?{month:t,day:"numeric"}:{month:t},i=r?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=s2(a=>this.extract(a,n,"month"))),this.monthsCache[i][t]})}weekdays(t,r=!1){return cc(this,t,cS,()=>{let n=r?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},i=r?"format":"standalone";return this.weekdaysCache[i][t]||(this.weekdaysCache[i][t]=l2(a=>this.extract(a,n,"weekday"))),this.weekdaysCache[i][t]})}meridiems(){return cc(this,void 0,()=>dS,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[mt.utc(2016,11,13,9),mt.utc(2016,11,13,19)].map(r=>this.extract(r,t,"dayperiod"))}return this.meridiemCache})}eras(t){return cc(this,t,fS,()=>{let r={era:t};return this.eraCache[t]||(this.eraCache[t]=[mt.utc(-40,1,1),mt.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[t]})}extract(t,r,n){let i=this.dtFormatter(t,r),a=i.formatToParts(),o=a.find(s=>s.type.toLowerCase()===n);return o?o.value:null}numberFormatter(t={}){return new wm(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,r={}){return new bm(t,this.intl,r)}relFormatter(t={}){return new Dm(this.intl,this.isEnglish(),t)}listFormatter(t={}){return t2(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}},am=null,Kr=class e extends oo{static get utcInstance(){return am===null&&(am=new e(0)),am}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let r=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new e(Tc(r[1],r[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${_l(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${_l(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,r){return _l(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}},Sm=class extends oo{constructor(t){super(),this.zoneName=t}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 ba(e,t){if(kt(e)||e===null)return t;if(e instanceof oo)return e;if(c2(e)){let r=e.toLowerCase();return r==="default"?t:r==="local"||r==="system"?wc.instance:r==="utc"||r==="gmt"?Kr.utcInstance:Kr.parseSpecifier(r)||Da.create(e)}else return ao(e)?Kr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Sm(e)}var l0=()=>Date.now(),u0="system",c0=null,d0=null,f0=null,h0=60,m0,hn=class{static get now(){return l0}static set now(t){l0=t}static set defaultZone(t){u0=t}static get defaultZone(){return ba(u0,wc.instance)}static get defaultLocale(){return c0}static set defaultLocale(t){c0=t}static get defaultNumberingSystem(){return d0}static set defaultNumberingSystem(t){d0=t}static get defaultOutputCalendar(){return f0}static set defaultOutputCalendar(t){f0=t}static get twoDigitCutoffYear(){return h0}static set twoDigitCutoffYear(t){h0=t%100}static get throwOnInvalid(){return m0}static set throwOnInvalid(t){m0=t}static resetCaches(){mn.resetCache(),Da.resetCache()}};function kt(e){return typeof e=="undefined"}function ao(e){return typeof e=="number"}function _c(e){return typeof e=="number"&&e%1===0}function c2(e){return typeof e=="string"}function d2(e){return Object.prototype.toString.call(e)==="[object Date]"}function rS(){try{return typeof Intl!="undefined"&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function f2(e){return Array.isArray(e)?e:[e]}function p0(e,t,r){if(e.length!==0)return e.reduce((n,i)=>{let a=[t(i),i];return n&&r(n[0],a[0])===n[0]?n:a},null)[1]}function h2(e,t){return t.reduce((r,n)=>(r[n]=e[n],r),{})}function rs(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ji(e,t,r){return _c(e)&&e>=t&&e<=r}function m2(e,t){return e-t*Math.floor(e/t)}function Tn(e,t=2){let r=e<0,n;return r?n="-"+(""+-e).padStart(t,"0"):n=(""+e).padStart(t,"0"),n}function wa(e){if(!(kt(e)||e===null||e===""))return parseInt(e,10)}function to(e){if(!(kt(e)||e===null||e===""))return parseFloat(e)}function Am(e){if(!(kt(e)||e===null||e==="")){let t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Om(e,t,r=!1){let n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function Fl(e){return e%4===0&&(e%100!==0||e%400===0)}function Cl(e){return Fl(e)?366:365}function bc(e,t){let r=m2(t-1,12)+1,n=e+(t-r)/12;return r===2?Fl(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function Mc(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Dc(e){let t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,r=e-1,n=(r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400))%7;return t===4||n===3?53:52}function Em(e){return e>99?e:e>hn.twoDigitCutoffYear?1900+e:2e3+e}function iS(e,t,r,n=null){let i=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(a.timeZone=n);let o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(r,o).formatToParts(i).find(u=>u.type.toLowerCase()==="timezonename");return s?s.value:null}function Tc(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);let n=parseInt(t,10)||0,i=r<0||Object.is(r,-0)?-n:n;return r*60+i}function aS(e){let t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new vr(`Invalid unit value ${e}`);return t}function Sc(e,t){let r={};for(let n in e)if(rs(e,n)){let i=e[n];if(i==null)continue;r[t(n)]=aS(i)}return r}function _l(e,t){let r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Tn(r,2)}:${Tn(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${Tn(r,2)}${Tn(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Fc(e){return h2(e,["hour","minute","second","millisecond"])}var p2=["January","February","March","April","May","June","July","August","September","October","November","December"],oS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g2=["J","F","M","A","M","J","J","A","S","O","N","D"];function sS(e){switch(e){case"narrow":return[...g2];case"short":return[...oS];case"long":return[...p2];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}}var lS=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],uS=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],y2=["M","T","W","T","F","S","S"];function cS(e){switch(e){case"narrow":return[...y2];case"short":return[...uS];case"long":return[...lS];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var dS=["AM","PM"],v2=["Before Christ","Anno Domini"],w2=["BC","AD"],b2=["B","A"];function fS(e){switch(e){case"narrow":return[...b2];case"short":return[...w2];case"long":return[...v2];default:return null}}function D2(e){return dS[e.hour<12?0:1]}function S2(e,t){return cS(t)[e.weekday-1]}function E2(e,t){return sS(t)[e.month-1]}function k2(e,t){return fS(t)[e.year<0?0:1]}function x2(e,t,r="always",n=!1){let i={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."]},a=["hours","minutes","seconds"].indexOf(e)===-1;if(r==="auto"&&a){let d=e==="days";switch(t){case 1:return d?"tomorrow":`next ${i[e][0]}`;case-1:return d?"yesterday":`last ${i[e][0]}`;case 0:return d?"today":`this ${i[e][0]}`}}let o=Object.is(t,-0)||t<0,s=Math.abs(t),u=s===1,l=i[e],c=n?u?l[1]:l[2]||l[1]:u?i[e][0]:e;return o?`${s} ${c} ago`:`in ${s} ${c}`}function g0(e,t){let r="";for(let n of e)n.literal?r+=n.val:r+=t(n.val);return r}var C2={D:vc,DD:H0,DDD:B0,DDDD:V0,t:$0,tt:U0,ttt:W0,tttt:Y0,T:z0,TT:K0,TTT:j0,TTTT:q0,f:G0,ff:Z0,fff:X0,ffff:tS,F:J0,FF:Q0,FFF:eS,FFFF:nS},Ir=class e{static create(t,r={}){return new e(t,r)}static parseFormat(t){let r=null,n="",i=!1,a=[];for(let o=0;o0&&a.push({literal:i||/^\s+$/.test(n),val:n}),r=null,n="",i=!i):i||s===r?n+=s:(n.length>0&&a.push({literal:/^\s+$/.test(n),val:n}),n=s,r=s)}return n.length>0&&a.push({literal:i||/^\s+$/.test(n),val:n}),a}static macroTokenToFormatOpts(t){return C2[t]}constructor(t,r){this.opts=r,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...r}).format()}dtFormatter(t,r={}){return this.loc.dtFormatter(t,{...this.opts,...r})}formatDateTime(t,r){return this.dtFormatter(t,r).format()}formatDateTimeParts(t,r){return this.dtFormatter(t,r).formatToParts()}formatInterval(t,r){return this.dtFormatter(t.start,r).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,r){return this.dtFormatter(t,r).resolvedOptions()}num(t,r=0){if(this.opts.forceSimple)return Tn(t,r);let n={...this.opts};return r>0&&(n.padTo=r),this.loc.numberFormatter(n).format(t)}formatDateTimeFromString(t,r){let n=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(h,g)=>this.loc.extract(t,h,g),o=h=>t.isOffsetFixed&&t.offset===0&&h.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,h.format):"",s=()=>n?D2(t):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(h,g)=>n?E2(t,h):a(g?{month:h}:{month:h,day:"numeric"},"month"),l=(h,g)=>n?S2(t,h):a(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),c=h=>{let g=e.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(t,g):h},d=h=>n?k2(t,h):a({era:h},"era"),m=h=>{switch(h){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.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 t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return s();case"d":return i?a({day:"numeric"},"day"):this.num(t.day);case"dd":return i?a({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return i?a({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?a({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return i?a({month:"numeric"},"month"):this.num(t.month);case"MM":return i?a({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return i?a({year:"numeric"},"year"):this.num(t.year);case"yy":return i?a({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?a({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?a({year:"numeric"},"year"):this.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(h)}};return g0(e.parseFormat(r),m)}formatDurationFromString(t,r){let n=u=>{switch(u[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}},i=u=>l=>{let c=n(l);return c?this.num(u.get(c),l.length):l},a=e.parseFormat(r),o=a.reduce((u,{literal:l,val:c})=>l?u:u.concat(c),[]),s=t.shiftTo(...o.map(n).filter(u=>u));return g0(a,i(s))}},Ar=class{constructor(t,r){this.reason=t,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},hS=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function is(...e){let t=e.reduce((r,n)=>r+n.source,"");return RegExp(`^${t}$`)}function as(...e){return t=>e.reduce(([r,n,i],a)=>{let[o,s,u]=a(t,i);return[{...r,...o},s||n,u]},[{},null,1]).slice(0,2)}function os(e,...t){if(e==null)return[null,null];for(let[r,n]of t){let i=r.exec(e);if(i)return n(i)}return[null,null]}function mS(...e){return(t,r)=>{let n={},i;for(i=0;ih!==void 0&&(g||h&&c)?-h:h;return[{years:m(to(r)),months:m(to(n)),weeks:m(to(i)),days:m(to(a)),hours:m(to(o)),minutes:m(to(s)),seconds:m(to(u),u==="-0"),milliseconds:m(Am(l),d)}]}var B2={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 Nm(e,t,r,n,i,a,o){let s={year:t.length===2?Em(wa(t)):wa(t),month:oS.indexOf(r)+1,day:wa(n),hour:wa(i),minute:wa(a)};return o&&(s.second=wa(o)),e&&(s.weekday=e.length>3?lS.indexOf(e)+1:uS.indexOf(e)+1),s}var V2=/^(?:(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 $2(e){let[,t,r,n,i,a,o,s,u,l,c,d]=e,m=Nm(t,i,n,r,a,o,s),h;return u?h=B2[u]:l?h=0:h=Tc(c,d),[m,new Kr(h)]}function U2(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var W2=/^(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$/,Y2=/^(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$/,z2=/^(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 y0(e){let[,t,r,n,i,a,o,s]=e;return[Nm(t,i,n,r,a,o,s),Kr.utcInstance]}function K2(e){let[,t,r,n,i,a,o,s]=e;return[Nm(t,s,r,n,i,a,o),Kr.utcInstance]}var j2=is(M2,Pm),q2=is(T2,Pm),G2=is(F2,Pm),J2=is(gS),vS=as(P2,ss,Il,Al),Z2=as(I2,ss,Il,Al),Q2=as(A2,ss,Il,Al),X2=as(ss,Il,Al);function eP(e){return os(e,[j2,vS],[q2,Z2],[G2,Q2],[J2,X2])}function tP(e){return os(U2(e),[V2,$2])}function nP(e){return os(e,[W2,y0],[Y2,y0],[z2,K2])}function rP(e){return os(e,[R2,H2])}var iP=as(ss);function aP(e){return os(e,[N2,iP])}var oP=is(O2,L2),sP=is(yS),lP=as(ss,Il,Al);function uP(e){return os(e,[oP,vS],[sP,lP])}var v0="Invalid Duration",wS={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}},cP={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},...wS},Yr=146097/400,Qo=146097/4800,dP={years:{quarters:4,months:12,weeks:Yr/7,days:Yr,hours:Yr*24,minutes:Yr*24*60,seconds:Yr*24*60*60,milliseconds:Yr*24*60*60*1e3},quarters:{months:3,weeks:Yr/28,days:Yr/4,hours:Yr*24/4,minutes:Yr*24*60/4,seconds:Yr*24*60*60/4,milliseconds:Yr*24*60*60*1e3/4},months:{weeks:Qo/7,days:Qo,hours:Qo*24,minutes:Qo*24*60,seconds:Qo*24*60*60,milliseconds:Qo*24*60*60*1e3},...wS},io=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],fP=io.slice(0).reverse();function va(e,t,r=!1){let n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new He(n)}function bS(e,t){var n;let r=(n=t.milliseconds)!=null?n:0;for(let i of fP.slice(1))t[i]&&(r+=t[i]*e[i].milliseconds);return r}function w0(e,t){let r=bS(e,t)<0?-1:1;io.reduceRight((n,i)=>{if(kt(t[i]))return n;if(n){let a=t[n]*r,o=e[i][n],s=Math.floor(a/o);t[i]+=s*r,t[n]-=s*o*r}return i},null),io.reduce((n,i)=>{if(kt(t[i]))return n;if(n){let a=t[n]%1;t[n]-=a,t[i]+=a*e[n][i]}return i},null)}function hP(e){let t={};for(let[r,n]of Object.entries(e))n!==0&&(t[r]=n);return t}var He=class e{constructor(t){let r=t.conversionAccuracy==="longterm"||!1,n=r?dP:cP;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||mn.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,r){return e.fromObject({milliseconds:t},r)}static fromObject(t,r={}){if(t==null||typeof t!="object")throw new vr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new e({values:Sc(t,e.normalizeUnit),loc:mn.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(t){if(ao(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t=="object")return e.fromObject(t);throw new vr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,r){let[n]=rP(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,r){let[n]=aP(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,r=null){if(!t)throw new vr("need to specify a reason the Duration is invalid");let n=t instanceof Ar?t:new Ar(t,r);if(hn.throwOnInvalid)throw new mm(n);return new e({invalid:n})}static normalizeUnit(t){let r={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"}[t&&t.toLowerCase()];if(!r)throw new yc(t);return r}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,r={}){let n={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Ir.create(this.loc,n).formatDurationFromString(this,t):v0}toHuman(t={}){if(!this.isValid)return v0;let r=io.map(n=>{let i=this.values[n];return kt(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:n.slice(0,-1)}).format(i)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Om(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;let r=this.toMillis();return r<0||r>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},mt.fromMillis(r,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.isValid?bS(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t),n={};for(let i of io)(rs(r.values,i)||rs(this.values,i))&&(n[i]=r.get(i)+this.get(i));return va(this,{values:n},!0)}minus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t);return this.plus(r.negate())}mapUnits(t){if(!this.isValid)return this;let r={};for(let n of Object.keys(this.values))r[n]=aS(t(this.values[n],n));return va(this,{values:r},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let r={...this.values,...Sc(t,e.normalizeUnit)};return va(this,{values:r})}reconfigure({locale:t,numberingSystem:r,conversionAccuracy:n,matrix:i}={}){let o={loc:this.loc.clone({locale:t,numberingSystem:r}),matrix:i,conversionAccuracy:n};return va(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return w0(this.matrix,t),va(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=hP(this.normalize().shiftToAll().toObject());return va(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>e.normalizeUnit(o));let r={},n={},i=this.toObject(),a;for(let o of io)if(t.indexOf(o)>=0){a=o;let s=0;for(let l in n)s+=this.matrix[l][o]*n[l],n[l]=0;ao(i[o])&&(s+=i[o]);let u=Math.trunc(s);r[o]=u,n[o]=(s*1e3-u*1e3)/1e3}else ao(i[o])&&(n[o]=i[o]);for(let o in n)n[o]!==0&&(r[a]+=o===a?n[o]:n[o]/this.matrix[a][o]);return w0(this.matrix,r),va(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let t={};for(let r of Object.keys(this.values))t[r]=this.values[r]===0?0:-this.values[r];return va(this,{values:t},!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(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function r(n,i){return n===void 0||n===0?i===void 0||i===0:n===i}for(let n of io)if(!r(this.values[n],t.values[n]))return!1;return!0}},Xo="Invalid Interval";function mP(e,t){return!e||!e.isValid?ns.invalid("missing or invalid start"):!t||!t.isValid?ns.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:r}={}){return this.isValid?e.fromDateTimes(t||this.s,r||this.e):this}splitAt(...t){if(!this.isValid)return[];let r=t.map(El).filter(o=>this.contains(o)).sort(),n=[],{s:i}=this,a=0;for(;i+this.e?this.e:o;n.push(e.fromDateTimes(i,s)),i=s,a+=1}return n}splitBy(t){let r=He.fromDurationLike(t);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:n}=this,i=1,a,o=[];for(;nu*i));a=+s>+this.e?this.e:s,o.push(e.fromDateTimes(n,a)),n=a,i+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;let r=this.s>t.s?this.s:t.s,n=this.e=n?null:e.fromDateTimes(r,n)}union(t){if(!this.isValid)return this;let r=this.st.e?this.e:t.e;return e.fromDateTimes(r,n)}static merge(t){let[r,n]=t.sort((i,a)=>i.s-a.s).reduce(([i,a],o)=>a?a.overlaps(o)||a.abutsStart(o)?[i,a.union(o)]:[i.concat([a]),o]:[i,o],[[],null]);return n&&r.push(n),r}static xor(t){let r=null,n=0,i=[],a=t.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),o=Array.prototype.concat(...a),s=o.sort((u,l)=>u.time-l.time);for(let u of s)n+=u.type==="s"?1:-1,n===1?r=u.time:(r&&+r!=+u.time&&i.push(e.fromDateTimes(r,u.time)),r=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Xo}toLocaleString(t=vc,r={}){return this.isValid?Ir.create(this.s.loc.clone(r),t).formatInterval(this):Xo}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Xo}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Xo}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Xo}toFormat(t,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${r}${this.e.toFormat(t)}`:Xo}toDuration(t,r){return this.isValid?this.e.diff(this.s,t,r):He.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}},es=class{static hasDST(t=hn.defaultZone){let r=mt.now().setZone(t).set({month:12});return!t.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(t){return Da.isValidZone(t)}static normalizeZone(t){return ba(t,hn.defaultZone)}static months(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||mn.create(r,n,a)).months(t)}static monthsFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||mn.create(r,n,a)).months(t,!0)}static weekdays(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||mn.create(r,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||mn.create(r,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return mn.create(t).meridiems()}static eras(t="short",{locale:r=null}={}){return mn.create(r,null,"gregory").eras(t)}static features(){return{relative:rS()}}};function b0(e,t){let r=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(He.fromMillis(n).as("days"))}function pP(e,t,r){let n=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{let c=b0(u,l);return(c-c%7)/7}],["days",b0]],i={},a=e,o,s;for(let[u,l]of n)r.indexOf(u)>=0&&(o=u,i[u]=l(e,t),s=a.plus(i),s>t?(i[u]--,e=a.plus(i),e>t&&(s=e,i[u]--,e=a.plus(i))):e=s);return[e,i,s,o]}function gP(e,t,r,n){let[i,a,o,s]=pP(e,t,r),u=t-i,l=r.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);l.length===0&&(o0?He.fromMillis(u,n).shiftTo(...l).plus(c):c}var Rm={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"},D0={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]},yP=Rm.hanidec.replace(/[\[|\]]/g,"").split("");function vP(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r=a&&n<=o&&(t+=n-a)}}return parseInt(t,10)}else return t}function ri({numberingSystem:e},t=""){return new RegExp(`${Rm[e||"latn"]}${t}`)}var wP="missing Intl.DateTimeFormat.formatToParts support";function Nt(e,t=r=>r){return{regex:e,deser:([r])=>t(vP(r))}}var bP="\xA0",DS=`[ ${bP}]`,SS=new RegExp(DS,"g");function DP(e){return e.replace(/\./g,"\\.?").replace(SS,DS)}function S0(e){return e.replace(/\./g,"").replace(SS," ").toLowerCase()}function ii(e,t){return e===null?null:{regex:RegExp(e.map(DP).join("|")),deser:([r])=>e.findIndex(n=>S0(r)===S0(n))+t}}function E0(e,t){return{regex:e,deser:([,r,n])=>Tc(r,n),groups:t}}function dc(e){return{regex:e,deser:([t])=>t}}function SP(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function EP(e,t){let r=ri(t),n=ri(t,"{2}"),i=ri(t,"{3}"),a=ri(t,"{4}"),o=ri(t,"{6}"),s=ri(t,"{1,2}"),u=ri(t,"{1,3}"),l=ri(t,"{1,6}"),c=ri(t,"{1,9}"),d=ri(t,"{2,4}"),m=ri(t,"{4,6}"),h=v=>({regex:RegExp(SP(v.val)),deser:([D])=>D,literal:!0}),y=(v=>{if(e.literal)return h(v);switch(v.val){case"G":return ii(t.eras("short"),0);case"GG":return ii(t.eras("long"),0);case"y":return Nt(l);case"yy":return Nt(d,Em);case"yyyy":return Nt(a);case"yyyyy":return Nt(m);case"yyyyyy":return Nt(o);case"M":return Nt(s);case"MM":return Nt(n);case"MMM":return ii(t.months("short",!0),1);case"MMMM":return ii(t.months("long",!0),1);case"L":return Nt(s);case"LL":return Nt(n);case"LLL":return ii(t.months("short",!1),1);case"LLLL":return ii(t.months("long",!1),1);case"d":return Nt(s);case"dd":return Nt(n);case"o":return Nt(u);case"ooo":return Nt(i);case"HH":return Nt(n);case"H":return Nt(s);case"hh":return Nt(n);case"h":return Nt(s);case"mm":return Nt(n);case"m":return Nt(s);case"q":return Nt(s);case"qq":return Nt(n);case"s":return Nt(s);case"ss":return Nt(n);case"S":return Nt(u);case"SSS":return Nt(i);case"u":return dc(c);case"uu":return dc(s);case"uuu":return Nt(r);case"a":return ii(t.meridiems(),0);case"kkkk":return Nt(a);case"kk":return Nt(d,Em);case"W":return Nt(s);case"WW":return Nt(n);case"E":case"c":return Nt(r);case"EEE":return ii(t.weekdays("short",!1),1);case"EEEE":return ii(t.weekdays("long",!1),1);case"ccc":return ii(t.weekdays("short",!0),1);case"cccc":return ii(t.weekdays("long",!0),1);case"Z":case"ZZ":return E0(new RegExp(`([+-]${s.source})(?::(${n.source}))?`),2);case"ZZZ":return E0(new RegExp(`([+-]${s.source})(${n.source})?`),2);case"z":return dc(/[a-z_+-/]{1,256}?/i);case" ":return dc(/[^\S\n\r]/);default:return h(v)}})(e)||{invalidReason:wP};return y.token=e,y}var kP={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",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function xP(e,t,r){let{type:n,value:i}=e;if(n==="literal"){let u=/^\s+$/.test(i);return{literal:!u,val:u?" ":i}}let a=t[n],o=n;n==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=r.hour12?"hour12":"hour24");let s=kP[o];if(typeof s=="object"&&(s=s[a]),s)return{literal:!1,val:s}}function CP(e){return[`^${e.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,e]}function _P(e,t,r){let n=e.match(t);if(n){let i={},a=1;for(let o in r)if(rs(r,o)){let s=r[o],u=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(n.slice(a,a+u))),a+=u}return[n,i]}else return[n,{}]}function MP(e){let t=a=>{switch(a){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}},r=null,n;return kt(e.z)||(r=Da.create(e.z)),kt(e.Z)||(r||(r=new Kr(e.Z)),n=e.Z),kt(e.q)||(e.M=(e.q-1)*3+1),kt(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),kt(e.u)||(e.S=Am(e.u)),[Object.keys(e).reduce((a,o)=>{let s=t(o);return s&&(a[s]=e[o]),a},{}),r,n]}var om=null;function TP(){return om||(om=mt.fromMillis(1555555555555)),om}function FP(e,t){if(e.literal)return e;let r=Ir.macroTokenToFormatOpts(e.val),n=xS(r,t);return n==null||n.includes(void 0)?e:n}function ES(e,t){return Array.prototype.concat(...e.map(r=>FP(r,t)))}function kS(e,t,r){let n=ES(Ir.parseFormat(r),e),i=n.map(o=>EP(o,e)),a=i.find(o=>o.invalidReason);if(a)return{input:t,tokens:n,invalidReason:a.invalidReason};{let[o,s]=CP(i),u=RegExp(o,"i"),[l,c]=_P(t,u,s),[d,m,h]=c?MP(c):[null,null,void 0];if(rs(c,"a")&&rs(c,"H"))throw new ro("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:n,regex:u,rawMatches:l,matches:c,result:d,zone:m,specificOffset:h}}}function IP(e,t,r){let{result:n,zone:i,specificOffset:a,invalidReason:o}=kS(e,t,r);return[n,i,a,o]}function xS(e,t){if(!e)return null;let n=Ir.create(t,e).dtFormatter(TP()),i=n.formatToParts(),a=n.resolvedOptions();return i.map(o=>xP(o,e,a))}var CS=[0,31,59,90,120,151,181,212,243,273,304,334],_S=[0,31,60,91,121,152,182,213,244,274,305,335];function zr(e,t){return new Ar("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function MS(e,t,r){let n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);let i=n.getUTCDay();return i===0?7:i}function TS(e,t,r){return r+(Fl(e)?_S:CS)[t-1]}function FS(e,t){let r=Fl(e)?_S:CS,n=r.findIndex(a=>aDc(t)?(s=t+1,o=1):s=t,{weekYear:s,weekNumber:o,weekday:a,...Fc(e)}}function k0(e){let{weekYear:t,weekNumber:r,weekday:n}=e,i=MS(t,1,4),a=Cl(t),o=r*7+n-i-3,s;o<1?(s=t-1,o+=Cl(s)):o>a?(s=t+1,o-=Cl(t)):s=t;let{month:u,day:l}=FS(s,o);return{year:s,month:u,day:l,...Fc(e)}}function sm(e){let{year:t,month:r,day:n}=e,i=TS(t,r,n);return{year:t,ordinal:i,...Fc(e)}}function x0(e){let{year:t,ordinal:r}=e,{month:n,day:i}=FS(t,r);return{year:t,month:n,day:i,...Fc(e)}}function AP(e){let t=_c(e.weekYear),r=ji(e.weekNumber,1,Dc(e.weekYear)),n=ji(e.weekday,1,7);return t?r?n?!1:zr("weekday",e.weekday):zr("week",e.week):zr("weekYear",e.weekYear)}function OP(e){let t=_c(e.year),r=ji(e.ordinal,1,Cl(e.year));return t?r?!1:zr("ordinal",e.ordinal):zr("year",e.year)}function IS(e){let t=_c(e.year),r=ji(e.month,1,12),n=ji(e.day,1,bc(e.year,e.month));return t?r?n?!1:zr("day",e.day):zr("month",e.month):zr("year",e.year)}function AS(e){let{hour:t,minute:r,second:n,millisecond:i}=e,a=ji(t,0,23)||t===24&&r===0&&n===0&&i===0,o=ji(r,0,59),s=ji(n,0,59),u=ji(i,0,999);return a?o?s?u?!1:zr("millisecond",i):zr("second",n):zr("minute",r):zr("hour",t)}var lm="Invalid DateTime",C0=864e13;function fc(e){return new Ar("unsupported zone",`the zone "${e.name}" is not supported`)}function um(e){return e.weekData===null&&(e.weekData=km(e.c)),e.weekData}function no(e,t){let r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new mt({...r,...t,old:r})}function OS(e,t,r){let n=e-t*60*1e3,i=r.offset(n);if(t===i)return[n,t];n-=(i-t)*60*1e3;let a=r.offset(n);return i===a?[n,i]:[e-Math.min(i,a)*60*1e3,Math.max(i,a)]}function hc(e,t){e+=t*60*1e3;let r=new Date(e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function gc(e,t,r){return OS(Mc(e),t,r)}function _0(e,t){let r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,a={...e.c,year:n,month:i,day:Math.min(e.c.day,bc(n,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=He.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=Mc(a),[u,l]=OS(s,r,e.zone);return o!==0&&(u+=o,l=e.zone.offset(u)),{ts:u,o:l}}function Sl(e,t,r,n,i,a){let{setZone:o,zone:s}=r;if(e&&Object.keys(e).length!==0||t){let u=t||s,l=mt.fromObject(e,{...r,zone:u,specificOffset:a});return o?l:l.setZone(s)}else return mt.invalid(new Ar("unparsable",`the input "${i}" can't be parsed as ${n}`))}function mc(e,t,r=!0){return e.isValid?Ir.create(mn.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function cm(e,t){let r=e.c.year>9999||e.c.year<0,n="";return r&&e.c.year>=0&&(n+="+"),n+=Tn(e.c.year,r?6:4),t?(n+="-",n+=Tn(e.c.month),n+="-",n+=Tn(e.c.day)):(n+=Tn(e.c.month),n+=Tn(e.c.day)),n}function M0(e,t,r,n,i,a){let o=Tn(e.c.hour);return t?(o+=":",o+=Tn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(o+=":")):o+=Tn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(o+=Tn(e.c.second),(e.c.millisecond!==0||!n)&&(o+=".",o+=Tn(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!a?o+="Z":e.o<0?(o+="-",o+=Tn(Math.trunc(-e.o/60)),o+=":",o+=Tn(Math.trunc(-e.o%60))):(o+="+",o+=Tn(Math.trunc(e.o/60)),o+=":",o+=Tn(Math.trunc(e.o%60)))),a&&(o+="["+e.zone.ianaName+"]"),o}var LS={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},LP={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},PP={ordinal:1,hour:0,minute:0,second:0,millisecond:0},PS=["year","month","day","hour","minute","second","millisecond"],NP=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],RP=["year","ordinal","hour","minute","second","millisecond"];function T0(e){let t={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"}[e.toLowerCase()];if(!t)throw new yc(e);return t}function F0(e,t){let r=ba(t.zone,hn.defaultZone),n=mn.fromObject(t),i=hn.now(),a,o;if(kt(e.year))a=i;else{for(let l of PS)kt(e[l])&&(e[l]=LS[l]);let s=IS(e)||AS(e);if(s)return mt.invalid(s);let u=r.offset(i);[a,o]=gc(e,u,r)}return new mt({ts:a,zone:r,loc:n,o})}function I0(e,t,r){let n=kt(r.round)?!0:r.round,i=(o,s)=>(o=Om(o,n||r.calendary?0:2,!0),t.loc.clone(r).relFormatter(r).format(o,s)),a=o=>r.calendary?t.hasSame(e,o)?0:t.startOf(o).diff(e.startOf(o),o).get(o):t.diff(e,o).get(o);if(r.unit)return i(a(r.unit),r.unit);for(let o of r.units){let s=a(o);if(Math.abs(s)>=1)return i(s,o)}return i(e>t?-0:0,r.units[r.units.length-1])}function A0(e){let t={},r;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],r=Array.from(e).slice(0,e.length-1)):r=Array.from(e),[t,r]}var mt=class e{constructor(t){let r=t.zone||hn.defaultZone,n=t.invalid||(Number.isNaN(t.ts)?new Ar("invalid input"):null)||(r.isValid?null:fc(r));this.ts=kt(t.ts)?hn.now():t.ts;let i=null,a=null;if(!n)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(r))[i,a]=[t.old.c,t.old.o];else{let s=r.offset(this.ts);i=hc(this.ts,s),n=Number.isNaN(i.year)?new Ar("invalid input"):null,i=n?null:i,a=n?null:s}this._zone=r,this.loc=t.loc||mn.create(),this.invalid=n,this.weekData=null,this.c=i,this.o=a,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[t,r]=A0(arguments),[n,i,a,o,s,u,l]=r;return F0({year:n,month:i,day:a,hour:o,minute:s,second:u,millisecond:l},t)}static utc(){let[t,r]=A0(arguments),[n,i,a,o,s,u,l]=r;return t.zone=Kr.utcInstance,F0({year:n,month:i,day:a,hour:o,minute:s,second:u,millisecond:l},t)}static fromJSDate(t,r={}){let n=d2(t)?t.valueOf():NaN;if(Number.isNaN(n))return e.invalid("invalid input");let i=ba(r.zone,hn.defaultZone);return i.isValid?new e({ts:n,zone:i,loc:mn.fromObject(r)}):e.invalid(fc(i))}static fromMillis(t,r={}){if(ao(t))return t<-C0||t>C0?e.invalid("Timestamp out of range"):new e({ts:t,zone:ba(r.zone,hn.defaultZone),loc:mn.fromObject(r)});throw new vr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,r={}){if(ao(t))return new e({ts:t*1e3,zone:ba(r.zone,hn.defaultZone),loc:mn.fromObject(r)});throw new vr("fromSeconds requires a numerical input")}static fromObject(t,r={}){t=t||{};let n=ba(r.zone,hn.defaultZone);if(!n.isValid)return e.invalid(fc(n));let i=hn.now(),a=kt(r.specificOffset)?n.offset(i):r.specificOffset,o=Sc(t,T0),s=!kt(o.ordinal),u=!kt(o.year),l=!kt(o.month)||!kt(o.day),c=u||l,d=o.weekYear||o.weekNumber,m=mn.fromObject(r);if((c||s)&&d)throw new ro("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new ro("Can't mix ordinal dates with month/day");let h=d||o.weekday&&!c,g,y,v=hc(i,a);h?(g=NP,y=LP,v=km(v)):s?(g=RP,y=PP,v=sm(v)):(g=PS,y=LS);let D=!1;for(let B of g){let G=o[B];kt(G)?D?o[B]=y[B]:o[B]=v[B]:D=!0}let I=h?AP(o):s?OP(o):IS(o),C=I||AS(o);if(C)return e.invalid(C);let x=h?k0(o):s?x0(o):o,[O,A]=gc(x,a,n),P=new e({ts:O,zone:n,o:A,loc:m});return o.weekday&&c&&t.weekday!==P.weekday?e.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${P.toISO()}`):P}static fromISO(t,r={}){let[n,i]=eP(t);return Sl(n,i,r,"ISO 8601",t)}static fromRFC2822(t,r={}){let[n,i]=tP(t);return Sl(n,i,r,"RFC 2822",t)}static fromHTTP(t,r={}){let[n,i]=nP(t);return Sl(n,i,r,"HTTP",r)}static fromFormat(t,r,n={}){if(kt(t)||kt(r))throw new vr("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:a=null}=n,o=mn.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),[s,u,l,c]=IP(o,t,r);return c?e.invalid(c):Sl(s,u,n,`format ${r}`,t,l)}static fromString(t,r,n={}){return e.fromFormat(t,r,n)}static fromSQL(t,r={}){let[n,i]=uP(t);return Sl(n,i,r,"SQL",t)}static invalid(t,r=null){if(!t)throw new vr("need to specify a reason the DateTime is invalid");let n=t instanceof Ar?t:new Ar(t,r);if(hn.throwOnInvalid)throw new fm(n);return new e({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,r={}){let n=xS(t,mn.fromObject(r));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(t,r={}){return ES(Ir.parseFormat(t),mn.fromObject(r)).map(i=>i.val).join("")}get(t){return this[t]}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?um(this).weekYear:NaN}get weekNumber(){return this.isValid?um(this).weekNumber:NaN}get weekday(){return this.isValid?um(this).weekday:NaN}get ordinal(){return this.isValid?sm(this.c).ordinal:NaN}get monthShort(){return this.isValid?es.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?es.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?es.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?es.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}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let t=864e5,r=6e4,n=Mc(this.c),i=this.zone.offset(n-t),a=this.zone.offset(n+t),o=this.zone.offset(n-i*r),s=this.zone.offset(n-a*r);if(o===s)return[this];let u=n-o*r,l=n-s*r,c=hc(u,o),d=hc(l,s);return c.hour===d.hour&&c.minute===d.minute&&c.second===d.second&&c.millisecond===d.millisecond?[no(this,{ts:u}),no(this,{ts:l})]:[this]}get isInLeapYear(){return Fl(this.year)}get daysInMonth(){return bc(this.year,this.month)}get daysInYear(){return this.isValid?Cl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Dc(this.weekYear):NaN}resolvedLocaleOptions(t={}){let{locale:r,numberingSystem:n,calendar:i}=Ir.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:i}}toUTC(t=0,r={}){return this.setZone(Kr.instance(t),r)}toLocal(){return this.setZone(hn.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(t=ba(t,hn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(r||n){let a=t.offset(this.ts),o=this.toObject();[i]=gc(o,a,t)}return no(this,{ts:i,zone:t})}else return e.invalid(fc(t))}reconfigure({locale:t,numberingSystem:r,outputCalendar:n}={}){let i=this.loc.clone({locale:t,numberingSystem:r,outputCalendar:n});return no(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let r=Sc(t,T0),n=!kt(r.weekYear)||!kt(r.weekNumber)||!kt(r.weekday),i=!kt(r.ordinal),a=!kt(r.year),o=!kt(r.month)||!kt(r.day),s=a||o,u=r.weekYear||r.weekNumber;if((s||i)&&u)throw new ro("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&i)throw new ro("Can't mix ordinal dates with month/day");let l;n?l=k0({...km(this.c),...r}):kt(r.ordinal)?(l={...this.toObject(),...r},kt(r.day)&&(l.day=Math.min(bc(l.year,l.month),l.day))):l=x0({...sm(this.c),...r});let[c,d]=gc(l,this.o,this.zone);return no(this,{ts:c,o:d})}plus(t){if(!this.isValid)return this;let r=He.fromDurationLike(t);return no(this,_0(this,r))}minus(t){if(!this.isValid)return this;let r=He.fromDurationLike(t).negate();return no(this,_0(this,r))}startOf(t){if(!this.isValid)return this;let r={},n=He.normalizeUnit(t);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(n==="weeks"&&(r.weekday=1),n==="quarters"){let i=Math.ceil(this.month/3);r.month=(i-1)*3+1}return this.set(r)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,r={}){return this.isValid?Ir.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,t):lm}toLocaleString(t=vc,r={}){return this.isValid?Ir.create(this.loc.clone(r),t).formatDateTime(this):lm}toLocaleParts(t={}){return this.isValid?Ir.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:r=!1,suppressMilliseconds:n=!1,includeOffset:i=!0,extendedZone:a=!1}={}){if(!this.isValid)return null;let o=t==="extended",s=cm(this,o);return s+="T",s+=M0(this,o,r,n,i,a),s}toISODate({format:t="extended"}={}){return this.isValid?cm(this,t==="extended"):null}toISOWeekDate(){return mc(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:r=!1,includeOffset:n=!0,includePrefix:i=!1,extendedZone:a=!1,format:o="extended"}={}){return this.isValid?(i?"T":"")+M0(this,o==="extended",r,t,n,a):null}toRFC2822(){return mc(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return mc(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?cm(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:r=!1,includeOffsetSpace:n=!0}={}){let i="HH:mm:ss.SSS";return(r||t)&&(n&&(i+=" "),r?i+="z":t&&(i+="ZZ")),mc(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():lm}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(t={}){if(!this.isValid)return{};let r={...this.c};return t.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,r="milliseconds",n={}){if(!this.isValid||!t.isValid)return He.invalid("created by diffing an invalid DateTime");let i={locale:this.locale,numberingSystem:this.numberingSystem,...n},a=f2(r).map(He.normalizeUnit),o=t.valueOf()>this.valueOf(),s=o?this:t,u=o?t:this,l=gP(s,u,a,i);return o?l.negate():l}diffNow(t="milliseconds",r={}){return this.diff(e.now(),t,r)}until(t){return this.isValid?ns.fromDateTimes(this,t):this}hasSame(t,r){if(!this.isValid)return!1;let n=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(r)<=n&&n<=i.endOf(r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;let r=t.base||e.fromObject({},{zone:this.zone}),n=t.padding?thisr.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new vr("max requires all arguments be DateTimes");return p0(t,r=>r.valueOf(),Math.max)}static fromFormatExplain(t,r,n={}){let{locale:i=null,numberingSystem:a=null}=n,o=mn.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});return kS(o,t,r)}static fromStringExplain(t,r,n={}){return e.fromFormatExplain(t,r,n)}static get DATE_SHORT(){return vc}static get DATE_MED(){return H0}static get DATE_MED_WITH_WEEKDAY(){return GL}static get DATE_FULL(){return B0}static get DATE_HUGE(){return V0}static get TIME_SIMPLE(){return $0}static get TIME_WITH_SECONDS(){return U0}static get TIME_WITH_SHORT_OFFSET(){return W0}static get TIME_WITH_LONG_OFFSET(){return Y0}static get TIME_24_SIMPLE(){return z0}static get TIME_24_WITH_SECONDS(){return K0}static get TIME_24_WITH_SHORT_OFFSET(){return j0}static get TIME_24_WITH_LONG_OFFSET(){return q0}static get DATETIME_SHORT(){return G0}static get DATETIME_SHORT_WITH_SECONDS(){return J0}static get DATETIME_MED(){return Z0}static get DATETIME_MED_WITH_SECONDS(){return Q0}static get DATETIME_MED_WITH_WEEKDAY(){return JL}static get DATETIME_FULL(){return X0}static get DATETIME_FULL_WITH_SECONDS(){return eS}static get DATETIME_HUGE(){return tS}static get DATETIME_HUGE_WITH_SECONDS(){return nS}};function El(e){if(mt.isDateTime(e))return e;if(e&&e.valueOf&&ao(e.valueOf()))return mt.fromJSDate(e);if(e&&typeof e=="object")return mt.fromObject(e);throw new vr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}var Hm={renderNullAs:"\\-",taskCompletionTracking:!1,taskCompletionUseEmojiShorthand:!1,taskCompletionText:"completion",taskCompletionDateFormat:"yyyy-MM-dd",recursiveSubTaskCompletion:!1,warnOnEmptyResult:!0,refreshEnabled:!0,refreshInterval:2500,defaultDateFormat:"MMMM dd, yyyy",defaultDateTimeFormat:"h:mm a - MMMM dd, yyyy",maxRecursiveRenderDepth:4,tableIdColumnName:"File",tableGroupColumnName:"Group",showResultCount:!0},HP={allowHtml:!0};({...Hm,...HP});var xm=class e{constructor(t){ur(this,"value");ur(this,"successful");this.value=t,this.successful=!0}map(t){return new e(t(this.value))}flatMap(t){return t(this.value)}mapErr(t){return this}bimap(t,r){return this.map(t)}orElse(t){return this.value}cast(){return this}orElseThrow(t){return this.value}},Cm=class e{constructor(t){ur(this,"error");ur(this,"successful");this.error=t,this.successful=!1}map(t){return this}flatMap(t){return this}mapErr(t){return new e(t(this.error))}bimap(t,r){return this.mapErr(r)}orElse(t){return t}cast(){return this}orElseThrow(t){throw t?new Error(t(this.error)):new Error(""+this.error)}},Ec;(function(e){function t(a){return new xm(a)}e.success=t;function r(a){return new Cm(a)}e.failure=r;function n(a,o,s){return a.successful?o.successful?s(a.value,o.value):r(o.error):r(a.error)}e.flatMap2=n;function i(a,o,s){return n(a,o,(u,l)=>t(s(u,l)))}e.map2=i})(Ec||(Ec={}));var BP=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"||typeof window!="undefined"?window:typeof self!="undefined"?self:{},kc={exports:{}};kc.exports;(function(e,t){(function(r,n){e.exports=n()})(typeof self!="undefined"?self:BP,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,s){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:s})},i.r=function(a){Object.defineProperty(a,"__esModule",{value:!0})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=0)}([function(r,n,i){function a(L){if(!(this instanceof a))return new a(L);this._=L}var o=a.prototype;function s(L,K){for(var ee=0;ee>7),buf:function(de){var ve=u(function(ge,M,H,q){return ge.concat(H===q.length-1?Buffer.from([M,0]).readUInt16BE(0):q.readUInt16BE(H))},[],de);return Buffer.from(l(function(ge){return(ge<<1&65535)>>8},ve))}(ee.buf)}}),ee}function d(){return typeof Buffer!="undefined"}function m(){if(!d())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function h(L){m();var K=u(function(ve,ge){return ve+ge},0,L);if(K%8!=0)throw new Error("The bits ["+L.join(", ")+"] add up to "+K+" which is not an even number of bytes; the total should be divisible by 8");var ee,ue=K/8,de=(ee=function(ve){return ve>48},u(function(ve,ge){return ve||(ee(ge)?ge:ve)},null,L));if(de)throw new Error(de+" bit range requested exceeds 48 bit (6 byte) Number max.");return new a(function(ve,ge){var M=ue+ge;return M>ve.length?B(ge,ue.toString()+" bytes"):P(M,u(function(H,q){var ie=c(q,H.buf);return{coll:H.coll.concat(ie.v),buf:ie.buf}},{coll:[],buf:ve.slice(ge,M)},L).coll)})}function g(L,K){return new a(function(ee,ue){return m(),ue+K>ee.length?B(ue,K+" bytes for "+L):P(ue+K,ee.slice(ue,ue+K))})}function y(L,K){if(typeof(ee=K)!="number"||Math.floor(ee)!==ee||K<0||K>6)throw new Error(L+" requires integer length in range [0, 6].");var ee}function v(L){return y("uintBE",L),g("uintBE("+L+")",L).map(function(K){return K.readUIntBE(0,L)})}function D(L){return y("uintLE",L),g("uintLE("+L+")",L).map(function(K){return K.readUIntLE(0,L)})}function I(L){return y("intBE",L),g("intBE("+L+")",L).map(function(K){return K.readIntBE(0,L)})}function C(L){return y("intLE",L),g("intLE("+L+")",L).map(function(K){return K.readIntLE(0,L)})}function x(L){return L instanceof a}function O(L){return{}.toString.call(L)==="[object Array]"}function A(L){return d()&&Buffer.isBuffer(L)}function P(L,K){return{status:!0,index:L,value:K,furthest:-1,expected:[]}}function B(L,K){return O(K)||(K=[K]),{status:!1,index:-1,value:null,furthest:L,expected:K}}function G(L,K){if(!K||L.furthest>K.furthest)return L;var ee=L.furthest===K.furthest?function(ue,de){if(function(){if(a._supportsSet!==void 0)return a._supportsSet;var ae=typeof Set!="undefined";return a._supportsSet=ae,ae}()&&Array.from){for(var ve=new Set(ue),ge=0;ge=0;){if(ge in ee){ue=ee[ge].line,ve===0&&(ve=ee[ge].lineStart);break}(L.charAt(ge)===` +`||L.charAt(ge)==="\r"&&L.charAt(ge+1)!==` +`)&&(de++,ve===0&&(ve=ge+1)),ge--}var M=ue+de,H=K-ve;return ee[K]={line:M,lineStart:ve},{offset:K,line:M+1,column:H+1}}function oe(L){if(!x(L))throw new Error("not a parser: "+L)}function te(L,K){return typeof L=="string"?L.charAt(K):L[K]}function re(L){if(typeof L!="number")throw new Error("not a number: "+L)}function ne(L){if(typeof L!="function")throw new Error("not a function: "+L)}function be(L){if(typeof L!="string")throw new Error("not a string: "+L)}var pe=2,De=3,Ce=8,U=5*Ce,Je=4*Ce,it=" ";function N(L,K){return new Array(K+1).join(L)}function Ze(L,K,ee){var ue=K-L.length;return ue<=0?L:N(ee,ue)+L}function It(L,K,ee,ue){return{from:L-K>0?L-K:0,to:L+ee>ue?ue:L+ee}}function Mt(L,K){var ee,ue,de,ve,ge,M=K.index,H=M.offset,q=1;if(H===L.length)return"Got the end of the input";if(A(L)){var ie=H-H%Ce,ye=H-ie,ce=It(ie,U,Je+Ce,L.length),ae=l(function(Te){return l(function(Ue){return Ze(Ue.toString(16),2,"0")},Te)},function(Te,Ue){var We=Te.length,Ft=[],Hn=0;if(We<=Ue)return[Te.slice()];for(var Ot=0;Ot=4&&(ee+=1),q=2,de=l(function(Te){return Te.length<=4?Te.join(" "):Te.slice(0,4).join(" ")+" "+Te.slice(4).join(" ")},ae),(ge=(8*(ve.to>0?ve.to-1:ve.to)).toString(16).length)<2&&(ge=2)}else{var Se=L.split(/\r\n|[\n\r\u2028\u2029]/);ee=M.column-1,ue=M.line-1,ve=It(ue,pe,De,Se.length),de=Se.slice(ve.from,ve.to),ge=ve.to.toString().length}var nt=ue-ve.from;return A(L)&&(ge=(8*(ve.to>0?ve.to-1:ve.to)).toString(16).length)<2&&(ge=2),u(function(Te,Ue,We){var Ft,Hn=We===nt,Ot=Hn?"> ":it;return Ft=A(L)?Ze((8*(ve.from+We)).toString(16),ge,"0"):Ze((ve.from+We+1).toString(),ge," "),[].concat(Te,[Ot+Ft+" | "+Ue],Hn?[it+N(" ",ge)+" | "+Ze("",ee," ")+N("^",q)]:[])},[],de).join(` +`)}function jt(L,K){return[` +`,"-- PARSING FAILED "+N("-",50),` + +`,Mt(L,K),` + +`,(ee=K.expected,ee.length===1?`Expected: + +`+ee[0]:`Expected one of the following: + +`+ee.join(", ")),` +`].join("");var ee}function vt(L){return L.flags!==void 0?L.flags:[L.global?"g":"",L.ignoreCase?"i":"",L.multiline?"m":"",L.unicode?"u":"",L.sticky?"y":""].join("")}function Wt(){for(var L=[].slice.call(arguments),K=L.length,ee=0;ee=2?re(K):K=0;var ee=function(de){return RegExp("^(?:"+de.source+")",vt(de))}(L),ue=""+L;return a(function(de,ve){var ge=ee.exec(de.slice(ve));if(ge){if(0<=K&&K<=ge.length){var M=ge[0],H=ge[K];return P(ve+M.length,H)}return B(ve,"valid match group (0 to "+ge.length+") in "+ue)}return B(ve,ue)})}function xn(L){return a(function(K,ee){return P(ee,L)})}function jn(L){return a(function(K,ee){return B(ee,L)})}function sn(L){if(x(L))return a(function(K,ee){var ue=L._(K,ee);return ue.index=ee,ue.value="",ue});if(typeof L=="string")return sn(yn(L));if(L instanceof RegExp)return sn(vn(L));throw new Error("not a string, regexp, or parser: "+L)}function Rt(L){return oe(L),a(function(K,ee){var ue=L._(K,ee),de=K.slice(ee,ue.index);return ue.status?B(ee,'not "'+de+'"'):P(ee,null)})}function Vt(L){return ne(L),a(function(K,ee){var ue=te(K,ee);return ee=L.length?B(K,"any character/byte"):P(K+1,te(L,K))}),rn=a(function(L,K){return P(L.length,L.slice(K))}),At=a(function(L,K){return K=0}).desc(K)},a.optWhitespace=Dt,a.Parser=a,a.range=function(L,K){return Vt(function(ee){return L<=ee&&ee<=K}).desc(L+"-"+K)},a.regex=vn,a.regexp=vn,a.sepBy=en,a.sepBy1=gn,a.seq=Wt,a.seqMap=Tt,a.seqObj=function(){for(var L,K={},ee=0,ue=(L=arguments,Array.prototype.slice.call(L)),de=ue.length,ve=0;ve255)throw new Error("Value specified to byte constructor ("+L+"=0x"+L.toString(16)+") is larger in value than a single byte.");var K=(L>15?"0x":"0x0")+L.toString(16);return a(function(ee,ue){var de=te(ee,ue);return de===L?P(ue+1,de):B(ue,K)})},buffer:function(L){return g("buffer",L).map(function(K){return Buffer.from(K)})},encodedString:function(L,K){return g("string",K).map(function(ee){return ee.toString(L)})},uintBE:v,uint8BE:v(1),uint16BE:v(2),uint32BE:v(4),uintLE:D,uint8LE:D(1),uint16LE:D(2),uint32LE:D(4),intBE:I,int8BE:I(1),int16BE:I(2),int32BE:I(4),intLE:C,int8LE:C(1),int16LE:C(2),int32LE:C(4),floatBE:g("floatBE",4).map(function(L){return L.readFloatBE(0)}),floatLE:g("floatLE",4).map(function(L){return L.readFloatLE(0)}),doubleBE:g("doubleBE",8).map(function(L){return L.readDoubleBE(0)}),doubleLE:g("doubleLE",8).map(function(L){return L.readDoubleLE(0)})},r.exports=a}])})})(kc,kc.exports);var W=kc.exports,Bm=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function NS(e){return e==null?e:e.shiftToAll().normalize()}function O0(e){return e.includes("/")&&(e=e.substring(e.lastIndexOf("/")+1)),e.endsWith(".md")&&(e=e.substring(0,e.length-3)),e}W.alt(W.regex(new RegExp(Bm(),"")),W.regex(/[0-9\p{Letter}_-]+/u).map(e=>e.toLocaleLowerCase()),W.whitespace.map(e=>"-"),W.any.map(e=>"")).many().map(e=>e.join(""));var VP=W.alt(W.regex(new RegExp(Bm(),"")),W.regex(/[0-9\p{Letter}_-]+/u),W.whitespace.map(e=>" "),W.any.map(e=>" ")).many().map(e=>e.join("").split(/\s+/).join(" ").trim());function $P(e){return VP.tryParse(e)}function UP(e){return e=NS(e),e=He.fromObject(Object.fromEntries(Object.entries(e.toObject()).filter(([,t])=>t!=0))),e.toHuman()}var Ml;(function(e){function t(x,O=Hm,A=!1){let P=r(x);if(!P)return O.renderNullAs;switch(P.type){case"null":return O.renderNullAs;case"string":return P.value;case"number":case"boolean":return""+P.value;case"html":return P.value.outerHTML;case"widget":return P.value.markdown();case"link":return P.value.markdown();case"function":return"";case"array":let B="";return A&&(B+="["),B+=P.value.map(G=>t(G,O,!0)).join(", "),A&&(B+="]"),B;case"object":return"{ "+Object.entries(P.value).map(G=>G[0]+": "+t(G[1],O,!0)).join(", ")+" }";case"date":return P.value.second==0&&P.value.hour==0&&P.value.minute==0?P.value.toFormat(O.defaultDateFormat):P.value.toFormat(O.defaultDateTimeFormat);case"duration":return UP(P.value)}}e.toString=t;function r(x){return m(x)?{type:"null",value:x}:l(x)?{type:"number",value:x}:u(x)?{type:"string",value:x}:g(x)?{type:"boolean",value:x}:d(x)?{type:"duration",value:x}:c(x)?{type:"date",value:x}:v(x)?{type:"widget",value:x}:h(x)?{type:"array",value:x}:y(x)?{type:"link",value:x}:C(x)?{type:"function",value:x}:D(x)?{type:"html",value:x}:I(x)?{type:"object",value:x}:void 0}e.wrapValue=r;function n(x,O){if(I(x)){let A={};for(let[P,B]of Object.entries(x))A[P]=n(B,O);return A}else if(h(x)){let A=[];for(let P of x)A.push(n(P,O));return A}else return O(x)}e.mapLeaves=n;function i(x,O,A){var G,J;if(x===void 0&&(x=null),O===void 0&&(O=null),x===null&&O===null)return 0;if(x===null)return-1;if(O===null)return 1;let P=r(x),B=r(O);if(P===void 0&&B===void 0)return 0;if(P===void 0)return-1;if(B===void 0)return 1;if(P.type!=B.type)return P.type.localeCompare(B.type);if(P.value===B.value)return 0;switch(P.type){case"string":return P.value.localeCompare(B.value);case"number":return P.valueN,re=te(Q.path).localeCompare(te(oe.path));if(re!=0)return re;let ne=Q.type.localeCompare(oe.type);return ne!=0?ne:Q.subpath&&!oe.subpath?1:!Q.subpath&&oe.subpath?-1:!Q.subpath&&!oe.subpath?0:((G=Q.subpath)!=null?G:"").localeCompare((J=oe.subpath)!=null?J:"");case"date":return P.value0;case"boolean":return O.value;case"link":return!!O.value.path;case"date":return O.value.toMillis()!=0;case"duration":return O.value.as("seconds")!=0;case"object":return Object.keys(O.value).length>0;case"array":return O.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}e.isTruthy=o;function s(x){if(x==null)return x;if(e.isArray(x))return[].concat(x.map(O=>s(O)));if(e.isObject(x)){let O={};for(let[A,P]of Object.entries(x))O[A]=s(P);return O}else return x}e.deepCopy=s;function u(x){return typeof x=="string"}e.isString=u;function l(x){return typeof x=="number"}e.isNumber=l;function c(x){return x instanceof mt}e.isDate=c;function d(x){return x instanceof He}e.isDuration=d;function m(x){return x==null}e.isNull=m;function h(x){return Array.isArray(x)}e.isArray=h;function g(x){return typeof x=="boolean"}e.isBoolean=g;function y(x){return x instanceof xc}e.isLink=y;function v(x){return x instanceof Tl}e.isWidget=v;function D(x){return typeof HTMLElement!="undefined"?x instanceof HTMLElement:!1}e.isHtml=D;function I(x){return typeof x=="object"&&!D(x)&&!v(x)&&!h(x)&&!d(x)&&!c(x)&&!y(x)&&x!==void 0&&!m(x)}e.isObject=I;function C(x){return typeof x=="function"}e.isFunction=C})(Ml||(Ml={}));var L0;(function(e){function t(i){return Ml.isObject(i)&&Object.keys(i).length==2&&"key"in i&&"rows"in i}e.isElementGroup=t;function r(i){for(let a of i)if(!t(a))return!1;return!0}e.isGrouping=r;function n(i){if(r(i)){let a=0;for(let o of i)a+=n(o.rows);return a}else return i.length}e.count=n})(L0||(L0={}));var xc=class e{constructor(t){ur(this,"path");ur(this,"display");ur(this,"subpath");ur(this,"embed");ur(this,"type");Object.assign(this,t)}static file(t,r=!1,n){return new e({path:t,embed:r,display:n,subpath:void 0,type:"file"})}static infer(t,r=!1,n){if(t.includes("#^")){let i=t.split("#^");return e.block(i[0],i[1],r,n)}else if(t.includes("#")){let i=t.split("#");return e.header(i[0],i[1],r,n)}else return e.file(t,r,n)}static header(t,r,n,i){return new e({path:t,embed:n,display:i,subpath:$P(r),type:"header"})}static block(t,r,n,i){return new e({path:t,embed:n,display:i,subpath:r,type:"block"})}static fromObject(t){return new e(t)}equals(t){return t==null||t==null?!1:this.path==t.path&&this.type==t.type&&this.subpath==t.subpath}toString(){return this.markdown()}toObject(){return{path:this.path,type:this.type,subpath:this.subpath,display:this.display,embed:this.embed}}withPath(t){return new e(Object.assign({},this,{path:t}))}withDisplay(t){return new e(Object.assign({},this,{display:t}))}withHeader(t){return e.header(this.path,t,this.embed,this.display)}toFile(){return e.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let t=new e(this);return t.embed=!0,t}}fromEmbed(){if(this.embed){let t=new e(this);return t.embed=!1,t}else return this}markdown(){let t=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?t+="|"+this.display:(t+="|"+O0(this.path),(this.type=="header"||this.type=="block")&&(t+=" > "+this.subpath)),t+="]]",t}obsidianLink(){var r,n;let t=this.path.replaceAll("|","\\|");return this.type=="header"?t+"#"+((r=this.subpath)==null?void 0:r.replaceAll("|","\\|")):this.type=="block"?t+"#^"+((n=this.subpath)==null?void 0:n.replaceAll("|","\\|")):t}fileName(){return O0(this.path).replace(".md","")}},Tl=class{constructor(t){ur(this,"$widget");this.$widget=t}},_m=class extends Tl{constructor(r,n){super("dataview:list-pair");ur(this,"key");ur(this,"value");this.key=r,this.value=n}markdown(){return`${Ml.toString(this.key)}: ${Ml.toString(this.value)}`}},Mm=class extends Tl{constructor(r,n){super("dataview:external-link");ur(this,"url");ur(this,"display");this.url=r,this.display=n}markdown(){var r;return`[${(r=this.display)!=null?r:this.url}](${this.url})`}},P0;(function(e){function t(o,s){return new _m(o,s)}e.listPair=t;function r(o,s){return new Mm(o,s)}e.externalLink=r;function n(o){return o.$widget==="dataview:list-pair"}e.isListPair=n;function i(o){return o.$widget==="dataview:external-link"}e.isExternalLink=i;function a(o){return n(o)||i(o)}e.isBuiltin=a})(P0||(P0={}));var fn;(function(e){function t(m){return{type:"variable",name:m}}e.variable=t;function r(m){return{type:"literal",value:m}}e.literal=r;function n(m,h,g){return{type:"binaryop",left:m,op:h,right:g}}e.binaryOp=n;function i(m,h){return{type:"index",object:m,index:h}}e.index=i;function a(m){let h=m.split("."),g=e.variable(h[0]);for(let y=1;y"||m==">="||m=="!="||m=="="}e.isCompareOp=d,e.NULL=e.literal(null)})(fn||(fn={}));var Si;(function(e){function t(c){return{type:"tag",tag:c}}e.tag=t;function r(c){return{type:"csv",path:c}}e.csv=r;function n(c){return{type:"folder",folder:c}}e.folder=n;function i(c,d){return{type:"link",file:c,direction:d?"incoming":"outgoing"}}e.link=i;function a(c,d,m){return{type:"binaryop",left:c,op:d,right:m}}e.binaryOp=a;function o(c,d){return{type:"binaryop",left:c,op:"&",right:d}}e.and=o;function s(c,d){return{type:"binaryop",left:c,op:"|",right:d}}e.or=s;function u(c){return{type:"negate",child:c}}e.negate=u;function l(){return{type:"empty"}}e.empty=l})(Si||(Si={}));var N0=new RegExp(Bm(),""),Tm={year:He.fromObject({years:1}),years:He.fromObject({years:1}),yr:He.fromObject({years:1}),yrs:He.fromObject({years:1}),month:He.fromObject({months:1}),months:He.fromObject({months:1}),mo:He.fromObject({months:1}),mos:He.fromObject({months:1}),week:He.fromObject({weeks:1}),weeks:He.fromObject({weeks:1}),wk:He.fromObject({weeks:1}),wks:He.fromObject({weeks:1}),w:He.fromObject({weeks:1}),day:He.fromObject({days:1}),days:He.fromObject({days:1}),d:He.fromObject({days:1}),hour:He.fromObject({hours:1}),hours:He.fromObject({hours:1}),hr:He.fromObject({hours:1}),hrs:He.fromObject({hours:1}),h:He.fromObject({hours:1}),minute:He.fromObject({minutes:1}),minutes:He.fromObject({minutes:1}),min:He.fromObject({minutes:1}),mins:He.fromObject({minutes:1}),m:He.fromObject({minutes:1}),second:He.fromObject({seconds:1}),seconds:He.fromObject({seconds:1}),sec:He.fromObject({seconds:1}),secs:He.fromObject({seconds:1}),s:He.fromObject({seconds:1})},Fm={now:()=>mt.local(),today:()=>mt.local().startOf("day"),yesterday:()=>mt.local().startOf("day").minus(He.fromObject({days:1})),tomorrow:()=>mt.local().startOf("day").plus(He.fromObject({days:1})),sow:()=>mt.local().startOf("week"),"start-of-week":()=>mt.local().startOf("week"),eow:()=>mt.local().endOf("week"),"end-of-week":()=>mt.local().endOf("week"),soy:()=>mt.local().startOf("year"),"start-of-year":()=>mt.local().startOf("year"),eoy:()=>mt.local().endOf("year"),"end-of-year":()=>mt.local().endOf("year"),som:()=>mt.local().startOf("month"),"start-of-month":()=>mt.local().startOf("month"),eom:()=>mt.local().endOf("month"),"end-of-month":()=>mt.local().endOf("month")},Im=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function WP(e){let t=-1;for(;(t=e.indexOf("|",t+1))>=0;)if(!(t>0&&e[t-1]=="\\"))return[e.substring(0,t).replace(/\\\|/g,"|"),e.substring(t+1)];return[e.replace(/\\\|/g,"|"),void 0]}function YP(e){let[t,r]=WP(e);return xc.infer(t,!1,r)}function kl(e,t,r){return W.seqMap(e,W.seq(W.optWhitespace,t,W.optWhitespace,e).many(),(n,i)=>{if(i.length==0)return n;let a=r(n,i[0][1],i[0][3]);for(let o=1;o(i,a)=>{let o=e._(i,a);if(!o.status)return o;for(let s of t){let u=s(o.value)._(i,o.index);if(!u.status)return o;o=u}return o})}var ai=W.createLanguage({number:e=>W.regexp(/-?[0-9]+(\.[0-9]+)?/).map(t=>Number.parseFloat(t)).desc("number"),string:e=>W.string('"').then(W.alt(e.escapeCharacter,W.noneOf('"\\')).atLeast(0).map(t=>t.join(""))).skip(W.string('"')).desc("string"),escapeCharacter:e=>W.string("\\").then(W.any).map(t=>t==='"'?'"':t==="\\"?"\\":"\\"+t),bool:e=>W.regexp(/true|false|True|False/).map(t=>t.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:e=>W.seqMap(W.string("#"),W.alt(W.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(t,r)=>t+r.join("")).desc("tag ('#hello/stuff')"),identifier:e=>W.seqMap(W.alt(W.regexp(/\p{Letter}/u),W.regexp(N0).desc("text")),W.alt(W.regexp(/[0-9\p{Letter}_-]/u),W.regexp(N0).desc("text")).many(),(t,r)=>t+r.join("")).desc("variable identifier"),link:e=>W.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(t=>YP(t)).desc("file link"),embedLink:e=>W.seqMap(W.string("!").atMost(1),e.link,(t,r)=>(t.length>0&&(r.embed=!0),r)).desc("file link"),binaryPlusMinus:e=>W.regexp(/\+|-/).map(t=>t).desc("'+' or '-'"),binaryMulDiv:e=>W.regexp(/\*|\/|%/).map(t=>t).desc("'*' or '/' or '%'"),binaryCompareOp:e=>W.regexp(/>=|<=|!=|>|<|=/).map(t=>t).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:e=>W.regexp(/and|or|&|\|/i).map(t=>t.toLowerCase()=="and"?"&":t.toLowerCase()=="or"?"|":t).desc("'and' or 'or'"),rootDate:e=>W.seqMap(W.regexp(/\d{4}/),W.string("-"),W.regexp(/\d{2}/),(t,r,n)=>mt.fromObject({year:Number.parseInt(t),month:Number.parseInt(n)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:e=>W.alt(...Object.keys(Fm).sort((t,r)=>r.length-t.length).map(W.string)),date:e=>zP(e.rootDate,t=>W.seqMap(W.string("-"),W.regexp(/\d{2}/),(r,n)=>t.set({day:Number.parseInt(n)})),t=>W.seqMap(W.string("T"),W.regexp(/\d{2}/),(r,n)=>t.set({hour:Number.parseInt(n)})),t=>W.seqMap(W.string(":"),W.regexp(/\d{2}/),(r,n)=>t.set({minute:Number.parseInt(n)})),t=>W.seqMap(W.string(":"),W.regexp(/\d{2}/),(r,n)=>t.set({second:Number.parseInt(n)})),t=>W.alt(W.seqMap(W.string("."),W.regexp(/\d{3}/),(r,n)=>t.set({millisecond:Number.parseInt(n)})),W.succeed(t)),t=>W.alt(W.seqMap(W.string("+").or(W.string("-")),W.regexp(/\d{1,2}(:\d{2})?/),(r,n)=>t.setZone("UTC"+r+n,{keepLocalTime:!0})),W.seqMap(W.string("Z"),()=>t.setZone("utc",{keepLocalTime:!0})),W.seqMap(W.string("["),W.regexp(/[0-9A-Za-z+-\/]+/u),W.string("]"),(r,n,i)=>t.setZone(n,{keepLocalTime:!0})))).assert(t=>t.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:e=>W.alt(e.dateShorthand.map(t=>Fm[t]()),e.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:e=>W.alt(...Object.keys(Tm).sort((t,r)=>r.length-t.length).map(W.string)),duration:e=>W.seqMap(e.number,W.optWhitespace,e.durationType,(t,r,n)=>Tm[n].mapUnits(i=>i*t)).sepBy1(W.string(",").trim(W.optWhitespace).or(W.optWhitespace)).map(t=>t.reduce((r,n)=>r.plus(n))).desc("duration like 4hr2min"),rawNull:e=>W.string("null"),tagSource:e=>e.tag.map(t=>Si.tag(t)),csvSource:e=>W.seqMap(W.string("csv(").skip(W.optWhitespace),e.string,W.string(")"),(t,r,n)=>Si.csv(r)),linkIncomingSource:e=>e.link.map(t=>Si.link(t.path,!0)),linkOutgoingSource:e=>W.seqMap(W.string("outgoing(").skip(W.optWhitespace),e.link,W.string(")"),(t,r,n)=>Si.link(r.path,!1)),folderSource:e=>e.string.map(t=>Si.folder(t)),parensSource:e=>W.seqMap(W.string("("),W.optWhitespace,e.source,W.optWhitespace,W.string(")"),(t,r,n,i,a)=>n),negateSource:e=>W.seqMap(W.alt(W.string("-"),W.string("!")),e.atomSource,(t,r)=>Si.negate(r)),atomSource:e=>W.alt(e.parensSource,e.negateSource,e.linkOutgoingSource,e.linkIncomingSource,e.folderSource,e.tagSource,e.csvSource),binaryOpSource:e=>kl(e.atomSource,e.binaryBooleanOp.map(t=>t),Si.binaryOp),source:e=>e.binaryOpSource,variableField:e=>e.identifier.chain(t=>Im.includes(t.toUpperCase())?W.fail("Variable fields cannot be a keyword ("+Im.join(" or ")+")"):W.succeed(fn.variable(t))).desc("variable"),numberField:e=>e.number.map(t=>fn.literal(t)).desc("number"),stringField:e=>e.string.map(t=>fn.literal(t)).desc("string"),boolField:e=>e.bool.map(t=>fn.literal(t)).desc("boolean"),dateField:e=>W.seqMap(W.string("date("),W.optWhitespace,e.datePlus,W.optWhitespace,W.string(")"),(t,r,n,i,a)=>fn.literal(n)).desc("date"),durationField:e=>W.seqMap(W.string("dur("),W.optWhitespace,e.duration,W.optWhitespace,W.string(")"),(t,r,n,i,a)=>fn.literal(n)).desc("duration"),nullField:e=>e.rawNull.map(t=>fn.NULL),linkField:e=>e.link.map(t=>fn.literal(t)),listField:e=>e.field.sepBy(W.string(",").trim(W.optWhitespace)).wrap(W.string("[").skip(W.optWhitespace),W.optWhitespace.then(W.string("]"))).map(t=>fn.list(t)).desc("list ('[1, 2, 3]')"),objectField:e=>W.seqMap(e.identifier.or(e.string),W.string(":").trim(W.optWhitespace),e.field,(t,r,n)=>({name:t,value:n})).sepBy(W.string(",").trim(W.optWhitespace)).wrap(W.string("{").skip(W.optWhitespace),W.optWhitespace.then(W.string("}"))).map(t=>{let r={};for(let n of t)r[n.name]=n.value;return fn.object(r)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:e=>W.alt(e.date,e.duration.map(t=>NS(t)),e.string,e.tag,e.embedLink,e.bool,e.number,e.rawNull),inlineFieldList:e=>e.atomInlineField.sepBy(W.string(",").trim(W.optWhitespace).lookahead(e.atomInlineField)),inlineField:e=>W.alt(W.seqMap(e.atomInlineField,W.string(",").trim(W.optWhitespace),e.inlineFieldList,(t,r,n)=>[t].concat(n)),e.atomInlineField),atomField:e=>W.alt(e.embedLink.map(t=>fn.literal(t)),e.negatedField,e.linkField,e.listField,e.objectField,e.lambdaField,e.parensField,e.boolField,e.numberField,e.stringField,e.dateField,e.durationField,e.nullField,e.variableField),indexField:e=>W.seqMap(e.atomField,W.alt(e.dotPostfix,e.indexPostfix,e.functionPostfix).many(),(t,r)=>{let n=t;for(let i of r)switch(i.type){case"dot":n=fn.index(n,fn.literal(i.field));break;case"index":n=fn.index(n,i.field);break;case"function":n=fn.func(n,i.fields);break}return n}),negatedField:e=>W.seqMap(W.string("!"),e.indexField,(t,r)=>fn.negate(r)).desc("negated field"),parensField:e=>W.seqMap(W.string("("),W.optWhitespace,e.field,W.optWhitespace,W.string(")"),(t,r,n,i,a)=>n),lambdaField:e=>W.seqMap(e.identifier.sepBy(W.string(",").trim(W.optWhitespace)).wrap(W.string("(").trim(W.optWhitespace),W.string(")").trim(W.optWhitespace)),W.string("=>").trim(W.optWhitespace),e.field,(t,r,n)=>({type:"lambda",arguments:t,value:n})),dotPostfix:e=>W.seqMap(W.string("."),e.identifier,(t,r)=>({type:"dot",field:r})),indexPostfix:e=>W.seqMap(W.string("["),W.optWhitespace,e.field,W.optWhitespace,W.string("]"),(t,r,n,i,a)=>({type:"index",field:n})),functionPostfix:e=>W.seqMap(W.string("("),W.optWhitespace,e.field.sepBy(W.string(",").trim(W.optWhitespace)),W.optWhitespace,W.string(")"),(t,r,n,i,a)=>({type:"function",fields:n})),binaryMulDivField:e=>kl(e.indexField,e.binaryMulDiv,fn.binaryOp),binaryPlusMinusField:e=>kl(e.binaryMulDivField,e.binaryPlusMinus,fn.binaryOp),binaryCompareField:e=>kl(e.binaryPlusMinusField,e.binaryCompareOp,fn.binaryOp),binaryBooleanField:e=>kl(e.binaryCompareField,e.binaryBooleanOp,fn.binaryOp),binaryOpField:e=>e.binaryBooleanField,field:e=>e.binaryOpField});function KP(e){try{return Ec.success(ai.field.tryParse(e))}catch(t){return Ec.failure(""+t)}}var Cc;(function(e){function t(n,i){return{name:n,field:i}}e.named=t;function r(n,i){return{field:n,direction:i}}e.sortBy=r})(Cc||(Cc={}));function jP(e){return W.custom((t,r)=>(n,i)=>{let a=e._(n,i);return a.status?Object.assign({},a,{value:[a.value,n.substring(i,a.index)]}):a})}function qP(e){return e.split(/[\r\n]+/).map(t=>t.trim()).join("")}function R0(e,t){return W.eof.map(e).or(W.whitespace.then(t))}var RS=W.createLanguage({queryType:e=>W.alt(W.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(t=>t.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:e=>W.seqMap(ai.field.skip(W.whitespace),W.regexp(/AS/i).skip(W.whitespace),ai.identifier.or(ai.string),(t,r,n)=>Cc.named(n,t)),comment:()=>W.Parser((e,t)=>{let r=e.substring(t);if(!r.startsWith("//"))return W.makeFailure(t,"Not a comment");r=r.split(` +`)[0];let n=r.substring(2).trim();return W.makeSuccess(t+r.length,n)}),namedField:e=>W.alt(e.explicitNamedField,jP(ai.field).map(([t,r])=>Cc.named(qP(r),t))),sortField:e=>W.seqMap(ai.field.skip(W.optWhitespace),W.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(t,r)=>{let n=r.length==0?"ascending":r[0].toLowerCase();return n=="desc"&&(n="descending"),n=="asc"&&(n="ascending"),{field:t,direction:n}}),headerClause:e=>e.queryType.chain(t=>{switch(t){case"table":return R0(()=>({type:t,fields:[],showId:!0}),W.seqMap(W.regexp(/WITHOUT\s+ID/i).skip(W.optWhitespace).atMost(1),W.sepBy(e.namedField,W.string(",").trim(W.optWhitespace)),(r,n)=>({type:t,fields:n,showId:r.length==0})));case"list":return R0(()=>({type:t,format:void 0,showId:!0}),W.seqMap(W.regexp(/WITHOUT\s+ID/i).skip(W.optWhitespace).atMost(1),ai.field.atMost(1),(r,n)=>({type:t,format:n.length==1?n[0]:void 0,showId:r.length==0})));case"task":return W.succeed({type:t});case"calendar":return W.whitespace.then(W.seqMap(e.namedField,r=>({type:t,showId:!0,field:r})));default:return W.fail(`Unrecognized query type '${t}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:e=>W.seqMap(W.regexp(/FROM/i),W.whitespace,ai.source,(t,r,n)=>n),whereClause:e=>W.seqMap(W.regexp(/WHERE/i),W.whitespace,ai.field,(t,r,n)=>({type:"where",clause:n})).desc("WHERE "),sortByClause:e=>W.seqMap(W.regexp(/SORT/i),W.whitespace,e.sortField.sepBy1(W.string(",").trim(W.optWhitespace)),(t,r,n)=>({type:"sort",fields:n})).desc("SORT field [ASC/DESC]"),limitClause:e=>W.seqMap(W.regexp(/LIMIT/i),W.whitespace,ai.field,(t,r,n)=>({type:"limit",amount:n})).desc("LIMIT "),flattenClause:e=>W.seqMap(W.regexp(/FLATTEN/i).skip(W.whitespace),e.namedField,(t,r)=>({type:"flatten",field:r})).desc("FLATTEN [AS ]"),groupByClause:e=>W.seqMap(W.regexp(/GROUP BY/i).skip(W.whitespace),e.namedField,(t,r)=>({type:"group",field:r})).desc("GROUP BY [AS ]"),clause:e=>W.alt(e.fromClause,e.whereClause,e.sortByClause,e.limitClause,e.groupByClause,e.flattenClause),query:e=>W.seqMap(e.headerClause.trim(dm),e.fromClause.trim(dm).atMost(1),e.clause.trim(dm).many(),(t,r,n)=>({header:t,source:r.length==0?Si.folder(""):r[0],operations:n,settings:Hm}))}),dm=W.alt(W.whitespace,RS.comment).many().map(e=>e.join("")),GP=e=>{var t;return e?(t=e.plugins.plugins.dataview)==null?void 0:t.api:window.DataviewAPI},JP=e=>e.plugins.enabledPlugins.has("dataview");Ei.DATE_SHORTHANDS=Fm;Ei.DURATION_TYPES=Tm;Ei.EXPRESSION=ai;Ei.KEYWORDS=Im;Ei.QUERY_LANGUAGE=RS;Ei.getAPI=GP;Ei.isPluginEnabled=JP;Ei.parseField=KP});var HS=wn((Vm,$m)=>{(function(e,t){typeof Vm=="object"&&typeof $m!="undefined"?$m.exports=t():typeof define=="function"&&define.amd?define(t):e.Mark=t()})(Vm,function(){"use strict";var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t=function(s,u){if(!(s instanceof u))throw new TypeError("Cannot call a class as a function")},r=function(){function s(u,l){for(var c=0;c1&&arguments[1]!==void 0?arguments[1]:!0,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5e3;t(this,s),this.ctx=u,this.iframes=l,this.exclude=c,this.iframesTimeout=d}return r(s,[{key:"getContexts",value:function(){var l=void 0,c=[];return typeof this.ctx=="undefined"||!this.ctx?l=[]:NodeList.prototype.isPrototypeOf(this.ctx)?l=Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?l=this.ctx:typeof this.ctx=="string"?l=Array.prototype.slice.call(document.querySelectorAll(this.ctx)):l=[this.ctx],l.forEach(function(d){var m=c.filter(function(h){return h.contains(d)}).length>0;c.indexOf(d)===-1&&!m&&c.push(d)}),c}},{key:"getIframeContents",value:function(l,c){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},m=void 0;try{var h=l.contentWindow;if(m=h.document,!h||!m)throw new Error("iframe inaccessible")}catch(g){d()}m&&c(m)}},{key:"isIframeBlank",value:function(l){var c="about:blank",d=l.getAttribute("src").trim(),m=l.contentWindow.location.href;return m===c&&d!==c&&d}},{key:"observeIframeLoad",value:function(l,c,d){var m=this,h=!1,g=null,y=function v(){if(!h){h=!0,activeWindow.clearTimeout(g);try{m.isIframeBlank(l)||(l.removeEventListener("load",v),m.getIframeContents(l,c,d))}catch(D){d()}}};l.addEventListener("load",y),g=activeWindow.setTimeout(y,this.iframesTimeout)}},{key:"onIframeReady",value:function(l,c,d){try{l.contentWindow.document.readyState==="complete"?this.isIframeBlank(l)?this.observeIframeLoad(l,c,d):this.getIframeContents(l,c,d):this.observeIframeLoad(l,c,d)}catch(m){d()}}},{key:"waitForIframes",value:function(l,c){var d=this,m=0;this.forEachIframe(l,function(){return!0},function(h){m++,d.waitForIframes(h.querySelector("html"),function(){--m||c()})},function(h){h||c()})}},{key:"forEachIframe",value:function(l,c,d){var m=this,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){},g=l.querySelectorAll("iframe"),y=g.length,v=0;g=Array.prototype.slice.call(g);var D=function(){--y<=0&&h(v)};y||D(),g.forEach(function(I){s.matches(I,m.exclude)?D():m.onIframeReady(I,function(C){c(I)&&(v++,d(C)),D()},D)})}},{key:"createIterator",value:function(l,c,d){return document.createNodeIterator(l,c,d,!1)}},{key:"createInstanceOnIframe",value:function(l){return new s(l.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(l,c,d){var m=l.compareDocumentPosition(d),h=Node.DOCUMENT_POSITION_PRECEDING;if(m&h)if(c!==null){var g=c.compareDocumentPosition(d),y=Node.DOCUMENT_POSITION_FOLLOWING;if(g&y)return!0}else return!0;return!1}},{key:"getIteratorNode",value:function(l){var c=l.previousNode(),d=void 0;return c===null?d=l.nextNode():d=l.nextNode()&&l.nextNode(),{prevNode:c,node:d}}},{key:"checkIframeFilter",value:function(l,c,d,m){var h=!1,g=!1;return m.forEach(function(y,v){y.val===d&&(h=v,g=y.handled)}),this.compareNodeIframe(l,c,d)?(h===!1&&!g?m.push({val:d,handled:!0}):h!==!1&&!g&&(m[h].handled=!0),!0):(h===!1&&m.push({val:d,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(l,c,d,m){var h=this;l.forEach(function(g){g.handled||h.getIframeContents(g.val,function(y){h.createInstanceOnIframe(y).forEachNode(c,d,m)})})}},{key:"iterateThroughNodes",value:function(l,c,d,m,h){for(var g=this,y=this.createIterator(c,l,m),v=[],D=[],I=void 0,C=void 0,x=function(){var A=g.getIteratorNode(y);return C=A.prevNode,I=A.node,I};x();)this.iframes&&this.forEachIframe(c,function(O){return g.checkIframeFilter(I,C,O,v)},function(O){g.createInstanceOnIframe(O).forEachNode(l,function(A){return D.push(A)},m)}),D.push(I);D.forEach(function(O){d(O)}),this.iframes&&this.handleOpenIframes(v,l,d,m),h()}},{key:"forEachNode",value:function(l,c,d){var m=this,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){},g=this.getContexts(),y=g.length;y||h(),g.forEach(function(v){var D=function(){m.iterateThroughNodes(l,v,c,d,function(){--y<=0&&h()})};m.iframes?m.waitForIframes(v,D):D()})}}],[{key:"matches",value:function(l,c){var d=typeof c=="string"?[c]:c,m=l.matches||l.matchesSelector||l.msMatchesSelector||l.mozMatchesSelector||l.oMatchesSelector||l.webkitMatchesSelector;if(m){var h=!1;return d.every(function(g){return m.call(l,g)?(h=!0,!1):!0}),h}else return!1}}]),s}(),a=function(){function s(u){t(this,s),this.ctx=u,this.ie=!1;var l=window.navigator.userAgent;(l.indexOf("MSIE")>-1||l.indexOf("Trident")>-1)&&(this.ie=!0)}return r(s,[{key:"log",value:function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"debug",d=this.opt.log;this.opt.debug&&(typeof d=="undefined"?"undefined":e(d))==="object"&&typeof d[c]=="function"&&d[c]("mark.js: "+l)}},{key:"escapeStr",value:function(l){return l.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(l){return this.opt.wildcards!=="disabled"&&(l=this.setupWildcardsRegExp(l)),l=this.escapeStr(l),Object.keys(this.opt.synonyms).length&&(l=this.createSynonymsRegExp(l)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(l=this.setupIgnoreJoinersRegExp(l)),this.opt.diacritics&&(l=this.createDiacriticsRegExp(l)),l=this.createMergedBlanksRegExp(l),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(l=this.createJoinersRegExp(l)),this.opt.wildcards!=="disabled"&&(l=this.createWildcardsRegExp(l)),l=this.createAccuracyRegExp(l),l}},{key:"createSynonymsRegExp",value:function(l){var c=this.opt.synonyms,d=this.opt.caseSensitive?"":"i",m=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var h in c)if(c.hasOwnProperty(h)){var g=c[h],y=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(h):this.escapeStr(h),v=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(g):this.escapeStr(g);y!==""&&v!==""&&(l=l.replace(new RegExp("("+this.escapeStr(y)+"|"+this.escapeStr(v)+")","gm"+d),m+("("+this.processSynomyms(y)+"|")+(this.processSynomyms(v)+")")+m))}return l}},{key:"processSynomyms",value:function(l){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(l=this.setupIgnoreJoinersRegExp(l)),l}},{key:"setupWildcardsRegExp",value:function(l){return l=l.replace(/(?:\\)*\?/g,function(c){return c.charAt(0)==="\\"?"?":""}),l.replace(/(?:\\)*\*/g,function(c){return c.charAt(0)==="\\"?"*":""})}},{key:"createWildcardsRegExp",value:function(l){var c=this.opt.wildcards==="withSpaces";return l.replace(/\u0001/g,c?"[\\S\\s]?":"\\S?").replace(/\u0002/g,c?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(l){return l.replace(/[^(|)\\]/g,function(c,d,m){var h=m.charAt(d+1);return/[(|)\\]/.test(h)||h===""?c:c+"\0"})}},{key:"createJoinersRegExp",value:function(l){var c=[],d=this.opt.ignorePunctuation;return Array.isArray(d)&&d.length&&c.push(this.escapeStr(d.join(""))),this.opt.ignoreJoiners&&c.push("\\u00ad\\u200b\\u200c\\u200d"),c.length?l.split(/\u0000+/).join("["+c.join("")+"]*"):l}},{key:"createDiacriticsRegExp",value:function(l){var c=this.opt.caseSensitive?"":"i",d=this.opt.caseSensitive?["a\xE0\xE1\u1EA3\xE3\u1EA1\u0103\u1EB1\u1EAF\u1EB3\u1EB5\u1EB7\xE2\u1EA7\u1EA5\u1EA9\u1EAB\u1EAD\xE4\xE5\u0101\u0105","A\xC0\xC1\u1EA2\xC3\u1EA0\u0102\u1EB0\u1EAE\u1EB2\u1EB4\u1EB6\xC2\u1EA6\u1EA4\u1EA8\u1EAA\u1EAC\xC4\xC5\u0100\u0104","c\xE7\u0107\u010D","C\xC7\u0106\u010C","d\u0111\u010F","D\u0110\u010E","e\xE8\xE9\u1EBB\u1EBD\u1EB9\xEA\u1EC1\u1EBF\u1EC3\u1EC5\u1EC7\xEB\u011B\u0113\u0119","E\xC8\xC9\u1EBA\u1EBC\u1EB8\xCA\u1EC0\u1EBE\u1EC2\u1EC4\u1EC6\xCB\u011A\u0112\u0118","i\xEC\xED\u1EC9\u0129\u1ECB\xEE\xEF\u012B","I\xCC\xCD\u1EC8\u0128\u1ECA\xCE\xCF\u012A","l\u0142","L\u0141","n\xF1\u0148\u0144","N\xD1\u0147\u0143","o\xF2\xF3\u1ECF\xF5\u1ECD\xF4\u1ED3\u1ED1\u1ED5\u1ED7\u1ED9\u01A1\u1EDF\u1EE1\u1EDB\u1EDD\u1EE3\xF6\xF8\u014D","O\xD2\xD3\u1ECE\xD5\u1ECC\xD4\u1ED2\u1ED0\u1ED4\u1ED6\u1ED8\u01A0\u1EDE\u1EE0\u1EDA\u1EDC\u1EE2\xD6\xD8\u014C","r\u0159","R\u0158","s\u0161\u015B\u0219\u015F","S\u0160\u015A\u0218\u015E","t\u0165\u021B\u0163","T\u0164\u021A\u0162","u\xF9\xFA\u1EE7\u0169\u1EE5\u01B0\u1EEB\u1EE9\u1EED\u1EEF\u1EF1\xFB\xFC\u016F\u016B","U\xD9\xDA\u1EE6\u0168\u1EE4\u01AF\u1EEA\u1EE8\u1EEC\u1EEE\u1EF0\xDB\xDC\u016E\u016A","y\xFD\u1EF3\u1EF7\u1EF9\u1EF5\xFF","Y\xDD\u1EF2\u1EF6\u1EF8\u1EF4\u0178","z\u017E\u017C\u017A","Z\u017D\u017B\u0179"]:["a\xE0\xE1\u1EA3\xE3\u1EA1\u0103\u1EB1\u1EAF\u1EB3\u1EB5\u1EB7\xE2\u1EA7\u1EA5\u1EA9\u1EAB\u1EAD\xE4\xE5\u0101\u0105A\xC0\xC1\u1EA2\xC3\u1EA0\u0102\u1EB0\u1EAE\u1EB2\u1EB4\u1EB6\xC2\u1EA6\u1EA4\u1EA8\u1EAA\u1EAC\xC4\xC5\u0100\u0104","c\xE7\u0107\u010DC\xC7\u0106\u010C","d\u0111\u010FD\u0110\u010E","e\xE8\xE9\u1EBB\u1EBD\u1EB9\xEA\u1EC1\u1EBF\u1EC3\u1EC5\u1EC7\xEB\u011B\u0113\u0119E\xC8\xC9\u1EBA\u1EBC\u1EB8\xCA\u1EC0\u1EBE\u1EC2\u1EC4\u1EC6\xCB\u011A\u0112\u0118","i\xEC\xED\u1EC9\u0129\u1ECB\xEE\xEF\u012BI\xCC\xCD\u1EC8\u0128\u1ECA\xCE\xCF\u012A","l\u0142L\u0141","n\xF1\u0148\u0144N\xD1\u0147\u0143","o\xF2\xF3\u1ECF\xF5\u1ECD\xF4\u1ED3\u1ED1\u1ED5\u1ED7\u1ED9\u01A1\u1EDF\u1EE1\u1EDB\u1EDD\u1EE3\xF6\xF8\u014DO\xD2\xD3\u1ECE\xD5\u1ECC\xD4\u1ED2\u1ED0\u1ED4\u1ED6\u1ED8\u01A0\u1EDE\u1EE0\u1EDA\u1EDC\u1EE2\xD6\xD8\u014C","r\u0159R\u0158","s\u0161\u015B\u0219\u015FS\u0160\u015A\u0218\u015E","t\u0165\u021B\u0163T\u0164\u021A\u0162","u\xF9\xFA\u1EE7\u0169\u1EE5\u01B0\u1EEB\u1EE9\u1EED\u1EEF\u1EF1\xFB\xFC\u016F\u016BU\xD9\xDA\u1EE6\u0168\u1EE4\u01AF\u1EEA\u1EE8\u1EEC\u1EEE\u1EF0\xDB\xDC\u016E\u016A","y\xFD\u1EF3\u1EF7\u1EF9\u1EF5\xFFY\xDD\u1EF2\u1EF6\u1EF8\u1EF4\u0178","z\u017E\u017C\u017AZ\u017D\u017B\u0179"],m=[];return l.split("").forEach(function(h){d.every(function(g){if(g.indexOf(h)!==-1){if(m.indexOf(g)>-1)return!1;l=l.replace(new RegExp("["+g+"]","gm"+c),"["+g+"]"),m.push(g)}return!0})}),l}},{key:"createMergedBlanksRegExp",value:function(l){return l.replace(/[\s]+/gmi,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(l){var c=this,d="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\xA1\xBF",m=this.opt.accuracy,h=typeof m=="string"?m:m.value,g=typeof m=="string"?[]:m.limiters,y="";switch(g.forEach(function(v){y+="|"+c.escapeStr(v)}),h){case"partially":default:return"()("+l+")";case"complementary":return y="\\s"+(y||this.escapeStr(d)),"()([^"+y+"]*"+l+"[^"+y+"]*)";case"exactly":return"(^|\\s"+y+")("+l+")(?=$|\\s"+y+")"}}},{key:"getSeparatedKeywords",value:function(l){var c=this,d=[];return l.forEach(function(m){c.opt.separateWordSearch?m.split(" ").forEach(function(h){h.trim()&&d.indexOf(h)===-1&&d.push(h)}):m.trim()&&d.indexOf(m)===-1&&d.push(m)}),{keywords:d.sort(function(m,h){return h.length-m.length}),length:d.length}}},{key:"isNumeric",value:function(l){return Number(parseFloat(l))==l}},{key:"checkRanges",value:function(l){var c=this;if(!Array.isArray(l)||Object.prototype.toString.call(l[0])!=="[object Object]")return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(l),[];var d=[],m=0;return l.sort(function(h,g){return h.start-g.start}).forEach(function(h){var g=c.callNoMatchOnInvalidRanges(h,m),y=g.start,v=g.end,D=g.valid;D&&(h.start=y,h.length=v-y,d.push(h),m=v)}),d}},{key:"callNoMatchOnInvalidRanges",value:function(l,c){var d=void 0,m=void 0,h=!1;return l&&typeof l.start!="undefined"?(d=parseInt(l.start,10),m=d+parseInt(l.length,10),this.isNumeric(l.start)&&this.isNumeric(l.length)&&m-c>0&&m-d>0?h=!0:(this.log("Ignoring invalid or overlapping range: "+(""+JSON.stringify(l))),this.opt.noMatch(l))):(this.log("Ignoring invalid range: "+JSON.stringify(l)),this.opt.noMatch(l)),{start:d,end:m,valid:h}}},{key:"checkWhitespaceRanges",value:function(l,c,d){var m=void 0,h=!0,g=d.length,y=c-g,v=parseInt(l.start,10)-y;return v=v>g?g:v,m=v+parseInt(l.length,10),m>g&&(m=g,this.log("End range automatically set to the max value of "+g)),v<0||m-v<0||v>g||m>g?(h=!1,this.log("Invalid range: "+JSON.stringify(l)),this.opt.noMatch(l)):d.substring(v,m).replace(/\s+/g,"")===""&&(h=!1,this.log("Skipping whitespace only range: "+JSON.stringify(l)),this.opt.noMatch(l)),{start:v,end:m,valid:h}}},{key:"getTextNodes",value:function(l){var c=this,d="",m=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(h){m.push({start:d.length,end:(d+=h.textContent).length,node:h})},function(h){return c.matchesExclude(h.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){l({value:d,nodes:m})})}},{key:"matchesExclude",value:function(l){return i.matches(l,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(l,c,d){var m=this.opt.element?this.opt.element:"mark",h=l.splitText(c),g=h.splitText(d-c),y=document.createElement(m);return y.setAttribute("data-markjs","true"),this.opt.className&&y.setAttribute("class",this.opt.className),y.textContent=h.textContent,h.parentNode.replaceChild(y,h),g}},{key:"wrapRangeInMappedTextNode",value:function(l,c,d,m,h){var g=this;l.nodes.every(function(y,v){var D=l.nodes[v+1];if(typeof D=="undefined"||D.start>c){if(!m(y.node))return!1;var I=c-y.start,C=(d>y.end?y.end:d)-y.start,x=l.value.substr(0,y.start),O=l.value.substr(C+y.start);if(y.node=g.wrapRangeInTextNode(y.node,I,C),l.value=x+O,l.nodes.forEach(function(A,P){P>=v&&(l.nodes[P].start>0&&P!==v&&(l.nodes[P].start-=C),l.nodes[P].end-=C)}),d-=C,h(y.node.previousSibling,y.start),d>y.end)c=y.end;else return!1}return!0})}},{key:"wrapMatches",value:function(l,c,d,m,h){var g=this,y=c===0?0:c+1;this.getTextNodes(function(v){v.nodes.forEach(function(D){D=D.node;for(var I=void 0;(I=l.exec(D.textContent))!==null&&I[y]!=="";)if(d(I[y],D)){var C=I.index;if(y!==0)for(var x=1;x{(function(e,t){typeof Um=="object"&&typeof ls!="undefined"?ls.exports=t():typeof define=="function"&&define.amd?define(t):e.moment=t()})(Um,function(){"use strict";var e;function t(){return e.apply(null,arguments)}function r(f){e=f}function n(f){return f instanceof Array||Object.prototype.toString.call(f)==="[object Array]"}function i(f){return f!=null&&Object.prototype.toString.call(f)==="[object Object]"}function a(f,p){return Object.prototype.hasOwnProperty.call(f,p)}function o(f){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(f).length===0;var p;for(p in f)if(a(f,p))return!1;return!0}function s(f){return f===void 0}function u(f){return typeof f=="number"||Object.prototype.toString.call(f)==="[object Number]"}function l(f){return f instanceof Date||Object.prototype.toString.call(f)==="[object Date]"}function c(f,p){var w=[],S,F=f.length;for(S=0;S>>0,S;for(S=0;S0)for(w=0;w=0;return(j?w?"+":"":"-")+Math.pow(10,Math.max(0,F)).toString().substr(1)+S}var Ce=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,U=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Je={},it={};function N(f,p,w,S){var F=S;typeof S=="string"&&(F=function(){return this[S]()}),f&&(it[f]=F),p&&(it[p[0]]=function(){return De(F.apply(this,arguments),p[1],p[2])}),w&&(it[w]=function(){return this.localeData().ordinal(F.apply(this,arguments),f)})}function Ze(f){return f.match(/\[[\s\S]/)?f.replace(/^\[|\]$/g,""):f.replace(/\\/g,"")}function It(f){var p=f.match(Ce),w,S;for(w=0,S=p.length;w=0&&U.test(f);)f=f.replace(U,S),U.lastIndex=0,w-=1;return f}var vt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Wt(f){var p=this._longDateFormat[f],w=this._longDateFormat[f.toUpperCase()];return p||!w?p:(this._longDateFormat[f]=w.match(Ce).map(function(S){return S==="MMMM"||S==="MM"||S==="DD"||S==="dddd"?S.slice(1):S}).join(""),this._longDateFormat[f])}var Tt="Invalid date";function Jt(){return this._invalidDate}var en="%d",gn=/\d{1,2}/;function yn(f){return this._ordinal.replace("%d",f)}var vn={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function xn(f,p,w,S){var F=this._relativeTime[w];return Q(F)?F(f,p,w,S):F.replace(/%d/i,f)}function jn(f,p){var w=this._relativeTime[f>0?"future":"past"];return Q(w)?w(p):w.replace(/%s/i,p)}var sn={};function Rt(f,p){var w=f.toLowerCase();sn[w]=sn[w+"s"]=sn[p]=f}function Vt(f){return typeof f=="string"?sn[f]||sn[f.toLowerCase()]:void 0}function Sr(f){var p={},w,S;for(S in f)a(f,S)&&(w=Vt(S),w&&(p[w]=f[S]));return p}var Rr={};function Bt(f,p){Rr[f]=p}function Hr(f){var p=[],w;for(w in f)a(f,w)&&p.push({unit:w,priority:Rr[w]});return p.sort(function(S,F){return S.priority-F.priority}),p}function rn(f){return f%4===0&&f%100!==0||f%400===0}function At(f){return f<0?Math.ceil(f)||0:Math.floor(f)}function Z(f){var p=+f,w=0;return p!==0&&isFinite(p)&&(w=At(p)),w}function me(f,p){return function(w){return w!=null?(at(this,f,w),t.updateOffset(this,p),this):Ie(this,f)}}function Ie(f,p){return f.isValid()?f._d["get"+(f._isUTC?"UTC":"")+p]():NaN}function at(f,p,w){f.isValid()&&!isNaN(w)&&(p==="FullYear"&&rn(f.year())&&f.month()===1&&f.date()===29?(w=Z(w),f._d["set"+(f._isUTC?"UTC":"")+p](w,f.month(),b(w,f.month()))):f._d["set"+(f._isUTC?"UTC":"")+p](w))}function Dt(f){return f=Vt(f),Q(this[f])?this[f]():this}function Cn(f,p){if(typeof f=="object"){f=Sr(f);var w=Hr(f),S,F=w.length;for(S=0;S68?1900:2e3)};var On=me("FullYear",!0);function Vn(){return rn(this.year())}function ki(f,p,w,S,F,j,se){var Pe;return f<100&&f>=0?(Pe=new Date(f+400,p,w,S,F,j,se),isFinite(Pe.getFullYear())&&Pe.setFullYear(f)):Pe=new Date(f,p,w,S,F,j,se),Pe}function kr(f){var p,w;return f<100&&f>=0?(w=Array.prototype.slice.call(arguments),w[0]=f+400,p=new Date(Date.UTC.apply(null,w)),isFinite(p.getUTCFullYear())&&p.setUTCFullYear(f)):p=new Date(Date.UTC.apply(null,arguments)),p}function Jr(f,p,w){var S=7+p-w,F=(7+kr(f,0,S).getUTCDay()-p)%7;return-F+S-1}function My(f,p,w,S,F){var j=(7+w-S)%7,se=Jr(f,S,F),Pe=1+7*(p-1)+j+se,ut,$t;return Pe<=0?(ut=f-1,$t=qt(ut)+Pe):Pe>qt(f)?(ut=f+1,$t=Pe-qt(f)):(ut=f,$t=Pe),{year:ut,dayOfYear:$t}}function Ns(f,p,w){var S=Jr(f.year(),p,w),F=Math.floor((f.dayOfYear()-S-1)/7)+1,j,se;return F<1?(se=f.year()-1,j=F+xi(se,p,w)):F>xi(f.year(),p,w)?(j=F-xi(f.year(),p,w),se=f.year()+1):(se=f.year(),j=F),{week:j,year:se}}function xi(f,p,w){var S=Jr(f,p,w),F=Jr(f+1,p,w);return(qt(f)-S+F)/7}N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),Rt("week","w"),Rt("isoWeek","W"),Bt("week",5),Bt("isoWeek",5),ae("w",L),ae("ww",L,Ht),ae("W",L),ae("WW",L,Ht),Ft(["w","ww","W","WW"],function(f,p,w,S){p[S.substr(0,1)]=Z(f)});function j_(f){return Ns(f,this._week.dow,this._week.doy).week}var q_={dow:0,doy:6};function G_(){return this._week.dow}function J_(){return this._week.doy}function Z_(f){var p=this.localeData().week(this);return f==null?p:this.add((f-p)*7,"d")}function Q_(f){var p=Ns(this,1,4).week;return f==null?p:this.add((f-p)*7,"d")}N("d",0,"do","day"),N("dd",0,0,function(f){return this.localeData().weekdaysMin(this,f)}),N("ddd",0,0,function(f){return this.localeData().weekdaysShort(this,f)}),N("dddd",0,0,function(f){return this.localeData().weekdays(this,f)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),Rt("day","d"),Rt("weekday","e"),Rt("isoWeekday","E"),Bt("day",11),Bt("weekday",11),Bt("isoWeekday",11),ae("d",L),ae("e",L),ae("E",L),ae("dd",function(f,p){return p.weekdaysMinRegex(f)}),ae("ddd",function(f,p){return p.weekdaysShortRegex(f)}),ae("dddd",function(f,p){return p.weekdaysRegex(f)}),Ft(["dd","ddd","dddd"],function(f,p,w,S){var F=w._locale.weekdaysParse(f,S,w._strict);F!=null?p.d=F:g(w).invalidWeekday=f}),Ft(["d","e","E"],function(f,p,w,S){p[S]=Z(f)});function X_(f,p){return typeof f!="string"?f:isNaN(f)?(f=p.weekdaysParse(f),typeof f=="number"?f:null):parseInt(f,10)}function e1(f,p){return typeof f=="string"?p.weekdaysParse(f)%7||7:isNaN(f)?null:f}function bf(f,p){return f.slice(p,7).concat(f.slice(0,p))}var t1="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ty="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),n1="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),r1=ye,i1=ye,a1=ye;function o1(f,p){var w=n(this._weekdays)?this._weekdays:this._weekdays[f&&f!==!0&&this._weekdays.isFormat.test(p)?"format":"standalone"];return f===!0?bf(w,this._week.dow):f?w[f.day()]:w}function s1(f){return f===!0?bf(this._weekdaysShort,this._week.dow):f?this._weekdaysShort[f.day()]:this._weekdaysShort}function l1(f){return f===!0?bf(this._weekdaysMin,this._week.dow):f?this._weekdaysMin[f.day()]:this._weekdaysMin}function u1(f,p,w){var S,F,j,se=f.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],S=0;S<7;++S)j=m([2e3,1]).day(S),this._minWeekdaysParse[S]=this.weekdaysMin(j,"").toLocaleLowerCase(),this._shortWeekdaysParse[S]=this.weekdaysShort(j,"").toLocaleLowerCase(),this._weekdaysParse[S]=this.weekdays(j,"").toLocaleLowerCase();return w?p==="dddd"?(F=_.call(this._weekdaysParse,se),F!==-1?F:null):p==="ddd"?(F=_.call(this._shortWeekdaysParse,se),F!==-1?F:null):(F=_.call(this._minWeekdaysParse,se),F!==-1?F:null):p==="dddd"?(F=_.call(this._weekdaysParse,se),F!==-1||(F=_.call(this._shortWeekdaysParse,se),F!==-1)?F:(F=_.call(this._minWeekdaysParse,se),F!==-1?F:null)):p==="ddd"?(F=_.call(this._shortWeekdaysParse,se),F!==-1||(F=_.call(this._weekdaysParse,se),F!==-1)?F:(F=_.call(this._minWeekdaysParse,se),F!==-1?F:null)):(F=_.call(this._minWeekdaysParse,se),F!==-1||(F=_.call(this._weekdaysParse,se),F!==-1)?F:(F=_.call(this._shortWeekdaysParse,se),F!==-1?F:null))}function c1(f,p,w){var S,F,j;if(this._weekdaysParseExact)return u1.call(this,f,p,w);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),S=0;S<7;S++){if(F=m([2e3,1]).day(S),w&&!this._fullWeekdaysParse[S]&&(this._fullWeekdaysParse[S]=new RegExp("^"+this.weekdays(F,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[S]=new RegExp("^"+this.weekdaysShort(F,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[S]=new RegExp("^"+this.weekdaysMin(F,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[S]||(j="^"+this.weekdays(F,"")+"|^"+this.weekdaysShort(F,"")+"|^"+this.weekdaysMin(F,""),this._weekdaysParse[S]=new RegExp(j.replace(".",""),"i")),w&&p==="dddd"&&this._fullWeekdaysParse[S].test(f))return S;if(w&&p==="ddd"&&this._shortWeekdaysParse[S].test(f))return S;if(w&&p==="dd"&&this._minWeekdaysParse[S].test(f))return S;if(!w&&this._weekdaysParse[S].test(f))return S}}function d1(f){if(!this.isValid())return f!=null?this:NaN;var p=this._isUTC?this._d.getUTCDay():this._d.getDay();return f!=null?(f=X_(f,this.localeData()),this.add(f-p,"d")):p}function f1(f){if(!this.isValid())return f!=null?this:NaN;var p=(this.day()+7-this.localeData()._week.dow)%7;return f==null?p:this.add(f-p,"d")}function h1(f){if(!this.isValid())return f!=null?this:NaN;if(f!=null){var p=e1(f,this.localeData());return this.day(this.day()%7?p:p-7)}else return this.day()||7}function m1(f){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Df.call(this),f?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=r1),this._weekdaysStrictRegex&&f?this._weekdaysStrictRegex:this._weekdaysRegex)}function p1(f){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Df.call(this),f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=i1),this._weekdaysShortStrictRegex&&f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function g1(f){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Df.call(this),f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=a1),this._weekdaysMinStrictRegex&&f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Df(){function f(lr,Fi){return Fi.length-lr.length}var p=[],w=[],S=[],F=[],j,se,Pe,ut,$t;for(j=0;j<7;j++)se=m([2e3,1]).day(j),Pe=Te(this.weekdaysMin(se,"")),ut=Te(this.weekdaysShort(se,"")),$t=Te(this.weekdays(se,"")),p.push(Pe),w.push(ut),S.push($t),F.push(Pe),F.push(ut),F.push($t);p.sort(f),w.sort(f),S.sort(f),F.sort(f),this._weekdaysRegex=new RegExp("^("+F.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+p.join("|")+")","i")}function Sf(){return this.hours()%12||12}function y1(){return this.hours()||24}N("H",["HH",2],0,"hour"),N("h",["hh",2],0,Sf),N("k",["kk",2],0,y1),N("hmm",0,0,function(){return""+Sf.apply(this)+De(this.minutes(),2)}),N("hmmss",0,0,function(){return""+Sf.apply(this)+De(this.minutes(),2)+De(this.seconds(),2)}),N("Hmm",0,0,function(){return""+this.hours()+De(this.minutes(),2)}),N("Hmmss",0,0,function(){return""+this.hours()+De(this.minutes(),2)+De(this.seconds(),2)});function Fy(f,p){N(f,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),p)})}Fy("a",!0),Fy("A",!1),Rt("hour","h"),Bt("hour",13);function Iy(f,p){return p._meridiemParse}ae("a",Iy),ae("A",Iy),ae("H",L),ae("h",L),ae("k",L),ae("HH",L,Ht),ae("hh",L,Ht),ae("kk",L,Ht),ae("hmm",K),ae("hmmss",ee),ae("Hmm",K),ae("Hmmss",ee),We(["H","HH"],Yt),We(["k","kk"],function(f,p,w){var S=Z(f);p[Yt]=S===24?0:S}),We(["a","A"],function(f,p,w){w._isPm=w._locale.isPM(f),w._meridiem=f}),We(["h","hh"],function(f,p,w){p[Yt]=Z(f),g(w).bigHour=!0}),We("hmm",function(f,p,w){var S=f.length-2;p[Yt]=Z(f.substr(0,S)),p[Bn]=Z(f.substr(S)),g(w).bigHour=!0}),We("hmmss",function(f,p,w){var S=f.length-4,F=f.length-2;p[Yt]=Z(f.substr(0,S)),p[Bn]=Z(f.substr(S,2)),p[Er]=Z(f.substr(F)),g(w).bigHour=!0}),We("Hmm",function(f,p,w){var S=f.length-2;p[Yt]=Z(f.substr(0,S)),p[Bn]=Z(f.substr(S))}),We("Hmmss",function(f,p,w){var S=f.length-4,F=f.length-2;p[Yt]=Z(f.substr(0,S)),p[Bn]=Z(f.substr(S,2)),p[Er]=Z(f.substr(F))});function v1(f){return(f+"").toLowerCase().charAt(0)==="p"}var w1=/[ap]\.?m?\.?/i,b1=me("Hours",!0);function D1(f,p,w){return f>11?w?"pm":"PM":w?"am":"AM"}var Ay={calendar:be,longDateFormat:vt,invalidDate:Tt,ordinal:en,dayOfMonthOrdinalParse:gn,relativeTime:vn,months:T,monthsShort:V,week:q_,weekdays:t1,weekdaysMin:n1,weekdaysShort:Ty,meridiemParse:w1},tn={},Rs={},Hs;function S1(f,p){var w,S=Math.min(f.length,p.length);for(w=0;w0;){if(F=nu(j.slice(0,w).join("-")),F)return F;if(S&&S.length>=w&&S1(j,S)>=w-1)break;w--}p++}return Hs}function k1(f){return f.match("^[^/\\\\]*$")!=null}function nu(f){var p=null,w;if(tn[f]===void 0&&typeof ls!="undefined"&&ls&&ls.exports&&k1(f))try{p=Hs._abbr,w=require,w("./locale/"+f),na(p)}catch(S){tn[f]=null}return tn[f]}function na(f,p){var w;return f&&(s(p)?w=Ci(f):w=Ef(f,p),w?Hs=w:typeof console!="undefined"&&console.warn&&console.warn("Locale "+f+" not found. Did you forget to load it?")),Hs._abbr}function Ef(f,p){if(p!==null){var w,S=Ay;if(p.abbr=f,tn[f]!=null)J("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),S=tn[f]._config;else if(p.parentLocale!=null)if(tn[p.parentLocale]!=null)S=tn[p.parentLocale]._config;else if(w=nu(p.parentLocale),w!=null)S=w._config;else return Rs[p.parentLocale]||(Rs[p.parentLocale]=[]),Rs[p.parentLocale].push({name:f,config:p}),null;return tn[f]=new re(te(S,p)),Rs[f]&&Rs[f].forEach(function(F){Ef(F.name,F.config)}),na(f),tn[f]}else return delete tn[f],null}function x1(f,p){if(p!=null){var w,S,F=Ay;tn[f]!=null&&tn[f].parentLocale!=null?tn[f].set(te(tn[f]._config,p)):(S=nu(f),S!=null&&(F=S._config),p=te(F,p),S==null&&(p.abbr=f),w=new re(p),w.parentLocale=tn[f],tn[f]=w),na(f)}else tn[f]!=null&&(tn[f].parentLocale!=null?(tn[f]=tn[f].parentLocale,f===na()&&na(f)):tn[f]!=null&&delete tn[f]);return tn[f]}function Ci(f){var p;if(f&&f._locale&&f._locale._abbr&&(f=f._locale._abbr),!f)return Hs;if(!n(f)){if(p=nu(f),p)return p;f=[f]}return E1(f)}function C1(){return ne(tn)}function kf(f){var p,w=f._a;return w&&g(f).overflow===-2&&(p=w[or]<0||w[or]>11?or:w[sr]<1||w[sr]>b(w[Ot],w[or])?sr:w[Yt]<0||w[Yt]>24||w[Yt]===24&&(w[Bn]!==0||w[Er]!==0||w[Gr]!==0)?Yt:w[Bn]<0||w[Bn]>59?Bn:w[Er]<0||w[Er]>59?Er:w[Gr]<0||w[Gr]>999?Gr:-1,g(f)._overflowDayOfYear&&(psr)&&(p=sr),g(f)._overflowWeeks&&p===-1&&(p=tu),g(f)._overflowWeekday&&p===-1&&(p=z),g(f).overflow=p),f}var _1=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,M1=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,T1=/Z|[+-]\d\d(?::?\d\d)?/,ru=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],xf=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],F1=/^\/?Date\((-?\d+)/i,I1=/^(?:(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{4}))$/,A1={UT:0,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 Ly(f){var p,w,S=f._i,F=_1.exec(S)||M1.exec(S),j,se,Pe,ut,$t=ru.length,lr=xf.length;if(F){for(g(f).iso=!0,p=0,w=$t;pqt(se)||f._dayOfYear===0)&&(g(f)._overflowDayOfYear=!0),w=kr(se,0,f._dayOfYear),f._a[or]=w.getUTCMonth(),f._a[sr]=w.getUTCDate()),p=0;p<3&&f._a[p]==null;++p)f._a[p]=S[p]=F[p];for(;p<7;p++)f._a[p]=S[p]=f._a[p]==null?p===2?1:0:f._a[p];f._a[Yt]===24&&f._a[Bn]===0&&f._a[Er]===0&&f._a[Gr]===0&&(f._nextDay=!0,f._a[Yt]=0),f._d=(f._useUTC?kr:ki).apply(null,S),j=f._useUTC?f._d.getUTCDay():f._d.getDay(),f._tzm!=null&&f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),f._nextDay&&(f._a[Yt]=24),f._w&&typeof f._w.d!="undefined"&&f._w.d!==j&&(g(f).weekdayMismatch=!0)}}function V1(f){var p,w,S,F,j,se,Pe,ut,$t;p=f._w,p.GG!=null||p.W!=null||p.E!=null?(j=1,se=4,w=bo(p.GG,f._a[Ot],Ns(Zt(),1,4).year),S=bo(p.W,1),F=bo(p.E,1),(F<1||F>7)&&(ut=!0)):(j=f._locale._week.dow,se=f._locale._week.doy,$t=Ns(Zt(),j,se),w=bo(p.gg,f._a[Ot],$t.year),S=bo(p.w,$t.week),p.d!=null?(F=p.d,(F<0||F>6)&&(ut=!0)):p.e!=null?(F=p.e+j,(p.e<0||p.e>6)&&(ut=!0)):F=j),S<1||S>xi(w,j,se)?g(f)._overflowWeeks=!0:ut!=null?g(f)._overflowWeekday=!0:(Pe=My(w,S,F,j,se),f._a[Ot]=Pe.year,f._dayOfYear=Pe.dayOfYear)}t.ISO_8601=function(){},t.RFC_2822=function(){};function _f(f){if(f._f===t.ISO_8601){Ly(f);return}if(f._f===t.RFC_2822){Py(f);return}f._a=[],g(f).empty=!0;var p=""+f._i,w,S,F,j,se,Pe=p.length,ut=0,$t,lr;for(F=jt(f._f,f._locale).match(Ce)||[],lr=F.length,w=0;w0&&g(f).unusedInput.push(se),p=p.slice(p.indexOf(S)+S.length),ut+=S.length),it[j]?(S?g(f).empty=!1:g(f).unusedTokens.push(j),Hn(j,S,f)):f._strict&&!S&&g(f).unusedTokens.push(j);g(f).charsLeftOver=Pe-ut,p.length>0&&g(f).unusedInput.push(p),f._a[Yt]<=12&&g(f).bigHour===!0&&f._a[Yt]>0&&(g(f).bigHour=void 0),g(f).parsedDateParts=f._a.slice(0),g(f).meridiem=f._meridiem,f._a[Yt]=$1(f._locale,f._a[Yt],f._meridiem),$t=g(f).era,$t!==null&&(f._a[Ot]=f._locale.erasConvertYear($t,f._a[Ot])),Cf(f),kf(f)}function $1(f,p,w){var S;return w==null?p:f.meridiemHour!=null?f.meridiemHour(p,w):(f.isPM!=null&&(S=f.isPM(w),S&&p<12&&(p+=12),!S&&p===12&&(p=0)),p)}function U1(f){var p,w,S,F,j,se,Pe=!1,ut=f._f.length;if(ut===0){g(f).invalidFormat=!0,f._d=new Date(NaN);return}for(F=0;Fthis?this:f:D()});function Hy(f,p){var w,S;if(p.length===1&&n(p[0])&&(p=p[0]),!p.length)return Zt();for(w=p[0],S=1;Sthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function uM(){if(!s(this._isDSTShifted))return this._isDSTShifted;var f={},p;return x(f,this),f=Ny(f),f._a?(p=f._isUTC?m(f._a):Zt(f._a),this._isDSTShifted=this.isValid()&&eM(f._a,p.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function cM(){return this.isValid()?!this._isUTC:!1}function dM(){return this.isValid()?this._isUTC:!1}function Vy(){return this.isValid()?this._isUTC&&this._offset===0:!1}var fM=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,hM=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Zr(f,p){var w=f,S=null,F,j,se;return au(f)?w={ms:f._milliseconds,d:f._days,M:f._months}:u(f)||!isNaN(+f)?(w={},p?w[p]=+f:w.milliseconds=+f):(S=fM.exec(f))?(F=S[1]==="-"?-1:1,w={y:0,d:Z(S[sr])*F,h:Z(S[Yt])*F,m:Z(S[Bn])*F,s:Z(S[Er])*F,ms:Z(Mf(S[Gr]*1e3))*F}):(S=hM.exec(f))?(F=S[1]==="-"?-1:1,w={y:Ha(S[2],F),M:Ha(S[3],F),w:Ha(S[4],F),d:Ha(S[5],F),h:Ha(S[6],F),m:Ha(S[7],F),s:Ha(S[8],F)}):w==null?w={}:typeof w=="object"&&("from"in w||"to"in w)&&(se=mM(Zt(w.from),Zt(w.to)),w={},w.ms=se.milliseconds,w.M=se.months),j=new iu(w),au(f)&&a(f,"_locale")&&(j._locale=f._locale),au(f)&&a(f,"_isValid")&&(j._isValid=f._isValid),j}Zr.fn=iu.prototype,Zr.invalid=X1;function Ha(f,p){var w=f&&parseFloat(f.replace(",","."));return(isNaN(w)?0:w)*p}function $y(f,p){var w={};return w.months=p.month()-f.month()+(p.year()-f.year())*12,f.clone().add(w.months,"M").isAfter(p)&&--w.months,w.milliseconds=+p-+f.clone().add(w.months,"M"),w}function mM(f,p){var w;return f.isValid()&&p.isValid()?(p=Ff(p,f),f.isBefore(p)?w=$y(f,p):(w=$y(p,f),w.milliseconds=-w.milliseconds,w.months=-w.months),w):{milliseconds:0,months:0}}function Uy(f,p){return function(w,S){var F,j;return S!==null&&!isNaN(+S)&&(J(p,"moment()."+p+"(period, number) is deprecated. Please use moment()."+p+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),j=w,w=S,S=j),F=Zr(w,S),Wy(this,F,f),this}}function Wy(f,p,w,S){var F=p._milliseconds,j=Mf(p._days),se=Mf(p._months);f.isValid()&&(S=S==null?!0:S,se&&Qe(f,Ie(f,"Month")+se*w),j&&at(f,"Date",Ie(f,"Date")+j*w),F&&f._d.setTime(f._d.valueOf()+F*w),S&&t.updateOffset(f,j||se))}var pM=Uy(1,"add"),gM=Uy(-1,"subtract");function Yy(f){return typeof f=="string"||f instanceof String}function yM(f){return A(f)||l(f)||Yy(f)||u(f)||wM(f)||vM(f)||f===null||f===void 0}function vM(f){var p=i(f)&&!o(f),w=!1,S=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],F,j,se=S.length;for(F=0;Fw.valueOf():w.valueOf()9999?Mt(w,p?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Q(Date.prototype.toISOString)?p?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Mt(w,"Z")):Mt(w,p?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function OM(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var f="moment",p="",w,S,F,j;return this.isLocal()||(f=this.utcOffset()===0?"moment.utc":"moment.parseZone",p="Z"),w="["+f+'("]',S=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",F="-MM-DD[T]HH:mm:ss.SSS",j=p+'[")]',this.format(w+S+F+j)}function LM(f){f||(f=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var p=Mt(this,f);return this.localeData().postformat(p)}function PM(f,p){return this.isValid()&&(A(f)&&f.isValid()||Zt(f).isValid())?Zr({to:this,from:f}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function NM(f){return this.from(Zt(),f)}function RM(f,p){return this.isValid()&&(A(f)&&f.isValid()||Zt(f).isValid())?Zr({from:this,to:f}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function HM(f){return this.to(Zt(),f)}function zy(f){var p;return f===void 0?this._locale._abbr:(p=Ci(f),p!=null&&(this._locale=p),this)}var Ky=B("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(f){return f===void 0?this.localeData():this.locale(f)});function jy(){return this._locale}var su=1e3,Do=60*su,lu=60*Do,qy=(365*400+97)*24*lu;function So(f,p){return(f%p+p)%p}function Gy(f,p,w){return f<100&&f>=0?new Date(f+400,p,w)-qy:new Date(f,p,w).valueOf()}function Jy(f,p,w){return f<100&&f>=0?Date.UTC(f+400,p,w)-qy:Date.UTC(f,p,w)}function BM(f){var p,w;if(f=Vt(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?Jy:Gy,f){case"year":p=w(this.year(),0,1);break;case"quarter":p=w(this.year(),this.month()-this.month()%3,1);break;case"month":p=w(this.year(),this.month(),1);break;case"week":p=w(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":p=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":p=w(this.year(),this.month(),this.date());break;case"hour":p=this._d.valueOf(),p-=So(p+(this._isUTC?0:this.utcOffset()*Do),lu);break;case"minute":p=this._d.valueOf(),p-=So(p,Do);break;case"second":p=this._d.valueOf(),p-=So(p,su);break}return this._d.setTime(p),t.updateOffset(this,!0),this}function VM(f){var p,w;if(f=Vt(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?Jy:Gy,f){case"year":p=w(this.year()+1,0,1)-1;break;case"quarter":p=w(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":p=w(this.year(),this.month()+1,1)-1;break;case"week":p=w(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":p=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":p=w(this.year(),this.month(),this.date()+1)-1;break;case"hour":p=this._d.valueOf(),p+=lu-So(p+(this._isUTC?0:this.utcOffset()*Do),lu)-1;break;case"minute":p=this._d.valueOf(),p+=Do-So(p,Do)-1;break;case"second":p=this._d.valueOf(),p+=su-So(p,su)-1;break}return this._d.setTime(p),t.updateOffset(this,!0),this}function $M(){return this._d.valueOf()-(this._offset||0)*6e4}function UM(){return Math.floor(this.valueOf()/1e3)}function WM(){return new Date(this.valueOf())}function YM(){var f=this;return[f.year(),f.month(),f.date(),f.hour(),f.minute(),f.second(),f.millisecond()]}function zM(){var f=this;return{years:f.year(),months:f.month(),date:f.date(),hours:f.hours(),minutes:f.minutes(),seconds:f.seconds(),milliseconds:f.milliseconds()}}function KM(){return this.isValid()?this.toISOString():null}function jM(){return v(this)}function qM(){return d({},g(this))}function GM(){return g(this).overflow}function JM(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}N("N",0,0,"eraAbbr"),N("NN",0,0,"eraAbbr"),N("NNN",0,0,"eraAbbr"),N("NNNN",0,0,"eraName"),N("NNNNN",0,0,"eraNarrow"),N("y",["y",1],"yo","eraYear"),N("y",["yy",2],0,"eraYear"),N("y",["yyy",3],0,"eraYear"),N("y",["yyyy",4],0,"eraYear"),ae("N",Af),ae("NN",Af),ae("NNN",Af),ae("NNNN",sT),ae("NNNNN",lT),We(["N","NN","NNN","NNNN","NNNNN"],function(f,p,w,S){var F=w._locale.erasParse(f,S,w._strict);F?g(w).era=F:g(w).invalidEra=f}),ae("y",ge),ae("yy",ge),ae("yyy",ge),ae("yyyy",ge),ae("yo",uT),We(["y","yy","yyy","yyyy"],Ot),We(["yo"],function(f,p,w,S){var F;w._locale._eraYearOrdinalRegex&&(F=f.match(w._locale._eraYearOrdinalRegex)),w._locale.eraYearOrdinalParse?p[Ot]=w._locale.eraYearOrdinalParse(f,F):p[Ot]=parseInt(f,10)});function ZM(f,p){var w,S,F,j=this._eras||Ci("en")._eras;for(w=0,S=j.length;w=0)return j[S]}function XM(f,p){var w=f.since<=f.until?1:-1;return p===void 0?t(f.since).year():t(f.since).year()+(p-f.offset)*w}function eT(){var f,p,w,S=this.localeData().eras();for(f=0,p=S.length;fj&&(p=j),gT.call(this,f,p,w,S,F))}function gT(f,p,w,S,F){var j=My(f,p,w,S,F),se=kr(j.year,0,j.dayOfYear);return this.year(se.getUTCFullYear()),this.month(se.getUTCMonth()),this.date(se.getUTCDate()),this}N("Q",0,"Qo","quarter"),Rt("quarter","Q"),Bt("quarter",7),ae("Q",_n),We("Q",function(f,p){p[or]=(Z(f)-1)*3});function yT(f){return f==null?Math.ceil((this.month()+1)/3):this.month((f-1)*3+this.month()%3)}N("D",["DD",2],"Do","date"),Rt("date","D"),Bt("date",9),ae("D",L),ae("DD",L,Ht),ae("Do",function(f,p){return f?p._dayOfMonthOrdinalParse||p._ordinalParse:p._dayOfMonthOrdinalParseLenient}),We(["D","DD"],sr),We("Do",function(f,p){p[sr]=Z(f.match(L)[0])});var Qy=me("Date",!0);N("DDD",["DDDD",3],"DDDo","dayOfYear"),Rt("dayOfYear","DDD"),Bt("dayOfYear",4),ae("DDD",ue),ae("DDDD",ar),We(["DDD","DDDD"],function(f,p,w){w._dayOfYear=Z(f)});function vT(f){var p=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return f==null?p:this.add(f-p,"d")}N("m",["mm",2],0,"minute"),Rt("minute","m"),Bt("minute",14),ae("m",L),ae("mm",L,Ht),We(["m","mm"],Bn);var wT=me("Minutes",!1);N("s",["ss",2],0,"second"),Rt("second","s"),Bt("second",15),ae("s",L),ae("ss",L,Ht),We(["s","ss"],Er);var bT=me("Seconds",!1);N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return this.millisecond()*10}),N(0,["SSSSS",5],0,function(){return this.millisecond()*100}),N(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),N(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),N(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),N(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Rt("millisecond","ms"),Bt("millisecond",16),ae("S",ue,_n),ae("SS",ue,Ht),ae("SSS",ue,ar);var ra,Xy;for(ra="SSSS";ra.length<=9;ra+="S")ae(ra,ge);function DT(f,p){p[Gr]=Z(("0."+f)*1e3)}for(ra="S";ra.length<=9;ra+="S")We(ra,DT);Xy=me("Milliseconds",!1),N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");function ST(){return this._isUTC?"UTC":""}function ET(){return this._isUTC?"Coordinated Universal Time":""}var we=O.prototype;we.add=pM,we.calendar=SM,we.clone=EM,we.diff=FM,we.endOf=VM,we.format=LM,we.from=PM,we.fromNow=NM,we.to=RM,we.toNow=HM,we.get=Dt,we.invalidAt=GM,we.isAfter=kM,we.isBefore=xM,we.isBetween=CM,we.isSame=_M,we.isSameOrAfter=MM,we.isSameOrBefore=TM,we.isValid=jM,we.lang=Ky,we.locale=zy,we.localeData=jy,we.max=j1,we.min=K1,we.parsingFlags=qM,we.set=Cn,we.startOf=BM,we.subtract=gM,we.toArray=YM,we.toObject=zM,we.toDate=WM,we.toISOString=AM,we.inspect=OM,typeof Symbol!="undefined"&&Symbol.for!=null&&(we[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),we.toJSON=KM,we.toString=IM,we.unix=UM,we.valueOf=$M,we.creationData=JM,we.eraName=eT,we.eraNarrow=tT,we.eraAbbr=nT,we.eraYear=rT,we.year=On,we.isLeapYear=Vn,we.weekYear=cT,we.isoWeekYear=dT,we.quarter=we.quarters=yT,we.month=ot,we.daysInMonth=qe,we.week=we.weeks=Z_,we.isoWeek=we.isoWeeks=Q_,we.weeksInYear=mT,we.weeksInWeekYear=pT,we.isoWeeksInYear=fT,we.isoWeeksInISOWeekYear=hT,we.date=Qy,we.day=we.days=d1,we.weekday=f1,we.isoWeekday=h1,we.dayOfYear=vT,we.hour=we.hours=b1,we.minute=we.minutes=wT,we.second=we.seconds=bT,we.millisecond=we.milliseconds=Xy,we.utcOffset=nM,we.utc=iM,we.local=aM,we.parseZone=oM,we.hasAlignedHourOffset=sM,we.isDST=lM,we.isLocal=cM,we.isUtcOffset=dM,we.isUtc=Vy,we.isUTC=Vy,we.zoneAbbr=ST,we.zoneName=ET,we.dates=B("dates accessor is deprecated. Use date instead.",Qy),we.months=B("months accessor is deprecated. Use month instead",ot),we.years=B("years accessor is deprecated. Use year instead",On),we.zone=B("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",rM),we.isDSTShifted=B("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",uM);function kT(f){return Zt(f*1e3)}function xT(){return Zt.apply(null,arguments).parseZone()}function ev(f){return f}var Lt=re.prototype;Lt.calendar=pe,Lt.longDateFormat=Wt,Lt.invalidDate=Jt,Lt.ordinal=yn,Lt.preparse=ev,Lt.postformat=ev,Lt.relativeTime=xn,Lt.pastFuture=jn,Lt.set=oe,Lt.eras=ZM,Lt.erasParse=QM,Lt.erasConvertYear=XM,Lt.erasAbbrRegex=aT,Lt.erasNameRegex=iT,Lt.erasNarrowRegex=oT,Lt.months=he,Lt.monthsShort=Me,Lt.monthsParse=Le,Lt.monthsRegex=st,Lt.monthsShortRegex=yt,Lt.week=j_,Lt.firstDayOfYear=J_,Lt.firstDayOfWeek=G_,Lt.weekdays=o1,Lt.weekdaysMin=l1,Lt.weekdaysShort=s1,Lt.weekdaysParse=c1,Lt.weekdaysRegex=m1,Lt.weekdaysShortRegex=p1,Lt.weekdaysMinRegex=g1,Lt.isPM=v1,Lt.meridiem=D1;function cu(f,p,w,S){var F=Ci(),j=m().set(S,p);return F[w](j,f)}function tv(f,p,w){if(u(f)&&(p=f,f=void 0),f=f||"",p!=null)return cu(f,p,w,"month");var S,F=[];for(S=0;S<12;S++)F[S]=cu(f,S,w,"month");return F}function Lf(f,p,w,S){typeof f=="boolean"?(u(p)&&(w=p,p=void 0),p=p||""):(p=f,w=p,f=!1,u(p)&&(w=p,p=void 0),p=p||"");var F=Ci(),j=f?F._week.dow:0,se,Pe=[];if(w!=null)return cu(p,(w+j)%7,S,"day");for(se=0;se<7;se++)Pe[se]=cu(p,(se+j)%7,S,"day");return Pe}function CT(f,p){return tv(f,p,"months")}function _T(f,p){return tv(f,p,"monthsShort")}function MT(f,p,w){return Lf(f,p,w,"weekdays")}function TT(f,p,w){return Lf(f,p,w,"weekdaysShort")}function FT(f,p,w){return Lf(f,p,w,"weekdaysMin")}na("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(f){var p=f%10,w=Z(f%100/10)===1?"th":p===1?"st":p===2?"nd":p===3?"rd":"th";return f+w}}),t.lang=B("moment.lang is deprecated. Use moment.locale instead.",na),t.langData=B("moment.langData is deprecated. Use moment.localeData instead.",Ci);var _i=Math.abs;function IT(){var f=this._data;return this._milliseconds=_i(this._milliseconds),this._days=_i(this._days),this._months=_i(this._months),f.milliseconds=_i(f.milliseconds),f.seconds=_i(f.seconds),f.minutes=_i(f.minutes),f.hours=_i(f.hours),f.months=_i(f.months),f.years=_i(f.years),this}function nv(f,p,w,S){var F=Zr(p,w);return f._milliseconds+=S*F._milliseconds,f._days+=S*F._days,f._months+=S*F._months,f._bubble()}function AT(f,p){return nv(this,f,p,1)}function OT(f,p){return nv(this,f,p,-1)}function rv(f){return f<0?Math.floor(f):Math.ceil(f)}function LT(){var f=this._milliseconds,p=this._days,w=this._months,S=this._data,F,j,se,Pe,ut;return f>=0&&p>=0&&w>=0||f<=0&&p<=0&&w<=0||(f+=rv(Pf(w)+p)*864e5,p=0,w=0),S.milliseconds=f%1e3,F=At(f/1e3),S.seconds=F%60,j=At(F/60),S.minutes=j%60,se=At(j/60),S.hours=se%24,p+=At(se/24),ut=At(iv(p)),w+=ut,p-=rv(Pf(ut)),Pe=At(w/12),w%=12,S.days=p,S.months=w,S.years=Pe,this}function iv(f){return f*4800/146097}function Pf(f){return f*146097/4800}function PT(f){if(!this.isValid())return NaN;var p,w,S=this._milliseconds;if(f=Vt(f),f==="month"||f==="quarter"||f==="year")switch(p=this._days+S/864e5,w=this._months+iv(p),f){case"month":return w;case"quarter":return w/3;case"year":return w/12}else switch(p=this._days+Math.round(Pf(this._months)),f){case"week":return p/7+S/6048e5;case"day":return p+S/864e5;case"hour":return p*24+S/36e5;case"minute":return p*1440+S/6e4;case"second":return p*86400+S/1e3;case"millisecond":return Math.floor(p*864e5)+S;default:throw new Error("Unknown unit "+f)}}function NT(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Z(this._months/12)*31536e6:NaN}function Mi(f){return function(){return this.as(f)}}var RT=Mi("ms"),HT=Mi("s"),BT=Mi("m"),VT=Mi("h"),$T=Mi("d"),UT=Mi("w"),WT=Mi("M"),YT=Mi("Q"),zT=Mi("y");function KT(){return Zr(this)}function jT(f){return f=Vt(f),this.isValid()?this[f+"s"]():NaN}function Ba(f){return function(){return this.isValid()?this._data[f]:NaN}}var qT=Ba("milliseconds"),GT=Ba("seconds"),JT=Ba("minutes"),ZT=Ba("hours"),QT=Ba("days"),XT=Ba("months"),eF=Ba("years");function tF(){return At(this.days()/7)}var Ti=Math.round,Eo={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function nF(f,p,w,S,F){return F.relativeTime(p||1,!!w,f,S)}function rF(f,p,w,S){var F=Zr(f).abs(),j=Ti(F.as("s")),se=Ti(F.as("m")),Pe=Ti(F.as("h")),ut=Ti(F.as("d")),$t=Ti(F.as("M")),lr=Ti(F.as("w")),Fi=Ti(F.as("y")),ia=j<=w.ss&&["s",j]||j0,ia[4]=S,nF.apply(null,ia)}function iF(f){return f===void 0?Ti:typeof f=="function"?(Ti=f,!0):!1}function aF(f,p){return Eo[f]===void 0?!1:p===void 0?Eo[f]:(Eo[f]=p,f==="s"&&(Eo.ss=p-1),!0)}function oF(f,p){if(!this.isValid())return this.localeData().invalidDate();var w=!1,S=Eo,F,j;return typeof f=="object"&&(p=f,f=!1),typeof f=="boolean"&&(w=f),typeof p=="object"&&(S=Object.assign({},Eo,p),p.s!=null&&p.ss==null&&(S.ss=p.s-1)),F=this.localeData(),j=rF(this,!w,S,F),w&&(j=F.pastFuture(+this,j)),F.postformat(j)}var Nf=Math.abs;function ko(f){return(f>0)-(f<0)||+f}function du(){if(!this.isValid())return this.localeData().invalidDate();var f=Nf(this._milliseconds)/1e3,p=Nf(this._days),w=Nf(this._months),S,F,j,se,Pe=this.asSeconds(),ut,$t,lr,Fi;return Pe?(S=At(f/60),F=At(S/60),f%=60,S%=60,j=At(w/12),w%=12,se=f?f.toFixed(3).replace(/\.?0+$/,""):"",ut=Pe<0?"-":"",$t=ko(this._months)!==ko(Pe)?"-":"",lr=ko(this._days)!==ko(Pe)?"-":"",Fi=ko(this._milliseconds)!==ko(Pe)?"-":"",ut+"P"+(j?$t+j+"Y":"")+(w?$t+w+"M":"")+(p?lr+p+"D":"")+(F||S||f?"T":"")+(F?Fi+F+"H":"")+(S?Fi+S+"M":"")+(f?Fi+se+"S":"")):"P0D"}var xt=iu.prototype;xt.isValid=Q1,xt.abs=IT,xt.add=AT,xt.subtract=OT,xt.as=PT,xt.asMilliseconds=RT,xt.asSeconds=HT,xt.asMinutes=BT,xt.asHours=VT,xt.asDays=$T,xt.asWeeks=UT,xt.asMonths=WT,xt.asQuarters=YT,xt.asYears=zT,xt.valueOf=NT,xt._bubble=LT,xt.clone=KT,xt.get=jT,xt.milliseconds=qT,xt.seconds=GT,xt.minutes=JT,xt.hours=ZT,xt.days=QT,xt.weeks=tF,xt.months=XT,xt.years=eF,xt.humanize=oF,xt.toISOString=du,xt.toString=du,xt.toJSON=du,xt.locale=zy,xt.localeData=jy,xt.toIsoString=B("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",du),xt.lang=Ky,N("X",0,0,"unix"),N("x",0,0,"valueOf"),ae("x",M),ae("X",ie),We("X",function(f,p,w){w._d=new Date(parseFloat(f)*1e3)}),We("x",function(f,p,w){w._d=new Date(Z(f))});return t.version="2.29.4",r(Zt),t.fn=we,t.min=q1,t.max=G1,t.now=J1,t.utc=m,t.unix=kT,t.months=CT,t.isDate=l,t.locale=na,t.invalid=D,t.duration=Zr,t.isMoment=A,t.weekdays=MT,t.parseZone=xT,t.localeData=Ci,t.isDuration=au,t.monthsShort=_T,t.weekdaysMin=FT,t.defineLocale=Ef,t.updateLocale=x1,t.locales=C1,t.weekdaysShort=TT,t.normalizeUnits=Vt,t.relativeTimeRounding=iF,t.relativeTimeThreshold=aF,t.calendarFormat=DM,t.prototype=we,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t})});var dx=wn((Fd,_g)=>{(function(t,r){typeof Fd=="object"&&typeof _g=="object"?_g.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Fd=="object"?Fd.Choices=r():t.Choices=r()})(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(n,i,a){r.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:a})},r.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,i){if(i&1&&(n=r(n)),i&8||i&4&&typeof n=="object"&&n&&n.__esModule)return n;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),i&2&&typeof n!="string")for(var o in n)r.d(a,o,function(s){return n[s]}.bind(null,o));return a},r.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(i,"a",i),i},r.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},r.p="/public/assets/scripts/",r(r.s=4)}([function(e,t,r){"use strict";var n=function(x){return i(x)&&!a(x)};function i(C){return!!C&&typeof C=="object"}function a(C){var x=Object.prototype.toString.call(C);return x==="[object RegExp]"||x==="[object Date]"||u(C)}var o=typeof Symbol=="function"&&Symbol.for,s=o?Symbol.for("react.element"):60103;function u(C){return C.$$typeof===s}function l(C){return Array.isArray(C)?[]:{}}function c(C,x){return x.clone!==!1&&x.isMergeableObject(C)?D(l(C),C,x):C}function d(C,x,O){return C.concat(x).map(function(A){return c(A,O)})}function m(C,x){if(!x.customMerge)return D;var O=x.customMerge(C);return typeof O=="function"?O:D}function h(C){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(C).filter(function(x){return C.propertyIsEnumerable(x)}):[]}function g(C){return Object.keys(C).concat(h(C))}function y(C,x){try{return x in C&&!(Object.hasOwnProperty.call(C,x)&&Object.propertyIsEnumerable.call(C,x))}catch(O){return!1}}function v(C,x,O){var A={};return O.isMergeableObject(C)&&g(C).forEach(function(P){A[P]=c(C[P],O)}),g(x).forEach(function(P){y(C,P)||(!O.isMergeableObject(x[P])||!C[P]?A[P]=c(x[P],O):A[P]=m(P,O)(C[P],x[P],O))}),A}function D(C,x,O){O=O||{},O.arrayMerge=O.arrayMerge||d,O.isMergeableObject=O.isMergeableObject||n,O.cloneUnlessOtherwiseSpecified=c;var A=Array.isArray(x),P=Array.isArray(C),B=A===P;return B?A?O.arrayMerge(C,x,O):v(C,x,O):c(x,O)}D.all=function(x,O){if(!Array.isArray(x))throw new Error("first argument should be an array");return x.reduce(function(A,P){return D(A,P,O)},{})};var I=D;e.exports=I},function(e,t,r){"use strict";(function(n,i){var a=r(3),o;typeof self!="undefined"?o=self:typeof window!="undefined"?o=window:typeof n!="undefined"?o=n:o=i;var s=Object(a.a)(o);t.a=s}).call(this,r(5),r(6)(e))},function(e,t,r){(function(n,i){e.exports=i()})(this,function(){return function(n){var i={};function a(o){if(i[o])return i[o].exports;var s=i[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=n,a.c=i,a.d=function(o,s,u){a.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:u})},a.r=function(o){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},a.t=function(o,s){if(1&s&&(o=a(o)),8&s||4&s&&typeof o=="object"&&o&&o.__esModule)return o;var u=Object.create(null);if(a.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:o}),2&s&&typeof o!="string")for(var l in o)a.d(u,l,function(c){return o[c]}.bind(null,l));return u},a.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(s,"a",s),s},a.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},a.p="",a(a.s=1)}([function(n,i){n.exports=function(a){return Array.isArray?Array.isArray(a):Object.prototype.toString.call(a)==="[object Array]"}},function(n,i,a){function o(m){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h})(m)}function s(m,h){for(var g=0;g1&&arguments[1]!==void 0?arguments[1]:{limit:!1};this._log(`--------- +Search pattern: "`.concat(v,'"'));var I=this._prepareSearchers(v),C=I.tokenSearchers,x=I.fullSearcher,O=this._search(C,x),A=O.weights,P=O.results;return this._computeScore(A,P),this.options.shouldSort&&this._sort(P),D.limit&&typeof D.limit=="number"&&(P=P.slice(0,D.limit)),this._format(P)}},{key:"_prepareSearchers",value:function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",D=[];if(this.options.tokenize)for(var I=v.split(this.options.tokenSeparator),C=0,x=I.length;C0&&arguments[0]!==void 0?arguments[0]:[],D=arguments.length>1?arguments[1]:void 0,I=this.list,C={},x=[];if(typeof I[0]=="string"){for(var O=0,A=I.length;O1)throw new Error("Key weight has to be > 0 and <= 1");te=te.name}else P[te]={weight:1};this._analyze({key:te,value:this.options.getFn(J,te),record:J,index:B},{resultMap:C,results:x,tokenSearchers:v,fullSearcher:D})}return{weights:P,results:x}}},{key:"_analyze",value:function(v,D){var I=v.key,C=v.arrayIndex,x=C===void 0?-1:C,O=v.value,A=v.record,P=v.index,B=D.tokenSearchers,G=B===void 0?[]:B,J=D.fullSearcher,Q=J===void 0?[]:J,oe=D.resultMap,te=oe===void 0?{}:oe,re=D.results,ne=re===void 0?[]:re;if(O!=null){var be=!1,pe=-1,De=0;if(typeof O=="string"){this._log(` +Key: `.concat(I===""?"-":I));var Ce=Q.search(O);if(this._log('Full text: "'.concat(O,'", score: ').concat(Ce.score)),this.options.tokenize){for(var U=O.split(this.options.tokenSeparator),Je=[],it=0;it-1&&(Jt=(Jt+pe)/2),this._log("Score average:",Jt);var en=!this.options.tokenize||!this.options.matchAllTokens||De>=G.length;if(this._log(` +Check Matches: `.concat(en)),(be||Ce.isMatch)&&en){var gn=te[P];gn?gn.output.push({key:I,arrayIndex:x,value:O,score:Jt,matchedIndices:Ce.matchedIndices}):(te[P]={item:A,output:[{key:I,arrayIndex:x,value:O,score:Jt,matchedIndices:Ce.matchedIndices}]},ne.push(te[P]))}}else if(c(O))for(var yn=0,vn=O.length;yn-1&&(be.arrayIndex=ne.arrayIndex),Q.matches.push(be)}}}),this.options.includeScore&&C.push(function(J,Q){Q.score=J.score});for(var x=0,O=v.length;xD)return s(y,this.pattern,I);var C=this.options,x=C.location,O=C.distance,A=C.threshold,P=C.findAllMatches,B=C.minMatchCharLength;return u(y,this.pattern,this.patternAlphabet,{location:x,distance:O,threshold:A,findAllMatches:P,minMatchCharLength:B})}}])&&o(m.prototype,h),g&&o(m,g),d}();n.exports=c},function(n,i){var a=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;n.exports=function(o,s){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:/ +/g,l=new RegExp(s.replace(a,"\\$&").replace(u,"|")),c=o.match(l),d=!!c,m=[];if(d)for(var h=0,g=c.length;h=it;It-=1){var Mt=It-1,jt=c[u.charAt(Mt)];if(jt&&(Q[Mt]=1),Ze[It]=(Ze[It+1]<<1|1)&jt,Ce!==0&&(Ze[It]|=(ne[It+1]|ne[It])<<1|1|ne[It+1]),Ze[It]&De&&(be=o(l,{errors:Ce,currentLocation:Mt,expectedLocation:A,distance:y}))<=B){if(B=be,(G=Mt)<=A)break;it=Math.max(1,2*A-G)}}if(o(l,{errors:Ce+1,currentLocation:A,expectedLocation:A,distance:y})>B)break;ne=Ze}return{isMatch:G>=0,score:be===0?.001:be,matchedIndices:s(Q,O)}}},function(n,i){n.exports=function(a,o){var s=o.errors,u=s===void 0?0:s,l=o.currentLocation,c=l===void 0?0:l,d=o.expectedLocation,m=d===void 0?0:d,h=o.distance,g=h===void 0?100:h,y=u/a.length,v=Math.abs(m-c);return g?y+v/g:v?1:y}},function(n,i){n.exports=function(){for(var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,s=[],u=-1,l=-1,c=0,d=a.length;c=o&&s.push([u,l]),u=-1)}return a[c-1]&&c-u>=o&&s.push([u,c-1]),s}},function(n,i){n.exports=function(a){for(var o={},s=a.length,u=0;u0)return"Unexpected "+(Y.length>1?"keys":"key")+" "+('"'+Y.join('", "')+'" found in '+V+". ")+"Expected to find one of the known reducer keys instead: "+('"'+T.join('", "')+'". Unexpected keys will be ignored.')}function y(z){Object.keys(z).forEach(function(k){var _=z[k],b=_(void 0,{type:l.INIT});if(typeof b=="undefined")throw new Error('Reducer "'+k+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof _(void 0,{type:l.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error('Reducer "'+k+'" returned undefined when probed with a random type. '+("Don't try to handle "+l.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}function v(z){for(var k=Object.keys(z),_={},b=0;b-1?z.map(function(_){var b=_;return b.id===parseInt(k.choiceId,10)&&(b.selected=!0),b}):z;case"REMOVE_ITEM":return k.choiceId>-1?z.map(function(_){var b=_;return b.id===parseInt(k.choiceId,10)&&(b.selected=!1),b}):z;case"FILTER_CHOICES":return z.map(function(_){var b=_;return b.active=k.results.some(function(T){var V=T.item,Y=T.score;return V.id===b.id?(b.score=Y,!0):!1}),b});case"ACTIVATE_CHOICES":return z.map(function(_){var b=_;return b.active=k.active,b});case"CLEAR_CHOICES":return te;default:return z}}var ne={loading:!1},be=function(k,_){switch(k===void 0&&(k=ne),_.type){case"SET_IS_LOADING":return{loading:_.isLoading};default:return k}},pe=be,De=function(k,_){return Math.floor(Math.random()*(_-k)+k)},Ce=function(k){return Array.from({length:k},function(){return De(0,36).toString(36)}).join("")},U=function(k,_){var b=k.id||k.name&&k.name+"-"+Ce(2)||Ce(4);return b=b.replace(/(:|\.|\[|\]|,)/g,""),b=_+"-"+b,b},Je=function(k){return Object.prototype.toString.call(k).slice(8,-1)},it=function(k,_){return _!=null&&Je(_)===k},N=function(k,_){return _===void 0&&(_=document.createElement("div")),k.nextSibling?k.parentNode.insertBefore(_,k.nextSibling):k.parentNode.appendChild(_),_.appendChild(k)},Ze=function(k,_,b){if(b===void 0&&(b=1),!(!(k instanceof Element)||typeof _!="string")){for(var T=(b>0?"next":"previous")+"ElementSibling",V=k[T];V;){if(V.matches(_))return V;V=V[T]}return V}},It=function(k,_,b){if(b===void 0&&(b=1),!k)return!1;var T;return b>0?T=_.scrollTop+_.offsetHeight>=k.offsetTop+k.offsetHeight:T=k.offsetTop>=_.scrollTop,T},Mt=function(k){return typeof k!="string"?k:k.replace(/&/g,"&").replace(/>/g,"&rt;").replace(/"'+Mt(k)+'"'},maxItemText:function(k){return"Only "+k+" values can be added"},valueComparer:function(k,_){return k===_},fuseOptions:{includeScore:!0},callbackOnInit:null,callbackOnCreateTemplates:null,classNames:Bt},rn={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice"},At={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL"},Z={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},me="text",Ie="select-one",at="select-multiple",Dt=4,Cn=function(){function z(_){var b=_.element,T=_.type,V=_.classNames,Y=_.position;this.element=b,this.classNames=V,this.type=T,this.position=Y,this.isOpen=!1,this.isFlipped=!1,this.isFocussed=!1,this.isDisabled=!1,this.isLoading=!1,this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}var k=z.prototype;return k.addEventListeners=function(){this.element.addEventListener("focus",this._onFocus),this.element.addEventListener("blur",this._onBlur)},k.removeEventListeners=function(){this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},k.shouldFlip=function(b){if(typeof b!="number")return!1;var T=!1;return this.position==="auto"?T=!window.matchMedia("(min-height: "+(b+1)+"px)").matches:this.position==="top"&&(T=!0),T},k.setActiveDescendant=function(b){this.element.setAttribute("aria-activedescendant",b)},k.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},k.open=function(b){this.element.classList.add(this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(b)&&(this.element.classList.add(this.classNames.flippedState),this.isFlipped=!0)},k.close=function(){this.element.classList.remove(this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(this.element.classList.remove(this.classNames.flippedState),this.isFlipped=!1)},k.focus=function(){this.isFocussed||this.element.focus()},k.addFocusState=function(){this.element.classList.add(this.classNames.focusState)},k.removeFocusState=function(){this.element.classList.remove(this.classNames.focusState)},k.enable=function(){this.element.classList.remove(this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===Ie&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},k.disable=function(){this.element.classList.add(this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===Ie&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},k.wrap=function(b){N(b,this.element)},k.unwrap=function(b){this.element.parentNode.insertBefore(b,this.element),this.element.parentNode.removeChild(this.element)},k.addLoadingState=function(){this.element.classList.add(this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},k.removeLoadingState=function(){this.element.classList.remove(this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},k._onFocus=function(){this.isFocussed=!0},k._onBlur=function(){this.isFocussed=!1},z}();function _n(z,k){for(var _=0;_0?this.element.scrollTop+he-X:b.offsetTop;activeWindow.requestAnimationFrame(function(){V._animateScroll(Me,T)})}},k._scrollDown=function(b,T,V){var Y=(V-b)/T,X=Y>1?Y:1;this.element.scrollTop=b+X},k._scrollUp=function(b,T,V){var Y=(b-V)/T,X=Y>1?Y:1;this.element.scrollTop=b-X},k._animateScroll=function(b,T){var V=this,Y=Dt,X=this.element.scrollTop,le=!1;T>0?(this._scrollDown(X,Y,b),Xb&&(le=!0)),le&&activeWindow.requestAnimationFrame(function(){V._animateScroll(b,T)})},z}();function St(z,k){for(var _=0;_0?"treeitem":"option"),Object.assign(lt.dataset,{choice:"",id:Me,value:Ve,selectText:b}),qe?(lt.classList.add(le),lt.dataset.choiceDisabled="",lt.setAttribute("aria-disabled","true")):(lt.classList.add(Y),lt.dataset.choiceSelectable=""),lt},input:function(k,_){var b=k.input,T=k.inputCloned,V=Object.assign(document.createElement("input"),{type:"text",className:b+" "+T,autocomplete:"off",autocapitalize:"off",spellcheck:!1});return V.setAttribute("role","textbox"),V.setAttribute("aria-autocomplete","list"),V.setAttribute("aria-label",_),V},dropdown:function(k){var _=k.list,b=k.listDropdown,T=document.createElement("div");return T.classList.add(_,b),T.setAttribute("aria-expanded","false"),T},notice:function(k,_,b){var T=k.item,V=k.itemChoice,Y=k.noResults,X=k.noChoices;b===void 0&&(b="");var le=[T,V];return b==="no-choices"?le.push(X):b==="no-results"&&le.push(Y),Object.assign(document.createElement("div"),{innerHTML:_,className:le.join(" ")})},option:function(k){var _=k.label,b=k.value,T=k.customProperties,V=k.active,Y=k.disabled,X=new Option(_,b,!1,V);return T&&(X.dataset.customProperties=T),X.disabled=Y,X}},ye=ie,ce=function(k){var _=k.value,b=k.label,T=k.id,V=k.groupId,Y=k.disabled,X=k.elementId,le=k.customProperties,he=k.placeholder,Me=k.keyCode;return{type:At.ADD_CHOICE,value:_,label:b,id:T,groupId:V,disabled:Y,elementId:X,customProperties:le,placeholder:he,keyCode:Me}},ae=function(k){return{type:At.FILTER_CHOICES,results:k}},Se=function(k){return k===void 0&&(k=!0),{type:At.ACTIVATE_CHOICES,active:k}},nt=function(){return{type:At.CLEAR_CHOICES}},Te=function(k){var _=k.value,b=k.label,T=k.id,V=k.choiceId,Y=k.groupId,X=k.customProperties,le=k.placeholder,he=k.keyCode;return{type:At.ADD_ITEM,value:_,label:b,id:T,choiceId:V,groupId:Y,customProperties:X,placeholder:le,keyCode:he}},Ue=function(k,_){return{type:At.REMOVE_ITEM,id:k,choiceId:_}},We=function(k,_){return{type:At.HIGHLIGHT_ITEM,id:k,highlighted:_}},Ft=function(k){var _=k.value,b=k.id,T=k.active,V=k.disabled;return{type:At.ADD_GROUP,value:_,id:b,active:T,disabled:V}},Hn=function(){return{type:"CLEAR_ALL"}},Ot=function(k){return{type:"RESET_TO",state:k}},or=function(k){return{type:"SET_IS_LOADING",isLoading:k}};function sr(z,k){for(var _=0;_=0?this._store.getGroupById(X):null;return this._store.dispatch(We(V,!0)),T&&this.passedElement.triggerEvent(rn.highlightItem,{id:V,value:he,label:Ve,groupValue:Le&&Le.value?Le.value:null}),this},k.unhighlightItem=function(b){if(!b)return this;var T=b.id,V=b.groupId,Y=V===void 0?-1:V,X=b.value,le=X===void 0?"":X,he=b.label,Me=he===void 0?"":he,Ve=Y>=0?this._store.getGroupById(Y):null;return this._store.dispatch(We(T,!1)),this.passedElement.triggerEvent(rn.highlightItem,{id:T,value:le,label:Me,groupValue:Ve&&Ve.value?Ve.value:null}),this},k.highlightAll=function(){var b=this;return this._store.items.forEach(function(T){return b.highlightItem(T)}),this},k.unhighlightAll=function(){var b=this;return this._store.items.forEach(function(T){return b.unhighlightItem(T)}),this},k.removeActiveItemsByValue=function(b){var T=this;return this._store.activeItems.filter(function(V){return V.value===b}).forEach(function(V){return T._removeItem(V)}),this},k.removeActiveItems=function(b){var T=this;return this._store.activeItems.filter(function(V){var Y=V.id;return Y!==b}).forEach(function(V){return T._removeItem(V)}),this},k.removeHighlightedItems=function(b){var T=this;return b===void 0&&(b=!1),this._store.highlightedActiveItems.forEach(function(V){T._removeItem(V),b&&T._triggerChange(V.value)}),this},k.showDropdown=function(b){var T=this;return this.dropdown.isActive?this:(activeWindow.requestAnimationFrame(function(){T.dropdown.show(),T.containerOuter.open(T.dropdown.distanceFromTopWindow),!b&&T._canSearch&&T.input.focus(),T.passedElement.triggerEvent(rn.showDropdown,{})}),this)},k.hideDropdown=function(b){var T=this;return this.dropdown.isActive?(activeWindow.requestAnimationFrame(function(){T.dropdown.hide(),T.containerOuter.close(),!b&&T._canSearch&&(T.input.removeActiveDescendant(),T.input.blur()),T.passedElement.triggerEvent(rn.hideDropdown,{})}),this):this},k.getValue=function(b){b===void 0&&(b=!1);var T=this._store.activeItems.reduce(function(V,Y){var X=b?Y.value:Y;return V.push(X),V},[]);return this._isSelectOneElement?T[0]:T},k.setValue=function(b){var T=this;return this.initialised?(b.forEach(function(V){return T._setChoiceOrItem(V)}),this):this},k.setChoiceByValue=function(b){var T=this;if(!this.initialised||this._isTextElement)return this;var V=Array.isArray(b)?b:[b];return V.forEach(function(Y){return T._findAndSelectChoiceByValue(Y)}),this},k.setChoices=function(b,T,V,Y){var X=this;if(b===void 0&&(b=[]),T===void 0&&(T="value"),V===void 0&&(V="label"),Y===void 0&&(Y=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if(typeof T!="string"||!T)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(Y&&this.clearChoices(),typeof b=="function"){var le=b(this);if(typeof Promise=="function"&&le instanceof Promise)return new Promise(function(he){return activeWindow.requestAnimationFrame(he)}).then(function(){return X._handleLoadingState(!0)}).then(function(){return le}).then(function(he){return X.setChoices(he,T,V,Y)}).catch(function(he){X.config.silent||console.error(he)}).then(function(){return X._handleLoadingState(!1)}).then(function(){return X});if(!Array.isArray(le))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: "+typeof le);return this.setChoices(le,T,V,!1)}if(!Array.isArray(b))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),b.forEach(function(he){he.choices?X._addGroup({id:parseInt(he.id,10)||null,group:he,valueKey:T,labelKey:V}):X._addChoice({value:he[T],label:he[V],isSelected:he.selected,isDisabled:he.disabled,customProperties:he.customProperties,placeholder:he.placeholder})}),this._stopLoading(),this},k.clearChoices=function(){return this._store.dispatch(nt()),this},k.clearStore=function(){return this._store.dispatch(Hn()),this},k.clearInput=function(){var b=!this._isSelectOneElement;return this.input.clear(b),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch(Se(!0))),this},k._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var b=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,T=this._isSelectElement,V=this._currentState.items!==this._prevState.items;b&&(T&&this._renderChoices(),V&&this._renderItems(),this._prevState=this._currentState)}},k._renderChoices=function(){var b=this,T=this._store,V=T.activeGroups,Y=T.activeChoices,X=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&activeWindow.requestAnimationFrame(function(){return b.choiceList.scrollToTop()}),V.length>=1&&!this._isSearching){var le=Y.filter(function(Qe){return Qe.placeholder===!0&&Qe.groupId===-1});le.length>=1&&(X=this._createChoicesFragment(le,X)),X=this._createGroupsFragment(V,Y,X)}else Y.length>=1&&(X=this._createChoicesFragment(Y,X));if(X.childNodes&&X.childNodes.length>0){var he=this._store.activeItems,Me=this._canAddItem(he,this.input.value);Me.response?(this.choiceList.append(X),this._highlightChoice()):this.choiceList.append(this._getTemplate("notice",Me.notice))}else{var Ve,Le;this._isSearching?(Le=typeof this.config.noResultsText=="function"?this.config.noResultsText():this.config.noResultsText,Ve=this._getTemplate("notice",Le,"no-results")):(Le=typeof this.config.noChoicesText=="function"?this.config.noChoicesText():this.config.noChoicesText,Ve=this._getTemplate("notice",Le,"no-choices")),this.choiceList.append(Ve)}},k._renderItems=function(){var b=this._store.activeItems||[];this.itemList.clear();var T=this._createItemsFragment(b);T.childNodes&&this.itemList.append(T)},k._createGroupsFragment=function(b,T,V){var Y=this;V===void 0&&(V=document.createDocumentFragment());var X=function(he){return T.filter(function(Me){return Y._isSelectOneElement?Me.groupId===he.id:Me.groupId===he.id&&(Y.config.renderSelectedChoices==="always"||!Me.selected)})};return this.config.shouldSort&&b.sort(this.config.sorter),b.forEach(function(le){var he=X(le);if(he.length>=1){var Me=Y._getTemplate("choiceGroup",le);V.appendChild(Me),Y._createChoicesFragment(he,V,!0)}}),V},k._createChoicesFragment=function(b,T,V){var Y=this;T===void 0&&(T=document.createDocumentFragment()),V===void 0&&(V=!1);var X=this.config,le=X.renderSelectedChoices,he=X.searchResultLimit,Me=X.renderChoiceLimit,Ve=this._isSearching?Wt:this.config.sorter,Le=function(Vn){var ki=le==="auto"?Y._isSelectOneElement||!Vn.selected:!0;if(ki){var kr=Y._getTemplate("choice",Vn,Y.config.itemSelectText);T.appendChild(kr)}},Qe=b;le==="auto"&&!this._isSelectOneElement&&(Qe=b.filter(function(On){return!On.selected}));var ot=Qe.reduce(function(On,Vn){return Vn.placeholder?On.placeholderChoices.push(Vn):On.normalChoices.push(Vn),On},{placeholderChoices:[],normalChoices:[]}),qe=ot.placeholderChoices,yt=ot.normalChoices;(this.config.shouldSort||this._isSearching)&&yt.sort(Ve);var st=Qe.length,lt=this._isSelectOneElement?[].concat(qe,yt):yt;this._isSearching?st=he:Me&&Me>0&&!V&&(st=Me);for(var qt=0;qt=Y){var he=X?this._searchChoices(b):0;this.passedElement.triggerEvent(rn.search,{value:b,resultCount:he})}else le&&(this._isSearching=!1,this._store.dispatch(Se(!0)))}},k._canAddItem=function(b,T){var V=!0,Y=typeof this.config.addItemText=="function"?this.config.addItemText(T):this.config.addItemText;if(!this._isSelectOneElement){var X=Jt(b,T);this.config.maxItemCount>0&&this.config.maxItemCount<=b.length&&(V=!1,Y=typeof this.config.maxItemText=="function"?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&X&&V&&(V=!1,Y=typeof this.config.uniqueItemText=="function"?this.config.uniqueItemText(T):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&V&&typeof this.config.addItemFilter=="function"&&!this.config.addItemFilter(T)&&(V=!1,Y=typeof this.config.customAddItemText=="function"?this.config.customAddItemText(T):this.config.customAddItemText)}return{response:V,notice:Y}},k._searchChoices=function(b){var T=typeof b=="string"?b.trim():b,V=typeof this._currentValue=="string"?this._currentValue.trim():this._currentValue;if(T.length<1&&T===V+" ")return 0;var Y=this._store.searchableChoices,X=T,le=[].concat(this.config.searchFields),he=Object.assign(this.config.fuseOptions,{keys:le}),Me=new i.a(Y,he),Ve=Me.search(X);return this._currentValue=T,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch(ae(Ve)),Ve.length},k._addEventListeners=function(){var b=document,T=b.documentElement;T.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),T.addEventListener("click",this._onClick,{passive:!0}),T.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},k._removeEventListeners=function(){var b=document,T=b.documentElement;T.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),T.removeEventListener("click",this._onClick),T.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},k._onKeyDown=function(b){var T,V=b.target,Y=b.keyCode,X=b.ctrlKey,le=b.metaKey,he=this._store.activeItems,Me=this.input.isFocussed,Ve=this.dropdown.isActive,Le=this.itemList.hasChildren(),Qe=String.fromCharCode(Y),ot=Z.BACK_KEY,qe=Z.DELETE_KEY,yt=Z.ENTER_KEY,st=Z.A_KEY,lt=Z.ESC_KEY,qt=Z.UP_KEY,On=Z.DOWN_KEY,Vn=Z.PAGE_UP_KEY,ki=Z.PAGE_DOWN_KEY,kr=X||le;!this._isTextElement&&/[a-zA-Z0-9-_ ]/.test(Qe)&&this.showDropdown();var Jr=(T={},T[st]=this._onAKey,T[yt]=this._onEnterKey,T[lt]=this._onEscapeKey,T[qt]=this._onDirectionKey,T[Vn]=this._onDirectionKey,T[On]=this._onDirectionKey,T[ki]=this._onDirectionKey,T[qe]=this._onDeleteKey,T[ot]=this._onDeleteKey,T);Jr[Y]&&Jr[Y]({event:b,target:V,keyCode:Y,metaKey:le,activeItems:he,hasFocusedInput:Me,hasActiveDropdown:Ve,hasItems:Le,hasCtrlDownKeyPressed:kr})},k._onKeyUp=function(b){var T=b.target,V=b.keyCode,Y=this.input.value,X=this._store.activeItems,le=this._canAddItem(X,Y),he=Z.BACK_KEY,Me=Z.DELETE_KEY;if(this._isTextElement){var Ve=le.notice&&Y;if(Ve){var Le=this._getTemplate("notice",le.notice);this.dropdown.element.innerHTML=Le.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0)}else{var Qe=(V===he||V===Me)&&!T.value,ot=!this._isTextElement&&this._isSearching,qe=this._canSearch&&le.response;Qe&&ot?(this._isSearching=!1,this._store.dispatch(Se(!0))):qe&&this._handleSearch(this.input.value)}this._canSearch=this.config.searchEnabled},k._onAKey=function(b){var T=b.hasItems,V=b.hasCtrlDownKeyPressed;if(V&&T){this._canSearch=!1;var Y=this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement;Y&&this.highlightAll()}},k._onEnterKey=function(b){var T=b.event,V=b.target,Y=b.activeItems,X=b.hasActiveDropdown,le=Z.ENTER_KEY,he=V.hasAttribute("data-button");if(this._isTextElement&&V.value){var Me=this.input.value,Ve=this._canAddItem(Y,Me);Ve.response&&(this.hideDropdown(!0),this._addItem({value:Me}),this._triggerChange(Me),this.clearInput())}if(he&&(this._handleButtonAction(Y,V),T.preventDefault()),X){var Le=this.dropdown.getChild("."+this.config.classNames.highlightedState);Le&&(Y[0]&&(Y[0].keyCode=le),this._handleChoiceAction(Y,Le)),T.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),T.preventDefault())},k._onEscapeKey=function(b){var T=b.hasActiveDropdown;T&&(this.hideDropdown(!0),this.containerOuter.focus())},k._onDirectionKey=function(b){var T=b.event,V=b.hasActiveDropdown,Y=b.keyCode,X=b.metaKey,le=Z.DOWN_KEY,he=Z.PAGE_UP_KEY,Me=Z.PAGE_DOWN_KEY;if(V||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var Ve=Y===le||Y===Me?1:-1,Le=X||Y===Me||Y===he,Qe="[data-choice-selectable]",ot;if(Le)Ve>0?ot=this.dropdown.element.querySelector(Qe+":last-of-type"):ot=this.dropdown.element.querySelector(Qe);else{var qe=this.dropdown.element.querySelector("."+this.config.classNames.highlightedState);qe?ot=Ze(qe,Qe,Ve):ot=this.dropdown.element.querySelector(Qe)}ot&&(It(ot,this.choiceList.element,Ve)||this.choiceList.scrollToChildElement(ot,Ve),this._highlightChoice(ot)),T.preventDefault()}},k._onDeleteKey=function(b){var T=b.event,V=b.target,Y=b.hasFocusedInput,X=b.activeItems;Y&&!V.value&&!this._isSelectOneElement&&(this._handleBackspace(X),T.preventDefault())},k._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},k._onTouchEnd=function(b){var T=b||b.touches[0],V=T.target,Y=this._wasTap&&this.containerOuter.element.contains(V);if(Y){var X=V===this.containerOuter.element||V===this.containerInner.element;X&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),b.stopPropagation()}this._wasTap=!0},k._onMouseDown=function(b){var T=b.target;if(T instanceof HTMLElement){if(Bn&&this.choiceList.element.contains(T)){var V=this.choiceList.element.firstElementChild,Y=this._direction==="ltr"?b.offsetX>=V.offsetWidth:b.offsetX0;Y&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0)}},k._onFocus=function(b){var T=this,V,Y=b.target,X=this.containerOuter.element.contains(Y);if(X){var le=(V={},V[me]=function(){Y===T.input.element&&T.containerOuter.addFocusState()},V[Ie]=function(){T.containerOuter.addFocusState(),Y===T.input.element&&T.showDropdown(!0)},V[at]=function(){Y===T.input.element&&(T.showDropdown(!0),T.containerOuter.addFocusState())},V);le[this.passedElement.element.type]()}},k._onBlur=function(b){var T=this,V=b.target,Y=this.containerOuter.element.contains(V);if(Y&&!this._isScrollingOnIe){var X,le=this._store.activeItems,he=le.some(function(Ve){return Ve.highlighted}),Me=(X={},X[me]=function(){V===T.input.element&&(T.containerOuter.removeFocusState(),he&&T.unhighlightAll(),T.hideDropdown(!0))},X[Ie]=function(){T.containerOuter.removeFocusState(),(V===T.input.element||V===T.containerOuter.element&&!T._canSearch)&&T.hideDropdown(!0)},X[at]=function(){V===T.input.element&&(T.containerOuter.removeFocusState(),T.hideDropdown(!0),he&&T.unhighlightAll())},X);Me[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},k._onFormReset=function(){this._store.dispatch(Ot(this._initialState))},k._highlightChoice=function(b){var T=this;b===void 0&&(b=null);var V=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(V.length){var Y=b,X=Array.from(this.dropdown.element.querySelectorAll("."+this.config.classNames.highlightedState));X.forEach(function(le){le.classList.remove(T.config.classNames.highlightedState),le.setAttribute("aria-selected","false")}),Y?this._highlightPosition=V.indexOf(Y):(V.length>this._highlightPosition?Y=V[this._highlightPosition]:Y=V[V.length-1],Y||(Y=V[0])),Y.classList.add(this.config.classNames.highlightedState),Y.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(rn.highlightChoice,{el:Y}),this.dropdown.isActive&&(this.input.setActiveDescendant(Y.id),this.containerOuter.setActiveDescendant(Y.id))}},k._addItem=function(b){var T=b.value,V=b.label,Y=V===void 0?null:V,X=b.choiceId,le=X===void 0?-1:X,he=b.groupId,Me=he===void 0?-1:he,Ve=b.customProperties,Le=Ve===void 0?null:Ve,Qe=b.placeholder,ot=Qe===void 0?!1:Qe,qe=b.keyCode,yt=qe===void 0?null:qe,st=typeof T=="string"?T.trim():T,lt=yt,qt=Le,On=this._store.items,Vn=Y||st,ki=le||-1,kr=Me>=0?this._store.getGroupById(Me):null,Jr=On?On.length+1:1;return this.config.prependValue&&(st=this.config.prependValue+st.toString()),this.config.appendValue&&(st+=this.config.appendValue.toString()),this._store.dispatch(Te({value:st,label:Vn,id:Jr,choiceId:ki,groupId:Me,customProperties:Le,placeholder:ot,keyCode:lt})),this._isSelectOneElement&&this.removeActiveItems(Jr),this.passedElement.triggerEvent(rn.addItem,{id:Jr,value:st,label:Vn,customProperties:qt,groupValue:kr&&kr.value?kr.value:void 0,keyCode:lt}),this},k._removeItem=function(b){if(!b||!it("Object",b))return this;var T=b.id,V=b.value,Y=b.label,X=b.choiceId,le=b.groupId,he=le>=0?this._store.getGroupById(le):null;return this._store.dispatch(Ue(T,X)),he&&he.value?this.passedElement.triggerEvent(rn.removeItem,{id:T,value:V,label:Y,groupValue:he.value}):this.passedElement.triggerEvent(rn.removeItem,{id:T,value:V,label:Y}),this},k._addChoice=function(b){var T=b.value,V=b.label,Y=V===void 0?null:V,X=b.isSelected,le=X===void 0?!1:X,he=b.isDisabled,Me=he===void 0?!1:he,Ve=b.groupId,Le=Ve===void 0?-1:Ve,Qe=b.customProperties,ot=Qe===void 0?null:Qe,qe=b.placeholder,yt=qe===void 0?!1:qe,st=b.keyCode,lt=st===void 0?null:st;if(!(typeof T=="undefined"||T===null)){var qt=this._store.choices,On=Y||T,Vn=qt?qt.length+1:1,ki=this._baseId+"-"+this._idNames.itemChoice+"-"+Vn;this._store.dispatch(ce({id:Vn,groupId:Le,elementId:ki,value:T,label:On,disabled:Me,customProperties:ot,placeholder:yt,keyCode:lt})),le&&this._addItem({value:T,label:On,choiceId:Vn,customProperties:ot,placeholder:yt,keyCode:lt})}},k._addGroup=function(b){var T=this,V=b.group,Y=b.id,X=b.valueKey,le=X===void 0?"value":X,he=b.labelKey,Me=he===void 0?"label":he,Ve=it("Object",V)?V.choices:Array.from(V.getElementsByTagName("OPTION")),Le=Y||Math.floor(new Date().valueOf()*Math.random()),Qe=V.disabled?V.disabled:!1;if(Ve){this._store.dispatch(Ft({value:V.label,id:Le,active:!0,disabled:Qe}));var ot=function(yt){var st=yt.disabled||yt.parentNode&&yt.parentNode.disabled;T._addChoice({value:yt[le],label:it("Object",yt)?yt[Me]:yt.innerHTML,isSelected:yt.selected,isDisabled:st,groupId:Le,customProperties:yt.customProperties,placeholder:yt.placeholder})};Ve.forEach(ot)}else this._store.dispatch(Ft({value:V.label,id:V.id,active:!1,disabled:V.disabled}))},k._getTemplate=function(b){var T;if(!b)return null;for(var V=this.config.classNames,Y=arguments.length,X=new Array(Y>1?Y-1:0),le=1;le{var IH=typeof Element!="undefined",AH=typeof Map=="function",OH=typeof Set=="function",LH=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function jd(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!jd(e[n],t[n]))return!1;return!0}var a;if(AH&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!jd(n.value[1],t.get(n.value[0])))return!1;return!0}if(OH&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(LH&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;if(IH&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!jd(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}pC.exports=function(t,r){try{return jd(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}});var S_=wn((Gne,Dy)=>{(function(){var e;typeof Dy!="undefined"?e=Dy.exports=n:e=function(){return this||(0,eval)("this")}(),e.format=n,e.vsprintf=r,typeof console!="undefined"&&typeof console.log=="function"&&(e.printf=t);function t(){console.log(n.apply(null,arguments))}function r(i,a){return n.apply(null,[i].concat(a))}function n(i){for(var a=1,o=[].slice.call(arguments),s=0,u=i.length,l="",c,d=!1,m,h,g=!1,y,v=function(){return o[a++]},D=function(){for(var I="";/\d/.test(i[s]);)I+=i[s++],c=i[s];return I.length>0?parseInt(I):null};swf});module.exports=ov(HB);function fu(e,t){let r=Object.keys(t).map(n=>mF(e,n,t[n]));return r.length===1?r[0]:function(){r.forEach(n=>n())}}function mF(e,t,r){let n=e[t],i=e.hasOwnProperty(t),a=r(n);return n&&Object.setPrototypeOf(a,n),Object.setPrototypeOf(o,a),e[t]=o,s;function o(...u){return a===n&&e[t]===o&&s(),a.apply(this,u)}function s(){e[t]===o&&(i?e[t]=n:delete e[t]),a!==n&&(a=n,Object.setPrototypeOf(o,n||Function))}}var Rn=require("obsidian");var Ws,Xe,cv,pF,Va,sv,dv,Hf,Wf,Bf,Vf,fv,Us={},hv=[],gF=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,pu=Array.isArray;function Ii(e,t){for(var r in t)e[r]=t[r];return e}function mv(e){var t=e.parentNode;t&&t.removeChild(e)}function xr(e,t,r){var n,i,a,o={};for(a in t)a=="key"?n=t[a]:a=="ref"?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?Ws.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return $s(e,o,n,i,null)}function $s(e,t,r,n,i){var a={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i==null?++cv:i,__i:-1,__u:0};return i==null&&Xe.vnode!=null&&Xe.vnode(a),a}function Yf(){return{current:null}}function ct(e){return e.children}function Br(e,t){this.props=e,this.context=t}function $a(e,t){if(t==null)return e.__?$a(e.__,e.__i+1):null;for(var r;tt&&Va.sort(Hf));mu.__r=0}function gv(e,t,r,n,i,a,o,s,u,l,c){var d,m,h,g,y,v=n&&n.__k||hv,D=t.length;for(r.__d=u,yF(r,t,v),u=r.__d,d=0;d0?$s(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,s=vF(i,r,o,c),i.__i=s,a=null,s!==-1&&(c--,(a=r[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&d--,typeof i.type!="function"&&(i.__u|=65536)):s!==o&&(s===o+1?d++:s>o?c>u-o?d+=s-o:d--:s(u!=null&&!(131072&u.__u)?1:0))for(;o>=0||s=0){if((u=t[o])&&!(131072&u.__u)&&i==u.key&&a===u.type)return o;o--}if(s2&&(s.children=arguments.length>3?Ws.call(arguments,2):r),$s(e.type,s,n||e.key,i||e.ref,null)}function aa(e,t){var r={__c:t="__cC"+fv++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,a;return this.getChildContext||(i=[],(a={})[t]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(s){s.__e=!0,$f(s)})},this.sub=function(o){i.push(o);var s=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),s&&s.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}Ws=hv.slice,Xe={__e:function(e,t,r,n){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(s){e=s}throw e}},cv=0,pF=function(e){return e!=null&&e.constructor==null},Br.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ii({},this.state),typeof e=="function"&&(e=e(Ii({},r),this.props)),e&&Ii(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),$f(this))},Br.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$f(this))},Br.prototype.render=ct,Va=[],dv=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):activeWindow.setTimeout,Hf=function(e,t){return e.__v.__b-t.__v.__b},mu.__r=0,Wf=0,Bf=uv(!1),Vf=uv(!0),fv=0;var oa,Qt,qf,bv,Co=0,Mv=[],gu=[],an=Xe,Dv=an.__b,Sv=an.__r,Ev=an.diffed,kv=an.__c,xv=an.unmount,Cv=an.__;function _o(e,t){an.__h&&an.__h(Qt,e,Co||t),Co=0;var r=Qt.__H||(Qt.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:gu}),r.__[e]}function Ne(e){return Co=1,Jf(Av,e)}function Jf(e,t,r){var n=_o(oa++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Av(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],l=n.t(u,s);u!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=Qt,!Qt.u)){var i=function(s,u,l){if(!n.__c.__H)return!0;var c=n.__c.__H.__.filter(function(m){return!!m.__c});if(c.every(function(m){return!m.__N}))return!a||a.call(this,s,u,l);var d=!1;return c.forEach(function(m){if(m.__N){var h=m.__[0];m.__=m.__N,m.__N=void 0,h!==m.__[0]&&(d=!0)}}),!(!d&&n.__c.props===s)&&(!a||a.call(this,s,u,l))};Qt.u=!0;var a=Qt.shouldComponentUpdate,o=Qt.componentWillUpdate;Qt.componentWillUpdate=function(s,u,l){if(this.__e){var c=a;a=void 0,i(s,u,l),a=c}o&&o.call(this,s,u,l)},Qt.shouldComponentUpdate=i}return n.__N||n.__}function Ae(e,t){var r=_o(oa++,3);!an.__s&&Zf(r.__H,t)&&(r.__=e,r.i=t,Qt.__H.__h.push(r))}function Ai(e,t){var r=_o(oa++,4);!an.__s&&Zf(r.__H,t)&&(r.__=e,r.i=t,Qt.__h.push(r))}function Fe(e){return Co=5,Re(function(){return{current:e}},[])}function Tv(e,t,r){Co=6,Ai(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function Re(e,t){var r=_o(oa++,7);return Zf(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Ye(e,t){return Co=8,Re(function(){return e},t)}function Ee(e){var t=Qt.context[e.__c],r=_o(oa++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(Qt)),t.props.value):e.__}function Fv(e,t){an.useDebugValue&&an.useDebugValue(t?t(e):e)}function Iv(){var e=_o(oa++,11);if(!e.__){for(var t=Qt.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function DF(){for(var e;e=Mv.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(yu),e.__H.__h.forEach(Gf),e.__H.__h=[]}catch(t){e.__H.__h=[],an.__e(t,e.__v)}}an.__b=function(e){Qt=null,Dv&&Dv(e)},an.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Cv&&Cv(e,t)},an.__r=function(e){Sv&&Sv(e),oa=0;var t=(Qt=e.__c).__H;t&&(qf===Qt?(t.__h=[],Qt.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=gu,r.__N=r.i=void 0})):(t.__h.forEach(yu),t.__h.forEach(Gf),t.__h=[],oa=0)),qf=Qt},an.diffed=function(e){Ev&&Ev(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Mv.push(t)!==1&&bv===an.requestAnimationFrame||((bv=an.requestAnimationFrame)||SF)(DF)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==gu&&(r.__=r.__V),r.i=void 0,r.__V=gu})),qf=Qt=null},an.__c=function(e,t){t.some(function(r){try{r.__h.forEach(yu),r.__h=r.__h.filter(function(n){return!n.__||Gf(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],an.__e(n,r.__v)}}),kv&&kv(e,t)},an.unmount=function(e){xv&&xv(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{yu(n)}catch(i){t=i}}),r.__H=void 0,t&&an.__e(t,r.__v))};var _v=typeof activeWindow.requestAnimationFrame=="function";function SF(e){var t,r=function(){activeWindow.clearTimeout(n),_v&&activeWindow.cancelAnimationFrame(t),activeWindow.setTimeout(e)},n=activeWindow.setTimeout(r,100);_v&&(t=activeWindow.requestAnimationFrame(r))}function yu(e){var t=Qt,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Qt=t}function Gf(e){var t=Qt;e.__c=e.__(),Qt=t}function Zf(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Av(e,t){return typeof t=="function"?t(e):t}function $v(e,t){for(var r in t)e[r]=t[r];return e}function Xf(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function eh(e,t){this.props=e,this.context=t}function zt(e,t){function r(i){var a=this.props.ref,o=a==i.ref;return!o&&a&&(a.call?a(null):a.current=null),t?!t(this.props,i)||!o:Xf(this.props,i)}function n(i){return this.shouldComponentUpdate=r,xr(e,i)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(eh.prototype=new Br).isPureReactComponent=!0,eh.prototype.shouldComponentUpdate=function(e,t){return Xf(this.props,e)||Xf(this.state,t)};var Ov=Xe.__b;Xe.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ov&&Ov(e)};var EF=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function kF(e){function t(r){var n=$v({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=EF,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Lv=function(e,t){return e==null?null:fi(fi(e).map(t))},xF={map:Lv,forEach:Lv,count:function(e){return e?fi(e).length:0},only:function(e){var t=fi(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:fi},CF=Xe.__e;Xe.__e=function(e,t,r,n){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}CF(e,t,r,n)};var Pv=Xe.unmount;function Uv(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=$v({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Uv(n,t,r)})),e}function Wv(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Wv(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function vu(){this.__u=0,this.t=null,this.__b=null}function Yv(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function _F(e){var t,r,n;function i(a){if(t||(t=e()).then(function(o){r=o.default||o},function(o){n=o}),n)throw n;if(!r)throw t;return xr(r,a)}return i.displayName="Lazy",i.__f=!0,i}function Ys(){this.u=null,this.o=null}Xe.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Pv&&Pv(e)},(vu.prototype=new Br).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var i=Yv(n.__v),a=!1,o=function(){a||(a=!0,r.__R=null,i?i(s):s())};r.__R=o;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=Wv(u,u.__c.__P,u.__c.__O)}var l;for(n.setState({__a:n.__b=null});l=n.t.pop();)l.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(o,o)},vu.prototype.componentWillUnmount=function(){this.t=[]},vu.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Uv(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&xr(ct,null,e.fallback);return i&&(i.__u&=-33),[xr(ct,null,t.__a?null:e.children),i]};var Nv=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]>>1,1),t.i.removeChild(n)}}),xo(xr(MF,{context:t.context},e.__v),t.l)}function Oi(e,t){var r=xr(TF,{__v:e,i:t});return r.containerInfo=t,r}(Ys.prototype=new Br).__a=function(e){var t=this,r=Yv(t.__v),n=t.o.get(e);return n[0]++,function(i){var a=function(){t.props.revealOrder?(n.push(i),Nv(t,e,n)):i()};r?r(a):a()}},Ys.prototype.render=function(e){this.u=null,this.o=new Map;var t=fi(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},Ys.prototype.componentDidUpdate=Ys.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){Nv(e,r,t)})};var zv=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,FF=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,IF=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,AF=/[A-Z0-9]/g,OF=typeof document!="undefined",LF=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Li(e,t,r){return t.__k==null&&(t.textContent=""),xo(e,t),typeof r=="function"&&r(),e?e.__c:null}function PF(e,t,r){return jf(e,t),typeof r=="function"&&r(),e?e.__c:null}Br.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Br.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Rv=Xe.event;function NF(){}function RF(){return this.cancelBubble}function HF(){return this.defaultPrevented}Xe.event=function(e){return Rv&&(e=Rv(e)),e.persist=NF,e.isPropagationStopped=RF,e.isDefaultPrevented=HF,e.nativeEvent=e};var th,BF={enumerable:!1,configurable:!0,get:function(){return this.class}},Hv=Xe.vnode;Xe.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={};for(var a in r){var o=r[a];if(!(a==="value"&&"defaultValue"in r&&o==null||OF&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&o===!0?o="":s==="translate"&&o==="no"?o=!1:s==="ondoubleclick"?a="ondblclick":s!=="onchange"||n!=="input"&&n!=="textarea"||LF(r.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":IF.test(a)?a=s:n.indexOf("-")===-1&&FF.test(a)?a=a.replace(AF,"-$&").toLowerCase():o===null&&(o=void 0):s=a="oninput",s==="oninput"&&i[a=s]&&(a="oninputCapture"),i[a]=o}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=fi(r.children).forEach(function(u){u.props.selected=i.value.indexOf(u.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=fi(r.children).forEach(function(u){u.props.selected=i.multiple?i.defaultValue.indexOf(u.props.value)!=-1:i.defaultValue==u.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",BF)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=zv,Hv&&Hv(e)};var Bv=Xe.__r;Xe.__r=function(e){Bv&&Bv(e),th=e.__c};var Vv=Xe.diffed;Xe.diffed=function(e){Vv&&Vv(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),th=null};var VF={ReactCurrentDispatcher:{current:{readContext:function(e){return th.__n[e.__c].props.value}}}};function $F(e){return xr.bind(null,e)}function wu(e){return!!e&&e.$$typeof===zv}function UF(e){return wu(e)&&e.type===ct}function WF(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function YF(e){return wu(e)?wv.apply(null,arguments):e}function Pi(e){return!!e.__k&&(xo(null,e),!0)}function zF(e){return e&&(e.base||e.nodeType===1&&e)||null}var KF=function(e,t){return e(t)},jF=function(e,t){return e(t)},qF=ct;function Kv(e){e()}function GF(e){return e}function JF(){return[!1,Kv]}var ZF=Ai,QF=wu;function XF(e,t){var r=t(),n=Ne({h:{__:r,v:t}}),i=n[0].h,a=n[1];return Ai(function(){i.__=r,i.v=t,Qf(i)&&a({h:i})},[e,r,t]),Ae(function(){return Qf(i)&&a({h:i}),e(function(){Qf(i)&&a({h:i})})},[e]),r}function Qf(e){var t,r,n=e.v,i=e.__;try{var a=n();return!((t=i)===(r=a)&&(t!==0||1/t==1/r)||t!=t&&r!=r)}catch(o){return!0}}var $e={useState:Ne,useId:Iv,useReducer:Jf,useEffect:Ae,useLayoutEffect:Ai,useInsertionEffect:ZF,useTransition:JF,useDeferredValue:GF,useSyncExternalStore:XF,startTransition:Kv,useRef:Fe,useImperativeHandle:Tv,useMemo:Re,useCallback:Ye,useContext:Ee,useDebugValue:Fv,version:"17.0.2",Children:xF,render:Li,hydrate:PF,unmountComponentAtNode:Pi,createPortal:Oi,createElement:xr,createContext:aa,createFactory:$F,cloneElement:YF,createRef:Yf,Fragment:ct,isValidElement:wu,isElement:QF,isFragment:UF,isMemo:WF,findDOMNode:zF,Component:Br,PureComponent:eh,memo:zt,forwardRef:kF,flushSync:jF,unstable_batchedUpdates:KF,StrictMode:qF,Suspense:vu,SuspenseList:Ys,lazy:_F,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:VF};function Ge(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,n;rn===i.length-1?r!==t[n]:r===t[n])}function SI(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function js(e,t){if(SI(e,t))return 2;if(!DI(e,t))return 3;let r=e.length-1;return e[r]=0;n--)r={children:{[e[n]]:r}};return r}function qs(e,t){let r=t;for(let n=e.length-2;n>=0;n--)r={children:{[e[n]]:r}};return r}function iw(e,t){let r=t?[e.last(),1,t]:[e.last(),1];return qs(e,{children:{$splice:[r]}})}function aw(e,t,r=0){return qs(e,{children:{$splice:[[e.last()+r,0,...t]]}})}function xI(e,t){return qs(e,{children:{$push:t}})}function CI(e,t){return qs(e,{children:{$unshift:t}})}function Ri(e,t,r,n,i){let a=n?n(un(e,t)):un(e,t),s=js(t,r)===1?-1:0,u=i==null?void 0:i(un(e,t)),l=iw(t,u),c=aw(r,Array.isArray(a)?a:[a],s),d=(0,rw.default)(l,c,{isMergeableObject:h=>Ni(h)||Array.isArray(h)});return(0,la.default)(e,d)}function mi(e,t,r){return(0,la.default)(e,iw(t,r))}function Xr(e,t,r){return(0,la.default)(e,aw(t,r))}function ah(e,t,r){return(0,la.default)(e,xI(t,r))}function ow(e,t,r){return(0,la.default)(e,CI(t,r))}function Du(e,t,r){return(0,la.default)(e,kI(t,r))}function oh(e,t,r){return(0,la.default)(e,qs(t,r))}var Gs=["MO","TU","WE","TH","FR","SA","SU"],Mn=function(){function e(t,r){if(r===0)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=r}return e.fromStr=function(t){return new e(Gs.indexOf(t))},e.prototype.nth=function(t){return this.n===t?this:new e(this.weekday,t)},e.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},e.prototype.toString=function(){var t=Gs[this.weekday];return this.n&&(t=(this.n>0?"+":"")+String(this.n)+t),t},e.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},e}();var Gt=function(e){return e!=null},Cr=function(e){return typeof e=="number"},sh=function(e){return typeof e=="string"&&Gs.includes(e)},$n=Array.isArray,$r=function(e,t){t===void 0&&(t=e),arguments.length===1&&(t=e,e=0);for(var r=[],n=e;n>0,n.length>t?String(n):(t=t-n.length,t>r.length&&(r+=wt(r,t/r.length)),r.slice(0,t)+String(n))}var lw=function(e,t,r){var n=e.split(t);return r?n.slice(0,r).concat([n.slice(r).join(t)]):n},qn=function(e,t){var r=e%t;return r*t<0?r+t:r},Su=function(e,t){return{div:Math.floor(e/t),mod:qn(e,t)}},_r=function(e){return!Gt(e)||e.length===0},bn=function(e){return!_r(e)},Et=function(e,t){return bn(e)&&e.indexOf(t)!==-1};var pi=function(e,t,r,n,i,a){return n===void 0&&(n=0),i===void 0&&(i=0),a===void 0&&(a=0),new Date(Date.UTC(e,t-1,r,n,i,a))},_I=[31,28,31,30,31,30,31,31,30,31,30,31],cw=1e3*60*60*24,Eu=9999,dw=pi(1970,1,1),MI=[6,0,1,2,3,4,5];var To=function(e){return e%4===0&&e%100!==0||e%400===0},lh=function(e){return e instanceof Date},Ya=function(e){return lh(e)&&!isNaN(e.getTime())};var TI=function(e,t){var r=e.getTime(),n=t.getTime(),i=r-n;return Math.round(i/cw)},Js=function(e){return TI(e,dw)},ku=function(e){return new Date(dw.getTime()+e*cw)},FI=function(e){var t=e.getUTCMonth();return t===1&&To(e.getUTCFullYear())?29:_I[t]},Hi=function(e){return MI[e.getUTCDay()]},uh=function(e,t){var r=pi(e,t+1,1);return[Hi(r),FI(r)]},xu=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},Cu=function(e){var t=new Date(e.getTime());return t},ch=function(e){for(var t=[],r=0;rthis.maxDate;if(this.method==="between"){if(r)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return r?!0:(this.add(t),!1);return this.add(t)},e.prototype.add=function(t){return this._result.push(t),!0},e.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;case"before":case"after":default:return t.length?t[t.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e}(),Vi=II;var dh=function(e,t){return dh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},dh(e,t)};function Io(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");dh(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Un=function(){return Un=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function hw(){for(var e=[],t=0;tt[0].length)&&(t=a,r=i)}if(t!=null&&(this.text=this.text.substr(t[0].length),this.text===""&&(this.done=!0)),t==null){this.done=!0,this.symbol=null,this.value=null;return}}while(r==="SKIP");return this.symbol=r,this.value=t,!0},e.prototype.accept=function(t){if(this.symbol===t){if(this.value){var r=this.value;return this.nextSymbol(),r}return this.nextSymbol(),!0}return!1},e.prototype.acceptNumber=function(){return this.accept("number")},e.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},e}();function Qs(e,t){t===void 0&&(t=za);var r={},n=new HI(t.tokens);if(!n.start(e))return null;return i(),r;function i(){n.expect("every");var m=n.acceptNumber();if(m&&(r.interval=parseInt(m[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":r.freq=Oe.DAILY,n.nextSymbol()&&(o(),d());break;case"weekday(s)":r.freq=Oe.WEEKLY,r.byweekday=[Oe.MO,Oe.TU,Oe.WE,Oe.TH,Oe.FR],n.nextSymbol(),o(),d();break;case"week(s)":r.freq=Oe.WEEKLY,n.nextSymbol()&&(a(),o(),d());break;case"hour(s)":r.freq=Oe.HOURLY,n.nextSymbol()&&(a(),d());break;case"minute(s)":r.freq=Oe.MINUTELY,n.nextSymbol()&&(a(),d());break;case"month(s)":r.freq=Oe.MONTHLY,n.nextSymbol()&&(a(),d());break;case"year(s)":r.freq=Oe.YEARLY,n.nextSymbol()&&(a(),d());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":r.freq=Oe.WEEKLY;var h=n.symbol.substr(0,2).toUpperCase();if(r.byweekday=[Oe[h]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var g=u();if(!g)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");r.byweekday.push(Oe[g]),n.nextSymbol()}o(),c(),d();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(r.freq=Oe.YEARLY,r.bymonth=[s()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var y=s();if(!y)throw new Error("Unexpected symbol "+n.symbol+", expected month");r.bymonth.push(y),n.nextSymbol()}a(),d();break;default:throw new Error("Unknown symbol")}}function a(){var m=n.accept("on"),h=n.accept("the");if(m||h)do{var g=l(),y=u(),v=s();if(g)y?(n.nextSymbol(),r.byweekday||(r.byweekday=[]),r.byweekday.push(Oe[y].nth(g))):(r.bymonthday||(r.bymonthday=[]),r.bymonthday.push(g),n.accept("day(s)"));else if(y)n.nextSymbol(),r.byweekday||(r.byweekday=[]),r.byweekday.push(Oe[y]);else if(n.symbol==="weekday(s)")n.nextSymbol(),r.byweekday||(r.byweekday=[Oe.MO,Oe.TU,Oe.WE,Oe.TH,Oe.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var D=n.acceptNumber();if(!D)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(r.byweekno=[parseInt(D[0],10)];n.accept("comma");){if(D=n.acceptNumber(),!D)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");r.byweekno.push(parseInt(D[0],10))}}else if(v)n.nextSymbol(),r.bymonth||(r.bymonth=[]),r.bymonth.push(v);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function o(){var m=n.accept("at");if(m)do{var h=n.acceptNumber();if(!h)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(r.byhour=[parseInt(h[0],10)];n.accept("comma");){if(h=n.acceptNumber(),!h)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");r.byhour.push(parseInt(h[0],10))}}while(n.accept("comma")||n.accept("at"))}function s(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function u(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function l(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var m=parseInt(n.value[1],10);if(m<-366||m>366)throw new Error("Nth out of range: "+m);return n.nextSymbol(),n.accept("last")?-m:m;default:return!1}}function c(){n.accept("on"),n.accept("the");var m=l();if(m)for(r.bymonthday=[m],n.nextSymbol();n.accept("comma");){if(m=l(),!m)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");r.bymonthday.push(m),n.nextSymbol()}}function d(){if(n.symbol==="until"){var m=Date.parse(n.text);if(!m)throw new Error("Cannot parse until date:"+n.text);r.until=new Date(m)}else n.accept("for")&&(r.count=parseInt(n.value[0],10),n.expect("number"))}}var pt;(function(e){e[e.YEARLY=0]="YEARLY",e[e.MONTHLY=1]="MONTHLY",e[e.WEEKLY=2]="WEEKLY",e[e.DAILY=3]="DAILY",e[e.HOURLY=4]="HOURLY",e[e.MINUTELY=5]="MINUTELY",e[e.SECONDLY=6]="SECONDLY"})(pt||(pt={}));function Xs(e){return e12){var n=Math.floor(this.month/12),i=qn(this.month,12);this.month=i,this.year+=n,this.month===0&&(this.month=12,--this.year)}},t.prototype.addWeekly=function(r,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+r*7:this.day+=-(this.getWeekday()-n)+r*7,this.fixDay()},t.prototype.addDaily=function(r){this.day+=r,this.fixDay()},t.prototype.addHours=function(r,n,i){for(n&&(this.hour+=Math.floor((23-this.hour)/r)*r);;){this.hour+=r;var a=Su(this.hour,24),o=a.div,s=a.mod;if(o&&(this.hour=s,this.addDaily(o)),_r(i)||Et(i,this.hour))break}},t.prototype.addMinutes=function(r,n,i,a){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/r)*r);;){this.minute+=r;var o=Su(this.minute,60),s=o.div,u=o.mod;if(s&&(this.minute=u,this.addHours(s,!1,i)),(_r(i)||Et(i,this.hour))&&(_r(a)||Et(a,this.minute)))break}},t.prototype.addSeconds=function(r,n,i,a,o){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/r)*r);;){this.second+=r;var s=Su(this.second,60),u=s.div,l=s.mod;if(u&&(this.second=l,this.addMinutes(u,!1,i,a)),(_r(i)||Et(i,this.hour))&&(_r(a)||Et(a,this.minute))&&(_r(o)||Et(o,this.second)))break}},t.prototype.fixDay=function(){if(!(this.day<=28)){var r=uh(this.year,this.month-1)[1];if(!(this.day<=r))for(;this.day>r;){if(this.day-=r,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Eu))return;r=uh(this.year,this.month-1)[1]}}},t.prototype.add=function(r,n){var i=r.freq,a=r.interval,o=r.wkst,s=r.byhour,u=r.byminute,l=r.bysecond;switch(i){case pt.YEARLY:return this.addYears(a);case pt.MONTHLY:return this.addMonths(a);case pt.WEEKLY:return this.addWeekly(a,o);case pt.DAILY:return this.addDaily(a);case pt.HOURLY:return this.addHours(a,n,s);case pt.MINUTELY:return this.addMinutes(a,n,s,u);case pt.SECONDLY:return this.addSeconds(a,n,s,u,l)}},t}(Po);function hh(e){for(var t=[],r=Object.keys(e),n=0,i=r;n=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(t.byweekno||bn(t.byweekno)||bn(t.byyearday)||t.bymonthday||bn(t.bymonthday)||Gt(t.byweekday)||Gt(t.byeaster)))switch(t.freq){case Oe.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case Oe.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case Oe.WEEKLY:t.byweekday=[Hi(t.dtstart)];break}if(Gt(t.bymonth)&&!$n(t.bymonth)&&(t.bymonth=[t.bymonth]),Gt(t.byyearday)&&!$n(t.byyearday)&&Cr(t.byyearday)&&(t.byyearday=[t.byyearday]),!Gt(t.bymonthday))t.bymonthday=[],t.bynmonthday=[];else if($n(t.bymonthday)){for(var i=[],a=[],r=0;r0?i.push(n):n<0&&a.push(n)}t.bymonthday=i,t.bynmonthday=a}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);if(Gt(t.byweekno)&&!$n(t.byweekno)&&(t.byweekno=[t.byweekno]),!Gt(t.byweekday))t.bynweekday=null;else if(Cr(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(sh(t.byweekday))t.byweekday=[Mn.fromStr(t.byweekday).weekday],t.bynweekday=null;else if(t.byweekday instanceof Mn)!t.byweekday.n||t.freq>Oe.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{for(var o=[],s=[],r=0;rOe.MONTHLY?o.push(u.weekday):s.push([u.weekday,u.n])}t.byweekday=bn(o)?o:null,t.bynweekday=bn(s)?s:null}return Gt(t.byhour)?Cr(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq=4?(c=0,l=s.yearlen+qn(o-t.wkst,7)):l=n-c;for(var d=Math.floor(l/7),m=qn(l,7),h=Math.floor(d+m/4),g=0;g0&&y<=h){var v=void 0;y>1?(v=c+(y-1)*7,c!==u&&(v-=7-u)):v=c;for(var D=0;D<7&&(s.wnomask[v]=1,v++,s.wdaymask[v]!==t.wkst);D++);}}if(Et(t.byweekno,1)){var v=c+h*7;if(c!==u&&(v-=7-u),v=4?(x=0,A=O+qn(C-t.wkst,7)):A=n-c,I=Math.floor(52+qn(A,7)/4)}if(Et(t.byweekno,I))for(var v=0;va)return $i(e);if(I>=r){var C=Hw(I,t);if(!e.accept(C)||s&&(--s,!s))return $i(e)}}else for(var D=h;Da)return $i(e);if(I>=r){var C=Hw(I,t);if(!e.accept(C)||s&&(--s,!s))return $i(e)}}}if(t.interval===0||(u.add(t,y),u.year>Eu))return $i(e);Xs(n)||(c=l.gettimeset(n)(u.hour,u.minute,u.second,0)),l.rebuild(u.year,u.month)}}function JI(e,t,r){var n=r.bymonth,i=r.byweekno,a=r.byweekday,o=r.byeaster,s=r.bymonthday,u=r.bynmonthday,l=r.byyearday;return bn(n)&&!Et(n,e.mmask[t])||bn(i)&&!e.wnomask[t]||bn(a)&&!Et(a,e.wdaymask[t])||bn(e.nwdaymask)&&!e.nwdaymask[t]||o!==null&&!Et(e.eastermask,t)||(bn(s)||bn(u))&&!Et(s,e.mdaymask[t])&&!Et(u,e.nmdaymask[t])||bn(l)&&(t=e.yearlen&&!Et(l,t+1-e.yearlen)&&!Et(l,-e.nextyearlen+t-e.yearlen))}function Hw(e,t){return new Ka(e,t.tzid).rezonedDate()}function $i(e){return e.getValue()}function ZI(e,t,r,n,i){for(var a=!1,o=t;o=Oe.HOURLY&&bn(i)&&!Et(i,t.hour)||n>=Oe.MINUTELY&&bn(a)&&!Et(a,t.minute)||n>=Oe.SECONDLY&&bn(o)&&!Et(o,t.second)?[]:e.gettimeset(n)(t.hour,t.minute,t.second,t.millisecond)}var Ur={MO:new Mn(0),TU:new Mn(1),WE:new Mn(2),TH:new Mn(3),FR:new Mn(4),SA:new Mn(5),SU:new Mn(6)},el={freq:pt.YEARLY,dtstart:null,interval:1,wkst:Ur.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},Dw=Object.keys(el),Oe=function(){function e(t,r){t===void 0&&(t={}),r===void 0&&(r=!1),this._cache=r?null:new kw,this.origOptions=hh(t);var n=ww(t).parsedOptions;this.options=n}return e.parseText=function(t,r){return Qs(t,r)},e.fromText=function(t,r){return pw(t,r)},e.fromString=function(t){return new e(e.parseString(t)||void 0)},e.prototype._iter=function(t){return _u(t,this.options)},e.prototype._cacheGet=function(t,r){return this._cache?this._cache._cacheGet(t,r):!1},e.prototype._cacheAdd=function(t,r,n){if(this._cache)return this._cache._cacheAdd(t,r,n)},e.prototype.all=function(t){if(t)return this._iter(new fh("all",{},t));var r=this._cacheGet("all");return r===!1&&(r=this._iter(new Vi("all",{})),this._cacheAdd("all",r)),r},e.prototype.between=function(t,r,n,i){if(n===void 0&&(n=!1),!Ya(t)||!Ya(r))throw new Error("Invalid date passed in to RRule.between");var a={before:r,after:t,inc:n};if(i)return this._iter(new fh("between",a,i));var o=this._cacheGet("between",a);return o===!1&&(o=this._iter(new Vi("between",a)),this._cacheAdd("between",o,a)),o},e.prototype.before=function(t,r){if(r===void 0&&(r=!1),!Ya(t))throw new Error("Invalid date passed in to RRule.before");var n={dt:t,inc:r},i=this._cacheGet("before",n);return i===!1&&(i=this._iter(new Vi("before",n)),this._cacheAdd("before",i,n)),i},e.prototype.after=function(t,r){if(r===void 0&&(r=!1),!Ya(t))throw new Error("Invalid date passed in to RRule.after");var n={dt:t,inc:r},i=this._cacheGet("after",n);return i===!1&&(i=this._iter(new Vi("after",n)),this._cacheAdd("after",i,n)),i},e.prototype.count=function(){return this.all().length},e.prototype.toString=function(){return rl(this.origOptions)},e.prototype.toText=function(t,r,n){return gw(this,t,r,n)},e.prototype.isFullyConvertibleToText=function(){return yw(this)},e.prototype.clone=function(){return new e(this.origOptions)},e.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],e.YEARLY=pt.YEARLY,e.MONTHLY=pt.MONTHLY,e.WEEKLY=pt.WEEKLY,e.DAILY=pt.DAILY,e.HOURLY=pt.HOURLY,e.MINUTELY=pt.MINUTELY,e.SECONDLY=pt.SECONDLY,e.MO=Ur.MO,e.TU=Ur.TU,e.WE=Ur.WE,e.TH=Ur.TH,e.FR=Ur.FR,e.SA=Ur.SA,e.SU=Ur.SU,e.parseString=nl,e.optionsToString=rl,e}();function Bw(e,t,r,n,i,a){var o={},s=e.accept;function u(m,h){r.forEach(function(g){g.between(m,h,!0).forEach(function(y){o[Number(y)]=!0})})}i.forEach(function(m){var h=new Ka(m,a).rezonedDate();o[Number(h)]=!0}),e.accept=function(m){var h=Number(m);return isNaN(h)?s.call(this,m):!o[h]&&(u(new Date(h-1),new Date(h+1)),!o[h])?(o[h]=!0,s.call(this,m)):!0},e.method==="between"&&(u(e.args.after,e.args.before),e.accept=function(m){var h=Number(m);return o[h]?!0:(o[h]=!0,s.call(this,m))});for(var l=0;l1||i.length||a.length||o.length){var c=new gh(l);return c.dtstart(s),c.tzid(u||void 0),n.forEach(function(m){c.rrule(new Oe(ph(m,s,u),l))}),i.forEach(function(m){c.rdate(m)}),a.forEach(function(m){c.exrule(new Oe(ph(m,s,u),l))}),o.forEach(function(m){c.exdate(m)}),t.compatible&&t.dtstart&&c.rdate(s),c}var d=n[0]||{};return new Oe(ph(d,d.dtstart||t.dtstart||s,d.tzid||t.tzid||u),l)}function Mu(e,t){return t===void 0&&(t={}),eA(e,tA(t))}function ph(e,t,r){return Un(Un({},e),{dtstart:t,tzid:r})}function tA(e){var t=[],r=Object.keys(e),n=Object.keys(Vw);if(r.forEach(function(i){Et(n,i)||t.push(i)}),t.length)throw new Error("Invalid options: "+t.join(", "));return Un(Un({},Vw),e)}function nA(e){if(e.indexOf(":")===-1)return{name:"RRULE",value:e};var t=lw(e,":",1),r=t[0],n=t[1];return{name:r,value:n}}function rA(e){var t=nA(e),r=t.name,n=t.value,i=r.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:n}}function iA(e,t){if(t===void 0&&(t=!1),e=e&&e.trim(),!e)throw new Error("Invalid empty string");if(!t)return e.split(/\s/);for(var r=e.split(` +`),n=0;n0&&i[0]===" "?(r[n-1]+=i.slice(1),r.splice(n,1)):n+=1:r.splice(n,1)}return r}function aA(e){e.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)})}function $w(e,t){return aA(t),e.split(",").map(function(r){return Zs(r)})}function Uw(e){var t=this;return function(r){if(r!==void 0&&(t["_".concat(e)]=r),t["_".concat(e)]!==void 0)return t["_".concat(e)];for(var n=0;n