diff --git a/src/vanna/flask/__init__.py b/src/vanna/flask/__init__.py index 5a3ff9a6..e359b570 100644 --- a/src/vanna/flask/__init__.py +++ b/src/vanna/flask/__init__.py @@ -585,13 +585,10 @@ def add_training_data(user: any): print("TRAINING ERROR", e) return jsonify({"type": "error", "error": str(e)}) - @self.flask_app.route("/api/v0/create_function", methods=["POST"]) + @self.flask_app.route("/api/v0/create_function", methods=["GET"]) @self.requires_auth - def create_function(user: any): - question = flask.request.json.get("question") - sql = flask.request.json.get("sql") - id = flask.request.json.get("id") - + @self.requires_cache(["question", "sql"]) + def create_function(user: any, id: str, question: str, sql: str): plotly_code = self.cache.get(id=id, field="plotly_code") if plotly_code is None: diff --git a/src/vanna/flask/assets.py b/src/vanna/flask/assets.py index 81cbefab..6a306d00 100644 --- a/src/vanna/flask/assets.py +++ b/src/vanna/flask/assets.py @@ -7,7 +7,7 @@ Vanna.AI - + @@ -20,7 +20,7 @@ css_content = '''.nav-title{font-family:Roboto Slab,serif}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-px{left:1px;right:1px}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-px{bottom:1px}.end-0{inset-inline-end:0px}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-50{z-index:50}.z-\\[60\\]{z-index:60}.z-\\[80\\]{z-index:80}.-m-1{margin:-.25rem}.-m-1\\.5{margin:-.375rem}.m-1{margin:.25rem}.m-3{margin:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-2\\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-auto{margin-bottom:auto}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-1{margin-right:.25rem}.mr-1\\.5{margin-right:.375rem}.mr-3{margin-right:.75rem}.ms-0{margin-inline-start:0px}.ms-3{margin-inline-start:.75rem}.mt-0{margin-top:0}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-2\\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-7{margin-top:1.75rem}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-52{height:13rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\\[2\\.375rem\\]{height:2.375rem}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.min-h-\\[15rem\\]{min-height:15rem}.min-h-\\[calc\\(100\\%-3\\.5rem\\)\\]{min-height:calc(100% - 3.5rem)}.w-0{width:0px}.w-1{width:.25rem}.w-1\\.5{width:.375rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-8{width:2rem}.w-\\[2\\.375rem\\]{width:2.375rem}.w-\\[3\\.25rem\\]{width:3.25rem}.w-full{width:100%}.w-px{width:1px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-7xl{max-width:80rem}.max-w-\\[50rem\\]{max-width:50rem}.max-w-\\[85rem\\]{max-width:85rem}.max-w-fit{max-width:-moz-fit-content;max-width:fit-content}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-disc{list-style-type:disc}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-4{row-gap:1rem}.-space-y-px>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(-1px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(-1px * var(--tw-space-y-reverse))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.whitespace-break-spaces{white-space:break-spaces}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-b-md{border-bottom-right-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.rounded-ee-xl{border-end-end-radius:.75rem}.rounded-es-xl{border-end-start-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-\\[3px\\]{border-width:3px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-s{border-inline-start-width:1px}.border-t{border-top-width:1px}.border-t-2{border-top-width:2px}.border-t-4{border-top-width:4px}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity))}.border-current{border-color:currentColor}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity))}.border-neutral-700{--tw-border-opacity: 1;border-color:rgb(64 64 64 / var(--tw-border-opacity))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.border-red-600{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity))}.border-teal-100{--tw-border-opacity: 1;border-color:rgb(204 251 241 / var(--tw-border-opacity))}.border-teal-500{--tw-border-opacity: 1;border-color:rgb(20 184 166 / var(--tw-border-opacity))}.border-teal-900{--tw-border-opacity: 1;border-color:rgb(19 78 74 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity))}.border-t-blue-500{--tw-border-opacity: 1;border-top-color:rgb(59 130 246 / var(--tw-border-opacity))}.border-t-blue-600{--tw-border-opacity: 1;border-top-color:rgb(37 99 235 / var(--tw-border-opacity))}.border-t-green-500{--tw-border-opacity: 1;border-top-color:rgb(34 197 94 / var(--tw-border-opacity))}.border-t-green-600{--tw-border-opacity: 1;border-top-color:rgb(22 163 74 / var(--tw-border-opacity))}.border-t-red-500{--tw-border-opacity: 1;border-top-color:rgb(239 68 68 / var(--tw-border-opacity))}.border-t-red-600{--tw-border-opacity: 1;border-top-color:rgb(220 38 38 / var(--tw-border-opacity))}.border-t-transparent{border-top-color:transparent}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.bg-neutral-800{--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity))}.bg-neutral-900{--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity))}.bg-teal-200{--tw-bg-opacity: 1;background-color:rgb(153 246 228 / var(--tw-bg-opacity))}.bg-teal-50{--tw-bg-opacity: 1;background-color:rgb(240 253 250 / var(--tw-bg-opacity))}.bg-teal-800{--tw-bg-opacity: 1;background-color:rgb(17 94 89 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-80{--tw-bg-opacity: .8}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-12{padding-bottom:3rem}.pe-11{padding-inline-end:2.75rem}.pe-3{padding-inline-end:.75rem}.pl-3{padding-left:.75rem}.pl-7{padding-left:1.75rem}.pr-10{padding-right:2.5rem}.pr-4{padding-right:1rem}.pr-9{padding-right:2.25rem}.ps-5{padding-inline-start:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-start{text-align:start}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-7xl{font-size:4.5rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.tracking-wide{letter-spacing:.025em}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-neutral-200{--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity))}.text-neutral-300{--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity))}.text-neutral-400{--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity))}.text-neutral-500{--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.text-teal-400{--tw-text-opacity: 1;color:rgb(45 212 191 / var(--tw-text-opacity))}.text-teal-800{--tw-text-opacity: 1;color:rgb(17 94 89 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity))}.decoration-2{text-decoration-thickness:2px}.opacity-0{opacity:0}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-neutral-700{--tw-shadow-color: #404040;--tw-shadow: var(--tw-shadow-colored)}.shadow-slate-700{--tw-shadow-color: #334155;--tw-shadow: var(--tw-shadow-colored)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-transparent{--tw-ring-color: transparent}.ring-offset-white{--tw-ring-offset-color: #fff}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.\\[--body-scroll\\:true\\]{--body-scroll: true}.marker\\:text-blue-600 *::marker{color:#2563eb}.marker\\:text-blue-600::marker{color:#2563eb}.before\\:inline-block:before{content:var(--tw-content);display:inline-block}.before\\:h-6:before{content:var(--tw-content);height:1.5rem}.before\\:w-6:before{content:var(--tw-content);width:1.5rem}.before\\:translate-x-0:before{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.before\\:transform:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.before\\:rounded-full:before{content:var(--tw-content);border-radius:9999px}.before\\:bg-white:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.before\\:shadow:before{content:var(--tw-content);--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.before\\:ring-0:before{content:var(--tw-content);--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.before\\:transition:before{content:var(--tw-content);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.before\\:duration-200:before{content:var(--tw-content);transition-duration:.2s}.before\\:ease-in-out:before{content:var(--tw-content);transition-timing-function:cubic-bezier(.4,0,.2,1)}.first\\:mt-0:first-child{margin-top:0}.first\\:rounded-t-lg:first-child{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.last\\:rounded-b-lg:last-child{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.checked\\:bg-blue-600:checked{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.checked\\:bg-none:checked{background-image:none}.checked\\:before\\:translate-x-full:checked:before{content:var(--tw-content);--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.checked\\:before\\:bg-blue-200:checked:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity))}.hover\\:border-blue-500:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.hover\\:border-green-500:hover{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity))}.hover\\:border-red-400:hover{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity))}.hover\\:border-red-500:hover{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.hover\\:bg-blue-50:hover{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity))}.hover\\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.hover\\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\\:bg-green-500:hover{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity))}.hover\\:bg-red-500:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.hover\\:text-blue-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.hover\\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}.hover\\:text-blue-800:hover{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity))}.hover\\:text-gray-400:hover{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.hover\\:text-green-800:hover{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity))}.hover\\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity))}.hover\\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.hover\\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.focus\\:z-10:focus{z-index:10}.focus\\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.focus\\:border-blue-600:focus{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity))}.focus\\:border-indigo-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity))}.focus\\:ring-blue-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(37 99 235 / var(--tw-ring-opacity))}.focus\\:ring-gray-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus\\:ring-green-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(187 247 208 / var(--tw-ring-opacity))}.focus\\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity))}.focus\\:ring-red-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(254 202 202 / var(--tw-ring-opacity))}.focus\\:ring-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus\\:ring-offset-white:focus{--tw-ring-offset-color: #fff}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-50:disabled{opacity:.5}[data-hs-tab].active.hs-tab-active\\:border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity))}[data-hs-tab].active.hs-tab-active\\:font-semibold{font-weight:600}[data-hs-tab].active.hs-tab-active\\:text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}[data-hs-tab].active .hs-tab-active\\:border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity))}[data-hs-tab].active .hs-tab-active\\:font-semibold{font-weight:600}[data-hs-tab].active .hs-tab-active\\:text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}.open.hs-overlay-open\\:mt-7{margin-top:1.75rem}.open.hs-overlay-open\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.open.hs-overlay-open\\:opacity-100{opacity:1}.open.hs-overlay-open\\:duration-500{transition-duration:.5s}.open .hs-overlay-open\\:mt-7{margin-top:1.75rem}.open .hs-overlay-open\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.open .hs-overlay-open\\:opacity-100{opacity:1}.open .hs-overlay-open\\:duration-500{transition-duration:.5s}@media (prefers-color-scheme: dark){.dark\\:divide-gray-700>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity))}.dark\\:border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.dark\\:border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.dark\\:border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.dark\\:border-neutral-700{--tw-border-opacity: 1;border-color:rgb(64 64 64 / var(--tw-border-opacity))}.dark\\:border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.dark\\:border-teal-900{--tw-border-opacity: 1;border-color:rgb(19 78 74 / var(--tw-border-opacity))}.dark\\:border-t-blue-500{--tw-border-opacity: 1;border-top-color:rgb(59 130 246 / var(--tw-border-opacity))}.dark\\:border-t-green-500{--tw-border-opacity: 1;border-top-color:rgb(34 197 94 / var(--tw-border-opacity))}.dark\\:border-t-red-500{--tw-border-opacity: 1;border-top-color:rgb(239 68 68 / var(--tw-border-opacity))}.dark\\:bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\\:bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\\:bg-neutral-800{--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity))}.dark\\:bg-neutral-900{--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity))}.dark\\:bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}.dark\\:bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity))}.dark\\:bg-teal-800{--tw-bg-opacity: 1;background-color:rgb(17 94 89 / var(--tw-bg-opacity))}.dark\\:bg-teal-800\\/30{background-color:#115e594d}.dark\\:bg-opacity-80{--tw-bg-opacity: .8}.dark\\:text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.dark\\:text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.dark\\:text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.dark\\:text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.dark\\:text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.dark\\:text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.dark\\:text-neutral-200{--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity))}.dark\\:text-neutral-400{--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity))}.dark\\:text-neutral-500{--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity))}.dark\\:text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.dark\\:text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.dark\\:text-teal-400{--tw-text-opacity: 1;color:rgb(45 212 191 / var(--tw-text-opacity))}.dark\\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\\:placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}.dark\\:placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}.dark\\:placeholder-neutral-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(115 115 115 / var(--tw-placeholder-opacity))}.dark\\:placeholder-neutral-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(115 115 115 / var(--tw-placeholder-opacity))}.dark\\:shadow-neutral-700\\/70{--tw-shadow-color: rgb(64 64 64 / .7);--tw-shadow: var(--tw-shadow-colored)}.dark\\:shadow-slate-700\\/\\[\\.7\\]{--tw-shadow-color: rgb(51 65 85 / .7);--tw-shadow: var(--tw-shadow-colored)}.dark\\:before\\:bg-gray-400:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.dark\\:checked\\:border-blue-500:checked{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.dark\\:checked\\:bg-blue-500:checked{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.dark\\:checked\\:bg-blue-600:checked{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.dark\\:checked\\:before\\:bg-blue-200:checked:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity))}.dark\\:hover\\:border-blue-400:hover{--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity))}.dark\\:hover\\:border-red-400:hover{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity))}.dark\\:hover\\:bg-gray-900:hover{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.dark\\:hover\\:bg-neutral-700:hover{--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity))}.dark\\:hover\\:bg-slate-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}.dark\\:hover\\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.dark\\:hover\\:text-blue-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.dark\\:hover\\:text-green-400:hover{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity))}.dark\\:hover\\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity))}.dark\\:hover\\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.dark\\:hover\\:text-slate-300:hover{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}.dark\\:hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\\:focus\\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.dark\\:focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.dark\\:focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.dark\\:focus\\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity))}.dark\\:focus\\:ring-gray-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}.dark\\:focus\\:ring-gray-700:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity))}.dark\\:focus\\:ring-neutral-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(82 82 82 / var(--tw-ring-opacity))}.dark\\:focus\\:ring-red-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity))}.dark\\:focus\\:ring-offset-gray-800:focus{--tw-ring-offset-color: #1f2937}}@media (min-width: 640px){.sm\\:mx-auto{margin-left:auto;margin-right:auto}.sm\\:mb-3{margin-bottom:.75rem}.sm\\:mt-10{margin-top:2.5rem}.sm\\:w-auto{width:auto}.sm\\:w-full{width:100%}.sm\\:max-w-lg{max-width:32rem}.sm\\:flex-row{flex-direction:row}.sm\\:gap-3{gap:.75rem}.sm\\:gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.sm\\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\\:p-4{padding:1rem}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.sm\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\\:text-9xl{font-size:8rem;line-height:1}.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\\:flex{display:flex}.md\\:items-center{align-items:center}.md\\:justify-between{justify-content:space-between}.md\\:p-10{padding:2.5rem}.md\\:p-5{padding:1.25rem}}@media (min-width: 1024px){.lg\\:bottom-0{bottom:0}.lg\\:right-auto{right:auto}.lg\\:block{display:block}.lg\\:hidden{display:none}.lg\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:px-8{padding-left:2rem;padding-right:2rem}.lg\\:py-14{padding-top:3.5rem;padding-bottom:3.5rem}.lg\\:pl-64{padding-left:16rem}} ''' -js_content = '''var tn=Object.defineProperty;var Tn=(E,e,T)=>e in E?tn(E,e,{enumerable:!0,configurable:!0,writable:!0,value:T}):E[e]=T;var Wt=(E,e,T)=>(Tn(E,typeof e!="symbol"?e+"":e,T),T);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))t(r);new MutationObserver(r=>{for(const R of r)if(R.type==="childList")for(const A of R.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&t(A)}).observe(document,{childList:!0,subtree:!0});function T(r){const R={};return r.integrity&&(R.integrity=r.integrity),r.referrerPolicy&&(R.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?R.credentials="include":r.crossOrigin==="anonymous"?R.credentials="omit":R.credentials="same-origin",R}function t(r){if(r.ep)return;r.ep=!0;const R=T(r);fetch(r.href,R)}})();function Z(){}function rn(E,e){for(const T in e)E[T]=e[T];return E}function CR(E){return E()}function FT(){return Object.create(null)}function iE(E){E.forEach(CR)}function ZE(E){return typeof E=="function"}function Ne(E,e){return E!=E?e==e:E!==e||E&&typeof E=="object"||typeof E=="function"}let Lt;function YT(E,e){return E===e?!0:(Lt||(Lt=document.createElement("a")),Lt.href=e,E===Lt.href)}function Rn(E){return Object.keys(E).length===0}function uR(E,...e){if(E==null){for(const t of e)t(void 0);return Z}const T=E.subscribe(...e);return T.unsubscribe?()=>T.unsubscribe():T}function cE(E){let e;return uR(E,T=>e=T)(),e}function RE(E,e,T){E.$$.on_destroy.push(uR(e,T))}function pt(E,e,T,t){if(E){const r=cR(E,e,T,t);return E[0](r)}}function cR(E,e,T,t){return E[1]&&t?rn(T.ctx.slice(),E[1](t(e))):T.ctx}function Mt(E,e,T,t){if(E[2]&&t){const r=E[2](t(T));if(e.dirty===void 0)return r;if(typeof r=="object"){const R=[],A=Math.max(e.dirty.length,r.length);for(let s=0;s32){const e=[],T=E.ctx.length/32;for(let t=0;tE.removeEventListener(e,T,t)}function i(E,e,T){T==null?E.removeAttribute(e):E.getAttribute(e)!==T&&E.setAttribute(e,T)}function nn(E){let e;return{p(...T){e=T,e.forEach(t=>E.push(t))},r(){e.forEach(T=>E.splice(E.indexOf(T),1))}}}function An(E){return Array.from(E.childNodes)}function Pe(E,e){e=""+e,E.data!==e&&(E.data=e)}function Ye(E,e){E.value=e??""}function Ct(E,e,T,t){T==null?E.style.removeProperty(e):E.style.setProperty(e,T,t?"important":"")}function VT(E,e,T){for(let t=0;tE.indexOf(t)===-1?e.push(t):T.push(t)),T.forEach(t=>t()),jE=e}const ut=new Set;let BE;function Ge(){BE={r:0,c:[],p:BE}}function ge(){BE.r||iE(BE.c),BE=BE.p}function G(E,e){E&&E.i&&(ut.delete(E),E.i(e))}function B(E,e,T,t){if(E&&E.o){if(ut.has(E))return;ut.add(E),BE.c.push(()=>{ut.delete(E),t&&(T&&E.d(1),t())}),E.o(e)}else t&&t()}function ce(E){return(E==null?void 0:E.length)!==void 0?E:Array.from(E)}function ln(E,e){E.d(1),e.delete(E.key)}function _n(E,e,T,t,r,R,A,s,o,n,S,O){let N=E.length,u=R.length,D=N;const d={};for(;D--;)d[E[D].key]=D;const C=[],_=new Map,L=new Map,c=[];for(D=u;D--;){const a=O(r,R,D),I=T(a);let f=A.get(I);f?t&&c.push(()=>f.p(a,e)):(f=n(I,a),f.c()),_.set(I,C[D]=f),I in d&&L.set(I,Math.abs(D-d[I]))}const H=new Set,y=new Set;function h(a){G(a,1),a.m(s,S),A.set(a.key,a),S=a.first,u--}for(;N&&u;){const a=C[u-1],I=E[N-1],f=a.key,m=I.key;a===I?(S=a.first,N--,u--):_.has(m)?!A.has(f)||H.has(f)?h(a):y.has(m)?N--:L.get(f)>L.get(m)?(y.add(f),h(a)):(H.add(m),N--):(o(I,A),N--)}for(;N--;){const a=E[N];_.has(a.key)||o(a,A)}for(;u;)h(C[u-1]);return iE(c),C}function Ln(E,e,T){const t=E.$$.props[e];t!==void 0&&(E.$$.bound[t]=T,T(E.$$.ctx[t]))}function k(E){E&&E.c()}function $(E,e,T){const{fragment:t,after_update:r}=E.$$;t&&t.m(e,T),Pt(()=>{const R=E.$$.on_mount.map(CR).filter(ZE);E.$$.on_destroy?E.$$.on_destroy.push(...R):iE(R),E.$$.on_mount=[]}),r.forEach(Pt)}function X(E,e){const T=E.$$;T.fragment!==null&&(Nn(T.after_update),iE(T.on_destroy),T.fragment&&T.fragment.d(e),T.on_destroy=T.fragment=null,T.ctx=[])}function Cn(E,e){E.$$.dirty[0]===-1&&(QE.push(E),On(),E.$$.dirty.fill(0)),E.$$.dirty[e/31|0]|=1<{const D=u.length?u[0]:N;return n.ctx&&r(n.ctx[O],n.ctx[O]=D)&&(!n.skip_bound&&n.bound[O]&&n.bound[O](D),S&&Cn(E,O)),N}):[],n.update(),S=!0,iE(n.before_update),n.fragment=t?t(n.ctx):!1,e.target){if(e.hydrate){const O=An(e.target);n.fragment&&n.fragment.l(O),O.forEach(Y)}else n.fragment&&n.fragment.c();e.intro&&G(E.$$.fragment),$(E,e.target,e.anchor),PR()}At(o)}class Le{constructor(){Wt(this,"$$");Wt(this,"$$set")}$destroy(){X(this,1),this.$destroy=Z}$on(e,T){if(!ZE(T))return Z;const t=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return t.push(T),()=>{const r=t.indexOf(T);r!==-1&&t.splice(r,1)}}$set(e){this.$$set&&!Rn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const un="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(un);const KE=[];function aE(E,e=Z){let T;const t=new Set;function r(s){if(Ne(E,s)&&(E=s,T)){const o=!KE.length;for(const n of t)n[1](),KE.push(n,E);if(o){for(let n=0;n{t.delete(n),t.size===0&&T&&(T(),T=null)}}return{set:r,update:R,subscribe:A}}let GE=aE(""),Et=aE([]),lT=aE(null),ht=aE(null),Gt=aE(!1),st=aE(!1),DE=aE("chat"),_T=aE([]),zE=aE(""),DR=aE(!1),FE=aE({debug:!0,logo:"",title:"Welcome to Vanna.AI",subtitle:"Loading...",show_training_data:!0,suggested_questions:!0,sql:!0,table:!0,csv_download:!0,chart:!0,redraw_chart:!0,auto_fix_sql:!0,ask_results_correct:!0,followup_questions:!0,summarization:!0,function_generation:!0}),gt=aE(null),dR=aE([]);function Ht(){Et.set([]),Gt.set(!1),st.set(!1)}async function LT(E){Ht();let e=cE(FE);Se({type:"user_question",question:E}),Gt.set(!0);const T=await fe("get_function","GET",{question:E});let t;if(e.function_generation&&T.type==="function")Se(T),t=T.id,GE.set(T.id),zE.set(T.function.instantiated_sql);else{const R=await fe("generate_sql","GET",{question:E});if(Se(R),R.type!=="sql")return;window.location.hash=R.id,GE.set(R.id),zE.set(R.text),t=R.id}const r=await fe("run_sql","GET",{id:t});if(Se(r),r.type==="df"){if(r.should_generate_chart){const R=await fe("generate_plotly_figure","GET",{id:r.id});if(Se(R),R.type!=="plotly_figure")return;_T.update(A=>[...A,{question:E,id:R.id}])}if(e.summarization){const R=await fe("generate_summary","GET",{id:t});Se(R)}Se({type:"feedback_question"}),Se({type:"feedback_buttons"})}}async function cn(E){let e=cE(FE);if(Se(E),E.type!=="sql")return;window.location.hash=E.id,GE.set(E.id),zE.set(E.text);const T=await fe("run_sql","GET",{id:E.id});if(Se(T),T.type!=="df")return;const t=await fe("generate_plotly_figure","GET",{id:T.id});if(Se(t),t.type==="plotly_figure"){if(e.summarization){const r=await fe("generate_summary","GET",{id:t.id});Se(r)}Se({type:"feedback_question"}),Se({type:"feedback_buttons"})}}function fn(E){Se({type:"user_question",question:"Re-run the SQL"}),fe("run_sql","GET",{id:E}).then(Se).then(e=>{e.type==="df"&&fe("generate_plotly_figure","GET",{id:e.id}).then(Se).then(T=>{T.type==="plotly_figure"&&fe("generate_followup_questions","GET",{id:T.id}).then(Se)})})}function Pn(){fe("get_question_history","GET",[]).then(hn)}function Dn(){fe("get_config","GET",[]).then(mn)}function CT(){window.location.hash="functions",DE.set("functions"),fe("get_all_functions","GET",[]).then(Mn)}function pR(){window.location.hash="training-data",DE.set("training-data"),fe("get_training_data","GET",[]).then(Dt)}function uT(){window.location.hash="",DE.set("chat"),Ht(),cE(lT)===null&&fe("generate_questions","GET",[]).then(Un)}function dn(E){window.location.hash=E,DE.set("chat"),Ht(),Gt.set(!0),fe("load_question","GET",{id:E}).then(Se)}function pn(E){ht.set(null),fe("remove_training_data","POST",{id:E}).then(e=>{fe("get_training_data","GET",[]).then(Dt)})}function Se(E){return E.type==="not_logged_in"?(gt.set(E.html),DE.set("login"),E):(Et.update(e=>[...e,E]),gn(),E)}function Dt(E){return ht.set(E),E.type==="df"?JSON.parse(E.df).length===0&&DE.set("no-training-data"):E.type==="not_logged_in"&&(gt.set(E.html),DE.set("login")),E}function Mn(E){return E.type==="functions"&&dR.set(E.functions),E}function Un(E){return lT.set(E),E}function mn(E){return E.type==="config"?(FE.set(E.config),E.config.debug&&Wn()):E.type==="not_logged_in"&&(gt.set(E.html),DE.set("login")),E}function hn(E){return E.type==="question_history"&&_T.set(E.questions),E}function Gn(E,e){ht.set(null);let T={};T[e]=E,fe("train","POST",T).then(Dt).then(t=>{t.type!=="error"&&fe("get_training_data","GET",[]).then(Dt)})}async function fe(E,e,T){try{st.set(!0);let t="",r;if(e==="GET")t=Object.entries(T).filter(([A,s])=>A!=="endpoint"&&A!=="addMessage").map(([A,s])=>`${encodeURIComponent(A)}=${encodeURIComponent(s)}`).join("&"),r=await fetch(`/api/v0/${E}?${t}`);else{let A=JSON.stringify(T);r=await fetch(`/api/v0/${E}`,{method:"POST",headers:{"Content-Type":"application/json"},body:A})}if(!r.ok)throw new Error("The server returned an error. See the server logs for more details.");const R=await r.json();return st.set(!1),R}catch(t){return st.set(!1),{type:"error",error:String(t)}}}function gn(){setTimeout(()=>{window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},100)}function cT(){let E=cE(Et),e=E.find(T=>T.type==="user_question");if(e&&e.type==="user_question"){let T=E.findLast(t=>t.type==="sql");if(T&&T.type==="sql")return{question:e.question,sql:T.text}}return null}function Ot(E){Et.update(e=>e.filter(T=>T.type!==E))}function Hn(E){fe("fix_sql","POST",{id:cE(GE),error:E}).then(cn)}function bn(E){let T=cE(Et).find(t=>t.type==="user_question");T&&T.type==="user_question"&&(fe("update_sql","POST",{id:cE(GE),sql:E}).then(Se).then(t=>{t.type==="sql"&&(zE.set(t.text),fe("run_sql","GET",{id:t.id}).then(Se).then(r=>{r.type==="df"?JSON.parse(r.df).length>1?fe("generate_plotly_figure","GET",{id:r.id}).then(Se).then(A=>{Se({type:"feedback_question"}),Se({type:"feedback_buttons"})}):(Se({type:"feedback_question"}),Se({type:"feedback_buttons"})):(Se({type:"feedback_question"}),Se({type:"feedback_buttons"}))}))}),Ot("user_sql"))}function yn(){Se({type:"chart_modification"})}function Bn(){Ot("feedback_buttons"),Se({type:"feedback_correct"});let E=cT();if(E){let e={question:E.question,sql:E.sql,id:cE(GE)};fe("create_function","POST",e).then(Se)}else console.log("No Question-SQL Found")}function vn(E,e){fe("update_function","POST",{old_function_name:E,updated_function:e})}function Fn(E){fe("delete_function","POST",{function_name:E}).finally(()=>{CT()})}function Yn(){Ot("feedback_buttons"),Se({type:"feedback_correct"});let E=cT();E&&(fe("train","POST",E),fe("generate_followup_questions","GET",{id:cE(GE)}).then(Se))}function WT(){Ot("feedback_buttons"),Se({type:"feedback_incorrect"}),Se({type:"user_sql"})}function Vn(E){Ot("chart_modification"),Se({type:"user_question",question:"Update the chart with these instructions: "+E}),fe("generate_plotly_figure","GET",{id:cE(GE),chart_instructions:E}).then(Se)}function Wn(){var E=new WebSocket("ws://"+window.location.host+"/api/v0/log");E.onopen=function(){console.log("Connected to WebSocket server at /log.")},E.onmessage=function(e){console.log("Received message:",e.data);try{var T=JSON.parse(e.data)}catch(r){console.error("Error parsing JSON:",r);return}var t=document.getElementById("log-contents");t&&(t.innerHTML+="
"+T.title+" "+JSON.stringify(T.message)+"

")},E.onclose=function(e){console.log("WebSocket connection closed:",e)},E.onerror=function(e){console.error("WebSocket error:",e)}}function wT(E,e,T){const t=E.slice();return t[3]=e[T],t}function xT(E){let e,T,t,r;return{c(){e=P("li"),T=P("button"),T.innerHTML=` +js_content = '''var tn=Object.defineProperty;var Tn=(E,e,T)=>e in E?tn(E,e,{enumerable:!0,configurable:!0,writable:!0,value:T}):E[e]=T;var Wt=(E,e,T)=>(Tn(E,typeof e!="symbol"?e+"":e,T),T);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))t(r);new MutationObserver(r=>{for(const R of r)if(R.type==="childList")for(const A of R.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&t(A)}).observe(document,{childList:!0,subtree:!0});function T(r){const R={};return r.integrity&&(R.integrity=r.integrity),r.referrerPolicy&&(R.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?R.credentials="include":r.crossOrigin==="anonymous"?R.credentials="omit":R.credentials="same-origin",R}function t(r){if(r.ep)return;r.ep=!0;const R=T(r);fetch(r.href,R)}})();function Z(){}function rn(E,e){for(const T in e)E[T]=e[T];return E}function CR(E){return E()}function FT(){return Object.create(null)}function iE(E){E.forEach(CR)}function ZE(E){return typeof E=="function"}function Ne(E,e){return E!=E?e==e:E!==e||E&&typeof E=="object"||typeof E=="function"}let Lt;function YT(E,e){return E===e?!0:(Lt||(Lt=document.createElement("a")),Lt.href=e,E===Lt.href)}function Rn(E){return Object.keys(E).length===0}function uR(E,...e){if(E==null){for(const t of e)t(void 0);return Z}const T=E.subscribe(...e);return T.unsubscribe?()=>T.unsubscribe():T}function cE(E){let e;return uR(E,T=>e=T)(),e}function RE(E,e,T){E.$$.on_destroy.push(uR(e,T))}function pt(E,e,T,t){if(E){const r=cR(E,e,T,t);return E[0](r)}}function cR(E,e,T,t){return E[1]&&t?rn(T.ctx.slice(),E[1](t(e))):T.ctx}function Mt(E,e,T,t){if(E[2]&&t){const r=E[2](t(T));if(e.dirty===void 0)return r;if(typeof r=="object"){const R=[],A=Math.max(e.dirty.length,r.length);for(let s=0;s32){const e=[],T=E.ctx.length/32;for(let t=0;tE.removeEventListener(e,T,t)}function i(E,e,T){T==null?E.removeAttribute(e):E.getAttribute(e)!==T&&E.setAttribute(e,T)}function nn(E){let e;return{p(...T){e=T,e.forEach(t=>E.push(t))},r(){e.forEach(T=>E.splice(E.indexOf(T),1))}}}function An(E){return Array.from(E.childNodes)}function Pe(E,e){e=""+e,E.data!==e&&(E.data=e)}function Ye(E,e){E.value=e??""}function Ct(E,e,T,t){T==null?E.style.removeProperty(e):E.style.setProperty(e,T,t?"important":"")}function VT(E,e,T){for(let t=0;tE.indexOf(t)===-1?e.push(t):T.push(t)),T.forEach(t=>t()),jE=e}const ut=new Set;let BE;function Ge(){BE={r:0,c:[],p:BE}}function ge(){BE.r||iE(BE.c),BE=BE.p}function G(E,e){E&&E.i&&(ut.delete(E),E.i(e))}function B(E,e,T,t){if(E&&E.o){if(ut.has(E))return;ut.add(E),BE.c.push(()=>{ut.delete(E),t&&(T&&E.d(1),t())}),E.o(e)}else t&&t()}function ce(E){return(E==null?void 0:E.length)!==void 0?E:Array.from(E)}function ln(E,e){E.d(1),e.delete(E.key)}function _n(E,e,T,t,r,R,A,s,o,n,S,O){let N=E.length,u=R.length,D=N;const d={};for(;D--;)d[E[D].key]=D;const C=[],_=new Map,L=new Map,c=[];for(D=u;D--;){const a=O(r,R,D),I=T(a);let f=A.get(I);f?t&&c.push(()=>f.p(a,e)):(f=n(I,a),f.c()),_.set(I,C[D]=f),I in d&&L.set(I,Math.abs(D-d[I]))}const H=new Set,y=new Set;function h(a){G(a,1),a.m(s,S),A.set(a.key,a),S=a.first,u--}for(;N&&u;){const a=C[u-1],I=E[N-1],f=a.key,m=I.key;a===I?(S=a.first,N--,u--):_.has(m)?!A.has(f)||H.has(f)?h(a):y.has(m)?N--:L.get(f)>L.get(m)?(y.add(f),h(a)):(H.add(m),N--):(o(I,A),N--)}for(;N--;){const a=E[N];_.has(a.key)||o(a,A)}for(;u;)h(C[u-1]);return iE(c),C}function Ln(E,e,T){const t=E.$$.props[e];t!==void 0&&(E.$$.bound[t]=T,T(E.$$.ctx[t]))}function k(E){E&&E.c()}function $(E,e,T){const{fragment:t,after_update:r}=E.$$;t&&t.m(e,T),Pt(()=>{const R=E.$$.on_mount.map(CR).filter(ZE);E.$$.on_destroy?E.$$.on_destroy.push(...R):iE(R),E.$$.on_mount=[]}),r.forEach(Pt)}function X(E,e){const T=E.$$;T.fragment!==null&&(Nn(T.after_update),iE(T.on_destroy),T.fragment&&T.fragment.d(e),T.on_destroy=T.fragment=null,T.ctx=[])}function Cn(E,e){E.$$.dirty[0]===-1&&(QE.push(E),On(),E.$$.dirty.fill(0)),E.$$.dirty[e/31|0]|=1<{const D=u.length?u[0]:N;return n.ctx&&r(n.ctx[O],n.ctx[O]=D)&&(!n.skip_bound&&n.bound[O]&&n.bound[O](D),S&&Cn(E,O)),N}):[],n.update(),S=!0,iE(n.before_update),n.fragment=t?t(n.ctx):!1,e.target){if(e.hydrate){const O=An(e.target);n.fragment&&n.fragment.l(O),O.forEach(Y)}else n.fragment&&n.fragment.c();e.intro&&G(E.$$.fragment),$(E,e.target,e.anchor),PR()}At(o)}class Le{constructor(){Wt(this,"$$");Wt(this,"$$set")}$destroy(){X(this,1),this.$destroy=Z}$on(e,T){if(!ZE(T))return Z;const t=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return t.push(T),()=>{const r=t.indexOf(T);r!==-1&&t.splice(r,1)}}$set(e){this.$$set&&!Rn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const un="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(un);const KE=[];function aE(E,e=Z){let T;const t=new Set;function r(s){if(Ne(E,s)&&(E=s,T)){const o=!KE.length;for(const n of t)n[1](),KE.push(n,E);if(o){for(let n=0;n{t.delete(n),t.size===0&&T&&(T(),T=null)}}return{set:r,update:R,subscribe:A}}let GE=aE(""),Et=aE([]),lT=aE(null),ht=aE(null),Gt=aE(!1),st=aE(!1),DE=aE("chat"),_T=aE([]),zE=aE(""),DR=aE(!1),FE=aE({debug:!0,logo:"",title:"Welcome to Vanna.AI",subtitle:"Loading...",show_training_data:!0,suggested_questions:!0,sql:!0,table:!0,csv_download:!0,chart:!0,redraw_chart:!0,auto_fix_sql:!0,ask_results_correct:!0,followup_questions:!0,summarization:!0,function_generation:!0}),gt=aE(null),dR=aE([]);function Ht(){Et.set([]),Gt.set(!1),st.set(!1)}async function LT(E){Ht();let e=cE(FE);Se({type:"user_question",question:E}),Gt.set(!0);const T=await fe("get_function","GET",{question:E});let t;if(e.function_generation&&T.type==="function")Se(T),t=T.id,GE.set(T.id),zE.set(T.function.instantiated_sql);else{const R=await fe("generate_sql","GET",{question:E});if(Se(R),R.type!=="sql")return;window.location.hash=R.id,GE.set(R.id),zE.set(R.text),t=R.id}const r=await fe("run_sql","GET",{id:t});if(Se(r),r.type==="df"){if(r.should_generate_chart){const R=await fe("generate_plotly_figure","GET",{id:r.id});if(Se(R),R.type!=="plotly_figure")return;_T.update(A=>[...A,{question:E,id:R.id}])}if(e.summarization){const R=await fe("generate_summary","GET",{id:t});Se(R)}Se({type:"feedback_question"}),Se({type:"feedback_buttons"})}}async function cn(E){let e=cE(FE);if(Se(E),E.type!=="sql")return;window.location.hash=E.id,GE.set(E.id),zE.set(E.text);const T=await fe("run_sql","GET",{id:E.id});if(Se(T),T.type!=="df")return;const t=await fe("generate_plotly_figure","GET",{id:T.id});if(Se(t),t.type==="plotly_figure"){if(e.summarization){const r=await fe("generate_summary","GET",{id:t.id});Se(r)}Se({type:"feedback_question"}),Se({type:"feedback_buttons"})}}function fn(E){Se({type:"user_question",question:"Re-run the SQL"}),fe("run_sql","GET",{id:E}).then(Se).then(e=>{e.type==="df"&&fe("generate_plotly_figure","GET",{id:e.id}).then(Se).then(T=>{T.type==="plotly_figure"&&fe("generate_followup_questions","GET",{id:T.id}).then(Se)})})}function Pn(){fe("get_question_history","GET",[]).then(hn)}function Dn(){fe("get_config","GET",[]).then(mn)}function CT(){window.location.hash="functions",DE.set("functions"),fe("get_all_functions","GET",[]).then(Mn)}function pR(){window.location.hash="training-data",DE.set("training-data"),fe("get_training_data","GET",[]).then(Dt)}function uT(){window.location.hash="",DE.set("chat"),Ht(),cE(lT)===null&&fe("generate_questions","GET",[]).then(Un)}function dn(E){window.location.hash=E,DE.set("chat"),Ht(),Gt.set(!0),fe("load_question","GET",{id:E}).then(Se)}function pn(E){ht.set(null),fe("remove_training_data","POST",{id:E}).then(e=>{fe("get_training_data","GET",[]).then(Dt)})}function Se(E){return E.type==="not_logged_in"?(gt.set(E.html),DE.set("login"),E):(Et.update(e=>[...e,E]),gn(),E)}function Dt(E){return ht.set(E),E.type==="df"?JSON.parse(E.df).length===0&&DE.set("no-training-data"):E.type==="not_logged_in"&&(gt.set(E.html),DE.set("login")),E}function Mn(E){return E.type==="functions"&&dR.set(E.functions),E}function Un(E){return lT.set(E),E}function mn(E){return E.type==="config"?(FE.set(E.config),E.config.debug&&Wn()):E.type==="not_logged_in"&&(gt.set(E.html),DE.set("login")),E}function hn(E){return E.type==="question_history"&&_T.set(E.questions),E}function Gn(E,e){ht.set(null);let T={};T[e]=E,fe("train","POST",T).then(Dt).then(t=>{t.type!=="error"&&fe("get_training_data","GET",[]).then(Dt)})}async function fe(E,e,T){try{st.set(!0);let t="",r;if(e==="GET")t=Object.entries(T).filter(([A,s])=>A!=="endpoint"&&A!=="addMessage").map(([A,s])=>`${encodeURIComponent(A)}=${encodeURIComponent(s)}`).join("&"),r=await fetch(`/api/v0/${E}?${t}`);else{let A=JSON.stringify(T);r=await fetch(`/api/v0/${E}`,{method:"POST",headers:{"Content-Type":"application/json"},body:A})}if(!r.ok)throw new Error("The server returned an error. See the server logs for more details. If you are running in Colab, this function is probably not supported. Please try running in a local environment.");const R=await r.json();return st.set(!1),R}catch(t){return st.set(!1),{type:"error",error:String(t)}}}function gn(){setTimeout(()=>{window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},100)}function cT(){let E=cE(Et),e=E.find(T=>T.type==="user_question");if(e&&e.type==="user_question"){let T=E.findLast(t=>t.type==="sql");if(T&&T.type==="sql")return{question:e.question,sql:T.text}}return null}function Ot(E){Et.update(e=>e.filter(T=>T.type!==E))}function Hn(E){fe("fix_sql","POST",{id:cE(GE),error:E}).then(cn)}function bn(E){let T=cE(Et).find(t=>t.type==="user_question");T&&T.type==="user_question"&&(fe("update_sql","POST",{id:cE(GE),sql:E}).then(Se).then(t=>{t.type==="sql"&&(zE.set(t.text),fe("run_sql","GET",{id:t.id}).then(Se).then(r=>{r.type==="df"?JSON.parse(r.df).length>1?fe("generate_plotly_figure","GET",{id:r.id}).then(Se).then(A=>{Se({type:"feedback_question"}),Se({type:"feedback_buttons"})}):(Se({type:"feedback_question"}),Se({type:"feedback_buttons"})):(Se({type:"feedback_question"}),Se({type:"feedback_buttons"}))}))}),Ot("user_sql"))}function yn(){Se({type:"chart_modification"})}function Bn(){Ot("feedback_buttons"),Se({type:"feedback_correct"}),cT()?fe("create_function","GET",{id:cE(GE)}).then(Se):console.log("No Question-SQL Found")}function vn(E,e){fe("update_function","POST",{old_function_name:E,updated_function:e})}function Fn(E){fe("delete_function","POST",{function_name:E}).finally(()=>{CT()})}function Yn(){Ot("feedback_buttons"),Se({type:"feedback_correct"});let E=cT();E&&(fe("train","POST",E),fe("generate_followup_questions","GET",{id:cE(GE)}).then(Se))}function WT(){Ot("feedback_buttons"),Se({type:"feedback_incorrect"}),Se({type:"user_sql"})}function Vn(E){Ot("chart_modification"),Se({type:"user_question",question:"Update the chart with these instructions: "+E}),fe("generate_plotly_figure","GET",{id:cE(GE),chart_instructions:E}).then(Se)}function Wn(){var E=new WebSocket("ws://"+window.location.host+"/api/v0/log");E.onopen=function(){console.log("Connected to WebSocket server at /log.")},E.onmessage=function(e){console.log("Received message:",e.data);try{var T=JSON.parse(e.data)}catch(r){console.error("Error parsing JSON:",r);return}var t=document.getElementById("log-contents");t&&(t.innerHTML+="
"+T.title+" "+JSON.stringify(T.message)+"

")},E.onclose=function(e){console.log("WebSocket connection closed:",e)},E.onerror=function(e){console.error("WebSocket error:",e)}}function wT(E,e,T){const t=E.slice();return t[3]=e[T],t}function xT(E){let e,T,t,r;return{c(){e=P("li"),T=P("button"),T.innerHTML=` Functions`,i(T,"class","flex items-center gap-x-3 py-2 px-3 text-sm text-slate-700 rounded-md hover:bg-gray-100 dark:hover:bg-gray-900 dark:text-slate-400 dark:hover:text-slate-300 border border-gray-200 dark:border-gray-700 w-full")},m(R,A){W(R,e,A),l(e,T),t||(r=ae(T,"click",CT),t=!0)},d(R){R&&Y(e),t=!1,r()}}}function $T(E){let e,T,t,r;return{c(){e=P("li"),T=P("button"),T.innerHTML=` Training Data`,i(T,"class","flex items-center gap-x-3 py-2 px-3 text-sm text-slate-700 rounded-md hover:bg-gray-100 dark:hover:bg-gray-900 dark:text-slate-400 dark:hover:text-slate-300 border border-gray-200 dark:border-gray-700 w-full")},m(R,A){W(R,e,A),l(e,T),t||(r=ae(T,"click",pR),t=!0)},d(R){R&&Y(e),t=!1,r()}}}function XT(E){let e,T,t,r,R,A=E[3].question+"",s,o,n,S;function O(){return E[2](E[3])}return{c(){e=P("li"),T=P("button"),t=OE("svg"),r=OE("path"),R=x(),s=Re(A),o=x(),i(r,"stroke-linecap","round"),i(r,"stroke-linejoin","round"),i(r,"d","M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"),i(t,"class","w-3.5 h-3.5"),i(t,"fill","none"),i(t,"stroke","currentColor"),i(t,"stroke-width","1.5"),i(t,"viewBox","0 0 24 24"),i(t,"xmlns","http://www.w3.org/2000/svg"),i(t,"aria-hidden","true"),i(T,"class","flex items-center text-left gap-x-3 py-2 px-3 text-sm text-slate-700 rounded-md hover:bg-gray-100 dark:hover:bg-gray-900 dark:text-slate-400 dark:hover:text-slate-300")},m(N,u){W(N,e,u),l(e,T),l(T,t),l(t,r),l(T,R),l(T,s),l(e,o),n||(S=ae(T,"click",O),n=!0)},p(N,u){E=N,u&2&&A!==(A=E[3].question+"")&&Pe(s,A)},d(N){N&&Y(e),n=!1,S()}}}function wn(E){let e,T,t,r,R,A,s,o,n,S,O,N,u,D,d,C,_,L,c,H=E[0].function_generation&&xT(),y=E[0].show_training_data&&$T(),h=ce(E[1]),a=[];for(let I=0;I Sidebar',o=x(),n=P("div"),S=P("ul"),H&&H.c(),O=x(),y&&y.c(),N=x(),u=P("li"),D=P("button"),D.innerHTML=` New question`,d=x();for(let I=0;I