diff --git a/_app/immutable/assets/0.D8FRstQi.css b/_app/immutable/assets/0.jrQgBrF_.css similarity index 65% rename from _app/immutable/assets/0.D8FRstQi.css rename to _app/immutable/assets/0.jrQgBrF_.css index ae8f04d..779c6ca 100644 --- a/_app/immutable/assets/0.D8FRstQi.css +++ b/_app/immutable/assets/0.jrQgBrF_.css @@ -1 +1 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{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,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}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-feature-settings:normal;font-variation-settings:normal;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}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 72.2% 50.6%;--destructive-foreground: 210 40% 98%;--ring: 222.2 84% 4.9%;--radius: .5rem}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--ring: hsl(212.7,26.8%,83.9)}*{--tw-border-opacity: 1;border-color:hsl(var(--border) / var(--tw-border-opacity))}body{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:hsl(var(--foreground) / var(--tw-text-opacity))}*,: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: }.fixed{position:fixed}.top-0{top:0}.z-10{z-index:10}.my-0{margin-top:0;margin-bottom:0}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-9{margin-top:2.25rem}.block{display:block}.inline-flex{display:inline-flex}.contents{display:contents}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.w-10{width:2.5rem}.w-full{width:100%}.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))}.items-center{align-items:center}.justify-center{justify-content:center}.whitespace-nowrap{white-space:nowrap}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-2{border-width:2px}.border-\[\#0F172A\]{--tw-border-opacity: 1;border-color:rgb(15 23 42 / var(--tw-border-opacity))}.border-input{--tw-border-opacity: 1;border-color:hsl(var(--input) / var(--tw-border-opacity))}.bg-background{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity))}.bg-destructive{--tw-bg-opacity: 1;background-color:hsl(var(--destructive) / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:hsl(var(--secondary) / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.italic{font-style:italic}.text-destructive-foreground{--tw-text-opacity: 1;color:hsl(var(--destructive-foreground) / var(--tw-text-opacity))}.text-primary{--tw-text-opacity: 1;color:hsl(var(--primary) / var(--tw-text-opacity))}.text-primary-foreground{--tw-text-opacity: 1;color:hsl(var(--primary-foreground) / var(--tw-text-opacity))}.text-secondary-foreground{--tw-text-opacity: 1;color:hsl(var(--secondary-foreground) / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background) / 1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:bg-accent:hover{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{--tw-text-opacity: 1;color:hsl(var(--accent-foreground) / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--ring) / var(--tw-ring-opacity))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}:is(.dark .dark\:bg-\[\#0F172A\]){--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity))}@media not all and (min-width: 768px){.max-md\:hidden{display:none}.max-md\:border-none{border-style:none}.max-md\:p-2{padding:.5rem}.max-md\:px-2{padding-left:.5rem;padding-right:.5rem}.max-md\:pb-2{padding-bottom:.5rem}.max-md\:pt-4{padding-top:1rem}} +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{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,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}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-feature-settings:normal;font-variation-settings:normal;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}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 72.2% 50.6%;--destructive-foreground: 210 40% 98%;--ring: 222.2 84% 4.9%;--radius: .5rem}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--ring: hsl(212.7,26.8%,83.9)}*{--tw-border-opacity: 1;border-color:hsl(var(--border) / var(--tw-border-opacity))}body{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:hsl(var(--foreground) / var(--tw-text-opacity))}*,: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: }.fixed{position:fixed}.top-0{top:0}.z-10{z-index:10}.my-0{margin-top:0;margin-bottom:0}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-9{margin-top:2.25rem}.block{display:block}.inline-flex{display:inline-flex}.contents{display:contents}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.w-10{width:2.5rem}.w-full{width:100%}.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))}.items-center{align-items:center}.justify-center{justify-content:center}.whitespace-nowrap{white-space:nowrap}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-2{border-width:2px}.border-\[color\:hsl\(222\.2\,84\%\,4\.9\%\)\]{--tw-border-opacity: 1;border-color:hsl(222.2 84% 4.9% / var(--tw-border-opacity))}.border-input{--tw-border-opacity: 1;border-color:hsl(var(--input) / var(--tw-border-opacity))}.bg-background{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity))}.bg-destructive{--tw-bg-opacity: 1;background-color:hsl(var(--destructive) / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:hsl(var(--secondary) / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.italic{font-style:italic}.text-destructive-foreground{--tw-text-opacity: 1;color:hsl(var(--destructive-foreground) / var(--tw-text-opacity))}.text-primary{--tw-text-opacity: 1;color:hsl(var(--primary) / var(--tw-text-opacity))}.text-primary-foreground{--tw-text-opacity: 1;color:hsl(var(--primary-foreground) / var(--tw-text-opacity))}.text-secondary-foreground{--tw-text-opacity: 1;color:hsl(var(--secondary-foreground) / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background) / 1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:bg-accent:hover{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{--tw-text-opacity: 1;color:hsl(var(--accent-foreground) / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--ring) / var(--tw-ring-opacity))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}:is(.dark .dark\:border-white){--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}:is(.dark .dark\:bg-\[color\:hsl\(222\.2\,84\%\,4\.9\%\)\]){--tw-bg-opacity: 1;background-color:hsl(222.2 84% 4.9% / var(--tw-bg-opacity))}@media not all and (min-width: 768px){.max-md\:hidden{display:none}.max-md\:border-none{border-style:none}.max-md\:p-2{padding:.5rem}.max-md\:px-2{padding-left:.5rem;padding-right:.5rem}.max-md\:pb-2{padding-bottom:.5rem}.max-md\:pt-4{padding-top:1rem}} diff --git a/_app/immutable/assets/_layout.D8FRstQi.css b/_app/immutable/assets/_layout.jrQgBrF_.css similarity index 65% rename from _app/immutable/assets/_layout.D8FRstQi.css rename to _app/immutable/assets/_layout.jrQgBrF_.css index ae8f04d..779c6ca 100644 --- a/_app/immutable/assets/_layout.D8FRstQi.css +++ b/_app/immutable/assets/_layout.jrQgBrF_.css @@ -1 +1 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{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,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}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-feature-settings:normal;font-variation-settings:normal;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}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 72.2% 50.6%;--destructive-foreground: 210 40% 98%;--ring: 222.2 84% 4.9%;--radius: .5rem}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--ring: hsl(212.7,26.8%,83.9)}*{--tw-border-opacity: 1;border-color:hsl(var(--border) / var(--tw-border-opacity))}body{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:hsl(var(--foreground) / var(--tw-text-opacity))}*,: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: }.fixed{position:fixed}.top-0{top:0}.z-10{z-index:10}.my-0{margin-top:0;margin-bottom:0}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-9{margin-top:2.25rem}.block{display:block}.inline-flex{display:inline-flex}.contents{display:contents}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.w-10{width:2.5rem}.w-full{width:100%}.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))}.items-center{align-items:center}.justify-center{justify-content:center}.whitespace-nowrap{white-space:nowrap}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-2{border-width:2px}.border-\[\#0F172A\]{--tw-border-opacity: 1;border-color:rgb(15 23 42 / var(--tw-border-opacity))}.border-input{--tw-border-opacity: 1;border-color:hsl(var(--input) / var(--tw-border-opacity))}.bg-background{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity))}.bg-destructive{--tw-bg-opacity: 1;background-color:hsl(var(--destructive) / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:hsl(var(--secondary) / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.italic{font-style:italic}.text-destructive-foreground{--tw-text-opacity: 1;color:hsl(var(--destructive-foreground) / var(--tw-text-opacity))}.text-primary{--tw-text-opacity: 1;color:hsl(var(--primary) / var(--tw-text-opacity))}.text-primary-foreground{--tw-text-opacity: 1;color:hsl(var(--primary-foreground) / var(--tw-text-opacity))}.text-secondary-foreground{--tw-text-opacity: 1;color:hsl(var(--secondary-foreground) / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background) / 1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:bg-accent:hover{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{--tw-text-opacity: 1;color:hsl(var(--accent-foreground) / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--ring) / var(--tw-ring-opacity))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}:is(.dark .dark\:bg-\[\#0F172A\]){--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity))}@media not all and (min-width: 768px){.max-md\:hidden{display:none}.max-md\:border-none{border-style:none}.max-md\:p-2{padding:.5rem}.max-md\:px-2{padding-left:.5rem;padding-right:.5rem}.max-md\:pb-2{padding-bottom:.5rem}.max-md\:pt-4{padding-top:1rem}} +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{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,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}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-feature-settings:normal;font-variation-settings:normal;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}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 72.2% 50.6%;--destructive-foreground: 210 40% 98%;--ring: 222.2 84% 4.9%;--radius: .5rem}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--ring: hsl(212.7,26.8%,83.9)}*{--tw-border-opacity: 1;border-color:hsl(var(--border) / var(--tw-border-opacity))}body{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:hsl(var(--foreground) / var(--tw-text-opacity))}*,: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: }.fixed{position:fixed}.top-0{top:0}.z-10{z-index:10}.my-0{margin-top:0;margin-bottom:0}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-9{margin-top:2.25rem}.block{display:block}.inline-flex{display:inline-flex}.contents{display:contents}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.w-10{width:2.5rem}.w-full{width:100%}.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))}.items-center{align-items:center}.justify-center{justify-content:center}.whitespace-nowrap{white-space:nowrap}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-2{border-width:2px}.border-\[color\:hsl\(222\.2\,84\%\,4\.9\%\)\]{--tw-border-opacity: 1;border-color:hsl(222.2 84% 4.9% / var(--tw-border-opacity))}.border-input{--tw-border-opacity: 1;border-color:hsl(var(--input) / var(--tw-border-opacity))}.bg-background{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity))}.bg-destructive{--tw-bg-opacity: 1;background-color:hsl(var(--destructive) / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:hsl(var(--secondary) / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.italic{font-style:italic}.text-destructive-foreground{--tw-text-opacity: 1;color:hsl(var(--destructive-foreground) / var(--tw-text-opacity))}.text-primary{--tw-text-opacity: 1;color:hsl(var(--primary) / var(--tw-text-opacity))}.text-primary-foreground{--tw-text-opacity: 1;color:hsl(var(--primary-foreground) / var(--tw-text-opacity))}.text-secondary-foreground{--tw-text-opacity: 1;color:hsl(var(--secondary-foreground) / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background) / 1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:bg-accent:hover{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{--tw-text-opacity: 1;color:hsl(var(--accent-foreground) / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--ring) / var(--tw-ring-opacity))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}:is(.dark .dark\:border-white){--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}:is(.dark .dark\:bg-\[color\:hsl\(222\.2\,84\%\,4\.9\%\)\]){--tw-bg-opacity: 1;background-color:hsl(222.2 84% 4.9% / var(--tw-bg-opacity))}@media not all and (min-width: 768px){.max-md\:hidden{display:none}.max-md\:border-none{border-style:none}.max-md\:p-2{padding:.5rem}.max-md\:px-2{padding-left:.5rem;padding-right:.5rem}.max-md\:pb-2{padding-bottom:.5rem}.max-md\:pt-4{padding-top:1rem}} diff --git a/_app/immutable/chunks/entry.dqFI3o1w.js b/_app/immutable/chunks/entry.Z9mBvn4y.js similarity index 80% rename from _app/immutable/chunks/entry.dqFI3o1w.js rename to _app/immutable/chunks/entry.Z9mBvn4y.js index b1ba75f..6fe554b 100644 --- a/_app/immutable/chunks/entry.dqFI3o1w.js +++ b/_app/immutable/chunks/entry.Z9mBvn4y.js @@ -1,3 +1,3 @@ -import{t as re}from"./scheduler.wibOmgHn.js";import{w as dt}from"./index.NY8kyXAF.js";new URL("sveltekit-internal://");function oe(t,n){return t==="/"||n==="ignore"?t:n==="never"?t.endsWith("/")?t.slice(0,-1):t:n==="always"&&!t.endsWith("/")?t+"/":t}function se(t){return t.split("%25").map(decodeURI).join("%25")}function ie(t){for(const n in t)t[n]=decodeURIComponent(t[n]);return t}function st({href:t}){return t.split("#")[0]}const ce=["href","pathname","search","toString","toJSON"];function le(t,n,e){const r=new URL(t);Object.defineProperty(r,"searchParams",{value:new Proxy(r.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return s=>(e(s),a[o](s));n();const i=Reflect.get(a,o);return typeof i=="function"?i.bind(a):i}}),enumerable:!0,configurable:!0});for(const a of ce)Object.defineProperty(r,a,{get(){return n(),t[a]},enumerable:!0,configurable:!0});return r}const fe="/__data.json",ue=".html__data.json";function de(t){return t.endsWith(".html")?t.replace(/\.html$/,ue):t.replace(/\/$/,"")+fe}function he(...t){let n=5381;for(const e of t)if(typeof e=="string"){let r=e.length;for(;r;)n=n*33^e.charCodeAt(--r)}else if(ArrayBuffer.isView(e)){const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function pe(t){const n=atob(t),e=new Uint8Array(n.length);for(let r=0;r((t instanceof Request?t.method:(n==null?void 0:n.method)||"GET")!=="GET"&&V.delete(ht(t)),Ot(t,n));const V=new Map;function ge(t,n){const e=ht(t,n),r=document.querySelector(e);if(r!=null&&r.textContent){let{body:a,...o}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&V.set(e,{body:a,init:o,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=pe(a)),Promise.resolve(new Response(a,o))}return window.fetch(t,n)}function me(t,n,e){if(V.size>0){const r=ht(t,e),a=V.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return n.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return it(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return it(String.fromCharCode(...c.slice(2).split("-").map(l=>parseInt(l,16))));const u=_e.exec(c),[,h,g,d,m]=u;return n.push({name:d,matcher:m,optional:!!h,rest:!!g,chained:g?f===1&&i[0]==="":!1}),g?"(.*?)":h?"([^/]*)?":"([^/]+?)"}return it(c)}).join("")}).join("")}/?$`),params:n}}function we(t){return!/^\([^)]+\)$/.test(t)}function ve(t){return t.slice(1).split("/").filter(we)}function be(t,n,e){const r={},a=t.slice(1),o=a.filter(s=>s!==void 0);let i=0;for(let s=0;su).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||e[c.matcher](f)){r[c.name]=f;const u=n[s+1],h=a[s+1];u&&!u.rest&&u.optional&&h&&c.chained&&(i=0),!u&&!h&&Object.keys(r).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function it(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ee({nodes:t,server_loads:n,dictionary:e,matchers:r}){const a=new Set(n);return Object.entries(e).map(([s,[c,f,u]])=>{const{pattern:h,params:g}=ye(s),d={id:s,exec:m=>{const l=h.exec(m);if(l)return be(l,g,r)},errors:[1,...u||[]].map(m=>t[m]),layouts:[0,...f||[]].map(i),leaf:o(c)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function o(s){const c=s<0;return c&&(s=~s),[c,t[s]]}function i(s){return s===void 0?s:[a.has(s),t[s]]}}function jt(t,n=JSON.parse){try{return n(sessionStorage[t])}catch{}}function At(t,n,e=JSON.stringify){const r=e(n);try{sessionStorage[t]=r}catch{}}var xt;const I=((xt=globalThis.__sveltekit_jzf2sa)==null?void 0:xt.base)??"/note2";var Nt;const ke=((Nt=globalThis.__sveltekit_jzf2sa)==null?void 0:Nt.assets)??I,Se="1706371901367",Dt="sveltekit:snapshot",$t="sveltekit:scroll",Ct="sveltekit:states",Ae="sveltekit:pageurl",j="sveltekit:history",F="sveltekit:navigation",K={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},H=location.origin;function Vt(t){if(t instanceof URL)return t;let n=document.baseURI;if(!n){const e=document.getElementsByTagName("base");n=e.length?e[0].href:document.URL}return new URL(t,n)}function pt(){return{x:pageXOffset,y:pageYOffset}}function N(t,n){return t.getAttribute(`data-sveltekit-${n}`)}const Rt={...K,"":K.hover};function Ft(t){let n=t.assignedSlot??t.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function Gt(t,n){for(;t&&t!==n;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=Ft(t)}}function lt(t,n){let e;try{e=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const r=t instanceof SVGAElement?t.target.baseVal:t.target,a=!e||!!r||tt(e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(e==null?void 0:e.origin)===H&&t.hasAttribute("download");return{url:e,external:a,target:r,download:o}}function z(t){let n=null,e=null,r=null,a=null,o=null,i=null,s=t;for(;s&&s!==document.documentElement;)r===null&&(r=N(s,"preload-code")),a===null&&(a=N(s,"preload-data")),n===null&&(n=N(s,"keepfocus")),e===null&&(e=N(s,"noscroll")),o===null&&(o=N(s,"reload")),i===null&&(i=N(s,"replacestate")),s=Ft(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Rt[r??"off"],preload_data:Rt[a??"off"],keepfocus:c(n),noscroll:c(e),reload:c(o),replace_state:c(i)}}function It(t){const n=dt(t);let e=!0;function r(){e=!0,n.update(i=>i)}function a(i){e=!1,n.set(i)}function o(i){let s;return n.subscribe(c=>{(s===void 0||e&&c!==s)&&i(s=c)})}return{notify:r,set:a,subscribe:o}}function Re(){const{set:t,subscribe:n}=dt(!1);let e;async function r(){clearTimeout(e);try{const a=await fetch(`${ke}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Se;return i&&(t(!0),clearTimeout(e)),i}catch{return!1}}return{subscribe:n,check:r}}function tt(t,n){return t.origin!==H||!t.pathname.startsWith(n)}const Ie=-1,Le=-2,Pe=-3,Te=-4,Ue=-5,xe=-6;function Ne(t,n){if(typeof t=="number")return a(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const e=t,r=Array(e.length);function a(o,i=!1){if(o===Ie)return;if(o===Pe)return NaN;if(o===Te)return 1/0;if(o===Ue)return-1/0;if(o===xe)return-0;if(i)throw new Error("Invalid input");if(o in r)return r[o];const s=e[o];if(!s||typeof s!="object")r[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],f=n==null?void 0:n[c];if(f)return r[o]=f(a(s[1]));switch(c){case"Date":r[o]=new Date(s[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;dn!=null)}class et{constructor(n,e){this.status=n,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class qt{constructor(n,e){this.status=n,this.location=e}}class gt extends Error{constructor(n,e,r){super(r),this.status=n,this.text=e}}const De="x-sveltekit-invalidated",$e="x-sveltekit-trailing-slash";function Y(t){return t instanceof et||t instanceof gt?t.status:500}function Ce(t){return t instanceof gt?t.text:"Internal Error"}const x=jt($t)??{},G=jt(Dt)??{},T={url:It({}),page:It({}),navigating:dt(null),updated:Re()};function mt(t){x[t]=pt()}function Ve(t,n){let e=t+1;for(;x[e];)delete x[e],e+=1;for(e=n+1;G[e];)delete G[e],e+=1}function D(t){return location.href=t.href,new Promise(()=>{})}function Lt(){}let nt,ft,J,L,ut,$;const Ht=[],W=[];let P=null;const Bt=[],Fe=[];let O=[],w={branch:[],error:null,url:null},_t=!1,X=!1,Pt=!0,M=!1,C=!1,Kt=!1,yt=!1,wt,k,A,R,Z;async function Xe(t,n,e){var a,o;document.URL!==location.href&&(location.href=location.href),$=t,nt=Ee(t),L=document.documentElement,ut=n,ft=t.nodes[0],J=t.nodes[1],ft(),J(),k=(a=history.state)==null?void 0:a[j],A=(o=history.state)==null?void 0:o[F],k||(k=A=Date.now(),history.replaceState({...history.state,[j]:k,[F]:A},""));const r=x[k];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),e?await ze(ut,e):Be(location.href,{replaceState:!0}),Ke()}function zt(t){W.some(n=>n==null?void 0:n.snapshot)&&(G[t]=W.map(n=>{var e;return(e=n==null?void 0:n.snapshot)==null?void 0:e.capture()}))}function Yt(t){var n;(n=G[t])==null||n.forEach((e,r)=>{var a,o;(o=(a=W[r])==null?void 0:a.snapshot)==null||o.restore(e)})}function Tt(){mt(k),At($t,x),zt(A),At(Dt,G)}async function Jt(t,n,e,r){return B({type:"goto",url:Vt(t),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:e,nav_token:r,accept:()=>{n.invalidateAll&&(yt=!0)}})}async function Ge(t){return P={id:t.id,promise:Xt(t).then(n=>(n.type==="loaded"&&n.state.error&&(P=null),n))},P.promise}async function ct(t){const n=nt.find(e=>e.exec(Zt(t)));n&&await Promise.all([...n.layouts,n.leaf].map(e=>e==null?void 0:e[1]()))}function Wt(t,n){var a;w=t.state;const e=document.querySelector("style[data-sveltekit]");e&&e.remove(),R=t.props.page,wt=new $.root({target:n,props:{...t.props,stores:T,components:W},hydrate:!0}),Yt(A);const r={from:null,to:{params:w.params,route:{id:((a=w.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};O.forEach(o=>o(r)),X=!0}async function Q({url:t,params:n,branch:e,status:r,error:a,route:o,form:i}){let s="never";if(I&&(t.pathname===I||t.pathname===I+"/"))s="always";else for(const d of e)(d==null?void 0:d.slash)!==void 0&&(s=d.slash);t.pathname=oe(t.pathname,s),t.search=t.search;const c={type:"loaded",state:{url:t,params:n,branch:e,error:a,route:o},props:{constructors:je(e).map(d=>d.node.component),page:R}};i!==void 0&&(c.props.form=i);let f={},u=!R,h=0;for(let d=0;d(s&&(c.route=!0),l[_])}),params:new Proxy(r,{get:(l,_)=>(s&&c.params.add(_),l[_])}),data:(o==null?void 0:o.data)??null,url:le(e,()=>{s&&(c.url=!0)},l=>{s&&c.search_params.add(l)}),async fetch(l,_){let v;l instanceof Request?(v=l.url,_={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:l.headers,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,..._}):v=l;const S=new URL(v,e);return s&&d(S.href),S.origin===e.origin&&(v=S.href.slice(e.origin.length)),X?me(v,S.href,_):ge(v,_)},setHeaders:()=>{},depends:d,parent(){return s&&(c.parent=!0),n()},untrack(l){s=!1;try{return l()}finally{s=!0}}};i=await f.universal.load.call(null,m)??null}return{node:f,loader:t,server:o,universal:(h=f.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(o==null?void 0:o.slash)}}function Ut(t,n,e,r,a,o){if(yt)return!0;if(!a)return!1;if(a.parent&&t||a.route&&n||a.url&&e)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(o[i]!==w.params[i])return!0;for(const i of a.dependencies)if(Ht.some(s=>s(new URL(i))))return!0;return!1}function bt(t,n){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?n??null:null}function Me(t,n){if(!t)return new Set(n.searchParams.keys());const e=new Set([...t.searchParams.keys(),...n.searchParams.keys()]);for(const r of e){const a=t.searchParams.getAll(r),o=n.searchParams.getAll(r);a.every(i=>o.includes(i))&&o.every(i=>a.includes(i))&&e.delete(r)}return e}async function Xt({id:t,invalidating:n,url:e,params:r,route:a}){if((P==null?void 0:P.id)===t)return P.promise;const{errors:o,layouts:i,leaf:s}=a,c=[...i,s];o.forEach(p=>p==null?void 0:p().catch(()=>{})),c.forEach(p=>p==null?void 0:p[1]().catch(()=>{}));let f=null;const u=w.url?t!==w.url.pathname+w.url.search:!1,h=w.route?a.id!==w.route.id:!1,g=Me(w.url,e);let d=!1;const m=c.map((p,y)=>{var U;const b=w.branch[y],E=!!(p!=null&&p[0])&&((b==null?void 0:b.loader)!==p[1]||Ut(d,h,u,g,(U=b.server)==null?void 0:U.uses,r));return E&&(d=!0),E});if(m.some(Boolean)){try{f=await ee(e,m)}catch(p){return at({status:Y(p),error:await q(p,{url:e,params:r,route:{id:a.id}}),url:e,route:a})}if(f.type==="redirect")return f}const l=f==null?void 0:f.nodes;let _=!1;const v=c.map(async(p,y)=>{var rt;if(!p)return;const b=w.branch[y],E=l==null?void 0:l[y];if((!E||E.type==="skip")&&p[1]===(b==null?void 0:b.loader)&&!Ut(_,h,u,g,(rt=b.universal)==null?void 0:rt.uses,r))return b;if(_=!0,(E==null?void 0:E.type)==="error")throw E;return vt({loader:p[1],url:e,params:r,route:a,parent:async()=>{var St;const kt={};for(let ot=0;ot{});const S=[];for(let p=0;pPromise.resolve({}),server_data_node:bt(o)}),c={node:await J(),loader:J,universal:null,server:null,data:null};return await Q({url:e,params:a,branch:[s,c],status:t,error:n,route:null})}function Et(t,n){if(!t||tt(t,I))return;let e;try{e=$.hooks.reroute({url:new URL(t)})??t.pathname}catch{return}const r=Zt(e);for(const a of nt){const o=a.exec(r);if(o)return{id:t.pathname+t.search,invalidating:n,route:a,params:ie(o),url:t}}}function Zt(t){return se(t.slice(I.length)||"/")}function Qt({url:t,type:n,intent:e,delta:r}){let a=!1;const o=ae(w,e,t,n);r!==void 0&&(o.navigation.delta=r);const i={...o.navigation,cancel:()=>{a=!0,o.reject(new Error("navigation cancelled"))}};return M||Bt.forEach(s=>s(i)),a?null:o}async function B({type:t,url:n,popped:e,keepfocus:r,noscroll:a,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:f=Lt,block:u=Lt}){const h=Et(n,!1),g=Qt({url:n,type:t,delta:e==null?void 0:e.delta,intent:h});if(!g){u();return}const d=k,m=A;f(),M=!0,X&&T.navigating.set(g.navigation),Z=c;let l=h&&await Xt(h);if(!l){if(tt(n,I))return await D(n);l=await te(n,{id:null},await q(new gt(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(h==null?void 0:h.url)||n,Z!==c)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(s>=20)l=await at({status:500,error:await q(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Jt(new URL(l.location,n).href,{},s+1,c),!1;else l.props.page.status>=400&&await T.updated.check()&&await D(n);if(Ht.length=0,yt=!1,mt(d),zt(m),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),i=e?e.state:i,!e){const p=o?0:1,y={[j]:k+=p,[F]:A+=p,[Ct]:i};(o?history.replaceState:history.pushState).call(history,y,"",n),o||Ve(k,A)}if(P=null,l.props.page.state=i,X){w=l.state,l.props.page&&(l.props.page.url=n);const p=(await Promise.all(Fe.map(y=>y(g.navigation)))).filter(y=>typeof y=="function");if(p.length>0){let y=function(){O=O.filter(b=>!p.includes(b))};p.push(y),O.push(...p)}wt.$set(l.props),Kt=!0}else Wt(l,ut);const{activeElement:_}=document;await re();const v=e?e.scroll:a?pt():null;if(Pt){const p=n.hash&&document.getElementById(decodeURIComponent(n.hash.slice(1)));v?scrollTo(v.x,v.y):p?p.scrollIntoView():scrollTo(0,0)}const S=document.activeElement!==_&&document.activeElement!==document.body;!r&&!S&&Ye(),Pt=!0,l.props.page&&(R=l.props.page),M=!1,t==="popstate"&&Yt(A),g.fulfil(void 0),O.forEach(p=>p(g.navigation)),T.navigating.set(null)}async function te(t,n,e,r){return t.origin===H&&t.pathname===location.pathname&&!_t?await at({status:r,error:e,url:t,route:n}):await D(t)}function He(){let t;L.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(t),t=setTimeout(()=>{r(i,2)},20)});function n(o){r(o.composedPath()[0],1)}L.addEventListener("mousedown",n),L.addEventListener("touchstart",n,{passive:!0});const e=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(ct(i.target.href),e.unobserve(i.target))},{threshold:0});function r(o,i){const s=Gt(o,L);if(!s)return;const{url:c,external:f,download:u}=lt(s,I);if(f||u)return;const h=z(s);if(!h.reload)if(i<=h.preload_data){const g=Et(c,!1);g&&Ge(g)}else i<=h.preload_code&&ct(c.pathname)}function a(){e.disconnect();for(const o of L.querySelectorAll("a")){const{url:i,external:s,download:c}=lt(o,I);if(s||c)continue;const f=z(o);f.reload||(f.preload_code===K.viewport&&e.observe(o),f.preload_code===K.eager&&ct(i.pathname))}}O.push(a),a()}function q(t,n){if(t instanceof et)return t.body;const e=Y(t),r=Ce(t);return $.hooks.handleError({error:t,event:n,status:e,message:r})??{message:r}}function Be(t,n={}){return t=Vt(t),t.origin!==H?Promise.reject(new Error("goto: invalid URL")):Jt(t,n,0)}function Ke(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(Tt(),!M){const a=ae(w,void 0,null,"leave"),o={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};Bt.forEach(i=>i(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Tt()}),(n=navigator.connection)!=null&&n.saveData||He(),L.addEventListener("click",e=>{var g;if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=Gt(e.composedPath()[0],L);if(!r)return;const{url:a,external:o,target:i,download:s}=lt(r,I);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=z(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||s)return;if(o||c.reload){Qt({url:a,type:"link"})?M=!0:e.preventDefault();return}const[u,h]=a.href.split("#");if(h!==void 0&&u===st(location)){const[,d]=w.url.href.split("#");if(d===h){e.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):(g=r.ownerDocument.getElementById(h))==null||g.scrollIntoView();return}if(C=!0,mt(k),t(a),!c.replace_state)return;C=!1}e.preventDefault(),B({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href})}),L.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),a=e.submitter;if(((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(tt(i,I))return;const s=e.target,c=z(s);if(c.reload)return;e.preventDefault(),e.stopPropagation();const f=new FormData(s),u=a==null?void 0:a.getAttribute("name");u&&f.append(u,(a==null?void 0:a.getAttribute("value"))??""),i.search=new URLSearchParams(f).toString(),B({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href})}),addEventListener("popstate",async e=>{var r;if((r=e.state)!=null&&r[j]){const a=e.state[j];if(Z={},a===k)return;const o=x[a],i=e.state[Ct]??{},s=new URL(e.state[Ae]??location.href),c=e.state[F],f=st(location)===st(w.url);if(c===A&&(Kt||f)){t(s),x[k]=pt(),o&&scrollTo(o.x,o.y),i!==R.state&&(R={...R,state:i},wt.$set({page:R})),k=a;return}const h=a-k;await B({type:"popstate",url:s,popped:{state:i,scroll:o,delta:h},accept:()=>{k=a,A=c},block:()=>{history.go(-h)},nav_token:Z})}else if(!C){const a=new URL(location.href);t(a)}}),addEventListener("hashchange",()=>{C&&(C=!1,history.replaceState({...history.state,[j]:++k,[F]:A},"",location.href))});for(const e of document.querySelectorAll("link"))e.rel==="icon"&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&T.navigating.set(null)});function t(e){w.url=e,T.page.set({...R,url:e}),T.page.notify()}}async function ze(t,{status:n=200,error:e,node_ids:r,params:a,route:o,data:i,form:s}){_t=!0;const c=new URL(location.href);({params:a={},route:o={id:null}}=Et(c,!1)||{});let f;try{const u=r.map(async(d,m)=>{const l=i[m];return l!=null&&l.uses&&(l.uses=ne(l.uses)),vt({loader:$.nodes[d],url:c,params:a,route:o,parent:async()=>{const _={};for(let v=0;vd===o.id);if(g){const d=g.layouts;for(let m=0;mo?"1":"0").join(""));const r=await Ot(e.href);if(!r.ok){let o;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?o=await r.json():r.status===404?o="Not Found":r.status===500&&(o="Internal Error"),new et(r.status,o)}return new Promise(async o=>{var h;const i=new Map,s=r.body.getReader(),c=new TextDecoder;function f(g){return Ne(g,{Promise:d=>new Promise((m,l)=>{i.set(d,{fulfil:m,reject:l})})})}let u="";for(;;){const{done:g,value:d}=await s.read();if(g&&!u)break;for(u+=!d&&u?` +import{t as re}from"./scheduler.wibOmgHn.js";import{w as dt}from"./index.NY8kyXAF.js";new URL("sveltekit-internal://");function oe(t,n){return t==="/"||n==="ignore"?t:n==="never"?t.endsWith("/")?t.slice(0,-1):t:n==="always"&&!t.endsWith("/")?t+"/":t}function se(t){return t.split("%25").map(decodeURI).join("%25")}function ie(t){for(const n in t)t[n]=decodeURIComponent(t[n]);return t}function st({href:t}){return t.split("#")[0]}const ce=["href","pathname","search","toString","toJSON"];function le(t,n,e){const r=new URL(t);Object.defineProperty(r,"searchParams",{value:new Proxy(r.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return s=>(e(s),a[o](s));n();const i=Reflect.get(a,o);return typeof i=="function"?i.bind(a):i}}),enumerable:!0,configurable:!0});for(const a of ce)Object.defineProperty(r,a,{get(){return n(),t[a]},enumerable:!0,configurable:!0});return r}const fe="/__data.json",ue=".html__data.json";function de(t){return t.endsWith(".html")?t.replace(/\.html$/,ue):t.replace(/\/$/,"")+fe}function he(...t){let n=5381;for(const e of t)if(typeof e=="string"){let r=e.length;for(;r;)n=n*33^e.charCodeAt(--r)}else if(ArrayBuffer.isView(e)){const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function pe(t){const n=atob(t),e=new Uint8Array(n.length);for(let r=0;r((t instanceof Request?t.method:(n==null?void 0:n.method)||"GET")!=="GET"&&V.delete(ht(t)),Ot(t,n));const V=new Map;function ge(t,n){const e=ht(t,n),r=document.querySelector(e);if(r!=null&&r.textContent){let{body:a,...o}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&V.set(e,{body:a,init:o,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=pe(a)),Promise.resolve(new Response(a,o))}return window.fetch(t,n)}function me(t,n,e){if(V.size>0){const r=ht(t,e),a=V.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return n.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return it(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return it(String.fromCharCode(...c.slice(2).split("-").map(l=>parseInt(l,16))));const u=_e.exec(c),[,h,g,d,m]=u;return n.push({name:d,matcher:m,optional:!!h,rest:!!g,chained:g?f===1&&i[0]==="":!1}),g?"(.*?)":h?"([^/]*)?":"([^/]+?)"}return it(c)}).join("")}).join("")}/?$`),params:n}}function we(t){return!/^\([^)]+\)$/.test(t)}function ve(t){return t.slice(1).split("/").filter(we)}function be(t,n,e){const r={},a=t.slice(1),o=a.filter(s=>s!==void 0);let i=0;for(let s=0;su).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||e[c.matcher](f)){r[c.name]=f;const u=n[s+1],h=a[s+1];u&&!u.rest&&u.optional&&h&&c.chained&&(i=0),!u&&!h&&Object.keys(r).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function it(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ee({nodes:t,server_loads:n,dictionary:e,matchers:r}){const a=new Set(n);return Object.entries(e).map(([s,[c,f,u]])=>{const{pattern:h,params:g}=ye(s),d={id:s,exec:m=>{const l=h.exec(m);if(l)return be(l,g,r)},errors:[1,...u||[]].map(m=>t[m]),layouts:[0,...f||[]].map(i),leaf:o(c)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function o(s){const c=s<0;return c&&(s=~s),[c,t[s]]}function i(s){return s===void 0?s:[a.has(s),t[s]]}}function jt(t,n=JSON.parse){try{return n(sessionStorage[t])}catch{}}function At(t,n,e=JSON.stringify){const r=e(n);try{sessionStorage[t]=r}catch{}}var Ut;const I=((Ut=globalThis.__sveltekit_95qfpx)==null?void 0:Ut.base)??"/note2";var Nt;const ke=((Nt=globalThis.__sveltekit_95qfpx)==null?void 0:Nt.assets)??I,Se="1706373374610",Dt="sveltekit:snapshot",$t="sveltekit:scroll",Ct="sveltekit:states",Ae="sveltekit:pageurl",j="sveltekit:history",F="sveltekit:navigation",K={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},H=location.origin;function Vt(t){if(t instanceof URL)return t;let n=document.baseURI;if(!n){const e=document.getElementsByTagName("base");n=e.length?e[0].href:document.URL}return new URL(t,n)}function pt(){return{x:pageXOffset,y:pageYOffset}}function N(t,n){return t.getAttribute(`data-sveltekit-${n}`)}const Rt={...K,"":K.hover};function Ft(t){let n=t.assignedSlot??t.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function qt(t,n){for(;t&&t!==n;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=Ft(t)}}function lt(t,n){let e;try{e=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const r=t instanceof SVGAElement?t.target.baseVal:t.target,a=!e||!!r||tt(e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(e==null?void 0:e.origin)===H&&t.hasAttribute("download");return{url:e,external:a,target:r,download:o}}function Y(t){let n=null,e=null,r=null,a=null,o=null,i=null,s=t;for(;s&&s!==document.documentElement;)r===null&&(r=N(s,"preload-code")),a===null&&(a=N(s,"preload-data")),n===null&&(n=N(s,"keepfocus")),e===null&&(e=N(s,"noscroll")),o===null&&(o=N(s,"reload")),i===null&&(i=N(s,"replacestate")),s=Ft(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Rt[r??"off"],preload_data:Rt[a??"off"],keepfocus:c(n),noscroll:c(e),reload:c(o),replace_state:c(i)}}function It(t){const n=dt(t);let e=!0;function r(){e=!0,n.update(i=>i)}function a(i){e=!1,n.set(i)}function o(i){let s;return n.subscribe(c=>{(s===void 0||e&&c!==s)&&i(s=c)})}return{notify:r,set:a,subscribe:o}}function Re(){const{set:t,subscribe:n}=dt(!1);let e;async function r(){clearTimeout(e);try{const a=await fetch(`${ke}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Se;return i&&(t(!0),clearTimeout(e)),i}catch{return!1}}return{subscribe:n,check:r}}function tt(t,n){return t.origin!==H||!t.pathname.startsWith(n)}const Ie=-1,Le=-2,Pe=-3,xe=-4,Te=-5,Ue=-6;function Ne(t,n){if(typeof t=="number")return a(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const e=t,r=Array(e.length);function a(o,i=!1){if(o===Ie)return;if(o===Pe)return NaN;if(o===xe)return 1/0;if(o===Te)return-1/0;if(o===Ue)return-0;if(i)throw new Error("Invalid input");if(o in r)return r[o];const s=e[o];if(!s||typeof s!="object")r[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],f=n==null?void 0:n[c];if(f)return r[o]=f(a(s[1]));switch(c){case"Date":r[o]=new Date(s[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;dn!=null)}class et{constructor(n,e){this.status=n,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class Mt{constructor(n,e){this.status=n,this.location=e}}class gt extends Error{constructor(n,e,r){super(r),this.status=n,this.text=e}}const De="x-sveltekit-invalidated",$e="x-sveltekit-trailing-slash";function J(t){return t instanceof et||t instanceof gt?t.status:500}function Ce(t){return t instanceof gt?t.text:"Internal Error"}const U=jt($t)??{},q=jt(Dt)??{},x={url:It({}),page:It({}),navigating:dt(null),updated:Re()};function mt(t){U[t]=pt()}function Ve(t,n){let e=t+1;for(;U[e];)delete U[e],e+=1;for(e=n+1;q[e];)delete q[e],e+=1}function D(t){return location.href=t.href,new Promise(()=>{})}function Lt(){}let nt,ft,W,L,ut,$;const Ht=[],z=[];let P=null;const Bt=[],Fe=[];let O=[],w={branch:[],error:null,url:null},_t=!1,X=!1,Pt=!0,G=!1,C=!1,Kt=!1,yt=!1,wt,k,A,R,Z;async function Xe(t,n,e){var a,o;document.URL!==location.href&&(location.href=location.href),$=t,nt=Ee(t),L=document.documentElement,ut=n,ft=t.nodes[0],W=t.nodes[1],ft(),W(),k=(a=history.state)==null?void 0:a[j],A=(o=history.state)==null?void 0:o[F],k||(k=A=Date.now(),history.replaceState({...history.state,[j]:k,[F]:A},""));const r=U[k];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),e?await Ye(ut,e):Be(location.href,{replaceState:!0}),Ke()}function Yt(t){z.some(n=>n==null?void 0:n.snapshot)&&(q[t]=z.map(n=>{var e;return(e=n==null?void 0:n.snapshot)==null?void 0:e.capture()}))}function Jt(t){var n;(n=q[t])==null||n.forEach((e,r)=>{var a,o;(o=(a=z[r])==null?void 0:a.snapshot)==null||o.restore(e)})}function xt(){mt(k),At($t,U),Yt(A),At(Dt,q)}async function Wt(t,n,e,r){return B({type:"goto",url:Vt(t),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:e,nav_token:r,accept:()=>{n.invalidateAll&&(yt=!0)}})}async function qe(t){return P={id:t.id,promise:Xt(t).then(n=>(n.type==="loaded"&&n.state.error&&(P=null),n))},P.promise}async function ct(t){const n=nt.find(e=>e.exec(Zt(t)));n&&await Promise.all([...n.layouts,n.leaf].map(e=>e==null?void 0:e[1]()))}function zt(t,n){var a;w=t.state;const e=document.querySelector("style[data-sveltekit]");e&&e.remove(),R=t.props.page,wt=new $.root({target:n,props:{...t.props,stores:x,components:z},hydrate:!0}),Jt(A);const r={from:null,to:{params:w.params,route:{id:((a=w.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};O.forEach(o=>o(r)),X=!0}async function Q({url:t,params:n,branch:e,status:r,error:a,route:o,form:i}){let s="never";if(I&&(t.pathname===I||t.pathname===I+"/"))s="always";else for(const d of e)(d==null?void 0:d.slash)!==void 0&&(s=d.slash);t.pathname=oe(t.pathname,s),t.search=t.search;const c={type:"loaded",state:{url:t,params:n,branch:e,error:a,route:o},props:{constructors:je(e).map(d=>d.node.component),page:R}};i!==void 0&&(c.props.form=i);let f={},u=!R,h=0;for(let d=0;d(s&&(c.route=!0),l[_])}),params:new Proxy(r,{get:(l,_)=>(s&&c.params.add(_),l[_])}),data:(o==null?void 0:o.data)??null,url:le(e,()=>{s&&(c.url=!0)},l=>{s&&c.search_params.add(l)}),async fetch(l,_){let v;l instanceof Request?(v=l.url,_={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:l.headers,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,..._}):v=l;const S=new URL(v,e);return s&&d(S.href),S.origin===e.origin&&(v=S.href.slice(e.origin.length)),X?me(v,S.href,_):ge(v,_)},setHeaders:()=>{},depends:d,parent(){return s&&(c.parent=!0),n()},untrack(l){s=!1;try{return l()}finally{s=!0}}};i=await f.universal.load.call(null,m)??null}return{node:f,loader:t,server:o,universal:(h=f.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(o==null?void 0:o.slash)}}function Tt(t,n,e,r,a,o){if(yt)return!0;if(!a)return!1;if(a.parent&&t||a.route&&n||a.url&&e)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(o[i]!==w.params[i])return!0;for(const i of a.dependencies)if(Ht.some(s=>s(new URL(i))))return!0;return!1}function bt(t,n){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?n??null:null}function Ge(t,n){if(!t)return new Set(n.searchParams.keys());const e=new Set([...t.searchParams.keys(),...n.searchParams.keys()]);for(const r of e){const a=t.searchParams.getAll(r),o=n.searchParams.getAll(r);a.every(i=>o.includes(i))&&o.every(i=>a.includes(i))&&e.delete(r)}return e}async function Xt({id:t,invalidating:n,url:e,params:r,route:a}){if((P==null?void 0:P.id)===t)return P.promise;const{errors:o,layouts:i,leaf:s}=a,c=[...i,s];o.forEach(p=>p==null?void 0:p().catch(()=>{})),c.forEach(p=>p==null?void 0:p[1]().catch(()=>{}));let f=null;const u=w.url?t!==w.url.pathname+w.url.search:!1,h=w.route?a.id!==w.route.id:!1,g=Ge(w.url,e);let d=!1;const m=c.map((p,y)=>{var T;const b=w.branch[y],E=!!(p!=null&&p[0])&&((b==null?void 0:b.loader)!==p[1]||Tt(d,h,u,g,(T=b.server)==null?void 0:T.uses,r));return E&&(d=!0),E});if(m.some(Boolean)){try{f=await ee(e,m)}catch(p){return at({status:J(p),error:await M(p,{url:e,params:r,route:{id:a.id}}),url:e,route:a})}if(f.type==="redirect")return f}const l=f==null?void 0:f.nodes;let _=!1;const v=c.map(async(p,y)=>{var rt;if(!p)return;const b=w.branch[y],E=l==null?void 0:l[y];if((!E||E.type==="skip")&&p[1]===(b==null?void 0:b.loader)&&!Tt(_,h,u,g,(rt=b.universal)==null?void 0:rt.uses,r))return b;if(_=!0,(E==null?void 0:E.type)==="error")throw E;return vt({loader:p[1],url:e,params:r,route:a,parent:async()=>{var St;const kt={};for(let ot=0;ot{});const S=[];for(let p=0;pPromise.resolve({}),server_data_node:bt(o)}),c={node:await W(),loader:W,universal:null,server:null,data:null};return await Q({url:e,params:a,branch:[s,c],status:t,error:n,route:null})}function Et(t,n){if(!t||tt(t,I))return;let e;try{e=$.hooks.reroute({url:new URL(t)})??t.pathname}catch{return}const r=Zt(e);for(const a of nt){const o=a.exec(r);if(o)return{id:t.pathname+t.search,invalidating:n,route:a,params:ie(o),url:t}}}function Zt(t){return se(t.slice(I.length)||"/")}function Qt({url:t,type:n,intent:e,delta:r}){let a=!1;const o=ae(w,e,t,n);r!==void 0&&(o.navigation.delta=r);const i={...o.navigation,cancel:()=>{a=!0,o.reject(new Error("navigation cancelled"))}};return G||Bt.forEach(s=>s(i)),a?null:o}async function B({type:t,url:n,popped:e,keepfocus:r,noscroll:a,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:f=Lt,block:u=Lt}){const h=Et(n,!1),g=Qt({url:n,type:t,delta:e==null?void 0:e.delta,intent:h});if(!g){u();return}const d=k,m=A;f(),G=!0,X&&x.navigating.set(g.navigation),Z=c;let l=h&&await Xt(h);if(!l){if(tt(n,I))return await D(n);l=await te(n,{id:null},await M(new gt(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(h==null?void 0:h.url)||n,Z!==c)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(s>=20)l=await at({status:500,error:await M(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Wt(new URL(l.location,n).href,{},s+1,c),!1;else l.props.page.status>=400&&await x.updated.check()&&await D(n);if(Ht.length=0,yt=!1,mt(d),Yt(m),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),i=e?e.state:i,!e){const p=o?0:1,y={[j]:k+=p,[F]:A+=p,[Ct]:i};(o?history.replaceState:history.pushState).call(history,y,"",n),o||Ve(k,A)}if(P=null,l.props.page.state=i,X){w=l.state,l.props.page&&(l.props.page.url=n);const p=(await Promise.all(Fe.map(y=>y(g.navigation)))).filter(y=>typeof y=="function");if(p.length>0){let y=function(){O=O.filter(b=>!p.includes(b))};p.push(y),O.push(...p)}wt.$set(l.props),Kt=!0}else zt(l,ut);const{activeElement:_}=document;await re();const v=e?e.scroll:a?pt():null;if(Pt){const p=n.hash&&document.getElementById(decodeURIComponent(n.hash.slice(1)));v?scrollTo(v.x,v.y):p?p.scrollIntoView():scrollTo(0,0)}const S=document.activeElement!==_&&document.activeElement!==document.body;!r&&!S&&Je(),Pt=!0,l.props.page&&(R=l.props.page),G=!1,t==="popstate"&&Jt(A),g.fulfil(void 0),O.forEach(p=>p(g.navigation)),x.navigating.set(null)}async function te(t,n,e,r){return t.origin===H&&t.pathname===location.pathname&&!_t?await at({status:r,error:e,url:t,route:n}):await D(t)}function He(){let t;L.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(t),t=setTimeout(()=>{r(i,2)},20)});function n(o){r(o.composedPath()[0],1)}L.addEventListener("mousedown",n),L.addEventListener("touchstart",n,{passive:!0});const e=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(ct(i.target.href),e.unobserve(i.target))},{threshold:0});function r(o,i){const s=qt(o,L);if(!s)return;const{url:c,external:f,download:u}=lt(s,I);if(f||u)return;const h=Y(s);if(!h.reload)if(i<=h.preload_data){const g=Et(c,!1);g&&qe(g)}else i<=h.preload_code&&ct(c.pathname)}function a(){e.disconnect();for(const o of L.querySelectorAll("a")){const{url:i,external:s,download:c}=lt(o,I);if(s||c)continue;const f=Y(o);f.reload||(f.preload_code===K.viewport&&e.observe(o),f.preload_code===K.eager&&ct(i.pathname))}}O.push(a),a()}function M(t,n){if(t instanceof et)return t.body;const e=J(t),r=Ce(t);return $.hooks.handleError({error:t,event:n,status:e,message:r})??{message:r}}function Be(t,n={}){return t=Vt(t),t.origin!==H?Promise.reject(new Error("goto: invalid URL")):Wt(t,n,0)}function Ke(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(xt(),!G){const a=ae(w,void 0,null,"leave"),o={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};Bt.forEach(i=>i(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&xt()}),(n=navigator.connection)!=null&&n.saveData||He(),L.addEventListener("click",e=>{var g;if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=qt(e.composedPath()[0],L);if(!r)return;const{url:a,external:o,target:i,download:s}=lt(r,I);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=Y(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||s)return;if(o||c.reload){Qt({url:a,type:"link"})?G=!0:e.preventDefault();return}const[u,h]=a.href.split("#");if(h!==void 0&&u===st(location)){const[,d]=w.url.href.split("#");if(d===h){e.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):(g=r.ownerDocument.getElementById(h))==null||g.scrollIntoView();return}if(C=!0,mt(k),t(a),!c.replace_state)return;C=!1}e.preventDefault(),B({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href})}),L.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),a=e.submitter;if(((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(tt(i,I))return;const s=e.target,c=Y(s);if(c.reload)return;e.preventDefault(),e.stopPropagation();const f=new FormData(s),u=a==null?void 0:a.getAttribute("name");u&&f.append(u,(a==null?void 0:a.getAttribute("value"))??""),i.search=new URLSearchParams(f).toString(),B({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href})}),addEventListener("popstate",async e=>{var r;if((r=e.state)!=null&&r[j]){const a=e.state[j];if(Z={},a===k)return;const o=U[a],i=e.state[Ct]??{},s=new URL(e.state[Ae]??location.href),c=e.state[F],f=st(location)===st(w.url);if(c===A&&(Kt||f)){t(s),U[k]=pt(),o&&scrollTo(o.x,o.y),i!==R.state&&(R={...R,state:i},wt.$set({page:R})),k=a;return}const h=a-k;await B({type:"popstate",url:s,popped:{state:i,scroll:o,delta:h},accept:()=>{k=a,A=c},block:()=>{history.go(-h)},nav_token:Z})}else if(!C){const a=new URL(location.href);t(a)}}),addEventListener("hashchange",()=>{C&&(C=!1,history.replaceState({...history.state,[j]:++k,[F]:A},"",location.href))});for(const e of document.querySelectorAll("link"))e.rel==="icon"&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&x.navigating.set(null)});function t(e){w.url=e,x.page.set({...R,url:e}),x.page.notify()}}async function Ye(t,{status:n=200,error:e,node_ids:r,params:a,route:o,data:i,form:s}){_t=!0;const c=new URL(location.href);({params:a={},route:o={id:null}}=Et(c,!1)||{});let f;try{const u=r.map(async(d,m)=>{const l=i[m];return l!=null&&l.uses&&(l.uses=ne(l.uses)),vt({loader:$.nodes[d],url:c,params:a,route:o,parent:async()=>{const _={};for(let v=0;vd===o.id);if(g){const d=g.layouts;for(let m=0;mo?"1":"0").join(""));const r=await Ot(e.href);if(!r.ok){let o;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?o=await r.json():r.status===404?o="Not Found":r.status===500&&(o="Internal Error"),new et(r.status,o)}return new Promise(async o=>{var h;const i=new Map,s=r.body.getReader(),c=new TextDecoder;function f(g){return Ne(g,{Promise:d=>new Promise((m,l)=>{i.set(d,{fulfil:m,reject:l})})})}let u="";for(;;){const{done:g,value:d}=await s.read();if(g&&!u)break;for(u+=!d&&u?` `:c.decode(d,{stream:!0});;){const m=u.indexOf(` -`);if(m===-1)break;const l=JSON.parse(u.slice(0,m));if(u=u.slice(m+1),l.type==="redirect")return o(l);if(l.type==="data")(h=l.nodes)==null||h.forEach(_=>{(_==null?void 0:_.type)==="data"&&(_.uses=ne(_.uses),_.data=f(_.data))}),o(l);else if(l.type==="chunk"){const{id:_,data:v,error:S}=l,p=i.get(_);i.delete(_),S?p.reject(f(S)):p.fulfil(f(v))}}}})}function ne(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),search_params:new Set((t==null?void 0:t.search_params)??[])}}function Ye(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=document.body,e=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),e!==null?n.setAttribute("tabindex",e):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let o=0;o{if(r.rangeCount===a.length){for(let o=0;o{a=u,o=h});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:e&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:e},willUnload:!n,type:r,complete:i},fulfil:a,reject:o}}export{Xe as a,T as s}; +`);if(m===-1)break;const l=JSON.parse(u.slice(0,m));if(u=u.slice(m+1),l.type==="redirect")return o(l);if(l.type==="data")(h=l.nodes)==null||h.forEach(_=>{(_==null?void 0:_.type)==="data"&&(_.uses=ne(_.uses),_.data=f(_.data))}),o(l);else if(l.type==="chunk"){const{id:_,data:v,error:S}=l,p=i.get(_);i.delete(_),S?p.reject(f(S)):p.fulfil(f(v))}}}})}function ne(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),search_params:new Set((t==null?void 0:t.search_params)??[])}}function Je(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=document.body,e=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),e!==null?n.setAttribute("tabindex",e):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let o=0;o{if(r.rangeCount===a.length){for(let o=0;o{a=u,o=h});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:e&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:e},willUnload:!n,type:r,complete:i},fulfil:a,reject:o}}export{Xe as a,x as s}; diff --git a/_app/immutable/entry/app.46Bka0KH.js b/_app/immutable/entry/app.Ccl2X3Um.js similarity index 93% rename from _app/immutable/entry/app.46Bka0KH.js rename to _app/immutable/entry/app.Ccl2X3Um.js index f751fcf..d370c94 100644 --- a/_app/immutable/entry/app.46Bka0KH.js +++ b/_app/immutable/entry/app.Ccl2X3Um.js @@ -1,7 +1,7 @@ -import{a as A,b as B,o as U,d as L,t as j}from"../chunks/scheduler.wibOmgHn.js";import{S as M,i as W,s as z,k as d,f as F,g as b,l as p,m as R,n as w,d as g,e as G,c as H,a as J,o as N,p as h,t as K,b as Q,j as X,q as P,r as k,u as v,v as C,w as E,x as y}from"../chunks/index.mQQZ-7su.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},D={},S=function(e,n,i){let s=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link");s=Promise.all(n.map(t=>{if(t=Z(t,i),t in D)return;D[t]=!0;const r=t.endsWith(".css"),l=r?'[rel="stylesheet"]':"";if(!!i)for(let _=c.length-1;_>=0;_--){const m=c[_];if(m.href===t&&(!r||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${l}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":Y,r||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),r)return new Promise((_,m)=>{o.addEventListener("load",_),o.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${t}`)))})}))}return s.then(()=>e()).catch(c=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=c,window.dispatchEvent(t),!t.defaultPrevented)throw c})},re={};function $(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,c(a)),a[12](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[12](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[12](null),e&&y(e,t)}}}function x(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=k(s,c(a)),a[11](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[11](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[11](null),e&&y(e,t)}}}function ee(a){let e,n,i;var s=a[1][1];function c(t,r){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,c(a)),a[10](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][1])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[10](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[10](null),e&&y(e,t)}}}function I(a){let e,n=a[6]&&O(a);return{c(){e=G("div"),n&&n.c(),this.h()},l(i){e=H(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=J(e);n&&n.l(s),s.forEach(g),this.h()},h(){N(e,"id","svelte-announcer"),N(e,"aria-live","assertive"),N(e,"aria-atomic","true"),h(e,"position","absolute"),h(e,"left","0"),h(e,"top","0"),h(e,"clip","rect(0 0 0 0)"),h(e,"clip-path","inset(50%)"),h(e,"overflow","hidden"),h(e,"white-space","nowrap"),h(e,"width","1px"),h(e,"height","1px")},m(i,s){b(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=O(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&g(e),n&&n.d()}}}function O(a){let e;return{c(){e=K(a[7])},l(n){e=Q(n,a[7])},m(n,i){b(n,e,i)},p(n,i){i&128&&X(e,n[7])},d(n){n&&g(e)}}}function te(a){let e,n,i,s,c;const t=[x,$],r=[];function l(o,_){return o[1][1]?0:1}e=l(a),n=r[e]=t[e](a);let u=a[5]&&I(a);return{c(){n.c(),i=z(),u&&u.c(),s=d()},l(o){n.l(o),i=F(o),u&&u.l(o),s=d()},m(o,_){r[e].m(o,_),b(o,i,_),u&&u.m(o,_),b(o,s,_),c=!0},p(o,[_]){let m=e;e=l(o),e===m?r[e].p(o,_):(P(),p(r[m],1,1,()=>{r[m]=null}),R(),n=r[e],n?n.p(o,_):(n=r[e]=t[e](o),n.c()),w(n,1),n.m(i.parentNode,i)),o[5]?u?u.p(o,_):(u=I(o),u.c(),u.m(s.parentNode,s)):u&&(u.d(1),u=null)},i(o){c||(w(n),c=!0)},o(o){p(n),c=!1},d(o){o&&(g(i),g(s)),r[e].d(o),u&&u.d(o)}}}function ne(a,e,n){let{stores:i}=e,{page:s}=e,{constructors:c}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:u=null}=e;B(i.page.notify);let o=!1,_=!1,m=null;U(()=>{const f=i.page.subscribe(()=>{o&&(n(6,_=!0),j().then(()=>{n(7,m=document.title||"untitled page")}))});return n(5,o=!0),f});function T(f){L[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function V(f){L[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function q(f){L[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return a.$$set=f=>{"stores"in f&&n(8,i=f.stores),"page"in f&&n(9,s=f.page),"constructors"in f&&n(1,c=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,r=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,u=f.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(s)},[t,c,r,l,u,o,_,m,i,s,T,V,q]}class oe extends M{constructor(e){super(),W(this,e,ne,te,A,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>S(()=>import("../nodes/0.rF-iwD_z.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),()=>S(()=>import("../nodes/1.o9Zo-hF6.js"),__vite__mapDeps([6,1,2,7,4]),import.meta.url),()=>S(()=>import("../nodes/2.lIAty09h.js"),__vite__mapDeps([8,1,2,4,3,9]),import.meta.url)],le=[],fe={"/":[2]},ce={handleError:({error:a})=>{console.error(a)},reroute:()=>{}};export{fe as dictionary,ce as hooks,re as matchers,ae as nodes,oe as root,le as server_loads}; +import{a as A,b as B,o as U,d as L,t as j}from"../chunks/scheduler.wibOmgHn.js";import{S as M,i as W,s as z,k as d,f as F,g as b,l as p,m as R,n as w,d as g,e as G,c as H,a as J,o as N,p as h,t as K,b as Q,j as X,q as P,r as k,u as v,v as C,w as E,x as y}from"../chunks/index.mQQZ-7su.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},D={},S=function(e,n,i){let s=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link");s=Promise.all(n.map(t=>{if(t=Z(t,i),t in D)return;D[t]=!0;const r=t.endsWith(".css"),l=r?'[rel="stylesheet"]':"";if(!!i)for(let _=c.length-1;_>=0;_--){const m=c[_];if(m.href===t&&(!r||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${l}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":Y,r||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),r)return new Promise((_,m)=>{o.addEventListener("load",_),o.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${t}`)))})}))}return s.then(()=>e()).catch(c=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=c,window.dispatchEvent(t),!t.defaultPrevented)throw c})},re={};function $(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,c(a)),a[12](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[12](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[12](null),e&&y(e,t)}}}function x(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=k(s,c(a)),a[11](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[11](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[11](null),e&&y(e,t)}}}function ee(a){let e,n,i;var s=a[1][1];function c(t,r){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,c(a)),a[10](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][1])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[10](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[10](null),e&&y(e,t)}}}function I(a){let e,n=a[6]&&O(a);return{c(){e=G("div"),n&&n.c(),this.h()},l(i){e=H(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=J(e);n&&n.l(s),s.forEach(g),this.h()},h(){N(e,"id","svelte-announcer"),N(e,"aria-live","assertive"),N(e,"aria-atomic","true"),h(e,"position","absolute"),h(e,"left","0"),h(e,"top","0"),h(e,"clip","rect(0 0 0 0)"),h(e,"clip-path","inset(50%)"),h(e,"overflow","hidden"),h(e,"white-space","nowrap"),h(e,"width","1px"),h(e,"height","1px")},m(i,s){b(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=O(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&g(e),n&&n.d()}}}function O(a){let e;return{c(){e=K(a[7])},l(n){e=Q(n,a[7])},m(n,i){b(n,e,i)},p(n,i){i&128&&X(e,n[7])},d(n){n&&g(e)}}}function te(a){let e,n,i,s,c;const t=[x,$],r=[];function l(o,_){return o[1][1]?0:1}e=l(a),n=r[e]=t[e](a);let u=a[5]&&I(a);return{c(){n.c(),i=z(),u&&u.c(),s=d()},l(o){n.l(o),i=F(o),u&&u.l(o),s=d()},m(o,_){r[e].m(o,_),b(o,i,_),u&&u.m(o,_),b(o,s,_),c=!0},p(o,[_]){let m=e;e=l(o),e===m?r[e].p(o,_):(P(),p(r[m],1,1,()=>{r[m]=null}),R(),n=r[e],n?n.p(o,_):(n=r[e]=t[e](o),n.c()),w(n,1),n.m(i.parentNode,i)),o[5]?u?u.p(o,_):(u=I(o),u.c(),u.m(s.parentNode,s)):u&&(u.d(1),u=null)},i(o){c||(w(n),c=!0)},o(o){p(n),c=!1},d(o){o&&(g(i),g(s)),r[e].d(o),u&&u.d(o)}}}function ne(a,e,n){let{stores:i}=e,{page:s}=e,{constructors:c}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:u=null}=e;B(i.page.notify);let o=!1,_=!1,m=null;U(()=>{const f=i.page.subscribe(()=>{o&&(n(6,_=!0),j().then(()=>{n(7,m=document.title||"untitled page")}))});return n(5,o=!0),f});function T(f){L[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function V(f){L[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function q(f){L[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return a.$$set=f=>{"stores"in f&&n(8,i=f.stores),"page"in f&&n(9,s=f.page),"constructors"in f&&n(1,c=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,r=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,u=f.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(s)},[t,c,r,l,u,o,_,m,i,s,T,V,q]}class oe extends M{constructor(e){super(),W(this,e,ne,te,A,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>S(()=>import("../nodes/0.kGZKXzRR.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),()=>S(()=>import("../nodes/1.ODiwzhy-.js"),__vite__mapDeps([6,1,2,7,4]),import.meta.url),()=>S(()=>import("../nodes/2.Odz4Q0fB.js"),__vite__mapDeps([8,1,2,4,3,9]),import.meta.url)],le=[],fe={"/":[2]},ce={handleError:({error:a})=>{console.error(a)},reroute:()=>{}};export{fe as dictionary,ce as hooks,re as matchers,ae as nodes,oe as root,le as server_loads}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["../nodes/0.rF-iwD_z.js","../chunks/scheduler.wibOmgHn.js","../chunks/index.mQQZ-7su.js","../chunks/mode.GmPMGUR4.js","../chunks/index.NY8kyXAF.js","../assets/0.D8FRstQi.css","../nodes/1.o9Zo-hF6.js","../chunks/entry.dqFI3o1w.js","../nodes/2.lIAty09h.js","../assets/2.26kbxIwP.css"] + __vite__mapDeps.viteFileDeps = ["../nodes/0.kGZKXzRR.js","../chunks/scheduler.wibOmgHn.js","../chunks/index.mQQZ-7su.js","../chunks/mode.GmPMGUR4.js","../chunks/index.NY8kyXAF.js","../assets/0.jrQgBrF_.css","../nodes/1.ODiwzhy-.js","../chunks/entry.Z9mBvn4y.js","../nodes/2.Odz4Q0fB.js","../assets/2.26kbxIwP.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/_app/immutable/entry/start.0oMfLCAQ.js b/_app/immutable/entry/start.0oMfLCAQ.js new file mode 100644 index 0000000..82fdce9 --- /dev/null +++ b/_app/immutable/entry/start.0oMfLCAQ.js @@ -0,0 +1 @@ +import{a as t}from"../chunks/entry.Z9mBvn4y.js";export{t as start}; diff --git a/_app/immutable/entry/start.EA8FFi0D.js b/_app/immutable/entry/start.EA8FFi0D.js deleted file mode 100644 index 866b055..0000000 --- a/_app/immutable/entry/start.EA8FFi0D.js +++ /dev/null @@ -1 +0,0 @@ -import{a as t}from"../chunks/entry.dqFI3o1w.js";export{t as start}; diff --git a/_app/immutable/nodes/0.rF-iwD_z.js b/_app/immutable/nodes/0.kGZKXzRR.js similarity index 100% rename from _app/immutable/nodes/0.rF-iwD_z.js rename to _app/immutable/nodes/0.kGZKXzRR.js diff --git a/_app/immutable/nodes/1.o9Zo-hF6.js b/_app/immutable/nodes/1.ODiwzhy-.js similarity index 93% rename from _app/immutable/nodes/1.o9Zo-hF6.js rename to _app/immutable/nodes/1.ODiwzhy-.js index 08be1aa..cafb78b 100644 --- a/_app/immutable/nodes/1.o9Zo-hF6.js +++ b/_app/immutable/nodes/1.ODiwzhy-.js @@ -1 +1 @@ -import{a as S,n as _,c as x}from"../chunks/scheduler.wibOmgHn.js";import{S as j,i as q,e as f,t as d,s as y,c as g,a as h,b as v,d as u,f as C,g as m,h as $,j as E}from"../chunks/index.mQQZ-7su.js";import{s as H}from"../chunks/entry.dqFI3o1w.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 x(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,S,{})}};export{F as component}; +import{a as S,n as _,c as x}from"../chunks/scheduler.wibOmgHn.js";import{S as j,i as q,e as f,t as d,s as y,c as g,a as h,b as v,d as u,f as C,g as m,h as $,j as E}from"../chunks/index.mQQZ-7su.js";import{s as H}from"../chunks/entry.Z9mBvn4y.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 x(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,S,{})}};export{F as component}; diff --git a/_app/immutable/nodes/2.lIAty09h.js b/_app/immutable/nodes/2.Odz4Q0fB.js similarity index 93% rename from _app/immutable/nodes/2.lIAty09h.js rename to _app/immutable/nodes/2.Odz4Q0fB.js index 8dde26d..0101241 100644 --- a/_app/immutable/nodes/2.lIAty09h.js +++ b/_app/immutable/nodes/2.Odz4Q0fB.js @@ -1,15 +1,15 @@ -import{a as Mr,z as Bi,A as qn,B as lu,C as Xe,d as Ls,e as kl,u as wl,f as xl,h as Sl,r as Ro,D as Tf,i as Of,o as Af,n as Mn}from"../chunks/scheduler.wibOmgHn.js";import{S as Po,i as Lo,k as hr,g as ne,q as au,l as le,m as cu,n as se,d as U,e as Se,c as Ce,a as mt,A as zi,B as Ee,u as ge,v as be,w as ye,x as ve,s as de,f as fe,o as lt,p as Ef,h as ce,t as $e,b as Be,C as gn}from"../chunks/index.mQQZ-7su.js";import{r as uu}from"../chunks/index.NY8kyXAF.js";import{t as Nf}from"../chunks/mode.GmPMGUR4.js";function Cl(n,e){const t={},r={},i={$$scope:1};let o=n.length;for(;o--;){const s=n[o],l=e[o];if(l){for(const a in s)a in l||(r[a]=1);for(const a in l)i[a]||(t[a]=l[a],i[a]=1);n[o]=l}else for(const a in s)i[a]=1}for(const s in r)s in t||(t[s]=void 0);return t}function Df(n){return typeof n=="object"&&n!==null?n:{}}function Re(n){this.content=n}Re.prototype={constructor:Re,find:function(n){for(var e=0;e>1}};Re.from=function(n){if(n instanceof Re)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Re(e)};function du(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=du(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function fu(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){t-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let c=0,u=Math.min(s.text.length,l.text.length);for(;ce&&r(a,i+l,o||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);oe)for(let o=0,s=0;se&&((st)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),i+=l.nodeSize),s=a}return new T(r,i)}cutByIndex(e,t){return e==t?T.empty:e==0&&t==this.content.length?this:new T(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new T(i,o)}addToStart(e){return new T([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new T(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||t>0?vi(r+1,s):vi(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return T.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new T(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return T.empty;let t,r=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-i.type.rank),t}};ue.none=[];class _i extends Error{}class I{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=hu(this.content,e+this.openStart,t);return r&&new I(r,this.openStart,this.openEnd)}removeBetween(e,t){return new I(pu(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return I.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new I(T.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new I(e,r,i)}}I.empty=new I(T.empty,0,0);function pu(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(i==e||o.isText){if(l!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(pu(o.content,e-i-1,t-i-1)))}function hu(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=hu(s.content,e-o-1,t);return l&&n.replaceChild(i,s.copy(l))}function If(n,e,t){if(t.openStart>n.depth)throw new _i("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new _i("Inconsistent open depths");return mu(n,e,t,0)}function mu(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Vr(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(_n(n.nodeAfter,r),o++));for(let l=o;li&&Bs(n,e,i+1),s=r.depth>i&&Bs(t,r,i+1),l=[];return Vr(null,n,i,l),o&&s&&e.index(i)==t.index(i)?(gu(o,s),_n(Hn(o,bu(n,e,t,r,i+1)),l)):(o&&_n(Hn(o,Hi(n,e,i+1)),l),Vr(e,t,i,l),s&&_n(Hn(s,Hi(t,r,i+1)),l)),Vr(r,null,i,l),new T(l)}function Hi(n,e,t){let r=[];if(Vr(null,n,t,r),n.depth>t){let i=Bs(n,e,t+1);_n(Hn(i,Hi(n,e,t+1)),r)}return Vr(e,null,t,r),new T(r)}function Rf(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(T.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Qr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Vi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(o),c=o-a;if(r.push(s,l,i+a),!c||(s=s.child(l),s.isText))break;o=c-1,i+=a+1}return new Qr(t,r,o)}static resolveCached(e,t){for(let i=0;ie&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),yu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=T.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=T.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Vn.prototype.text=void 0;class ji extends Vn{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):yu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ji(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ji(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function yu(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Kn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new $f(e,t);if(r.next==null)return Kn.empty;let i=vu(r);r.next&&r.err("Unexpected trailing text");let o=jf(Vf(i));return Wf(o,r),o}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` +import{a as Mr,z as Bi,A as qn,B as lu,C as Xe,d as Ls,e as kl,u as wl,f as xl,h as Sl,r as Ro,D as Tf,i as Of,o as Ef,n as Mn}from"../chunks/scheduler.wibOmgHn.js";import{S as Po,i as Lo,k as hr,g as ne,q as au,l as le,m as cu,n as se,d as U,e as Se,c as Ce,a as mt,A as zi,B as Ae,u as ge,v as be,w as ye,x as ve,s as de,f as fe,o as lt,p as Af,h as ce,t as $e,b as Be,C as gn}from"../chunks/index.mQQZ-7su.js";import{r as uu}from"../chunks/index.NY8kyXAF.js";import{t as Nf}from"../chunks/mode.GmPMGUR4.js";function Cl(n,e){const t={},r={},i={$$scope:1};let o=n.length;for(;o--;){const s=n[o],l=e[o];if(l){for(const a in s)a in l||(r[a]=1);for(const a in l)i[a]||(t[a]=l[a],i[a]=1);n[o]=l}else for(const a in s)i[a]=1}for(const s in r)s in t||(t[s]=void 0);return t}function Df(n){return typeof n=="object"&&n!==null?n:{}}function Re(n){this.content=n}Re.prototype={constructor:Re,find:function(n){for(var e=0;e>1}};Re.from=function(n){if(n instanceof Re)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Re(e)};function du(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=du(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function fu(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){t-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let c=0,u=Math.min(s.text.length,l.text.length);for(;ce&&r(a,i+l,o||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);oe)for(let o=0,s=0;se&&((st)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),i+=l.nodeSize),s=a}return new T(r,i)}cutByIndex(e,t){return e==t?T.empty:e==0&&t==this.content.length?this:new T(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new T(i,o)}addToStart(e){return new T([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new T(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||t>0?vi(r+1,s):vi(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return T.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new T(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return T.empty;let t,r=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-i.type.rank),t}};ue.none=[];class _i extends Error{}class I{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=hu(this.content,e+this.openStart,t);return r&&new I(r,this.openStart,this.openEnd)}removeBetween(e,t){return new I(pu(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return I.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new I(T.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new I(e,r,i)}}I.empty=new I(T.empty,0,0);function pu(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(i==e||o.isText){if(l!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(pu(o.content,e-i-1,t-i-1)))}function hu(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=hu(s.content,e-o-1,t);return l&&n.replaceChild(i,s.copy(l))}function If(n,e,t){if(t.openStart>n.depth)throw new _i("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new _i("Inconsistent open depths");return mu(n,e,t,0)}function mu(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Vr(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(_n(n.nodeAfter,r),o++));for(let l=o;li&&Bs(n,e,i+1),s=r.depth>i&&Bs(t,r,i+1),l=[];return Vr(null,n,i,l),o&&s&&e.index(i)==t.index(i)?(gu(o,s),_n(Hn(o,bu(n,e,t,r,i+1)),l)):(o&&_n(Hn(o,Hi(n,e,i+1)),l),Vr(e,t,i,l),s&&_n(Hn(s,Hi(t,r,i+1)),l)),Vr(r,null,i,l),new T(l)}function Hi(n,e,t){let r=[];if(Vr(null,n,t,r),n.depth>t){let i=Bs(n,e,t+1);_n(Hn(i,Hi(n,e,t+1)),r)}return Vr(e,null,t,r),new T(r)}function Rf(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(T.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Qr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Vi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(o),c=o-a;if(r.push(s,l,i+a),!c||(s=s.child(l),s.isText))break;o=c-1,i+=a+1}return new Qr(t,r,o)}static resolveCached(e,t){for(let i=0;ie&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),yu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=T.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=T.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Vn.prototype.text=void 0;class ji extends Vn{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):yu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ji(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ji(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function yu(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Kn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new $f(e,t);if(r.next==null)return Kn.empty;let i=vu(r);r.next&&r.err("Unexpected trailing text");let o=jf(Vf(i));return Wf(o,r),o}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` `)}}Kn.empty=new Kn(!0);class $f{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function vu(n){let e=[];do e.push(Bf(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Bf(n){let e=[];do e.push(zf(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function zf(n){let e=Hf(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Ff(n,e);else break;return e}function fa(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Ff(n,e){let t=fa(n),r=t;return n.eat(",")&&(n.next!="}"?r=fa(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function _f(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let s=t[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Hf(n){if(n.eat("(")){let e=vu(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=_f(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Vf(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function i(s,l){s.forEach(a=>a.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(o(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=o(s.exprs[a],l);if(a==s.exprs.length-1)return c;i(c,l=t())}else if(s.type=="star"){let a=t();return r(l,a),i(o(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=t();return i(o(s.expr,l),a),i(o(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c{n[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u{c||i.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new Kn(r.indexOf(n.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[o]=new Cu(o,t,s));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Uf{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class $o{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Su(i.attrs),this.excluded=null;let o=wu(this.attrs);this.instance=o?new ue(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ue(this,xu(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new $o(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t-1}}class qf{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Re.from(e.nodes),t.marks=Re.from(e.marks||{}),this.nodes=ha.compile(this.spec.nodes,this),this.marks=$o.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;o.contentMatch=r[s]||(r[s]=Kn.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=l=="_"?null:l?ma(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:ma(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ha){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new ji(r,r.defaultAttrs,e,ue.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Vn.fromJSON(this,e)}markFromJSON(e){return ue.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function ma(n,e){let t=[];for(let r=0;r-1)&&t.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}let Ml=class Fs{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new ba(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new ba(this,t,!0);return r.addAll(e,t.from,t.to),I.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(s.getAttrs){let a=s.getAttrs(t);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=ya(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=ya(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Fs(e,Fs.schemaRules(e)))}};const Mu={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Kf={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Tu={ol:!0,ul:!0},Wi=1,Ui=2,jr=4;function ga(n,e,t){return e!=null?(e?Wi:0)|(e==="full"?Ui:0):n&&n.whitespace=="pre"?Wi|Ui:t&~jr}class ki{constructor(e,t,r,i,o,s,l){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=l,this.content=[],this.activeMarks=ue.none,this.stashMarks=[],this.match=s||(l&jr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(T.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Wi)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=T.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(T.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;tthis.addAll(e)),s&&this.sync(l),this.needsBlock=a}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=ue.none,r=ue.none;for(let i=0;i{s.clearMark(l)&&(r=l.addToSet(r))}):t=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(t),s.consuming===!1)o=s;else break}return[t,r]}addElementByRule(e,t,r){let i,o,s;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(s=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(s));let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!t||t.length>s.length)&&(t=s,r=o,!s.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;ithis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;a--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=Qf(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==t)break}}}function Jf(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Tu.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Gf(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Yf(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function ya(n){let e={};for(let t in n)e[t]=n[t];return e}function Xf(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=l=>{o.push(l);for(let a=0;a{if(o.length||s.marks.length){let l=0,a=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Ft.renderSpec(rs(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?e.createElementNS(r,i):e.createElement(i),a=t[1],c=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){c=2;for(let u in a)if(a[u]!=null){let d=u.indexOf(" ");d>0?l.setAttributeNS(u.slice(0,d),u.slice(d+1),a[u]):l.setAttribute(u,a[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:p}=Ft.renderSpec(e,d,r);if(l.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:l,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ft(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=va(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return va(e.marks)}}function va(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function rs(n){return n.document||window.document}const Ou=65535,Au=Math.pow(2,16);function Zf(n,e){return n+e*Au}function ka(n){return n&Ou}function ep(n){return(n-(n&Ou))/Au}const Eu=1,Nu=2,Di=4,Du=8;class _s{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Du)>0}get deletedBefore(){return(this.delInfo&(Eu|Di))>0}get deletedAfter(){return(this.delInfo&(Nu|Di))>0}get deletedAcross(){return(this.delInfo&Di)>0}}class at{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&at.empty)return at.empty}recover(e){let t=0,r=ka(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[l+o],u=this.ranges[l+s],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,p=a+i+(f<0?0:u);if(r)return p;let h=e==(t<0?a:d)?null:Zf(l/3,e-a),m=e==a?Nu:e==d?Eu:Di;return(t<0?e!=a:e!=d)&&(m|=Du),new _s(p,m,h)}i+=u-c}return r?e+i:new _s(e+i,0,null)}touches(e,t){let r=0,i=ka(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+o],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new ur;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;ro&&a!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),t.openStart,t.openEnd);return Te.fromReplace(e,this.from,this.to,o)}invert(){return new _t(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new bn(t.pos,r.pos,this.mark)}merge(e){return e instanceof bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new bn(t.from,t.to,e.markFromJSON(t.mark))}}je.jsonID("addMark",bn);class _t extends je{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new I(Tl(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Te.fromReplace(e,this.from,this.to,r)}invert(){return new bn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new _t(t.pos,r.pos,this.mark)}merge(e){return e instanceof _t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new _t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new _t(t.from,t.to,e.markFromJSON(t.mark))}}je.jsonID("removeMark",_t);class yn extends je{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Te.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Te.fromReplace(e,this.pos,this.pos+1,new I(T.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;ir.pos?null:new Ne(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ne(t.from,t.to,t.gapFrom,t.gapTo,I.fromJSON(e,t.slice),t.insert,!!t.structure)}}je.jsonID("replaceAround",Ne);function Hs(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function tp(n,e,t,r){let i=[],o=[],s,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+a.nodeSize,t),h=r.addToSet(d);for(let m=0;mn.step(a)),o.forEach(a=>n.step(a))}function np(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof $o){let c=s.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,t);for(let u=0;un.step(new _t(s.from,s.to,s.style)))}function rp(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)n.step(o[l])}function ip(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Tr(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),s=n.$to.indexAfter(r);if(rt;h--)m||r.index(h)>0?(m=!0,u=T.from(r.node(h).copy(u)),d++):a--;let f=T.empty,p=0;for(let h=o,m=!1;h>t;h--)m||i.after(h+1)=0;s--){if(r.size){let l=t[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=T.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new Ne(i,o,i,o,new I(r,0,0),t.length,!0))}function cp(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&up(n.doc,n.mapping.slice(o).map(l),r)){n.clearIncompatible(n.mapping.slice(o).map(l,1),r);let a=n.mapping.slice(o),c=a.map(l,1),u=a.map(l+s.nodeSize,1);return n.step(new Ne(c,u,c+1,u-1,new I(T.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function up(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function dp(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let s=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,s);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Ne(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new I(T.from(s),0,0),1,!0))}function dr(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=t-2;c>o;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function fp(n,e,t=1,r){let i=n.doc.resolve(e),o=T.empty,s=T.empty;for(let l=i.depth,a=i.depth-t,c=t-1;l>a;l--,c--){o=T.from(i.node(l).copy(o));let u=r&&r[c];s=T.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}n.step(new Pe(e,e,new I(o.append(s),t,t),!0))}function Tn(n,e){let t=n.resolve(e),r=t.index();return Iu(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Iu(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function Bo(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):t>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Iu(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function pp(n,e,t){let r=new Pe(e-t,e+t,I.empty,!0);n.step(r)}function hp(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(a,a,i);else{let d=c.contentMatchAt(a).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Al(n,e,t=e,r=I.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return Pu(i,o,r)?new Pe(e,t,r):new mp(i,o,r).fit()}function Pu(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class mp{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=T.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=T.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let a=new I(o,s,l);return e>-1?new Ne(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new Pe(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=ss(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(T.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:d};if(t==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=ss(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new I(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=ss(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new I(Fr(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new I(Fr(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let m=0;m1||a==0||m.content.size)&&(d=g,u.push(Lu(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?p:-1)))}let h=c==l.childCount;h||(p=-1),this.placed=_r(this.placed,t,T.from(u)),this.frontier[t].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t=0;l--){let{match:a,type:c}=this.frontier[l],u=ls(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=_r(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=_r(this.placed,this.depth,T.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(T.empty,!0);t.childCount&&(this.placed=_r(this.placed,this.frontier.length,t))}}function Fr(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Fr(n.firstChild.content,e-1,t)))}function _r(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(_r(n.lastChild.content,e-1,t)))}function ss(n,e){for(let t=0;t1&&(r=r.replaceChild(0,Lu(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(T.empty,!0)))),n.copy(r)}function ls(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!gp(t,o.content,s)?l:null}function gp(n,e,t){for(let r=t;r0;f--,p--){let h=i.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?l=f:i.before(f)==p&&s.splice(1,0,-f)}let a=s.indexOf(l),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=bp(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(l)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(n.replace(e,t,r),!(n.steps.length>d));f--){let p=s[f];p<0||(e=i.before(p),t=o.after(p))}}function $u(n,e,t,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(T.empty,!0))}return n}function vp(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=hp(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new I(T.from(r),0,0))}function kp(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Bu(r,i);for(let s=0;s0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return n.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&t>r.end(s)&&i.end(s)-t!=i.depth-s)return n.delete(r.before(s),t);n.delete(e,t)}function Bu(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(oe.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class fr extends je{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Te.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Te.fromReplace(e,this.pos,this.pos+1,new I(T.from(i),0,t.isLeaf?0:1))}getMap(){return at.empty}invert(e){return new fr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new fr(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fr(t.pos,t.attr,t.value)}}je.jsonID("attr",fr);class Zr extends je{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Te.ok(r)}getMap(){return at.empty}invert(e){return new Zr(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Zr(t.attr,t.value)}}je.jsonID("docAttr",Zr);let gr=class extends Error{};gr=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};gr.prototype=Object.create(Error.prototype);gr.prototype.constructor=gr;gr.prototype.name="TransformError";class zu{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ur}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new gr(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=I.empty){let i=Al(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new I(T.from(r),0,0))}delete(e,t){return this.replace(e,t,I.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return yp(this,e,t,r),this}replaceRangeWith(e,t,r){return vp(this,e,t,r),this}deleteRange(e,t){return kp(this,e,t),this}lift(e,t){return op(this,e,t),this}join(e,t=1){return pp(this,e,t),this}wrap(e,t){return ap(this,e,t),this}setBlockType(e,t=e,r,i=null){return cp(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return dp(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new fr(e,t,r)),this}setDocAttribute(e,t){return this.step(new Zr(e,t)),this}addNodeMark(e,t){return this.step(new yn(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ue)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new mr(e,t)),this}split(e,t=1,r){return fp(this,e,t,r),this}addMark(e,t,r){return tp(this,e,t,r),this}removeMark(e,t,r){return np(this,e,t,r),this}clearIncompatible(e,t,r){return rp(this,e,t,r),this}}const as=Object.create(null);class Z{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new wp(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;o--){let s=t<0?ir(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):ir(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Ot(e.node(0))}static atStart(e){return ir(e,e,0,0,1)||new Ot(e)}static atEnd(e){return ir(e,e,e.content.size,e.childCount,-1)||new Ot(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=as[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in as)throw new RangeError("Duplicate use of selection JSON ID "+e);return as[e]=t,t.prototype.jsonID=e,t}getBookmark(){return G.between(this.$anchor,this.$head).getBookmark()}}Z.prototype.visible=!0;class wp{constructor(e,t){this.$from=e,this.$to=t}}let xa=!1;function Sa(n){!xa&&!n.parent.inlineContent&&(xa=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class G extends Z{constructor(e,t=e){Sa(e),Sa(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return Z.near(r);let i=e.resolve(t.map(this.anchor));return new G(i.parent.inlineContent?i:r,r)}replace(e,t=I.empty){if(super.replace(e,t),t==I.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof G&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new zo(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new G(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=Z.findFrom(t,r,!0)||Z.findFrom(t,-r,!0);if(o)t=o.$head;else return Z.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(Z.findFrom(e,-r,!0)||Z.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&j.isSelectable(l))return j.create(n,t-(i<0?l.nodeSize:0))}else{let a=ir(n,l,t+i,i<0?l.childCount:0,i,o);if(a)return a}t+=l.nodeSize*i}return null}function Ca(n,e,t){let r=n.steps.length-1;if(r{s==null&&(s=u)}),n.setSelection(Z.near(n.doc.resolve(s),t))}const Ma=1,wi=2,Ta=4;class Sp extends zu{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=wi,this}ensureMarks(e){return ue.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&wi)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~wi,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ue.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(Z.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ta,this}get scrolledIntoView(){return(this.updated&Ta)>0}}function Oa(n,e){return!e||!n?n:n.bind(e)}class Hr{constructor(e,t,r){this.name=e,this.init=Oa(t.init,r),this.apply=Oa(t.apply,r)}}const Cp=[new Hr("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Hr("selection",{init(n,e){return n.selection||Z.atStart(e.doc)},apply(n){return n.selection}}),new Hr("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Hr("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class cs{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Cp.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Hr(r.key,r.spec.state,r))})}}class ar{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new cs(e.schema,e.plugins),o=new ar(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Vn.fromJSON(e.schema,t.doc);else if(s.name=="selection")o.selection=Z.fromJSON(o.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){o[s.name]=c.fromJSON.call(a,e,t[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function Fu(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Fu(i,e,{})),t[r]=i}return t}class We{constructor(e){this.spec=e,this.props={},e.props&&Fu(e.props,this,this.props),this.key=e.key?e.key.key:_u("plugin")}getState(e){return e[this.key]}}const us=Object.create(null);function _u(n){return n in us?n+"$"+ ++us[n]:(us[n]=0,n+"$")}class wt{constructor(e="key"){this.key=_u(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ke=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},ei=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Aa=null;const Qt=function(n,e,t){let r=Aa||(Aa=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Jn=function(n,e,t,r){return t&&(Ea(n,e,t,r,-1)||Ea(n,e,t,r,1))},Mp=/^(img|br|input|textarea|hr)$/i;function Ea(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:zt(n))){let o=n.parentNode;if(!o||o.nodeType!=1||Nl(n)||Mp.test(n.nodeName)||n.contentEditable=="false")return!1;e=Ke(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?zt(n):0}else return!1}}function zt(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Tp(n,e,t){for(let r=e==0,i=e==zt(n);r||i;){if(n==t)return!0;let o=Ke(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==zt(n)}}function Nl(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Fo=function(n){return n.focusNode&&Jn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Pn(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function Op(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Ap(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:r.startOffset}}}const Vt=typeof navigator<"u"?navigator:null,Na=typeof document<"u"?document:null,On=Vt&&Vt.userAgent||"",Vs=/Edge\/(\d+)/.exec(On),Hu=/MSIE \d/.exec(On),js=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(On),Ze=!!(Hu||js||Vs),kn=Hu?document.documentMode:js?+js[1]:Vs?+Vs[1]:0,At=!Ze&&/gecko\/(\d+)/i.test(On);At&&+(/Firefox\/(\d+)/.exec(On)||[0,0])[1];const Ws=!Ze&&/Chrome\/(\d+)/.exec(On),He=!!Ws,Ep=Ws?+Ws[1]:0,Je=!Ze&&!!Vt&&/Apple Computer/.test(Vt.vendor),br=Je&&(/Mobile\/\w+/.test(On)||!!Vt&&Vt.maxTouchPoints>2),ht=br||(Vt?/Mac/.test(Vt.platform):!1),Np=Vt?/Win/.test(Vt.platform):!1,Ct=/Android \d/.test(On),di=!!Na&&"webkitFontSmoothing"in Na.documentElement.style,Dp=di?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ip(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Gt(n,e){return typeof n=="number"?n:n[e]}function Rp(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function Da(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;s=ei(s)){if(s.nodeType!=1)continue;let l=s,a=l==o.body,c=a?Ip(o):Rp(l),u=0,d=0;if(e.topc.bottom-Gt(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Gt(i,"top")-c.top:e.bottom-c.bottom+Gt(i,"bottom")),e.leftc.right-Gt(r,"right")&&(u=e.right-c.right+Gt(i,"right")),u||d)if(a)o.defaultView.scrollBy(u,d);else{let f=l.scrollLeft,p=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let h=l.scrollLeft-f,m=l.scrollTop-p;e={left:e.left-h,top:e.top-m,right:e.right-h,bottom:e.bottom-m}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Pp(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=t+1;s=t-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:Vu(n.dom)}}function Vu(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=ei(r));return e}function Lp({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;ju(t,r==0?0:r-e)}function ju(n,e){for(let t=0;t=l){s=Math.max(h.bottom,s),l=Math.min(h.top,l);let m=h.left>e.left?h.left-e.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!a&&h.left<=e.left&&h.right>=e.left&&(a=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!t&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=d+1)}}return!t&&a&&(t=a,i=c,r=0),t&&t.nodeType==3?Bp(t,i):!t||r&&t.nodeType==1?{node:n,offset:o}:Wu(t,i)}function Bp(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function Dl(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function zp(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}function _p(n,e,t,r){let i=-1;for(let o=e,s=!1;o!=n.dom;){let l=n.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!s||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!s&&(s=!0,a.left>r.left||a.top>r.top?i=l.posBefore:(a.right-1?i:n.docView.posFromDOM(e,t,-1)}function Uu(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&i++}let c;di&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=_p(n,r,i,e))}l==null&&(l=Fp(n,s,e));let a=n.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Ia(n){return n.top=0&&i==r.nodeValue.length?(a--,u=1):t<0?a--:c++,Ir(un(Qt(r,a,c),u),u<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==zt(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return ds(a.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(t<0||i==zt(r))){let a=r.childNodes[i-1],c=a.nodeType==3?Qt(a,zt(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return Ir(un(c,1),!1)}if(o==null&&i=0)}function Ir(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function ds(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Ku(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function jp(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return Ku(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=qu(n,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Qt(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const Wp=/[\u0590-\u08ac]/;function Up(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=n.domSelection();return!Wp.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?o:s:Ku(n,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",t,"character");let p=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:h,focusOffset:m}=n.domSelectionRange(),g=h&&!p.contains(h.nodeType==1?h:h.parentNode)||a==h&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),g})}let Ra=null,Pa=null,La=!1;function qp(n,e,t){return Ra==e&&Pa==t?La:(Ra=e,Pa=t,La=t=="up"||t=="down"?jp(n,e,t):Up(n,e,t))}const bt=0,$a=1,Ln=2,jt=3;class fi{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=bt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tKe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!t||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||s instanceof Gu){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Ju&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?Ke(o.dom)+1:0}}else{let o,s=!0;for(;o=r=u&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=s;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Ke(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>t||l==this.children.length-1)){t=c;for(let u=l+1;up&&st){let p=l;l=a,a=p}let f=document.createRange();f.setEnd(a.node,a.offset),f.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i=r:er){let l=r+o.border,a=s-o.border;if(e>=l&&t<=a){this.dirty=e==r||t==s?Ln:$a,e==l&&t==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=jt:o.markDirty(e-l,t-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Ln:jt}r=s}this.dirty=Ln}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Ln:$a;t.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!t.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==bt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Kp extends fi{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Gn extends fi{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return(!s||!s.dom)&&(s=Ft.renderSpec(document,t.type.spec.toDOM(t,r))),new Gn(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&jt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=jt&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=bt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Ks(o,0,e,r));for(let l=0;l{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Ft.renderSpec(document,t.type.spec.toDOM(t)));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Qu(u,r,t),c?a=new Jp(e,t,r,i,u,d||null,f,c,o,s+1):t.isText?new _o(e,t,r,i,u,f,o):new wn(e,t,r,i,u,d||null,f,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>T.empty)}return e}matchesNode(e,t,r){return this.dirty==bt&&e.eq(this.node)&&qs(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new Yp(this,s&&s.node,e);Zp(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?ue.none:this.node.child(u).marks,r,e),a.placeWidget(c,e,i)},(c,u,d,f)=>{a.syncToMarks(c.marks,r,e);let p;a.findNodeMatch(c,u,d,f)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(c,u,d,p,e)||a.updateNextNode(c,u,d,e,f,i)||a.addNode(c,u,d,e,i),i+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Ln)&&(s&&this.protectLocalComposition(e,s),Yu(this.contentDOM,this.children,e),br&&eh(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof G)||rt+this.node.content.size)return null;let o=e.domSelectionRange(),s=th(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let l=s.nodeValue,a=nh(this.node.content,l,r-t,i-t);return a<0?null:{node:s,pos:a,text:l}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new Kp(this,o,t,i);e.input.compositionNodes.push(s),this.children=Ks(this.children,r,r+i.length,e,s)}update(e,t,r,i){return this.dirty==jt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=bt}updateOuterDeco(e){if(qs(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Xu(this.dom,this.nodeDOM,Us(this.outerDeco,this.node,t),Us(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Ba(n,e,t,r,i){Qu(r,e,n);let o=new wn(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class _o extends wn{constructor(e,t,r,i,o,s,l){super(e,t,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==jt||this.dirty!=bt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=bt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=bt,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new _o(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=jt)}get domAtom(){return!1}}class Gu extends fi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==bt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Jp extends wn{constructor(e,t,r,i,o,s,l,a,c,u){super(e,t,r,i,o,s,l,c,u),this.spec=a}update(e,t,r,i){if(this.dirty==jt)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Yu(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=Gn.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let c=t.children[r-1];if(c instanceof Gn)t=c,r=c.children.length;else{l=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=n.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function Qp(n,e){return n.type.side-e.type.side}function Zp(n,e,t,r){let i=e.locals(n),o=0;if(i.length==0){for(let c=0;co;)l.push(i[s++]);let h=o+f.nodeSize;if(f.isText){let g=h;s!g.inline):l.slice();r(f,m,e.forChild(o,f),p),o=h}}function eh(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function th(n,e){for(;;){if(n.nodeType==3)return n;if(n.nodeType==1&&e>0){if(n.childNodes.length>e&&n.childNodes[e].nodeType==3)return n.childNodes[e];n=n.childNodes[e-1],e=zt(n)}else if(n.nodeType==1&&e=t){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l=0&&c+e.length+l>=t)return l+c;if(t==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function Ks(n,e,t,r,i){let o=[];for(let s=0,l=0;s=t||u<=e?o.push(a):(ct&&o.push(a.slice(t-c,a.size,r)))}return o}function Il(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(Fo(t)){for(a=l;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&j.isSelectable(u)&&i.parent&&!(u.isInline&&Tp(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;c=new j(s==d?l:r.resolve(d))}}else{let u=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(u<0)return null;a=r.resolve(u)}if(!c){let u=e=="pointer"||n.state.selection.head{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Zu(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function ih(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,Ke(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Ze&&kn<=11&&(r.disabled=!0,r.disabled=!1)}function ed(n,e){if(e instanceof j){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Va(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Va(n)}function Va(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Rl(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||G.between(e,t,r)}function ja(n){return n.editable&&!n.hasFocus()?!1:td(n)}function td(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function oh(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Jn(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Js(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&Z.findFrom(o,e)}function dn(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Wa(n,e,t){let r=n.state.selection;if(r instanceof G)if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return dn(n,new G(r.$anchor,s))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=Js(n.state,e);return i&&i instanceof j?dn(n,i):!1}else if(!(ht&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=n.docView.descAt(l))&&!s.contentDOM?j.isSelectable(o)?dn(n,new j(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):di?dn(n,new G(n.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof j&&r.node.isInline)return dn(n,new G(e>0?r.$to:r.$from));{let i=Js(n.state,e);return i?dn(n,i):!1}}}function qi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ur(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function nr(n,e){return e<0?sh(n):lh(n)}function sh(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,s=!1;for(At&&t.nodeType==1&&r0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(Ur(l,-1))i=t,o=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(nd(t))break;{let l=t.previousSibling;for(;l&&Ur(l,-1);)i=t.parentNode,o=Ke(l),l=l.previousSibling;if(l)t=l,r=qi(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?Gs(n,t,r):i&&Gs(n,i,o)}function lh(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=qi(t),o,s;for(;;)if(r{n.state==i&&en(n)},50)}function Ua(n,e){let t=n.state.doc.resolve(e);if(!(He||Np)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function qa(n,e,t){let r=n.state.selection;if(r instanceof G&&!r.empty||t.indexOf("s")>-1||ht&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=Js(n.state,e);if(s&&s instanceof j)return dn(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof Ot?Z.near(s,e):Z.findFrom(s,e);return l?dn(n,l):!1}return!1}function Ka(n,e){if(!(n.state.selection instanceof G))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function Ja(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function uh(n){if(!Je||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Ja(n,r,"true"),setTimeout(()=>Ja(n,r,"false"),20)}return!1}function dh(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function fh(n,e){let t=e.keyCode,r=dh(e);if(t==8||ht&&t==72&&r=="c")return Ka(n,-1)||nr(n,-1);if(t==46&&!e.shiftKey||ht&&t==68&&r=="c")return Ka(n,1)||nr(n,1);if(t==13||t==27)return!0;if(t==37||ht&&t==66&&r=="c"){let i=t==37?Ua(n,n.state.selection.from)=="ltr"?-1:1:-1;return Wa(n,i,r)||nr(n,i)}else if(t==39||ht&&t==70&&r=="c"){let i=t==39?Ua(n,n.state.selection.from)=="ltr"?1:-1:1;return Wa(n,i,r)||nr(n,i)}else{if(t==38||ht&&t==80&&r=="c")return qa(n,-1,r)||nr(n,-1);if(t==40||ht&&t==78&&r=="c")return uh(n)||qa(n,1,r)||nr(n,1);if(r==(ht?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function rd(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=n.someProp("clipboardSerializer")||Ft.fromSchema(n.state.schema),l=cd(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=ad[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=l.createElement(u[p]);for(;a.firstChild;)h.appendChild(a.firstChild);a.appendChild(h),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,` +`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=ue.none,r=ue.none;for(let i=0;i{s.clearMark(l)&&(r=l.addToSet(r))}):t=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(t),s.consuming===!1)o=s;else break}return[t,r]}addElementByRule(e,t,r){let i,o,s;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(s=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(s));let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!t||t.length>s.length)&&(t=s,r=o,!s.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;ithis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;a--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=Qf(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==t)break}}}function Jf(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Tu.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Gf(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Yf(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function ya(n){let e={};for(let t in n)e[t]=n[t];return e}function Xf(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=l=>{o.push(l);for(let a=0;a{if(o.length||s.marks.length){let l=0,a=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Ft.renderSpec(rs(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?e.createElementNS(r,i):e.createElement(i),a=t[1],c=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){c=2;for(let u in a)if(a[u]!=null){let d=u.indexOf(" ");d>0?l.setAttributeNS(u.slice(0,d),u.slice(d+1),a[u]):l.setAttribute(u,a[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:p}=Ft.renderSpec(e,d,r);if(l.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:l,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ft(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=va(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return va(e.marks)}}function va(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function rs(n){return n.document||window.document}const Ou=65535,Eu=Math.pow(2,16);function Zf(n,e){return n+e*Eu}function ka(n){return n&Ou}function ep(n){return(n-(n&Ou))/Eu}const Au=1,Nu=2,Di=4,Du=8;class _s{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Du)>0}get deletedBefore(){return(this.delInfo&(Au|Di))>0}get deletedAfter(){return(this.delInfo&(Nu|Di))>0}get deletedAcross(){return(this.delInfo&Di)>0}}class at{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&at.empty)return at.empty}recover(e){let t=0,r=ka(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[l+o],u=this.ranges[l+s],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,p=a+i+(f<0?0:u);if(r)return p;let h=e==(t<0?a:d)?null:Zf(l/3,e-a),m=e==a?Nu:e==d?Au:Di;return(t<0?e!=a:e!=d)&&(m|=Du),new _s(p,m,h)}i+=u-c}return r?e+i:new _s(e+i,0,null)}touches(e,t){let r=0,i=ka(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+o],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new ur;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;ro&&a!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),t.openStart,t.openEnd);return Te.fromReplace(e,this.from,this.to,o)}invert(){return new _t(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new bn(t.pos,r.pos,this.mark)}merge(e){return e instanceof bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new bn(t.from,t.to,e.markFromJSON(t.mark))}}je.jsonID("addMark",bn);class _t extends je{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new I(Tl(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Te.fromReplace(e,this.from,this.to,r)}invert(){return new bn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new _t(t.pos,r.pos,this.mark)}merge(e){return e instanceof _t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new _t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new _t(t.from,t.to,e.markFromJSON(t.mark))}}je.jsonID("removeMark",_t);class yn extends je{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Te.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Te.fromReplace(e,this.pos,this.pos+1,new I(T.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;ir.pos?null:new Ne(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ne(t.from,t.to,t.gapFrom,t.gapTo,I.fromJSON(e,t.slice),t.insert,!!t.structure)}}je.jsonID("replaceAround",Ne);function Hs(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function tp(n,e,t,r){let i=[],o=[],s,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+a.nodeSize,t),h=r.addToSet(d);for(let m=0;mn.step(a)),o.forEach(a=>n.step(a))}function np(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof $o){let c=s.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,t);for(let u=0;un.step(new _t(s.from,s.to,s.style)))}function rp(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)n.step(o[l])}function ip(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Tr(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),s=n.$to.indexAfter(r);if(rt;h--)m||r.index(h)>0?(m=!0,u=T.from(r.node(h).copy(u)),d++):a--;let f=T.empty,p=0;for(let h=o,m=!1;h>t;h--)m||i.after(h+1)=0;s--){if(r.size){let l=t[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=T.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new Ne(i,o,i,o,new I(r,0,0),t.length,!0))}function cp(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&up(n.doc,n.mapping.slice(o).map(l),r)){n.clearIncompatible(n.mapping.slice(o).map(l,1),r);let a=n.mapping.slice(o),c=a.map(l,1),u=a.map(l+s.nodeSize,1);return n.step(new Ne(c,u,c+1,u-1,new I(T.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function up(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function dp(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let s=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,s);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Ne(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new I(T.from(s),0,0),1,!0))}function dr(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=t-2;c>o;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function fp(n,e,t=1,r){let i=n.doc.resolve(e),o=T.empty,s=T.empty;for(let l=i.depth,a=i.depth-t,c=t-1;l>a;l--,c--){o=T.from(i.node(l).copy(o));let u=r&&r[c];s=T.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}n.step(new Pe(e,e,new I(o.append(s),t,t),!0))}function Tn(n,e){let t=n.resolve(e),r=t.index();return Iu(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Iu(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function Bo(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):t>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Iu(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function pp(n,e,t){let r=new Pe(e-t,e+t,I.empty,!0);n.step(r)}function hp(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(a,a,i);else{let d=c.contentMatchAt(a).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function El(n,e,t=e,r=I.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return Pu(i,o,r)?new Pe(e,t,r):new mp(i,o,r).fit()}function Pu(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class mp{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=T.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=T.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let a=new I(o,s,l);return e>-1?new Ne(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new Pe(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=ss(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(T.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:d};if(t==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=ss(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new I(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=ss(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new I(Fr(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new I(Fr(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let m=0;m1||a==0||m.content.size)&&(d=g,u.push(Lu(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?p:-1)))}let h=c==l.childCount;h||(p=-1),this.placed=_r(this.placed,t,T.from(u)),this.frontier[t].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t=0;l--){let{match:a,type:c}=this.frontier[l],u=ls(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=_r(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=_r(this.placed,this.depth,T.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(T.empty,!0);t.childCount&&(this.placed=_r(this.placed,this.frontier.length,t))}}function Fr(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Fr(n.firstChild.content,e-1,t)))}function _r(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(_r(n.lastChild.content,e-1,t)))}function ss(n,e){for(let t=0;t1&&(r=r.replaceChild(0,Lu(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(T.empty,!0)))),n.copy(r)}function ls(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!gp(t,o.content,s)?l:null}function gp(n,e,t){for(let r=t;r0;f--,p--){let h=i.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?l=f:i.before(f)==p&&s.splice(1,0,-f)}let a=s.indexOf(l),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=bp(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(l)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(n.replace(e,t,r),!(n.steps.length>d));f--){let p=s[f];p<0||(e=i.before(p),t=o.after(p))}}function $u(n,e,t,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(T.empty,!0))}return n}function vp(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=hp(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new I(T.from(r),0,0))}function kp(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Bu(r,i);for(let s=0;s0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return n.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&t>r.end(s)&&i.end(s)-t!=i.depth-s)return n.delete(r.before(s),t);n.delete(e,t)}function Bu(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(oe.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class fr extends je{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Te.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Te.fromReplace(e,this.pos,this.pos+1,new I(T.from(i),0,t.isLeaf?0:1))}getMap(){return at.empty}invert(e){return new fr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new fr(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fr(t.pos,t.attr,t.value)}}je.jsonID("attr",fr);class Zr extends je{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Te.ok(r)}getMap(){return at.empty}invert(e){return new Zr(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Zr(t.attr,t.value)}}je.jsonID("docAttr",Zr);let gr=class extends Error{};gr=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};gr.prototype=Object.create(Error.prototype);gr.prototype.constructor=gr;gr.prototype.name="TransformError";class zu{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ur}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new gr(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=I.empty){let i=El(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new I(T.from(r),0,0))}delete(e,t){return this.replace(e,t,I.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return yp(this,e,t,r),this}replaceRangeWith(e,t,r){return vp(this,e,t,r),this}deleteRange(e,t){return kp(this,e,t),this}lift(e,t){return op(this,e,t),this}join(e,t=1){return pp(this,e,t),this}wrap(e,t){return ap(this,e,t),this}setBlockType(e,t=e,r,i=null){return cp(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return dp(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new fr(e,t,r)),this}setDocAttribute(e,t){return this.step(new Zr(e,t)),this}addNodeMark(e,t){return this.step(new yn(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ue)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new mr(e,t)),this}split(e,t=1,r){return fp(this,e,t,r),this}addMark(e,t,r){return tp(this,e,t,r),this}removeMark(e,t,r){return np(this,e,t,r),this}clearIncompatible(e,t,r){return rp(this,e,t,r),this}}const as=Object.create(null);class Z{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new wp(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;o--){let s=t<0?ir(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):ir(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Ot(e.node(0))}static atStart(e){return ir(e,e,0,0,1)||new Ot(e)}static atEnd(e){return ir(e,e,e.content.size,e.childCount,-1)||new Ot(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=as[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in as)throw new RangeError("Duplicate use of selection JSON ID "+e);return as[e]=t,t.prototype.jsonID=e,t}getBookmark(){return G.between(this.$anchor,this.$head).getBookmark()}}Z.prototype.visible=!0;class wp{constructor(e,t){this.$from=e,this.$to=t}}let xa=!1;function Sa(n){!xa&&!n.parent.inlineContent&&(xa=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class G extends Z{constructor(e,t=e){Sa(e),Sa(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return Z.near(r);let i=e.resolve(t.map(this.anchor));return new G(i.parent.inlineContent?i:r,r)}replace(e,t=I.empty){if(super.replace(e,t),t==I.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof G&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new zo(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new G(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=Z.findFrom(t,r,!0)||Z.findFrom(t,-r,!0);if(o)t=o.$head;else return Z.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(Z.findFrom(e,-r,!0)||Z.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&j.isSelectable(l))return j.create(n,t-(i<0?l.nodeSize:0))}else{let a=ir(n,l,t+i,i<0?l.childCount:0,i,o);if(a)return a}t+=l.nodeSize*i}return null}function Ca(n,e,t){let r=n.steps.length-1;if(r{s==null&&(s=u)}),n.setSelection(Z.near(n.doc.resolve(s),t))}const Ma=1,wi=2,Ta=4;class Sp extends zu{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=wi,this}ensureMarks(e){return ue.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&wi)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~wi,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ue.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(Z.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ta,this}get scrolledIntoView(){return(this.updated&Ta)>0}}function Oa(n,e){return!e||!n?n:n.bind(e)}class Hr{constructor(e,t,r){this.name=e,this.init=Oa(t.init,r),this.apply=Oa(t.apply,r)}}const Cp=[new Hr("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Hr("selection",{init(n,e){return n.selection||Z.atStart(e.doc)},apply(n){return n.selection}}),new Hr("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Hr("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class cs{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Cp.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Hr(r.key,r.spec.state,r))})}}class ar{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new cs(e.schema,e.plugins),o=new ar(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Vn.fromJSON(e.schema,t.doc);else if(s.name=="selection")o.selection=Z.fromJSON(o.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){o[s.name]=c.fromJSON.call(a,e,t[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function Fu(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Fu(i,e,{})),t[r]=i}return t}class We{constructor(e){this.spec=e,this.props={},e.props&&Fu(e.props,this,this.props),this.key=e.key?e.key.key:_u("plugin")}getState(e){return e[this.key]}}const us=Object.create(null);function _u(n){return n in us?n+"$"+ ++us[n]:(us[n]=0,n+"$")}class wt{constructor(e="key"){this.key=_u(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ke=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},ei=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Ea=null;const Qt=function(n,e,t){let r=Ea||(Ea=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Jn=function(n,e,t,r){return t&&(Aa(n,e,t,r,-1)||Aa(n,e,t,r,1))},Mp=/^(img|br|input|textarea|hr)$/i;function Aa(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:zt(n))){let o=n.parentNode;if(!o||o.nodeType!=1||Nl(n)||Mp.test(n.nodeName)||n.contentEditable=="false")return!1;e=Ke(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?zt(n):0}else return!1}}function zt(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Tp(n,e,t){for(let r=e==0,i=e==zt(n);r||i;){if(n==t)return!0;let o=Ke(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==zt(n)}}function Nl(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Fo=function(n){return n.focusNode&&Jn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Pn(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function Op(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Ep(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:r.startOffset}}}const Vt=typeof navigator<"u"?navigator:null,Na=typeof document<"u"?document:null,On=Vt&&Vt.userAgent||"",Vs=/Edge\/(\d+)/.exec(On),Hu=/MSIE \d/.exec(On),js=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(On),Ze=!!(Hu||js||Vs),kn=Hu?document.documentMode:js?+js[1]:Vs?+Vs[1]:0,Et=!Ze&&/gecko\/(\d+)/i.test(On);Et&&+(/Firefox\/(\d+)/.exec(On)||[0,0])[1];const Ws=!Ze&&/Chrome\/(\d+)/.exec(On),He=!!Ws,Ap=Ws?+Ws[1]:0,Je=!Ze&&!!Vt&&/Apple Computer/.test(Vt.vendor),br=Je&&(/Mobile\/\w+/.test(On)||!!Vt&&Vt.maxTouchPoints>2),ht=br||(Vt?/Mac/.test(Vt.platform):!1),Np=Vt?/Win/.test(Vt.platform):!1,Ct=/Android \d/.test(On),di=!!Na&&"webkitFontSmoothing"in Na.documentElement.style,Dp=di?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ip(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Gt(n,e){return typeof n=="number"?n:n[e]}function Rp(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function Da(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;s=ei(s)){if(s.nodeType!=1)continue;let l=s,a=l==o.body,c=a?Ip(o):Rp(l),u=0,d=0;if(e.topc.bottom-Gt(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Gt(i,"top")-c.top:e.bottom-c.bottom+Gt(i,"bottom")),e.leftc.right-Gt(r,"right")&&(u=e.right-c.right+Gt(i,"right")),u||d)if(a)o.defaultView.scrollBy(u,d);else{let f=l.scrollLeft,p=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let h=l.scrollLeft-f,m=l.scrollTop-p;e={left:e.left-h,top:e.top-m,right:e.right-h,bottom:e.bottom-m}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Pp(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=t+1;s=t-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:Vu(n.dom)}}function Vu(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=ei(r));return e}function Lp({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;ju(t,r==0?0:r-e)}function ju(n,e){for(let t=0;t=l){s=Math.max(h.bottom,s),l=Math.min(h.top,l);let m=h.left>e.left?h.left-e.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!a&&h.left<=e.left&&h.right>=e.left&&(a=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!t&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=d+1)}}return!t&&a&&(t=a,i=c,r=0),t&&t.nodeType==3?Bp(t,i):!t||r&&t.nodeType==1?{node:n,offset:o}:Wu(t,i)}function Bp(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function Dl(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function zp(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}function _p(n,e,t,r){let i=-1;for(let o=e,s=!1;o!=n.dom;){let l=n.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!s||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!s&&(s=!0,a.left>r.left||a.top>r.top?i=l.posBefore:(a.right-1?i:n.docView.posFromDOM(e,t,-1)}function Uu(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&i++}let c;di&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=_p(n,r,i,e))}l==null&&(l=Fp(n,s,e));let a=n.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Ia(n){return n.top=0&&i==r.nodeValue.length?(a--,u=1):t<0?a--:c++,Ir(un(Qt(r,a,c),u),u<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==zt(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return ds(a.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(t<0||i==zt(r))){let a=r.childNodes[i-1],c=a.nodeType==3?Qt(a,zt(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return Ir(un(c,1),!1)}if(o==null&&i=0)}function Ir(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function ds(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Ku(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function jp(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return Ku(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=qu(n,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Qt(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const Wp=/[\u0590-\u08ac]/;function Up(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=n.domSelection();return!Wp.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?o:s:Ku(n,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",t,"character");let p=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:h,focusOffset:m}=n.domSelectionRange(),g=h&&!p.contains(h.nodeType==1?h:h.parentNode)||a==h&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),g})}let Ra=null,Pa=null,La=!1;function qp(n,e,t){return Ra==e&&Pa==t?La:(Ra=e,Pa=t,La=t=="up"||t=="down"?jp(n,e,t):Up(n,e,t))}const bt=0,$a=1,Ln=2,jt=3;class fi{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=bt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tKe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!t||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||s instanceof Gu){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Ju&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?Ke(o.dom)+1:0}}else{let o,s=!0;for(;o=r=u&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=s;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Ke(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>t||l==this.children.length-1)){t=c;for(let u=l+1;up&&st){let p=l;l=a,a=p}let f=document.createRange();f.setEnd(a.node,a.offset),f.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i=r:er){let l=r+o.border,a=s-o.border;if(e>=l&&t<=a){this.dirty=e==r||t==s?Ln:$a,e==l&&t==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=jt:o.markDirty(e-l,t-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Ln:jt}r=s}this.dirty=Ln}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Ln:$a;t.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!t.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==bt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Kp extends fi{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Gn extends fi{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return(!s||!s.dom)&&(s=Ft.renderSpec(document,t.type.spec.toDOM(t,r))),new Gn(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&jt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=jt&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=bt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Ks(o,0,e,r));for(let l=0;l{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Ft.renderSpec(document,t.type.spec.toDOM(t)));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Qu(u,r,t),c?a=new Jp(e,t,r,i,u,d||null,f,c,o,s+1):t.isText?new _o(e,t,r,i,u,f,o):new wn(e,t,r,i,u,d||null,f,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>T.empty)}return e}matchesNode(e,t,r){return this.dirty==bt&&e.eq(this.node)&&qs(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new Yp(this,s&&s.node,e);Zp(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?ue.none:this.node.child(u).marks,r,e),a.placeWidget(c,e,i)},(c,u,d,f)=>{a.syncToMarks(c.marks,r,e);let p;a.findNodeMatch(c,u,d,f)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(c,u,d,p,e)||a.updateNextNode(c,u,d,e,f,i)||a.addNode(c,u,d,e,i),i+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Ln)&&(s&&this.protectLocalComposition(e,s),Yu(this.contentDOM,this.children,e),br&&eh(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof G)||rt+this.node.content.size)return null;let o=e.domSelectionRange(),s=th(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let l=s.nodeValue,a=nh(this.node.content,l,r-t,i-t);return a<0?null:{node:s,pos:a,text:l}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new Kp(this,o,t,i);e.input.compositionNodes.push(s),this.children=Ks(this.children,r,r+i.length,e,s)}update(e,t,r,i){return this.dirty==jt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=bt}updateOuterDeco(e){if(qs(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Xu(this.dom,this.nodeDOM,Us(this.outerDeco,this.node,t),Us(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Ba(n,e,t,r,i){Qu(r,e,n);let o=new wn(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class _o extends wn{constructor(e,t,r,i,o,s,l){super(e,t,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==jt||this.dirty!=bt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=bt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=bt,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new _o(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=jt)}get domAtom(){return!1}}class Gu extends fi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==bt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Jp extends wn{constructor(e,t,r,i,o,s,l,a,c,u){super(e,t,r,i,o,s,l,c,u),this.spec=a}update(e,t,r,i){if(this.dirty==jt)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Yu(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=Gn.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let c=t.children[r-1];if(c instanceof Gn)t=c,r=c.children.length;else{l=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=n.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function Qp(n,e){return n.type.side-e.type.side}function Zp(n,e,t,r){let i=e.locals(n),o=0;if(i.length==0){for(let c=0;co;)l.push(i[s++]);let h=o+f.nodeSize;if(f.isText){let g=h;s!g.inline):l.slice();r(f,m,e.forChild(o,f),p),o=h}}function eh(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function th(n,e){for(;;){if(n.nodeType==3)return n;if(n.nodeType==1&&e>0){if(n.childNodes.length>e&&n.childNodes[e].nodeType==3)return n.childNodes[e];n=n.childNodes[e-1],e=zt(n)}else if(n.nodeType==1&&e=t){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l=0&&c+e.length+l>=t)return l+c;if(t==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function Ks(n,e,t,r,i){let o=[];for(let s=0,l=0;s=t||u<=e?o.push(a):(ct&&o.push(a.slice(t-c,a.size,r)))}return o}function Il(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(Fo(t)){for(a=l;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&j.isSelectable(u)&&i.parent&&!(u.isInline&&Tp(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;c=new j(s==d?l:r.resolve(d))}}else{let u=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(u<0)return null;a=r.resolve(u)}if(!c){let u=e=="pointer"||n.state.selection.head{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Zu(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function ih(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,Ke(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Ze&&kn<=11&&(r.disabled=!0,r.disabled=!1)}function ed(n,e){if(e instanceof j){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Va(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Va(n)}function Va(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Rl(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||G.between(e,t,r)}function ja(n){return n.editable&&!n.hasFocus()?!1:td(n)}function td(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function oh(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Jn(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Js(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&Z.findFrom(o,e)}function dn(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Wa(n,e,t){let r=n.state.selection;if(r instanceof G)if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return dn(n,new G(r.$anchor,s))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=Js(n.state,e);return i&&i instanceof j?dn(n,i):!1}else if(!(ht&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=n.docView.descAt(l))&&!s.contentDOM?j.isSelectable(o)?dn(n,new j(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):di?dn(n,new G(n.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof j&&r.node.isInline)return dn(n,new G(e>0?r.$to:r.$from));{let i=Js(n.state,e);return i?dn(n,i):!1}}}function qi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ur(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function nr(n,e){return e<0?sh(n):lh(n)}function sh(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,s=!1;for(Et&&t.nodeType==1&&r0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(Ur(l,-1))i=t,o=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(nd(t))break;{let l=t.previousSibling;for(;l&&Ur(l,-1);)i=t.parentNode,o=Ke(l),l=l.previousSibling;if(l)t=l,r=qi(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?Gs(n,t,r):i&&Gs(n,i,o)}function lh(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=qi(t),o,s;for(;;)if(r{n.state==i&&en(n)},50)}function Ua(n,e){let t=n.state.doc.resolve(e);if(!(He||Np)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function qa(n,e,t){let r=n.state.selection;if(r instanceof G&&!r.empty||t.indexOf("s")>-1||ht&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=Js(n.state,e);if(s&&s instanceof j)return dn(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof Ot?Z.near(s,e):Z.findFrom(s,e);return l?dn(n,l):!1}return!1}function Ka(n,e){if(!(n.state.selection instanceof G))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function Ja(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function uh(n){if(!Je||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Ja(n,r,"true"),setTimeout(()=>Ja(n,r,"false"),20)}return!1}function dh(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function fh(n,e){let t=e.keyCode,r=dh(e);if(t==8||ht&&t==72&&r=="c")return Ka(n,-1)||nr(n,-1);if(t==46&&!e.shiftKey||ht&&t==68&&r=="c")return Ka(n,1)||nr(n,1);if(t==13||t==27)return!0;if(t==37||ht&&t==66&&r=="c"){let i=t==37?Ua(n,n.state.selection.from)=="ltr"?-1:1:-1;return Wa(n,i,r)||nr(n,i)}else if(t==39||ht&&t==70&&r=="c"){let i=t==39?Ua(n,n.state.selection.from)=="ltr"?1:-1:1;return Wa(n,i,r)||nr(n,i)}else{if(t==38||ht&&t==80&&r=="c")return qa(n,-1,r)||nr(n,-1);if(t==40||ht&&t==78&&r=="c")return uh(n)||qa(n,1,r)||nr(n,1);if(r==(ht?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function rd(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=n.someProp("clipboardSerializer")||Ft.fromSchema(n.state.schema),l=cd(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=ad[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=l.createElement(u[p]);for(;a.firstChild;)h.appendChild(a.firstChild);a.appendChild(h),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,` `);return{dom:a,text:f}}function id(n,e,t,r,i){let o=i.parent.type.spec.code,s,l;if(!t&&!e)return null;let a=e&&(r||o||!t);if(a){if(n.someProp("transformPastedText",f=>{e=f(e,o||r,n)}),o)return e?new I(T.from(n.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):I.empty;let d=n.someProp("clipboardTextParser",f=>f(e,i,r,n));if(d)l=d;else{let f=i.marks(),{schema:p}=n.state,h=Ft.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(h.serializeNode(p.text(m,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),s=mh(t),di&&gh(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Ml.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!ph.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=bh(Ga(l,+u[1],+u[2]),u[4]);else if(l=I.maxOpen(hh(l.content,i),!0),l.openStart||l.openEnd){let d=0,f=0;for(let p=l.content.firstChild;d{l=d(l,n)}),l}const ph=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function hh(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,s=[];if(n.forEach(l=>{if(!s)return;let a=i.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&o.length&&sd(a,o,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=ld(s[s.length-1],o.length));let u=od(l,a);s.push(u),i=i.matchType(u.type),o=a}}),s)return T.from(s)}return n}function od(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,T.from(n));return n}function sd(n,e,t,r,i){if(i1&&(o=0),i=t&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(T.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(l))}function Ga(n,e,t){return e]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=cd().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&ad[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"").reverse().join("")),t.innerHTML=n,i)for(let o=0;o=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=T.from(a.create(r[l+1],i)),o++,s++}return new I(i,o,s)}const Ge={},Ye={},yh={touchstart:!0,touchmove:!0};class vh{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function kh(n){for(let e in Ge){let t=Ge[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{xh(n,r)&&!Pl(n,r)&&(n.editable||!(r.type in Ye))&&t(n,r)},yh[e]?{passive:!0}:void 0)}Je&&n.dom.addEventListener("input",()=>null),Xs(n)}function vn(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function wh(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Xs(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Pl(n,r))})}function Pl(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function xh(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Sh(n,e){!Pl(n,e)&&Ge[e.type]&&(n.editable||!(e.type in Ye))&&Ge[e.type](n,e)}Ye.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!dd(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Ct&&He&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),br&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Pn(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||fh(n,t)?t.preventDefault():vn(n,"key")};Ye.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Ye.keypress=(n,e)=>{let t=e;if(dd(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||ht&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof G)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function Ho(n){return{left:n.clientX,top:n.clientY}}function Ch(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Ll(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,l=>s>o.depth?l(n,t,o.nodeAfter,o.before(s),i,!0):l(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function pr(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function Mh(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&j.isSelectable(r)?(pr(n,new j(t),"pointer"),!0):!1}function Th(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof j&&(r=t.node);let o=n.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(j.isSelectable(l)){r&&t.$from.depth>0&&s>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(s);break}}return i!=null?(pr(n,j.create(n.state.doc,i),"pointer"),!0):!1}function Oh(n,e,t,r,i){return Ll(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?Th(n,t):Mh(n,t))}function Ah(n,e,t,r){return Ll(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Eh(n,e,t,r){return Ll(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Nh(n,t,r)}function Nh(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(pr(n,G.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)pr(n,G.create(r,l+1,l+1+s.content.size),"pointer");else if(j.isSelectable(s))pr(n,j.create(r,l),"pointer");else continue;return!0}}function $l(n){return Ki(n)}const ud=ht?"metaKey":"ctrlKey";Ge.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=$l(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&Ch(t,n.input.lastClick)&&!t[ud]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let s=n.posAtCoords(Ho(t));s&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Dh(n,s,t,!!r)):(o=="doubleClick"?Ah:Eh)(n,s.pos,s.inside,t)?t.preventDefault():vn(n,"pointer"))};class Dh{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[ud],this.allowDefault=r.shiftKey;let o,s;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,s=u.depth?u.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a?a.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof j&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&At&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),vn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>en(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ho(e))),this.updateAllowDefault(e),this.allowDefault||!t?vn(this.view,"pointer"):Oh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Je&&this.mightDrag&&!this.mightDrag.node.isAtom||He&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(pr(this.view,Z.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):vn(this.view,"pointer")}move(e){this.updateAllowDefault(e),vn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Ge.touchstart=n=>{n.input.lastTouch=Date.now(),$l(n),vn(n,"pointer")};Ge.touchmove=n=>{n.input.lastTouch=Date.now(),vn(n,"pointer")};Ge.contextmenu=n=>$l(n);function dd(n,e){return n.composing?!0:Je&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Ih=Ct?5e3:-1;Ye.compositionstart=Ye.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),Ki(n,!0),n.markCursor=null;else if(Ki(n),At&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){n.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}n.input.composing=!0}fd(n,Ih)};Ye.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,fd(n,20))};function fd(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ki(n),e))}function pd(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Rh());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Rh(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Ki(n,e=!1){if(!(Ct&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),pd(n),e||n.docView&&n.docView.dirty){let t=Il(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function Ph(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const ti=Ze&&kn<15||br&&Dp<604;Ge.copy=Ye.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=ti?null:t.clipboardData,s=r.content(),{dom:l,text:a}=rd(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):Ph(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Lh(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function $h(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?ni(n,r.value,null,i,e):ni(n,r.textContent,r.innerHTML,i,e)},50)}function ni(n,e,t,r,i){let o=id(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,i,o||I.empty)))return!0;if(!o)return!1;let s=Lh(o),l=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function hd(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ye.paste=(n,e)=>{let t=e;if(n.composing&&!Ct)return;let r=ti?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&ni(n,hd(r),r.getData("text/html"),i,t)?t.preventDefault():$h(n,t)};class md{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const gd=ht?"altKey":"ctrlKey";Ge.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(Ho(t)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof j?i.to-1:i.to))){if(r&&r.mightDrag)s=j.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let u=n.docView.nearestDesc(t.target,!0);u&&u.node.type.spec.draggable&&u!=n.docView&&(s=j.create(n.state.doc,u.posBefore))}}let l=(s||n.state.selection).content(),{dom:a,text:c}=rd(n,l);t.dataTransfer.clearData(),t.dataTransfer.setData(ti?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",ti||t.dataTransfer.setData("text/plain",c),n.dragging=new md(l,!t[gd],s)};Ge.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Ye.dragover=Ye.dragenter=(n,e)=>e.preventDefault();Ye.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Ho(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",h=>{s=h(s,n)}):s=id(n,hd(t.dataTransfer),ti?null:t.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!t[gd]);if(n.someProp("handleDrop",h=>h(n,t,s||I.empty,l))){t.preventDefault();return}if(!s)return;t.preventDefault();let a=s?Ru(n.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let c=n.state.tr;if(l){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&j.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new j(p));else{let h=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,k)=>h=k),c.setSelection(Rl(n,p,c.doc.resolve(h)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))};Ge.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&en(n)},20))};Ge.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Ge.beforeinput=(n,e)=>{if(He&&Ct&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Pn(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in Ye)Ge[n]=Ye[n];function ri(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Ji{constructor(e,t){this.toDOM=e,this.spec=t||jn,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new gt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Ji&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ri(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class xn{constructor(e,t){this.attrs=e,this.spec=t||jn}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new gt(o,s,this)}valid(e,t){return t.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,r,i+l,o)}}map(e,t,r){return this==_e||e.maps.length==0?this:this.mapInner(e,t,0,0,r||jn)}mapInner(e,t,r,i,o){let s;for(let l=0;l{let c=a+r,u;if(u=yd(t,l,c)){for(i||(i=this.children.slice());ol&&d.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+t.content.size;for(let l=0;lo&&a.type instanceof xn){let c=Math.max(o,a.from)-o,u=Math.min(s,a.to)-o;ci.map(e,t,jn));return hn.from(r)}forChild(e,t){if(t.isLeaf)return Ae.empty;let r=[];for(let i=0;it instanceof Ae)?e:e.reduce((t,r)=>t.concat(r instanceof Ae?r:r.members),[]))}}}function Bh(n,e,t,r,i,o,s){let l=n.slice();for(let c=0,u=o;c{let g=m-h-(p-f);for(let y=0;yk+u-d)continue;let C=l[y]+u-d;p>=C?l[y+1]=f<=C?-2:-1:f>=u&&g&&(l[y]+=g,l[y+1]+=g)}d+=g}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let f=t.map(n[c+1]+o,-1),p=f-i,{index:h,offset:m}=r.content.findIndex(d),g=r.maybeChild(h);if(g&&m==d&&m+g.nodeSize==p){let y=l[c+2].mapInner(t,g,u+1,n[c]+o+1,s);y!=_e?(l[c]=d,l[c+1]=p,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=zh(l,n,e,t,i,o,s),u=Gi(c,r,0,s);e=u.local;for(let d=0;dt&&s.to{let c=yd(n,l,a+t);if(c){o=!0;let u=Gi(c,l,t+a+1,r);u!=_e&&i.push(a,a+l.nodeSize,u)}});let s=bd(o?vd(n):n,-t).sort(Wn);for(let l=0;l0;)e++;n.splice(e,0,t)}function ps(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=_e&&e.push(r)}),n.cursorWrapper&&e.push(Ae.create(n.state.doc,[n.cursorWrapper.deco])),hn.from(e)}const Fh={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},_h=Ze&&kn<=11;class Hh{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Vh{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Hh,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),_h&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Fh)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ja(this.view)){if(this.suppressingSelectionUpdates)return en(this.view);if(Ze&&kn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Jn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let o=e.focusNode;o;o=ei(o))t.add(o);for(let o=e.anchorNode;o;o=ei(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&ja(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(e.editable)for(let u=0;u1){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),jh(e)),this.handleDOMChange(o,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||en(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;ui;g--){let y=r.childNodes[g-1],k=y.pmViewDesc;if(y.nodeName=="BR"&&!k){o=g;break}if(!k||k.size)break}let d=n.state.doc,f=n.someProp("domParser")||Ml.fromSchema(n.state.schema),p=d.resolve(s),h=null,m=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:qh,context:p});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),h={anchor:g+s,head:y+s}}return{doc:m,sel:h,from:s,to:l}}function qh(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Je&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||Je&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Kh=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Jh(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let w=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,H=Il(n,w);if(H&&!n.state.selection.eq(H)){if(He&&Ct&&n.input.lastKeyCode===13&&Date.now()-100S(n,Pn(13,"Enter"))))return;let q=n.state.tr.setSelection(H);w=="pointer"?q.setMeta("pointer",!0):w=="key"&&q.scrollIntoView(),o&&q.setMeta("composition",o),n.dispatch(q)}return}let s=n.state.doc.resolve(e),l=s.sharedDepth(t);e=s.before(l+1),t=n.state.doc.resolve(t).after(l+1);let a=n.state.selection,c=Uh(n,e,t),u=n.state.doc,d=u.slice(c.from,c.to),f,p;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Ct)&&i.some(w=>w.nodeType==1&&!Kh.test(w.nodeName))&&(!h||h.endA>=h.endB)&&n.someProp("handleKeyDown",w=>w(n,Pn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!h)if(r&&a instanceof G&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let w=ec(n,n.state.doc,c.sel);if(w&&!w.eq(n.state.selection)){let H=n.state.tr.setSelection(w);o&&H.setMeta("composition",o),n.dispatch(H)}}return}if(He&&n.cursorWrapper&&c.sel&&c.sel.anchor==n.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let w=h.endB-h.start;c.sel={anchor:c.sel.anchor+w,head:c.sel.anchor+w}}n.input.domChangeCount++,n.state.selection.fromn.state.selection.from&&h.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?h.start=n.state.selection.from:h.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(h.endB+=n.state.selection.to-h.endA,h.endA=n.state.selection.to)),Ze&&kn<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),g=c.doc.resolveNoCache(h.endB-c.from),y=u.resolve(h.start),k=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=h.endA,C;if((br&&n.input.lastIOSEnter>Date.now()-225&&(!k||i.some(w=>w.nodeName=="DIV"||w.nodeName=="P"))||!k&&m.posw(n,Pn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>h.start&&Yh(u,h.start,h.endA,m,g)&&n.someProp("handleKeyDown",w=>w(n,Pn(8,"Backspace")))){Ct&&He&&n.domObserver.suppressSelectionUpdates();return}He&&Ct&&h.endB==h.start&&(n.input.lastAndroidDelete=Date.now()),Ct&&!k&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,g=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(w){return w(n,Pn(13,"Enter"))})},20));let b=h.start,A=h.endA,v,O,W;if(k){if(m.pos==g.pos)Ze&&kn<=11&&m.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>en(n),20)),v=n.state.tr.delete(b,A),O=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(W=Gh(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start()))))v=n.state.tr,W.type=="add"?v.addMark(b,A,W.mark):v.removeMark(b,A,W.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let w=m.parent.textBetween(m.parentOffset,g.parentOffset);if(n.someProp("handleTextInput",H=>H(n,b,A,w)))return;v=n.state.tr.insertText(w,b,A)}}if(v||(v=n.state.tr.replace(b,A,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let w=ec(n,v.doc,c.sel);w&&!(He&&Ct&&n.composing&&w.empty&&(h.start!=h.endB||n.input.lastAndroidDeletee.content.size?null:Rl(n,e.resolve(t.anchor),e.resolve(t.head))}function Gh(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r,s,l,a;for(let u=0;uu.mark(l.addToSet(u.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ut||hs(s,!0,!1)0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Xh(n,e,t,r,i){let o=n.findDiffStart(e,t);if(o==null)return null;let{a:s,b:l}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,l));r-=s+a-o}if(s=s?o-r:0;o-=a,o&&o=l?o-r:0;o-=a,o&&o=56320&&e<=57343&&t>=55296&&t<=56319}class Qh{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new vh,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(sc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ic(this),rc(this),this.nodeViews=oc(this),this.docView=Ba(this.state.doc,nc(this),ps(this),this.dom,this),this.domObserver=new Vh(this,(r,i,o,s)=>Jh(this,r,i,o,s)),this.domObserver.start(),kh(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Xs(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(sc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(pd(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=oc(this);em(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&Xs(this),this.editable=ic(this),rc(this);let a=ps(this),c=nc(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=o||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(i.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Pp(this);if(s){this.domObserver.stop();let p=d&&(Ze||He)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Zh(i.selection,e.selection);if(d){let h=He?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Ba(e.doc,c,a,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&oh(this))?en(this,p):(ed(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&Lp(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof j){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Da(this,t.getBoundingClientRect(),e)}else Da(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new md(e.slice,e.move,i<0?void 0:j.create(this.state.doc,i))}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let s=0;st.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Hp(this,e)}coordsAtPos(e,t=1){return qu(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return qp(this,t||this.state,e)}pasteHTML(e,t){return ni(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ni(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(wh(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ps(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Sh(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Je&&this.root.nodeType===11&&Op(this.dom.ownerDocument)==this.dom?Wh(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function nc(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[gt.node(0,n.state.doc.content.size,e)]}function rc(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:gt.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function ic(n){return!n.someProp("editable",e=>e(n.state)===!1)}function Zh(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function oc(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function em(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function sc(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Cn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Yi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},tm=typeof navigator<"u"&&/Mac/.test(navigator.platform),nm=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Le=0;Le<10;Le++)Cn[48+Le]=Cn[96+Le]=String(Le);for(var Le=1;Le<=24;Le++)Cn[Le+111]="F"+Le;for(var Le=65;Le<=90;Le++)Cn[Le]=String.fromCharCode(Le+32),Yi[Le]=String.fromCharCode(Le);for(var ms in Cn)Yi.hasOwnProperty(ms)||(Yi[ms]=Cn[ms]);function rm(n){var e=tm&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||nm&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Yi:Cn)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const im=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function om(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,s;for(let l=0;l127)&&(o=Cn[r.keyCode])&&o!=i){let l=e[gs(o,r)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}const am=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function cm(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const um=(n,e,t)=>{let r=cm(n,t);if(!r)return!1;let i=wd(r);if(!i){let s=r.blockRange(),l=s&&Tr(s);return l==null?!1:(e&&e(n.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Cd(n,i,e))return!0;if(r.parent.content.size==0&&(yr(o,"end")||j.isSelectable(o))){let s=Al(n.doc,r.before(),r.after(),I.empty);if(s&&s.slice.size{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=wd(r)}let s=o&&o.nodeBefore;return!s||!j.isSelectable(s)?!1:(e&&e(n.tr.setSelection(j.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function wd(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function fm(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let r=fm(n,t);if(!r)return!1;let i=xd(r);if(!i)return!1;let o=i.nodeAfter;if(Cd(n,i,e))return!0;if(r.parent.content.size==0&&(yr(o,"start")||j.isSelectable(o))){let s=Al(n.doc,r.before(),r.after(),I.empty);if(s&&s.slice.size{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,r=t instanceof j,i;if(r){if(t.node.isTextblock||!Tn(n.doc,t.from))return!1;i=t.from}else if(i=Bo(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(j.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},gm=(n,e)=>{let t=n.selection,r;if(t instanceof j){if(t.node.isTextblock||!Tn(n.doc,t.to))return!1;r=t.to}else if(r=Bo(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},bm=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&Tr(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},ym=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(` -`).scrollIntoView()),!0)};function Sd(n){for(let e=0;e{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),s=Sd(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=t.after(),a=n.tr.replaceWith(l,l,s.createAndFill());a.setSelection(Z.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},km=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Ot||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Sd(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(dr(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Tr(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},xm=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(j.create(n.doc,i))),!0)};function Sm(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Tn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Cd(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(Sm(n,e,t))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(t){let d=e.pos+i.nodeSize,f=T.empty;for(let m=o.length-1;m>=0;m--)f=T.from(o[m].create(null,f));f=T.from(r.copy(f));let p=n.tr.step(new Ne(e.pos-1,d,e.pos,d,new I(f,1,0),o.length,!0)),h=d+2*o.length;Tn(p.doc,h)&&p.join(h),t(p.scrollIntoView())}return!0}let a=Z.findFrom(e,1),c=a&&a.$from.blockRange(a.$to),u=c&&Tr(c);if(u!=null&&u>=e.depth)return t&&t(n.tr.lift(c,u).scrollIntoView()),!0;if(l&&yr(i,"start",!0)&&yr(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(t){let m=T.empty;for(let y=f.length-1;y>=0;y--)m=T.from(f[y].copy(m));let g=n.tr.step(new Ne(e.pos-f.length,e.pos+i.nodeSize,e.pos+h,e.pos+i.nodeSize-h,new I(m,f.length,0),0,!0));t(g.scrollIntoView())}return!0}}return!1}function Md(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(G.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const Cm=Md(-1),Mm=Md(1);function Tm(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,s=i.blockRange(o),l=s&&Ol(s,n,e);return l?(r&&r(t.tr.wrap(s,l).scrollIntoView()),!0):!1}}function lc(n,e=null){return function(t,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)i=!0;else{let u=t.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(n)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let u=t.doc.resolve(s.start-2);a=new Vi(u,u,s.depth),s.endIndex=0;u--)o=T.from(t[u].type.create(t[u].attrs,o));n.step(new Ne(e.start-(r?2:0),e.end,e.start,e.end,new I(o,0,0),t.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?Nm(e,t,n,o):Dm(e,t,o):!0:!1}}function Nm(n,e,t,r){let i=n.tr,o=r.end,s=r.$to.end(r.depth);om;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(t.start),s=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(l?0:1),u+1,s.content.append(a?T.empty:T.from(i))))return!1;let d=o.pos,f=d+s.nodeSize;return r.step(new Ne(d-(l?1:0),f+(a?1:0),d+1,f-1,new I((l?T.empty:T.from(i.copy(T.empty))).append(a?T.empty:T.from(i.copy(T.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Im(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==n);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,a=l.child(s-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=T.from(c?n.create():null),d=new I(T.from(n.create(null,T.from(l.type.create(null,u)))),c?3:1,0),f=o.start,p=o.end;t(e.tr.step(new Ne(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}function Vo(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class jo{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...u)=>{const d=a(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],a=!!e,c=e||o.tr,u=()=>(!a&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...m)=>{const g=this.buildProps(c,t),y=p(...m)(g);return l.push(y),d}])),run:u};return d}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:Vo({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([a,c])=>[a,(...u)=>c(...u)(l)]))}};return l}}class Rm{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(i=>i!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function F(n,e,t){return n.config[e]===void 0&&n.parent?F(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?F(n.parent,e,t):null}):n.config[e]}function Wo(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Td(n){const e=[],{nodeExtensions:t,markExtensions:r}=Wo(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},a=F(s,"addGlobalAttributes",l);if(!a)return;a().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([f,p])=>{e.push({type:d,name:f,attribute:{...o,...p}})})})})}),i.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},a=F(s,"addAttributes",l);if(!a)return;const c=a();Object.entries(c).forEach(([u,d])=>{const f={...o,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:s.name,name:u,attribute:f})})}),e}function Ie(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Me(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const l=o?o.split(" "):[],a=r[i]?r[i].split(" "):[],c=l.filter(u=>!a.includes(u));r[i]=[...a,...c].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Qs(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Me(t,r),{})}function Od(n){return typeof n=="function"}function Q(n,e=void 0,...t){return Od(n)?e?n.bind(e)(...t):n(...t):n}function Pm(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Lm(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function ac(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(t):Lm(t.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function cc(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&Pm(t)?!1:t!=null))}function $m(n,e){var t;const r=Td(n),{nodeExtensions:i,markExtensions:o}=Wo(n),s=(t=i.find(c=>F(c,"topNode")))===null||t===void 0?void 0:t.name,l=Object.fromEntries(i.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=n.reduce((y,k)=>{const C=F(k,"extendNodeSchema",d);return{...y,...C?C(c):{}}},{}),p=cc({...f,content:Q(F(c,"content",d)),marks:Q(F(c,"marks",d)),group:Q(F(c,"group",d)),inline:Q(F(c,"inline",d)),atom:Q(F(c,"atom",d)),selectable:Q(F(c,"selectable",d)),draggable:Q(F(c,"draggable",d)),code:Q(F(c,"code",d)),defining:Q(F(c,"defining",d)),isolating:Q(F(c,"isolating",d)),attrs:Object.fromEntries(u.map(y=>{var k;return[y.name,{default:(k=y==null?void 0:y.attribute)===null||k===void 0?void 0:k.default}]}))}),h=Q(F(c,"parseHTML",d));h&&(p.parseDOM=h.map(y=>ac(y,u)));const m=F(c,"renderHTML",d);m&&(p.toDOM=y=>m({node:y,HTMLAttributes:Qs(y,u)}));const g=F(c,"renderText",d);return g&&(p.toText=g),[c.name,p]})),a=Object.fromEntries(o.map(c=>{const u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=n.reduce((g,y)=>{const k=F(y,"extendMarkSchema",d);return{...g,...k?k(c):{}}},{}),p=cc({...f,inclusive:Q(F(c,"inclusive",d)),excludes:Q(F(c,"excludes",d)),group:Q(F(c,"group",d)),spanning:Q(F(c,"spanning",d)),code:Q(F(c,"code",d)),attrs:Object.fromEntries(u.map(g=>{var y;return[g.name,{default:(y=g==null?void 0:g.attribute)===null||y===void 0?void 0:y.default}]}))}),h=Q(F(c,"parseHTML",d));h&&(p.parseDOM=h.map(g=>ac(g,u)));const m=F(c,"renderHTML",d);return m&&(p.toDOM=g=>m({mark:g,HTMLAttributes:Qs(g,u)})),[c.name,p]}));return new qf({topNode:s,nodes:l,marks:a})}function bs(n,e){return e.nodes[n]||e.marks[n]||null}function uc(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const Bm=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var a,c;const u=((c=(a=i.type.spec).toText)===null||c===void 0?void 0:c.call(a,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";t+=u.slice(0,Math.max(0,r-o))}),t};function Fl(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Uo{constructor(e){this.find=e.find,this.handler=e.handler}}const zm=(n,e)=>{if(Fl(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function ys(n){var e;const{editor:t,from:r,to:i,text:o,rules:s,plugin:l}=n,{view:a}=t;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=Bm(c)+o;return s.forEach(f=>{if(u)return;const p=zm(d,f.find);if(!p)return;const h=a.state.tr,m=Vo({state:a.state,transaction:h}),g={from:r-(p[0].length-o.length),to:i},{commands:y,chain:k,can:C}=new jo({editor:t,state:m});f.handler({state:m,range:g,match:p,commands:y,chain:k,can:C})===null||!h.steps.length||(h.setMeta(l,{transform:h,from:r,to:i,text:o}),a.dispatch(h),u=!0)}),u}function Fm(n){const{editor:e,rules:t}=n,r=new We({state:{init(){return null},apply(i,o){const s=i.getMeta(r);return s||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,s,l){return ys({editor:e,from:o,to:s,text:l,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&ys({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?ys({editor:e,from:s.pos,to:s.pos,text:` -`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function _m(n){return typeof n=="number"}class Hm{constructor(e){this.find=e.find,this.handler=e.handler}}const Vm=(n,e,t)=>{if(Fl(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=n,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function jm(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=n,{commands:a,chain:c,can:u}=new jo({editor:e,state:t}),d=[];return t.doc.nodesBetween(r,i,(p,h)=>{if(!p.isTextblock||p.type.spec.code)return;const m=Math.max(r,h),g=Math.min(i,h+p.content.size),y=p.textBetween(m-h,g-h,void 0,"");Vm(y,o.find,s).forEach(C=>{if(C.index===void 0)return;const b=m+C.index+1,A=b+C[0].length,v={from:t.tr.mapping.map(b),to:t.tr.mapping.map(A)},O=o.handler({state:t,range:v,match:C,commands:a,chain:c,can:u,pasteEvent:s,dropEvent:l});d.push(O)})}),d.every(p=>p!==null)}function Wm(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,s=new ClipboardEvent("paste"),l=new DragEvent("drop");return t.map(c=>new We({view(u){const d=f=>{var p;r=!((p=u.dom.parentElement)===null||p===void 0)&&p.contains(f.target)?u.dom.parentElement:null};return window.addEventListener("dragstart",d),{destroy(){window.removeEventListener("dragstart",d)}}},props:{handleDOMEvents:{drop:(u,d)=>(o=r===u.dom.parentElement,l=d,!1),paste:(u,d)=>{var f;const p=(f=d.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return s=d,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(u,d,f)=>{const p=u[0],h=p.getMeta("uiEvent")==="paste"&&!i,m=p.getMeta("uiEvent")==="drop"&&!o;if(!h&&!m)return;const g=d.doc.content.findDiffStart(f.doc.content),y=d.doc.content.findDiffEnd(f.doc.content);if(!_m(g)||!y||g===y.b)return;const k=f.tr,C=Vo({state:f,transaction:k});if(!(!jm({editor:e,state:C,from:Math.max(g-1,0),to:y.b-1,rule:c,pasteEvent:s,dropEvent:l})||!k.steps.length))return l=new DragEvent("drop"),s=new ClipboardEvent("paste"),k}}))}function Um(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class cr{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=cr.resolve(e),this.schema=$m(this.extensions,t),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:bs(r.name,this.schema)};r.type==="mark"&&(!((i=Q(F(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const s=F(r,"onBeforeCreate",o);s&&this.editor.on("beforeCreate",s);const l=F(r,"onCreate",o);l&&this.editor.on("create",l);const a=F(r,"onUpdate",o);a&&this.editor.on("update",a);const c=F(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const u=F(r,"onTransaction",o);u&&this.editor.on("transaction",u);const d=F(r,"onFocus",o);d&&this.editor.on("focus",d);const f=F(r,"onBlur",o);f&&this.editor.on("blur",f);const p=F(r,"onDestroy",o);p&&this.editor.on("destroy",p)})}static resolve(e){const t=cr.sort(cr.flatten(e)),r=Um(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=F(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=F(r,"priority")||100,s=F(i,"priority")||100;return o>s?-1:o{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:bs(t.name,this.schema)},i=F(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=cr.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(s=>{const l={name:s.name,options:s.options,storage:s.storage,editor:e,type:bs(s.name,this.schema)},a=[],c=F(s,"addKeyboardShortcuts",l);let u={};if(s.type==="mark"&&s.config.exitable&&(u.ArrowRight=()=>Et.handleExit({editor:e,mark:s})),c){const m=Object.fromEntries(Object.entries(c()).map(([g,y])=>[g,()=>y({editor:e})]));u={...u,...m}}const d=lm(u);a.push(d);const f=F(s,"addInputRules",l);uc(s,e.options.enableInputRules)&&f&&r.push(...f());const p=F(s,"addPasteRules",l);uc(s,e.options.enablePasteRules)&&p&&i.push(...p());const h=F(s,"addProseMirrorPlugins",l);if(h){const m=h();a.push(...m)}return a}).flat();return[Fm({editor:e,rules:r}),...Wm({editor:e,rules:i}),...o]}get attributes(){return Td(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Wo(this.extensions);return Object.fromEntries(t.filter(r=>!!F(r,"addNodeView")).map(r=>{const i=this.attributes.filter(a=>a.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Ie(r.name,this.schema)},s=F(r,"addNodeView",o);if(!s)return[];const l=(a,c,u,d)=>{const f=Qs(a,i);return s()({editor:e,node:a,getPos:u,decorations:d,HTMLAttributes:f,extension:r})};return[r.name,l]}))}}function qm(n){return Object.prototype.toString.call(n).slice(8,-1)}function vs(n){return qm(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function qo(n,e){const t={...n};return vs(n)&&vs(e)&&Object.keys(e).forEach(r=>{vs(e[r])?r in n?t[r]=qo(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class nt{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Q(F(this,"addOptions",{name:this.name}))),this.storage=Q(F(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new nt(e)}configure(e={}){const t=this.extend();return t.options=qo(this.options,e),t.storage=Q(F(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new nt(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Q(F(t,"addOptions",{name:t.name})),t.storage=Q(F(t,"addStorage",{name:t.name,options:t.options})),t}}function Ad(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=` +`))),0,0):I.empty;let d=n.someProp("clipboardTextParser",f=>f(e,i,r,n));if(d)l=d;else{let f=i.marks(),{schema:p}=n.state,h=Ft.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(h.serializeNode(p.text(m,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),s=mh(t),di&&gh(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Ml.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!ph.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=bh(Ga(l,+u[1],+u[2]),u[4]);else if(l=I.maxOpen(hh(l.content,i),!0),l.openStart||l.openEnd){let d=0,f=0;for(let p=l.content.firstChild;d{l=d(l,n)}),l}const ph=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function hh(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,s=[];if(n.forEach(l=>{if(!s)return;let a=i.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&o.length&&sd(a,o,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=ld(s[s.length-1],o.length));let u=od(l,a);s.push(u),i=i.matchType(u.type),o=a}}),s)return T.from(s)}return n}function od(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,T.from(n));return n}function sd(n,e,t,r,i){if(i1&&(o=0),i=t&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(T.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(l))}function Ga(n,e,t){return e]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=cd().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&ad[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"").reverse().join("")),t.innerHTML=n,i)for(let o=0;o=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=T.from(a.create(r[l+1],i)),o++,s++}return new I(i,o,s)}const Ge={},Ye={},yh={touchstart:!0,touchmove:!0};class vh{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function kh(n){for(let e in Ge){let t=Ge[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{xh(n,r)&&!Pl(n,r)&&(n.editable||!(r.type in Ye))&&t(n,r)},yh[e]?{passive:!0}:void 0)}Je&&n.dom.addEventListener("input",()=>null),Xs(n)}function vn(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function wh(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Xs(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Pl(n,r))})}function Pl(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function xh(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Sh(n,e){!Pl(n,e)&&Ge[e.type]&&(n.editable||!(e.type in Ye))&&Ge[e.type](n,e)}Ye.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!dd(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Ct&&He&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),br&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Pn(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||fh(n,t)?t.preventDefault():vn(n,"key")};Ye.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Ye.keypress=(n,e)=>{let t=e;if(dd(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||ht&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof G)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function Ho(n){return{left:n.clientX,top:n.clientY}}function Ch(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Ll(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,l=>s>o.depth?l(n,t,o.nodeAfter,o.before(s),i,!0):l(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function pr(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function Mh(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&j.isSelectable(r)?(pr(n,new j(t),"pointer"),!0):!1}function Th(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof j&&(r=t.node);let o=n.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(j.isSelectable(l)){r&&t.$from.depth>0&&s>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(s);break}}return i!=null?(pr(n,j.create(n.state.doc,i),"pointer"),!0):!1}function Oh(n,e,t,r,i){return Ll(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?Th(n,t):Mh(n,t))}function Eh(n,e,t,r){return Ll(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Ah(n,e,t,r){return Ll(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Nh(n,t,r)}function Nh(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(pr(n,G.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)pr(n,G.create(r,l+1,l+1+s.content.size),"pointer");else if(j.isSelectable(s))pr(n,j.create(r,l),"pointer");else continue;return!0}}function $l(n){return Ki(n)}const ud=ht?"metaKey":"ctrlKey";Ge.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=$l(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&Ch(t,n.input.lastClick)&&!t[ud]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let s=n.posAtCoords(Ho(t));s&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Dh(n,s,t,!!r)):(o=="doubleClick"?Eh:Ah)(n,s.pos,s.inside,t)?t.preventDefault():vn(n,"pointer"))};class Dh{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[ud],this.allowDefault=r.shiftKey;let o,s;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,s=u.depth?u.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a?a.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof j&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Et&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),vn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>en(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ho(e))),this.updateAllowDefault(e),this.allowDefault||!t?vn(this.view,"pointer"):Oh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Je&&this.mightDrag&&!this.mightDrag.node.isAtom||He&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(pr(this.view,Z.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):vn(this.view,"pointer")}move(e){this.updateAllowDefault(e),vn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Ge.touchstart=n=>{n.input.lastTouch=Date.now(),$l(n),vn(n,"pointer")};Ge.touchmove=n=>{n.input.lastTouch=Date.now(),vn(n,"pointer")};Ge.contextmenu=n=>$l(n);function dd(n,e){return n.composing?!0:Je&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Ih=Ct?5e3:-1;Ye.compositionstart=Ye.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),Ki(n,!0),n.markCursor=null;else if(Ki(n),Et&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){n.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}n.input.composing=!0}fd(n,Ih)};Ye.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,fd(n,20))};function fd(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ki(n),e))}function pd(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Rh());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Rh(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Ki(n,e=!1){if(!(Ct&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),pd(n),e||n.docView&&n.docView.dirty){let t=Il(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function Ph(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const ti=Ze&&kn<15||br&&Dp<604;Ge.copy=Ye.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=ti?null:t.clipboardData,s=r.content(),{dom:l,text:a}=rd(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):Ph(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Lh(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function $h(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?ni(n,r.value,null,i,e):ni(n,r.textContent,r.innerHTML,i,e)},50)}function ni(n,e,t,r,i){let o=id(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,i,o||I.empty)))return!0;if(!o)return!1;let s=Lh(o),l=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function hd(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ye.paste=(n,e)=>{let t=e;if(n.composing&&!Ct)return;let r=ti?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&ni(n,hd(r),r.getData("text/html"),i,t)?t.preventDefault():$h(n,t)};class md{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const gd=ht?"altKey":"ctrlKey";Ge.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(Ho(t)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof j?i.to-1:i.to))){if(r&&r.mightDrag)s=j.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let u=n.docView.nearestDesc(t.target,!0);u&&u.node.type.spec.draggable&&u!=n.docView&&(s=j.create(n.state.doc,u.posBefore))}}let l=(s||n.state.selection).content(),{dom:a,text:c}=rd(n,l);t.dataTransfer.clearData(),t.dataTransfer.setData(ti?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",ti||t.dataTransfer.setData("text/plain",c),n.dragging=new md(l,!t[gd],s)};Ge.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Ye.dragover=Ye.dragenter=(n,e)=>e.preventDefault();Ye.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Ho(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",h=>{s=h(s,n)}):s=id(n,hd(t.dataTransfer),ti?null:t.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!t[gd]);if(n.someProp("handleDrop",h=>h(n,t,s||I.empty,l))){t.preventDefault();return}if(!s)return;t.preventDefault();let a=s?Ru(n.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let c=n.state.tr;if(l){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&j.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new j(p));else{let h=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,k)=>h=k),c.setSelection(Rl(n,p,c.doc.resolve(h)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))};Ge.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&en(n)},20))};Ge.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Ge.beforeinput=(n,e)=>{if(He&&Ct&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Pn(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in Ye)Ge[n]=Ye[n];function ri(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Ji{constructor(e,t){this.toDOM=e,this.spec=t||jn,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new gt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Ji&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ri(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class xn{constructor(e,t){this.attrs=e,this.spec=t||jn}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new gt(o,s,this)}valid(e,t){return t.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,r,i+l,o)}}map(e,t,r){return this==_e||e.maps.length==0?this:this.mapInner(e,t,0,0,r||jn)}mapInner(e,t,r,i,o){let s;for(let l=0;l{let c=a+r,u;if(u=yd(t,l,c)){for(i||(i=this.children.slice());ol&&d.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+t.content.size;for(let l=0;lo&&a.type instanceof xn){let c=Math.max(o,a.from)-o,u=Math.min(s,a.to)-o;ci.map(e,t,jn));return hn.from(r)}forChild(e,t){if(t.isLeaf)return Ee.empty;let r=[];for(let i=0;it instanceof Ee)?e:e.reduce((t,r)=>t.concat(r instanceof Ee?r:r.members),[]))}}}function Bh(n,e,t,r,i,o,s){let l=n.slice();for(let c=0,u=o;c{let g=m-h-(p-f);for(let y=0;yk+u-d)continue;let C=l[y]+u-d;p>=C?l[y+1]=f<=C?-2:-1:f>=u&&g&&(l[y]+=g,l[y+1]+=g)}d+=g}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let f=t.map(n[c+1]+o,-1),p=f-i,{index:h,offset:m}=r.content.findIndex(d),g=r.maybeChild(h);if(g&&m==d&&m+g.nodeSize==p){let y=l[c+2].mapInner(t,g,u+1,n[c]+o+1,s);y!=_e?(l[c]=d,l[c+1]=p,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=zh(l,n,e,t,i,o,s),u=Gi(c,r,0,s);e=u.local;for(let d=0;dt&&s.to{let c=yd(n,l,a+t);if(c){o=!0;let u=Gi(c,l,t+a+1,r);u!=_e&&i.push(a,a+l.nodeSize,u)}});let s=bd(o?vd(n):n,-t).sort(Wn);for(let l=0;l0;)e++;n.splice(e,0,t)}function ps(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=_e&&e.push(r)}),n.cursorWrapper&&e.push(Ee.create(n.state.doc,[n.cursorWrapper.deco])),hn.from(e)}const Fh={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},_h=Ze&&kn<=11;class Hh{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Vh{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Hh,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),_h&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Fh)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ja(this.view)){if(this.suppressingSelectionUpdates)return en(this.view);if(Ze&&kn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Jn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let o=e.focusNode;o;o=ei(o))t.add(o);for(let o=e.anchorNode;o;o=ei(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&ja(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(e.editable)for(let u=0;u1){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),jh(e)),this.handleDOMChange(o,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||en(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;ui;g--){let y=r.childNodes[g-1],k=y.pmViewDesc;if(y.nodeName=="BR"&&!k){o=g;break}if(!k||k.size)break}let d=n.state.doc,f=n.someProp("domParser")||Ml.fromSchema(n.state.schema),p=d.resolve(s),h=null,m=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:qh,context:p});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),h={anchor:g+s,head:y+s}}return{doc:m,sel:h,from:s,to:l}}function qh(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Je&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||Je&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Kh=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Jh(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let w=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,H=Il(n,w);if(H&&!n.state.selection.eq(H)){if(He&&Ct&&n.input.lastKeyCode===13&&Date.now()-100S(n,Pn(13,"Enter"))))return;let q=n.state.tr.setSelection(H);w=="pointer"?q.setMeta("pointer",!0):w=="key"&&q.scrollIntoView(),o&&q.setMeta("composition",o),n.dispatch(q)}return}let s=n.state.doc.resolve(e),l=s.sharedDepth(t);e=s.before(l+1),t=n.state.doc.resolve(t).after(l+1);let a=n.state.selection,c=Uh(n,e,t),u=n.state.doc,d=u.slice(c.from,c.to),f,p;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Ct)&&i.some(w=>w.nodeType==1&&!Kh.test(w.nodeName))&&(!h||h.endA>=h.endB)&&n.someProp("handleKeyDown",w=>w(n,Pn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!h)if(r&&a instanceof G&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let w=ec(n,n.state.doc,c.sel);if(w&&!w.eq(n.state.selection)){let H=n.state.tr.setSelection(w);o&&H.setMeta("composition",o),n.dispatch(H)}}return}if(He&&n.cursorWrapper&&c.sel&&c.sel.anchor==n.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let w=h.endB-h.start;c.sel={anchor:c.sel.anchor+w,head:c.sel.anchor+w}}n.input.domChangeCount++,n.state.selection.fromn.state.selection.from&&h.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?h.start=n.state.selection.from:h.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(h.endB+=n.state.selection.to-h.endA,h.endA=n.state.selection.to)),Ze&&kn<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),g=c.doc.resolveNoCache(h.endB-c.from),y=u.resolve(h.start),k=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=h.endA,C;if((br&&n.input.lastIOSEnter>Date.now()-225&&(!k||i.some(w=>w.nodeName=="DIV"||w.nodeName=="P"))||!k&&m.posw(n,Pn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>h.start&&Yh(u,h.start,h.endA,m,g)&&n.someProp("handleKeyDown",w=>w(n,Pn(8,"Backspace")))){Ct&&He&&n.domObserver.suppressSelectionUpdates();return}He&&Ct&&h.endB==h.start&&(n.input.lastAndroidDelete=Date.now()),Ct&&!k&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,g=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(w){return w(n,Pn(13,"Enter"))})},20));let b=h.start,E=h.endA,v,O,W;if(k){if(m.pos==g.pos)Ze&&kn<=11&&m.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>en(n),20)),v=n.state.tr.delete(b,E),O=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(W=Gh(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start()))))v=n.state.tr,W.type=="add"?v.addMark(b,E,W.mark):v.removeMark(b,E,W.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let w=m.parent.textBetween(m.parentOffset,g.parentOffset);if(n.someProp("handleTextInput",H=>H(n,b,E,w)))return;v=n.state.tr.insertText(w,b,E)}}if(v||(v=n.state.tr.replace(b,E,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let w=ec(n,v.doc,c.sel);w&&!(He&&Ct&&n.composing&&w.empty&&(h.start!=h.endB||n.input.lastAndroidDeletee.content.size?null:Rl(n,e.resolve(t.anchor),e.resolve(t.head))}function Gh(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r,s,l,a;for(let u=0;uu.mark(l.addToSet(u.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ut||hs(s,!0,!1)0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Xh(n,e,t,r,i){let o=n.findDiffStart(e,t);if(o==null)return null;let{a:s,b:l}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,l));r-=s+a-o}if(s=s?o-r:0;o-=a,o&&o=l?o-r:0;o-=a,o&&o=56320&&e<=57343&&t>=55296&&t<=56319}class Qh{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new vh,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(sc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ic(this),rc(this),this.nodeViews=oc(this),this.docView=Ba(this.state.doc,nc(this),ps(this),this.dom,this),this.domObserver=new Vh(this,(r,i,o,s)=>Jh(this,r,i,o,s)),this.domObserver.start(),kh(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Xs(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(sc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(pd(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=oc(this);em(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&Xs(this),this.editable=ic(this),rc(this);let a=ps(this),c=nc(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=o||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(i.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Pp(this);if(s){this.domObserver.stop();let p=d&&(Ze||He)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Zh(i.selection,e.selection);if(d){let h=He?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Ba(e.doc,c,a,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&oh(this))?en(this,p):(ed(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&Lp(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof j){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Da(this,t.getBoundingClientRect(),e)}else Da(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new md(e.slice,e.move,i<0?void 0:j.create(this.state.doc,i))}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let s=0;st.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Hp(this,e)}coordsAtPos(e,t=1){return qu(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return qp(this,t||this.state,e)}pasteHTML(e,t){return ni(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ni(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(wh(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ps(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Sh(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Je&&this.root.nodeType===11&&Op(this.dom.ownerDocument)==this.dom?Wh(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function nc(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[gt.node(0,n.state.doc.content.size,e)]}function rc(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:gt.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function ic(n){return!n.someProp("editable",e=>e(n.state)===!1)}function Zh(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function oc(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function em(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function sc(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Cn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Yi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},tm=typeof navigator<"u"&&/Mac/.test(navigator.platform),nm=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Le=0;Le<10;Le++)Cn[48+Le]=Cn[96+Le]=String(Le);for(var Le=1;Le<=24;Le++)Cn[Le+111]="F"+Le;for(var Le=65;Le<=90;Le++)Cn[Le]=String.fromCharCode(Le+32),Yi[Le]=String.fromCharCode(Le);for(var ms in Cn)Yi.hasOwnProperty(ms)||(Yi[ms]=Cn[ms]);function rm(n){var e=tm&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||nm&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Yi:Cn)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const im=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function om(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,s;for(let l=0;l127)&&(o=Cn[r.keyCode])&&o!=i){let l=e[gs(o,r)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}const am=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function cm(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const um=(n,e,t)=>{let r=cm(n,t);if(!r)return!1;let i=wd(r);if(!i){let s=r.blockRange(),l=s&&Tr(s);return l==null?!1:(e&&e(n.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Cd(n,i,e))return!0;if(r.parent.content.size==0&&(yr(o,"end")||j.isSelectable(o))){let s=El(n.doc,r.before(),r.after(),I.empty);if(s&&s.slice.size{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=wd(r)}let s=o&&o.nodeBefore;return!s||!j.isSelectable(s)?!1:(e&&e(n.tr.setSelection(j.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function wd(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function fm(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let r=fm(n,t);if(!r)return!1;let i=xd(r);if(!i)return!1;let o=i.nodeAfter;if(Cd(n,i,e))return!0;if(r.parent.content.size==0&&(yr(o,"start")||j.isSelectable(o))){let s=El(n.doc,r.before(),r.after(),I.empty);if(s&&s.slice.size{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,r=t instanceof j,i;if(r){if(t.node.isTextblock||!Tn(n.doc,t.from))return!1;i=t.from}else if(i=Bo(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(j.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},gm=(n,e)=>{let t=n.selection,r;if(t instanceof j){if(t.node.isTextblock||!Tn(n.doc,t.to))return!1;r=t.to}else if(r=Bo(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},bm=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&Tr(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},ym=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(` +`).scrollIntoView()),!0)};function Sd(n){for(let e=0;e{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),s=Sd(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=t.after(),a=n.tr.replaceWith(l,l,s.createAndFill());a.setSelection(Z.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},km=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Ot||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Sd(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(dr(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Tr(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},xm=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(j.create(n.doc,i))),!0)};function Sm(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Tn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Cd(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(Sm(n,e,t))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(t){let d=e.pos+i.nodeSize,f=T.empty;for(let m=o.length-1;m>=0;m--)f=T.from(o[m].create(null,f));f=T.from(r.copy(f));let p=n.tr.step(new Ne(e.pos-1,d,e.pos,d,new I(f,1,0),o.length,!0)),h=d+2*o.length;Tn(p.doc,h)&&p.join(h),t(p.scrollIntoView())}return!0}let a=Z.findFrom(e,1),c=a&&a.$from.blockRange(a.$to),u=c&&Tr(c);if(u!=null&&u>=e.depth)return t&&t(n.tr.lift(c,u).scrollIntoView()),!0;if(l&&yr(i,"start",!0)&&yr(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(t){let m=T.empty;for(let y=f.length-1;y>=0;y--)m=T.from(f[y].copy(m));let g=n.tr.step(new Ne(e.pos-f.length,e.pos+i.nodeSize,e.pos+h,e.pos+i.nodeSize-h,new I(m,f.length,0),0,!0));t(g.scrollIntoView())}return!0}}return!1}function Md(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(G.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const Cm=Md(-1),Mm=Md(1);function Tm(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,s=i.blockRange(o),l=s&&Ol(s,n,e);return l?(r&&r(t.tr.wrap(s,l).scrollIntoView()),!0):!1}}function lc(n,e=null){return function(t,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)i=!0;else{let u=t.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(n)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let u=t.doc.resolve(s.start-2);a=new Vi(u,u,s.depth),s.endIndex=0;u--)o=T.from(t[u].type.create(t[u].attrs,o));n.step(new Ne(e.start-(r?2:0),e.end,e.start,e.end,new I(o,0,0),t.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?Nm(e,t,n,o):Dm(e,t,o):!0:!1}}function Nm(n,e,t,r){let i=n.tr,o=r.end,s=r.$to.end(r.depth);om;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(t.start),s=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(l?0:1),u+1,s.content.append(a?T.empty:T.from(i))))return!1;let d=o.pos,f=d+s.nodeSize;return r.step(new Ne(d-(l?1:0),f+(a?1:0),d+1,f-1,new I((l?T.empty:T.from(i.copy(T.empty))).append(a?T.empty:T.from(i.copy(T.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Im(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==n);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,a=l.child(s-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=T.from(c?n.create():null),d=new I(T.from(n.create(null,T.from(l.type.create(null,u)))),c?3:1,0),f=o.start,p=o.end;t(e.tr.step(new Ne(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}function Vo(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class jo{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...u)=>{const d=a(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],a=!!e,c=e||o.tr,u=()=>(!a&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...m)=>{const g=this.buildProps(c,t),y=p(...m)(g);return l.push(y),d}])),run:u};return d}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:Vo({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([a,c])=>[a,(...u)=>c(...u)(l)]))}};return l}}class Rm{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(i=>i!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function F(n,e,t){return n.config[e]===void 0&&n.parent?F(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?F(n.parent,e,t):null}):n.config[e]}function Wo(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Td(n){const e=[],{nodeExtensions:t,markExtensions:r}=Wo(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},a=F(s,"addGlobalAttributes",l);if(!a)return;a().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([f,p])=>{e.push({type:d,name:f,attribute:{...o,...p}})})})})}),i.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},a=F(s,"addAttributes",l);if(!a)return;const c=a();Object.entries(c).forEach(([u,d])=>{const f={...o,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:s.name,name:u,attribute:f})})}),e}function Ie(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Me(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const l=o?o.split(" "):[],a=r[i]?r[i].split(" "):[],c=l.filter(u=>!a.includes(u));r[i]=[...a,...c].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Qs(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Me(t,r),{})}function Od(n){return typeof n=="function"}function Q(n,e=void 0,...t){return Od(n)?e?n.bind(e)(...t):n(...t):n}function Pm(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Lm(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function ac(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(t):Lm(t.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function cc(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&Pm(t)?!1:t!=null))}function $m(n,e){var t;const r=Td(n),{nodeExtensions:i,markExtensions:o}=Wo(n),s=(t=i.find(c=>F(c,"topNode")))===null||t===void 0?void 0:t.name,l=Object.fromEntries(i.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=n.reduce((y,k)=>{const C=F(k,"extendNodeSchema",d);return{...y,...C?C(c):{}}},{}),p=cc({...f,content:Q(F(c,"content",d)),marks:Q(F(c,"marks",d)),group:Q(F(c,"group",d)),inline:Q(F(c,"inline",d)),atom:Q(F(c,"atom",d)),selectable:Q(F(c,"selectable",d)),draggable:Q(F(c,"draggable",d)),code:Q(F(c,"code",d)),defining:Q(F(c,"defining",d)),isolating:Q(F(c,"isolating",d)),attrs:Object.fromEntries(u.map(y=>{var k;return[y.name,{default:(k=y==null?void 0:y.attribute)===null||k===void 0?void 0:k.default}]}))}),h=Q(F(c,"parseHTML",d));h&&(p.parseDOM=h.map(y=>ac(y,u)));const m=F(c,"renderHTML",d);m&&(p.toDOM=y=>m({node:y,HTMLAttributes:Qs(y,u)}));const g=F(c,"renderText",d);return g&&(p.toText=g),[c.name,p]})),a=Object.fromEntries(o.map(c=>{const u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=n.reduce((g,y)=>{const k=F(y,"extendMarkSchema",d);return{...g,...k?k(c):{}}},{}),p=cc({...f,inclusive:Q(F(c,"inclusive",d)),excludes:Q(F(c,"excludes",d)),group:Q(F(c,"group",d)),spanning:Q(F(c,"spanning",d)),code:Q(F(c,"code",d)),attrs:Object.fromEntries(u.map(g=>{var y;return[g.name,{default:(y=g==null?void 0:g.attribute)===null||y===void 0?void 0:y.default}]}))}),h=Q(F(c,"parseHTML",d));h&&(p.parseDOM=h.map(g=>ac(g,u)));const m=F(c,"renderHTML",d);return m&&(p.toDOM=g=>m({mark:g,HTMLAttributes:Qs(g,u)})),[c.name,p]}));return new qf({topNode:s,nodes:l,marks:a})}function bs(n,e){return e.nodes[n]||e.marks[n]||null}function uc(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const Bm=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var a,c;const u=((c=(a=i.type.spec).toText)===null||c===void 0?void 0:c.call(a,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";t+=u.slice(0,Math.max(0,r-o))}),t};function Fl(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Uo{constructor(e){this.find=e.find,this.handler=e.handler}}const zm=(n,e)=>{if(Fl(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function ys(n){var e;const{editor:t,from:r,to:i,text:o,rules:s,plugin:l}=n,{view:a}=t;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=Bm(c)+o;return s.forEach(f=>{if(u)return;const p=zm(d,f.find);if(!p)return;const h=a.state.tr,m=Vo({state:a.state,transaction:h}),g={from:r-(p[0].length-o.length),to:i},{commands:y,chain:k,can:C}=new jo({editor:t,state:m});f.handler({state:m,range:g,match:p,commands:y,chain:k,can:C})===null||!h.steps.length||(h.setMeta(l,{transform:h,from:r,to:i,text:o}),a.dispatch(h),u=!0)}),u}function Fm(n){const{editor:e,rules:t}=n,r=new We({state:{init(){return null},apply(i,o){const s=i.getMeta(r);return s||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,s,l){return ys({editor:e,from:o,to:s,text:l,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&ys({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?ys({editor:e,from:s.pos,to:s.pos,text:` +`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function _m(n){return typeof n=="number"}class Hm{constructor(e){this.find=e.find,this.handler=e.handler}}const Vm=(n,e,t)=>{if(Fl(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=n,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function jm(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=n,{commands:a,chain:c,can:u}=new jo({editor:e,state:t}),d=[];return t.doc.nodesBetween(r,i,(p,h)=>{if(!p.isTextblock||p.type.spec.code)return;const m=Math.max(r,h),g=Math.min(i,h+p.content.size),y=p.textBetween(m-h,g-h,void 0,"");Vm(y,o.find,s).forEach(C=>{if(C.index===void 0)return;const b=m+C.index+1,E=b+C[0].length,v={from:t.tr.mapping.map(b),to:t.tr.mapping.map(E)},O=o.handler({state:t,range:v,match:C,commands:a,chain:c,can:u,pasteEvent:s,dropEvent:l});d.push(O)})}),d.every(p=>p!==null)}function Wm(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,s=new ClipboardEvent("paste"),l=new DragEvent("drop");return t.map(c=>new We({view(u){const d=f=>{var p;r=!((p=u.dom.parentElement)===null||p===void 0)&&p.contains(f.target)?u.dom.parentElement:null};return window.addEventListener("dragstart",d),{destroy(){window.removeEventListener("dragstart",d)}}},props:{handleDOMEvents:{drop:(u,d)=>(o=r===u.dom.parentElement,l=d,!1),paste:(u,d)=>{var f;const p=(f=d.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return s=d,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(u,d,f)=>{const p=u[0],h=p.getMeta("uiEvent")==="paste"&&!i,m=p.getMeta("uiEvent")==="drop"&&!o;if(!h&&!m)return;const g=d.doc.content.findDiffStart(f.doc.content),y=d.doc.content.findDiffEnd(f.doc.content);if(!_m(g)||!y||g===y.b)return;const k=f.tr,C=Vo({state:f,transaction:k});if(!(!jm({editor:e,state:C,from:Math.max(g-1,0),to:y.b-1,rule:c,pasteEvent:s,dropEvent:l})||!k.steps.length))return l=new DragEvent("drop"),s=new ClipboardEvent("paste"),k}}))}function Um(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class cr{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=cr.resolve(e),this.schema=$m(this.extensions,t),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:bs(r.name,this.schema)};r.type==="mark"&&(!((i=Q(F(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const s=F(r,"onBeforeCreate",o);s&&this.editor.on("beforeCreate",s);const l=F(r,"onCreate",o);l&&this.editor.on("create",l);const a=F(r,"onUpdate",o);a&&this.editor.on("update",a);const c=F(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const u=F(r,"onTransaction",o);u&&this.editor.on("transaction",u);const d=F(r,"onFocus",o);d&&this.editor.on("focus",d);const f=F(r,"onBlur",o);f&&this.editor.on("blur",f);const p=F(r,"onDestroy",o);p&&this.editor.on("destroy",p)})}static resolve(e){const t=cr.sort(cr.flatten(e)),r=Um(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=F(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=F(r,"priority")||100,s=F(i,"priority")||100;return o>s?-1:o{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:bs(t.name,this.schema)},i=F(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=cr.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(s=>{const l={name:s.name,options:s.options,storage:s.storage,editor:e,type:bs(s.name,this.schema)},a=[],c=F(s,"addKeyboardShortcuts",l);let u={};if(s.type==="mark"&&s.config.exitable&&(u.ArrowRight=()=>At.handleExit({editor:e,mark:s})),c){const m=Object.fromEntries(Object.entries(c()).map(([g,y])=>[g,()=>y({editor:e})]));u={...u,...m}}const d=lm(u);a.push(d);const f=F(s,"addInputRules",l);uc(s,e.options.enableInputRules)&&f&&r.push(...f());const p=F(s,"addPasteRules",l);uc(s,e.options.enablePasteRules)&&p&&i.push(...p());const h=F(s,"addProseMirrorPlugins",l);if(h){const m=h();a.push(...m)}return a}).flat();return[Fm({editor:e,rules:r}),...Wm({editor:e,rules:i}),...o]}get attributes(){return Td(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Wo(this.extensions);return Object.fromEntries(t.filter(r=>!!F(r,"addNodeView")).map(r=>{const i=this.attributes.filter(a=>a.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Ie(r.name,this.schema)},s=F(r,"addNodeView",o);if(!s)return[];const l=(a,c,u,d)=>{const f=Qs(a,i);return s()({editor:e,node:a,getPos:u,decorations:d,HTMLAttributes:f,extension:r})};return[r.name,l]}))}}function qm(n){return Object.prototype.toString.call(n).slice(8,-1)}function vs(n){return qm(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function qo(n,e){const t={...n};return vs(n)&&vs(e)&&Object.keys(e).forEach(r=>{vs(e[r])?r in n?t[r]=qo(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class nt{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Q(F(this,"addOptions",{name:this.name}))),this.storage=Q(F(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new nt(e)}configure(e={}){const t=this.extend();return t.options=qo(this.options,e),t.storage=Q(F(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new nt(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Q(F(t,"addOptions",{name:t.name})),t.storage=Q(F(t,"addStorage",{name:t.name,options:t.options})),t}}function Ed(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=` -`,textSerializers:s={}}=t||{};let l="",a=!0;return n.nodesBetween(r,i,(c,u,d,f)=>{var p;const h=s==null?void 0:s[c.type.name];h?(c.isBlock&&!a&&(l+=o,a=!0),d&&(l+=h({node:c,pos:u,parent:d,index:f,range:e}))):c.isText?(l+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,i-u),a=!1):c.isBlock&&!a&&(l+=o,a=!0)}),l}function Ed(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const Km=nt.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new We({key:new wt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),l=Math.max(...o.map(u=>u.$to.pos)),a=Ed(t);return Ad(r,{from:s,to:l},{textSerializers:a})}}})]}}),Jm=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),Gm=(n=!1)=>({commands:e})=>e.setContent("",n),Ym=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:s})=>{n.doc.nodesBetween(o.pos,s.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),p=d.blockRange(f);if(!p)return;const h=Tr(p);if(l.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(h||h===0)&&e.lift(p,h)})}),!0},Xm=n=>e=>n(e),Qm=()=>({state:n,dispatch:e})=>km(n,e),Zm=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new G(r.doc.resolve(s-1))),!0},eg=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const l=i.before(o),a=i.after(o);n.delete(l,a).scrollIntoView()}return!0}return!1},tg=n=>({tr:e,state:t,dispatch:r})=>{const i=Ie(n,t.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const a=o.before(s),c=o.after(s);e.delete(a,c).scrollIntoView()}return!0}return!1},ng=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},rg=()=>({state:n,dispatch:e})=>am(n,e),ig=()=>({commands:n})=>n.keyboardShortcut("Enter"),og=()=>({state:n,dispatch:e})=>vm(n,e);function Xi(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Fl(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function Zs(n,e,t={}){return n.find(r=>r.type===e&&Xi(r.attrs,t))}function sg(n,e,t={}){return!!Zs(n,e,t)}function _l(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=Zs([...r.node.marks],e,t);if(!i)return;let o=r.index,s=n.start()+r.offset,l=o+1,a=s+r.node.nodeSize;for(Zs([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,s-=n.parent.child(o).nodeSize;for(;l({tr:t,state:r,dispatch:i})=>{const o=An(n,r.schema),{doc:s,selection:l}=t,{$from:a,from:c,to:u}=l;if(i){const d=_l(a,o,e);if(d&&d.from<=c&&d.to>=u){const f=G.create(s,d.from,d.to);t.setSelection(f)}}return!0},ag=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{Vl()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!Hl(t.state.selection))return s(),!0;const l=Nd(i.doc,n)||t.state.selection,a=t.state.selection.eq(l);return o&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},ug=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),dg=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),el=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&!/\S/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&el(r)}return n};function dc(n){const e=`${n}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return el(t),el(t)}function Qi(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?T.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),Qi("",e,t)}if(typeof n=="string"){const r=Ml.fromSchema(e);return t.slice?r.parseSlice(dc(n),t.parseOptions).content:r.parse(dc(n),t.parseOptions)}return Qi("",e,t)}function fg(n,e,t){const r=n.steps.length-1;if(r{s===0&&(s=u)}),n.setSelection(Z.near(n.doc.resolve(s),t))}const pg=n=>n.toString().startsWith("<"),hg=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const s=Qi(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(s.toString()==="<>")return!0;let{from:l,to:a}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},c=!0,u=!0;if((pg(s)?s:[s]).forEach(f=>{f.check(),c=c?f.isText&&f.marks.length===0:!1,u=u?f.isBlock:!1}),l===a&&u){const{parent:f}=r.doc.resolve(l);f.isTextblock&&!f.type.spec.code&&!f.childCount&&(l-=1,a+=1)}c?Array.isArray(e)?r.insertText(e.map(f=>f.text||"").join(""),l,a):typeof e=="object"&&e&&e.text?r.insertText(e.text,l,a):r.insertText(e,l,a):r.replaceWith(l,a,s),t.updateSelection&&fg(r,r.steps.length-1,-1)}return!0},mg=()=>({state:n,dispatch:e})=>mm(n,e),gg=()=>({state:n,dispatch:e})=>gm(n,e),bg=()=>({state:n,dispatch:e})=>um(n,e),yg=()=>({state:n,dispatch:e})=>pm(n,e),vg=()=>({tr:n,state:e,dispatch:t})=>{try{const r=Bo(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},kg=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Bo(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function jl(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function wg(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,s;for(let l=0;l({editor:e,view:t,tr:r,dispatch:i})=>{const o=wg(n).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function ii(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,s=e?Ie(e,n.schema):null,l=[];n.doc.nodesBetween(r,i,(d,f)=>{if(d.isText)return;const p=Math.max(r,f),h=Math.min(i,f+d.nodeSize);l.push({node:d,from:p,to:h})});const a=i-r,c=l.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>Xi(d.node.attrs,t,{strict:!1}));return o?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=a}const Sg=(n,e={})=>({state:t,dispatch:r})=>{const i=Ie(n,t.schema);return ii(t,i,e)?bm(t,r):!1},Cg=()=>({state:n,dispatch:e})=>wm(n,e),Mg=n=>({state:e,dispatch:t})=>{const r=Ie(n,e.schema);return Em(r)(e,t)},Tg=()=>({state:n,dispatch:e})=>ym(n,e);function Ko(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function fc(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const Og=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,s=null;const l=Ko(typeof n=="string"?n:n.name,r.schema);return l?(l==="node"&&(o=Ie(n,r.schema)),l==="mark"&&(s=An(n,r.schema)),i&&t.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(c,u)=>{o&&o===c.type&&t.setNodeMarkup(u,void 0,fc(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&t.addMark(u,u+c.nodeSize,s.create(fc(d.attrs,e)))})})}),!0):!1},Ag=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Eg=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),Ng=()=>({state:n,dispatch:e})=>dm(n,e),Dg=()=>({state:n,dispatch:e})=>hm(n,e),Ig=()=>({state:n,dispatch:e})=>xm(n,e),Rg=()=>({state:n,dispatch:e})=>Mm(n,e),Pg=()=>({state:n,dispatch:e})=>Cm(n,e);function Dd(n,e,t={}){return Qi(n,e,{slice:!1,parseOptions:t})}const Lg=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,l=Dd(n,i.schema,t);return o&&r.replaceWith(0,s.content.size,l).setMeta("preventUpdate",!e),!0};function Jo(n,e){const t=An(e,n.schema),{from:r,to:i,empty:o}=n.selection,s=[];o?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,a=>{s.push(...a.marks)});const l=s.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function $g(n,e){const t=new zu(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function Bg(n){for(let e=0;e{t(i)&&r.push({node:i,pos:o})}),r}function Fg(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Wl(n){return e=>Fg(e.$from,n)}function _g(n,e){const t=Ft.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function Hg(n,e){const t={from:0,to:n.content.size};return Ad(n,t,e)}function Vg(n,e){const t=Ie(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,l=>{o.push(l)});const s=o.reverse().find(l=>l.type.name===t.name);return s?{...s.attrs}:{}}function Id(n,e){const t=Ko(typeof e=="string"?e:e.name,n.schema);return t==="node"?Vg(n,e):t==="mark"?Jo(n,e):{}}function jg(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function Wg(n){const e=jg(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,s)=>s!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function Ug(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((l,a)=>{s.push({from:l,to:a})});else{const{from:l,to:a}=t[o];if(l===void 0||a===void 0)return;s.push({from:l,to:a})}s.forEach(({from:l,to:a})=>{const c=e.slice(o).map(l,-1),u=e.slice(o).map(a),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),Wg(r)}function Ul(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),s=_l(o,i.type);s&&r.push({mark:i,...s})}):t.nodesBetween(n,e,(i,o)=>{!i||i.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Ii(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function tl(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?An(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>Xi(d.attrs,t,{strict:!1}));let s=0;const l=[];if(i.forEach(({$from:d,$to:f})=>{const p=d.pos,h=f.pos;n.doc.nodesBetween(p,h,(m,g)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(p,g),k=Math.min(h,g+m.nodeSize),C=k-y;s+=C,l.push(...m.marks.map(b=>({mark:b,from:y,to:k})))})}),s===0)return!1;const a=l.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>Xi(d.mark.attrs,t,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=l.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,f)=>d+f.to-f.from,0);return(a>0?a+c:a)>=s}function qg(n,e,t={}){if(!e)return ii(n,null,t)||tl(n,null,t);const r=Ko(e,n.schema);return r==="node"?ii(n,e,t):r==="mark"?tl(n,e,t):!1}function pc(n,e){const{nodeExtensions:t}=Wo(e),r=t.find(s=>s.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Q(F(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Kg(n){var e;const t=(e=n.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=n.toJSON();return JSON.stringify(t)===JSON.stringify(r)}function Jg(n){return n instanceof j}function Gg(n,e,t){const i=n.state.doc.content.size,o=Zt(e,0,i),s=Zt(t,0,i),l=n.coordsAtPos(o),a=n.coordsAtPos(s,-1),c=Math.min(l.top,a.top),u=Math.max(l.bottom,a.bottom),d=Math.min(l.left,a.left),f=Math.max(l.right,a.right),p=f-d,h=u-c,y={top:c,bottom:u,left:d,right:f,width:p,height:h,x:d,y:c};return{...y,toJSON:()=>y}}function Yg(n,e,t){var r;const{selection:i}=e;let o=null;if(Hl(i)&&(o=i.$cursor),o){const l=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(l)||!l.some(a=>a.type.excludes(t))}const{ranges:s}=i;return s.some(({$from:l,$to:a})=>{let c=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,a.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const p=!f||f.type.allowsMarkType(t),h=!!t.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(t));c=p&&h}return!c}),c})}const Xg=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:s,ranges:l}=o,a=An(n,r.schema);if(i)if(s){const c=Jo(r,a);t.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,p)=>{const h=Math.max(p,u),m=Math.min(p+f.nodeSize,d);f.marks.find(y=>y.type===a)?f.marks.forEach(y=>{a===y.type&&t.addMark(h,m,a.create({...y.attrs,...e}))}):t.addMark(h,m,a.create(e))})});return Yg(r,t,a)},Qg=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),Zg=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=Ie(n,t.schema);return o.isTextblock?i().command(({commands:s})=>lc(o,e)(t)?!0:s.clearNodes()).command(({state:s})=>lc(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},eb=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Zt(n,0,r.content.size),o=j.create(r,i);e.setSelection(o)}return!0},tb=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,s=G.atStart(r).from,l=G.atEnd(r).to,a=Zt(i,s,l),c=Zt(o,s,l),u=G.create(r,a,c);e.setSelection(u)}return!0},nb=n=>({state:e,dispatch:t})=>{const r=Ie(n,e.schema);return Im(r)(e,t)};function hc(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e==null?void 0:e.includes(i.type.name));n.tr.ensureMarks(r)}}const rb=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:l,$to:a}=o,c=i.extensionManager.attributes,u=Ii(c,l.node().type.name,l.node().attrs);if(o instanceof j&&o.node.isBlock)return!l.parentOffset||!dr(s,l.pos)?!1:(r&&(n&&hc(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const d=a.parentOffset===a.parent.content.size;o instanceof G&&e.deleteSelection();const f=l.depth===0?void 0:Bg(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=d&&f?[{type:f,attrs:u}]:void 0,h=dr(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!h&&dr(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:u}]:void 0),h&&(e.split(e.mapping.map(l.pos),1,p),f&&!d&&!l.parentOffset&&l.parent.type!==f)){const m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}n&&hc(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},ib=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const s=Ie(n,t.schema),{$from:l,$to:a}=t.selection,c=t.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(a))return!1;const u=l.node(-1);if(u.type!==s)return!1;const d=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let g=T.empty;const y=l.index(-1)?1:l.index(-2)?2:3;for(let O=l.depth-y;O>=l.depth-3;O-=1)g=T.from(l.node(O).copy(g));const k=l.indexAfter(-1){if(v>-1)return!1;O.isTextblock&&O.content.size===0&&(v=W+1)}),v>-1&&e.setSelection(G.near(e.doc.resolve(v))),e.scrollIntoView()}return!0}const f=a.pos===l.end()?u.contentMatchAt(0).defaultType:null,p=Ii(d,u.type.name,u.attrs),h=Ii(d,l.node().type.name,l.node().attrs);e.delete(l.pos,a.pos);const m=f?[{type:s,attrs:p},{type:f,attrs:h}]:[{type:s,attrs:p}];if(!dr(e.doc,l.pos,2))return!1;if(r){const{selection:g,storedMarks:y}=t,{splittableMarks:k}=i.extensionManager,C=y||g.$to.parentOffset&&g.$from.marks();if(e.split(l.pos,2,m).scrollIntoView(),!C||!r)return!0;const b=C.filter(A=>k.includes(A.type.name));e.ensureMarks(b)}return!0},ks=(n,e)=>{const t=Wl(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&Tn(n.doc,t.pos)&&n.join(t.pos),!0},ws=(n,e)=>{const t=Wl(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&Tn(n.doc,r)&&n.join(r),!0},ob=(n,e,t,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,p=Ie(n,s.schema),h=Ie(e,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:k}=m,C=y.blockRange(k),b=g||m.$to.parentOffset&&m.$from.marks();if(!C)return!1;const A=Wl(v=>pc(v.type.name,d))(m);if(C.depth>=1&&A&&C.depth-A.depth<=1){if(A.node.type===p)return c.liftListItem(h);if(pc(A.node.type.name,d)&&p.validContent(A.node.content)&&l)return a().command(()=>(o.setNodeMarkup(A.pos,p),!0)).command(()=>ks(o,p)).command(()=>ws(o,p)).run()}return!t||!b||!l?a().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>ks(o,p)).command(()=>ws(o,p)).run():a().command(()=>{const v=u().wrapInList(p,r),O=b.filter(W=>f.includes(W.type.name));return o.ensureMarks(O),v?!0:c.clearNodes()}).wrapInList(p,r).command(()=>ks(o,p)).command(()=>ws(o,p)).run()},sb=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,s=An(n,r.schema);return tl(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},lb=(n,e,t={})=>({state:r,commands:i})=>{const o=Ie(n,r.schema),s=Ie(e,r.schema);return ii(r,o,t)?i.setNode(s):i.setNode(o,t)},ab=(n,e={})=>({state:t,commands:r})=>{const i=Ie(n,t.schema);return ii(t,i,e)?r.lift(i):r.wrapIn(i,e)},cb=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r=0;a-=1)s.step(l.steps[a].invert(l.docs[a]));if(o.text){const a=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,n.schema.text(o.text,a))}else s.delete(o.from,o.to)}return!0}}return!1},ub=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},db=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:l}=t,a=An(n,r.schema),{$from:c,empty:u,ranges:d}=l;if(!i)return!0;if(u&&s){let{from:f,to:p}=l;const h=(o=c.marks().find(g=>g.type===a))===null||o===void 0?void 0:o.attrs,m=_l(c,a,h);m&&(f=m.from,p=m.to),t.removeMark(f,p,a)}else d.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,a)});return t.removeStoredMark(a),!0},fb=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,s=null;const l=Ko(typeof n=="string"?n:n.name,r.schema);return l?(l==="node"&&(o=Ie(n,r.schema)),l==="mark"&&(s=An(n,r.schema)),i&&t.selection.ranges.forEach(a=>{const c=a.$from.pos,u=a.$to.pos;r.doc.nodesBetween(c,u,(d,f)=>{o&&o===d.type&&t.setNodeMarkup(f,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(p=>{if(s===p.type){const h=Math.max(f,c),m=Math.min(f+d.nodeSize,u);t.addMark(h,m,s.create({...p.attrs,...e}))}})})}),!0):!1},pb=(n,e={})=>({state:t,dispatch:r})=>{const i=Ie(n,t.schema);return Tm(i,e)(t,r)},hb=(n,e={})=>({state:t,dispatch:r})=>{const i=Ie(n,t.schema);return Om(i,e)(t,r)};var mb=Object.freeze({__proto__:null,blur:Jm,clearContent:Gm,clearNodes:Ym,command:Xm,createParagraphNear:Qm,cut:Zm,deleteCurrentNode:eg,deleteNode:tg,deleteRange:ng,deleteSelection:rg,enter:ig,exitCode:og,extendMarkRange:lg,first:ag,focus:cg,forEach:ug,insertContent:dg,insertContentAt:hg,joinUp:mg,joinDown:gg,joinBackward:bg,joinForward:yg,joinItemBackward:vg,joinItemForward:kg,keyboardShortcut:xg,lift:Sg,liftEmptyBlock:Cg,liftListItem:Mg,newlineInCode:Tg,resetAttributes:Og,scrollIntoView:Ag,selectAll:Eg,selectNodeBackward:Ng,selectNodeForward:Dg,selectParentNode:Ig,selectTextblockEnd:Rg,selectTextblockStart:Pg,setContent:Lg,setMark:Xg,setMeta:Qg,setNode:Zg,setNodeSelection:eb,setTextSelection:tb,sinkListItem:nb,splitBlock:rb,splitListItem:ib,toggleList:ob,toggleMark:sb,toggleNode:lb,toggleWrap:ab,undoInputRule:cb,unsetAllMarks:ub,unsetMark:db,updateAttributes:fb,wrapIn:pb,wrapInList:hb});const gb=nt.create({name:"commands",addCommands(){return{...mb}}}),bb=nt.create({name:"editable",addProseMirrorPlugins(){return[new We({key:new wt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),yb=nt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new We({key:new wt("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),vb=nt.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:d}=a,{pos:f,parent:p}=d,h=d.parent.isTextblock?l.doc.resolve(f-1):d,m=h.parent.type.spec.isolating,g=d.pos-d.parentOffset,y=m&&h.parent.childCount===1?g===d.pos:Z.atStart(c).from===f;return!u||!y||!p.type.isTextblock||p.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Vl()||jl()?o:i},addProseMirrorPlugins(){return[new We({key:new wt("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(h=>h.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:s}=e.selection,l=Z.atStart(e.doc).from,a=Z.atEnd(e.doc).to;if(i||!(o===l&&s===a)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const d=t.tr,f=Vo({state:t,transaction:d}),{commands:p}=new jo({editor:this.editor,state:f});if(p.clearNodes(),!!d.steps.length)return d}})]}}),kb=nt.create({name:"tabindex",addProseMirrorPlugins(){return[new We({key:new wt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var wb=Object.freeze({__proto__:null,ClipboardTextSerializer:Km,Commands:gb,Editable:bb,FocusEvents:yb,Keymap:vb,Tabindex:kb});const xb=`.ProseMirror { +`,textSerializers:s={}}=t||{};let l="",a=!0;return n.nodesBetween(r,i,(c,u,d,f)=>{var p;const h=s==null?void 0:s[c.type.name];h?(c.isBlock&&!a&&(l+=o,a=!0),d&&(l+=h({node:c,pos:u,parent:d,index:f,range:e}))):c.isText?(l+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,i-u),a=!1):c.isBlock&&!a&&(l+=o,a=!0)}),l}function Ad(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const Km=nt.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new We({key:new wt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),l=Math.max(...o.map(u=>u.$to.pos)),a=Ad(t);return Ed(r,{from:s,to:l},{textSerializers:a})}}})]}}),Jm=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),Gm=(n=!1)=>({commands:e})=>e.setContent("",n),Ym=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:s})=>{n.doc.nodesBetween(o.pos,s.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),p=d.blockRange(f);if(!p)return;const h=Tr(p);if(l.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(h||h===0)&&e.lift(p,h)})}),!0},Xm=n=>e=>n(e),Qm=()=>({state:n,dispatch:e})=>km(n,e),Zm=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new G(r.doc.resolve(s-1))),!0},eg=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const l=i.before(o),a=i.after(o);n.delete(l,a).scrollIntoView()}return!0}return!1},tg=n=>({tr:e,state:t,dispatch:r})=>{const i=Ie(n,t.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const a=o.before(s),c=o.after(s);e.delete(a,c).scrollIntoView()}return!0}return!1},ng=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},rg=()=>({state:n,dispatch:e})=>am(n,e),ig=()=>({commands:n})=>n.keyboardShortcut("Enter"),og=()=>({state:n,dispatch:e})=>vm(n,e);function Xi(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Fl(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function Zs(n,e,t={}){return n.find(r=>r.type===e&&Xi(r.attrs,t))}function sg(n,e,t={}){return!!Zs(n,e,t)}function _l(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=Zs([...r.node.marks],e,t);if(!i)return;let o=r.index,s=n.start()+r.offset,l=o+1,a=s+r.node.nodeSize;for(Zs([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,s-=n.parent.child(o).nodeSize;for(;l({tr:t,state:r,dispatch:i})=>{const o=En(n,r.schema),{doc:s,selection:l}=t,{$from:a,from:c,to:u}=l;if(i){const d=_l(a,o,e);if(d&&d.from<=c&&d.to>=u){const f=G.create(s,d.from,d.to);t.setSelection(f)}}return!0},ag=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{Vl()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!Hl(t.state.selection))return s(),!0;const l=Nd(i.doc,n)||t.state.selection,a=t.state.selection.eq(l);return o&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},ug=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),dg=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),el=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&!/\S/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&el(r)}return n};function dc(n){const e=`${n}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return el(t),el(t)}function Qi(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?T.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),Qi("",e,t)}if(typeof n=="string"){const r=Ml.fromSchema(e);return t.slice?r.parseSlice(dc(n),t.parseOptions).content:r.parse(dc(n),t.parseOptions)}return Qi("",e,t)}function fg(n,e,t){const r=n.steps.length-1;if(r{s===0&&(s=u)}),n.setSelection(Z.near(n.doc.resolve(s),t))}const pg=n=>n.toString().startsWith("<"),hg=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const s=Qi(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(s.toString()==="<>")return!0;let{from:l,to:a}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},c=!0,u=!0;if((pg(s)?s:[s]).forEach(f=>{f.check(),c=c?f.isText&&f.marks.length===0:!1,u=u?f.isBlock:!1}),l===a&&u){const{parent:f}=r.doc.resolve(l);f.isTextblock&&!f.type.spec.code&&!f.childCount&&(l-=1,a+=1)}c?Array.isArray(e)?r.insertText(e.map(f=>f.text||"").join(""),l,a):typeof e=="object"&&e&&e.text?r.insertText(e.text,l,a):r.insertText(e,l,a):r.replaceWith(l,a,s),t.updateSelection&&fg(r,r.steps.length-1,-1)}return!0},mg=()=>({state:n,dispatch:e})=>mm(n,e),gg=()=>({state:n,dispatch:e})=>gm(n,e),bg=()=>({state:n,dispatch:e})=>um(n,e),yg=()=>({state:n,dispatch:e})=>pm(n,e),vg=()=>({tr:n,state:e,dispatch:t})=>{try{const r=Bo(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},kg=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Bo(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function jl(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function wg(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,s;for(let l=0;l({editor:e,view:t,tr:r,dispatch:i})=>{const o=wg(n).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function ii(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,s=e?Ie(e,n.schema):null,l=[];n.doc.nodesBetween(r,i,(d,f)=>{if(d.isText)return;const p=Math.max(r,f),h=Math.min(i,f+d.nodeSize);l.push({node:d,from:p,to:h})});const a=i-r,c=l.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>Xi(d.node.attrs,t,{strict:!1}));return o?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=a}const Sg=(n,e={})=>({state:t,dispatch:r})=>{const i=Ie(n,t.schema);return ii(t,i,e)?bm(t,r):!1},Cg=()=>({state:n,dispatch:e})=>wm(n,e),Mg=n=>({state:e,dispatch:t})=>{const r=Ie(n,e.schema);return Am(r)(e,t)},Tg=()=>({state:n,dispatch:e})=>ym(n,e);function Ko(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function fc(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const Og=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,s=null;const l=Ko(typeof n=="string"?n:n.name,r.schema);return l?(l==="node"&&(o=Ie(n,r.schema)),l==="mark"&&(s=En(n,r.schema)),i&&t.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(c,u)=>{o&&o===c.type&&t.setNodeMarkup(u,void 0,fc(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&t.addMark(u,u+c.nodeSize,s.create(fc(d.attrs,e)))})})}),!0):!1},Eg=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Ag=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),Ng=()=>({state:n,dispatch:e})=>dm(n,e),Dg=()=>({state:n,dispatch:e})=>hm(n,e),Ig=()=>({state:n,dispatch:e})=>xm(n,e),Rg=()=>({state:n,dispatch:e})=>Mm(n,e),Pg=()=>({state:n,dispatch:e})=>Cm(n,e);function Dd(n,e,t={}){return Qi(n,e,{slice:!1,parseOptions:t})}const Lg=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,l=Dd(n,i.schema,t);return o&&r.replaceWith(0,s.content.size,l).setMeta("preventUpdate",!e),!0};function Jo(n,e){const t=En(e,n.schema),{from:r,to:i,empty:o}=n.selection,s=[];o?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,a=>{s.push(...a.marks)});const l=s.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function $g(n,e){const t=new zu(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function Bg(n){for(let e=0;e{t(i)&&r.push({node:i,pos:o})}),r}function Fg(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Wl(n){return e=>Fg(e.$from,n)}function _g(n,e){const t=Ft.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function Hg(n,e){const t={from:0,to:n.content.size};return Ed(n,t,e)}function Vg(n,e){const t=Ie(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,l=>{o.push(l)});const s=o.reverse().find(l=>l.type.name===t.name);return s?{...s.attrs}:{}}function Id(n,e){const t=Ko(typeof e=="string"?e:e.name,n.schema);return t==="node"?Vg(n,e):t==="mark"?Jo(n,e):{}}function jg(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function Wg(n){const e=jg(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,s)=>s!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function Ug(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((l,a)=>{s.push({from:l,to:a})});else{const{from:l,to:a}=t[o];if(l===void 0||a===void 0)return;s.push({from:l,to:a})}s.forEach(({from:l,to:a})=>{const c=e.slice(o).map(l,-1),u=e.slice(o).map(a),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),Wg(r)}function Ul(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),s=_l(o,i.type);s&&r.push({mark:i,...s})}):t.nodesBetween(n,e,(i,o)=>{!i||i.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Ii(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function tl(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?En(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>Xi(d.attrs,t,{strict:!1}));let s=0;const l=[];if(i.forEach(({$from:d,$to:f})=>{const p=d.pos,h=f.pos;n.doc.nodesBetween(p,h,(m,g)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(p,g),k=Math.min(h,g+m.nodeSize),C=k-y;s+=C,l.push(...m.marks.map(b=>({mark:b,from:y,to:k})))})}),s===0)return!1;const a=l.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>Xi(d.mark.attrs,t,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=l.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,f)=>d+f.to-f.from,0);return(a>0?a+c:a)>=s}function qg(n,e,t={}){if(!e)return ii(n,null,t)||tl(n,null,t);const r=Ko(e,n.schema);return r==="node"?ii(n,e,t):r==="mark"?tl(n,e,t):!1}function pc(n,e){const{nodeExtensions:t}=Wo(e),r=t.find(s=>s.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Q(F(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Kg(n){var e;const t=(e=n.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=n.toJSON();return JSON.stringify(t)===JSON.stringify(r)}function Jg(n){return n instanceof j}function Gg(n,e,t){const i=n.state.doc.content.size,o=Zt(e,0,i),s=Zt(t,0,i),l=n.coordsAtPos(o),a=n.coordsAtPos(s,-1),c=Math.min(l.top,a.top),u=Math.max(l.bottom,a.bottom),d=Math.min(l.left,a.left),f=Math.max(l.right,a.right),p=f-d,h=u-c,y={top:c,bottom:u,left:d,right:f,width:p,height:h,x:d,y:c};return{...y,toJSON:()=>y}}function Yg(n,e,t){var r;const{selection:i}=e;let o=null;if(Hl(i)&&(o=i.$cursor),o){const l=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(l)||!l.some(a=>a.type.excludes(t))}const{ranges:s}=i;return s.some(({$from:l,$to:a})=>{let c=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,a.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const p=!f||f.type.allowsMarkType(t),h=!!t.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(t));c=p&&h}return!c}),c})}const Xg=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:s,ranges:l}=o,a=En(n,r.schema);if(i)if(s){const c=Jo(r,a);t.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,p)=>{const h=Math.max(p,u),m=Math.min(p+f.nodeSize,d);f.marks.find(y=>y.type===a)?f.marks.forEach(y=>{a===y.type&&t.addMark(h,m,a.create({...y.attrs,...e}))}):t.addMark(h,m,a.create(e))})});return Yg(r,t,a)},Qg=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),Zg=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=Ie(n,t.schema);return o.isTextblock?i().command(({commands:s})=>lc(o,e)(t)?!0:s.clearNodes()).command(({state:s})=>lc(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},eb=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Zt(n,0,r.content.size),o=j.create(r,i);e.setSelection(o)}return!0},tb=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,s=G.atStart(r).from,l=G.atEnd(r).to,a=Zt(i,s,l),c=Zt(o,s,l),u=G.create(r,a,c);e.setSelection(u)}return!0},nb=n=>({state:e,dispatch:t})=>{const r=Ie(n,e.schema);return Im(r)(e,t)};function hc(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e==null?void 0:e.includes(i.type.name));n.tr.ensureMarks(r)}}const rb=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:l,$to:a}=o,c=i.extensionManager.attributes,u=Ii(c,l.node().type.name,l.node().attrs);if(o instanceof j&&o.node.isBlock)return!l.parentOffset||!dr(s,l.pos)?!1:(r&&(n&&hc(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const d=a.parentOffset===a.parent.content.size;o instanceof G&&e.deleteSelection();const f=l.depth===0?void 0:Bg(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=d&&f?[{type:f,attrs:u}]:void 0,h=dr(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!h&&dr(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:u}]:void 0),h&&(e.split(e.mapping.map(l.pos),1,p),f&&!d&&!l.parentOffset&&l.parent.type!==f)){const m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}n&&hc(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},ib=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const s=Ie(n,t.schema),{$from:l,$to:a}=t.selection,c=t.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(a))return!1;const u=l.node(-1);if(u.type!==s)return!1;const d=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let g=T.empty;const y=l.index(-1)?1:l.index(-2)?2:3;for(let O=l.depth-y;O>=l.depth-3;O-=1)g=T.from(l.node(O).copy(g));const k=l.indexAfter(-1){if(v>-1)return!1;O.isTextblock&&O.content.size===0&&(v=W+1)}),v>-1&&e.setSelection(G.near(e.doc.resolve(v))),e.scrollIntoView()}return!0}const f=a.pos===l.end()?u.contentMatchAt(0).defaultType:null,p=Ii(d,u.type.name,u.attrs),h=Ii(d,l.node().type.name,l.node().attrs);e.delete(l.pos,a.pos);const m=f?[{type:s,attrs:p},{type:f,attrs:h}]:[{type:s,attrs:p}];if(!dr(e.doc,l.pos,2))return!1;if(r){const{selection:g,storedMarks:y}=t,{splittableMarks:k}=i.extensionManager,C=y||g.$to.parentOffset&&g.$from.marks();if(e.split(l.pos,2,m).scrollIntoView(),!C||!r)return!0;const b=C.filter(E=>k.includes(E.type.name));e.ensureMarks(b)}return!0},ks=(n,e)=>{const t=Wl(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&Tn(n.doc,t.pos)&&n.join(t.pos),!0},ws=(n,e)=>{const t=Wl(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&Tn(n.doc,r)&&n.join(r),!0},ob=(n,e,t,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,p=Ie(n,s.schema),h=Ie(e,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:k}=m,C=y.blockRange(k),b=g||m.$to.parentOffset&&m.$from.marks();if(!C)return!1;const E=Wl(v=>pc(v.type.name,d))(m);if(C.depth>=1&&E&&C.depth-E.depth<=1){if(E.node.type===p)return c.liftListItem(h);if(pc(E.node.type.name,d)&&p.validContent(E.node.content)&&l)return a().command(()=>(o.setNodeMarkup(E.pos,p),!0)).command(()=>ks(o,p)).command(()=>ws(o,p)).run()}return!t||!b||!l?a().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>ks(o,p)).command(()=>ws(o,p)).run():a().command(()=>{const v=u().wrapInList(p,r),O=b.filter(W=>f.includes(W.type.name));return o.ensureMarks(O),v?!0:c.clearNodes()}).wrapInList(p,r).command(()=>ks(o,p)).command(()=>ws(o,p)).run()},sb=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,s=En(n,r.schema);return tl(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},lb=(n,e,t={})=>({state:r,commands:i})=>{const o=Ie(n,r.schema),s=Ie(e,r.schema);return ii(r,o,t)?i.setNode(s):i.setNode(o,t)},ab=(n,e={})=>({state:t,commands:r})=>{const i=Ie(n,t.schema);return ii(t,i,e)?r.lift(i):r.wrapIn(i,e)},cb=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r=0;a-=1)s.step(l.steps[a].invert(l.docs[a]));if(o.text){const a=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,n.schema.text(o.text,a))}else s.delete(o.from,o.to)}return!0}}return!1},ub=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},db=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:l}=t,a=En(n,r.schema),{$from:c,empty:u,ranges:d}=l;if(!i)return!0;if(u&&s){let{from:f,to:p}=l;const h=(o=c.marks().find(g=>g.type===a))===null||o===void 0?void 0:o.attrs,m=_l(c,a,h);m&&(f=m.from,p=m.to),t.removeMark(f,p,a)}else d.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,a)});return t.removeStoredMark(a),!0},fb=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,s=null;const l=Ko(typeof n=="string"?n:n.name,r.schema);return l?(l==="node"&&(o=Ie(n,r.schema)),l==="mark"&&(s=En(n,r.schema)),i&&t.selection.ranges.forEach(a=>{const c=a.$from.pos,u=a.$to.pos;r.doc.nodesBetween(c,u,(d,f)=>{o&&o===d.type&&t.setNodeMarkup(f,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(p=>{if(s===p.type){const h=Math.max(f,c),m=Math.min(f+d.nodeSize,u);t.addMark(h,m,s.create({...p.attrs,...e}))}})})}),!0):!1},pb=(n,e={})=>({state:t,dispatch:r})=>{const i=Ie(n,t.schema);return Tm(i,e)(t,r)},hb=(n,e={})=>({state:t,dispatch:r})=>{const i=Ie(n,t.schema);return Om(i,e)(t,r)};var mb=Object.freeze({__proto__:null,blur:Jm,clearContent:Gm,clearNodes:Ym,command:Xm,createParagraphNear:Qm,cut:Zm,deleteCurrentNode:eg,deleteNode:tg,deleteRange:ng,deleteSelection:rg,enter:ig,exitCode:og,extendMarkRange:lg,first:ag,focus:cg,forEach:ug,insertContent:dg,insertContentAt:hg,joinUp:mg,joinDown:gg,joinBackward:bg,joinForward:yg,joinItemBackward:vg,joinItemForward:kg,keyboardShortcut:xg,lift:Sg,liftEmptyBlock:Cg,liftListItem:Mg,newlineInCode:Tg,resetAttributes:Og,scrollIntoView:Eg,selectAll:Ag,selectNodeBackward:Ng,selectNodeForward:Dg,selectParentNode:Ig,selectTextblockEnd:Rg,selectTextblockStart:Pg,setContent:Lg,setMark:Xg,setMeta:Qg,setNode:Zg,setNodeSelection:eb,setTextSelection:tb,sinkListItem:nb,splitBlock:rb,splitListItem:ib,toggleList:ob,toggleMark:sb,toggleNode:lb,toggleWrap:ab,undoInputRule:cb,unsetAllMarks:ub,unsetMark:db,updateAttributes:fb,wrapIn:pb,wrapInList:hb});const gb=nt.create({name:"commands",addCommands(){return{...mb}}}),bb=nt.create({name:"editable",addProseMirrorPlugins(){return[new We({key:new wt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),yb=nt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new We({key:new wt("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),vb=nt.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:d}=a,{pos:f,parent:p}=d,h=d.parent.isTextblock?l.doc.resolve(f-1):d,m=h.parent.type.spec.isolating,g=d.pos-d.parentOffset,y=m&&h.parent.childCount===1?g===d.pos:Z.atStart(c).from===f;return!u||!y||!p.type.isTextblock||p.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Vl()||jl()?o:i},addProseMirrorPlugins(){return[new We({key:new wt("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(h=>h.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:s}=e.selection,l=Z.atStart(e.doc).from,a=Z.atEnd(e.doc).to;if(i||!(o===l&&s===a)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const d=t.tr,f=Vo({state:t,transaction:d}),{commands:p}=new jo({editor:this.editor,state:f});if(p.clearNodes(),!!d.steps.length)return d}})]}}),kb=nt.create({name:"tabindex",addProseMirrorPlugins(){return[new We({key:new wt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var wb=Object.freeze({__proto__:null,ClipboardTextSerializer:Km,Commands:gb,Editable:bb,FocusEvents:yb,Keymap:vb,Tabindex:kb});const xb=`.ProseMirror { position: relative; } @@ -85,15 +85,15 @@ img.ProseMirror-separator { opacity: 0 }`;function Sb(n,e,t){const r=document.querySelector(`style[data-tiptap-style${t?`-${t}`:""}]`);if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${t?`-${t}`:""}`,""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}class Cb extends Rm{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Sb(xb,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const r=Od(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const t=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(t))});this.view.updateState(r)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(wb):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new cr(t,this)}createCommandManager(){this.commandManager=new jo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Dd(this.options.content,this.schema,this.options.parseOptions),t=Nd(e,this.options.autofocus);this.view=new Qh(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:ar.create({doc:e,selection:t||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(s)});return}const t=this.state.apply(e),r=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Id(this.state,e)}isActive(e,t){const r=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return qg(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return _g(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=` -`,textSerializers:r={}}=e||{};return Hg(this.state.doc,{blockSeparator:t,textSerializers:{...Ed(this.schema),...r}})}get isEmpty(){return Kg(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}}function vr(n){return new Uo({find:n.find,handler:({state:e,range:t,match:r})=>{const i=Q(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],l=r[0];if(s){const a=l.search(/\S/),c=t.from+l.indexOf(s),u=c+s.length;if(Ul(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===n.type&&m!==p.mark.type)).filter(p=>p.to>c).length)return null;ut.from&&o.delete(t.from+a,c);const f=t.from+a+s.length;o.addMark(t.from+a,f,n.type.create(i||{})),o.removeStoredMark(n.type)}}})}function Mb(n){return new Uo({find:n.find,handler:({state:e,range:t,match:r})=>{const i=Q(n.getAttributes,void 0,r)||{},{tr:o}=e,s=t.from;let l=t.to;const a=n.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];o.insertText(d,s+r[0].length-1),o.replaceWith(u,l,a)}else r[0]&&o.insert(s-1,n.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l));o.scrollIntoView()}})}function nl(n){return new Uo({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=Q(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function oi(n){return new Uo({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=Q(n.getAttributes,void 0,r)||{},s=e.tr.delete(t.from,t.to),a=s.doc.resolve(t.from).blockRange(),c=a&&Ol(a,n.type,o);if(!c)return null;if(s.wrap(a,c),n.keepMarks&&n.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:p}=n.editor.extensionManager,h=f||d.$to.parentOffset&&d.$from.marks();if(h){const m=h.filter(g=>p.includes(g.type.name));s.ensureMarks(m)}}if(n.keepAttributes){const d=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,o).run()}const u=s.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&Tn(s.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&s.join(t.from-1)}})}class Et{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Q(F(this,"addOptions",{name:this.name}))),this.storage=Q(F(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Et(e)}configure(e={}){const t=this.extend();return t.options=qo(this.options,e),t.storage=Q(F(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Et(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Q(F(t,"addOptions",{name:t.name})),t.storage=Q(F(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===t.name))return!1;const a=s.find(c=>(c==null?void 0:c.type.name)===t.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class Ve{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Q(F(this,"addOptions",{name:this.name}))),this.storage=Q(F(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ve(e)}configure(e={}){const t=this.extend();return t.options=qo(this.options,e),t.storage=Q(F(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ve(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Q(F(t,"addOptions",{name:t.name})),t.storage=Q(F(t,"addStorage",{name:t.name,options:t.options})),t}}function Yn(n){return new Hm({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=Q(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,l=r[r.length-1],a=r[0];let c=t.to;if(l){const u=a.search(/\S/),d=t.from+a.indexOf(l),f=d+l.length;if(Ul(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>d).length)return null;ft.from&&s.delete(t.from+u,d),c=t.from+u+l.length,s.addMark(t.from+u,c,n.type.create(o||{})),s.removeStoredMark(n.type)}}})}const Tb=/^\s*>\s$/,Ob=Ve.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[oi({find:Tb,type:this.type})]}}),Ab=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Eb=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Nb=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Db=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Ib=Et.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[vr({find:Ab,type:this.type}),vr({find:Nb,type:this.type})]},addPasteRules(){return[Yn({find:Eb,type:this.type}),Yn({find:Db,type:this.type})]}}),Rb=Ve.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Me(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),mc=Et.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=Jo(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),gc=/^\s*([-+*])\s$/,Pb=Ve.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Rb.name,this.editor.getAttributes(mc.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=oi({find:gc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=oi({find:gc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(mc.name),editor:this.editor})),[n]}}),Lb=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,$b=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Bb=Et.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[vr({find:Lb,type:this.type})]},addPasteRules(){return[Yn({find:$b,type:this.type})]}}),zb=/^```([a-z]+)?[\s\n]$/,Fb=/^~~~([a-z]+)?[\s\n]$/,_b=Ve.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options,o=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(t)).map(s=>s.replace(t,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",Me(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` +`,textSerializers:r={}}=e||{};return Hg(this.state.doc,{blockSeparator:t,textSerializers:{...Ad(this.schema),...r}})}get isEmpty(){return Kg(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}}function vr(n){return new Uo({find:n.find,handler:({state:e,range:t,match:r})=>{const i=Q(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],l=r[0];if(s){const a=l.search(/\S/),c=t.from+l.indexOf(s),u=c+s.length;if(Ul(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===n.type&&m!==p.mark.type)).filter(p=>p.to>c).length)return null;ut.from&&o.delete(t.from+a,c);const f=t.from+a+s.length;o.addMark(t.from+a,f,n.type.create(i||{})),o.removeStoredMark(n.type)}}})}function Mb(n){return new Uo({find:n.find,handler:({state:e,range:t,match:r})=>{const i=Q(n.getAttributes,void 0,r)||{},{tr:o}=e,s=t.from;let l=t.to;const a=n.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];o.insertText(d,s+r[0].length-1),o.replaceWith(u,l,a)}else r[0]&&o.insert(s-1,n.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l));o.scrollIntoView()}})}function nl(n){return new Uo({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=Q(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function oi(n){return new Uo({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=Q(n.getAttributes,void 0,r)||{},s=e.tr.delete(t.from,t.to),a=s.doc.resolve(t.from).blockRange(),c=a&&Ol(a,n.type,o);if(!c)return null;if(s.wrap(a,c),n.keepMarks&&n.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:p}=n.editor.extensionManager,h=f||d.$to.parentOffset&&d.$from.marks();if(h){const m=h.filter(g=>p.includes(g.type.name));s.ensureMarks(m)}}if(n.keepAttributes){const d=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,o).run()}const u=s.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&Tn(s.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&s.join(t.from-1)}})}class At{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Q(F(this,"addOptions",{name:this.name}))),this.storage=Q(F(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new At(e)}configure(e={}){const t=this.extend();return t.options=qo(this.options,e),t.storage=Q(F(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new At(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Q(F(t,"addOptions",{name:t.name})),t.storage=Q(F(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===t.name))return!1;const a=s.find(c=>(c==null?void 0:c.type.name)===t.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class Ve{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Q(F(this,"addOptions",{name:this.name}))),this.storage=Q(F(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ve(e)}configure(e={}){const t=this.extend();return t.options=qo(this.options,e),t.storage=Q(F(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ve(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Q(F(t,"addOptions",{name:t.name})),t.storage=Q(F(t,"addStorage",{name:t.name,options:t.options})),t}}function Yn(n){return new Hm({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=Q(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,l=r[r.length-1],a=r[0];let c=t.to;if(l){const u=a.search(/\S/),d=t.from+a.indexOf(l),f=d+l.length;if(Ul(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>d).length)return null;ft.from&&s.delete(t.from+u,d),c=t.from+u+l.length,s.addMark(t.from+u,c,n.type.create(o||{})),s.removeStoredMark(n.type)}}})}const Tb=/^\s*>\s$/,Ob=Ve.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[oi({find:Tb,type:this.type})]}}),Eb=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Ab=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Nb=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Db=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Ib=At.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[vr({find:Eb,type:this.type}),vr({find:Nb,type:this.type})]},addPasteRules(){return[Yn({find:Ab,type:this.type}),Yn({find:Db,type:this.type})]}}),Rb=Ve.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Me(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),mc=At.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=Jo(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),gc=/^\s*([-+*])\s$/,Pb=Ve.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Rb.name,this.editor.getAttributes(mc.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=oi({find:gc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=oi({find:gc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(mc.name),editor:this.editor})),[n]}}),Lb=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,$b=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Bb=At.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[vr({find:Lb,type:this.type})]},addPasteRules(){return[Yn({find:$b,type:this.type})]}}),zb=/^```([a-z]+)?[\s\n]$/,Fb=/^~~~([a-z]+)?[\s\n]$/,_b=Ve.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options,o=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(t)).map(s=>s.replace(t,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",Me(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` `);return!o||!s?!1:n.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:o}=t;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0||r.nodeAt(l)?!1:n.commands.exitCode()}}},addInputRules(){return[nl({find:zb,type:this.type,getAttributes:n=>({language:n[1]})}),nl({find:Fb,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new We({key:new wt("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!t||!o)return!1;const{tr:s}=n.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(G.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(t.replace(/\r\n?/g,` -`)),s.setMeta("paste",!0),n.dispatch(s),!0}}})]}}),Hb=Ve.create({name:"doc",topNode:!0,content:"block+"});function Vb(n={}){return new We({view(e){return new jb(e,n)}})}class jb{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r;if(t){let l=e.nodeBefore,a=e.nodeAfter;if(l||a){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=l?u.bottom:u.top;l&&a&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Ru(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const Wb=nt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Vb(this.options)]}});class we extends Z{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return we.valid(r)?new we(r):Z.near(r)}content(){return I.empty}eq(e){return e instanceof we&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new we(e.resolve(t.pos))}getBookmark(){return new ql(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!Ub(e)||!qb(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&we.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(t>0?e.indexAfter(s)0){o=l.child(t>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=t;let a=e.doc.resolve(i);if(we.valid(a))return a}for(;;){let s=t>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!j.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=s,i+=t;let l=e.doc.resolve(i);if(we.valid(l))return l}return null}}}we.prototype.visible=!1;we.findFrom=we.findGapCursorFrom;Z.jsonID("gapcursor",we);class ql{constructor(e){this.pos=e}map(e){return new ql(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return we.valid(t)?new we(t):Z.near(t)}}function Ub(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function qb(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Kb(){return new We({props:{decorations:Xb,createSelectionBetween(n,e,t){return e.pos==t.pos&&we.valid(t)?new we(t):null},handleClick:Gb,handleKeyDown:Jb,handleDOMEvents:{beforeinput:Yb}}})}const Jb=kd({ArrowLeft:xi("horiz",-1),ArrowRight:xi("horiz",1),ArrowUp:xi("vert",-1),ArrowDown:xi("vert",1)});function xi(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,a=s.empty;if(s instanceof G){if(!o.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=we.findGapCursorFrom(l,e,a);return c?(i&&i(r.tr.setSelection(new we(c))),!0):!1}}function Gb(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!we.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&j.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new we(r))),!0)}function Yb(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof we))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=T.empty;for(let s=r.length-1;s>=0;s--)i=T.from(r[s].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new I(i,0,0));return o.setSelection(G.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function Xb(n){if(!(n.selection instanceof we))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ae.create(n.doc,[gt.widget(n.selection.head,e,{key:"gapcursor"})])}const Qb=nt.create({name:"gapCursor",addProseMirrorPlugins(){return[Kb()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=Q(F(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),Zb=Ve.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",Me(this.options.HTMLAttributes,n)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:o}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,a=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&s){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ey=Ve.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Me(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>nl({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Zi=200,De=function(){};De.prototype.append=function(e){return e.length?(e=De.from(e),!this.length&&e||e.length=t?De.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};De.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};De.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};De.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i};De.from=function(e){return e instanceof De?e:e&&e.length?new Rd(e):De.empty};var Rd=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var a=o;a=s;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Zi)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Zi)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(De);De.empty=new Rd([]);var ty=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(De);const ny=500;class Mt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(r,f+1),o=i.maps.length),o--,u.push(d);return}if(i){u.push(new Rt(d.map));let p=d.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new Rt(h,void 0,void 0,c.length+u.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(d.step);if(d.selection)return l=i?d.selection.map(i.slice(o)):d.selection,a=new Mt(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,t,r,i){let o=[],s=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let u=0;uiy&&(l=ry(l,c),s-=c),new Mt(l.append(o),s)}remapping(e,t){let r=new ur;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new Mt(this.items.append(e.map(t=>new Rt(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let a=t;this.items.forEach(f=>{let p=o.getMirror(--a);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),g=f.selection&&f.selection.map(o.slice(a+1,p));g&&l++,r.push(new Rt(h,m,g))}else r.push(new Rt(h))},i);let c=[];for(let f=t;fny&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=s.selection&&s.selection.map(t.slice(r));u&&o++;let d=new Rt(c.invert(),a,u),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else s.map&&r--},this.items.length,0),new Mt(De.from(i.reverse()),o)}}Mt.empty=new Mt(De.empty,0);function ry(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class Rt{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Rt(t.getMap().invert(),t,this.selection)}}}class fn{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const iy=20;function oy(n,e,t,r){let i=t.getMeta(Sn),o;if(i)return i.historyState;t.getMeta(ly)&&(n=new fn(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(Sn))return s.getMeta(Sn).redo?new fn(n.done.addTransform(t,void 0,r,Ri(e)),n.undone,bc(t.mapping.maps[t.steps.length-1]),n.prevTime,n.prevComposition):new fn(n.done,n.undone.addTransform(t,void 0,r,Ri(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!s&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!sy(t,n.prevRanges)),c=s?xs(n.prevRanges,t.mapping):bc(t.mapping.maps[t.steps.length-1]);return new fn(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,Ri(e)),Mt.empty,c,t.time,l??n.prevComposition)}else return(o=t.getMeta("rebased"))?new fn(n.done.rebased(t,o),n.undone.rebased(t,o),xs(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new fn(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),xs(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function sy(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(t=!0)}),t}function bc(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function xs(n,e){if(!n)return null;let t=[];for(let r=0;r{let t=Sn.getState(n);return!t||t.done.eventCount==0?!1:(e&&Pd(t,n,e,!1),!0)},$d=(n,e)=>{let t=Sn.getState(n);return!t||t.undone.eventCount==0?!1:(e&&Pd(t,n,e,!0),!0)},cy=nt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>Ld(n,e),redo:()=>({state:n,dispatch:e})=>$d(n,e)}},addProseMirrorPlugins(){return[ay(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),uy=Ve.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Me(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:l}=i.selection,a=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(G.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(j.create(i.doc,l.pos)):i.setSelection(G.create(i.doc,l.pos));else{const c=(s=l.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();c&&(i.insert(a,c),i.setSelection(G.create(i.doc,a+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Mb({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),dy=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,fy=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,py=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,hy=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,my=Et.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[vr({find:dy,type:this.type}),vr({find:py,type:this.type})]},addPasteRules(){return[Yn({find:fy,type:this.type}),Yn({find:hy,type:this.type})]}}),gy=Ve.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Me(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),by=Ve.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Me(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),vc=Et.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=Jo(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),kc=/^(\d+)\.\s$/,yy=Ve.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",Me(this.options.HTMLAttributes,t),0]:["ol",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(by.name,this.editor.getAttributes(vc.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=oi({find:kc,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=oi({find:kc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(vc.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),vy=Ve.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ky=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,wy=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,xy=Et.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){const n={};return jl()?n["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():n["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),n},addInputRules(){return[vr({find:ky,type:this.type})]},addPasteRules(){return[Yn({find:wy,type:this.type})]}}),Sy=Ve.create({name:"text",group:"inline"}),Cy=nt.create({name:"starterKit",addExtensions(){var n,e,t,r,i,o,s,l,a,c,u,d,f,p,h,m,g,y;const k=[];return this.options.blockquote!==!1&&k.push(Ob.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&k.push(Ib.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&k.push(Pb.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&k.push(Bb.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&k.push(_b.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&k.push(Hb.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&k.push(Wb.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&k.push(Qb.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&k.push(Zb.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&k.push(ey.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&k.push(cy.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&k.push(uy.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&k.push(my.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&k.push(gy.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&k.push(yy.configure((h=this.options)===null||h===void 0?void 0:h.orderedList)),this.options.paragraph!==!1&&k.push(vy.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&k.push(xy.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&k.push(Sy.configure((y=this.options)===null||y===void 0?void 0:y.text)),k}});var et="top",vt="bottom",kt="right",tt="left",Kl="auto",pi=[et,vt,kt,tt],kr="start",si="end",My="clippingParents",Bd="viewport",Rr="popper",Ty="reference",wc=pi.reduce(function(n,e){return n.concat([e+"-"+kr,e+"-"+si])},[]),zd=[].concat(pi,[Kl]).reduce(function(n,e){return n.concat([e,e+"-"+kr,e+"-"+si])},[]),Oy="beforeRead",Ay="read",Ey="afterRead",Ny="beforeMain",Dy="main",Iy="afterMain",Ry="beforeWrite",Py="write",Ly="afterWrite",$y=[Oy,Ay,Ey,Ny,Dy,Iy,Ry,Py,Ly];function Wt(n){return n?(n.nodeName||"").toLowerCase():null}function ct(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Xn(n){var e=ct(n).Element;return n instanceof e||n instanceof Element}function yt(n){var e=ct(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Jl(n){if(typeof ShadowRoot>"u")return!1;var e=ct(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function By(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];!yt(o)||!Wt(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function zy(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),l=s.reduce(function(a,c){return a[c]="",a},{});!yt(i)||!Wt(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(a){i.removeAttribute(a)}))})}}const Fd={name:"applyStyles",enabled:!0,phase:"write",fn:By,effect:zy,requires:["computeStyles"]};function Ht(n){return n.split("-")[0]}var Un=Math.max,eo=Math.min,wr=Math.round;function rl(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function _d(){return!/^((?!chrome|android).)*safari/i.test(rl())}function xr(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),i=1,o=1;e&&yt(n)&&(i=n.offsetWidth>0&&wr(r.width)/n.offsetWidth||1,o=n.offsetHeight>0&&wr(r.height)/n.offsetHeight||1);var s=Xn(n)?ct(n):window,l=s.visualViewport,a=!_d()&&t,c=(r.left+(a&&l?l.offsetLeft:0))/i,u=(r.top+(a&&l?l.offsetTop:0))/o,d=r.width/i,f=r.height/o;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Gl(n){var e=xr(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function Hd(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Jl(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function tn(n){return ct(n).getComputedStyle(n)}function Fy(n){return["table","td","th"].indexOf(Wt(n))>=0}function En(n){return((Xn(n)?n.ownerDocument:n.document)||window.document).documentElement}function Go(n){return Wt(n)==="html"?n:n.assignedSlot||n.parentNode||(Jl(n)?n.host:null)||En(n)}function xc(n){return!yt(n)||tn(n).position==="fixed"?null:n.offsetParent}function _y(n){var e=/firefox/i.test(rl()),t=/Trident/i.test(rl());if(t&&yt(n)){var r=tn(n);if(r.position==="fixed")return null}var i=Go(n);for(Jl(i)&&(i=i.host);yt(i)&&["html","body"].indexOf(Wt(i))<0;){var o=tn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function hi(n){for(var e=ct(n),t=xc(n);t&&Fy(t)&&tn(t).position==="static";)t=xc(t);return t&&(Wt(t)==="html"||Wt(t)==="body"&&tn(t).position==="static")?e:t||_y(n)||e}function Yl(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function qr(n,e,t){return Un(n,eo(e,t))}function Hy(n,e,t){var r=qr(n,e,t);return r>t?t:r}function Vd(){return{top:0,right:0,bottom:0,left:0}}function jd(n){return Object.assign({},Vd(),n)}function Wd(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var Vy=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,jd(typeof e!="number"?e:Wd(e,pi))};function jy(n){var e,t=n.state,r=n.name,i=n.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,l=Ht(t.placement),a=Yl(l),c=[tt,kt].indexOf(l)>=0,u=c?"height":"width";if(!(!o||!s)){var d=Vy(i.padding,t),f=Gl(o),p=a==="y"?et:tt,h=a==="y"?vt:kt,m=t.rects.reference[u]+t.rects.reference[a]-s[a]-t.rects.popper[u],g=s[a]-t.rects.reference[a],y=hi(o),k=y?a==="y"?y.clientHeight||0:y.clientWidth||0:0,C=m/2-g/2,b=d[p],A=k-f[u]-d[h],v=k/2-f[u]/2+C,O=qr(b,v,A),W=a;t.modifiersData[r]=(e={},e[W]=O,e.centerOffset=O-v,e)}}function Wy(n){var e=n.state,t=n.options,r=t.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Hd(e.elements.popper,i)&&(e.elements.arrow=i))}const Uy={name:"arrow",enabled:!0,phase:"main",fn:jy,effect:Wy,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sr(n){return n.split("-")[1]}var qy={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ky(n,e){var t=n.x,r=n.y,i=e.devicePixelRatio||1;return{x:wr(t*i)/i||0,y:wr(r*i)/i||0}}function Sc(n){var e,t=n.popper,r=n.popperRect,i=n.placement,o=n.variation,s=n.offsets,l=n.position,a=n.gpuAcceleration,c=n.adaptive,u=n.roundOffsets,d=n.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,g=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var y=s.hasOwnProperty("x"),k=s.hasOwnProperty("y"),C=tt,b=et,A=window;if(c){var v=hi(t),O="clientHeight",W="clientWidth";if(v===ct(t)&&(v=En(t),tn(v).position!=="static"&&l==="absolute"&&(O="scrollHeight",W="scrollWidth")),v=v,i===et||(i===tt||i===kt)&&o===si){b=vt;var w=d&&v===A&&A.visualViewport?A.visualViewport.height:v[O];m-=w-r.height,m*=a?1:-1}if(i===tt||(i===et||i===vt)&&o===si){C=kt;var H=d&&v===A&&A.visualViewport?A.visualViewport.width:v[W];p-=H-r.width,p*=a?1:-1}}var q=Object.assign({position:l},c&&qy),S=u===!0?Ky({x:p,y:m},ct(t)):{x:p,y:m};if(p=S.x,m=S.y,a){var N;return Object.assign({},q,(N={},N[b]=k?"0":"",N[C]=y?"0":"",N.transform=(A.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",N))}return Object.assign({},q,(e={},e[b]=k?m+"px":"",e[C]=y?p+"px":"",e.transform="",e))}function Jy(n){var e=n.state,t=n.options,r=t.gpuAcceleration,i=r===void 0?!0:r,o=t.adaptive,s=o===void 0?!0:o,l=t.roundOffsets,a=l===void 0?!0:l,c={placement:Ht(e.placement),variation:Sr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Sc(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Sc(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Gy={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Jy,data:{}};var Si={passive:!0};function Yy(n){var e=n.state,t=n.instance,r=n.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,a=ct(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",t.update,Si)}),l&&a.addEventListener("resize",t.update,Si),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",t.update,Si)}),l&&a.removeEventListener("resize",t.update,Si)}}const Xy={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Yy,data:{}};var Qy={left:"right",right:"left",bottom:"top",top:"bottom"};function Pi(n){return n.replace(/left|right|bottom|top/g,function(e){return Qy[e]})}var Zy={start:"end",end:"start"};function Cc(n){return n.replace(/start|end/g,function(e){return Zy[e]})}function Xl(n){var e=ct(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Ql(n){return xr(En(n)).left+Xl(n).scrollLeft}function e0(n,e){var t=ct(n),r=En(n),i=t.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,a=0;if(i){o=i.width,s=i.height;var c=_d();(c||!c&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l+Ql(n),y:a}}function t0(n){var e,t=En(n),r=Xl(n),i=(e=n.ownerDocument)==null?void 0:e.body,o=Un(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Un(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Ql(n),a=-r.scrollTop;return tn(i||t).direction==="rtl"&&(l+=Un(t.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:a}}function Zl(n){var e=tn(n),t=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+r)}function Ud(n){return["html","body","#document"].indexOf(Wt(n))>=0?n.ownerDocument.body:yt(n)&&Zl(n)?n:Ud(Go(n))}function Kr(n,e){var t;e===void 0&&(e=[]);var r=Ud(n),i=r===((t=n.ownerDocument)==null?void 0:t.body),o=ct(r),s=i?[o].concat(o.visualViewport||[],Zl(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(Kr(Go(s)))}function il(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function n0(n,e){var t=xr(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Mc(n,e,t){return e===Bd?il(e0(n,t)):Xn(e)?n0(e,t):il(t0(En(n)))}function r0(n){var e=Kr(Go(n)),t=["absolute","fixed"].indexOf(tn(n).position)>=0,r=t&&yt(n)?hi(n):n;return Xn(r)?e.filter(function(i){return Xn(i)&&Hd(i,r)&&Wt(i)!=="body"}):[]}function i0(n,e,t,r){var i=e==="clippingParents"?r0(n):[].concat(e),o=[].concat(i,[t]),s=o[0],l=o.reduce(function(a,c){var u=Mc(n,c,r);return a.top=Un(u.top,a.top),a.right=eo(u.right,a.right),a.bottom=eo(u.bottom,a.bottom),a.left=Un(u.left,a.left),a},Mc(n,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function qd(n){var e=n.reference,t=n.element,r=n.placement,i=r?Ht(r):null,o=r?Sr(r):null,s=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,a;switch(i){case et:a={x:s,y:e.y-t.height};break;case vt:a={x:s,y:e.y+e.height};break;case kt:a={x:e.x+e.width,y:l};break;case tt:a={x:e.x-t.width,y:l};break;default:a={x:e.x,y:e.y}}var c=i?Yl(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case kr:a[c]=a[c]-(e[u]/2-t[u]/2);break;case si:a[c]=a[c]+(e[u]/2-t[u]/2);break}}return a}function li(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=r===void 0?n.placement:r,o=t.strategy,s=o===void 0?n.strategy:o,l=t.boundary,a=l===void 0?My:l,c=t.rootBoundary,u=c===void 0?Bd:c,d=t.elementContext,f=d===void 0?Rr:d,p=t.altBoundary,h=p===void 0?!1:p,m=t.padding,g=m===void 0?0:m,y=jd(typeof g!="number"?g:Wd(g,pi)),k=f===Rr?Ty:Rr,C=n.rects.popper,b=n.elements[h?k:f],A=i0(Xn(b)?b:b.contextElement||En(n.elements.popper),a,u,s),v=xr(n.elements.reference),O=qd({reference:v,element:C,strategy:"absolute",placement:i}),W=il(Object.assign({},C,O)),w=f===Rr?W:v,H={top:A.top-w.top+y.top,bottom:w.bottom-A.bottom+y.bottom,left:A.left-w.left+y.left,right:w.right-A.right+y.right},q=n.modifiersData.offset;if(f===Rr&&q){var S=q[i];Object.keys(H).forEach(function(N){var P=[kt,vt].indexOf(N)>=0?1:-1,B=[et,vt].indexOf(N)>=0?"y":"x";H[N]+=S[B]*P})}return H}function o0(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=t.boundary,o=t.rootBoundary,s=t.padding,l=t.flipVariations,a=t.allowedAutoPlacements,c=a===void 0?zd:a,u=Sr(r),d=u?l?wc:wc.filter(function(h){return Sr(h)===u}):pi,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=li(n,{placement:m,boundary:i,rootBoundary:o,padding:s})[Ht(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function s0(n){if(Ht(n)===Kl)return[];var e=Pi(n);return[Cc(n),e,Cc(e)]}function l0(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var i=t.mainAxis,o=i===void 0?!0:i,s=t.altAxis,l=s===void 0?!0:s,a=t.fallbackPlacements,c=t.padding,u=t.boundary,d=t.rootBoundary,f=t.altBoundary,p=t.flipVariations,h=p===void 0?!0:p,m=t.allowedAutoPlacements,g=e.options.placement,y=Ht(g),k=y===g,C=a||(k||!h?[Pi(g)]:s0(g)),b=[g].concat(C).reduce(function(Oe,me){return Oe.concat(Ht(me)===Kl?o0(e,{placement:me,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):me)},[]),A=e.rects.reference,v=e.rects.popper,O=new Map,W=!0,w=b[0],H=0;H=0,B=P?"width":"height",L=li(e,{placement:q,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),R=P?N?kt:tt:N?vt:et;A[B]>v[B]&&(R=Pi(R));var _=Pi(R),$=[];if(o&&$.push(L[S]<=0),l&&$.push(L[R]<=0,L[_]<=0),$.every(function(Oe){return Oe})){w=q,W=!1;break}O.set(q,$)}if(W)for(var K=h?3:1,ee=function(me){var Ue=b.find(function(ze){var rt=O.get(ze);if(rt)return rt.slice(0,me).every(function(Fe){return Fe})});if(Ue)return w=Ue,"break"},ie=K;ie>0;ie--){var te=ee(ie);if(te==="break")break}e.placement!==w&&(e.modifiersData[r]._skip=!0,e.placement=w,e.reset=!0)}}const a0={name:"flip",enabled:!0,phase:"main",fn:l0,requiresIfExists:["offset"],data:{_skip:!1}};function Tc(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Oc(n){return[et,kt,vt,tt].some(function(e){return n[e]>=0})}function c0(n){var e=n.state,t=n.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=li(e,{elementContext:"reference"}),l=li(e,{altBoundary:!0}),a=Tc(s,r),c=Tc(l,i,o),u=Oc(a),d=Oc(c);e.modifiersData[t]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const u0={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:c0};function d0(n,e,t){var r=Ht(n),i=[tt,et].indexOf(r)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[tt,kt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function f0(n){var e=n.state,t=n.options,r=n.name,i=t.offset,o=i===void 0?[0,0]:i,s=zd.reduce(function(u,d){return u[d]=d0(d,e.rects,o),u},{}),l=s[e.placement],a=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const p0={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:f0};function h0(n){var e=n.state,t=n.name;e.modifiersData[t]=qd({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const m0={name:"popperOffsets",enabled:!0,phase:"read",fn:h0,data:{}};function g0(n){return n==="x"?"y":"x"}function b0(n){var e=n.state,t=n.options,r=n.name,i=t.mainAxis,o=i===void 0?!0:i,s=t.altAxis,l=s===void 0?!1:s,a=t.boundary,c=t.rootBoundary,u=t.altBoundary,d=t.padding,f=t.tether,p=f===void 0?!0:f,h=t.tetherOffset,m=h===void 0?0:h,g=li(e,{boundary:a,rootBoundary:c,padding:d,altBoundary:u}),y=Ht(e.placement),k=Sr(e.placement),C=!k,b=Yl(y),A=g0(b),v=e.modifiersData.popperOffsets,O=e.rects.reference,W=e.rects.popper,w=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,H=typeof w=="number"?{mainAxis:w,altAxis:w}:Object.assign({mainAxis:0,altAxis:0},w),q=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,S={x:0,y:0};if(v){if(o){var N,P=b==="y"?et:tt,B=b==="y"?vt:kt,L=b==="y"?"height":"width",R=v[b],_=R+g[P],$=R-g[B],K=p?-W[L]/2:0,ee=k===kr?O[L]:W[L],ie=k===kr?-W[L]:-O[L],te=e.elements.arrow,Oe=p&&te?Gl(te):{width:0,height:0},me=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Vd(),Ue=me[P],ze=me[B],rt=qr(0,O[L],Oe[L]),Fe=C?O[L]/2-K-rt-Ue-H.mainAxis:ee-rt-Ue-H.mainAxis,it=C?-O[L]/2+K+rt+ze+H.mainAxis:ie+rt+ze+H.mainAxis,Nt=e.elements.arrow&&hi(e.elements.arrow),Nn=Nt?b==="y"?Nt.clientTop||0:Nt.clientLeft||0:0,M=(N=q==null?void 0:q[b])!=null?N:0,D=R+Fe-M-Nn,V=R+it-M,Dt=qr(p?eo(_,D):_,R,p?Un($,V):$);v[b]=Dt,S[b]=Dt-R}if(l){var It,Ut=b==="x"?et:tt,qt=b==="x"?vt:kt,ot=v[A],ut=A==="y"?"height":"width",Kt=ot+g[Ut],xt=ot-g[qt],Jt=[et,tt].indexOf(y)!==-1,nn=(It=q==null?void 0:q[A])!=null?It:0,rn=Jt?Kt:ot-O[ut]-W[ut]-nn+H.altAxis,on=Jt?ot+O[ut]+W[ut]-nn-H.altAxis:xt,Dn=p&&Jt?Hy(rn,ot,on):qr(p?rn:Kt,ot,p?on:xt);v[A]=Dn,S[A]=Dn-ot}e.modifiersData[r]=S}}const y0={name:"preventOverflow",enabled:!0,phase:"main",fn:b0,requiresIfExists:["offset"]};function v0(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function k0(n){return n===ct(n)||!yt(n)?Xl(n):v0(n)}function w0(n){var e=n.getBoundingClientRect(),t=wr(e.width)/n.offsetWidth||1,r=wr(e.height)/n.offsetHeight||1;return t!==1||r!==1}function x0(n,e,t){t===void 0&&(t=!1);var r=yt(e),i=yt(e)&&w0(e),o=En(e),s=xr(n,i,t),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!t)&&((Wt(e)!=="body"||Zl(o))&&(l=k0(e)),yt(e)?(a=xr(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):o&&(a.x=Ql(o))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function S0(n){var e=new Map,t=new Set,r=[];n.forEach(function(o){e.set(o.name,o)});function i(o){t.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!t.has(l)){var a=e.get(l);a&&i(a)}}),r.push(o)}return n.forEach(function(o){t.has(o.name)||i(o)}),r}function C0(n){var e=S0(n);return $y.reduce(function(t,r){return t.concat(e.filter(function(i){return i.phase===r}))},[])}function M0(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function T0(n){var e=n.reduce(function(t,r){var i=t[r.name];return t[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var Ac={placement:"bottom",modifiers:[],strategy:"absolute"};function Ec(){for(var n=arguments.length,e=new Array(n),t=0;t-1}function Xd(n,e){return typeof n=="function"?n.apply(void 0,e):n}function Nc(n,e){if(e===0)return n;var t;return function(r){clearTimeout(t),t=setTimeout(function(){n(r)},e)}}function I0(n){return n.split(/\s+/).filter(Boolean)}function sr(n){return[].concat(n)}function Dc(n,e){n.indexOf(e)===-1&&n.push(e)}function R0(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function P0(n){return n.split("-")[0]}function to(n){return[].slice.call(n)}function Ic(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function Jr(){return document.createElement("div")}function Yo(n){return["Element","Fragment"].some(function(e){return ea(n,e)})}function L0(n){return ea(n,"NodeList")}function $0(n){return ea(n,"MouseEvent")}function B0(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function z0(n){return Yo(n)?[n]:L0(n)?to(n):Array.isArray(n)?n:to(document.querySelectorAll(n))}function Ms(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Rc(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function F0(n){var e,t=sr(n),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function _0(n,e){var t=e.clientX,r=e.clientY;return n.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,a=l.interactiveBorder,c=P0(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,m=o.top-r+d>a,g=r-o.bottom-f>a,y=o.left-t+p>a,k=t-o.right-h>a;return m||g||y||k})}function Ts(n,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){n[r](i,t)})}function Pc(n,e){for(var t=e;t;){var r;if(n.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var Bt={isTouch:!1},Lc=0;function H0(){Bt.isTouch||(Bt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Qd))}function Qd(){var n=performance.now();n-Lc<20&&(Bt.isTouch=!1,document.removeEventListener("mousemove",Qd)),Lc=n}function V0(){var n=document.activeElement;if(B0(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function j0(){document.addEventListener("touchstart",H0,Rn),window.addEventListener("blur",V0)}var W0=typeof window<"u"&&typeof document<"u",U0=W0?!!window.msCrypto:!1,q0={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},K0={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Tt=Object.assign({appendTo:Yd,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},q0,K0),J0=Object.keys(Tt),G0=function(e){var t=Object.keys(e);t.forEach(function(r){Tt[r]=e[r]})};function Zd(n){var e=n.plugins||[],t=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=n[o]!==void 0?n[o]:(l=Tt[o])!=null?l:s}return r},{});return Object.assign({},n,t)}function Y0(n,e){var t=e?Object.keys(Zd(Object.assign({},Tt,{plugins:e}))):J0,r=t.reduce(function(i,o){var s=(n.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function $c(n,e){var t=Object.assign({},e,{content:Xd(e.content,[n])},e.ignoreAttributes?{}:Y0(n,e.plugins));return t.aria=Object.assign({},Tt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var X0=function(){return"innerHTML"};function ol(n,e){n[X0()]=e}function Bc(n){var e=Jr();return n===!0?e.className=Jd:(e.className=Gd,Yo(n)?e.appendChild(n):ol(e,n)),e}function zc(n,e){Yo(e.content)?(ol(n,""),n.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?ol(n,e.content):n.textContent=e.content)}function sl(n){var e=n.firstElementChild,t=to(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(Kd)}),arrow:t.find(function(r){return r.classList.contains(Jd)||r.classList.contains(Gd)}),backdrop:t.find(function(r){return r.classList.contains(D0)})}}function ef(n){var e=Jr(),t=Jr();t.className=N0,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=Jr();r.className=Kd,r.setAttribute("data-state","hidden"),zc(r,n.props),e.appendChild(t),t.appendChild(r),i(n.props,n.props);function i(o,s){var l=sl(e),a=l.box,c=l.content,u=l.arrow;s.theme?a.setAttribute("data-theme",s.theme):a.removeAttribute("data-theme"),typeof s.animation=="string"?a.setAttribute("data-animation",s.animation):a.removeAttribute("data-animation"),s.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?a.setAttribute("role",s.role):a.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&zc(c,n.props),s.arrow?u?o.arrow!==s.arrow&&(a.removeChild(u),a.appendChild(Bc(s.arrow))):a.appendChild(Bc(s.arrow)):u&&a.removeChild(u)}return{popper:e,onUpdate:i}}ef.$$tippy=!0;var Q0=1,Ci=[],Os=[];function Z0(n,e){var t=$c(n,Object.assign({},Tt,Zd(Ic(e)))),r,i,o,s=!1,l=!1,a=!1,c=!1,u,d,f,p=[],h=Nc(D,t.interactiveDebounce),m,g=Q0++,y=null,k=R0(t.plugins),C={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:g,reference:n,popper:Jr(),popperInstance:y,props:t,state:C,plugins:k,clearDelayTimeouts:rn,setProps:on,setContent:Dn,show:Ar,hide:Er,hideWithInteractivity:Nr,enable:Jt,disable:nn,unmount:Dr,destroy:gi};if(!t.render)return b;var A=t.render(b),v=A.popper,O=A.onUpdate;v.setAttribute("data-tippy-root",""),v.id="tippy-"+b.id,b.popper=v,n._tippy=b,v._tippy=b;var W=k.map(function(x){return x.fn(b)}),w=n.hasAttribute("aria-expanded");return Nt(),K(),R(),_("onCreate",[b]),t.showOnCreate&&Kt(),v.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),v.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",h)}),b;function H(){var x=b.props.touch;return Array.isArray(x)?x:[x,0]}function q(){return H()[0]==="hold"}function S(){var x;return!!((x=b.props.render)!=null&&x.$$tippy)}function N(){return m||n}function P(){var x=N().parentNode;return x?F0(x):document}function B(){return sl(v)}function L(x){return b.state.isMounted&&!b.state.isVisible||Bt.isTouch||u&&u.type==="focus"?0:Cs(b.props.delay,x?0:1,Tt.delay)}function R(x){x===void 0&&(x=!1),v.style.pointerEvents=b.props.interactive&&!x?"":"none",v.style.zIndex=""+b.props.zIndex}function _(x,z,J){if(J===void 0&&(J=!0),W.forEach(function(oe){oe[x]&&oe[x].apply(oe,z)}),J){var ae;(ae=b.props)[x].apply(ae,z)}}function $(){var x=b.props.aria;if(x.content){var z="aria-"+x.content,J=v.id,ae=sr(b.props.triggerTarget||n);ae.forEach(function(oe){var qe=oe.getAttribute(z);if(b.state.isVisible)oe.setAttribute(z,qe?qe+" "+J:J);else{var dt=qe&&qe.replace(J,"").trim();dt?oe.setAttribute(z,dt):oe.removeAttribute(z)}})}}function K(){if(!(w||!b.props.aria.expanded)){var x=sr(b.props.triggerTarget||n);x.forEach(function(z){b.props.interactive?z.setAttribute("aria-expanded",b.state.isVisible&&z===N()?"true":"false"):z.removeAttribute("aria-expanded")})}}function ee(){P().removeEventListener("mousemove",h),Ci=Ci.filter(function(x){return x!==h})}function ie(x){if(!(Bt.isTouch&&(a||x.type==="mousedown"))){var z=x.composedPath&&x.composedPath()[0]||x.target;if(!(b.props.interactive&&Pc(v,z))){if(sr(b.props.triggerTarget||n).some(function(J){return Pc(J,z)})){if(Bt.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else _("onClickOutside",[b,x]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),l=!0,setTimeout(function(){l=!1}),b.state.isMounted||Ue())}}}function te(){a=!0}function Oe(){a=!1}function me(){var x=P();x.addEventListener("mousedown",ie,!0),x.addEventListener("touchend",ie,Rn),x.addEventListener("touchstart",Oe,Rn),x.addEventListener("touchmove",te,Rn)}function Ue(){var x=P();x.removeEventListener("mousedown",ie,!0),x.removeEventListener("touchend",ie,Rn),x.removeEventListener("touchstart",Oe,Rn),x.removeEventListener("touchmove",te,Rn)}function ze(x,z){Fe(x,function(){!b.state.isVisible&&v.parentNode&&v.parentNode.contains(v)&&z()})}function rt(x,z){Fe(x,z)}function Fe(x,z){var J=B().box;function ae(oe){oe.target===J&&(Ts(J,"remove",ae),z())}if(x===0)return z();Ts(J,"remove",d),Ts(J,"add",ae),d=ae}function it(x,z,J){J===void 0&&(J=!1);var ae=sr(b.props.triggerTarget||n);ae.forEach(function(oe){oe.addEventListener(x,z,J),p.push({node:oe,eventType:x,handler:z,options:J})})}function Nt(){q()&&(it("touchstart",M,{passive:!0}),it("touchend",V,{passive:!0})),I0(b.props.trigger).forEach(function(x){if(x!=="manual")switch(it(x,M),x){case"mouseenter":it("mouseleave",V);break;case"focus":it(U0?"focusout":"blur",Dt);break;case"focusin":it("focusout",Dt);break}})}function Nn(){p.forEach(function(x){var z=x.node,J=x.eventType,ae=x.handler,oe=x.options;z.removeEventListener(J,ae,oe)}),p=[]}function M(x){var z,J=!1;if(!(!b.state.isEnabled||It(x)||l)){var ae=((z=u)==null?void 0:z.type)==="focus";u=x,m=x.currentTarget,K(),!b.state.isVisible&&$0(x)&&Ci.forEach(function(oe){return oe(x)}),x.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?J=!0:Kt(x),x.type==="click"&&(s=!J),J&&!ae&&xt(x)}}function D(x){var z=x.target,J=N().contains(z)||v.contains(z);if(!(x.type==="mousemove"&&J)){var ae=ut().concat(v).map(function(oe){var qe,dt=oe._tippy,Zn=(qe=dt.popperInstance)==null?void 0:qe.state;return Zn?{popperRect:oe.getBoundingClientRect(),popperState:Zn,props:t}:null}).filter(Boolean);_0(ae,x)&&(ee(),xt(x))}}function V(x){var z=It(x)||b.props.trigger.indexOf("click")>=0&&s;if(!z){if(b.props.interactive){b.hideWithInteractivity(x);return}xt(x)}}function Dt(x){b.props.trigger.indexOf("focusin")<0&&x.target!==N()||b.props.interactive&&x.relatedTarget&&v.contains(x.relatedTarget)||xt(x)}function It(x){return Bt.isTouch?q()!==x.type.indexOf("touch")>=0:!1}function Ut(){qt();var x=b.props,z=x.popperOptions,J=x.placement,ae=x.offset,oe=x.getReferenceClientRect,qe=x.moveTransition,dt=S()?sl(v).arrow:null,Zn=oe?{getBoundingClientRect:oe,contextElement:oe.contextElement||N()}:n,da={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(bi){var er=bi.state;if(S()){var Mf=B(),Zo=Mf.box;["placement","reference-hidden","escaped"].forEach(function(yi){yi==="placement"?Zo.setAttribute("data-placement",er.placement):er.attributes.popper["data-popper-"+yi]?Zo.setAttribute("data-"+yi,""):Zo.removeAttribute("data-"+yi)}),er.attributes.popper={}}}},In=[{name:"offset",options:{offset:ae}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!qe}},da];S()&&dt&&In.push({name:"arrow",options:{element:dt,padding:3}}),In.push.apply(In,(z==null?void 0:z.modifiers)||[]),b.popperInstance=E0(Zn,v,Object.assign({},z,{placement:J,onFirstUpdate:f,modifiers:In}))}function qt(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function ot(){var x=b.props.appendTo,z,J=N();b.props.interactive&&x===Yd||x==="parent"?z=J.parentNode:z=Xd(x,[J]),z.contains(v)||z.appendChild(v),b.state.isMounted=!0,Ut()}function ut(){return to(v.querySelectorAll("[data-tippy-root]"))}function Kt(x){b.clearDelayTimeouts(),x&&_("onTrigger",[b,x]),me();var z=L(!0),J=H(),ae=J[0],oe=J[1];Bt.isTouch&&ae==="hold"&&oe&&(z=oe),z?r=setTimeout(function(){b.show()},z):b.show()}function xt(x){if(b.clearDelayTimeouts(),_("onUntrigger",[b,x]),!b.state.isVisible){Ue();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(x.type)>=0&&s)){var z=L(!1);z?i=setTimeout(function(){b.state.isVisible&&b.hide()},z):o=requestAnimationFrame(function(){b.hide()})}}function Jt(){b.state.isEnabled=!0}function nn(){b.hide(),b.state.isEnabled=!1}function rn(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function on(x){if(!b.state.isDestroyed){_("onBeforeUpdate",[b,x]),Nn();var z=b.props,J=$c(n,Object.assign({},z,Ic(x),{ignoreAttributes:!0}));b.props=J,Nt(),z.interactiveDebounce!==J.interactiveDebounce&&(ee(),h=Nc(D,J.interactiveDebounce)),z.triggerTarget&&!J.triggerTarget?sr(z.triggerTarget).forEach(function(ae){ae.removeAttribute("aria-expanded")}):J.triggerTarget&&n.removeAttribute("aria-expanded"),K(),R(),O&&O(z,J),b.popperInstance&&(Ut(),ut().forEach(function(ae){requestAnimationFrame(ae._tippy.popperInstance.forceUpdate)})),_("onAfterUpdate",[b,x])}}function Dn(x){b.setProps({content:x})}function Ar(){var x=b.state.isVisible,z=b.state.isDestroyed,J=!b.state.isEnabled,ae=Bt.isTouch&&!b.props.touch,oe=Cs(b.props.duration,0,Tt.duration);if(!(x||z||J||ae)&&!N().hasAttribute("disabled")&&(_("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,S()&&(v.style.visibility="visible"),R(),me(),b.state.isMounted||(v.style.transition="none"),S()){var qe=B(),dt=qe.box,Zn=qe.content;Ms([dt,Zn],0)}f=function(){var In;if(!(!b.state.isVisible||c)){if(c=!0,v.offsetHeight,v.style.transition=b.props.moveTransition,S()&&b.props.animation){var Qo=B(),bi=Qo.box,er=Qo.content;Ms([bi,er],oe),Rc([bi,er],"visible")}$(),K(),Dc(Os,b),(In=b.popperInstance)==null||In.forceUpdate(),_("onMount",[b]),b.props.animation&&S()&&rt(oe,function(){b.state.isShown=!0,_("onShown",[b])})}},ot()}}function Er(){var x=!b.state.isVisible,z=b.state.isDestroyed,J=!b.state.isEnabled,ae=Cs(b.props.duration,1,Tt.duration);if(!(x||z||J)&&(_("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,c=!1,s=!1,S()&&(v.style.visibility="hidden"),ee(),Ue(),R(!0),S()){var oe=B(),qe=oe.box,dt=oe.content;b.props.animation&&(Ms([qe,dt],ae),Rc([qe,dt],"hidden"))}$(),K(),b.props.animation?S()&&ze(ae,b.unmount):b.unmount()}}function Nr(x){P().addEventListener("mousemove",h),Dc(Ci,h),h(x)}function Dr(){b.state.isVisible&&b.hide(),b.state.isMounted&&(qt(),ut().forEach(function(x){x._tippy.unmount()}),v.parentNode&&v.parentNode.removeChild(v),Os=Os.filter(function(x){return x!==b}),b.state.isMounted=!1,_("onHidden",[b]))}function gi(){b.state.isDestroyed||(b.clearDelayTimeouts(),b.unmount(),Nn(),delete n._tippy,b.state.isDestroyed=!0,_("onDestroy",[b]))}}function mi(n,e){e===void 0&&(e={});var t=Tt.plugins.concat(e.plugins||[]);j0();var r=Object.assign({},e,{plugins:t}),i=z0(n),o=i.reduce(function(s,l){var a=l&&Z0(l,r);return a&&s.push(a),s},[]);return Yo(n)?o[0]:o}mi.defaultProps=Tt;mi.setDefaultProps=G0;mi.currentInput=Bt;Object.assign({},Fd,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});mi.setDefaultProps({render:ef});class ev{constructor({editor:e,element:t,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:a,from:c,to:u})=>{const{doc:d,selection:f}=a,{empty:p}=f,h=!d.textBetween(c,u).length&&Hl(a.selection),m=this.element.contains(document.activeElement);return!(!(l.hasFocus()||m)||p||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var a;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,a)=>{const c=!(a!=null&&a.selection.eq(l.state.selection)),u=!(a!=null&&a.doc.eq(l.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,c,u,a)},this.updateDelay))},this.updateHandler=(l,a,c,u)=>{var d,f,p;const{state:h,composing:m}=l,{selection:g}=h;if(m||!a&&!c)return;this.createTooltip();const{ranges:k}=g,C=Math.min(...k.map(v=>v.$from.pos)),b=Math.max(...k.map(v=>v.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,view:l,state:h,oldState:u,from:C,to:b}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(Jg(h.selection)){let v=l.nodeDOM(C);const O=v.dataset.nodeViewWrapper?v:v.querySelector("[data-node-view-wrapper]");if(O&&(v=O.firstChild),v)return v.getBoundingClientRect()}return Gg(l,C,b)})}),this.show()},this.editor=e,this.element=t,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=mi(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,t);return}const o=!(t!=null&&t.selection.eq(e.state.selection)),s=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,o,s,t)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const tv=n=>new We({key:typeof n.pluginKey=="string"?new wt(n.pluginKey):n.pluginKey,view:e=>new ev({view:e,...n})}),nv=nt.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[tv({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}}),rv="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",iv="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Cr=(n,e)=>{for(const t in e)n[t]=e[t];return n},ll="numeric",al="ascii",cl="alpha",Li="asciinumeric",Mi="alphanumeric",ul="domain",tf="emoji",ov="scheme",sv="slashscheme",Fc="whitespace";function lv(n,e){return n in e||(e[n]=[]),e[n]}function Bn(n,e,t){e[ll]&&(e[Li]=!0,e[Mi]=!0),e[al]&&(e[Li]=!0,e[cl]=!0),e[Li]&&(e[Mi]=!0),e[cl]&&(e[Mi]=!0),e[Mi]&&(e[ul]=!0),e[tf]&&(e[ul]=!0);for(const r in e){const i=lv(r,t);i.indexOf(n)<0&&i.push(n)}}function av(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function Qe(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}Qe.groups={};Qe.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;rn.ta(e,t,r,i),ft=(n,e,t,r,i)=>n.tr(e,t,r,i),_c=(n,e,t,r,i)=>n.ts(e,t,r,i),E=(n,e,t,r,i)=>n.tt(e,t,r,i),Xt="WORD",dl="UWORD",ai="LOCALHOST",fl="TLD",pl="UTLD",$i="SCHEME",lr="SLASH_SCHEME",ta="NUM",nf="WS",na="NL",Gr="OPENBRACE",Yr="CLOSEBRACE",no="OPENBRACKET",ro="CLOSEBRACKET",io="OPENPAREN",oo="CLOSEPAREN",so="OPENANGLEBRACKET",lo="CLOSEANGLEBRACKET",ao="FULLWIDTHLEFTPAREN",co="FULLWIDTHRIGHTPAREN",uo="LEFTCORNERBRACKET",fo="RIGHTCORNERBRACKET",po="LEFTWHITECORNERBRACKET",ho="RIGHTWHITECORNERBRACKET",mo="FULLWIDTHLESSTHAN",go="FULLWIDTHGREATERTHAN",bo="AMPERSAND",yo="APOSTROPHE",vo="ASTERISK",pn="AT",ko="BACKSLASH",wo="BACKTICK",xo="CARET",mn="COLON",ra="COMMA",So="DOLLAR",Pt="DOT",Co="EQUALS",ia="EXCLAMATION",Lt="HYPHEN",Mo="PERCENT",To="PIPE",Oo="PLUS",Ao="POUND",Eo="QUERY",oa="QUOTE",sa="SEMI",$t="SLASH",Xr="TILDE",No="UNDERSCORE",rf="EMOJI",Do="SYM";var of=Object.freeze({__proto__:null,WORD:Xt,UWORD:dl,LOCALHOST:ai,TLD:fl,UTLD:pl,SCHEME:$i,SLASH_SCHEME:lr,NUM:ta,WS:nf,NL:na,OPENBRACE:Gr,CLOSEBRACE:Yr,OPENBRACKET:no,CLOSEBRACKET:ro,OPENPAREN:io,CLOSEPAREN:oo,OPENANGLEBRACKET:so,CLOSEANGLEBRACKET:lo,FULLWIDTHLEFTPAREN:ao,FULLWIDTHRIGHTPAREN:co,LEFTCORNERBRACKET:uo,RIGHTCORNERBRACKET:fo,LEFTWHITECORNERBRACKET:po,RIGHTWHITECORNERBRACKET:ho,FULLWIDTHLESSTHAN:mo,FULLWIDTHGREATERTHAN:go,AMPERSAND:bo,APOSTROPHE:yo,ASTERISK:vo,AT:pn,BACKSLASH:ko,BACKTICK:wo,CARET:xo,COLON:mn,COMMA:ra,DOLLAR:So,DOT:Pt,EQUALS:Co,EXCLAMATION:ia,HYPHEN:Lt,PERCENT:Mo,PIPE:To,PLUS:Oo,POUND:Ao,QUERY:Eo,QUOTE:oa,SEMI:sa,SLASH:$t,TILDE:Xr,UNDERSCORE:No,EMOJI:rf,SYM:Do});const rr=/[a-z]/,As=new RegExp("\\p{L}","u"),Es=new RegExp("\\p{Emoji}","u"),Ns=/\d/,Hc=/\s/,Vc=` -`,cv="️",uv="‍";let Ti=null,Oi=null;function dv(n){n===void 0&&(n=[]);const e={};Qe.groups=e;const t=new Qe;Ti==null&&(Ti=jc(rv)),Oi==null&&(Oi=jc(iv)),E(t,"'",yo),E(t,"{",Gr),E(t,"}",Yr),E(t,"[",no),E(t,"]",ro),E(t,"(",io),E(t,")",oo),E(t,"<",so),E(t,">",lo),E(t,"(",ao),E(t,")",co),E(t,"「",uo),E(t,"」",fo),E(t,"『",po),E(t,"』",ho),E(t,"<",mo),E(t,">",go),E(t,"&",bo),E(t,"*",vo),E(t,"@",pn),E(t,"`",wo),E(t,"^",xo),E(t,":",mn),E(t,",",ra),E(t,"$",So),E(t,".",Pt),E(t,"=",Co),E(t,"!",ia),E(t,"-",Lt),E(t,"%",Mo),E(t,"|",To),E(t,"+",Oo),E(t,"#",Ao),E(t,"?",Eo),E(t,'"',oa),E(t,"/",$t),E(t,";",sa),E(t,"~",Xr),E(t,"_",No),E(t,"\\",ko);const r=ft(t,Ns,ta,{[ll]:!0});ft(r,Ns,r);const i=ft(t,rr,Xt,{[al]:!0});ft(i,rr,i);const o=ft(t,As,dl,{[cl]:!0});ft(o,rr),ft(o,As,o);const s=ft(t,Hc,nf,{[Fc]:!0});E(t,Vc,na,{[Fc]:!0}),E(s,Vc),ft(s,Hc,s);const l=ft(t,Es,rf,{[tf]:!0});ft(l,Es,l),E(l,cv,l);const a=E(l,uv);ft(a,Es,l);const c=[[rr,i]],u=[[rr,null],[As,o]];for(let d=0;dd[0]>f[0]?1:-1);for(let d=0;d=0?h[ul]=!0:rr.test(f)?Ns.test(f)?h[Li]=!0:h[al]=!0:h[ll]=!0,_c(t,f,f,h)}return _c(t,"localhost",ai,{ascii:!0}),t.jd=new Qe(Do),{start:t,tokens:Cr({groups:e},of)}}function fv(n,e){const t=pv(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,i=[];let o=0,s=0;for(;s=0&&(d+=t[s].length,f++),c+=t[s].length,o+=t[s].length,s++;o-=d,s-=f,c-=d,i.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function pv(n){const e=[],t=n.length;let r=0;for(;r56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(s),r+=s.length}return e}function sn(n,e,t,r,i){let o;const s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(t.join(""));for(let s=parseInt(n.substring(r,r+o),10);s>0;s--)t.pop();r+=o}else t.push(n[r]),r++}return e}const ci={defaultProtocol:"http",events:null,format:Wc,formatHref:Wc,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function la(n,e){e===void 0&&(e=null);let t=Cr({},ci);n&&(t=Cr(t,n instanceof la?n.o:n));const r=t.ignoreTags,i=[];for(let o=0;ot?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n){return n===void 0&&(n=ci.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),s={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),u&&Cr(s,u),{tagName:i,attributes:s,content:o,eventListeners:d}}};function Xo(n,e){class t extends sf{constructor(i,o){super(i,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const Uc=Xo("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),qc=Xo("text"),hv=Xo("nl"),Ai=Xo("url",{isLink:!0,toHref(n){return n===void 0&&(n=ci.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==ai&&n[1].t===mn}}),pt=n=>new Qe(n);function mv(n){let{groups:e}=n;const t=e.domain.concat([bo,vo,pn,ko,wo,xo,So,Co,Lt,ta,Mo,To,Oo,Ao,$t,Do,Xr,No]),r=[yo,mn,ra,Pt,ia,Eo,oa,sa,so,lo,Gr,Yr,ro,no,io,oo,ao,co,uo,fo,po,ho,mo,go],i=[bo,yo,vo,ko,wo,xo,So,Co,Lt,Gr,Yr,Mo,To,Oo,Ao,Eo,$t,Do,Xr,No],o=pt(),s=E(o,Xr);X(s,i,s),X(s,e.domain,s);const l=pt(),a=pt(),c=pt();X(o,e.domain,l),X(o,e.scheme,a),X(o,e.slashscheme,c),X(l,i,s),X(l,e.domain,l);const u=E(l,pn);E(s,pn,u),E(a,pn,u),E(c,pn,u);const d=E(s,Pt);X(d,i,s),X(d,e.domain,s);const f=pt();X(u,e.domain,f),X(f,e.domain,f);const p=E(f,Pt);X(p,e.domain,f);const h=pt(Uc);X(p,e.tld,h),X(p,e.utld,h),E(u,ai,h);const m=E(f,Lt);X(m,e.domain,f),X(h,e.domain,f),E(h,Pt,p),E(h,Lt,m);const g=E(h,mn);X(g,e.numeric,Uc);const y=E(l,Lt),k=E(l,Pt);X(y,e.domain,l),X(k,i,s),X(k,e.domain,l);const C=pt(Ai);X(k,e.tld,C),X(k,e.utld,C),X(C,e.domain,l),X(C,i,s),E(C,Pt,k),E(C,Lt,y),E(C,pn,u);const b=E(C,mn),A=pt(Ai);X(b,e.numeric,A);const v=pt(Ai),O=pt();X(v,t,v),X(v,r,O),X(O,t,v),X(O,r,O),E(C,$t,v),E(A,$t,v);const W=E(a,mn),w=E(c,mn),H=E(w,$t),q=E(H,$t);X(a,e.domain,l),E(a,Pt,k),E(a,Lt,y),X(c,e.domain,l),E(c,Pt,k),E(c,Lt,y),X(W,e.domain,v),E(W,$t,v),X(q,e.domain,v),X(q,t,v),E(q,$t,v);const S=[[Gr,Yr],[no,ro],[io,oo],[so,lo],[ao,co],[uo,fo],[po,ho],[mo,go]];for(let N=0;N=0&&f++,i++,u++;if(f<0)i-=u,i0&&(o.push(Ds(qc,e,s)),s=[]),i-=f,u-=f;const p=d.t,h=t.slice(i-u,i);o.push(Ds(p,e,h))}}return s.length>0&&o.push(Ds(qc,e,s)),o}function Ds(n,e,t){const r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}const bv=typeof console<"u"&&console&&console.warn||(()=>{}),yv="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ke={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function vv(){Qe.groups={},ke.scanner=null,ke.parser=null,ke.tokenQueue=[],ke.pluginQueue=[],ke.customSchemes=[],ke.initialized=!1}function Kc(n,e){if(e===void 0&&(e=!1),ke.initialized&&bv(`linkifyjs: already initialized - will not register custom scheme "${n}" ${yv}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. +`)),s.setMeta("paste",!0),n.dispatch(s),!0}}})]}}),Hb=Ve.create({name:"doc",topNode:!0,content:"block+"});function Vb(n={}){return new We({view(e){return new jb(e,n)}})}class jb{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r;if(t){let l=e.nodeBefore,a=e.nodeAfter;if(l||a){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=l?u.bottom:u.top;l&&a&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Ru(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const Wb=nt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Vb(this.options)]}});class we extends Z{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return we.valid(r)?new we(r):Z.near(r)}content(){return I.empty}eq(e){return e instanceof we&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new we(e.resolve(t.pos))}getBookmark(){return new ql(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!Ub(e)||!qb(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&we.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(t>0?e.indexAfter(s)0){o=l.child(t>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=t;let a=e.doc.resolve(i);if(we.valid(a))return a}for(;;){let s=t>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!j.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=s,i+=t;let l=e.doc.resolve(i);if(we.valid(l))return l}return null}}}we.prototype.visible=!1;we.findFrom=we.findGapCursorFrom;Z.jsonID("gapcursor",we);class ql{constructor(e){this.pos=e}map(e){return new ql(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return we.valid(t)?new we(t):Z.near(t)}}function Ub(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function qb(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Kb(){return new We({props:{decorations:Xb,createSelectionBetween(n,e,t){return e.pos==t.pos&&we.valid(t)?new we(t):null},handleClick:Gb,handleKeyDown:Jb,handleDOMEvents:{beforeinput:Yb}}})}const Jb=kd({ArrowLeft:xi("horiz",-1),ArrowRight:xi("horiz",1),ArrowUp:xi("vert",-1),ArrowDown:xi("vert",1)});function xi(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,a=s.empty;if(s instanceof G){if(!o.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=we.findGapCursorFrom(l,e,a);return c?(i&&i(r.tr.setSelection(new we(c))),!0):!1}}function Gb(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!we.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&j.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new we(r))),!0)}function Yb(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof we))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=T.empty;for(let s=r.length-1;s>=0;s--)i=T.from(r[s].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new I(i,0,0));return o.setSelection(G.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function Xb(n){if(!(n.selection instanceof we))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ee.create(n.doc,[gt.widget(n.selection.head,e,{key:"gapcursor"})])}const Qb=nt.create({name:"gapCursor",addProseMirrorPlugins(){return[Kb()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=Q(F(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),Zb=Ve.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",Me(this.options.HTMLAttributes,n)]},renderText(){return` +`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:o}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,a=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&s){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ey=Ve.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Me(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>nl({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Zi=200,De=function(){};De.prototype.append=function(e){return e.length?(e=De.from(e),!this.length&&e||e.length=t?De.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};De.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};De.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};De.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i};De.from=function(e){return e instanceof De?e:e&&e.length?new Rd(e):De.empty};var Rd=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var a=o;a=s;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Zi)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Zi)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(De);De.empty=new Rd([]);var ty=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(De);const ny=500;class Mt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(r,f+1),o=i.maps.length),o--,u.push(d);return}if(i){u.push(new Rt(d.map));let p=d.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new Rt(h,void 0,void 0,c.length+u.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(d.step);if(d.selection)return l=i?d.selection.map(i.slice(o)):d.selection,a=new Mt(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,t,r,i){let o=[],s=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let u=0;uiy&&(l=ry(l,c),s-=c),new Mt(l.append(o),s)}remapping(e,t){let r=new ur;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new Mt(this.items.append(e.map(t=>new Rt(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let a=t;this.items.forEach(f=>{let p=o.getMirror(--a);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),g=f.selection&&f.selection.map(o.slice(a+1,p));g&&l++,r.push(new Rt(h,m,g))}else r.push(new Rt(h))},i);let c=[];for(let f=t;fny&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=s.selection&&s.selection.map(t.slice(r));u&&o++;let d=new Rt(c.invert(),a,u),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else s.map&&r--},this.items.length,0),new Mt(De.from(i.reverse()),o)}}Mt.empty=new Mt(De.empty,0);function ry(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class Rt{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Rt(t.getMap().invert(),t,this.selection)}}}class fn{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const iy=20;function oy(n,e,t,r){let i=t.getMeta(Sn),o;if(i)return i.historyState;t.getMeta(ly)&&(n=new fn(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(Sn))return s.getMeta(Sn).redo?new fn(n.done.addTransform(t,void 0,r,Ri(e)),n.undone,bc(t.mapping.maps[t.steps.length-1]),n.prevTime,n.prevComposition):new fn(n.done,n.undone.addTransform(t,void 0,r,Ri(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!s&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!sy(t,n.prevRanges)),c=s?xs(n.prevRanges,t.mapping):bc(t.mapping.maps[t.steps.length-1]);return new fn(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,Ri(e)),Mt.empty,c,t.time,l??n.prevComposition)}else return(o=t.getMeta("rebased"))?new fn(n.done.rebased(t,o),n.undone.rebased(t,o),xs(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new fn(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),xs(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function sy(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(t=!0)}),t}function bc(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function xs(n,e){if(!n)return null;let t=[];for(let r=0;r{let t=Sn.getState(n);return!t||t.done.eventCount==0?!1:(e&&Pd(t,n,e,!1),!0)},$d=(n,e)=>{let t=Sn.getState(n);return!t||t.undone.eventCount==0?!1:(e&&Pd(t,n,e,!0),!0)},cy=nt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>Ld(n,e),redo:()=>({state:n,dispatch:e})=>$d(n,e)}},addProseMirrorPlugins(){return[ay(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),uy=Ve.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Me(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:l}=i.selection,a=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(G.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(j.create(i.doc,l.pos)):i.setSelection(G.create(i.doc,l.pos));else{const c=(s=l.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();c&&(i.insert(a,c),i.setSelection(G.create(i.doc,a+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Mb({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),dy=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,fy=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,py=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,hy=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,my=At.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[vr({find:dy,type:this.type}),vr({find:py,type:this.type})]},addPasteRules(){return[Yn({find:fy,type:this.type}),Yn({find:hy,type:this.type})]}}),gy=Ve.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Me(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),by=Ve.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Me(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),vc=At.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=Jo(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),kc=/^(\d+)\.\s$/,yy=Ve.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",Me(this.options.HTMLAttributes,t),0]:["ol",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(by.name,this.editor.getAttributes(vc.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=oi({find:kc,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=oi({find:kc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(vc.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),vy=Ve.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ky=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,wy=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,xy=At.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){const n={};return jl()?n["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():n["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),n},addInputRules(){return[vr({find:ky,type:this.type})]},addPasteRules(){return[Yn({find:wy,type:this.type})]}}),Sy=Ve.create({name:"text",group:"inline"}),Cy=nt.create({name:"starterKit",addExtensions(){var n,e,t,r,i,o,s,l,a,c,u,d,f,p,h,m,g,y;const k=[];return this.options.blockquote!==!1&&k.push(Ob.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&k.push(Ib.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&k.push(Pb.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&k.push(Bb.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&k.push(_b.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&k.push(Hb.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&k.push(Wb.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&k.push(Qb.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&k.push(Zb.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&k.push(ey.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&k.push(cy.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&k.push(uy.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&k.push(my.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&k.push(gy.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&k.push(yy.configure((h=this.options)===null||h===void 0?void 0:h.orderedList)),this.options.paragraph!==!1&&k.push(vy.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&k.push(xy.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&k.push(Sy.configure((y=this.options)===null||y===void 0?void 0:y.text)),k}});var et="top",vt="bottom",kt="right",tt="left",Kl="auto",pi=[et,vt,kt,tt],kr="start",si="end",My="clippingParents",Bd="viewport",Rr="popper",Ty="reference",wc=pi.reduce(function(n,e){return n.concat([e+"-"+kr,e+"-"+si])},[]),zd=[].concat(pi,[Kl]).reduce(function(n,e){return n.concat([e,e+"-"+kr,e+"-"+si])},[]),Oy="beforeRead",Ey="read",Ay="afterRead",Ny="beforeMain",Dy="main",Iy="afterMain",Ry="beforeWrite",Py="write",Ly="afterWrite",$y=[Oy,Ey,Ay,Ny,Dy,Iy,Ry,Py,Ly];function Wt(n){return n?(n.nodeName||"").toLowerCase():null}function ct(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Xn(n){var e=ct(n).Element;return n instanceof e||n instanceof Element}function yt(n){var e=ct(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Jl(n){if(typeof ShadowRoot>"u")return!1;var e=ct(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function By(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];!yt(o)||!Wt(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function zy(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),l=s.reduce(function(a,c){return a[c]="",a},{});!yt(i)||!Wt(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(a){i.removeAttribute(a)}))})}}const Fd={name:"applyStyles",enabled:!0,phase:"write",fn:By,effect:zy,requires:["computeStyles"]};function Ht(n){return n.split("-")[0]}var Un=Math.max,eo=Math.min,wr=Math.round;function rl(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function _d(){return!/^((?!chrome|android).)*safari/i.test(rl())}function xr(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),i=1,o=1;e&&yt(n)&&(i=n.offsetWidth>0&&wr(r.width)/n.offsetWidth||1,o=n.offsetHeight>0&&wr(r.height)/n.offsetHeight||1);var s=Xn(n)?ct(n):window,l=s.visualViewport,a=!_d()&&t,c=(r.left+(a&&l?l.offsetLeft:0))/i,u=(r.top+(a&&l?l.offsetTop:0))/o,d=r.width/i,f=r.height/o;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Gl(n){var e=xr(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function Hd(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Jl(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function tn(n){return ct(n).getComputedStyle(n)}function Fy(n){return["table","td","th"].indexOf(Wt(n))>=0}function An(n){return((Xn(n)?n.ownerDocument:n.document)||window.document).documentElement}function Go(n){return Wt(n)==="html"?n:n.assignedSlot||n.parentNode||(Jl(n)?n.host:null)||An(n)}function xc(n){return!yt(n)||tn(n).position==="fixed"?null:n.offsetParent}function _y(n){var e=/firefox/i.test(rl()),t=/Trident/i.test(rl());if(t&&yt(n)){var r=tn(n);if(r.position==="fixed")return null}var i=Go(n);for(Jl(i)&&(i=i.host);yt(i)&&["html","body"].indexOf(Wt(i))<0;){var o=tn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function hi(n){for(var e=ct(n),t=xc(n);t&&Fy(t)&&tn(t).position==="static";)t=xc(t);return t&&(Wt(t)==="html"||Wt(t)==="body"&&tn(t).position==="static")?e:t||_y(n)||e}function Yl(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function qr(n,e,t){return Un(n,eo(e,t))}function Hy(n,e,t){var r=qr(n,e,t);return r>t?t:r}function Vd(){return{top:0,right:0,bottom:0,left:0}}function jd(n){return Object.assign({},Vd(),n)}function Wd(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var Vy=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,jd(typeof e!="number"?e:Wd(e,pi))};function jy(n){var e,t=n.state,r=n.name,i=n.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,l=Ht(t.placement),a=Yl(l),c=[tt,kt].indexOf(l)>=0,u=c?"height":"width";if(!(!o||!s)){var d=Vy(i.padding,t),f=Gl(o),p=a==="y"?et:tt,h=a==="y"?vt:kt,m=t.rects.reference[u]+t.rects.reference[a]-s[a]-t.rects.popper[u],g=s[a]-t.rects.reference[a],y=hi(o),k=y?a==="y"?y.clientHeight||0:y.clientWidth||0:0,C=m/2-g/2,b=d[p],E=k-f[u]-d[h],v=k/2-f[u]/2+C,O=qr(b,v,E),W=a;t.modifiersData[r]=(e={},e[W]=O,e.centerOffset=O-v,e)}}function Wy(n){var e=n.state,t=n.options,r=t.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Hd(e.elements.popper,i)&&(e.elements.arrow=i))}const Uy={name:"arrow",enabled:!0,phase:"main",fn:jy,effect:Wy,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sr(n){return n.split("-")[1]}var qy={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ky(n,e){var t=n.x,r=n.y,i=e.devicePixelRatio||1;return{x:wr(t*i)/i||0,y:wr(r*i)/i||0}}function Sc(n){var e,t=n.popper,r=n.popperRect,i=n.placement,o=n.variation,s=n.offsets,l=n.position,a=n.gpuAcceleration,c=n.adaptive,u=n.roundOffsets,d=n.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,g=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var y=s.hasOwnProperty("x"),k=s.hasOwnProperty("y"),C=tt,b=et,E=window;if(c){var v=hi(t),O="clientHeight",W="clientWidth";if(v===ct(t)&&(v=An(t),tn(v).position!=="static"&&l==="absolute"&&(O="scrollHeight",W="scrollWidth")),v=v,i===et||(i===tt||i===kt)&&o===si){b=vt;var w=d&&v===E&&E.visualViewport?E.visualViewport.height:v[O];m-=w-r.height,m*=a?1:-1}if(i===tt||(i===et||i===vt)&&o===si){C=kt;var H=d&&v===E&&E.visualViewport?E.visualViewport.width:v[W];p-=H-r.width,p*=a?1:-1}}var q=Object.assign({position:l},c&&qy),S=u===!0?Ky({x:p,y:m},ct(t)):{x:p,y:m};if(p=S.x,m=S.y,a){var N;return Object.assign({},q,(N={},N[b]=k?"0":"",N[C]=y?"0":"",N.transform=(E.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",N))}return Object.assign({},q,(e={},e[b]=k?m+"px":"",e[C]=y?p+"px":"",e.transform="",e))}function Jy(n){var e=n.state,t=n.options,r=t.gpuAcceleration,i=r===void 0?!0:r,o=t.adaptive,s=o===void 0?!0:o,l=t.roundOffsets,a=l===void 0?!0:l,c={placement:Ht(e.placement),variation:Sr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Sc(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Sc(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Gy={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Jy,data:{}};var Si={passive:!0};function Yy(n){var e=n.state,t=n.instance,r=n.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,a=ct(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",t.update,Si)}),l&&a.addEventListener("resize",t.update,Si),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",t.update,Si)}),l&&a.removeEventListener("resize",t.update,Si)}}const Xy={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Yy,data:{}};var Qy={left:"right",right:"left",bottom:"top",top:"bottom"};function Pi(n){return n.replace(/left|right|bottom|top/g,function(e){return Qy[e]})}var Zy={start:"end",end:"start"};function Cc(n){return n.replace(/start|end/g,function(e){return Zy[e]})}function Xl(n){var e=ct(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Ql(n){return xr(An(n)).left+Xl(n).scrollLeft}function e0(n,e){var t=ct(n),r=An(n),i=t.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,a=0;if(i){o=i.width,s=i.height;var c=_d();(c||!c&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l+Ql(n),y:a}}function t0(n){var e,t=An(n),r=Xl(n),i=(e=n.ownerDocument)==null?void 0:e.body,o=Un(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Un(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Ql(n),a=-r.scrollTop;return tn(i||t).direction==="rtl"&&(l+=Un(t.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:a}}function Zl(n){var e=tn(n),t=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+r)}function Ud(n){return["html","body","#document"].indexOf(Wt(n))>=0?n.ownerDocument.body:yt(n)&&Zl(n)?n:Ud(Go(n))}function Kr(n,e){var t;e===void 0&&(e=[]);var r=Ud(n),i=r===((t=n.ownerDocument)==null?void 0:t.body),o=ct(r),s=i?[o].concat(o.visualViewport||[],Zl(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(Kr(Go(s)))}function il(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function n0(n,e){var t=xr(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Mc(n,e,t){return e===Bd?il(e0(n,t)):Xn(e)?n0(e,t):il(t0(An(n)))}function r0(n){var e=Kr(Go(n)),t=["absolute","fixed"].indexOf(tn(n).position)>=0,r=t&&yt(n)?hi(n):n;return Xn(r)?e.filter(function(i){return Xn(i)&&Hd(i,r)&&Wt(i)!=="body"}):[]}function i0(n,e,t,r){var i=e==="clippingParents"?r0(n):[].concat(e),o=[].concat(i,[t]),s=o[0],l=o.reduce(function(a,c){var u=Mc(n,c,r);return a.top=Un(u.top,a.top),a.right=eo(u.right,a.right),a.bottom=eo(u.bottom,a.bottom),a.left=Un(u.left,a.left),a},Mc(n,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function qd(n){var e=n.reference,t=n.element,r=n.placement,i=r?Ht(r):null,o=r?Sr(r):null,s=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,a;switch(i){case et:a={x:s,y:e.y-t.height};break;case vt:a={x:s,y:e.y+e.height};break;case kt:a={x:e.x+e.width,y:l};break;case tt:a={x:e.x-t.width,y:l};break;default:a={x:e.x,y:e.y}}var c=i?Yl(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case kr:a[c]=a[c]-(e[u]/2-t[u]/2);break;case si:a[c]=a[c]+(e[u]/2-t[u]/2);break}}return a}function li(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=r===void 0?n.placement:r,o=t.strategy,s=o===void 0?n.strategy:o,l=t.boundary,a=l===void 0?My:l,c=t.rootBoundary,u=c===void 0?Bd:c,d=t.elementContext,f=d===void 0?Rr:d,p=t.altBoundary,h=p===void 0?!1:p,m=t.padding,g=m===void 0?0:m,y=jd(typeof g!="number"?g:Wd(g,pi)),k=f===Rr?Ty:Rr,C=n.rects.popper,b=n.elements[h?k:f],E=i0(Xn(b)?b:b.contextElement||An(n.elements.popper),a,u,s),v=xr(n.elements.reference),O=qd({reference:v,element:C,strategy:"absolute",placement:i}),W=il(Object.assign({},C,O)),w=f===Rr?W:v,H={top:E.top-w.top+y.top,bottom:w.bottom-E.bottom+y.bottom,left:E.left-w.left+y.left,right:w.right-E.right+y.right},q=n.modifiersData.offset;if(f===Rr&&q){var S=q[i];Object.keys(H).forEach(function(N){var P=[kt,vt].indexOf(N)>=0?1:-1,B=[et,vt].indexOf(N)>=0?"y":"x";H[N]+=S[B]*P})}return H}function o0(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=t.boundary,o=t.rootBoundary,s=t.padding,l=t.flipVariations,a=t.allowedAutoPlacements,c=a===void 0?zd:a,u=Sr(r),d=u?l?wc:wc.filter(function(h){return Sr(h)===u}):pi,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=li(n,{placement:m,boundary:i,rootBoundary:o,padding:s})[Ht(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function s0(n){if(Ht(n)===Kl)return[];var e=Pi(n);return[Cc(n),e,Cc(e)]}function l0(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var i=t.mainAxis,o=i===void 0?!0:i,s=t.altAxis,l=s===void 0?!0:s,a=t.fallbackPlacements,c=t.padding,u=t.boundary,d=t.rootBoundary,f=t.altBoundary,p=t.flipVariations,h=p===void 0?!0:p,m=t.allowedAutoPlacements,g=e.options.placement,y=Ht(g),k=y===g,C=a||(k||!h?[Pi(g)]:s0(g)),b=[g].concat(C).reduce(function(Oe,me){return Oe.concat(Ht(me)===Kl?o0(e,{placement:me,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):me)},[]),E=e.rects.reference,v=e.rects.popper,O=new Map,W=!0,w=b[0],H=0;H=0,B=P?"width":"height",L=li(e,{placement:q,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),R=P?N?kt:tt:N?vt:et;E[B]>v[B]&&(R=Pi(R));var _=Pi(R),$=[];if(o&&$.push(L[S]<=0),l&&$.push(L[R]<=0,L[_]<=0),$.every(function(Oe){return Oe})){w=q,W=!1;break}O.set(q,$)}if(W)for(var K=h?3:1,ee=function(me){var Ue=b.find(function(ze){var rt=O.get(ze);if(rt)return rt.slice(0,me).every(function(Fe){return Fe})});if(Ue)return w=Ue,"break"},ie=K;ie>0;ie--){var te=ee(ie);if(te==="break")break}e.placement!==w&&(e.modifiersData[r]._skip=!0,e.placement=w,e.reset=!0)}}const a0={name:"flip",enabled:!0,phase:"main",fn:l0,requiresIfExists:["offset"],data:{_skip:!1}};function Tc(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Oc(n){return[et,kt,vt,tt].some(function(e){return n[e]>=0})}function c0(n){var e=n.state,t=n.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=li(e,{elementContext:"reference"}),l=li(e,{altBoundary:!0}),a=Tc(s,r),c=Tc(l,i,o),u=Oc(a),d=Oc(c);e.modifiersData[t]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const u0={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:c0};function d0(n,e,t){var r=Ht(n),i=[tt,et].indexOf(r)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[tt,kt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function f0(n){var e=n.state,t=n.options,r=n.name,i=t.offset,o=i===void 0?[0,0]:i,s=zd.reduce(function(u,d){return u[d]=d0(d,e.rects,o),u},{}),l=s[e.placement],a=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const p0={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:f0};function h0(n){var e=n.state,t=n.name;e.modifiersData[t]=qd({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const m0={name:"popperOffsets",enabled:!0,phase:"read",fn:h0,data:{}};function g0(n){return n==="x"?"y":"x"}function b0(n){var e=n.state,t=n.options,r=n.name,i=t.mainAxis,o=i===void 0?!0:i,s=t.altAxis,l=s===void 0?!1:s,a=t.boundary,c=t.rootBoundary,u=t.altBoundary,d=t.padding,f=t.tether,p=f===void 0?!0:f,h=t.tetherOffset,m=h===void 0?0:h,g=li(e,{boundary:a,rootBoundary:c,padding:d,altBoundary:u}),y=Ht(e.placement),k=Sr(e.placement),C=!k,b=Yl(y),E=g0(b),v=e.modifiersData.popperOffsets,O=e.rects.reference,W=e.rects.popper,w=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,H=typeof w=="number"?{mainAxis:w,altAxis:w}:Object.assign({mainAxis:0,altAxis:0},w),q=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,S={x:0,y:0};if(v){if(o){var N,P=b==="y"?et:tt,B=b==="y"?vt:kt,L=b==="y"?"height":"width",R=v[b],_=R+g[P],$=R-g[B],K=p?-W[L]/2:0,ee=k===kr?O[L]:W[L],ie=k===kr?-W[L]:-O[L],te=e.elements.arrow,Oe=p&&te?Gl(te):{width:0,height:0},me=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Vd(),Ue=me[P],ze=me[B],rt=qr(0,O[L],Oe[L]),Fe=C?O[L]/2-K-rt-Ue-H.mainAxis:ee-rt-Ue-H.mainAxis,it=C?-O[L]/2+K+rt+ze+H.mainAxis:ie+rt+ze+H.mainAxis,Nt=e.elements.arrow&&hi(e.elements.arrow),Nn=Nt?b==="y"?Nt.clientTop||0:Nt.clientLeft||0:0,M=(N=q==null?void 0:q[b])!=null?N:0,D=R+Fe-M-Nn,V=R+it-M,Dt=qr(p?eo(_,D):_,R,p?Un($,V):$);v[b]=Dt,S[b]=Dt-R}if(l){var It,Ut=b==="x"?et:tt,qt=b==="x"?vt:kt,ot=v[E],ut=E==="y"?"height":"width",Kt=ot+g[Ut],xt=ot-g[qt],Jt=[et,tt].indexOf(y)!==-1,nn=(It=q==null?void 0:q[E])!=null?It:0,rn=Jt?Kt:ot-O[ut]-W[ut]-nn+H.altAxis,on=Jt?ot+O[ut]+W[ut]-nn-H.altAxis:xt,Dn=p&&Jt?Hy(rn,ot,on):qr(p?rn:Kt,ot,p?on:xt);v[E]=Dn,S[E]=Dn-ot}e.modifiersData[r]=S}}const y0={name:"preventOverflow",enabled:!0,phase:"main",fn:b0,requiresIfExists:["offset"]};function v0(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function k0(n){return n===ct(n)||!yt(n)?Xl(n):v0(n)}function w0(n){var e=n.getBoundingClientRect(),t=wr(e.width)/n.offsetWidth||1,r=wr(e.height)/n.offsetHeight||1;return t!==1||r!==1}function x0(n,e,t){t===void 0&&(t=!1);var r=yt(e),i=yt(e)&&w0(e),o=An(e),s=xr(n,i,t),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!t)&&((Wt(e)!=="body"||Zl(o))&&(l=k0(e)),yt(e)?(a=xr(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):o&&(a.x=Ql(o))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function S0(n){var e=new Map,t=new Set,r=[];n.forEach(function(o){e.set(o.name,o)});function i(o){t.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!t.has(l)){var a=e.get(l);a&&i(a)}}),r.push(o)}return n.forEach(function(o){t.has(o.name)||i(o)}),r}function C0(n){var e=S0(n);return $y.reduce(function(t,r){return t.concat(e.filter(function(i){return i.phase===r}))},[])}function M0(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function T0(n){var e=n.reduce(function(t,r){var i=t[r.name];return t[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var Ec={placement:"bottom",modifiers:[],strategy:"absolute"};function Ac(){for(var n=arguments.length,e=new Array(n),t=0;t-1}function Xd(n,e){return typeof n=="function"?n.apply(void 0,e):n}function Nc(n,e){if(e===0)return n;var t;return function(r){clearTimeout(t),t=setTimeout(function(){n(r)},e)}}function I0(n){return n.split(/\s+/).filter(Boolean)}function sr(n){return[].concat(n)}function Dc(n,e){n.indexOf(e)===-1&&n.push(e)}function R0(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function P0(n){return n.split("-")[0]}function to(n){return[].slice.call(n)}function Ic(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function Jr(){return document.createElement("div")}function Yo(n){return["Element","Fragment"].some(function(e){return ea(n,e)})}function L0(n){return ea(n,"NodeList")}function $0(n){return ea(n,"MouseEvent")}function B0(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function z0(n){return Yo(n)?[n]:L0(n)?to(n):Array.isArray(n)?n:to(document.querySelectorAll(n))}function Ms(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Rc(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function F0(n){var e,t=sr(n),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function _0(n,e){var t=e.clientX,r=e.clientY;return n.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,a=l.interactiveBorder,c=P0(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,m=o.top-r+d>a,g=r-o.bottom-f>a,y=o.left-t+p>a,k=t-o.right-h>a;return m||g||y||k})}function Ts(n,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){n[r](i,t)})}function Pc(n,e){for(var t=e;t;){var r;if(n.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var Bt={isTouch:!1},Lc=0;function H0(){Bt.isTouch||(Bt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Qd))}function Qd(){var n=performance.now();n-Lc<20&&(Bt.isTouch=!1,document.removeEventListener("mousemove",Qd)),Lc=n}function V0(){var n=document.activeElement;if(B0(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function j0(){document.addEventListener("touchstart",H0,Rn),window.addEventListener("blur",V0)}var W0=typeof window<"u"&&typeof document<"u",U0=W0?!!window.msCrypto:!1,q0={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},K0={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Tt=Object.assign({appendTo:Yd,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},q0,K0),J0=Object.keys(Tt),G0=function(e){var t=Object.keys(e);t.forEach(function(r){Tt[r]=e[r]})};function Zd(n){var e=n.plugins||[],t=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=n[o]!==void 0?n[o]:(l=Tt[o])!=null?l:s}return r},{});return Object.assign({},n,t)}function Y0(n,e){var t=e?Object.keys(Zd(Object.assign({},Tt,{plugins:e}))):J0,r=t.reduce(function(i,o){var s=(n.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function $c(n,e){var t=Object.assign({},e,{content:Xd(e.content,[n])},e.ignoreAttributes?{}:Y0(n,e.plugins));return t.aria=Object.assign({},Tt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var X0=function(){return"innerHTML"};function ol(n,e){n[X0()]=e}function Bc(n){var e=Jr();return n===!0?e.className=Jd:(e.className=Gd,Yo(n)?e.appendChild(n):ol(e,n)),e}function zc(n,e){Yo(e.content)?(ol(n,""),n.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?ol(n,e.content):n.textContent=e.content)}function sl(n){var e=n.firstElementChild,t=to(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(Kd)}),arrow:t.find(function(r){return r.classList.contains(Jd)||r.classList.contains(Gd)}),backdrop:t.find(function(r){return r.classList.contains(D0)})}}function ef(n){var e=Jr(),t=Jr();t.className=N0,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=Jr();r.className=Kd,r.setAttribute("data-state","hidden"),zc(r,n.props),e.appendChild(t),t.appendChild(r),i(n.props,n.props);function i(o,s){var l=sl(e),a=l.box,c=l.content,u=l.arrow;s.theme?a.setAttribute("data-theme",s.theme):a.removeAttribute("data-theme"),typeof s.animation=="string"?a.setAttribute("data-animation",s.animation):a.removeAttribute("data-animation"),s.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?a.setAttribute("role",s.role):a.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&zc(c,n.props),s.arrow?u?o.arrow!==s.arrow&&(a.removeChild(u),a.appendChild(Bc(s.arrow))):a.appendChild(Bc(s.arrow)):u&&a.removeChild(u)}return{popper:e,onUpdate:i}}ef.$$tippy=!0;var Q0=1,Ci=[],Os=[];function Z0(n,e){var t=$c(n,Object.assign({},Tt,Zd(Ic(e)))),r,i,o,s=!1,l=!1,a=!1,c=!1,u,d,f,p=[],h=Nc(D,t.interactiveDebounce),m,g=Q0++,y=null,k=R0(t.plugins),C={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:g,reference:n,popper:Jr(),popperInstance:y,props:t,state:C,plugins:k,clearDelayTimeouts:rn,setProps:on,setContent:Dn,show:Er,hide:Ar,hideWithInteractivity:Nr,enable:Jt,disable:nn,unmount:Dr,destroy:gi};if(!t.render)return b;var E=t.render(b),v=E.popper,O=E.onUpdate;v.setAttribute("data-tippy-root",""),v.id="tippy-"+b.id,b.popper=v,n._tippy=b,v._tippy=b;var W=k.map(function(x){return x.fn(b)}),w=n.hasAttribute("aria-expanded");return Nt(),K(),R(),_("onCreate",[b]),t.showOnCreate&&Kt(),v.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),v.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",h)}),b;function H(){var x=b.props.touch;return Array.isArray(x)?x:[x,0]}function q(){return H()[0]==="hold"}function S(){var x;return!!((x=b.props.render)!=null&&x.$$tippy)}function N(){return m||n}function P(){var x=N().parentNode;return x?F0(x):document}function B(){return sl(v)}function L(x){return b.state.isMounted&&!b.state.isVisible||Bt.isTouch||u&&u.type==="focus"?0:Cs(b.props.delay,x?0:1,Tt.delay)}function R(x){x===void 0&&(x=!1),v.style.pointerEvents=b.props.interactive&&!x?"":"none",v.style.zIndex=""+b.props.zIndex}function _(x,z,J){if(J===void 0&&(J=!0),W.forEach(function(oe){oe[x]&&oe[x].apply(oe,z)}),J){var ae;(ae=b.props)[x].apply(ae,z)}}function $(){var x=b.props.aria;if(x.content){var z="aria-"+x.content,J=v.id,ae=sr(b.props.triggerTarget||n);ae.forEach(function(oe){var qe=oe.getAttribute(z);if(b.state.isVisible)oe.setAttribute(z,qe?qe+" "+J:J);else{var dt=qe&&qe.replace(J,"").trim();dt?oe.setAttribute(z,dt):oe.removeAttribute(z)}})}}function K(){if(!(w||!b.props.aria.expanded)){var x=sr(b.props.triggerTarget||n);x.forEach(function(z){b.props.interactive?z.setAttribute("aria-expanded",b.state.isVisible&&z===N()?"true":"false"):z.removeAttribute("aria-expanded")})}}function ee(){P().removeEventListener("mousemove",h),Ci=Ci.filter(function(x){return x!==h})}function ie(x){if(!(Bt.isTouch&&(a||x.type==="mousedown"))){var z=x.composedPath&&x.composedPath()[0]||x.target;if(!(b.props.interactive&&Pc(v,z))){if(sr(b.props.triggerTarget||n).some(function(J){return Pc(J,z)})){if(Bt.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else _("onClickOutside",[b,x]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),l=!0,setTimeout(function(){l=!1}),b.state.isMounted||Ue())}}}function te(){a=!0}function Oe(){a=!1}function me(){var x=P();x.addEventListener("mousedown",ie,!0),x.addEventListener("touchend",ie,Rn),x.addEventListener("touchstart",Oe,Rn),x.addEventListener("touchmove",te,Rn)}function Ue(){var x=P();x.removeEventListener("mousedown",ie,!0),x.removeEventListener("touchend",ie,Rn),x.removeEventListener("touchstart",Oe,Rn),x.removeEventListener("touchmove",te,Rn)}function ze(x,z){Fe(x,function(){!b.state.isVisible&&v.parentNode&&v.parentNode.contains(v)&&z()})}function rt(x,z){Fe(x,z)}function Fe(x,z){var J=B().box;function ae(oe){oe.target===J&&(Ts(J,"remove",ae),z())}if(x===0)return z();Ts(J,"remove",d),Ts(J,"add",ae),d=ae}function it(x,z,J){J===void 0&&(J=!1);var ae=sr(b.props.triggerTarget||n);ae.forEach(function(oe){oe.addEventListener(x,z,J),p.push({node:oe,eventType:x,handler:z,options:J})})}function Nt(){q()&&(it("touchstart",M,{passive:!0}),it("touchend",V,{passive:!0})),I0(b.props.trigger).forEach(function(x){if(x!=="manual")switch(it(x,M),x){case"mouseenter":it("mouseleave",V);break;case"focus":it(U0?"focusout":"blur",Dt);break;case"focusin":it("focusout",Dt);break}})}function Nn(){p.forEach(function(x){var z=x.node,J=x.eventType,ae=x.handler,oe=x.options;z.removeEventListener(J,ae,oe)}),p=[]}function M(x){var z,J=!1;if(!(!b.state.isEnabled||It(x)||l)){var ae=((z=u)==null?void 0:z.type)==="focus";u=x,m=x.currentTarget,K(),!b.state.isVisible&&$0(x)&&Ci.forEach(function(oe){return oe(x)}),x.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?J=!0:Kt(x),x.type==="click"&&(s=!J),J&&!ae&&xt(x)}}function D(x){var z=x.target,J=N().contains(z)||v.contains(z);if(!(x.type==="mousemove"&&J)){var ae=ut().concat(v).map(function(oe){var qe,dt=oe._tippy,Zn=(qe=dt.popperInstance)==null?void 0:qe.state;return Zn?{popperRect:oe.getBoundingClientRect(),popperState:Zn,props:t}:null}).filter(Boolean);_0(ae,x)&&(ee(),xt(x))}}function V(x){var z=It(x)||b.props.trigger.indexOf("click")>=0&&s;if(!z){if(b.props.interactive){b.hideWithInteractivity(x);return}xt(x)}}function Dt(x){b.props.trigger.indexOf("focusin")<0&&x.target!==N()||b.props.interactive&&x.relatedTarget&&v.contains(x.relatedTarget)||xt(x)}function It(x){return Bt.isTouch?q()!==x.type.indexOf("touch")>=0:!1}function Ut(){qt();var x=b.props,z=x.popperOptions,J=x.placement,ae=x.offset,oe=x.getReferenceClientRect,qe=x.moveTransition,dt=S()?sl(v).arrow:null,Zn=oe?{getBoundingClientRect:oe,contextElement:oe.contextElement||N()}:n,da={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(bi){var er=bi.state;if(S()){var Mf=B(),Zo=Mf.box;["placement","reference-hidden","escaped"].forEach(function(yi){yi==="placement"?Zo.setAttribute("data-placement",er.placement):er.attributes.popper["data-popper-"+yi]?Zo.setAttribute("data-"+yi,""):Zo.removeAttribute("data-"+yi)}),er.attributes.popper={}}}},In=[{name:"offset",options:{offset:ae}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!qe}},da];S()&&dt&&In.push({name:"arrow",options:{element:dt,padding:3}}),In.push.apply(In,(z==null?void 0:z.modifiers)||[]),b.popperInstance=A0(Zn,v,Object.assign({},z,{placement:J,onFirstUpdate:f,modifiers:In}))}function qt(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function ot(){var x=b.props.appendTo,z,J=N();b.props.interactive&&x===Yd||x==="parent"?z=J.parentNode:z=Xd(x,[J]),z.contains(v)||z.appendChild(v),b.state.isMounted=!0,Ut()}function ut(){return to(v.querySelectorAll("[data-tippy-root]"))}function Kt(x){b.clearDelayTimeouts(),x&&_("onTrigger",[b,x]),me();var z=L(!0),J=H(),ae=J[0],oe=J[1];Bt.isTouch&&ae==="hold"&&oe&&(z=oe),z?r=setTimeout(function(){b.show()},z):b.show()}function xt(x){if(b.clearDelayTimeouts(),_("onUntrigger",[b,x]),!b.state.isVisible){Ue();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(x.type)>=0&&s)){var z=L(!1);z?i=setTimeout(function(){b.state.isVisible&&b.hide()},z):o=requestAnimationFrame(function(){b.hide()})}}function Jt(){b.state.isEnabled=!0}function nn(){b.hide(),b.state.isEnabled=!1}function rn(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function on(x){if(!b.state.isDestroyed){_("onBeforeUpdate",[b,x]),Nn();var z=b.props,J=$c(n,Object.assign({},z,Ic(x),{ignoreAttributes:!0}));b.props=J,Nt(),z.interactiveDebounce!==J.interactiveDebounce&&(ee(),h=Nc(D,J.interactiveDebounce)),z.triggerTarget&&!J.triggerTarget?sr(z.triggerTarget).forEach(function(ae){ae.removeAttribute("aria-expanded")}):J.triggerTarget&&n.removeAttribute("aria-expanded"),K(),R(),O&&O(z,J),b.popperInstance&&(Ut(),ut().forEach(function(ae){requestAnimationFrame(ae._tippy.popperInstance.forceUpdate)})),_("onAfterUpdate",[b,x])}}function Dn(x){b.setProps({content:x})}function Er(){var x=b.state.isVisible,z=b.state.isDestroyed,J=!b.state.isEnabled,ae=Bt.isTouch&&!b.props.touch,oe=Cs(b.props.duration,0,Tt.duration);if(!(x||z||J||ae)&&!N().hasAttribute("disabled")&&(_("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,S()&&(v.style.visibility="visible"),R(),me(),b.state.isMounted||(v.style.transition="none"),S()){var qe=B(),dt=qe.box,Zn=qe.content;Ms([dt,Zn],0)}f=function(){var In;if(!(!b.state.isVisible||c)){if(c=!0,v.offsetHeight,v.style.transition=b.props.moveTransition,S()&&b.props.animation){var Qo=B(),bi=Qo.box,er=Qo.content;Ms([bi,er],oe),Rc([bi,er],"visible")}$(),K(),Dc(Os,b),(In=b.popperInstance)==null||In.forceUpdate(),_("onMount",[b]),b.props.animation&&S()&&rt(oe,function(){b.state.isShown=!0,_("onShown",[b])})}},ot()}}function Ar(){var x=!b.state.isVisible,z=b.state.isDestroyed,J=!b.state.isEnabled,ae=Cs(b.props.duration,1,Tt.duration);if(!(x||z||J)&&(_("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,c=!1,s=!1,S()&&(v.style.visibility="hidden"),ee(),Ue(),R(!0),S()){var oe=B(),qe=oe.box,dt=oe.content;b.props.animation&&(Ms([qe,dt],ae),Rc([qe,dt],"hidden"))}$(),K(),b.props.animation?S()&&ze(ae,b.unmount):b.unmount()}}function Nr(x){P().addEventListener("mousemove",h),Dc(Ci,h),h(x)}function Dr(){b.state.isVisible&&b.hide(),b.state.isMounted&&(qt(),ut().forEach(function(x){x._tippy.unmount()}),v.parentNode&&v.parentNode.removeChild(v),Os=Os.filter(function(x){return x!==b}),b.state.isMounted=!1,_("onHidden",[b]))}function gi(){b.state.isDestroyed||(b.clearDelayTimeouts(),b.unmount(),Nn(),delete n._tippy,b.state.isDestroyed=!0,_("onDestroy",[b]))}}function mi(n,e){e===void 0&&(e={});var t=Tt.plugins.concat(e.plugins||[]);j0();var r=Object.assign({},e,{plugins:t}),i=z0(n),o=i.reduce(function(s,l){var a=l&&Z0(l,r);return a&&s.push(a),s},[]);return Yo(n)?o[0]:o}mi.defaultProps=Tt;mi.setDefaultProps=G0;mi.currentInput=Bt;Object.assign({},Fd,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});mi.setDefaultProps({render:ef});class ev{constructor({editor:e,element:t,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:a,from:c,to:u})=>{const{doc:d,selection:f}=a,{empty:p}=f,h=!d.textBetween(c,u).length&&Hl(a.selection),m=this.element.contains(document.activeElement);return!(!(l.hasFocus()||m)||p||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var a;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,a)=>{const c=!(a!=null&&a.selection.eq(l.state.selection)),u=!(a!=null&&a.doc.eq(l.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,c,u,a)},this.updateDelay))},this.updateHandler=(l,a,c,u)=>{var d,f,p;const{state:h,composing:m}=l,{selection:g}=h;if(m||!a&&!c)return;this.createTooltip();const{ranges:k}=g,C=Math.min(...k.map(v=>v.$from.pos)),b=Math.max(...k.map(v=>v.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,view:l,state:h,oldState:u,from:C,to:b}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(Jg(h.selection)){let v=l.nodeDOM(C);const O=v.dataset.nodeViewWrapper?v:v.querySelector("[data-node-view-wrapper]");if(O&&(v=O.firstChild),v)return v.getBoundingClientRect()}return Gg(l,C,b)})}),this.show()},this.editor=e,this.element=t,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=mi(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,t);return}const o=!(t!=null&&t.selection.eq(e.state.selection)),s=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,o,s,t)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const tv=n=>new We({key:typeof n.pluginKey=="string"?new wt(n.pluginKey):n.pluginKey,view:e=>new ev({view:e,...n})}),nv=nt.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[tv({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}}),rv="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",iv="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Cr=(n,e)=>{for(const t in e)n[t]=e[t];return n},ll="numeric",al="ascii",cl="alpha",Li="asciinumeric",Mi="alphanumeric",ul="domain",tf="emoji",ov="scheme",sv="slashscheme",Fc="whitespace";function lv(n,e){return n in e||(e[n]=[]),e[n]}function Bn(n,e,t){e[ll]&&(e[Li]=!0,e[Mi]=!0),e[al]&&(e[Li]=!0,e[cl]=!0),e[Li]&&(e[Mi]=!0),e[cl]&&(e[Mi]=!0),e[Mi]&&(e[ul]=!0),e[tf]&&(e[ul]=!0);for(const r in e){const i=lv(r,t);i.indexOf(n)<0&&i.push(n)}}function av(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function Qe(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}Qe.groups={};Qe.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;rn.ta(e,t,r,i),ft=(n,e,t,r,i)=>n.tr(e,t,r,i),_c=(n,e,t,r,i)=>n.ts(e,t,r,i),A=(n,e,t,r,i)=>n.tt(e,t,r,i),Xt="WORD",dl="UWORD",ai="LOCALHOST",fl="TLD",pl="UTLD",$i="SCHEME",lr="SLASH_SCHEME",ta="NUM",nf="WS",na="NL",Gr="OPENBRACE",Yr="CLOSEBRACE",no="OPENBRACKET",ro="CLOSEBRACKET",io="OPENPAREN",oo="CLOSEPAREN",so="OPENANGLEBRACKET",lo="CLOSEANGLEBRACKET",ao="FULLWIDTHLEFTPAREN",co="FULLWIDTHRIGHTPAREN",uo="LEFTCORNERBRACKET",fo="RIGHTCORNERBRACKET",po="LEFTWHITECORNERBRACKET",ho="RIGHTWHITECORNERBRACKET",mo="FULLWIDTHLESSTHAN",go="FULLWIDTHGREATERTHAN",bo="AMPERSAND",yo="APOSTROPHE",vo="ASTERISK",pn="AT",ko="BACKSLASH",wo="BACKTICK",xo="CARET",mn="COLON",ra="COMMA",So="DOLLAR",Pt="DOT",Co="EQUALS",ia="EXCLAMATION",Lt="HYPHEN",Mo="PERCENT",To="PIPE",Oo="PLUS",Eo="POUND",Ao="QUERY",oa="QUOTE",sa="SEMI",$t="SLASH",Xr="TILDE",No="UNDERSCORE",rf="EMOJI",Do="SYM";var of=Object.freeze({__proto__:null,WORD:Xt,UWORD:dl,LOCALHOST:ai,TLD:fl,UTLD:pl,SCHEME:$i,SLASH_SCHEME:lr,NUM:ta,WS:nf,NL:na,OPENBRACE:Gr,CLOSEBRACE:Yr,OPENBRACKET:no,CLOSEBRACKET:ro,OPENPAREN:io,CLOSEPAREN:oo,OPENANGLEBRACKET:so,CLOSEANGLEBRACKET:lo,FULLWIDTHLEFTPAREN:ao,FULLWIDTHRIGHTPAREN:co,LEFTCORNERBRACKET:uo,RIGHTCORNERBRACKET:fo,LEFTWHITECORNERBRACKET:po,RIGHTWHITECORNERBRACKET:ho,FULLWIDTHLESSTHAN:mo,FULLWIDTHGREATERTHAN:go,AMPERSAND:bo,APOSTROPHE:yo,ASTERISK:vo,AT:pn,BACKSLASH:ko,BACKTICK:wo,CARET:xo,COLON:mn,COMMA:ra,DOLLAR:So,DOT:Pt,EQUALS:Co,EXCLAMATION:ia,HYPHEN:Lt,PERCENT:Mo,PIPE:To,PLUS:Oo,POUND:Eo,QUERY:Ao,QUOTE:oa,SEMI:sa,SLASH:$t,TILDE:Xr,UNDERSCORE:No,EMOJI:rf,SYM:Do});const rr=/[a-z]/,Es=new RegExp("\\p{L}","u"),As=new RegExp("\\p{Emoji}","u"),Ns=/\d/,Hc=/\s/,Vc=` +`,cv="️",uv="‍";let Ti=null,Oi=null;function dv(n){n===void 0&&(n=[]);const e={};Qe.groups=e;const t=new Qe;Ti==null&&(Ti=jc(rv)),Oi==null&&(Oi=jc(iv)),A(t,"'",yo),A(t,"{",Gr),A(t,"}",Yr),A(t,"[",no),A(t,"]",ro),A(t,"(",io),A(t,")",oo),A(t,"<",so),A(t,">",lo),A(t,"(",ao),A(t,")",co),A(t,"「",uo),A(t,"」",fo),A(t,"『",po),A(t,"』",ho),A(t,"<",mo),A(t,">",go),A(t,"&",bo),A(t,"*",vo),A(t,"@",pn),A(t,"`",wo),A(t,"^",xo),A(t,":",mn),A(t,",",ra),A(t,"$",So),A(t,".",Pt),A(t,"=",Co),A(t,"!",ia),A(t,"-",Lt),A(t,"%",Mo),A(t,"|",To),A(t,"+",Oo),A(t,"#",Eo),A(t,"?",Ao),A(t,'"',oa),A(t,"/",$t),A(t,";",sa),A(t,"~",Xr),A(t,"_",No),A(t,"\\",ko);const r=ft(t,Ns,ta,{[ll]:!0});ft(r,Ns,r);const i=ft(t,rr,Xt,{[al]:!0});ft(i,rr,i);const o=ft(t,Es,dl,{[cl]:!0});ft(o,rr),ft(o,Es,o);const s=ft(t,Hc,nf,{[Fc]:!0});A(t,Vc,na,{[Fc]:!0}),A(s,Vc),ft(s,Hc,s);const l=ft(t,As,rf,{[tf]:!0});ft(l,As,l),A(l,cv,l);const a=A(l,uv);ft(a,As,l);const c=[[rr,i]],u=[[rr,null],[Es,o]];for(let d=0;dd[0]>f[0]?1:-1);for(let d=0;d=0?h[ul]=!0:rr.test(f)?Ns.test(f)?h[Li]=!0:h[al]=!0:h[ll]=!0,_c(t,f,f,h)}return _c(t,"localhost",ai,{ascii:!0}),t.jd=new Qe(Do),{start:t,tokens:Cr({groups:e},of)}}function fv(n,e){const t=pv(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,i=[];let o=0,s=0;for(;s=0&&(d+=t[s].length,f++),c+=t[s].length,o+=t[s].length,s++;o-=d,s-=f,c-=d,i.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function pv(n){const e=[],t=n.length;let r=0;for(;r56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(s),r+=s.length}return e}function sn(n,e,t,r,i){let o;const s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(t.join(""));for(let s=parseInt(n.substring(r,r+o),10);s>0;s--)t.pop();r+=o}else t.push(n[r]),r++}return e}const ci={defaultProtocol:"http",events:null,format:Wc,formatHref:Wc,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function la(n,e){e===void 0&&(e=null);let t=Cr({},ci);n&&(t=Cr(t,n instanceof la?n.o:n));const r=t.ignoreTags,i=[];for(let o=0;ot?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n){return n===void 0&&(n=ci.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),s={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),u&&Cr(s,u),{tagName:i,attributes:s,content:o,eventListeners:d}}};function Xo(n,e){class t extends sf{constructor(i,o){super(i,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const Uc=Xo("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),qc=Xo("text"),hv=Xo("nl"),Ei=Xo("url",{isLink:!0,toHref(n){return n===void 0&&(n=ci.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==ai&&n[1].t===mn}}),pt=n=>new Qe(n);function mv(n){let{groups:e}=n;const t=e.domain.concat([bo,vo,pn,ko,wo,xo,So,Co,Lt,ta,Mo,To,Oo,Eo,$t,Do,Xr,No]),r=[yo,mn,ra,Pt,ia,Ao,oa,sa,so,lo,Gr,Yr,ro,no,io,oo,ao,co,uo,fo,po,ho,mo,go],i=[bo,yo,vo,ko,wo,xo,So,Co,Lt,Gr,Yr,Mo,To,Oo,Eo,Ao,$t,Do,Xr,No],o=pt(),s=A(o,Xr);X(s,i,s),X(s,e.domain,s);const l=pt(),a=pt(),c=pt();X(o,e.domain,l),X(o,e.scheme,a),X(o,e.slashscheme,c),X(l,i,s),X(l,e.domain,l);const u=A(l,pn);A(s,pn,u),A(a,pn,u),A(c,pn,u);const d=A(s,Pt);X(d,i,s),X(d,e.domain,s);const f=pt();X(u,e.domain,f),X(f,e.domain,f);const p=A(f,Pt);X(p,e.domain,f);const h=pt(Uc);X(p,e.tld,h),X(p,e.utld,h),A(u,ai,h);const m=A(f,Lt);X(m,e.domain,f),X(h,e.domain,f),A(h,Pt,p),A(h,Lt,m);const g=A(h,mn);X(g,e.numeric,Uc);const y=A(l,Lt),k=A(l,Pt);X(y,e.domain,l),X(k,i,s),X(k,e.domain,l);const C=pt(Ei);X(k,e.tld,C),X(k,e.utld,C),X(C,e.domain,l),X(C,i,s),A(C,Pt,k),A(C,Lt,y),A(C,pn,u);const b=A(C,mn),E=pt(Ei);X(b,e.numeric,E);const v=pt(Ei),O=pt();X(v,t,v),X(v,r,O),X(O,t,v),X(O,r,O),A(C,$t,v),A(E,$t,v);const W=A(a,mn),w=A(c,mn),H=A(w,$t),q=A(H,$t);X(a,e.domain,l),A(a,Pt,k),A(a,Lt,y),X(c,e.domain,l),A(c,Pt,k),A(c,Lt,y),X(W,e.domain,v),A(W,$t,v),X(q,e.domain,v),X(q,t,v),A(q,$t,v);const S=[[Gr,Yr],[no,ro],[io,oo],[so,lo],[ao,co],[uo,fo],[po,ho],[mo,go]];for(let N=0;N=0&&f++,i++,u++;if(f<0)i-=u,i0&&(o.push(Ds(qc,e,s)),s=[]),i-=f,u-=f;const p=d.t,h=t.slice(i-u,i);o.push(Ds(p,e,h))}}return s.length>0&&o.push(Ds(qc,e,s)),o}function Ds(n,e,t){const r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}const bv=typeof console<"u"&&console&&console.warn||(()=>{}),yv="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ke={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function vv(){Qe.groups={},ke.scanner=null,ke.parser=null,ke.tokenQueue=[],ke.pluginQueue=[],ke.customSchemes=[],ke.initialized=!1}function Kc(n,e){if(e===void 0&&(e=!1),ke.initialized&&bv(`linkifyjs: already initialized - will not register custom scheme "${n}" ${yv}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" -3. "-" cannot repeat`);ke.customSchemes.push([n,e])}function kv(){ke.scanner=dv(ke.customSchemes);for(let n=0;n{const i=e.some(c=>c.docChanged)&&!t.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,l=$g(t.doc,[...e]);if(Ug(l).forEach(({newRange:c})=>{const u=zg(r.doc,c,p=>p.isTextblock);let d,f;if(u.length>1?(d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&f){const p=f.split(" ").filter(g=>g!=="");if(p.length<=0)return!1;const h=p[p.length-1],m=d.pos+f.lastIndexOf(h);if(!h)return!1;aa(h).filter(g=>g.isLink).map(g=>({...g,from:m+g.start+1,to:m+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>n.validate?n.validate(g.value):!0).forEach(g=>{Ul(g.from,g.to,r.doc).some(y=>y.mark.type===n.type)||s.addMark(g.from,g.to,n.type.create({href:g.href}))})}}),!!s.steps.length)return s}})}function Sv(n){return new We({key:new wt("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const l=Id(e.state,n.type.name),a=r.target,c=(i=a==null?void 0:a.href)!==null&&i!==void 0?i:l.href,u=(o=a==null?void 0:a.target)!==null&&o!==void 0?o:l.target;return a&&c?(e.editable&&window.open(c,u),!0):!1}}})}function Cv(n){return new We({key:new wt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const a=aa(l).find(c=>c.isLink&&c.value===l);return!l||!a?!1:(n.editor.commands.setMark(n.type,{href:a.href}),!0)}}})}const Mv=Et.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){Kc(n);return}Kc(n.scheme,n.optionalSlashes)})},onDestroy(){vv()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:n}){var e;return!((e=n.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",Me(this.options.HTMLAttributes,{...n,href:""}),0]:["a",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setLink:n=>({chain:e})=>e().setMark(this.name,n).setMeta("preventAutolink",!0).run(),toggleLink:n=>({chain:e})=>e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Yn({find:(n,e)=>{var t;const r=(t=e==null?void 0:e.clipboardData)===null||t===void 0?void 0:t.getData("text/html"),i=[];if(r){const o=new DOMParser().parseFromString(r,"text/html"),s=o.querySelectorAll("a");s.length&&[...s].forEach(l=>i.push({text:l.innerText,data:{href:l.getAttribute("href")},index:o.body.innerText.indexOf(l.innerText)+l.innerText.length}))}if(n){const o=aa(n).filter(s=>s.isLink);o.length&&o.forEach(s=>i.push({text:s.value,data:{href:s.href},index:s.start}))}return i},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(xv({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(Sv({type:this.type})),this.options.linkOnPaste&&n.push(Cv({editor:this.editor,type:this.type})),n}});function Tv(n){return Object.keys(n).reduce((e,t)=>n[t]===void 0?e:e+`${t}:${n[t]};`,"")}Tv({position:"absolute",opacity:0,"pointer-events":"none",margin:0,transform:"translateX(-100%)"});function lf(n,e,t,r){const i=Array.isArray(e)?e:[e];return i.forEach(o=>n.addEventListener(o,t,r)),()=>{i.forEach(o=>n.removeEventListener(o,t,r))}}const Ov={ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",A:"a",P:"p"};uu(void 0,n=>{function e(r){n(r),n(void 0)}return lf(document,"pointerup",e,{passive:!1,capture:!0})});uu(void 0,n=>{function e(r){r&&r.key===Ov.ESCAPE&&n(r),n(void 0)}return lf(document,"keydown",e,{passive:!1})});function Av(n,e){const t=[];return e.builders.forEach(r=>{const i=r.action(n);i&&t.push(i)}),{destroy:()=>{t.forEach(r=>{r.destroy&&r.destroy()})}}}function Jc(n){const e={};return n.forEach(t=>{Object.keys(t).forEach(r=>{r!=="action"&&(e[r]=t[r])})}),e}function Ev(n){let e=n[1]?"a":"button",t,r,i=(n[1]?"a":"button")&&Is(n);return{c(){i&&i.c(),t=hr()},l(o){i&&i.l(o),t=hr()},m(o,s){i&&i.m(o,s),ne(o,t,s),r=!0},p(o,s){o[1],e?Mr(e,o[1]?"a":"button")?(i.d(1),i=Is(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t)):i.p(o,s):(i=Is(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t))},i(o){r||(se(i,o),r=!0)},o(o){le(i,o),r=!1},d(o){o&&U(t),i&&i.d(o)}}}function Nv(n){let e=n[1]?"a":"button",t,r,i=(n[1]?"a":"button")&&Rs(n);return{c(){i&&i.c(),t=hr()},l(o){i&&i.l(o),t=hr()},m(o,s){i&&i.m(o,s),ne(o,t,s),r=!0},p(o,s){o[1],e?Mr(e,o[1]?"a":"button")?(i.d(1),i=Rs(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t)):i.p(o,s):(i=Rs(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t))},i(o){r||(se(i,o),r=!0)},o(o){le(i,o),r=!1},d(o){o&&U(t),i&&i.d(o)}}}function Is(n){let e,t,r,i,o;const s=n[7].default,l=kl(s,n,n[6],null);let a=[{type:t=n[1]?void 0:n[2]},{href:n[1]},{tabindex:"0"},n[5],n[4]],c={};for(let u=0;u{s[u]=null}),cu(),t=s[e],t?t.p(a,c):(t=s[e]=o[e](a),t.c()),se(t,1),t.m(r.parentNode,r))},i(a){i||(se(t),i=!0)},o(a){le(t),i=!1},d(a){a&&U(r),s[e].d(a)}}}function Iv(n,e,t){const r=["href","type","builders","el"];let i=Bi(e,r),{$$slots:o={},$$scope:s}=e,{href:l=void 0}=e,{type:a=void 0}=e,{builders:c=[]}=e,{el:u=void 0}=e;const d={"data-button-root":""};function f(w){Xe.call(this,n,w)}function p(w){Xe.call(this,n,w)}function h(w){Xe.call(this,n,w)}function m(w){Xe.call(this,n,w)}function g(w){Xe.call(this,n,w)}function y(w){Xe.call(this,n,w)}function k(w){Xe.call(this,n,w)}function C(w){Xe.call(this,n,w)}function b(w){Xe.call(this,n,w)}function A(w){Xe.call(this,n,w)}function v(w){Xe.call(this,n,w)}function O(w){Xe.call(this,n,w)}function W(w){Ls[w?"unshift":"push"](()=>{u=w,t(0,u)})}return n.$$set=w=>{e=qn(qn({},e),lu(w)),t(5,i=Bi(e,r)),"href"in w&&t(1,l=w.href),"type"in w&&t(2,a=w.type),"builders"in w&&t(3,c=w.builders),"el"in w&&t(0,u=w.el),"$$scope"in w&&t(6,s=w.$$scope)},[u,l,a,c,d,i,s,o,f,p,h,m,g,y,k,C,b,A,v,O,W]}let Rv=class extends Po{constructor(e){super(),Lo(this,e,Iv,Dv,Mr,{href:1,type:2,builders:3,el:0})}};function af(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;el(o)))==null?void 0:s.classGroupId}const Gc=/^\[(.+)\]$/;function $v(n){if(Gc.test(n)){const e=Gc.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}}function Bv(n){const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return Fv(Object.entries(n.classGroups),t).forEach(([o,s])=>{hl(s,r,o,e)}),r}function hl(n,e,t,r){n.forEach(i=>{if(typeof i=="string"){const o=i===""?e:Yc(e,i);o.classGroupId=t;return}if(typeof i=="function"){if(zv(i)){hl(i(r),e,t,r);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([o,s])=>{hl(s,Yc(e,o),t,r)})})}function Yc(n,e){let t=n;return e.split(ca).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t}function zv(n){return n.isThemeGetter}function Fv(n,e){return e?n.map(([t,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,l])=>[e+s,l])):o);return[t,i]}):n}function _v(n){if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;function i(o,s){t.set(o,s),e++,e>n&&(e=0,r=t,t=new Map)}return{get(o){let s=t.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){t.has(o)?t.set(o,s):i(o,s)}}}const uf="!";function Hv(n){const e=n.separator,t=e.length===1,r=e[0],i=e.length;return function(s){const l=[];let a=0,c=0,u;for(let m=0;mc?u-c:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}}}function Vv(n){if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e}function jv(n){return{cache:_v(n.cacheSize),splitModifiers:Hv(n),...Lv(n)}}const Wv=/\s+/;function Uv(n,e){const{splitModifiers:t,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=new Set;return n.trim().split(Wv).map(s=>{const{modifiers:l,hasImportantModifier:a,baseClassName:c,maybePostfixModifierPosition:u}=t(s);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};f=!1}const p=Vv(l).join(":");return{isTailwindClass:!0,modifierId:a?p+uf:p,classGroupId:d,originalClassName:s,hasPostfixModifier:f}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:l,classGroupId:a,hasPostfixModifier:c}=s,u=l+a;return o.has(u)?!1:(o.add(u),i(a,c).forEach(d=>o.add(l+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function qv(){let n=0,e,t,r="";for(;nd(u),n());return t=jv(c),r=t.cache.get,i=t.cache.set,o=l,l(a)}function l(a){const c=r(a);if(c)return c;const u=Uv(a,t);return i(a,u),u}return function(){return o(qv.apply(null,arguments))}}function pe(n){const e=t=>t[n]||[];return e.isThemeGetter=!0,e}const ff=/^\[(?:([a-z-]+):)?(.+)\]$/i,Jv=/^\d+\/\d+$/,Gv=new Set(["px","full","screen"]),Yv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Qv=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Yt(n){return zn(n)||Gv.has(n)||Jv.test(n)}function ln(n){return Or(n,"length",l1)}function zn(n){return!!n&&!Number.isNaN(Number(n))}function Ei(n){return Or(n,"number",zn)}function Pr(n){return!!n&&Number.isInteger(Number(n))}function e1(n){return n.endsWith("%")&&zn(n.slice(0,-1))}function Y(n){return ff.test(n)}function an(n){return Yv.test(n)}const t1=new Set(["length","size","percentage"]);function n1(n){return Or(n,t1,pf)}function r1(n){return Or(n,"position",pf)}const i1=new Set(["image","url"]);function o1(n){return Or(n,i1,c1)}function s1(n){return Or(n,"",a1)}function Lr(){return!0}function Or(n,e,t){const r=ff.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1}function l1(n){return Xv.test(n)}function pf(){return!1}function a1(n){return Qv.test(n)}function c1(n){return Zv.test(n)}function u1(){const n=pe("colors"),e=pe("spacing"),t=pe("blur"),r=pe("brightness"),i=pe("borderColor"),o=pe("borderRadius"),s=pe("borderSpacing"),l=pe("borderWidth"),a=pe("contrast"),c=pe("grayscale"),u=pe("hueRotate"),d=pe("invert"),f=pe("gap"),p=pe("gradientColorStops"),h=pe("gradientColorStopPositions"),m=pe("inset"),g=pe("margin"),y=pe("opacity"),k=pe("padding"),C=pe("saturate"),b=pe("scale"),A=pe("sepia"),v=pe("skew"),O=pe("space"),W=pe("translate"),w=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",Y,e],S=()=>[Y,e],N=()=>["",Yt,ln],P=()=>["auto",zn,Y],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],R=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],_=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",Y],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ee=()=>[zn,Ei],ie=()=>[zn,Y];return{cacheSize:500,separator:":",theme:{colors:[Lr],spacing:[Yt,ln],blur:["none","",an,Y],brightness:ee(),borderColor:[n],borderRadius:["none","","full",an,Y],borderSpacing:S(),borderWidth:N(),contrast:ee(),grayscale:$(),hueRotate:ie(),invert:$(),gap:S(),gradientColorStops:[n],gradientColorStopPositions:[e1,ln],inset:q(),margin:q(),opacity:ee(),padding:S(),saturate:ee(),scale:ee(),sepia:$(),skew:ie(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[an]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),Y]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:w()}],"overscroll-x":[{"overscroll-x":w()}],"overscroll-y":[{"overscroll-y":w()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pr,Y]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Y]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",Pr,Y]}],"grid-cols":[{"grid-cols":[Lr]}],"col-start-end":[{col:["auto",{span:["full",Pr,Y]},Y]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[Lr]}],"row-start-end":[{row:["auto",{span:[Pr,Y]},Y]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Y]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Y,e]}],"min-w":[{"min-w":[Y,e,"min","max","fit"]}],"max-w":[{"max-w":[Y,e,"none","full","min","max","fit","prose",{screen:[an]},an]}],h:[{h:[Y,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Y,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Y,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Y,e,"auto","min","max","fit"]}],"font-size":[{text:["base",an,ln]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ei]}],"font-family":[{font:[Lr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Y]}],"line-clamp":[{"line-clamp":["none",zn,Ei]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Yt,Y]}],"list-image":[{"list-image":["none",Y]}],"list-style-type":[{list:["none","disc","decimal",Y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Yt,ln]}],"underline-offset":[{"underline-offset":["auto",Yt,Y]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),r1]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",n1]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},o1]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:L()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[Yt,Y]}],"outline-w":[{outline:[Yt,ln]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Yt,ln]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",an,s1]}],"shadow-color":[{shadow:[Lr]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":R()}],"bg-blend":[{"bg-blend":R()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",an,Y]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[C]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Y]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",Y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Pr,Y]}],"translate-x":[{"translate-x":[W]}],"translate-y":[{"translate-y":[W]}],"skew-x":[{"skew-x":[v]}],"skew-y":[{"skew-y":[v]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Y]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Y]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Y]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Yt,ln,Ei]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const d1=Kv(u1);function Xc(...n){return d1(Pv(n))}function f1(n){let e;const t=n[5].default,r=kl(t,n,n[8],null);return{c(){r&&r.c()},l(i){r&&r.l(i)},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&256)&&wl(r,t,i,i[8],e?Sl(t,i[8],o,null):xl(i[8]),null)},i(i){e||(se(r,i),e=!0)},o(i){le(r,i),e=!1},d(i){r&&r.d(i)}}}function p1(n){let e,t;const r=[{builders:n[3]},{class:Xc(iu({variant:n[1],size:n[2],className:n[0]}))},{type:"button"},n[4]];let i={$$slots:{default:[f1]},$$scope:{ctx:n}};for(let o=0;o{e=qn(qn({},e),lu(p)),t(4,i=Bi(e,r)),"class"in p&&t(0,l=p.class),"variant"in p&&t(1,a=p.variant),"size"in p&&t(2,c=p.size),"builders"in p&&t(3,u=p.builders),"$$scope"in p&&t(8,s=p.$$scope)},[l,a,c,u,i,o,d,f,s]}class xe extends Po{constructor(e){super(),Lo(this,e,h1,p1,Mr,{class:0,variant:1,size:2,builders:3})}}var Qc=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,st=n=>!n||typeof n!="object"||Object.keys(n).length===0,m1=(n,e)=>JSON.stringify(n)===JSON.stringify(e);function hf(n,e){n.forEach(function(t){Array.isArray(t)?hf(t,e):e.push(t)})}function mf(n){let e=[];return hf(n,e),e}var gf=(...n)=>mf(n).filter(Boolean),bf=(n,e)=>{let t={},r=Object.keys(n),i=Object.keys(e);for(let o of r)if(i.includes(o)){let s=n[o],l=e[o];typeof s=="object"&&typeof l=="object"?t[o]=bf(s,l):Array.isArray(s)||Array.isArray(l)?t[o]=gf(l,s):t[o]=l+" "+s}else t[o]=n[o];for(let o of i)r.includes(o)||(t[o]=e[o]);return t},Zc=n=>!n||typeof n!="string"?n:n.replace(/\s+/g," ").trim();function g1(){for(var n=0,e,t,r="";nn&&(e=0,r=t,t=new Map)}return{get:function(s){var l=t.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return i(s,l),l},set:function(s,l){t.has(s)?t.set(s,l):i(s,l)}}}var kf="!";function S1(n){var e=n.separator||":",t=e.length===1,r=e[0],i=e.length;return function(s){for(var l=[],a=0,c=0,u,d=0;dc?u-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}}}function C1(n){if(n.length<=1)return n;var e=[],t=[];return n.forEach(function(r){var i=r[0]==="[";i?(e.push.apply(e,t.sort().concat([r])),t=[]):t.push(r)}),e.push.apply(e,t.sort()),e}function M1(n){return{cache:x1(n.cacheSize),splitModifiers:S1(n),...b1(n)}}var T1=/\s+/;function O1(n,e){var t=e.splitModifiers,r=e.getClassGroupId,i=e.getConflictingClassGroupIds,o=new Set;return n.trim().split(T1).map(function(s){var l=t(s),a=l.modifiers,c=l.hasImportantModifier,u=l.baseClassName,d=l.maybePostfixModifierPosition,f=r(d?u.substring(0,d):u),p=!!d;if(!f){if(!d)return{isTailwindClass:!1,originalClassName:s};if(f=r(u),!f)return{isTailwindClass:!1,originalClassName:s};p=!1}var h=C1(a).join(":"),m=c?h+kf:h;return{isTailwindClass:!0,modifierId:m,classGroupId:f,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(function(s){if(!s.isTailwindClass)return!0;var l=s.modifierId,a=s.classGroupId,c=s.hasPostfixModifier,u=l+a;return o.has(u)?!1:(o.add(u),i(a,c).forEach(function(d){return o.add(l+d)}),!0)}).reverse().map(function(s){return s.originalClassName}).join(" ")}function gl(){for(var n=arguments.length,e=new Array(n),t=0;t1?e-1:0),r=1;rn||void 0,ui=(...n)=>Cf(mf(n).filter(Boolean).join(" ")),Ps=null,Io={},vl=!1,zr=(...n)=>e=>e.twMerge?((!Ps||vl)&&(vl=!1,Ps=st(Io)?U1:W1(Io)),Cf(Ps(ui(n)))):ui(n),ru=(n,e)=>{for(let t in e)n.hasOwnProperty(t)?n[t]=ui(n[t],e[t]):n[t]=e[t];return n},K1=(n,e)=>{let{extend:t=null,slots:r={},variants:i={},compoundVariants:o=[],compoundSlots:s=[],defaultVariants:l={}}=n,a={...q1,...e},c=t!=null&&t.base?ui(t.base,n==null?void 0:n.base):n==null?void 0:n.base,u=t!=null&&t.variants&&!st(t.variants)?bf(i,t.variants):i,d=t!=null&&t.defaultVariants&&!st(t.defaultVariants)?{...t.defaultVariants,...l}:l;!st(a.twMergeConfig)&&!m1(a.twMergeConfig,Io)&&(vl=!0,Io=a.twMergeConfig);let f=st(t==null?void 0:t.slots),p=st(r)?{}:{base:ui(n==null?void 0:n.base,f&&(t==null?void 0:t.base)),...r},h=f?p:ru({...t==null?void 0:t.slots},st(p)?{base:n==null?void 0:n.base}:p),m=y=>{if(st(u)&&st(r)&&f)return zr(c,y==null?void 0:y.class,y==null?void 0:y.className)(a);if(o&&!Array.isArray(o))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof o}`);if(s&&!Array.isArray(s))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof s}`);let k=(S,N,P=[],B)=>{let L=P;if(typeof N=="string")L=L.concat(Zc(N).split(" ").map(R=>`${S}:${R}`));else if(Array.isArray(N))L=L.concat(N.reduce((R,_)=>R.concat(`${S}:${_}`),[]));else if(typeof N=="object"&&typeof B=="string"){for(let R in N)if(N.hasOwnProperty(R)&&R===B){let _=N[R];if(_&&typeof _=="string"){let $=Zc(_);L[B]?L[B]=L[B].concat($.split(" ").map(K=>`${S}:${K}`)):L[B]=$.split(" ").map(K=>`${S}:${K}`)}else Array.isArray(_)&&_.length>0&&(L[B]=_.reduce(($,K)=>$.concat(`${S}:${K}`),[]))}}return L},C=(S,N=u,P=null,B=null)=>{var L;let R=N[S];if(!R||st(R))return null;let _=(L=B==null?void 0:B[S])!=null?L:y==null?void 0:y[S];if(_===null)return null;let $=Qc(_),K=Array.isArray(a.responsiveVariants)&&a.responsiveVariants.length>0||a.responsiveVariants===!0,ee=d==null?void 0:d[S],ie=[];if(typeof $=="object"&&K)for(let[Oe,me]of Object.entries($)){let Ue=R[me];if(Oe==="initial"){ee=me;continue}Array.isArray(a.responsiveVariants)&&!a.responsiveVariants.includes(Oe)||(ie=k(Oe,Ue,ie,P))}let te=R[$]||R[Qc(ee)];return typeof ie=="object"&&typeof P=="string"&&ie[P]?ru(ie,te):ie.length>0?(ie.push(te),ie):te},b=()=>u?Object.keys(u).map(S=>C(S,u)):null,A=(S,N)=>{if(!u||typeof u!="object")return null;let P=new Array;for(let B in u){let L=C(B,u,S,N),R=S==="base"&&typeof L=="string"?L:L&&L[S];R&&(P[P.length]=R)}return P},v={};for(let S in y)y[S]!==void 0&&(v[S]=y[S]);let O=(S,N)=>{var P;let B=typeof(y==null?void 0:y[S])=="object"?{[S]:(P=y[S])==null?void 0:P.initial}:{};return{...d,...v,...B,...N}},W=(S=[],N)=>{let P=[];for(let{class:B,className:L,...R}of S){let _=!0;for(let[$,K]of Object.entries(R)){let ee=O($,N);if(Array.isArray(K)){if(!K.includes(ee[$])){_=!1;break}}else if(ee[$]!==K){_=!1;break}}_&&(B&&P.push(B),L&&P.push(L))}return P},w=S=>{let N=W(o,S),P=W(t==null?void 0:t.compoundVariants,S);return gf(P,N)},H=S=>{let N=w(S);if(!Array.isArray(N))return N;let P={};for(let B of N)if(typeof B=="string"&&(P.base=zr(P.base,B)(a)),typeof B=="object")for(let[L,R]of Object.entries(B))P[L]=zr(P[L],R)(a);return P},q=S=>{if(s.length<1)return null;let N={};for(let{slots:P=[],class:B,className:L,...R}of s){if(!st(R)){let _=!0;for(let $ of Object.keys(R)){let K=O($,S)[$];if(K===void 0||(Array.isArray(R[$])?!R[$].includes(K):R[$]!==K)){_=!1;break}}if(!_)continue}for(let _ of P)N[_]=N[_]||[],N[_].push([B,L])}return N};if(!st(r)||!f){let S={};if(typeof h=="object"&&!st(h))for(let N of Object.keys(h))S[N]=P=>{var B,L;return zr(h[N],A(N,P),((B=H(P))!=null?B:[])[N],((L=q(P))!=null?L:[])[N],P==null?void 0:P.class,P==null?void 0:P.className)(a)};return S}return zr(c,b(),w(),y==null?void 0:y.class,y==null?void 0:y.className)(a)},g=()=>{if(!(!u||typeof u!="object"))return Object.keys(u)};return m.variantKeys=g(),m.extend=t,m.base=c,m.slots=h,m.variants=u,m.defaultVariants=d,m.compoundSlots=s,m.compoundVariants=o,m};const iu=K1({base:"inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}});function ou(n){let e,t,r,i,o,s,l,a,c,u,d,f,p,h,m,g,y,k,C,b,A,v,O,W,w,H,q,S,N,P,B,L,R,_,$,K,ee,ie,te,Oe,me,Ue,ze,rt,Fe,it,Nt,Nn;return r=new xe({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[J1]},$$scope:{ctx:n}}}),r.$on("click",n[7]),o=new xe({props:{disabled:!n[1].can().chain().focus().toggleBold().run(),variant:n[1].isActive("bold")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[G1]},$$scope:{ctx:n}}}),o.$on("click",n[8]),l=new xe({props:{disabled:!n[1].can().chain().focus().toggleItalic().run(),variant:n[1].isActive("italic")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[Y1]},$$scope:{ctx:n}}}),l.$on("click",n[9]),c=new xe({props:{disabled:!n[1].can().chain().focus().toggleStrike().run(),variant:n[1].isActive("strike")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[X1]},$$scope:{ctx:n}}}),c.$on("click",n[10]),d=new xe({props:{disabled:!n[1].can().chain().focus().toggleCode().run(),variant:n[1].isActive("code")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[Q1]},$$scope:{ctx:n}}}),d.$on("click",n[11]),p=new xe({props:{variant:n[1].isActive("paragraph")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[Z1]},$$scope:{ctx:n}}}),p.$on("click",n[12]),m=new xe({props:{variant:n[1].isActive("heading",{level:1})?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[ek]},$$scope:{ctx:n}}}),m.$on("click",n[13]),y=new xe({props:{variant:n[1].isActive("heading",{level:2})?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[tk]},$$scope:{ctx:n}}}),y.$on("click",n[14]),C=new xe({props:{variant:n[1].isActive("heading",{level:3})?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[nk]},$$scope:{ctx:n}}}),C.$on("click",n[15]),A=new xe({props:{variant:n[1].isActive("bulletList")?"default":"secondary",class:"mt-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[rk]},$$scope:{ctx:n}}}),A.$on("click",n[16]),O=new xe({props:{variant:n[1].isActive("orderedList")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[ik]},$$scope:{ctx:n}}}),O.$on("click",n[17]),w=new xe({props:{variant:n[1].isActive("codeBlock")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[ok]},$$scope:{ctx:n}}}),w.$on("click",n[18]),q=new xe({props:{variant:n[1].isActive("blockquote")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[sk]},$$scope:{ctx:n}}}),q.$on("click",n[19]),N=new xe({props:{class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[lk]},$$scope:{ctx:n}}}),N.$on("click",n[20]),B=new xe({props:{variant:n[1].isActive("link")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm underline",$$slots:{default:[ak]},$$scope:{ctx:n}}}),B.$on("click",n[6]),R=new xe({props:{disabled:!n[1].isActive("link"),class:"my-0.5 h-6 px-2 text-sm underline",$$slots:{default:[ck]},$$scope:{ctx:n}}}),R.$on("click",n[21]),$=new xe({props:{disabled:!n[1].can().chain().focus().undo().run(),class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[uk]},$$scope:{ctx:n}}}),$.$on("click",n[22]),ee=new xe({props:{disabled:!n[1].can().chain().focus().redo().run(),class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[dk]},$$scope:{ctx:n}}}),ee.$on("click",n[23]),te=new xe({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[fk]},$$scope:{ctx:n}}}),te.$on("click",n[4]),ze=new xe({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[pk]},$$scope:{ctx:n}}}),ze.$on("click",n[25]),Fe=new xe({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[hk]},$$scope:{ctx:n}}}),Fe.$on("click",Nf),{c(){e=Se("div"),t=Se("nav"),ge(r.$$.fragment),i=de(),ge(o.$$.fragment),s=de(),ge(l.$$.fragment),a=de(),ge(c.$$.fragment),u=de(),ge(d.$$.fragment),f=de(),ge(p.$$.fragment),h=de(),ge(m.$$.fragment),g=de(),ge(y.$$.fragment),k=de(),ge(C.$$.fragment),b=de(),ge(A.$$.fragment),v=de(),ge(O.$$.fragment),W=de(),ge(w.$$.fragment),H=de(),ge(q.$$.fragment),S=de(),ge(N.$$.fragment),P=de(),ge(B.$$.fragment),L=de(),ge(R.$$.fragment),_=de(),ge($.$$.fragment),K=de(),ge(ee.$$.fragment),ie=de(),ge(te.$$.fragment),Oe=de(),me=Se("input"),Ue=de(),ge(ze.$$.fragment),rt=de(),ge(Fe.$$.fragment),this.h()},l(M){e=Ce(M,"DIV",{});var D=mt(e);t=Ce(D,"NAV",{class:!0});var V=mt(t);be(r.$$.fragment,V),i=fe(V),be(o.$$.fragment,V),s=fe(V),be(l.$$.fragment,V),a=fe(V),be(c.$$.fragment,V),u=fe(V),be(d.$$.fragment,V),f=fe(V),be(p.$$.fragment,V),h=fe(V),be(m.$$.fragment,V),g=fe(V),be(y.$$.fragment,V),k=fe(V),be(C.$$.fragment,V),b=fe(V),be(A.$$.fragment,V),v=fe(V),be(O.$$.fragment,V),W=fe(V),be(w.$$.fragment,V),H=fe(V),be(q.$$.fragment,V),S=fe(V),be(N.$$.fragment,V),P=fe(V),be(B.$$.fragment,V),L=fe(V),be(R.$$.fragment,V),_=fe(V),be($.$$.fragment,V),K=fe(V),be(ee.$$.fragment,V),ie=fe(V),be(te.$$.fragment,V),Oe=fe(V),me=Ce(V,"INPUT",{type:!0,id:!0,style:!0}),Ue=fe(V),be(ze.$$.fragment,V),rt=fe(V),be(Fe.$$.fragment,V),V.forEach(U),D.forEach(U),this.h()},h(){lt(me,"type","file"),lt(me,"id","selectedFile"),Ef(me,"display","none"),lt(t,"class","fixed top-0 z-10 w-full bg-white px-4 py-2 dark:bg-[#0F172A] max-md:px-2")},m(M,D){ne(M,e,D),ce(e,t),ye(r,t,null),ce(t,i),ye(o,t,null),ce(t,s),ye(l,t,null),ce(t,a),ye(c,t,null),ce(t,u),ye(d,t,null),ce(t,f),ye(p,t,null),ce(t,h),ye(m,t,null),ce(t,g),ye(y,t,null),ce(t,k),ye(C,t,null),ce(t,b),ye(A,t,null),ce(t,v),ye(O,t,null),ce(t,W),ye(w,t,null),ce(t,H),ye(q,t,null),ce(t,S),ye(N,t,null),ce(t,P),ye(B,t,null),ce(t,L),ye(R,t,null),ce(t,_),ye($,t,null),ce(t,K),ye(ee,t,null),ce(t,ie),ye(te,t,null),ce(t,Oe),ce(t,me),ce(t,Ue),ye(ze,t,null),ce(t,rt),ye(Fe,t,null),it=!0,Nt||(Nn=[Ee(me,"change",n[24]),Ee(me,"change",n[5])],Nt=!0)},p(M,D){const V={};D[1]&2&&(V.$$scope={dirty:D,ctx:M}),r.$set(V);const Dt={};D[0]&2&&(Dt.disabled=!M[1].can().chain().focus().toggleBold().run()),D[0]&2&&(Dt.variant=M[1].isActive("bold")?"default":"secondary"),D[1]&2&&(Dt.$$scope={dirty:D,ctx:M}),o.$set(Dt);const It={};D[0]&2&&(It.disabled=!M[1].can().chain().focus().toggleItalic().run()),D[0]&2&&(It.variant=M[1].isActive("italic")?"default":"secondary"),D[1]&2&&(It.$$scope={dirty:D,ctx:M}),l.$set(It);const Ut={};D[0]&2&&(Ut.disabled=!M[1].can().chain().focus().toggleStrike().run()),D[0]&2&&(Ut.variant=M[1].isActive("strike")?"default":"secondary"),D[1]&2&&(Ut.$$scope={dirty:D,ctx:M}),c.$set(Ut);const qt={};D[0]&2&&(qt.disabled=!M[1].can().chain().focus().toggleCode().run()),D[0]&2&&(qt.variant=M[1].isActive("code")?"default":"secondary"),D[1]&2&&(qt.$$scope={dirty:D,ctx:M}),d.$set(qt);const ot={};D[0]&2&&(ot.variant=M[1].isActive("paragraph")?"default":"secondary"),D[1]&2&&(ot.$$scope={dirty:D,ctx:M}),p.$set(ot);const ut={};D[0]&2&&(ut.variant=M[1].isActive("heading",{level:1})?"default":"secondary"),D[1]&2&&(ut.$$scope={dirty:D,ctx:M}),m.$set(ut);const Kt={};D[0]&2&&(Kt.variant=M[1].isActive("heading",{level:2})?"default":"secondary"),D[1]&2&&(Kt.$$scope={dirty:D,ctx:M}),y.$set(Kt);const xt={};D[0]&2&&(xt.variant=M[1].isActive("heading",{level:3})?"default":"secondary"),D[1]&2&&(xt.$$scope={dirty:D,ctx:M}),C.$set(xt);const Jt={};D[0]&2&&(Jt.variant=M[1].isActive("bulletList")?"default":"secondary"),D[1]&2&&(Jt.$$scope={dirty:D,ctx:M}),A.$set(Jt);const nn={};D[0]&2&&(nn.variant=M[1].isActive("orderedList")?"default":"secondary"),D[1]&2&&(nn.$$scope={dirty:D,ctx:M}),O.$set(nn);const rn={};D[0]&2&&(rn.variant=M[1].isActive("codeBlock")?"default":"secondary"),D[1]&2&&(rn.$$scope={dirty:D,ctx:M}),w.$set(rn);const on={};D[0]&2&&(on.variant=M[1].isActive("blockquote")?"default":"secondary"),D[1]&2&&(on.$$scope={dirty:D,ctx:M}),q.$set(on);const Dn={};D[1]&2&&(Dn.$$scope={dirty:D,ctx:M}),N.$set(Dn);const Ar={};D[0]&2&&(Ar.variant=M[1].isActive("link")?"default":"secondary"),D[1]&2&&(Ar.$$scope={dirty:D,ctx:M}),B.$set(Ar);const Er={};D[0]&2&&(Er.disabled=!M[1].isActive("link")),D[1]&2&&(Er.$$scope={dirty:D,ctx:M}),R.$set(Er);const Nr={};D[0]&2&&(Nr.disabled=!M[1].can().chain().focus().undo().run()),D[1]&2&&(Nr.$$scope={dirty:D,ctx:M}),$.$set(Nr);const Dr={};D[0]&2&&(Dr.disabled=!M[1].can().chain().focus().redo().run()),D[1]&2&&(Dr.$$scope={dirty:D,ctx:M}),ee.$set(Dr);const gi={};D[1]&2&&(gi.$$scope={dirty:D,ctx:M}),te.$set(gi);const x={};D[1]&2&&(x.$$scope={dirty:D,ctx:M}),ze.$set(x);const z={};D[1]&2&&(z.$$scope={dirty:D,ctx:M}),Fe.$set(z)},i(M){it||(se(r.$$.fragment,M),se(o.$$.fragment,M),se(l.$$.fragment,M),se(c.$$.fragment,M),se(d.$$.fragment,M),se(p.$$.fragment,M),se(m.$$.fragment,M),se(y.$$.fragment,M),se(C.$$.fragment,M),se(A.$$.fragment,M),se(O.$$.fragment,M),se(w.$$.fragment,M),se(q.$$.fragment,M),se(N.$$.fragment,M),se(B.$$.fragment,M),se(R.$$.fragment,M),se($.$$.fragment,M),se(ee.$$.fragment,M),se(te.$$.fragment,M),se(ze.$$.fragment,M),se(Fe.$$.fragment,M),it=!0)},o(M){le(r.$$.fragment,M),le(o.$$.fragment,M),le(l.$$.fragment,M),le(c.$$.fragment,M),le(d.$$.fragment,M),le(p.$$.fragment,M),le(m.$$.fragment,M),le(y.$$.fragment,M),le(C.$$.fragment,M),le(A.$$.fragment,M),le(O.$$.fragment,M),le(w.$$.fragment,M),le(q.$$.fragment,M),le(N.$$.fragment,M),le(B.$$.fragment,M),le(R.$$.fragment,M),le($.$$.fragment,M),le(ee.$$.fragment,M),le(te.$$.fragment,M),le(ze.$$.fragment,M),le(Fe.$$.fragment,M),it=!1},d(M){M&&U(e),ve(r),ve(o),ve(l),ve(c),ve(d),ve(p),ve(m),ve(y),ve(C),ve(A),ve(O),ve(w),ve(q),ve(N),ve(B),ve(R),ve($),ve(ee),ve(te),ve(ze),ve(Fe),Nt=!1,Ro(Nn)}}}function J1(n){let e;return{c(){e=$e("N")},l(t){e=Be(t,"N")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function G1(n){let e,t="B";return{c(){e=Se("strong"),e.textContent=t},l(r){e=Ce(r,"STRONG",{"data-svelte-h":!0}),gn(e)!=="svelte-1dz6n38"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:Mn,d(r){r&&U(e)}}}function Y1(n){let e,t="I";return{c(){e=Se("i"),e.textContent=t},l(r){e=Ce(r,"I",{"data-svelte-h":!0}),gn(e)!=="svelte-14lqchx"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:Mn,d(r){r&&U(e)}}}function X1(n){let e,t="S";return{c(){e=Se("strike"),e.textContent=t},l(r){e=Ce(r,"STRIKE",{"data-svelte-h":!0}),gn(e)!=="svelte-rz7pbd"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:Mn,d(r){r&&U(e)}}}function Q1(n){let e,t="C";return{c(){e=Se("code"),e.textContent=t},l(r){e=Ce(r,"CODE",{"data-svelte-h":!0}),gn(e)!=="svelte-9f3k19"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:Mn,d(r){r&&U(e)}}}function Z1(n){let e;return{c(){e=$e("P")},l(t){e=Be(t,"P")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function ek(n){let e;return{c(){e=$e("H1")},l(t){e=Be(t,"H1")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function tk(n){let e;return{c(){e=$e("H2")},l(t){e=Be(t,"H2")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function nk(n){let e;return{c(){e=$e("H3")},l(t){e=Be(t,"H3")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function rk(n){let e;return{c(){e=$e("*UL")},l(t){e=Be(t,"*UL")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function ik(n){let e;return{c(){e=$e("1.OL")},l(t){e=Be(t,"1.OL")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function ok(n){let e="{..}",t;return{c(){t=$e(e)},l(r){t=Be(r,e)},m(r,i){ne(r,t,i)},p:Mn,d(r){r&&U(t)}}}function sk(n){let e=">..",t;return{c(){t=$e(e)},l(r){t=Be(r,e)},m(r,i){ne(r,t,i)},p:Mn,d(r){r&&U(t)}}}function lk(n){let e;return{c(){e=$e("--")},l(t){e=Be(t,"--")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function ak(n){let e;return{c(){e=$e("L")},l(t){e=Be(t,"L")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function ck(n){let e,t="L",r;return{c(){e=Se("strike"),r=$e(t)},l(i){e=Ce(i,"STRIKE",{});var o=mt(e);r=Be(o,t),o.forEach(U)},m(i,o){ne(i,e,o),ce(e,r)},p:Mn,d(i){i&&U(e)}}}function uk(n){let e;return{c(){e=$e("←")},l(t){e=Be(t,"←")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function dk(n){let e;return{c(){e=$e("→")},l(t){e=Be(t,"→")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function fk(n){let e;return{c(){e=$e("↓")},l(t){e=Be(t,"↓")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function pk(n){let e;return{c(){e=$e("↑")},l(t){e=Be(t,"↑")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function hk(n){let e;return{c(){e=$e("⛯")},l(t){e=Be(t,"⛯")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function su(n){let e,t,r="B",i,o,s,l,a="I",c,u,d,f,p="S",h,m,g,y,k="C",C,b,A;return{c(){e=Se("button"),t=Se("strong"),t.textContent=r,o=de(),s=Se("button"),l=Se("i"),l.textContent=a,u=de(),d=Se("button"),f=Se("strike"),f.textContent=p,m=de(),g=Se("button"),y=Se("code"),y.textContent=k,this.h()},l(v){e=Ce(v,"BUTTON",{class:!0});var O=mt(e);t=Ce(O,"STRONG",{"data-svelte-h":!0}),gn(t)!=="svelte-1dz6n38"&&(t.textContent=r),O.forEach(U),o=fe(v),s=Ce(v,"BUTTON",{class:!0});var W=mt(s);l=Ce(W,"I",{"data-svelte-h":!0}),gn(l)!=="svelte-14lqchx"&&(l.textContent=a),W.forEach(U),u=fe(v),d=Ce(v,"BUTTON",{class:!0});var w=mt(d);f=Ce(w,"STRIKE",{"data-svelte-h":!0}),gn(f)!=="svelte-rz7pbd"&&(f.textContent=p),w.forEach(U),m=fe(v),g=Ce(v,"BUTTON",{class:!0});var H=mt(g);y=Ce(H,"CODE",{"data-svelte-h":!0}),gn(y)!=="svelte-9f3k19"&&(y.textContent=k),H.forEach(U),this.h()},h(){lt(e,"class",i=n[1].isActive("bold")?"is-active":""),lt(s,"class",c=n[1].isActive("italic")?"is-active":""),lt(d,"class",h=n[1].isActive("strike")?"is-active":""),lt(g,"class",C=n[1].isActive("code")?"is-active":"")},m(v,O){ne(v,e,O),ce(e,t),ne(v,o,O),ne(v,s,O),ce(s,l),ne(v,u,O),ne(v,d,O),ce(d,f),ne(v,m,O),ne(v,g,O),ce(g,y),b||(A=[Ee(e,"click",n[26]),Ee(s,"click",n[27]),Ee(d,"click",n[28]),Ee(g,"click",n[29])],b=!0)},p(v,O){O[0]&2&&i!==(i=v[1].isActive("bold")?"is-active":"")&<(e,"class",i),O[0]&2&&c!==(c=v[1].isActive("italic")?"is-active":"")&<(s,"class",c),O[0]&2&&h!==(h=v[1].isActive("strike")?"is-active":"")&<(d,"class",h),O[0]&2&&C!==(C=v[1].isActive("code")?"is-active":"")&<(g,"class",C)},d(v){v&&(U(e),U(o),U(s),U(u),U(d),U(m),U(g)),b=!1,Ro(A)}}}function mk(n){let e,t,r,i,o,s=n[1]&&ou(n),l=n[1]&&su(n);return{c(){s&&s.c(),e=de(),t=Se("div"),l&&l.c(),r=de(),i=Se("div"),this.h()},l(a){s&&s.l(a),e=fe(a),t=Ce(a,"DIV",{class:!0});var c=mt(t);l&&l.l(c),c.forEach(U),r=fe(a),i=Ce(a,"DIV",{class:!0}),mt(i).forEach(U),this.h()},h(){lt(t,"class","bubble-menu"),lt(i,"class","p-4 max-md:px-2 max-md:pb-2 max-md:pt-4")},m(a,c){s&&s.m(a,c),ne(a,e,c),ne(a,t,c),l&&l.m(t,null),n[30](t),ne(a,r,c),ne(a,i,c),n[31](i),o=!0},p(a,c){a[1]?s?(s.p(a,c),c[0]&2&&se(s,1)):(s=ou(a),s.c(),se(s,1),s.m(e.parentNode,e)):s&&(au(),le(s,1,1,()=>{s=null}),cu()),a[1]?l?l.p(a,c):(l=su(a),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},i(a){o||(se(s),o=!0)},o(a){le(s),o=!1},d(a){a&&(U(e),U(t),U(r),U(i)),s&&s.d(a),l&&l.d(),n[30](null),n[31](null)}}}function gk(n,e,t){let r,i,o,s;Af(async()=>{const $=localStorage.getItem("auto-saved")??'

Hello,

This is a note web app based on SvelteKit, Tiptap and shadcn/ui.

This note app essentially supports three types of headers, basic paragraph type, code block, unordered list, and ordered list types necessary for document creation.

Header types and basic paragraph types can be emphasized with formatting options such as bold, italic, and strike.

Links can be added or modified through the link button, and they can be removed using the link removal button.

The history feature is also provided through undo and redo actions.

Documents are basically stored in LocalStorage, and if you wish to save them permanently, you should use the provided save function to store them as HTML files. Additionally, you can upload these files to continue editing.

The theme supports both Light and Dark modes.

If you want more features, please visit the tiptap documentation and extend the functionality through extensions.


# H1: H1

## H2: H2

### H3: H3

`code`: code

**bold**: bold

*italic*: italic

~~strike~~: strike

- or * unordered list:

  • unordered list

1. ordered list:

  1. ordered list

```code block```:

```code block```

> block quote:

block quote

---:


cmd+z: undo

cmd+shift+z: redo

';t(1,i=new Cb({element:r,editorProps:{attributes:{class:"border-2 border-[#0F172A] max-md:border-none rounded-lg mt-9 max-md:p-2 p-4 outline-none"}},extensions:[Cy,nv.configure({element:o}),Mv.configure({openOnClick:!1,autolink:!0})],onUpdate({editor:K}){try{localStorage.setItem("auto-saved",K.getHTML())}catch(ee){console.error(ee)}},content:$,onTransaction:()=>{t(1,i)}}))});function l(){let $=`note_${Date.now()}.html`,K=window.prompt("Please insert file name",$);if(K===null||K.trim().length===0){K=$;return}const ee=i.getHTML(),ie=` +3. "-" cannot repeat`);ke.customSchemes.push([n,e])}function kv(){ke.scanner=dv(ke.customSchemes);for(let n=0;n{const i=e.some(c=>c.docChanged)&&!t.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,l=$g(t.doc,[...e]);if(Ug(l).forEach(({newRange:c})=>{const u=zg(r.doc,c,p=>p.isTextblock);let d,f;if(u.length>1?(d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&f){const p=f.split(" ").filter(g=>g!=="");if(p.length<=0)return!1;const h=p[p.length-1],m=d.pos+f.lastIndexOf(h);if(!h)return!1;aa(h).filter(g=>g.isLink).map(g=>({...g,from:m+g.start+1,to:m+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>n.validate?n.validate(g.value):!0).forEach(g=>{Ul(g.from,g.to,r.doc).some(y=>y.mark.type===n.type)||s.addMark(g.from,g.to,n.type.create({href:g.href}))})}}),!!s.steps.length)return s}})}function Sv(n){return new We({key:new wt("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const l=Id(e.state,n.type.name),a=r.target,c=(i=a==null?void 0:a.href)!==null&&i!==void 0?i:l.href,u=(o=a==null?void 0:a.target)!==null&&o!==void 0?o:l.target;return a&&c?(e.editable&&window.open(c,u),!0):!1}}})}function Cv(n){return new We({key:new wt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const a=aa(l).find(c=>c.isLink&&c.value===l);return!l||!a?!1:(n.editor.commands.setMark(n.type,{href:a.href}),!0)}}})}const Mv=At.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){Kc(n);return}Kc(n.scheme,n.optionalSlashes)})},onDestroy(){vv()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:n}){var e;return!((e=n.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",Me(this.options.HTMLAttributes,{...n,href:""}),0]:["a",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setLink:n=>({chain:e})=>e().setMark(this.name,n).setMeta("preventAutolink",!0).run(),toggleLink:n=>({chain:e})=>e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Yn({find:(n,e)=>{var t;const r=(t=e==null?void 0:e.clipboardData)===null||t===void 0?void 0:t.getData("text/html"),i=[];if(r){const o=new DOMParser().parseFromString(r,"text/html"),s=o.querySelectorAll("a");s.length&&[...s].forEach(l=>i.push({text:l.innerText,data:{href:l.getAttribute("href")},index:o.body.innerText.indexOf(l.innerText)+l.innerText.length}))}if(n){const o=aa(n).filter(s=>s.isLink);o.length&&o.forEach(s=>i.push({text:s.value,data:{href:s.href},index:s.start}))}return i},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(xv({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(Sv({type:this.type})),this.options.linkOnPaste&&n.push(Cv({editor:this.editor,type:this.type})),n}});function Tv(n){return Object.keys(n).reduce((e,t)=>n[t]===void 0?e:e+`${t}:${n[t]};`,"")}Tv({position:"absolute",opacity:0,"pointer-events":"none",margin:0,transform:"translateX(-100%)"});function lf(n,e,t,r){const i=Array.isArray(e)?e:[e];return i.forEach(o=>n.addEventListener(o,t,r)),()=>{i.forEach(o=>n.removeEventListener(o,t,r))}}const Ov={ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",A:"a",P:"p"};uu(void 0,n=>{function e(r){n(r),n(void 0)}return lf(document,"pointerup",e,{passive:!1,capture:!0})});uu(void 0,n=>{function e(r){r&&r.key===Ov.ESCAPE&&n(r),n(void 0)}return lf(document,"keydown",e,{passive:!1})});function Ev(n,e){const t=[];return e.builders.forEach(r=>{const i=r.action(n);i&&t.push(i)}),{destroy:()=>{t.forEach(r=>{r.destroy&&r.destroy()})}}}function Jc(n){const e={};return n.forEach(t=>{Object.keys(t).forEach(r=>{r!=="action"&&(e[r]=t[r])})}),e}function Av(n){let e=n[1]?"a":"button",t,r,i=(n[1]?"a":"button")&&Is(n);return{c(){i&&i.c(),t=hr()},l(o){i&&i.l(o),t=hr()},m(o,s){i&&i.m(o,s),ne(o,t,s),r=!0},p(o,s){o[1],e?Mr(e,o[1]?"a":"button")?(i.d(1),i=Is(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t)):i.p(o,s):(i=Is(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t))},i(o){r||(se(i,o),r=!0)},o(o){le(i,o),r=!1},d(o){o&&U(t),i&&i.d(o)}}}function Nv(n){let e=n[1]?"a":"button",t,r,i=(n[1]?"a":"button")&&Rs(n);return{c(){i&&i.c(),t=hr()},l(o){i&&i.l(o),t=hr()},m(o,s){i&&i.m(o,s),ne(o,t,s),r=!0},p(o,s){o[1],e?Mr(e,o[1]?"a":"button")?(i.d(1),i=Rs(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t)):i.p(o,s):(i=Rs(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t))},i(o){r||(se(i,o),r=!0)},o(o){le(i,o),r=!1},d(o){o&&U(t),i&&i.d(o)}}}function Is(n){let e,t,r,i,o;const s=n[7].default,l=kl(s,n,n[6],null);let a=[{type:t=n[1]?void 0:n[2]},{href:n[1]},{tabindex:"0"},n[5],n[4]],c={};for(let u=0;u{s[u]=null}),cu(),t=s[e],t?t.p(a,c):(t=s[e]=o[e](a),t.c()),se(t,1),t.m(r.parentNode,r))},i(a){i||(se(t),i=!0)},o(a){le(t),i=!1},d(a){a&&U(r),s[e].d(a)}}}function Iv(n,e,t){const r=["href","type","builders","el"];let i=Bi(e,r),{$$slots:o={},$$scope:s}=e,{href:l=void 0}=e,{type:a=void 0}=e,{builders:c=[]}=e,{el:u=void 0}=e;const d={"data-button-root":""};function f(w){Xe.call(this,n,w)}function p(w){Xe.call(this,n,w)}function h(w){Xe.call(this,n,w)}function m(w){Xe.call(this,n,w)}function g(w){Xe.call(this,n,w)}function y(w){Xe.call(this,n,w)}function k(w){Xe.call(this,n,w)}function C(w){Xe.call(this,n,w)}function b(w){Xe.call(this,n,w)}function E(w){Xe.call(this,n,w)}function v(w){Xe.call(this,n,w)}function O(w){Xe.call(this,n,w)}function W(w){Ls[w?"unshift":"push"](()=>{u=w,t(0,u)})}return n.$$set=w=>{e=qn(qn({},e),lu(w)),t(5,i=Bi(e,r)),"href"in w&&t(1,l=w.href),"type"in w&&t(2,a=w.type),"builders"in w&&t(3,c=w.builders),"el"in w&&t(0,u=w.el),"$$scope"in w&&t(6,s=w.$$scope)},[u,l,a,c,d,i,s,o,f,p,h,m,g,y,k,C,b,E,v,O,W]}let Rv=class extends Po{constructor(e){super(),Lo(this,e,Iv,Dv,Mr,{href:1,type:2,builders:3,el:0})}};function af(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;el(o)))==null?void 0:s.classGroupId}const Gc=/^\[(.+)\]$/;function $v(n){if(Gc.test(n)){const e=Gc.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}}function Bv(n){const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return Fv(Object.entries(n.classGroups),t).forEach(([o,s])=>{hl(s,r,o,e)}),r}function hl(n,e,t,r){n.forEach(i=>{if(typeof i=="string"){const o=i===""?e:Yc(e,i);o.classGroupId=t;return}if(typeof i=="function"){if(zv(i)){hl(i(r),e,t,r);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([o,s])=>{hl(s,Yc(e,o),t,r)})})}function Yc(n,e){let t=n;return e.split(ca).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t}function zv(n){return n.isThemeGetter}function Fv(n,e){return e?n.map(([t,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,l])=>[e+s,l])):o);return[t,i]}):n}function _v(n){if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;function i(o,s){t.set(o,s),e++,e>n&&(e=0,r=t,t=new Map)}return{get(o){let s=t.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){t.has(o)?t.set(o,s):i(o,s)}}}const uf="!";function Hv(n){const e=n.separator,t=e.length===1,r=e[0],i=e.length;return function(s){const l=[];let a=0,c=0,u;for(let m=0;mc?u-c:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}}}function Vv(n){if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e}function jv(n){return{cache:_v(n.cacheSize),splitModifiers:Hv(n),...Lv(n)}}const Wv=/\s+/;function Uv(n,e){const{splitModifiers:t,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=new Set;return n.trim().split(Wv).map(s=>{const{modifiers:l,hasImportantModifier:a,baseClassName:c,maybePostfixModifierPosition:u}=t(s);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};f=!1}const p=Vv(l).join(":");return{isTailwindClass:!0,modifierId:a?p+uf:p,classGroupId:d,originalClassName:s,hasPostfixModifier:f}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:l,classGroupId:a,hasPostfixModifier:c}=s,u=l+a;return o.has(u)?!1:(o.add(u),i(a,c).forEach(d=>o.add(l+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function qv(){let n=0,e,t,r="";for(;nd(u),n());return t=jv(c),r=t.cache.get,i=t.cache.set,o=l,l(a)}function l(a){const c=r(a);if(c)return c;const u=Uv(a,t);return i(a,u),u}return function(){return o(qv.apply(null,arguments))}}function pe(n){const e=t=>t[n]||[];return e.isThemeGetter=!0,e}const ff=/^\[(?:([a-z-]+):)?(.+)\]$/i,Jv=/^\d+\/\d+$/,Gv=new Set(["px","full","screen"]),Yv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Qv=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Yt(n){return zn(n)||Gv.has(n)||Jv.test(n)}function ln(n){return Or(n,"length",l1)}function zn(n){return!!n&&!Number.isNaN(Number(n))}function Ai(n){return Or(n,"number",zn)}function Pr(n){return!!n&&Number.isInteger(Number(n))}function e1(n){return n.endsWith("%")&&zn(n.slice(0,-1))}function Y(n){return ff.test(n)}function an(n){return Yv.test(n)}const t1=new Set(["length","size","percentage"]);function n1(n){return Or(n,t1,pf)}function r1(n){return Or(n,"position",pf)}const i1=new Set(["image","url"]);function o1(n){return Or(n,i1,c1)}function s1(n){return Or(n,"",a1)}function Lr(){return!0}function Or(n,e,t){const r=ff.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1}function l1(n){return Xv.test(n)}function pf(){return!1}function a1(n){return Qv.test(n)}function c1(n){return Zv.test(n)}function u1(){const n=pe("colors"),e=pe("spacing"),t=pe("blur"),r=pe("brightness"),i=pe("borderColor"),o=pe("borderRadius"),s=pe("borderSpacing"),l=pe("borderWidth"),a=pe("contrast"),c=pe("grayscale"),u=pe("hueRotate"),d=pe("invert"),f=pe("gap"),p=pe("gradientColorStops"),h=pe("gradientColorStopPositions"),m=pe("inset"),g=pe("margin"),y=pe("opacity"),k=pe("padding"),C=pe("saturate"),b=pe("scale"),E=pe("sepia"),v=pe("skew"),O=pe("space"),W=pe("translate"),w=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",Y,e],S=()=>[Y,e],N=()=>["",Yt,ln],P=()=>["auto",zn,Y],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],R=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],_=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",Y],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ee=()=>[zn,Ai],ie=()=>[zn,Y];return{cacheSize:500,separator:":",theme:{colors:[Lr],spacing:[Yt,ln],blur:["none","",an,Y],brightness:ee(),borderColor:[n],borderRadius:["none","","full",an,Y],borderSpacing:S(),borderWidth:N(),contrast:ee(),grayscale:$(),hueRotate:ie(),invert:$(),gap:S(),gradientColorStops:[n],gradientColorStopPositions:[e1,ln],inset:q(),margin:q(),opacity:ee(),padding:S(),saturate:ee(),scale:ee(),sepia:$(),skew:ie(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[an]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),Y]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:w()}],"overscroll-x":[{"overscroll-x":w()}],"overscroll-y":[{"overscroll-y":w()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pr,Y]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Y]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",Pr,Y]}],"grid-cols":[{"grid-cols":[Lr]}],"col-start-end":[{col:["auto",{span:["full",Pr,Y]},Y]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[Lr]}],"row-start-end":[{row:["auto",{span:[Pr,Y]},Y]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Y]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Y,e]}],"min-w":[{"min-w":[Y,e,"min","max","fit"]}],"max-w":[{"max-w":[Y,e,"none","full","min","max","fit","prose",{screen:[an]},an]}],h:[{h:[Y,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Y,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Y,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Y,e,"auto","min","max","fit"]}],"font-size":[{text:["base",an,ln]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ai]}],"font-family":[{font:[Lr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Y]}],"line-clamp":[{"line-clamp":["none",zn,Ai]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Yt,Y]}],"list-image":[{"list-image":["none",Y]}],"list-style-type":[{list:["none","disc","decimal",Y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Yt,ln]}],"underline-offset":[{"underline-offset":["auto",Yt,Y]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),r1]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",n1]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},o1]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:L()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[Yt,Y]}],"outline-w":[{outline:[Yt,ln]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Yt,ln]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",an,s1]}],"shadow-color":[{shadow:[Lr]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":R()}],"bg-blend":[{"bg-blend":R()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",an,Y]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[C]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Y]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",Y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Pr,Y]}],"translate-x":[{"translate-x":[W]}],"translate-y":[{"translate-y":[W]}],"skew-x":[{"skew-x":[v]}],"skew-y":[{"skew-y":[v]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Y]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Y]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Y]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Yt,ln,Ai]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const d1=Kv(u1);function Xc(...n){return d1(Pv(n))}function f1(n){let e;const t=n[5].default,r=kl(t,n,n[8],null);return{c(){r&&r.c()},l(i){r&&r.l(i)},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&256)&&wl(r,t,i,i[8],e?Sl(t,i[8],o,null):xl(i[8]),null)},i(i){e||(se(r,i),e=!0)},o(i){le(r,i),e=!1},d(i){r&&r.d(i)}}}function p1(n){let e,t;const r=[{builders:n[3]},{class:Xc(iu({variant:n[1],size:n[2],className:n[0]}))},{type:"button"},n[4]];let i={$$slots:{default:[f1]},$$scope:{ctx:n}};for(let o=0;o{e=qn(qn({},e),lu(p)),t(4,i=Bi(e,r)),"class"in p&&t(0,l=p.class),"variant"in p&&t(1,a=p.variant),"size"in p&&t(2,c=p.size),"builders"in p&&t(3,u=p.builders),"$$scope"in p&&t(8,s=p.$$scope)},[l,a,c,u,i,o,d,f,s]}class xe extends Po{constructor(e){super(),Lo(this,e,h1,p1,Mr,{class:0,variant:1,size:2,builders:3})}}var Qc=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,st=n=>!n||typeof n!="object"||Object.keys(n).length===0,m1=(n,e)=>JSON.stringify(n)===JSON.stringify(e);function hf(n,e){n.forEach(function(t){Array.isArray(t)?hf(t,e):e.push(t)})}function mf(n){let e=[];return hf(n,e),e}var gf=(...n)=>mf(n).filter(Boolean),bf=(n,e)=>{let t={},r=Object.keys(n),i=Object.keys(e);for(let o of r)if(i.includes(o)){let s=n[o],l=e[o];typeof s=="object"&&typeof l=="object"?t[o]=bf(s,l):Array.isArray(s)||Array.isArray(l)?t[o]=gf(l,s):t[o]=l+" "+s}else t[o]=n[o];for(let o of i)r.includes(o)||(t[o]=e[o]);return t},Zc=n=>!n||typeof n!="string"?n:n.replace(/\s+/g," ").trim();function g1(){for(var n=0,e,t,r="";nn&&(e=0,r=t,t=new Map)}return{get:function(s){var l=t.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return i(s,l),l},set:function(s,l){t.has(s)?t.set(s,l):i(s,l)}}}var kf="!";function S1(n){var e=n.separator||":",t=e.length===1,r=e[0],i=e.length;return function(s){for(var l=[],a=0,c=0,u,d=0;dc?u-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}}}function C1(n){if(n.length<=1)return n;var e=[],t=[];return n.forEach(function(r){var i=r[0]==="[";i?(e.push.apply(e,t.sort().concat([r])),t=[]):t.push(r)}),e.push.apply(e,t.sort()),e}function M1(n){return{cache:x1(n.cacheSize),splitModifiers:S1(n),...b1(n)}}var T1=/\s+/;function O1(n,e){var t=e.splitModifiers,r=e.getClassGroupId,i=e.getConflictingClassGroupIds,o=new Set;return n.trim().split(T1).map(function(s){var l=t(s),a=l.modifiers,c=l.hasImportantModifier,u=l.baseClassName,d=l.maybePostfixModifierPosition,f=r(d?u.substring(0,d):u),p=!!d;if(!f){if(!d)return{isTailwindClass:!1,originalClassName:s};if(f=r(u),!f)return{isTailwindClass:!1,originalClassName:s};p=!1}var h=C1(a).join(":"),m=c?h+kf:h;return{isTailwindClass:!0,modifierId:m,classGroupId:f,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(function(s){if(!s.isTailwindClass)return!0;var l=s.modifierId,a=s.classGroupId,c=s.hasPostfixModifier,u=l+a;return o.has(u)?!1:(o.add(u),i(a,c).forEach(function(d){return o.add(l+d)}),!0)}).reverse().map(function(s){return s.originalClassName}).join(" ")}function gl(){for(var n=arguments.length,e=new Array(n),t=0;t1?e-1:0),r=1;rn||void 0,ui=(...n)=>Cf(mf(n).filter(Boolean).join(" ")),Ps=null,Io={},vl=!1,zr=(...n)=>e=>e.twMerge?((!Ps||vl)&&(vl=!1,Ps=st(Io)?U1:W1(Io)),Cf(Ps(ui(n)))):ui(n),ru=(n,e)=>{for(let t in e)n.hasOwnProperty(t)?n[t]=ui(n[t],e[t]):n[t]=e[t];return n},K1=(n,e)=>{let{extend:t=null,slots:r={},variants:i={},compoundVariants:o=[],compoundSlots:s=[],defaultVariants:l={}}=n,a={...q1,...e},c=t!=null&&t.base?ui(t.base,n==null?void 0:n.base):n==null?void 0:n.base,u=t!=null&&t.variants&&!st(t.variants)?bf(i,t.variants):i,d=t!=null&&t.defaultVariants&&!st(t.defaultVariants)?{...t.defaultVariants,...l}:l;!st(a.twMergeConfig)&&!m1(a.twMergeConfig,Io)&&(vl=!0,Io=a.twMergeConfig);let f=st(t==null?void 0:t.slots),p=st(r)?{}:{base:ui(n==null?void 0:n.base,f&&(t==null?void 0:t.base)),...r},h=f?p:ru({...t==null?void 0:t.slots},st(p)?{base:n==null?void 0:n.base}:p),m=y=>{if(st(u)&&st(r)&&f)return zr(c,y==null?void 0:y.class,y==null?void 0:y.className)(a);if(o&&!Array.isArray(o))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof o}`);if(s&&!Array.isArray(s))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof s}`);let k=(S,N,P=[],B)=>{let L=P;if(typeof N=="string")L=L.concat(Zc(N).split(" ").map(R=>`${S}:${R}`));else if(Array.isArray(N))L=L.concat(N.reduce((R,_)=>R.concat(`${S}:${_}`),[]));else if(typeof N=="object"&&typeof B=="string"){for(let R in N)if(N.hasOwnProperty(R)&&R===B){let _=N[R];if(_&&typeof _=="string"){let $=Zc(_);L[B]?L[B]=L[B].concat($.split(" ").map(K=>`${S}:${K}`)):L[B]=$.split(" ").map(K=>`${S}:${K}`)}else Array.isArray(_)&&_.length>0&&(L[B]=_.reduce(($,K)=>$.concat(`${S}:${K}`),[]))}}return L},C=(S,N=u,P=null,B=null)=>{var L;let R=N[S];if(!R||st(R))return null;let _=(L=B==null?void 0:B[S])!=null?L:y==null?void 0:y[S];if(_===null)return null;let $=Qc(_),K=Array.isArray(a.responsiveVariants)&&a.responsiveVariants.length>0||a.responsiveVariants===!0,ee=d==null?void 0:d[S],ie=[];if(typeof $=="object"&&K)for(let[Oe,me]of Object.entries($)){let Ue=R[me];if(Oe==="initial"){ee=me;continue}Array.isArray(a.responsiveVariants)&&!a.responsiveVariants.includes(Oe)||(ie=k(Oe,Ue,ie,P))}let te=R[$]||R[Qc(ee)];return typeof ie=="object"&&typeof P=="string"&&ie[P]?ru(ie,te):ie.length>0?(ie.push(te),ie):te},b=()=>u?Object.keys(u).map(S=>C(S,u)):null,E=(S,N)=>{if(!u||typeof u!="object")return null;let P=new Array;for(let B in u){let L=C(B,u,S,N),R=S==="base"&&typeof L=="string"?L:L&&L[S];R&&(P[P.length]=R)}return P},v={};for(let S in y)y[S]!==void 0&&(v[S]=y[S]);let O=(S,N)=>{var P;let B=typeof(y==null?void 0:y[S])=="object"?{[S]:(P=y[S])==null?void 0:P.initial}:{};return{...d,...v,...B,...N}},W=(S=[],N)=>{let P=[];for(let{class:B,className:L,...R}of S){let _=!0;for(let[$,K]of Object.entries(R)){let ee=O($,N);if(Array.isArray(K)){if(!K.includes(ee[$])){_=!1;break}}else if(ee[$]!==K){_=!1;break}}_&&(B&&P.push(B),L&&P.push(L))}return P},w=S=>{let N=W(o,S),P=W(t==null?void 0:t.compoundVariants,S);return gf(P,N)},H=S=>{let N=w(S);if(!Array.isArray(N))return N;let P={};for(let B of N)if(typeof B=="string"&&(P.base=zr(P.base,B)(a)),typeof B=="object")for(let[L,R]of Object.entries(B))P[L]=zr(P[L],R)(a);return P},q=S=>{if(s.length<1)return null;let N={};for(let{slots:P=[],class:B,className:L,...R}of s){if(!st(R)){let _=!0;for(let $ of Object.keys(R)){let K=O($,S)[$];if(K===void 0||(Array.isArray(R[$])?!R[$].includes(K):R[$]!==K)){_=!1;break}}if(!_)continue}for(let _ of P)N[_]=N[_]||[],N[_].push([B,L])}return N};if(!st(r)||!f){let S={};if(typeof h=="object"&&!st(h))for(let N of Object.keys(h))S[N]=P=>{var B,L;return zr(h[N],E(N,P),((B=H(P))!=null?B:[])[N],((L=q(P))!=null?L:[])[N],P==null?void 0:P.class,P==null?void 0:P.className)(a)};return S}return zr(c,b(),w(),y==null?void 0:y.class,y==null?void 0:y.className)(a)},g=()=>{if(!(!u||typeof u!="object"))return Object.keys(u)};return m.variantKeys=g(),m.extend=t,m.base=c,m.slots=h,m.variants=u,m.defaultVariants=d,m.compoundSlots=s,m.compoundVariants=o,m};const iu=K1({base:"inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}});function ou(n){let e,t,r,i,o,s,l,a,c,u,d,f,p,h,m,g,y,k,C,b,E,v,O,W,w,H,q,S,N,P,B,L,R,_,$,K,ee,ie,te,Oe,me,Ue,ze,rt,Fe,it,Nt,Nn;return r=new xe({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[J1]},$$scope:{ctx:n}}}),r.$on("click",n[7]),o=new xe({props:{disabled:!n[1].can().chain().focus().toggleBold().run(),variant:n[1].isActive("bold")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[G1]},$$scope:{ctx:n}}}),o.$on("click",n[8]),l=new xe({props:{disabled:!n[1].can().chain().focus().toggleItalic().run(),variant:n[1].isActive("italic")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[Y1]},$$scope:{ctx:n}}}),l.$on("click",n[9]),c=new xe({props:{disabled:!n[1].can().chain().focus().toggleStrike().run(),variant:n[1].isActive("strike")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[X1]},$$scope:{ctx:n}}}),c.$on("click",n[10]),d=new xe({props:{disabled:!n[1].can().chain().focus().toggleCode().run(),variant:n[1].isActive("code")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[Q1]},$$scope:{ctx:n}}}),d.$on("click",n[11]),p=new xe({props:{variant:n[1].isActive("paragraph")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[Z1]},$$scope:{ctx:n}}}),p.$on("click",n[12]),m=new xe({props:{variant:n[1].isActive("heading",{level:1})?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[ek]},$$scope:{ctx:n}}}),m.$on("click",n[13]),y=new xe({props:{variant:n[1].isActive("heading",{level:2})?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[tk]},$$scope:{ctx:n}}}),y.$on("click",n[14]),C=new xe({props:{variant:n[1].isActive("heading",{level:3})?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[nk]},$$scope:{ctx:n}}}),C.$on("click",n[15]),E=new xe({props:{variant:n[1].isActive("bulletList")?"default":"secondary",class:"mt-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[rk]},$$scope:{ctx:n}}}),E.$on("click",n[16]),O=new xe({props:{variant:n[1].isActive("orderedList")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[ik]},$$scope:{ctx:n}}}),O.$on("click",n[17]),w=new xe({props:{variant:n[1].isActive("codeBlock")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[ok]},$$scope:{ctx:n}}}),w.$on("click",n[18]),q=new xe({props:{variant:n[1].isActive("blockquote")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[sk]},$$scope:{ctx:n}}}),q.$on("click",n[19]),N=new xe({props:{class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[lk]},$$scope:{ctx:n}}}),N.$on("click",n[20]),B=new xe({props:{variant:n[1].isActive("link")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm underline",$$slots:{default:[ak]},$$scope:{ctx:n}}}),B.$on("click",n[6]),R=new xe({props:{disabled:!n[1].isActive("link"),class:"my-0.5 h-6 px-2 text-sm underline",$$slots:{default:[ck]},$$scope:{ctx:n}}}),R.$on("click",n[21]),$=new xe({props:{disabled:!n[1].can().chain().focus().undo().run(),class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[uk]},$$scope:{ctx:n}}}),$.$on("click",n[22]),ee=new xe({props:{disabled:!n[1].can().chain().focus().redo().run(),class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[dk]},$$scope:{ctx:n}}}),ee.$on("click",n[23]),te=new xe({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[fk]},$$scope:{ctx:n}}}),te.$on("click",n[4]),ze=new xe({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[pk]},$$scope:{ctx:n}}}),ze.$on("click",n[25]),Fe=new xe({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[hk]},$$scope:{ctx:n}}}),Fe.$on("click",Nf),{c(){e=Se("div"),t=Se("nav"),ge(r.$$.fragment),i=de(),ge(o.$$.fragment),s=de(),ge(l.$$.fragment),a=de(),ge(c.$$.fragment),u=de(),ge(d.$$.fragment),f=de(),ge(p.$$.fragment),h=de(),ge(m.$$.fragment),g=de(),ge(y.$$.fragment),k=de(),ge(C.$$.fragment),b=de(),ge(E.$$.fragment),v=de(),ge(O.$$.fragment),W=de(),ge(w.$$.fragment),H=de(),ge(q.$$.fragment),S=de(),ge(N.$$.fragment),P=de(),ge(B.$$.fragment),L=de(),ge(R.$$.fragment),_=de(),ge($.$$.fragment),K=de(),ge(ee.$$.fragment),ie=de(),ge(te.$$.fragment),Oe=de(),me=Se("input"),Ue=de(),ge(ze.$$.fragment),rt=de(),ge(Fe.$$.fragment),this.h()},l(M){e=Ce(M,"DIV",{});var D=mt(e);t=Ce(D,"NAV",{class:!0});var V=mt(t);be(r.$$.fragment,V),i=fe(V),be(o.$$.fragment,V),s=fe(V),be(l.$$.fragment,V),a=fe(V),be(c.$$.fragment,V),u=fe(V),be(d.$$.fragment,V),f=fe(V),be(p.$$.fragment,V),h=fe(V),be(m.$$.fragment,V),g=fe(V),be(y.$$.fragment,V),k=fe(V),be(C.$$.fragment,V),b=fe(V),be(E.$$.fragment,V),v=fe(V),be(O.$$.fragment,V),W=fe(V),be(w.$$.fragment,V),H=fe(V),be(q.$$.fragment,V),S=fe(V),be(N.$$.fragment,V),P=fe(V),be(B.$$.fragment,V),L=fe(V),be(R.$$.fragment,V),_=fe(V),be($.$$.fragment,V),K=fe(V),be(ee.$$.fragment,V),ie=fe(V),be(te.$$.fragment,V),Oe=fe(V),me=Ce(V,"INPUT",{type:!0,id:!0,style:!0}),Ue=fe(V),be(ze.$$.fragment,V),rt=fe(V),be(Fe.$$.fragment,V),V.forEach(U),D.forEach(U),this.h()},h(){lt(me,"type","file"),lt(me,"id","selectedFile"),Af(me,"display","none"),lt(t,"class","fixed top-0 z-10 w-full bg-white px-4 py-2 dark:bg-[color:hsl(222.2,84%,4.9%)] max-md:px-2")},m(M,D){ne(M,e,D),ce(e,t),ye(r,t,null),ce(t,i),ye(o,t,null),ce(t,s),ye(l,t,null),ce(t,a),ye(c,t,null),ce(t,u),ye(d,t,null),ce(t,f),ye(p,t,null),ce(t,h),ye(m,t,null),ce(t,g),ye(y,t,null),ce(t,k),ye(C,t,null),ce(t,b),ye(E,t,null),ce(t,v),ye(O,t,null),ce(t,W),ye(w,t,null),ce(t,H),ye(q,t,null),ce(t,S),ye(N,t,null),ce(t,P),ye(B,t,null),ce(t,L),ye(R,t,null),ce(t,_),ye($,t,null),ce(t,K),ye(ee,t,null),ce(t,ie),ye(te,t,null),ce(t,Oe),ce(t,me),ce(t,Ue),ye(ze,t,null),ce(t,rt),ye(Fe,t,null),it=!0,Nt||(Nn=[Ae(me,"change",n[24]),Ae(me,"change",n[5])],Nt=!0)},p(M,D){const V={};D[1]&2&&(V.$$scope={dirty:D,ctx:M}),r.$set(V);const Dt={};D[0]&2&&(Dt.disabled=!M[1].can().chain().focus().toggleBold().run()),D[0]&2&&(Dt.variant=M[1].isActive("bold")?"default":"secondary"),D[1]&2&&(Dt.$$scope={dirty:D,ctx:M}),o.$set(Dt);const It={};D[0]&2&&(It.disabled=!M[1].can().chain().focus().toggleItalic().run()),D[0]&2&&(It.variant=M[1].isActive("italic")?"default":"secondary"),D[1]&2&&(It.$$scope={dirty:D,ctx:M}),l.$set(It);const Ut={};D[0]&2&&(Ut.disabled=!M[1].can().chain().focus().toggleStrike().run()),D[0]&2&&(Ut.variant=M[1].isActive("strike")?"default":"secondary"),D[1]&2&&(Ut.$$scope={dirty:D,ctx:M}),c.$set(Ut);const qt={};D[0]&2&&(qt.disabled=!M[1].can().chain().focus().toggleCode().run()),D[0]&2&&(qt.variant=M[1].isActive("code")?"default":"secondary"),D[1]&2&&(qt.$$scope={dirty:D,ctx:M}),d.$set(qt);const ot={};D[0]&2&&(ot.variant=M[1].isActive("paragraph")?"default":"secondary"),D[1]&2&&(ot.$$scope={dirty:D,ctx:M}),p.$set(ot);const ut={};D[0]&2&&(ut.variant=M[1].isActive("heading",{level:1})?"default":"secondary"),D[1]&2&&(ut.$$scope={dirty:D,ctx:M}),m.$set(ut);const Kt={};D[0]&2&&(Kt.variant=M[1].isActive("heading",{level:2})?"default":"secondary"),D[1]&2&&(Kt.$$scope={dirty:D,ctx:M}),y.$set(Kt);const xt={};D[0]&2&&(xt.variant=M[1].isActive("heading",{level:3})?"default":"secondary"),D[1]&2&&(xt.$$scope={dirty:D,ctx:M}),C.$set(xt);const Jt={};D[0]&2&&(Jt.variant=M[1].isActive("bulletList")?"default":"secondary"),D[1]&2&&(Jt.$$scope={dirty:D,ctx:M}),E.$set(Jt);const nn={};D[0]&2&&(nn.variant=M[1].isActive("orderedList")?"default":"secondary"),D[1]&2&&(nn.$$scope={dirty:D,ctx:M}),O.$set(nn);const rn={};D[0]&2&&(rn.variant=M[1].isActive("codeBlock")?"default":"secondary"),D[1]&2&&(rn.$$scope={dirty:D,ctx:M}),w.$set(rn);const on={};D[0]&2&&(on.variant=M[1].isActive("blockquote")?"default":"secondary"),D[1]&2&&(on.$$scope={dirty:D,ctx:M}),q.$set(on);const Dn={};D[1]&2&&(Dn.$$scope={dirty:D,ctx:M}),N.$set(Dn);const Er={};D[0]&2&&(Er.variant=M[1].isActive("link")?"default":"secondary"),D[1]&2&&(Er.$$scope={dirty:D,ctx:M}),B.$set(Er);const Ar={};D[0]&2&&(Ar.disabled=!M[1].isActive("link")),D[1]&2&&(Ar.$$scope={dirty:D,ctx:M}),R.$set(Ar);const Nr={};D[0]&2&&(Nr.disabled=!M[1].can().chain().focus().undo().run()),D[1]&2&&(Nr.$$scope={dirty:D,ctx:M}),$.$set(Nr);const Dr={};D[0]&2&&(Dr.disabled=!M[1].can().chain().focus().redo().run()),D[1]&2&&(Dr.$$scope={dirty:D,ctx:M}),ee.$set(Dr);const gi={};D[1]&2&&(gi.$$scope={dirty:D,ctx:M}),te.$set(gi);const x={};D[1]&2&&(x.$$scope={dirty:D,ctx:M}),ze.$set(x);const z={};D[1]&2&&(z.$$scope={dirty:D,ctx:M}),Fe.$set(z)},i(M){it||(se(r.$$.fragment,M),se(o.$$.fragment,M),se(l.$$.fragment,M),se(c.$$.fragment,M),se(d.$$.fragment,M),se(p.$$.fragment,M),se(m.$$.fragment,M),se(y.$$.fragment,M),se(C.$$.fragment,M),se(E.$$.fragment,M),se(O.$$.fragment,M),se(w.$$.fragment,M),se(q.$$.fragment,M),se(N.$$.fragment,M),se(B.$$.fragment,M),se(R.$$.fragment,M),se($.$$.fragment,M),se(ee.$$.fragment,M),se(te.$$.fragment,M),se(ze.$$.fragment,M),se(Fe.$$.fragment,M),it=!0)},o(M){le(r.$$.fragment,M),le(o.$$.fragment,M),le(l.$$.fragment,M),le(c.$$.fragment,M),le(d.$$.fragment,M),le(p.$$.fragment,M),le(m.$$.fragment,M),le(y.$$.fragment,M),le(C.$$.fragment,M),le(E.$$.fragment,M),le(O.$$.fragment,M),le(w.$$.fragment,M),le(q.$$.fragment,M),le(N.$$.fragment,M),le(B.$$.fragment,M),le(R.$$.fragment,M),le($.$$.fragment,M),le(ee.$$.fragment,M),le(te.$$.fragment,M),le(ze.$$.fragment,M),le(Fe.$$.fragment,M),it=!1},d(M){M&&U(e),ve(r),ve(o),ve(l),ve(c),ve(d),ve(p),ve(m),ve(y),ve(C),ve(E),ve(O),ve(w),ve(q),ve(N),ve(B),ve(R),ve($),ve(ee),ve(te),ve(ze),ve(Fe),Nt=!1,Ro(Nn)}}}function J1(n){let e;return{c(){e=$e("N")},l(t){e=Be(t,"N")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function G1(n){let e,t="B";return{c(){e=Se("strong"),e.textContent=t},l(r){e=Ce(r,"STRONG",{"data-svelte-h":!0}),gn(e)!=="svelte-1dz6n38"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:Mn,d(r){r&&U(e)}}}function Y1(n){let e,t="I";return{c(){e=Se("i"),e.textContent=t},l(r){e=Ce(r,"I",{"data-svelte-h":!0}),gn(e)!=="svelte-14lqchx"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:Mn,d(r){r&&U(e)}}}function X1(n){let e,t="S";return{c(){e=Se("strike"),e.textContent=t},l(r){e=Ce(r,"STRIKE",{"data-svelte-h":!0}),gn(e)!=="svelte-rz7pbd"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:Mn,d(r){r&&U(e)}}}function Q1(n){let e,t="C";return{c(){e=Se("code"),e.textContent=t},l(r){e=Ce(r,"CODE",{"data-svelte-h":!0}),gn(e)!=="svelte-9f3k19"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:Mn,d(r){r&&U(e)}}}function Z1(n){let e;return{c(){e=$e("P")},l(t){e=Be(t,"P")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function ek(n){let e;return{c(){e=$e("H1")},l(t){e=Be(t,"H1")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function tk(n){let e;return{c(){e=$e("H2")},l(t){e=Be(t,"H2")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function nk(n){let e;return{c(){e=$e("H3")},l(t){e=Be(t,"H3")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function rk(n){let e;return{c(){e=$e("*UL")},l(t){e=Be(t,"*UL")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function ik(n){let e;return{c(){e=$e("1.OL")},l(t){e=Be(t,"1.OL")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function ok(n){let e="{..}",t;return{c(){t=$e(e)},l(r){t=Be(r,e)},m(r,i){ne(r,t,i)},p:Mn,d(r){r&&U(t)}}}function sk(n){let e=">..",t;return{c(){t=$e(e)},l(r){t=Be(r,e)},m(r,i){ne(r,t,i)},p:Mn,d(r){r&&U(t)}}}function lk(n){let e;return{c(){e=$e("--")},l(t){e=Be(t,"--")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function ak(n){let e;return{c(){e=$e("L")},l(t){e=Be(t,"L")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function ck(n){let e,t="L",r;return{c(){e=Se("strike"),r=$e(t)},l(i){e=Ce(i,"STRIKE",{});var o=mt(e);r=Be(o,t),o.forEach(U)},m(i,o){ne(i,e,o),ce(e,r)},p:Mn,d(i){i&&U(e)}}}function uk(n){let e;return{c(){e=$e("←")},l(t){e=Be(t,"←")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function dk(n){let e;return{c(){e=$e("→")},l(t){e=Be(t,"→")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function fk(n){let e;return{c(){e=$e("↓")},l(t){e=Be(t,"↓")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function pk(n){let e;return{c(){e=$e("↑")},l(t){e=Be(t,"↑")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function hk(n){let e;return{c(){e=$e("⛯")},l(t){e=Be(t,"⛯")},m(t,r){ne(t,e,r)},d(t){t&&U(e)}}}function su(n){let e,t,r="B",i,o,s,l,a="I",c,u,d,f,p="S",h,m,g,y,k="C",C,b,E;return{c(){e=Se("button"),t=Se("strong"),t.textContent=r,o=de(),s=Se("button"),l=Se("i"),l.textContent=a,u=de(),d=Se("button"),f=Se("strike"),f.textContent=p,m=de(),g=Se("button"),y=Se("code"),y.textContent=k,this.h()},l(v){e=Ce(v,"BUTTON",{class:!0});var O=mt(e);t=Ce(O,"STRONG",{"data-svelte-h":!0}),gn(t)!=="svelte-1dz6n38"&&(t.textContent=r),O.forEach(U),o=fe(v),s=Ce(v,"BUTTON",{class:!0});var W=mt(s);l=Ce(W,"I",{"data-svelte-h":!0}),gn(l)!=="svelte-14lqchx"&&(l.textContent=a),W.forEach(U),u=fe(v),d=Ce(v,"BUTTON",{class:!0});var w=mt(d);f=Ce(w,"STRIKE",{"data-svelte-h":!0}),gn(f)!=="svelte-rz7pbd"&&(f.textContent=p),w.forEach(U),m=fe(v),g=Ce(v,"BUTTON",{class:!0});var H=mt(g);y=Ce(H,"CODE",{"data-svelte-h":!0}),gn(y)!=="svelte-9f3k19"&&(y.textContent=k),H.forEach(U),this.h()},h(){lt(e,"class",i=n[1].isActive("bold")?"is-active":""),lt(s,"class",c=n[1].isActive("italic")?"is-active":""),lt(d,"class",h=n[1].isActive("strike")?"is-active":""),lt(g,"class",C=n[1].isActive("code")?"is-active":"")},m(v,O){ne(v,e,O),ce(e,t),ne(v,o,O),ne(v,s,O),ce(s,l),ne(v,u,O),ne(v,d,O),ce(d,f),ne(v,m,O),ne(v,g,O),ce(g,y),b||(E=[Ae(e,"click",n[26]),Ae(s,"click",n[27]),Ae(d,"click",n[28]),Ae(g,"click",n[29])],b=!0)},p(v,O){O[0]&2&&i!==(i=v[1].isActive("bold")?"is-active":"")&<(e,"class",i),O[0]&2&&c!==(c=v[1].isActive("italic")?"is-active":"")&<(s,"class",c),O[0]&2&&h!==(h=v[1].isActive("strike")?"is-active":"")&<(d,"class",h),O[0]&2&&C!==(C=v[1].isActive("code")?"is-active":"")&<(g,"class",C)},d(v){v&&(U(e),U(o),U(s),U(u),U(d),U(m),U(g)),b=!1,Ro(E)}}}function mk(n){let e,t,r,i,o,s=n[1]&&ou(n),l=n[1]&&su(n);return{c(){s&&s.c(),e=de(),t=Se("div"),l&&l.c(),r=de(),i=Se("div"),this.h()},l(a){s&&s.l(a),e=fe(a),t=Ce(a,"DIV",{class:!0});var c=mt(t);l&&l.l(c),c.forEach(U),r=fe(a),i=Ce(a,"DIV",{class:!0}),mt(i).forEach(U),this.h()},h(){lt(t,"class","bubble-menu"),lt(i,"class","p-4 max-md:px-2 max-md:pb-2 max-md:pt-4")},m(a,c){s&&s.m(a,c),ne(a,e,c),ne(a,t,c),l&&l.m(t,null),n[30](t),ne(a,r,c),ne(a,i,c),n[31](i),o=!0},p(a,c){a[1]?s?(s.p(a,c),c[0]&2&&se(s,1)):(s=ou(a),s.c(),se(s,1),s.m(e.parentNode,e)):s&&(au(),le(s,1,1,()=>{s=null}),cu()),a[1]?l?l.p(a,c):(l=su(a),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},i(a){o||(se(s),o=!0)},o(a){le(s),o=!1},d(a){a&&(U(e),U(t),U(r),U(i)),s&&s.d(a),l&&l.d(),n[30](null),n[31](null)}}}function gk(n,e,t){let r,i,o,s;Ef(async()=>{const $=localStorage.getItem("auto-saved")??'

Hello,

This is a note web app based on SvelteKit, Tiptap and shadcn/ui.

This note app essentially supports three types of headers, basic paragraph type, code block, unordered list, and ordered list types necessary for document creation.

Header types and basic paragraph types can be emphasized with formatting options such as bold, italic, and strike.

Links can be added or modified through the link button, and they can be removed using the link removal button.

The history feature is also provided through undo and redo actions.

Documents are basically stored in LocalStorage, and if you wish to save them permanently, you should use the provided save function to store them as HTML files. Additionally, you can upload these files to continue editing.

The theme supports both Light and Dark modes.

If you want more features, please visit the tiptap documentation and extend the functionality through extensions.


# H1: H1

## H2: H2

### H3: H3

`code`: code

**bold**: bold

*italic*: italic

~~strike~~: strike

- or * unordered list:

  • unordered list

1. ordered list:

  1. ordered list

```code block```:

```code block```

> block quote:

block quote

---:


cmd+z: undo

cmd+shift+z: redo

';t(1,i=new Cb({element:r,editorProps:{attributes:{class:"border-2 border-[color:hsl(222.2,84%,4.9%)] dark:border-white max-md:border-none rounded-lg mt-9 max-md:p-2 p-4 outline-none"}},extensions:[Cy,nv.configure({element:o}),Mv.configure({openOnClick:!1,autolink:!0})],onUpdate({editor:K}){try{localStorage.setItem("auto-saved",K.getHTML())}catch(ee){console.error(ee)}},content:$,onTransaction:()=>{t(1,i)}}))});function l(){let $=`note_${Date.now()}.html`,K=window.prompt("Please insert file name",$);if(K===null||K.trim().length===0){K=$;return}const ee=i.getHTML(),ie=` - `,te=document.createElement("a"),Oe=new Blob([ie,ee],{type:"text/html"});te.setAttribute("href",window.URL.createObjectURL(Oe)),te.setAttribute("download",K),te.click()}async function a(){s&&i.commands.setContent(await s[0].text())}function c(){const $=i.getAttributes("link").href,K=window.prompt("Please insert link url",$);if(K!==null){if(K===""){i.chain().focus().extendMarkRange("link").unsetLink().run();return}i.chain().focus().extendMarkRange("link").setLink({href:K}).run()}}function u(){i.commands.clearContent(),i.commands.focus()}const d=()=>i.chain().focus().toggleBold().run(),f=()=>i.chain().focus().toggleItalic().run(),p=()=>i.chain().focus().toggleStrike().run(),h=()=>i.chain().focus().toggleCode().run(),m=()=>i.chain().focus().setParagraph().run(),g=()=>i.chain().focus().toggleHeading({level:1}).run(),y=()=>i.chain().focus().toggleHeading({level:2}).run(),k=()=>i.chain().focus().toggleHeading({level:3}).run(),C=()=>i.chain().focus().toggleBulletList().run(),b=()=>i.chain().focus().toggleOrderedList().run(),A=()=>i.chain().focus().toggleCodeBlock().run(),v=()=>i.chain().focus().toggleBlockquote().run(),O=()=>i.chain().focus().setHorizontalRule().run(),W=()=>i.chain().focus().unsetLink().run(),w=()=>i.chain().focus().undo().run(),H=()=>i.chain().focus().redo().run();function q(){s=this.files,t(3,s)}const S=()=>{var $;return($=document.getElementById("selectedFile"))==null?void 0:$.click()},N=()=>i.chain().focus().toggleBold().run(),P=()=>i.chain().focus().toggleItalic().run(),B=()=>i.chain().focus().toggleStrike().run(),L=()=>i.chain().focus().toggleCode().run();function R($){Ls[$?"unshift":"push"](()=>{o=$,t(2,o)})}function _($){Ls[$?"unshift":"push"](()=>{r=$,t(0,r)})}return[r,i,o,s,l,a,c,u,d,f,p,h,m,g,y,k,C,b,A,v,O,W,w,H,q,S,N,P,B,L,R,_]}class bk extends Po{constructor(e){super(),Lo(this,e,gk,mk,Mr,{},null,[-1,-1])}}function yk(n){let e,t,r;return t=new bk({}),{c(){e=Se("main"),ge(t.$$.fragment)},l(i){e=Ce(i,"MAIN",{});var o=mt(e);be(t.$$.fragment,o),o.forEach(U)},m(i,o){ne(i,e,o),ye(t,e,null),r=!0},p:Mn,i(i){r||(se(t.$$.fragment,i),r=!0)},o(i){le(t.$$.fragment,i),r=!1},d(i){i&&U(e),ve(t)}}}class Ck extends Po{constructor(e){super(),Lo(this,e,null,yk,Mr,{})}}export{Ck as component}; + `,te=document.createElement("a"),Oe=new Blob([ie,ee],{type:"text/html"});te.setAttribute("href",window.URL.createObjectURL(Oe)),te.setAttribute("download",K),te.click()}async function a(){s&&i.commands.setContent(await s[0].text())}function c(){const $=i.getAttributes("link").href,K=window.prompt("Please insert link url",$);if(K!==null){if(K===""){i.chain().focus().extendMarkRange("link").unsetLink().run();return}i.chain().focus().extendMarkRange("link").setLink({href:K}).run()}}function u(){i.commands.clearContent(),i.commands.focus()}const d=()=>i.chain().focus().toggleBold().run(),f=()=>i.chain().focus().toggleItalic().run(),p=()=>i.chain().focus().toggleStrike().run(),h=()=>i.chain().focus().toggleCode().run(),m=()=>i.chain().focus().setParagraph().run(),g=()=>i.chain().focus().toggleHeading({level:1}).run(),y=()=>i.chain().focus().toggleHeading({level:2}).run(),k=()=>i.chain().focus().toggleHeading({level:3}).run(),C=()=>i.chain().focus().toggleBulletList().run(),b=()=>i.chain().focus().toggleOrderedList().run(),E=()=>i.chain().focus().toggleCodeBlock().run(),v=()=>i.chain().focus().toggleBlockquote().run(),O=()=>i.chain().focus().setHorizontalRule().run(),W=()=>i.chain().focus().unsetLink().run(),w=()=>i.chain().focus().undo().run(),H=()=>i.chain().focus().redo().run();function q(){s=this.files,t(3,s)}const S=()=>{var $;return($=document.getElementById("selectedFile"))==null?void 0:$.click()},N=()=>i.chain().focus().toggleBold().run(),P=()=>i.chain().focus().toggleItalic().run(),B=()=>i.chain().focus().toggleStrike().run(),L=()=>i.chain().focus().toggleCode().run();function R($){Ls[$?"unshift":"push"](()=>{o=$,t(2,o)})}function _($){Ls[$?"unshift":"push"](()=>{r=$,t(0,r)})}return[r,i,o,s,l,a,c,u,d,f,p,h,m,g,y,k,C,b,E,v,O,W,w,H,q,S,N,P,B,L,R,_]}class bk extends Po{constructor(e){super(),Lo(this,e,gk,mk,Mr,{},null,[-1,-1])}}function yk(n){let e,t,r;return t=new bk({}),{c(){e=Se("main"),ge(t.$$.fragment)},l(i){e=Ce(i,"MAIN",{});var o=mt(e);be(t.$$.fragment,o),o.forEach(U)},m(i,o){ne(i,e,o),ye(t,e,null),r=!0},p:Mn,i(i){r||(se(t.$$.fragment,i),r=!0)},o(i){le(t.$$.fragment,i),r=!1},d(i){i&&U(e),ve(t)}}}class Ck extends Po{constructor(e){super(),Lo(this,e,null,yk,Mr,{})}}export{Ck as component}; diff --git a/_app/version.json b/_app/version.json index f79fbfa..46ab682 100644 --- a/_app/version.json +++ b/_app/version.json @@ -1 +1 @@ -{"version":"1706371901367"} \ No newline at end of file +{"version":"1706373374610"} \ No newline at end of file diff --git a/index.html b/index.html index 2d490c4..bfc5218 100644 --- a/index.html +++ b/index.html @@ -7,17 +7,17 @@ - + - - + + - + - + -