diff --git a/_app/immutable/assets/3.57cf30c7.css b/_app/immutable/assets/3.57cf30c7.css deleted file mode 100644 index a021cd75..00000000 --- a/_app/immutable/assets/3.57cf30c7.css +++ /dev/null @@ -1 +0,0 @@ -.midi-body.svelte-al1s46{display:grid;gap:.5rem;grid-template-columns:25% 25% 25%;grid-template-rows:auto;align-items:center}.error.svelte-al1s46{font-size:.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity))}.objective.svelte-17gk9sj.svelte-17gk9sj{display:flex}.score.svelte-17gk9sj.svelte-17gk9sj{display:flex;flex-direction:column;font-family:Noto Music,sans-serif}.score.svelte-17gk9sj .line.svelte-17gk9sj{position:relative}.score.svelte-17gk9sj .g-clef.svelte-17gk9sj{bottom:.8rem;font-size:3.3rem;left:1rem;line-height:1;position:absolute}.score.svelte-17gk9sj .f-clef.svelte-17gk9sj{bottom:.7rem;font-size:3rem;left:1rem;position:absolute}.score.svelte-17gk9sj .staff.svelte-17gk9sj{display:block;font-size:3.5rem;line-height:1.42;transform:scaleX(13);transform-origin:.4% 50%}.score.svelte-17gk9sj .note.svelte-17gk9sj{font-size:3.1rem;position:absolute}.score.svelte-17gk9sj .target.svelte-17gk9sj{left:5rem;pointer-events:none}.score.svelte-17gk9sj .played.svelte-17gk9sj{bottom:2.6rem;display:none;left:9rem;pointer-events:none;position:absolute}.wrong{color:red}.correct{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity))} diff --git a/_app/immutable/assets/3.7335eec7.css b/_app/immutable/assets/3.7335eec7.css new file mode 100644 index 00000000..f0760bb2 --- /dev/null +++ b/_app/immutable/assets/3.7335eec7.css @@ -0,0 +1 @@ +.midi-body.svelte-5m5dii{display:grid;gap:.5rem;grid-template-columns:25% 25% 25%;grid-template-rows:auto;align-items:center}@media (width <= 475px){.midi-body.svelte-5m5dii{grid-template-columns:50% 50%}}.error.svelte-5m5dii{font-size:.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity))}.objective.svelte-5792x8.svelte-5792x8{display:flex}.score.svelte-5792x8.svelte-5792x8{display:flex;flex-direction:column;font-family:Noto Music,sans-serif}.score.svelte-5792x8 .line.svelte-5792x8{position:relative}.score.svelte-5792x8 .g-clef.svelte-5792x8{bottom:.8rem;font-size:3.3rem;left:2.5rem;line-height:1;position:absolute}.score.svelte-5792x8 .f-clef.svelte-5792x8{bottom:.7rem;font-size:3rem;left:2.5rem;position:absolute}.score.svelte-5792x8 .staff.svelte-5792x8{display:block;font-size:3.5rem;line-height:1.42;transform:scaleX(10);transform-origin:0 50%;width:61.6px}@media (width <= 605px){.score.svelte-5792x8 .staff.svelte-5792x8{transform:scaleX(5);transform-origin:-6% 50%}}.score.svelte-5792x8 .note.svelte-5792x8{font-size:3.1rem;position:absolute}.score.svelte-5792x8 .target.svelte-5792x8{left:7rem;pointer-events:none}.score.svelte-5792x8 .played.svelte-5792x8{bottom:2.6rem;display:none;left:10rem;pointer-events:none;position:absolute}.wrong{color:red}.correct{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity))} diff --git a/_app/immutable/assets/_page.kkZp-D9Q.css b/_app/immutable/assets/_page.kkZp-D9Q.css new file mode 100644 index 00000000..f0760bb2 --- /dev/null +++ b/_app/immutable/assets/_page.kkZp-D9Q.css @@ -0,0 +1 @@ +.midi-body.svelte-5m5dii{display:grid;gap:.5rem;grid-template-columns:25% 25% 25%;grid-template-rows:auto;align-items:center}@media (width <= 475px){.midi-body.svelte-5m5dii{grid-template-columns:50% 50%}}.error.svelte-5m5dii{font-size:.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity))}.objective.svelte-5792x8.svelte-5792x8{display:flex}.score.svelte-5792x8.svelte-5792x8{display:flex;flex-direction:column;font-family:Noto Music,sans-serif}.score.svelte-5792x8 .line.svelte-5792x8{position:relative}.score.svelte-5792x8 .g-clef.svelte-5792x8{bottom:.8rem;font-size:3.3rem;left:2.5rem;line-height:1;position:absolute}.score.svelte-5792x8 .f-clef.svelte-5792x8{bottom:.7rem;font-size:3rem;left:2.5rem;position:absolute}.score.svelte-5792x8 .staff.svelte-5792x8{display:block;font-size:3.5rem;line-height:1.42;transform:scaleX(10);transform-origin:0 50%;width:61.6px}@media (width <= 605px){.score.svelte-5792x8 .staff.svelte-5792x8{transform:scaleX(5);transform-origin:-6% 50%}}.score.svelte-5792x8 .note.svelte-5792x8{font-size:3.1rem;position:absolute}.score.svelte-5792x8 .target.svelte-5792x8{left:7rem;pointer-events:none}.score.svelte-5792x8 .played.svelte-5792x8{bottom:2.6rem;display:none;left:10rem;pointer-events:none;position:absolute}.wrong{color:red}.correct{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity))} diff --git a/_app/immutable/assets/_page.nthuemAr.css b/_app/immutable/assets/_page.nthuemAr.css deleted file mode 100644 index a021cd75..00000000 --- a/_app/immutable/assets/_page.nthuemAr.css +++ /dev/null @@ -1 +0,0 @@ -.midi-body.svelte-al1s46{display:grid;gap:.5rem;grid-template-columns:25% 25% 25%;grid-template-rows:auto;align-items:center}.error.svelte-al1s46{font-size:.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity))}.objective.svelte-17gk9sj.svelte-17gk9sj{display:flex}.score.svelte-17gk9sj.svelte-17gk9sj{display:flex;flex-direction:column;font-family:Noto Music,sans-serif}.score.svelte-17gk9sj .line.svelte-17gk9sj{position:relative}.score.svelte-17gk9sj .g-clef.svelte-17gk9sj{bottom:.8rem;font-size:3.3rem;left:1rem;line-height:1;position:absolute}.score.svelte-17gk9sj .f-clef.svelte-17gk9sj{bottom:.7rem;font-size:3rem;left:1rem;position:absolute}.score.svelte-17gk9sj .staff.svelte-17gk9sj{display:block;font-size:3.5rem;line-height:1.42;transform:scaleX(13);transform-origin:.4% 50%}.score.svelte-17gk9sj .note.svelte-17gk9sj{font-size:3.1rem;position:absolute}.score.svelte-17gk9sj .target.svelte-17gk9sj{left:5rem;pointer-events:none}.score.svelte-17gk9sj .played.svelte-17gk9sj{bottom:2.6rem;display:none;left:9rem;pointer-events:none;position:absolute}.wrong{color:red}.correct{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity))} diff --git a/_app/immutable/assets/tailwind.yMuGD2Ix.css b/_app/immutable/assets/tailwind.-rZV5gi8.css similarity index 78% rename from _app/immutable/assets/tailwind.yMuGD2Ix.css rename to _app/immutable/assets/tailwind.-rZV5gi8.css index cbe7fa59..b09404f7 100644 --- a/_app/immutable/assets/tailwind.yMuGD2Ix.css +++ b/_app/immutable/assets/tailwind.-rZV5gi8.css @@ -1 +1 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.btn{border-radius:.25rem;padding:.25rem 1rem;font-weight:700}.primary{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.primary:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.absolute{position:absolute}.relative{position:relative}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-\[auto\]{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-8{margin-top:2rem;margin-bottom:2rem}.ml-8{margin-left:2rem}.mt-12{margin-top:3rem}.block{display:block}.flex{display:flex}.grid{display:grid}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.max-w-\[732px\]{max-width:732px}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.rounded{border-radius:.25rem}.border-2{border-width:2px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pt-8{padding-top:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.tracking-tight{letter-spacing:-.025em}@font-face{font-family:Bravura Text;src:url(/practise-music-reading/BravuraText.otf)}@font-face{font-family:Noto Music;src:url(/practise-music-reading/NotoMusic-Regular.ttf)}html{font-size:16px}@media (min-width: 768px){.md\:text-5xl{font-size:3rem;line-height:1}} +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.btn{border-radius:.25rem;padding:.25rem 1rem;font-weight:700}.primary{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.primary:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.absolute{position:absolute}.relative{position:relative}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-\[auto\]{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-8{margin-top:2rem;margin-bottom:2rem}.ml-8{margin-left:2rem}.ml-\[-0\.5rem\]{margin-left:-.5rem}.mt-12{margin-top:3rem}.block{display:block}.flex{display:flex}.grid{display:grid}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.max-w-\[732px\]{max-width:732px}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.rounded{border-radius:.25rem}.border-2{border-width:2px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pt-12{padding-top:3rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.tracking-tight{letter-spacing:-.025em}@font-face{font-family:Bravura Text;src:url(/practise-music-reading/BravuraText.otf)}@font-face{font-family:Noto Music;src:url(/practise-music-reading/NotoMusic-Regular.ttf)}html{font-size:16px}@media (min-width: 768px){.md\:ml-\[-1\.6rem\]{margin-left:-1.6rem}.md\:px-0{padding-left:0;padding-right:0}.md\:text-5xl{font-size:3rem;line-height:1}} diff --git a/_app/immutable/assets/tailwind.9d0d3188.css b/_app/immutable/assets/tailwind.132c0f7b.css similarity index 78% rename from _app/immutable/assets/tailwind.9d0d3188.css rename to _app/immutable/assets/tailwind.132c0f7b.css index b354502b..2257ceef 100644 --- a/_app/immutable/assets/tailwind.9d0d3188.css +++ b/_app/immutable/assets/tailwind.132c0f7b.css @@ -1 +1 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.btn{border-radius:.25rem;padding:.25rem 1rem;font-weight:700}.primary{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.primary:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.absolute{position:absolute}.relative{position:relative}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-\[auto\]{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-8{margin-top:2rem;margin-bottom:2rem}.ml-8{margin-left:2rem}.mt-12{margin-top:3rem}.block{display:block}.flex{display:flex}.grid{display:grid}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.max-w-\[732px\]{max-width:732px}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.rounded{border-radius:.25rem}.border-2{border-width:2px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pt-8{padding-top:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.tracking-tight{letter-spacing:-.025em}@font-face{font-family:Bravura Text;src:url(../../../BravuraText.otf)}@font-face{font-family:Noto Music;src:url(../../../NotoMusic-Regular.ttf)}html{font-size:16px}@media (min-width: 768px){.md\:text-5xl{font-size:3rem;line-height:1}} +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.btn{border-radius:.25rem;padding:.25rem 1rem;font-weight:700}.primary{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.primary:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.absolute{position:absolute}.relative{position:relative}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-\[auto\]{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-8{margin-top:2rem;margin-bottom:2rem}.ml-8{margin-left:2rem}.ml-\[-0\.5rem\]{margin-left:-.5rem}.mt-12{margin-top:3rem}.block{display:block}.flex{display:flex}.grid{display:grid}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.max-w-\[732px\]{max-width:732px}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.rounded{border-radius:.25rem}.border-2{border-width:2px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pt-12{padding-top:3rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.tracking-tight{letter-spacing:-.025em}@font-face{font-family:Bravura Text;src:url(../../../BravuraText.otf)}@font-face{font-family:Noto Music;src:url(../../../NotoMusic-Regular.ttf)}html{font-size:16px}@media (min-width: 768px){.md\:ml-\[-1\.6rem\]{margin-left:-1.6rem}.md\:px-0{padding-left:0;padding-right:0}.md\:text-5xl{font-size:3rem;line-height:1}} diff --git a/_app/immutable/chunks/singletons.10cd924e.js b/_app/immutable/chunks/singletons.06f3a387.js similarity index 64% rename from _app/immutable/chunks/singletons.10cd924e.js rename to _app/immutable/chunks/singletons.06f3a387.js index 43a4184a..4c9ef03c 100644 --- a/_app/immutable/chunks/singletons.10cd924e.js +++ b/_app/immutable/chunks/singletons.06f3a387.js @@ -1 +1 @@ -import{w as u}from"./index.7d157e8c.js";var _;const k=((_=globalThis.__sveltekit_bthsqe)==null?void 0:_.base)??"/practise-music-reading";var h;const m=((h=globalThis.__sveltekit_bthsqe)==null?void 0:h.assets)??k,w="1705593001718",T="sveltekit:snapshot",y="sveltekit:scroll",I="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1},g=location.origin;function S(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function b(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=b(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||A(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===g&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function L(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),a===null&&(a=c(s,"replacestate")),s=b(s);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[o??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(a)}}function p(e){const t=u(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:l}}function E(){const{set:e,subscribe:t}=u(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${m}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==w;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function A(e,t){return e.origin!==g||!e.pathname.startsWith(t)}function N(e){e.client}const P={url:p({}),page:p({}),navigating:u(null),updated:E()};export{I,f as P,y as S,T as a,U as b,L as c,P as d,k as e,O as f,S as g,N as h,A as i,g as o,x as s}; +import{w as u}from"./index.7d157e8c.js";var _;const k=((_=globalThis.__sveltekit_s2zxyu)==null?void 0:_.base)??"/practise-music-reading";var g;const m=((g=globalThis.__sveltekit_s2zxyu)==null?void 0:g.assets)??k,w="1705596134297",R="sveltekit:snapshot",T="sveltekit:scroll",x="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1},h=location.origin;function I(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function S(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function b(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=b(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||E(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===h&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function L(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),a===null&&(a=c(s,"replacestate")),s=b(s);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[o??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(a)}}function p(e){const t=u(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:l}}function y(){const{set:e,subscribe:t}=u(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${m}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==w;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function E(e,t){return e.origin!==h||!e.pathname.startsWith(t)}function N(e){e.client}const P={url:p({}),page:p({}),navigating:u(null),updated:y()};export{x as I,f as P,T as S,R as a,U as b,L as c,P as d,k as e,O as f,I as g,N as h,E as i,h as o,S as s}; diff --git a/_app/immutable/entry/app.586ac86f.js b/_app/immutable/entry/app.fed08244.js similarity index 92% rename from _app/immutable/entry/app.586ac86f.js rename to _app/immutable/entry/app.fed08244.js index 5431070e..20605e39 100644 --- a/_app/immutable/entry/app.586ac86f.js +++ b/_app/immutable/entry/app.fed08244.js @@ -1 +1 @@ -import{s as U,a as j,o as W,t as z,b as L}from"../chunks/scheduler.e80da8ef.js";import{S as F,i as G,s as H,e as m,c as J,a as w,t as p,b as y,d as h,f as d,g as K,h as M,j as Q,k as S,l as E,m as X,n as Y,o as Z,p as R,q as g,r as b,u as P,v as k,w as v}from"../chunks/index.3d76737d.js";const x="modulepreload",ee=function(f,e){return new URL(f,e).href},I={},$=function(e,n,r){if(!n||n.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(n.map(a=>{if(a=ee(a,r),a in I)return;I[a]=!0;const t=a.endsWith(".css"),o=t?'[rel="stylesheet"]':"";if(!!r)for(let l=i.length-1;l>=0;l--){const u=i[l];if(u.href===a&&(!t||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${o}`))return;const c=document.createElement("link");if(c.rel=t?"stylesheet":x,t||(c.as="script",c.crossOrigin=""),c.href=a,document.head.appendChild(c),t)return new Promise((l,u)=>{c.addEventListener("load",l),c.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=a,window.dispatchEvent(t),!t.defaultPrevented)throw a})},_e={};function te(f){let e,n,r;var i=f[1][0];function a(t,o){return{props:{data:t[3],form:t[2]}}}return i&&(e=g(i,a(f)),f[15](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][0])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[15](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&8&&(s.data=t[3]),o&4&&(s.form=t[2]),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[15](null),e&&v(e,t)}}}function ne(f){let e,n,r;var i=f[1][0];function a(t,o){return{props:{data:t[3],$$slots:{default:[oe]},$$scope:{ctx:t}}}}return i&&(e=g(i,a(f)),f[14](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][0])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[14](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&8&&(s.data=t[3]),o&65591&&(s.$$scope={dirty:o,ctx:t}),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[14](null),e&&v(e,t)}}}function ie(f){let e,n,r;var i=f[1][1];function a(t,o){return{props:{data:t[4],form:t[2]}}}return i&&(e=g(i,a(f)),f[13](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][1])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[13](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&16&&(s.data=t[4]),o&4&&(s.form=t[2]),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[13](null),e&&v(e,t)}}}function se(f){let e,n,r;var i=f[1][1];function a(t,o){return{props:{data:t[4],$$slots:{default:[re]},$$scope:{ctx:t}}}}return i&&(e=g(i,a(f)),f[12](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][1])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[12](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&16&&(s.data=t[4]),o&65575&&(s.$$scope={dirty:o,ctx:t}),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[12](null),e&&v(e,t)}}}function re(f){let e,n,r;var i=f[1][2];function a(t,o){return{props:{data:t[5],form:t[2]}}}return i&&(e=g(i,a(f)),f[11](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][2])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[11](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&32&&(s.data=t[5]),o&4&&(s.form=t[2]),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[11](null),e&&v(e,t)}}}function oe(f){let e,n,r,i;const a=[se,ie],t=[];function o(s,c){return s[1][2]?0:1}return e=o(f),n=t[e]=a[e](f),{c(){n.c(),r=m()},l(s){n.l(s),r=m()},m(s,c){t[e].m(s,c),w(s,r,c),i=!0},p(s,c){let l=e;e=o(s),e===l?t[e].p(s,c):(R(),p(t[l],1,1,()=>{t[l]=null}),y(),n=t[e],n?n.p(s,c):(n=t[e]=a[e](s),n.c()),h(n,1),n.m(r.parentNode,r))},i(s){i||(h(n),i=!0)},o(s){p(n),i=!1},d(s){s&&d(r),t[e].d(s)}}}function O(f){let e,n=f[7]&&T(f);return{c(){e=K("div"),n&&n.c(),this.h()},l(r){e=M(r,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var i=Q(e);n&&n.l(i),i.forEach(d),this.h()},h(){S(e,"id","svelte-announcer"),S(e,"aria-live","assertive"),S(e,"aria-atomic","true"),E(e,"position","absolute"),E(e,"left","0"),E(e,"top","0"),E(e,"clip","rect(0 0 0 0)"),E(e,"clip-path","inset(50%)"),E(e,"overflow","hidden"),E(e,"white-space","nowrap"),E(e,"width","1px"),E(e,"height","1px")},m(r,i){w(r,e,i),n&&n.m(e,null)},p(r,i){r[7]?n?n.p(r,i):(n=T(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(r){r&&d(e),n&&n.d()}}}function T(f){let e;return{c(){e=X(f[8])},l(n){e=Y(n,f[8])},m(n,r){w(n,e,r)},p(n,r){r&256&&Z(e,n[8])},d(n){n&&d(e)}}}function fe(f){let e,n,r,i,a;const t=[ne,te],o=[];function s(l,u){return l[1][1]?0:1}e=s(f),n=o[e]=t[e](f);let c=f[6]&&O(f);return{c(){n.c(),r=H(),c&&c.c(),i=m()},l(l){n.l(l),r=J(l),c&&c.l(l),i=m()},m(l,u){o[e].m(l,u),w(l,r,u),c&&c.m(l,u),w(l,i,u),a=!0},p(l,[u]){let N=e;e=s(l),e===N?o[e].p(l,u):(R(),p(o[N],1,1,()=>{o[N]=null}),y(),n=o[e],n?n.p(l,u):(n=o[e]=t[e](l),n.c()),h(n,1),n.m(r.parentNode,r)),l[6]?c?c.p(l,u):(c=O(l),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null)},i(l){a||(h(n),a=!0)},o(l){p(n),a=!1},d(l){l&&(d(r),d(i)),o[e].d(l),c&&c.d(l)}}}function ae(f,e,n){let{stores:r}=e,{page:i}=e,{constructors:a}=e,{components:t=[]}=e,{form:o}=e,{data_0:s=null}=e,{data_1:c=null}=e,{data_2:l=null}=e;j(r.page.notify);let u=!1,N=!1,D=null;W(()=>{const _=r.page.subscribe(()=>{u&&(n(7,N=!0),z().then(()=>{n(8,D=document.title||"untitled page")}))});return n(6,u=!0),_});function V(_){L[_?"unshift":"push"](()=>{t[2]=_,n(0,t)})}function A(_){L[_?"unshift":"push"](()=>{t[1]=_,n(0,t)})}function C(_){L[_?"unshift":"push"](()=>{t[1]=_,n(0,t)})}function q(_){L[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}function B(_){L[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}return f.$$set=_=>{"stores"in _&&n(9,r=_.stores),"page"in _&&n(10,i=_.page),"constructors"in _&&n(1,a=_.constructors),"components"in _&&n(0,t=_.components),"form"in _&&n(2,o=_.form),"data_0"in _&&n(3,s=_.data_0),"data_1"in _&&n(4,c=_.data_1),"data_2"in _&&n(5,l=_.data_2)},f.$$.update=()=>{f.$$.dirty&1536&&r.page.set(i)},[t,a,o,s,c,l,u,N,D,r,i,V,A,C,q,B]}class ue extends F{constructor(e){super(),G(this,e,ae,fe,U,{stores:9,page:10,constructors:1,components:0,form:2,data_0:3,data_1:4,data_2:5})}}const me=[()=>$(()=>import("../nodes/0.337291a1.js"),["../nodes/0.337291a1.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../assets/tailwind.9d0d3188.css"],import.meta.url),()=>$(()=>import("../nodes/1.9b84f65d.js"),["../nodes/1.9b84f65d.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../chunks/singletons.10cd924e.js","../chunks/index.7d157e8c.js"],import.meta.url),()=>$(()=>import("../nodes/2.c0e9e268.js"),["../nodes/2.c0e9e268.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../assets/tailwind.9d0d3188.css"],import.meta.url),()=>$(()=>import("../nodes/3.8d2dfa83.js"),["../nodes/3.8d2dfa83.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../chunks/index.7d157e8c.js","../assets/3.57cf30c7.css"],import.meta.url)],pe=[],he={"/(site)":[3,[2]]},de={handleError:({error:f})=>{console.error(f)}};export{he as dictionary,de as hooks,_e as matchers,me as nodes,ue as root,pe as server_loads}; +import{s as U,a as j,o as W,t as z,b as L}from"../chunks/scheduler.e80da8ef.js";import{S as F,i as G,s as H,e as m,c as J,a as w,t as p,b as y,d as h,f as d,g as K,h as M,j as Q,k as S,l as E,m as X,n as Y,o as Z,p as R,q as g,r as b,u as P,v as k,w as v}from"../chunks/index.3d76737d.js";const x="modulepreload",ee=function(f,e){return new URL(f,e).href},I={},$=function(e,n,r){if(!n||n.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(n.map(a=>{if(a=ee(a,r),a in I)return;I[a]=!0;const t=a.endsWith(".css"),o=t?'[rel="stylesheet"]':"";if(!!r)for(let l=i.length-1;l>=0;l--){const u=i[l];if(u.href===a&&(!t||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${o}`))return;const c=document.createElement("link");if(c.rel=t?"stylesheet":x,t||(c.as="script",c.crossOrigin=""),c.href=a,document.head.appendChild(c),t)return new Promise((l,u)=>{c.addEventListener("load",l),c.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=a,window.dispatchEvent(t),!t.defaultPrevented)throw a})},_e={};function te(f){let e,n,r;var i=f[1][0];function a(t,o){return{props:{data:t[3],form:t[2]}}}return i&&(e=g(i,a(f)),f[15](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][0])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[15](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&8&&(s.data=t[3]),o&4&&(s.form=t[2]),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[15](null),e&&v(e,t)}}}function ne(f){let e,n,r;var i=f[1][0];function a(t,o){return{props:{data:t[3],$$slots:{default:[oe]},$$scope:{ctx:t}}}}return i&&(e=g(i,a(f)),f[14](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][0])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[14](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&8&&(s.data=t[3]),o&65591&&(s.$$scope={dirty:o,ctx:t}),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[14](null),e&&v(e,t)}}}function ie(f){let e,n,r;var i=f[1][1];function a(t,o){return{props:{data:t[4],form:t[2]}}}return i&&(e=g(i,a(f)),f[13](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][1])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[13](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&16&&(s.data=t[4]),o&4&&(s.form=t[2]),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[13](null),e&&v(e,t)}}}function se(f){let e,n,r;var i=f[1][1];function a(t,o){return{props:{data:t[4],$$slots:{default:[re]},$$scope:{ctx:t}}}}return i&&(e=g(i,a(f)),f[12](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][1])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[12](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&16&&(s.data=t[4]),o&65575&&(s.$$scope={dirty:o,ctx:t}),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[12](null),e&&v(e,t)}}}function re(f){let e,n,r;var i=f[1][2];function a(t,o){return{props:{data:t[5],form:t[2]}}}return i&&(e=g(i,a(f)),f[11](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][2])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[11](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&32&&(s.data=t[5]),o&4&&(s.form=t[2]),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[11](null),e&&v(e,t)}}}function oe(f){let e,n,r,i;const a=[se,ie],t=[];function o(s,c){return s[1][2]?0:1}return e=o(f),n=t[e]=a[e](f),{c(){n.c(),r=m()},l(s){n.l(s),r=m()},m(s,c){t[e].m(s,c),w(s,r,c),i=!0},p(s,c){let l=e;e=o(s),e===l?t[e].p(s,c):(R(),p(t[l],1,1,()=>{t[l]=null}),y(),n=t[e],n?n.p(s,c):(n=t[e]=a[e](s),n.c()),h(n,1),n.m(r.parentNode,r))},i(s){i||(h(n),i=!0)},o(s){p(n),i=!1},d(s){s&&d(r),t[e].d(s)}}}function O(f){let e,n=f[7]&&T(f);return{c(){e=K("div"),n&&n.c(),this.h()},l(r){e=M(r,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var i=Q(e);n&&n.l(i),i.forEach(d),this.h()},h(){S(e,"id","svelte-announcer"),S(e,"aria-live","assertive"),S(e,"aria-atomic","true"),E(e,"position","absolute"),E(e,"left","0"),E(e,"top","0"),E(e,"clip","rect(0 0 0 0)"),E(e,"clip-path","inset(50%)"),E(e,"overflow","hidden"),E(e,"white-space","nowrap"),E(e,"width","1px"),E(e,"height","1px")},m(r,i){w(r,e,i),n&&n.m(e,null)},p(r,i){r[7]?n?n.p(r,i):(n=T(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(r){r&&d(e),n&&n.d()}}}function T(f){let e;return{c(){e=X(f[8])},l(n){e=Y(n,f[8])},m(n,r){w(n,e,r)},p(n,r){r&256&&Z(e,n[8])},d(n){n&&d(e)}}}function fe(f){let e,n,r,i,a;const t=[ne,te],o=[];function s(l,u){return l[1][1]?0:1}e=s(f),n=o[e]=t[e](f);let c=f[6]&&O(f);return{c(){n.c(),r=H(),c&&c.c(),i=m()},l(l){n.l(l),r=J(l),c&&c.l(l),i=m()},m(l,u){o[e].m(l,u),w(l,r,u),c&&c.m(l,u),w(l,i,u),a=!0},p(l,[u]){let N=e;e=s(l),e===N?o[e].p(l,u):(R(),p(o[N],1,1,()=>{o[N]=null}),y(),n=o[e],n?n.p(l,u):(n=o[e]=t[e](l),n.c()),h(n,1),n.m(r.parentNode,r)),l[6]?c?c.p(l,u):(c=O(l),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null)},i(l){a||(h(n),a=!0)},o(l){p(n),a=!1},d(l){l&&(d(r),d(i)),o[e].d(l),c&&c.d(l)}}}function ae(f,e,n){let{stores:r}=e,{page:i}=e,{constructors:a}=e,{components:t=[]}=e,{form:o}=e,{data_0:s=null}=e,{data_1:c=null}=e,{data_2:l=null}=e;j(r.page.notify);let u=!1,N=!1,D=null;W(()=>{const _=r.page.subscribe(()=>{u&&(n(7,N=!0),z().then(()=>{n(8,D=document.title||"untitled page")}))});return n(6,u=!0),_});function V(_){L[_?"unshift":"push"](()=>{t[2]=_,n(0,t)})}function A(_){L[_?"unshift":"push"](()=>{t[1]=_,n(0,t)})}function C(_){L[_?"unshift":"push"](()=>{t[1]=_,n(0,t)})}function q(_){L[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}function B(_){L[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}return f.$$set=_=>{"stores"in _&&n(9,r=_.stores),"page"in _&&n(10,i=_.page),"constructors"in _&&n(1,a=_.constructors),"components"in _&&n(0,t=_.components),"form"in _&&n(2,o=_.form),"data_0"in _&&n(3,s=_.data_0),"data_1"in _&&n(4,c=_.data_1),"data_2"in _&&n(5,l=_.data_2)},f.$$.update=()=>{f.$$.dirty&1536&&r.page.set(i)},[t,a,o,s,c,l,u,N,D,r,i,V,A,C,q,B]}class ue extends F{constructor(e){super(),G(this,e,ae,fe,U,{stores:9,page:10,constructors:1,components:0,form:2,data_0:3,data_1:4,data_2:5})}}const me=[()=>$(()=>import("../nodes/0.adbffdf9.js"),["../nodes/0.adbffdf9.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../assets/tailwind.132c0f7b.css"],import.meta.url),()=>$(()=>import("../nodes/1.11fa3d0a.js"),["../nodes/1.11fa3d0a.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../chunks/singletons.06f3a387.js","../chunks/index.7d157e8c.js"],import.meta.url),()=>$(()=>import("../nodes/2.1e86c4e5.js"),["../nodes/2.1e86c4e5.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../assets/tailwind.132c0f7b.css"],import.meta.url),()=>$(()=>import("../nodes/3.d5005826.js"),["../nodes/3.d5005826.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../chunks/index.7d157e8c.js","../assets/3.7335eec7.css"],import.meta.url)],pe=[],he={"/(site)":[3,[2]]},de={handleError:({error:f})=>{console.error(f)}};export{he as dictionary,de as hooks,_e as matchers,me as nodes,ue as root,pe as server_loads}; diff --git a/_app/immutable/entry/start.f52ce0bb.js b/_app/immutable/entry/start.a0d177c1.js similarity index 99% rename from _app/immutable/entry/start.f52ce0bb.js rename to _app/immutable/entry/start.a0d177c1.js index f9d2aba2..df51de68 100644 --- a/_app/immutable/entry/start.f52ce0bb.js +++ b/_app/immutable/entry/start.a0d177c1.js @@ -1,3 +1,3 @@ -import{o as me,t as we}from"../chunks/scheduler.e80da8ef.js";import{S as Ge,a as Je,I as V,g as De,f as Ce,b as _e,c as le,s as te,i as ye,d as H,o as Me,e as G,P as Ve,h as Ze}from"../chunks/singletons.10cd924e.js";function Qe(t,r){return t==="/"||r==="ignore"?t:r==="never"?t.endsWith("/")?t.slice(0,-1):t:r==="always"&&!t.endsWith("/")?t+"/":t}function et(t){return t.split("%25").map(decodeURI).join("%25")}function tt(t){for(const r in t)t[r]=decodeURIComponent(t[r]);return t}const nt=["href","pathname","search","searchParams","toString","toJSON"];function at(t,r){const f=new URL(t);for(const i of nt)Object.defineProperty(f,i,{get(){return r(),t[i]},enumerable:!0,configurable:!0});return rt(f),f}function rt(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const ot="/__data.json";function it(t){return t.replace(/\/$/,"")+ot}function st(...t){let r=5381;for(const f of t)if(typeof f=="string"){let i=f.length;for(;i;)r=r*33^f.charCodeAt(--i)}else if(ArrayBuffer.isView(f)){const i=new Uint8Array(f.buffer,f.byteOffset,f.byteLength);let h=i.length;for(;h;)r=r*33^i[--h]}else throw new TypeError("value must be a string or TypedArray");return(r>>>0).toString(36)}const Ke=window.fetch;window.fetch=(t,r)=>((t instanceof Request?t.method:(r==null?void 0:r.method)||"GET")!=="GET"&&ae.delete(Se(t)),Ke(t,r));const ae=new Map;function ct(t,r){const f=Se(t,r),i=document.querySelector(f);if(i!=null&&i.textContent){const{body:h,...u}=JSON.parse(i.textContent),E=i.getAttribute("data-ttl");return E&&ae.set(f,{body:h,init:u,ttl:1e3*Number(E)}),Promise.resolve(new Response(h,u))}return window.fetch(t,r)}function lt(t,r,f){if(ae.size>0){const i=Se(t,f),h=ae.get(i);if(h){if(performance.now(){const h=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(i);if(h)return r.push({name:h[1],matcher:h[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const u=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(i);if(u)return r.push({name:u[1],matcher:u[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!i)return;const E=i.split(/\[(.+?)\](?!\])/);return"/"+E.map((g,m)=>{if(m%2){if(g.startsWith("x+"))return ve(String.fromCharCode(parseInt(g.slice(2),16)));if(g.startsWith("u+"))return ve(String.fromCharCode(...g.slice(2).split("-").map(U=>parseInt(U,16))));const d=ft.exec(g);if(!d)throw new Error(`Invalid param: ${g}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,j,T,R,C]=d;return r.push({name:R,matcher:C,optional:!!j,rest:!!T,chained:T?m===1&&E[0]==="":!1}),T?"(.*?)":j?"([^/]*)?":"([^/]+?)"}return ve(g)}).join("")}).join("")}/?$`),params:r}}function dt(t){return!/^\([^)]+\)$/.test(t)}function pt(t){return t.slice(1).split("/").filter(dt)}function ht(t,r,f){const i={},h=t.slice(1),u=h.filter(l=>l!==void 0);let E=0;for(let l=0;ld).join("/"),E=0),m===void 0){g.rest&&(i[g.name]="");continue}if(!g.matcher||f[g.matcher](m)){i[g.name]=m;const d=r[l+1],j=h[l+1];d&&!d.rest&&d.optional&&j&&g.chained&&(E=0),!d&&!j&&Object.keys(i).length===u.length&&(E=0);continue}if(g.optional&&g.chained){E++;continue}return}if(!E)return i}function ve(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function gt({nodes:t,server_loads:r,dictionary:f,matchers:i}){const h=new Set(r);return Object.entries(f).map(([l,[g,m,d]])=>{const{pattern:j,params:T}=ut(l),R={id:l,exec:C=>{const U=j.exec(C);if(U)return ht(U,T,i)},errors:[1,...d||[]].map(C=>t[C]),layouts:[0,...m||[]].map(E),leaf:u(g)};return R.errors.length=R.layouts.length=Math.max(R.errors.length,R.layouts.length),R});function u(l){const g=l<0;return g&&(l=~l),[g,t[l]]}function E(l){return l===void 0?l:[h.has(l),t[l]]}}function ze(t){try{return JSON.parse(sessionStorage[t])}catch{}}function qe(t,r){const f=JSON.stringify(r);try{sessionStorage[t]=f}catch{}}const mt=-1,wt=-2,_t=-3,yt=-4,vt=-5,bt=-6;function Et(t,r){if(typeof t=="number")return h(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const f=t,i=Array(f.length);function h(u,E=!1){if(u===mt)return;if(u===_t)return NaN;if(u===yt)return 1/0;if(u===vt)return-1/0;if(u===bt)return-0;if(E)throw new Error("Invalid input");if(u in i)return i[u];const l=f[u];if(!l||typeof l!="object")i[u]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const g=l[0],m=r==null?void 0:r[g];if(m)return i[u]=m(h(l[1]));switch(g){case"Date":i[u]=new Date(l[1]);break;case"Set":const d=new Set;i[u]=d;for(let R=1;Rr!=null)}const We=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...We];const kt=new Set([...We]);[...kt];async function Rt(t,r){var f;for(const i in t)if(typeof((f=t[i])==null?void 0:f.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(t).map(async([h,u])=>[h,await u])));return t}class ne{constructor(r,f){this.status=r,typeof f=="string"?this.body={message:f}:f?this.body=f:this.body={message:`Error: ${r}`}}toString(){return JSON.stringify(this.body)}}class Fe{constructor(r,f){this.status=r,this.location=f}}const At="x-sveltekit-invalidated",It="x-sveltekit-trailing-slash",J=ze(Ge)??{},ee=ze(Je)??{};function be(t){J[t]=te()}function K(t){return location.href=t.href,new Promise(()=>{})}function Lt(t,r){var Ne;const f=gt(t),i=t.nodes[0],h=t.nodes[1];i(),h();const u=document.documentElement,E=[],l=[];let g=null;const m={before_navigate:[],on_navigate:[],after_navigate:[]};let d={branch:[],error:null,url:null},j=!1,T=!1,R=!0,C=!1,U=!1,D=!1,z=!1,q,x=(Ne=history.state)==null?void 0:Ne[V];x||(x=Date.now(),history.replaceState({...history.state,[V]:x},"",location.href));const fe=J[x];fe&&(history.scrollRestoration="manual",scrollTo(fe.x,fe.y));let F,W,Y;async function ke(){if(Y=Y||Promise.resolve(),await Y,!Y)return;Y=null;const e=new URL(location.href),s=Z(e,!0);g=null;const n=W={},o=s&&await pe(s);if(n===W&&o){if(o.type==="redirect")return re(new URL(o.location,e).href,{},1,n);o.props.page!==void 0&&(F=o.props.page),q.$set(o.props)}}function Re(e){l.some(s=>s==null?void 0:s.snapshot)&&(ee[e]=l.map(s=>{var n;return(n=s==null?void 0:s.snapshot)==null?void 0:n.capture()}))}function Ae(e){var s;(s=ee[e])==null||s.forEach((n,o)=>{var a,c;(c=(a=l[o])==null?void 0:a.snapshot)==null||c.restore(n)})}function Ie(){be(x),qe(Ge,J),Re(x),qe(Je,ee)}async function re(e,{noScroll:s=!1,replaceState:n=!1,keepFocus:o=!1,state:a={},invalidateAll:c=!1},p,v){return typeof e=="string"&&(e=new URL(e,De(document))),ce({url:e,scroll:s?te():null,keepfocus:o,redirect_count:p,details:{state:a,replaceState:n},nav_token:v,accepted:()=>{c&&(z=!0)},blocked:()=>{},type:"goto"})}async function Le(e){return g={id:e.id,promise:pe(e).then(s=>(s.type==="loaded"&&s.state.error&&(g=null),s))},g.promise}async function oe(...e){const n=f.filter(o=>e.some(a=>o.exec(a))).map(o=>Promise.all([...o.layouts,o.leaf].map(a=>a==null?void 0:a[1]())));await Promise.all(n)}function Pe(e){var o;d=e.state;const s=document.querySelector("style[data-sveltekit]");s&&s.remove(),F=e.props.page,q=new t.root({target:r,props:{...e.props,stores:H,components:l},hydrate:!0}),Ae(x);const n={from:null,to:{params:d.params,route:{id:((o=d.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};m.after_navigate.forEach(a=>a(n)),T=!0}async function X({url:e,params:s,branch:n,status:o,error:a,route:c,form:p}){let v="never";for(const _ of n)(_==null?void 0:_.slash)!==void 0&&(v=_.slash);e.pathname=Qe(e.pathname,v),e.search=e.search;const b={type:"loaded",state:{url:e,params:s,branch:n,error:a,route:c},props:{constructors:St(n).map(_=>_.node.component)}};p!==void 0&&(b.props.form=p);let y={},L=!F,A=0;for(let _=0;_(v.route=!0,w[O])}),params:new Proxy(o,{get:(w,O)=>(v.params.add(O),w[O])}),data:(c==null?void 0:c.data)??null,url:at(n,()=>{v.url=!0}),async fetch(w,O){let N;w instanceof Request?(N=w.url,O={body:w.method==="GET"||w.method==="HEAD"?void 0:await w.blob(),cache:w.cache,credentials:w.credentials,headers:w.headers,integrity:w.integrity,keepalive:w.keepalive,method:w.method,mode:w.mode,redirect:w.redirect,referrer:w.referrer,referrerPolicy:w.referrerPolicy,signal:w.signal,...O}):N=w;const M=new URL(N,n);return P(M.href),M.origin===n.origin&&(N=M.href.slice(n.origin.length)),T?lt(N,M.href,O):ct(N,O)},setHeaders:()=>{},depends:P,parent(){return v.parent=!0,s()}};p=await b.universal.load.call(null,_)??null,p=p?await Rt(p,a.id):null}return{node:b,loader:e,server:c,universal:(L=b.universal)!=null&&L.load?{type:"data",data:p,uses:v}:null,data:p??(c==null?void 0:c.data)??null,slash:((A=b.universal)==null?void 0:A.trailingSlash)??(c==null?void 0:c.slash)}}function Oe(e,s,n,o,a){if(z)return!0;if(!o)return!1;if(o.parent&&e||o.route&&s||o.url&&n)return!0;for(const c of o.params)if(a[c]!==d.params[c])return!0;for(const c of o.dependencies)if(E.some(p=>p(new URL(c))))return!0;return!1}function de(e,s){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?s??null:null}async function pe({id:e,invalidating:s,url:n,params:o,route:a}){if((g==null?void 0:g.id)===e)return g.promise;const{errors:c,layouts:p,leaf:v}=a,b=[...p,v];c.forEach(S=>S==null?void 0:S().catch(()=>{})),b.forEach(S=>S==null?void 0:S[1]().catch(()=>{}));let y=null;const L=d.url?e!==d.url.pathname+d.url.search:!1,A=d.route?a.id!==d.route.id:!1;let P=!1;const _=b.map((S,I)=>{var B;const k=d.branch[I],$=!!(S!=null&&S[0])&&((k==null?void 0:k.loader)!==S[1]||Oe(P,A,L,(B=k.server)==null?void 0:B.uses,o));return $&&(P=!0),$});if(_.some(Boolean)){try{y=await He(n,_)}catch(S){return ie({status:S instanceof ne?S.status:500,error:await Q(S,{url:n,params:o,route:{id:a.id}}),url:n,route:a})}if(y.type==="redirect")return y}const w=y==null?void 0:y.nodes;let O=!1;const N=b.map(async(S,I)=>{var he;if(!S)return;const k=d.branch[I],$=w==null?void 0:w[I];if((!$||$.type==="skip")&&S[1]===(k==null?void 0:k.loader)&&!Oe(O,A,L,(he=k.universal)==null?void 0:he.uses,o))return k;if(O=!0,($==null?void 0:$.type)==="error")throw $;return ue({loader:S[1],url:n,params:o,route:a,parent:async()=>{var Te;const $e={};for(let ge=0;ge{});const M=[];for(let S=0;SPromise.resolve({}),server_data_node:de(c)}),b={node:await h(),loader:h,universal:null,server:null,data:null};return await X({url:n,params:a,branch:[v,b],status:e,error:s,route:null})}function Z(e,s){if(ye(e,G))return;const n=se(e);for(const o of f){const a=o.exec(n);if(a)return{id:e.pathname+e.search,invalidating:s,route:o,params:tt(a),url:e}}}function se(e){return et(e.pathname.slice(G.length)||"/")}function Ue({url:e,type:s,intent:n,delta:o}){let a=!1;const c=Be(d,n,e,s);o!==void 0&&(c.navigation.delta=o);const p={...c.navigation,cancel:()=>{a=!0,c.reject(new Error("navigation was cancelled"))}};return U||m.before_navigate.forEach(v=>v(p)),a?null:c}async function ce({url:e,scroll:s,keepfocus:n,redirect_count:o,details:a,type:c,delta:p,nav_token:v={},accepted:b,blocked:y}){var N,M,S;const L=Z(e,!1),A=Ue({url:e,type:c,delta:p,intent:L});if(!A){y();return}const P=x;b(),U=!0,T&&H.navigating.set(A.navigation),W=v;let _=L&&await pe(L);if(!_){if(ye(e,G))return await K(e);_=await je(e,{id:null},await Q(new Error(`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(L==null?void 0:L.url)||e,W!==v)return A.reject(new Error("navigation was aborted")),!1;if(_.type==="redirect")if(o>=20)_=await ie({status:500,error:await Q(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return re(new URL(_.location,e).href,{},o+1,v),!1;else((N=_.props.page)==null?void 0:N.status)>=400&&await H.updated.check()&&await K(e);if(E.length=0,z=!1,C=!0,be(P),Re(P),(M=_.props.page)!=null&&M.url&&_.props.page.url.pathname!==e.pathname&&(e.pathname=(S=_.props.page)==null?void 0:S.url.pathname),a){const I=a.replaceState?0:1;if(a.state[V]=x+=I,history[a.replaceState?"replaceState":"pushState"](a.state,"",e),!a.replaceState){let k=x+1;for(;ee[k]||J[k];)delete ee[k],delete J[k],k+=1}}if(g=null,T){d=_.state,_.props.page&&(_.props.page.url=e);const I=(await Promise.all(m.on_navigate.map(k=>k(A.navigation)))).filter(k=>typeof k=="function");if(I.length>0){let k=function(){m.after_navigate=m.after_navigate.filter($=>!I.includes($))};I.push(k),m.after_navigate.push(...I)}q.$set(_.props)}else Pe(_);const{activeElement:w}=document;if(await we(),R){const I=e.hash&&document.getElementById(decodeURIComponent(e.hash.slice(1)));s?scrollTo(s.x,s.y):I?I.scrollIntoView():scrollTo(0,0)}const O=document.activeElement!==w&&document.activeElement!==document.body;!n&&!O&&Ee(),R=!0,_.props.page&&(F=_.props.page),U=!1,c==="popstate"&&Ae(x),A.fulfil(void 0),m.after_navigate.forEach(I=>I(A.navigation)),H.navigating.set(null),C=!1}async function je(e,s,n,o){return e.origin===Me&&e.pathname===location.pathname&&!j?await ie({status:o,error:n,url:e,route:s}):await K(e)}function Xe(){let e;u.addEventListener("mousemove",c=>{const p=c.target;clearTimeout(e),e=setTimeout(()=>{o(p,2)},20)});function s(c){o(c.composedPath()[0],1)}u.addEventListener("mousedown",s),u.addEventListener("touchstart",s,{passive:!0});const n=new IntersectionObserver(c=>{for(const p of c)p.isIntersecting&&(oe(se(new URL(p.target.href))),n.unobserve(p.target))},{threshold:0});function o(c,p){const v=Ce(c,u);if(!v)return;const{url:b,external:y,download:L}=_e(v,G);if(y||L)return;const A=le(v);if(!A.reload)if(p<=A.preload_data){const P=Z(b,!1);P&&Le(P)}else p<=A.preload_code&&oe(se(b))}function a(){n.disconnect();for(const c of u.querySelectorAll("a")){const{url:p,external:v,download:b}=_e(c,G);if(v||b)continue;const y=le(c);y.reload||(y.preload_code===Ve.viewport&&n.observe(c),y.preload_code===Ve.eager&&oe(se(p)))}}m.after_navigate.push(a),a()}function Q(e,s){return e instanceof ne?e.body:t.hooks.handleError({error:e,event:s})??{message:s.route.id!=null?"Internal Error":"Not Found"}}return{after_navigate:e=>{me(()=>(m.after_navigate.push(e),()=>{const s=m.after_navigate.indexOf(e);m.after_navigate.splice(s,1)}))},before_navigate:e=>{me(()=>(m.before_navigate.push(e),()=>{const s=m.before_navigate.indexOf(e);m.before_navigate.splice(s,1)}))},on_navigate:e=>{me(()=>(m.on_navigate.push(e),()=>{const s=m.on_navigate.indexOf(e);m.on_navigate.splice(s,1)}))},disable_scroll_handling:()=>{(C||!T)&&(R=!1)},goto:(e,s={})=>re(e,s,0),invalidate:e=>{if(typeof e=="function")E.push(e);else{const{href:s}=new URL(e,location.href);E.push(n=>n.href===s)}return ke()},invalidate_all:()=>(z=!0,ke()),preload_data:async e=>{const s=new URL(e,De(document)),n=Z(s,!1);if(!n)throw new Error(`Attempted to preload a URL that does not belong to this app: ${s}`);await Le(n)},preload_code:oe,apply_action:async e=>{if(e.type==="error"){const s=new URL(location.href),{branch:n,route:o}=d;if(!o)return;const a=await xe(d.branch.length,n,o.errors);if(a){const c=await X({url:s,params:d.params,branch:n.slice(0,a.idx).concat(a.node),status:e.status??500,error:e.error,route:o});d=c.state,q.$set(c.props),we().then(Ee)}}else e.type==="redirect"?re(e.location,{invalidateAll:!0},0):(q.$set({form:null,page:{...F,form:e.data,status:e.status}}),await we(),q.$set({form:e.data}),e.type==="success"&&Ee())},_start_router:()=>{var s;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let o=!1;if(Ie(),!U){const a=Be(d,void 0,null,"leave"),c={...a.navigation,cancel:()=>{o=!0,a.reject(new Error("navigation was cancelled"))}};m.before_navigate.forEach(p=>p(c))}o?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ie()}),(s=navigator.connection)!=null&&s.saveData||Xe(),u.addEventListener("click",n=>{var P;if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const o=Ce(n.composedPath()[0],u);if(!o)return;const{url:a,external:c,target:p,download:v}=_e(o,G);if(!a)return;if(p==="_parent"||p==="_top"){if(window.parent!==window)return}else if(p&&p!=="_self")return;const b=le(o);if(!(o instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||v)return;if(c||b.reload){Ue({url:a,type:"link"})?U=!0:n.preventDefault();return}const[L,A]=a.href.split("#");if(A!==void 0&&L===location.href.split("#")[0]){if(d.url.hash===a.hash){n.preventDefault(),(P=o.ownerDocument.getElementById(A))==null||P.scrollIntoView();return}if(D=!0,be(x),e(a),!b.replace_state)return;D=!1,n.preventDefault()}ce({url:a,scroll:b.noscroll?te():null,keepfocus:b.keep_focus??!1,redirect_count:0,details:{state:{},replaceState:b.replace_state??a.href===location.href},accepted:()=>n.preventDefault(),blocked:()=>n.preventDefault(),type:"link"})}),u.addEventListener("submit",n=>{if(n.defaultPrevented)return;const o=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formMethod)||o.method)!=="get")return;const p=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||o.action);if(ye(p,G))return;const v=n.target,{keep_focus:b,noscroll:y,reload:L,replace_state:A}=le(v);if(L)return;n.preventDefault(),n.stopPropagation();const P=new FormData(v),_=a==null?void 0:a.getAttribute("name");_&&P.append(_,(a==null?void 0:a.getAttribute("value"))??""),p.search=new URLSearchParams(P).toString(),ce({url:p,scroll:y?te():null,keepfocus:b??!1,redirect_count:0,details:{state:{},replaceState:A??p.href===location.href},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",async n=>{var o;if(W={},(o=n.state)!=null&&o[V]){if(n.state[V]===x)return;const a=J[n.state[V]],c=new URL(location.href);if(d.url.href.split("#")[0]===location.href.split("#")[0]){e(c),J[x]=te(),x=n.state[V],scrollTo(a.x,a.y);return}const p=n.state[V]-x;await ce({url:c,scroll:a,keepfocus:!1,redirect_count:0,details:null,accepted:()=>{x=n.state[V]},blocked:()=>{history.go(-p)},type:"popstate",delta:p,nav_token:W})}else if(!D){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{D&&(D=!1,history.replaceState({...history.state,[V]:++x},"",location.href))});for(const n of document.querySelectorAll("link"))n.rel==="icon"&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&H.navigating.set(null)});function e(n){d.url=n,H.page.set({...F,url:n}),H.page.notify()}},_hydrate:async({status:e=200,error:s,node_ids:n,params:o,route:a,data:c,form:p})=>{j=!0;const v=new URL(location.href);({params:o={},route:a={id:null}}=Z(v,!1)||{});let b;try{const y=n.map(async(P,_)=>{const w=c[_];return w!=null&&w.uses&&(w.uses=Ye(w.uses)),ue({loader:t.nodes[P],url:v,params:o,route:a,parent:async()=>{const O={};for(let N=0;N<_;N+=1)Object.assign(O,(await y[N]).data);return O},server_data_node:de(w)})}),L=await Promise.all(y),A=f.find(({id:P})=>P===a.id);if(A){const P=A.layouts;for(let _=0;_u?"1":"0").join(""));const i=await Ke(f.href);if((h=i.headers.get("content-type"))!=null&&h.includes("text/html")&&await K(t),!i.ok)throw new ne(i.status,await i.json());return new Promise(async u=>{var j;const E=new Map,l=i.body.getReader(),g=new TextDecoder;function m(T){return Et(T,{Promise:R=>new Promise((C,U)=>{E.set(R,{fulfil:C,reject:U})})})}let d="";for(;;){const{done:T,value:R}=await l.read();if(T&&!d)break;for(d+=!R&&d?` +import{o as me,t as we}from"../chunks/scheduler.e80da8ef.js";import{S as Ge,a as Je,I as V,g as De,f as Ce,b as _e,c as le,s as te,i as ye,d as H,o as Me,e as G,P as Ve,h as Ze}from"../chunks/singletons.06f3a387.js";function Qe(t,r){return t==="/"||r==="ignore"?t:r==="never"?t.endsWith("/")?t.slice(0,-1):t:r==="always"&&!t.endsWith("/")?t+"/":t}function et(t){return t.split("%25").map(decodeURI).join("%25")}function tt(t){for(const r in t)t[r]=decodeURIComponent(t[r]);return t}const nt=["href","pathname","search","searchParams","toString","toJSON"];function at(t,r){const f=new URL(t);for(const i of nt)Object.defineProperty(f,i,{get(){return r(),t[i]},enumerable:!0,configurable:!0});return rt(f),f}function rt(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const ot="/__data.json";function it(t){return t.replace(/\/$/,"")+ot}function st(...t){let r=5381;for(const f of t)if(typeof f=="string"){let i=f.length;for(;i;)r=r*33^f.charCodeAt(--i)}else if(ArrayBuffer.isView(f)){const i=new Uint8Array(f.buffer,f.byteOffset,f.byteLength);let h=i.length;for(;h;)r=r*33^i[--h]}else throw new TypeError("value must be a string or TypedArray");return(r>>>0).toString(36)}const Ke=window.fetch;window.fetch=(t,r)=>((t instanceof Request?t.method:(r==null?void 0:r.method)||"GET")!=="GET"&&ae.delete(Se(t)),Ke(t,r));const ae=new Map;function ct(t,r){const f=Se(t,r),i=document.querySelector(f);if(i!=null&&i.textContent){const{body:h,...u}=JSON.parse(i.textContent),E=i.getAttribute("data-ttl");return E&&ae.set(f,{body:h,init:u,ttl:1e3*Number(E)}),Promise.resolve(new Response(h,u))}return window.fetch(t,r)}function lt(t,r,f){if(ae.size>0){const i=Se(t,f),h=ae.get(i);if(h){if(performance.now(){const h=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(i);if(h)return r.push({name:h[1],matcher:h[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const u=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(i);if(u)return r.push({name:u[1],matcher:u[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!i)return;const E=i.split(/\[(.+?)\](?!\])/);return"/"+E.map((g,m)=>{if(m%2){if(g.startsWith("x+"))return ve(String.fromCharCode(parseInt(g.slice(2),16)));if(g.startsWith("u+"))return ve(String.fromCharCode(...g.slice(2).split("-").map(U=>parseInt(U,16))));const d=ft.exec(g);if(!d)throw new Error(`Invalid param: ${g}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,j,T,R,C]=d;return r.push({name:R,matcher:C,optional:!!j,rest:!!T,chained:T?m===1&&E[0]==="":!1}),T?"(.*?)":j?"([^/]*)?":"([^/]+?)"}return ve(g)}).join("")}).join("")}/?$`),params:r}}function dt(t){return!/^\([^)]+\)$/.test(t)}function pt(t){return t.slice(1).split("/").filter(dt)}function ht(t,r,f){const i={},h=t.slice(1),u=h.filter(l=>l!==void 0);let E=0;for(let l=0;ld).join("/"),E=0),m===void 0){g.rest&&(i[g.name]="");continue}if(!g.matcher||f[g.matcher](m)){i[g.name]=m;const d=r[l+1],j=h[l+1];d&&!d.rest&&d.optional&&j&&g.chained&&(E=0),!d&&!j&&Object.keys(i).length===u.length&&(E=0);continue}if(g.optional&&g.chained){E++;continue}return}if(!E)return i}function ve(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function gt({nodes:t,server_loads:r,dictionary:f,matchers:i}){const h=new Set(r);return Object.entries(f).map(([l,[g,m,d]])=>{const{pattern:j,params:T}=ut(l),R={id:l,exec:C=>{const U=j.exec(C);if(U)return ht(U,T,i)},errors:[1,...d||[]].map(C=>t[C]),layouts:[0,...m||[]].map(E),leaf:u(g)};return R.errors.length=R.layouts.length=Math.max(R.errors.length,R.layouts.length),R});function u(l){const g=l<0;return g&&(l=~l),[g,t[l]]}function E(l){return l===void 0?l:[h.has(l),t[l]]}}function ze(t){try{return JSON.parse(sessionStorage[t])}catch{}}function qe(t,r){const f=JSON.stringify(r);try{sessionStorage[t]=f}catch{}}const mt=-1,wt=-2,_t=-3,yt=-4,vt=-5,bt=-6;function Et(t,r){if(typeof t=="number")return h(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const f=t,i=Array(f.length);function h(u,E=!1){if(u===mt)return;if(u===_t)return NaN;if(u===yt)return 1/0;if(u===vt)return-1/0;if(u===bt)return-0;if(E)throw new Error("Invalid input");if(u in i)return i[u];const l=f[u];if(!l||typeof l!="object")i[u]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const g=l[0],m=r==null?void 0:r[g];if(m)return i[u]=m(h(l[1]));switch(g){case"Date":i[u]=new Date(l[1]);break;case"Set":const d=new Set;i[u]=d;for(let R=1;Rr!=null)}const We=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...We];const kt=new Set([...We]);[...kt];async function Rt(t,r){var f;for(const i in t)if(typeof((f=t[i])==null?void 0:f.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(t).map(async([h,u])=>[h,await u])));return t}class ne{constructor(r,f){this.status=r,typeof f=="string"?this.body={message:f}:f?this.body=f:this.body={message:`Error: ${r}`}}toString(){return JSON.stringify(this.body)}}class Fe{constructor(r,f){this.status=r,this.location=f}}const At="x-sveltekit-invalidated",It="x-sveltekit-trailing-slash",J=ze(Ge)??{},ee=ze(Je)??{};function be(t){J[t]=te()}function K(t){return location.href=t.href,new Promise(()=>{})}function Lt(t,r){var Ne;const f=gt(t),i=t.nodes[0],h=t.nodes[1];i(),h();const u=document.documentElement,E=[],l=[];let g=null;const m={before_navigate:[],on_navigate:[],after_navigate:[]};let d={branch:[],error:null,url:null},j=!1,T=!1,R=!0,C=!1,U=!1,D=!1,z=!1,q,x=(Ne=history.state)==null?void 0:Ne[V];x||(x=Date.now(),history.replaceState({...history.state,[V]:x},"",location.href));const fe=J[x];fe&&(history.scrollRestoration="manual",scrollTo(fe.x,fe.y));let F,W,Y;async function ke(){if(Y=Y||Promise.resolve(),await Y,!Y)return;Y=null;const e=new URL(location.href),s=Z(e,!0);g=null;const n=W={},o=s&&await pe(s);if(n===W&&o){if(o.type==="redirect")return re(new URL(o.location,e).href,{},1,n);o.props.page!==void 0&&(F=o.props.page),q.$set(o.props)}}function Re(e){l.some(s=>s==null?void 0:s.snapshot)&&(ee[e]=l.map(s=>{var n;return(n=s==null?void 0:s.snapshot)==null?void 0:n.capture()}))}function Ae(e){var s;(s=ee[e])==null||s.forEach((n,o)=>{var a,c;(c=(a=l[o])==null?void 0:a.snapshot)==null||c.restore(n)})}function Ie(){be(x),qe(Ge,J),Re(x),qe(Je,ee)}async function re(e,{noScroll:s=!1,replaceState:n=!1,keepFocus:o=!1,state:a={},invalidateAll:c=!1},p,v){return typeof e=="string"&&(e=new URL(e,De(document))),ce({url:e,scroll:s?te():null,keepfocus:o,redirect_count:p,details:{state:a,replaceState:n},nav_token:v,accepted:()=>{c&&(z=!0)},blocked:()=>{},type:"goto"})}async function Le(e){return g={id:e.id,promise:pe(e).then(s=>(s.type==="loaded"&&s.state.error&&(g=null),s))},g.promise}async function oe(...e){const n=f.filter(o=>e.some(a=>o.exec(a))).map(o=>Promise.all([...o.layouts,o.leaf].map(a=>a==null?void 0:a[1]())));await Promise.all(n)}function Pe(e){var o;d=e.state;const s=document.querySelector("style[data-sveltekit]");s&&s.remove(),F=e.props.page,q=new t.root({target:r,props:{...e.props,stores:H,components:l},hydrate:!0}),Ae(x);const n={from:null,to:{params:d.params,route:{id:((o=d.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};m.after_navigate.forEach(a=>a(n)),T=!0}async function X({url:e,params:s,branch:n,status:o,error:a,route:c,form:p}){let v="never";for(const _ of n)(_==null?void 0:_.slash)!==void 0&&(v=_.slash);e.pathname=Qe(e.pathname,v),e.search=e.search;const b={type:"loaded",state:{url:e,params:s,branch:n,error:a,route:c},props:{constructors:St(n).map(_=>_.node.component)}};p!==void 0&&(b.props.form=p);let y={},L=!F,A=0;for(let _=0;_(v.route=!0,w[O])}),params:new Proxy(o,{get:(w,O)=>(v.params.add(O),w[O])}),data:(c==null?void 0:c.data)??null,url:at(n,()=>{v.url=!0}),async fetch(w,O){let N;w instanceof Request?(N=w.url,O={body:w.method==="GET"||w.method==="HEAD"?void 0:await w.blob(),cache:w.cache,credentials:w.credentials,headers:w.headers,integrity:w.integrity,keepalive:w.keepalive,method:w.method,mode:w.mode,redirect:w.redirect,referrer:w.referrer,referrerPolicy:w.referrerPolicy,signal:w.signal,...O}):N=w;const M=new URL(N,n);return P(M.href),M.origin===n.origin&&(N=M.href.slice(n.origin.length)),T?lt(N,M.href,O):ct(N,O)},setHeaders:()=>{},depends:P,parent(){return v.parent=!0,s()}};p=await b.universal.load.call(null,_)??null,p=p?await Rt(p,a.id):null}return{node:b,loader:e,server:c,universal:(L=b.universal)!=null&&L.load?{type:"data",data:p,uses:v}:null,data:p??(c==null?void 0:c.data)??null,slash:((A=b.universal)==null?void 0:A.trailingSlash)??(c==null?void 0:c.slash)}}function Oe(e,s,n,o,a){if(z)return!0;if(!o)return!1;if(o.parent&&e||o.route&&s||o.url&&n)return!0;for(const c of o.params)if(a[c]!==d.params[c])return!0;for(const c of o.dependencies)if(E.some(p=>p(new URL(c))))return!0;return!1}function de(e,s){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?s??null:null}async function pe({id:e,invalidating:s,url:n,params:o,route:a}){if((g==null?void 0:g.id)===e)return g.promise;const{errors:c,layouts:p,leaf:v}=a,b=[...p,v];c.forEach(S=>S==null?void 0:S().catch(()=>{})),b.forEach(S=>S==null?void 0:S[1]().catch(()=>{}));let y=null;const L=d.url?e!==d.url.pathname+d.url.search:!1,A=d.route?a.id!==d.route.id:!1;let P=!1;const _=b.map((S,I)=>{var B;const k=d.branch[I],$=!!(S!=null&&S[0])&&((k==null?void 0:k.loader)!==S[1]||Oe(P,A,L,(B=k.server)==null?void 0:B.uses,o));return $&&(P=!0),$});if(_.some(Boolean)){try{y=await He(n,_)}catch(S){return ie({status:S instanceof ne?S.status:500,error:await Q(S,{url:n,params:o,route:{id:a.id}}),url:n,route:a})}if(y.type==="redirect")return y}const w=y==null?void 0:y.nodes;let O=!1;const N=b.map(async(S,I)=>{var he;if(!S)return;const k=d.branch[I],$=w==null?void 0:w[I];if((!$||$.type==="skip")&&S[1]===(k==null?void 0:k.loader)&&!Oe(O,A,L,(he=k.universal)==null?void 0:he.uses,o))return k;if(O=!0,($==null?void 0:$.type)==="error")throw $;return ue({loader:S[1],url:n,params:o,route:a,parent:async()=>{var Te;const $e={};for(let ge=0;ge{});const M=[];for(let S=0;SPromise.resolve({}),server_data_node:de(c)}),b={node:await h(),loader:h,universal:null,server:null,data:null};return await X({url:n,params:a,branch:[v,b],status:e,error:s,route:null})}function Z(e,s){if(ye(e,G))return;const n=se(e);for(const o of f){const a=o.exec(n);if(a)return{id:e.pathname+e.search,invalidating:s,route:o,params:tt(a),url:e}}}function se(e){return et(e.pathname.slice(G.length)||"/")}function Ue({url:e,type:s,intent:n,delta:o}){let a=!1;const c=Be(d,n,e,s);o!==void 0&&(c.navigation.delta=o);const p={...c.navigation,cancel:()=>{a=!0,c.reject(new Error("navigation was cancelled"))}};return U||m.before_navigate.forEach(v=>v(p)),a?null:c}async function ce({url:e,scroll:s,keepfocus:n,redirect_count:o,details:a,type:c,delta:p,nav_token:v={},accepted:b,blocked:y}){var N,M,S;const L=Z(e,!1),A=Ue({url:e,type:c,delta:p,intent:L});if(!A){y();return}const P=x;b(),U=!0,T&&H.navigating.set(A.navigation),W=v;let _=L&&await pe(L);if(!_){if(ye(e,G))return await K(e);_=await je(e,{id:null},await Q(new Error(`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(L==null?void 0:L.url)||e,W!==v)return A.reject(new Error("navigation was aborted")),!1;if(_.type==="redirect")if(o>=20)_=await ie({status:500,error:await Q(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return re(new URL(_.location,e).href,{},o+1,v),!1;else((N=_.props.page)==null?void 0:N.status)>=400&&await H.updated.check()&&await K(e);if(E.length=0,z=!1,C=!0,be(P),Re(P),(M=_.props.page)!=null&&M.url&&_.props.page.url.pathname!==e.pathname&&(e.pathname=(S=_.props.page)==null?void 0:S.url.pathname),a){const I=a.replaceState?0:1;if(a.state[V]=x+=I,history[a.replaceState?"replaceState":"pushState"](a.state,"",e),!a.replaceState){let k=x+1;for(;ee[k]||J[k];)delete ee[k],delete J[k],k+=1}}if(g=null,T){d=_.state,_.props.page&&(_.props.page.url=e);const I=(await Promise.all(m.on_navigate.map(k=>k(A.navigation)))).filter(k=>typeof k=="function");if(I.length>0){let k=function(){m.after_navigate=m.after_navigate.filter($=>!I.includes($))};I.push(k),m.after_navigate.push(...I)}q.$set(_.props)}else Pe(_);const{activeElement:w}=document;if(await we(),R){const I=e.hash&&document.getElementById(decodeURIComponent(e.hash.slice(1)));s?scrollTo(s.x,s.y):I?I.scrollIntoView():scrollTo(0,0)}const O=document.activeElement!==w&&document.activeElement!==document.body;!n&&!O&&Ee(),R=!0,_.props.page&&(F=_.props.page),U=!1,c==="popstate"&&Ae(x),A.fulfil(void 0),m.after_navigate.forEach(I=>I(A.navigation)),H.navigating.set(null),C=!1}async function je(e,s,n,o){return e.origin===Me&&e.pathname===location.pathname&&!j?await ie({status:o,error:n,url:e,route:s}):await K(e)}function Xe(){let e;u.addEventListener("mousemove",c=>{const p=c.target;clearTimeout(e),e=setTimeout(()=>{o(p,2)},20)});function s(c){o(c.composedPath()[0],1)}u.addEventListener("mousedown",s),u.addEventListener("touchstart",s,{passive:!0});const n=new IntersectionObserver(c=>{for(const p of c)p.isIntersecting&&(oe(se(new URL(p.target.href))),n.unobserve(p.target))},{threshold:0});function o(c,p){const v=Ce(c,u);if(!v)return;const{url:b,external:y,download:L}=_e(v,G);if(y||L)return;const A=le(v);if(!A.reload)if(p<=A.preload_data){const P=Z(b,!1);P&&Le(P)}else p<=A.preload_code&&oe(se(b))}function a(){n.disconnect();for(const c of u.querySelectorAll("a")){const{url:p,external:v,download:b}=_e(c,G);if(v||b)continue;const y=le(c);y.reload||(y.preload_code===Ve.viewport&&n.observe(c),y.preload_code===Ve.eager&&oe(se(p)))}}m.after_navigate.push(a),a()}function Q(e,s){return e instanceof ne?e.body:t.hooks.handleError({error:e,event:s})??{message:s.route.id!=null?"Internal Error":"Not Found"}}return{after_navigate:e=>{me(()=>(m.after_navigate.push(e),()=>{const s=m.after_navigate.indexOf(e);m.after_navigate.splice(s,1)}))},before_navigate:e=>{me(()=>(m.before_navigate.push(e),()=>{const s=m.before_navigate.indexOf(e);m.before_navigate.splice(s,1)}))},on_navigate:e=>{me(()=>(m.on_navigate.push(e),()=>{const s=m.on_navigate.indexOf(e);m.on_navigate.splice(s,1)}))},disable_scroll_handling:()=>{(C||!T)&&(R=!1)},goto:(e,s={})=>re(e,s,0),invalidate:e=>{if(typeof e=="function")E.push(e);else{const{href:s}=new URL(e,location.href);E.push(n=>n.href===s)}return ke()},invalidate_all:()=>(z=!0,ke()),preload_data:async e=>{const s=new URL(e,De(document)),n=Z(s,!1);if(!n)throw new Error(`Attempted to preload a URL that does not belong to this app: ${s}`);await Le(n)},preload_code:oe,apply_action:async e=>{if(e.type==="error"){const s=new URL(location.href),{branch:n,route:o}=d;if(!o)return;const a=await xe(d.branch.length,n,o.errors);if(a){const c=await X({url:s,params:d.params,branch:n.slice(0,a.idx).concat(a.node),status:e.status??500,error:e.error,route:o});d=c.state,q.$set(c.props),we().then(Ee)}}else e.type==="redirect"?re(e.location,{invalidateAll:!0},0):(q.$set({form:null,page:{...F,form:e.data,status:e.status}}),await we(),q.$set({form:e.data}),e.type==="success"&&Ee())},_start_router:()=>{var s;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let o=!1;if(Ie(),!U){const a=Be(d,void 0,null,"leave"),c={...a.navigation,cancel:()=>{o=!0,a.reject(new Error("navigation was cancelled"))}};m.before_navigate.forEach(p=>p(c))}o?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ie()}),(s=navigator.connection)!=null&&s.saveData||Xe(),u.addEventListener("click",n=>{var P;if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const o=Ce(n.composedPath()[0],u);if(!o)return;const{url:a,external:c,target:p,download:v}=_e(o,G);if(!a)return;if(p==="_parent"||p==="_top"){if(window.parent!==window)return}else if(p&&p!=="_self")return;const b=le(o);if(!(o instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||v)return;if(c||b.reload){Ue({url:a,type:"link"})?U=!0:n.preventDefault();return}const[L,A]=a.href.split("#");if(A!==void 0&&L===location.href.split("#")[0]){if(d.url.hash===a.hash){n.preventDefault(),(P=o.ownerDocument.getElementById(A))==null||P.scrollIntoView();return}if(D=!0,be(x),e(a),!b.replace_state)return;D=!1,n.preventDefault()}ce({url:a,scroll:b.noscroll?te():null,keepfocus:b.keep_focus??!1,redirect_count:0,details:{state:{},replaceState:b.replace_state??a.href===location.href},accepted:()=>n.preventDefault(),blocked:()=>n.preventDefault(),type:"link"})}),u.addEventListener("submit",n=>{if(n.defaultPrevented)return;const o=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formMethod)||o.method)!=="get")return;const p=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||o.action);if(ye(p,G))return;const v=n.target,{keep_focus:b,noscroll:y,reload:L,replace_state:A}=le(v);if(L)return;n.preventDefault(),n.stopPropagation();const P=new FormData(v),_=a==null?void 0:a.getAttribute("name");_&&P.append(_,(a==null?void 0:a.getAttribute("value"))??""),p.search=new URLSearchParams(P).toString(),ce({url:p,scroll:y?te():null,keepfocus:b??!1,redirect_count:0,details:{state:{},replaceState:A??p.href===location.href},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",async n=>{var o;if(W={},(o=n.state)!=null&&o[V]){if(n.state[V]===x)return;const a=J[n.state[V]],c=new URL(location.href);if(d.url.href.split("#")[0]===location.href.split("#")[0]){e(c),J[x]=te(),x=n.state[V],scrollTo(a.x,a.y);return}const p=n.state[V]-x;await ce({url:c,scroll:a,keepfocus:!1,redirect_count:0,details:null,accepted:()=>{x=n.state[V]},blocked:()=>{history.go(-p)},type:"popstate",delta:p,nav_token:W})}else if(!D){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{D&&(D=!1,history.replaceState({...history.state,[V]:++x},"",location.href))});for(const n of document.querySelectorAll("link"))n.rel==="icon"&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&H.navigating.set(null)});function e(n){d.url=n,H.page.set({...F,url:n}),H.page.notify()}},_hydrate:async({status:e=200,error:s,node_ids:n,params:o,route:a,data:c,form:p})=>{j=!0;const v=new URL(location.href);({params:o={},route:a={id:null}}=Z(v,!1)||{});let b;try{const y=n.map(async(P,_)=>{const w=c[_];return w!=null&&w.uses&&(w.uses=Ye(w.uses)),ue({loader:t.nodes[P],url:v,params:o,route:a,parent:async()=>{const O={};for(let N=0;N<_;N+=1)Object.assign(O,(await y[N]).data);return O},server_data_node:de(w)})}),L=await Promise.all(y),A=f.find(({id:P})=>P===a.id);if(A){const P=A.layouts;for(let _=0;_u?"1":"0").join(""));const i=await Ke(f.href);if((h=i.headers.get("content-type"))!=null&&h.includes("text/html")&&await K(t),!i.ok)throw new ne(i.status,await i.json());return new Promise(async u=>{var j;const E=new Map,l=i.body.getReader(),g=new TextDecoder;function m(T){return Et(T,{Promise:R=>new Promise((C,U)=>{E.set(R,{fulfil:C,reject:U})})})}let d="";for(;;){const{done:T,value:R}=await l.read();if(T&&!d)break;for(d+=!R&&d?` `:g.decode(R);;){const C=d.indexOf(` `);if(C===-1)break;const U=JSON.parse(d.slice(0,C));if(d=d.slice(C+1),U.type==="redirect")return u(U);if(U.type==="data")(j=U.nodes)==null||j.forEach(D=>{(D==null?void 0:D.type)==="data"&&(D.uses=Ye(D.uses),D.data=m(D.data))}),u(U);else if(U.type==="chunk"){const{id:D,data:z,error:q}=U,x=E.get(D);E.delete(D),q?x.reject(m(q)):x.fulfil(m(z))}}}})}function Ye(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url)}}function Ee(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const r=document.body,f=r.getAttribute("tabindex");r.tabIndex=-1,r.focus({preventScroll:!0,focusVisible:!1}),f!==null?r.setAttribute("tabindex",f):r.removeAttribute("tabindex");const i=getSelection();if(i&&i.type!=="None"){const h=[];for(let u=0;u{if(i.rangeCount===h.length){for(let u=0;u{h=d,u=j});return E.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((g=t.route)==null?void 0:g.id)??null},url:t.url},to:f&&{params:(r==null?void 0:r.params)??null,route:{id:((m=r==null?void 0:r.route)==null?void 0:m.id)??null},url:f},willUnload:!r,type:i,complete:E},fulfil:h,reject:u}}async function xt(t,r,f){const i=Lt(t,r);Ze({client:i}),f?await i._hydrate(f):i.goto(location.href,{replaceState:!0}),i._start_router()}export{xt as start}; diff --git a/_app/immutable/nodes/0.337291a1.js b/_app/immutable/nodes/0.adbffdf9.js similarity index 100% rename from _app/immutable/nodes/0.337291a1.js rename to _app/immutable/nodes/0.adbffdf9.js diff --git a/_app/immutable/nodes/1.9b84f65d.js b/_app/immutable/nodes/1.11fa3d0a.js similarity index 93% rename from _app/immutable/nodes/1.9b84f65d.js rename to _app/immutable/nodes/1.11fa3d0a.js index 9632b9f0..8935a837 100644 --- a/_app/immutable/nodes/1.9b84f65d.js +++ b/_app/immutable/nodes/1.11fa3d0a.js @@ -1 +1 @@ -import{s as x,n as _,e as S}from"../chunks/scheduler.e80da8ef.js";import{S as j,i as q,g as f,m as d,s as y,h as g,j as h,n as v,f as u,c as C,a as m,x as $,o as E}from"../chunks/index.3d76737d.js";import{d as H}from"../chunks/singletons.10cd924e.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=y(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return S(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,x,{})}};export{F as component}; +import{s as x,n as _,e as S}from"../chunks/scheduler.e80da8ef.js";import{S as j,i as q,g as f,m as d,s as y,h as g,j as h,n as v,f as u,c as C,a as m,x as $,o as E}from"../chunks/index.3d76737d.js";import{d as H}from"../chunks/singletons.06f3a387.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=y(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return S(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,x,{})}};export{F as component}; diff --git a/_app/immutable/nodes/2.c0e9e268.js b/_app/immutable/nodes/2.1e86c4e5.js similarity index 100% rename from _app/immutable/nodes/2.c0e9e268.js rename to _app/immutable/nodes/2.1e86c4e5.js diff --git a/_app/immutable/nodes/3.8d2dfa83.js b/_app/immutable/nodes/3.d5005826.js similarity index 81% rename from _app/immutable/nodes/3.8d2dfa83.js rename to _app/immutable/nodes/3.d5005826.js index 4a6cdc96..90469471 100644 --- a/_app/immutable/nodes/3.8d2dfa83.js +++ b/_app/immutable/nodes/3.d5005826.js @@ -1,4 +1,4 @@ -var ke=Object.defineProperty;var He=(o,e,t)=>e in o?ke(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var fe=(o,e,t)=>(He(o,typeof e!="symbol"?e+"":e,t),t);import{s as Le,f as Ae,n as Ee,r as Fe,e as ge,h as ve,i as Ce,j as Ve,o as ze,b as Te}from"../chunks/scheduler.e80da8ef.js";import{S as Ue,i as xe,g as m,s as T,h as p,j as v,y as z,c as R,f as E,k as g,a as k,x as d,z as ue,A as te,m as W,n as K,o as oe,r as je,u as Ye,v as qe,d as We,t as Ke,w as Je}from"../chunks/index.3d76737d.js";import{w as Ne}from"../chunks/index.7d157e8c.js";class J{constructor(e=!1){this.eventMap={},this.eventsSuspended=e==!0}addListener(e,t,n={}){if(typeof e=="string"&&e.length<1||e instanceof String&&e.length<1||typeof e!="string"&&!(e instanceof String)&&e!==J.ANY_EVENT)throw new TypeError("The 'event' parameter must be a string or EventEmitter.ANY_EVENT.");if(typeof t!="function")throw new TypeError("The callback must be a function.");const r=new Re(e,this,t,n);return this.eventMap[e]||(this.eventMap[e]=[]),n.prepend?this.eventMap[e].unshift(r):this.eventMap[e].push(r),r}addOneTimeListener(e,t,n={}){n.remaining=1,this.addListener(e,t,n)}static get ANY_EVENT(){return Symbol.for("Any event")}hasListener(e,t){return e===void 0?this.eventMap[J.ANY_EVENT]&&this.eventMap[J.ANY_EVENT].length>0?!0:Object.entries(this.eventMap).some(([,n])=>n.length>0):this.eventMap[e]&&this.eventMap[e].length>0?t instanceof Re?this.eventMap[e].filter(r=>r===t).length>0:typeof t=="function"?this.eventMap[e].filter(r=>r.callback===t).length>0:t==null:!1}get eventNames(){return Object.keys(this.eventMap)}getListeners(e){return this.eventMap[e]||[]}suspendEvent(e){this.getListeners(e).forEach(t=>{t.suspended=!0})}unsuspendEvent(e){this.getListeners(e).forEach(t=>{t.suspended=!1})}getListenerCount(e){return this.getListeners(e).length}emit(e,...t){if(typeof e!="string"&&!(e instanceof String))throw new TypeError("The 'event' parameter must be a string.");if(this.eventsSuspended)return;let n=[],r=this.eventMap[J.ANY_EVENT]||[];return this.eventMap[e]&&(r=r.concat(this.eventMap[e])),r.forEach(s=>{if(s.suspended)return;let a=[...t];Array.isArray(s.arguments)&&(a=a.concat(s.arguments)),s.remaining>0&&(n.push(s.callback.apply(s.context,a)),s.count++),--s.remaining<1&&s.remove()}),n}removeListener(e,t,n={}){if(e===void 0){this.eventMap={};return}else if(!this.eventMap[e])return;let r=this.eventMap[e].filter(s=>t&&s.callback!==t||n.remaining&&n.remaining!==s.remaining||n.context&&n.context!==s.context);r.length?this.eventMap[e]=r:delete this.eventMap[e]}async waitFor(e,t={}){return t.duration=parseInt(t.duration),(isNaN(t.duration)||t.duration<=0)&&(t.duration=1/0),new Promise((n,r)=>{let s,a=this.addListener(e,()=>{clearTimeout(s),n()},{remaining:1});t.duration!==1/0&&(s=setTimeout(()=>{a.remove(),r("The duration expired before the event was emitted.")},t.duration))})}get eventCount(){return Object.keys(this.eventMap).length}}class Re{constructor(e,t,n,r={}){if(typeof e!="string"&&!(e instanceof String)&&e!==J.ANY_EVENT)throw new TypeError("The 'event' parameter must be a string or EventEmitter.ANY_EVENT.");if(!t)throw new ReferenceError("The 'target' parameter is mandatory.");if(typeof n!="function")throw new TypeError("The 'callback' must be a function.");r.arguments!==void 0&&!Array.isArray(r.arguments)&&(r.arguments=[r.arguments]),r=Object.assign({context:t,remaining:1/0,arguments:void 0,duration:1/0},r),r.duration!==1/0&&setTimeout(()=>this.remove(),r.duration),this.arguments=r.arguments,this.callback=n,this.context=r.context,this.count=0,this.event=e,this.remaining=parseInt(r.remaining)>=1?parseInt(r.remaining):1/0,this.suspended=!1,this.target=t}remove(){this.target.removeListener(this.event,this.callback,{context:this.context,remaining:this.remaining})}}/** +var Ve=Object.defineProperty;var Fe=(o,e,t)=>e in o?Ve(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var fe=(o,e,t)=>(Fe(o,typeof e!="symbol"?e+"":e,t),t);import{s as Le,f as ve,n as Ee,r as Ue,e as ge,h as Ae,i as Ce,j as ze,o as je,b as Te}from"../chunks/scheduler.e80da8ef.js";import{S as Pe,i as Ge,g as p,s as B,h as E,j as v,y as F,c as x,f as b,k as _,a as V,x as h,z as ue,A as $,m as W,n as K,o as le,r as Ye,u as qe,v as We,d as Ke,t as Je,w as Qe}from"../chunks/index.3d76737d.js";import{w as Ne}from"../chunks/index.7d157e8c.js";class J{constructor(e=!1){this.eventMap={},this.eventsSuspended=e==!0}addListener(e,t,n={}){if(typeof e=="string"&&e.length<1||e instanceof String&&e.length<1||typeof e!="string"&&!(e instanceof String)&&e!==J.ANY_EVENT)throw new TypeError("The 'event' parameter must be a string or EventEmitter.ANY_EVENT.");if(typeof t!="function")throw new TypeError("The callback must be a function.");const r=new Re(e,this,t,n);return this.eventMap[e]||(this.eventMap[e]=[]),n.prepend?this.eventMap[e].unshift(r):this.eventMap[e].push(r),r}addOneTimeListener(e,t,n={}){n.remaining=1,this.addListener(e,t,n)}static get ANY_EVENT(){return Symbol.for("Any event")}hasListener(e,t){return e===void 0?this.eventMap[J.ANY_EVENT]&&this.eventMap[J.ANY_EVENT].length>0?!0:Object.entries(this.eventMap).some(([,n])=>n.length>0):this.eventMap[e]&&this.eventMap[e].length>0?t instanceof Re?this.eventMap[e].filter(r=>r===t).length>0:typeof t=="function"?this.eventMap[e].filter(r=>r.callback===t).length>0:t==null:!1}get eventNames(){return Object.keys(this.eventMap)}getListeners(e){return this.eventMap[e]||[]}suspendEvent(e){this.getListeners(e).forEach(t=>{t.suspended=!0})}unsuspendEvent(e){this.getListeners(e).forEach(t=>{t.suspended=!1})}getListenerCount(e){return this.getListeners(e).length}emit(e,...t){if(typeof e!="string"&&!(e instanceof String))throw new TypeError("The 'event' parameter must be a string.");if(this.eventsSuspended)return;let n=[],r=this.eventMap[J.ANY_EVENT]||[];return this.eventMap[e]&&(r=r.concat(this.eventMap[e])),r.forEach(s=>{if(s.suspended)return;let a=[...t];Array.isArray(s.arguments)&&(a=a.concat(s.arguments)),s.remaining>0&&(n.push(s.callback.apply(s.context,a)),s.count++),--s.remaining<1&&s.remove()}),n}removeListener(e,t,n={}){if(e===void 0){this.eventMap={};return}else if(!this.eventMap[e])return;let r=this.eventMap[e].filter(s=>t&&s.callback!==t||n.remaining&&n.remaining!==s.remaining||n.context&&n.context!==s.context);r.length?this.eventMap[e]=r:delete this.eventMap[e]}async waitFor(e,t={}){return t.duration=parseInt(t.duration),(isNaN(t.duration)||t.duration<=0)&&(t.duration=1/0),new Promise((n,r)=>{let s,a=this.addListener(e,()=>{clearTimeout(s),n()},{remaining:1});t.duration!==1/0&&(s=setTimeout(()=>{a.remove(),r("The duration expired before the event was emitted.")},t.duration))})}get eventCount(){return Object.keys(this.eventMap).length}}class Re{constructor(e,t,n,r={}){if(typeof e!="string"&&!(e instanceof String)&&e!==J.ANY_EVENT)throw new TypeError("The 'event' parameter must be a string or EventEmitter.ANY_EVENT.");if(!t)throw new ReferenceError("The 'target' parameter is mandatory.");if(typeof n!="function")throw new TypeError("The 'callback' must be a function.");r.arguments!==void 0&&!Array.isArray(r.arguments)&&(r.arguments=[r.arguments]),r=Object.assign({context:t,remaining:1/0,arguments:void 0,duration:1/0},r),r.duration!==1/0&&setTimeout(()=>this.remove(),r.duration),this.arguments=r.arguments,this.callback=n,this.context=r.context,this.count=0,this.event=e,this.remaining=parseInt(r.remaining)>=1?parseInt(r.remaining):1/0,this.suspended=!1,this.target=t}remove(){this.target.removeListener(this.event,this.callback,{context:this.context,remaining:this.remaining})}}/** * The `Enumerations` class contains enumerations and arrays of elements used throughout the * library. All its properties are static and should be referenced using the class name. For * example: `Enumerations.CHANNEL_MESSAGES`. @@ -28,13 +28,13 @@ var ke=Object.defineProperty;var He=(o,e,t)=>e in o?ke(o,e,{enumerable:!0,config * * @license Apache-2.0 * @since 3.0.0 - */class ae{constructor(e,t={}){this.duration=l.defaults.note.duration,this.attack=l.defaults.note.attack,this.release=l.defaults.note.release,t.duration!=null&&(this.duration=t.duration),t.attack!=null&&(this.attack=t.attack),t.rawAttack!=null&&(this.attack=c.from7bitToFloat(t.rawAttack)),t.release!=null&&(this.release=t.release),t.rawRelease!=null&&(this.release=c.from7bitToFloat(t.rawRelease)),Number.isInteger(e)?this.identifier=c.toNoteIdentifier(e):this.identifier=e}get identifier(){return this._name+(this._accidental||"")+this._octave}set identifier(e){const t=c.getNoteDetails(e);if(l.validation&&!e)throw new Error("Invalid note identifier");this._name=t.name,this._accidental=t.accidental,this._octave=t.octave}get name(){return this._name}set name(e){if(l.validation&&(e=e.toUpperCase(),!["C","D","E","F","G","A","B"].includes(e)))throw new Error("Invalid name value");this._name=e}get accidental(){return this._accidental}set accidental(e){if(l.validation&&(e=e.toLowerCase(),!["#","##","b","bb"].includes(e)))throw new Error("Invalid accidental value");this._accidental=e}get octave(){return this._octave}set octave(e){if(l.validation&&(e=parseInt(e),isNaN(e)))throw new Error("Invalid octave value");this._octave=e}get duration(){return this._duration}set duration(e){if(l.validation&&(e=parseFloat(e),isNaN(e)||e===null||e<0))throw new RangeError("Invalid duration value.");this._duration=e}get attack(){return this._attack}set attack(e){if(l.validation&&(e=parseFloat(e),isNaN(e)||!(e>=0&&e<=1)))throw new RangeError("Invalid attack value.");this._attack=e}get release(){return this._release}set release(e){if(l.validation&&(e=parseFloat(e),isNaN(e)||!(e>=0&&e<=1)))throw new RangeError("Invalid release value.");this._release=e}get rawAttack(){return c.fromFloatTo7Bit(this._attack)}set rawAttack(e){this._attack=c.from7bitToFloat(e)}get rawRelease(){return c.fromFloatTo7Bit(this._release)}set rawRelease(e){this._release=c.from7bitToFloat(e)}get number(){return c.toNoteNumber(this.identifier)}getOffsetNumber(e=0,t=0){return l.validation&&(e=parseInt(e)||0,t=parseInt(t)||0),Math.min(Math.max(this.number+e*12+t,0),127)}}/** + */class oe{constructor(e,t={}){this.duration=l.defaults.note.duration,this.attack=l.defaults.note.attack,this.release=l.defaults.note.release,t.duration!=null&&(this.duration=t.duration),t.attack!=null&&(this.attack=t.attack),t.rawAttack!=null&&(this.attack=c.from7bitToFloat(t.rawAttack)),t.release!=null&&(this.release=t.release),t.rawRelease!=null&&(this.release=c.from7bitToFloat(t.rawRelease)),Number.isInteger(e)?this.identifier=c.toNoteIdentifier(e):this.identifier=e}get identifier(){return this._name+(this._accidental||"")+this._octave}set identifier(e){const t=c.getNoteDetails(e);if(l.validation&&!e)throw new Error("Invalid note identifier");this._name=t.name,this._accidental=t.accidental,this._octave=t.octave}get name(){return this._name}set name(e){if(l.validation&&(e=e.toUpperCase(),!["C","D","E","F","G","A","B"].includes(e)))throw new Error("Invalid name value");this._name=e}get accidental(){return this._accidental}set accidental(e){if(l.validation&&(e=e.toLowerCase(),!["#","##","b","bb"].includes(e)))throw new Error("Invalid accidental value");this._accidental=e}get octave(){return this._octave}set octave(e){if(l.validation&&(e=parseInt(e),isNaN(e)))throw new Error("Invalid octave value");this._octave=e}get duration(){return this._duration}set duration(e){if(l.validation&&(e=parseFloat(e),isNaN(e)||e===null||e<0))throw new RangeError("Invalid duration value.");this._duration=e}get attack(){return this._attack}set attack(e){if(l.validation&&(e=parseFloat(e),isNaN(e)||!(e>=0&&e<=1)))throw new RangeError("Invalid attack value.");this._attack=e}get release(){return this._release}set release(e){if(l.validation&&(e=parseFloat(e),isNaN(e)||!(e>=0&&e<=1)))throw new RangeError("Invalid release value.");this._release=e}get rawAttack(){return c.fromFloatTo7Bit(this._attack)}set rawAttack(e){this._attack=c.from7bitToFloat(e)}get rawRelease(){return c.fromFloatTo7Bit(this._release)}set rawRelease(e){this._release=c.from7bitToFloat(e)}get number(){return c.toNoteNumber(this.identifier)}getOffsetNumber(e=0,t=0){return l.validation&&(e=parseInt(e)||0,t=parseInt(t)||0),Math.min(Math.max(this.number+e*12+t,0),127)}}/** * The `Utilities` class contains general-purpose utility methods. All methods are static and * should be called using the class name. For example: `Utilities.getNoteDetails("C4")`. * * @license Apache-2.0 * @since 3.0.0 - */class c{static toNoteNumber(e,t=0){if(t=t==null?0:parseInt(t),isNaN(t))throw new RangeError("Invalid 'octaveOffset' value");typeof e!="string"&&(e="");const n=this.getNoteDetails(e);if(!n)throw new TypeError("Invalid note identifier");const r={C:0,D:2,E:4,F:5,G:7,A:9,B:11};let s=(n.octave+1+t)*12;if(s+=r[n.name],n.accidental&&(n.accidental.startsWith("b")?s-=n.accidental.length:s+=n.accidental.length),s<0||s>127)throw new RangeError("Invalid octaveOffset value");return s}static getNoteDetails(e){Number.isInteger(e)&&(e=this.toNoteIdentifier(e));const t=e.match(/^([CDEFGAB])(#{0,2}|b{0,2})(-?\d+)$/i);if(!t)throw new TypeError("Invalid note identifier");const n=t[1].toUpperCase(),r=parseInt(t[3]);let s=t[2].toLowerCase();return s=s===""?void 0:s,{accidental:s,identifier:n+(s||"")+r,name:n,octave:r}}static sanitizeChannels(e){let t;if(l.validation){if(e==="all")t=["all"];else if(e==="none")return[]}return Array.isArray(e)?t=e:t=[e],t.indexOf("all")>-1&&(t=i.MIDI_CHANNEL_NUMBERS),t.map(function(n){return parseInt(n)}).filter(function(n){return n>=1&&n<=16})}static toTimestamp(e){let t=!1;const n=parseFloat(e);return isNaN(n)?!1:(typeof e=="string"&&e.substring(0,1)==="+"?n>=0&&(t=l.time+n):n>=0&&(t=n),t)}static guessNoteNumber(e,t){t=parseInt(t)||0;let n=!1;if(Number.isInteger(e)&&e>=0&&e<=127)n=parseInt(e);else if(parseInt(e)>=0&&parseInt(e)<=127)n=parseInt(e);else if(typeof e=="string"||e instanceof String)try{n=this.toNoteNumber(e.trim(),t)}catch{return!1}return n}static toNoteIdentifier(e,t){if(e=parseInt(e),isNaN(e)||e<0||e>127)throw new RangeError("Invalid note number");if(t=t==null?0:parseInt(t),isNaN(t))throw new RangeError("Invalid octaveOffset value");const n=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],r=Math.floor(e/12-1)+t;return n[e%12]+r.toString()}static buildNote(e,t={}){if(t.octaveOffset=parseInt(t.octaveOffset)||0,e instanceof ae)return e;let n=this.guessNoteNumber(e,t.octaveOffset);if(n===!1)throw new TypeError(`The input could not be parsed as a note (${e})`);return t.octaveOffset=void 0,new ae(n,t)}static buildNoteArray(e,t={}){let n=[];return Array.isArray(e)||(e=[e]),e.forEach(r=>{n.push(this.buildNote(r,t))}),n}static from7bitToFloat(e){return e===1/0&&(e=127),e=parseInt(e)||0,Math.min(Math.max(e/127,0),1)}static fromFloatTo7Bit(e){return e===1/0&&(e=1),e=parseFloat(e)||0,Math.min(Math.max(Math.round(e*127),0),127)}static fromMsbLsbToFloat(e,t=0){l.validation&&(e=Math.min(Math.max(parseInt(e)||0,0),127),t=Math.min(Math.max(parseInt(t)||0,0),127));const n=((e<<7)+t)/16383;return Math.min(Math.max(n,0),1)}static fromFloatToMsbLsb(e){l.validation&&(e=Math.min(Math.max(parseFloat(e)||0,0),1));const t=Math.round(e*16383);return{msb:t>>7,lsb:t&127}}static offsetNumber(e,t=0,n=0){if(l.validation){if(e=parseInt(e),isNaN(e))throw new Error("Invalid note number");t=parseInt(t)||0,n=parseInt(n)||0}return Math.min(Math.max(e+t*12+n,0),127)}static getPropertyByValue(e,t){return Object.keys(e).find(n=>e[n]===t)}static getCcNameByNumber(e){if(!(l.validation&&(e=parseInt(e),!(e>=0&&e<=127))))return i.CONTROL_CHANGE_MESSAGES[e].name}static getCcNumberByName(e){let t=i.CONTROL_CHANGE_MESSAGES.find(n=>n.name===e);return t?t.number:i.MIDI_CONTROL_CHANGE_MESSAGES[e]}static getChannelModeByNumber(e){if(!(e>=120&&e<=127))return!1;for(let t in i.CHANNEL_MODE_MESSAGES)if(i.CHANNEL_MODE_MESSAGES.hasOwnProperty(t)&&e===i.CHANNEL_MODE_MESSAGES[t])return t;return!1}static get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null}static get isBrowser(){return typeof window<"u"&&typeof window.document<"u"}}/** + */class c{static toNoteNumber(e,t=0){if(t=t==null?0:parseInt(t),isNaN(t))throw new RangeError("Invalid 'octaveOffset' value");typeof e!="string"&&(e="");const n=this.getNoteDetails(e);if(!n)throw new TypeError("Invalid note identifier");const r={C:0,D:2,E:4,F:5,G:7,A:9,B:11};let s=(n.octave+1+t)*12;if(s+=r[n.name],n.accidental&&(n.accidental.startsWith("b")?s-=n.accidental.length:s+=n.accidental.length),s<0||s>127)throw new RangeError("Invalid octaveOffset value");return s}static getNoteDetails(e){Number.isInteger(e)&&(e=this.toNoteIdentifier(e));const t=e.match(/^([CDEFGAB])(#{0,2}|b{0,2})(-?\d+)$/i);if(!t)throw new TypeError("Invalid note identifier");const n=t[1].toUpperCase(),r=parseInt(t[3]);let s=t[2].toLowerCase();return s=s===""?void 0:s,{accidental:s,identifier:n+(s||"")+r,name:n,octave:r}}static sanitizeChannels(e){let t;if(l.validation){if(e==="all")t=["all"];else if(e==="none")return[]}return Array.isArray(e)?t=e:t=[e],t.indexOf("all")>-1&&(t=i.MIDI_CHANNEL_NUMBERS),t.map(function(n){return parseInt(n)}).filter(function(n){return n>=1&&n<=16})}static toTimestamp(e){let t=!1;const n=parseFloat(e);return isNaN(n)?!1:(typeof e=="string"&&e.substring(0,1)==="+"?n>=0&&(t=l.time+n):n>=0&&(t=n),t)}static guessNoteNumber(e,t){t=parseInt(t)||0;let n=!1;if(Number.isInteger(e)&&e>=0&&e<=127)n=parseInt(e);else if(parseInt(e)>=0&&parseInt(e)<=127)n=parseInt(e);else if(typeof e=="string"||e instanceof String)try{n=this.toNoteNumber(e.trim(),t)}catch{return!1}return n}static toNoteIdentifier(e,t){if(e=parseInt(e),isNaN(e)||e<0||e>127)throw new RangeError("Invalid note number");if(t=t==null?0:parseInt(t),isNaN(t))throw new RangeError("Invalid octaveOffset value");const n=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],r=Math.floor(e/12-1)+t;return n[e%12]+r.toString()}static buildNote(e,t={}){if(t.octaveOffset=parseInt(t.octaveOffset)||0,e instanceof oe)return e;let n=this.guessNoteNumber(e,t.octaveOffset);if(n===!1)throw new TypeError(`The input could not be parsed as a note (${e})`);return t.octaveOffset=void 0,new oe(n,t)}static buildNoteArray(e,t={}){let n=[];return Array.isArray(e)||(e=[e]),e.forEach(r=>{n.push(this.buildNote(r,t))}),n}static from7bitToFloat(e){return e===1/0&&(e=127),e=parseInt(e)||0,Math.min(Math.max(e/127,0),1)}static fromFloatTo7Bit(e){return e===1/0&&(e=1),e=parseFloat(e)||0,Math.min(Math.max(Math.round(e*127),0),127)}static fromMsbLsbToFloat(e,t=0){l.validation&&(e=Math.min(Math.max(parseInt(e)||0,0),127),t=Math.min(Math.max(parseInt(t)||0,0),127));const n=((e<<7)+t)/16383;return Math.min(Math.max(n,0),1)}static fromFloatToMsbLsb(e){l.validation&&(e=Math.min(Math.max(parseFloat(e)||0,0),1));const t=Math.round(e*16383);return{msb:t>>7,lsb:t&127}}static offsetNumber(e,t=0,n=0){if(l.validation){if(e=parseInt(e),isNaN(e))throw new Error("Invalid note number");t=parseInt(t)||0,n=parseInt(n)||0}return Math.min(Math.max(e+t*12+n,0),127)}static getPropertyByValue(e,t){return Object.keys(e).find(n=>e[n]===t)}static getCcNameByNumber(e){if(!(l.validation&&(e=parseInt(e),!(e>=0&&e<=127))))return i.CONTROL_CHANGE_MESSAGES[e].name}static getCcNumberByName(e){let t=i.CONTROL_CHANGE_MESSAGES.find(n=>n.name===e);return t?t.number:i.MIDI_CONTROL_CHANGE_MESSAGES[e]}static getChannelModeByNumber(e){if(!(e>=120&&e<=127))return!1;for(let t in i.CHANNEL_MODE_MESSAGES)if(i.CHANNEL_MODE_MESSAGES.hasOwnProperty(t)&&e===i.CHANNEL_MODE_MESSAGES[t])return t;return!1}static get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null}static get isBrowser(){return typeof window<"u"&&typeof window.document<"u"}}/** * The `OutputChannel` class represents a single output MIDI channel. `OutputChannel` objects are * provided by an [`Output`](Output) port which, itself, is made available by a device. The * `OutputChannel` object is derived from the host's MIDI subsystem and should not be instantiated @@ -49,7 +49,7 @@ var ke=Object.defineProperty;var He=(o,e,t)=>e in o?ke(o,e,{enumerable:!0,config * @extends EventEmitter * @license Apache-2.0 * @since 3.0.0 - */class Qe extends J{constructor(e,t){super(),this._output=e,this._number=t,this._octaveOffset=0}destroy(){this._output=null,this._number=null,this._octaveOffset=0,this.removeListener()}send(e,t={time:0}){return this.output.send(e,t),this}sendKeyAftertouch(e,t,n={}){if(l.validation){if(n.useRawValue&&(n.rawValue=n.useRawValue),isNaN(parseFloat(t)))throw new RangeError("Invalid key aftertouch value.");if(n.rawValue){if(!(t>=0&&t<=127&&Number.isInteger(t)))throw new RangeError("Key aftertouch raw value must be an integer between 0 and 127.")}else if(!(t>=0&&t<=1))throw new RangeError("Key aftertouch value must be a float between 0 and 1.")}n.rawValue||(t=c.fromFloatTo7Bit(t));const r=l.octaveOffset+this.output.octaveOffset+this.octaveOffset;return Array.isArray(e)||(e=[e]),c.buildNoteArray(e).forEach(s=>{this.send([(i.CHANNEL_MESSAGES.keyaftertouch<<4)+(this.number-1),s.getOffsetNumber(r),t],{time:c.toTimestamp(n.time)})}),this}sendControlChange(e,t,n={}){if(typeof e=="string"&&(e=c.getCcNumberByName(e)),Array.isArray(t)||(t=[t]),l.validation){if(e===void 0)throw new TypeError("Control change must be identified with a valid name or an integer between 0 and 127.");if(!Number.isInteger(e)||!(e>=0&&e<=127))throw new TypeError("Control change number must be an integer between 0 and 127.");if(t=t.map(r=>{const s=Math.min(Math.max(parseInt(r),0),127);if(isNaN(s))throw new TypeError("Values must be integers between 0 and 127");return s}),t.length===2&&e>=32)throw new TypeError("To use a value array, the controller must be between 0 and 31")}return t.forEach((r,s)=>{this.send([(i.CHANNEL_MESSAGES.controlchange<<4)+(this.number-1),e+s*32,t[s]],{time:c.toTimestamp(n.time)})}),this}_selectNonRegisteredParameter(e,t={}){return this.sendControlChange(99,e[0],t),this.sendControlChange(98,e[1],t),this}_deselectRegisteredParameter(e={}){return this.sendControlChange(101,127,e),this.sendControlChange(100,127,e),this}_deselectNonRegisteredParameter(e={}){return this.sendControlChange(101,127,e),this.sendControlChange(100,127,e),this}_selectRegisteredParameter(e,t={}){return this.sendControlChange(101,e[0],t),this.sendControlChange(100,e[1],t),this}_setCurrentParameter(e,t={}){return e=[].concat(e),this.sendControlChange(6,e[0],t),e.length<2?this:(this.sendControlChange(38,e[1],t),this)}sendRpnDecrement(e,t={}){if(Array.isArray(e)||(e=i.REGISTERED_PARAMETERS[e]),l.validation){if(e===void 0)throw new TypeError("The specified registered parameter is invalid.");let n=!1;if(Object.getOwnPropertyNames(i.REGISTERED_PARAMETERS).forEach(r=>{i.REGISTERED_PARAMETERS[r][0]===e[0]&&i.REGISTERED_PARAMETERS[r][1]===e[1]&&(n=!0)}),!n)throw new TypeError("The specified registered parameter is invalid.")}return this._selectRegisteredParameter(e,t),this.sendControlChange(97,0,t),this._deselectRegisteredParameter(t),this}sendRpnIncrement(e,t={}){if(Array.isArray(e)||(e=i.REGISTERED_PARAMETERS[e]),l.validation){if(e===void 0)throw new TypeError("The specified registered parameter is invalid.");let n=!1;if(Object.getOwnPropertyNames(i.REGISTERED_PARAMETERS).forEach(r=>{i.REGISTERED_PARAMETERS[r][0]===e[0]&&i.REGISTERED_PARAMETERS[r][1]===e[1]&&(n=!0)}),!n)throw new TypeError("The specified registered parameter is invalid.")}return this._selectRegisteredParameter(e,t),this.sendControlChange(96,0,t),this._deselectRegisteredParameter(t),this}playNote(e,t={}){this.sendNoteOn(e,t);const n=Array.isArray(e)?e:[e];for(let r of n)if(parseInt(r.duration)>0){const s={time:(c.toTimestamp(t.time)||l.time)+parseInt(r.duration),release:r.release,rawRelease:r.rawRelease};this.sendNoteOff(r,s)}else if(parseInt(t.duration)>0){const s={time:(c.toTimestamp(t.time)||l.time)+parseInt(t.duration),release:t.release,rawRelease:t.rawRelease};this.sendNoteOff(r,s)}return this}sendNoteOff(e,t={}){if(l.validation){if(t.rawRelease!=null&&!(t.rawRelease>=0&&t.rawRelease<=127))throw new RangeError("The 'rawRelease' option must be an integer between 0 and 127");if(t.release!=null&&!(t.release>=0&&t.release<=1))throw new RangeError("The 'release' option must be an number between 0 and 1");t.rawVelocity&&(t.rawRelease=t.velocity,console.warn("The 'rawVelocity' option is deprecated. Use 'rawRelease' instead.")),t.velocity&&(t.release=t.velocity,console.warn("The 'velocity' option is deprecated. Use 'attack' instead."))}let n=64;t.rawRelease!=null?n=t.rawRelease:isNaN(t.release)||(n=Math.round(t.release*127));const r=l.octaveOffset+this.output.octaveOffset+this.octaveOffset;return c.buildNoteArray(e,{rawRelease:parseInt(n)}).forEach(s=>{this.send([(i.CHANNEL_MESSAGES.noteoff<<4)+(this.number-1),s.getOffsetNumber(r),s.rawRelease],{time:c.toTimestamp(t.time)})}),this}stopNote(e,t={}){return this.sendNoteOff(e,t)}sendNoteOn(e,t={}){if(l.validation){if(t.rawAttack!=null&&!(t.rawAttack>=0&&t.rawAttack<=127))throw new RangeError("The 'rawAttack' option must be an integer between 0 and 127");if(t.attack!=null&&!(t.attack>=0&&t.attack<=1))throw new RangeError("The 'attack' option must be an number between 0 and 1");t.rawVelocity&&(t.rawAttack=t.velocity,t.rawRelease=t.release,console.warn("The 'rawVelocity' option is deprecated. Use 'rawAttack' or 'rawRelease'.")),t.velocity&&(t.attack=t.velocity,console.warn("The 'velocity' option is deprecated. Use 'attack' instead."))}let n=64;t.rawAttack!=null?n=t.rawAttack:isNaN(t.attack)||(n=Math.round(t.attack*127));const r=l.octaveOffset+this.output.octaveOffset+this.octaveOffset;return c.buildNoteArray(e,{rawAttack:n}).forEach(s=>{this.send([(i.CHANNEL_MESSAGES.noteon<<4)+(this.number-1),s.getOffsetNumber(r),s.rawAttack],{time:c.toTimestamp(t.time)})}),this}sendChannelMode(e,t=0,n={}){if(typeof e=="string"&&(e=i.CHANNEL_MODE_MESSAGES[e]),l.validation){if(e===void 0)throw new TypeError("Invalid channel mode message name or number.");if(isNaN(e)||!(e>=120&&e<=127))throw new TypeError("Invalid channel mode message number.");if(isNaN(parseInt(t))||t<0||t>127)throw new RangeError("Value must be an integer between 0 and 127.")}return this.send([(i.CHANNEL_MESSAGES.controlchange<<4)+(this.number-1),e,t],{time:c.toTimestamp(n.time)}),this}sendOmniMode(e,t={}){return e===void 0||e?this.sendChannelMode("omnimodeon",0,t):this.sendChannelMode("omnimodeoff",0,t),this}sendChannelAftertouch(e,t={}){if(l.validation){if(isNaN(parseFloat(e)))throw new RangeError("Invalid channel aftertouch value.");if(t.rawValue){if(!(e>=0&&e<=127&&Number.isInteger(e)))throw new RangeError("Channel aftertouch raw value must be an integer between 0 and 127.")}else if(!(e>=0&&e<=1))throw new RangeError("Channel aftertouch value must be a float between 0 and 1.")}return t.rawValue||(e=c.fromFloatTo7Bit(e)),this.send([(i.CHANNEL_MESSAGES.channelaftertouch<<4)+(this.number-1),Math.round(e)],{time:c.toTimestamp(t.time)}),this}sendMasterTuning(e,t={}){if(e=parseFloat(e)||0,l.validation&&!(e>-65&&e<64))throw new RangeError("The value must be a decimal number larger than -65 and smaller than 64.");let n=Math.floor(e)+64,r=e-Math.floor(e);r=Math.round((r+1)/2*16383);let s=r>>7&127,a=r&127;return this.sendRpnValue("channelcoarsetuning",n,t),this.sendRpnValue("channelfinetuning",[s,a],t),this}sendModulationRange(e,t,n={}){if(l.validation){if(!Number.isInteger(e)||!(e>=0&&e<=127))throw new RangeError("The semitones value must be an integer between 0 and 127.");if(t!=null&&(!Number.isInteger(t)||!(t>=0&&t<=127)))throw new RangeError("If specified, the cents value must be an integer between 0 and 127.")}return t>=0&&t<=127||(t=0),this.sendRpnValue("modulationrange",[e,t],n),this}sendNrpnValue(e,t,n={}){if(t=[].concat(t),l.validation){if(!Array.isArray(e)||!Number.isInteger(e[0])||!Number.isInteger(e[1]))throw new TypeError("The specified NRPN is invalid.");if(!(e[0]>=0&&e[0]<=127))throw new RangeError("The first byte of the NRPN must be between 0 and 127.");if(!(e[1]>=0&&e[1]<=127))throw new RangeError("The second byte of the NRPN must be between 0 and 127.");t.forEach(r=>{if(!(r>=0&&r<=127))throw new RangeError("The data bytes of the NRPN must be between 0 and 127.")})}return this._selectNonRegisteredParameter(e,n),this._setCurrentParameter(t,n),this._deselectNonRegisteredParameter(n),this}sendPitchBend(e,t={}){if(l.validation)if(t.rawValue&&Array.isArray(e)){if(!(e[0]>=0&&e[0]<=127))throw new RangeError("The pitch bend MSB must be an integer between 0 and 127.");if(!(e[1]>=0&&e[1]<=127))throw new RangeError("The pitch bend LSB must be an integer between 0 and 127.")}else if(t.rawValue&&!Array.isArray(e)){if(!(e>=0&&e<=127))throw new RangeError("The pitch bend MSB must be an integer between 0 and 127.")}else{if(isNaN(e)||e===null)throw new RangeError("Invalid pitch bend value.");if(!(e>=-1&&e<=1))throw new RangeError("The pitch bend value must be a float between -1 and 1.")}let n=0,r=0;if(t.rawValue&&Array.isArray(e))n=e[0],r=e[1];else if(t.rawValue&&!Array.isArray(e))n=e;else{const s=c.fromFloatToMsbLsb((e+1)/2);n=s.msb,r=s.lsb}return this.send([(i.CHANNEL_MESSAGES.pitchbend<<4)+(this.number-1),r,n],{time:c.toTimestamp(t.time)}),this}sendPitchBendRange(e,t,n={}){if(l.validation){if(!Number.isInteger(e)||!(e>=0&&e<=127))throw new RangeError("The semitones value must be an integer between 0 and 127.");if(!Number.isInteger(t)||!(t>=0&&t<=127))throw new RangeError("The cents value must be an integer between 0 and 127.")}return this.sendRpnValue("pitchbendrange",[e,t],n),this}sendProgramChange(e,t={}){if(e=parseInt(e)||0,l.validation&&!(e>=0&&e<=127))throw new RangeError("The program number must be between 0 and 127.");return this.send([(i.CHANNEL_MESSAGES.programchange<<4)+(this.number-1),e],{time:c.toTimestamp(t.time)}),this}sendRpnValue(e,t,n={}){if(Array.isArray(e)||(e=i.REGISTERED_PARAMETERS[e]),l.validation){if(!Number.isInteger(e[0])||!Number.isInteger(e[1]))throw new TypeError("The specified NRPN is invalid.");if(!(e[0]>=0&&e[0]<=127))throw new RangeError("The first byte of the RPN must be between 0 and 127.");if(!(e[1]>=0&&e[1]<=127))throw new RangeError("The second byte of the RPN must be between 0 and 127.");[].concat(t).forEach(r=>{if(!(r>=0&&r<=127))throw new RangeError("The data bytes of the RPN must be between 0 and 127.")})}return this._selectRegisteredParameter(e,n),this._setCurrentParameter(t,n),this._deselectRegisteredParameter(n),this}sendTuningBank(e,t={}){if(l.validation&&(!Number.isInteger(e)||!(e>=0&&e<=127)))throw new RangeError("The tuning bank number must be between 0 and 127.");return this.sendRpnValue("tuningbank",e,t),this}sendTuningProgram(e,t={}){if(l.validation&&(!Number.isInteger(e)||!(e>=0&&e<=127)))throw new RangeError("The tuning program number must be between 0 and 127.");return this.sendRpnValue("tuningprogram",e,t),this}sendLocalControl(e,t={}){return e?this.sendChannelMode("localcontrol",127,t):this.sendChannelMode("localcontrol",0,t)}sendAllNotesOff(e={}){return this.sendChannelMode("allnotesoff",0,e)}sendAllSoundOff(e={}){return this.sendChannelMode("allsoundoff",0,e)}sendResetAllControllers(e={}){return this.sendChannelMode("resetallcontrollers",0,e)}sendPolyphonicMode(e,t={}){return e==="mono"?this.sendChannelMode("monomodeon",0,t):this.sendChannelMode("polymodeon",0,t)}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get output(){return this._output}get number(){return this._number}}/** + */class Xe extends J{constructor(e,t){super(),this._output=e,this._number=t,this._octaveOffset=0}destroy(){this._output=null,this._number=null,this._octaveOffset=0,this.removeListener()}send(e,t={time:0}){return this.output.send(e,t),this}sendKeyAftertouch(e,t,n={}){if(l.validation){if(n.useRawValue&&(n.rawValue=n.useRawValue),isNaN(parseFloat(t)))throw new RangeError("Invalid key aftertouch value.");if(n.rawValue){if(!(t>=0&&t<=127&&Number.isInteger(t)))throw new RangeError("Key aftertouch raw value must be an integer between 0 and 127.")}else if(!(t>=0&&t<=1))throw new RangeError("Key aftertouch value must be a float between 0 and 1.")}n.rawValue||(t=c.fromFloatTo7Bit(t));const r=l.octaveOffset+this.output.octaveOffset+this.octaveOffset;return Array.isArray(e)||(e=[e]),c.buildNoteArray(e).forEach(s=>{this.send([(i.CHANNEL_MESSAGES.keyaftertouch<<4)+(this.number-1),s.getOffsetNumber(r),t],{time:c.toTimestamp(n.time)})}),this}sendControlChange(e,t,n={}){if(typeof e=="string"&&(e=c.getCcNumberByName(e)),Array.isArray(t)||(t=[t]),l.validation){if(e===void 0)throw new TypeError("Control change must be identified with a valid name or an integer between 0 and 127.");if(!Number.isInteger(e)||!(e>=0&&e<=127))throw new TypeError("Control change number must be an integer between 0 and 127.");if(t=t.map(r=>{const s=Math.min(Math.max(parseInt(r),0),127);if(isNaN(s))throw new TypeError("Values must be integers between 0 and 127");return s}),t.length===2&&e>=32)throw new TypeError("To use a value array, the controller must be between 0 and 31")}return t.forEach((r,s)=>{this.send([(i.CHANNEL_MESSAGES.controlchange<<4)+(this.number-1),e+s*32,t[s]],{time:c.toTimestamp(n.time)})}),this}_selectNonRegisteredParameter(e,t={}){return this.sendControlChange(99,e[0],t),this.sendControlChange(98,e[1],t),this}_deselectRegisteredParameter(e={}){return this.sendControlChange(101,127,e),this.sendControlChange(100,127,e),this}_deselectNonRegisteredParameter(e={}){return this.sendControlChange(101,127,e),this.sendControlChange(100,127,e),this}_selectRegisteredParameter(e,t={}){return this.sendControlChange(101,e[0],t),this.sendControlChange(100,e[1],t),this}_setCurrentParameter(e,t={}){return e=[].concat(e),this.sendControlChange(6,e[0],t),e.length<2?this:(this.sendControlChange(38,e[1],t),this)}sendRpnDecrement(e,t={}){if(Array.isArray(e)||(e=i.REGISTERED_PARAMETERS[e]),l.validation){if(e===void 0)throw new TypeError("The specified registered parameter is invalid.");let n=!1;if(Object.getOwnPropertyNames(i.REGISTERED_PARAMETERS).forEach(r=>{i.REGISTERED_PARAMETERS[r][0]===e[0]&&i.REGISTERED_PARAMETERS[r][1]===e[1]&&(n=!0)}),!n)throw new TypeError("The specified registered parameter is invalid.")}return this._selectRegisteredParameter(e,t),this.sendControlChange(97,0,t),this._deselectRegisteredParameter(t),this}sendRpnIncrement(e,t={}){if(Array.isArray(e)||(e=i.REGISTERED_PARAMETERS[e]),l.validation){if(e===void 0)throw new TypeError("The specified registered parameter is invalid.");let n=!1;if(Object.getOwnPropertyNames(i.REGISTERED_PARAMETERS).forEach(r=>{i.REGISTERED_PARAMETERS[r][0]===e[0]&&i.REGISTERED_PARAMETERS[r][1]===e[1]&&(n=!0)}),!n)throw new TypeError("The specified registered parameter is invalid.")}return this._selectRegisteredParameter(e,t),this.sendControlChange(96,0,t),this._deselectRegisteredParameter(t),this}playNote(e,t={}){this.sendNoteOn(e,t);const n=Array.isArray(e)?e:[e];for(let r of n)if(parseInt(r.duration)>0){const s={time:(c.toTimestamp(t.time)||l.time)+parseInt(r.duration),release:r.release,rawRelease:r.rawRelease};this.sendNoteOff(r,s)}else if(parseInt(t.duration)>0){const s={time:(c.toTimestamp(t.time)||l.time)+parseInt(t.duration),release:t.release,rawRelease:t.rawRelease};this.sendNoteOff(r,s)}return this}sendNoteOff(e,t={}){if(l.validation){if(t.rawRelease!=null&&!(t.rawRelease>=0&&t.rawRelease<=127))throw new RangeError("The 'rawRelease' option must be an integer between 0 and 127");if(t.release!=null&&!(t.release>=0&&t.release<=1))throw new RangeError("The 'release' option must be an number between 0 and 1");t.rawVelocity&&(t.rawRelease=t.velocity,console.warn("The 'rawVelocity' option is deprecated. Use 'rawRelease' instead.")),t.velocity&&(t.release=t.velocity,console.warn("The 'velocity' option is deprecated. Use 'attack' instead."))}let n=64;t.rawRelease!=null?n=t.rawRelease:isNaN(t.release)||(n=Math.round(t.release*127));const r=l.octaveOffset+this.output.octaveOffset+this.octaveOffset;return c.buildNoteArray(e,{rawRelease:parseInt(n)}).forEach(s=>{this.send([(i.CHANNEL_MESSAGES.noteoff<<4)+(this.number-1),s.getOffsetNumber(r),s.rawRelease],{time:c.toTimestamp(t.time)})}),this}stopNote(e,t={}){return this.sendNoteOff(e,t)}sendNoteOn(e,t={}){if(l.validation){if(t.rawAttack!=null&&!(t.rawAttack>=0&&t.rawAttack<=127))throw new RangeError("The 'rawAttack' option must be an integer between 0 and 127");if(t.attack!=null&&!(t.attack>=0&&t.attack<=1))throw new RangeError("The 'attack' option must be an number between 0 and 1");t.rawVelocity&&(t.rawAttack=t.velocity,t.rawRelease=t.release,console.warn("The 'rawVelocity' option is deprecated. Use 'rawAttack' or 'rawRelease'.")),t.velocity&&(t.attack=t.velocity,console.warn("The 'velocity' option is deprecated. Use 'attack' instead."))}let n=64;t.rawAttack!=null?n=t.rawAttack:isNaN(t.attack)||(n=Math.round(t.attack*127));const r=l.octaveOffset+this.output.octaveOffset+this.octaveOffset;return c.buildNoteArray(e,{rawAttack:n}).forEach(s=>{this.send([(i.CHANNEL_MESSAGES.noteon<<4)+(this.number-1),s.getOffsetNumber(r),s.rawAttack],{time:c.toTimestamp(t.time)})}),this}sendChannelMode(e,t=0,n={}){if(typeof e=="string"&&(e=i.CHANNEL_MODE_MESSAGES[e]),l.validation){if(e===void 0)throw new TypeError("Invalid channel mode message name or number.");if(isNaN(e)||!(e>=120&&e<=127))throw new TypeError("Invalid channel mode message number.");if(isNaN(parseInt(t))||t<0||t>127)throw new RangeError("Value must be an integer between 0 and 127.")}return this.send([(i.CHANNEL_MESSAGES.controlchange<<4)+(this.number-1),e,t],{time:c.toTimestamp(n.time)}),this}sendOmniMode(e,t={}){return e===void 0||e?this.sendChannelMode("omnimodeon",0,t):this.sendChannelMode("omnimodeoff",0,t),this}sendChannelAftertouch(e,t={}){if(l.validation){if(isNaN(parseFloat(e)))throw new RangeError("Invalid channel aftertouch value.");if(t.rawValue){if(!(e>=0&&e<=127&&Number.isInteger(e)))throw new RangeError("Channel aftertouch raw value must be an integer between 0 and 127.")}else if(!(e>=0&&e<=1))throw new RangeError("Channel aftertouch value must be a float between 0 and 1.")}return t.rawValue||(e=c.fromFloatTo7Bit(e)),this.send([(i.CHANNEL_MESSAGES.channelaftertouch<<4)+(this.number-1),Math.round(e)],{time:c.toTimestamp(t.time)}),this}sendMasterTuning(e,t={}){if(e=parseFloat(e)||0,l.validation&&!(e>-65&&e<64))throw new RangeError("The value must be a decimal number larger than -65 and smaller than 64.");let n=Math.floor(e)+64,r=e-Math.floor(e);r=Math.round((r+1)/2*16383);let s=r>>7&127,a=r&127;return this.sendRpnValue("channelcoarsetuning",n,t),this.sendRpnValue("channelfinetuning",[s,a],t),this}sendModulationRange(e,t,n={}){if(l.validation){if(!Number.isInteger(e)||!(e>=0&&e<=127))throw new RangeError("The semitones value must be an integer between 0 and 127.");if(t!=null&&(!Number.isInteger(t)||!(t>=0&&t<=127)))throw new RangeError("If specified, the cents value must be an integer between 0 and 127.")}return t>=0&&t<=127||(t=0),this.sendRpnValue("modulationrange",[e,t],n),this}sendNrpnValue(e,t,n={}){if(t=[].concat(t),l.validation){if(!Array.isArray(e)||!Number.isInteger(e[0])||!Number.isInteger(e[1]))throw new TypeError("The specified NRPN is invalid.");if(!(e[0]>=0&&e[0]<=127))throw new RangeError("The first byte of the NRPN must be between 0 and 127.");if(!(e[1]>=0&&e[1]<=127))throw new RangeError("The second byte of the NRPN must be between 0 and 127.");t.forEach(r=>{if(!(r>=0&&r<=127))throw new RangeError("The data bytes of the NRPN must be between 0 and 127.")})}return this._selectNonRegisteredParameter(e,n),this._setCurrentParameter(t,n),this._deselectNonRegisteredParameter(n),this}sendPitchBend(e,t={}){if(l.validation)if(t.rawValue&&Array.isArray(e)){if(!(e[0]>=0&&e[0]<=127))throw new RangeError("The pitch bend MSB must be an integer between 0 and 127.");if(!(e[1]>=0&&e[1]<=127))throw new RangeError("The pitch bend LSB must be an integer between 0 and 127.")}else if(t.rawValue&&!Array.isArray(e)){if(!(e>=0&&e<=127))throw new RangeError("The pitch bend MSB must be an integer between 0 and 127.")}else{if(isNaN(e)||e===null)throw new RangeError("Invalid pitch bend value.");if(!(e>=-1&&e<=1))throw new RangeError("The pitch bend value must be a float between -1 and 1.")}let n=0,r=0;if(t.rawValue&&Array.isArray(e))n=e[0],r=e[1];else if(t.rawValue&&!Array.isArray(e))n=e;else{const s=c.fromFloatToMsbLsb((e+1)/2);n=s.msb,r=s.lsb}return this.send([(i.CHANNEL_MESSAGES.pitchbend<<4)+(this.number-1),r,n],{time:c.toTimestamp(t.time)}),this}sendPitchBendRange(e,t,n={}){if(l.validation){if(!Number.isInteger(e)||!(e>=0&&e<=127))throw new RangeError("The semitones value must be an integer between 0 and 127.");if(!Number.isInteger(t)||!(t>=0&&t<=127))throw new RangeError("The cents value must be an integer between 0 and 127.")}return this.sendRpnValue("pitchbendrange",[e,t],n),this}sendProgramChange(e,t={}){if(e=parseInt(e)||0,l.validation&&!(e>=0&&e<=127))throw new RangeError("The program number must be between 0 and 127.");return this.send([(i.CHANNEL_MESSAGES.programchange<<4)+(this.number-1),e],{time:c.toTimestamp(t.time)}),this}sendRpnValue(e,t,n={}){if(Array.isArray(e)||(e=i.REGISTERED_PARAMETERS[e]),l.validation){if(!Number.isInteger(e[0])||!Number.isInteger(e[1]))throw new TypeError("The specified NRPN is invalid.");if(!(e[0]>=0&&e[0]<=127))throw new RangeError("The first byte of the RPN must be between 0 and 127.");if(!(e[1]>=0&&e[1]<=127))throw new RangeError("The second byte of the RPN must be between 0 and 127.");[].concat(t).forEach(r=>{if(!(r>=0&&r<=127))throw new RangeError("The data bytes of the RPN must be between 0 and 127.")})}return this._selectRegisteredParameter(e,n),this._setCurrentParameter(t,n),this._deselectRegisteredParameter(n),this}sendTuningBank(e,t={}){if(l.validation&&(!Number.isInteger(e)||!(e>=0&&e<=127)))throw new RangeError("The tuning bank number must be between 0 and 127.");return this.sendRpnValue("tuningbank",e,t),this}sendTuningProgram(e,t={}){if(l.validation&&(!Number.isInteger(e)||!(e>=0&&e<=127)))throw new RangeError("The tuning program number must be between 0 and 127.");return this.sendRpnValue("tuningprogram",e,t),this}sendLocalControl(e,t={}){return e?this.sendChannelMode("localcontrol",127,t):this.sendChannelMode("localcontrol",0,t)}sendAllNotesOff(e={}){return this.sendChannelMode("allnotesoff",0,e)}sendAllSoundOff(e={}){return this.sendChannelMode("allsoundoff",0,e)}sendResetAllControllers(e={}){return this.sendChannelMode("resetallcontrollers",0,e)}sendPolyphonicMode(e,t={}){return e==="mono"?this.sendChannelMode("monomodeon",0,t):this.sendChannelMode("polymodeon",0,t)}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get output(){return this._output}get number(){return this._number}}/** * The `Output` class represents a single MIDI output port (not to be confused with a MIDI channel). * A port is made available by a MIDI device. A MIDI device can advertise several input and output * ports. Each port has 16 MIDI channels which can be accessed via the [`channels`](#channels) @@ -69,7 +69,7 @@ var ke=Object.defineProperty;var He=(o,e,t)=>e in o?ke(o,e,{enumerable:!0,config * * @extends EventEmitter * @license Apache-2.0 - */class be extends J{constructor(e){super(),this._midiOutput=e,this._octaveOffset=0,this.channels=[];for(let t=1;t<=16;t++)this.channels[t]=new Qe(this,t);this._midiOutput.onstatechange=this._onStateChange.bind(this)}async destroy(){this.removeListener(),this.channels.forEach(e=>e.destroy()),this.channels=[],this._midiOutput&&(this._midiOutput.onstatechange=null),await this.close(),this._midiOutput=null}_onStateChange(e){let t={timestamp:l.time};e.port.connection==="open"?(t.type="opened",t.target=this,t.port=t.target,this.emit("opened",t)):e.port.connection==="closed"&&e.port.state==="connected"?(t.type="closed",t.target=this,t.port=t.target,this.emit("closed",t)):e.port.connection==="closed"&&e.port.state==="disconnected"?(t.type="disconnected",t.port={connection:e.port.connection,id:e.port.id,manufacturer:e.port.manufacturer,name:e.port.name,state:e.port.state,type:e.port.type},this.emit("disconnected",t)):e.port.connection==="pending"&&e.port.state==="disconnected"||console.warn("This statechange event was not caught:",e.port.connection,e.port.state)}async open(){try{return await this._midiOutput.open(),Promise.resolve(this)}catch(e){return Promise.reject(e)}}async close(){this._midiOutput?await this._midiOutput.close():await Promise.resolve()}send(e,t={time:0},n=0){if(e instanceof Pe&&(e=c.isNode?e.data:e.rawData),e instanceof Uint8Array&&c.isNode&&(e=Array.from(e)),l.validation){if(!Array.isArray(e)&&!(e instanceof Uint8Array)&&(e=[e],Array.isArray(t)&&(e=e.concat(t)),t=isNaN(n)?{time:0}:{time:n}),!(parseInt(e[0])>=128&&parseInt(e[0])<=255))throw new RangeError("The first byte (status) must be an integer between 128 and 255.");e.slice(1).forEach(r=>{if(r=parseInt(r),!(r>=0&&r<=255))throw new RangeError("Data bytes must be integers between 0 and 255.")}),t||(t={time:0})}return this._midiOutput.send(e,c.toTimestamp(t.time)),this}sendSysex(e,t=[],n={}){if(e=[].concat(e),t instanceof Uint8Array){const r=new Uint8Array(1+e.length+t.length+1);r[0]=i.SYSTEM_MESSAGES.sysex,r.set(Uint8Array.from(e),1),r.set(t,1+e.length),r[r.length-1]=i.SYSTEM_MESSAGES.sysexend,this.send(r,{time:n.time})}else{const r=e.concat(t,i.SYSTEM_MESSAGES.sysexend);this.send([i.SYSTEM_MESSAGES.sysex].concat(r),{time:n.time})}return this}clear(){return this._midiOutput.clear?this._midiOutput.clear():l.validation&&console.warn("The 'clear()' method has not yet been implemented in your environment."),this}sendTimecodeQuarterFrame(e,t={}){if(l.validation&&(e=parseInt(e),isNaN(e)||!(e>=0&&e<=127)))throw new RangeError("The value must be an integer between 0 and 127.");return this.send([i.SYSTEM_MESSAGES.timecode,e],{time:t.time}),this}sendSongPosition(e=0,t={}){e=Math.floor(e)||0;var n=e>>7&127,r=e&127;return this.send([i.SYSTEM_MESSAGES.songposition,n,r],{time:t.time}),this}sendSongSelect(e=0,t={}){if(l.validation&&(e=parseInt(e),isNaN(e)||!(e>=0&&e<=127)))throw new RangeError("The program value must be between 0 and 127");return this.send([i.SYSTEM_MESSAGES.songselect,e],{time:t.time}),this}sendTuneRequest(e={}){return this.send([i.SYSTEM_MESSAGES.tunerequest],{time:e.time}),this}sendClock(e={}){return this.send([i.SYSTEM_MESSAGES.clock],{time:e.time}),this}sendStart(e={}){return this.send([i.SYSTEM_MESSAGES.start],{time:e.time}),this}sendContinue(e={}){return this.send([i.SYSTEM_MESSAGES.continue],{time:e.time}),this}sendStop(e={}){return this.send([i.SYSTEM_MESSAGES.stop],{time:e.time}),this}sendActiveSensing(e={}){return this.send([i.SYSTEM_MESSAGES.activesensing],{time:e.time}),this}sendReset(e={}){return this.send([i.SYSTEM_MESSAGES.reset],{time:e.time}),this}sendTuningRequest(e={}){return l.validation&&console.warn("The sendTuningRequest() method has been deprecated. Use sendTuningRequest() instead."),this.sendTuneRequest(e)}sendKeyAftertouch(e,t,n={}){return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r].sendKeyAftertouch(e,t,n)}),this}sendControlChange(e,t,n={},r={}){if(l.validation&&(Array.isArray(n)||Number.isInteger(n)||n==="all")){const s=n;n=r,n.channels=s,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)}return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(s=>{this.channels[s].sendControlChange(e,t,n)}),this}sendPitchBendRange(e=0,t=0,n={}){return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r].sendPitchBendRange(e,t,n)}),this}setPitchBendRange(e=0,t=0,n="all",r={}){return l.validation&&(console.warn("The setPitchBendRange() method is deprecated. Use sendPitchBendRange() instead."),r.channels=n,r.channels==="all"&&(r.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendPitchBendRange(e,t,r)}sendRpnValue(e,t,n={}){return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r].sendRpnValue(e,t,n)}),this}setRegisteredParameter(e,t=[],n="all",r={}){return l.validation&&(console.warn("The setRegisteredParameter() method is deprecated. Use sendRpnValue() instead."),r.channels=n,r.channels==="all"&&(r.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendRpnValue(e,t,r)}sendChannelAftertouch(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendChannelAftertouch(e,t)}),this}sendPitchBend(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendPitchBend(e,t)}),this}sendProgramChange(e=0,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendProgramChange(e,t)}),this}sendModulationRange(e,t,n={}){return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r].sendModulationRange(e,t,n)}),this}setModulationRange(e=0,t=0,n="all",r={}){return l.validation&&(console.warn("The setModulationRange() method is deprecated. Use sendModulationRange() instead."),r.channels=n,r.channels==="all"&&(r.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendModulationRange(e,t,r)}sendMasterTuning(e,t={}){return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(n=>{this.channels[n].sendMasterTuning(e,t)}),this}setMasterTuning(e,t={},n={}){return l.validation&&(console.warn("The setMasterTuning() method is deprecated. Use sendMasterTuning() instead."),n.channels=t,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendMasterTuning(e,n)}sendTuningProgram(e,t={}){return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(n=>{this.channels[n].sendTuningProgram(e,t)}),this}setTuningProgram(e,t="all",n={}){return l.validation&&(console.warn("The setTuningProgram() method is deprecated. Use sendTuningProgram() instead."),n.channels=t,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendTuningProgram(e,n)}sendTuningBank(e=0,t={}){return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(n=>{this.channels[n].sendTuningBank(e,t)}),this}setTuningBank(e,t="all",n={}){return l.validation&&(console.warn("The setTuningBank() method is deprecated. Use sendTuningBank() instead."),n.channels=t,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendTuningBank(e,n)}sendChannelMode(e,t=0,n={},r={}){if(l.validation&&(Array.isArray(n)||Number.isInteger(n)||n==="all")){const s=n;n=r,n.channels=s,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)}return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(s=>{this.channels[s].sendChannelMode(e,t,n)}),this}sendAllSoundOff(e={}){return e.channels==null&&(e.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(e.channels).forEach(t=>{this.channels[t].sendAllSoundOff(e)}),this}sendAllNotesOff(e={}){return e.channels==null&&(e.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(e.channels).forEach(t=>{this.channels[t].sendAllNotesOff(e)}),this}sendResetAllControllers(e={},t={}){if(l.validation&&(Array.isArray(e)||Number.isInteger(e)||e==="all")){const n=e;e=t,e.channels=n,e.channels==="all"&&(e.channels=i.MIDI_CHANNEL_NUMBERS)}return e.channels==null&&(e.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(e.channels).forEach(n=>{this.channels[n].sendResetAllControllers(e)}),this}sendPolyphonicMode(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendPolyphonicMode(e,t)}),this}sendLocalControl(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendLocalControl(e,t)}),this}sendOmniMode(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendOmniMode(e,t)}),this}sendNrpnValue(e,t,n={}){return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r].sendNrpnValue(e,t,n)}),this}setNonRegisteredParameter(e,t=[],n="all",r={}){return l.validation&&(console.warn("The setNonRegisteredParameter() method is deprecated. Use sendNrpnValue() instead."),r.channels=n,r.channels==="all"&&(r.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendNrpnValue(e,t,r)}sendRpnIncrement(e,t={}){return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(n=>{this.channels[n].sendRpnIncrement(e,t)}),this}incrementRegisteredParameter(e,t="all",n={}){return l.validation&&(console.warn("The incrementRegisteredParameter() method is deprecated. Use sendRpnIncrement() instead."),n.channels=t,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendRpnIncrement(e,n)}sendRpnDecrement(e,t={}){return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(n=>{this.channels[n].sendRpnDecrement(e,t)}),this}decrementRegisteredParameter(e,t="all",n={}){return l.validation&&(console.warn("The decrementRegisteredParameter() method is deprecated. Use sendRpnDecrement() instead."),n.channels=t,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendRpnDecrement(e,n)}sendNoteOff(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendNoteOff(e,t)}),this}stopNote(e,t){return this.sendNoteOff(e,t)}playNote(e,t={},n={}){if(l.validation&&(t.rawVelocity&&console.warn("The 'rawVelocity' option is deprecated. Use 'rawAttack' instead."),t.velocity&&console.warn("The 'velocity' option is deprecated. Use 'velocity' instead."),Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].playNote(e,t)}),this}sendNoteOn(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendNoteOn(e,t)}),this}get name(){return this._midiOutput.name}get id(){return this._midiOutput.id}get connection(){return this._midiOutput.connection}get manufacturer(){return this._midiOutput.manufacturer}get state(){return this._midiOutput.state}get type(){return this._midiOutput.type}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}}/** + */class be extends J{constructor(e){super(),this._midiOutput=e,this._octaveOffset=0,this.channels=[];for(let t=1;t<=16;t++)this.channels[t]=new Xe(this,t);this._midiOutput.onstatechange=this._onStateChange.bind(this)}async destroy(){this.removeListener(),this.channels.forEach(e=>e.destroy()),this.channels=[],this._midiOutput&&(this._midiOutput.onstatechange=null),await this.close(),this._midiOutput=null}_onStateChange(e){let t={timestamp:l.time};e.port.connection==="open"?(t.type="opened",t.target=this,t.port=t.target,this.emit("opened",t)):e.port.connection==="closed"&&e.port.state==="connected"?(t.type="closed",t.target=this,t.port=t.target,this.emit("closed",t)):e.port.connection==="closed"&&e.port.state==="disconnected"?(t.type="disconnected",t.port={connection:e.port.connection,id:e.port.id,manufacturer:e.port.manufacturer,name:e.port.name,state:e.port.state,type:e.port.type},this.emit("disconnected",t)):e.port.connection==="pending"&&e.port.state==="disconnected"||console.warn("This statechange event was not caught:",e.port.connection,e.port.state)}async open(){try{return await this._midiOutput.open(),Promise.resolve(this)}catch(e){return Promise.reject(e)}}async close(){this._midiOutput?await this._midiOutput.close():await Promise.resolve()}send(e,t={time:0},n=0){if(e instanceof ke&&(e=c.isNode?e.data:e.rawData),e instanceof Uint8Array&&c.isNode&&(e=Array.from(e)),l.validation){if(!Array.isArray(e)&&!(e instanceof Uint8Array)&&(e=[e],Array.isArray(t)&&(e=e.concat(t)),t=isNaN(n)?{time:0}:{time:n}),!(parseInt(e[0])>=128&&parseInt(e[0])<=255))throw new RangeError("The first byte (status) must be an integer between 128 and 255.");e.slice(1).forEach(r=>{if(r=parseInt(r),!(r>=0&&r<=255))throw new RangeError("Data bytes must be integers between 0 and 255.")}),t||(t={time:0})}return this._midiOutput.send(e,c.toTimestamp(t.time)),this}sendSysex(e,t=[],n={}){if(e=[].concat(e),t instanceof Uint8Array){const r=new Uint8Array(1+e.length+t.length+1);r[0]=i.SYSTEM_MESSAGES.sysex,r.set(Uint8Array.from(e),1),r.set(t,1+e.length),r[r.length-1]=i.SYSTEM_MESSAGES.sysexend,this.send(r,{time:n.time})}else{const r=e.concat(t,i.SYSTEM_MESSAGES.sysexend);this.send([i.SYSTEM_MESSAGES.sysex].concat(r),{time:n.time})}return this}clear(){return this._midiOutput.clear?this._midiOutput.clear():l.validation&&console.warn("The 'clear()' method has not yet been implemented in your environment."),this}sendTimecodeQuarterFrame(e,t={}){if(l.validation&&(e=parseInt(e),isNaN(e)||!(e>=0&&e<=127)))throw new RangeError("The value must be an integer between 0 and 127.");return this.send([i.SYSTEM_MESSAGES.timecode,e],{time:t.time}),this}sendSongPosition(e=0,t={}){e=Math.floor(e)||0;var n=e>>7&127,r=e&127;return this.send([i.SYSTEM_MESSAGES.songposition,n,r],{time:t.time}),this}sendSongSelect(e=0,t={}){if(l.validation&&(e=parseInt(e),isNaN(e)||!(e>=0&&e<=127)))throw new RangeError("The program value must be between 0 and 127");return this.send([i.SYSTEM_MESSAGES.songselect,e],{time:t.time}),this}sendTuneRequest(e={}){return this.send([i.SYSTEM_MESSAGES.tunerequest],{time:e.time}),this}sendClock(e={}){return this.send([i.SYSTEM_MESSAGES.clock],{time:e.time}),this}sendStart(e={}){return this.send([i.SYSTEM_MESSAGES.start],{time:e.time}),this}sendContinue(e={}){return this.send([i.SYSTEM_MESSAGES.continue],{time:e.time}),this}sendStop(e={}){return this.send([i.SYSTEM_MESSAGES.stop],{time:e.time}),this}sendActiveSensing(e={}){return this.send([i.SYSTEM_MESSAGES.activesensing],{time:e.time}),this}sendReset(e={}){return this.send([i.SYSTEM_MESSAGES.reset],{time:e.time}),this}sendTuningRequest(e={}){return l.validation&&console.warn("The sendTuningRequest() method has been deprecated. Use sendTuningRequest() instead."),this.sendTuneRequest(e)}sendKeyAftertouch(e,t,n={}){return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r].sendKeyAftertouch(e,t,n)}),this}sendControlChange(e,t,n={},r={}){if(l.validation&&(Array.isArray(n)||Number.isInteger(n)||n==="all")){const s=n;n=r,n.channels=s,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)}return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(s=>{this.channels[s].sendControlChange(e,t,n)}),this}sendPitchBendRange(e=0,t=0,n={}){return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r].sendPitchBendRange(e,t,n)}),this}setPitchBendRange(e=0,t=0,n="all",r={}){return l.validation&&(console.warn("The setPitchBendRange() method is deprecated. Use sendPitchBendRange() instead."),r.channels=n,r.channels==="all"&&(r.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendPitchBendRange(e,t,r)}sendRpnValue(e,t,n={}){return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r].sendRpnValue(e,t,n)}),this}setRegisteredParameter(e,t=[],n="all",r={}){return l.validation&&(console.warn("The setRegisteredParameter() method is deprecated. Use sendRpnValue() instead."),r.channels=n,r.channels==="all"&&(r.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendRpnValue(e,t,r)}sendChannelAftertouch(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendChannelAftertouch(e,t)}),this}sendPitchBend(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendPitchBend(e,t)}),this}sendProgramChange(e=0,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendProgramChange(e,t)}),this}sendModulationRange(e,t,n={}){return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r].sendModulationRange(e,t,n)}),this}setModulationRange(e=0,t=0,n="all",r={}){return l.validation&&(console.warn("The setModulationRange() method is deprecated. Use sendModulationRange() instead."),r.channels=n,r.channels==="all"&&(r.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendModulationRange(e,t,r)}sendMasterTuning(e,t={}){return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(n=>{this.channels[n].sendMasterTuning(e,t)}),this}setMasterTuning(e,t={},n={}){return l.validation&&(console.warn("The setMasterTuning() method is deprecated. Use sendMasterTuning() instead."),n.channels=t,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendMasterTuning(e,n)}sendTuningProgram(e,t={}){return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(n=>{this.channels[n].sendTuningProgram(e,t)}),this}setTuningProgram(e,t="all",n={}){return l.validation&&(console.warn("The setTuningProgram() method is deprecated. Use sendTuningProgram() instead."),n.channels=t,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendTuningProgram(e,n)}sendTuningBank(e=0,t={}){return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(n=>{this.channels[n].sendTuningBank(e,t)}),this}setTuningBank(e,t="all",n={}){return l.validation&&(console.warn("The setTuningBank() method is deprecated. Use sendTuningBank() instead."),n.channels=t,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendTuningBank(e,n)}sendChannelMode(e,t=0,n={},r={}){if(l.validation&&(Array.isArray(n)||Number.isInteger(n)||n==="all")){const s=n;n=r,n.channels=s,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)}return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(s=>{this.channels[s].sendChannelMode(e,t,n)}),this}sendAllSoundOff(e={}){return e.channels==null&&(e.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(e.channels).forEach(t=>{this.channels[t].sendAllSoundOff(e)}),this}sendAllNotesOff(e={}){return e.channels==null&&(e.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(e.channels).forEach(t=>{this.channels[t].sendAllNotesOff(e)}),this}sendResetAllControllers(e={},t={}){if(l.validation&&(Array.isArray(e)||Number.isInteger(e)||e==="all")){const n=e;e=t,e.channels=n,e.channels==="all"&&(e.channels=i.MIDI_CHANNEL_NUMBERS)}return e.channels==null&&(e.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(e.channels).forEach(n=>{this.channels[n].sendResetAllControllers(e)}),this}sendPolyphonicMode(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendPolyphonicMode(e,t)}),this}sendLocalControl(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendLocalControl(e,t)}),this}sendOmniMode(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendOmniMode(e,t)}),this}sendNrpnValue(e,t,n={}){return n.channels==null&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r].sendNrpnValue(e,t,n)}),this}setNonRegisteredParameter(e,t=[],n="all",r={}){return l.validation&&(console.warn("The setNonRegisteredParameter() method is deprecated. Use sendNrpnValue() instead."),r.channels=n,r.channels==="all"&&(r.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendNrpnValue(e,t,r)}sendRpnIncrement(e,t={}){return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(n=>{this.channels[n].sendRpnIncrement(e,t)}),this}incrementRegisteredParameter(e,t="all",n={}){return l.validation&&(console.warn("The incrementRegisteredParameter() method is deprecated. Use sendRpnIncrement() instead."),n.channels=t,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendRpnIncrement(e,n)}sendRpnDecrement(e,t={}){return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(n=>{this.channels[n].sendRpnDecrement(e,t)}),this}decrementRegisteredParameter(e,t="all",n={}){return l.validation&&(console.warn("The decrementRegisteredParameter() method is deprecated. Use sendRpnDecrement() instead."),n.channels=t,n.channels==="all"&&(n.channels=i.MIDI_CHANNEL_NUMBERS)),this.sendRpnDecrement(e,n)}sendNoteOff(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendNoteOff(e,t)}),this}stopNote(e,t){return this.sendNoteOff(e,t)}playNote(e,t={},n={}){if(l.validation&&(t.rawVelocity&&console.warn("The 'rawVelocity' option is deprecated. Use 'rawAttack' instead."),t.velocity&&console.warn("The 'velocity' option is deprecated. Use 'velocity' instead."),Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].playNote(e,t)}),this}sendNoteOn(e,t={},n={}){if(l.validation&&(Array.isArray(t)||Number.isInteger(t)||t==="all")){const r=t;t=n,t.channels=r,t.channels==="all"&&(t.channels=i.MIDI_CHANNEL_NUMBERS)}return t.channels==null&&(t.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(t.channels).forEach(r=>{this.channels[r].sendNoteOn(e,t)}),this}get name(){return this._midiOutput.name}get id(){return this._midiOutput.id}get connection(){return this._midiOutput.connection}get manufacturer(){return this._midiOutput.manufacturer}get state(){return this._midiOutput.state}get type(){return this._midiOutput.type}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}}/** * The `Forwarder` class allows the forwarding of MIDI messages to predetermined outputs. When you * call its [`forward()`](#forward) method, it will send the specified [`Message`](Message) object * to all the outputs listed in its [`destinations`](#destinations) property. @@ -193,13 +193,13 @@ var ke=Object.defineProperty;var He=(o,e,t)=>e in o?ke(o,e,{enumerable:!0,config * @extends EventEmitter * @license Apache-2.0 * @since 3.0.0 - */class Xe extends J{constructor(e,t){super(),this._input=e,this._number=t,this._octaveOffset=0,this._nrpnBuffer=[],this._rpnBuffer=[],this.parameterNumberEventsEnabled=!0,this.notesState=new Array(128).fill(!1)}destroy(){this._input=null,this._number=null,this._octaveOffset=0,this._nrpnBuffer=[],this.notesState=new Array(128).fill(!1),this.parameterNumberEventsEnabled=!1,this.removeListener()}_processMidiMessageEvent(e){const t=Object.assign({},e);t.port=this.input,t.target=this,t.type="midimessage",this.emit(t.type,t),this._parseEventForStandardMessages(t)}_parseEventForStandardMessages(e){const t=Object.assign({},e);t.type=t.message.type||"unknownmessage";const n=e.message.dataBytes[0],r=e.message.dataBytes[1];if(t.type==="noteoff"||t.type==="noteon"&&r===0)this.notesState[n]=!1,t.type="noteoff",t.note=new ae(c.offsetNumber(n,this.octaveOffset+this.input.octaveOffset+l.octaveOffset),{rawAttack:0,rawRelease:r}),t.value=c.from7bitToFloat(r),t.rawValue=r,t.velocity=t.note.release,t.rawVelocity=t.note.rawRelease;else if(t.type==="noteon")this.notesState[n]=!0,t.note=new ae(c.offsetNumber(n,this.octaveOffset+this.input.octaveOffset+l.octaveOffset),{rawAttack:r}),t.value=c.from7bitToFloat(r),t.rawValue=r,t.velocity=t.note.attack,t.rawVelocity=t.note.rawAttack;else if(t.type==="keyaftertouch")t.note=new ae(c.offsetNumber(n,this.octaveOffset+this.input.octaveOffset+l.octaveOffset)),t.value=c.from7bitToFloat(r),t.rawValue=r,t.identifier=t.note.identifier,t.key=t.note.number,t.rawKey=n;else if(t.type==="controlchange"){t.controller={number:n,name:i.CONTROL_CHANGE_MESSAGES[n].name,description:i.CONTROL_CHANGE_MESSAGES[n].description,position:i.CONTROL_CHANGE_MESSAGES[n].position},t.subtype=t.controller.name||"controller"+n,t.value=c.from7bitToFloat(r),t.rawValue=r;const s=Object.assign({},t);s.type=`${t.type}-controller${n}`,delete s.subtype,this.emit(s.type,s);const a=Object.assign({},t);a.type=`${t.type}-`+i.CONTROL_CHANGE_MESSAGES[n].name,delete a.subtype,a.type.indexOf("controller")!==0&&this.emit(a.type,a),t.message.dataBytes[0]>=120&&this._parseChannelModeMessage(t),this.parameterNumberEventsEnabled&&this._isRpnOrNrpnController(t.message.dataBytes[0])&&this._parseEventForParameterNumber(t)}else t.type==="programchange"?(t.value=n,t.rawValue=t.value):t.type==="channelaftertouch"?(t.value=c.from7bitToFloat(n),t.rawValue=n):t.type==="pitchbend"?(t.value=((r<<7)+n-8192)/8192,t.rawValue=(r<<7)+n):t.type="unknownmessage";this.emit(t.type,t)}_parseChannelModeMessage(e){const t=Object.assign({},e);t.type=t.controller.name,t.type==="localcontrol"&&(t.value=t.message.data[2]===127,t.rawValue=t.message.data[2]),t.type==="omnimodeon"?(t.type="omnimode",t.value=!0,t.rawValue=t.message.data[2]):t.type==="omnimodeoff"&&(t.type="omnimode",t.value=!1,t.rawValue=t.message.data[2]),t.type==="monomodeon"?(t.type="monomode",t.value=!0,t.rawValue=t.message.data[2]):t.type==="polymodeon"&&(t.type="monomode",t.value=!1,t.rawValue=t.message.data[2]),this.emit(t.type,t)}_parseEventForParameterNumber(e){const t=e.message.dataBytes[0],n=e.message.dataBytes[1];t===99||t===101?(this._nrpnBuffer=[],this._rpnBuffer=[],t===99?this._nrpnBuffer=[e.message]:n!==127&&(this._rpnBuffer=[e.message])):t===98||t===100?t===98?(this._rpnBuffer=[],this._nrpnBuffer.length===1?this._nrpnBuffer.push(e.message):this._nrpnBuffer=[]):(this._nrpnBuffer=[],this._rpnBuffer.length===1&&n!==127?this._rpnBuffer.push(e.message):this._rpnBuffer=[]):(t===6||t===38||t===96||t===97)&&(this._rpnBuffer.length===2?this._dispatchParameterNumberEvent("rpn",this._rpnBuffer[0].dataBytes[1],this._rpnBuffer[1].dataBytes[1],e):this._nrpnBuffer.length===2?this._dispatchParameterNumberEvent("nrpn",this._nrpnBuffer[0].dataBytes[1],this._nrpnBuffer[1].dataBytes[1],e):(this._nrpnBuffer=[],this._rpnBuffer=[]))}_isRpnOrNrpnController(e){return e===6||e===38||e===96||e===97||e===98||e===99||e===100||e===101}_dispatchParameterNumberEvent(e,t,n,r){e=e==="nrpn"?"nrpn":"rpn";const s={target:r.target,timestamp:r.timestamp,message:r.message,parameterMsb:t,parameterLsb:n,value:c.from7bitToFloat(r.message.dataBytes[1]),rawValue:r.message.dataBytes[1]};e==="rpn"?s.parameter=Object.keys(i.REGISTERED_PARAMETERS).find(u=>i.REGISTERED_PARAMETERS[u][0]===t&&i.REGISTERED_PARAMETERS[u][1]===n):s.parameter=(t<<7)+n;const a=i.CONTROL_CHANGE_MESSAGES[r.message.dataBytes[0]].name;s.type=`${e}-${a}`,this.emit(s.type,s);const h=Object.assign({},s);h.type==="nrpn-dataincrement"?h.type="nrpn-databuttonincrement":h.type==="nrpn-datadecrement"?h.type="nrpn-databuttondecrement":h.type==="rpn-dataincrement"?h.type="rpn-databuttonincrement":h.type==="rpn-datadecrement"&&(h.type="rpn-databuttondecrement"),this.emit(h.type,h),s.type=e,s.subtype=a,this.emit(s.type,s)}getChannelModeByNumber(e){return l.validation&&(console.warn("The 'getChannelModeByNumber()' method has been moved to the 'Utilities' class."),e=Math.floor(e)),c.getChannelModeByNumber(e)}getCcNameByNumber(e){if(l.validation&&(console.warn("The 'getCcNameByNumber()' method has been moved to the 'Utilities' class."),e=parseInt(e),!(e>=0&&e<=127)))throw new RangeError("Invalid control change number.");return c.getCcNameByNumber(e)}getNoteState(e){e instanceof ae&&(e=e.identifier);const t=c.guessNoteNumber(e,l.octaveOffset+this.input.octaveOffset+this.octaveOffset);return this.notesState[t]}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get input(){return this._input}get number(){return this._number}get nrpnEventsEnabled(){return this.parameterNumberEventsEnabled}set nrpnEventsEnabled(e){this.validation&&(e=!!e),this.parameterNumberEventsEnabled=e}}/** + */class Ze extends J{constructor(e,t){super(),this._input=e,this._number=t,this._octaveOffset=0,this._nrpnBuffer=[],this._rpnBuffer=[],this.parameterNumberEventsEnabled=!0,this.notesState=new Array(128).fill(!1)}destroy(){this._input=null,this._number=null,this._octaveOffset=0,this._nrpnBuffer=[],this.notesState=new Array(128).fill(!1),this.parameterNumberEventsEnabled=!1,this.removeListener()}_processMidiMessageEvent(e){const t=Object.assign({},e);t.port=this.input,t.target=this,t.type="midimessage",this.emit(t.type,t),this._parseEventForStandardMessages(t)}_parseEventForStandardMessages(e){const t=Object.assign({},e);t.type=t.message.type||"unknownmessage";const n=e.message.dataBytes[0],r=e.message.dataBytes[1];if(t.type==="noteoff"||t.type==="noteon"&&r===0)this.notesState[n]=!1,t.type="noteoff",t.note=new oe(c.offsetNumber(n,this.octaveOffset+this.input.octaveOffset+l.octaveOffset),{rawAttack:0,rawRelease:r}),t.value=c.from7bitToFloat(r),t.rawValue=r,t.velocity=t.note.release,t.rawVelocity=t.note.rawRelease;else if(t.type==="noteon")this.notesState[n]=!0,t.note=new oe(c.offsetNumber(n,this.octaveOffset+this.input.octaveOffset+l.octaveOffset),{rawAttack:r}),t.value=c.from7bitToFloat(r),t.rawValue=r,t.velocity=t.note.attack,t.rawVelocity=t.note.rawAttack;else if(t.type==="keyaftertouch")t.note=new oe(c.offsetNumber(n,this.octaveOffset+this.input.octaveOffset+l.octaveOffset)),t.value=c.from7bitToFloat(r),t.rawValue=r,t.identifier=t.note.identifier,t.key=t.note.number,t.rawKey=n;else if(t.type==="controlchange"){t.controller={number:n,name:i.CONTROL_CHANGE_MESSAGES[n].name,description:i.CONTROL_CHANGE_MESSAGES[n].description,position:i.CONTROL_CHANGE_MESSAGES[n].position},t.subtype=t.controller.name||"controller"+n,t.value=c.from7bitToFloat(r),t.rawValue=r;const s=Object.assign({},t);s.type=`${t.type}-controller${n}`,delete s.subtype,this.emit(s.type,s);const a=Object.assign({},t);a.type=`${t.type}-`+i.CONTROL_CHANGE_MESSAGES[n].name,delete a.subtype,a.type.indexOf("controller")!==0&&this.emit(a.type,a),t.message.dataBytes[0]>=120&&this._parseChannelModeMessage(t),this.parameterNumberEventsEnabled&&this._isRpnOrNrpnController(t.message.dataBytes[0])&&this._parseEventForParameterNumber(t)}else t.type==="programchange"?(t.value=n,t.rawValue=t.value):t.type==="channelaftertouch"?(t.value=c.from7bitToFloat(n),t.rawValue=n):t.type==="pitchbend"?(t.value=((r<<7)+n-8192)/8192,t.rawValue=(r<<7)+n):t.type="unknownmessage";this.emit(t.type,t)}_parseChannelModeMessage(e){const t=Object.assign({},e);t.type=t.controller.name,t.type==="localcontrol"&&(t.value=t.message.data[2]===127,t.rawValue=t.message.data[2]),t.type==="omnimodeon"?(t.type="omnimode",t.value=!0,t.rawValue=t.message.data[2]):t.type==="omnimodeoff"&&(t.type="omnimode",t.value=!1,t.rawValue=t.message.data[2]),t.type==="monomodeon"?(t.type="monomode",t.value=!0,t.rawValue=t.message.data[2]):t.type==="polymodeon"&&(t.type="monomode",t.value=!1,t.rawValue=t.message.data[2]),this.emit(t.type,t)}_parseEventForParameterNumber(e){const t=e.message.dataBytes[0],n=e.message.dataBytes[1];t===99||t===101?(this._nrpnBuffer=[],this._rpnBuffer=[],t===99?this._nrpnBuffer=[e.message]:n!==127&&(this._rpnBuffer=[e.message])):t===98||t===100?t===98?(this._rpnBuffer=[],this._nrpnBuffer.length===1?this._nrpnBuffer.push(e.message):this._nrpnBuffer=[]):(this._nrpnBuffer=[],this._rpnBuffer.length===1&&n!==127?this._rpnBuffer.push(e.message):this._rpnBuffer=[]):(t===6||t===38||t===96||t===97)&&(this._rpnBuffer.length===2?this._dispatchParameterNumberEvent("rpn",this._rpnBuffer[0].dataBytes[1],this._rpnBuffer[1].dataBytes[1],e):this._nrpnBuffer.length===2?this._dispatchParameterNumberEvent("nrpn",this._nrpnBuffer[0].dataBytes[1],this._nrpnBuffer[1].dataBytes[1],e):(this._nrpnBuffer=[],this._rpnBuffer=[]))}_isRpnOrNrpnController(e){return e===6||e===38||e===96||e===97||e===98||e===99||e===100||e===101}_dispatchParameterNumberEvent(e,t,n,r){e=e==="nrpn"?"nrpn":"rpn";const s={target:r.target,timestamp:r.timestamp,message:r.message,parameterMsb:t,parameterLsb:n,value:c.from7bitToFloat(r.message.dataBytes[1]),rawValue:r.message.dataBytes[1]};e==="rpn"?s.parameter=Object.keys(i.REGISTERED_PARAMETERS).find(g=>i.REGISTERED_PARAMETERS[g][0]===t&&i.REGISTERED_PARAMETERS[g][1]===n):s.parameter=(t<<7)+n;const a=i.CONTROL_CHANGE_MESSAGES[r.message.dataBytes[0]].name;s.type=`${e}-${a}`,this.emit(s.type,s);const f=Object.assign({},s);f.type==="nrpn-dataincrement"?f.type="nrpn-databuttonincrement":f.type==="nrpn-datadecrement"?f.type="nrpn-databuttondecrement":f.type==="rpn-dataincrement"?f.type="rpn-databuttonincrement":f.type==="rpn-datadecrement"&&(f.type="rpn-databuttondecrement"),this.emit(f.type,f),s.type=e,s.subtype=a,this.emit(s.type,s)}getChannelModeByNumber(e){return l.validation&&(console.warn("The 'getChannelModeByNumber()' method has been moved to the 'Utilities' class."),e=Math.floor(e)),c.getChannelModeByNumber(e)}getCcNameByNumber(e){if(l.validation&&(console.warn("The 'getCcNameByNumber()' method has been moved to the 'Utilities' class."),e=parseInt(e),!(e>=0&&e<=127)))throw new RangeError("Invalid control change number.");return c.getCcNameByNumber(e)}getNoteState(e){e instanceof oe&&(e=e.identifier);const t=c.guessNoteNumber(e,l.octaveOffset+this.input.octaveOffset+this.octaveOffset);return this.notesState[t]}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get input(){return this._input}get number(){return this._number}get nrpnEventsEnabled(){return this.parameterNumberEventsEnabled}set nrpnEventsEnabled(e){this.validation&&(e=!!e),this.parameterNumberEventsEnabled=e}}/** * The `Message` class represents a single MIDI message. It has several properties that make it * easy to make sense of the binary data it contains. * * @license Apache-2.0 * @since 3.0.0 - */class Pe{constructor(e){this.rawData=e,this.data=Array.from(this.rawData),this.statusByte=this.rawData[0],this.rawDataBytes=this.rawData.slice(1),this.dataBytes=this.data.slice(1),this.isChannelMessage=!1,this.isSystemMessage=!1,this.command=void 0,this.channel=void 0,this.manufacturerId=void 0,this.type=void 0,this.statusByte<240?(this.isChannelMessage=!0,this.command=this.statusByte>>4,this.channel=(this.statusByte&15)+1):(this.isSystemMessage=!0,this.command=this.statusByte),this.isChannelMessage?this.type=c.getPropertyByValue(i.CHANNEL_MESSAGES,this.command):this.isSystemMessage&&(this.type=c.getPropertyByValue(i.SYSTEM_MESSAGES,this.command)),this.statusByte===i.SYSTEM_MESSAGES.sysex&&(this.dataBytes[0]===0?(this.manufacturerId=this.dataBytes.slice(0,3),this.dataBytes=this.dataBytes.slice(3,this.rawDataBytes.length-1),this.rawDataBytes=this.rawDataBytes.slice(3,this.rawDataBytes.length-1)):(this.manufacturerId=[this.dataBytes[0]],this.dataBytes=this.dataBytes.slice(1,this.dataBytes.length-1),this.rawDataBytes=this.rawDataBytes.slice(1,this.rawDataBytes.length-1)))}}/** + */class ke{constructor(e){this.rawData=e,this.data=Array.from(this.rawData),this.statusByte=this.rawData[0],this.rawDataBytes=this.rawData.slice(1),this.dataBytes=this.data.slice(1),this.isChannelMessage=!1,this.isSystemMessage=!1,this.command=void 0,this.channel=void 0,this.manufacturerId=void 0,this.type=void 0,this.statusByte<240?(this.isChannelMessage=!0,this.command=this.statusByte>>4,this.channel=(this.statusByte&15)+1):(this.isSystemMessage=!0,this.command=this.statusByte),this.isChannelMessage?this.type=c.getPropertyByValue(i.CHANNEL_MESSAGES,this.command):this.isSystemMessage&&(this.type=c.getPropertyByValue(i.SYSTEM_MESSAGES,this.command)),this.statusByte===i.SYSTEM_MESSAGES.sysex&&(this.dataBytes[0]===0?(this.manufacturerId=this.dataBytes.slice(0,3),this.dataBytes=this.dataBytes.slice(3,this.rawDataBytes.length-1),this.rawDataBytes=this.rawDataBytes.slice(3,this.rawDataBytes.length-1)):(this.manufacturerId=[this.dataBytes[0]],this.dataBytes=this.dataBytes.slice(1,this.dataBytes.length-1),this.rawDataBytes=this.rawDataBytes.slice(1,this.rawDataBytes.length-1)))}}/** * The `Input` class represents a single MIDI input port. This object is automatically instantiated * by the library according to the host's MIDI subsystem and does not need to be directly * instantiated. Instead, you can access all `Input` objects by referring to the @@ -237,7 +237,7 @@ var ke=Object.defineProperty;var He=(o,e,t)=>e in o?ke(o,e,{enumerable:!0,config * * @extends EventEmitter * @license Apache-2.0 - */class Ze extends J{constructor(e){super(),this._midiInput=e,this._octaveOffset=0,this.channels=[];for(let t=1;t<=16;t++)this.channels[t]=new Xe(this,t);this._forwarders=[],this._midiInput.onstatechange=this._onStateChange.bind(this),this._midiInput.onmidimessage=this._onMidiMessage.bind(this)}async destroy(){this.removeListener(),this.channels.forEach(e=>e.destroy()),this.channels=[],this._forwarders=[],this._midiInput&&(this._midiInput.onstatechange=null,this._midiInput.onmidimessage=null),await this.close(),this._midiInput=null}_onStateChange(e){let t={timestamp:l.time,target:this,port:this};e.port.connection==="open"?(t.type="opened",this.emit("opened",t)):e.port.connection==="closed"&&e.port.state==="connected"?(t.type="closed",this.emit("closed",t)):e.port.connection==="closed"&&e.port.state==="disconnected"?(t.type="disconnected",t.port={connection:e.port.connection,id:e.port.id,manufacturer:e.port.manufacturer,name:e.port.name,state:e.port.state,type:e.port.type},this.emit("disconnected",t)):e.port.connection==="pending"&&e.port.state==="disconnected"||console.warn("This statechange event was not caught: ",e.port.connection,e.port.state)}_onMidiMessage(e){const t=new Pe(e.data),n={port:this,target:this,message:t,timestamp:e.timeStamp,type:"midimessage",data:t.data,rawData:t.data,statusByte:t.data[0],dataBytes:t.dataBytes};this.emit("midimessage",n),t.isSystemMessage?this._parseEvent(n):t.isChannelMessage&&this.channels[t.channel]._processMidiMessageEvent(n),this._forwarders.forEach(r=>r.forward(t))}_parseEvent(e){const t=Object.assign({},e);t.type=t.message.type||"unknownmidimessage",t.type==="songselect"&&(t.song=e.data[1]+1,t.value=e.data[1],t.rawValue=t.value),this.emit(t.type,t)}async open(){try{await this._midiInput.open()}catch(e){return Promise.reject(e)}return Promise.resolve(this)}async close(){if(!this._midiInput)return Promise.resolve(this);try{await this._midiInput.close()}catch(e){return Promise.reject(e)}return Promise.resolve(this)}getChannelModeByNumber(){l.validation&&console.warn("The 'getChannelModeByNumber()' method has been moved to the 'Utilities' class.")}addListener(e,t,n={}){if(l.validation&&typeof n=="function"){let r=t!=null?[].concat(t):void 0;t=n,n={channels:r}}if(i.CHANNEL_EVENTS.includes(e)){n.channels===void 0&&(n.channels=i.MIDI_CHANNEL_NUMBERS);let r=[];return c.sanitizeChannels(n.channels).forEach(s=>{r.push(this.channels[s].addListener(e,t,n))}),r}else return super.addListener(e,t,n)}addOneTimeListener(e,t,n={}){return n.remaining=1,this.addListener(e,t,n)}on(e,t,n,r){return this.addListener(e,t,n,r)}hasListener(e,t,n={}){if(l.validation&&typeof n=="function"){let r=[].concat(t);t=n,n={channels:r}}return i.CHANNEL_EVENTS.includes(e)?(n.channels===void 0&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).every(r=>this.channels[r].hasListener(e,t))):super.hasListener(e,t)}removeListener(e,t,n={}){if(l.validation&&typeof n=="function"){let r=[].concat(t);t=n,n={channels:r}}if(n.channels===void 0&&(n.channels=i.MIDI_CHANNEL_NUMBERS),e==null)return c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r]&&this.channels[r].removeListener()}),super.removeListener();i.CHANNEL_EVENTS.includes(e)?c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r].removeListener(e,t,n)}):super.removeListener(e,t,n)}addForwarder(e,t={}){let n;return e instanceof Oe?n=e:n=new Oe(e,t),this._forwarders.push(n),n}removeForwarder(e){this._forwarders=this._forwarders.filter(t=>t!==e)}hasForwarder(e){return this._forwarders.includes(e)}get name(){return this._midiInput.name}get id(){return this._midiInput.id}get connection(){return this._midiInput.connection}get manufacturer(){return this._midiInput.manufacturer}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get state(){return this._midiInput.state}get type(){return this._midiInput.type}get nrpnEventsEnabled(){return l.validation&&console.warn("The 'nrpnEventsEnabled' property has been moved to the 'InputChannel' class."),!1}}/** + */class $e extends J{constructor(e){super(),this._midiInput=e,this._octaveOffset=0,this.channels=[];for(let t=1;t<=16;t++)this.channels[t]=new Ze(this,t);this._forwarders=[],this._midiInput.onstatechange=this._onStateChange.bind(this),this._midiInput.onmidimessage=this._onMidiMessage.bind(this)}async destroy(){this.removeListener(),this.channels.forEach(e=>e.destroy()),this.channels=[],this._forwarders=[],this._midiInput&&(this._midiInput.onstatechange=null,this._midiInput.onmidimessage=null),await this.close(),this._midiInput=null}_onStateChange(e){let t={timestamp:l.time,target:this,port:this};e.port.connection==="open"?(t.type="opened",this.emit("opened",t)):e.port.connection==="closed"&&e.port.state==="connected"?(t.type="closed",this.emit("closed",t)):e.port.connection==="closed"&&e.port.state==="disconnected"?(t.type="disconnected",t.port={connection:e.port.connection,id:e.port.id,manufacturer:e.port.manufacturer,name:e.port.name,state:e.port.state,type:e.port.type},this.emit("disconnected",t)):e.port.connection==="pending"&&e.port.state==="disconnected"||console.warn("This statechange event was not caught: ",e.port.connection,e.port.state)}_onMidiMessage(e){const t=new ke(e.data),n={port:this,target:this,message:t,timestamp:e.timeStamp,type:"midimessage",data:t.data,rawData:t.data,statusByte:t.data[0],dataBytes:t.dataBytes};this.emit("midimessage",n),t.isSystemMessage?this._parseEvent(n):t.isChannelMessage&&this.channels[t.channel]._processMidiMessageEvent(n),this._forwarders.forEach(r=>r.forward(t))}_parseEvent(e){const t=Object.assign({},e);t.type=t.message.type||"unknownmidimessage",t.type==="songselect"&&(t.song=e.data[1]+1,t.value=e.data[1],t.rawValue=t.value),this.emit(t.type,t)}async open(){try{await this._midiInput.open()}catch(e){return Promise.reject(e)}return Promise.resolve(this)}async close(){if(!this._midiInput)return Promise.resolve(this);try{await this._midiInput.close()}catch(e){return Promise.reject(e)}return Promise.resolve(this)}getChannelModeByNumber(){l.validation&&console.warn("The 'getChannelModeByNumber()' method has been moved to the 'Utilities' class.")}addListener(e,t,n={}){if(l.validation&&typeof n=="function"){let r=t!=null?[].concat(t):void 0;t=n,n={channels:r}}if(i.CHANNEL_EVENTS.includes(e)){n.channels===void 0&&(n.channels=i.MIDI_CHANNEL_NUMBERS);let r=[];return c.sanitizeChannels(n.channels).forEach(s=>{r.push(this.channels[s].addListener(e,t,n))}),r}else return super.addListener(e,t,n)}addOneTimeListener(e,t,n={}){return n.remaining=1,this.addListener(e,t,n)}on(e,t,n,r){return this.addListener(e,t,n,r)}hasListener(e,t,n={}){if(l.validation&&typeof n=="function"){let r=[].concat(t);t=n,n={channels:r}}return i.CHANNEL_EVENTS.includes(e)?(n.channels===void 0&&(n.channels=i.MIDI_CHANNEL_NUMBERS),c.sanitizeChannels(n.channels).every(r=>this.channels[r].hasListener(e,t))):super.hasListener(e,t)}removeListener(e,t,n={}){if(l.validation&&typeof n=="function"){let r=[].concat(t);t=n,n={channels:r}}if(n.channels===void 0&&(n.channels=i.MIDI_CHANNEL_NUMBERS),e==null)return c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r]&&this.channels[r].removeListener()}),super.removeListener();i.CHANNEL_EVENTS.includes(e)?c.sanitizeChannels(n.channels).forEach(r=>{this.channels[r].removeListener(e,t,n)}):super.removeListener(e,t,n)}addForwarder(e,t={}){let n;return e instanceof Oe?n=e:n=new Oe(e,t),this._forwarders.push(n),n}removeForwarder(e){this._forwarders=this._forwarders.filter(t=>t!==e)}hasForwarder(e){return this._forwarders.includes(e)}get name(){return this._midiInput.name}get id(){return this._midiInput.id}get connection(){return this._midiInput.connection}get manufacturer(){return this._midiInput.manufacturer}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get state(){return this._midiInput.state}get type(){return this._midiInput.type}get nrpnEventsEnabled(){return l.validation&&console.warn("The 'nrpnEventsEnabled' property has been moved to the 'InputChannel' class."),!1}}/** * The `WebMidi` object makes it easier to work with the low-level Web MIDI API. Basically, it * simplifies sending outgoing MIDI messages and reacting to incoming MIDI messages. * @@ -256,10 +256,10 @@ var ke=Object.defineProperty;var He=(o,e,t)=>e in o?ke(o,e,{enumerable:!0,config * * @extends EventEmitter * @license Apache-2.0 - */class $e extends J{constructor(){super(),this.defaults={note:{attack:c.from7bitToFloat(64),release:c.from7bitToFloat(64),duration:1/0}},this.interface=null,this.validation=!0,this._inputs=[],this._disconnectedInputs=[],this._outputs=[],this._disconnectedOutputs=[],this._stateChangeQueue=[],this._octaveOffset=0}async enable(e={},t=!1){if(c.isNode){try{window.navigator}catch{let h=await Object.getPrototypeOf(async function(){}).constructor(` + */class et extends J{constructor(){super(),this.defaults={note:{attack:c.from7bitToFloat(64),release:c.from7bitToFloat(64),duration:1/0}},this.interface=null,this.validation=!0,this._inputs=[],this._disconnectedInputs=[],this._outputs=[],this._disconnectedOutputs=[],this._stateChangeQueue=[],this._octaveOffset=0}async enable(e={},t=!1){if(c.isNode){try{window.navigator}catch{let f=await Object.getPrototypeOf(async function(){}).constructor(` let jzz = await import("jzz"); return jzz.default; - `)();global.navigator||(global.navigator={}),Object.assign(global.navigator,h)}try{}catch{global.performance=await Object.getPrototypeOf(async function(){}).constructor(` + `)();global.navigator||(global.navigator={}),Object.assign(global.navigator,f)}try{}catch{global.performance=await Object.getPrototypeOf(async function(){}).constructor(` let perf_hooks = await import("perf_hooks"); return perf_hooks.performance; - `)()}}if(this.validation=e.validation!==!1,this.validation&&(typeof e=="function"&&(e={callback:e,sysex:t}),t&&(e.sysex=!0)),this.enabled)return typeof e.callback=="function"&&e.callback(),Promise.resolve();const n={timestamp:this.time,target:this,type:"error",error:void 0},r={timestamp:this.time,target:this,type:"midiaccessgranted"},s={timestamp:this.time,target:this,type:"enabled"};try{typeof e.requestMIDIAccessFunction=="function"?this.interface=await e.requestMIDIAccessFunction({sysex:e.sysex,software:e.software}):this.interface=await navigator.requestMIDIAccess({sysex:e.sysex,software:e.software})}catch(a){return n.error=a,this.emit("error",n),typeof e.callback=="function"&&e.callback(a),Promise.reject(a)}this.emit("midiaccessgranted",r),this.interface.onstatechange=this._onInterfaceStateChange.bind(this);try{await this._updateInputsAndOutputs()}catch(a){return n.error=a,this.emit("error",n),typeof e.callback=="function"&&e.callback(a),Promise.reject(a)}return this.emit("enabled",s),typeof e.callback=="function"&&e.callback(),Promise.resolve(this)}async disable(){return this.interface&&(this.interface.onstatechange=void 0),this._destroyInputsAndOutputs().then(()=>{navigator&&typeof navigator.close=="function"&&navigator.close(),this.interface=null;let e={timestamp:this.time,target:this,type:"disabled"};this.emit("disabled",e),this.removeListener()})}getInputById(e,t={disconnected:!1}){if(this.validation){if(!this.enabled)throw new Error("WebMidi is not enabled.");if(!e)return}if(t.disconnected){for(let n=0;n=0&&e<=127?c.getNoteDetails(c.offsetNumber(e,this.octaveOffset)).octave:!1}sanitizeChannels(e){return this.validation&&console.warn("The sanitizeChannels() method has been moved to the utilities class."),c.sanitizeChannels(e)}toMIDIChannels(e){return this.validation&&console.warn("The toMIDIChannels() method has been deprecated. Use Utilities.sanitizeChannels() instead."),c.sanitizeChannels(e)}guessNoteNumber(e){return this.validation&&console.warn("The guessNoteNumber() method has been deprecated. Use Utilities.guessNoteNumber() instead."),c.guessNoteNumber(e,this.octaveOffset)}getValidNoteArray(e,t={}){return this.validation&&console.warn("The getValidNoteArray() method has been moved to the Utilities.buildNoteArray()"),c.buildNoteArray(e,t)}convertToTimestamp(e){return this.validation&&console.warn("The convertToTimestamp() method has been moved to Utilities.toTimestamp()."),c.toTimestamp(e)}async _destroyInputsAndOutputs(){let e=[];return this.inputs.forEach(t=>e.push(t.destroy())),this.outputs.forEach(t=>e.push(t.destroy())),Promise.all(e).then(()=>{this._inputs=[],this._outputs=[]})}_onInterfaceStateChange(e){this._updateInputsAndOutputs();let t={timestamp:e.timeStamp,type:e.port.state,target:this};if(e.port.state==="connected"&&e.port.connection==="open"){e.port.type==="output"?t.port=this.getOutputById(e.port.id):e.port.type==="input"&&(t.port=this.getInputById(e.port.id)),this.emit(e.port.state,t);const n=Object.assign({},t);n.type="portschanged",this.emit(n.type,n)}else if(e.port.state==="disconnected"&&e.port.connection==="pending"){e.port.type==="input"?t.port=this.getInputById(e.port.id,{disconnected:!0}):e.port.type==="output"&&(t.port=this.getOutputById(e.port.id,{disconnected:!0})),this.emit(e.port.state,t);const n=Object.assign({},t);n.type="portschanged",this.emit(n.type,n)}}async _updateInputsAndOutputs(){return Promise.all([this._updateInputs(),this._updateOutputs()])}async _updateInputs(){if(!this.interface)return;for(let t=this._inputs.length-1;t>=0;t--){const n=this._inputs[t];Array.from(this.interface.inputs.values()).find(s=>s===n._midiInput)||(this._disconnectedInputs.push(n),this._inputs.splice(t,1))}let e=[];return this.interface.inputs.forEach(t=>{if(!this._inputs.find(n=>n._midiInput===t)){let n=this._disconnectedInputs.find(r=>r._midiInput===t);n||(n=new Ze(t)),this._inputs.push(n),e.push(n.open())}}),Promise.all(e)}async _updateOutputs(){if(!this.interface)return;for(let t=this._outputs.length-1;t>=0;t--){const n=this._outputs[t];Array.from(this.interface.outputs.values()).find(s=>s===n._midiOutput)||(this._disconnectedOutputs.push(n),this._outputs.splice(t,1))}let e=[];return this.interface.outputs.forEach(t=>{if(!this._outputs.find(n=>n._midiOutput===t)){let n=this._disconnectedOutputs.find(r=>r._midiOutput===t);n||(n=new be(t)),this._outputs.push(n),e.push(n.open())}}),Promise.all(e)}get enabled(){return this.interface!==null}get inputs(){return this._inputs}get isNode(){return this.validation&&console.warn("WebMidi.isNode has been deprecated. Use Utilities.isNode instead."),c.isNode}get isBrowser(){return this.validation&&console.warn("WebMidi.isBrowser has been deprecated. Use Utilities.isBrowser instead."),c.isBrowser}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get outputs(){return this._outputs}get supported(){return typeof navigator<"u"&&navigator.requestMIDIAccess}get sysexEnabled(){return!!(this.interface&&this.interface.sysexEnabled)}get time(){return performance.now()}get version(){return"3.1.8"}get flavour(){return"esm"}get CHANNEL_EVENTS(){return this.validation&&console.warn("The CHANNEL_EVENTS enum has been moved to Enumerations.CHANNEL_EVENTS."),i.CHANNEL_EVENTS}get MIDI_SYSTEM_MESSAGES(){return this.validation&&console.warn("The MIDI_SYSTEM_MESSAGES enum has been moved to Enumerations.SYSTEM_MESSAGES."),i.SYSTEM_MESSAGES}get MIDI_CHANNEL_MODE_MESSAGES(){return this.validation&&console.warn("The MIDI_CHANNEL_MODE_MESSAGES enum has been moved to Enumerations.CHANNEL_MODE_MESSAGES."),i.CHANNEL_MODE_MESSAGES}get MIDI_CONTROL_CHANGE_MESSAGES(){return this.validation&&console.warn("The MIDI_CONTROL_CHANGE_MESSAGES enum has been replaced by the Enumerations.CONTROL_CHANGE_MESSAGES array."),i.MIDI_CONTROL_CHANGE_MESSAGES}get MIDI_REGISTERED_PARAMETER(){return this.validation&&console.warn("The MIDI_REGISTERED_PARAMETER enum has been moved to Enumerations.REGISTERED_PARAMETERS."),i.REGISTERED_PARAMETERS}get NOTES(){return this.validation&&console.warn("The NOTES enum has been deprecated."),["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]}}const l=new $e;l.constructor=null;function et(o,e){try{const t=e==="local"?window.localStorage:window.sessionStorage;return{data:JSON.parse(t.getItem(o)||"")}}catch(t){return{err:`Failed to retrieve value from storage: ${t}`,code:400}}}function tt(o,e,t){try{return(t==="local"?window.localStorage:window.sessionStorage).setItem(e,JSON.stringify(o)),{data:void 0}}catch(n){return{err:`Failed to store the value: ${n}`,code:400}}}function nt(o,e){const{key:t,storage:n="local"}=e,r=et(t,n);return"data"in r&&r.data?o.set(e.deserialize?e.deserialize(r.data):r.data):"err"in r&&(e!=null&&e.debug)&&console.info(r.err),o.subscribe(s=>{const a=tt(e.serialize?e.serialize(s):s,t,n);"err"in a&&(e!=null&&e.debug)&&console.error(a.err)}),o}const ce=Ne(void 0),ye=nt(Ne([60,84]),{key:"midi-range",storage:"session"}),Se={async openMidi(){return l.enable().then(()=>l.inputs.length>0?(ce.set(l.inputs[0]),{data:l.inputs[0]}):{err:"No MIDI device found.",code:400}).catch(o=>({err:o.toString(),code:403}))},setMidiRange(o){ye.set(o)}},Ge={0:{note:"C",steps:0,sharp:!1,flat:!1},1:{note:"C♯",steps:0,sharp:!0,flat:!1},2:{note:"D",steps:1,sharp:!1,flat:!1},3:{note:"E♭",steps:2,sharp:!1,flat:!0},4:{note:"E",steps:2,sharp:!1,flat:!1},5:{note:"F",steps:3,sharp:!1,flat:!1},6:{note:"F♯",steps:3,sharp:!0,flat:!1},7:{note:"G",steps:4,sharp:!1,flat:!1},8:{note:"G♯",steps:4,sharp:!0,flat:!1},9:{note:"A",steps:5,sharp:!1,flat:!1},10:{note:"B♭",steps:6,sharp:!1,flat:!0},11:{note:"B",steps:6,sharp:!1,flat:!1}};function V(o){const e=o-12,t=Math.floor(e/12),n=Ge[e%12];return{...n,absolute:`${n.note}${t}`}}function rt(o){if(o.length===2||o.length===3){const e=o.slice(0,o.length-1).toUpperCase();let t;try{t=parseInt(o[o.length-1])}catch{return{err:`Couldn't parse note "${o}" octave`,code:400}}const n=Object.values(Ge).findIndex(r=>r.note===e);return n===-1?{err:`Note "${o}" not found in scale`,code:400}:{data:12+t*12+n}}else return{err:`Unrecognized note "${o}"`,code:400}}function De(o){let e,t;return{c(){e=m("div"),t=W(o[2]),this.h()},l(n){e=p(n,"DIV",{class:!0});var r=v(e);t=K(r,o[2]),r.forEach(E),this.h()},h(){g(e,"class","error svelte-al1s46")},m(n,r){k(n,e,r),d(e,t)},p(n,r){r&4&&oe(t,n[2])},d(n){n&&E(e)}}}function st(o){let e,t,n,r="MIDI",s,a,h,u,_="Device",N,b,O,w,U,D,j="Prompt",H,f,S,x="Range",C,P,B,Y,I,le="-",Z,A,y,M,X,F,q="Use MIDI",me,$,we='
',de,pe,Me,G=o[2]&&De(o);return{c(){e=m("div"),t=m("fieldset"),n=m("legend"),n.textContent=r,s=T(),a=m("div"),h=m("div"),u=m("label"),u.textContent=_,N=T(),b=m("input"),w=T(),U=m("div"),D=m("button"),D.textContent=j,H=T(),f=m("div"),S=m("label"),S.textContent=x,C=T(),P=m("div"),B=m("input"),Y=T(),I=m("span"),I.textContent=le,Z=T(),A=m("input"),y=T(),M=m("div"),G&&G.c(),X=T(),F=m("button"),F.textContent=q,me=T(),$=m("div"),$.innerHTML=we,this.h()},l(L){e=p(L,"DIV",{class:!0});var Q=v(e);t=p(Q,"FIELDSET",{class:!0});var ee=v(t);n=p(ee,"LEGEND",{class:!0,"data-svelte-h":!0}),z(n)!=="svelte-dnpakp"&&(n.textContent=r),s=R(ee),a=p(ee,"DIV",{class:!0});var ne=v(a);h=p(ne,"DIV",{class:!0});var re=v(h);u=p(re,"LABEL",{class:!0,for:!0,"data-svelte-h":!0}),z(u)!=="svelte-crpa7y"&&(u.textContent=_),N=R(re),b=p(re,"INPUT",{class:!0,id:!0}),w=R(re),U=p(re,"DIV",{});var Ie=v(U);D=p(Ie,"BUTTON",{class:!0,"data-svelte-h":!0}),z(D)!=="svelte-r53s7o"&&(D.textContent=j),Ie.forEach(E),re.forEach(E),H=R(ne),f=p(ne,"DIV",{class:!0});var se=v(f);S=p(se,"LABEL",{class:!0,for:!0,"data-svelte-h":!0}),z(S)!=="svelte-10u0679"&&(S.textContent=x),C=R(se),P=p(se,"DIV",{class:!0});var ie=v(P);B=p(ie,"INPUT",{class:!0,id:!0}),Y=R(ie),I=p(ie,"SPAN",{class:!0,"data-svelte-h":!0}),z(I)!=="svelte-2j6xs"&&(I.textContent=le),Z=R(ie),A=p(ie,"INPUT",{class:!0,id:!0}),ie.forEach(E),y=R(se),M=p(se,"DIV",{});var he=v(M);G&&G.l(he),X=R(he),F=p(he,"BUTTON",{class:!0,"data-svelte-h":!0}),z(F)!=="svelte-1elgafa"&&(F.textContent=q),he.forEach(E),se.forEach(E),me=R(ne),$=p(ne,"DIV",{class:!0,"data-svelte-h":!0}),z($)!=="svelte-10qluel"&&($.innerHTML=we),ne.forEach(E),ee.forEach(E),Q.forEach(E),this.h()},h(){var L;g(n,"class","px-2 text-0A text-base"),g(u,"class","font-bold"),g(u,"for","device"),g(b,"class","my-1 w-50"),g(b,"id","device"),b.disabled=!0,b.value=O=((L=o[3])==null?void 0:L.name)??"No device",g(D,"class","btn primary"),g(h,"class","flex flex-col"),g(S,"class","font-bold"),g(S,"for","range_min"),g(B,"class","w-10"),g(B,"id","range_min"),g(I,"class","mx-2"),g(A,"class","w-10"),g(A,"id","range_max"),g(P,"class","my-1 flex"),g(F,"class","btn primary"),g(f,"class","flex flex-col"),g($,"class","flex flex-col h-full"),g(a,"class","midi-body svelte-al1s46"),g(t,"class","flex flex-col rounded border-2 px-4 py-2 my-4 text-sm"),g(e,"class",de=Ae(`${o[5].class||""}`)+" svelte-al1s46")},m(L,Q){k(L,e,Q),d(e,t),d(t,n),d(t,s),d(t,a),d(a,h),d(h,u),d(h,N),d(h,b),d(h,w),d(h,U),d(U,D),d(a,H),d(a,f),d(f,S),d(f,C),d(f,P),d(P,B),ue(B,o[0]),d(P,Y),d(P,I),d(P,Z),d(P,A),ue(A,o[1]),d(f,y),d(f,M),G&&G.m(M,null),d(M,X),d(M,F),d(a,me),d(a,$),pe||(Me=[te(D,"click",Se.openMidi),te(B,"input",o[6]),te(B,"change",o[7]),te(A,"input",o[8]),te(A,"change",o[9]),te(F,"click",it)],pe=!0)},p(L,[Q]){var ee;Q&8&&O!==(O=((ee=L[3])==null?void 0:ee.name)??"No device")&&b.value!==O&&(b.value=O),Q&1&&B.value!==L[0]&&ue(B,L[0]),Q&2&&A.value!==L[1]&&ue(A,L[1]),L[2]?G?G.p(L,Q):(G=De(L),G.c(),G.m(M,X)):G&&(G.d(1),G=null),Q&32&&de!==(de=Ae(`${L[5].class||""}`)+" svelte-al1s46")&&g(e,"class",de)},i:Ee,o:Ee,d(L){L&&E(e),G&&G.d(),pe=!1,Fe(Me)}}}function it(){}function at(o,e,t){let n,r;ge(o,ye,w=>t(10,n=w)),ge(o,ce,w=>t(3,r=w));let s=V(n[0]).absolute,a=V(n[1]).absolute,h="";function u(w,U){const D=rt(U.currentTarget.value);if("data"in D){const j=n,H=[w==="min"?D.data:j[0],w==="max"?D.data:j[1]];Se.setMidiRange(H),t(2,h="")}else t(2,h=D.err),w==="min"?t(0,s=V(n[0]).absolute):t(1,a=V(n[1]).absolute)}function _(){s=this.value,t(0,s)}const N=w=>u("min",w);function b(){a=this.value,t(1,a)}const O=w=>u("max",w);return o.$$set=w=>{t(5,e=ve(ve({},e),Ce(w)))},e=Ce(e),[s,a,h,r,u,e,_,N,b,O]}class ot extends Ue{constructor(e){super(),xe(this,e,at,st,Le,{})}}class lt{constructor(e){fe(this,"notes");fe(this,"correct",0);fe(this,"idx",0);this.notes=e}get current(){return this.notes[this.idx]}get ended(){return this.notes.length===this.idx+1}guess(e){const t=this.current===e;return t&&(this.correct+=1),this.idx+=1,t}next(){this.idx+=1}}const _e=Ne(void 0),ct={playGuessNotes(o=10){const e=[],t=Ve(ye);console.log("range",t);for(let r=0;r0&&Be(o);return{c(){e=m("div"),t&&t.c(),this.h()},l(n){e=p(n,"DIV",{class:!0});var r=v(e);t&&t.l(r),r.forEach(E),this.h()},h(){g(e,"class","objective svelte-17gk9sj")},m(n,r){k(n,e,r),t&&t.m(e,null)},p(n,r){n[3]>0?t?t.p(n,r):(t=Be(n),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(n){n&&E(e),t&&t.d()}}}function ft(o){let e;function t(s,a){if(s[4]==="correct"||s[4]==="wrong")return mt;if(s[4]==="ended")return ut}let n=t(o),r=n&&n(o);return{c(){e=m("div"),r&&r.c(),this.h()},l(s){e=p(s,"DIV",{class:!0});var a=v(e);r&&r.l(a),a.forEach(E),this.h()},h(){g(e,"class","objective svelte-17gk9sj")},m(s,a){k(s,e,a),r&&r.m(e,null)},p(s,a){n===(n=t(s))&&r?r.p(s,a):(r&&r.d(1),r=n&&n(s),r&&(r.c(),r.m(e,null)))},d(s){s&&E(e),r&&r.d()}}}function Be(o){let e,t,n=V(o[3]).absolute+"",r;return{c(){e=m("div"),t=W("Played: "),r=W(n)},l(s){e=p(s,"DIV",{});var a=v(e);t=K(a,"Played: "),r=K(a,n),a.forEach(E)},m(s,a){k(s,e,a),d(e,t),d(e,r)},p(s,a){a&8&&n!==(n=V(s[3]).absolute+"")&&oe(r,n)},d(s){s&&E(e)}}}function ut(o){let e,t,n=o[5].correct+"",r,s,a=o[5].notes.length+"",h;return{c(){e=m("div"),t=W("Result: "),r=W(n),s=W(" / "),h=W(a)},l(u){e=p(u,"DIV",{});var _=v(e);t=K(_,"Result: "),r=K(_,n),s=K(_," / "),h=K(_,a),_.forEach(E)},m(u,_){k(u,e,_),d(e,t),d(e,r),d(e,s),d(e,h)},p(u,_){_&32&&n!==(n=u[5].correct+"")&&oe(r,n),_&32&&a!==(a=u[5].notes.length+"")&&oe(h,a)},d(u){u&&E(e)}}}function mt(o){let e,t,n=V(o[2]).absolute+"",r,s,a,h,u=V(o[3]).absolute+"",_;return{c(){e=m("div"),t=W("Target: "),r=W(n),s=T(),a=m("div"),h=W("Played: "),_=W(u),this.h()},l(N){e=p(N,"DIV",{});var b=v(e);t=K(b,"Target: "),r=K(b,n),b.forEach(E),s=R(N),a=p(N,"DIV",{class:!0});var O=v(a);h=K(O,"Played: "),_=K(O,u),O.forEach(E),this.h()},h(){g(a,"class","ml-8")},m(N,b){k(N,e,b),d(e,t),d(e,r),k(N,s,b),k(N,a,b),d(a,h),d(a,_)},p(N,b){b&4&&n!==(n=V(N[2]).absolute+"")&&oe(r,n),b&8&&u!==(u=V(N[3]).absolute+"")&&oe(_,u)},d(N){N&&(E(e),E(s),E(a))}}}function pt(o){let e,t="Practise Music Reading",n,r,s,a,h,u,_,N,b,O="𝄞",w,U,D="𝄚",j,H,f,S,x,C,P='𝄢 𝄚',B,Y;s=new ot({});let I=ce&&dt(o);function le(y,M){return y[5]?ft:ht}let Z=le(o),A=Z(o);return{c(){e=m("h1"),e.textContent=t,n=T(),r=m("section"),je(s.$$.fragment),a=T(),I&&I.c(),h=T(),u=m("section"),_=m("section"),N=m("div"),b=m("span"),b.textContent=O,w=T(),U=m("span"),U.textContent=D,j=T(),H=m("span"),f=T(),S=m("span"),x=T(),C=m("div"),C.innerHTML=P,B=T(),A.c(),this.h()},l(y){e=p(y,"H1",{class:!0,"data-svelte-h":!0}),z(e)!=="svelte-a40moj"&&(e.textContent=t),n=R(y),r=p(y,"SECTION",{});var M=v(r);Ye(s.$$.fragment,M),a=R(M),I&&I.l(M),M.forEach(E),h=R(y),u=p(y,"SECTION",{class:!0});var X=v(u);_=p(X,"SECTION",{class:!0});var F=v(_);N=p(F,"DIV",{class:!0});var q=v(N);b=p(q,"SPAN",{class:!0,"data-svelte-h":!0}),z(b)!=="svelte-19670ev"&&(b.textContent=O),w=R(q),U=p(q,"SPAN",{class:!0,"data-svelte-h":!0}),z(U)!=="svelte-1redxk9"&&(U.textContent=D),j=R(q),H=p(q,"SPAN",{class:!0}),v(H).forEach(E),f=R(q),S=p(q,"SPAN",{class:!0}),v(S).forEach(E),q.forEach(E),x=R(F),C=p(F,"DIV",{class:!0,"data-svelte-h":!0}),z(C)!=="svelte-6r9gri"&&(C.innerHTML=P),F.forEach(E),B=R(X),A.l(X),X.forEach(E),this.h()},h(){g(e,"class","font-cursive my-8 text-3xl md:text-5xl mt-12 tracking-tight"),g(b,"class","g-clef svelte-17gk9sj"),g(U,"class","staff svelte-17gk9sj"),g(H,"class","note target svelte-17gk9sj"),g(S,"class","note played svelte-17gk9sj"),g(N,"class","line svelte-17gk9sj"),g(C,"class","line svelte-17gk9sj"),g(_,"class","pt-8 score svelte-17gk9sj"),g(u,"class","pl-2")},m(y,M){k(y,e,M),k(y,n,M),k(y,r,M),qe(s,r,null),d(r,a),I&&I.m(r,null),k(y,h,M),k(y,u,M),d(u,_),d(_,N),d(N,b),d(N,w),d(N,U),d(N,j),d(N,H),o[7](H),d(N,f),d(N,S),o[8](S),d(_,x),d(_,C),d(u,B),A.m(u,null),Y=!0},p(y,[M]){ce&&I.p(y,M),Z===(Z=le(y))&&A?A.p(y,M):(A.d(1),A=Z(y),A&&(A.c(),A.m(u,null)))},i(y){Y||(We(s.$$.fragment,y),Y=!0)},o(y){Ke(s.$$.fragment,y),Y=!1},d(y){y&&(E(e),E(n),E(r),E(h),E(u)),Je(s),I&&I.d(),o[7](null),o[8](null),A.d()}}}function Et(o,e,t){let n;ge(o,_e,f=>t(5,n=f));let r,s,a=0,h=0,u,_;ze(()=>{U()}),ce.subscribe(f=>{f&&f.channels[1].addListener("noteon",N)});function N(f){if(u)return;console.log("noteon",f);const x=f.rawData[1];if(!n)b(x);else{t(2,a=n.current);const C=n.guess(x);t(4,_=C?"correct":"wrong"),b(x,C),u=setTimeout(()=>{n!=null&&n.ended?(O(),t(4,_="ended")):n&&(O(n.current),t(4,_="waiting")),b(),u=void 0},2e3)}}function b(f,S){if(f===void 0)t(0,r.style.display="none",r),r.classList.remove("correct"),r.classList.remove("wrong"),t(3,h=0);else{const x=V(f),C=w("g",f);console.log(`played note ${f} pos ${C}`),t(0,r.style.bottom=`${C}rem`,r),t(0,r.style.display="block",r),t(0,r.textContent=`${x.flat?"♭":x.sharp?"♯":""}𝅝`,r),S?(r.classList.remove("wrong"),r.classList.add("correct")):(r.classList.remove("correct"),r.classList.add("wrong")),t(3,h=f)}}function O(f){if(f===void 0)t(1,s.style.display="none",s),t(2,a=0);else{console.log(`hey new target note ${f}`);const S=V(f),x=w("g",f);t(1,s.style.bottom=`${x}rem`,s),t(1,s.style.display="block",s),t(1,s.textContent=`${S.flat?"♭":S.sharp?"♯":""}𝅝`,s)}}function w(f,S){const C=.41809090909,P=S-60,B=V(S),Y=Math.floor(Math.abs(P)/12);if(f==="f")return .5+C*(S-50);if(f==="g"){let I;return P>=0?I=Y*7+B.steps:I=-1*(Y*7+B.steps===0?0:7-B.steps),console.log(`steps ${I}`),-1.2+C*I}else console.warn("Unrecognized clef: ",f)}async function U(){const f=await Se.openMidi();"data"in f?f.data.name:f.err}function D(){const f=ct.playGuessNotes();O(f.current),b()}function j(f){Te[f?"unshift":"push"](()=>{s=f,t(1,s)})}function H(f){Te[f?"unshift":"push"](()=>{r=f,t(0,r)})}return[r,s,a,h,_,n,D,j,H]}class yt extends Ue{constructor(e){super(),xe(this,e,Et,pt,Le,{})}}export{yt as component}; + `)()}}if(this.validation=e.validation!==!1,this.validation&&(typeof e=="function"&&(e={callback:e,sysex:t}),t&&(e.sysex=!0)),this.enabled)return typeof e.callback=="function"&&e.callback(),Promise.resolve();const n={timestamp:this.time,target:this,type:"error",error:void 0},r={timestamp:this.time,target:this,type:"midiaccessgranted"},s={timestamp:this.time,target:this,type:"enabled"};try{typeof e.requestMIDIAccessFunction=="function"?this.interface=await e.requestMIDIAccessFunction({sysex:e.sysex,software:e.software}):this.interface=await navigator.requestMIDIAccess({sysex:e.sysex,software:e.software})}catch(a){return n.error=a,this.emit("error",n),typeof e.callback=="function"&&e.callback(a),Promise.reject(a)}this.emit("midiaccessgranted",r),this.interface.onstatechange=this._onInterfaceStateChange.bind(this);try{await this._updateInputsAndOutputs()}catch(a){return n.error=a,this.emit("error",n),typeof e.callback=="function"&&e.callback(a),Promise.reject(a)}return this.emit("enabled",s),typeof e.callback=="function"&&e.callback(),Promise.resolve(this)}async disable(){return this.interface&&(this.interface.onstatechange=void 0),this._destroyInputsAndOutputs().then(()=>{navigator&&typeof navigator.close=="function"&&navigator.close(),this.interface=null;let e={timestamp:this.time,target:this,type:"disabled"};this.emit("disabled",e),this.removeListener()})}getInputById(e,t={disconnected:!1}){if(this.validation){if(!this.enabled)throw new Error("WebMidi is not enabled.");if(!e)return}if(t.disconnected){for(let n=0;n=0&&e<=127?c.getNoteDetails(c.offsetNumber(e,this.octaveOffset)).octave:!1}sanitizeChannels(e){return this.validation&&console.warn("The sanitizeChannels() method has been moved to the utilities class."),c.sanitizeChannels(e)}toMIDIChannels(e){return this.validation&&console.warn("The toMIDIChannels() method has been deprecated. Use Utilities.sanitizeChannels() instead."),c.sanitizeChannels(e)}guessNoteNumber(e){return this.validation&&console.warn("The guessNoteNumber() method has been deprecated. Use Utilities.guessNoteNumber() instead."),c.guessNoteNumber(e,this.octaveOffset)}getValidNoteArray(e,t={}){return this.validation&&console.warn("The getValidNoteArray() method has been moved to the Utilities.buildNoteArray()"),c.buildNoteArray(e,t)}convertToTimestamp(e){return this.validation&&console.warn("The convertToTimestamp() method has been moved to Utilities.toTimestamp()."),c.toTimestamp(e)}async _destroyInputsAndOutputs(){let e=[];return this.inputs.forEach(t=>e.push(t.destroy())),this.outputs.forEach(t=>e.push(t.destroy())),Promise.all(e).then(()=>{this._inputs=[],this._outputs=[]})}_onInterfaceStateChange(e){this._updateInputsAndOutputs();let t={timestamp:e.timeStamp,type:e.port.state,target:this};if(e.port.state==="connected"&&e.port.connection==="open"){e.port.type==="output"?t.port=this.getOutputById(e.port.id):e.port.type==="input"&&(t.port=this.getInputById(e.port.id)),this.emit(e.port.state,t);const n=Object.assign({},t);n.type="portschanged",this.emit(n.type,n)}else if(e.port.state==="disconnected"&&e.port.connection==="pending"){e.port.type==="input"?t.port=this.getInputById(e.port.id,{disconnected:!0}):e.port.type==="output"&&(t.port=this.getOutputById(e.port.id,{disconnected:!0})),this.emit(e.port.state,t);const n=Object.assign({},t);n.type="portschanged",this.emit(n.type,n)}}async _updateInputsAndOutputs(){return Promise.all([this._updateInputs(),this._updateOutputs()])}async _updateInputs(){if(!this.interface)return;for(let t=this._inputs.length-1;t>=0;t--){const n=this._inputs[t];Array.from(this.interface.inputs.values()).find(s=>s===n._midiInput)||(this._disconnectedInputs.push(n),this._inputs.splice(t,1))}let e=[];return this.interface.inputs.forEach(t=>{if(!this._inputs.find(n=>n._midiInput===t)){let n=this._disconnectedInputs.find(r=>r._midiInput===t);n||(n=new $e(t)),this._inputs.push(n),e.push(n.open())}}),Promise.all(e)}async _updateOutputs(){if(!this.interface)return;for(let t=this._outputs.length-1;t>=0;t--){const n=this._outputs[t];Array.from(this.interface.outputs.values()).find(s=>s===n._midiOutput)||(this._disconnectedOutputs.push(n),this._outputs.splice(t,1))}let e=[];return this.interface.outputs.forEach(t=>{if(!this._outputs.find(n=>n._midiOutput===t)){let n=this._disconnectedOutputs.find(r=>r._midiOutput===t);n||(n=new be(t)),this._outputs.push(n),e.push(n.open())}}),Promise.all(e)}get enabled(){return this.interface!==null}get inputs(){return this._inputs}get isNode(){return this.validation&&console.warn("WebMidi.isNode has been deprecated. Use Utilities.isNode instead."),c.isNode}get isBrowser(){return this.validation&&console.warn("WebMidi.isBrowser has been deprecated. Use Utilities.isBrowser instead."),c.isBrowser}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get outputs(){return this._outputs}get supported(){return typeof navigator<"u"&&navigator.requestMIDIAccess}get sysexEnabled(){return!!(this.interface&&this.interface.sysexEnabled)}get time(){return performance.now()}get version(){return"3.1.8"}get flavour(){return"esm"}get CHANNEL_EVENTS(){return this.validation&&console.warn("The CHANNEL_EVENTS enum has been moved to Enumerations.CHANNEL_EVENTS."),i.CHANNEL_EVENTS}get MIDI_SYSTEM_MESSAGES(){return this.validation&&console.warn("The MIDI_SYSTEM_MESSAGES enum has been moved to Enumerations.SYSTEM_MESSAGES."),i.SYSTEM_MESSAGES}get MIDI_CHANNEL_MODE_MESSAGES(){return this.validation&&console.warn("The MIDI_CHANNEL_MODE_MESSAGES enum has been moved to Enumerations.CHANNEL_MODE_MESSAGES."),i.CHANNEL_MODE_MESSAGES}get MIDI_CONTROL_CHANGE_MESSAGES(){return this.validation&&console.warn("The MIDI_CONTROL_CHANGE_MESSAGES enum has been replaced by the Enumerations.CONTROL_CHANGE_MESSAGES array."),i.MIDI_CONTROL_CHANGE_MESSAGES}get MIDI_REGISTERED_PARAMETER(){return this.validation&&console.warn("The MIDI_REGISTERED_PARAMETER enum has been moved to Enumerations.REGISTERED_PARAMETERS."),i.REGISTERED_PARAMETERS}get NOTES(){return this.validation&&console.warn("The NOTES enum has been deprecated."),["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]}}const l=new et;l.constructor=null;function tt(o,e){try{const t=e==="local"?window.localStorage:window.sessionStorage;return{data:JSON.parse(t.getItem(o)||"")}}catch(t){return{err:`Failed to retrieve value from storage: ${t}`,code:400}}}function nt(o,e,t){try{return(t==="local"?window.localStorage:window.sessionStorage).setItem(e,JSON.stringify(o)),{data:void 0}}catch(n){return{err:`Failed to store the value: ${n}`,code:400}}}function rt(o,e){const{key:t,storage:n="local"}=e,r=tt(t,n);return"data"in r&&r.data?o.set(e.deserialize?e.deserialize(r.data):r.data):"err"in r&&(e!=null&&e.debug)&&console.info(r.err),o.subscribe(s=>{const a=nt(e.serialize?e.serialize(s):s,t,n);"err"in a&&(e!=null&&e.debug)&&console.error(a.err)}),o}const ce=Ne(void 0),ye=rt(Ne([60,84]),{key:"midi-range",storage:"session"}),Se={async openMidi(){return l.enable().then(()=>l.inputs.length>0?(ce.set(l.inputs[0]),{data:l.inputs[0]}):{err:"No MIDI device found.",code:400}).catch(o=>({err:o.toString(),code:403}))},setMidiRange(o){ye.set(o)}},He={0:{note:"C",steps:0,sharp:!1,flat:!1},1:{note:"C♯",steps:0,sharp:!0,flat:!1},2:{note:"D",steps:1,sharp:!1,flat:!1},3:{note:"E♭",steps:2,sharp:!1,flat:!0},4:{note:"E",steps:2,sharp:!1,flat:!1},5:{note:"F",steps:3,sharp:!1,flat:!1},6:{note:"F♯",steps:3,sharp:!0,flat:!1},7:{note:"G",steps:4,sharp:!1,flat:!1},8:{note:"G♯",steps:4,sharp:!0,flat:!1},9:{note:"A",steps:5,sharp:!1,flat:!1},10:{note:"B♭",steps:6,sharp:!1,flat:!0},11:{note:"B",steps:6,sharp:!1,flat:!1}};function j(o){const e=o-12,t=Math.floor(e/12),n=He[e%12];return{...n,absolute:`${n.note}${t}`}}function st(o){if(o.length===2||o.length===3){const e=o.slice(0,o.length-1).toUpperCase();let t;try{t=parseInt(o[o.length-1])}catch{return{err:`Couldn't parse note "${o}" octave`,code:400}}const n=Object.values(He).findIndex(r=>r.note===e);return n===-1?{err:`Note "${o}" not found in scale`,code:400}:{data:12+t*12+n}}else return{err:`Unrecognized note "${o}"`,code:400}}function De(o){let e,t;return{c(){e=p("div"),t=W(o[2]),this.h()},l(n){e=E(n,"DIV",{class:!0});var r=v(e);t=K(r,o[2]),r.forEach(b),this.h()},h(){_(e,"class","error svelte-5m5dii")},m(n,r){V(n,e,r),h(e,t)},p(n,r){r&4&&le(t,n[2])},d(n){n&&b(e)}}}function it(o){let e,t,n,r="MIDI",s,a,f,g,N="Device",m,u,O,y,w,D,H="Prompt",P,I,d,C="Range",M,T,G,Y,L,Q="-",ee,R,S,A,Z,z,q="Use MIDI",me,te,we='
',de,pe,Me,k=o[2]&&De(o);return{c(){e=p("div"),t=p("fieldset"),n=p("legend"),n.textContent=r,s=B(),a=p("div"),f=p("div"),g=p("label"),g.textContent=N,m=B(),u=p("input"),y=B(),w=p("div"),D=p("button"),D.textContent=H,P=B(),I=p("div"),d=p("label"),d.textContent=C,M=B(),T=p("div"),G=p("input"),Y=B(),L=p("span"),L.textContent=Q,ee=B(),R=p("input"),S=B(),A=p("div"),k&&k.c(),Z=B(),z=p("button"),z.textContent=q,me=B(),te=p("div"),te.innerHTML=we,this.h()},l(U){e=E(U,"DIV",{class:!0});var X=v(e);t=E(X,"FIELDSET",{class:!0});var ne=v(t);n=E(ne,"LEGEND",{class:!0,"data-svelte-h":!0}),F(n)!=="svelte-dnpakp"&&(n.textContent=r),s=x(ne),a=E(ne,"DIV",{class:!0});var re=v(a);f=E(re,"DIV",{class:!0});var se=v(f);g=E(se,"LABEL",{class:!0,for:!0,"data-svelte-h":!0}),F(g)!=="svelte-crpa7y"&&(g.textContent=N),m=x(se),u=E(se,"INPUT",{class:!0,id:!0}),y=x(se),w=E(se,"DIV",{});var Ie=v(w);D=E(Ie,"BUTTON",{class:!0,"data-svelte-h":!0}),F(D)!=="svelte-r53s7o"&&(D.textContent=H),Ie.forEach(b),se.forEach(b),P=x(re),I=E(re,"DIV",{class:!0});var ie=v(I);d=E(ie,"LABEL",{class:!0,for:!0,"data-svelte-h":!0}),F(d)!=="svelte-10u0679"&&(d.textContent=C),M=x(ie),T=E(ie,"DIV",{class:!0});var ae=v(T);G=E(ae,"INPUT",{class:!0,id:!0}),Y=x(ae),L=E(ae,"SPAN",{class:!0,"data-svelte-h":!0}),F(L)!=="svelte-2j6xs"&&(L.textContent=Q),ee=x(ae),R=E(ae,"INPUT",{class:!0,id:!0}),ae.forEach(b),S=x(ie),A=E(ie,"DIV",{});var he=v(A);k&&k.l(he),Z=x(he),z=E(he,"BUTTON",{class:!0,"data-svelte-h":!0}),F(z)!=="svelte-1elgafa"&&(z.textContent=q),he.forEach(b),ie.forEach(b),me=x(re),te=E(re,"DIV",{class:!0,"data-svelte-h":!0}),F(te)!=="svelte-10qluel"&&(te.innerHTML=we),re.forEach(b),ne.forEach(b),X.forEach(b),this.h()},h(){var U;_(n,"class","px-2 text-0A text-base"),_(g,"class","font-bold"),_(g,"for","device"),_(u,"class","my-1 w-50"),_(u,"id","device"),u.disabled=!0,u.value=O=((U=o[3])==null?void 0:U.name)??"No device",_(D,"class","btn primary"),_(f,"class","flex flex-col"),_(d,"class","font-bold"),_(d,"for","range_min"),_(G,"class","w-10"),_(G,"id","range_min"),_(L,"class","mx-2"),_(R,"class","w-10"),_(R,"id","range_max"),_(T,"class","my-1 flex"),_(z,"class","btn primary"),_(I,"class","flex flex-col"),_(te,"class","flex flex-col h-full"),_(a,"class","midi-body svelte-5m5dii"),_(t,"class","flex flex-col rounded border-2 px-4 py-2 my-4 text-sm"),_(e,"class",de=ve(`${o[5].class||""}`)+" svelte-5m5dii")},m(U,X){V(U,e,X),h(e,t),h(t,n),h(t,s),h(t,a),h(a,f),h(f,g),h(f,m),h(f,u),h(f,y),h(f,w),h(w,D),h(a,P),h(a,I),h(I,d),h(I,M),h(I,T),h(T,G),ue(G,o[0]),h(T,Y),h(T,L),h(T,ee),h(T,R),ue(R,o[1]),h(I,S),h(I,A),k&&k.m(A,null),h(A,Z),h(A,z),h(a,me),h(a,te),pe||(Me=[$(D,"click",Se.openMidi),$(G,"input",o[6]),$(G,"change",o[7]),$(R,"input",o[8]),$(R,"change",o[9]),$(z,"click",at)],pe=!0)},p(U,[X]){var ne;X&8&&O!==(O=((ne=U[3])==null?void 0:ne.name)??"No device")&&u.value!==O&&(u.value=O),X&1&&G.value!==U[0]&&ue(G,U[0]),X&2&&R.value!==U[1]&&ue(R,U[1]),U[2]?k?k.p(U,X):(k=De(U),k.c(),k.m(A,Z)):k&&(k.d(1),k=null),X&32&&de!==(de=ve(`${U[5].class||""}`)+" svelte-5m5dii")&&_(e,"class",de)},i:Ee,o:Ee,d(U){U&&b(e),k&&k.d(),pe=!1,Ue(Me)}}}function at(){}function ot(o,e,t){let n,r;ge(o,ye,y=>t(10,n=y)),ge(o,ce,y=>t(3,r=y));let s=j(n[0]).absolute,a=j(n[1]).absolute,f="";function g(y,w){const D=st(w.currentTarget.value);if("data"in D){const H=n,P=[y==="min"?D.data:H[0],y==="max"?D.data:H[1]];Se.setMidiRange(P),t(2,f="")}else t(2,f=D.err),y==="min"?t(0,s=j(n[0]).absolute):t(1,a=j(n[1]).absolute)}function N(){s=this.value,t(0,s)}const m=y=>g("min",y);function u(){a=this.value,t(1,a)}const O=y=>g("max",y);return o.$$set=y=>{t(5,e=Ae(Ae({},e),Ce(y)))},e=Ce(e),[s,a,f,r,g,e,N,m,u,O]}class lt extends Pe{constructor(e){super(),Ge(this,e,ot,it,Le,{})}}class ct{constructor(e){fe(this,"notes");fe(this,"correct",0);fe(this,"idx",0);this.notes=e}get current(){return this.notes[this.idx]}get ended(){return this.notes.length===this.idx+1}guess(e){const t=this.current===e;return t&&(this.correct+=1),this.idx+=1,t}next(){this.idx+=1}}const _e=Ne(void 0),Be={playGuessNotes(o=10){const e=[],t=ze(ye);console.log("range",t);for(let r=0;r0&&xe(o);return{c(){e=p("div"),t&&t.c(),this.h()},l(n){e=E(n,"DIV",{class:!0});var r=v(e);t&&t.l(r),r.forEach(b),this.h()},h(){_(e,"class","objective svelte-5792x8")},m(n,r){V(n,e,r),t&&t.m(e,null)},p(n,r){n[3]>0?t?t.p(n,r):(t=xe(n),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(n){n&&b(e),t&&t.d()}}}function ft(o){let e;function t(s,a){if(s[4]==="correct"||s[4]==="wrong")return mt;if(s[4]==="ended")return ut}let n=t(o),r=n&&n(o);return{c(){e=p("div"),r&&r.c(),this.h()},l(s){e=E(s,"DIV",{class:!0});var a=v(e);r&&r.l(a),a.forEach(b),this.h()},h(){_(e,"class","objective svelte-5792x8")},m(s,a){V(s,e,a),r&&r.m(e,null)},p(s,a){n===(n=t(s))&&r?r.p(s,a):(r&&r.d(1),r=n&&n(s),r&&(r.c(),r.m(e,null)))},d(s){s&&b(e),r&&r.d()}}}function xe(o){let e,t,n=j(o[3]).absolute+"",r;return{c(){e=p("div"),t=W("Played: "),r=W(n)},l(s){e=E(s,"DIV",{});var a=v(e);t=K(a,"Played: "),r=K(a,n),a.forEach(b)},m(s,a){V(s,e,a),h(e,t),h(e,r)},p(s,a){a&8&&n!==(n=j(s[3]).absolute+"")&&le(r,n)},d(s){s&&b(e)}}}function ut(o){let e,t,n,r=o[5].correct+"",s,a,f=o[5].notes.length+"",g,N,m,u,O="Try Again",y,w,D="Clear",H,P;return{c(){e=p("div"),t=p("div"),n=W("Result: "),s=W(r),a=W(" / "),g=W(f),N=B(),m=p("div"),u=p("button"),u.textContent=O,y=B(),w=p("button"),w.textContent=D,this.h()},l(I){e=E(I,"DIV",{});var d=v(e);t=E(d,"DIV",{});var C=v(t);n=K(C,"Result: "),s=K(C,r),a=K(C," / "),g=K(C,f),C.forEach(b),N=x(d),m=E(d,"DIV",{});var M=v(m);u=E(M,"BUTTON",{class:!0,"data-svelte-h":!0}),F(u)!=="svelte-16ds756"&&(u.textContent=O),y=x(M),w=E(M,"BUTTON",{class:!0,"data-svelte-h":!0}),F(w)!=="svelte-11mnk9v"&&(w.textContent=D),M.forEach(b),d.forEach(b),this.h()},h(){_(u,"class","btn primary"),_(w,"class","btn primary")},m(I,d){V(I,e,d),h(e,t),h(t,n),h(t,s),h(t,a),h(t,g),h(e,N),h(e,m),h(m,u),h(m,y),h(m,w),H||(P=[$(u,"click",o[6]),$(w,"click",o[7])],H=!0)},p(I,d){d&32&&r!==(r=I[5].correct+"")&&le(s,r),d&32&&f!==(f=I[5].notes.length+"")&&le(g,f)},d(I){I&&b(e),H=!1,Ue(P)}}}function mt(o){let e,t,n=j(o[2]).absolute+"",r,s,a,f,g=j(o[3]).absolute+"",N;return{c(){e=p("div"),t=W("Target: "),r=W(n),s=B(),a=p("div"),f=W("Played: "),N=W(g),this.h()},l(m){e=E(m,"DIV",{});var u=v(e);t=K(u,"Target: "),r=K(u,n),u.forEach(b),s=x(m),a=E(m,"DIV",{class:!0});var O=v(a);f=K(O,"Played: "),N=K(O,g),O.forEach(b),this.h()},h(){_(a,"class","ml-8")},m(m,u){V(m,e,u),h(e,t),h(e,r),V(m,s,u),V(m,a,u),h(a,f),h(a,N)},p(m,u){u&4&&n!==(n=j(m[2]).absolute+"")&&le(r,n),u&8&&g!==(g=j(m[3]).absolute+"")&&le(N,g)},d(m){m&&(b(e),b(s),b(a))}}}function pt(o){let e,t="Practise Music Reading",n,r,s,a,f,g,N,m,u,O="𝄞",y,w,D="𝄚",H,P,I,d,C,M,T='𝄢 𝄚',G,Y;s=new lt({});let L=ce&&dt(o);function Q(S,A){return S[5]?ft:ht}let ee=Q(o),R=ee(o);return{c(){e=p("h1"),e.textContent=t,n=B(),r=p("section"),Ye(s.$$.fragment),a=B(),L&&L.c(),f=B(),g=p("section"),N=p("section"),m=p("div"),u=p("span"),u.textContent=O,y=B(),w=p("span"),w.textContent=D,H=B(),P=p("span"),I=B(),d=p("span"),C=B(),M=p("div"),M.innerHTML=T,G=B(),R.c(),this.h()},l(S){e=E(S,"H1",{class:!0,"data-svelte-h":!0}),F(e)!=="svelte-4znfng"&&(e.textContent=t),n=x(S),r=E(S,"SECTION",{class:!0});var A=v(r);qe(s.$$.fragment,A),a=x(A),L&&L.l(A),A.forEach(b),f=x(S),g=E(S,"SECTION",{});var Z=v(g);N=E(Z,"SECTION",{class:!0});var z=v(N);m=E(z,"DIV",{class:!0});var q=v(m);u=E(q,"SPAN",{class:!0,"data-svelte-h":!0}),F(u)!=="svelte-19670ev"&&(u.textContent=O),y=x(q),w=E(q,"SPAN",{class:!0,"data-svelte-h":!0}),F(w)!=="svelte-1redxk9"&&(w.textContent=D),H=x(q),P=E(q,"SPAN",{class:!0}),v(P).forEach(b),I=x(q),d=E(q,"SPAN",{class:!0}),v(d).forEach(b),q.forEach(b),C=x(z),M=E(z,"DIV",{class:!0,"data-svelte-h":!0}),F(M)!=="svelte-6r9gri"&&(M.innerHTML=T),z.forEach(b),G=x(Z),R.l(Z),Z.forEach(b),this.h()},h(){_(e,"class","my-8 md:text-5xl mt-12 px-4 md:px-0 text-3xl font-cursive tracking-tight"),_(r,"class","px-4 md:px-0"),_(u,"class","g-clef svelte-5792x8"),_(w,"class","staff svelte-5792x8"),_(P,"class","note target svelte-5792x8"),_(d,"class","note played svelte-5792x8"),_(m,"class","line svelte-5792x8"),_(M,"class","line svelte-5792x8"),_(N,"class","pt-12 pb-8 ml-[-0.5rem] md:ml-[-1.6rem] score svelte-5792x8")},m(S,A){V(S,e,A),V(S,n,A),V(S,r,A),We(s,r,null),h(r,a),L&&L.m(r,null),V(S,f,A),V(S,g,A),h(g,N),h(N,m),h(m,u),h(m,y),h(m,w),h(m,H),h(m,P),o[8](P),h(m,I),h(m,d),o[9](d),h(N,C),h(N,M),h(g,G),R.m(g,null),Y=!0},p(S,[A]){ce&&L.p(S,A),ee===(ee=Q(S))&&R?R.p(S,A):(R.d(1),R=ee(S),R&&(R.c(),R.m(g,null)))},i(S){Y||(Ke(s.$$.fragment,S),Y=!0)},o(S){Je(s.$$.fragment,S),Y=!1},d(S){S&&(b(e),b(n),b(r),b(f),b(g)),Qe(s),L&&L.d(),o[8](null),o[9](null),R.d()}}}function Et(o,e,t){let n;ge(o,_e,d=>t(5,n=d));let r,s,a=0,f=0,g,N;je(()=>{w()}),ce.subscribe(d=>{d&&d.channels[1].addListener("noteon",m)});function m(d){if(g)return;console.log("noteon",d);const M=d.rawData[1];if(!n)u(M);else{t(2,a=n.current);const T=n.guess(M);t(4,N=T?"correct":"wrong"),u(M,T),g=setTimeout(()=>{n!=null&&n.ended?(O(),t(4,N="ended")):n&&(O(n.current),t(4,N="waiting")),u(),g=void 0},2e3)}}function u(d,C){if(d===void 0)t(0,r.style.display="none",r),r.classList.remove("correct"),r.classList.remove("wrong"),t(3,f=0);else{const M=j(d),T=y("g",d);console.log(`played note ${d} pos ${T}`),t(0,r.style.bottom=`${T}rem`,r),t(0,r.style.display="block",r),t(0,r.textContent=`${M.flat?"♭":M.sharp?"♯":""}𝅝`,r),C?(r.classList.remove("wrong"),r.classList.add("correct")):(r.classList.remove("correct"),r.classList.add("wrong")),t(3,f=d)}}function O(d){if(d===void 0)t(1,s.style.display="none",s),t(2,a=0);else{console.log(`hey new target note ${d}`);const C=j(d),M=y("g",d);t(1,s.style.bottom=`${M}rem`,s),t(1,s.style.display="block",s),t(1,s.textContent=`${C.flat?"♭":C.sharp?"♯":""}𝅝`,s)}}function y(d,C){const T=.41809090909,G=C-60,Y=j(C),L=Math.floor(Math.abs(G)/12);if(d==="f")return .5+T*(C-50);if(d==="g"){let Q;return G>=0?Q=L*7+Y.steps:Q=-1*(L*7+Y.steps===0?0:7-Y.steps),console.log(`steps ${Q}`),-1.2+T*Q}else console.warn("Unrecognized clef: ",d)}async function w(){const d=await Se.openMidi();"data"in d?d.data.name:d.err}function D(){t(4,N="waiting");const d=Be.playGuessNotes();O(d.current),u()}function H(){t(4,N="waiting"),Be.clearGame()}function P(d){Te[d?"unshift":"push"](()=>{s=d,t(1,s)})}function I(d){Te[d?"unshift":"push"](()=>{r=d,t(0,r)})}return[r,s,a,f,N,n,D,H,P,I]}class yt extends Pe{constructor(e){super(),Ge(this,e,Et,pt,Le,{})}}export{yt as component}; diff --git a/_app/version.json b/_app/version.json index fa618067..9298f2a0 100644 --- a/_app/version.json +++ b/_app/version.json @@ -1 +1 @@ -{"version":"1705593001718"} \ No newline at end of file +{"version":"1705596134297"} \ No newline at end of file diff --git a/index.html b/index.html index 57a263af..c1804f34 100644 --- a/index.html +++ b/index.html @@ -22,11 +22,11 @@ - + - + - + @@ -34,7 +34,7 @@