From 4a99c78756a4dd2dea30f91588e6958fe9e757ef Mon Sep 17 00:00:00 2001 From: Jojo Ortiz Date: Wed, 27 Sep 2023 10:47:13 -0700 Subject: [PATCH] update latest build files --- pykoi/frontend/dist/assets/index-51debcf5.css | 1 + pykoi/frontend/dist/assets/index-6e8a727f.css | 1 - pykoi/frontend/dist/assets/index-e2e50638.js | 68 ++++++++++++++++++ pykoi/frontend/dist/assets/index-e352a05f.js | 70 ------------------- pykoi/frontend/dist/index.html | 4 +- 5 files changed, 71 insertions(+), 73 deletions(-) create mode 100644 pykoi/frontend/dist/assets/index-51debcf5.css delete mode 100644 pykoi/frontend/dist/assets/index-6e8a727f.css create mode 100644 pykoi/frontend/dist/assets/index-e2e50638.js delete mode 100644 pykoi/frontend/dist/assets/index-e352a05f.js diff --git a/pykoi/frontend/dist/assets/index-51debcf5.css b/pykoi/frontend/dist/assets/index-51debcf5.css new file mode 100644 index 0000000..f44f9cc --- /dev/null +++ b/pykoi/frontend/dist/assets/index-51debcf5.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css?family=Work+Sans:400|Lato:400|Inconsolata:400";:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:auto;width:100%}h1{font-size:3.2em;line-height:1.1}.card{padding:2em}#app{margin:0 auto;text-align:center}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}:root{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--yellow);--danger: var(--red);--background: var(--lightGrey);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--white);--footerBackground: var(--darkBlue);--footerTextColor: var(--lightGrey);--headerTextColor: var(--black);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--borderBottom: solid 2px var(--primary);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Inconsolata", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 0px}header{color:var(--headerTextColor);position:fixed;left:0;top:0;width:100%;height:var(--headerHeight);background:var(--headerBackground);border-bottom:var(--line);display:flex;justify-content:space-between;align-items:center;padding:0 var(--containerPadding)}footer{color:var(--footerTextColor);background-color:var(--footerBackground);padding:calc(var(--headerHeight) * .75) var(--containerPadding);text-align:center;position:absolute;bottom:0;width:100%}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:var(--buttonTextColor);background-color:var(--white);border:var(--line);border-radius:var(--borderRadius);padding:5px 25px;box-shadow:var(--shadow-s);transition:.3s ease-in-out box-shadow}.dark{--background: var(--black);--textColor: var(--lightGrey);--headerBackground: var(--darkGrey);--footerBackground: var(--darkGrey);--cardBg: var(--darkGrey);--buttonTextColor: var(--black)}.theme{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--green);--danger: var(--red);--background: var(--lightGrey);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--darkBlue);--footerBackground: var(--darkBlue);--footerTextColor: var(--lightGrey);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Work Sans", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 10px}:root{--left: 300px}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--yellow);--danger: var(--red);--background: var(--white);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--white);--footerBackground: var(--green);--footerTextColor: var(--black);--headerTextColor: var(--black);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--borderBottom: solid 2px var(--primary);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Work Sans", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 0px;--height: height: calc(100vh - var(--headerHeight))}html{box-sizing:border-box;font-size:var(--baseFontSize)}*,*:before,*:after{box-sizing:inherit}body{font-family:var(--bodyFont);font-weight:400;line-height:1.75;background:var(--background);color:var(--textColor)}header{color:var(--headerTextColor);margin-top:1%;height:var(--headerHeight);background:var(--headerBackground);font-size:var(--h5);display:flex;justify-content:space-between;align-items:center;padding:0 var(--containerPadding)}header nav a{color:var(--white);text-decoration:none}header nav a+a{margin-left:10px}footer{color:var(--footerTextColor);background-color:var(--footerBackground);padding:calc(var(--headerHeight) * .75) var(--containerPadding);text-align:center;bottom:0;width:100%}footer a{color:var(--footerTextColor)}footer nav a+a{margin-left:10px}footer p{margin-bottom:0;max-width:none}p{margin-bottom:1rem}p a,blockquote a{color:var(--textColor);text-decoration:none;border-bottom:var(--borderBottom)}h1,h2,h3,h4,h5{margin:3rem 0 1.38rem;font-family:var(--headingFont);font-weight:400;line-height:1.15}h1{margin-top:0;font-size:var(--h1)}h2{font-size:var(--h2)}h3{font-size:var(--h3)}h4{font-size:var(--h4)}h5{font-size:var(--h5)}small,.text_small{font-size:var(--smallText)}blockquote{margin:10px;padding:2em;background:var(--cardBg);box-shadow:var(--shadow-lg)}label{display:block;font-size:var(--smallText)}input,textarea{padding:2px 5px;border:var(--line);border-radius:4px}textarea{width:100%;height:5rem}::placeholder{color:var(--grey)}::selection,.highlight{background:#ffb7b7;background:var(--red);color:var(--white)}select{border:var(--line)}hr{border-top:var(--line)}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:var(--buttonTextColor);background-color:var(--white);border:var(--line);border-radius:var(--borderRadius);padding:10px 25px;box-shadow:var(--shadow-s);transition:.3s ease-in-out box-shadow}button:hover{cursor:pointer;box-shadow:var(--shadow-md)}button[disabled]{opacity:.4}button.cancel{--buttonColor: var(--danger);--buttonTextColor: var(--white)}button.small{font-size:var(--smallText)}.layout{padding-top:calc(0rem + var(--headerHeight))}.grid{--gridCols: 2;display:block;grid-template-columns:repeat(var(--gridCols),1fr)}.cols-3{--gridCols: 3}.cols-4{--gridCols: 4}.flex{--justifyContent: space-between;display:block;justify-content:var(--justifyContent)}.flex-around{--justifyContent: space-around}.card{padding:2em;background:var(--cardBg);box-shadow:var(--shadow-lg);border-radius:var(--borderRadius)}.grid-split{display:grid;grid-template-columns:33% 67%;gap:20px}@media only screen and (min-width: 600px){:root{--baseFontSize: 100%}.grid{display:grid}.flex{display:flex}}.logo{font-size:var(--baseFontSize);margin:0 0 0 8px}.dark{--background: var(--black);--textColor: var(--lightGrey);--headerBackground: var(--darkGrey);--footerBackground: var(--yellow);--cardBg: var(--darkGrey);--buttonTextColor: var(--black)}.oled{--black: #000;--cardBg: var(--darkGrey);--headerBackground: var(--darkGrey);--footerBackground: var(--darkGrey)}.theme{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--green);--danger: var(--red);--background: var(--lightGrey);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--darkBlue);--footerBackground: var(--darkBlue);--footerTextColor: var(--black);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Work Sans", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 10px}:root{--left: 25px}.grid-sidemenu{--gridCols: 2;display:grid;grid-template-columns:var(--left) 1fr}header{padding:0 15px 0 0}header nav a+a{margin-left:15px}.corner{margin-left:var(--left)}header nav a{color:var(--black);text-decoration:none}.page{padding:3em}.page-title{text-decoration:none;border-bottom:var(--borderBottom)}.card{padding:2em;background:var(--cardBg);box-shadow:var(--shadow-lg);border-radius:var(--borderRadius);font-size:var(--smallText)}.card:hover{box-shadow:var(--shadow-xl)}.card>*:first-child{margin-top:0}.card>*:last-child{margin-bottom:0}table{margin:auto}button{margin:5px}dialog.svelte-g384pz.svelte-g384pz{max-width:32em;border-radius:1em;border:none;padding:0}dialog.svelte-g384pz.svelte-g384pz::backdrop{background:rgba(0,0,0,.3)}dialog.svelte-g384pz>div.svelte-g384pz{padding:1em}dialog[open].svelte-g384pz.svelte-g384pz{animation:svelte-g384pz-zoom .3s cubic-bezier(.34,1.56,.64,1)}@keyframes svelte-g384pz-zoom{0%{transform:scale(.95)}to{transform:scale(1)}}dialog[open].svelte-g384pz.svelte-g384pz::backdrop{animation:svelte-g384pz-fade .2s ease-out}@keyframes svelte-g384pz-fade{0%{opacity:0}to{opacity:1}}button.svelte-g384pz.svelte-g384pz{display:block}.close-button.svelte-g384pz.svelte-g384pz{display:block;height:30px;width:30px;border-radius:50%;border:1px solid var(--grey);padding:0}.close-button.svelte-g384pz.svelte-g384pz:hover{background-color:var(--lightGrey)}.btn-container.svelte-g384pz.svelte-g384pz{display:flex;justify-content:flex-end}.btn-container.svelte-sy2m0x.svelte-sy2m0x{display:flex;justify-content:center;padding-top:1em}div.inputs.svelte-sy2m0x.svelte-sy2m0x{display:grid;grid-template-columns:max-content max-content;grid-gap:5px}div.inputs.svelte-sy2m0x label.svelte-sy2m0x{text-align:right}h4.svelte-sy2m0x.svelte-sy2m0x{margin:20px 0}.small-button.svelte-19cad35.svelte-19cad35{margin-left:10px;background:none;border:3px solid transparent;color:inherit;padding:6px 10px;cursor:pointer;box-shadow:none;font-size:var(--smallText)}.feedback-buttons.svelte-19cad35.svelte-19cad35{text-align:center;margin:auto;width:20%}.small-button.svelte-19cad35.svelte-19cad35:hover{box-shadow:var(--shadow-md)}.thumbs-up.svelte-19cad35.svelte-19cad35,.thumbs-up.svelte-19cad35.svelte-19cad35:hover,.thumbs-up.svelte-19cad35.svelte-19cad35::selection{background:var(--green)}.thumbs-down.svelte-19cad35.svelte-19cad35,.thumbs-down.svelte-19cad35.svelte-19cad35:hover,.thumbs-down.svelte-19cad35.svelte-19cad35::selection{background:var(--red)}.ranked-chat.svelte-19cad35.svelte-19cad35{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-19cad35.svelte-19cad35{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;align-items:center;padding:5px;width:100%;max-width:820px;margin:auto}.chat-input-textarea.svelte-19cad35.svelte-19cad35{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-19cad35.svelte-19cad35{display:flex;width:100%}.btnyousend.svelte-19cad35.svelte-19cad35{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-19cad35.svelte-19cad35{opacity:1}.green.svelte-19cad35.svelte-19cad35{border-bottom:2px solid var(--green)}.red.svelte-19cad35.svelte-19cad35{border-bottom:2px solid var(--red)}.instructions.svelte-19cad35.svelte-19cad35{text-align:center;padding:5%}.instructions.svelte-19cad35 h5.svelte-19cad35{text-align:left}.instructions.svelte-19cad35 p.svelte-19cad35{font-size:var(--smallText);text-align:left}.instructions.svelte-19cad35 button.svelte-19cad35{font-size:var(--smallText)}.ranked-feedback-container.svelte-19cad35.svelte-19cad35{display:grid;grid-template-columns:20% 80%}.underline.svelte-19cad35.svelte-19cad35{border-bottom:var(--line)}.bold.svelte-19cad35.svelte-19cad35{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-19cad35.svelte-19cad35{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-19cad35.svelte-19cad35{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-19cad35 .question.svelte-19cad35{text-align:left;border:1px solid var(--grey);padding:5px;background-color:var(--lightGrey)}.message-content.svelte-19cad35 .answer.svelte-19cad35{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-19cad35 .answers.svelte-19cad35{display:grid;grid-template-columns:100%;gap:0%;width:100%;margin:auto}#tooltip{position:absolute;bottom:100%;right:.78rem;transform:translate(50%);padding:.2rem .35rem;background:hsl(0,0%,20%);color:#fafafa;font-size:.95em;border-radius:.25rem;filter:drop-shadow(0 1px 2px hsla(0,0%,0%,.2));width:max-content}.tooltip #tooltip:before{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:.6em;height:.25em;background:inherit;clip-path:polygon(0% 0%,100% 0%,50% 100%)}.ranked-chat.svelte-au920n.svelte-au920n{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-au920n.svelte-au920n{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;align-items:center;padding:24px;width:100%;max-width:640px;margin:auto}.chat-input-textarea.svelte-au920n.svelte-au920n{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-au920n.svelte-au920n{display:flex;width:100%}.btnyousend.svelte-au920n.svelte-au920n{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-au920n.svelte-au920n{opacity:1}.green.svelte-au920n.svelte-au920n{border-bottom:2px solid var(--green)}.red.svelte-au920n.svelte-au920n{border-bottom:2px solid var(--red)}.instructions.svelte-au920n.svelte-au920n{text-align:center;padding:5%}.instructions.svelte-au920n h5.svelte-au920n{text-align:left}.instructions.svelte-au920n p.svelte-au920n{font-size:var(--smallText);text-align:left}.instructions.svelte-au920n button.svelte-au920n{font-size:var(--smallText)}.ranked-feedback-container.svelte-au920n.svelte-au920n{display:grid;grid-template-columns:20% 80%}.underline.svelte-au920n.svelte-au920n{border-bottom:var(--line)}.bold.svelte-au920n.svelte-au920n{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-au920n.svelte-au920n{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-au920n.svelte-au920n{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-au920n .question.svelte-au920n{text-align:left;border:1px solid var(--grey);padding:5px;margin-bottom:10px;background-color:var(--lightGrey)}.message-content.svelte-au920n .answer.svelte-au920n{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-au920n .answers.svelte-au920n{display:grid;grid-template-columns:49% 49%;gap:2%;width:100%;margin:auto}.multiselect.svelte-8o2wf2.svelte-8o2wf2{position:relative;max-width:200px}.selectBox.svelte-8o2wf2.svelte-8o2wf2{position:relative}.selectBox.svelte-8o2wf2 select.svelte-8o2wf2{width:100%;font-weight:700}.overSelect.svelte-8o2wf2.svelte-8o2wf2{position:absolute;left:0;right:0;top:0;bottom:0}.dropdown-content.svelte-8o2wf2.svelte-8o2wf2{position:absolute;top:100%;left:0;width:100%;border:1px #dadada solid;background-color:#fff;z-index:1}.source.svelte-1pk2e1k{text-align:left;background-color:var(--lightGrey);border:1px solid var(--grey);border-top:none;padding:0 5px;margin:0;color:var(--darkGrey);box-sizing:border-box}.source_tab.svelte-1pk2e1k{display:flex;justify-content:space-between;align-items:center;cursor:pointer}.source_content.svelte-1pk2e1k{border:1pt solid var(--grey);padding:5px;margin-bottom:5px;background-color:#fff;color:var(--darkGrey)}p.svelte-1pk2e1k{margin:0;padding:0}.source.svelte-1pk2e1k:nth-of-type(2){border-top:1px solid var(--grey)}.sources.svelte-1r759df{display:inline-block;text-align:left;padding:5px;border:1pt solid var(--grey)}.sources-header.svelte-1r759df{display:flex;justify-content:space-between;align-items:center;cursor:pointer}.box.svelte-iwm583.svelte-iwm583{margin-bottom:10px;padding:40px;border:1px solid #dee2e6;border-radius:0 0 .5rem .5rem;border-top:0}ul.svelte-iwm583.svelte-iwm583{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none;border-bottom:1px solid #dee2e6}li.svelte-iwm583.svelte-iwm583{margin-bottom:-1px}span.svelte-iwm583.svelte-iwm583{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem;display:block;padding:.5rem 1rem;cursor:pointer}span.svelte-iwm583.svelte-iwm583:hover{border-color:#e9ecef #e9ecef #dee2e6;color:#495057}li.svelte-iwm583>span.svelte-iwm583{color:var(--grey)}li.active.svelte-iwm583>span.svelte-iwm583{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.button-container.svelte-i9wciy{display:flex;justify-content:space-between}.note.svelte-i9wciy{font-size:var(--smallText);color:var(--gray)}.small-button.svelte-1u8cd0w{margin-left:10px;background:none;border:3px solid transparent;color:inherit;padding:6px 10px;cursor:pointer;box-shadow:none;font-size:var(--smallText)}.feedback-buttons.svelte-1u8cd0w{display:flex;text-align:center;margin:auto;width:20%}.small-button.svelte-1u8cd0w:hover{box-shadow:var(--shadow-md)}.thumbs-up.svelte-1u8cd0w,.thumbs-up.svelte-1u8cd0w:hover,.thumbs-up.svelte-1u8cd0w::selection{background:var(--green)}.thumbs-down.svelte-1u8cd0w,.thumbs-down.svelte-1u8cd0w:hover,.thumbs-down.svelte-1u8cd0w::selection{background:var(--red)}.chat-and-question.svelte-vgv4ev.svelte-vgv4ev{display:grid;grid-template-columns:20% 80%;width:100%}.ranked-chat.svelte-vgv4ev.svelte-vgv4ev{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-vgv4ev.svelte-vgv4ev{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;align-items:center;padding:5px;width:100%;max-width:820px;margin:auto}.chat-input-textarea.svelte-vgv4ev.svelte-vgv4ev{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-vgv4ev.svelte-vgv4ev{display:flex;width:100%}.btnyousend.svelte-vgv4ev.svelte-vgv4ev{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-vgv4ev.svelte-vgv4ev{opacity:1}.green.svelte-vgv4ev.svelte-vgv4ev{border-bottom:2px solid var(--green)}.red.svelte-vgv4ev.svelte-vgv4ev{border-bottom:2px solid var(--red)}.instructions.svelte-vgv4ev.svelte-vgv4ev{text-align:center;padding:5%}.instructions.svelte-vgv4ev h5.svelte-vgv4ev{text-align:left}.instructions.svelte-vgv4ev p.svelte-vgv4ev{font-size:var(--smallText);text-align:left}.instructions.svelte-vgv4ev button.svelte-vgv4ev{font-size:var(--smallText)}.ranked-feedback-container.svelte-vgv4ev.svelte-vgv4ev{display:grid;grid-template-columns:20% 80%}.underline.svelte-vgv4ev.svelte-vgv4ev{border-bottom:var(--line)}.bold{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-vgv4ev.svelte-vgv4ev{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-vgv4ev.svelte-vgv4ev{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-vgv4ev .question.svelte-vgv4ev{text-align:left;border:1px solid var(--grey);padding:5px;background-color:var(--lightGrey)}.message-content.svelte-vgv4ev .answer.svelte-vgv4ev{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-vgv4ev .answers.svelte-vgv4ev{display:grid;grid-template-columns:100%;gap:0%;width:100%;margin:auto}.rag-sources.svelte-vgv4ev.svelte-vgv4ev{display:flex}.tooltip{white-space:nowrap;position:relative;padding-top:.35rem;cursor:zoom-in}#tooltip{position:absolute;bottom:100%;right:.78rem;transform:translate(calc(100% - 120px));padding:.2rem .35rem;background:hsl(0,0%,20%);color:#fafafa;font-size:.95em;border-radius:.25rem;filter:drop-shadow(0 1px 2px hsla(0,0%,0%,.2));width:max-content}.tooltip #tooltip:before{content:"";position:absolute;top:100%;left:10px;width:.6em;height:.25em;background:inherit;clip-path:polygon(0% 0%,100% 0%,50% 100%)}.series.svelte-tg5p7i:focus{outline:none}.horizontal-bar-rect.selected.svelte-tg5p7i{stroke:var(--black);stroke-width:3}#stackedrect-holder.svelte-tg5p7i{height:100%;width:100%}.line.svelte-tg5p7i{stroke-width:3;stroke:var(--black);fill:none}.horizontal-bar-rect.svelte-tg5p7i{transition:opacity .3s}.horizontal-bar-rect.svelte-tg5p7i:hover{stroke:var(--black);stroke-width:3}.horizontal-bar-text.svelte-tg5p7i{transition:opacity .3s;stroke:var(--white);stroke-width:4px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill;pointer-events:none;font-size:var(--smallText)}.qa-card.svelte-szi0e{border:2px solid var(--black);display:flex;flex-direction:column;font-size:var(--smallText);padding:4px;margin:6px}.qa-card.svelte-szi0e:hover{border:3px solid var(--black)}.question.svelte-szi0e{background-color:var(--white);margin:0;padding:8px;border-bottom:1px solid var(--black)}.answer.svelte-szi0e{background-color:var(--lightGrey);margin:0;padding:8px}.feedback.svelte-szi0e{margin:0;padding:8px}.up.svelte-szi0e{background-color:var(--green)}.down.svelte-szi0e{background-color:var(--red)}.na.svelte-szi0e{background-color:var(--yellow)}.qa-container.svelte-1xv9cfi{border:2px solid var(--background);max-height:100%;overflow-y:auto}.chart-title.svelte-1oikip4{font-size:var(--smallText)}rect.svelte-1oikip4:hover{stroke:var(--black)}#stackedrect-holder.svelte-1oikip4{height:100%;width:100%}.axis-line.svelte-1oikip4{stroke-width:3;stroke:var(--black);fill:none}.axis-tick.svelte-1oikip4{stroke-width:1;fill:none;opacity:0;font-size:9px}.axis-text.svelte-1oikip4{font-size:calc(var(--smallText) * .9)}.svelte-kz2qh6{transition:all .3s}.chart-title.svelte-kz2qh6{font-size:var(--smallText)}rect.svelte-kz2qh6:hover{stroke:var(--black)}.histogram-container.svelte-kz2qh6{height:100%;width:100%}.axis-line.svelte-kz2qh6{stroke-width:3;stroke:var(--black);fill:none}.axis-tick.svelte-kz2qh6{stroke-width:1;fill:none;opacity:0;font-size:9px}.axis-text.svelte-kz2qh6{font-size:calc(var(--smallText) * .9)}.svelte-1pknxov{font-family:Lato}.card-container.svelte-1pknxov{border:2px solid var(--black);width:100%;height:100%;display:grid;grid-template-columns:100%;grid-template-rows:35% 50% 10%;padding:5px;box-sizing:border-box}.card-text.svelte-1pknxov{text-align:left;margin:0;padding:0 0 0 2px;font-weight:700;font-size:.8em}#feedback-dropdown.svelte-1pknxov{width:98%;border:none;border-bottom:1px solid var(--black);border-top:1px solid var(--black);font-size:var(--smallText);margin-bottom:1px}svg.svelte-1pknxov{width:100%;height:100%;border-bottom:1px solid var(--black)}.small.svelte-1pknxov{font-size:.6em}text.svelte-1pknxov{font-size:3rem;transition:opacity .3s;stroke:#fff;stroke-width:6px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill;pointer-events:none}.card-container.svelte-mchgj2{border:2px solid var(--black);width:100%;height:100%;display:grid;grid-template-columns:100%;grid-template-rows:35% 50% 10%;padding:5px;box-sizing:border-box}.card-text.svelte-mchgj2{text-align:left;margin:0;padding:0 0 0 2px;font-weight:700;font-size:.8em}#feedback-dropdown.svelte-mchgj2{width:98%;border:none;border-bottom:1px solid var(--black);border-top:1px solid var(--black);font-size:var(--smallText);margin-bottom:1px}svg.svelte-mchgj2{width:100%;height:100%;border-bottom:1px solid var(--black)}.small.svelte-mchgj2{font-size:.6em}text.svelte-mchgj2{font-size:3rem;transition:opacity .3s;stroke:#fff;stroke-width:6px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill;pointer-events:none}.ranked-chat.svelte-1nj8mt0.svelte-1nj8mt0{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.chat-input-holder.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;align-items:center;padding:24px;width:100%;max-width:640px;margin:auto}.chat-input-textarea.svelte-1nj8mt0.svelte-1nj8mt0{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;width:100%}.btnyousend.svelte-1nj8mt0.svelte-1nj8mt0{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-1nj8mt0.svelte-1nj8mt0{opacity:1}.instructions.svelte-1nj8mt0.svelte-1nj8mt0{text-align:center;padding:5%;border-right:var(--line)}.instructions.svelte-1nj8mt0 h5.svelte-1nj8mt0{text-align:left}.instructions.svelte-1nj8mt0 p.svelte-1nj8mt0{font-size:var(--smallText);text-align:left;margin:0}.instructions.svelte-1nj8mt0 button.svelte-1nj8mt0{font-size:var(--smallText)}.ranked-feedback-container.svelte-1nj8mt0.svelte-1nj8mt0{display:grid;grid-template-columns:20% 80%}.underline.svelte-1nj8mt0.svelte-1nj8mt0{border-bottom:var(--line)}.bold.svelte-1nj8mt0.svelte-1nj8mt0{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-1nj8mt0.svelte-1nj8mt0{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-1nj8mt0.svelte-1nj8mt0{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-1nj8mt0 .question.svelte-1nj8mt0{text-align:left;border:1px solid var(--grey);padding:5px;margin-bottom:10px;background-color:var(--lightGrey)}.message-content.svelte-1nj8mt0 .answer.svelte-1nj8mt0{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}option.svelte-1nj8mt0.svelte-1nj8mt0{font-weight:700;font-size:120%}p.svelte-1nj8mt0.svelte-1nj8mt0{margin:0}.svelte-1nna9rx{font-family:Lato}#chart-holder.svelte-1nna9rx{height:100%;width:100%}.axis-line.svelte-1nna9rx{stroke-width:3;stroke:#000;fill:none}.axis-tick.svelte-1nna9rx{stroke-width:2;stroke:#000;fill:none;opacity:.13}.axis-text.svelte-1nna9rx{font-family:Arial;font-size:12px}.bump-text.svelte-1nna9rx{font-size:12px;pointer-events:none}.model-path.svelte-1nna9rx{fill:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round}.model-path-outer.svelte-1nna9rx{fill:none;stroke-width:8;stroke-linecap:round;stroke-linejoin:round}.chart-subtitle.svelte-1nna9rx{font-size:12px}#bar-chart-holder.svelte-1y9gffu{height:100%;width:100%}.axis-text.svelte-1y9gffu{font-size:9px}.axis-line.svelte-1y9gffu{stroke-width:3;stroke:#000;fill:none}.label-text.svelte-1y9gffu{font-size:9px}.cell.svelte-hnulv9{max-height:40px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.cell.active.svelte-hnulv9{max-height:100%;overflow:visible;white-space:normal}.svelte-owgjbp.svelte-owgjbp{font-family:Lato,monospace}.table.svelte-owgjbp.svelte-owgjbp{margin:auto;width:90%}.pretty-pager.svelte-owgjbp.svelte-owgjbp{padding-top:1rem}.pretty-table.normal.svelte-owgjbp.svelte-owgjbp{font-size:15px}.pretty-table.normal.svelte-owgjbp th.svelte-owgjbp,.pretty-table.normal.svelte-owgjbp td.svelte-owgjbp{padding:3px 2px}.pretty-table.svelte-owgjbp th.svelte-owgjbp,.pretty-table.svelte-owgjbp td.svelte-owgjbp{vertical-align:top}.pretty-table.svelte-owgjbp thead th.svelte-owgjbp{text-transform:uppercase;font-weight:700;font-family:Work Sans,sans-serif;border-bottom:2px solid black}.pretty-table.svelte-owgjbp th.svelte-owgjbp{cursor:pointer}.pretty-table.svelte-owgjbp tbody td.cell-type-number.svelte-owgjbp,.pretty-table.svelte-owgjbp tbody td.cell-rank.svelte-owgjbp{text-align:right}.pretty-table.svelte-owgjbp tbody td.cell-type-number.svelte-owgjbp,.pretty-table.svelte-owgjbp tbody td.cell-rank.svelte-owgjbp{font-family:menlo,consolas,monaco,monospace;font-size:90%}.pretty-table.svelte-owgjbp tbody td.cell-rank.svelte-owgjbp{padding-right:1em;color:#666}table.pretty-table.svelte-owgjbp.svelte-owgjbp{border-collapse:collapse}table.pretty-table.svelte-owgjbp.svelte-owgjbp{border-collapse:collapse;table-layout:fixed}.pretty-table.svelte-owgjbp tr.svelte-owgjbp{border-bottom:1px solid #eee}td.active.svelte-owgjbp.svelte-owgjbp{max-height:100%;overflow:auto;color:red}td.svelte-owgjbp.svelte-owgjbp:not(.active){overflow:hidden;white-space:normal}tr.svelte-owgjbp.svelte-owgjbp:hover{background:#eee}.pretty-table.svelte-owgjbp.svelte-owgjbp{width:100%}#heatmap-holder.svelte-t6wv8i{height:100%;width:100%}.axis-text.svelte-t6wv8i,.chart-subtitle.svelte-t6wv8i{font-size:12px}.holder.svelte-1gze3r0.svelte-1gze3r0{height:100vh;width:100%;display:flex;justify-content:center;align-items:center}button.svelte-1gze3r0.svelte-1gze3r0{margin:0}.chart-captions.svelte-1gze3r0.svelte-1gze3r0{margin:auto;width:100%;text-align:left;height:100%}.chart-captions.svelte-1gze3r0 h4.svelte-1gze3r0{padding:0;margin:0}.instructions.svelte-1gze3r0.svelte-1gze3r0{text-align:left;padding-left:0}.instructions.svelte-1gze3r0 p.svelte-1gze3r0{font-size:var(--smallText);text-align:left}.instructions.svelte-1gze3r0 button.svelte-1gze3r0{font-size:var(--smallText)}.underline.svelte-1gze3r0.svelte-1gze3r0{border-bottom:var(--line)}.bold.svelte-1gze3r0.svelte-1gze3r0{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.instructions.svelte-1gze3r0.svelte-1gze3r0{border-right:1px solid #eee}.main-container.svelte-1gze3r0.svelte-1gze3r0{display:grid;grid-template-columns:20% 80%}.eval-container.svelte-1gze3r0.svelte-1gze3r0{display:grid;height:100vh;grid-template-rows:100%;grid-template-columns:65% 35%;padding:1rem}.left-charts.svelte-1gze3r0.svelte-1gze3r0{display:grid;grid-template-columns:100%;grid-template-rows:15% 60% 25%}.eval-table.svelte-1gze3r0.svelte-1gze3r0{margin:auto;width:100%}.right-charts.svelte-1gze3r0.svelte-1gze3r0{display:grid;grid-template-columns:100%;grid-template-rows:10% 33% 33%;gap:1%}.main-annotation-container.svelte-3wjb3y.svelte-3wjb3y{display:grid;grid-template-columns:100%;grid-template-rows:90% 10%;height:100vh;width:100%;margin:auto}.buttons.svelte-3wjb3y.svelte-3wjb3y{display:flex;background:var(--grey)}.rating-button.svelte-3wjb3y.svelte-3wjb3y{padding:10px;border:none}.rating-button.svelte-3wjb3y+.rating-button.svelte-3wjb3y{margin-left:-1px}.ranked-chat.svelte-3wjb3y.svelte-3wjb3y{display:grid;grid-template-columns:100%;grid-template-rows:100%;border:var(--line);margin:12px}.chat-input-holder.svelte-3wjb3y.svelte-3wjb3y{align-items:center;width:100%;margin:auto;border-top:var(--line)}.instructions.svelte-3wjb3y.svelte-3wjb3y{text-align:center;padding:5%}.instructions.svelte-3wjb3y h5.svelte-3wjb3y{text-align:left}.instructions.svelte-3wjb3y p.svelte-3wjb3y{font-size:var(--smallText);text-align:left}.instructions.svelte-3wjb3y button.svelte-3wjb3y{font-size:var(--smallText)}.annotation-container.svelte-3wjb3y.svelte-3wjb3y{display:grid;grid-template-columns:40% 60%}.underline.svelte-3wjb3y.svelte-3wjb3y{border-bottom:var(--line)}.bold.svelte-3wjb3y.svelte-3wjb3y{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-3wjb3y.svelte-3wjb3y{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-message-center.svelte-3wjb3y.svelte-3wjb3y{display:flex;flex-direction:column;padding:12px;box-sizing:border-box}.message-content.svelte-3wjb3y.svelte-3wjb3y{display:flex;flex-direction:column;box-sizing:border-box;display:block}.message-content.svelte-3wjb3y .question.svelte-3wjb3y{text-align:left;border:1px solid var(--grey);padding:5px;margin-bottom:10px;background-color:var(--lightGrey)}.message-content.svelte-3wjb3y .answer.svelte-3wjb3y{display:block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-3wjb3y .answers.svelte-3wjb3y{display:grid;grid-template-columns:100%;gap:2%;width:100%;margin:auto}svg.svelte-h2ab3o{background:conic-gradient(from 90deg at 1px 1px,#0000 90deg,rgba(0,0,0,.04) 0) 0 0/20px 20px;border:var(--line)}.file-circle-g.svelte-h2ab3o:hover{opacity:1}.bubble-file-text.svelte-h2ab3o{font-size:calc(.99 * var(--smallText));pointer-events:none;stroke:var(--white);stroke-width:4px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill}circle.svelte-h2ab3o{transition:all .3s ease}circle.svelte-h2ab3o:hover{stroke:var(--black);stroke-width:3}.table-container.svelte-16fb3tv.svelte-16fb3tv{margin:auto;width:100%;overflow-y:scroll;max-height:100%;height:100%;overflow-y:auto}table.svelte-16fb3tv.svelte-16fb3tv{width:100%;border-collapse:collapse;font-size:var(--smallText)}thead.svelte-16fb3tv th.svelte-16fb3tv{text-align:center;padding:5px;border-bottom:4px solid var(--grey);background-color:var(--lightGrey)}thead.svelte-16fb3tv th.svelte-16fb3tv:nth-child(1){text-align:left}tbody.svelte-16fb3tv tr.svelte-16fb3tv{border-bottom:var(--line)}tbody.svelte-16fb3tv tr.svelte-16fb3tv:nth-child(2n){background-color:var(--white)}tbody.svelte-16fb3tv td.svelte-16fb3tv{padding:10px}.is-flex.svelte-16fb3tv.svelte-16fb3tv{display:flex;justify-content:space-between;align-items:center;padding:10px}.button.svelte-16fb3tv.svelte-16fb3tv{padding:5px 10px;border:none;cursor:pointer;transition:background-color .3s ease}.button.is-disabled.svelte-16fb3tv.svelte-16fb3tv{cursor:not-allowed;color:#ccc}.button.svelte-16fb3tv.svelte-16fb3tv:not(.is-disabled):hover{background-color:#f2f2f2}.button.is-white.svelte-16fb3tv.svelte-16fb3tv{color:#000}.mx-1.svelte-16fb3tv.svelte-16fb3tv{margin-left:1em;margin-right:1em}.file-container.svelte-1lu6hos{display:grid;height:calc(100% - var(--headerHeight));align-items:center;justify-content:center}.upload-container.svelte-1lu6hos{margin:auto;max-width:100%;text-align:center}.charts-container.svelte-1lu6hos{height:calc(100vh - var(--headerHeight));display:grid;gap:2%;grid-template-columns:100%;grid-template-rows:50% 40%}.data-grid.svelte-1lu6hos{display:grid;grid-template-columns:45% 50%;gap:0;margin:auto;max-width:1200px;padding-top:20px}.upload-box.svelte-1lu6hos{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;max-height:50vh;margin:auto;border:5px dashed var(--grey);padding:20px;box-sizing:border-box}.feedback-container.svelte-14znspc{border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-columns:30% 70%;grid-template-rows:100%;width:90%;height:calc(100vh - var(--headerHeight))}.feedback-left.svelte-14znspc{border-bottom:var(--line);display:grid;grid-template-columns:100%;grid-template-rows:25% 25% 25% 12.5% 12.5%}.left-text.svelte-14znspc{text-align:center;border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-rows:100%;grid-template-columns:50% 50%}.left-confidence.svelte-14znspc{text-align:center;border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-rows:40% 55%}.left-question.svelte-14znspc,.left-filter.svelte-14znspc{border-bottom:var(--line);border-right:var(--line)}.feedback-right.svelte-14znspc{border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-columns:100%;grid-template-rows:30% 70%;grid-template-rows:0% 100%}.right-chart.svelte-14znspc{border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-columns:50% 50%;grid-template-rows:100%}.right-chart-1.svelte-14znspc,.right-chart-2.svelte-14znspc{border-right:var(--line)}.right-table.svelte-14znspc{border-bottom:var(--line);border-right:var(--line)}.card-1.svelte-14znspc{border-right:var(--line)} diff --git a/pykoi/frontend/dist/assets/index-6e8a727f.css b/pykoi/frontend/dist/assets/index-6e8a727f.css deleted file mode 100644 index 9767a75..0000000 --- a/pykoi/frontend/dist/assets/index-6e8a727f.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css?family=Work+Sans:400|Lato:400|Inconsolata:400";:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:auto;width:100%}h1{font-size:3.2em;line-height:1.1}.card{padding:2em}#app{margin:0 auto;text-align:center}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}:root{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--yellow);--danger: var(--red);--background: var(--lightGrey);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--white);--footerBackground: var(--darkBlue);--footerTextColor: var(--lightGrey);--headerTextColor: var(--black);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--borderBottom: solid 2px var(--primary);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Inconsolata", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 0px}header{color:var(--headerTextColor);position:fixed;left:0;top:0;width:100%;height:var(--headerHeight);background:var(--headerBackground);border-bottom:var(--line);display:flex;justify-content:space-between;align-items:center;padding:0 var(--containerPadding)}footer{color:var(--footerTextColor);background-color:var(--footerBackground);padding:calc(var(--headerHeight) * .75) var(--containerPadding);text-align:center;position:absolute;bottom:0;width:100%}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:var(--buttonTextColor);background-color:var(--white);border:var(--line);border-radius:var(--borderRadius);padding:5px 25px;box-shadow:var(--shadow-s);transition:.3s ease-in-out box-shadow}.dark{--background: var(--black);--textColor: var(--lightGrey);--headerBackground: var(--darkGrey);--footerBackground: var(--darkGrey);--cardBg: var(--darkGrey);--buttonTextColor: var(--black)}.theme{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--green);--danger: var(--red);--background: var(--lightGrey);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--darkBlue);--footerBackground: var(--darkBlue);--footerTextColor: var(--lightGrey);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Work Sans", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 10px}:root{--left: 300px}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--yellow);--danger: var(--red);--background: var(--white);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--white);--footerBackground: var(--green);--footerTextColor: var(--black);--headerTextColor: var(--black);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--borderBottom: solid 2px var(--primary);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Work Sans", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 0px;--height: height: calc(100vh - var(--headerHeight))}html{box-sizing:border-box;font-size:var(--baseFontSize)}*,*:before,*:after{box-sizing:inherit}body{font-family:var(--bodyFont);font-weight:400;line-height:1.75;background:var(--background);color:var(--textColor)}header{color:var(--headerTextColor);margin-top:1%;height:var(--headerHeight);background:var(--headerBackground);font-size:var(--h5);display:flex;justify-content:space-between;align-items:center;padding:0 var(--containerPadding)}header nav a{color:var(--white);text-decoration:none}header nav a+a{margin-left:10px}footer{color:var(--footerTextColor);background-color:var(--footerBackground);padding:calc(var(--headerHeight) * .75) var(--containerPadding);text-align:center;bottom:0;width:100%}footer a{color:var(--footerTextColor)}footer nav a+a{margin-left:10px}footer p{margin-bottom:0;max-width:none}p{margin-bottom:1rem}p a,blockquote a{color:var(--textColor);text-decoration:none;border-bottom:var(--borderBottom)}h1,h2,h3,h4,h5{margin:3rem 0 1.38rem;font-family:var(--headingFont);font-weight:400;line-height:1.15}h1{margin-top:0;font-size:var(--h1)}h2{font-size:var(--h2)}h3{font-size:var(--h3)}h4{font-size:var(--h4)}h5{font-size:var(--h5)}small,.text_small{font-size:var(--smallText)}blockquote{margin:10px;padding:2em;background:var(--cardBg);box-shadow:var(--shadow-lg)}label{display:block;font-size:var(--smallText)}input,textarea{padding:2px 5px;border:var(--line);border-radius:4px}textarea{width:100%;height:5rem}::placeholder{color:var(--grey)}::selection,.highlight{background:#ffb7b7;background:var(--red);color:var(--white)}select{border:var(--line)}hr{border-top:var(--line)}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:var(--buttonTextColor);background-color:var(--white);border:var(--line);border-radius:var(--borderRadius);padding:10px 25px;box-shadow:var(--shadow-s);transition:.3s ease-in-out box-shadow}button:hover{cursor:pointer;box-shadow:var(--shadow-md)}button[disabled]{opacity:.4}button.cancel{--buttonColor: var(--danger);--buttonTextColor: var(--white)}button.small{font-size:var(--smallText)}.layout{padding-top:calc(0rem + var(--headerHeight))}.grid{--gridCols: 2;display:block;grid-template-columns:repeat(var(--gridCols),1fr)}.cols-3{--gridCols: 3}.cols-4{--gridCols: 4}.flex{--justifyContent: space-between;display:block;justify-content:var(--justifyContent)}.flex-around{--justifyContent: space-around}.card{padding:2em;background:var(--cardBg);box-shadow:var(--shadow-lg);border-radius:var(--borderRadius)}.grid-split{display:grid;grid-template-columns:33% 67%;gap:20px}@media only screen and (min-width: 600px){:root{--baseFontSize: 100%}.grid{display:grid}.flex{display:flex}}.logo{font-size:var(--baseFontSize);margin:0 0 0 8px}.dark{--background: var(--black);--textColor: var(--lightGrey);--headerBackground: var(--darkGrey);--footerBackground: var(--yellow);--cardBg: var(--darkGrey);--buttonTextColor: var(--black)}.oled{--black: #000;--cardBg: var(--darkGrey);--headerBackground: var(--darkGrey);--footerBackground: var(--darkGrey)}.theme{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--green);--danger: var(--red);--background: var(--lightGrey);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--darkBlue);--footerBackground: var(--darkBlue);--footerTextColor: var(--black);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Work Sans", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 10px}:root{--left: 25px}.grid-sidemenu{--gridCols: 2;display:grid;grid-template-columns:var(--left) 1fr}header{padding:0 15px 0 0}header nav a+a{margin-left:15px}.corner{margin-left:var(--left)}header nav a{color:var(--black);text-decoration:none}.page{padding:3em}.page-title{text-decoration:none;border-bottom:var(--borderBottom)}.card{padding:2em;background:var(--cardBg);box-shadow:var(--shadow-lg);border-radius:var(--borderRadius);font-size:var(--smallText)}.card:hover{box-shadow:var(--shadow-xl)}.card>*:first-child{margin-top:0}.card>*:last-child{margin-bottom:0}table{margin:auto}button{margin:5px}.small-button.svelte-19cad35.svelte-19cad35{margin-left:10px;background:none;border:3px solid transparent;color:inherit;padding:6px 10px;cursor:pointer;box-shadow:none;font-size:var(--smallText)}.feedback-buttons.svelte-19cad35.svelte-19cad35{text-align:center;margin:auto;width:20%}.small-button.svelte-19cad35.svelte-19cad35:hover{box-shadow:var(--shadow-md)}.thumbs-up.svelte-19cad35.svelte-19cad35,.thumbs-up.svelte-19cad35.svelte-19cad35:hover,.thumbs-up.svelte-19cad35.svelte-19cad35::selection{background:var(--green)}.thumbs-down.svelte-19cad35.svelte-19cad35,.thumbs-down.svelte-19cad35.svelte-19cad35:hover,.thumbs-down.svelte-19cad35.svelte-19cad35::selection{background:var(--red)}.ranked-chat.svelte-19cad35.svelte-19cad35{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-19cad35.svelte-19cad35{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;align-items:center;padding:5px;width:100%;max-width:820px;margin:auto}.chat-input-textarea.svelte-19cad35.svelte-19cad35{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-19cad35.svelte-19cad35{display:flex;width:100%}.btnyousend.svelte-19cad35.svelte-19cad35{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-19cad35.svelte-19cad35{opacity:1}.green.svelte-19cad35.svelte-19cad35{border-bottom:2px solid var(--green)}.red.svelte-19cad35.svelte-19cad35{border-bottom:2px solid var(--red)}.instructions.svelte-19cad35.svelte-19cad35{text-align:center;padding:5%}.instructions.svelte-19cad35 h5.svelte-19cad35{text-align:left}.instructions.svelte-19cad35 p.svelte-19cad35{font-size:var(--smallText);text-align:left}.ranked-feedback-container.svelte-19cad35.svelte-19cad35{display:grid;grid-template-columns:20% 80%}.underline.svelte-19cad35.svelte-19cad35{border-bottom:var(--line)}.bold.svelte-19cad35.svelte-19cad35{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-19cad35.svelte-19cad35{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-19cad35.svelte-19cad35{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-19cad35 .question.svelte-19cad35{text-align:left;border:1px solid var(--grey);padding:5px;background-color:var(--lightGrey)}.message-content.svelte-19cad35 .answer.svelte-19cad35{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-19cad35 .answers.svelte-19cad35{display:grid;grid-template-columns:100%;gap:0%;width:100%;margin:auto}#tooltip{position:absolute;bottom:100%;right:.78rem;transform:translate(50%);padding:.2rem .35rem;background:hsl(0,0%,20%);color:#fafafa;font-size:.95em;border-radius:.25rem;filter:drop-shadow(0 1px 2px hsla(0,0%,0%,.2));width:max-content}.tooltip #tooltip:before{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:.6em;height:.25em;background:inherit;clip-path:polygon(0% 0%,100% 0%,50% 100%)}.ranked-chat.svelte-au920n.svelte-au920n{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-au920n.svelte-au920n{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;align-items:center;padding:24px;width:100%;max-width:640px;margin:auto}.chat-input-textarea.svelte-au920n.svelte-au920n{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-au920n.svelte-au920n{display:flex;width:100%}.btnyousend.svelte-au920n.svelte-au920n{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-au920n.svelte-au920n{opacity:1}.green.svelte-au920n.svelte-au920n{border-bottom:2px solid var(--green)}.red.svelte-au920n.svelte-au920n{border-bottom:2px solid var(--red)}.instructions.svelte-au920n.svelte-au920n{text-align:center;padding:5%}.instructions.svelte-au920n h5.svelte-au920n{text-align:left}.instructions.svelte-au920n p.svelte-au920n{font-size:var(--smallText);text-align:left}.instructions.svelte-au920n button.svelte-au920n{font-size:var(--smallText)}.ranked-feedback-container.svelte-au920n.svelte-au920n{display:grid;grid-template-columns:20% 80%}.underline.svelte-au920n.svelte-au920n{border-bottom:var(--line)}.bold.svelte-au920n.svelte-au920n{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-au920n.svelte-au920n{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-au920n.svelte-au920n{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-au920n .question.svelte-au920n{text-align:left;border:1px solid var(--grey);padding:5px;margin-bottom:10px;background-color:var(--lightGrey)}.message-content.svelte-au920n .answer.svelte-au920n{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-au920n .answers.svelte-au920n{display:grid;grid-template-columns:49% 49%;gap:2%;width:100%;margin:auto}.multiselect.svelte-8o2wf2.svelte-8o2wf2{position:relative;max-width:200px}.selectBox.svelte-8o2wf2.svelte-8o2wf2{position:relative}.selectBox.svelte-8o2wf2 select.svelte-8o2wf2{width:100%;font-weight:700}.overSelect.svelte-8o2wf2.svelte-8o2wf2{position:absolute;left:0;right:0;top:0;bottom:0}.dropdown-content.svelte-8o2wf2.svelte-8o2wf2{position:absolute;top:100%;left:0;width:100%;border:1px #dadada solid;background-color:#fff;z-index:1}.source.svelte-1pk2e1k{text-align:left;background-color:var(--lightGrey);border:1px solid var(--grey);border-top:none;padding:0 5px;margin:0;color:var(--darkGrey);box-sizing:border-box}.source_tab.svelte-1pk2e1k{display:flex;justify-content:space-between;align-items:center;cursor:pointer}.source_content.svelte-1pk2e1k{border:1pt solid var(--grey);padding:5px;margin-bottom:5px;background-color:#fff;color:var(--darkGrey)}p.svelte-1pk2e1k{margin:0;padding:0}.source.svelte-1pk2e1k:nth-of-type(2){border-top:1px solid var(--grey)}.sources.svelte-1r759df{display:inline-block;text-align:left;padding:5px;border:1pt solid var(--grey)}.sources-header.svelte-1r759df{display:flex;justify-content:space-between;align-items:center;cursor:pointer}.box.svelte-iwm583.svelte-iwm583{margin-bottom:10px;padding:40px;border:1px solid #dee2e6;border-radius:0 0 .5rem .5rem;border-top:0}ul.svelte-iwm583.svelte-iwm583{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none;border-bottom:1px solid #dee2e6}li.svelte-iwm583.svelte-iwm583{margin-bottom:-1px}span.svelte-iwm583.svelte-iwm583{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem;display:block;padding:.5rem 1rem;cursor:pointer}span.svelte-iwm583.svelte-iwm583:hover{border-color:#e9ecef #e9ecef #dee2e6;color:#495057}li.svelte-iwm583>span.svelte-iwm583{color:var(--grey)}li.active.svelte-iwm583>span.svelte-iwm583{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.button-container.svelte-i9wciy{display:flex;justify-content:space-between}.note.svelte-i9wciy{font-size:var(--smallText);color:var(--gray)}.small-button.svelte-1u8cd0w{margin-left:10px;background:none;border:3px solid transparent;color:inherit;padding:6px 10px;cursor:pointer;box-shadow:none;font-size:var(--smallText)}.feedback-buttons.svelte-1u8cd0w{display:flex;text-align:center;margin:auto;width:20%}.small-button.svelte-1u8cd0w:hover{box-shadow:var(--shadow-md)}.thumbs-up.svelte-1u8cd0w,.thumbs-up.svelte-1u8cd0w:hover,.thumbs-up.svelte-1u8cd0w::selection{background:var(--green)}.thumbs-down.svelte-1u8cd0w,.thumbs-down.svelte-1u8cd0w:hover,.thumbs-down.svelte-1u8cd0w::selection{background:var(--red)}.chat-and-question.svelte-aj7hp0.svelte-aj7hp0{display:grid;grid-template-columns:20% 80%;width:100%}.ranked-chat.svelte-aj7hp0.svelte-aj7hp0{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-aj7hp0.svelte-aj7hp0{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-aj7hp0.svelte-aj7hp0{display:flex;flex-direction:column;align-items:center;padding:5px;width:100%;max-width:820px;margin:auto}.chat-input-textarea.svelte-aj7hp0.svelte-aj7hp0{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-aj7hp0.svelte-aj7hp0{display:flex;width:100%}.btnyousend.svelte-aj7hp0.svelte-aj7hp0{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-aj7hp0.svelte-aj7hp0{opacity:1}.green.svelte-aj7hp0.svelte-aj7hp0{border-bottom:2px solid var(--green)}.red.svelte-aj7hp0.svelte-aj7hp0{border-bottom:2px solid var(--red)}.instructions.svelte-aj7hp0.svelte-aj7hp0{text-align:center;padding:5%}.instructions.svelte-aj7hp0 h5.svelte-aj7hp0{text-align:left}.instructions.svelte-aj7hp0 p.svelte-aj7hp0{font-size:var(--smallText);text-align:left}.ranked-feedback-container.svelte-aj7hp0.svelte-aj7hp0{display:grid;grid-template-columns:20% 80%}.underline.svelte-aj7hp0.svelte-aj7hp0{border-bottom:var(--line)}.bold{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-aj7hp0.svelte-aj7hp0{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-aj7hp0.svelte-aj7hp0{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-aj7hp0.svelte-aj7hp0{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-aj7hp0.svelte-aj7hp0{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-aj7hp0.svelte-aj7hp0{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-aj7hp0 .question.svelte-aj7hp0{text-align:left;border:1px solid var(--grey);padding:5px;background-color:var(--lightGrey)}.message-content.svelte-aj7hp0 .answer.svelte-aj7hp0{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-aj7hp0 .answers.svelte-aj7hp0{display:grid;grid-template-columns:100%;gap:0%;width:100%;margin:auto}.rag-sources.svelte-aj7hp0.svelte-aj7hp0{display:flex}.tooltip{white-space:nowrap;position:relative;padding-top:.35rem;cursor:zoom-in}#tooltip{position:absolute;bottom:100%;right:.78rem;transform:translate(calc(100% - 120px));padding:.2rem .35rem;background:hsl(0,0%,20%);color:#fafafa;font-size:.95em;border-radius:.25rem;filter:drop-shadow(0 1px 2px hsla(0,0%,0%,.2));width:max-content}.tooltip #tooltip:before{content:"";position:absolute;top:100%;left:10px;width:.6em;height:.25em;background:inherit;clip-path:polygon(0% 0%,100% 0%,50% 100%)}.series.svelte-tg5p7i:focus{outline:none}.horizontal-bar-rect.selected.svelte-tg5p7i{stroke:var(--black);stroke-width:3}#stackedrect-holder.svelte-tg5p7i{height:100%;width:100%}.line.svelte-tg5p7i{stroke-width:3;stroke:var(--black);fill:none}.horizontal-bar-rect.svelte-tg5p7i{transition:opacity .3s}.horizontal-bar-rect.svelte-tg5p7i:hover{stroke:var(--black);stroke-width:3}.horizontal-bar-text.svelte-tg5p7i{transition:opacity .3s;stroke:var(--white);stroke-width:4px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill;pointer-events:none;font-size:var(--smallText)}.qa-card.svelte-szi0e{border:2px solid var(--black);display:flex;flex-direction:column;font-size:var(--smallText);padding:4px;margin:6px}.qa-card.svelte-szi0e:hover{border:3px solid var(--black)}.question.svelte-szi0e{background-color:var(--white);margin:0;padding:8px;border-bottom:1px solid var(--black)}.answer.svelte-szi0e{background-color:var(--lightGrey);margin:0;padding:8px}.feedback.svelte-szi0e{margin:0;padding:8px}.up.svelte-szi0e{background-color:var(--green)}.down.svelte-szi0e{background-color:var(--red)}.na.svelte-szi0e{background-color:var(--yellow)}.qa-container.svelte-1xv9cfi{border:2px solid var(--background);max-height:100%;overflow-y:auto}.chart-title.svelte-1oikip4{font-size:var(--smallText)}rect.svelte-1oikip4:hover{stroke:var(--black)}#stackedrect-holder.svelte-1oikip4{height:100%;width:100%}.axis-line.svelte-1oikip4{stroke-width:3;stroke:var(--black);fill:none}.axis-tick.svelte-1oikip4{stroke-width:1;fill:none;opacity:0;font-size:9px}.axis-text.svelte-1oikip4{font-size:calc(var(--smallText) * .9)}.svelte-kz2qh6{transition:all .3s}.chart-title.svelte-kz2qh6{font-size:var(--smallText)}rect.svelte-kz2qh6:hover{stroke:var(--black)}.histogram-container.svelte-kz2qh6{height:100%;width:100%}.axis-line.svelte-kz2qh6{stroke-width:3;stroke:var(--black);fill:none}.axis-tick.svelte-kz2qh6{stroke-width:1;fill:none;opacity:0;font-size:9px}.axis-text.svelte-kz2qh6{font-size:calc(var(--smallText) * .9)}.svelte-1pknxov{font-family:Lato}.card-container.svelte-1pknxov{border:2px solid var(--black);width:100%;height:100%;display:grid;grid-template-columns:100%;grid-template-rows:35% 50% 10%;padding:5px;box-sizing:border-box}.card-text.svelte-1pknxov{text-align:left;margin:0;padding:0 0 0 2px;font-weight:700;font-size:.8em}#feedback-dropdown.svelte-1pknxov{width:98%;border:none;border-bottom:1px solid var(--black);border-top:1px solid var(--black);font-size:var(--smallText);margin-bottom:1px}svg.svelte-1pknxov{width:100%;height:100%;border-bottom:1px solid var(--black)}.small.svelte-1pknxov{font-size:.6em}text.svelte-1pknxov{font-size:3rem;transition:opacity .3s;stroke:#fff;stroke-width:6px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill;pointer-events:none}.card-container.svelte-mchgj2{border:2px solid var(--black);width:100%;height:100%;display:grid;grid-template-columns:100%;grid-template-rows:35% 50% 10%;padding:5px;box-sizing:border-box}.card-text.svelte-mchgj2{text-align:left;margin:0;padding:0 0 0 2px;font-weight:700;font-size:.8em}#feedback-dropdown.svelte-mchgj2{width:98%;border:none;border-bottom:1px solid var(--black);border-top:1px solid var(--black);font-size:var(--smallText);margin-bottom:1px}svg.svelte-mchgj2{width:100%;height:100%;border-bottom:1px solid var(--black)}.small.svelte-mchgj2{font-size:.6em}text.svelte-mchgj2{font-size:3rem;transition:opacity .3s;stroke:#fff;stroke-width:6px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill;pointer-events:none}.ranked-chat.svelte-1nj8mt0.svelte-1nj8mt0{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.chat-input-holder.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;align-items:center;padding:24px;width:100%;max-width:640px;margin:auto}.chat-input-textarea.svelte-1nj8mt0.svelte-1nj8mt0{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;width:100%}.btnyousend.svelte-1nj8mt0.svelte-1nj8mt0{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-1nj8mt0.svelte-1nj8mt0{opacity:1}.instructions.svelte-1nj8mt0.svelte-1nj8mt0{text-align:center;padding:5%;border-right:var(--line)}.instructions.svelte-1nj8mt0 h5.svelte-1nj8mt0{text-align:left}.instructions.svelte-1nj8mt0 p.svelte-1nj8mt0{font-size:var(--smallText);text-align:left;margin:0}.instructions.svelte-1nj8mt0 button.svelte-1nj8mt0{font-size:var(--smallText)}.ranked-feedback-container.svelte-1nj8mt0.svelte-1nj8mt0{display:grid;grid-template-columns:20% 80%}.underline.svelte-1nj8mt0.svelte-1nj8mt0{border-bottom:var(--line)}.bold.svelte-1nj8mt0.svelte-1nj8mt0{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-1nj8mt0.svelte-1nj8mt0{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-1nj8mt0.svelte-1nj8mt0{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-1nj8mt0 .question.svelte-1nj8mt0{text-align:left;border:1px solid var(--grey);padding:5px;margin-bottom:10px;background-color:var(--lightGrey)}.message-content.svelte-1nj8mt0 .answer.svelte-1nj8mt0{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}option.svelte-1nj8mt0.svelte-1nj8mt0{font-weight:700;font-size:120%}p.svelte-1nj8mt0.svelte-1nj8mt0{margin:0}.svelte-1nna9rx{font-family:Lato}#chart-holder.svelte-1nna9rx{height:100%;width:100%}.axis-line.svelte-1nna9rx{stroke-width:3;stroke:#000;fill:none}.axis-tick.svelte-1nna9rx{stroke-width:2;stroke:#000;fill:none;opacity:.13}.axis-text.svelte-1nna9rx{font-family:Arial;font-size:12px}.bump-text.svelte-1nna9rx{font-size:12px;pointer-events:none}.model-path.svelte-1nna9rx{fill:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round}.model-path-outer.svelte-1nna9rx{fill:none;stroke-width:8;stroke-linecap:round;stroke-linejoin:round}.chart-subtitle.svelte-1nna9rx{font-size:12px}#bar-chart-holder.svelte-1y9gffu{height:100%;width:100%}.axis-text.svelte-1y9gffu{font-size:9px}.axis-line.svelte-1y9gffu{stroke-width:3;stroke:#000;fill:none}.label-text.svelte-1y9gffu{font-size:9px}.cell.svelte-hnulv9{max-height:40px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.cell.active.svelte-hnulv9{max-height:100%;overflow:visible;white-space:normal}.svelte-owgjbp.svelte-owgjbp{font-family:Lato,monospace}.table.svelte-owgjbp.svelte-owgjbp{margin:auto;width:90%}.pretty-pager.svelte-owgjbp.svelte-owgjbp{padding-top:1rem}.pretty-table.normal.svelte-owgjbp.svelte-owgjbp{font-size:15px}.pretty-table.normal.svelte-owgjbp th.svelte-owgjbp,.pretty-table.normal.svelte-owgjbp td.svelte-owgjbp{padding:3px 2px}.pretty-table.svelte-owgjbp th.svelte-owgjbp,.pretty-table.svelte-owgjbp td.svelte-owgjbp{vertical-align:top}.pretty-table.svelte-owgjbp thead th.svelte-owgjbp{text-transform:uppercase;font-weight:700;font-family:Work Sans,sans-serif;border-bottom:2px solid black}.pretty-table.svelte-owgjbp th.svelte-owgjbp{cursor:pointer}.pretty-table.svelte-owgjbp tbody td.cell-type-number.svelte-owgjbp,.pretty-table.svelte-owgjbp tbody td.cell-rank.svelte-owgjbp{text-align:right}.pretty-table.svelte-owgjbp tbody td.cell-type-number.svelte-owgjbp,.pretty-table.svelte-owgjbp tbody td.cell-rank.svelte-owgjbp{font-family:menlo,consolas,monaco,monospace;font-size:90%}.pretty-table.svelte-owgjbp tbody td.cell-rank.svelte-owgjbp{padding-right:1em;color:#666}table.pretty-table.svelte-owgjbp.svelte-owgjbp{border-collapse:collapse}table.pretty-table.svelte-owgjbp.svelte-owgjbp{border-collapse:collapse;table-layout:fixed}.pretty-table.svelte-owgjbp tr.svelte-owgjbp{border-bottom:1px solid #eee}td.active.svelte-owgjbp.svelte-owgjbp{max-height:100%;overflow:auto;color:red}td.svelte-owgjbp.svelte-owgjbp:not(.active){overflow:hidden;white-space:normal}tr.svelte-owgjbp.svelte-owgjbp:hover{background:#eee}.pretty-table.svelte-owgjbp.svelte-owgjbp{width:100%}#heatmap-holder.svelte-t6wv8i{height:100%;width:100%}.axis-text.svelte-t6wv8i,.chart-subtitle.svelte-t6wv8i{font-size:12px}.holder.svelte-1gze3r0.svelte-1gze3r0{height:100vh;width:100%;display:flex;justify-content:center;align-items:center}button.svelte-1gze3r0.svelte-1gze3r0{margin:0}.chart-captions.svelte-1gze3r0.svelte-1gze3r0{margin:auto;width:100%;text-align:left;height:100%}.chart-captions.svelte-1gze3r0 h4.svelte-1gze3r0{padding:0;margin:0}.instructions.svelte-1gze3r0.svelte-1gze3r0{text-align:left;padding-left:0}.instructions.svelte-1gze3r0 p.svelte-1gze3r0{font-size:var(--smallText);text-align:left}.instructions.svelte-1gze3r0 button.svelte-1gze3r0{font-size:var(--smallText)}.underline.svelte-1gze3r0.svelte-1gze3r0{border-bottom:var(--line)}.bold.svelte-1gze3r0.svelte-1gze3r0{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.instructions.svelte-1gze3r0.svelte-1gze3r0{border-right:1px solid #eee}.main-container.svelte-1gze3r0.svelte-1gze3r0{display:grid;grid-template-columns:20% 80%}.eval-container.svelte-1gze3r0.svelte-1gze3r0{display:grid;height:100vh;grid-template-rows:100%;grid-template-columns:65% 35%;padding:1rem}.left-charts.svelte-1gze3r0.svelte-1gze3r0{display:grid;grid-template-columns:100%;grid-template-rows:15% 60% 25%}.eval-table.svelte-1gze3r0.svelte-1gze3r0{margin:auto;width:100%}.right-charts.svelte-1gze3r0.svelte-1gze3r0{display:grid;grid-template-columns:100%;grid-template-rows:10% 33% 33%;gap:1%}.main-annotation-container.svelte-3wjb3y.svelte-3wjb3y{display:grid;grid-template-columns:100%;grid-template-rows:90% 10%;height:100vh;width:100%;margin:auto}.buttons.svelte-3wjb3y.svelte-3wjb3y{display:flex;background:var(--grey)}.rating-button.svelte-3wjb3y.svelte-3wjb3y{padding:10px;border:none}.rating-button.svelte-3wjb3y+.rating-button.svelte-3wjb3y{margin-left:-1px}.ranked-chat.svelte-3wjb3y.svelte-3wjb3y{display:grid;grid-template-columns:100%;grid-template-rows:100%;border:var(--line);margin:12px}.chat-input-holder.svelte-3wjb3y.svelte-3wjb3y{align-items:center;width:100%;margin:auto;border-top:var(--line)}.instructions.svelte-3wjb3y.svelte-3wjb3y{text-align:center;padding:5%}.instructions.svelte-3wjb3y h5.svelte-3wjb3y{text-align:left}.instructions.svelte-3wjb3y p.svelte-3wjb3y{font-size:var(--smallText);text-align:left}.instructions.svelte-3wjb3y button.svelte-3wjb3y{font-size:var(--smallText)}.annotation-container.svelte-3wjb3y.svelte-3wjb3y{display:grid;grid-template-columns:40% 60%}.underline.svelte-3wjb3y.svelte-3wjb3y{border-bottom:var(--line)}.bold.svelte-3wjb3y.svelte-3wjb3y{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-3wjb3y.svelte-3wjb3y{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-message-center.svelte-3wjb3y.svelte-3wjb3y{display:flex;flex-direction:column;padding:12px;box-sizing:border-box}.message-content.svelte-3wjb3y.svelte-3wjb3y{display:flex;flex-direction:column;box-sizing:border-box;display:block}.message-content.svelte-3wjb3y .question.svelte-3wjb3y{text-align:left;border:1px solid var(--grey);padding:5px;margin-bottom:10px;background-color:var(--lightGrey)}.message-content.svelte-3wjb3y .answer.svelte-3wjb3y{display:block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-3wjb3y .answers.svelte-3wjb3y{display:grid;grid-template-columns:100%;gap:2%;width:100%;margin:auto}svg.svelte-h2ab3o{background:conic-gradient(from 90deg at 1px 1px,#0000 90deg,rgba(0,0,0,.04) 0) 0 0/20px 20px;border:var(--line)}.file-circle-g.svelte-h2ab3o:hover{opacity:1}.bubble-file-text.svelte-h2ab3o{font-size:calc(.99 * var(--smallText));pointer-events:none;stroke:var(--white);stroke-width:4px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill}circle.svelte-h2ab3o{transition:all .3s ease}circle.svelte-h2ab3o:hover{stroke:var(--black);stroke-width:3}.table-container.svelte-16fb3tv.svelte-16fb3tv{margin:auto;width:100%;overflow-y:scroll;max-height:100%;height:100%;overflow-y:auto}table.svelte-16fb3tv.svelte-16fb3tv{width:100%;border-collapse:collapse;font-size:var(--smallText)}thead.svelte-16fb3tv th.svelte-16fb3tv{text-align:center;padding:5px;border-bottom:4px solid var(--grey);background-color:var(--lightGrey)}thead.svelte-16fb3tv th.svelte-16fb3tv:nth-child(1){text-align:left}tbody.svelte-16fb3tv tr.svelte-16fb3tv{border-bottom:var(--line)}tbody.svelte-16fb3tv tr.svelte-16fb3tv:nth-child(2n){background-color:var(--white)}tbody.svelte-16fb3tv td.svelte-16fb3tv{padding:10px}.is-flex.svelte-16fb3tv.svelte-16fb3tv{display:flex;justify-content:space-between;align-items:center;padding:10px}.button.svelte-16fb3tv.svelte-16fb3tv{padding:5px 10px;border:none;cursor:pointer;transition:background-color .3s ease}.button.is-disabled.svelte-16fb3tv.svelte-16fb3tv{cursor:not-allowed;color:#ccc}.button.svelte-16fb3tv.svelte-16fb3tv:not(.is-disabled):hover{background-color:#f2f2f2}.button.is-white.svelte-16fb3tv.svelte-16fb3tv{color:#000}.mx-1.svelte-16fb3tv.svelte-16fb3tv{margin-left:1em;margin-right:1em}.file-container.svelte-1lu6hos{display:grid;height:calc(100% - var(--headerHeight));align-items:center;justify-content:center}.upload-container.svelte-1lu6hos{margin:auto;max-width:100%;text-align:center}.charts-container.svelte-1lu6hos{height:calc(100vh - var(--headerHeight));display:grid;gap:2%;grid-template-columns:100%;grid-template-rows:50% 40%}.data-grid.svelte-1lu6hos{display:grid;grid-template-columns:45% 50%;gap:0;margin:auto;max-width:1200px;padding-top:20px}.upload-box.svelte-1lu6hos{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;max-height:50vh;margin:auto;border:5px dashed var(--grey);padding:20px;box-sizing:border-box}.feedback-container.svelte-14znspc{border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-columns:30% 70%;grid-template-rows:100%;width:90%;height:calc(100vh - var(--headerHeight))}.feedback-left.svelte-14znspc{border-bottom:var(--line);display:grid;grid-template-columns:100%;grid-template-rows:25% 25% 25% 12.5% 12.5%}.left-text.svelte-14znspc{text-align:center;border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-rows:100%;grid-template-columns:50% 50%}.left-confidence.svelte-14znspc{text-align:center;border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-rows:40% 55%}.left-question.svelte-14znspc,.left-filter.svelte-14znspc{border-bottom:var(--line);border-right:var(--line)}.feedback-right.svelte-14znspc{border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-columns:100%;grid-template-rows:30% 70%;grid-template-rows:0% 100%}.right-chart.svelte-14znspc{border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-columns:50% 50%;grid-template-rows:100%}.right-chart-1.svelte-14znspc,.right-chart-2.svelte-14znspc{border-right:var(--line)}.right-table.svelte-14znspc{border-bottom:var(--line);border-right:var(--line)}.card-1.svelte-14znspc{border-right:var(--line)} diff --git a/pykoi/frontend/dist/assets/index-e2e50638.js b/pykoi/frontend/dist/assets/index-e2e50638.js new file mode 100644 index 0000000..d35a169 --- /dev/null +++ b/pykoi/frontend/dist/assets/index-e2e50638.js @@ -0,0 +1,68 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function H(){}const us=e=>e;function pn(e,t){for(const n in t)e[n]=t[n];return e}function cs(e){return e()}function Wr(){return Object.create(null)}function ve(e){e.forEach(cs)}function Je(e){return typeof e=="function"}function ae(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Ta(e){return Object.keys(e).length===0}function mr(e,...t){if(e==null)return H;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function xa(e){let t;return mr(e,n=>t=n)(),t}function ie(e,t,n){e.$$.on_destroy.push(mr(t,n))}function Oo(e,t,n,r){if(e){const o=fs(e,t,n,r);return e[0](o)}}function fs(e,t,n,r){return e[1]&&r?pn(n.ctx.slice(),e[1](r(t))):n.ctx}function Vo(e,t,n,r){if(e[2]&&r){const o=e[2](r(n));if(t.dirty===void 0)return o;if(typeof o=="object"){const i=[],l=Math.max(t.dirty.length,o.length);for(let a=0;a32){const t=[],n=e.ctx.length/32;for(let r=0;rwindow.performance.now():()=>Date.now(),bo=ds?e=>requestAnimationFrame(e):H;const Ht=new Set;function hs(e){Ht.forEach(t=>{t.c(e)||(Ht.delete(t),t.f())}),Ht.size!==0&&bo(hs)}function ps(e){let t;return Ht.size===0&&bo(hs),{promise:new Promise(n=>{Ht.add(t={c:e,f:n})}),abort(){Ht.delete(t)}}}let _r=!1;function Oa(){_r=!0}function Va(){_r=!1}function za(e,t,n,r){for(;e>1);n(o)<=r?e=o+1:t=o}return e}function Ha(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const s=[];for(let u=0;u0&&t[n[o]].claim_order<=u?o+1:za(1,o,d=>t[n[d]].claim_order,u))-1;r[s]=n[c]+1;const f=c+1;n[f]=s,o=Math.max(f,o)}const i=[],l=[];let a=t.length-1;for(let s=n[o]+1;s!=0;s=r[s-1]){for(i.push(t[s-1]);a>=s;a--)l.push(t[a]);a--}for(;a>=0;a--)l.push(t[a]);i.reverse(),l.sort((s,u)=>s.claim_order-u.claim_order);for(let s=0,u=0;s=i[u].claim_order;)u++;const c=ue.removeEventListener(t,n,r)}function ja(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function Ua(e){return function(t){t.target===this&&e.call(this,t)}}function h(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Wa(e){return Array.from(e.childNodes)}function Xa(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function Ya(e,t,n,r,o=!1){Xa(e);const i=(()=>{for(let l=e.claim_info.last_index;l=0;l--){const a=e[l];if(t(a)){const s=n(a);return s===void 0?e.splice(l,1):e[l]=s,o?s===void 0&&e.claim_info.last_index--:e.claim_info.last_index=l,a}}return r()})();return i.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,i}function Qa(e,t){return Ya(e,n=>n.nodeType===3,n=>{const r=""+t;if(n.data.startsWith(r)){if(n.data.length!==r.length)return n.splitText(r.length)}else n.data=r},()=>z(t),!0)}function ne(e,t){t=""+t,e.data!==t&&(e.data=t)}function Ue(e,t){e.value=t??""}function De(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,r?"important":"")}function Wn(e,t,n){for(let r=0;r{l.source===r.contentWindow&&t()})):(r.src="about:blank",r.onload=()=>{i=q(r.contentWindow,"resize",t),t()}),v(e,r),()=>{(o||i&&r.contentWindow)&&i(),P(r)}}function nn(e,t,n){e.classList[n?"add":"remove"](t)}function Ja(e,t,{bubbles:n=!1,cancelable:r=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,r,t),o}function bt(e,t){return new e(t)}const Xn=new Map;let Yn=0;function Za(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function eu(e,t){const n={stylesheet:La(t),rules:{}};return Xn.set(e,n),n}function qo(e,t,n,r,o,i,l,a=0){const s=16.666/r;let u=`{ +`;for(let _=0;_<=1;_+=s){const w=t+(n-t)*i(_);u+=_*100+`%{${l(w,1-w)}} +`}const c=u+`100% {${l(n,1-n)}} +}`,f=`__svelte_${Za(c)}_${a}`,d=ms(e),{stylesheet:g,rules:p}=Xn.get(d)||eu(d,e);p[f]||(p[f]=!0,g.insertRule(`@keyframes ${f} ${c}`,g.cssRules.length));const m=e.style.animation||"";return e.style.animation=`${m?`${m}, `:""}${f} ${r}ms linear ${o}ms 1 both`,Yn+=1,f}function tu(e,t){const n=(e.style.animation||"").split(", "),r=n.filter(t?i=>i.indexOf(t)<0:i=>i.indexOf("__svelte")===-1),o=n.length-r.length;o&&(e.style.animation=r.join(", "),Yn-=o,Yn||nu())}function nu(){bo(()=>{Yn||(Xn.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&P(t)}),Xn.clear())})}let jt;function Rt(e){jt=e}function ru(){if(!jt)throw new Error("Function called outside component initialization");return jt}function dt(e){ru().$$.on_mount.push(e)}function ou(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(r=>r.call(this,t))}const xt=[],ot=[];let Lt=[];const Xr=[],iu=Promise.resolve();let Yr=!1;function lu(){Yr||(Yr=!0,iu.then(vs))}function Ae(e){Lt.push(e)}function Qn(e){Xr.push(e)}const Cr=new Set;let It=0;function vs(){if(It!==0)return;const e=jt;do{try{for(;Ite.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),Lt=t}let Jt;function uu(){return Jt||(Jt=Promise.resolve(),Jt.then(()=>{Jt=null})),Jt}function kr(e,t,n){e.dispatchEvent(Ja(`${t?"intro":"outro"}${n}`))}const Hn=new Set;let at;function pe(){at={r:0,c:[],p:at}}function me(){at.r||ve(at.c),at=at.p}function N(e,t){e&&e.i&&(Hn.delete(e),e.i(t))}function x(e,t,n,r){if(e&&e.o){if(Hn.has(e))return;Hn.add(e),at.c.push(()=>{Hn.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}const cu={duration:0};function et(e,t,n,r){const o={direction:"both"};let i=t(e,n,o),l=r?0:1,a=null,s=null,u=null;function c(){u&&tu(e,u)}function f(g,p){const m=g.b-l;return p*=Math.abs(m),{a:l,b:g.b,d:m,duration:p,start:g.start,end:g.start+p,group:g.group}}function d(g){const{delay:p=0,duration:m=300,easing:_=us,tick:w=H,css:b}=i||cu,R={start:gs()+p,b:g};g||(R.group=at,at.r+=1),a||s?s=R:(b&&(c(),u=qo(e,l,g,m,p,_,b)),g&&w(0,1),a=f(R,m),Ae(()=>kr(e,g,"start")),ps(A=>{if(s&&A>s.start&&(a=f(s,m),s=null,kr(e,a.b,"start"),b&&(c(),u=qo(e,l,a.b,a.duration,0,_,i.css))),a){if(A>=a.end)w(l=a.b,1-l),kr(e,a.b,"end"),s||(a.b?c():--a.group.r||ve(a.group.c)),a=null;else if(A>=a.start){const $=A-a.start;l=a.a+a.d*_($/a.duration),w(l,1-l)}}return!!(a||s)}))}return{run(g){Je(i)?uu().then(()=>{i=i(o),d(g)}):d(g)},end(){c(),a=s=null}}}function vr(e,t){e.d(1),t.delete(e.key)}function bs(e,t){x(e,1,1,()=>{t.delete(e.key)})}function Qt(e,t,n,r,o,i,l,a,s,u,c,f){let d=e.length,g=i.length,p=d;const m={};for(;p--;)m[e[p].key]=p;const _=[],w=new Map,b=new Map,R=[];for(p=g;p--;){const S=f(o,i,p),k=n(S);let y=l.get(k);y?r&&R.push(()=>y.p(S,t)):(y=u(k,S),y.c()),w.set(k,_[p]=y),k in m&&b.set(k,Math.abs(p-m[k]))}const A=new Set,$=new Set;function M(S){N(S,1),S.m(a,c),l.set(S.key,S),c=S.first,g--}for(;d&&g;){const S=_[g-1],k=e[d-1],y=S.key,E=k.key;S===k?(c=S.first,d--,g--):w.has(E)?!l.has(y)||A.has(y)?M(S):$.has(E)?d--:b.get(y)>b.get(E)?($.add(y),M(S)):(A.add(E),d--):(s(k,l),d--)}for(;d--;){const S=e[d];w.has(S.key)||s(S,l)}for(;g;)M(_[g-1]);return ve(R),_}function ws(e,t){const n={},r={},o={$$scope:1};let i=e.length;for(;i--;){const l=e[i],a=t[i];if(a){for(const s in l)s in a||(r[s]=1);for(const s in a)o[s]||(n[s]=a[s],o[s]=1);e[i]=a}else for(const s in l)o[s]=1}for(const l in r)l in n||(n[l]=void 0);return n}function ys(e){return typeof e=="object"&&e!==null?e:{}}const fu=/[&"]/g,du=/[&<]/g;function gu(e,t=!1){const n=String(e),r=t?fu:du;r.lastIndex=0;let o="",i=0;for(;r.test(n);){const l=r.lastIndex-1,a=n[l];o+=n.substring(i,l)+(a==="&"?"&":a==='"'?""":"<"),i=l+1}return o+n.substring(i)}function hu(e,t){if(!e||!e.$$render)throw t==="svelte:component"&&(t+=" this={...}"),new Error(`<${t}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${t}>.`);return e}let $r;function Ss(e){function t(n,r,o,i,l){const a=jt,s={on_destroy:$r,context:new Map(l||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Wr()};Rt({$$:s});const u=e(n,r,o,i);return Rt(a),u}return{render:(n={},{$$slots:r={},context:o=new Map}={})=>{$r=[];const i={title:"",head:"",css:new Set},l=t(i,n,{},r,o);return ve($r),{html:l,css:{code:Array.from(i.css).map(a=>a.code).join(` +`),map:null},head:i.title+i.head}},$$render:t}}function Kn(e,t,n){const r=e.$$.props[t];r!==void 0&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function te(e){e&&e.c()}function pu(e,t){e&&e.l(t)}function Q(e,t,n,r){const{fragment:o,after_update:i}=e.$$;o&&o.m(t,n),r||Ae(()=>{const l=e.$$.on_mount.map(cs).filter(Je);e.$$.on_destroy?e.$$.on_destroy.push(...l):ve(l),e.$$.on_mount=[]}),i.forEach(Ae)}function K(e,t){const n=e.$$;n.fragment!==null&&(au(n.after_update),ve(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function mu(e,t){e.$$.dirty[0]===-1&&(xt.push(e),lu(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const p=g.length?g[0]:d;return u.ctx&&o(u.ctx[f],u.ctx[f]=p)&&(!u.skip_bound&&u.bound[f]&&u.bound[f](p),c&&mu(e,f)),d}):[],u.update(),c=!0,ve(u.before_update),u.fragment=r?r(u.ctx):!1,t.target){if(t.hydrate){Oa();const f=Wa(t.target);u.fragment&&u.fragment.l(f),f.forEach(P)}else u.fragment&&u.fragment.c();t.intro&&N(e.$$.fragment),Q(e,t.target,t.anchor,t.customElement),Va(),vs()}Rt(s)}class ue{$destroy(){K(this,1),this.$destroy=H}$on(t,n){if(!Je(n))return H;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const o=r.indexOf(n);o!==-1&&r.splice(o,1)}}$set(t){this.$$set&&!Ta(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Nt=[];function Qr(e,t){return{subscribe:Ee(e,t).subscribe}}function Ee(e,t=H){let n;const r=new Set;function o(a){if(ae(e,a)&&(e=a,n)){const s=!Nt.length;for(const u of r)u[1](),Nt.push(u,e);if(s){for(let u=0;u{r.delete(u),r.size===0&&n&&(n(),n=null)}}return{set:o,update:i,subscribe:l}}function _u(e,t,n){const r=!Array.isArray(e),o=r?[e]:e,i=t.length<2;return Qr(n,l=>{let a=!1;const s=[];let u=0,c=H;const f=()=>{if(u)return;c();const g=t(r?s[0]:s,l);i?l(g):c=Je(g)?g:H},d=o.map((g,p)=>mr(g,m=>{s[p]=m,u&=~(1<{u|=1<e;const n=typeof e;if(n!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const r=t.map((o,i)=>Kr(e[i],o));return o=>r.map(i=>i(o))}if(n==="object"){if(!e||!t)throw new Error("Object cannot be null");if(Go(e)&&Go(t)){e=e.getTime(),t=t.getTime();const i=t-e;return l=>new Date(e+l*i)}const r=Object.keys(t),o={};return r.forEach(i=>{o[i]=Kr(e[i],t[i])}),i=>{const l={};return r.forEach(a=>{l[a]=o[a](i)}),l}}if(n==="number"){const r=t-e;return o=>e+o*r}throw new Error(`Cannot interpolate ${n} values`)}function yo(e,t={}){const n=Ee(e);let r,o=e;function i(l,a){if(e==null)return n.set(e=l),Promise.resolve();o=l;let s=r,u=!1,{delay:c=0,duration:f=400,easing:d=us,interpolate:g=Kr}=pn(pn({},t),a);if(f===0)return s&&(s.abort(),s=null),n.set(e=o),Promise.resolve();const p=gs()+c;let m;return r=ps(_=>{if(_f?(n.set(e=l),!1):(n.set(e=m(d(w/f))),!0)}),r.promise}return{set:i,update:(l,a)=>i(l(o,e),a),subscribe:n.subscribe}}const Ve=Ee([]),Rr=Ee([]),Ar=Ee([]),_n=Ee([]),it=Ee("all"),Bo=Ee({"n/a":1,up:1,down:1}),vu=["who","what","how","why","where","does","can","n/a"],Jr=yo(vu.map(e=>({question:e,count:0}))),Zr=Ee(new Set);var eo="http://www.w3.org/1999/xhtml";const jo={svg:"http://www.w3.org/2000/svg",xhtml:eo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Cs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),jo.hasOwnProperty(t)?{space:jo[t],local:e}:e}function bu(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===eo&&t.documentElement.namespaceURI===eo?t.createElement(e):t.createElementNS(n,e)}}function wu(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ks(e){var t=Cs(e);return(t.local?wu:bu)(t)}function yu(){}function $s(e){return e==null?yu:function(){return this.querySelector(e)}}function Su(e){typeof e!="function"&&(e=$s(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o=R&&(R=b+1);!($=_[R])&&++R=0;)(l=r[o])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function Xu(e){e||(e=Yu);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,o=new Array(r),i=0;it?1:e>=t?0:NaN}function Qu(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ku(){return Array.from(this)}function Ju(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?uc:typeof t=="function"?fc:cc)(e,t,n??"")):gc(this.node(),e)}function gc(e,t){return e.style.getPropertyValue(t)||Es(e).getComputedStyle(e,null).getPropertyValue(t)}function hc(e){return function(){delete this[e]}}function pc(e,t){return function(){this[e]=t}}function mc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function _c(e,t){return arguments.length>1?this.each((t==null?hc:typeof t=="function"?mc:pc)(e,t)):this.node()[e]}function Fs(e){return e.trim().split(/^|\s+/)}function So(e){return e.classList||new Ds(e)}function Ds(e){this._node=e,this._names=Fs(e.getAttribute("class")||"")}Ds.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Is(e,t){for(var n=So(e),r=-1,o=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function jc(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n({}),Uo=e=>({});function ef(e){let t,n,r,o,i,l,a,s,u;const c=e[3].header,f=Oo(c,e,e[2],Uo),d=e[3].default,g=Oo(d,e,e[2],null);return{c(){t=C("dialog"),n=C("div"),r=C("div"),o=C("button"),o.textContent="X",i=F(),f&&f.c(),l=F(),g&&g.c(),h(o,"class","close-button svelte-g384pz"),h(r,"class","btn-container svelte-g384pz"),h(n,"class","svelte-g384pz"),h(t,"class","svelte-g384pz")},m(p,m){T(p,t,m),v(t,n),v(n,r),v(r,o),v(n,i),f&&f.m(n,null),v(n,l),g&&g.m(n,null),e[6](t),a=!0,s||(u=[q(o,"click",e[5]),q(n,"click",ja(e[4])),q(t,"close",e[7]),q(t,"click",Ua(e[8]))],s=!0)},p(p,[m]){f&&f.p&&(!a||m&4)&&zo(f,c,p,p[2],a?Vo(c,p[2],m,Zc):Ho(p[2]),Uo),g&&g.p&&(!a||m&4)&&zo(g,d,p,p[2],a?Vo(d,p[2],m,null):Ho(p[2]),null)},i(p){a||(N(f,p),N(g,p),a=!0)},o(p){x(f,p),x(g,p),a=!1},d(p){p&&P(t),f&&f.d(p),g&&g.d(p),e[6](null),s=!1,ve(u)}}}function tf(e,t,n){let{$$slots:r={},$$scope:o}=t,{showModal:i}=t,{dialog:l}=t;function a(d){ou.call(this,e,d)}const s=()=>l.close();function u(d){ot[d?"unshift":"push"](()=>{l=d,n(1,l)})}const c=()=>n(0,i=!1),f=()=>l.close();return e.$$set=d=>{"showModal"in d&&n(0,i=d.showModal),"dialog"in d&&n(1,l=d.dialog),"$$scope"in d&&n(2,o=d.$$scope)},e.$$.update=()=>{e.$$.dirty&3&&l&&i&&l.showModal()},[i,l,o,r,a,s,u,c,f]}class nf extends ue{constructor(t){super(),de(this,t,tf,ef,ae,{showModal:0,dialog:1})}}function rf(e){let t,n,r,o,i,l,a,s,u;return{c(){t=C("form"),n=C("div"),r=C("label"),r.textContent="Filename",o=F(),i=C("input"),l=F(),a=C("div"),a.innerHTML='',h(r,"for","file_name"),h(r,"class","svelte-sy2m0x"),h(i,"type","text"),h(i,"placeholder","Please enter filename"),h(i,"name","file_name"),i.required=!0,h(n,"class","inputs svelte-sy2m0x"),h(a,"class","btn-container svelte-sy2m0x")},m(c,f){T(c,t,f),v(t,n),v(n,r),v(n,o),v(n,i),Ue(i,e[2]),v(t,l),v(t,a),s||(u=[q(i,"input",e[5]),q(t,"submit",e[3])],s=!0)},p(c,f){f&4&&i.value!==c[2]&&Ue(i,c[2])},d(c){c&&P(t),s=!1,ve(u)}}}function of(e){let t;return{c(){t=C("h4"),t.textContent="Download Data",h(t,"slot","header"),h(t,"class","svelte-sy2m0x")},m(n,r){T(n,t,r)},p:H,d(n){n&&P(t)}}}function lf(e){let t,n,r,o;function i(s){e[6](s)}function l(s){e[7](s)}let a={$$slots:{header:[of],default:[rf]},$$scope:{ctx:e}};return e[0]!==void 0&&(a.showModal=e[0]),e[1]!==void 0&&(a.dialog=e[1]),t=new nf({props:a}),ot.push(()=>Kn(t,"showModal",i)),ot.push(()=>Kn(t,"dialog",l)),{c(){te(t.$$.fragment)},m(s,u){Q(t,s,u),o=!0},p(s,[u]){const c={};u&260&&(c.$$scope={dirty:u,ctx:s}),!n&&u&1&&(n=!0,c.showModal=s[0],Qn(()=>n=!1)),!r&&u&2&&(r=!0,c.dialog=s[1],Qn(()=>r=!1)),t.$set(c)},i(s){o||(N(t.$$.fragment,s),o=!0)},o(s){x(t.$$.fragment,s),o=!1},d(s){K(t,s)}}}function sf(e,t,n){let{showModal:r,table:o}=t,i,l="";const a=async f=>{f.preventDefault(),i.close();const d={file_name:l},p=await(await fetch(`/chat/${o}/save_to_csv`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})).json();console.log("Download Complete: ",p)};function s(){l=this.value,n(2,l)}function u(f){r=f,n(0,r)}function c(f){i=f,n(1,i)}return e.$$set=f=>{"showModal"in f&&n(0,r=f.showModal),"table"in f&&n(4,o=f.table)},[r,i,l,a,o,s,u,c]}class xs extends ue{constructor(t){super(),de(this,t,sf,lf,ae,{showModal:0,table:4})}}function Wo(e,t,n){const r=e.slice();return r[19]=t[n],r[21]=n,r}function Xo(e){let t,n,r,o,i,l;function a(...u){return e[12](e[21],...u)}function s(...u){return e[13](e[21],...u)}return{c(){t=C("div"),n=C("button"),n.textContent="👍",r=F(),o=C("button"),o.textContent="👎",h(n,"class","small-button thumbs-up svelte-19cad35"),h(o,"class","small-button thumbs-down svelte-19cad35"),h(t,"class","feedback-buttons svelte-19cad35")},m(u,c){T(u,t,c),v(t,n),v(t,r),v(t,o),i||(l=[q(n,"click",a),q(o,"click",s)],i=!0)},p(u,c){e=u},d(u){u&&P(t),i=!1,ve(l)}}}function Yo(e,t){let n,r,o,i,l,a,s,u,c,f=t[19].question+"",d,g,p,m,_,w,b,R=t[19].answer+"",A,$,M,S,k,y,E=t[0]&&Xo(t);return{key:e,first:null,c(){n=C("div"),r=C("div"),o=C("div"),i=F(),l=C("div"),a=C("div"),s=C("h5"),s.textContent="Question:",u=F(),c=C("p"),d=z(f),g=F(),p=C("div"),m=C("div"),_=C("h5"),_.textContent="Response:",w=F(),b=C("p"),A=z(R),$=F(),E&&E.c(),M=F(),h(o,"class","avatar"),h(s,"class","bold svelte-19cad35"),h(a,"class","question svelte-19cad35"),h(_,"class","bold svelte-19cad35"),h(m,"class","answer svelte-19cad35"),h(p,"class","answers svelte-19cad35"),h(l,"class","message-content svelte-19cad35"),h(r,"class","chat-message-center svelte-19cad35"),h(n,"class","chat-message svelte-19cad35"),this.first=n},m(D,I){T(D,n,I),v(n,r),v(r,o),v(r,i),v(r,l),v(l,a),v(a,s),v(a,u),v(a,c),v(c,d),v(l,g),v(l,p),v(p,m),v(m,_),v(m,w),v(m,b),v(b,A),v(m,$),E&&E.m(m,null),v(n,M),k||(y=mn(S=uf.call(null,n,t[21]===t[5].length-1)),k=!0)},p(D,I){t=D,I&32&&f!==(f=t[19].question+"")&&ne(d,f),I&32&&R!==(R=t[19].answer+"")&&ne(A,R),t[0]?E?E.p(t,I):(E=Xo(t),E.c(),E.m(m,null)):E&&(E.d(1),E=null),S&&Je(S.update)&&I&32&&S.update.call(null,t[21]===t[5].length-1)},d(D){D&&P(n),E&&E.d(),k=!1,y()}}}function af(e){let t,n,r,o,i,l,a,s,u,c,f,d,g,p,m=[],_=new Map,w,b,R,A,$,M,S=(e[3]?e[4]:"Send")+"",k,y,E,D,I,V,J;function ce(L){e[11](L)}let re={table:"qa_table"};e[1]!==void 0&&(re.showModal=e[1]),t=new xs({props:re}),ot.push(()=>Kn(t,"showModal",ce));let be=e[5];const ke=L=>L[21];for(let L=0;L👍 + button. If the repsonse is not satisfactory, click on the + 👎 button.`,u=F(),c=C("button"),c.textContent="Download Data",f=F(),d=C("div"),g=C("section"),p=C("div");for(let L=0;Ln=!1)),t.$set(he),G&161&&(be=L[5],m=Qt(m,G,ke,1,L,be,_,p,vr,Yo,null,Wo)),G&4&&A.value!==L[2]&&Ue(A,L[2]),(!I||G&24)&&S!==(S=(L[3]?L[4]:"Send")+"")&&ne(k,S),(!I||G&4&&y!==(y="btnyousend "+(L[2]===""?"":"active")+" svelte-19cad35"))&&h(M,"class",y)},i(L){I||(N(t.$$.fragment,L),I=!0)},o(L){x(t.$$.fragment,L),I=!1},d(L){K(t,L),L&&P(r),L&&P(o);for(let G=0;G{e.scrollIntoView({behavior:"smooth"})},0)}async function cf(e){const t=await fetch("/chat/qa_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function ff(e,t,n){let r,o;ie(e,Ve,A=>n(5,o=A));let i=!1,{feedback:l=!1}=t,{is_retrieval:a=!1}=t,s="",u="",c=!1;dt(()=>{f()});async function f(){const S=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map(k=>({id:k[0],question:k[1],answer:k[2],vote_status:k[3]}));He(Ve,o=[...S],o)}const d=async A=>{A.preventDefault(),s=u,n(2,u=""),n(3,c=!0);let $={id:o.length+1,question:s,answer:"Loading...",vote_status:"na"};He(Ve,o=[...o,$],o);const M=a?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:s})}):await fetch(`/chat/${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:s})});if(M.ok){const S=await M.json();console.log("response data",S),$.answer=S.answer,Ve.update(k=>(k[k.length-1]=$,k))}else{const S=await M.text();alert(S)}n(3,c=!1)};let g=0;setInterval(()=>{n(10,g=(g+1)%4)},200);function p(A,$,M){const S=o[M];S.vote=$;const k={id:M+1,vote_status:$};cf(k),ct(A.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),ct(A.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}function m(){n(1,i=!0)}[...Array(10).keys()].map(A=>String.fromCharCode(65+A));function _(A){i=A,n(1,i)}const w=(A,$)=>p($,"up",A),b=(A,$)=>p($,"down",A);function R(){u=this.value,n(2,u)}return e.$$set=A=>{"feedback"in A&&n(0,l=A.feedback),"is_retrieval"in A&&n(9,a=A.is_retrieval)},e.$$.update=()=>{e.$$.dirty&1024&&n(4,r=".".repeat(g).padEnd(3))},[l,i,u,c,r,o,d,p,m,a,g,_,w,b,R]}class Co extends ue{constructor(t){super(),de(this,t,ff,af,ae,{feedback:0,is_retrieval:9})}}function Qo(e,t,n){const r=e.slice();return r[14]=t[n],r[16]=n,r}function Ko(e,t){let n,r,o,i,l,a,s,u,c,f=t[14].question+"",d,g,p,m,_,w,b,R=t[14].up_ranking_answer+"",A,$,M,S,k,y,E=t[14].low_ranking_answer+"",D,I,V,J,ce;function re(...G){return t[7](t[14],t[16],...G)}function be(...G){return t[8](t[14],t[16],...G)}function ke(...G){return t[9](t[14],t[16],...G)}function L(...G){return t[10](t[14],t[16],...G)}return{key:e,first:null,c(){n=C("div"),r=C("div"),o=C("div"),i=F(),l=C("div"),a=C("div"),s=C("h5"),s.textContent="Question:",u=F(),c=C("p"),d=z(f),g=F(),p=C("div"),m=C("div"),_=C("h5"),_.textContent="Response 1:",w=F(),b=C("p"),A=z(R),$=F(),M=C("div"),S=C("h5"),S.textContent="Response 2:",k=F(),y=C("p"),D=z(E),I=F(),h(o,"class","avatar"),h(s,"class","bold svelte-au920n"),h(a,"class","question svelte-au920n"),h(_,"class","bold underline svelte-au920n"),h(m,"class","answer svelte-au920n"),h(S,"class","bold underline svelte-au920n"),h(M,"class","answer svelte-au920n"),h(p,"class","answers svelte-au920n"),h(l,"class","message-content svelte-au920n"),h(r,"class","chat-message-center svelte-au920n"),h(n,"class","chat-message svelte-au920n"),this.first=n},m(G,he){T(G,n,he),v(n,r),v(r,o),v(r,i),v(r,l),v(l,a),v(a,s),v(a,u),v(a,c),v(c,d),v(l,g),v(l,p),v(p,m),v(m,_),v(m,w),v(m,b),v(b,A),v(p,$),v(p,M),v(M,S),v(M,k),v(M,y),v(y,D),v(n,I),J||(ce=[q(m,"click",re),q(m,"keydown",be),q(M,"click",ke),q(M,"keydown",L),mn(V=gf.call(null,n,t[16]===t[3].length-1))],J=!0)},p(G,he){t=G,he&8&&f!==(f=t[14].question+"")&&ne(d,f),he&8&&R!==(R=t[14].up_ranking_answer+"")&&ne(A,R),he&8&&E!==(E=t[14].low_ranking_answer+"")&&ne(D,E),V&&Je(V.update)&&he&8&&V.update.call(null,t[16]===t[3].length-1)},d(G){G&&P(n),J=!1,ve(ce)}}}function df(e){let t,n,r,o,i,l,a=[],s=new Map,u,c,f,d,g,p,m=(e[1]?e[2]:"Send")+"",_,w,b,R,A,$,M=e[3];const S=k=>k[16];for(let k=0;kRanked Feedback Instructions +

Ask a question and click on the better of the two responses. The better + response will be outlined in green, the worse + response outlined in red. This data will be + automatically fed to RLHF.

+ `,r=F(),o=C("div"),i=C("section"),l=C("div");for(let k=0;k{e.scrollIntoView({behavior:"smooth"})},0)}async function hf(e){const t=await fetch("/chat/ranking_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function pf(e,t,n){let r,o;ie(e,Rr,_=>n(3,o=_));let i="",l="",a=!1;dt(()=>{});const s=async _=>{_.preventDefault(),i=l,n(0,l=""),n(1,a=!0);let w={question:i,up_ranking_answer:"Loading...",low_ranking_answer:"Loading..."};He(Rr,o=[...o,w],o);const b=await fetch(`/chat/multi_responses/${i}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:i})});if(b.ok){const R=await b.json();w.up_ranking_answer=R.answer[0],w.low_ranking_answer=R.answer[1],Rr.update(A=>(A[A.length-1]=w,A))}else{const R=await b.text();alert(R)}n(1,a=!1)};let u=0;setInterval(()=>{n(6,u=(u+1)%4)},200);function c(_,w,b,R){const A=o[b],$={1:"up_ranking_answer",2:"low_ranking_answer"},M={question:A.question,up_ranking_answer:A[$[R]],low_ranking_answer:A[$[R%2+1]]};hf(M),ct(_.currentTarget.parentNode).selectAll("div").style("outline","2px solid var(--red)").style("border","1px solid var(--red)"),ct(_.currentTarget).style("outline","2px solid var(--green)").style("border","1px solid var(--green)")}const f=(_,w,b)=>c(b,_,w,1),d=(_,w,b)=>c(b,_,w,1),g=(_,w,b)=>c(b,_,w,2),p=(_,w,b)=>c(b,_,w,2);function m(){l=this.value,n(0,l)}return e.$$.update=()=>{e.$$.dirty&64&&n(2,r=".".repeat(u).padEnd(3))},[l,a,r,o,s,c,u,f,d,g,p,m]}class mf extends ue{constructor(t){super(),de(this,t,pf,df,ae,{})}}function Jo(e,t,n){const r=e.slice();return r[8]=t[n],r[10]=n,r}function Zo(e){let t,n,r,o,i=e[8].name+"",l,a,s,u,c;function f(...d){return e[6](e[8],...d)}return{c(){t=C("label"),n=C("input"),l=z(i),a=F(),h(n,"type","checkbox"),h(n,"id",r=e[8].id),n.checked=o=e[1].has(e[8].name),h(t,"for",s=e[8].id)},m(d,g){T(d,t,g),v(t,n),v(t,l),v(t,a),u||(c=q(n,"change",f),u=!0)},p(d,g){e=d,g&1&&r!==(r=e[8].id)&&h(n,"id",r),g&3&&o!==(o=e[1].has(e[8].name))&&(n.checked=o),g&1&&i!==(i=e[8].name+"")&&ne(l,i),g&1&&s!==(s=e[8].id)&&h(t,"for",s)},d(d){d&&P(t),u=!1,c()}}}function _f(e){let t,n,r,o,i,l,a,s,u,c,f,d=e[0],g=[];for(let p=0;pn(1,r=f));let{documents:o=[]}=t,i=!1,l;function a(){n(2,i=!i)}function s(f,d){d.target.checked?r.add(f):r.delete(f),Zr.set(new Set(r))}const u=(f,d)=>s(f.name,d);function c(f){ot[f?"unshift":"push"](()=>{l=f,n(3,l)})}return e.$$set=f=>{"documents"in f&&n(0,o=f.documents)},e.$$.update=()=>{e.$$.dirty&2&&console.log(r)},[o,r,i,l,a,s,u,c]}let bf=class extends ue{constructor(t){super(),de(this,t,vf,_f,ae,{documents:0})}};function to(e,t=2){if(e===0)return"0 Bytes";const n=1024,r=t<0?0:t,o=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],i=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,i)).toFixed(r))+" "+o[i]}function wf(e){let t={who:0,what:0,how:0,why:0,where:0,does:0,can:0,"n/a":0};for(let r=0;r({question:r,count:t[r]}))}function Os(e){return e.map(t=>{const n=t.question.split(" ").length,r=t.answer.split(" ").length;return{index:t.index,question:+n,answer:+r,vote:t.vote}})}function yf(e,t){e.classList.add("tooltip"),e.setAttribute("tabindex",0);function n(){const o=document.createElement("span");o.textContent=t,o.setAttribute("id","tooltip"),e.appendChild(o),e.addEventListener("mouseleave",r),e.addEventListener("blur",r),e.removeEventListener("mouseenter",n),e.removeEventListener("focus",n)}function r(){e.removeChild(e.querySelector("#tooltip")),e.removeEventListener("mouseleave",r),e.removeEventListener("blur",r),e.addEventListener("mouseenter",n),e.addEventListener("focus",n)}return e.addEventListener("mouseenter",n),e.addEventListener("focus",n),{onDestroy(){e.classList.remove("tooltip"),e.removeEventListener("mouseenter",n),e.removeEventListener("focus",n)}}}function vn(e,{delay:t=0,duration:n=400,easing:r=wo,axis:o="y"}={}){const i=getComputedStyle(e),l=+i.opacity,a=o==="y"?"height":"width",s=parseFloat(i[a]),u=o==="y"?["top","bottom"]:["left","right"],c=u.map(w=>`${w[0].toUpperCase()}${w.slice(1)}`),f=parseFloat(i[`padding${c[0]}`]),d=parseFloat(i[`padding${c[1]}`]),g=parseFloat(i[`margin${c[0]}`]),p=parseFloat(i[`margin${c[1]}`]),m=parseFloat(i[`border${c[0]}Width`]),_=parseFloat(i[`border${c[1]}Width`]);return{delay:t,duration:n,easing:r,css:w=>`overflow: hidden;opacity: ${Math.min(w*20,1)*l};${a}: ${w*s}px;padding-${u[0]}: ${w*f}px;padding-${u[1]}: ${w*d}px;margin-${u[0]}: ${w*g}px;margin-${u[1]}: ${w*p}px;border-${u[0]}-width: ${w*m}px;border-${u[1]}-width: ${w*_}px;`}}function Mn(e,{delay:t=0,duration:n=400,easing:r=wo,start:o=0,opacity:i=0}={}){const l=getComputedStyle(e),a=+l.opacity,s=l.transform==="none"?"":l.transform,u=1-o,c=a*(1-i);return{delay:t,duration:n,easing:r,css:(f,d)=>` + transform: ${s} scale(${1-u*d}); + opacity: ${a-c*d} + `}}function Sf(e){let t;return{c(){t=C("p"),t.textContent="⌄",h(t,"class","svelte-1pk2e1k")},m(n,r){T(n,t,r)},d(n){n&&P(t)}}}function Cf(e){let t;return{c(){t=C("p"),t.textContent="⌃",h(t,"class","svelte-1pk2e1k")},m(n,r){T(n,t,r)},d(n){n&&P(t)}}}function ei(e){let t,n,r,o,i;return{c(){t=C("div"),n=C("p"),r=z(e[1]),h(n,"class","bold svelte-1pk2e1k"),h(t,"class","source_content svelte-1pk2e1k")},m(l,a){T(l,t,a),v(t,n),v(n,r),i=!0},p(l,a){(!i||a&2)&&ne(r,l[1])},i(l){i||(Ae(()=>{i&&(o||(o=et(t,vn,{},!0)),o.run(1))}),i=!0)},o(l){o||(o=et(t,vn,{},!1)),o.run(0),i=!1},d(l){l&&P(t),l&&o&&o.end()}}}function kf(e){let t,n,r,o=e[2]+1+"",i,l,a,s,u,c,f,d,g;function p(b,R){return b[3]?Cf:Sf}let m=p(e),_=m(e),w=e[3]&&ei(e);return{c(){t=C("div"),n=C("div"),r=C("p"),i=z(o),l=z(": "),a=z(e[0]),s=F(),_.c(),c=F(),w&&w.c(),h(r,"class","bold svelte-1pk2e1k"),h(n,"class","source_tab svelte-1pk2e1k"),h(t,"class","source svelte-1pk2e1k")},m(b,R){T(b,t,R),v(t,n),v(n,r),v(r,i),v(r,l),v(r,a),v(n,s),_.m(n,null),v(t,c),w&&w.m(t,null),f=!0,d||(g=q(n,"click",e[4]),d=!0)},p(b,[R]){(!f||R&4)&&o!==(o=b[2]+1+"")&&ne(i,o),(!f||R&1)&&ne(a,b[0]),m!==(m=p(b))&&(_.d(1),_=m(b),_&&(_.c(),_.m(n,null))),b[3]?w?(w.p(b,R),R&8&&N(w,1)):(w=ei(b),w.c(),N(w,1),w.m(t,null)):w&&(pe(),x(w,1,1,()=>{w=null}),me())},i(b){f||(Ae(()=>{f&&(u||(u=et(n,vn,{},!0)),u.run(1))}),N(w),f=!0)},o(b){u||(u=et(n,vn,{},!1)),u.run(0),x(w),f=!1},d(b){b&&P(t),_.d(),b&&u&&u.end(),w&&w.d(),d=!1,g()}}}function $f(e,t,n){let{source:r=""}=t,{source_content:o=""}=t,{i=0}=t,l=i===0;const a=()=>n(3,l=!l);return e.$$set=s=>{"source"in s&&n(0,r=s.source),"source_content"in s&&n(1,o=s.source_content),"i"in s&&n(2,i=s.i)},[r,o,i,l,a]}class Rf extends ue{constructor(t){super(),de(this,t,$f,kf,ae,{source:0,source_content:1,i:2})}}function ti(e,t,n){const r=e.slice();return r[4]=t[n],r[6]=n,r}function ni(e){let t,n,r,o;const i=[Ff,Ef,Mf,Af],l=[];function a(s,u){return s[0][0]==="N/A"?0:s[0][0]==="Loading..."?1:s[0][0]==="Not loaded"?2:3}return t=a(e),n=l[t]=i[t](e),{c(){n.c(),r=Ie()},m(s,u){l[t].m(s,u),T(s,r,u),o=!0},p(s,u){let c=t;t=a(s),t===c?l[t].p(s,u):(pe(),x(l[c],1,1,()=>{l[c]=null}),me(),n=l[t],n?n.p(s,u):(n=l[t]=i[t](s),n.c()),N(n,1),n.m(r.parentNode,r))},i(s){o||(N(n),o=!0)},o(s){x(n),o=!1},d(s){l[t].d(s),s&&P(r)}}}function Af(e){let t,n,r,o=e[0].length+"",i,l,a,s,u,c,f,d;function g(w,b){return w[2]?If:Df}let p=g(e),m=p(e),_=e[2]&&ri(e);return{c(){t=C("div"),n=C("h5"),r=z("📖 Response Sources ("),i=z(o),l=z(")"),a=F(),m.c(),s=F(),_&&_.c(),u=Ie(),h(n,"class","bold"),h(t,"class","sources-header svelte-1r759df")},m(w,b){T(w,t,b),v(t,n),v(n,r),v(n,i),v(n,l),v(t,a),m.m(t,null),T(w,s,b),_&&_.m(w,b),T(w,u,b),c=!0,f||(d=q(t,"click",e[3]),f=!0)},p(w,b){(!c||b&1)&&o!==(o=w[0].length+"")&&ne(i,o),p!==(p=g(w))&&(m.d(1),m=p(w),m&&(m.c(),m.m(t,null))),w[2]?_?(_.p(w,b),b&4&&N(_,1)):(_=ri(w),_.c(),N(_,1),_.m(u.parentNode,u)):_&&(pe(),x(_,1,1,()=>{_=null}),me())},i(w){c||(N(_),c=!0)},o(w){x(_),c=!1},d(w){w&&P(t),m.d(),w&&P(s),_&&_.d(w),w&&P(u),f=!1,d()}}}function Mf(e){let t;return{c(){t=C("h5"),t.textContent="⚠️ No sources loaded",h(t,"class","bold")},m(n,r){T(n,t,r)},p:H,i:H,o:H,d(n){n&&P(t)}}}function Ef(e){let t;return{c(){t=C("h5"),t.textContent="📖 Loading...",h(t,"class","bold")},m(n,r){T(n,t,r)},p:H,i:H,o:H,d(n){n&&P(t)}}}function Ff(e){let t;return{c(){t=C("h5"),t.textContent="⚠️ No Retrieval Sources selected",h(t,"class","bold")},m(n,r){T(n,t,r)},p:H,i:H,o:H,d(n){n&&P(t)}}}function Df(e){let t;return{c(){t=C("span"),t.textContent="⌄"},m(n,r){T(n,t,r)},d(n){n&&P(t)}}}function If(e){let t;return{c(){t=C("span"),t.textContent="⌃"},m(n,r){T(n,t,r)},d(n){n&&P(t)}}}function ri(e){let t,n,r=e[0],o=[];for(let l=0;lx(o[l],1,1,()=>{o[l]=null});return{c(){for(let l=0;l{r=null}),me())},i(o){n||(N(r),n=!0)},o(o){x(r),n=!1},d(o){o&&P(t),r&&r.d()}}}function Pf(e,t,n){let{sources:r=[]}=t,{source_content:o=[]}=t,i=!1;const l=()=>n(2,i=!i);return e.$$set=a=>{"sources"in a&&n(0,r=a.sources),"source_content"in a&&n(1,o=a.source_content)},[r,o,i,l]}class Tf extends ue{constructor(t){super(),de(this,t,Pf,Nf,ae,{sources:0,source_content:1})}}function ii(e,t,n){const r=e.slice();return r[4]=t[n],r}function li(e,t,n){const r=e.slice();return r[4]=t[n],r}function si(e){let t,n,r,o=e[4].label+"",i,l,a,s,u;return{c(){t=C("li"),n=C("span"),r=C("h5"),i=z(o),l=F(),h(r,"class","bold"),h(n,"class","svelte-iwm583"),h(t,"class",a=Lo(e[0]===e[4].value?"active":"")+" svelte-iwm583")},m(c,f){T(c,t,f),v(t,n),v(n,r),v(r,i),v(t,l),s||(u=q(n,"click",function(){Je(e[3](e[4].value))&&e[3](e[4].value).apply(this,arguments)}),s=!0)},p(c,f){e=c,f&2&&o!==(o=e[4].label+"")&&ne(i,o),f&3&&a!==(a=Lo(e[0]===e[4].value?"active":"")+" svelte-iwm583")&&h(t,"class",a)},d(c){c&&P(t),s=!1,u()}}}function ai(e){let t,n,r,o;const i=[e[2]];var l=e[4].component;function a(s){let u={};for(let c=0;c{K(f,1)}),me()}l?(n=bt(l,a()),te(n.$$.fragment),N(n.$$.fragment,1),Q(n,t,r)):n=null}else l&&n.$set(c)},i(s){o||(n&&N(n.$$.fragment,s),o=!0)},o(s){n&&x(n.$$.fragment,s),o=!1},d(s){s&&P(t),n&&K(n)}}}function ui(e){let t,n,r=e[0]==e[4].value&&ai(e);return{c(){r&&r.c(),t=Ie()},m(o,i){r&&r.m(o,i),T(o,t,i),n=!0},p(o,i){o[0]==o[4].value?r?(r.p(o,i),i&3&&N(r,1)):(r=ai(o),r.c(),N(r,1),r.m(t.parentNode,t)):r&&(pe(),x(r,1,1,()=>{r=null}),me())},i(o){n||(N(r),n=!0)},o(o){x(r),n=!1},d(o){r&&r.d(o),o&&P(t)}}}function xf(e){let t,n,r,o,i=e[1],l=[];for(let c=0;cx(s[c],1,1,()=>{s[c]=null});return{c(){t=C("ul");for(let c=0;c()=>n(0,o=a);return e.$$set=a=>{"items"in a&&n(1,r=a.items),"activeTabValue"in a&&n(0,o=a.activeTabValue),"tabProps"in a&&n(2,i=a.tabProps)},[o,r,i,l]}class Vf extends ue{constructor(t){super(),de(this,t,Of,xf,ae,{items:1,activeTabValue:0,tabProps:2})}}function ci(e){let t;return{c(){t=z("Press ENTER to autofill with the RAG answer.")},m(n,r){T(n,t,r)},d(n){n&&P(t)}}}function zf(e){let t,n,r,o,i,l,a,s,u,c,f,d,g,p=e[0].edited_answer===Zn&&ci();return{c(){t=C("form"),n=C("textarea"),o=F(),i=C("div"),l=C("div"),p&&p.c(),a=F(),s=C("div"),u=C("button"),u.textContent="Update",c=F(),f=C("button"),f.textContent="Reset",h(n,"placeholder",r=e[0].answer),h(l,"class","note svelte-i9wciy"),h(i,"class","button-container svelte-i9wciy")},m(m,_){T(m,t,_),v(t,n),Ue(n,e[0].edited_answer),e[6](n),v(t,o),v(t,i),v(i,l),p&&p.m(l,null),v(i,a),v(i,s),v(s,u),v(s,c),v(s,f),d||(g=[q(n,"input",e[5]),q(n,"keydown",e[4]),q(u,"click",e[2]),q(f,"click",e[3])],d=!0)},p(m,[_]){_&1&&r!==(r=m[0].answer)&&h(n,"placeholder",r),_&1&&Ue(n,m[0].edited_answer),m[0].edited_answer===Zn?p||(p=ci(),p.c(),p.m(l,null)):p&&(p.d(1),p=null)},i:H,o:H,d(m){m&&P(t),e[6](null),p&&p.d(),d=!1,ve(g)}}}const Zn="";function Hf(e,t,n){let{message:r={}}=t,o;const i=async f=>{const d={id:r.id,new_answer:f},g=await fetch("/chat/rag_table/update_answer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)});if(g.ok)console.log("Answer updated successfully",g),n(0,r.edited_answer=f,r);else{const p=await g.text();alert(p)}},l=f=>{f.preventDefault(),i(r.edited_answer)},a=f=>{f.preventDefault(),i(Zn)},s=f=>{f.key=="Enter"&&r.edited_answer===Zn&&(f.preventDefault(),console.log("ENTER"),n(0,r.edited_answer=r.answer,r))};dt(function(){o.focus()});function u(){r.edited_answer=this.value,n(0,r)}function c(f){ot[f?"unshift":"push"](()=>{o=f,n(1,o)})}return e.$$set=f=>{"message"in f&&n(0,r=f.message)},[r,o,l,a,s,u,c]}class Lf extends ue{constructor(t){super(),de(this,t,Hf,zf,ae,{message:0})}}function fi(e){let t,n,r,o,i,l;return{c(){t=C("div"),n=C("button"),n.textContent="👍",r=F(),o=C("button"),o.textContent="👎",h(n,"class","small-button thumbs-up svelte-1u8cd0w"),h(o,"class","small-button thumbs-down svelte-1u8cd0w"),h(t,"class","feedback-buttons svelte-1u8cd0w")},m(a,s){T(a,t,s),v(t,n),v(t,r),v(t,o),i||(l=[q(n,"click",e[4]),q(o,"click",e[5])],i=!0)},p:H,d(a){a&&P(t),i=!1,ve(l)}}}function qf(e){let t,n=e[0].answer+"",r,o,i,l=e[1]&&fi(e);return{c(){t=C("div"),r=z(n),o=F(),l&&l.c(),i=Ie()},m(a,s){T(a,t,s),v(t,r),T(a,o,s),l&&l.m(a,s),T(a,i,s)},p(a,[s]){s&1&&n!==(n=a[0].answer+"")&&ne(r,n),a[1]?l?l.p(a,s):(l=fi(a),l.c(),l.m(i.parentNode,i)):l&&(l.d(1),l=null)},i:H,o:H,d(a){a&&P(t),a&&P(o),l&&l.d(a),a&&P(i)}}}async function Gf(e){const t=await fetch("/chat/rag_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function Bf(e,t,n){let r;ie(e,Ve,c=>n(6,r=c));let{message:o={}}=t,{feedback:i=!1}=t,{index:l=0}=t;function a(c,f,d){const g=r[d];g.vote=f;const p={id:d+1,vote_status:f};Gf(p),ct(c.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),ct(c.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}const s=c=>a(c,"up",l),u=c=>a(c,"down",l);return e.$$set=c=>{"message"in c&&n(0,o=c.message),"feedback"in c&&n(1,i=c.feedback),"index"in c&&n(2,l=c.index)},[o,i,l,a,s,u]}class jf extends ue{constructor(t){super(),de(this,t,Bf,qf,ae,{message:0,feedback:1,index:2})}}function di(e,t,n){const r=e.slice();return r[19]=t[n],r[21]=n,r}function gi(e,t){let n,r,o,i,l,a,s,u,c,f=t[19].question+"",d,g,p,m,_,w,b,R,A,$,M,S,k,y,E,D;return A=new Vf({props:{items:t[8],tabProps:{message:t[19],feedback:t[0],index:t[21]}}}),M=new Tf({props:{sources:t[19].source,source_content:t[19].source_content}}),{key:e,first:null,c(){n=C("div"),r=C("div"),o=C("div"),i=F(),l=C("div"),a=C("div"),s=C("h5"),s.textContent="Question:",u=F(),c=C("p"),d=z(f),g=F(),p=C("div"),m=C("p"),m.textContent="ℹ️ Retrieval Sources",w=F(),b=C("div"),R=C("div"),te(A.$$.fragment),$=F(),te(M.$$.fragment),S=F(),h(o,"class","avatar"),h(s,"class","bold"),h(m,"class","bold"),h(p,"class","rag-sources svelte-vgv4ev"),h(a,"class","question svelte-vgv4ev"),h(R,"class","answer svelte-vgv4ev"),h(b,"class","answers svelte-vgv4ev"),h(l,"class","message-content svelte-vgv4ev"),h(r,"class","chat-message-center svelte-vgv4ev"),h(n,"class","chat-message svelte-vgv4ev"),this.first=n},m(I,V){T(I,n,V),v(n,r),v(r,o),v(r,i),v(r,l),v(l,a),v(a,s),v(a,u),v(a,c),v(c,d),v(a,g),v(a,p),v(p,m),v(l,w),v(l,b),v(b,R),Q(A,R,null),v(l,$),Q(M,l,null),v(n,S),y=!0,E||(D=[mn(_=yf.call(null,m,hi(t[19]))),mn(k=Wf.call(null,n,t[21]===t[5].length-1))],E=!0)},p(I,V){t=I,(!y||V&32)&&f!==(f=t[19].question+"")&&ne(d,f),_&&Je(_.update)&&V&32&&_.update.call(null,hi(t[19]));const J={};V&33&&(J.tabProps={message:t[19],feedback:t[0],index:t[21]}),A.$set(J);const ce={};V&32&&(ce.sources=t[19].source),V&32&&(ce.source_content=t[19].source_content),M.$set(ce),k&&Je(k.update)&&V&32&&k.update.call(null,t[21]===t[5].length-1)},i(I){y||(N(A.$$.fragment,I),N(M.$$.fragment,I),y=!0)},o(I){x(A.$$.fragment,I),x(M.$$.fragment,I),y=!1},d(I){I&&P(n),K(A),K(M),E=!1,ve(D)}}}function Uf(e){let t,n,r,o,i,l,a,s,u,c,f,d,g,p,m=[],_=new Map,w,b,R,A,$,M,S,k,y,E=(e[2]?e[4]:"Send")+"",D,I,V,J,ce,re,be;function ke(Z){e[13](Z)}let L={table:"rag_table"};e[3]!==void 0&&(L.showModal=e[3]),t=new xs({props:L}),ot.push(()=>Kn(t,"showModal",ke));let G=e[5];const he=Z=>Z[21];for(let Z=0;Z👍 + button. If the response is not satisfactory, click on the + 👎 button.`,u=F(),c=C("button"),c.textContent="Download Data",f=F(),d=C("div"),g=C("section"),p=C("div");for(let Z=0;Zn=!1)),t.$set(le),oe&289&&(G=Z[5],pe(),m=Qt(m,oe,he,1,Z,G,_,p,bs,gi,null,di),me());const Rn={};oe&64&&(Rn.documents=Z[6]),A.$set(Rn),oe&2&&S.value!==Z[1]&&Ue(S,Z[1]),(!ce||oe&20)&&E!==(E=(Z[2]?Z[4]:"Send")+"")&&ne(D,E),(!ce||oe&2&&I!==(I="btnyousend "+(Z[1]===""?"":"active")+" svelte-vgv4ev"))&&h(y,"class",I)},i(Z){if(!ce){N(t.$$.fragment,Z);for(let oe=0;oe{e.scrollIntoView({behavior:"smooth"})},0)}function hi(e){return e.rag_sources.length===0?"No Sources":e.rag_sources.join(", ")}function Xf(e,t,n){let r,o,i,l;ie(e,Ve,M=>n(5,o=M)),ie(e,Zr,M=>n(16,i=M));let{feedback:a=!1}=t,{is_retrieval:s=!1}=t;const u=Ee([]);ie(e,u,M=>n(6,l=M));let c="",f="",d=!1,g=!1,p=[{label:"Answer",value:1,component:jf},{label:"Modified Answer",value:2,component:Lf}];dt(()=>{_(),m()});async function m(){const S=await(await fetch("/retrieval/file/get")).json();console.log("data",S.files);const y=S.files.map((E,D)=>({id:String(D),name:E.name}));console.log("files",y),He(u,l=[...y],l)}async function _(){const k=(await(await fetch("/chat/rag_table/retrieve")).json()).rows;console.log("Got data from db",k);const y=k.map(E=>({id:E[0],question:E[1],answer:E[2],edited_answer:E[3],vote_status:E[4],rag_sources:E[5],source:E[6],source_content:E[7]}));He(Ve,o=[...y],o)}const w=async M=>{M.preventDefault(),c=f,n(1,f=""),n(2,d=!0);const S=[...i];let k={id:o.length+1,question:c,answer:"Loading...",rag_sources:S,vote_status:"na",source:["Loading..."],source_content:["Loading..."]};He(Ve,o=[...o,k],o);const y=s?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:c,file_names:S})}):await fetch(`/chat/${c}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:c})});if(y.ok){const E=await y.json();console.log("response data",E),k.answer=E.answer,k.source=E.source,k.source_content=E.source_content,Ve.update(D=>(D[D.length-1]=k,D))}else{const E=await y.text();alert(E)}n(2,d=!1)};let b=0;setInterval(()=>{n(12,b=(b+1)%4)},200);function R(){n(3,g=!0)}function A(M){g=M,n(3,g)}function $(){f=this.value,n(1,f)}return e.$$set=M=>{"feedback"in M&&n(0,a=M.feedback),"is_retrieval"in M&&n(11,s=M.is_retrieval)},e.$$.update=()=>{e.$$.dirty&4096&&n(4,r=".".repeat(b).padEnd(3))},[a,f,d,g,r,o,l,u,p,w,R,s,b,A,$]}class Yf extends ue{constructor(t){super(),de(this,t,Xf,Uf,ae,{feedback:0,is_retrieval:11})}}function pi(e){let t,n;return t=new Co({props:{is_retrieval:e[1]}}),{c(){te(t.$$.fragment)},m(r,o){Q(t,r,o),n=!0},p(r,o){const i={};o&2&&(i.is_retrieval=r[1]),t.$set(i)},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){x(t.$$.fragment,r),n=!1},d(r){K(t,r)}}}function mi(e){let t,n;return t=new Co({props:{feedback:!0,is_retrieval:e[1]}}),{c(){te(t.$$.fragment)},m(r,o){Q(t,r,o),n=!0},p(r,o){const i={};o&2&&(i.is_retrieval=r[1]),t.$set(i)},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){x(t.$$.fragment,r),n=!1},d(r){K(t,r)}}}function _i(e){let t,n;return t=new Yf({props:{feedback:!0,is_retrieval:e[1]}}),{c(){te(t.$$.fragment)},m(r,o){Q(t,r,o),n=!0},p(r,o){const i={};o&2&&(i.is_retrieval=r[1]),t.$set(i)},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){x(t.$$.fragment,r),n=!1},d(r){K(t,r)}}}function vi(e){let t,n,r,o;const i=[Kf,Qf],l=[];function a(s,u){return s[1]?0:1}return t=a(e),n=l[t]=i[t](e),{c(){n.c(),r=Ie()},m(s,u){l[t].m(s,u),T(s,r,u),o=!0},p(s,u){let c=t;t=a(s),t===c?l[t].p(s,u):(pe(),x(l[c],1,1,()=>{l[c]=null}),me(),n=l[t],n?n.p(s,u):(n=l[t]=i[t](s),n.c()),N(n,1),n.m(r.parentNode,r))},i(s){o||(N(n),o=!0)},o(s){x(n),o=!1},d(s){l[t].d(s),s&&P(r)}}}function Qf(e){let t,n;return t=new mf({}),{c(){te(t.$$.fragment)},m(r,o){Q(t,r,o),n=!0},p:H,i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){x(t.$$.fragment,r),n=!1},d(r){K(t,r)}}}function Kf(e){let t,n;return t=new Co({props:{feedback:!0,is_retrieval:e[1]}}),{c(){te(t.$$.fragment)},m(r,o){Q(t,r,o),n=!0},p(r,o){const i={};o&2&&(i.is_retrieval=r[1]),t.$set(i)},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){x(t.$$.fragment,r),n=!1},d(r){K(t,r)}}}function Jf(e){let t,n,r,o,i,l=!e[0]&&pi(e),a=e[0]==="vote"&&mi(e),s=e[0]==="rag"&&_i(e),u=e[0]==="rank"&&vi(e);return{c(){l&&l.c(),t=F(),a&&a.c(),n=F(),s&&s.c(),r=F(),u&&u.c(),o=Ie()},m(c,f){l&&l.m(c,f),T(c,t,f),a&&a.m(c,f),T(c,n,f),s&&s.m(c,f),T(c,r,f),u&&u.m(c,f),T(c,o,f),i=!0},p(c,[f]){c[0]?l&&(pe(),x(l,1,1,()=>{l=null}),me()):l?(l.p(c,f),f&1&&N(l,1)):(l=pi(c),l.c(),N(l,1),l.m(t.parentNode,t)),c[0]==="vote"?a?(a.p(c,f),f&1&&N(a,1)):(a=mi(c),a.c(),N(a,1),a.m(n.parentNode,n)):a&&(pe(),x(a,1,1,()=>{a=null}),me()),c[0]==="rag"?s?(s.p(c,f),f&1&&N(s,1)):(s=_i(c),s.c(),N(s,1),s.m(r.parentNode,r)):s&&(pe(),x(s,1,1,()=>{s=null}),me()),c[0]==="rank"?u?(u.p(c,f),f&1&&N(u,1)):(u=vi(c),u.c(),N(u,1),u.m(o.parentNode,o)):u&&(pe(),x(u,1,1,()=>{u=null}),me())},i(c){i||(N(l),N(a),N(s),N(u),i=!0)},o(c){x(l),x(a),x(s),x(u),i=!1},d(c){l&&l.d(c),c&&P(t),a&&a.d(c),c&&P(n),s&&s.d(c),c&&P(r),u&&u.d(c),c&&P(o)}}}function Zf(e,t,n){let{feedback:r}=t,{is_retrieval:o}=t;return e.$$set=i=>{"feedback"in i&&n(0,r=i.feedback),"is_retrieval"in i&&n(1,o=i.is_retrieval)},[r,o]}class ed extends ue{constructor(t){super(),de(this,t,Zf,Jf,ae,{feedback:0,is_retrieval:1})}}function bi(e,t,n){const r=e.slice();return r[2]=t[n],r}function wi(e){let t,n=e[2]+"",r,o;return{c(){t=C("option"),r=z(n),t.__value=o=e[2],t.value=t.__value},m(i,l){T(i,t,l),v(t,r)},p(i,l){l&1&&n!==(n=i[2]+"")&&ne(r,n),l&1&&o!==(o=i[2])&&(t.__value=o,t.value=t.__value)},d(i){i&&P(t)}}}function td(e){let t,n=e[0],r=[];for(let o=0;o{const i=await fetch(`/data/${r}`);n(0,o=await i.json())}),e.$$set=i=>{"data_endpoint"in i&&n(1,r=i.data_endpoint)},[o,r]}class rd extends ue{constructor(t){super(),de(this,t,nd,td,ae,{data_endpoint:1})}}function qt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function od(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Vs(e){let t,n,r;e.length!==2?(t=qt,n=(a,s)=>qt(e(a),s),r=(a,s)=>e(a)-s):(t=e===qt||e===od?e:id,n=e,r=e);function o(a,s,u=0,c=a.length){if(u>>1;n(a[f],s)<0?u=f+1:c=f}while(u>>1;n(a[f],s)<=0?u=f+1:c=f}while(uu&&r(a[f-1],s)>-r(a[f],s)?f-1:f}return{left:o,center:l,right:i}}function id(){return 0}function ld(e){return e===null?NaN:+e}function*sd(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const ad=Vs(qt),ud=ad.right;Vs(ld).center;const zs=ud;function cd(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(o=+o)>=o&&++n}return n}function un(e,t){let n,r;if(t===void 0)for(const o of e)o!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r=i&&(n=r=i):(n>i&&(n=i),r{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Hs(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var md=Array.prototype,_d=md.slice;function Er(e){return()=>e}const vd=Math.sqrt(50),bd=Math.sqrt(10),wd=Math.sqrt(2);function er(e,t,n){const r=(t-e)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),l=i>=vd?10:i>=bd?5:i>=wd?2:1;let a,s,u;return o<0?(u=Math.pow(10,-o)/l,a=Math.round(e*u),s=Math.round(t*u),a/ut&&--s,u=-u):(u=Math.pow(10,o)*l,a=Math.round(e/u),s=Math.round(t/u),a*ut&&--s),s0))return[];if(e===t)return[e];const r=t=o))return[];const a=i-o+1,s=new Array(a);if(r)if(l<0)for(let u=0;u0?(e=Math.floor(e/o)*o,t=Math.ceil(t/o)*o):o<0&&(e=Math.ceil(e*o)/o,t=Math.floor(t*o)/o),r=o}}function Cd(e){return Math.max(1,Math.ceil(Math.log(cd(e))/Math.LN2)+1)}function qs(){var e=hd,t=un,n=Cd;function r(o){Array.isArray(o)||(o=Array.from(o));var i,l=o.length,a,s,u=new Array(l);for(i=0;i=d)if(R>=d&&t===un){const $=Ut(f,d,A);isFinite($)&&($>0?d=(Math.floor(d/$)+1)*$:$<0&&(d=(Math.ceil(d*-$)+1)/-$))}else g.pop()}for(var p=g.length,m=0,_=p;g[m]<=f;)++m;for(;g[_-1]>d;)--_;(m||_0?g[i-1]:f,b.x1=i0)for(i=0;i=r)&&(n=r);else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(n=o)&&(n=o)}return n}function Ci(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function Gs(e,t,n=0,r=1/0,o){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(o=o===void 0?Hs:pd(o);r>n;){if(r-n>600){const s=r-n+1,u=t-n+1,c=Math.log(s),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(s-f)/s)*(u-s/2<0?-1:1),g=Math.max(n,Math.floor(t-u*f/s+d)),p=Math.min(r,Math.floor(t+(s-u)*f/s+d));Gs(e,t,g,p,o)}const i=e[t];let l=n,a=r;for(Zt(e,n,t),o(e[r],i)>0&&Zt(e,n,r);l0;)--a}o(e[n],i)===0?Zt(e,n,a):(++a,Zt(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function Zt(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function kd(e,t,n){if(e=Float64Array.from(sd(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Ci(e);if(t>=1)return Mt(e);var r,o=(r-1)*t,i=Math.floor(o),l=Mt(Gs(e,i).subarray(0,i+1)),a=Ci(e.subarray(i+1));return l+(a-l)*(o-i)}}function $d(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);++r=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function tr(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Wt(e){return e=tr(Math.abs(e)),e?e[1]:NaN}function Ad(e,t){return function(n,r){for(var o=n.length,i=[],l=0,a=e[0],s=0;o>0&&a>0&&(s+a+1>r&&(a=Math.max(1,r-s)),i.push(n.substring(o-=a,o+a)),!((s+=a+1)>r));)a=e[l=(l+1)%e.length];return i.reverse().join(t)}}function Md(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Ed=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function nr(e){if(!(t=Ed.exec(e)))throw new Error("invalid format: "+e);var t;return new ko({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}nr.prototype=ko.prototype;function ko(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}ko.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Fd(e){e:for(var t=e.length,n=1,r=-1,o;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(o+1):e}var Bs;function Dd(e,t){var n=tr(e,t);if(!n)return e+"";var r=n[0],o=n[1],i=o-(Bs=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,l=r.length;return i===l?r:i>l?r+new Array(i-l+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+tr(e,Math.max(0,t+i-1))[0]}function ki(e,t){var n=tr(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}const $i={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Rd,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ki(e*100,t),r:ki,s:Dd,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Ri(e){return e}var Ai=Array.prototype.map,Mi=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Id(e){var t=e.grouping===void 0||e.thousands===void 0?Ri:Ad(Ai.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",o=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?Ri:Md(Ai.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",s=e.nan===void 0?"NaN":e.nan+"";function u(f){f=nr(f);var d=f.fill,g=f.align,p=f.sign,m=f.symbol,_=f.zero,w=f.width,b=f.comma,R=f.precision,A=f.trim,$=f.type;$==="n"?(b=!0,$="g"):$i[$]||(R===void 0&&(R=12),A=!0,$="g"),(_||d==="0"&&g==="=")&&(_=!0,d="0",g="=");var M=m==="$"?n:m==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",S=m==="$"?r:/[%p]/.test($)?l:"",k=$i[$],y=/[defgprs%]/.test($);R=R===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,R)):Math.max(0,Math.min(20,R));function E(D){var I=M,V=S,J,ce,re;if($==="c")V=k(D)+V,D="";else{D=+D;var be=D<0||1/D<0;if(D=isNaN(D)?s:k(Math.abs(D),R),A&&(D=Fd(D)),be&&+D==0&&p!=="+"&&(be=!1),I=(be?p==="("?p:a:p==="-"||p==="("?"":p)+I,V=($==="s"?Mi[8+Bs/3]:"")+V+(be&&p==="("?")":""),y){for(J=-1,ce=D.length;++Jre||re>57){V=(re===46?o+D.slice(J+1):D.slice(J))+V,D=D.slice(0,J);break}}}b&&!_&&(D=t(D,1/0));var ke=I.length+D.length+V.length,L=ke>1)+I+D+V+L.slice(ke);break;default:D=L+I+D+V;break}return i(D)}return E.toString=function(){return f+""},E}function c(f,d){var g=u((f=nr(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Wt(d)/3)))*3,m=Math.pow(10,-p),_=Mi[8+p/3];return function(w){return g(m*w)+_}}return{format:u,formatPrefix:c}}var En,Dt,js;Nd({thousands:",",grouping:[3],currency:["$",""]});function Nd(e){return En=Id(e),Dt=En.format,js=En.formatPrefix,En}function Pd(e){return Math.max(0,-Wt(Math.abs(e)))}function Td(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Wt(t)/3)))*3-Wt(Math.abs(e)))}function xd(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Wt(t)-Wt(e))+1}function $o(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Ei=Symbol("implicit");function br(){var e=new yi,t=[],n=[],r=Ei;function o(i){let l=e.get(i);if(l===void 0){if(r!==Ei)return r;e.set(i,l=t.push(i)-1)}return n[l%n.length]}return o.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new yi;for(const l of i)e.has(l)||e.set(l,t.push(l)-1);return o},o.range=function(i){return arguments.length?(n=Array.from(i),o):n.slice()},o.unknown=function(i){return arguments.length?(r=i,o):r},o.copy=function(){return br(t,n).unknown(r)},$o.apply(o,arguments),o}function Ro(){var e=br().unknown(void 0),t=e.domain,n=e.range,r=0,o=1,i,l,a=!1,s=0,u=0,c=.5;delete e.unknown;function f(){var d=t().length,g=o>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Fn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Fn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Vd.exec(e))?new ze(t[1],t[2],t[3],1):(t=zd.exec(e))?new ze(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Hd.exec(e))?Fn(t[1],t[2],t[3],t[4]):(t=Ld.exec(e))?Fn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qd.exec(e))?xi(t[1],t[2]/100,t[3]/100,1):(t=Gd.exec(e))?xi(t[1],t[2]/100,t[3]/100,t[4]):Fi.hasOwnProperty(e)?Ni(Fi[e]):e==="transparent"?new ze(NaN,NaN,NaN,0):null}function Ni(e){return new ze(e>>16&255,e>>8&255,e&255,1)}function Fn(e,t,n,r){return r<=0&&(e=t=n=NaN),new ze(e,t,n,r)}function Ud(e){return e instanceof Cn||(e=yn(e)),e?(e=e.rgb(),new ze(e.r,e.g,e.b,e.opacity)):new ze}function no(e,t,n,r){return arguments.length===1?Ud(e):new ze(e,t,n,r??1)}function ze(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ao(ze,no,Us(Cn,{brighter(e){return e=e==null?rr:Math.pow(rr,e),new ze(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?bn:Math.pow(bn,e),new ze(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ze(At(this.r),At(this.g),At(this.b),or(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Pi,formatHex:Pi,formatHex8:Wd,formatRgb:Ti,toString:Ti}));function Pi(){return`#${$t(this.r)}${$t(this.g)}${$t(this.b)}`}function Wd(){return`#${$t(this.r)}${$t(this.g)}${$t(this.b)}${$t((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ti(){const e=or(this.opacity);return`${e===1?"rgb(":"rgba("}${At(this.r)}, ${At(this.g)}, ${At(this.b)}${e===1?")":`, ${e})`}`}function or(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function At(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $t(e){return e=At(e),(e<16?"0":"")+e.toString(16)}function xi(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ye(e,t,n,r)}function Ws(e){if(e instanceof Ye)return new Ye(e.h,e.s,e.l,e.opacity);if(e instanceof Cn||(e=yn(e)),!e)return new Ye;if(e instanceof Ye)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),l=NaN,a=i-o,s=(i+o)/2;return a?(t===i?l=(n-r)/a+(n0&&s<1?0:l,new Ye(l,a,s,e.opacity)}function Xd(e,t,n,r){return arguments.length===1?Ws(e):new Ye(e,t,n,r??1)}function Ye(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ao(Ye,Xd,Us(Cn,{brighter(e){return e=e==null?rr:Math.pow(rr,e),new Ye(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bn:Math.pow(bn,e),new Ye(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new ze(Fr(e>=240?e-240:e+120,o,r),Fr(e,o,r),Fr(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Ye(Oi(this.h),Dn(this.s),Dn(this.l),or(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=or(this.opacity);return`${e===1?"hsl(":"hsla("}${Oi(this.h)}, ${Dn(this.s)*100}%, ${Dn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Oi(e){return e=(e||0)%360,e<0?e+360:e}function Dn(e){return Math.max(0,Math.min(1,e||0))}function Fr(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Mo=e=>()=>e;function Yd(e,t){return function(n){return e+n*t}}function Qd(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Kd(e){return(e=+e)==1?Xs:function(t,n){return n-t?Qd(t,n,e):Mo(isNaN(t)?n:t)}}function Xs(e,t){var n=t-e;return n?Yd(e,n):Mo(isNaN(e)?t:e)}const Vi=function e(t){var n=Kd(t);function r(o,i){var l=n((o=no(o)).r,(i=no(i)).r),a=n(o.g,i.g),s=n(o.b,i.b),u=Xs(o.opacity,i.opacity);return function(c){return o.r=l(c),o.g=a(c),o.b=s(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function Jd(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;on&&(i=t.slice(n,i),a[l]?a[l]+=i:a[++l]=i),(r=r[0])===(o=o[0])?a[l]?a[l]+=o:a[++l]=o:(a[++l]=null,s.push({i:l,x:ir(r,o)})),n=Dr.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function cg(e,t,n){var r=e[0],o=e[1],i=t[0],l=t[1];return o2?fg:cg,s=u=null,f}function f(d){return d==null||isNaN(d=+d)?i:(s||(s=a(e.map(r),t,n)))(r(l(d)))}return f.invert=function(d){return l(o((u||(u=a(t,e.map(r),ir)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,ag),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=lg,c()},f.clamp=function(d){return arguments.length?(l=d?!0:Vt,c()):l!==Vt},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(i=d,f):i},function(d,g){return r=d,o=g,c()}}function hg(){return gg()(Vt,Vt)}function pg(e,t,n,r){var o=yd(e,t,n),i;switch(r=nr(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=Td(o,l))&&(r.precision=i),js(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=xd(o,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=Pd(o))&&(r.precision=i-(r.type==="%")*2);break}}return Dt(r)}function mg(e){var t=e.domain;return e.ticks=function(n){var r=t();return Ls(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var o=t();return pg(o[0],o[o.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),o=0,i=r.length-1,l=r[o],a=r[i],s,u,c=10;for(a0;){if(u=Ut(l,a,n),u===s)return r[o]=l,r[i]=a,t(r);if(u>0)l=Math.floor(l/u)*u,a=Math.ceil(a/u)*u;else if(u<0)l=Math.ceil(l*u)/u,a=Math.floor(a*u)/u;else break;s=u}return e},e}function Qe(){var e=hg();return e.copy=function(){return dg(e,Qe())},$o.apply(e,arguments),mg(e)}function In(e){return function(){return e}}function _g(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function io(e,t){if((l=e.length)>1)for(var n=1,r,o,i=e[t[0]],l,a=i.length;n=0;)n[t]=t;return n}function vg(e,t){return e[t]}function bg(e){const t=[];return t.key=e,t}function wg(){var e=In([]),t=lo,n=io,r=vg;function o(i){var l=Array.from(e.apply(this,arguments),bg),a,s=l.length,u=-1,c;for(const f of i)for(a=0,++u;aFeedback Distribution

",n=F(),r=C("div"),o=W("svg");for(let s=0;se[19].call(r))},m(s,u){T(s,t,u),T(s,n,u),T(s,r,u),v(r,o);for(let c=0;cn(15,f=k)),ie(e,Bo,k=>n(4,d=k)),ie(e,Ve,k=>n(16,g=k));let p=300,m=300;const _={up:2,down:1,"n/a":0,all:"all"},w={top:10,bottom:10,left:25,right:5},b=br().range(["var(--yellow)","var(--red)","var(--green)"]),R=Dt(".0%");function A(k,y){r===k?n(5,r="all"):n(5,r=k),He(it,f=r==="all"?"all":y,f)}const $=(k,y)=>A(k,y.key),M=(k,y)=>A(k,y.key);function S(){m=this.offsetWidth,p=this.offsetHeight,n(1,m),n(0,p)}return e.$$.update=()=>{e.$$.dirty&32768&&n(5,r=_[f]),e.$$.dirty&2&&n(3,o=m-w.left-w.right),e.$$.dirty&1&&n(14,i=p-w.top-w.bottom),e.$$.dirty&65552&&g.forEach(k=>{He(Bo,d[k.vote_status]++,d)}),e.$$.dirty&16&&n(2,l=d.up+d.down+d["n/a"]),e.$$.dirty&16384&&n(8,a=Ro().rangeRound([w.top,i-w.bottom]).padding(0).domain(["a"])),e.$$.dirty&12&&n(7,s=Qe().rangeRound([w.left,o-w.right]).domain([0,l])),e.$$.dirty&8208&&n(6,c=u([d]))},n(13,u=wg().keys(["n/a","down","up"]).order(lo).offset(io)),[p,m,l,o,d,r,c,s,a,w,b,R,A,u,i,f,g,$,M,S]}class Ys extends ue{constructor(t){super(),de(this,t,Sg,yg,ae,{})}}function Cg(e){let t,n,r,o,i,l,a,s,u,c,f,d=e[3][e[2]]+"",g,p;return{c(){t=C("div"),n=C("div"),r=z("Q: "),o=z(e[0]),i=F(),l=C("div"),a=z("A: "),s=z(e[1]),u=F(),c=C("div"),f=z("Rating: "),g=z(d),h(n,"class","question svelte-szi0e"),h(l,"class","answer svelte-szi0e"),h(c,"class",p="feedback "+e[2]+" svelte-szi0e"),h(t,"class","qa-card svelte-szi0e")},m(m,_){T(m,t,_),v(t,n),v(n,r),v(n,o),v(t,i),v(t,l),v(l,a),v(l,s),v(t,u),v(t,c),v(c,f),v(c,g)},p(m,[_]){_&1&&ne(o,m[0]),_&2&&ne(s,m[1]),_&4&&d!==(d=m[3][m[2]]+"")&&ne(g,d),_&4&&p!==(p="feedback "+m[2]+" svelte-szi0e")&&h(c,"class",p)},i:H,o:H,d(m){m&&P(t)}}}function kg(e,t,n){let{question:r="What is gradient descent?"}=t,{answer:o="Gradient descent is an algorithm used to minimize a loss function by taking small steps in the direction of steepest descent."}=t,{feedback:i="Good: 👍"}=t;const l={up:"Good 👍",down:"Bad 👎","n/a":"No Rating",all:"All"};return e.$$set=a=>{"question"in a&&n(0,r=a.question),"answer"in a&&n(1,o=a.answer),"feedback"in a&&n(2,i=a.feedback)},[r,o,i,l]}class $g extends ue{constructor(t){super(),de(this,t,kg,Cg,ae,{question:0,answer:1,feedback:2})}}function Bi(e,t,n){const r=e.slice();return r[5]=t[n].question,r[6]=t[n].answer,r[7]=t[n].vote_status,r}function ji(e){let t,n,r,o,i;return n=new $g({props:{question:e[5],answer:e[6],feedback:e[7]}}),{c(){t=C("div"),te(n.$$.fragment),r=F()},m(l,a){T(l,t,a),Q(n,t,null),v(t,r),i=!0},p(l,a){const s={};a&1&&(s.question=l[5]),a&1&&(s.answer=l[6]),a&1&&(s.feedback=l[7]),n.$set(s)},i(l){i||(N(n.$$.fragment,l),l&&Ae(()=>{i&&(o||(o=et(t,e[1],{duration:300},!0)),o.run(1))}),i=!0)},o(l){x(n.$$.fragment,l),l&&(o||(o=et(t,e[1],{duration:300},!1)),o.run(0)),i=!1},d(l){l&&P(t),K(n),l&&o&&o.end()}}}function Rg(e){let t,n,r=e[0],o=[];for(let l=0;lx(o[l],1,1,()=>{o[l]=null});return{c(){t=C("div");for(let l=0;ln(4,o=s)),ie(e,it,s=>n(2,i=s)),ie(e,_n,s=>n(3,l=s));const a=(s,{delay:u=0,duration:c=1e3,easing:f=wo})=>vn(s,{delay:u,duration:c,easing:f});return e.$$.update=()=>{e.$$.dirty&12&&n(0,r=i==="all"?l:l.filter(s=>s.vote_status===i)),e.$$.dirty&1&&He(Jr,o=wf(r),o)},[r,a,i,l]}class Qs extends ue{constructor(t){super(),de(this,t,Ag,Rg,ae,{})}}function Ui(e,t,n){const r=e.slice();return r[13]=t[n],r}function Wi(e,t,n){const r=e.slice();return r[16]=t[n],r}function Xi(e,t,n){const r=e.slice();return r[16]=t[n],r}function Yi(e){let t,n,r,o,i=e[16]+"",l,a;return{c(){t=W("g"),n=W("line"),o=W("text"),l=z(i),h(n,"class","axis-tick svelte-1oikip4"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",r=-e[2]+e[10].bottom+e[10].top),h(n,"stroke","var(--squidink)"),h(n,"stroke-dasharray","4"),h(o,"class","axis-text svelte-1oikip4"),h(o,"y","15"),h(o,"text-anchor","middle"),h(t,"transform",a=`translate(${e[6](e[16])+e[6].bandwidth()/2} ${e[2]-e[10].bottom})`)},m(s,u){T(s,t,u),v(t,n),v(t,o),v(o,l)},p(s,u){u&4&&r!==(r=-s[2]+s[10].bottom+s[10].top)&&h(n,"y2",r),u&16&&i!==(i=s[16]+"")&&ne(l,i),u&84&&a!==(a=`translate(${s[6](s[16])+s[6].bandwidth()/2} ${s[2]-s[10].bottom})`)&&h(t,"transform",a)},d(s){s&&P(t)}}}function Qi(e){let t,n,r,o;return{c(){t=W("g"),n=W("line"),h(n,"class","axis-tick svelte-1oikip4"),h(n,"x1",0),h(n,"x2",r=e[3]-e[10].right-e[10].left),h(n,"y1","0"),h(n,"y2","0"),h(n,"stroke","black"),h(t,"transform",o=`translate(${e[10].left} ${e[5](e[16])+0})`)},m(i,l){T(i,t,l),v(t,n)},p(i,l){l&8&&r!==(r=i[3]-i[10].right-i[10].left)&&h(n,"x2",r),l&32&&o!==(o=`translate(${i[10].left} ${i[5](i[16])+0})`)&&h(t,"transform",o)},d(i){i&&P(t)}}}function Ki(e){let t,n,r,o,i,l,a,s,u=Math.round(e[11](e[13].count))+"",c,f,d;return{c(){t=W("g"),n=W("rect"),s=W("text"),c=z(u),h(n,"x",r=e[6](e[13].question)),h(n,"y",o=e[5](e[13].count)),h(n,"height",i=e[2]-e[5](e[13].count)-e[10].bottom),h(n,"fill",l=e[9][e[7]]),h(n,"fill-opacity","0.95"),h(n,"width",a=e[6].bandwidth()),h(n,"class","svelte-1oikip4"),h(s,"class","axis-text svelte-1oikip4"),h(s,"x",f=e[6](e[13].question)+e[6].bandwidth()/2),h(s,"y",d=e[5](e[13].count)-5),h(s,"text-anchor","middle"),h(t,"class","series")},m(g,p){T(g,t,p),v(t,n),v(t,s),v(s,c)},p(g,p){p&80&&r!==(r=g[6](g[13].question))&&h(n,"x",r),p&48&&o!==(o=g[5](g[13].count))&&h(n,"y",o),p&52&&i!==(i=g[2]-g[5](g[13].count)-g[10].bottom)&&h(n,"height",i),p&128&&l!==(l=g[9][g[7]])&&h(n,"fill",l),p&64&&a!==(a=g[6].bandwidth())&&h(n,"width",a),p&16&&u!==(u=Math.round(g[11](g[13].count))+"")&&ne(c,u),p&80&&f!==(f=g[6](g[13].question)+g[6].bandwidth()/2)&&h(s,"x",f),p&48&&d!==(d=g[5](g[13].count)-5)&&h(s,"y",d)},d(g){g&&P(t)}}}function Mg(e){let t,n,r,o,i,l,a=e[8][e[7]]+"",s,u,c,f,d,g,p,m,_,w=e[4].map(Ji),b=[];for(let S=0;Se[12].call(t))},m(S,k){T(S,t,k),v(t,n);for(let y=0;ye.question;function Eg(e,t,n){let r,o,i,l,a,s;ie(e,Jr,_=>n(4,a=_)),ie(e,it,_=>n(7,s=_));const u={up:"Good 👍",down:"Bad 👎","n/a":"No Rating",all:"All"},c={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let f=300,d=300,g={top:35,bottom:10,left:25,right:5};const p=Dt(".1f");function m(){d=this.offsetWidth,f=this.offsetHeight,n(1,d),n(0,f)}return e.$$.update=()=>{e.$$.dirty&2&&n(3,r=d-g.left-g.right),e.$$.dirty&1&&n(2,o=f-g.top-g.bottom),e.$$.dirty&24&&n(6,i=Ro().rangeRound([g.left,r-g.right]).padding(.05).domain(a.map(_=>_.question))),e.$$.dirty&20&&n(5,l=Qe().rangeRound([o-g.bottom,g.top]).domain([0,Mt(a,_=>_.count)])),e.$$.dirty&16&&console.log(a)},[f,d,o,r,a,l,i,s,u,c,g,p,m]}class Ks extends ue{constructor(t){super(),de(this,t,Eg,Mg,ae,{})}}function Zi(e,t,n){const r=e.slice();r[19]=t[n];const o=r[7](r[19].x1)-r[7](r[19].x0);return r[20]=o,r}function el(e,t,n){const r=e.slice();return r[23]=t[n],r}function tl(e){let t,n,r,o,i=e[23]+"",l,a;return{c(){t=W("g"),n=W("line"),o=W("text"),l=z(i),h(n,"class","axis-tick svelte-kz2qh6"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",r=-e[2]+e[9].bottom+e[9].top),h(n,"stroke","var(--squidink)"),h(n,"stroke-dasharray","4"),h(o,"class","axis-text svelte-kz2qh6"),h(o,"y","15"),h(o,"text-anchor","middle"),h(t,"transform",a=`translate(${e[7](e[23])+(e[7](1)-e[7](0))/2} ${e[2]-e[9].bottom})`),h(t,"class","svelte-kz2qh6")},m(s,u){T(s,t,u),v(t,n),v(t,o),v(o,l)},p(s,u){u&4&&r!==(r=-s[2]+s[9].bottom+s[9].top)&&h(n,"y2",r),u&128&&i!==(i=s[23]+"")&&ne(l,i),u&132&&a!==(a=`translate(${s[7](s[23])+(s[7](1)-s[7](0))/2} ${s[2]-s[9].bottom})`)&&h(t,"transform",a)},d(s){s&&P(t)}}}function nl(e){let t,n,r,o,i,l,a;return{c(){t=W("g"),n=W("rect"),h(n,"x",r=e[7](e[19].x0)+1),h(n,"width",o=e[20]),h(n,"y",i=e[6](e[19].length)),h(n,"height",l=e[6](0)-e[6](e[19].length)),h(n,"fill",a=e[8][e[5]]),h(n,"class","svelte-kz2qh6"),h(t,"class","histogram-bin svelte-kz2qh6")},m(s,u){T(s,t,u),v(t,n)},p(s,u){u&136&&r!==(r=s[7](s[19].x0)+1)&&h(n,"x",r),u&136&&o!==(o=s[20])&&h(n,"width",o),u&72&&i!==(i=s[6](s[19].length))&&h(n,"y",i),u&72&&l!==(l=s[6](0)-s[6](s[19].length))&&h(n,"height",l),u&32&&a!==(a=s[8][s[5]])&&h(n,"fill",a)},d(s){s&&P(t)}}}function Fg(e){let t,n,r,o,i,l,a,s,u,c,f,d=e[7].ticks(),g=[];for(let _=0;_e[14].call(t))},m(_,w){T(_,t,w),v(t,n);for(let b=0;bn(5,f=R)),ie(e,Ve,R=>n(13,d=R));const g={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let p=300,m=300,_={top:15,bottom:10,left:25,right:5};Dt(".1f");let w=Array.from({length:rl},(R,A)=>A);function b(){m=this.offsetWidth,p=this.offsetHeight,n(1,m),n(0,p)}return e.$$.update=()=>{e.$$.dirty&8224&&n(12,r=f==="all"?d:d.filter(R=>R.vote_status===f)),e.$$.dirty&4096&&n(11,o=Os(r)),e.$$.dirty&2&&n(4,i=m-_.left-_.right),e.$$.dirty&1&&n(2,l=p-_.top-_.bottom),e.$$.dirty&2048&&n(3,a=qs().thresholds(w).value(R=>R.answer)(o)),e.$$.dirty&16&&n(7,s=Qe().domain([3,rl]).range([_.left,i-_.right])),e.$$.dirty&12&&n(6,u=Qe().domain([0,Mt(a,R=>R.length)]).range([l-_.bottom,_.top])),e.$$.dirty&2048&&n(10,c=Mt(o,R=>R.length)),e.$$.dirty&1056&&Qe().domain([0,c]).range(["white",g[f]]).interpolate(wr)},[p,m,l,a,i,f,u,s,g,_,c,o,r,d,b]}class Js extends ue{constructor(t){super(),de(this,t,Dg,Fg,ae,{})}}function ol(e,t,n){const r=e.slice();r[18]=t[n];const o=r[7](r[18].x1)-r[7](r[18].x0);return r[19]=o,r}function il(e,t,n){const r=e.slice();return r[22]=t[n],r}function ll(e){let t,n,r,o,i=e[22]+"",l,a;return{c(){t=W("g"),n=W("line"),o=W("text"),l=z(i),h(n,"class","axis-tick svelte-kz2qh6"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",r=-e[2]+e[9].bottom+e[9].top),h(n,"stroke","var(--squidink)"),h(n,"stroke-dasharray","4"),h(o,"class","axis-text svelte-kz2qh6"),h(o,"y","15"),h(o,"text-anchor","middle"),h(t,"transform",a=`translate(${e[7](e[22])+(e[7](1)-e[7](0))/2} ${e[2]-e[9].bottom})`),h(t,"class","svelte-kz2qh6")},m(s,u){T(s,t,u),v(t,n),v(t,o),v(o,l)},p(s,u){u&4&&r!==(r=-s[2]+s[9].bottom+s[9].top)&&h(n,"y2",r),u&128&&i!==(i=s[22]+"")&&ne(l,i),u&132&&a!==(a=`translate(${s[7](s[22])+(s[7](1)-s[7](0))/2} ${s[2]-s[9].bottom})`)&&h(t,"transform",a)},d(s){s&&P(t)}}}function sl(e){let t,n,r,o,i,l,a;return{c(){t=W("g"),n=W("rect"),h(n,"x",r=e[7](e[18].x0)+1),h(n,"width",o=e[19]),h(n,"y",i=e[6](e[18].length)),h(n,"height",l=e[6](0)-e[6](e[18].length)),h(n,"fill",a=e[8][e[5]]),h(n,"class","svelte-kz2qh6"),h(t,"class","histogram-bin svelte-kz2qh6")},m(s,u){T(s,t,u),v(t,n)},p(s,u){u&136&&r!==(r=s[7](s[18].x0)+1)&&h(n,"x",r),u&136&&o!==(o=s[19])&&h(n,"width",o),u&72&&i!==(i=s[6](s[18].length))&&h(n,"y",i),u&72&&l!==(l=s[6](0)-s[6](s[18].length))&&h(n,"height",l),u&32&&a!==(a=s[8][s[5]])&&h(n,"fill",a)},d(s){s&&P(t)}}}function Ig(e){let t,n,r,o,i,l,a,s,u,c,f,d=e[7].ticks(),g=[];for(let _=0;_e[13].call(t))},m(_,w){T(_,t,w),v(t,n);for(let b=0;bn(5,c=b)),ie(e,Ve,b=>n(12,f=b));const d={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let g=300,p=300,m={top:15,bottom:10,left:25,right:5},_=Array.from({length:al},(b,R)=>R);br().range(["var(--yellow)","var(--red)","var(--green)"]);function w(){p=this.offsetWidth,g=this.offsetHeight,n(1,p),n(0,g)}return e.$$.update=()=>{e.$$.dirty&4128&&n(11,r=c==="all"?f:f.filter(b=>b.vote_status===c)),e.$$.dirty&2048&&n(10,o=Os(r)),e.$$.dirty&2&&n(4,i=p-m.left-m.right),e.$$.dirty&1&&n(2,l=g-m.top-m.bottom),e.$$.dirty&1024&&n(3,a=qs().thresholds(_).value(b=>b.question)(o)),e.$$.dirty&16&&n(7,s=Qe().domain([3,al]).range([m.left,i-m.right])),e.$$.dirty&12&&n(6,u=Qe().domain([0,Mt(a,b=>b.length)]).range([l-m.bottom,m.top])),e.$$.dirty&1024&&Mt(o,b=>b.length)},[g,p,l,a,i,c,u,s,d,m,o,r,f,w]}class Zs extends ue{constructor(t){super(),de(this,t,Ng,Ig,ae,{})}}function Pg(e){let t,n,r,o,i,l,a,s,u,c,f,d,g,p=Math.round(e[5](e[3]))+"",m,_,w,b,R,A,$,M;return{c(){t=C("div"),n=C("div"),r=C("p"),r.textContent="Questions",o=F(),i=C("select"),l=C("option"),l.textContent="All",a=C("option"),a.textContent="Good",s=C("option"),s.textContent="Bad",u=C("option"),u.textContent="N/A",c=F(),f=C("div"),d=W("svg"),g=W("text"),m=z(p),R=F(),A=C("p"),A.textContent="number of responses",h(r,"class","card-text svelte-1pknxov"),l.__value="all",l.value=l.__value,h(l,"class","svelte-1pknxov"),a.__value="up",a.value=a.__value,h(a,"class","svelte-1pknxov"),s.__value="down",s.value=s.__value,h(s,"class","svelte-1pknxov"),u.__value="n/a",u.value=u.__value,h(u,"class","svelte-1pknxov"),h(i,"id","feedback-dropdown"),h(i,"name","feedback-dropdown"),De(i,"background",e[6][e[0]]),h(i,"class","svelte-1pknxov"),e[0]===void 0&&Ae(()=>e[9].call(i)),h(n,"class","svelte-1pknxov"),h(g,"dominant-baseline","middle"),h(g,"x",_=e[2]/2),h(g,"y",w=e[1]/2),h(g,"text-anchor","middle"),h(g,"class","svelte-1pknxov"),h(d,"width",e[2]),h(d,"height",e[1]),h(d,"class","svelte-1pknxov"),h(f,"class","svelte-1pknxov"),Ae(()=>e[10].call(f)),h(A,"class","small svelte-1pknxov"),h(t,"class","card-container svelte-1pknxov"),De(t,"background",e[6][e[0]])},m(S,k){T(S,t,k),v(t,n),v(n,r),v(n,o),v(n,i),v(i,l),v(i,a),v(i,s),v(i,u),Wn(i,e[0],!0),v(t,c),v(t,f),v(f,d),v(d,g),v(g,m),b=Ft(f,e[10].bind(f)),v(t,R),v(t,A),$||(M=q(i,"change",e[9]),$=!0)},p(S,[k]){k&1&&De(i,"background",S[6][S[0]]),k&1&&Wn(i,S[0]),k&8&&p!==(p=Math.round(S[5](S[3]))+"")&&ne(m,p),k&4&&_!==(_=S[2]/2)&&h(g,"x",_),k&2&&w!==(w=S[1]/2)&&h(g,"y",w),k&4&&h(d,"width",S[2]),k&2&&h(d,"height",S[1]),k&1&&De(t,"background",S[6][S[0]])},i:H,o:H,d(S){S&&P(t),b(),$=!1,M()}}}function Tg(e,t){return t==="all"?e.length:e.filter(r=>r.vote_status===t).length}function xg(e,t,n){let r,o,i,l;ie(e,it,p=>n(0,o=p)),ie(e,Ve,p=>n(8,i=p));let a,s,u=yo(0);ie(e,u,p=>n(3,l=p));const c=Dt(".1f"),f={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"var(--white)"};function d(){o=_s(this),it.set(o)}function g(){s=this.clientWidth,a=this.clientHeight,n(2,s),n(1,a)}return e.$$.update=()=>{e.$$.dirty&257&&n(7,r=Tg(i,o)),e.$$.dirty&128&&console.log("fbc",r),e.$$.dirty&128&&u.set(r)},[o,a,s,l,u,c,f,r,i,d,g]}class ea extends ue{constructor(t){super(),de(this,t,xg,Pg,ae,{})}}function Og(e){let t,n,r,o,i,l,a,s,u,c,f,d,g,p=e[5](e[3])+"",m,_,w,b,R,A,$,M;return{c(){t=C("div"),n=C("div"),r=C("p"),r.textContent="Questions",o=F(),i=C("select"),l=C("option"),l.textContent="All",a=C("option"),a.textContent="Good",s=C("option"),s.textContent="Bad",u=C("option"),u.textContent="N/A",c=F(),f=C("div"),d=W("svg"),g=W("text"),m=z(p),R=F(),A=C("p"),A.textContent="percentage of responses",h(r,"class","card-text svelte-mchgj2"),l.__value="all",l.value=l.__value,a.__value="up",a.value=a.__value,s.__value="down",s.value=s.__value,u.__value="n/a",u.value=u.__value,h(i,"id","feedback-dropdown"),h(i,"name","feedback-dropdown"),De(i,"background",e[6][e[0]]),h(i,"class","svelte-mchgj2"),e[0]===void 0&&Ae(()=>e[9].call(i)),h(g,"dominant-baseline","middle"),h(g,"x",_=e[2]/2),h(g,"y",w=e[1]/2),h(g,"text-anchor","middle"),h(g,"class","svelte-mchgj2"),h(d,"width",e[2]),h(d,"height",e[1]),h(d,"class","svelte-mchgj2"),Ae(()=>e[10].call(f)),h(A,"class","small svelte-mchgj2"),h(t,"class","card-container svelte-mchgj2"),De(t,"background",e[6][e[0]])},m(S,k){T(S,t,k),v(t,n),v(n,r),v(n,o),v(n,i),v(i,l),v(i,a),v(i,s),v(i,u),Wn(i,e[0],!0),v(t,c),v(t,f),v(f,d),v(d,g),v(g,m),b=Ft(f,e[10].bind(f)),v(t,R),v(t,A),$||(M=q(i,"change",e[9]),$=!0)},p(S,[k]){k&1&&De(i,"background",S[6][S[0]]),k&1&&Wn(i,S[0]),k&8&&p!==(p=S[5](S[3])+"")&&ne(m,p),k&4&&_!==(_=S[2]/2)&&h(g,"x",_),k&2&&w!==(w=S[1]/2)&&h(g,"y",w),k&4&&h(d,"width",S[2]),k&2&&h(d,"height",S[1]),k&1&&De(t,"background",S[6][S[0]])},i:H,o:H,d(S){S&&P(t),b(),$=!1,M()}}}function Vg(e,t){const n=e.length;return t==="all"?1:e.filter(o=>o.vote_status===t).length/n}function zg(e,t,n){let r,o,i,l;ie(e,it,p=>n(0,o=p)),ie(e,Ve,p=>n(8,i=p));let a,s,u=yo(0);ie(e,u,p=>n(3,l=p));const c=Dt(".1%"),f={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"var(--white)"};function d(){o=_s(this),it.set(o)}function g(){s=this.clientWidth,a=this.clientHeight,n(2,s),n(1,a)}return e.$$.update=()=>{e.$$.dirty&257&&n(7,r=Vg(i,o)),e.$$.dirty&128&&u.set(r)},[o,a,s,l,u,c,f,r,i,d,g]}class ta extends ue{constructor(t){super(),de(this,t,zg,Og,ae,{})}}function Hg(e){let t,n,r,o,i,l,a,s,u,c,f,d,g,p,m,_,w,b,R,A,$,M,S,k,y,E,D;return i=new ea({}),s=new ta({}),f=new Ys({}),p=new Ks({props:{feedback:"Bad"}}),w=new Zs({}),A=new Js({}),E=new Qs({}),{c(){t=C("div"),n=C("div"),r=C("div"),o=C("div"),te(i.$$.fragment),l=F(),a=C("div"),te(s.$$.fragment),u=F(),c=C("div"),te(f.$$.fragment),d=F(),g=C("div"),te(p.$$.fragment),m=F(),_=C("div"),te(w.$$.fragment),b=F(),R=C("div"),te(A.$$.fragment),$=F(),M=C("div"),S=C("div"),S.innerHTML=`
+
`,k=F(),y=C("div"),te(E.$$.fragment),h(o,"class","card-1 svelte-14znspc"),h(a,"class","card-2"),h(r,"class","left-text svelte-14znspc"),h(c,"class","left-confidence svelte-14znspc"),h(g,"class","left-question svelte-14znspc"),h(_,"class","left-filter svelte-14znspc"),h(R,"class","left-filter2"),h(n,"class","feedback-left svelte-14znspc"),h(S,"class","right-chart svelte-14znspc"),h(y,"class","right-table svelte-14znspc"),h(M,"class","feedback-right svelte-14znspc"),h(t,"class","feedback-container svelte-14znspc")},m(I,V){T(I,t,V),v(t,n),v(n,r),v(r,o),Q(i,o,null),v(r,l),v(r,a),Q(s,a,null),v(n,u),v(n,c),Q(f,c,null),v(n,d),v(n,g),Q(p,g,null),v(n,m),v(n,_),Q(w,_,null),v(n,b),v(n,R),Q(A,R,null),v(t,$),v(t,M),v(M,S),v(M,k),v(M,y),Q(E,y,null),D=!0},p:H,i(I){D||(N(i.$$.fragment,I),N(s.$$.fragment,I),N(f.$$.fragment,I),N(p.$$.fragment,I),N(w.$$.fragment,I),N(A.$$.fragment,I),N(E.$$.fragment,I),D=!0)},o(I){x(i.$$.fragment,I),x(s.$$.fragment,I),x(f.$$.fragment,I),x(p.$$.fragment,I),x(w.$$.fragment,I),x(A.$$.fragment,I),x(E.$$.fragment,I),D=!1},d(I){I&&P(t),K(i),K(s),K(f),K(p),K(w),K(A),K(E)}}}function Lg(e,t,n){let r;ie(e,_n,i=>n(0,r=i)),dt(()=>{o()});async function o(){const s=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map(u=>({id:u[0],question:u[1],answer:u[2],vote_status:u[3]}));He(_n,r=[...s],r)}return[]}class na extends ue{constructor(t){super(),de(this,t,Lg,Hg,ae,{})}}/**! + * Sortable 1.15.0 + * @author RubaXa + * @author owenm + * @license MIT + */function ul(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Bg(e,t){if(e==null)return{};var n=Gg(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var jg="1.15.0";function ut(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var gt=ut(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),kn=ut(/Edge/i),cl=ut(/firefox/i),cn=ut(/safari/i)&&!ut(/chrome/i)&&!ut(/android/i),ra=ut(/iP(ad|od|hone)/i),oa=ut(/chrome/i)&&ut(/android/i),ia={capture:!1,passive:!1};function fe(e,t,n){e.addEventListener(t,n,!gt&&ia)}function se(e,t,n){e.removeEventListener(t,n,!gt&&ia)}function lr(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Ug(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Ze(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&lr(e,t):lr(e,t))||r&&e===n)return e;if(e===n)break}while(e=Ug(e))}return null}var fl=/\s+/g;function qe(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(fl," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(fl," ")}}function j(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),r[t]=n+(typeof n=="string"?"":"px")}}function Bt(e,t){var n="";if(typeof e=="string")n=e;else do{var r=j(e,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function la(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,i=r.length;if(n)for(;o=i:l=o<=i,!l)return r;if(r===rt())break;r=_t(r,!1)}return!1}function Xt(e,t,n,r){for(var o=0,i=0,l=e.children;i2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,i=Bg(r,eh);$n.pluginEvent.bind(B)(t,n,lt({dragEl:O,parentEl:Se,ghostEl:Y,rootEl:_e,nextEl:kt,lastDownEl:qn,cloneEl:we,cloneHidden:pt,dragStarted:rn,putSortable:Me,activeSortable:B.active,originalEvent:o,oldIndex:zt,oldDraggableIndex:dn,newIndex:Ge,newDraggableIndex:ht,hideGhostForTarget:ga,unhideGhostForTarget:ha,cloneNowHidden:function(){pt=!0},cloneNowShown:function(){pt=!1},dispatchSortableEvent:function(a){Ne({sortable:n,name:a,originalEvent:o})}},i))};function Ne(e){Zg(lt({putSortable:Me,cloneEl:we,targetEl:O,rootEl:_e,oldIndex:zt,oldDraggableIndex:dn,newIndex:Ge,newDraggableIndex:ht},e))}var O,Se,Y,_e,kt,qn,we,pt,zt,Ge,dn,ht,Nn,Me,Ot=!1,sr=!1,ar=[],St,Xe,Pr,Tr,hl,pl,rn,Tt,gn,hn=!1,Pn=!1,Gn,Fe,xr=[],so=!1,ur=[],yr=typeof document<"u",Tn=ra,ml=kn||gt?"cssFloat":"float",th=yr&&!oa&&!ra&&"draggable"in document.createElement("div"),ca=function(){if(yr){if(gt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),fa=function(t,n){var r=j(t),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),i=Xt(t,0,n),l=Xt(t,1,n),a=i&&j(i),s=l&&j(l),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Re(i).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Re(l).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&a.float!=="none"){var f=a.float==="left"?"left":"right";return l&&(s.clear==="both"||s.clear===f)?"vertical":"horizontal"}return i&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||u>=o&&r[ml]==="none"||l&&r[ml]==="none"&&u+c>o)?"vertical":"horizontal"},nh=function(t,n,r){var o=r?t.left:t.top,i=r?t.right:t.bottom,l=r?t.width:t.height,a=r?n.left:n.top,s=r?n.right:n.bottom,u=r?n.width:n.height;return o===a||i===s||o+l/2===a+u/2},rh=function(t,n){var r;return ar.some(function(o){var i=o[Be].options.emptyInsertThreshold;if(!(!i||Eo(o))){var l=Re(o),a=t>=l.left-i&&t<=l.right+i,s=n>=l.top-i&&n<=l.bottom+i;if(a&&s)return r=o}}),r},da=function(t){function n(i,l){return function(a,s,u,c){var f=a.options.group.name&&s.options.group.name&&a.options.group.name===s.options.group.name;if(i==null&&(l||f))return!0;if(i==null||i===!1)return!1;if(l&&i==="clone")return i;if(typeof i=="function")return n(i(a,s,u,c),l)(a,s,u,c);var d=(l?a:s).options.group.name;return i===!0||typeof i=="string"&&i===d||i.join&&i.indexOf(d)>-1}}var r={},o=t.group;(!o||Ln(o)!="object")&&(o={name:o}),r.name=o.name,r.checkPull=n(o.pull,!0),r.checkPut=n(o.put),r.revertClone=o.revertClone,t.group=r},ga=function(){!ca&&Y&&j(Y,"display","none")},ha=function(){!ca&&Y&&j(Y,"display","")};yr&&!oa&&document.addEventListener("click",function(e){if(sr)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),sr=!1,!1},!0);var Ct=function(t){if(O){t=t.touches?t.touches[0]:t;var n=rh(t.clientX,t.clientY);if(n){var r={};for(var o in t)t.hasOwnProperty(o)&&(r[o]=t[o]);r.target=r.rootEl=n,r.preventDefault=void 0,r.stopPropagation=void 0,n[Be]._onDragOver(r)}}},oh=function(t){O&&O.parentNode[Be]._isOutsideThisEl(t.target)};function B(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=ft({},t),e[Be]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return fa(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,a){l.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:B.supportPointer!==!1&&"PointerEvent"in window&&!cn,emptyInsertThreshold:5};$n.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);da(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:th,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?fe(e,"pointerdown",this._onTapStart):(fe(e,"mousedown",this._onTapStart),fe(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(fe(e,"dragover",this),fe(e,"dragenter",this)),ar.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),ft(this,Qg())}B.prototype={constructor:B,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Tt=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,O):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,r=this.el,o=this.options,i=o.preventOnFilter,l=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,s=(a||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=o.filter;if(dh(r),!O&&!(/mousedown|pointerdown/.test(l)&&t.button!==0||o.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&cn&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Ze(s,o.draggable,r,!1),!(s&&s.animated)&&qn!==s)){if(zt=je(s),dn=je(s,o.draggable),typeof c=="function"){if(c.call(this,t,s,this)){Ne({sortable:n,rootEl:u,name:"filter",targetEl:s,toEl:r,fromEl:r}),xe("filter",n,{evt:t}),i&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(f){if(f=Ze(u,f.trim(),r,!1),f)return Ne({sortable:n,rootEl:f,name:"filter",targetEl:s,fromEl:r,toEl:r}),xe("filter",n,{evt:t}),!0}),c)){i&&t.cancelable&&t.preventDefault();return}o.handle&&!Ze(u,o.handle,r,!1)||this._prepareDragStart(t,a,s)}}},_prepareDragStart:function(t,n,r){var o=this,i=o.el,l=o.options,a=i.ownerDocument,s;if(r&&!O&&r.parentNode===i){var u=Re(r);if(_e=i,O=r,Se=O.parentNode,kt=O.nextSibling,qn=r,Nn=l.group,B.dragged=O,St={target:O,clientX:(n||t).clientX,clientY:(n||t).clientY},hl=St.clientX-u.left,pl=St.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,O.style["will-change"]="all",s=function(){if(xe("delayEnded",o,{evt:t}),B.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!cl&&o.nativeDraggable&&(O.draggable=!0),o._triggerDragStart(t,n),Ne({sortable:o,name:"choose",originalEvent:t}),qe(O,l.chosenClass,!0)},l.ignore.split(",").forEach(function(c){la(O,c.trim(),Or)}),fe(a,"dragover",Ct),fe(a,"mousemove",Ct),fe(a,"touchmove",Ct),fe(a,"mouseup",o._onDrop),fe(a,"touchend",o._onDrop),fe(a,"touchcancel",o._onDrop),cl&&this.nativeDraggable&&(this.options.touchStartThreshold=4,O.draggable=!0),xe("delayStart",this,{evt:t}),l.delay&&(!l.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(kn||gt))){if(B.eventCanceled){this._onDrop();return}fe(a,"mouseup",o._disableDelayedDrag),fe(a,"touchend",o._disableDelayedDrag),fe(a,"touchcancel",o._disableDelayedDrag),fe(a,"mousemove",o._delayedDragTouchMoveHandler),fe(a,"touchmove",o._delayedDragTouchMoveHandler),l.supportPointer&&fe(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(s,l.delay)}else s()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){O&&Or(O),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;se(t,"mouseup",this._disableDelayedDrag),se(t,"touchend",this._disableDelayedDrag),se(t,"touchcancel",this._disableDelayedDrag),se(t,"mousemove",this._delayedDragTouchMoveHandler),se(t,"touchmove",this._delayedDragTouchMoveHandler),se(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?fe(document,"pointermove",this._onTouchMove):n?fe(document,"touchmove",this._onTouchMove):fe(document,"mousemove",this._onTouchMove):(fe(O,"dragend",this),fe(_e,"dragstart",this._onDragStart));try{document.selection?Bn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Ot=!1,_e&&O){xe("dragStarted",this,{evt:n}),this.nativeDraggable&&fe(document,"dragover",oh);var r=this.options;!t&&qe(O,r.dragClass,!1),qe(O,r.ghostClass,!0),B.active=this,t&&this._appendGhost(),Ne({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Xe){this._lastX=Xe.clientX,this._lastY=Xe.clientY,ga();for(var t=document.elementFromPoint(Xe.clientX,Xe.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Xe.clientX,Xe.clientY),t!==n);)n=t;if(O.parentNode[Be]._isOutsideThisEl(t),n)do{if(n[Be]){var r=void 0;if(r=n[Be]._onDragOver({clientX:Xe.clientX,clientY:Xe.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);ha()}},_onTouchMove:function(t){if(St){var n=this.options,r=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,l=Y&&Bt(Y,!0),a=Y&&l&&l.a,s=Y&&l&&l.d,u=Tn&&Fe&&gl(Fe),c=(i.clientX-St.clientX+o.x)/(a||1)+(u?u[0]-xr[0]:0)/(a||1),f=(i.clientY-St.clientY+o.y)/(s||1)+(u?u[1]-xr[1]:0)/(s||1);if(!B.active&&!Ot){if(r&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))=0&&(Ne({rootEl:Se,name:"add",toEl:Se,fromEl:_e,originalEvent:t}),Ne({sortable:this,name:"remove",toEl:Se,originalEvent:t}),Ne({rootEl:Se,name:"sort",toEl:Se,fromEl:_e,originalEvent:t}),Ne({sortable:this,name:"sort",toEl:Se,originalEvent:t})),Me&&Me.save()):Ge!==zt&&Ge>=0&&(Ne({sortable:this,name:"update",toEl:Se,originalEvent:t}),Ne({sortable:this,name:"sort",toEl:Se,originalEvent:t})),B.active&&((Ge==null||Ge===-1)&&(Ge=zt,ht=dn),Ne({sortable:this,name:"end",toEl:Se,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){xe("nulling",this),_e=O=Se=Y=kt=we=qn=pt=St=Xe=rn=Ge=ht=zt=dn=Tt=gn=Me=Nn=B.dragged=B.ghost=B.clone=B.active=null,ur.forEach(function(t){t.checked=!0}),ur.length=Pr=Tr=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":O&&(this._onDragOver(t),ih(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,r=this.el.children,o=0,i=r.length,l=this.options;or.right+o||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+o}function uh(e,t,n,r,o,i,l,a){var s=r?e.clientY:e.clientX,u=r?n.height:n.width,c=r?n.top:n.left,f=r?n.bottom:n.right,d=!1;if(!l){if(a&&Gnc+u*i/2:sf-Gn)return-gn}else if(s>c+u*(1-o)/2&&sf-u*i/2)?s>c+u/2?1:-1:0}function ch(e){return je(O)k[24];for(let k=0;kM[21];for(let M=0;MQ & A Comparison Instructions +
+

Ask a question and rank the answers across the models. Drag each answer to + rank it, in ascending order, from left-to-right. Optionally, select the + rank for each via the corresponding dropdown.

+
+ `,r=F(),o=C("div"),i=C("section"),l=C("div");for(let M=0;M{e.scrollIntoView({behavior:"smooth"})},0)}async function kl(e){console.log("run update",e);const n=await fetch("/chat/comparator/db/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:e})});if(n.ok)console.log("ok",n);else{const r=await n.text();alert(r)}}function mh(e,t,n){let r,o,i;ie(e,Ar,$=>n(7,i=$));let{numModels:l=1}=t,{models:a=[0]}=t,s="",u="",c=!1;dt(async()=>{if(await new Promise($=>setTimeout($,200)),g){const $=new B(g,{animation:150,onUpdate(M){$.toArray()}});$.toArray()}});const f=async $=>{$.preventDefault(),s=u,n(3,u=""),n(4,c=!0);let M={question:s};for(let k of a)M[k]="Loading...";He(Ar,i=[...i,M],i);const S=await fetch(`/chat/comparator/${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:s})});if(S.ok){const k=await S.json();n(1,a=Object.keys(k.answer)),n(0,l=a.length);for(let y of a)M[y]=k.answer[y];M.qid=k.qid,Ar.update(y=>(y[y.length-1]=M,y))}else{const k=await S.text();alert(k)}n(4,c=!1)};let d=0;setInterval(()=>{n(11,d=(d+1)%4)},200);let g,p;function m($,M){const S=M,y=ct($.currentTarget.parentNode).selectAll("div.answer").nodes().map(V=>V.id);y.forEach((V,J)=>{ct(`#${V}`).select(".answer-rank").property("value",J+1)});let E=[];for(let[V,J]of y.entries()){const ce=parseInt(J.split("-")[1]),re=a[ce],be={rank:V,model:re};E.push(be)}let D=i.filter(V=>V.qid===S),I=[];for(let V of E){const J={model:V.model,qid:parseInt(S),rank:parseInt(V.rank)+1,answer:D[0][V.model]};I.push(J)}kl(I)}function _($,M,S){const k=M,y=parseInt($.target.value),E=a[S],D={qid:k,rank:parseInt(y),model:E};let I=[],J=i.filter(re=>re.qid===D.qid)[0][D.model];const ce={model:D.model,qid:parseInt(D.qid),rank:parseInt(D.rank),answer:J};I.push(ce),kl(I)}const w=($,M,S)=>_(S,$.qid,M),b=($,M)=>m(M,$.qid);function R($){ot[$?"unshift":"push"](()=>{g=$,n(2,g)})}function A(){u=this.value,n(3,u)}return e.$$set=$=>{"numModels"in $&&n(0,l=$.numModels),"models"in $&&n(1,a=$.models)},e.$$.update=()=>{e.$$.dirty&1&&n(6,r="1fr ".repeat(l).trim()),e.$$.dirty&2048&&n(5,o=".".repeat(d).padEnd(3)),e.$$.dirty&4100&&g&&(n(12,p=new B(g,{animation:150,dataIdAttr:"id",onUpdate($){p.toArray()}})),p.toArray())},[l,a,g,u,c,o,r,i,f,m,_,d,p,w,b,R,A]}class _h extends ue{constructor(t){super(),de(this,t,mh,hh,ae,{numModels:0,models:1})}}function vh(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return ma(this.cover(t,n),t,n,e)}function ma(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var o,i=e._root,l={data:r},a=e._x0,s=e._y0,u=e._x1,c=e._y1,f,d,g,p,m,_,w,b;if(!i)return e._root=l,e;for(;i.length;)if((m=t>=(f=(a+u)/2))?a=f:u=f,(_=n>=(d=(s+c)/2))?s=d:c=d,o=i,!(i=i[w=_<<1|m]))return o[w]=l,e;if(g=+e._x.call(null,i.data),p=+e._y.call(null,i.data),t===g&&n===p)return l.next=i,o?o[w]=l:e._root=l,e;do o=o?o[w]=new Array(4):e._root=new Array(4),(m=t>=(f=(a+u)/2))?a=f:u=f,(_=n>=(d=(s+c)/2))?s=d:c=d;while((w=_<<1|m)===(b=(p>=d)<<1|g>=f));return o[b]=i,o[w]=l,e}function bh(e){var t,n,r=e.length,o,i,l=new Array(r),a=new Array(r),s=1/0,u=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=o),if&&(f=i));if(s>c||u>f)return this;for(this.cover(s,u).cover(c,f),n=0;ne||e>=o||r>t||t>=i;)switch(u=(tc||(a=p.y0)>f||(s=p.x1)=w)<<1|e>=_)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-m],d[d.length-1-m]=p)}else{var b=e-+this._x.call(null,g.data),R=t-+this._y.call(null,g.data),A=b*b+R*R;if(A=(d=(l+s)/2))?l=d:s=d,(m=f>=(g=(a+u)/2))?a=g:u=g,t=n,!(n=n[_=m<<1|p]))return this;if(!n.length)break;(t[_+1&3]||t[_+2&3]||t[_+3&3])&&(r=t,w=_)}for(;n.data!==e;)if(o=n,!(n=n.next))return this;return(i=n.next)&&delete n.next,o?(i?o.next=i:delete o.next,this):t?(i?t[_]=i:delete t[_],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[w]=n:this._root=n),this):(this._root=i,this)}function $h(e){for(var t=0,n=e.length;td.index){var D=g-k.x-k.vx,I=p-k.y-k.vy,V=D*D+I*I;Vg+E||Mp+E||Su.r&&(u.r=u[c].r)}function s(){if(t){var u,c=t.length,f;for(n=new Array(c),u=0;u{}};function va(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Un.prototype=va.prototype={constructor:Un,on:function(e,t){var n=this._,r=Vh(e+"",n),o,i=-1,l=r.length;if(arguments.length<2){for(;++i0)for(var n=new Array(o),r=0,o,i;r=0&&e._call.call(void 0,t),e=e._next;--Yt}function Ml(){Et=(dr=Sn.now())+Sr,Yt=sn=0;try{Lh()}finally{Yt=0,Gh(),Et=0}}function qh(){var e=Sn.now(),t=e-dr;t>ba&&(Sr-=t,dr=e)}function Gh(){for(var e,t=fr,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:fr=n);an=e,go(r)}function go(e){if(!Yt){sn&&(sn=clearTimeout(sn));var t=e-Et;t>24?(e<1/0&&(sn=setTimeout(Ml,e-Sn.now()-Sr)),en&&(en=clearInterval(en))):(en||(dr=Sn.now(),en=setInterval(qh,ba)),Yt=1,wa(Ml))}}const Bh=1664525,jh=1013904223,El=4294967296;function Uh(){let e=1;return()=>(e=(Bh*e+jh)%El)/El}var Wh=10,Xh=Math.PI*(3-Math.sqrt(5));function Yh(e){var t,n=1,r=.001,o=1-Math.pow(r,1/300),i=0,l=.6,a=new Map,s=Sa(f),u=va("tick","end"),c=Uh();e==null&&(e=[]);function f(){d(),u.call("tick",t),n1?(_==null?a.delete(m):a.set(m,p(_)),t):a.get(m)},find:function(m,_,w){var b=0,R=e.length,A,$,M,S,k;for(w==null?w=1/0:w*=w,b=0;b1?(u.on(m,_),t):u.on(m)}}}function Qh(e){var t=tt(.1),n,r,o;typeof e!="function"&&(e=tt(e==null?0:+e));function i(a){for(var s=0,u=n.length,c;se[4]?1:0),h(t,"class",g="file-circle-g "+(e[20].size>e[4]?"large":"")+" svelte-h2ab3o"),h(t,"style",p=e[5](e[20].x,e[20].y)),h(t,"role","img")},m(b,R){T(b,t,R),v(t,n),v(t,i),v(i,a),v(i,s),v(s,c),m=!0,_||(w=[q(t,"mouseover",e[6]),q(t,"mouseout",e[7]),q(t,"focus",e[6]),q(t,"blur",e[7])],_=!0)},p(b,R){(!m||R&12&&r!==(r=b[3](b[20].size)))&&h(n,"r",r),(!m||R&4)&&l!==(l=b[20].file+"")&&ne(a,l),(!m||R&4)&&u!==(u=to(b[20].size)+"")&&ne(c,u),(!m||R&20&&f!==(f=b[20].size>b[4]?1:0))&&h(i,"opacity",f),(!m||R&20&&g!==(g="file-circle-g "+(b[20].size>b[4]?"large":"")+" svelte-h2ab3o"))&&h(t,"class",g),(!m||R&4&&p!==(p=b[5](b[20].x,b[20].y)))&&h(t,"style",p)},i(b){m||(b&&Ae(()=>{m&&(o||(o=et(n,Mn,{duration:1e3},!0)),o.run(1))}),b&&Ae(()=>{m&&(d||(d=et(i,Mn,{duration:1e3},!0)),d.run(1))}),m=!0)},o(b){b&&(o||(o=et(n,Mn,{duration:1e3},!1)),o.run(0)),b&&(d||(d=et(i,Mn,{duration:1e3},!1)),d.run(0)),m=!1},d(b){b&&P(t),b&&o&&o.end(),b&&d&&d.end(),_=!1,ve(w)}}}function Jh(e){let t,n,r,o,i=e[2],l=[];for(let s=0;sx(l[s],1,1,()=>{l[s]=null});return{c(){t=C("div"),n=W("svg");for(let s=0;se[15].call(t))},m(s,u){T(s,t,u),v(t,n);for(let c=0;cn(14,c=$));let f=600,d=350,g=!0,p=!1;const m=($,M)=>`transform: translate(${$}px, ${M}px)`,_=[-4,4],w=[-1,1];function b(){n(8,g=!0),n(9,p=!0);const $=ct(this);Mr(".file-circle-g").select("text").style("opacity",0),$.raise(),$.select("circle").attr("fill","var(--red)"),$.select("text").style("opacity",1)}const R=()=>{const $=Mr(".file-circle-g");$.select("circle").attr("fill","var(--yellow)"),$.select("text").style("opacity",0),n(9,p=!1),setTimeout(()=>{n(8,g=!1)},1e3)};function A(){f=this.offsetWidth,d=this.offsetHeight,n(0,f),n(1,d)}return e.$$.update=()=>{e.$$.dirty&16387&&n(2,r=c.map($=>({...$,x:f/2,y:d/2,tickCount:0}))),e.$$.dirty&16384&&console.log(c.map($=>$.size).sort(($,M)=>$-M)),e.$$.dirty&1&&n(13,o=Qh().x(f/2)),e.$$.dirty&2&&n(12,i=Kh().y(d/2)),e.$$.dirty&16384&&n(3,s=Qe().domain(un(c,$=>$.size)).range([12,60])),e.$$.dirty&8&&n(10,l=xh().radius($=>s($.size)+1).iterations(3)),e.$$.dirty&16384&&n(4,a=kd(c.map($=>$.size).sort(($,M)=>$-M),.85)),e.$$.dirty&1&&Qe().domain(_).range([5,f]),e.$$.dirty&2&&Qe().domain(w).range([d,5]),e.$$.dirty&4&&n(11,u=Yh().nodes(r).on("tick",()=>{n(2,r=[...r])})),e.$$.dirty&15360&&(u.force("x",o),u.force("y",i),u.force("collide",l),u.alpha(.02),u.restart()),e.$$.dirty&19468&&(s.domain(un(c,$=>$.size)),r.forEach($=>$.radius=s($.size)),u.nodes(r),l.radius($=>$.radius+.5)),e.$$.dirty&768&&g===!1&&(p||Mr(".large").select("text").style("opacity",1))},[f,d,r,s,a,m,b,R,g,p,l,u,i,o,c,A]}class ep extends ue{constructor(t){super(),de(this,t,Zh,Jh,ae,{})}}/** + * table-core + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function vt(e,t){return typeof e=="function"?e(t):e}function We(e,t){return n=>{t.setState(r=>({...r,[e]:vt(n,r[e])}))}}function hr(e){return e instanceof Function}function tp(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function np(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const l=t(i);l!=null&&l.length&&r(l)})};return r(e),n}function U(e,t,n){let r=[],o;return()=>{let i;n.key&&n.debug&&(i=Date.now());const l=e();if(!(l.length!==r.length||l.some((u,c)=>r[c]!==u)))return o;r=l;let s;if(n.key&&n.debug&&(s=Date.now()),o=t(...l),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-i)*100)/100,c=Math.round((Date.now()-s)*100)/100,f=c/16,d=(g,p)=>{for(g=String(g);g.length{let g=d;for(const m of s.split(".")){var p;g=(p=g)==null?void 0:p[m]}return g}:c=d=>d[a.accessorKey]),!u)throw new Error;let f={id:`${String(u)}`,accessorFn:c,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:U(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(g=>g.getFlatColumns())]},{key:"column.getFlatColumns",debug:()=>{var d;return(d=e.options.debugAll)!=null?d:e.options.debugColumns}}),getLeafColumns:U(()=>[e._getOrderColumnsFn()],d=>{var g;if((g=f.columns)!=null&&g.length){let p=f.columns.flatMap(m=>m.getLeafColumns());return d(p)}return[f]},{key:"column.getLeafColumns",debug:()=>{var d;return(d=e.options.debugAll)!=null?d:e.options.debugColumns}})};return f=e._features.reduce((d,g)=>Object.assign(d,g.createColumn==null?void 0:g.createColumn(f,e)),f),f}function Nl(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const l=[],a=s=>{s.subHeaders&&s.subHeaders.length&&s.subHeaders.map(a),l.push(s)};return a(i),l},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(l=>{Object.assign(i,l.createHeader==null?void 0:l.createHeader(i,e))}),i}const op={createTable:e=>({getHeaderGroups:U(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,l;const a=(i=r==null?void 0:r.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?i:[],s=(l=o==null?void 0:o.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?l:[],u=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return On(t,[...a,...u,...s],e)},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterHeaderGroups:U(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),On(t,n,e,"center")),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftHeaderGroups:U(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?o:[];return On(t,i,e,"left")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightHeaderGroups:U(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?o:[];return On(t,i,e,"right")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFooterGroups:U(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFooterGroups:U(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFooterGroups:U(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFooterGroups:U(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFlatHeaders:U(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFlatHeaders:U(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFlatHeaders:U(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFlatHeaders:U(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterLeafHeaders:U(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftLeafHeaders:U(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightLeafHeaders:U(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeafHeaders:U(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,l,a,s,u;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(l=(a=n[0])==null?void 0:a.headers)!=null?l:[],...(s=(u=r[0])==null?void 0:u.headers)!=null?s:[]].map(c=>c.getLeafHeaders()).flat()},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})})};function On(e,t,n,r){var o,i;let l=0;const a=function(d,g){g===void 0&&(g=1),l=Math.max(l,g),d.filter(p=>p.getIsVisible()).forEach(p=>{var m;(m=p.columns)!=null&&m.length&&a(p.columns,g+1)},0)};a(e);let s=[];const u=(d,g)=>{const p={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},m=[];d.forEach(_=>{const w=[...m].reverse()[0],b=_.column.depth===p.depth;let R,A=!1;if(b&&_.column.parent?R=_.column.parent:(R=_.column,A=!0),w&&(w==null?void 0:w.column)===R)w.subHeaders.push(_);else{const $=Nl(n,R,{id:[r,g,R.id,_==null?void 0:_.id].filter(Boolean).join("_"),isPlaceholder:A,placeholderId:A?`${m.filter(M=>M.column===R).length}`:void 0,depth:g,index:m.length});$.subHeaders.push(_),m.push($)}p.headers.push(_),_.headerGroup=p}),s.push(p),g>0&&u(m,g-1)},c=t.map((d,g)=>Nl(n,d,{depth:l,index:g}));u(c,l-1),s.reverse();const f=d=>d.filter(p=>p.column.getIsVisible()).map(p=>{let m=0,_=0,w=[0];p.subHeaders&&p.subHeaders.length?(w=[],f(p.subHeaders).forEach(R=>{let{colSpan:A,rowSpan:$}=R;m+=A,w.push($)})):m=1;const b=Math.min(...w);return _=_+b,p.colSpan=m,p.rowSpan=_,{colSpan:m,rowSpan:_}});return f((o=(i=s[0])==null?void 0:i.headers)!=null?o:[]),s}const Vn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Lr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ip={getDefaultColumnDef:()=>Vn,getInitialState:e=>({columnSizing:{},columnSizingInfo:Lr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:We("columnSizing",e),onColumnSizingInfoChange:We("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Vn.minSize,(r=i??e.columnDef.size)!=null?r:Vn.size),(o=e.columnDef.maxSize)!=null?o:Vn.maxSize)},getStart:n=>{const r=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),o=r.findIndex(i=>i.id===e.id);if(o>0){const i=r[o-1];return i.getStart(n)+i.getSize()}return 0},resetSize:()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},getCanResize:()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},getIsResizing:()=>t.getState().columnSizingInfo.isResizingColumn===e.id}),createHeader:(e,t)=>({getSize:()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},getStart:()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},getResizeHandler:()=>{const n=t.getColumn(e.column.id),r=n==null?void 0:n.getCanResize();return o=>{if(!n||!r||(o.persist==null||o.persist(),qr(o)&&o.touches&&o.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[n.id,n.getSize()]],a=qr(o)?Math.round(o.touches[0].clientX):o.clientX,s={},u=(m,_)=>{typeof _=="number"&&(t.setColumnSizingInfo(w=>{var b,R;const A=_-((b=w==null?void 0:w.startOffset)!=null?b:0),$=Math.max(A/((R=w==null?void 0:w.startSize)!=null?R:0),-.999999);return w.columnSizingStart.forEach(M=>{let[S,k]=M;s[S]=Math.round(Math.max(k+k*$,0)*100)/100}),{...w,deltaOffset:A,deltaPercentage:$}}),(t.options.columnResizeMode==="onChange"||m==="end")&&t.setColumnSizing(w=>({...w,...s})))},c=m=>u("move",m),f=m=>{u("end",m),t.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d={moveHandler:m=>c(m.clientX),upHandler:m=>{document.removeEventListener("mousemove",d.moveHandler),document.removeEventListener("mouseup",d.upHandler),f(m.clientX)}},g={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),c(m.touches[0].clientX),!1),upHandler:m=>{var _;document.removeEventListener("touchmove",g.moveHandler),document.removeEventListener("touchend",g.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),f((_=m.touches[0])==null?void 0:_.clientX)}},p=lp()?{passive:!1}:!1;qr(o)?(document.addEventListener("touchmove",g.moveHandler,p),document.addEventListener("touchend",g.upHandler,p)):(document.addEventListener("mousemove",d.moveHandler,p),document.addEventListener("mouseup",d.upHandler,p)),t.setColumnSizingInfo(m=>({...m,startOffset:a,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:n.id}))}}}),createTable:e=>({setColumnSizing:t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),setColumnSizingInfo:t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),resetColumnSizing:t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},resetHeaderSizeInfo:t=>{var n;e.setColumnSizingInfo(t?Lr():(n=e.initialState.columnSizingInfo)!=null?n:Lr())},getTotalSize:()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},getLeftTotalSize:()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},getCenterTotalSize:()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},getRightTotalSize:()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}})};let zn=null;function lp(){if(typeof zn=="boolean")return zn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return zn=e,zn}function qr(e){return e.type==="touchstart"}const sp={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:We("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},setExpanded:r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),toggleAllRowsExpanded:r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},resetExpanded:r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},getCanSomeRowsExpand:()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),getToggleAllRowsExpandedHandler:()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},getIsSomeRowsExpanded:()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},getIsAllRowsExpanded:()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},getExpandedDepth:()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const l=i.split(".");r=Math.max(r,l.length)}),r},getPreExpandedRowModel:()=>e.getSortedRowModel(),getExpandedRowModel:()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())}},createRow:(e,t)=>({toggleExpanded:n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let l={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{l[a]=!0}):l=r,n=(o=n)!=null?o:!i,!i&&n)return{...l,[e.id]:!0};if(i&&!n){const{[e.id]:a,...s}=l;return s}return r})},getIsExpanded:()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},getCanExpand:()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},getToggleExpandedHandler:()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}})},Ca=(e,t,n)=>{var r,o,i;const l=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(o=r.toString())==null||(i=o.toLowerCase())==null)&&i.includes(l))};Ca.autoRemove=e=>Ke(e);const ka=(e,t,n)=>{var r,o;return!!(!((r=e.getValue(t))==null||(o=r.toString())==null)&&o.includes(n))};ka.autoRemove=e=>Ke(e);const $a=(e,t,n)=>{var r,o;return((r=e.getValue(t))==null||(o=r.toString())==null?void 0:o.toLowerCase())===(n==null?void 0:n.toLowerCase())};$a.autoRemove=e=>Ke(e);const Ra=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Ra.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Aa=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Aa.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Ma=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Ma.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Ea=(e,t,n)=>e.getValue(t)===n;Ea.autoRemove=e=>Ke(e);const Fa=(e,t,n)=>e.getValue(t)==n;Fa.autoRemove=e=>Ke(e);const No=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};No.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,l=n===null||Number.isNaN(o)?1/0:o;if(i>l){const a=i;i=l,l=a}return[i,l]};No.autoRemove=e=>Ke(e)||Ke(e[0])&&Ke(e[1]);const st={includesString:Ca,includesStringSensitive:ka,equalsString:$a,arrIncludes:Ra,arrIncludesAll:Aa,arrIncludesSome:Ma,equals:Ea,weakEquals:Fa,inNumberRange:No};function Ke(e){return e==null||e===""}const ap={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:We("columnFilters",e),onGlobalFilterChange:We("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,r;const o=(n=e.getCoreRowModel().flatRows[0])==null||(r=n._getAllCellsByColumnId()[t.id])==null?void 0:r.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>({getAutoFilterFn:()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?st.includesString:typeof r=="number"?st.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?st.equals:Array.isArray(r)?st.arrIncludes:st.weakEquals},getFilterFn:()=>{var n,r;return hr(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:st[e.columnDef.filterFn]},getCanFilter:()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},getCanGlobalFilter:()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn},getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var n,r;return(n=t.getState().columnFilters)==null||(r=n.find(o=>o.id===e.id))==null?void 0:r.value},getFilterIndex:()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},setFilterValue:n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(c=>c.id===e.id),l=vt(n,i?i.value:void 0);if(Pl(o,l,e)){var a;return(a=r==null?void 0:r.filter(c=>c.id!==e.id))!=null?a:[]}const s={id:e.id,value:l};if(i){var u;return(u=r==null?void 0:r.map(c=>c.id===e.id?s:c))!=null?u:[]}return r!=null&&r.length?[...r,s]:[s]})},_getFacetedRowModel:t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),getFacetedRowModel:()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),_getFacetedUniqueValues:t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),getFacetedUniqueValues:()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,_getFacetedMinMaxValues:t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),getFacetedMinMaxValues:()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}),createRow:(e,t)=>({columnFilters:{},columnFiltersMeta:{}}),createTable:e=>({getGlobalAutoFilterFn:()=>st.includesString,getGlobalFilterFn:()=>{var t,n;const{globalFilterFn:r}=e.options;return hr(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:st[r]},setColumnFilters:t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=vt(t,o))==null?void 0:i.filter(l=>{const a=n.find(s=>s.id===l.id);if(a){const s=a.getFilterFn();if(Pl(s,l.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},setGlobalFilter:t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},resetGlobalFilter:t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},resetColumnFilters:t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},getPreFilteredRowModel:()=>e.getCoreRowModel(),getFilteredRowModel:()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),_getGlobalFacetedRowModel:e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),getGlobalFacetedRowModel:()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),_getGlobalFacetedUniqueValues:e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),getGlobalFacetedUniqueValues:()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,_getGlobalFacetedMinMaxValues:e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),getGlobalFacetedMinMaxValues:()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}})};function Pl(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const up=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),cp=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},fp=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r=i)&&(r=i)}),r},dp=(e,t,n)=>{let r,o;return n.forEach(i=>{const l=i.getValue(e);l!=null&&(r===void 0?l>=l&&(r=o=l):(r>l&&(r=l),o{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},hp=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!tp(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,l)=>i-l);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},pp=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),mp=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,_p=(e,t)=>t.length,Gr={sum:up,min:cp,max:fp,extent:dp,mean:gp,median:hp,unique:pp,uniqueCount:mp,count:_p},vp={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:We("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>({toggleGrouping:()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},getCanGroup:()=>{var n,r,o,i;return(n=(r=(o=(i=e.columnDef.enableGrouping)!=null?i:!0)!=null?o:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},getIsGrouped:()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},getGroupedIndex:()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},getToggleGroupingHandler:()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},getAutoAggregationFn:()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Gr.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Gr.extent},getAggregationFn:()=>{var n,r;if(!e)throw new Error;return hr(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Gr[e.columnDef.aggregationFn]}}),createTable:e=>({setGrouping:t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),resetGrouping:t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},getPreGroupedRowModel:()=>e.getFilteredRowModel(),getGroupedRowModel:()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())}),createRow:(e,t)=>({getIsGrouped:()=>!!e.groupingColumnId,getGroupingValue:n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},_groupingValuesCache:{}}),createCell:(e,t,n,r)=>({getIsGrouped:()=>t.getIsGrouped()&&t.id===n.groupingColumnId,getIsPlaceholder:()=>!e.getIsGrouped()&&t.getIsGrouped(),getIsAggregated:()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}})};function bp(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(l=>l.id===i)).filter(Boolean),...r]}const wp={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:We("columnOrder",e)}),createTable:e=>({setColumnOrder:t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),resetColumnOrder:t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},_getOrderColumnsFn:U(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const l=[...t],a=[...o];for(;a.length&&l.length;){const s=l.shift(),u=a.findIndex(c=>c.id===s);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return bp(i,n,r)},{key:!1})})},ho=0,po=10,Br=()=>({pageIndex:ho,pageSize:po}),yp={getInitialState:e=>({...e,pagination:{...Br(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:We("pagination",e)}),createTable:e=>{let t=!1,n=!1;return{_autoResetPageIndex:()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},setPagination:r=>{const o=i=>vt(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},resetPagination:r=>{var o;e.setPagination(r?Br():(o=e.initialState.pagination)!=null?o:Br())},setPageIndex:r=>{e.setPagination(o=>{let i=vt(r,o.pageIndex);const l=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,l)),{...o,pageIndex:i}})},resetPageIndex:r=>{var o,i,l;e.setPageIndex(r?ho:(o=(i=e.initialState)==null||(l=i.pagination)==null?void 0:l.pageIndex)!=null?o:ho)},resetPageSize:r=>{var o,i,l;e.setPageSize(r?po:(o=(i=e.initialState)==null||(l=i.pagination)==null?void 0:l.pageSize)!=null?o:po)},setPageSize:r=>{e.setPagination(o=>{const i=Math.max(1,vt(r,o.pageSize)),l=o.pageSize*o.pageIndex,a=Math.floor(l/i);return{...o,pageIndex:a,pageSize:i}})},setPageCount:r=>e.setPagination(o=>{var i;let l=vt(r,(i=e.options.pageCount)!=null?i:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...o,pageCount:l}}),getPageOptions:U(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,l)=>l)),o},{key:!1,debug:()=>{var r;return(r=e.options.debugAll)!=null?r:e.options.debugTable}}),getCanPreviousPage:()=>e.getState().pagination.pageIndex>0,getCanNextPage:()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:re.setPageIndex(r=>r-1),nextPage:()=>e.setPageIndex(r=>r+1),getPrePaginationRowModel:()=>e.getExpandedRowModel(),getPaginationRowModel:()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),getPageCount:()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}}},jr=()=>({left:[],right:[]}),Sp={getInitialState:e=>({columnPinning:jr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:We("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,l;if(n==="right"){var a,s;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((s=o==null?void 0:o.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var u,c;return{left:[...((u=o==null?void 0:o.left)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((c=o==null?void 0:o.right)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((l=o==null?void 0:o.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f)))}})},getCanPin:()=>e.getLeafColumns().some(r=>{var o,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=t.options.enablePinning)!=null?i:!0)}),getIsPinned:()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),l=n.some(a=>o==null?void 0:o.includes(a));return i?"left":l?"right":!1},getPinnedIndex:()=>{var n,r,o;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(o=r[i])==null?void 0:o.indexOf(e.id))!=null?n:-1:0}}),createRow:(e,t)=>({getCenterVisibleCells:U(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(l=>!i.includes(l.column.id))},{key:"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getLeftVisibleCells:U(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,r)=>(r??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),{key:"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getRightVisibleCells:U(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),{key:"row.getRightVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>({setColumnPinning:t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),resetColumnPinning:t=>{var n,r;return e.setColumnPinning(t?jr():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:jr())},getIsSomeColumnsPinned:t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},getLeftLeafColumns:U(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getRightLeafColumns:U(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getCenterLeafColumns:U(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}})})},Cp={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:We("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>({setRowSelection:t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),resetRowSelection:t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},toggleAllRowsSelected:t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},toggleAllPageRowsSelected:t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{mo(o,i.id,r,e)}),o}),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:U(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Ur(e,n):{rows:[],flatRows:[],rowsById:{}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getFilteredSelectedRowModel:U(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Ur(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getGroupedSelectedRowModel:U(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Ur(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getIsAllRowsSelected:()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},getIsSomeRowsSelected:()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},getToggleAllRowsSelectedHandler:()=>t=>{e.toggleAllRowsSelected(t.target.checked)},getToggleAllPageRowsSelectedHandler:()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}}),createRow:(e,t)=>({toggleSelected:n=>{const r=e.getIsSelected();t.setRowSelection(o=>{if(n=typeof n<"u"?n:!r,r===n)return o;const i={...o};return mo(i,e.id,n,t),i})},getIsSelected:()=>{const{rowSelection:n}=t.getState();return Po(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return Tl(e,n)==="some"},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return Tl(e,n)==="all"},getCanSelect:()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},getCanSelectSubRows:()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},getCanMultiSelect:()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},getToggleSelectedHandler:()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}})},mo=(e,t,n,r)=>{var o;const i=r.getRow(t);n?(i.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),i.getCanSelect()&&(e[t]=!0)):delete e[t],(o=i.subRows)!=null&&o.length&&i.getCanSelectSubRows()&&i.subRows.forEach(l=>mo(e,l.id,n,r))};function Ur(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(l,a){return l.map(s=>{var u;const c=Po(s,n);if(c&&(r.push(s),o[s.id]=s),(u=s.subRows)!=null&&u.length&&(s={...s,subRows:i(s.subRows)}),c)return s}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function Po(e,t){var n;return(n=t[e.id])!=null?n:!1}function Tl(e,t,n){if(e.subRows&&e.subRows.length){let r=!0,o=!1;return e.subRows.forEach(i=>{o&&!r||(Po(i,t)?o=!0:r=!1)}),r?"all":o?"some":!1}return!1}const _o=/([0-9]+)/gm,kp=(e,t,n)=>Da(wt(e.getValue(n)).toLowerCase(),wt(t.getValue(n)).toLowerCase()),$p=(e,t,n)=>Da(wt(e.getValue(n)),wt(t.getValue(n))),Rp=(e,t,n)=>To(wt(e.getValue(n)).toLowerCase(),wt(t.getValue(n)).toLowerCase()),Ap=(e,t,n)=>To(wt(e.getValue(n)),wt(t.getValue(n))),Mp=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:rTo(e.getValue(n),t.getValue(n));function To(e,t){return e===t?0:e>t?1:-1}function wt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Da(e,t){const n=e.split(_o).filter(Boolean),r=t.split(_o).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),l=parseInt(o,10),a=parseInt(i,10),s=[l,a].sort();if(isNaN(s[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(s[1]))return isNaN(l)?-1:1;if(l>a)return 1;if(a>l)return-1}return n.length-r.length}const tn={alphanumeric:kp,alphanumericCaseSensitive:$p,text:Rp,textCaseSensitive:Ap,datetime:Mp,basic:Ep},Fp={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:We("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return tn.datetime;if(typeof i=="string"&&(r=!0,i.split(_o).length>1))return tn.alphanumeric}return r?tn.text:tn.basic},getAutoSortDir:()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},getSortingFn:()=>{var n,r;if(!e)throw new Error;return hr(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:tn[e.columnDef.sortingFn]},toggleSorting:(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(l=>{const a=l==null?void 0:l.find(g=>g.id===e.id),s=l==null?void 0:l.findIndex(g=>g.id===e.id);let u=[],c,f=i?n:o==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&r?a?c="toggle":c="add":l!=null&&l.length&&s!==l.length-1?c="replace":a?c="toggle":c="replace",c==="toggle"&&(i||o||(c="remove")),c==="add"){var d;u=[...l,{id:e.id,desc:f}],u.splice(0,u.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else c==="toggle"?u=l.map(g=>g.id===e.id?{...g,desc:f}:g):c==="remove"?u=l.filter(g=>g.id!==e.id):u=[{id:e.id,desc:f}];return u})},getFirstSortDir:()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},getNextSortingOrder:n=>{var r,o;const i=e.getFirstSortDir(),l=e.getIsSorted();return l?l!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:l==="desc"?"asc":"desc":i},getCanSort:()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},getCanMultiSort:()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},getIsSorted:()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},getSortIndex:()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},clearSorting:()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},getToggleSortingHandler:()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}}),createTable:e=>({setSorting:t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),resetSorting:t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},getPreSortedRowModel:()=>e.getGroupedRowModel(),getSortedRowModel:()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())})},Dp={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:We("columnVisibility",e)}),createColumn:(e,t)=>({toggleVisibility:n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},getIsVisible:()=>{var n,r;return(n=(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},getCanHide:()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},getToggleVisibilityHandler:()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}}),createRow:(e,t)=>({_getAllVisibleCells:U(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),{key:"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getVisibleCells:U(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>{const t=(n,r)=>U(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),{key:n,debug:()=>{var o;return(o=e.options.debugAll)!=null?o:e.options.debugColumns}});return{getVisibleFlatColumns:t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),getVisibleLeafColumns:t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),getLeftVisibleLeafColumns:t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),getRightVisibleLeafColumns:t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),getCenterVisibleLeafColumns:t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),setColumnVisibility:n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),resetColumnVisibility:n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},toggleAllColumnsVisible:n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},getIsAllColumnsVisible:()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),getIsSomeColumnsVisible:()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),getToggleAllColumnsVisibilityHandler:()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}}},xl=[op,Dp,wp,Sp,ap,Fp,vp,sp,yp,Cp,ip];function Ip(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:xl};const r=n._features.reduce((c,f)=>Object.assign(c,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),o=c=>n.options.mergeOptions?n.options.mergeOptions(r,c):{...r,...c};let l={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(c=>{var f;l=(f=c.getInitialState==null?void 0:c.getInitialState(l))!=null?f:l});const a=[];let s=!1;const u={_features:xl,options:{...r,...e},initialState:l,_queue:c=>{a.push(c),s||(s=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();s=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:c=>{const f=vt(c,n.options);n.options=o(f)},getState:()=>n.options.state,setState:c=>{n.options.onStateChange==null||n.options.onStateChange(c)},_getRowId:(c,f,d)=>{var g;return(g=n.options.getRowId==null?void 0:n.options.getRowId(c,f,d))!=null?g:`${d?[d.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:c=>{const f=n.getRowModel().rowsById[c];if(!f)throw new Error;return f},_getDefaultColumnDef:U(()=>[n.options.defaultColumn],c=>{var f;return c=(f=c)!=null?f:{},{header:d=>{const g=d.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:d=>{var g,p;return(g=(p=d.renderValue())==null||p.toString==null?void 0:p.toString())!=null?g:null},...n._features.reduce((d,g)=>Object.assign(d,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...c}},{debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns},key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:U(()=>[n._getColumnDefs()],c=>{const f=function(d,g,p){return p===void 0&&(p=0),d.map(m=>{const _=rp(n,m,p,g),w=m;return _.columns=w.columns?f(w.columns,_,p+1):[],_})};return f(c)},{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getAllFlatColumns:U(()=>[n.getAllColumns()],c=>c.flatMap(f=>f.getFlatColumns()),{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),_getAllFlatColumnsById:U(()=>[n.getAllFlatColumns()],c=>c.reduce((f,d)=>(f[d.id]=d,f),{}),{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getAllLeafColumns:U(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(c,f)=>{let d=c.flatMap(g=>g.getLeafColumns());return f(d)},{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getColumn:c=>n._getAllFlatColumnsById()[c]};return Object.assign(n,u),n._features.forEach(c=>Object.assign(n,c.createTable==null?void 0:c.createTable(n))),n}function Np(e,t,n,r){const o=()=>{var l;return(l=i.getValue())!=null?l:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:U(()=>[e,n,t,i],(l,a,s,u)=>({table:l,column:a,row:s,cell:u,getValue:u.getValue,renderValue:u.renderValue}),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach(l=>{Object.assign(i,l.createCell==null?void 0:l.createCell(i,n,t,e))},{}),i}const xo=(e,t,n,r,o,i,l)=>{let a={id:t,index:r,original:n,depth:o,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:s=>{if(a._valuesCache.hasOwnProperty(s))return a._valuesCache[s];const u=e.getColumn(s);if(u!=null&&u.accessorFn)return a._valuesCache[s]=u.accessorFn(a.original,r),a._valuesCache[s]},getUniqueValues:s=>{if(a._uniqueValuesCache.hasOwnProperty(s))return a._uniqueValuesCache[s];const u=e.getColumn(s);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[s]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[s]):(a._uniqueValuesCache[s]=[a.getValue(s)],a._uniqueValuesCache[s])},renderValue:s=>{var u;return(u=a.getValue(s))!=null?u:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>np(a.subRows,s=>s.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId):void 0,getParentRows:()=>{let s=[],u=a;for(;;){const c=u.getParentRow();if(!c)break;s.push(c),u=c}return s.reverse()},getAllCells:U(()=>[e.getAllLeafColumns()],s=>s.map(u=>Np(e,a,u,u.id)),{key:!1,debug:()=>{var s;return(s=e.options.debugAll)!=null?s:e.options.debugRows}}),_getAllCellsByColumnId:U(()=>[a.getAllCells()],s=>s.reduce((u,c)=>(u[c.column.id]=c,u),{}),{key:"row.getAllCellsByColumnId",debug:()=>{var s;return(s=e.options.debugAll)!=null?s:e.options.debugRows}})};for(let s=0;stypeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function Ol(){return e=>U(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,l){i===void 0&&(i=0);const a=[];for(let u=0;u{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Ia(e,t,n){return n.options.filterFromLeafRows?Tp(e,t,n):xp(e,t,n)}function Tp(e,t,n){var r;const o=[],i={},l=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(s,u){u===void 0&&(u=0);const c=[];for(let d=0;dU(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let d=0;d{var g;const p=e.getColumn(d.id);if(!p)return;const m=p.getFilterFn();m&&o.push({id:d.id,filterFn:m,resolvedValue:(g=m.resolveFilterValue==null?void 0:m.resolveFilterValue(d.value))!=null?g:d.value})});const l=n.map(d=>d.id),a=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter(d=>d.getCanGlobalFilter());r&&a&&s.length&&(l.push("__global__"),s.forEach(d=>{var g;i.push({id:d.id,filterFn:a,resolvedValue:(g=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?g:r})}));let u,c;for(let d=0;d{g.columnFiltersMeta[m]=_})}if(i.length){for(let p=0;p{g.columnFiltersMeta[m]=_})){g.columnFilters.__global__=!0;break}}g.columnFilters.__global__!==!0&&(g.columnFilters.__global__=!1)}}const f=d=>{for(let g=0;g{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function zl(){return(e,t)=>U(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,o)=>{if(!n.rows.length||!(r!=null&&r.length)&&!o)return n;const i=[...r.map(a=>a.id).filter(a=>a!==t),o?"__global__":void 0].filter(Boolean),l=a=>{for(let s=0;s{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable},onChange:()=>{}})}function Hl(){return e=>U(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(s=>{var u;return(u=e.getColumn(s.id))==null?void 0:u.getCanSort()}),l={};i.forEach(s=>{const u=e.getColumn(s.id);u&&(l[s.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=s=>{const u=[...s];return u.sort((c,f)=>{for(let g=0;g{var f;o.push(c),(f=c.subRows)!=null&&f.length&&(c.subRows=a(c.subRows))}),u};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Op(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Ll(e){return t=>U(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:l,flatRows:a,rowsById:s}=r;const u=o*i,c=u+o;l=l.slice(u,c);let f;t.options.paginateExpandedRows?f={rows:l,flatRows:a,rowsById:s}:f=Op({rows:l,flatRows:a,rowsById:s}),f.flatRows=[];const d=g=>{f.flatRows.push(g),g.subRows.length&&g.subRows.forEach(d)};return f.rows.forEach(d),f},{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/** + * svelte-table + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Vp(e){let t;return{c(){t=z(e[0])},l(n){t=Qa(n,e[0])},m(n,r){Ba(n,t,r)},p(n,[r]){r&1&&ne(t,n[0])},i:H,o:H,d(n){n&&P(t)}}}function zp(e,t,n){let{content:r}=t;return e.$$set=o=>{"content"in o&&n(0,r=o.content)},[r]}class Hp extends ue{constructor(t){super(),de(this,t,zp,Vp,ae,{content:0})}}const Lp=Ss((e,t,n,r)=>`${gu(t.content)}`);var qp=typeof document>"u"?Lp:Hp;function Gp(e,t,n){let r,o;return r=new t({props:n,$$inline:!0}),{c(){te(r.$$.fragment)},l(i){pu(r.$$.fragment,i)},m(i,l){Q(r,i,l),o=!0},p:H,i(i){o||(N(r.$$.fragment,i),o=!0)},o(i){x(r.$$.fragment,i),o=!1},d(i){K(r,i)}}}function Bp(e,t){return class extends ue{constructor(r){super(),de(this,r,null,o=>Gp(o,e,t),ae,{},void 0)}}}function jp(e,t){return Ss((r,o,i,l)=>`${hu(e,"TableComponent").$$render(r,t,{},{})}`)}const vo=typeof window>"u"?jp:Bp;function Up(e){return typeof e=="object"&&typeof e.$$render=="function"&&typeof e.render=="function"}function Wp(e){var t,n;let r="__SVELTE_HMR"in window;return e.prototype instanceof ue||r&&((t=e.name)==null?void 0:t.startsWith("Proxy<"))&&((n=e.name)==null?void 0:n.endsWith(">"))}function ql(e){return typeof document>"u"?Up(e):Wp(e)}function Gl(e){return vo(qp,{content:e})}function pr(e,t){if(!e)return null;if(ql(e))return vo(e,t);if(typeof e=="function"){const n=e(t);return n==null?null:ql(n)?vo(n,t):Gl(n)}return Gl(e)}function Bl(e){let t;"subscribe"in e?t=e:t=Qr(e);let n={state:{},onStateChange:()=>{},renderFallbackValue:null,...xa(t)},r=Ip(n),o=Ee(r.initialState),i=_u([o,t],a=>a);return Qr(r,function(s){const u=i.subscribe(c=>{let[f,d]=c;r.setOptions(g=>({...g,...d,state:{...f,...d.state},onStateChange:p=>{p instanceof Function?o.update(p):o.set(p),n.onStateChange==null||n.onStateChange(p)}})),s(r)});return function(){u()}})}/** + * match-sorter-utils + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */const Na={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},Xp=Object.keys(Na).join("|"),Yp=new RegExp(Xp,"g");function Qp(e){return e.replace(Yp,t=>Na[t])}/** + * @name match-sorter + * @license MIT license. + * @copyright (c) 2099 Kent C. Dodds + * @author Kent C. Dodds (https://kentcdodds.com) + */const Oe={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Kp(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Oe.MATCHES,!n.accessors){const l=jl(e,t,n);return{rankedValue:e,rank:l,accessorIndex:-1,accessorThreshold:n.threshold,passed:l>=n.threshold}}const o=tm(e,n.accessors),i={rankedValue:e,rank:Oe.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let l=0;l=Oe.MATCHES?s=u:s>c&&(s=c),s=Math.min(s,c),s>=f&&s>i.rank&&(i.rank=s,i.passed=!0,i.accessorIndex=l,i.accessorThreshold=f,i.rankedValue=a.itemValue)}return i}function jl(e,t,n){return e=Ul(e,n),t=Ul(t,n),t.length>e.length?Oe.NO_MATCH:e===t?Oe.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Oe.EQUAL:e.startsWith(t)?Oe.STARTS_WITH:e.includes(` ${t}`)?Oe.WORD_STARTS_WITH:e.includes(t)?Oe.CONTAINS:t.length===1?Oe.NO_MATCH:Jp(e).includes(t)?Oe.ACRONYM:Zp(e,t))}function Jp(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(i=>{t+=i.substr(0,1)})}),t}function Zp(e,t){let n=0,r=0;function o(s,u,c){for(let f=c,d=u.length;f-1))return Oe.NO_MATCH}const a=r-l;return i(a)}function Ul(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=Qp(e)),e}function em(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function tm(e,t){const n=[];for(let r=0,o=t.length;r{K(p,1)}),me()}c?(n=bt(c,f()),te(n.$$.fragment),N(n.$$.fragment,1),Q(n,t,r)):n=null}},i(d){a||(n&&N(n.$$.fragment,d),a=!0)},o(d){n&&x(n.$$.fragment,d),a=!1},d(d){d&&P(t),n&&K(n),s=!1,u()}}}function Jl(e){let t,n,r=!e[26].isPlaceholder&&rm(e);return{c(){t=C("th"),r&&r.c(),h(t,"colspan",e[26].colSpan),h(t,"class","svelte-16fb3tv")},m(o,i){T(o,t,i),r&&r.m(t,null),n=!0},p(o,i){o[26].isPlaceholder||r.p(o,i)},i(o){n||(N(r),n=!0)},o(o){x(r),n=!1},d(o){o&&P(t),r&&r.d()}}}function Zl(e){let t,n,r,o=e[23].headers,i=[];for(let a=0;ax(i[a],1,1,()=>{i[a]=null});return{c(){t=C("tr");for(let a=0;a{K(u,1)}),me()}i?(r=bt(i,l()),te(r.$$.fragment),N(r.$$.fragment,1),Q(r,n,null)):r=null}},i(a){o||(r&&N(r.$$.fragment,a),o=!0)},o(a){r&&x(r.$$.fragment,a),o=!1},d(a){a&&P(n),r&&K(r)}}}function ts(e){let t,n=[],r=new Map,o,i,l=e[17].getVisibleCells();const a=s=>s[20].id;for(let s=0;s",ke,L,G,he,Z,oe=e[5],le=[];for(let X=0;Xx(le[X],1,1,()=>{le[X]=null});let yt=e[1].getRowModel().rows,ye=[];for(let X=0;Xx(ye[X],1,1,()=>{ye[X]=null});return{c(){t=C("div"),n=C("input"),r=F(),o=C("div"),i=C("table"),l=C("thead");for(let X=0;X(i(),i=mr(w,$=>n(1,o=$)),w);ie(e,gr,$=>n(8,r=$)),e.$$.on_destroy.push(()=>i());const a=($,M,S,k)=>{if(console.log("yessir"),Array.isArray(S))return S.length===0?!0:S.includes($.getValue(M));typeof S=="number"&&(S=String(S));const y=Kp($.getValue(M),S);return k({itemRank:y}),y.passed},s=Pp(),u=[s.accessor("file",{header:"File",cell:$=>$.getValue(),footer:$=>$.column.id}),s.accessor("size",{header:"Size",cell:$=>to($.getValue()),footer:$=>$.column.id}),s.accessor("type",{header:"Type",cell:$=>$.getValue(),footer:$=>$.column.id})];let c="",f=Ee({data:r,columns:u,getCoreRowModel:Ol(),getSortedRowModel:Hl(),getFilteredRowModel:Vl(),globalFilterFn:a,getFacetedRowModel:zl(),getPaginationRowModel:Ll(),state:{globalFilter:c,pagination:{pageSize:7,pageIndex:0}},enableGlobalFilter:!0});function d($){n(6,c=$),f.update(M=>({...M,state:{...M.state,globalFilter:$}}))}function g($){f.update(M=>{var S;return{...M,state:{...M.state,pagination:{...(S=M.state)==null?void 0:S.pagination,pageIndex:$}}}})}let p;function m($){clearTimeout(p),p=setTimeout(()=>{const M=$.target;d(M.value)},100)}function _($){const M=$.target;g(parseInt(M.value)-1)}let w=Bl(f);l();let b=o.getHeaderGroups();const R=()=>g(o.getState().pagination.pageIndex-1),A=()=>g(o.getState().pagination.pageIndex+1);return e.$$.update=()=>{e.$$.dirty&448&&(n(7,f={data:r,columns:u,getCoreRowModel:Ol(),getSortedRowModel:Hl(),getFilteredRowModel:Vl(),globalFilterFn:a,getFacetedRowModel:zl(),getPaginationRowModel:Ll(),state:{globalFilter:c,pagination:{pageSize:7,pageIndex:0}},enableGlobalFilter:!0}),l(n(0,w=Bl(Ee(f)))))},[w,o,g,m,_,b,c,f,r,R,A]}class sm extends ue{constructor(t){super(),de(this,t,lm,om,ae,{})}}function ns(e){let t,n;return{c(){t=C("p"),n=z(e[3])},m(r,o){T(r,t,o),v(t,n)},p(r,o){o&8&&ne(n,r[3])},d(r){r&&P(t)}}}function rs(e){let t;return{c(){t=C("p"),t.textContent="Data Successfully indexed!"},m(n,r){T(n,t,r)},d(n){n&&P(t)}}}function os(e){let t,n;return t=new sm({}),{c(){te(t.$$.fragment)},m(r,o){Q(t,r,o),n=!0},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){x(t.$$.fragment,r),n=!1},d(r){K(t,r)}}}function am(e){let t,n,r,o,i,l,a,s,u,c,f,d,g,p,m,_,w,b,R,A,$,M,S,k=e[2]&&!e[1]&&ns(e),y=e[1]&&rs();R=new ep({});let E=e[0]&&os();return{c(){t=C("div"),n=C("div"),r=C("div"),o=C("div"),i=C("h4"),i.textContent="Upload Data",l=F(),a=C("br"),s=F(),u=C("form"),c=C("input"),f=F(),k&&k.c(),d=F(),y&&y.c(),g=F(),p=C("p"),p.textContent="These are the files your model will use as context.",m=F(),_=C("p"),_.innerHTML="Currently pdf, txt, and md are supported.",w=F(),b=C("div"),te(R.$$.fragment),A=F(),E&&E.c(),h(c,"type","file"),c.multiple=!0,h(o,"class","upload-box svelte-1lu6hos"),h(r,"class","upload-container svelte-1lu6hos"),h(n,"class","file-container svelte-1lu6hos"),h(b,"class","charts-container svelte-1lu6hos"),h(t,"class","data-grid svelte-1lu6hos")},m(D,I){T(D,t,I),v(t,n),v(n,r),v(r,o),v(o,i),v(o,l),v(o,a),v(o,s),v(o,u),v(u,c),v(o,f),k&&k.m(o,null),v(o,d),y&&y.m(o,null),v(o,g),v(o,p),v(o,m),v(o,_),v(t,w),v(t,b),Q(R,b,null),v(b,A),E&&E.m(b,null),$=!0,M||(S=q(c,"change",e[4]),M=!0)},p(D,[I]){D[2]&&!D[1]?k?k.p(D,I):(k=ns(D),k.c(),k.m(o,d)):k&&(k.d(1),k=null),D[1]?y||(y=rs(),y.c(),y.m(o,g)):y&&(y.d(1),y=null),D[0]?E?I&1&&N(E,1):(E=os(),E.c(),N(E,1),E.m(b,null)):E&&(pe(),x(E,1,1,()=>{E=null}),me())},i(D){$||(N(R.$$.fragment,D),N(E),$=!0)},o(D){x(R.$$.fragment,D),x(E),$=!1},d(D){D&&P(t),k&&k.d(),y&&y.d(),K(R),E&&E.d(),M=!1,S()}}}function um(e,t,n){let r,o,i;ie(e,Fl,p=>n(6,o=p)),ie(e,gr,p=>n(7,i=p));let l=[],a=!1,s=!1;async function u(p){n(0,l=p.target.files);const m=new FormData;for(let _=0;_({file:w.name,size:w.size,type:w.type}));He(gr,i=[..._],i)}async function f(){console.log("index!"),n(2,s=!0),await(await fetch("/retrieval/vector_db/index",{method:"POST"})).json(),n(1,a=!0),n(2,s=!1)}async function d(){console.log("getting embeddings...");const m=await(await fetch("/retrieval/vector_db/get")).json();console.log("embeddingData",m),He(Fl,o=m,o)}dt(()=>{c()});let g=0;return setInterval(()=>{n(5,g=(g+1)%4)},200),e.$$.update=()=>{e.$$.dirty&32&&n(3,r="Indexing"+".".repeat(g))},[l,a,s,r,u,g]}class cm extends ue{constructor(t){super(),de(this,t,um,am,ae,{})}}function fm(e){let t,n,r,o,i,l,a,s,u,c,f,d,g,p,m,_,w,b,R,A,$,M,S,k,y,E,D;return i=new ea({}),s=new ta({}),f=new Ys({}),p=new Ks({props:{feedback:"Bad"}}),w=new Zs({}),A=new Js({}),E=new Qs({}),{c(){t=C("div"),n=C("div"),r=C("div"),o=C("div"),te(i.$$.fragment),l=F(),a=C("div"),te(s.$$.fragment),u=F(),c=C("div"),te(f.$$.fragment),d=F(),g=C("div"),te(p.$$.fragment),m=F(),_=C("div"),te(w.$$.fragment),b=F(),R=C("div"),te(A.$$.fragment),$=F(),M=C("div"),S=C("div"),S.innerHTML=`
+
`,k=F(),y=C("div"),te(E.$$.fragment),h(o,"class","card-1 svelte-14znspc"),h(a,"class","card-2"),h(r,"class","left-text svelte-14znspc"),h(c,"class","left-confidence svelte-14znspc"),h(g,"class","left-question svelte-14znspc"),h(_,"class","left-filter svelte-14znspc"),h(R,"class","left-filter2"),h(n,"class","feedback-left svelte-14znspc"),h(S,"class","right-chart svelte-14znspc"),h(y,"class","right-table svelte-14znspc"),h(M,"class","feedback-right svelte-14znspc"),h(t,"class","feedback-container svelte-14znspc")},m(I,V){T(I,t,V),v(t,n),v(n,r),v(r,o),Q(i,o,null),v(r,l),v(r,a),Q(s,a,null),v(n,u),v(n,c),Q(f,c,null),v(n,d),v(n,g),Q(p,g,null),v(n,m),v(n,_),Q(w,_,null),v(n,b),v(n,R),Q(A,R,null),v(t,$),v(t,M),v(M,S),v(M,k),v(M,y),Q(E,y,null),D=!0},p:H,i(I){D||(N(i.$$.fragment,I),N(s.$$.fragment,I),N(f.$$.fragment,I),N(p.$$.fragment,I),N(w.$$.fragment,I),N(A.$$.fragment,I),N(E.$$.fragment,I),D=!0)},o(I){x(i.$$.fragment,I),x(s.$$.fragment,I),x(f.$$.fragment,I),x(p.$$.fragment,I),x(w.$$.fragment,I),x(A.$$.fragment,I),x(E.$$.fragment,I),D=!1},d(I){I&&P(t),K(i),K(s),K(f),K(p),K(w),K(A),K(E)}}}function dm(e,t,n){let r;ie(e,_n,i=>n(0,r=i)),dt(()=>{console.log("FEEDBACK on mount"),o()});async function o(){const s=(await(await fetch("/chat/rag_table/retrieve")).json()).rows.map(u=>({id:u[0],question:u[1],answer:u[2],vote_status:u[4]}));He(_n,r=[...s],r)}return[]}class gm extends ue{constructor(t){super(),de(this,t,dm,fm,ae,{})}}function hm(e){let t,n;return t=new na({}),{c(){te(t.$$.fragment)},m(r,o){Q(t,r,o),n=!0},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){x(t.$$.fragment,r),n=!1},d(r){K(t,r)}}}function pm(e){let t,n;return t=new gm({}),{c(){te(t.$$.fragment)},m(r,o){Q(t,r,o),n=!0},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){x(t.$$.fragment,r),n=!1},d(r){K(t,r)}}}function mm(e){let t,n;return t=new na({}),{c(){te(t.$$.fragment)},m(r,o){Q(t,r,o),n=!0},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){x(t.$$.fragment,r),n=!1},d(r){K(t,r)}}}function _m(e){let t,n,r,o;const i=[mm,pm,hm],l=[];function a(s,u){return s[0]==="vote"?0:s[0]==="rag"?1:2}return t=a(e),n=l[t]=i[t](e),{c(){n.c(),r=Ie()},m(s,u){l[t].m(s,u),T(s,r,u),o=!0},p(s,[u]){let c=t;t=a(s),t!==c&&(pe(),x(l[c],1,1,()=>{l[c]=null}),me(),n=l[t],n||(n=l[t]=i[t](s),n.c()),N(n,1),n.m(r.parentNode,r))},i(s){o||(N(n),o=!0)},o(s){x(n),o=!1},d(s){l[t].d(s),s&&P(r)}}}function vm(e,t,n){let{feedback:r}=t;return e.$$set=o=>{"feedback"in o&&n(0,r=o.feedback)},[r]}class bm extends ue{constructor(t){super(),de(this,t,vm,_m,ae,{feedback:0})}}function is(e,t,n){const r=e.slice();return r[7]=t[n],r}function ls(e){let t,n=e[0],r=[];for(let o=0;o{K(c,1)}),me()}i?(t=bt(i,l()),te(t.$$.fragment),N(t.$$.fragment,1),Q(t,n.parentNode,n)):t=null}else i&&t.$set(u)},i(a){r||(t&&N(t.$$.fragment,a),r=!0)},o(a){t&&x(t.$$.fragment,a),r=!1},d(a){a&&P(n),t&&K(t,a)}}}function wm(e){let t,n,r,o=e[0].length>1&&ls(e),i=e[1]&&as(e);return{c(){o&&o.c(),t=F(),i&&i.c(),n=Ie()},m(l,a){o&&o.m(l,a),T(l,t,a),i&&i.m(l,a),T(l,n,a),r=!0},p(l,[a]){l[0].length>1?o?o.p(l,a):(o=ls(l),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null),l[1]?i?(i.p(l,a),a&2&&N(i,1)):(i=as(l),i.c(),N(i,1),i.m(n.parentNode,n)):i&&(pe(),x(i,1,1,()=>{i=null}),me())},i(l){r||(N(i),r=!0)},o(l){x(i),r=!1},d(l){o&&o.d(l),l&&P(t),i&&i.d(l),l&&P(n)}}}function ym(e,t,n){let r,o;const i=Ee([]);ie(e,i,c=>n(0,r=c));const l=Ee(null);ie(e,l,c=>n(1,o=c));const a={Chatbot:ed,Dropdown:rd,Feedback:bm,Compare:_h,RetrievalQA:cm},s=c=>{l.set(c)};return fetch("/components").then(c=>{if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return c.json()}).then(c=>{i.set(c),l.set(c[0])}).catch(c=>{console.log("Fetch request failed",c)}),[r,o,i,l,a,s,c=>s(c)]}class Sm extends ue{constructor(t){super(),de(this,t,ym,wm,ae,{})}}new Sm({target:document.getElementById("app")}); diff --git a/pykoi/frontend/dist/assets/index-e352a05f.js b/pykoi/frontend/dist/assets/index-e352a05f.js deleted file mode 100644 index de2f783..0000000 --- a/pykoi/frontend/dist/assets/index-e352a05f.js +++ /dev/null @@ -1,70 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function H(){}const ts=e=>e;function Bn(e,t){for(const n in t)e[n]=t[n];return e}function ns(e){return e()}function jr(){return Object.create(null)}function _e(e){e.forEach(ns)}function Ye(e){return typeof e=="function"}function re(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Ra(e){return Object.keys(e).length===0}function gr(e,...t){if(e==null)return H;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Aa(e){let t;return gr(e,n=>t=n)(),t}function ee(e,t,n){e.$$.on_destroy.push(gr(t,n))}function Ii(e){return e??""}function Oe(e,t,n){return e.set(n),t}function gn(e){return e&&Ye(e.destroy)?e.destroy:H}const rs=typeof window<"u";let is=rs?()=>window.performance.now():()=>Date.now(),hi=rs?e=>requestAnimationFrame(e):H;const Vt=new Set;function os(e){Vt.forEach(t=>{t.c(e)||(Vt.delete(t),t.f())}),Vt.size!==0&&hi(os)}function ls(e){let t;return Vt.size===0&&hi(os),{promise:new Promise(n=>{Vt.add(t={c:e,f:n})}),abort(){Vt.delete(t)}}}let hr=!1;function Ea(){hr=!0}function Ma(){hr=!1}function Fa(e,t,n,r){for(;e>1);n(i)<=r?e=i+1:t=i}return e}function Da(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const s=[];for(let u=0;u0&&t[n[i]].claim_order<=u?i+1:Fa(1,i,d=>t[n[d]].claim_order,u))-1;r[s]=n[c]+1;const f=c+1;n[f]=s,i=Math.max(f,i)}const o=[],l=[];let a=t.length-1;for(let s=n[i]+1;s!=0;s=r[s-1]){for(o.push(t[s-1]);a>=s;a--)l.push(t[a]);a--}for(;a>=0;a--)l.push(t[a]);o.reverse(),l.sort((s,u)=>s.claim_order-u.claim_order);for(let s=0,u=0;s=o[u].claim_order;)u++;const c=ue.removeEventListener(t,n,r)}function h(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Ta(e){return Array.from(e.childNodes)}function Oa(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function Va(e,t,n,r,i=!1){Oa(e);const o=(()=>{for(let l=e.claim_info.last_index;l=0;l--){const a=e[l];if(t(a)){const s=n(a);return s===void 0?e.splice(l,1):e[l]=s,i?s===void 0&&e.claim_info.last_index--:e.claim_info.last_index=l,a}}return r()})();return o.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,o}function za(e,t){return Va(e,n=>n.nodeType===3,n=>{const r=""+t;if(n.data.startsWith(r)){if(n.data.length!==r.length)return n.splitText(r.length)}else n.data=r},()=>z(t),!0)}function Q(e,t){t=""+t,e.data!==t&&(e.data=t)}function tt(e,t){e.value=t??""}function Re(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,r?"important":"")}function Un(e,t,n){for(let r=0;r{l.source===r.contentWindow&&t()})):(r.src="about:blank",r.onload=()=>{o=j(r.contentWindow,"resize",t),t()}),v(e,r),()=>{(i||o&&r.contentWindow)&&o(),x(r)}}function en(e,t,n){e.classList[n?"add":"remove"](t)}function La(e,t,{bubbles:n=!1,cancelable:r=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(e,n,r,t),i}function mt(e,t){return new e(t)}const Wn=new Map;let Xn=0;function qa(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function Ga(e,t){const n={stylesheet:Ia(t),rules:{}};return Wn.set(e,n),n}function Ni(e,t,n,r,i,o,l,a=0){const s=16.666/r;let u=`{ -`;for(let _=0;_<=1;_+=s){const b=t+(n-t)*o(_);u+=_*100+`%{${l(b,1-b)}} -`}const c=u+`100% {${l(n,1-n)}} -}`,f=`__svelte_${qa(c)}_${a}`,d=ss(e),{stylesheet:g,rules:p}=Wn.get(d)||Ga(d,e);p[f]||(p[f]=!0,g.insertRule(`@keyframes ${f} ${c}`,g.cssRules.length));const m=e.style.animation||"";return e.style.animation=`${m?`${m}, `:""}${f} ${r}ms linear ${i}ms 1 both`,Xn+=1,f}function ja(e,t){const n=(e.style.animation||"").split(", "),r=n.filter(t?o=>o.indexOf(t)<0:o=>o.indexOf("__svelte")===-1),i=n.length-r.length;i&&(e.style.animation=r.join(", "),Xn-=i,Xn||Ba())}function Ba(){hi(()=>{Xn||(Wn.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&x(t)}),Wn.clear())})}let Gt;function kt(e){Gt=e}function Ua(){if(!Gt)throw new Error("Function called outside component initialization");return Gt}function ut(e){Ua().$$.on_mount.push(e)}const Pt=[],hn=[];let zt=[];const Pi=[],Wa=Promise.resolve();let Br=!1;function Xa(){Br||(Br=!0,Wa.then(us))}function Se(e){zt.push(e)}const wr=new Set;let Ft=0;function us(){if(Ft!==0)return;const e=Gt;do{try{for(;Fte.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),zt=t}let Qt;function Ka(){return Qt||(Qt=Promise.resolve(),Qt.then(()=>{Qt=null})),Qt}function yr(e,t,n){e.dispatchEvent(La(`${t?"intro":"outro"}${n}`))}const Vn=new Set;let ot;function ue(){ot={r:0,c:[],p:ot}}function ce(){ot.r||_e(ot.c),ot=ot.p}function N(e,t){e&&e.i&&(Vn.delete(e),e.i(t))}function V(e,t,n,r){if(e&&e.o){if(Vn.has(e))return;Vn.add(e),ot.c.push(()=>{Vn.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}const Ja={duration:0};function Ke(e,t,n,r){const i={direction:"both"};let o=t(e,n,i),l=r?0:1,a=null,s=null,u=null;function c(){u&&ja(e,u)}function f(g,p){const m=g.b-l;return p*=Math.abs(m),{a:l,b:g.b,d:m,duration:p,start:g.start,end:g.start+p,group:g.group}}function d(g){const{delay:p=0,duration:m=300,easing:_=ts,tick:b=H,css:w}=o||Ja,C={start:is()+p,b:g};g||(C.group=ot,ot.r+=1),a||s?s=C:(w&&(c(),u=Ni(e,l,g,m,p,_,w)),g&&b(0,1),a=f(C,m),Se(()=>yr(e,g,"start")),ls(A=>{if(s&&A>s.start&&(a=f(s,m),s=null,yr(e,a.b,"start"),w&&(c(),u=Ni(e,l,a.b,a.duration,0,_,o.css))),a){if(A>=a.end)b(l=a.b,1-l),yr(e,a.b,"end"),s||(a.b?c():--a.group.r||_e(a.group.c)),a=null;else if(A>=a.start){const $=A-a.start;l=a.a+a.d*_($/a.duration),b(l,1-l)}}return!!(a||s)}))}return{run(g){Ye(o)?Ka().then(()=>{o=o(i),d(g)}):d(g)},end(){c(),a=s=null}}}function pr(e,t){e.d(1),t.delete(e.key)}function cs(e,t){V(e,1,1,()=>{t.delete(e.key)})}function Xt(e,t,n,r,i,o,l,a,s,u,c,f){let d=e.length,g=o.length,p=d;const m={};for(;p--;)m[e[p].key]=p;const _=[],b=new Map,w=new Map,C=[];for(p=g;p--;){const S=f(i,o,p),k=n(S);let y=l.get(k);y?r&&C.push(()=>y.p(S,t)):(y=u(k,S),y.c()),b.set(k,_[p]=y),k in m&&w.set(k,Math.abs(p-m[k]))}const A=new Set,$=new Set;function E(S){N(S,1),S.m(a,c),l.set(S.key,S),c=S.first,g--}for(;d&&g;){const S=_[g-1],k=e[d-1],y=S.key,M=k.key;S===k?(c=S.first,d--,g--):b.has(M)?!l.has(y)||A.has(y)?E(S):$.has(M)?d--:w.get(y)>w.get(M)?($.add(y),E(S)):(A.add(M),d--):(s(k,l),d--)}for(;d--;){const S=e[d];b.has(S.key)||s(S,l)}for(;g;)E(_[g-1]);return _e(C),_}function fs(e,t){const n={},r={},i={$$scope:1};let o=e.length;for(;o--;){const l=e[o],a=t[o];if(a){for(const s in l)s in a||(r[s]=1);for(const s in a)i[s]||(n[s]=a[s],i[s]=1);e[o]=a}else for(const s in l)i[s]=1}for(const l in r)l in n||(n[l]=void 0);return n}function ds(e){return typeof e=="object"&&e!==null?e:{}}const Za=/[&"]/g,eu=/[&<]/g;function tu(e,t=!1){const n=String(e),r=t?Za:eu;r.lastIndex=0;let i="",o=0;for(;r.test(n);){const l=r.lastIndex-1,a=n[l];i+=n.substring(o,l)+(a==="&"?"&":a==='"'?""":"<"),o=l+1}return i+n.substring(o)}function nu(e,t){if(!e||!e.$$render)throw t==="svelte:component"&&(t+=" this={...}"),new Error(`<${t}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${t}>.`);return e}let Sr;function gs(e){function t(n,r,i,o,l){const a=Gt,s={on_destroy:Sr,context:new Map(l||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:jr()};kt({$$:s});const u=e(n,r,i,o);return kt(a),u}return{render:(n={},{$$slots:r={},context:i=new Map}={})=>{Sr=[];const o={title:"",head:"",css:new Set},l=t(o,n,{},r,i);return _e(Sr),{html:l,css:{code:Array.from(o.css).map(a=>a.code).join(` -`),map:null},head:o.title+o.head}},$$render:t}}function Z(e){e&&e.c()}function ru(e,t){e&&e.l(t)}function K(e,t,n,r){const{fragment:i,after_update:o}=e.$$;i&&i.m(t,n),r||Se(()=>{const l=e.$$.on_mount.map(ns).filter(Ye);e.$$.on_destroy?e.$$.on_destroy.push(...l):_e(l),e.$$.on_mount=[]}),o.forEach(Se)}function J(e,t){const n=e.$$;n.fragment!==null&&(Qa(n.after_update),_e(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function iu(e,t){e.$$.dirty[0]===-1&&(Pt.push(e),Xa(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const p=g.length?g[0]:d;return u.ctx&&i(u.ctx[f],u.ctx[f]=p)&&(!u.skip_bound&&u.bound[f]&&u.bound[f](p),c&&iu(e,f)),d}):[],u.update(),c=!0,_e(u.before_update),u.fragment=r?r(u.ctx):!1,t.target){if(t.hydrate){Ea();const f=Ta(t.target);u.fragment&&u.fragment.l(f),f.forEach(x)}else u.fragment&&u.fragment.c();t.intro&&N(e.$$.fragment),K(e,t.target,t.anchor,t.customElement),Ma(),us()}kt(s)}class ie{$destroy(){J(this,1),this.$destroy=H}$on(t,n){if(!Ye(n))return H;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!Ra(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Dt=[];function Ur(e,t){return{subscribe:ke(e,t).subscribe}}function ke(e,t=H){let n;const r=new Set;function i(a){if(re(e,a)&&(e=a,n)){const s=!Dt.length;for(const u of r)u[1](),Dt.push(u,e);if(s){for(let u=0;u{r.delete(u),r.size===0&&n&&(n(),n=null)}}return{set:i,update:o,subscribe:l}}function ou(e,t,n){const r=!Array.isArray(e),i=r?[e]:e,o=t.length<2;return Ur(n,l=>{let a=!1;const s=[];let u=0,c=H;const f=()=>{if(u)return;c();const g=t(r?s[0]:s,l);o?l(g):c=Ye(g)?g:H},d=i.map((g,p)=>gr(g,m=>{s[p]=m,u&=~(1<{u|=1<e;const n=typeof e;if(n!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const r=t.map((i,o)=>Wr(e[o],i));return i=>r.map(o=>o(i))}if(n==="object"){if(!e||!t)throw new Error("Object cannot be null");if(xi(e)&&xi(t)){e=e.getTime(),t=t.getTime();const o=t-e;return l=>new Date(e+l*o)}const r=Object.keys(t),i={};return r.forEach(o=>{i[o]=Wr(e[o],t[o])}),o=>{const l={};return r.forEach(a=>{l[a]=i[a](o)}),l}}if(n==="number"){const r=t-e;return i=>e+i*r}throw new Error(`Cannot interpolate ${n} values`)}function mi(e,t={}){const n=ke(e);let r,i=e;function o(l,a){if(e==null)return n.set(e=l),Promise.resolve();i=l;let s=r,u=!1,{delay:c=0,duration:f=400,easing:d=ts,interpolate:g=Wr}=Bn(Bn({},t),a);if(f===0)return s&&(s.abort(),s=null),n.set(e=i),Promise.resolve();const p=is()+c;let m;return r=ls(_=>{if(_f?(n.set(e=l),!1):(n.set(e=m(d(b/f))),!0)}),r.promise}return{set:o,update:(l,a)=>o(l(i,e),a),subscribe:n.subscribe}}const xe=ke([]),Cr=ke([]),kr=ke([]),pn=ke([]),nt=ke("all"),Ti=ke({"n/a":1,up:1,down:1}),lu=["who","what","how","why","where","does","can","n/a"],Xr=mi(lu.map(e=>({question:e,count:0}))),Yr=ke(new Set);var Qr="http://www.w3.org/1999/xhtml";const Oi={svg:"http://www.w3.org/2000/svg",xhtml:Qr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function hs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Oi.hasOwnProperty(t)?{space:Oi[t],local:e}:e}function su(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Qr&&t.documentElement.namespaceURI===Qr?t.createElement(e):t.createElementNS(n,e)}}function au(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ps(e){var t=hs(e);return(t.local?au:su)(t)}function uu(){}function ms(e){return e==null?uu:function(){return this.querySelector(e)}}function cu(e){typeof e!="function"&&(e=ms(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=C&&(C=w+1);!($=_[C])&&++C=0;)(l=r[i])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function Tu(e){e||(e=Ou);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,i=new Array(r),o=0;ot?1:e>=t?0:NaN}function Vu(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zu(){return Array.from(this)}function Hu(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Ku:typeof t=="function"?Zu:Ju)(e,t,n??"")):tc(this.node(),e)}function tc(e,t){return e.style.getPropertyValue(t)||ws(e).getComputedStyle(e,null).getPropertyValue(t)}function nc(e){return function(){delete this[e]}}function rc(e,t){return function(){this[e]=t}}function ic(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function oc(e,t){return arguments.length>1?this.each((t==null?nc:typeof t=="function"?ic:rc)(e,t)):this.node()[e]}function ys(e){return e.trim().split(/^|\s+/)}function _i(e){return e.classList||new Ss(e)}function Ss(e){this._node=e,this._names=ys(e.getAttribute("class")||"")}Ss.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Cs(e,t){for(var n=_i(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Nc(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n`${b[0].toUpperCase()}${b.slice(1)}`),f=parseFloat(o[`padding${c[0]}`]),d=parseFloat(o[`padding${c[1]}`]),g=parseFloat(o[`margin${c[0]}`]),p=parseFloat(o[`margin${c[1]}`]),m=parseFloat(o[`border${c[0]}Width`]),_=parseFloat(o[`border${c[1]}Width`]);return{delay:t,duration:n,easing:r,css:b=>`overflow: hidden;opacity: ${Math.min(b*20,1)*l};${a}: ${b*s}px;padding-${u[0]}: ${b*f}px;padding-${u[1]}: ${b*d}px;margin-${u[0]}: ${b*g}px;margin-${u[1]}: ${b*p}px;border-${u[0]}-width: ${b*m}px;border-${u[1]}-width: ${b*_}px;`}}function Rn(e,{delay:t=0,duration:n=400,easing:r=pi,start:i=0,opacity:o=0}={}){const l=getComputedStyle(e),a=+l.opacity,s=l.transform==="none"?"":l.transform,u=1-i,c=a*(1-o);return{delay:t,duration:n,easing:r,css:(f,d)=>` - transform: ${s} scale(${1-u*d}); - opacity: ${a-c*d} - `}}function Kr(e,t=2){if(e===0)return"0 Bytes";const n=1024,r=t<0?0:t,i=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,o)).toFixed(r))+" "+i[o]}function Lc(e){let t={who:0,what:0,how:0,why:0,where:0,does:0,can:0,"n/a":0};for(let r=0;r({question:r,count:t[r]}))}function As(e){return e.map(t=>{const n=t.question.split(" ").length,r=t.answer.split(" ").length;return{index:t.index,question:+n,answer:+r,vote:t.vote}})}function qc(e,t){e.classList.add("tooltip"),e.setAttribute("tabindex",0);function n(){const i=document.createElement("span");i.textContent=t,i.setAttribute("id","tooltip"),e.appendChild(i),e.addEventListener("mouseleave",r),e.addEventListener("blur",r),e.removeEventListener("mouseenter",n),e.removeEventListener("focus",n)}function r(){e.removeChild(e.querySelector("#tooltip")),e.removeEventListener("mouseleave",r),e.removeEventListener("blur",r),e.addEventListener("mouseenter",n),e.addEventListener("focus",n)}return e.addEventListener("mouseenter",n),e.addEventListener("focus",n),{onDestroy(){e.classList.remove("tooltip"),e.removeEventListener("mouseenter",n),e.removeEventListener("focus",n)}}}function Vi(e,t,n){const r=e.slice();return r[16]=t[n],r[18]=n,r}function zi(e){let t,n,r,i,o,l;function a(...u){return e[9](e[18],...u)}function s(...u){return e[10](e[18],...u)}return{c(){t=R("div"),n=R("button"),n.textContent="👍",r=D(),i=R("button"),i.textContent="👎",h(n,"class","small-button thumbs-up svelte-19cad35"),h(i,"class","small-button thumbs-down svelte-19cad35"),h(t,"class","feedback-buttons svelte-19cad35")},m(u,c){T(u,t,c),v(t,n),v(t,r),v(t,i),o||(l=[j(n,"click",a),j(i,"click",s)],o=!0)},p(u,c){e=u},d(u){u&&x(t),o=!1,_e(l)}}}function Hi(e,t){let n,r,i,o,l,a,s,u,c,f=t[16].question+"",d,g,p,m,_,b,w,C=t[16].answer+"",A,$,E,S,k,y,M=t[0]&&zi(t);return{key:e,first:null,c(){n=R("div"),r=R("div"),i=R("div"),o=D(),l=R("div"),a=R("div"),s=R("h5"),s.textContent="Question:",u=D(),c=R("p"),d=z(f),g=D(),p=R("div"),m=R("div"),_=R("h5"),_.textContent="Response:",b=D(),w=R("p"),A=z(C),$=D(),M&&M.c(),E=D(),h(i,"class","avatar"),h(s,"class","bold svelte-19cad35"),h(a,"class","question svelte-19cad35"),h(_,"class","bold svelte-19cad35"),h(m,"class","answer svelte-19cad35"),h(p,"class","answers svelte-19cad35"),h(l,"class","message-content svelte-19cad35"),h(r,"class","chat-message-center svelte-19cad35"),h(n,"class","chat-message svelte-19cad35"),this.first=n},m(I,F){T(I,n,F),v(n,r),v(r,i),v(r,o),v(r,l),v(l,a),v(a,s),v(a,u),v(a,c),v(c,d),v(l,g),v(l,p),v(p,m),v(m,_),v(m,b),v(m,w),v(w,A),v(m,$),M&&M.m(m,null),v(n,E),k||(y=gn(S=jc.call(null,n,t[18]===t[4].length-1)),k=!0)},p(I,F){t=I,F&16&&f!==(f=t[16].question+"")&&Q(d,f),F&16&&C!==(C=t[16].answer+"")&&Q(A,C),t[0]?M?M.p(t,F):(M=zi(t),M.c(),M.m(m,null)):M&&(M.d(1),M=null),S&&Ye(S.update)&&F&16&&S.update.call(null,t[18]===t[4].length-1)},d(I){I&&x(n),M&&M.d(),k=!1,y()}}}function Gc(e){let t,n,r,i,o,l,a=[],s=new Map,u,c,f,d,g,p,m=(e[2]?e[3]:"Send")+"",_,b,w,C,A,$,E=e[4];const S=k=>k[18];for(let k=0;kVote Feedback Instructions -

Ask a question to receive an answer from the chatbot. If the response is - satisfactory, click on the 👍 - button. If the repsonse is not satisfactory, click on the - 👎 button.

`,r=D(),i=R("div"),o=R("section"),l=R("div");for(let k=0;k{e.scrollIntoView({behavior:"smooth"})},0)}async function Bc(e){const t=await fetch("/chat/qa_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function Uc(e,t,n){let r,i;ee(e,xe,b=>n(4,i=b));let{feedback:o=!1}=t,{is_retrieval:l=!1}=t,a="",s="",u=!1;ut(()=>{c()});async function c(){const A=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map($=>({id:$[0],question:$[1],answer:$[2],vote_status:$[3]}));Oe(xe,i=[...A],i)}const f=async b=>{b.preventDefault(),a=s,n(1,s=""),n(2,u=!0);let w={id:i.length+1,question:a,answer:"Loading...",vote_status:"na"};Oe(xe,i=[...i,w],i);const C=l?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:a})}):await fetch(`/chat/${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:a})});if(C.ok){const A=await C.json();console.log("response data",A),w.answer=A.answer,xe.update($=>($[$.length-1]=w,$))}else{const A=await C.text();alert(A)}n(2,u=!1)};let d=0;setInterval(()=>{n(8,d=(d+1)%4)},200);function g(b,w,C){const A=i[C];A.vote=w;const $={id:C+1,vote_status:w};Bc($),st(b.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),st(b.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}[...Array(10).keys()].map(b=>String.fromCharCode(65+b));const p=(b,w)=>g(w,"up",b),m=(b,w)=>g(w,"down",b);function _(){s=this.value,n(1,s)}return e.$$set=b=>{"feedback"in b&&n(0,o=b.feedback),"is_retrieval"in b&&n(7,l=b.is_retrieval)},e.$$.update=()=>{e.$$.dirty&256&&n(3,r=".".repeat(d).padEnd(3))},[o,s,u,r,i,f,g,l,d,p,m,_]}class vi extends ie{constructor(t){super(),se(this,t,Uc,Gc,re,{feedback:0,is_retrieval:7})}}function Li(e,t,n){const r=e.slice();return r[14]=t[n],r[16]=n,r}function qi(e,t){let n,r,i,o,l,a,s,u,c,f=t[14].question+"",d,g,p,m,_,b,w,C=t[14].up_ranking_answer+"",A,$,E,S,k,y,M=t[14].low_ranking_answer+"",I,F,P,B,ge;function oe(...ae){return t[7](t[14],t[16],...ae)}function Ee(...ae){return t[8](t[14],t[16],...ae)}function Me(...ae){return t[9](t[14],t[16],...ae)}function ye(...ae){return t[10](t[14],t[16],...ae)}return{key:e,first:null,c(){n=R("div"),r=R("div"),i=R("div"),o=D(),l=R("div"),a=R("div"),s=R("h5"),s.textContent="Question:",u=D(),c=R("p"),d=z(f),g=D(),p=R("div"),m=R("div"),_=R("h5"),_.textContent="Response 1:",b=D(),w=R("p"),A=z(C),$=D(),E=R("div"),S=R("h5"),S.textContent="Response 2:",k=D(),y=R("p"),I=z(M),F=D(),h(i,"class","avatar"),h(s,"class","bold svelte-au920n"),h(a,"class","question svelte-au920n"),h(_,"class","bold underline svelte-au920n"),h(m,"class","answer svelte-au920n"),h(S,"class","bold underline svelte-au920n"),h(E,"class","answer svelte-au920n"),h(p,"class","answers svelte-au920n"),h(l,"class","message-content svelte-au920n"),h(r,"class","chat-message-center svelte-au920n"),h(n,"class","chat-message svelte-au920n"),this.first=n},m(ae,ze){T(ae,n,ze),v(n,r),v(r,i),v(r,o),v(r,l),v(l,a),v(a,s),v(a,u),v(a,c),v(c,d),v(l,g),v(l,p),v(p,m),v(m,_),v(m,b),v(m,w),v(w,A),v(p,$),v(p,E),v(E,S),v(E,k),v(E,y),v(y,I),v(n,F),B||(ge=[j(m,"click",oe),j(m,"keydown",Ee),j(E,"click",Me),j(E,"keydown",ye),gn(P=Xc.call(null,n,t[16]===t[3].length-1))],B=!0)},p(ae,ze){t=ae,ze&8&&f!==(f=t[14].question+"")&&Q(d,f),ze&8&&C!==(C=t[14].up_ranking_answer+"")&&Q(A,C),ze&8&&M!==(M=t[14].low_ranking_answer+"")&&Q(I,M),P&&Ye(P.update)&&ze&8&&P.update.call(null,t[16]===t[3].length-1)},d(ae){ae&&x(n),B=!1,_e(ge)}}}function Wc(e){let t,n,r,i,o,l,a=[],s=new Map,u,c,f,d,g,p,m=(e[1]?e[2]:"Send")+"",_,b,w,C,A,$,E=e[3];const S=k=>k[16];for(let k=0;kRanked Feedback Instructions -

Ask a question and click on the better of the two responses. The better - response will be outlined in green, the worse - response outlined in red. This data will be - automatically fed to RLHF.

- `,r=D(),i=R("div"),o=R("section"),l=R("div");for(let k=0;k{e.scrollIntoView({behavior:"smooth"})},0)}async function Yc(e){const t=await fetch("/chat/ranking_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function Qc(e,t,n){let r,i;ee(e,Cr,_=>n(3,i=_));let o="",l="",a=!1;ut(()=>{});const s=async _=>{_.preventDefault(),o=l,n(0,l=""),n(1,a=!0);let b={question:o,up_ranking_answer:"Loading...",low_ranking_answer:"Loading..."};Oe(Cr,i=[...i,b],i);const w=await fetch(`/chat/multi_responses/${o}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:o})});if(w.ok){const C=await w.json();b.up_ranking_answer=C.answer[0],b.low_ranking_answer=C.answer[1],Cr.update(A=>(A[A.length-1]=b,A))}else{const C=await w.text();alert(C)}n(1,a=!1)};let u=0;setInterval(()=>{n(6,u=(u+1)%4)},200);function c(_,b,w,C){const A=i[w],$={1:"up_ranking_answer",2:"low_ranking_answer"},E={question:A.question,up_ranking_answer:A[$[C]],low_ranking_answer:A[$[C%2+1]]};Yc(E),st(_.currentTarget.parentNode).selectAll("div").style("outline","2px solid var(--red)").style("border","1px solid var(--red)"),st(_.currentTarget).style("outline","2px solid var(--green)").style("border","1px solid var(--green)")}const f=(_,b,w)=>c(w,_,b,1),d=(_,b,w)=>c(w,_,b,1),g=(_,b,w)=>c(w,_,b,2),p=(_,b,w)=>c(w,_,b,2);function m(){l=this.value,n(0,l)}return e.$$.update=()=>{e.$$.dirty&64&&n(2,r=".".repeat(u).padEnd(3))},[l,a,r,i,s,c,u,f,d,g,p,m]}class Kc extends ie{constructor(t){super(),se(this,t,Qc,Wc,re,{})}}function Gi(e,t,n){const r=e.slice();return r[8]=t[n],r[10]=n,r}function ji(e){let t,n,r,i,o=e[8].name+"",l,a,s,u,c;function f(...d){return e[6](e[8],...d)}return{c(){t=R("label"),n=R("input"),l=z(o),a=D(),h(n,"type","checkbox"),h(n,"id",r=e[8].id),n.checked=i=e[1].has(e[8].name),h(t,"for",s=e[8].id)},m(d,g){T(d,t,g),v(t,n),v(t,l),v(t,a),u||(c=j(n,"change",f),u=!0)},p(d,g){e=d,g&1&&r!==(r=e[8].id)&&h(n,"id",r),g&3&&i!==(i=e[1].has(e[8].name))&&(n.checked=i),g&1&&o!==(o=e[8].name+"")&&Q(l,o),g&1&&s!==(s=e[8].id)&&h(t,"for",s)},d(d){d&&x(t),u=!1,c()}}}function Jc(e){let t,n,r,i,o,l,a,s,u,c,f,d=e[0],g=[];for(let p=0;pn(1,r=f));let{documents:i=[]}=t,o=!1,l;function a(){n(2,o=!o)}function s(f,d){d.target.checked?r.add(f):r.delete(f),Yr.set(new Set(r))}const u=(f,d)=>s(f.name,d);function c(f){hn[f?"unshift":"push"](()=>{l=f,n(3,l)})}return e.$$set=f=>{"documents"in f&&n(0,i=f.documents)},e.$$.update=()=>{e.$$.dirty&2&&console.log(r)},[i,r,o,l,a,s,u,c]}let ef=class extends ie{constructor(t){super(),se(this,t,Zc,Jc,re,{documents:0})}};function tf(e){let t;return{c(){t=R("p"),t.textContent="⌄",h(t,"class","svelte-1pk2e1k")},m(n,r){T(n,t,r)},d(n){n&&x(t)}}}function nf(e){let t;return{c(){t=R("p"),t.textContent="⌃",h(t,"class","svelte-1pk2e1k")},m(n,r){T(n,t,r)},d(n){n&&x(t)}}}function Bi(e){let t,n,r,i,o;return{c(){t=R("div"),n=R("p"),r=z(e[1]),h(n,"class","bold svelte-1pk2e1k"),h(t,"class","source_content svelte-1pk2e1k")},m(l,a){T(l,t,a),v(t,n),v(n,r),o=!0},p(l,a){(!o||a&2)&&Q(r,l[1])},i(l){o||(Se(()=>{o&&(i||(i=Ke(t,mn,{},!0)),i.run(1))}),o=!0)},o(l){i||(i=Ke(t,mn,{},!1)),i.run(0),o=!1},d(l){l&&x(t),l&&i&&i.end()}}}function rf(e){let t,n,r,i=e[2]+1+"",o,l,a,s,u,c,f,d,g;function p(w,C){return w[3]?nf:tf}let m=p(e),_=m(e),b=e[3]&&Bi(e);return{c(){t=R("div"),n=R("div"),r=R("p"),o=z(i),l=z(": "),a=z(e[0]),s=D(),_.c(),c=D(),b&&b.c(),h(r,"class","bold svelte-1pk2e1k"),h(n,"class","source_tab svelte-1pk2e1k"),h(t,"class","source svelte-1pk2e1k")},m(w,C){T(w,t,C),v(t,n),v(n,r),v(r,o),v(r,l),v(r,a),v(n,s),_.m(n,null),v(t,c),b&&b.m(t,null),f=!0,d||(g=j(n,"click",e[4]),d=!0)},p(w,[C]){(!f||C&4)&&i!==(i=w[2]+1+"")&&Q(o,i),(!f||C&1)&&Q(a,w[0]),m!==(m=p(w))&&(_.d(1),_=m(w),_&&(_.c(),_.m(n,null))),w[3]?b?(b.p(w,C),C&8&&N(b,1)):(b=Bi(w),b.c(),N(b,1),b.m(t,null)):b&&(ue(),V(b,1,1,()=>{b=null}),ce())},i(w){f||(Se(()=>{f&&(u||(u=Ke(n,mn,{},!0)),u.run(1))}),N(b),f=!0)},o(w){u||(u=Ke(n,mn,{},!1)),u.run(0),V(b),f=!1},d(w){w&&x(t),_.d(),w&&u&&u.end(),b&&b.d(),d=!1,g()}}}function of(e,t,n){let{source:r=""}=t,{source_content:i=""}=t,{i:o=0}=t,l=o===0;const a=()=>n(3,l=!l);return e.$$set=s=>{"source"in s&&n(0,r=s.source),"source_content"in s&&n(1,i=s.source_content),"i"in s&&n(2,o=s.i)},[r,i,o,l,a]}class lf extends ie{constructor(t){super(),se(this,t,of,rf,re,{source:0,source_content:1,i:2})}}function Ui(e,t,n){const r=e.slice();return r[4]=t[n],r[6]=n,r}function Wi(e){let t,n,r,i;const o=[cf,uf,af,sf],l=[];function a(s,u){return s[0][0]==="N/A"?0:s[0][0]==="Loading..."?1:s[0][0]==="Not loaded"?2:3}return t=a(e),n=l[t]=o[t](e),{c(){n.c(),r=Ae()},m(s,u){l[t].m(s,u),T(s,r,u),i=!0},p(s,u){let c=t;t=a(s),t===c?l[t].p(s,u):(ue(),V(l[c],1,1,()=>{l[c]=null}),ce(),n=l[t],n?n.p(s,u):(n=l[t]=o[t](s),n.c()),N(n,1),n.m(r.parentNode,r))},i(s){i||(N(n),i=!0)},o(s){V(n),i=!1},d(s){l[t].d(s),s&&x(r)}}}function sf(e){let t,n,r,i=e[0].length+"",o,l,a,s,u,c,f,d;function g(b,w){return b[2]?df:ff}let p=g(e),m=p(e),_=e[2]&&Xi(e);return{c(){t=R("div"),n=R("h5"),r=z("📖 Response Sources ("),o=z(i),l=z(")"),a=D(),m.c(),s=D(),_&&_.c(),u=Ae(),h(n,"class","bold"),h(t,"class","sources-header svelte-1r759df")},m(b,w){T(b,t,w),v(t,n),v(n,r),v(n,o),v(n,l),v(t,a),m.m(t,null),T(b,s,w),_&&_.m(b,w),T(b,u,w),c=!0,f||(d=j(t,"click",e[3]),f=!0)},p(b,w){(!c||w&1)&&i!==(i=b[0].length+"")&&Q(o,i),p!==(p=g(b))&&(m.d(1),m=p(b),m&&(m.c(),m.m(t,null))),b[2]?_?(_.p(b,w),w&4&&N(_,1)):(_=Xi(b),_.c(),N(_,1),_.m(u.parentNode,u)):_&&(ue(),V(_,1,1,()=>{_=null}),ce())},i(b){c||(N(_),c=!0)},o(b){V(_),c=!1},d(b){b&&x(t),m.d(),b&&x(s),_&&_.d(b),b&&x(u),f=!1,d()}}}function af(e){let t;return{c(){t=R("h5"),t.textContent="⚠️ No sources loaded",h(t,"class","bold")},m(n,r){T(n,t,r)},p:H,i:H,o:H,d(n){n&&x(t)}}}function uf(e){let t;return{c(){t=R("h5"),t.textContent="📖 Loading...",h(t,"class","bold")},m(n,r){T(n,t,r)},p:H,i:H,o:H,d(n){n&&x(t)}}}function cf(e){let t;return{c(){t=R("h5"),t.textContent="⚠️ No Retrieval Sources selected",h(t,"class","bold")},m(n,r){T(n,t,r)},p:H,i:H,o:H,d(n){n&&x(t)}}}function ff(e){let t;return{c(){t=R("span"),t.textContent="⌄"},m(n,r){T(n,t,r)},d(n){n&&x(t)}}}function df(e){let t;return{c(){t=R("span"),t.textContent="⌃"},m(n,r){T(n,t,r)},d(n){n&&x(t)}}}function Xi(e){let t,n,r=e[0],i=[];for(let l=0;lV(i[l],1,1,()=>{i[l]=null});return{c(){for(let l=0;l{r=null}),ce())},i(i){n||(N(r),n=!0)},o(i){V(r),n=!1},d(i){i&&x(t),r&&r.d()}}}function hf(e,t,n){let{sources:r=[]}=t,{source_content:i=[]}=t,o=!1;const l=()=>n(2,o=!o);return e.$$set=a=>{"sources"in a&&n(0,r=a.sources),"source_content"in a&&n(1,i=a.source_content)},[r,i,o,l]}class pf extends ie{constructor(t){super(),se(this,t,hf,gf,re,{sources:0,source_content:1})}}function Qi(e,t,n){const r=e.slice();return r[4]=t[n],r}function Ki(e,t,n){const r=e.slice();return r[4]=t[n],r}function Ji(e){let t,n,r,i=e[4].label+"",o,l,a,s,u;return{c(){t=R("li"),n=R("span"),r=R("h5"),o=z(i),l=D(),h(r,"class","bold"),h(n,"class","svelte-iwm583"),h(t,"class",a=Ii(e[0]===e[4].value?"active":"")+" svelte-iwm583")},m(c,f){T(c,t,f),v(t,n),v(n,r),v(r,o),v(t,l),s||(u=j(n,"click",function(){Ye(e[3](e[4].value))&&e[3](e[4].value).apply(this,arguments)}),s=!0)},p(c,f){e=c,f&2&&i!==(i=e[4].label+"")&&Q(o,i),f&3&&a!==(a=Ii(e[0]===e[4].value?"active":"")+" svelte-iwm583")&&h(t,"class",a)},d(c){c&&x(t),s=!1,u()}}}function Zi(e){let t,n,r,i;const o=[e[2]];var l=e[4].component;function a(s){let u={};for(let c=0;c{J(f,1)}),ce()}l?(n=mt(l,a()),Z(n.$$.fragment),N(n.$$.fragment,1),K(n,t,r)):n=null}else l&&n.$set(c)},i(s){i||(n&&N(n.$$.fragment,s),i=!0)},o(s){n&&V(n.$$.fragment,s),i=!1},d(s){s&&x(t),n&&J(n)}}}function eo(e){let t,n,r=e[0]==e[4].value&&Zi(e);return{c(){r&&r.c(),t=Ae()},m(i,o){r&&r.m(i,o),T(i,t,o),n=!0},p(i,o){i[0]==i[4].value?r?(r.p(i,o),o&3&&N(r,1)):(r=Zi(i),r.c(),N(r,1),r.m(t.parentNode,t)):r&&(ue(),V(r,1,1,()=>{r=null}),ce())},i(i){n||(N(r),n=!0)},o(i){V(r),n=!1},d(i){r&&r.d(i),i&&x(t)}}}function mf(e){let t,n,r,i,o=e[1],l=[];for(let c=0;cV(s[c],1,1,()=>{s[c]=null});return{c(){t=R("ul");for(let c=0;c()=>n(0,i=a);return e.$$set=a=>{"items"in a&&n(1,r=a.items),"activeTabValue"in a&&n(0,i=a.activeTabValue),"tabProps"in a&&n(2,o=a.tabProps)},[i,r,o,l]}class vf extends ie{constructor(t){super(),se(this,t,_f,mf,re,{items:1,activeTabValue:0,tabProps:2})}}function to(e){let t;return{c(){t=z("Press ENTER to autofill with the RAG answer.")},m(n,r){T(n,t,r)},d(n){n&&x(t)}}}function bf(e){let t,n,r,i,o,l,a,s,u,c,f,d,g,p=e[0].edited_answer===Qn&&to();return{c(){t=R("form"),n=R("textarea"),i=D(),o=R("div"),l=R("div"),p&&p.c(),a=D(),s=R("div"),u=R("button"),u.textContent="Update",c=D(),f=R("button"),f.textContent="Reset",h(n,"placeholder",r=e[0].answer),h(l,"class","note svelte-i9wciy"),h(o,"class","button-container svelte-i9wciy")},m(m,_){T(m,t,_),v(t,n),tt(n,e[0].edited_answer),e[6](n),v(t,i),v(t,o),v(o,l),p&&p.m(l,null),v(o,a),v(o,s),v(s,u),v(s,c),v(s,f),d||(g=[j(n,"input",e[5]),j(n,"keydown",e[4]),j(u,"click",e[2]),j(f,"click",e[3])],d=!0)},p(m,[_]){_&1&&r!==(r=m[0].answer)&&h(n,"placeholder",r),_&1&&tt(n,m[0].edited_answer),m[0].edited_answer===Qn?p||(p=to(),p.c(),p.m(l,null)):p&&(p.d(1),p=null)},i:H,o:H,d(m){m&&x(t),e[6](null),p&&p.d(),d=!1,_e(g)}}}const Qn="";function wf(e,t,n){let{message:r={}}=t,i;const o=async f=>{const d={id:r.id,new_answer:f},g=await fetch("/chat/rag_table/update_answer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)});if(g.ok)console.log("Answer updated successfully",g),n(0,r.edited_answer=f,r);else{const p=await g.text();alert(p)}},l=f=>{f.preventDefault(),o(r.edited_answer)},a=f=>{f.preventDefault(),o(Qn)},s=f=>{f.key=="Enter"&&r.edited_answer===Qn&&(f.preventDefault(),console.log("ENTER"),n(0,r.edited_answer=r.answer,r))};ut(function(){i.focus()});function u(){r.edited_answer=this.value,n(0,r)}function c(f){hn[f?"unshift":"push"](()=>{i=f,n(1,i)})}return e.$$set=f=>{"message"in f&&n(0,r=f.message)},[r,i,l,a,s,u,c]}class yf extends ie{constructor(t){super(),se(this,t,wf,bf,re,{message:0})}}function no(e){let t,n,r,i,o,l;return{c(){t=R("div"),n=R("button"),n.textContent="👍",r=D(),i=R("button"),i.textContent="👎",h(n,"class","small-button thumbs-up svelte-1u8cd0w"),h(i,"class","small-button thumbs-down svelte-1u8cd0w"),h(t,"class","feedback-buttons svelte-1u8cd0w")},m(a,s){T(a,t,s),v(t,n),v(t,r),v(t,i),o||(l=[j(n,"click",e[4]),j(i,"click",e[5])],o=!0)},p:H,d(a){a&&x(t),o=!1,_e(l)}}}function Sf(e){let t,n=e[0].answer+"",r,i,o,l=e[1]&&no(e);return{c(){t=R("div"),r=z(n),i=D(),l&&l.c(),o=Ae()},m(a,s){T(a,t,s),v(t,r),T(a,i,s),l&&l.m(a,s),T(a,o,s)},p(a,[s]){s&1&&n!==(n=a[0].answer+"")&&Q(r,n),a[1]?l?l.p(a,s):(l=no(a),l.c(),l.m(o.parentNode,o)):l&&(l.d(1),l=null)},i:H,o:H,d(a){a&&x(t),a&&x(i),l&&l.d(a),a&&x(o)}}}async function Cf(e){const t=await fetch("/chat/rag_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function kf(e,t,n){let r;ee(e,xe,c=>n(6,r=c));let{message:i={}}=t,{feedback:o=!1}=t,{index:l=0}=t;function a(c,f,d){const g=r[d];g.vote=f;const p={id:d+1,vote_status:f};Cf(p),st(c.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),st(c.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}const s=c=>a(c,"up",l),u=c=>a(c,"down",l);return e.$$set=c=>{"message"in c&&n(0,i=c.message),"feedback"in c&&n(1,o=c.feedback),"index"in c&&n(2,l=c.index)},[i,o,l,a,s,u]}class $f extends ie{constructor(t){super(),se(this,t,kf,Sf,re,{message:0,feedback:1,index:2})}}function ro(e,t,n){const r=e.slice();return r[16]=t[n],r[18]=n,r}function io(e,t){let n,r,i,o,l,a,s,u,c,f=t[16].question+"",d,g,p,m,_,b,w,C,A,$,E,S,k,y,M,I;return A=new vf({props:{items:t[7],tabProps:{message:t[16],feedback:t[0],index:t[18]}}}),E=new pf({props:{sources:t[16].source,source_content:t[16].source_content}}),{key:e,first:null,c(){n=R("div"),r=R("div"),i=R("div"),o=D(),l=R("div"),a=R("div"),s=R("h5"),s.textContent="Question:",u=D(),c=R("p"),d=z(f),g=D(),p=R("div"),m=R("p"),m.textContent="ℹ️ Retrieval Sources",b=D(),w=R("div"),C=R("div"),Z(A.$$.fragment),$=D(),Z(E.$$.fragment),S=D(),h(i,"class","avatar"),h(s,"class","bold"),h(m,"class","bold"),h(p,"class","rag-sources svelte-aj7hp0"),h(a,"class","question svelte-aj7hp0"),h(C,"class","answer svelte-aj7hp0"),h(w,"class","answers svelte-aj7hp0"),h(l,"class","message-content svelte-aj7hp0"),h(r,"class","chat-message-center svelte-aj7hp0"),h(n,"class","chat-message svelte-aj7hp0"),this.first=n},m(F,P){T(F,n,P),v(n,r),v(r,i),v(r,o),v(r,l),v(l,a),v(a,s),v(a,u),v(a,c),v(c,d),v(a,g),v(a,p),v(p,m),v(l,b),v(l,w),v(w,C),K(A,C,null),v(l,$),K(E,l,null),v(n,S),y=!0,M||(I=[gn(_=qc.call(null,m,oo(t[16]))),gn(k=Af.call(null,n,t[18]===t[4].length-1))],M=!0)},p(F,P){t=F,(!y||P&16)&&f!==(f=t[16].question+"")&&Q(d,f),_&&Ye(_.update)&&P&16&&_.update.call(null,oo(t[16]));const B={};P&17&&(B.tabProps={message:t[16],feedback:t[0],index:t[18]}),A.$set(B);const ge={};P&16&&(ge.sources=t[16].source),P&16&&(ge.source_content=t[16].source_content),E.$set(ge),k&&Ye(k.update)&&P&16&&k.update.call(null,t[18]===t[4].length-1)},i(F){y||(N(A.$$.fragment,F),N(E.$$.fragment,F),y=!0)},o(F){V(A.$$.fragment,F),V(E.$$.fragment,F),y=!1},d(F){F&&x(n),J(A),J(E),M=!1,_e(I)}}}function Rf(e){let t,n,r,i,o,l,a=[],s=new Map,u,c,f,d,g,p,m,_,b,w=(e[2]?e[3]:"Send")+"",C,A,$,E,S,k,y,M=e[4];const I=F=>F[18];for(let F=0;FVote Feedback Instructions -

Ask a question to receive an answer from the chatbot. If the response is - satisfactory, click on the 👍 - button. If the response is not satisfactory, click on the - 👎 button.

`,r=D(),i=R("div"),o=R("section"),l=R("div");for(let F=0;F{e.scrollIntoView({behavior:"smooth"})},0)}function oo(e){return e.rag_sources.length===0?"No Sources":e.rag_sources.join(", ")}function Ef(e,t,n){let r,i,o,l;ee(e,xe,C=>n(4,i=C)),ee(e,Yr,C=>n(13,o=C));let{feedback:a=!1}=t,{is_retrieval:s=!1}=t;const u=ke([]);ee(e,u,C=>n(5,l=C));let c="",f="",d=!1,g=[{label:"Answer",value:1,component:$f},{label:"Modified Answer",value:2,component:yf}];ut(()=>{m(),p()});async function p(){const A=await(await fetch("/retrieval/file/get")).json();console.log("data",A.files);const E=A.files.map((S,k)=>({id:String(k),name:S.name}));console.log("files",E),Oe(u,l=[...E],l)}async function m(){const $=(await(await fetch("/chat/rag_table/retrieve")).json()).rows;console.log("Got data from db",$);const E=$.map(S=>({id:S[0],question:S[1],answer:S[2],edited_answer:S[3],vote_status:S[4],rag_sources:S[5],source:S[6],source_content:S[7]}));Oe(xe,i=[...E],i)}const _=async C=>{C.preventDefault(),c=f,n(1,f=""),n(2,d=!0);const A=[...o];let $={id:i.length+1,question:c,answer:"Loading...",rag_sources:A,vote_status:"na",source:["Loading..."],source_content:["Loading..."]};Oe(xe,i=[...i,$],i);const E=s?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:c,file_names:A})}):await fetch(`/chat/${c}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:c})});if(E.ok){const S=await E.json();console.log("response data",S),$.answer=S.answer,$.source=S.source,$.source_content=S.source_content,xe.update(k=>(k[k.length-1]=$,k))}else{const S=await E.text();alert(S)}n(2,d=!1)};let b=0;setInterval(()=>{n(10,b=(b+1)%4)},200);function w(){f=this.value,n(1,f)}return e.$$set=C=>{"feedback"in C&&n(0,a=C.feedback),"is_retrieval"in C&&n(9,s=C.is_retrieval)},e.$$.update=()=>{e.$$.dirty&1024&&n(3,r=".".repeat(b).padEnd(3))},[a,f,d,r,i,l,u,g,_,s,b,w]}class Mf extends ie{constructor(t){super(),se(this,t,Ef,Rf,re,{feedback:0,is_retrieval:9})}}function lo(e){let t,n;return t=new vi({props:{is_retrieval:e[1]}}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const o={};i&2&&(o.is_retrieval=r[1]),t.$set(o)},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function so(e){let t,n;return t=new vi({props:{feedback:!0,is_retrieval:e[1]}}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const o={};i&2&&(o.is_retrieval=r[1]),t.$set(o)},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function ao(e){let t,n;return t=new Mf({props:{feedback:!0,is_retrieval:e[1]}}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const o={};i&2&&(o.is_retrieval=r[1]),t.$set(o)},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function uo(e){let t,n,r,i;const o=[Df,Ff],l=[];function a(s,u){return s[1]?0:1}return t=a(e),n=l[t]=o[t](e),{c(){n.c(),r=Ae()},m(s,u){l[t].m(s,u),T(s,r,u),i=!0},p(s,u){let c=t;t=a(s),t===c?l[t].p(s,u):(ue(),V(l[c],1,1,()=>{l[c]=null}),ce(),n=l[t],n?n.p(s,u):(n=l[t]=o[t](s),n.c()),N(n,1),n.m(r.parentNode,r))},i(s){i||(N(n),i=!0)},o(s){V(n),i=!1},d(s){l[t].d(s),s&&x(r)}}}function Ff(e){let t,n;return t=new Kc({}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:H,i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function Df(e){let t,n;return t=new vi({props:{feedback:!0,is_retrieval:e[1]}}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const o={};i&2&&(o.is_retrieval=r[1]),t.$set(o)},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function If(e){let t,n,r,i,o,l=!e[0]&&lo(e),a=e[0]==="vote"&&so(e),s=e[0]==="rag"&&ao(e),u=e[0]==="rank"&&uo(e);return{c(){l&&l.c(),t=D(),a&&a.c(),n=D(),s&&s.c(),r=D(),u&&u.c(),i=Ae()},m(c,f){l&&l.m(c,f),T(c,t,f),a&&a.m(c,f),T(c,n,f),s&&s.m(c,f),T(c,r,f),u&&u.m(c,f),T(c,i,f),o=!0},p(c,[f]){c[0]?l&&(ue(),V(l,1,1,()=>{l=null}),ce()):l?(l.p(c,f),f&1&&N(l,1)):(l=lo(c),l.c(),N(l,1),l.m(t.parentNode,t)),c[0]==="vote"?a?(a.p(c,f),f&1&&N(a,1)):(a=so(c),a.c(),N(a,1),a.m(n.parentNode,n)):a&&(ue(),V(a,1,1,()=>{a=null}),ce()),c[0]==="rag"?s?(s.p(c,f),f&1&&N(s,1)):(s=ao(c),s.c(),N(s,1),s.m(r.parentNode,r)):s&&(ue(),V(s,1,1,()=>{s=null}),ce()),c[0]==="rank"?u?(u.p(c,f),f&1&&N(u,1)):(u=uo(c),u.c(),N(u,1),u.m(i.parentNode,i)):u&&(ue(),V(u,1,1,()=>{u=null}),ce())},i(c){o||(N(l),N(a),N(s),N(u),o=!0)},o(c){V(l),V(a),V(s),V(u),o=!1},d(c){l&&l.d(c),c&&x(t),a&&a.d(c),c&&x(n),s&&s.d(c),c&&x(r),u&&u.d(c),c&&x(i)}}}function Nf(e,t,n){let{feedback:r}=t,{is_retrieval:i}=t;return e.$$set=o=>{"feedback"in o&&n(0,r=o.feedback),"is_retrieval"in o&&n(1,i=o.is_retrieval)},[r,i]}class Pf extends ie{constructor(t){super(),se(this,t,Nf,If,re,{feedback:0,is_retrieval:1})}}function co(e,t,n){const r=e.slice();return r[2]=t[n],r}function fo(e){let t,n=e[2]+"",r,i;return{c(){t=R("option"),r=z(n),t.__value=i=e[2],t.value=t.__value},m(o,l){T(o,t,l),v(t,r)},p(o,l){l&1&&n!==(n=o[2]+"")&&Q(r,n),l&1&&i!==(i=o[2])&&(t.__value=i,t.value=t.__value)},d(o){o&&x(t)}}}function xf(e){let t,n=e[0],r=[];for(let i=0;i{const o=await fetch(`/data/${r}`);n(0,i=await o.json())}),e.$$set=o=>{"data_endpoint"in o&&n(1,r=o.data_endpoint)},[i,r]}class Of extends ie{constructor(t){super(),se(this,t,Tf,xf,re,{data_endpoint:1})}}function Ht(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Vf(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Es(e){let t,n,r;e.length!==2?(t=Ht,n=(a,s)=>Ht(e(a),s),r=(a,s)=>e(a)-s):(t=e===Ht||e===Vf?e:zf,n=e,r=e);function i(a,s,u=0,c=a.length){if(u>>1;n(a[f],s)<0?u=f+1:c=f}while(u>>1;n(a[f],s)<=0?u=f+1:c=f}while(uu&&r(a[f-1],s)>-r(a[f],s)?f-1:f}return{left:i,center:l,right:o}}function zf(){return 0}function Hf(e){return e===null?NaN:+e}function*Lf(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const qf=Es(Ht),Gf=qf.right;Es(Hf).center;const Ms=Gf;function jf(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function sn(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r=o&&(n=r=o):(n>o&&(n=o),r{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Fs(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var Qf=Array.prototype,Kf=Qf.slice;function Rr(e){return()=>e}const Jf=Math.sqrt(50),Zf=Math.sqrt(10),ed=Math.sqrt(2);function Kn(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),l=o>=Jf?10:o>=Zf?5:o>=ed?2:1;let a,s,u;return i<0?(u=Math.pow(10,-i)/l,a=Math.round(e*u),s=Math.round(t*u),a/ut&&--s,u=-u):(u=Math.pow(10,i)*l,a=Math.round(e/u),s=Math.round(t/u),a*ut&&--s),s0))return[];if(e===t)return[e];const r=t=i))return[];const a=o-i+1,s=new Array(a);if(r)if(l<0)for(let u=0;u0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function rd(e){return Math.max(1,Math.ceil(Math.log(jf(e))/Math.LN2)+1)}function Is(){var e=Xf,t=sn,n=rd;function r(i){Array.isArray(i)||(i=Array.from(i));var o,l=i.length,a,s,u=new Array(l);for(o=0;o=d)if(C>=d&&t===sn){const $=jt(f,d,A);isFinite($)&&($>0?d=(Math.floor(d/$)+1)*$:$<0&&(d=(Math.ceil(d*-$)+1)/-$))}else g.pop()}for(var p=g.length,m=0,_=p;g[m]<=f;)++m;for(;g[_-1]>d;)--_;(m||_0?g[o-1]:f,w.x1=o0)for(o=0;o=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function po(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Ns(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Fs:Yf(i);r>n;){if(r-n>600){const s=r-n+1,u=t-n+1,c=Math.log(s),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(s-f)/s)*(u-s/2<0?-1:1),g=Math.max(n,Math.floor(t-u*f/s+d)),p=Math.min(r,Math.floor(t+(s-u)*f/s+d));Ns(e,t,g,p,i)}const o=e[t];let l=n,a=r;for(Kt(e,n,t),i(e[r],o)>0&&Kt(e,n,r);l0;)--a}i(e[n],o)===0?Kt(e,n,a):(++a,Kt(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function Kt(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function id(e,t,n){if(e=Float64Array.from(Lf(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return po(e);if(t>=1)return Rt(e);var r,i=(r-1)*t,o=Math.floor(i),l=Rt(Ns(e,o).subarray(0,o+1)),a=po(e.subarray(o+1));return l+(a-l)*(i-o)}}function od(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Jn(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Bt(e){return e=Jn(Math.abs(e)),e?e[1]:NaN}function sd(e,t){return function(n,r){for(var i=n.length,o=[],l=0,a=e[0],s=0;i>0&&a>0&&(s+a+1>r&&(a=Math.max(1,r-s)),o.push(n.substring(i-=a,i+a)),!((s+=a+1)>r));)a=e[l=(l+1)%e.length];return o.reverse().join(t)}}function ad(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var ud=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Zn(e){if(!(t=ud.exec(e)))throw new Error("invalid format: "+e);var t;return new bi({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Zn.prototype=bi.prototype;function bi(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}bi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function cd(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Ps;function fd(e,t){var n=Jn(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(Ps=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return o===l?r:o>l?r+new Array(o-l+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Jn(e,Math.max(0,t+o-1))[0]}function mo(e,t){var n=Jn(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const _o={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:ld,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>mo(e*100,t),r:mo,s:fd,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function vo(e){return e}var bo=Array.prototype.map,wo=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function dd(e){var t=e.grouping===void 0||e.thousands===void 0?vo:sd(bo.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?vo:ad(bo.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",s=e.nan===void 0?"NaN":e.nan+"";function u(f){f=Zn(f);var d=f.fill,g=f.align,p=f.sign,m=f.symbol,_=f.zero,b=f.width,w=f.comma,C=f.precision,A=f.trim,$=f.type;$==="n"?(w=!0,$="g"):_o[$]||(C===void 0&&(C=12),A=!0,$="g"),(_||d==="0"&&g==="=")&&(_=!0,d="0",g="=");var E=m==="$"?n:m==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",S=m==="$"?r:/[%p]/.test($)?l:"",k=_o[$],y=/[defgprs%]/.test($);C=C===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function M(I){var F=E,P=S,B,ge,oe;if($==="c")P=k(I)+P,I="";else{I=+I;var Ee=I<0||1/I<0;if(I=isNaN(I)?s:k(Math.abs(I),C),A&&(I=cd(I)),Ee&&+I==0&&p!=="+"&&(Ee=!1),F=(Ee?p==="("?p:a:p==="-"||p==="("?"":p)+F,P=($==="s"?wo[8+Ps/3]:"")+P+(Ee&&p==="("?")":""),y){for(B=-1,ge=I.length;++Boe||oe>57){P=(oe===46?i+I.slice(B+1):I.slice(B))+P,I=I.slice(0,B);break}}}w&&!_&&(I=t(I,1/0));var Me=F.length+I.length+P.length,ye=Me>1)+F+I+P+ye.slice(Me);break;default:I=ye+F+I+P;break}return o(I)}return M.toString=function(){return f+""},M}function c(f,d){var g=u((f=Zn(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Bt(d)/3)))*3,m=Math.pow(10,-p),_=wo[8+p/3];return function(b){return g(m*b)+_}}return{format:u,formatPrefix:c}}var An,Mt,xs;gd({thousands:",",grouping:[3],currency:["$",""]});function gd(e){return An=dd(e),Mt=An.format,xs=An.formatPrefix,An}function hd(e){return Math.max(0,-Bt(Math.abs(e)))}function pd(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Bt(t)/3)))*3-Bt(Math.abs(e)))}function md(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Bt(t)-Bt(e))+1}function wi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const yo=Symbol("implicit");function mr(){var e=new go,t=[],n=[],r=yo;function i(o){let l=e.get(o);if(l===void 0){if(r!==yo)return r;e.set(o,l=t.push(o)-1)}return n[l%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new go;for(const l of o)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return mr(t,n).unknown(r)},wi.apply(i,arguments),i}function yi(){var e=mr().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,l,a=!1,s=0,u=0,c=.5;delete e.unknown;function f(){var d=t().length,g=i>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?En(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?En(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=vd.exec(e))?new Te(t[1],t[2],t[3],1):(t=bd.exec(e))?new Te(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=wd.exec(e))?En(t[1],t[2],t[3],t[4]):(t=yd.exec(e))?En(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Sd.exec(e))?Eo(t[1],t[2]/100,t[3]/100,1):(t=Cd.exec(e))?Eo(t[1],t[2]/100,t[3]/100,t[4]):So.hasOwnProperty(e)?$o(So[e]):e==="transparent"?new Te(NaN,NaN,NaN,0):null}function $o(e){return new Te(e>>16&255,e>>8&255,e&255,1)}function En(e,t,n,r){return r<=0&&(e=t=n=NaN),new Te(e,t,n,r)}function Rd(e){return e instanceof yn||(e=bn(e)),e?(e=e.rgb(),new Te(e.r,e.g,e.b,e.opacity)):new Te}function Jr(e,t,n,r){return arguments.length===1?Rd(e):new Te(e,t,n,r??1)}function Te(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Si(Te,Jr,Ts(yn,{brighter(e){return e=e==null?er:Math.pow(er,e),new Te(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?_n:Math.pow(_n,e),new Te(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Te($t(this.r),$t(this.g),$t(this.b),tr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ro,formatHex:Ro,formatHex8:Ad,formatRgb:Ao,toString:Ao}));function Ro(){return`#${Ct(this.r)}${Ct(this.g)}${Ct(this.b)}`}function Ad(){return`#${Ct(this.r)}${Ct(this.g)}${Ct(this.b)}${Ct((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ao(){const e=tr(this.opacity);return`${e===1?"rgb(":"rgba("}${$t(this.r)}, ${$t(this.g)}, ${$t(this.b)}${e===1?")":`, ${e})`}`}function tr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $t(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ct(e){return e=$t(e),(e<16?"0":"")+e.toString(16)}function Eo(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ue(e,t,n,r)}function Os(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof yn||(e=bn(e)),!e)return new Ue;if(e instanceof Ue)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,a=o-i,s=(o+i)/2;return a?(t===o?l=(n-r)/a+(n0&&s<1?0:l,new Ue(l,a,s,e.opacity)}function Ed(e,t,n,r){return arguments.length===1?Os(e):new Ue(e,t,n,r??1)}function Ue(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Si(Ue,Ed,Ts(yn,{brighter(e){return e=e==null?er:Math.pow(er,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?_n:Math.pow(_n,e),new Ue(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Te(Ar(e>=240?e-240:e+120,i,r),Ar(e,i,r),Ar(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ue(Mo(this.h),Mn(this.s),Mn(this.l),tr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=tr(this.opacity);return`${e===1?"hsl(":"hsla("}${Mo(this.h)}, ${Mn(this.s)*100}%, ${Mn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Mo(e){return e=(e||0)%360,e<0?e+360:e}function Mn(e){return Math.max(0,Math.min(1,e||0))}function Ar(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ci=e=>()=>e;function Md(e,t){return function(n){return e+n*t}}function Fd(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Dd(e){return(e=+e)==1?Vs:function(t,n){return n-t?Fd(t,n,e):Ci(isNaN(t)?n:t)}}function Vs(e,t){var n=t-e;return n?Md(e,n):Ci(isNaN(e)?t:e)}const Fo=function e(t){var n=Dd(t);function r(i,o){var l=n((i=Jr(i)).r,(o=Jr(o)).r),a=n(i.g,o.g),s=n(i.b,o.b),u=Vs(i.opacity,o.opacity);return function(c){return i.r=l(c),i.g=a(c),i.b=s(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function Id(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;in&&(o=t.slice(n,o),a[l]?a[l]+=o:a[++l]=o),(r=r[0])===(i=i[0])?a[l]?a[l]+=i:a[++l]=i:(a[++l]=null,s.push({i:l,x:nr(r,i)})),n=Er.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function jd(e,t,n){var r=e[0],i=e[1],o=t[0],l=t[1];return i2?Bd:jd,s=u=null,f}function f(d){return d==null||isNaN(d=+d)?o:(s||(s=a(e.map(r),t,n)))(r(l(d)))}return f.invert=function(d){return l(i((u||(u=a(t,e.map(r),nr)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,qd),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=Hd,c()},f.clamp=function(d){return arguments.length?(l=d?!0:Tt,c()):l!==Tt},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,g){return r=d,i=g,c()}}function Xd(){return Wd()(Tt,Tt)}function Yd(e,t,n,r){var i=td(e,t,n),o;switch(r=Zn(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=pd(i,l))&&(r.precision=o),xs(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=md(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=hd(i))&&(r.precision=o-(r.type==="%")*2);break}}return Mt(r)}function Qd(e){var t=e.domain;return e.ticks=function(n){var r=t();return Ds(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Yd(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,l=r[i],a=r[o],s,u,c=10;for(a0;){if(u=jt(l,a,n),u===s)return r[i]=l,r[o]=a,t(r);if(u>0)l=Math.floor(l/u)*u,a=Math.ceil(a/u)*u;else if(u<0)l=Math.ceil(l*u)/u,a=Math.floor(a*u)/u;else break;s=u}return e},e}function We(){var e=Xd();return e.copy=function(){return Ud(e,We())},wi.apply(e,arguments),Qd(e)}function Fn(e){return function(){return e}}function Kd(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ti(e,t){if((l=e.length)>1)for(var n=1,r,i,o=e[t[0]],l,a=o.length;n=0;)n[t]=t;return n}function Jd(e,t){return e[t]}function Zd(e){const t=[];return t.key=e,t}function eg(){var e=Fn([]),t=ni,n=ti,r=Jd;function i(o){var l=Array.from(e.apply(this,arguments),Zd),a,s=l.length,u=-1,c;for(const f of o)for(a=0,++u;aFeedback Distribution

",n=D(),r=R("div"),i=U("svg");for(let s=0;se[19].call(r))},m(s,u){T(s,t,u),T(s,n,u),T(s,r,u),v(r,i);for(let c=0;cn(15,f=k)),ee(e,Ti,k=>n(4,d=k)),ee(e,xe,k=>n(16,g=k));let p=300,m=300;const _={up:2,down:1,"n/a":0,all:"all"},b={top:10,bottom:10,left:25,right:5},w=mr().range(["var(--yellow)","var(--red)","var(--green)"]),C=Mt(".0%");function A(k,y){r===k?n(5,r="all"):n(5,r=k),Oe(nt,f=r==="all"?"all":y,f)}const $=(k,y)=>A(k,y.key),E=(k,y)=>A(k,y.key);function S(){m=this.offsetWidth,p=this.offsetHeight,n(1,m),n(0,p)}return e.$$.update=()=>{e.$$.dirty&32768&&n(5,r=_[f]),e.$$.dirty&2&&n(3,i=m-b.left-b.right),e.$$.dirty&1&&n(14,o=p-b.top-b.bottom),e.$$.dirty&65552&&g.forEach(k=>{Oe(Ti,d[k.vote_status]++,d)}),e.$$.dirty&16&&n(2,l=d.up+d.down+d["n/a"]),e.$$.dirty&16384&&n(8,a=yi().rangeRound([b.top,o-b.bottom]).padding(0).domain(["a"])),e.$$.dirty&12&&n(7,s=We().rangeRound([b.left,i-b.right]).domain([0,l])),e.$$.dirty&8208&&n(6,c=u([d]))},n(13,u=eg().keys(["n/a","down","up"]).order(ni).offset(ti)),[p,m,l,i,d,r,c,s,a,b,w,C,A,u,o,f,g,$,E,S]}class zs extends ie{constructor(t){super(),se(this,t,ng,tg,re,{})}}function rg(e){let t,n,r,i,o,l,a,s,u,c,f,d=e[3][e[2]]+"",g,p;return{c(){t=R("div"),n=R("div"),r=z("Q: "),i=z(e[0]),o=D(),l=R("div"),a=z("A: "),s=z(e[1]),u=D(),c=R("div"),f=z("Rating: "),g=z(d),h(n,"class","question svelte-szi0e"),h(l,"class","answer svelte-szi0e"),h(c,"class",p="feedback "+e[2]+" svelte-szi0e"),h(t,"class","qa-card svelte-szi0e")},m(m,_){T(m,t,_),v(t,n),v(n,r),v(n,i),v(t,o),v(t,l),v(l,a),v(l,s),v(t,u),v(t,c),v(c,f),v(c,g)},p(m,[_]){_&1&&Q(i,m[0]),_&2&&Q(s,m[1]),_&4&&d!==(d=m[3][m[2]]+"")&&Q(g,d),_&4&&p!==(p="feedback "+m[2]+" svelte-szi0e")&&h(c,"class",p)},i:H,o:H,d(m){m&&x(t)}}}function ig(e,t,n){let{question:r="What is gradient descent?"}=t,{answer:i="Gradient descent is an algorithm used to minimize a loss function by taking small steps in the direction of steepest descent."}=t,{feedback:o="Good: 👍"}=t;const l={up:"Good 👍",down:"Bad 👎","n/a":"No Rating",all:"All"};return e.$$set=a=>{"question"in a&&n(0,r=a.question),"answer"in a&&n(1,i=a.answer),"feedback"in a&&n(2,o=a.feedback)},[r,i,o,l]}class og extends ie{constructor(t){super(),se(this,t,ig,rg,re,{question:0,answer:1,feedback:2})}}function To(e,t,n){const r=e.slice();return r[5]=t[n].question,r[6]=t[n].answer,r[7]=t[n].vote_status,r}function Oo(e){let t,n,r,i,o;return n=new og({props:{question:e[5],answer:e[6],feedback:e[7]}}),{c(){t=R("div"),Z(n.$$.fragment),r=D()},m(l,a){T(l,t,a),K(n,t,null),v(t,r),o=!0},p(l,a){const s={};a&1&&(s.question=l[5]),a&1&&(s.answer=l[6]),a&1&&(s.feedback=l[7]),n.$set(s)},i(l){o||(N(n.$$.fragment,l),l&&Se(()=>{o&&(i||(i=Ke(t,e[1],{duration:300},!0)),i.run(1))}),o=!0)},o(l){V(n.$$.fragment,l),l&&(i||(i=Ke(t,e[1],{duration:300},!1)),i.run(0)),o=!1},d(l){l&&x(t),J(n),l&&i&&i.end()}}}function lg(e){let t,n,r=e[0],i=[];for(let l=0;lV(i[l],1,1,()=>{i[l]=null});return{c(){t=R("div");for(let l=0;ln(4,i=s)),ee(e,nt,s=>n(2,o=s)),ee(e,pn,s=>n(3,l=s));const a=(s,{delay:u=0,duration:c=1e3,easing:f=pi})=>mn(s,{delay:u,duration:c,easing:f});return e.$$.update=()=>{e.$$.dirty&12&&n(0,r=o==="all"?l:l.filter(s=>s.vote_status===o)),e.$$.dirty&1&&Oe(Xr,i=Lc(r),i)},[r,a,o,l]}class Hs extends ie{constructor(t){super(),se(this,t,sg,lg,re,{})}}function Vo(e,t,n){const r=e.slice();return r[13]=t[n],r}function zo(e,t,n){const r=e.slice();return r[16]=t[n],r}function Ho(e,t,n){const r=e.slice();return r[16]=t[n],r}function Lo(e){let t,n,r,i,o=e[16]+"",l,a;return{c(){t=U("g"),n=U("line"),i=U("text"),l=z(o),h(n,"class","axis-tick svelte-1oikip4"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",r=-e[2]+e[10].bottom+e[10].top),h(n,"stroke","var(--squidink)"),h(n,"stroke-dasharray","4"),h(i,"class","axis-text svelte-1oikip4"),h(i,"y","15"),h(i,"text-anchor","middle"),h(t,"transform",a=`translate(${e[6](e[16])+e[6].bandwidth()/2} ${e[2]-e[10].bottom})`)},m(s,u){T(s,t,u),v(t,n),v(t,i),v(i,l)},p(s,u){u&4&&r!==(r=-s[2]+s[10].bottom+s[10].top)&&h(n,"y2",r),u&16&&o!==(o=s[16]+"")&&Q(l,o),u&84&&a!==(a=`translate(${s[6](s[16])+s[6].bandwidth()/2} ${s[2]-s[10].bottom})`)&&h(t,"transform",a)},d(s){s&&x(t)}}}function qo(e){let t,n,r,i;return{c(){t=U("g"),n=U("line"),h(n,"class","axis-tick svelte-1oikip4"),h(n,"x1",0),h(n,"x2",r=e[3]-e[10].right-e[10].left),h(n,"y1","0"),h(n,"y2","0"),h(n,"stroke","black"),h(t,"transform",i=`translate(${e[10].left} ${e[5](e[16])+0})`)},m(o,l){T(o,t,l),v(t,n)},p(o,l){l&8&&r!==(r=o[3]-o[10].right-o[10].left)&&h(n,"x2",r),l&32&&i!==(i=`translate(${o[10].left} ${o[5](o[16])+0})`)&&h(t,"transform",i)},d(o){o&&x(t)}}}function Go(e){let t,n,r,i,o,l,a,s,u=Math.round(e[11](e[13].count))+"",c,f,d;return{c(){t=U("g"),n=U("rect"),s=U("text"),c=z(u),h(n,"x",r=e[6](e[13].question)),h(n,"y",i=e[5](e[13].count)),h(n,"height",o=e[2]-e[5](e[13].count)-e[10].bottom),h(n,"fill",l=e[9][e[7]]),h(n,"fill-opacity","0.95"),h(n,"width",a=e[6].bandwidth()),h(n,"class","svelte-1oikip4"),h(s,"class","axis-text svelte-1oikip4"),h(s,"x",f=e[6](e[13].question)+e[6].bandwidth()/2),h(s,"y",d=e[5](e[13].count)-5),h(s,"text-anchor","middle"),h(t,"class","series")},m(g,p){T(g,t,p),v(t,n),v(t,s),v(s,c)},p(g,p){p&80&&r!==(r=g[6](g[13].question))&&h(n,"x",r),p&48&&i!==(i=g[5](g[13].count))&&h(n,"y",i),p&52&&o!==(o=g[2]-g[5](g[13].count)-g[10].bottom)&&h(n,"height",o),p&128&&l!==(l=g[9][g[7]])&&h(n,"fill",l),p&64&&a!==(a=g[6].bandwidth())&&h(n,"width",a),p&16&&u!==(u=Math.round(g[11](g[13].count))+"")&&Q(c,u),p&80&&f!==(f=g[6](g[13].question)+g[6].bandwidth()/2)&&h(s,"x",f),p&48&&d!==(d=g[5](g[13].count)-5)&&h(s,"y",d)},d(g){g&&x(t)}}}function ag(e){let t,n,r,i,o,l,a=e[8][e[7]]+"",s,u,c,f,d,g,p,m,_,b=e[4].map(jo),w=[];for(let S=0;Se[12].call(t))},m(S,k){T(S,t,k),v(t,n);for(let y=0;ye.question;function ug(e,t,n){let r,i,o,l,a,s;ee(e,Xr,_=>n(4,a=_)),ee(e,nt,_=>n(7,s=_));const u={up:"Good 👍",down:"Bad 👎","n/a":"No Rating",all:"All"},c={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let f=300,d=300,g={top:35,bottom:10,left:25,right:5};const p=Mt(".1f");function m(){d=this.offsetWidth,f=this.offsetHeight,n(1,d),n(0,f)}return e.$$.update=()=>{e.$$.dirty&2&&n(3,r=d-g.left-g.right),e.$$.dirty&1&&n(2,i=f-g.top-g.bottom),e.$$.dirty&24&&n(6,o=yi().rangeRound([g.left,r-g.right]).padding(.05).domain(a.map(_=>_.question))),e.$$.dirty&20&&n(5,l=We().rangeRound([i-g.bottom,g.top]).domain([0,Rt(a,_=>_.count)])),e.$$.dirty&16&&console.log(a)},[f,d,i,r,a,l,o,s,u,c,g,p,m]}class Ls extends ie{constructor(t){super(),se(this,t,ug,ag,re,{})}}function Bo(e,t,n){const r=e.slice();r[19]=t[n];const i=r[7](r[19].x1)-r[7](r[19].x0);return r[20]=i,r}function Uo(e,t,n){const r=e.slice();return r[23]=t[n],r}function Wo(e){let t,n,r,i,o=e[23]+"",l,a;return{c(){t=U("g"),n=U("line"),i=U("text"),l=z(o),h(n,"class","axis-tick svelte-kz2qh6"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",r=-e[2]+e[9].bottom+e[9].top),h(n,"stroke","var(--squidink)"),h(n,"stroke-dasharray","4"),h(i,"class","axis-text svelte-kz2qh6"),h(i,"y","15"),h(i,"text-anchor","middle"),h(t,"transform",a=`translate(${e[7](e[23])+(e[7](1)-e[7](0))/2} ${e[2]-e[9].bottom})`),h(t,"class","svelte-kz2qh6")},m(s,u){T(s,t,u),v(t,n),v(t,i),v(i,l)},p(s,u){u&4&&r!==(r=-s[2]+s[9].bottom+s[9].top)&&h(n,"y2",r),u&128&&o!==(o=s[23]+"")&&Q(l,o),u&132&&a!==(a=`translate(${s[7](s[23])+(s[7](1)-s[7](0))/2} ${s[2]-s[9].bottom})`)&&h(t,"transform",a)},d(s){s&&x(t)}}}function Xo(e){let t,n,r,i,o,l,a;return{c(){t=U("g"),n=U("rect"),h(n,"x",r=e[7](e[19].x0)+1),h(n,"width",i=e[20]),h(n,"y",o=e[6](e[19].length)),h(n,"height",l=e[6](0)-e[6](e[19].length)),h(n,"fill",a=e[8][e[5]]),h(n,"class","svelte-kz2qh6"),h(t,"class","histogram-bin svelte-kz2qh6")},m(s,u){T(s,t,u),v(t,n)},p(s,u){u&136&&r!==(r=s[7](s[19].x0)+1)&&h(n,"x",r),u&136&&i!==(i=s[20])&&h(n,"width",i),u&72&&o!==(o=s[6](s[19].length))&&h(n,"y",o),u&72&&l!==(l=s[6](0)-s[6](s[19].length))&&h(n,"height",l),u&32&&a!==(a=s[8][s[5]])&&h(n,"fill",a)},d(s){s&&x(t)}}}function cg(e){let t,n,r,i,o,l,a,s,u,c,f,d=e[7].ticks(),g=[];for(let _=0;_e[14].call(t))},m(_,b){T(_,t,b),v(t,n);for(let w=0;wn(5,f=C)),ee(e,xe,C=>n(13,d=C));const g={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let p=300,m=300,_={top:15,bottom:10,left:25,right:5};Mt(".1f");let b=Array.from({length:Yo},(C,A)=>A);function w(){m=this.offsetWidth,p=this.offsetHeight,n(1,m),n(0,p)}return e.$$.update=()=>{e.$$.dirty&8224&&n(12,r=f==="all"?d:d.filter(C=>C.vote_status===f)),e.$$.dirty&4096&&n(11,i=As(r)),e.$$.dirty&2&&n(4,o=m-_.left-_.right),e.$$.dirty&1&&n(2,l=p-_.top-_.bottom),e.$$.dirty&2048&&n(3,a=Is().thresholds(b).value(C=>C.answer)(i)),e.$$.dirty&16&&n(7,s=We().domain([3,Yo]).range([_.left,o-_.right])),e.$$.dirty&12&&n(6,u=We().domain([0,Rt(a,C=>C.length)]).range([l-_.bottom,_.top])),e.$$.dirty&2048&&n(10,c=Rt(i,C=>C.length)),e.$$.dirty&1056&&We().domain([0,c]).range(["white",g[f]]).interpolate(_r)},[p,m,l,a,o,f,u,s,g,_,c,i,r,d,w]}class qs extends ie{constructor(t){super(),se(this,t,fg,cg,re,{})}}function Qo(e,t,n){const r=e.slice();r[18]=t[n];const i=r[7](r[18].x1)-r[7](r[18].x0);return r[19]=i,r}function Ko(e,t,n){const r=e.slice();return r[22]=t[n],r}function Jo(e){let t,n,r,i,o=e[22]+"",l,a;return{c(){t=U("g"),n=U("line"),i=U("text"),l=z(o),h(n,"class","axis-tick svelte-kz2qh6"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",r=-e[2]+e[9].bottom+e[9].top),h(n,"stroke","var(--squidink)"),h(n,"stroke-dasharray","4"),h(i,"class","axis-text svelte-kz2qh6"),h(i,"y","15"),h(i,"text-anchor","middle"),h(t,"transform",a=`translate(${e[7](e[22])+(e[7](1)-e[7](0))/2} ${e[2]-e[9].bottom})`),h(t,"class","svelte-kz2qh6")},m(s,u){T(s,t,u),v(t,n),v(t,i),v(i,l)},p(s,u){u&4&&r!==(r=-s[2]+s[9].bottom+s[9].top)&&h(n,"y2",r),u&128&&o!==(o=s[22]+"")&&Q(l,o),u&132&&a!==(a=`translate(${s[7](s[22])+(s[7](1)-s[7](0))/2} ${s[2]-s[9].bottom})`)&&h(t,"transform",a)},d(s){s&&x(t)}}}function Zo(e){let t,n,r,i,o,l,a;return{c(){t=U("g"),n=U("rect"),h(n,"x",r=e[7](e[18].x0)+1),h(n,"width",i=e[19]),h(n,"y",o=e[6](e[18].length)),h(n,"height",l=e[6](0)-e[6](e[18].length)),h(n,"fill",a=e[8][e[5]]),h(n,"class","svelte-kz2qh6"),h(t,"class","histogram-bin svelte-kz2qh6")},m(s,u){T(s,t,u),v(t,n)},p(s,u){u&136&&r!==(r=s[7](s[18].x0)+1)&&h(n,"x",r),u&136&&i!==(i=s[19])&&h(n,"width",i),u&72&&o!==(o=s[6](s[18].length))&&h(n,"y",o),u&72&&l!==(l=s[6](0)-s[6](s[18].length))&&h(n,"height",l),u&32&&a!==(a=s[8][s[5]])&&h(n,"fill",a)},d(s){s&&x(t)}}}function dg(e){let t,n,r,i,o,l,a,s,u,c,f,d=e[7].ticks(),g=[];for(let _=0;_e[13].call(t))},m(_,b){T(_,t,b),v(t,n);for(let w=0;wn(5,c=w)),ee(e,xe,w=>n(12,f=w));const d={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let g=300,p=300,m={top:15,bottom:10,left:25,right:5},_=Array.from({length:el},(w,C)=>C);mr().range(["var(--yellow)","var(--red)","var(--green)"]);function b(){p=this.offsetWidth,g=this.offsetHeight,n(1,p),n(0,g)}return e.$$.update=()=>{e.$$.dirty&4128&&n(11,r=c==="all"?f:f.filter(w=>w.vote_status===c)),e.$$.dirty&2048&&n(10,i=As(r)),e.$$.dirty&2&&n(4,o=p-m.left-m.right),e.$$.dirty&1&&n(2,l=g-m.top-m.bottom),e.$$.dirty&1024&&n(3,a=Is().thresholds(_).value(w=>w.question)(i)),e.$$.dirty&16&&n(7,s=We().domain([3,el]).range([m.left,o-m.right])),e.$$.dirty&12&&n(6,u=We().domain([0,Rt(a,w=>w.length)]).range([l-m.bottom,m.top])),e.$$.dirty&1024&&Rt(i,w=>w.length)},[g,p,l,a,o,c,u,s,d,m,i,r,f,b]}class Gs extends ie{constructor(t){super(),se(this,t,gg,dg,re,{})}}function hg(e){let t,n,r,i,o,l,a,s,u,c,f,d,g,p=Math.round(e[5](e[3]))+"",m,_,b,w,C,A,$,E;return{c(){t=R("div"),n=R("div"),r=R("p"),r.textContent="Questions",i=D(),o=R("select"),l=R("option"),l.textContent="All",a=R("option"),a.textContent="Good",s=R("option"),s.textContent="Bad",u=R("option"),u.textContent="N/A",c=D(),f=R("div"),d=U("svg"),g=U("text"),m=z(p),C=D(),A=R("p"),A.textContent="number of responses",h(r,"class","card-text svelte-1pknxov"),l.__value="all",l.value=l.__value,h(l,"class","svelte-1pknxov"),a.__value="up",a.value=a.__value,h(a,"class","svelte-1pknxov"),s.__value="down",s.value=s.__value,h(s,"class","svelte-1pknxov"),u.__value="n/a",u.value=u.__value,h(u,"class","svelte-1pknxov"),h(o,"id","feedback-dropdown"),h(o,"name","feedback-dropdown"),Re(o,"background",e[6][e[0]]),h(o,"class","svelte-1pknxov"),e[0]===void 0&&Se(()=>e[9].call(o)),h(n,"class","svelte-1pknxov"),h(g,"dominant-baseline","middle"),h(g,"x",_=e[2]/2),h(g,"y",b=e[1]/2),h(g,"text-anchor","middle"),h(g,"class","svelte-1pknxov"),h(d,"width",e[2]),h(d,"height",e[1]),h(d,"class","svelte-1pknxov"),h(f,"class","svelte-1pknxov"),Se(()=>e[10].call(f)),h(A,"class","small svelte-1pknxov"),h(t,"class","card-container svelte-1pknxov"),Re(t,"background",e[6][e[0]])},m(S,k){T(S,t,k),v(t,n),v(n,r),v(n,i),v(n,o),v(o,l),v(o,a),v(o,s),v(o,u),Un(o,e[0],!0),v(t,c),v(t,f),v(f,d),v(d,g),v(g,m),w=Et(f,e[10].bind(f)),v(t,C),v(t,A),$||(E=j(o,"change",e[9]),$=!0)},p(S,[k]){k&1&&Re(o,"background",S[6][S[0]]),k&1&&Un(o,S[0]),k&8&&p!==(p=Math.round(S[5](S[3]))+"")&&Q(m,p),k&4&&_!==(_=S[2]/2)&&h(g,"x",_),k&2&&b!==(b=S[1]/2)&&h(g,"y",b),k&4&&h(d,"width",S[2]),k&2&&h(d,"height",S[1]),k&1&&Re(t,"background",S[6][S[0]])},i:H,o:H,d(S){S&&x(t),w(),$=!1,E()}}}function pg(e,t){return t==="all"?e.length:e.filter(r=>r.vote_status===t).length}function mg(e,t,n){let r,i,o,l;ee(e,nt,p=>n(0,i=p)),ee(e,xe,p=>n(8,o=p));let a,s,u=mi(0);ee(e,u,p=>n(3,l=p));const c=Mt(".1f"),f={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"var(--white)"};function d(){i=as(this),nt.set(i)}function g(){s=this.clientWidth,a=this.clientHeight,n(2,s),n(1,a)}return e.$$.update=()=>{e.$$.dirty&257&&n(7,r=pg(o,i)),e.$$.dirty&128&&console.log("fbc",r),e.$$.dirty&128&&u.set(r)},[i,a,s,l,u,c,f,r,o,d,g]}class js extends ie{constructor(t){super(),se(this,t,mg,hg,re,{})}}function _g(e){let t,n,r,i,o,l,a,s,u,c,f,d,g,p=e[5](e[3])+"",m,_,b,w,C,A,$,E;return{c(){t=R("div"),n=R("div"),r=R("p"),r.textContent="Questions",i=D(),o=R("select"),l=R("option"),l.textContent="All",a=R("option"),a.textContent="Good",s=R("option"),s.textContent="Bad",u=R("option"),u.textContent="N/A",c=D(),f=R("div"),d=U("svg"),g=U("text"),m=z(p),C=D(),A=R("p"),A.textContent="percentage of responses",h(r,"class","card-text svelte-mchgj2"),l.__value="all",l.value=l.__value,a.__value="up",a.value=a.__value,s.__value="down",s.value=s.__value,u.__value="n/a",u.value=u.__value,h(o,"id","feedback-dropdown"),h(o,"name","feedback-dropdown"),Re(o,"background",e[6][e[0]]),h(o,"class","svelte-mchgj2"),e[0]===void 0&&Se(()=>e[9].call(o)),h(g,"dominant-baseline","middle"),h(g,"x",_=e[2]/2),h(g,"y",b=e[1]/2),h(g,"text-anchor","middle"),h(g,"class","svelte-mchgj2"),h(d,"width",e[2]),h(d,"height",e[1]),h(d,"class","svelte-mchgj2"),Se(()=>e[10].call(f)),h(A,"class","small svelte-mchgj2"),h(t,"class","card-container svelte-mchgj2"),Re(t,"background",e[6][e[0]])},m(S,k){T(S,t,k),v(t,n),v(n,r),v(n,i),v(n,o),v(o,l),v(o,a),v(o,s),v(o,u),Un(o,e[0],!0),v(t,c),v(t,f),v(f,d),v(d,g),v(g,m),w=Et(f,e[10].bind(f)),v(t,C),v(t,A),$||(E=j(o,"change",e[9]),$=!0)},p(S,[k]){k&1&&Re(o,"background",S[6][S[0]]),k&1&&Un(o,S[0]),k&8&&p!==(p=S[5](S[3])+"")&&Q(m,p),k&4&&_!==(_=S[2]/2)&&h(g,"x",_),k&2&&b!==(b=S[1]/2)&&h(g,"y",b),k&4&&h(d,"width",S[2]),k&2&&h(d,"height",S[1]),k&1&&Re(t,"background",S[6][S[0]])},i:H,o:H,d(S){S&&x(t),w(),$=!1,E()}}}function vg(e,t){const n=e.length;return t==="all"?1:e.filter(i=>i.vote_status===t).length/n}function bg(e,t,n){let r,i,o,l;ee(e,nt,p=>n(0,i=p)),ee(e,xe,p=>n(8,o=p));let a,s,u=mi(0);ee(e,u,p=>n(3,l=p));const c=Mt(".1%"),f={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"var(--white)"};function d(){i=as(this),nt.set(i)}function g(){s=this.clientWidth,a=this.clientHeight,n(2,s),n(1,a)}return e.$$.update=()=>{e.$$.dirty&257&&n(7,r=vg(o,i)),e.$$.dirty&128&&u.set(r)},[i,a,s,l,u,c,f,r,o,d,g]}class Bs extends ie{constructor(t){super(),se(this,t,bg,_g,re,{})}}function wg(e){let t,n,r,i,o,l,a,s,u,c,f,d,g,p,m,_,b,w,C,A,$,E,S,k,y,M,I;return o=new js({}),s=new Bs({}),f=new zs({}),p=new Ls({props:{feedback:"Bad"}}),b=new Gs({}),A=new qs({}),M=new Hs({}),{c(){t=R("div"),n=R("div"),r=R("div"),i=R("div"),Z(o.$$.fragment),l=D(),a=R("div"),Z(s.$$.fragment),u=D(),c=R("div"),Z(f.$$.fragment),d=D(),g=R("div"),Z(p.$$.fragment),m=D(),_=R("div"),Z(b.$$.fragment),w=D(),C=R("div"),Z(A.$$.fragment),$=D(),E=R("div"),S=R("div"),S.innerHTML=`
-
`,k=D(),y=R("div"),Z(M.$$.fragment),h(i,"class","card-1 svelte-14znspc"),h(a,"class","card-2"),h(r,"class","left-text svelte-14znspc"),h(c,"class","left-confidence svelte-14znspc"),h(g,"class","left-question svelte-14znspc"),h(_,"class","left-filter svelte-14znspc"),h(C,"class","left-filter2"),h(n,"class","feedback-left svelte-14znspc"),h(S,"class","right-chart svelte-14znspc"),h(y,"class","right-table svelte-14znspc"),h(E,"class","feedback-right svelte-14znspc"),h(t,"class","feedback-container svelte-14znspc")},m(F,P){T(F,t,P),v(t,n),v(n,r),v(r,i),K(o,i,null),v(r,l),v(r,a),K(s,a,null),v(n,u),v(n,c),K(f,c,null),v(n,d),v(n,g),K(p,g,null),v(n,m),v(n,_),K(b,_,null),v(n,w),v(n,C),K(A,C,null),v(t,$),v(t,E),v(E,S),v(E,k),v(E,y),K(M,y,null),I=!0},p:H,i(F){I||(N(o.$$.fragment,F),N(s.$$.fragment,F),N(f.$$.fragment,F),N(p.$$.fragment,F),N(b.$$.fragment,F),N(A.$$.fragment,F),N(M.$$.fragment,F),I=!0)},o(F){V(o.$$.fragment,F),V(s.$$.fragment,F),V(f.$$.fragment,F),V(p.$$.fragment,F),V(b.$$.fragment,F),V(A.$$.fragment,F),V(M.$$.fragment,F),I=!1},d(F){F&&x(t),J(o),J(s),J(f),J(p),J(b),J(A),J(M)}}}function yg(e,t,n){let r;ee(e,pn,o=>n(0,r=o)),ut(()=>{i()});async function i(){const s=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map(u=>({id:u[0],question:u[1],answer:u[2],vote_status:u[3]}));Oe(pn,r=[...s],r)}return[]}class Us extends ie{constructor(t){super(),se(this,t,yg,wg,re,{})}}/**! - * Sortable 1.15.0 - * @author RubaXa - * @author owenm - * @license MIT - */function tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rt(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function kg(e,t){if(e==null)return{};var n=Cg(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var $g="1.15.0";function lt(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var ct=lt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Sn=lt(/Edge/i),nl=lt(/firefox/i),an=lt(/safari/i)&&!lt(/chrome/i)&&!lt(/android/i),Ws=lt(/iP(ad|od|hone)/i),Xs=lt(/chrome/i)&<(/android/i),Ys={capture:!1,passive:!1};function ne(e,t,n){e.addEventListener(t,n,!ct&&Ys)}function te(e,t,n){e.removeEventListener(t,n,!ct&&Ys)}function rr(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Rg(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Qe(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&rr(e,t):rr(e,t))||r&&e===n)return e;if(e===n)break}while(e=Rg(e))}return null}var rl=/\s+/g;function He(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(rl," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(rl," ")}}function q(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),r[t]=n+(typeof n=="string"?"":"px")}}function qt(e,t){var n="";if(typeof e=="string")n=e;else do{var r=q(e,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Qs(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,o=r.length;if(n)for(;i=o:l=i<=o,!l)return r;if(r===et())break;r=ht(r,!1)}return!1}function Ut(e,t,n,r){for(var i=0,o=0,l=e.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,o=kg(r,Pg);Cn.pluginEvent.bind(L)(t,n,rt({dragEl:O,parentEl:me,ghostEl:X,rootEl:fe,nextEl:St,lastDownEl:Hn,cloneEl:de,cloneHidden:dt,dragStarted:tn,putSortable:Ce,activeSortable:L.active,originalEvent:i,oldIndex:Ot,oldDraggableIndex:cn,newIndex:Le,newDraggableIndex:ft,hideGhostForTarget:ra,unhideGhostForTarget:ia,cloneNowHidden:function(){dt=!0},cloneNowShown:function(){dt=!1},dispatchSortableEvent:function(a){Fe({sortable:n,name:a,originalEvent:i})}},o))};function Fe(e){Ng(rt({putSortable:Ce,cloneEl:de,targetEl:O,rootEl:fe,oldIndex:Ot,oldDraggableIndex:cn,newIndex:Le,newDraggableIndex:ft},e))}var O,me,X,fe,St,Hn,de,dt,Ot,Le,cn,ft,Dn,Ce,xt=!1,ir=!1,or=[],wt,Be,Dr,Ir,ll,sl,tn,Nt,fn,dn=!1,In=!1,Ln,$e,Nr=[],ri=!1,lr=[],vr=typeof document<"u",Nn=Ws,al=Sn||ct?"cssFloat":"float",xg=vr&&!Xs&&!Ws&&"draggable"in document.createElement("div"),ea=function(){if(vr){if(ct)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),ta=function(t,n){var r=q(t),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),o=Ut(t,0,n),l=Ut(t,1,n),a=o&&q(o),s=l&&q(l),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+we(o).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+we(l).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&a.float!=="none"){var f=a.float==="left"?"left":"right";return l&&(s.clear==="both"||s.clear===f)?"vertical":"horizontal"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||u>=i&&r[al]==="none"||l&&r[al]==="none"&&u+c>i)?"vertical":"horizontal"},Tg=function(t,n,r){var i=r?t.left:t.top,o=r?t.right:t.bottom,l=r?t.width:t.height,a=r?n.left:n.top,s=r?n.right:n.bottom,u=r?n.width:n.height;return i===a||o===s||i+l/2===a+u/2},Og=function(t,n){var r;return or.some(function(i){var o=i[qe].options.emptyInsertThreshold;if(!(!o||ki(i))){var l=we(i),a=t>=l.left-o&&t<=l.right+o,s=n>=l.top-o&&n<=l.bottom+o;if(a&&s)return r=i}}),r},na=function(t){function n(o,l){return function(a,s,u,c){var f=a.options.group.name&&s.options.group.name&&a.options.group.name===s.options.group.name;if(o==null&&(l||f))return!0;if(o==null||o===!1)return!1;if(l&&o==="clone")return o;if(typeof o=="function")return n(o(a,s,u,c),l)(a,s,u,c);var d=(l?a:s).options.group.name;return o===!0||typeof o=="string"&&o===d||o.join&&o.indexOf(d)>-1}}var r={},i=t.group;(!i||zn(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=n(i.pull,!0),r.checkPut=n(i.put),r.revertClone=i.revertClone,t.group=r},ra=function(){!ea&&X&&q(X,"display","none")},ia=function(){!ea&&X&&q(X,"display","")};vr&&!Xs&&document.addEventListener("click",function(e){if(ir)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),ir=!1,!1},!0);var yt=function(t){if(O){t=t.touches?t.touches[0]:t;var n=Og(t.clientX,t.clientY);if(n){var r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]=t[i]);r.target=r.rootEl=n,r.preventDefault=void 0,r.stopPropagation=void 0,n[qe]._onDragOver(r)}}},Vg=function(t){O&&O.parentNode[qe]._isOutsideThisEl(t.target)};function L(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=at({},t),e[qe]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ta(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,a){l.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:L.supportPointer!==!1&&"PointerEvent"in window&&!an,emptyInsertThreshold:5};Cn.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);na(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:xg,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?ne(e,"pointerdown",this._onTapStart):(ne(e,"mousedown",this._onTapStart),ne(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(ne(e,"dragover",this),ne(e,"dragenter",this)),or.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),at(this,Fg())}L.prototype={constructor:L,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Nt=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,O):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,r=this.el,i=this.options,o=i.preventOnFilter,l=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,s=(a||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=i.filter;if(Ug(r),!O&&!(/mousedown|pointerdown/.test(l)&&t.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&an&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Qe(s,i.draggable,r,!1),!(s&&s.animated)&&Hn!==s)){if(Ot=Ge(s),cn=Ge(s,i.draggable),typeof c=="function"){if(c.call(this,t,s,this)){Fe({sortable:n,rootEl:u,name:"filter",targetEl:s,toEl:r,fromEl:r}),Ne("filter",n,{evt:t}),o&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(f){if(f=Qe(u,f.trim(),r,!1),f)return Fe({sortable:n,rootEl:f,name:"filter",targetEl:s,fromEl:r,toEl:r}),Ne("filter",n,{evt:t}),!0}),c)){o&&t.cancelable&&t.preventDefault();return}i.handle&&!Qe(u,i.handle,r,!1)||this._prepareDragStart(t,a,s)}}},_prepareDragStart:function(t,n,r){var i=this,o=i.el,l=i.options,a=o.ownerDocument,s;if(r&&!O&&r.parentNode===o){var u=we(r);if(fe=o,O=r,me=O.parentNode,St=O.nextSibling,Hn=r,Dn=l.group,L.dragged=O,wt={target:O,clientX:(n||t).clientX,clientY:(n||t).clientY},ll=wt.clientX-u.left,sl=wt.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,O.style["will-change"]="all",s=function(){if(Ne("delayEnded",i,{evt:t}),L.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!nl&&i.nativeDraggable&&(O.draggable=!0),i._triggerDragStart(t,n),Fe({sortable:i,name:"choose",originalEvent:t}),He(O,l.chosenClass,!0)},l.ignore.split(",").forEach(function(c){Qs(O,c.trim(),Pr)}),ne(a,"dragover",yt),ne(a,"mousemove",yt),ne(a,"touchmove",yt),ne(a,"mouseup",i._onDrop),ne(a,"touchend",i._onDrop),ne(a,"touchcancel",i._onDrop),nl&&this.nativeDraggable&&(this.options.touchStartThreshold=4,O.draggable=!0),Ne("delayStart",this,{evt:t}),l.delay&&(!l.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Sn||ct))){if(L.eventCanceled){this._onDrop();return}ne(a,"mouseup",i._disableDelayedDrag),ne(a,"touchend",i._disableDelayedDrag),ne(a,"touchcancel",i._disableDelayedDrag),ne(a,"mousemove",i._delayedDragTouchMoveHandler),ne(a,"touchmove",i._delayedDragTouchMoveHandler),l.supportPointer&&ne(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,l.delay)}else s()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){O&&Pr(O),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;te(t,"mouseup",this._disableDelayedDrag),te(t,"touchend",this._disableDelayedDrag),te(t,"touchcancel",this._disableDelayedDrag),te(t,"mousemove",this._delayedDragTouchMoveHandler),te(t,"touchmove",this._delayedDragTouchMoveHandler),te(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?ne(document,"pointermove",this._onTouchMove):n?ne(document,"touchmove",this._onTouchMove):ne(document,"mousemove",this._onTouchMove):(ne(O,"dragend",this),ne(fe,"dragstart",this._onDragStart));try{document.selection?qn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(xt=!1,fe&&O){Ne("dragStarted",this,{evt:n}),this.nativeDraggable&&ne(document,"dragover",Vg);var r=this.options;!t&&He(O,r.dragClass,!1),He(O,r.ghostClass,!0),L.active=this,t&&this._appendGhost(),Fe({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Be){this._lastX=Be.clientX,this._lastY=Be.clientY,ra();for(var t=document.elementFromPoint(Be.clientX,Be.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Be.clientX,Be.clientY),t!==n);)n=t;if(O.parentNode[qe]._isOutsideThisEl(t),n)do{if(n[qe]){var r=void 0;if(r=n[qe]._onDragOver({clientX:Be.clientX,clientY:Be.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);ia()}},_onTouchMove:function(t){if(wt){var n=this.options,r=n.fallbackTolerance,i=n.fallbackOffset,o=t.touches?t.touches[0]:t,l=X&&qt(X,!0),a=X&&l&&l.a,s=X&&l&&l.d,u=Nn&&$e&&ol($e),c=(o.clientX-wt.clientX+i.x)/(a||1)+(u?u[0]-Nr[0]:0)/(a||1),f=(o.clientY-wt.clientY+i.y)/(s||1)+(u?u[1]-Nr[1]:0)/(s||1);if(!L.active&&!xt){if(r&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(Fe({rootEl:me,name:"add",toEl:me,fromEl:fe,originalEvent:t}),Fe({sortable:this,name:"remove",toEl:me,originalEvent:t}),Fe({rootEl:me,name:"sort",toEl:me,fromEl:fe,originalEvent:t}),Fe({sortable:this,name:"sort",toEl:me,originalEvent:t})),Ce&&Ce.save()):Le!==Ot&&Le>=0&&(Fe({sortable:this,name:"update",toEl:me,originalEvent:t}),Fe({sortable:this,name:"sort",toEl:me,originalEvent:t})),L.active&&((Le==null||Le===-1)&&(Le=Ot,ft=cn),Fe({sortable:this,name:"end",toEl:me,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Ne("nulling",this),fe=O=me=X=St=de=Hn=dt=wt=Be=tn=Le=ft=Ot=cn=Nt=fn=Ce=Dn=L.dragged=L.ghost=L.clone=L.active=null,lr.forEach(function(t){t.checked=!0}),lr.length=Dr=Ir=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":O&&(this._onDragOver(t),zg(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,r=this.el.children,i=0,o=r.length,l=this.options;ir.right+i||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+i}function Gg(e,t,n,r,i,o,l,a){var s=r?e.clientY:e.clientX,u=r?n.height:n.width,c=r?n.top:n.left,f=r?n.bottom:n.right,d=!1;if(!l){if(a&&Lnc+u*o/2:sf-Ln)return-fn}else if(s>c+u*(1-i)/2&&sf-u*o/2)?s>c+u/2?1:-1:0}function jg(e){return Ge(O)k[24];for(let k=0;kE[21];for(let E=0;EQ & A Comparison Instructions -
-

Ask a question and rank the answers across the models. Drag each answer to - rank it, in ascending order, from left-to-right. Optionally, select the - rank for each via the corresponding dropdown.

-
- `,r=D(),i=R("div"),o=R("section"),l=R("div");for(let E=0;E{e.scrollIntoView({behavior:"smooth"})},0)}async function ml(e){console.log("run update",e);const n=await fetch("/chat/comparator/db/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:e})});if(n.ok)console.log("ok",n);else{const r=await n.text();alert(r)}}function Qg(e,t,n){let r,i,o;ee(e,kr,$=>n(7,o=$));let{numModels:l=1}=t,{models:a=[0]}=t,s="",u="",c=!1;ut(async()=>{if(await new Promise($=>setTimeout($,200)),g){const $=new L(g,{animation:150,onUpdate(E){$.toArray()}});$.toArray()}});const f=async $=>{$.preventDefault(),s=u,n(3,u=""),n(4,c=!0);let E={question:s};for(let k of a)E[k]="Loading...";Oe(kr,o=[...o,E],o);const S=await fetch(`/chat/comparator/${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:s})});if(S.ok){const k=await S.json();n(1,a=Object.keys(k.answer)),n(0,l=a.length);for(let y of a)E[y]=k.answer[y];E.qid=k.qid,kr.update(y=>(y[y.length-1]=E,y))}else{const k=await S.text();alert(k)}n(4,c=!1)};let d=0;setInterval(()=>{n(11,d=(d+1)%4)},200);let g,p;function m($,E){const S=E,y=st($.currentTarget.parentNode).selectAll("div.answer").nodes().map(P=>P.id);y.forEach((P,B)=>{st(`#${P}`).select(".answer-rank").property("value",B+1)});let M=[];for(let[P,B]of y.entries()){const ge=parseInt(B.split("-")[1]),oe=a[ge],Ee={rank:P,model:oe};M.push(Ee)}let I=o.filter(P=>P.qid===S),F=[];for(let P of M){const B={model:P.model,qid:parseInt(S),rank:parseInt(P.rank)+1,answer:I[0][P.model]};F.push(B)}ml(F)}function _($,E,S){const k=E,y=parseInt($.target.value),M=a[S],I={qid:k,rank:parseInt(y),model:M};let F=[],B=o.filter(oe=>oe.qid===I.qid)[0][I.model];const ge={model:I.model,qid:parseInt(I.qid),rank:parseInt(I.rank),answer:B};F.push(ge),ml(F)}const b=($,E,S)=>_(S,$.qid,E),w=($,E)=>m(E,$.qid);function C($){hn[$?"unshift":"push"](()=>{g=$,n(2,g)})}function A(){u=this.value,n(3,u)}return e.$$set=$=>{"numModels"in $&&n(0,l=$.numModels),"models"in $&&n(1,a=$.models)},e.$$.update=()=>{e.$$.dirty&1&&n(6,r="1fr ".repeat(l).trim()),e.$$.dirty&2048&&n(5,i=".".repeat(d).padEnd(3)),e.$$.dirty&4100&&g&&(n(12,p=new L(g,{animation:150,dataIdAttr:"id",onUpdate($){p.toArray()}})),p.toArray())},[l,a,g,u,c,i,r,o,f,m,_,d,p,b,w,C,A]}class Kg extends ie{constructor(t){super(),se(this,t,Qg,Xg,re,{numModels:0,models:1})}}function Jg(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return la(this.cover(t,n),t,n,e)}function la(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o=e._root,l={data:r},a=e._x0,s=e._y0,u=e._x1,c=e._y1,f,d,g,p,m,_,b,w;if(!o)return e._root=l,e;for(;o.length;)if((m=t>=(f=(a+u)/2))?a=f:u=f,(_=n>=(d=(s+c)/2))?s=d:c=d,i=o,!(o=o[b=_<<1|m]))return i[b]=l,e;if(g=+e._x.call(null,o.data),p=+e._y.call(null,o.data),t===g&&n===p)return l.next=o,i?i[b]=l:e._root=l,e;do i=i?i[b]=new Array(4):e._root=new Array(4),(m=t>=(f=(a+u)/2))?a=f:u=f,(_=n>=(d=(s+c)/2))?s=d:c=d;while((b=_<<1|m)===(w=(p>=d)<<1|g>=f));return i[w]=o,i[b]=l,e}function Zg(e){var t,n,r=e.length,i,o,l=new Array(r),a=new Array(r),s=1/0,u=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=i),of&&(f=o));if(s>c||u>f)return this;for(this.cover(s,u).cover(c,f),n=0;ne||e>=i||r>t||t>=o;)switch(u=(tc||(a=p.y0)>f||(s=p.x1)=b)<<1|e>=_)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-m],d[d.length-1-m]=p)}else{var w=e-+this._x.call(null,g.data),C=t-+this._y.call(null,g.data),A=w*w+C*C;if(A=(d=(l+s)/2))?l=d:s=d,(m=f>=(g=(a+u)/2))?a=g:u=g,t=n,!(n=n[_=m<<1|p]))return this;if(!n.length)break;(t[_+1&3]||t[_+2&3]||t[_+3&3])&&(r=t,b=_)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):t?(o?t[_]=o:delete t[_],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[b]=n:this._root=n),this):(this._root=o,this)}function oh(e){for(var t=0,n=e.length;td.index){var I=g-k.x-k.vx,F=p-k.y-k.vy,P=I*I+F*F;Pg+M||Ep+M||Su.r&&(u.r=u[c].r)}function s(){if(t){var u,c=t.length,f;for(n=new Array(c),u=0;u{}};function aa(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}jn.prototype=aa.prototype={constructor:jn,on:function(e,t){var n=this._,r=vh(e+"",n),i,o=-1,l=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r=0&&e._call.call(void 0,t),e=e._next;--Wt}function wl(){At=(ur=wn.now())+br,Wt=on=0;try{yh()}finally{Wt=0,Ch(),At=0}}function Sh(){var e=wn.now(),t=e-ur;t>ua&&(br-=t,ur=e)}function Ch(){for(var e,t=ar,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ar=n);ln=e,ai(r)}function ai(e){if(!Wt){on&&(on=clearTimeout(on));var t=e-At;t>24?(e<1/0&&(on=setTimeout(wl,e-wn.now()-br)),Jt&&(Jt=clearInterval(Jt))):(Jt||(ur=wn.now(),Jt=setInterval(Sh,ua)),Wt=1,ca(wl))}}const kh=1664525,$h=1013904223,yl=4294967296;function Rh(){let e=1;return()=>(e=(kh*e+$h)%yl)/yl}var Ah=10,Eh=Math.PI*(3-Math.sqrt(5));function Mh(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,l=.6,a=new Map,s=da(f),u=aa("tick","end"),c=Rh();e==null&&(e=[]);function f(){d(),u.call("tick",t),n1?(_==null?a.delete(m):a.set(m,p(_)),t):a.get(m)},find:function(m,_,b){var w=0,C=e.length,A,$,E,S,k;for(b==null?b=1/0:b*=b,w=0;w1?(u.on(m,_),t):u.on(m)}}}function Fh(e){var t=Je(.1),n,r,i;typeof e!="function"&&(e=Je(e==null?0:+e));function o(a){for(var s=0,u=n.length,c;se[4]?1:0),h(t,"class",g="file-circle-g "+(e[20].size>e[4]?"large":"")+" svelte-h2ab3o"),h(t,"style",p=e[5](e[20].x,e[20].y)),h(t,"role","img")},m(w,C){T(w,t,C),v(t,n),v(t,o),v(o,a),v(o,s),v(s,c),m=!0,_||(b=[j(t,"mouseover",e[6]),j(t,"mouseout",e[7]),j(t,"focus",e[6]),j(t,"blur",e[7])],_=!0)},p(w,C){(!m||C&12&&r!==(r=w[3](w[20].size)))&&h(n,"r",r),(!m||C&4)&&l!==(l=w[20].file+"")&&Q(a,l),(!m||C&4)&&u!==(u=Kr(w[20].size)+"")&&Q(c,u),(!m||C&20&&f!==(f=w[20].size>w[4]?1:0))&&h(o,"opacity",f),(!m||C&20&&g!==(g="file-circle-g "+(w[20].size>w[4]?"large":"")+" svelte-h2ab3o"))&&h(t,"class",g),(!m||C&4&&p!==(p=w[5](w[20].x,w[20].y)))&&h(t,"style",p)},i(w){m||(w&&Se(()=>{m&&(i||(i=Ke(n,Rn,{duration:1e3},!0)),i.run(1))}),w&&Se(()=>{m&&(d||(d=Ke(o,Rn,{duration:1e3},!0)),d.run(1))}),m=!0)},o(w){w&&(i||(i=Ke(n,Rn,{duration:1e3},!1)),i.run(0)),w&&(d||(d=Ke(o,Rn,{duration:1e3},!1)),d.run(0)),m=!1},d(w){w&&x(t),w&&i&&i.end(),w&&d&&d.end(),_=!1,_e(b)}}}function Ih(e){let t,n,r,i,o=e[2],l=[];for(let s=0;sV(l[s],1,1,()=>{l[s]=null});return{c(){t=R("div"),n=U("svg");for(let s=0;se[15].call(t))},m(s,u){T(s,t,u),v(t,n);for(let c=0;cn(14,c=$));let f=600,d=350,g=!0,p=!1;const m=($,E)=>`transform: translate(${$}px, ${E}px)`,_=[-4,4],b=[-1,1];function w(){n(8,g=!0),n(9,p=!0);const $=st(this);$r(".file-circle-g").select("text").style("opacity",0),$.raise(),$.select("circle").attr("fill","var(--red)"),$.select("text").style("opacity",1)}const C=()=>{const $=$r(".file-circle-g");$.select("circle").attr("fill","var(--yellow)"),$.select("text").style("opacity",0),n(9,p=!1),setTimeout(()=>{n(8,g=!1)},1e3)};function A(){f=this.offsetWidth,d=this.offsetHeight,n(0,f),n(1,d)}return e.$$.update=()=>{e.$$.dirty&16387&&n(2,r=c.map($=>({...$,x:f/2,y:d/2,tickCount:0}))),e.$$.dirty&16384&&console.log(c.map($=>$.size).sort(($,E)=>$-E)),e.$$.dirty&1&&n(13,i=Fh().x(f/2)),e.$$.dirty&2&&n(12,o=Dh().y(d/2)),e.$$.dirty&16384&&n(3,s=We().domain(sn(c,$=>$.size)).range([12,60])),e.$$.dirty&8&&n(10,l=mh().radius($=>s($.size)+1).iterations(3)),e.$$.dirty&16384&&n(4,a=id(c.map($=>$.size).sort(($,E)=>$-E),.85)),e.$$.dirty&1&&We().domain(_).range([5,f]),e.$$.dirty&2&&We().domain(b).range([d,5]),e.$$.dirty&4&&n(11,u=Mh().nodes(r).on("tick",()=>{n(2,r=[...r])})),e.$$.dirty&15360&&(u.force("x",i),u.force("y",o),u.force("collide",l),u.alpha(.02),u.restart()),e.$$.dirty&19468&&(s.domain(sn(c,$=>$.size)),r.forEach($=>$.radius=s($.size)),u.nodes(r),l.radius($=>$.radius+.5)),e.$$.dirty&768&&g===!1&&(p||$r(".large").select("text").style("opacity",1))},[f,d,r,s,a,m,w,C,g,p,l,u,o,i,c,A]}class Ph extends ie{constructor(t){super(),se(this,t,Nh,Ih,re,{})}}/** - * table-core - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function pt(e,t){return typeof e=="function"?e(t):e}function je(e,t){return n=>{t.setState(r=>({...r,[e]:pt(n,r[e])}))}}function fr(e){return e instanceof Function}function xh(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Th(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const l=t(o);l!=null&&l.length&&r(l)})};return r(e),n}function G(e,t,n){let r=[],i;return()=>{let o;n.key&&n.debug&&(o=Date.now());const l=e();if(!(l.length!==r.length||l.some((u,c)=>r[c]!==u)))return i;r=l;let s;if(n.key&&n.debug&&(s=Date.now()),i=t(...l),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-o)*100)/100,c=Math.round((Date.now()-s)*100)/100,f=c/16,d=(g,p)=>{for(g=String(g);g.length{let g=d;for(const m of s.split(".")){var p;g=(p=g)==null?void 0:p[m]}return g}:c=d=>d[a.accessorKey]),!u)throw new Error;let f={id:`${String(u)}`,accessorFn:c,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:G(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(g=>g.getFlatColumns())]},{key:"column.getFlatColumns",debug:()=>{var d;return(d=e.options.debugAll)!=null?d:e.options.debugColumns}}),getLeafColumns:G(()=>[e._getOrderColumnsFn()],d=>{var g;if((g=f.columns)!=null&&g.length){let p=f.columns.flatMap(m=>m.getLeafColumns());return d(p)}return[f]},{key:"column.getLeafColumns",debug:()=>{var d;return(d=e.options.debugAll)!=null?d:e.options.debugColumns}})};return f=e._features.reduce((d,g)=>Object.assign(d,g.createColumn==null?void 0:g.createColumn(f,e)),f),f}function $l(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const l=[],a=s=>{s.subHeaders&&s.subHeaders.length&&s.subHeaders.map(a),l.push(s)};return a(o),l},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(l=>{Object.assign(o,l.createHeader==null?void 0:l.createHeader(o,e))}),o}const Vh={createTable:e=>({getHeaderGroups:G(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,l;const a=(o=r==null?void 0:r.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?o:[],s=(l=i==null?void 0:i.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?l:[],u=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(i!=null&&i.includes(f.id)));return xn(t,[...a,...u,...s],e)},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterHeaderGroups:G(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),xn(t,n,e,"center")),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftHeaderGroups:G(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?i:[];return xn(t,o,e,"left")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightHeaderGroups:G(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?i:[];return xn(t,o,e,"right")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFooterGroups:G(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFooterGroups:G(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFooterGroups:G(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFooterGroups:G(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFlatHeaders:G(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFlatHeaders:G(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFlatHeaders:G(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFlatHeaders:G(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterLeafHeaders:G(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftLeafHeaders:G(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightLeafHeaders:G(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeafHeaders:G(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,l,a,s,u;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(l=(a=n[0])==null?void 0:a.headers)!=null?l:[],...(s=(u=r[0])==null?void 0:u.headers)!=null?s:[]].map(c=>c.getLeafHeaders()).flat()},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})})};function xn(e,t,n,r){var i,o;let l=0;const a=function(d,g){g===void 0&&(g=1),l=Math.max(l,g),d.filter(p=>p.getIsVisible()).forEach(p=>{var m;(m=p.columns)!=null&&m.length&&a(p.columns,g+1)},0)};a(e);let s=[];const u=(d,g)=>{const p={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},m=[];d.forEach(_=>{const b=[...m].reverse()[0],w=_.column.depth===p.depth;let C,A=!1;if(w&&_.column.parent?C=_.column.parent:(C=_.column,A=!0),b&&(b==null?void 0:b.column)===C)b.subHeaders.push(_);else{const $=$l(n,C,{id:[r,g,C.id,_==null?void 0:_.id].filter(Boolean).join("_"),isPlaceholder:A,placeholderId:A?`${m.filter(E=>E.column===C).length}`:void 0,depth:g,index:m.length});$.subHeaders.push(_),m.push($)}p.headers.push(_),_.headerGroup=p}),s.push(p),g>0&&u(m,g-1)},c=t.map((d,g)=>$l(n,d,{depth:l,index:g}));u(c,l-1),s.reverse();const f=d=>d.filter(p=>p.column.getIsVisible()).map(p=>{let m=0,_=0,b=[0];p.subHeaders&&p.subHeaders.length?(b=[],f(p.subHeaders).forEach(C=>{let{colSpan:A,rowSpan:$}=C;m+=A,b.push($)})):m=1;const w=Math.min(...b);return _=_+w,p.colSpan=m,p.rowSpan=_,{colSpan:m,rowSpan:_}});return f((i=(o=s[0])==null?void 0:o.headers)!=null?i:[]),s}const Tn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Vr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),zh={getDefaultColumnDef:()=>Tn,getInitialState:e=>({columnSizing:{},columnSizingInfo:Vr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:je("columnSizing",e),onColumnSizingInfoChange:je("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Tn.minSize,(r=o??e.columnDef.size)!=null?r:Tn.size),(i=e.columnDef.maxSize)!=null?i:Tn.maxSize)},getStart:n=>{const r=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),i=r.findIndex(o=>o.id===e.id);if(i>0){const o=r[i-1];return o.getStart(n)+o.getSize()}return 0},resetSize:()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},getCanResize:()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},getIsResizing:()=>t.getState().columnSizingInfo.isResizingColumn===e.id}),createHeader:(e,t)=>({getSize:()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(e),n},getStart:()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},getResizeHandler:()=>{const n=t.getColumn(e.column.id),r=n==null?void 0:n.getCanResize();return i=>{if(!n||!r||(i.persist==null||i.persist(),zr(i)&&i.touches&&i.touches.length>1))return;const o=e.getSize(),l=e?e.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[n.id,n.getSize()]],a=zr(i)?Math.round(i.touches[0].clientX):i.clientX,s={},u=(m,_)=>{typeof _=="number"&&(t.setColumnSizingInfo(b=>{var w,C;const A=_-((w=b==null?void 0:b.startOffset)!=null?w:0),$=Math.max(A/((C=b==null?void 0:b.startSize)!=null?C:0),-.999999);return b.columnSizingStart.forEach(E=>{let[S,k]=E;s[S]=Math.round(Math.max(k+k*$,0)*100)/100}),{...b,deltaOffset:A,deltaPercentage:$}}),(t.options.columnResizeMode==="onChange"||m==="end")&&t.setColumnSizing(b=>({...b,...s})))},c=m=>u("move",m),f=m=>{u("end",m),t.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d={moveHandler:m=>c(m.clientX),upHandler:m=>{document.removeEventListener("mousemove",d.moveHandler),document.removeEventListener("mouseup",d.upHandler),f(m.clientX)}},g={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),c(m.touches[0].clientX),!1),upHandler:m=>{var _;document.removeEventListener("touchmove",g.moveHandler),document.removeEventListener("touchend",g.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),f((_=m.touches[0])==null?void 0:_.clientX)}},p=Hh()?{passive:!1}:!1;zr(i)?(document.addEventListener("touchmove",g.moveHandler,p),document.addEventListener("touchend",g.upHandler,p)):(document.addEventListener("mousemove",d.moveHandler,p),document.addEventListener("mouseup",d.upHandler,p)),t.setColumnSizingInfo(m=>({...m,startOffset:a,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:n.id}))}}}),createTable:e=>({setColumnSizing:t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),setColumnSizingInfo:t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),resetColumnSizing:t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},resetHeaderSizeInfo:t=>{var n;e.setColumnSizingInfo(t?Vr():(n=e.initialState.columnSizingInfo)!=null?n:Vr())},getTotalSize:()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},getLeftTotalSize:()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},getCenterTotalSize:()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},getRightTotalSize:()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}})};let On=null;function Hh(){if(typeof On=="boolean")return On;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return On=e,On}function zr(e){return e.type==="touchstart"}const Lh={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:je("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},setExpanded:r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),toggleAllRowsExpanded:r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},resetExpanded:r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},getCanSomeRowsExpand:()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),getToggleAllRowsExpandedHandler:()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},getIsSomeRowsExpanded:()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},getIsAllRowsExpanded:()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},getExpandedDepth:()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const l=o.split(".");r=Math.max(r,l.length)}),r},getPreExpandedRowModel:()=>e.getSortedRowModel(),getExpandedRowModel:()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())}},createRow:(e,t)=>({toggleExpanded:n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let l={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{l[a]=!0}):l=r,n=(i=n)!=null?i:!o,!o&&n)return{...l,[e.id]:!0};if(o&&!n){const{[e.id]:a,...s}=l;return s}return r})},getIsExpanded:()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},getCanExpand:()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},getToggleExpandedHandler:()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}})},ga=(e,t,n)=>{var r,i,o;const l=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(i=r.toString())==null||(o=i.toLowerCase())==null)&&o.includes(l))};ga.autoRemove=e=>Xe(e);const ha=(e,t,n)=>{var r,i;return!!(!((r=e.getValue(t))==null||(i=r.toString())==null)&&i.includes(n))};ha.autoRemove=e=>Xe(e);const pa=(e,t,n)=>{var r,i;return((r=e.getValue(t))==null||(i=r.toString())==null?void 0:i.toLowerCase())===(n==null?void 0:n.toLowerCase())};pa.autoRemove=e=>Xe(e);const ma=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};ma.autoRemove=e=>Xe(e)||!(e!=null&&e.length);const _a=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});_a.autoRemove=e=>Xe(e)||!(e!=null&&e.length);const va=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});va.autoRemove=e=>Xe(e)||!(e!=null&&e.length);const ba=(e,t,n)=>e.getValue(t)===n;ba.autoRemove=e=>Xe(e);const wa=(e,t,n)=>e.getValue(t)==n;wa.autoRemove=e=>Xe(e);const Ei=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};Ei.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,l=n===null||Number.isNaN(i)?1/0:i;if(o>l){const a=o;o=l,l=a}return[o,l]};Ei.autoRemove=e=>Xe(e)||Xe(e[0])&&Xe(e[1]);const it={includesString:ga,includesStringSensitive:ha,equalsString:pa,arrIncludes:ma,arrIncludesAll:_a,arrIncludesSome:va,equals:ba,weakEquals:wa,inNumberRange:Ei};function Xe(e){return e==null||e===""}const qh={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:je("columnFilters",e),onGlobalFilterChange:je("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,r;const i=(n=e.getCoreRowModel().flatRows[0])==null||(r=n._getAllCellsByColumnId()[t.id])==null?void 0:r.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(e,t)=>({getAutoFilterFn:()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?it.includesString:typeof r=="number"?it.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?it.equals:Array.isArray(r)?it.arrIncludes:it.weakEquals},getFilterFn:()=>{var n,r;return fr(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:it[e.columnDef.filterFn]},getCanFilter:()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},getCanGlobalFilter:()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var n,r;return(n=t.getState().columnFilters)==null||(r=n.find(i=>i.id===e.id))==null?void 0:r.value},getFilterIndex:()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},setFilterValue:n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r==null?void 0:r.find(c=>c.id===e.id),l=pt(n,o?o.value:void 0);if(Rl(i,l,e)){var a;return(a=r==null?void 0:r.filter(c=>c.id!==e.id))!=null?a:[]}const s={id:e.id,value:l};if(o){var u;return(u=r==null?void 0:r.map(c=>c.id===e.id?s:c))!=null?u:[]}return r!=null&&r.length?[...r,s]:[s]})},_getFacetedRowModel:t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),getFacetedRowModel:()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),_getFacetedUniqueValues:t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),getFacetedUniqueValues:()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,_getFacetedMinMaxValues:t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),getFacetedMinMaxValues:()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}),createRow:(e,t)=>({columnFilters:{},columnFiltersMeta:{}}),createTable:e=>({getGlobalAutoFilterFn:()=>it.includesString,getGlobalFilterFn:()=>{var t,n;const{globalFilterFn:r}=e.options;return fr(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:it[r]},setColumnFilters:t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=pt(t,i))==null?void 0:o.filter(l=>{const a=n.find(s=>s.id===l.id);if(a){const s=a.getFilterFn();if(Rl(s,l.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},setGlobalFilter:t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},resetGlobalFilter:t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},resetColumnFilters:t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},getPreFilteredRowModel:()=>e.getCoreRowModel(),getFilteredRowModel:()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),_getGlobalFacetedRowModel:e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),getGlobalFacetedRowModel:()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),_getGlobalFacetedUniqueValues:e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),getGlobalFacetedUniqueValues:()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,_getGlobalFacetedMinMaxValues:e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),getGlobalFacetedMinMaxValues:()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}})};function Rl(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Gh=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),jh=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},Bh=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r=o)&&(r=o)}),r},Uh=(e,t,n)=>{let r,i;return n.forEach(o=>{const l=o.getValue(e);l!=null&&(r===void 0?l>=l&&(r=i=l):(r>l&&(r=l),i{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},Xh=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!xh(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,l)=>o-l);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},Yh=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Qh=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Kh=(e,t)=>t.length,Hr={sum:Gh,min:jh,max:Bh,extent:Uh,mean:Wh,median:Xh,unique:Yh,uniqueCount:Qh,count:Kh},Jh={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:je("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>({toggleGrouping:()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},getCanGroup:()=>{var n,r,i,o;return(n=(r=(i=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?i:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},getIsGrouped:()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},getGroupedIndex:()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},getToggleGroupingHandler:()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},getAutoAggregationFn:()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Hr.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Hr.extent},getAggregationFn:()=>{var n,r;if(!e)throw new Error;return fr(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Hr[e.columnDef.aggregationFn]}}),createTable:e=>({setGrouping:t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),resetGrouping:t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},getPreGroupedRowModel:()=>e.getFilteredRowModel(),getGroupedRowModel:()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())}),createRow:(e,t)=>({getIsGrouped:()=>!!e.groupingColumnId,getGroupingValue:n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},_groupingValuesCache:{}}),createCell:(e,t,n,r)=>({getIsGrouped:()=>t.getIsGrouped()&&t.id===n.groupingColumnId,getIsPlaceholder:()=>!e.getIsGrouped()&&t.getIsGrouped(),getIsAggregated:()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}})};function Zh(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(l=>l.id===o)).filter(Boolean),...r]}const ep={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:je("columnOrder",e)}),createTable:e=>({setColumnOrder:t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),resetColumnOrder:t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},_getOrderColumnsFn:G(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const l=[...t],a=[...i];for(;a.length&&l.length;){const s=l.shift(),u=a.findIndex(c=>c.id===s);u>-1&&o.push(a.splice(u,1)[0])}o=[...o,...a]}return Zh(o,n,r)},{key:!1})})},ui=0,ci=10,Lr=()=>({pageIndex:ui,pageSize:ci}),tp={getInitialState:e=>({...e,pagination:{...Lr(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:je("pagination",e)}),createTable:e=>{let t=!1,n=!1;return{_autoResetPageIndex:()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},setPagination:r=>{const i=o=>pt(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},resetPagination:r=>{var i;e.setPagination(r?Lr():(i=e.initialState.pagination)!=null?i:Lr())},setPageIndex:r=>{e.setPagination(i=>{let o=pt(r,i.pageIndex);const l=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,l)),{...i,pageIndex:o}})},resetPageIndex:r=>{var i,o,l;e.setPageIndex(r?ui:(i=(o=e.initialState)==null||(l=o.pagination)==null?void 0:l.pageIndex)!=null?i:ui)},resetPageSize:r=>{var i,o,l;e.setPageSize(r?ci:(i=(o=e.initialState)==null||(l=o.pagination)==null?void 0:l.pageSize)!=null?i:ci)},setPageSize:r=>{e.setPagination(i=>{const o=Math.max(1,pt(r,i.pageSize)),l=i.pageSize*i.pageIndex,a=Math.floor(l/o);return{...i,pageIndex:a,pageSize:o}})},setPageCount:r=>e.setPagination(i=>{var o;let l=pt(r,(o=e.options.pageCount)!=null?o:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...i,pageCount:l}}),getPageOptions:G(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,l)=>l)),i},{key:!1,debug:()=>{var r;return(r=e.options.debugAll)!=null?r:e.options.debugTable}}),getCanPreviousPage:()=>e.getState().pagination.pageIndex>0,getCanNextPage:()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:re.setPageIndex(r=>r-1),nextPage:()=>e.setPageIndex(r=>r+1),getPrePaginationRowModel:()=>e.getExpandedRowModel(),getPaginationRowModel:()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),getPageCount:()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}}},qr=()=>({left:[],right:[]}),np={getInitialState:e=>({columnPinning:qr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:je("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,l;if(n==="right"){var a,s;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((s=i==null?void 0:i.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var u,c;return{left:[...((u=i==null?void 0:i.left)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((c=i==null?void 0:i.right)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((o=i==null?void 0:i.left)!=null?o:[]).filter(f=>!(r!=null&&r.includes(f))),right:((l=i==null?void 0:i.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f)))}})},getCanPin:()=>e.getLeafColumns().some(r=>{var i,o;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=t.options.enablePinning)!=null?o:!0)}),getIsPinned:()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(a=>r==null?void 0:r.includes(a)),l=n.some(a=>i==null?void 0:i.includes(a));return o?"left":l?"right":!1},getPinnedIndex:()=>{var n,r,i;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(i=r[o])==null?void 0:i.indexOf(e.id))!=null?n:-1:0}}),createRow:(e,t)=>({getCenterVisibleCells:G(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(l=>!o.includes(l.column.id))},{key:"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getLeftVisibleCells:G(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,r)=>(r??[]).map(o=>n.find(l=>l.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),{key:"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getRightVisibleCells:G(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(l=>l.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),{key:"row.getRightVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>({setColumnPinning:t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),resetColumnPinning:t=>{var n,r;return e.setColumnPinning(t?qr():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:qr())},getIsSomeColumnsPinned:t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},getLeftLeafColumns:G(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getRightLeafColumns:G(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getCenterLeafColumns:G(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}})})},rp={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:je("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>({setRowSelection:t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),resetRowSelection:t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},toggleAllRowsSelected:t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},toggleAllPageRowsSelected:t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{fi(i,o.id,r,e)}),i}),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:G(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Gr(e,n):{rows:[],flatRows:[],rowsById:{}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getFilteredSelectedRowModel:G(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Gr(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getGroupedSelectedRowModel:G(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Gr(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getIsAllRowsSelected:()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},getIsSomeRowsSelected:()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},getToggleAllRowsSelectedHandler:()=>t=>{e.toggleAllRowsSelected(t.target.checked)},getToggleAllPageRowsSelectedHandler:()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}}),createRow:(e,t)=>({toggleSelected:n=>{const r=e.getIsSelected();t.setRowSelection(i=>{if(n=typeof n<"u"?n:!r,r===n)return i;const o={...i};return fi(o,e.id,n,t),o})},getIsSelected:()=>{const{rowSelection:n}=t.getState();return Mi(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return Al(e,n)==="some"},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return Al(e,n)==="all"},getCanSelect:()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},getCanSelectSubRows:()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},getCanMultiSelect:()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},getToggleSelectedHandler:()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}})},fi=(e,t,n,r)=>{var i;const o=r.getRow(t);n?(o.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),o.getCanSelect()&&(e[t]=!0)):delete e[t],(i=o.subRows)!=null&&i.length&&o.getCanSelectSubRows()&&o.subRows.forEach(l=>fi(e,l.id,n,r))};function Gr(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(l,a){return l.map(s=>{var u;const c=Mi(s,n);if(c&&(r.push(s),i[s.id]=s),(u=s.subRows)!=null&&u.length&&(s={...s,subRows:o(s.subRows)}),c)return s}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function Mi(e,t){var n;return(n=t[e.id])!=null?n:!1}function Al(e,t,n){if(e.subRows&&e.subRows.length){let r=!0,i=!1;return e.subRows.forEach(o=>{i&&!r||(Mi(o,t)?i=!0:r=!1)}),r?"all":i?"some":!1}return!1}const di=/([0-9]+)/gm,ip=(e,t,n)=>ya(_t(e.getValue(n)).toLowerCase(),_t(t.getValue(n)).toLowerCase()),op=(e,t,n)=>ya(_t(e.getValue(n)),_t(t.getValue(n))),lp=(e,t,n)=>Fi(_t(e.getValue(n)).toLowerCase(),_t(t.getValue(n)).toLowerCase()),sp=(e,t,n)=>Fi(_t(e.getValue(n)),_t(t.getValue(n))),ap=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:rFi(e.getValue(n),t.getValue(n));function Fi(e,t){return e===t?0:e>t?1:-1}function _t(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function ya(e,t){const n=e.split(di).filter(Boolean),r=t.split(di).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),l=parseInt(i,10),a=parseInt(o,10),s=[l,a].sort();if(isNaN(s[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(s[1]))return isNaN(l)?-1:1;if(l>a)return 1;if(a>l)return-1}return n.length-r.length}const Zt={alphanumeric:ip,alphanumericCaseSensitive:op,text:lp,textCaseSensitive:sp,datetime:ap,basic:up},cp={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:je("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i==null?void 0:i.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Zt.datetime;if(typeof o=="string"&&(r=!0,o.split(di).length>1))return Zt.alphanumeric}return r?Zt.text:Zt.basic},getAutoSortDir:()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},getSortingFn:()=>{var n,r;if(!e)throw new Error;return fr(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Zt[e.columnDef.sortingFn]},toggleSorting:(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(l=>{const a=l==null?void 0:l.find(g=>g.id===e.id),s=l==null?void 0:l.findIndex(g=>g.id===e.id);let u=[],c,f=o?n:i==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&r?a?c="toggle":c="add":l!=null&&l.length&&s!==l.length-1?c="replace":a?c="toggle":c="replace",c==="toggle"&&(o||i||(c="remove")),c==="add"){var d;u=[...l,{id:e.id,desc:f}],u.splice(0,u.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else c==="toggle"?u=l.map(g=>g.id===e.id?{...g,desc:f}:g):c==="remove"?u=l.filter(g=>g.id!==e.id):u=[{id:e.id,desc:f}];return u})},getFirstSortDir:()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},getNextSortingOrder:n=>{var r,i;const o=e.getFirstSortDir(),l=e.getIsSorted();return l?l!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:l==="desc"?"asc":"desc":o},getCanSort:()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},getCanMultiSort:()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},getIsSorted:()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},getSortIndex:()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},clearSorting:()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},getToggleSortingHandler:()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}}),createTable:e=>({setSorting:t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),resetSorting:t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},getPreSortedRowModel:()=>e.getGroupedRowModel(),getSortedRowModel:()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())})},fp={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:je("columnVisibility",e)}),createColumn:(e,t)=>({toggleVisibility:n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},getIsVisible:()=>{var n,r;return(n=(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},getCanHide:()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},getToggleVisibilityHandler:()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}}),createRow:(e,t)=>({_getAllVisibleCells:G(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),{key:"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getVisibleCells:G(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>{const t=(n,r)=>G(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),{key:n,debug:()=>{var i;return(i=e.options.debugAll)!=null?i:e.options.debugColumns}});return{getVisibleFlatColumns:t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),getVisibleLeafColumns:t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),getLeftVisibleLeafColumns:t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),getRightVisibleLeafColumns:t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),getCenterVisibleLeafColumns:t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),setColumnVisibility:n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),resetColumnVisibility:n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},toggleAllColumnsVisible:n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},getIsAllColumnsVisible:()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),getIsSomeColumnsVisible:()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),getToggleAllColumnsVisibilityHandler:()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}}},El=[Vh,fp,ep,np,qh,cp,Jh,Lh,tp,rp,zh];function dp(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:El};const r=n._features.reduce((c,f)=>Object.assign(c,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),i=c=>n.options.mergeOptions?n.options.mergeOptions(r,c):{...r,...c};let l={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(c=>{var f;l=(f=c.getInitialState==null?void 0:c.getInitialState(l))!=null?f:l});const a=[];let s=!1;const u={_features:El,options:{...r,...e},initialState:l,_queue:c=>{a.push(c),s||(s=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();s=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:c=>{const f=pt(c,n.options);n.options=i(f)},getState:()=>n.options.state,setState:c=>{n.options.onStateChange==null||n.options.onStateChange(c)},_getRowId:(c,f,d)=>{var g;return(g=n.options.getRowId==null?void 0:n.options.getRowId(c,f,d))!=null?g:`${d?[d.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:c=>{const f=n.getRowModel().rowsById[c];if(!f)throw new Error;return f},_getDefaultColumnDef:G(()=>[n.options.defaultColumn],c=>{var f;return c=(f=c)!=null?f:{},{header:d=>{const g=d.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:d=>{var g,p;return(g=(p=d.renderValue())==null||p.toString==null?void 0:p.toString())!=null?g:null},...n._features.reduce((d,g)=>Object.assign(d,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...c}},{debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns},key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:G(()=>[n._getColumnDefs()],c=>{const f=function(d,g,p){return p===void 0&&(p=0),d.map(m=>{const _=Oh(n,m,p,g),b=m;return _.columns=b.columns?f(b.columns,_,p+1):[],_})};return f(c)},{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getAllFlatColumns:G(()=>[n.getAllColumns()],c=>c.flatMap(f=>f.getFlatColumns()),{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),_getAllFlatColumnsById:G(()=>[n.getAllFlatColumns()],c=>c.reduce((f,d)=>(f[d.id]=d,f),{}),{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getAllLeafColumns:G(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(c,f)=>{let d=c.flatMap(g=>g.getLeafColumns());return f(d)},{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getColumn:c=>n._getAllFlatColumnsById()[c]};return Object.assign(n,u),n._features.forEach(c=>Object.assign(n,c.createTable==null?void 0:c.createTable(n))),n}function gp(e,t,n,r){const i=()=>{var l;return(l=o.getValue())!=null?l:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:G(()=>[e,n,t,o],(l,a,s,u)=>({table:l,column:a,row:s,cell:u,getValue:u.getValue,renderValue:u.renderValue}),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach(l=>{Object.assign(o,l.createCell==null?void 0:l.createCell(o,n,t,e))},{}),o}const Di=(e,t,n,r,i,o,l)=>{let a={id:t,index:r,original:n,depth:i,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:s=>{if(a._valuesCache.hasOwnProperty(s))return a._valuesCache[s];const u=e.getColumn(s);if(u!=null&&u.accessorFn)return a._valuesCache[s]=u.accessorFn(a.original,r),a._valuesCache[s]},getUniqueValues:s=>{if(a._uniqueValuesCache.hasOwnProperty(s))return a._uniqueValuesCache[s];const u=e.getColumn(s);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[s]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[s]):(a._uniqueValuesCache[s]=[a.getValue(s)],a._uniqueValuesCache[s])},renderValue:s=>{var u;return(u=a.getValue(s))!=null?u:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>Th(a.subRows,s=>s.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId):void 0,getParentRows:()=>{let s=[],u=a;for(;;){const c=u.getParentRow();if(!c)break;s.push(c),u=c}return s.reverse()},getAllCells:G(()=>[e.getAllLeafColumns()],s=>s.map(u=>gp(e,a,u,u.id)),{key:!1,debug:()=>{var s;return(s=e.options.debugAll)!=null?s:e.options.debugRows}}),_getAllCellsByColumnId:G(()=>[a.getAllCells()],s=>s.reduce((u,c)=>(u[c.column.id]=c,u),{}),{key:"row.getAllCellsByColumnId",debug:()=>{var s;return(s=e.options.debugAll)!=null?s:e.options.debugRows}})};for(let s=0;stypeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function Ml(){return e=>G(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,l){o===void 0&&(o=0);const a=[];for(let u=0;u{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Sa(e,t,n){return n.options.filterFromLeafRows?pp(e,t,n):mp(e,t,n)}function pp(e,t,n){var r;const i=[],o={},l=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(s,u){u===void 0&&(u=0);const c=[];for(let d=0;dG(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let d=0;d{var g;const p=e.getColumn(d.id);if(!p)return;const m=p.getFilterFn();m&&i.push({id:d.id,filterFn:m,resolvedValue:(g=m.resolveFilterValue==null?void 0:m.resolveFilterValue(d.value))!=null?g:d.value})});const l=n.map(d=>d.id),a=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter(d=>d.getCanGlobalFilter());r&&a&&s.length&&(l.push("__global__"),s.forEach(d=>{var g;o.push({id:d.id,filterFn:a,resolvedValue:(g=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?g:r})}));let u,c;for(let d=0;d{g.columnFiltersMeta[m]=_})}if(o.length){for(let p=0;p{g.columnFiltersMeta[m]=_})){g.columnFilters.__global__=!0;break}}g.columnFilters.__global__!==!0&&(g.columnFilters.__global__=!1)}}const f=d=>{for(let g=0;g{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Dl(){return(e,t)=>G(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,i)=>{if(!n.rows.length||!(r!=null&&r.length)&&!i)return n;const o=[...r.map(a=>a.id).filter(a=>a!==t),i?"__global__":void 0].filter(Boolean),l=a=>{for(let s=0;s{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable},onChange:()=>{}})}function Il(){return e=>G(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(s=>{var u;return(u=e.getColumn(s.id))==null?void 0:u.getCanSort()}),l={};o.forEach(s=>{const u=e.getColumn(s.id);u&&(l[s.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=s=>{const u=[...s];return u.sort((c,f)=>{for(let g=0;g{var f;i.push(c),(f=c.subRows)!=null&&f.length&&(c.subRows=a(c.subRows))}),u};return{rows:a(n.rows),flatRows:i,rowsById:n.rowsById}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function _p(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Nl(e){return t=>G(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:l,flatRows:a,rowsById:s}=r;const u=i*o,c=u+i;l=l.slice(u,c);let f;t.options.paginateExpandedRows?f={rows:l,flatRows:a,rowsById:s}:f=_p({rows:l,flatRows:a,rowsById:s}),f.flatRows=[];const d=g=>{f.flatRows.push(g),g.subRows.length&&g.subRows.forEach(d)};return f.rows.forEach(d),f},{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/** - * svelte-table - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function vp(e){let t;return{c(){t=z(e[0])},l(n){t=za(n,e[0])},m(n,r){xa(n,t,r)},p(n,[r]){r&1&&Q(t,n[0])},i:H,o:H,d(n){n&&x(t)}}}function bp(e,t,n){let{content:r}=t;return e.$$set=i=>{"content"in i&&n(0,r=i.content)},[r]}class wp extends ie{constructor(t){super(),se(this,t,bp,vp,re,{content:0})}}const yp=gs((e,t,n,r)=>`${tu(t.content)}`);var Sp=typeof document>"u"?yp:wp;function Cp(e,t,n){let r,i;return r=new t({props:n,$$inline:!0}),{c(){Z(r.$$.fragment)},l(o){ru(r.$$.fragment,o)},m(o,l){K(r,o,l),i=!0},p:H,i(o){i||(N(r.$$.fragment,o),i=!0)},o(o){V(r.$$.fragment,o),i=!1},d(o){J(r,o)}}}function kp(e,t){return class extends ie{constructor(r){super(),se(this,r,null,i=>Cp(i,e,t),re,{},void 0)}}}function $p(e,t){return gs((r,i,o,l)=>`${nu(e,"TableComponent").$$render(r,t,{},{})}`)}const gi=typeof window>"u"?$p:kp;function Rp(e){return typeof e=="object"&&typeof e.$$render=="function"&&typeof e.render=="function"}function Ap(e){var t,n;let r="__SVELTE_HMR"in window;return e.prototype instanceof ie||r&&((t=e.name)==null?void 0:t.startsWith("Proxy<"))&&((n=e.name)==null?void 0:n.endsWith(">"))}function Pl(e){return typeof document>"u"?Rp(e):Ap(e)}function xl(e){return gi(Sp,{content:e})}function dr(e,t){if(!e)return null;if(Pl(e))return gi(e,t);if(typeof e=="function"){const n=e(t);return n==null?null:Pl(n)?gi(n,t):xl(n)}return xl(e)}function Tl(e){let t;"subscribe"in e?t=e:t=Ur(e);let n={state:{},onStateChange:()=>{},renderFallbackValue:null,...Aa(t)},r=dp(n),i=ke(r.initialState),o=ou([i,t],a=>a);return Ur(r,function(s){const u=o.subscribe(c=>{let[f,d]=c;r.setOptions(g=>({...g,...d,state:{...f,...d.state},onStateChange:p=>{p instanceof Function?i.update(p):i.set(p),n.onStateChange==null||n.onStateChange(p)}})),s(r)});return function(){u()}})}/** - * match-sorter-utils - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */const Ca={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},Ep=Object.keys(Ca).join("|"),Mp=new RegExp(Ep,"g");function Fp(e){return e.replace(Mp,t=>Ca[t])}/** - * @name match-sorter - * @license MIT license. - * @copyright (c) 2099 Kent C. Dodds - * @author Kent C. Dodds (https://kentcdodds.com) - */const Pe={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Dp(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Pe.MATCHES,!n.accessors){const l=Ol(e,t,n);return{rankedValue:e,rank:l,accessorIndex:-1,accessorThreshold:n.threshold,passed:l>=n.threshold}}const i=xp(e,n.accessors),o={rankedValue:e,rank:Pe.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let l=0;l=Pe.MATCHES?s=u:s>c&&(s=c),s=Math.min(s,c),s>=f&&s>o.rank&&(o.rank=s,o.passed=!0,o.accessorIndex=l,o.accessorThreshold=f,o.rankedValue=a.itemValue)}return o}function Ol(e,t,n){return e=Vl(e,n),t=Vl(t,n),t.length>e.length?Pe.NO_MATCH:e===t?Pe.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Pe.EQUAL:e.startsWith(t)?Pe.STARTS_WITH:e.includes(` ${t}`)?Pe.WORD_STARTS_WITH:e.includes(t)?Pe.CONTAINS:t.length===1?Pe.NO_MATCH:Ip(e).includes(t)?Pe.ACRONYM:Np(e,t))}function Ip(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(o=>{t+=o.substr(0,1)})}),t}function Np(e,t){let n=0,r=0;function i(s,u,c){for(let f=c,d=u.length;f-1))return Pe.NO_MATCH}const a=r-l;return o(a)}function Vl(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=Fp(e)),e}function Pp(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function xp(e,t){const n=[];for(let r=0,i=t.length;r{J(p,1)}),ce()}c?(n=mt(c,f()),Z(n.$$.fragment),N(n.$$.fragment,1),K(n,t,r)):n=null}},i(d){a||(n&&N(n.$$.fragment,d),a=!0)},o(d){n&&V(n.$$.fragment,d),a=!1},d(d){d&&x(t),n&&J(n),s=!1,u()}}}function jl(e){let t,n,r=!e[26].isPlaceholder&&Op(e);return{c(){t=R("th"),r&&r.c(),h(t,"colspan",e[26].colSpan),h(t,"class","svelte-16fb3tv")},m(i,o){T(i,t,o),r&&r.m(t,null),n=!0},p(i,o){i[26].isPlaceholder||r.p(i,o)},i(i){n||(N(r),n=!0)},o(i){V(r),n=!1},d(i){i&&x(t),r&&r.d()}}}function Bl(e){let t,n,r,i=e[23].headers,o=[];for(let a=0;aV(o[a],1,1,()=>{o[a]=null});return{c(){t=R("tr");for(let a=0;a{J(u,1)}),ce()}o?(r=mt(o,l()),Z(r.$$.fragment),N(r.$$.fragment,1),K(r,n,null)):r=null}},i(a){i||(r&&N(r.$$.fragment,a),i=!0)},o(a){r&&V(r.$$.fragment,a),i=!1},d(a){a&&x(n),r&&J(r)}}}function Wl(e){let t,n=[],r=new Map,i,o,l=e[17].getVisibleCells();const a=s=>s[20].id;for(let s=0;s",Me,ye,ae,ze,kn,vt=e[5],he=[];for(let W=0;WV(he[W],1,1,()=>{he[W]=null});let bt=e[1].getRowModel().rows,pe=[];for(let W=0;WV(pe[W],1,1,()=>{pe[W]=null});return{c(){t=R("div"),n=R("input"),r=D(),i=R("div"),o=R("table"),l=R("thead");for(let W=0;W(o(),o=gr(b,$=>n(1,i=$)),b);ee(e,cr,$=>n(8,r=$)),e.$$.on_destroy.push(()=>o());const a=($,E,S,k)=>{if(console.log("yessir"),Array.isArray(S))return S.length===0?!0:S.includes($.getValue(E));typeof S=="number"&&(S=String(S));const y=Dp($.getValue(E),S);return k({itemRank:y}),y.passed},s=hp(),u=[s.accessor("file",{header:"File",cell:$=>$.getValue(),footer:$=>$.column.id}),s.accessor("size",{header:"Size",cell:$=>Kr($.getValue()),footer:$=>$.column.id}),s.accessor("type",{header:"Type",cell:$=>$.getValue(),footer:$=>$.column.id})];let c="",f=ke({data:r,columns:u,getCoreRowModel:Ml(),getSortedRowModel:Il(),getFilteredRowModel:Fl(),globalFilterFn:a,getFacetedRowModel:Dl(),getPaginationRowModel:Nl(),state:{globalFilter:c,pagination:{pageSize:7,pageIndex:0}},enableGlobalFilter:!0});function d($){n(6,c=$),f.update(E=>({...E,state:{...E.state,globalFilter:$}}))}function g($){f.update(E=>{var S;return{...E,state:{...E.state,pagination:{...(S=E.state)==null?void 0:S.pagination,pageIndex:$}}}})}let p;function m($){clearTimeout(p),p=setTimeout(()=>{const E=$.target;d(E.value)},100)}function _($){const E=$.target;g(parseInt(E.value)-1)}let b=Tl(f);l();let w=i.getHeaderGroups();const C=()=>g(i.getState().pagination.pageIndex-1),A=()=>g(i.getState().pagination.pageIndex+1);return e.$$.update=()=>{e.$$.dirty&448&&(n(7,f={data:r,columns:u,getCoreRowModel:Ml(),getSortedRowModel:Il(),getFilteredRowModel:Fl(),globalFilterFn:a,getFacetedRowModel:Dl(),getPaginationRowModel:Nl(),state:{globalFilter:c,pagination:{pageSize:7,pageIndex:0}},enableGlobalFilter:!0}),l(n(0,b=Tl(ke(f)))))},[b,i,g,m,_,w,c,f,r,C,A]}class Lp extends ie{constructor(t){super(),se(this,t,Hp,Vp,re,{})}}function Xl(e){let t,n;return{c(){t=R("p"),n=z(e[3])},m(r,i){T(r,t,i),v(t,n)},p(r,i){i&8&&Q(n,r[3])},d(r){r&&x(t)}}}function Yl(e){let t;return{c(){t=R("p"),t.textContent="Data Successfully indexed!"},m(n,r){T(n,t,r)},d(n){n&&x(t)}}}function Ql(e){let t,n;return t=new Lp({}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function qp(e){let t,n,r,i,o,l,a,s,u,c,f,d,g,p,m,_,b,w,C,A,$,E,S,k=e[2]&&!e[1]&&Xl(e),y=e[1]&&Yl();C=new Ph({});let M=e[0]&&Ql();return{c(){t=R("div"),n=R("div"),r=R("div"),i=R("div"),o=R("h4"),o.textContent="Upload Data",l=D(),a=R("br"),s=D(),u=R("form"),c=R("input"),f=D(),k&&k.c(),d=D(),y&&y.c(),g=D(),p=R("p"),p.textContent="These are the files your model will use as context.",m=D(),_=R("p"),_.innerHTML="Currently pdf, txt, and md are supported.",b=D(),w=R("div"),Z(C.$$.fragment),A=D(),M&&M.c(),h(c,"type","file"),c.multiple=!0,h(i,"class","upload-box svelte-1lu6hos"),h(r,"class","upload-container svelte-1lu6hos"),h(n,"class","file-container svelte-1lu6hos"),h(w,"class","charts-container svelte-1lu6hos"),h(t,"class","data-grid svelte-1lu6hos")},m(I,F){T(I,t,F),v(t,n),v(n,r),v(r,i),v(i,o),v(i,l),v(i,a),v(i,s),v(i,u),v(u,c),v(i,f),k&&k.m(i,null),v(i,d),y&&y.m(i,null),v(i,g),v(i,p),v(i,m),v(i,_),v(t,b),v(t,w),K(C,w,null),v(w,A),M&&M.m(w,null),$=!0,E||(S=j(c,"change",e[4]),E=!0)},p(I,[F]){I[2]&&!I[1]?k?k.p(I,F):(k=Xl(I),k.c(),k.m(i,d)):k&&(k.d(1),k=null),I[1]?y||(y=Yl(),y.c(),y.m(i,g)):y&&(y.d(1),y=null),I[0]?M?F&1&&N(M,1):(M=Ql(),M.c(),N(M,1),M.m(w,null)):M&&(ue(),V(M,1,1,()=>{M=null}),ce())},i(I){$||(N(C.$$.fragment,I),N(M),$=!0)},o(I){V(C.$$.fragment,I),V(M),$=!1},d(I){I&&x(t),k&&k.d(),y&&y.d(),J(C),M&&M.d(),E=!1,S()}}}function Gp(e,t,n){let r,i,o;ee(e,Sl,p=>n(6,i=p)),ee(e,cr,p=>n(7,o=p));let l=[],a=!1,s=!1;async function u(p){n(0,l=p.target.files);const m=new FormData;for(let _=0;_({file:b.name,size:b.size,type:b.type}));Oe(cr,o=[..._],o)}async function f(){console.log("index!"),n(2,s=!0),await(await fetch("/retrieval/vector_db/index",{method:"POST"})).json(),n(1,a=!0),n(2,s=!1)}async function d(){console.log("getting embeddings...");const m=await(await fetch("/retrieval/vector_db/get")).json();console.log("embeddingData",m),Oe(Sl,i=m,i)}ut(()=>{c()});let g=0;return setInterval(()=>{n(5,g=(g+1)%4)},200),e.$$.update=()=>{e.$$.dirty&32&&n(3,r="Indexing"+".".repeat(g))},[l,a,s,r,u,g]}class jp extends ie{constructor(t){super(),se(this,t,Gp,qp,re,{})}}function Bp(e){let t,n,r,i,o,l,a,s,u,c,f,d,g,p,m,_,b,w,C,A,$,E,S,k,y,M,I;return o=new js({}),s=new Bs({}),f=new zs({}),p=new Ls({props:{feedback:"Bad"}}),b=new Gs({}),A=new qs({}),M=new Hs({}),{c(){t=R("div"),n=R("div"),r=R("div"),i=R("div"),Z(o.$$.fragment),l=D(),a=R("div"),Z(s.$$.fragment),u=D(),c=R("div"),Z(f.$$.fragment),d=D(),g=R("div"),Z(p.$$.fragment),m=D(),_=R("div"),Z(b.$$.fragment),w=D(),C=R("div"),Z(A.$$.fragment),$=D(),E=R("div"),S=R("div"),S.innerHTML=`
-
`,k=D(),y=R("div"),Z(M.$$.fragment),h(i,"class","card-1 svelte-14znspc"),h(a,"class","card-2"),h(r,"class","left-text svelte-14znspc"),h(c,"class","left-confidence svelte-14znspc"),h(g,"class","left-question svelte-14znspc"),h(_,"class","left-filter svelte-14znspc"),h(C,"class","left-filter2"),h(n,"class","feedback-left svelte-14znspc"),h(S,"class","right-chart svelte-14znspc"),h(y,"class","right-table svelte-14znspc"),h(E,"class","feedback-right svelte-14znspc"),h(t,"class","feedback-container svelte-14znspc")},m(F,P){T(F,t,P),v(t,n),v(n,r),v(r,i),K(o,i,null),v(r,l),v(r,a),K(s,a,null),v(n,u),v(n,c),K(f,c,null),v(n,d),v(n,g),K(p,g,null),v(n,m),v(n,_),K(b,_,null),v(n,w),v(n,C),K(A,C,null),v(t,$),v(t,E),v(E,S),v(E,k),v(E,y),K(M,y,null),I=!0},p:H,i(F){I||(N(o.$$.fragment,F),N(s.$$.fragment,F),N(f.$$.fragment,F),N(p.$$.fragment,F),N(b.$$.fragment,F),N(A.$$.fragment,F),N(M.$$.fragment,F),I=!0)},o(F){V(o.$$.fragment,F),V(s.$$.fragment,F),V(f.$$.fragment,F),V(p.$$.fragment,F),V(b.$$.fragment,F),V(A.$$.fragment,F),V(M.$$.fragment,F),I=!1},d(F){F&&x(t),J(o),J(s),J(f),J(p),J(b),J(A),J(M)}}}function Up(e,t,n){let r;ee(e,pn,o=>n(0,r=o)),ut(()=>{console.log("FEEDBACK on mount"),i()});async function i(){const s=(await(await fetch("/chat/rag_table/retrieve")).json()).rows.map(u=>({id:u[0],question:u[1],answer:u[2],vote_status:u[4]}));Oe(pn,r=[...s],r)}return[]}class Wp extends ie{constructor(t){super(),se(this,t,Up,Bp,re,{})}}function Xp(e){let t,n;return t=new Us({}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function Yp(e){let t,n;return t=new Wp({}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function Qp(e){let t,n;return t=new Us({}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function Kp(e){let t,n,r,i;const o=[Qp,Yp,Xp],l=[];function a(s,u){return s[0]==="vote"?0:s[0]==="rag"?1:2}return t=a(e),n=l[t]=o[t](e),{c(){n.c(),r=Ae()},m(s,u){l[t].m(s,u),T(s,r,u),i=!0},p(s,[u]){let c=t;t=a(s),t!==c&&(ue(),V(l[c],1,1,()=>{l[c]=null}),ce(),n=l[t],n||(n=l[t]=o[t](s),n.c()),N(n,1),n.m(r.parentNode,r))},i(s){i||(N(n),i=!0)},o(s){V(n),i=!1},d(s){l[t].d(s),s&&x(r)}}}function Jp(e,t,n){let{feedback:r}=t;return e.$$set=i=>{"feedback"in i&&n(0,r=i.feedback)},[r]}class Zp extends ie{constructor(t){super(),se(this,t,Jp,Kp,re,{feedback:0})}}function Kl(e,t,n){const r=e.slice();return r[7]=t[n],r}function Jl(e){let t,n=e[0],r=[];for(let i=0;i{J(c,1)}),ce()}o?(t=mt(o,l()),Z(t.$$.fragment),N(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}else o&&t.$set(u)},i(a){r||(t&&N(t.$$.fragment,a),r=!0)},o(a){t&&V(t.$$.fragment,a),r=!1},d(a){a&&x(n),t&&J(t,a)}}}function em(e){let t,n,r,i=e[0].length>1&&Jl(e),o=e[1]&&es(e);return{c(){i&&i.c(),t=D(),o&&o.c(),n=Ae()},m(l,a){i&&i.m(l,a),T(l,t,a),o&&o.m(l,a),T(l,n,a),r=!0},p(l,[a]){l[0].length>1?i?i.p(l,a):(i=Jl(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null),l[1]?o?(o.p(l,a),a&2&&N(o,1)):(o=es(l),o.c(),N(o,1),o.m(n.parentNode,n)):o&&(ue(),V(o,1,1,()=>{o=null}),ce())},i(l){r||(N(o),r=!0)},o(l){V(o),r=!1},d(l){i&&i.d(l),l&&x(t),o&&o.d(l),l&&x(n)}}}function tm(e,t,n){let r,i;const o=ke([]);ee(e,o,c=>n(0,r=c));const l=ke(null);ee(e,l,c=>n(1,i=c));const a={Chatbot:Pf,Dropdown:Of,Feedback:Zp,Compare:Kg,RetrievalQA:jp},s=c=>{l.set(c)};return fetch("/components").then(c=>{if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return c.json()}).then(c=>{o.set(c),l.set(c[0])}).catch(c=>{console.log("Fetch request failed",c)}),[r,i,o,l,a,s,c=>s(c)]}class nm extends ie{constructor(t){super(),se(this,t,tm,em,re,{})}}new nm({target:document.getElementById("app")}); diff --git a/pykoi/frontend/dist/index.html b/pykoi/frontend/dist/index.html index 6137fdc..b85ecc0 100644 --- a/pykoi/frontend/dist/index.html +++ b/pykoi/frontend/dist/index.html @@ -5,8 +5,8 @@ Vite + Svelte - - + +